From d5abcb1f1a43eb9784042ef57a028a2fd1c7399f Mon Sep 17 00:00:00 2001
From: Saifeddine ALOUI
Date: Wed, 9 Apr 2025 11:37:32 +0200
Subject: [PATCH] enhanced
---
lollms_core | 2 +-
.../{index-Dfi7295q.js => index-B6RHGmC5.js} | 2 +-
.../{index-BS_Zh7d_.js => index-B7HvTpiE.js} | 2 +-
.../{index-BRwG2R_M.js => index-B8d2aokf.js} | 2 +-
.../{index-R9wnJ2Ib.js => index-BRaXjugP.js} | 2 +-
.../{index-DkMe9ry1.js => index-C8VjSzoF.js} | 30 +-
.../{index-CcMBvVgL.js => index-DfwZFr7z.js} | 2 +-
web/dist/assets/index-GwzEAnMx.css | 26 ++
.../{index-Bf9mONnw.js => index-WpvKL_jd.js} | 2 +-
web/dist/assets/index-jd0TJS39.css | 26 --
web/dist/index.html | 4 +-
.../MarkdownBundle/DynamicUIRenderer.vue | 257 +++++++++++++-----
12 files changed, 247 insertions(+), 110 deletions(-)
rename web/dist/assets/{index-Dfi7295q.js => index-B6RHGmC5.js} (99%)
rename web/dist/assets/{index-BS_Zh7d_.js => index-B7HvTpiE.js} (97%)
rename web/dist/assets/{index-BRwG2R_M.js => index-B8d2aokf.js} (99%)
rename web/dist/assets/{index-R9wnJ2Ib.js => index-BRaXjugP.js} (99%)
rename web/dist/assets/{index-DkMe9ry1.js => index-C8VjSzoF.js} (98%)
rename web/dist/assets/{index-CcMBvVgL.js => index-DfwZFr7z.js} (99%)
create mode 100644 web/dist/assets/index-GwzEAnMx.css
rename web/dist/assets/{index-Bf9mONnw.js => index-WpvKL_jd.js} (98%)
delete mode 100644 web/dist/assets/index-jd0TJS39.css
diff --git a/lollms_core b/lollms_core
index c940d0ab..7bbc43f8 160000
--- a/lollms_core
+++ b/lollms_core
@@ -1 +1 @@
-Subproject commit c940d0abf631dfcc8f00fcffe738758173b25cb1
+Subproject commit 7bbc43f8c380818a95e7e3e32c0023f2822c624a
diff --git a/web/dist/assets/index-Dfi7295q.js b/web/dist/assets/index-B6RHGmC5.js
similarity index 99%
rename from web/dist/assets/index-Dfi7295q.js
rename to web/dist/assets/index-B6RHGmC5.js
index ac9571e0..0f969f1b 100644
--- a/web/dist/assets/index-Dfi7295q.js
+++ b/web/dist/assets/index-B6RHGmC5.js
@@ -1,4 +1,4 @@
-import{L as s,E as R,a as Y,s as x,C as w,t as O,b as d,c as X,d as k,i as h,e as f,f as u,g as y,h as l,j as g,k as j,l as U,m as G,N as b,I as Z}from"./index-DkMe9ry1.js";const _=177,q=179,E=184,v=12,C=13,D=17,z=20,F=25,B=53,N=95,I=142,L=144,A=145,J=148,M=10,H=13,K=32,OO=9,$=47,QO=41,eO=125,aO=new R((Q,e)=>{for(let n=0,a=Q.next;(e.context&&(a<0||a==M||a==H||a==$&&Q.peek(n+1)==$)||a==QO||a==eO)&&Q.acceptToken(_),!(a!=K&&a!=OO);)a=Q.peek(++n)},{contextual:!0});let tO=new Set([N,E,z,v,D,L,A,I,J,C,B,F]);const iO=new w({start:!1,shift:(Q,e)=>e==q?Q:tO.has(e)}),XO=x({"func interface struct chan map const type var":O.definitionKeyword,"import package":O.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":O.controlKeyword,range:O.keyword,Bool:O.bool,String:O.string,Rune:O.character,Number:O.number,Nil:O.null,VariableName:O.variableName,DefName:O.definition(O.variableName),TypeName:O.typeName,LabelName:O.labelName,FieldName:O.propertyName,"FunctionDecl/DefName":O.function(O.definition(O.variableName)),"TypeSpec/DefName":O.definition(O.typeName),"CallExpr/VariableName":O.function(O.variableName),LineComment:O.lineComment,BlockComment:O.blockComment,LogicOp:O.logicOperator,ArithOp:O.arithmeticOperator,BitOp:O.bitwiseOperator,"DerefOp .":O.derefOperator,"UpdateOp IncDecOp":O.updateOperator,CompareOp:O.compareOperator,"= :=":O.definitionOperator,"<-":O.operator,'~ "*"':O.modifier,"; ,":O.separator,"... :":O.punctuation,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),nO={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},PO=s.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuOPQSO7+%hOOQP7+%h7+%hO4cQQO7+%hOOQP1G0Q1G0QO!>^QQO1G0QOOQP1G0U1G0UO!>fQQO1G0UOF|QQO1G0UOOQO,5nAN>nO4cQQOAN>nO!IsQSOAN>nOOQP<nQQO'#FrOOQO,5vAN>vO!LtQQOAN>vP.hQQO'#F|OOQPG25XG25XO!LyQQOG25bO!MOQQO'#FPOOQPG25bG25bO!MZQQOG25bOOQPLD)tLD)tOOQPG24bG24bO!JqQQOLD*|O!9OQQO'#GQO!McQQO,5;kOOQP,5;k,5;kO?tQQO'#FQO!MnQQO'#FQO!MsQQOLD*|OOQP!$'Nh!$'NhOOQO,5VO^!hOh!POr-TOw}O!P-_O!Q-`O!W-^O!]-eO%O!eO%Y!fO~OZ!sO~O^#uO~O!P$xO~On!lO#W%]aV%]a^%]ah%]ar%]aw%]a!P%]a!Q%]a!W%]a!]%]a#T%]a$w%]a%O%]a%Y%]au%]a~O]${O^#QO~OZ#RO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O]$|O!|,WO~PBROj!qOn%QO!QnOi%cP~P*aO!V%WO!|#`O~PBRO!V%YO~OV!}O[oO^YOaoOdoOh!POjcOr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO#Y!RO#^!SO#d!TO#j!UO#m!VO#v!WO#{!XO#}!YO$S!ZO$U![O$V![O$W!]O$Y!^O$[!_O%OQO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~Oi%dX#p%dX#q%dX~PDQOi%]O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-QO!WaO!]!QO!phO!qhO%O+{O%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^%aO%O%_O~O!QnO!a%cO~P*aO!QnOn$mX#T$mX#U$mXV$mX$w$mX!a$mX~P*aOn#TO#T%ea#U%eaV%ea$w%ea!a%ea~O]%fO~PF|OV#ga$w#ga~PDTO[%sO~OZ#rO[#qO]%vO%O#oO~O^!hOh!POn%zOr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO]%[P~O^&OOh!POr!jOw}O!P!OO!Q!kO!WaO!]!QO%Y!fO^%ZXj%ZX~O%O%}O~PKfOjcO^qa]qanqa!Vqa~O^#uO!W&SO~O^!hOh!POr-TOw}O{&WO!P-_O!Q-`O!W-^O!]-eO%O,xO%Y!fO~Oi&^O~PL{O^!hOh!POr!jOw}O!Q!kO!WaO!]!QO%O!eO%Y!fO~O!P#hO~PMwOi&eO%O,yO%Y!fO~O#T&gOV#ZX$w#ZX~P?tO]&kO%O#oO~O^!hOh!POr-TOw}O!P-_O!Q-`O!]-eO%O!eO%Y!fO~O!W&lO#T&mO~P! _O]&qO%O#oO~O#T&sOV#eX$w#eX~P?tO]&vO%O#oO~OjeX~P$XOjcO!|,XO~P2gOn!lO#W&yO#W%]X~O^#VOn#TO!Q#cO!W#SO!|,XO#R#dO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]OV`X#T%eX#U%eX~OZ&zOj$`O$w`X~P!#cOi'OO#p'PO#q'QO~OZ#ROjcO~P!#cO#T'TO#U#iO~O#W'UO~OV'WO!QnO~P*aOV'XO~OjcO~O!|#`OV#za$w#za~PBROi'[O#p']O#q'^O~On#TO!|#`OV%eX$w%eX!a%eX~PBRO!|#`OV$Za$w$Za~PBRO${$rO$|$rO$}'`O~O]${O~O%O!eO]%ZXn%ZX!V%ZX~PKfO!|#`Oi!_Xn!_X!a!`X~PBROi!_Xn!_X!a!`X~O!a'aO~On'bOi%cX~Oi'dO~On'eO!V%bX!a%bX~O!V'gO~O]'jOn'kO!|,YO~PBROn'nO!V'mO!a'oO!|#`O~PBRO!QnO!V'qO!a'rO~P*aO!|#`On$ma#T$ma#U$maV$ma$w$ma!a$ma~PBRO]'sOu'tO~O%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi!|!xi#R!xi#T!xi#U!xi$w!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~O!V!xii!xi!a!xi~P!+YO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi!V!xii!xi!a!xi~O!|!xi~P!-TO!|#`O~P!-TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%q!xi~O!|#`O!V!xii!xi!a!xi~P!/VO!|#`OV#Pi$w#Pi!a#Pi~PBRO]'uOn'wOu'vO~OZ#rO[#qO]'zO%O#oO~Ou'|O~P?tOn'}O]%[X~O](PO~OZeX^mX^!TXj!TX!W!TX~OjcOV$]i$w$]i~O%`(ZOV%^X$w%^Xn%^X!V%^X~Oi(`O~PL{O[(aO!W!tOVlX$wlX~On(bO~P?tO[(aOVlX$wlX~Oi(hO%O,yO%Y!fO~O!V(iO~O#T(kO~O](nO%O#oO~O[oO^YOaoOdoOh!POr!pOu-bOw}O!P!OO!QnO!V-UO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O+zO~P!4vO](sO%O#oO~O#T(tOV#ea$w#ea~O](xO%O#oO~O#k(yOV#ii$w#ii~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-PO!WaO!]!QO!phO!qhO%O+xO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^(|O%O%_O~O#p%dP#q%dP~P/uOi)PO#p'PO#q'QO~O!a)RO~O!QnO#y)VO~P*aOV)WO!|#`O~PBROj#wa~P;_OV)WO!QnO~P*aOi)]O#p']O#q'^O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O,eO~P!:lO!a)bO~Oj!qO!QnO~P*aOj!qO!QnOi%ca~P*aOn)iOi%ca~O!V%ba!a%ba~P?tOn)lO!V%ba!a%ba~O])nO~O])oO~O!V)pO~O!QnO!V)rO!a)sO~P*aO!V)rO!a)sO!|#`O~PBRO])uOn)vO~O])wOn)xO~O^!hOh!POr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO~O]%[a~P!>nOn)|O]%[a~O]${O]tXntX~OjcOV$^q$w$^q~On*PO{&WO~P?tOn*SO!V%rX~O!V*UO~OjcOV$]q$w$]q~O%`(ZOV|a$w|an|a!V|a~O[*]OVla$wla~O[*]O!W!tOVla$wla~On*PO{&WO!W*`O^%WXj%WX~P! _OjcO#j!UO~OjcO!|,XO~PBROZ*dO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O!|#`O~P!BoO#^*eO~P?tO!a*fO~Oj$`O!|,XO~P!BoO#W*hO~Oj#wi~P;_OV*kO!|#`O~PBROn#TO!Q#cO!|#`O!a$QX#T%eX~PBRO#T*lO~O#W*lO~O!a*mO~O!|#`Oi!_in!_i~PBRO!|#`Oi!bXn!bX!a!cX~PBROi!bXn!bX!a!cX~O!a*nO~Oj!qO!QnOi%ci~P*aO!V%bi!a%bi~P?tO!V*qO!a*rO!|#`O~PBRO!V*qO!|#`O~PBRO]*tO~O]*uO~O]*uOu*vO~O]%[i~P!>nO%O!eO!V%ra~On*|O!V%ra~O[+OOVli$wli~O%O+yO~P!4vO#k+QOV#iy$w#iy~O^+RO%O%_O~O]+SO~O!|,XOj#xq~PBROj#wq~P;_O!V+ZO!|#`O~PBRO]+[On+]O~O%O!eO!V%ri~O^#QOn'eO!V%bX~O#^+`O~P?tOj+aO~O^#VO!W#SO!|#`O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~OZ+cO~P!JvO!|#`O!a$Qi~PBRO!|#`Oi!bin!bi~PBRO!V+dO!|#`O~PBRO]+eO~O]+fO~Oi+iO#p+jO#q+kO~O^+lO%O%_O~Oi+pO#p+jO#q+kO~O!a+rO~O#^+sO~P?tO!a+tO~O]+uO~OZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXVeXneX!QeX#ReX#TeX#UeX$weX~O]eX]!TX!VeXieX!aeX~P!NUOjeX~P!NUOZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXn!TX!VeX~O]eX!V!TX~P#!gOh!TXr!TXw!TX{!TX!P!TX!Q!TX!]!TX%O!TX%Y!TX~P#!gOZeX^eX^!TXj!TXneX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeX~O]eXueX~P#$xO]$mXn$mXu$mX~PF|Oj$mXn$mX~P!7`On+|O]%eau%ea~On+}Oj%ea~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-OO!WaO!]!QO!phO!qhO%O+yO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~OZeX]!TX^UXhUXnUXn!TXrUXuUXwUX!PUX!QUX!WUX!W!TX!]UX%OUX%YUX~OnUX!QeX!aeX#TeX#WUX~P#$xOn+|O!|,YO]%eXu%eX~PBROn+}O!|,XOj%eX~PBRO^&OOV%ZXj%ZX$w%ZX]%ZXn%ZX!V%ZXu%ZX%`%ZX#T%ZX[%ZX!a%ZX~P?wO!|,YO]$man$mau$ma~PBRO!|,XOj$man$ma~PBRO%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~Oj!xi~P!+YOn!xiu!xi~P#,hO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%p!xi%q!xi~O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xij!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi~O!|!xi~P#/_On!xiu!xi~P#.TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi%p!xi%q!xi~O!|,WO~P#1^O!|,XO~P#/_O!|,YOn!xiu!xi~P#1^O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OZ!xi]!xi^!xi!W!xi%q!xi~O!|,WO~P#3QO!|,XOj!xi~P!/VO!|,YOn!xiu!xi~P#3QO!|,XOj#Pi~PBROV!TXZeX^mX!W!TX$w!TX~O%`!TX~P#5RO[!TXhmXnmXrmXwmX!PmX!QmX!WmX!]mX%OmX%YmX~P#5ROn#TO!Q,aO!|,XO#R#dOj`X#T%eX#U%eX~PBRO[oO^YOaoOdoOh!POr!pOw}O!P#hO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O!Q-OO%O+yO~P#6{O!Q-PO%O+xO~P#6{O!Q-QO%O+{O~P#6{O#T,bO#U,bO~O#W,cO~O^!hOh!POr-TOw}O!P-_O!Q-WO!W-^O!]-eO%O!eO%Y!fO~O^!hOh!POr-TOw}O!Q-`O!W-^O!]-eO%O!eO%Y!fO~O!P-VO~P#9zO%O+wO~P!4vO!P-XO~O!V-YO!|#`O~PBRO!V-ZO~O!V-[O~O!W-dO~OP%ka%Oa~",goto:"!FW%sPP%tP%wP%zP'SP'XPPPP'`'cP'u'uP)w'u-_PPP0j0m0qP1V4b1VP7s8WP1VP8a8d8hP8p8w1VPP1V8{<`?vPPCY-_-_-_PCdCuCxPC{DQ'u'uDV'uES'u'u'u'uGUIW'uPPJR'uJUMjMjMj'u! r! r!#SP!$`!%d!&d'cP'cPP'cP!&yP!'V!'^!&yP!'a!'h!'n!'w!&yP!'z!(R!&y!(U!(fPP!&yP!(x!)UPP!&y!)Y!)c!&yP!)g!)gP!&yP!&yP!)j!)m!&v!&yP!&yPPP!&yP!&yP!)q!)q!)w!)}!*U!*[!*d!*j!*p!*w!*}!+T!+Z!.q!.x!/O!/X!/m!/s!/z!0Q!0W!0^!0d!0jPPPPPPPPP!0p!1f!1k!1{!2kPP!7P!:^P!>u!?Z!?_!@Z!@fP!@p!D_!Df!Di!DuPPPPPPPPPPPP!FSR!aPRyO!WXOScw!R!T!U!W#O#k#n#u$R$X&O&j&u&|'W'Y']'})W)|*k*w+gQ#pzU#r{#s%uQ#x|U$T!S$U&pQ$^!VQ$y!lR)U'RVROS#nQ#t{T%t#s%uR#t{qrOScw!U!V!W#O#k#n&|'W'Y)W*k+g%PoOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%O]OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^#u!iW^!O!h!t!z#e#h#u#v#y#|#}$P$Q$T$W$v$x%W%Y%a%x%y&O&S&W&]&`&b&d&m'e'|'}(S([(c(i(o(|)l)|*P*Q*S*p*w*|+R+^+j+l,h-U-V-W-X-Y-Z-[-]-_-d'cbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR$O!PT&c#}&dW%`#R&z*d+cQ&Q#vS&V#y&]S&`#}&dR*Y(b'cZOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d%fWOSWYacmnw!O!U!V!W!X!Z!_!q!z#O#Q#S#T#V#^#_#`#a#b#c#h#i#j#k#n#v#|$f$v$x%W%Y%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(i(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S&b#}&d!{-]!h!t#e#u#y$P$Q$T$W%a%x%y&O&W&]&`&m'e'|'}(S([(c(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-dQ#v|S$v!j!pU&P#v$v,hZ,h#x&Q&U&V-TS%{#u&OV){'})|*wR#z}T&[#y&]]&X#y&](S([(o*QZ&Z#y&](S(o*QT([&Y(]'s_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d'r_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!w^'bbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&a#}&dR(d&bS!u]fX!x`&_(e(oQ!r[Q%O!qQ)d'aU)f'b)i*oR+X*nR%R!qR%P!qV)h'b)i*oV)g'b)i*odtOScw#O#k#n&|'Y+gQ$h!WQ&R#wQ&w$[S'S$c$iQ(V&TQ*O(RQ*V(WQ*b(yQ*c(zR+_+Q%PfOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%PgOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^!q#Weg!o!y$[$_$c$j$m$q$}%^%b%d%m'V'p(z({)S)Y)^)c)e)q)t*i*s+T+V+W+Y,f,g,i,j,w,z-aR#fh#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z[,V%^,f,i,p,s,v`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q!Y#^e!y$j$m$q$}%b%d%i%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aY,Q!o,k,n,q,tl,R$[$_$c(z)S*i,g,j,l,o,r,u,w,z_,S%^,f,i,m,p,s,v!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z],V%^,f,i,p,s,v!S#ae!y$j$m$q$}%b%d%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aS,Z!o,tf,[$[$_$c(z)S*i,g,j,u,w,zX,]%^,f,i,v!Q#be!y$j$m$q$}%b%d%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aQ,^!od,_$[$_$c(z)S*i,g,j,w,zV,`%^,f,iprOScw!U!V!W#O#k#n&|'W'Y)W*k+gR)a']etOScw#O#k#n&|'Y+gQ$S!RT&i$R&jR$S!RQ$V!ST&o$U&pQ&U#xR&m$TS(T&S&lV*{*S*|+^R$V!SQ$Y!TT&t$X&uR$Y!TdsOScw#O#k#n&|'Y+gT$p![!]dtOScw#O#k#n&|'Y+gQ*b(yR+_+QQ$a!VQ&{$_Q)T'RR*g)ST&|$`&}Q+b+SQ+m+fR+v+uT+g+a+hR$i!WR$l!YT'Y$k'ZXuOSw#nQ$s!`R'_$sSSO#nR!dSQ%u#sR'y%uUwOS#nR#mwQ&d#}R(g&dQ(c&`R*Z(cS!mX$^R$z!mQ(O%{R)}(OQ&]#yR(_&]Q(]&YR*X(]'r^OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!v^S'f%T+PR)m'fQ'c%RR)j'cW#Oc&|'Y+gR%[#O^#Ue$[$_$c$m)^,zU%e#U,O,PQ,O,fR,P,gQ&j$RR(m&jS*Q(S(oR*y*QQ*T(TR*}*TQ&p$UR(r&pQ&u$XR(w&uQ&}$`R)O&}Q+h+aR+o+hQ'Z$kR)['ZQ!cRQ#luQ#nyQ%Z!|Q&x$]Q'R$bQ'x%tQ(^&[Q(f&cQ(l&iQ(q&oR(v&tVxOS#nWuOSw#nY!|c#O&|'Y+gR%r#kdtOScw#O#k#n&|'Y+gQ$]!UQ$b!VQ$g!WQ)X'WQ*j)WR+U*kdeOScw#O#k#n&|'Y+gQ!oYQ!ya`#gmn,{,|,}-O-P-QQ$[!UQ$_!VQ$c!WQ$j!Xd$m!Z#i#j&g&s'P'T'U(k(tQ$q!_Q$}!qQ%^#QQ%b#SQ%d#TW%h#^,Q,R,SQ%i#_Q%j#`Q%k#aQ%l#bQ%m#cQ'V$fQ'p%cQ(z&xQ({&yQ)S'RQ)Y'XQ)^']Q)c'aU)e'b)i*oQ)q'oQ)t'rQ*i)VQ*s)sQ+T*hQ+V*lQ+W*nQ+Y*rS,f#V'wS,g,b,cQ,i+|Q,j+}Q,k,TQ,l,UQ,m,VQ,n,WQ,o,XQ,p,YQ,q,ZQ,r,[Q,s,]Q,t,^Q,u,_Q,v,`Q,w,aU,z'W)W*kV-a&l*`-^#bZW!O!h!t!z#e#h#u#v#y#|$P$Q$T$W$v$x%W%Y%a%x%y&O&W&]&`&m'e'|'}(S([(c(i(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-d%P[OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^$zdOSacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S!gW-]Q!nYS#{!O-_Q$u!hS%T!t+jS%X!z-UQ%n#e[%o#h#|$x-V-W-XW%w#u'})|*wU&P#v$v,h[&X#y&](S([(o*QQ&f$PQ&h$QQ&n$TQ&r$WS'h%W-YS'i%Y-ZW'l%a(|+R+lS'{%x%yQ(Q&OQ(Y&WQ(d&`Q(p&mU)k'e)l*pQ)z'|Q*[(cS*^(i-[Q+P*`R-c-dS#w|!pS$w!j-TQ&T#xQ(R&QQ(W&UR(X&VT%|#u&OhqOScw!U!V#O#k#n&|'Y+gU$Q!R$R&jU$W!T$X&uQ$e!WY%y#u&O'})|*wQ)`']V-S'W)W*kS&[#y&]S*R(S(oR*z*QY&Y#y&](S(o*QR*W(['``OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:iO,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20,16,68,93,94,96,99,101,105,111,115,117,120,126,129,134,136,141,143,147,149,"Statement",-12,23,31,33,38,46,49,50,51,52,56,57,58,"Type"],["openedBy",13,"(",25,"{",53,"["],["closedBy",14,")",26,"}",54,"]"]],propSources:[XO],skippedNodes:[0,1,2,153],repeatNodeCount:23,tokenData:":b~RvXY#iYZ#i]^#ipq#iqr#zrs$Xuv&Pvw&^wx&yxy(qyz(vz{({{|)T|})e}!O)j!O!P)u!P!Q+}!Q!R,y!R![-t![!]2^!]!^2k!^!_2p!_!`3]!`!a3e!c!}3x!}#O4j#P#Q4o#Q#R4t#R#S4|#S#T9X#T#o3x#o#p9q#p#q9v#q#r:W#r#s:]$g;'S3x;'S;=`4d<%lO3x~#nS$y~XY#iYZ#i]^#ipq#iU$PP%hQ!_!`$SS$XO!|S~$^W[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y<%lO$X~${O[~~%ORO;'S$X;'S;=`%X;=`O$X~%^X[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y;=`<%l$X<%lO$X~%|P;=`<%l$X~&UP%l~!_!`&X~&^O#U~~&cR%j~vw&l!_!`&X#Q#R&q~&qO%p~~&vP%o~!_!`&X~'OWd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k<%lO&y~'mOd~~'pRO;'S&y;'S;=`'y;=`O&y~(OXd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k;=`<%l&y<%lO&y~(nP;=`<%l&y~(vO^~~({O]~~)QP%Y~!_!`&X~)YQ%f~{|)`!_!`&X~)eO#R~~)jOn~~)oQ%g~}!O)`!_!`&X~)zRZS!O!P*T!Q![*`#R#S+w~*WP!O!P*Z~*`Ou~Q*eTaQ!Q![*`!g!h*t#R#S+w#X#Y*t#]#^+rQ*wS{|+T}!O+T!Q![+^#R#S+lQ+WQ!Q![+^#R#S+lQ+cRaQ!Q![+^#R#S+l#]#^+rQ+oP!Q![+^Q+wOaQQ+zP!Q![*`~,SR%k~z{,]!P!Q,b!_!`&X~,bO$z~~,gSP~OY,bZ;'S,b;'S;=`,s<%lO,b~,vP;=`<%l,bQ-O[aQ!O!P*`!Q![-t!d!e.c!g!h*t!q!r/Z!z!{/x#R#S.]#U#V.c#X#Y*t#]#^+r#c#d/Z#l#m/xQ-yUaQ!O!P*`!Q![-t!g!h*t#R#S.]#X#Y*t#]#^+rQ.`P!Q![-tQ.fR!Q!R.o!R!S.o#R#S/QQ.tSaQ!Q!R.o!R!S.o#R#S/Q#]#^+rQ/TQ!Q!R.o!R!S.oQ/^Q!Q!Y/d#R#S/rQ/iRaQ!Q!Y/d#R#S/r#]#^+rQ/uP!Q!Y/dQ/{T!O!P0[!Q![1c!c!i1c#R#S2Q#T#Z1cQ0_S!Q![0k!c!i0k#R#S1V#T#Z0kQ0pVaQ!Q![0k!c!i0k!r!s*t#R#S1V#T#Z0k#]#^+r#d#e*tQ1YR!Q![0k!c!i0k#T#Z0kQ1hWaQ!O!P0k!Q![1c!c!i1c!r!s*t#R#S2Q#T#Z1c#]#^+r#d#e*tQ2TR!Q![1c!c!i1c#T#Z1c~2cP!a~!_!`2f~2kO#W~~2pOV~~2uR!|S}!O3O!^!_3T!_!`$S~3TO!Q~~3YP%m~!_!`&X~3bP#T~!_!`$S~3jQ!|S!_!`$S!`!a3p~3uP%n~!_!`&X~3}V%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~4gP;=`<%l3x~4oO!W~~4tO!V~~4yP%i~!_!`&X~5RV%O~!Q![5h!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~5o^aQ%O~!O!P*`!Q![5h!c!g3x!g!h6k!h!}3x#R#S4|#T#X3x#X#Y6k#Y#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~6pX%O~{|+T}!O+T!Q![7]!c!}3x#R#S8P#T#o3x$g;'S3x;'S;=`4d<%lO3x~7dXaQ%O~!Q![7]!c!}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[aO,1,2,new Y("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:Q=>nO[Q]||-1}],tokenPrec:5451}),oO=[X("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),X("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),X("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),X("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),X("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),X("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),X("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),X(`select {
+import{L as s,E as R,a as Y,s as x,C as w,t as O,b as d,c as X,d as k,i as h,e as f,f as u,g as y,h as l,j as g,k as j,l as U,m as G,N as b,I as Z}from"./index-C8VjSzoF.js";const _=177,q=179,E=184,v=12,C=13,D=17,z=20,F=25,B=53,N=95,I=142,L=144,A=145,J=148,M=10,H=13,K=32,OO=9,$=47,QO=41,eO=125,aO=new R((Q,e)=>{for(let n=0,a=Q.next;(e.context&&(a<0||a==M||a==H||a==$&&Q.peek(n+1)==$)||a==QO||a==eO)&&Q.acceptToken(_),!(a!=K&&a!=OO);)a=Q.peek(++n)},{contextual:!0});let tO=new Set([N,E,z,v,D,L,A,I,J,C,B,F]);const iO=new w({start:!1,shift:(Q,e)=>e==q?Q:tO.has(e)}),XO=x({"func interface struct chan map const type var":O.definitionKeyword,"import package":O.moduleKeyword,"switch for go select return break continue goto fallthrough case if else defer":O.controlKeyword,range:O.keyword,Bool:O.bool,String:O.string,Rune:O.character,Number:O.number,Nil:O.null,VariableName:O.variableName,DefName:O.definition(O.variableName),TypeName:O.typeName,LabelName:O.labelName,FieldName:O.propertyName,"FunctionDecl/DefName":O.function(O.definition(O.variableName)),"TypeSpec/DefName":O.definition(O.typeName),"CallExpr/VariableName":O.function(O.variableName),LineComment:O.lineComment,BlockComment:O.blockComment,LogicOp:O.logicOperator,ArithOp:O.arithmeticOperator,BitOp:O.bitwiseOperator,"DerefOp .":O.derefOperator,"UpdateOp IncDecOp":O.updateOperator,CompareOp:O.compareOperator,"= :=":O.definitionOperator,"<-":O.operator,'~ "*"':O.modifier,"; ,":O.separator,"... :":O.punctuation,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),nO={__proto__:null,package:10,import:18,true:380,false:380,nil:383,struct:48,func:68,interface:78,chan:94,map:118,make:157,new:159,const:204,type:212,var:224,if:236,else:238,switch:242,case:248,default:250,for:260,range:266,go:270,select:274,return:284,break:288,continue:290,goto:292,fallthrough:296,defer:300},PO=s.deserialize({version:14,states:"!=xO#{QQOOP$SOQOOO&UQTO'#CbO&]QRO'#FlO]QQOOOOQP'#Cn'#CnOOQP'#Co'#CoO&eQQO'#C|O(kQQO'#C{O)]QRO'#GiO+tQQO'#D_OOQP'#Ge'#GeO+{QQO'#GeO.aQTO'#GaO.hQQO'#D`OOQP'#Gm'#GmO.mQRO'#GdO/hQQO'#DgOOQP'#Gd'#GdO/uQQO'#DrO2bQQO'#DsO4QQTO'#GqO,^QTO'#GaO4XQQO'#DxO4^QQO'#D{OOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETO4cQQO'#EPO5}QQO'#EPOOQP'#Ga'#GaO6UQQO'#E`O6^QQO'#EcOOQP'#G`'#G`O6cQQO'#EsOOQP'#G_'#G_O&]QRO'#FnOOQO'#Fn'#FnO9QQQO'#G^QOQQOOO&]QROOO9XQQO'#C`O9^QSO'#CdO9lQQO'#C}O9tQQO'#DSO9yQQO'#D[O:kQQO'#CsO:pQQO'#DhO:uQQO'#EeO:}QQO'#EiO;VQQO'#EoO;_QQO'#EuOPQSO7+%hOOQP7+%h7+%hO4cQQO7+%hOOQP1G0Q1G0QO!>^QQO1G0QOOQP1G0U1G0UO!>fQQO1G0UOF|QQO1G0UOOQO,5nAN>nO4cQQOAN>nO!IsQSOAN>nOOQP<nQQO'#FrOOQO,5vAN>vO!LtQQOAN>vP.hQQO'#F|OOQPG25XG25XO!LyQQOG25bO!MOQQO'#FPOOQPG25bG25bO!MZQQOG25bOOQPLD)tLD)tOOQPG24bG24bO!JqQQOLD*|O!9OQQO'#GQO!McQQO,5;kOOQP,5;k,5;kO?tQQO'#FQO!MnQQO'#FQO!MsQQOLD*|OOQP!$'Nh!$'NhOOQO,5VO^!hOh!POr-TOw}O!P-_O!Q-`O!W-^O!]-eO%O!eO%Y!fO~OZ!sO~O^#uO~O!P$xO~On!lO#W%]aV%]a^%]ah%]ar%]aw%]a!P%]a!Q%]a!W%]a!]%]a#T%]a$w%]a%O%]a%Y%]au%]a~O]${O^#QO~OZ#RO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O]$|O!|,WO~PBROj!qOn%QO!QnOi%cP~P*aO!V%WO!|#`O~PBRO!V%YO~OV!}O[oO^YOaoOdoOh!POjcOr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO#Y!RO#^!SO#d!TO#j!UO#m!VO#v!WO#{!XO#}!YO$S!ZO$U![O$V![O$W!]O$Y!^O$[!_O%OQO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~Oi%dX#p%dX#q%dX~PDQOi%]O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-QO!WaO!]!QO!phO!qhO%O+{O%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^%aO%O%_O~O!QnO!a%cO~P*aO!QnOn$mX#T$mX#U$mXV$mX$w$mX!a$mX~P*aOn#TO#T%ea#U%eaV%ea$w%ea!a%ea~O]%fO~PF|OV#ga$w#ga~PDTO[%sO~OZ#rO[#qO]%vO%O#oO~O^!hOh!POn%zOr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO]%[P~O^&OOh!POr!jOw}O!P!OO!Q!kO!WaO!]!QO%Y!fO^%ZXj%ZX~O%O%}O~PKfOjcO^qa]qanqa!Vqa~O^#uO!W&SO~O^!hOh!POr-TOw}O{&WO!P-_O!Q-`O!W-^O!]-eO%O,xO%Y!fO~Oi&^O~PL{O^!hOh!POr!jOw}O!Q!kO!WaO!]!QO%O!eO%Y!fO~O!P#hO~PMwOi&eO%O,yO%Y!fO~O#T&gOV#ZX$w#ZX~P?tO]&kO%O#oO~O^!hOh!POr-TOw}O!P-_O!Q-`O!]-eO%O!eO%Y!fO~O!W&lO#T&mO~P! _O]&qO%O#oO~O#T&sOV#eX$w#eX~P?tO]&vO%O#oO~OjeX~P$XOjcO!|,XO~P2gOn!lO#W&yO#W%]X~O^#VOn#TO!Q#cO!W#SO!|,XO#R#dO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]OV`X#T%eX#U%eX~OZ&zOj$`O$w`X~P!#cOi'OO#p'PO#q'QO~OZ#ROjcO~P!#cO#T'TO#U#iO~O#W'UO~OV'WO!QnO~P*aOV'XO~OjcO~O!|#`OV#za$w#za~PBROi'[O#p']O#q'^O~On#TO!|#`OV%eX$w%eX!a%eX~PBRO!|#`OV$Za$w$Za~PBRO${$rO$|$rO$}'`O~O]${O~O%O!eO]%ZXn%ZX!V%ZX~PKfO!|#`Oi!_Xn!_X!a!`X~PBROi!_Xn!_X!a!`X~O!a'aO~On'bOi%cX~Oi'dO~On'eO!V%bX!a%bX~O!V'gO~O]'jOn'kO!|,YO~PBROn'nO!V'mO!a'oO!|#`O~PBRO!QnO!V'qO!a'rO~P*aO!|#`On$ma#T$ma#U$maV$ma$w$ma!a$ma~PBRO]'sOu'tO~O%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi!|!xi#R!xi#T!xi#U!xi$w!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~O!V!xii!xi!a!xi~P!+YO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi!V!xii!xi!a!xi~O!|!xi~P!-TO!|#`O~P!-TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OV!xiZ!xi^!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%q!xi~O!|#`O!V!xii!xi!a!xi~P!/VO!|#`OV#Pi$w#Pi!a#Pi~PBRO]'uOn'wOu'vO~OZ#rO[#qO]'zO%O#oO~Ou'|O~P?tOn'}O]%[X~O](PO~OZeX^mX^!TXj!TX!W!TX~OjcOV$]i$w$]i~O%`(ZOV%^X$w%^Xn%^X!V%^X~Oi(`O~PL{O[(aO!W!tOVlX$wlX~On(bO~P?tO[(aOVlX$wlX~Oi(hO%O,yO%Y!fO~O!V(iO~O#T(kO~O](nO%O#oO~O[oO^YOaoOdoOh!POr!pOu-bOw}O!P!OO!QnO!V-UO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O+zO~P!4vO](sO%O#oO~O#T(tOV#ea$w#ea~O](xO%O#oO~O#k(yOV#ii$w#ii~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-PO!WaO!]!QO!phO!qhO%O+xO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O^(|O%O%_O~O#p%dP#q%dP~P/uOi)PO#p'PO#q'QO~O!a)RO~O!QnO#y)VO~P*aOV)WO!|#`O~PBROj#wa~P;_OV)WO!QnO~P*aOi)]O#p']O#q'^O~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!QnO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O%O,eO~P!:lO!a)bO~Oj!qO!QnO~P*aOj!qO!QnOi%ca~P*aOn)iOi%ca~O!V%ba!a%ba~P?tOn)lO!V%ba!a%ba~O])nO~O])oO~O!V)pO~O!QnO!V)rO!a)sO~P*aO!V)rO!a)sO!|#`O~PBRO])uOn)vO~O])wOn)xO~O^!hOh!POr-TOu%xOw}O!P-_O!Q-`O!W-^O!]-eO%O,dO%Y!fO~O]%[a~P!>nOn)|O]%[a~O]${O]tXntX~OjcOV$^q$w$^q~On*PO{&WO~P?tOn*SO!V%rX~O!V*UO~OjcOV$]q$w$]q~O%`(ZOV|a$w|an|a!V|a~O[*]OVla$wla~O[*]O!W!tOVla$wla~On*PO{&WO!W*`O^%WXj%WX~P! _OjcO#j!UO~OjcO!|,XO~PBROZ*dO^#VO!W#SO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~O!|#`O~P!BoO#^*eO~P?tO!a*fO~Oj$`O!|,XO~P!BoO#W*hO~Oj#wi~P;_OV*kO!|#`O~PBROn#TO!Q#cO!|#`O!a$QX#T%eX~PBRO#T*lO~O#W*lO~O!a*mO~O!|#`Oi!_in!_i~PBRO!|#`Oi!bXn!bX!a!cX~PBROi!bXn!bX!a!cX~O!a*nO~Oj!qO!QnOi%ci~P*aO!V%bi!a%bi~P?tO!V*qO!a*rO!|#`O~PBRO!V*qO!|#`O~PBRO]*tO~O]*uO~O]*uOu*vO~O]%[i~P!>nO%O!eO!V%ra~On*|O!V%ra~O[+OOVli$wli~O%O+yO~P!4vO#k+QOV#iy$w#iy~O^+RO%O%_O~O]+SO~O!|,XOj#xq~PBROj#wq~P;_O!V+ZO!|#`O~PBRO]+[On+]O~O%O!eO!V%ri~O^#QOn'eO!V%bX~O#^+`O~P?tOj+aO~O^#VO!W#SO!|#`O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[O%q#]O~OZ+cO~P!JvO!|#`O!a$Qi~PBRO!|#`Oi!bin!bi~PBRO!V+dO!|#`O~PBRO]+eO~O]+fO~Oi+iO#p+jO#q+kO~O^+lO%O%_O~Oi+pO#p+jO#q+kO~O!a+rO~O#^+sO~P?tO!a+tO~O]+uO~OZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXVeXneX!QeX#ReX#TeX#UeX$weX~O]eX]!TX!VeXieX!aeX~P!NUOjeX~P!NUOZeX^eX^!TXj!TX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeXn!TX!VeX~O]eX!V!TX~P#!gOh!TXr!TXw!TX{!TX!P!TX!Q!TX!]!TX%O!TX%Y!TX~P#!gOZeX^eX^!TXj!TXneX!WeX!W!TX!|eX%YeX%`eX%feX%geX%ieX%jeX%keX%leX%meX%neX%oeX%peX%qeX~O]eXueX~P#$xO]$mXn$mXu$mX~PF|Oj$mXn$mX~P!7`On+|O]%eau%ea~On+}Oj%ea~O[oO^YOaoOdoOh!POr!pOw}O!P!OO!Q-OO!WaO!]!QO!phO!qhO%O+yO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~OZeX]!TX^UXhUXnUXn!TXrUXuUXwUX!PUX!QUX!WUX!W!TX!]UX%OUX%YUX~OnUX!QeX!aeX#TeX#WUX~P#$xOn+|O!|,YO]%eXu%eX~PBROn+}O!|,XOj%eX~PBRO^&OOV%ZXj%ZX$w%ZX]%ZXn%ZX!V%ZXu%ZX%`%ZX#T%ZX[%ZX!a%ZX~P?wO!|,YO]$man$mau$ma~PBRO!|,XOj$man$ma~PBRO%Y#XO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%`!xi%f!xi%g!xi%i!xi%p!xi%q!xi~Oj!xi~P!+YOn!xiu!xi~P#,hO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi!|!xi%p!xi%q!xi~O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOV!xiZ!xi^!xij!xin!xi!Q!xi!W!xi#R!xi#T!xi#U!xi$w!xi%p!xi%q!xi~O!|!xi~P#/_On!xiu!xi~P#.TO%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YOZ!xi]!xi^!xi!W!xi%p!xi%q!xi~O!|,WO~P#1^O!|,XO~P#/_O!|,YOn!xiu!xi~P#1^O%Y#XO%`#ZO%fiO%giO%i#ZO%j#YO%k#XO%l#XO%m#YO%n#YO%o#YO%p#[OZ!xi]!xi^!xi!W!xi%q!xi~O!|,WO~P#3QO!|,XOj!xi~P!/VO!|,YOn!xiu!xi~P#3QO!|,XOj#Pi~PBROV!TXZeX^mX!W!TX$w!TX~O%`!TX~P#5RO[!TXhmXnmXrmXwmX!PmX!QmX!WmX!]mX%OmX%YmX~P#5ROn#TO!Q,aO!|,XO#R#dOj`X#T%eX#U%eX~PBRO[oO^YOaoOdoOh!POr!pOw}O!P#hO!WaO!]!QO!phO!qhO%UTO%VUO%YVO%fiO%giO%hjO%ikO%jlO~O!Q-OO%O+yO~P#6{O!Q-PO%O+xO~P#6{O!Q-QO%O+{O~P#6{O#T,bO#U,bO~O#W,cO~O^!hOh!POr-TOw}O!P-_O!Q-WO!W-^O!]-eO%O!eO%Y!fO~O^!hOh!POr-TOw}O!Q-`O!W-^O!]-eO%O!eO%Y!fO~O!P-VO~P#9zO%O+wO~P!4vO!P-XO~O!V-YO!|#`O~PBRO!V-ZO~O!V-[O~O!W-dO~OP%ka%Oa~",goto:"!FW%sPP%tP%wP%zP'SP'XPPPP'`'cP'u'uP)w'u-_PPP0j0m0qP1V4b1VP7s8WP1VP8a8d8hP8p8w1VPP1V8{<`?vPPCY-_-_-_PCdCuCxPC{DQ'u'uDV'uES'u'u'u'uGUIW'uPPJR'uJUMjMjMj'u! r! r!#SP!$`!%d!&d'cP'cPP'cP!&yP!'V!'^!&yP!'a!'h!'n!'w!&yP!'z!(R!&y!(U!(fPP!&yP!(x!)UPP!&y!)Y!)c!&yP!)g!)gP!&yP!&yP!)j!)m!&v!&yP!&yPPP!&yP!&yP!)q!)q!)w!)}!*U!*[!*d!*j!*p!*w!*}!+T!+Z!.q!.x!/O!/X!/m!/s!/z!0Q!0W!0^!0d!0jPPPPPPPPP!0p!1f!1k!1{!2kPP!7P!:^P!>u!?Z!?_!@Z!@fP!@p!D_!Df!Di!DuPPPPPPPPPPPP!FSR!aPRyO!WXOScw!R!T!U!W#O#k#n#u$R$X&O&j&u&|'W'Y']'})W)|*k*w+gQ#pzU#r{#s%uQ#x|U$T!S$U&pQ$^!VQ$y!lR)U'RVROS#nQ#t{T%t#s%uR#t{qrOScw!U!V!W#O#k#n&|'W'Y)W*k+g%PoOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%O]OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^#u!iW^!O!h!t!z#e#h#u#v#y#|#}$P$Q$T$W$v$x%W%Y%a%x%y&O&S&W&]&`&b&d&m'e'|'}(S([(c(i(o(|)l)|*P*Q*S*p*w*|+R+^+j+l,h-U-V-W-X-Y-Z-[-]-_-d'cbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR$O!PT&c#}&dW%`#R&z*d+cQ&Q#vS&V#y&]S&`#}&dR*Y(b'cZOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d%fWOSWYacmnw!O!U!V!W!X!Z!_!q!z#O#Q#S#T#V#^#_#`#a#b#c#h#i#j#k#n#v#|$f$v$x%W%Y%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(i(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S&b#}&d!{-]!h!t#e#u#y$P$Q$T$W%a%x%y&O&W&]&`&m'e'|'}(S([(c(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-dQ#v|S$v!j!pU&P#v$v,hZ,h#x&Q&U&V-TS%{#u&OV){'})|*wR#z}T&[#y&]]&X#y&](S([(o*QZ&Z#y&](S(o*QT([&Y(]'s_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-d'r_OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!w^'bbOSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&a#}&dR(d&bS!u]fX!x`&_(e(oQ!r[Q%O!qQ)d'aU)f'b)i*oR+X*nR%R!qR%P!qV)h'b)i*oV)g'b)i*odtOScw#O#k#n&|'Y+gQ$h!WQ&R#wQ&w$[S'S$c$iQ(V&TQ*O(RQ*V(WQ*b(yQ*c(zR+_+Q%PfOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^%PgOSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^!q#Weg!o!y$[$_$c$j$m$q$}%^%b%d%m'V'p(z({)S)Y)^)c)e)q)t*i*s+T+V+W+Y,f,g,i,j,w,z-aR#fh#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z[,V%^,f,i,p,s,v`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q#^mOSacmnw!X!Z!_!q#O#S#T#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&y&|'P'T'U'X'Y']'a'b'o'r(k(t)i)s*`*h*l*n*o*r+g-^`,{Y,Q,T,W,Z,^,{-Ox,|!U!V!W&x'R'W)V)W*k+},R,U,X,[,_,a,b,c,|-Pg,}#Q#V'w+|,S,V,Y,],`,}-Q!Y#^e!y$j$m$q$}%b%d%i%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aY,Q!o,k,n,q,tl,R$[$_$c(z)S*i,g,j,l,o,r,u,w,z_,S%^,f,i,m,p,s,v!W#_e!y$j$m$q$}%b%d%j%k%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aW,T!o,n,q,tj,U$[$_$c(z)S*i,g,j,o,r,u,w,z],V%^,f,i,p,s,v!S#ae!y$j$m$q$}%b%d%l%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aS,Z!o,tf,[$[$_$c(z)S*i,g,j,u,w,zX,]%^,f,i,v!Q#be!y$j$m$q$}%b%d%m'V'p({)Y)^)c)e)q)t*s+T+V+W+Y-aQ,^!od,_$[$_$c(z)S*i,g,j,w,zV,`%^,f,iprOScw!U!V!W#O#k#n&|'W'Y)W*k+gR)a']etOScw#O#k#n&|'Y+gQ$S!RT&i$R&jR$S!RQ$V!ST&o$U&pQ&U#xR&m$TS(T&S&lV*{*S*|+^R$V!SQ$Y!TT&t$X&uR$Y!TdsOScw#O#k#n&|'Y+gT$p![!]dtOScw#O#k#n&|'Y+gQ*b(yR+_+QQ$a!VQ&{$_Q)T'RR*g)ST&|$`&}Q+b+SQ+m+fR+v+uT+g+a+hR$i!WR$l!YT'Y$k'ZXuOSw#nQ$s!`R'_$sSSO#nR!dSQ%u#sR'y%uUwOS#nR#mwQ&d#}R(g&dQ(c&`R*Z(cS!mX$^R$z!mQ(O%{R)}(OQ&]#yR(_&]Q(]&YR*X(]'r^OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|#}$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&S&W&]&`&b&d&g&l&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*P*Q*S*`*h*k*l*n*o*p*r*w*|+R+^+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dR!v^S'f%T+PR)m'fQ'c%RR)j'cW#Oc&|'Y+gR%[#O^#Ue$[$_$c$m)^,zU%e#U,O,PQ,O,fR,P,gQ&j$RR(m&jS*Q(S(oR*y*QQ*T(TR*}*TQ&p$UR(r&pQ&u$XR(w&uQ&}$`R)O&}Q+h+aR+o+hQ'Z$kR)['ZQ!cRQ#luQ#nyQ%Z!|Q&x$]Q'R$bQ'x%tQ(^&[Q(f&cQ(l&iQ(q&oR(v&tVxOS#nWuOSw#nY!|c#O&|'Y+gR%r#kdtOScw#O#k#n&|'Y+gQ$]!UQ$b!VQ$g!WQ)X'WQ*j)WR+U*kdeOScw#O#k#n&|'Y+gQ!oYQ!ya`#gmn,{,|,}-O-P-QQ$[!UQ$_!VQ$c!WQ$j!Xd$m!Z#i#j&g&s'P'T'U(k(tQ$q!_Q$}!qQ%^#QQ%b#SQ%d#TW%h#^,Q,R,SQ%i#_Q%j#`Q%k#aQ%l#bQ%m#cQ'V$fQ'p%cQ(z&xQ({&yQ)S'RQ)Y'XQ)^']Q)c'aU)e'b)i*oQ)q'oQ)t'rQ*i)VQ*s)sQ+T*hQ+V*lQ+W*nQ+Y*rS,f#V'wS,g,b,cQ,i+|Q,j+}Q,k,TQ,l,UQ,m,VQ,n,WQ,o,XQ,p,YQ,q,ZQ,r,[Q,s,]Q,t,^Q,u,_Q,v,`Q,w,aU,z'W)W*kV-a&l*`-^#bZW!O!h!t!z#e#h#u#v#y#|$P$Q$T$W$v$x%W%Y%a%x%y&O&W&]&`&m'e'|'}(S([(c(i(o(|)l)|*Q*p*w+R+j+l,h-U-V-W-X-Y-Z-[-]-_-d%P[OSYacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*`*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^$zdOSacmnw!U!V!W!X!Z!_!q#O#Q#S#T#V#^#_#`#a#b#c#i#j#k#n$f%c&g&l&s&x&y&|'P'R'T'U'W'X'Y']'a'b'o'r'w(k(t)V)W)i)s*h*k*l*n*o*r+g+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,{,|,}-O-P-Q-^S!gW-]Q!nYS#{!O-_Q$u!hS%T!t+jS%X!z-UQ%n#e[%o#h#|$x-V-W-XW%w#u'})|*wU&P#v$v,h[&X#y&](S([(o*QQ&f$PQ&h$QQ&n$TQ&r$WS'h%W-YS'i%Y-ZW'l%a(|+R+lS'{%x%yQ(Q&OQ(Y&WQ(d&`Q(p&mU)k'e)l*pQ)z'|Q*[(cS*^(i-[Q+P*`R-c-dS#w|!pS$w!j-TQ&T#xQ(R&QQ(W&UR(X&VT%|#u&OhqOScw!U!V#O#k#n&|'Y+gU$Q!R$R&jU$W!T$X&uQ$e!WY%y#u&O'})|*wQ)`']V-S'W)W*kS&[#y&]S*R(S(oR*z*QY&Y#y&](S(o*QR*W(['``OSWYacmnw!O!U!V!W!X!Z!_!h!q!t!z#O#Q#S#T#V#^#_#`#a#b#c#e#h#i#j#k#n#u#v#y#|$P$Q$T$W$f$v$x%W%Y%a%c%x%y&O&W&]&`&g&m&s&x&y&|'P'R'T'U'W'X'Y']'a'b'e'o'r'w'|'}(S([(c(i(k(o(t(|)V)W)i)l)s)|*Q*`*h*k*l*n*o*p*r*w+R+g+j+l+|+},Q,R,S,T,U,V,W,X,Y,Z,[,],^,_,`,a,b,c,h,{,|,}-O-P-Q-U-V-W-X-Y-Z-[-]-^-_-dS&_#}&dW(S&S*S*|+^Q(e&bQ(o&lR*x*PS%U!t*`R+q+jR%S!qQ#PcQ(}&|Q)Z'YR+n+ghpOScw!U!V#O#k#n&|'Y+gQ$d!WQ$n!ZQ%g#VU%p#i'T,bU%q#j'U,cQ(j&gQ(u&sQ)Q'PQ)_']Q)y'wQ*_(kQ*a(tV-R'W)W*kT(U&S&l",nodeNames:"⚠ LineComment BlockComment SourceFile PackageClause package DefName ; ImportDecl import ImportSpec . String ) ( SpecList ExprStatement Number Bool Nil Rune VariableName TypedLiteral StructType struct } { StructBody FieldDecl FieldName , PointerType * FunctionType func Parameters Parameter ... InterfaceType interface InterfaceBody MethodElem UnderlyingType ~ TypeElem LogicOp ChannelType chan <- ParenthesizedType QualifiedType TypeName ParameterizedType ] [ TypeArgs ArrayType SliceType MapType map LiteralValue Element Key : Element Key ParenthesizedExpr FunctionLiteral Block Conversion SelectorExpr IndexExpr SliceExpr TypeAssertion CallExpr ParameterizedExpr Arguments CallExpr make new Arguments UnaryExp ArithOp LogicOp BitOp DerefOp BinaryExp ArithOp BitOp BitOp CompareOp LogicOp LogicOp SendStatement IncDecStatement IncDecOp Assignment = UpdateOp VarDecl := ConstDecl const ConstSpec SpecList TypeDecl type TypeSpec TypeParams TypeParam SpecList VarDecl var VarSpec SpecList LabeledStatement LabelName IfStatement if else SwitchStatement switch SwitchBlock Case case default TypeSwitchStatement SwitchBlock Case ForStatement for ForClause RangeClause range GoStatement go SelectStatement select SelectBlock Case ReceiveStatement ReturnStatement return GotoStatement break continue goto FallthroughStatement fallthrough DeferStatement defer FunctionDecl MethodDecl",maxTerm:218,context:iO,nodeProps:[["isolate",-3,2,12,20,""],["group",-18,12,17,18,19,20,21,22,66,67,69,70,71,72,73,74,77,81,86,"Expr",-20,16,68,93,94,96,99,101,105,111,115,117,120,126,129,134,136,141,143,147,149,"Statement",-12,23,31,33,38,46,49,50,51,52,56,57,58,"Type"],["openedBy",13,"(",25,"{",53,"["],["closedBy",14,")",26,"}",54,"]"]],propSources:[XO],skippedNodes:[0,1,2,153],repeatNodeCount:23,tokenData:":b~RvXY#iYZ#i]^#ipq#iqr#zrs$Xuv&Pvw&^wx&yxy(qyz(vz{({{|)T|})e}!O)j!O!P)u!P!Q+}!Q!R,y!R![-t![!]2^!]!^2k!^!_2p!_!`3]!`!a3e!c!}3x!}#O4j#P#Q4o#Q#R4t#R#S4|#S#T9X#T#o3x#o#p9q#p#q9v#q#r:W#r#s:]$g;'S3x;'S;=`4d<%lO3x~#nS$y~XY#iYZ#i]^#ipq#iU$PP%hQ!_!`$SS$XO!|S~$^W[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y<%lO$X~${O[~~%ORO;'S$X;'S;=`%X;=`O$X~%^X[~OY$XZr$Xrs$vs#O$X#O#P${#P;'S$X;'S;=`%y;=`<%l$X<%lO$X~%|P;=`<%l$X~&UP%l~!_!`&X~&^O#U~~&cR%j~vw&l!_!`&X#Q#R&q~&qO%p~~&vP%o~!_!`&X~'OWd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k<%lO&y~'mOd~~'pRO;'S&y;'S;=`'y;=`O&y~(OXd~OY&yZw&ywx'hx#O&y#O#P'm#P;'S&y;'S;=`(k;=`<%l&y<%lO&y~(nP;=`<%l&y~(vO^~~({O]~~)QP%Y~!_!`&X~)YQ%f~{|)`!_!`&X~)eO#R~~)jOn~~)oQ%g~}!O)`!_!`&X~)zRZS!O!P*T!Q![*`#R#S+w~*WP!O!P*Z~*`Ou~Q*eTaQ!Q![*`!g!h*t#R#S+w#X#Y*t#]#^+rQ*wS{|+T}!O+T!Q![+^#R#S+lQ+WQ!Q![+^#R#S+lQ+cRaQ!Q![+^#R#S+l#]#^+rQ+oP!Q![+^Q+wOaQQ+zP!Q![*`~,SR%k~z{,]!P!Q,b!_!`&X~,bO$z~~,gSP~OY,bZ;'S,b;'S;=`,s<%lO,b~,vP;=`<%l,bQ-O[aQ!O!P*`!Q![-t!d!e.c!g!h*t!q!r/Z!z!{/x#R#S.]#U#V.c#X#Y*t#]#^+r#c#d/Z#l#m/xQ-yUaQ!O!P*`!Q![-t!g!h*t#R#S.]#X#Y*t#]#^+rQ.`P!Q![-tQ.fR!Q!R.o!R!S.o#R#S/QQ.tSaQ!Q!R.o!R!S.o#R#S/Q#]#^+rQ/TQ!Q!R.o!R!S.oQ/^Q!Q!Y/d#R#S/rQ/iRaQ!Q!Y/d#R#S/r#]#^+rQ/uP!Q!Y/dQ/{T!O!P0[!Q![1c!c!i1c#R#S2Q#T#Z1cQ0_S!Q![0k!c!i0k#R#S1V#T#Z0kQ0pVaQ!Q![0k!c!i0k!r!s*t#R#S1V#T#Z0k#]#^+r#d#e*tQ1YR!Q![0k!c!i0k#T#Z0kQ1hWaQ!O!P0k!Q![1c!c!i1c!r!s*t#R#S2Q#T#Z1c#]#^+r#d#e*tQ2TR!Q![1c!c!i1c#T#Z1c~2cP!a~!_!`2f~2kO#W~~2pOV~~2uR!|S}!O3O!^!_3T!_!`$S~3TO!Q~~3YP%m~!_!`&X~3bP#T~!_!`$S~3jQ!|S!_!`$S!`!a3p~3uP%n~!_!`&X~3}V%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~4gP;=`<%l3x~4oO!W~~4tO!V~~4yP%i~!_!`&X~5RV%O~!Q![5h!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~5o^aQ%O~!O!P*`!Q![5h!c!g3x!g!h6k!h!}3x#R#S4|#T#X3x#X#Y6k#Y#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~6pX%O~{|+T}!O+T!Q![7]!c!}3x#R#S8P#T#o3x$g;'S3x;'S;=`4d<%lO3x~7dXaQ%O~!Q![7]!c!}3x#R#S8P#T#]3x#]#^8k#^#o3x$g;'S3x;'S;=`4d<%lO3x~8UV%O~!Q![7]!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~8rVaQ%O~!Q![3x!c!}3x#R#S3x#T#o3x$g;'S3x;'S;=`4d<%lO3x~9[TO#S9X#S#T$v#T;'S9X;'S;=`9k<%lO9X~9nP;=`<%l9X~9vOj~~9{Q%`~!_!`&X#p#q:R~:WO%q~~:]Oi~~:bO{~",tokenizers:[aO,1,2,new Y("j~RQYZXz{^~^O$|~~aP!P!Qd~iO$}~~",25,181)],topRules:{SourceFile:[0,3]},dynamicPrecedences:{19:1,51:-1,55:2,69:-1,108:-1},specialized:[{term:184,get:Q=>nO[Q]||-1}],tokenPrec:5451}),oO=[X("func ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"declaration",type:"keyword"}),X("func (${receiver}) ${name}(${params}) ${type} {\n ${}\n}",{label:"func",detail:"method declaration",type:"keyword"}),X("var ${name} = ${value}",{label:"var",detail:"declaration",type:"keyword"}),X("type ${name} ${type}",{label:"type",detail:"declaration",type:"keyword"}),X("const ${name} = ${value}",{label:"const",detail:"declaration",type:"keyword"}),X("type ${name} = ${type}",{label:"type",detail:"alias declaration",type:"keyword"}),X("for ${init}; ${test}; ${update} {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for ${i} := range ${value} {\n ${}\n}",{label:"for",detail:"range",type:"keyword"}),X(`select {
\${}
}`,{label:"select",detail:"statement",type:"keyword"}),X("case ${}:\n${}",{label:"case",type:"keyword"}),X("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),X("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),X("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),X(`if \${} {
\${}
diff --git a/web/dist/assets/index-BS_Zh7d_.js b/web/dist/assets/index-B7HvTpiE.js
similarity index 97%
rename from web/dist/assets/index-BS_Zh7d_.js
rename to web/dist/assets/index-B7HvTpiE.js
index 347532d8..bdd49a75 100644
--- a/web/dist/assets/index-BS_Zh7d_.js
+++ b/web/dist/assets/index-B7HvTpiE.js
@@ -1 +1 @@
-import{b as O,d as b,L as r,f as s,g as a,s as t,j as P,l as n,t as e}from"./index-DkMe9ry1.js";const S={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},Q=r.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["isolate",-3,1,2,11,""],["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:o=>S[o]||-1}],tokenPrec:0}),i=O.define({name:"wast",parser:Q.configure({props:[s.add({App:P({closing:")",align:!1})}),a.add({App:n,BlockComment(o){return{from:o.from+2,to:o.to-2}}}),t({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function p(){return new b(i)}export{p as wast,i as wastLanguage};
+import{b as O,d as b,L as r,f as s,g as a,s as t,j as P,l as n,t as e}from"./index-C8VjSzoF.js";const S={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},Q=r.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["isolate",-3,1,2,11,""],["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:o=>S[o]||-1}],tokenPrec:0}),i=O.define({name:"wast",parser:Q.configure({props:[s.add({App:P({closing:")",align:!1})}),a.add({App:n,BlockComment(o){return{from:o.from+2,to:o.to-2}}}),t({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function p(){return new b(i)}export{p as wast,i as wastLanguage};
diff --git a/web/dist/assets/index-BRwG2R_M.js b/web/dist/assets/index-B8d2aokf.js
similarity index 99%
rename from web/dist/assets/index-BRwG2R_M.js
rename to web/dist/assets/index-B8d2aokf.js
index b5acd46c..cc4053b6 100644
--- a/web/dist/assets/index-BRwG2R_M.js
+++ b/web/dist/assets/index-B8d2aokf.js
@@ -1 +1 @@
-import{o as h,p as b,q as v,d as y,b as k,r as u,m as T,L as _,s as W,f as R,g as Y,t,j as w,E as P}from"./index-DkMe9ry1.js";const j=1,U=2,X=3,G=180,S=4,z=181,x=5,Z=182,E=6;function V(O){return O>=65&&O<=90||O>=97&&O<=122}const D=new P(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let r=O.peek(1);if(r==123){if(O.pos>a)break;O.acceptToken(j,2);return}else if(r==37){if(O.pos>a)break;let $=2,i=2;for(;;){let n=O.peek($);if(n==32||n==10)++$;else if(n==35)for(++$;;){let Q=O.peek($);if(Q<0||Q==10)break;$++}else if(n==45&&i==2)i=++$;else{let Q=n==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(Q?X:U,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(G)});function f(O,a,e){return new P(r=>{let $=r.pos;for(;;){let{next:i}=r;if(i==123&&r.peek(1)==37){let n=2;for(;;n++){let s=r.peek(n);if(s!=32&&s!=10)break}let Q="";for(;;n++){let s=r.peek(n);if(!V(s))break;Q+=String.fromCharCode(s)}if(Q==O){if(r.pos>$)break;r.acceptToken(e,2);break}}else if(i<0)break;if(r.advance(),i==10)break}r.pos>$&&r.acceptToken(a)})}const F=f("endcomment",Z,x),C=f("endraw",z,S),N=new P(O=>{if(O.next==35){for(O.advance();!(O.next==10||O.next<0||(O.next==37||O.next==125)&&O.peek(1)==125);)O.advance();O.acceptToken(E)}}),I={__proto__:null,contains:32,or:36,and:36,true:50,false:50,empty:52,forloop:54,tablerowloop:56,continue:58,in:128,with:194,for:196,as:198,if:234,endif:238,unless:244,endunless:248,elsif:252,else:256,case:262,endcase:266,when:270,endfor:278,tablerow:284,endtablerow:288,break:292,cycle:298,echo:302,render:306,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},L={__proto__:null,if:82,endif:86,elsif:90,else:94,unless:100,endunless:104,case:110,endcase:114,when:118,for:126,endfor:136,tablerow:142,endtablerow:146,break:150,continue:154,cycle:158,comment:164,endcomment:170,raw:176,endraw:182,echo:186,render:190,include:202,assign:206,capture:212,endcapture:216,increment:220,decrement:224,liquid:228},A=_.deserialize({version:14,states:"HOQYOPOOOOOP'#F{'#F{OeOaO'#CdOsQhO'#CfO!bQxO'#DQO#{OPO'#DTO$ZOPO'#D^O$iOPO'#DcO$wOPO'#DkO%VOPO'#DsO%eOSO'#EOO%jOQO'#EUO%oOPO'#EhOOOP'#G`'#G`OOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQW'#Cg'#CgO&`Q!jO,59QO&gQ!jO'#G^OsQhO'#CsOOQW'#G^'#G^OOOP,59l,59lO)PQhO,59lOsQhO,59pOsQhO,59tO)ZQhO,59vOsQhO,59yOsQhO,5:OOsQhO,5:SO!]QhO,5:WO!]QhO,5:`O)`QhO,5:dO)eQhO,5:fO)jQhO,5:hO)oQhO,5:kO)tQhO,5:qOsQhO,5:vOsQhO,5:xOsQhO,5;OOsQhO,5;QOsQhO,5;TOsQhO,5;XOsQhO,5;ZO+TQhO,5;]O+[OPO'#CdOOOP,59o,59oO#{OPO,59oO+jQxO'#DWOOOP,59x,59xO$ZOPO,59xO+oQxO'#DaOOOP,59},59}O$iOPO,59}O+tQxO'#DfOOOP,5:V,5:VO$wOPO,5:VO+yQxO'#DqOOOP,5:_,5:_O%VOPO,5:_O,OQxO'#DvOOOS'#GQ'#GQO,TOSO'#ERO,]OSO,5:jOOOQ'#GR'#GRO,bOQO'#EXO,jOQO,5:pOOOP,5;S,5;SO%oOPO,5;SO,oQxO'#EkOOOP-E9x-E9xO,tQ#|O,59SOsQhO,59VOsQhO,59VO,yQhO'#C|OOQW'#F|'#F|O-OQhO1G.lOOOP1G.l1G.lOsQhO,59VOsQhO,59ZO-WQ!jO,59_O-iQ!jO1G/WO-pQhO1G/WOOOP1G/W1G/WO-xQ!jO1G/[O.ZQ!jO1G/`OOOP1G/b1G/bO.lQ!jO1G/eO.}Q!jO1G/jO/qQ!jO1G/nO/xQhO1G/rO/}QhO1G/zOOOP1G0O1G0OOOOP1G0Q1G0QO0SQhO1G0SOOOS1G0V1G0VOOOQ1G0]1G0]O0_Q!jO1G0bO0fQ!jO1G0dO1QQ!jO1G0jO1cQ!jO1G0lO1jQ!jO1G0oO1{Q!jO1G0sO2^Q!jO1G0uO2oQhO'#EsO2vQhO'#ExO2}QhO'#FRO3UQhO'#FYO3]QhO'#F^O3dQhO'#FqOOQW'#Ga'#GaOOQW'#GT'#GTO3kQhO1G0wOsQhO'#EtOsQhO'#EyOsQhO'#E}OOQW'#FP'#FPOsQhO'#FSOsQhO'#FWO!]QhO'#FZO!]QhO'#F_OOQW'#Fc'#FcOOQW'#Fe'#FeO3rQhO'#FfOsQhO'#FhOsQhO'#FjOsQhO'#FmOsQhO'#FoOsQhO'#FrOsQhO'#FvOsQhO'#FxOOOP1G0w1G0wOOOP1G/Z1G/ZO3wQhO,59rOOOP1G/d1G/dO3|QhO,59{OOOP1G/i1G/iO4RQhO,5:QOOOP1G/q1G/qO4WQhO,5:]OOOP1G/y1G/yO4]QhO,5:bOOOS-E:O-E:OOOOP1G0U1G0UO4bQxO'#ESOOOQ-E:P-E:POOOP1G0[1G0[O4gQxO'#EYOOOP1G0n1G0nO4lQhO,5;VOOQW1G.n1G.nOOQW1G.q1G.qO7QQ!jO1G.qOOQW'#DO'#DOO7[QhO,59hOOQW-E9z-E9zOOOP7+$W7+$WO9UQ!jO1G.qO9`Q!jO1G.uOsQhO1G.yO;uQhO7+$rOOOP7+$r7+$rOOOP7+$v7+$vOOOP7+$z7+$zOOOP7+%P7+%POOOP7+%U7+%UOsQhO'#F}O;}QhO7+%YOOOP7+%Y7+%YOsQhO7+%^OsQhO7+%fOrQ!jO,5;eO@]Q!jO,5;iOBYQ!jO,5;nOCsQ!jO,5;rOEfQhO,5;uOEkQhO,5;yOEpQhO,5dOOOPAN>dAN>dO!7QQhOAN>lOOOPAN>lAN>lO!7YQhOAN>tOOOPAN>tAN>tOsQhO1G0fO!]QhO1G0fO!7bQ!jO7+&{O!8qQ!jO7+'PO!:QQhO7+'WO!;tQhO,5I[O]||-1},{term:37,get:O=>L[O]||-1}],tokenPrec:0});function l(O,a){return O.split(" ").map(e=>({label:e,type:a}))}const q=l("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),p=l("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),d=l("empty forloop tablerowloop in with as contains","keyword"),B=l("first index index0 last length rindex","property"),H=l("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function M(O){var a;let{state:e,pos:r}=O,$=T(e).resolveInner(r,-1).enterUnfinishedNodesBefore(r),i=((a=$.childBefore(r))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let n=O.matchBefore(/[\w\u00c0-\uffff]+$/);return n?{type:"expression",from:n.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function K(O,a,e,r){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:B;if(i.name=="tablerowloop")return $.length?[]:H;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let n=i.getChild("PropertyName");n&&$.unshift(O.sliceDoc(n.from,n.to)),a=i}else return[]}return r?r($,O,e):[]}function J(O={}){let a=O.filters?O.filters.concat(q):q,e=O.tags?O.tags.concat(p):p,r=O.variables?O.variables.concat(d):d,{properties:$}=O;return i=>{var n;let Q=M(i);if(!Q)return null;let s=(n=Q.from)!==null&&n!==void 0?n:Q.node?Q.node.from:i.pos,o;return Q.type=="filter"?o=a:Q.type=="tag"?o=e:Q.type=="expression"?o=r:o=K(i.state,Q.target,i,$),o.length?{options:o,from:s,validFor:/^[\w\u00c0-\uffff]*$/}:null}}const OO=h.inputHandler.of((O,a,e,r)=>r!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:b.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function c(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}const $O=k.define({name:"liquid",parser:A.configure({props:[W({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":t.keyword,"empty forloop tablerowloop":t.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":t.controlKeyword,"assign capture endcapture":t.definitionKeyword,contains:t.operatorKeyword,"render include":t.moduleKeyword,VariableName:t.variableName,TagName:t.tagName,FilterName:t.function(t.variableName),PropertyName:t.propertyName,CompareOp:t.compareOperator,AssignOp:t.definitionOperator,LogicOp:t.logicOperator,NumberLiteral:t.number,StringLiteral:t.string,BooleanLiteral:t.bool,InlineComment:t.lineComment,CommentText:t.blockComment,"{% %} {{ }}":t.brace,"( )":t.paren,".":t.derefOperator,", .. : |":t.punctuation}),R.add({Tag:w({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":c(/^\s*(\{%-?\s*)?end\w/),IfDirective:c(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:c(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),Y.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),m=v();function g(O){return $O.configure({wrap:u(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}const aO=g(m.language);function iO(O={}){let a=O.base||m,e=a.language==m.language?aO:g(a.language);return new y(e,[a.support,e.data.of({autocomplete:J(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),OO])}export{OO as closePercentBrace,iO as liquid,J as liquidCompletionSource,aO as liquidLanguage};
+import{o as h,p as b,q as v,d as y,b as k,r as u,m as T,L as _,s as W,f as R,g as Y,t,j as w,E as P}from"./index-C8VjSzoF.js";const j=1,U=2,X=3,G=180,S=4,z=181,x=5,Z=182,E=6;function V(O){return O>=65&&O<=90||O>=97&&O<=122}const D=new P(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let r=O.peek(1);if(r==123){if(O.pos>a)break;O.acceptToken(j,2);return}else if(r==37){if(O.pos>a)break;let $=2,i=2;for(;;){let n=O.peek($);if(n==32||n==10)++$;else if(n==35)for(++$;;){let Q=O.peek($);if(Q<0||Q==10)break;$++}else if(n==45&&i==2)i=++$;else{let Q=n==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(Q?X:U,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(G)});function f(O,a,e){return new P(r=>{let $=r.pos;for(;;){let{next:i}=r;if(i==123&&r.peek(1)==37){let n=2;for(;;n++){let s=r.peek(n);if(s!=32&&s!=10)break}let Q="";for(;;n++){let s=r.peek(n);if(!V(s))break;Q+=String.fromCharCode(s)}if(Q==O){if(r.pos>$)break;r.acceptToken(e,2);break}}else if(i<0)break;if(r.advance(),i==10)break}r.pos>$&&r.acceptToken(a)})}const F=f("endcomment",Z,x),C=f("endraw",z,S),N=new P(O=>{if(O.next==35){for(O.advance();!(O.next==10||O.next<0||(O.next==37||O.next==125)&&O.peek(1)==125);)O.advance();O.acceptToken(E)}}),I={__proto__:null,contains:32,or:36,and:36,true:50,false:50,empty:52,forloop:54,tablerowloop:56,continue:58,in:128,with:194,for:196,as:198,if:234,endif:238,unless:244,endunless:248,elsif:252,else:256,case:262,endcase:266,when:270,endfor:278,tablerow:284,endtablerow:288,break:292,cycle:298,echo:302,render:306,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},L={__proto__:null,if:82,endif:86,elsif:90,else:94,unless:100,endunless:104,case:110,endcase:114,when:118,for:126,endfor:136,tablerow:142,endtablerow:146,break:150,continue:154,cycle:158,comment:164,endcomment:170,raw:176,endraw:182,echo:186,render:190,include:202,assign:206,capture:212,endcapture:216,increment:220,decrement:224,liquid:228},A=_.deserialize({version:14,states:"HOQYOPOOOOOP'#F{'#F{OeOaO'#CdOsQhO'#CfO!bQxO'#DQO#{OPO'#DTO$ZOPO'#D^O$iOPO'#DcO$wOPO'#DkO%VOPO'#DsO%eOSO'#EOO%jOQO'#EUO%oOPO'#EhOOOP'#G`'#G`OOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQW'#Cg'#CgO&`Q!jO,59QO&gQ!jO'#G^OsQhO'#CsOOQW'#G^'#G^OOOP,59l,59lO)PQhO,59lOsQhO,59pOsQhO,59tO)ZQhO,59vOsQhO,59yOsQhO,5:OOsQhO,5:SO!]QhO,5:WO!]QhO,5:`O)`QhO,5:dO)eQhO,5:fO)jQhO,5:hO)oQhO,5:kO)tQhO,5:qOsQhO,5:vOsQhO,5:xOsQhO,5;OOsQhO,5;QOsQhO,5;TOsQhO,5;XOsQhO,5;ZO+TQhO,5;]O+[OPO'#CdOOOP,59o,59oO#{OPO,59oO+jQxO'#DWOOOP,59x,59xO$ZOPO,59xO+oQxO'#DaOOOP,59},59}O$iOPO,59}O+tQxO'#DfOOOP,5:V,5:VO$wOPO,5:VO+yQxO'#DqOOOP,5:_,5:_O%VOPO,5:_O,OQxO'#DvOOOS'#GQ'#GQO,TOSO'#ERO,]OSO,5:jOOOQ'#GR'#GRO,bOQO'#EXO,jOQO,5:pOOOP,5;S,5;SO%oOPO,5;SO,oQxO'#EkOOOP-E9x-E9xO,tQ#|O,59SOsQhO,59VOsQhO,59VO,yQhO'#C|OOQW'#F|'#F|O-OQhO1G.lOOOP1G.l1G.lOsQhO,59VOsQhO,59ZO-WQ!jO,59_O-iQ!jO1G/WO-pQhO1G/WOOOP1G/W1G/WO-xQ!jO1G/[O.ZQ!jO1G/`OOOP1G/b1G/bO.lQ!jO1G/eO.}Q!jO1G/jO/qQ!jO1G/nO/xQhO1G/rO/}QhO1G/zOOOP1G0O1G0OOOOP1G0Q1G0QO0SQhO1G0SOOOS1G0V1G0VOOOQ1G0]1G0]O0_Q!jO1G0bO0fQ!jO1G0dO1QQ!jO1G0jO1cQ!jO1G0lO1jQ!jO1G0oO1{Q!jO1G0sO2^Q!jO1G0uO2oQhO'#EsO2vQhO'#ExO2}QhO'#FRO3UQhO'#FYO3]QhO'#F^O3dQhO'#FqOOQW'#Ga'#GaOOQW'#GT'#GTO3kQhO1G0wOsQhO'#EtOsQhO'#EyOsQhO'#E}OOQW'#FP'#FPOsQhO'#FSOsQhO'#FWO!]QhO'#FZO!]QhO'#F_OOQW'#Fc'#FcOOQW'#Fe'#FeO3rQhO'#FfOsQhO'#FhOsQhO'#FjOsQhO'#FmOsQhO'#FoOsQhO'#FrOsQhO'#FvOsQhO'#FxOOOP1G0w1G0wOOOP1G/Z1G/ZO3wQhO,59rOOOP1G/d1G/dO3|QhO,59{OOOP1G/i1G/iO4RQhO,5:QOOOP1G/q1G/qO4WQhO,5:]OOOP1G/y1G/yO4]QhO,5:bOOOS-E:O-E:OOOOP1G0U1G0UO4bQxO'#ESOOOQ-E:P-E:POOOP1G0[1G0[O4gQxO'#EYOOOP1G0n1G0nO4lQhO,5;VOOQW1G.n1G.nOOQW1G.q1G.qO7QQ!jO1G.qOOQW'#DO'#DOO7[QhO,59hOOQW-E9z-E9zOOOP7+$W7+$WO9UQ!jO1G.qO9`Q!jO1G.uOsQhO1G.yO;uQhO7+$rOOOP7+$r7+$rOOOP7+$v7+$vOOOP7+$z7+$zOOOP7+%P7+%POOOP7+%U7+%UOsQhO'#F}O;}QhO7+%YOOOP7+%Y7+%YOsQhO7+%^OsQhO7+%fOrQ!jO,5;eO@]Q!jO,5;iOBYQ!jO,5;nOCsQ!jO,5;rOEfQhO,5;uOEkQhO,5;yOEpQhO,5dOOOPAN>dAN>dO!7QQhOAN>lOOOPAN>lAN>lO!7YQhOAN>tOOOPAN>tAN>tOsQhO1G0fO!]QhO1G0fO!7bQ!jO7+&{O!8qQ!jO7+'PO!:QQhO7+'WO!;tQhO,5I[O]||-1},{term:37,get:O=>L[O]||-1}],tokenPrec:0});function l(O,a){return O.split(" ").map(e=>({label:e,type:a}))}const q=l("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),p=l("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),d=l("empty forloop tablerowloop in with as contains","keyword"),B=l("first index index0 last length rindex","property"),H=l("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function M(O){var a;let{state:e,pos:r}=O,$=T(e).resolveInner(r,-1).enterUnfinishedNodesBefore(r),i=((a=$.childBefore(r))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let n=O.matchBefore(/[\w\u00c0-\uffff]+$/);return n?{type:"expression",from:n.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function K(O,a,e,r){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:B;if(i.name=="tablerowloop")return $.length?[]:H;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let n=i.getChild("PropertyName");n&&$.unshift(O.sliceDoc(n.from,n.to)),a=i}else return[]}return r?r($,O,e):[]}function J(O={}){let a=O.filters?O.filters.concat(q):q,e=O.tags?O.tags.concat(p):p,r=O.variables?O.variables.concat(d):d,{properties:$}=O;return i=>{var n;let Q=M(i);if(!Q)return null;let s=(n=Q.from)!==null&&n!==void 0?n:Q.node?Q.node.from:i.pos,o;return Q.type=="filter"?o=a:Q.type=="tag"?o=e:Q.type=="expression"?o=r:o=K(i.state,Q.target,i,$),o.length?{options:o,from:s,validFor:/^[\w\u00c0-\uffff]*$/}:null}}const OO=h.inputHandler.of((O,a,e,r)=>r!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:b.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function c(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}const $O=k.define({name:"liquid",parser:A.configure({props:[W({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":t.keyword,"empty forloop tablerowloop":t.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":t.controlKeyword,"assign capture endcapture":t.definitionKeyword,contains:t.operatorKeyword,"render include":t.moduleKeyword,VariableName:t.variableName,TagName:t.tagName,FilterName:t.function(t.variableName),PropertyName:t.propertyName,CompareOp:t.compareOperator,AssignOp:t.definitionOperator,LogicOp:t.logicOperator,NumberLiteral:t.number,StringLiteral:t.string,BooleanLiteral:t.bool,InlineComment:t.lineComment,CommentText:t.blockComment,"{% %} {{ }}":t.brace,"( )":t.paren,".":t.derefOperator,", .. : |":t.punctuation}),R.add({Tag:w({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":c(/^\s*(\{%-?\s*)?end\w/),IfDirective:c(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:c(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),Y.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),m=v();function g(O){return $O.configure({wrap:u(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}const aO=g(m.language);function iO(O={}){let a=O.base||m,e=a.language==m.language?aO:g(a.language);return new y(e,[a.support,e.data.of({autocomplete:J(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),OO])}export{OO as closePercentBrace,iO as liquid,J as liquidCompletionSource,aO as liquidLanguage};
diff --git a/web/dist/assets/index-R9wnJ2Ib.js b/web/dist/assets/index-BRaXjugP.js
similarity index 99%
rename from web/dist/assets/index-R9wnJ2Ib.js
rename to web/dist/assets/index-BRaXjugP.js
index 80dface4..453204f0 100644
--- a/web/dist/assets/index-R9wnJ2Ib.js
+++ b/web/dist/assets/index-BRaXjugP.js
@@ -1 +1 @@
-import{n as r,b as i,d as n,L as $,f as y,g as P,h as X,l as m,E as S,s as c,t as O}from"./index-DkMe9ry1.js";const s=110,l=1,f=2,t=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function e(T){return T>=65&&T<=90||T>=97&&T<=122||T>=161}function p(T){return T>=48&&T<=57}const W=new S((T,Q)=>{if(T.next==40){let a=T.peek(-1);(e(a)||p(a)||a==95||a==45)&&T.acceptToken(f,1)}}),d=new S(T=>{if(t.indexOf(T.peek(-1))>-1){let{next:Q}=T;(e(Q)||Q==95||Q==35||Q==46||Q==91||Q==58||Q==45)&&T.acceptToken(s)}}),Z=new S(T=>{if(t.indexOf(T.peek(-1))<0){let{next:Q}=T;if(Q==37&&(T.advance(),T.acceptToken(l)),e(Q)){do T.advance();while(e(T.next));T.acceptToken(l)}}}),w=c({"import charset namespace keyframes media supports when":O.definitionKeyword,"from to selector":O.keyword,NamespaceName:O.namespace,KeyframeName:O.labelName,TagName:O.tagName,ClassName:O.className,PseudoClassName:O.constant(O.className),IdName:O.labelName,"FeatureName PropertyName PropertyVariable":O.propertyName,AttributeName:O.attributeName,NumberLiteral:O.number,KeywordQuery:O.keyword,UnaryQueryOp:O.operatorKeyword,"CallTag ValueName":O.atom,VariableName:O.variableName,"AtKeyword Interpolation":O.special(O.variableName),Callee:O.operatorKeyword,Unit:O.unit,"UniversalSelector NestingSelector":O.definitionOperator,MatchOp:O.compareOperator,"ChildOp SiblingOp, LogicOp":O.logicOperator,BinOp:O.arithmeticOperator,Important:O.modifier,"Comment LineComment":O.blockComment,ColorLiteral:O.color,"ParenthesizedContent StringLiteral":O.string,Escape:O.special(O.string),": ...":O.punctuation,"PseudoOp #":O.derefOperator,"; ,":O.separator,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),h={__proto__:null,lang:40,"nth-child":40,"nth-last-child":40,"nth-of-type":40,"nth-last-of-type":40,dir:40,"host-context":40,and:244,or:244,not:74,only:74,url:86,"url-prefix":86,domain:86,regexp:86,when:117,selector:142,from:172,to:174},z={__proto__:null,"@import":126,"@plugin":126,"@media":152,"@charset":156,"@namespace":160,"@keyframes":166,"@supports":178},g=$.deserialize({version:14,states:"@^O!gQWOOO!nQaO'#CeOOQP'#Cd'#CdO$RQWO'#CgO$xQaO'#EaO%cQWO'#CiO%kQWO'#DZO%pQWO'#D^O%uQaO'#DfOOQP'#Es'#EsO'YQWO'#DlO'yQWO'#DyO(QQWO'#D{O(xQWO'#D}O)TQWO'#EQO'bQWO'#EWO)YQ`O'#FTO)]Q`O'#FTO)hQ`O'#FTO)vQWO'#EYOOQO'#Er'#ErOOQO'#FV'#FVOOQO'#Ec'#EcO){QWO'#EqO*WQWO'#EqQOQWOOOOQP'#Ch'#ChOOQP,59R,59RO$RQWO,59RO*bQWO'#EdO+PQWO,58|O+_QWO,59TO%kQWO,59uO%pQWO,59xO*bQWO,59{O*bQWO,59}OOQO'#De'#DeO*bQWO,5:OO,bQpO'#E}O,iQWO'#DkOOQO,58|,58|O(QQWO,58|O,pQWO,5:{OOQO,5:{,5:{OOQT'#Cl'#ClO-UQeO,59TO.cQ[O,59TOOQP'#D]'#D]OOQP,59u,59uOOQO'#D_'#D_O.hQpO,59xOOQO'#EZ'#EZO.pQ`O,5;oOOQO,5;o,5;oO/OQWO,5:WO/VQWO,5:WOOQS'#Dn'#DnO/rQWO'#DsO/yQ!fO'#FRO0eQWO'#DtOOQS'#FS'#FSO+YQWO,5:eO'bQWO'#DrOOQS'#Cu'#CuO(QQWO'#CwO0jQ!hO'#CyO2^Q!fO,5:gO2oQWO'#DWOOQS'#Ex'#ExO(QQWO'#DQOOQO'#EP'#EPO2tQWO,5:iO2yQWO,5:iOOQO'#ES'#ESO3RQWO,5:lO3WQ!fO,5:rO3iQ`O'#EkO.pQ`O,5;oOOQO,5:|,5:|O3zQWO,5:tOOQO,5:},5:}O4XQWO,5;]OOQO-E8a-E8aOOQP1G.m1G.mOOQP'#Ce'#CeO5RQaO,5;OOOQP'#Df'#DfOOQO-E8b-E8bOOQO1G.h1G.hO(QQWO1G.hO5fQWO1G.hO5nQeO1G.oO.cQ[O1G.oOOQP1G/a1G/aO6{QpO1G/dO7fQaO1G/gO8cQaO1G/iO9`QaO1G/jO:]Q!fO'#FOO:yQ!fO'#ExOOQO'#FO'#FOOOQO,5;i,5;iO<^QWO,5;iOWQWO1G/rO>]Q!fO'#DnO>qQWO,5:ZO>vQ!fO,5:_OOQO'#DP'#DPO'bQWO,5:]O?XQWO'#DwOOQS,5:b,5:bO?`QWO,5:dO'bQWO'#EiO?gQWO,5;mO*bQWO,5:`OOQO1G0P1G0PO?uQ!fO,5:^O@aQ!fO,59cOOQS,59e,59eO(QQWO,59iOOQS,59n,59nO@rQWO,59pOOQO1G0R1G0RO@yQ#tO,59rOARQ!fO,59lOOQO1G0T1G0TOBrQWO1G0TOBwQWO'#ETOOQO1G0W1G0WOOQO1G0^1G0^OOQO,5;V,5;VOOQO-E8i-E8iOCVQ!fO1G0bOCvQWO1G0`O%kQWO'#E_O$RQWO'#E`OEZQWO'#E^OOQO1G0b1G0bPEkQWO'#EcOUAN>UO!!RQWO,5;QOOQO-E8d-E8dO!!]QWOAN>dOOQS<S![;'S%T;'S;=`%f<%lO%Tm>ZY#m]|`Oy%Tz!Q%T!Q![>S![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%Tm?OY|`Oy%Tz{%T{|?n|}%T}!O?n!O!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm?sU|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@^U#m]|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@w[#m]|`Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TbAtS#xQ|`Oy%Tz;'S%T;'S;=`%f<%lO%TkBVScZOy%Tz;'S%T;'S;=`%f<%lO%TmBhXrWOy%Tz}%T}!OCT!O!P=k!P!Q%T!Q![@p![;'S%T;'S;=`%f<%lO%TmCYW|`Oy%Tz!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%TmCy[f]|`Oy%Tz}%T}!OCr!O!Q%T!Q![Cr![!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%ToDtW#iROy%Tz!O%T!O!PE^!P!Q%T!Q![>S![;'S%T;'S;=`%f<%lO%TlEcU|`Oy%Tz!O%T!O!PEu!P;'S%T;'S;=`%f<%lO%TlE|S#s[|`Oy%Tz;'S%T;'S;=`%f<%lO%T~F_VrWOy%Tz{Ft{!P%T!P!QIl!Q;'S%T;'S;=`%f<%lO%T~FyU|`OyFtyzG]z{Hd{;'SFt;'S;=`If<%lOFt~G`TOzG]z{Go{;'SG];'S;=`H^<%lOG]~GrVOzG]z{Go{!PG]!P!QHX!Q;'SG];'S;=`H^<%lOG]~H^OR~~HaP;=`<%lG]~HiW|`OyFtyzG]z{Hd{!PFt!P!QIR!Q;'SFt;'S;=`If<%lOFt~IYS|`R~Oy%Tz;'S%T;'S;=`%f<%lO%T~IiP;=`<%lFt~IsV|`S~OYIlYZ%TZyIlyzJYz;'SIl;'S;=`Jq<%lOIl~J_SS~OYJYZ;'SJY;'S;=`Jk<%lOJY~JnP;=`<%lJY~JtP;=`<%lIlmJ|[#m]Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TkKwU^ZOy%Tz![%T![!]LZ!];'S%T;'S;=`%f<%lO%TcLbS_R|`Oy%Tz;'S%T;'S;=`%f<%lO%TkLsS!ZZOy%Tz;'S%T;'S;=`%f<%lO%ThMUUrWOy%Tz!_%T!_!`Mh!`;'S%T;'S;=`%f<%lO%ThMoS|`rWOy%Tz;'S%T;'S;=`%f<%lO%TlNSW!SSrWOy%Tz!^%T!^!_Mh!_!`%T!`!aMh!a;'S%T;'S;=`%f<%lO%TjNsV!UQrWOy%Tz!_%T!_!`Mh!`!a! Y!a;'S%T;'S;=`%f<%lO%Tb! aS!UQ|`Oy%Tz;'S%T;'S;=`%f<%lO%To! rYg]Oy%Tz!b%T!b!c!!b!c!}!#R!}#T%T#T#o!#R#o#p!$O#p;'S%T;'S;=`%f<%lO%Tm!!iWg]|`Oy%Tz!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%Tm!#Y[g]|`Oy%Tz}%T}!O!#R!O!Q%T!Q![!#R![!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%To!$TW|`Oy%Tz!c%T!c!}!$m!}#T%T#T#o!$m#o;'S%T;'S;=`%f<%lO%To!$r^|`Oy%Tz}%T}!O!$m!O!Q%T!Q![!$m![!c%T!c!}!$m!}#T%T#T#o!$m#o#q%T#q#r!%n#r;'S%T;'S;=`%f<%lO%To!%uSp_|`Oy%Tz;'S%T;'S;=`%f<%lO%To!&W[#h_Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%To!'T[#h_|`Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%Tk!(OSyZOy%Tz;'S%T;'S;=`%f<%lO%Tm!(aSw]Oy%Tz;'S%T;'S;=`%f<%lO%Td!(pUOy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tk!)XS!^ZOy%Tz;'S%T;'S;=`%f<%lO%Tk!)jS!]ZOy%Tz;'S%T;'S;=`%f<%lO%To!){Y#oQOr%Trs!*ksw%Twx!.wxy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tm!*pZ|`OY!*kYZ%TZr!*krs!+csy!*kyz!+vz#O!*k#O#P!-j#P;'S!*k;'S;=`!.q<%lO!*km!+jSo]|`Oy%Tz;'S%T;'S;=`%f<%lO%T]!+yWOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d<%lO!+v]!,hOo]]!,kRO;'S!+v;'S;=`!,t;=`O!+v]!,wXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!+v<%lO!+v]!-gP;=`<%l!+vm!-oU|`Oy!*kyz!+vz;'S!*k;'S;=`!.R;=`<%l!+v<%lO!*km!.UXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!*k<%lO!+vm!.tP;=`<%l!*km!.|Z|`OY!.wYZ%TZw!.wwx!+cxy!.wyz!/oz#O!.w#O#P!1^#P;'S!.w;'S;=`!2e<%lO!.w]!/rWOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W<%lO!/o]!0_RO;'S!/o;'S;=`!0h;=`O!/o]!0kXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!/o<%lO!/o]!1ZP;=`<%l!/om!1cU|`Oy!.wyz!/oz;'S!.w;'S;=`!1u;=`<%l!/o<%lO!.wm!1xXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!.w<%lO!/om!2hP;=`<%l!.w`!2nP;=`<%l$t",tokenizers:[d,Z,W,0,1,2,3,4],topRules:{StyleSheet:[0,5]},specialized:[{term:116,get:T=>h[T]||-1},{term:23,get:T=>z[T]||-1}],tokenPrec:2180}),o=i.define({name:"less",parser:g.configure({props:[y.add({Declaration:X()}),P.add({Block:m})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"@-"}}),u=r(T=>T.name=="VariableName"||T.name=="AtKeyword");function R(){return new n(o,o.data.of({autocomplete:u}))}export{R as less,u as lessCompletionSource,o as lessLanguage};
+import{n as r,b as i,d as n,L as $,f as y,g as P,h as X,l as m,E as S,s as c,t as O}from"./index-C8VjSzoF.js";const s=110,l=1,f=2,t=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function e(T){return T>=65&&T<=90||T>=97&&T<=122||T>=161}function p(T){return T>=48&&T<=57}const W=new S((T,Q)=>{if(T.next==40){let a=T.peek(-1);(e(a)||p(a)||a==95||a==45)&&T.acceptToken(f,1)}}),d=new S(T=>{if(t.indexOf(T.peek(-1))>-1){let{next:Q}=T;(e(Q)||Q==95||Q==35||Q==46||Q==91||Q==58||Q==45)&&T.acceptToken(s)}}),Z=new S(T=>{if(t.indexOf(T.peek(-1))<0){let{next:Q}=T;if(Q==37&&(T.advance(),T.acceptToken(l)),e(Q)){do T.advance();while(e(T.next));T.acceptToken(l)}}}),w=c({"import charset namespace keyframes media supports when":O.definitionKeyword,"from to selector":O.keyword,NamespaceName:O.namespace,KeyframeName:O.labelName,TagName:O.tagName,ClassName:O.className,PseudoClassName:O.constant(O.className),IdName:O.labelName,"FeatureName PropertyName PropertyVariable":O.propertyName,AttributeName:O.attributeName,NumberLiteral:O.number,KeywordQuery:O.keyword,UnaryQueryOp:O.operatorKeyword,"CallTag ValueName":O.atom,VariableName:O.variableName,"AtKeyword Interpolation":O.special(O.variableName),Callee:O.operatorKeyword,Unit:O.unit,"UniversalSelector NestingSelector":O.definitionOperator,MatchOp:O.compareOperator,"ChildOp SiblingOp, LogicOp":O.logicOperator,BinOp:O.arithmeticOperator,Important:O.modifier,"Comment LineComment":O.blockComment,ColorLiteral:O.color,"ParenthesizedContent StringLiteral":O.string,Escape:O.special(O.string),": ...":O.punctuation,"PseudoOp #":O.derefOperator,"; ,":O.separator,"( )":O.paren,"[ ]":O.squareBracket,"{ }":O.brace}),h={__proto__:null,lang:40,"nth-child":40,"nth-last-child":40,"nth-of-type":40,"nth-last-of-type":40,dir:40,"host-context":40,and:244,or:244,not:74,only:74,url:86,"url-prefix":86,domain:86,regexp:86,when:117,selector:142,from:172,to:174},z={__proto__:null,"@import":126,"@plugin":126,"@media":152,"@charset":156,"@namespace":160,"@keyframes":166,"@supports":178},g=$.deserialize({version:14,states:"@^O!gQWOOO!nQaO'#CeOOQP'#Cd'#CdO$RQWO'#CgO$xQaO'#EaO%cQWO'#CiO%kQWO'#DZO%pQWO'#D^O%uQaO'#DfOOQP'#Es'#EsO'YQWO'#DlO'yQWO'#DyO(QQWO'#D{O(xQWO'#D}O)TQWO'#EQO'bQWO'#EWO)YQ`O'#FTO)]Q`O'#FTO)hQ`O'#FTO)vQWO'#EYOOQO'#Er'#ErOOQO'#FV'#FVOOQO'#Ec'#EcO){QWO'#EqO*WQWO'#EqQOQWOOOOQP'#Ch'#ChOOQP,59R,59RO$RQWO,59RO*bQWO'#EdO+PQWO,58|O+_QWO,59TO%kQWO,59uO%pQWO,59xO*bQWO,59{O*bQWO,59}OOQO'#De'#DeO*bQWO,5:OO,bQpO'#E}O,iQWO'#DkOOQO,58|,58|O(QQWO,58|O,pQWO,5:{OOQO,5:{,5:{OOQT'#Cl'#ClO-UQeO,59TO.cQ[O,59TOOQP'#D]'#D]OOQP,59u,59uOOQO'#D_'#D_O.hQpO,59xOOQO'#EZ'#EZO.pQ`O,5;oOOQO,5;o,5;oO/OQWO,5:WO/VQWO,5:WOOQS'#Dn'#DnO/rQWO'#DsO/yQ!fO'#FRO0eQWO'#DtOOQS'#FS'#FSO+YQWO,5:eO'bQWO'#DrOOQS'#Cu'#CuO(QQWO'#CwO0jQ!hO'#CyO2^Q!fO,5:gO2oQWO'#DWOOQS'#Ex'#ExO(QQWO'#DQOOQO'#EP'#EPO2tQWO,5:iO2yQWO,5:iOOQO'#ES'#ESO3RQWO,5:lO3WQ!fO,5:rO3iQ`O'#EkO.pQ`O,5;oOOQO,5:|,5:|O3zQWO,5:tOOQO,5:},5:}O4XQWO,5;]OOQO-E8a-E8aOOQP1G.m1G.mOOQP'#Ce'#CeO5RQaO,5;OOOQP'#Df'#DfOOQO-E8b-E8bOOQO1G.h1G.hO(QQWO1G.hO5fQWO1G.hO5nQeO1G.oO.cQ[O1G.oOOQP1G/a1G/aO6{QpO1G/dO7fQaO1G/gO8cQaO1G/iO9`QaO1G/jO:]Q!fO'#FOO:yQ!fO'#ExOOQO'#FO'#FOOOQO,5;i,5;iO<^QWO,5;iOWQWO1G/rO>]Q!fO'#DnO>qQWO,5:ZO>vQ!fO,5:_OOQO'#DP'#DPO'bQWO,5:]O?XQWO'#DwOOQS,5:b,5:bO?`QWO,5:dO'bQWO'#EiO?gQWO,5;mO*bQWO,5:`OOQO1G0P1G0PO?uQ!fO,5:^O@aQ!fO,59cOOQS,59e,59eO(QQWO,59iOOQS,59n,59nO@rQWO,59pOOQO1G0R1G0RO@yQ#tO,59rOARQ!fO,59lOOQO1G0T1G0TOBrQWO1G0TOBwQWO'#ETOOQO1G0W1G0WOOQO1G0^1G0^OOQO,5;V,5;VOOQO-E8i-E8iOCVQ!fO1G0bOCvQWO1G0`O%kQWO'#E_O$RQWO'#E`OEZQWO'#E^OOQO1G0b1G0bPEkQWO'#EcOUAN>UO!!RQWO,5;QOOQO-E8d-E8dO!!]QWOAN>dOOQS<S![;'S%T;'S;=`%f<%lO%Tm>ZY#m]|`Oy%Tz!Q%T!Q![>S![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%Tm?OY|`Oy%Tz{%T{|?n|}%T}!O?n!O!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm?sU|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@^U#m]|`Oy%Tz!Q%T!Q![@V![;'S%T;'S;=`%f<%lO%Tm@w[#m]|`Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TbAtS#xQ|`Oy%Tz;'S%T;'S;=`%f<%lO%TkBVScZOy%Tz;'S%T;'S;=`%f<%lO%TmBhXrWOy%Tz}%T}!OCT!O!P=k!P!Q%T!Q![@p![;'S%T;'S;=`%f<%lO%TmCYW|`Oy%Tz!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%TmCy[f]|`Oy%Tz}%T}!OCr!O!Q%T!Q![Cr![!c%T!c!}Cr!}#T%T#T#oCr#o;'S%T;'S;=`%f<%lO%ToDtW#iROy%Tz!O%T!O!PE^!P!Q%T!Q![>S![;'S%T;'S;=`%f<%lO%TlEcU|`Oy%Tz!O%T!O!PEu!P;'S%T;'S;=`%f<%lO%TlE|S#s[|`Oy%Tz;'S%T;'S;=`%f<%lO%T~F_VrWOy%Tz{Ft{!P%T!P!QIl!Q;'S%T;'S;=`%f<%lO%T~FyU|`OyFtyzG]z{Hd{;'SFt;'S;=`If<%lOFt~G`TOzG]z{Go{;'SG];'S;=`H^<%lOG]~GrVOzG]z{Go{!PG]!P!QHX!Q;'SG];'S;=`H^<%lOG]~H^OR~~HaP;=`<%lG]~HiW|`OyFtyzG]z{Hd{!PFt!P!QIR!Q;'SFt;'S;=`If<%lOFt~IYS|`R~Oy%Tz;'S%T;'S;=`%f<%lO%T~IiP;=`<%lFt~IsV|`S~OYIlYZ%TZyIlyzJYz;'SIl;'S;=`Jq<%lOIl~J_SS~OYJYZ;'SJY;'S;=`Jk<%lOJY~JnP;=`<%lJY~JtP;=`<%lIlmJ|[#m]Oy%Tz!O%T!O!P>S!P!Q%T!Q![@p![!g%T!g!h>y!h#X%T#X#Y>y#Y;'S%T;'S;=`%f<%lO%TkKwU^ZOy%Tz![%T![!]LZ!];'S%T;'S;=`%f<%lO%TcLbS_R|`Oy%Tz;'S%T;'S;=`%f<%lO%TkLsS!ZZOy%Tz;'S%T;'S;=`%f<%lO%ThMUUrWOy%Tz!_%T!_!`Mh!`;'S%T;'S;=`%f<%lO%ThMoS|`rWOy%Tz;'S%T;'S;=`%f<%lO%TlNSW!SSrWOy%Tz!^%T!^!_Mh!_!`%T!`!aMh!a;'S%T;'S;=`%f<%lO%TjNsV!UQrWOy%Tz!_%T!_!`Mh!`!a! Y!a;'S%T;'S;=`%f<%lO%Tb! aS!UQ|`Oy%Tz;'S%T;'S;=`%f<%lO%To! rYg]Oy%Tz!b%T!b!c!!b!c!}!#R!}#T%T#T#o!#R#o#p!$O#p;'S%T;'S;=`%f<%lO%Tm!!iWg]|`Oy%Tz!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%Tm!#Y[g]|`Oy%Tz}%T}!O!#R!O!Q%T!Q![!#R![!c%T!c!}!#R!}#T%T#T#o!#R#o;'S%T;'S;=`%f<%lO%To!$TW|`Oy%Tz!c%T!c!}!$m!}#T%T#T#o!$m#o;'S%T;'S;=`%f<%lO%To!$r^|`Oy%Tz}%T}!O!$m!O!Q%T!Q![!$m![!c%T!c!}!$m!}#T%T#T#o!$m#o#q%T#q#r!%n#r;'S%T;'S;=`%f<%lO%To!%uSp_|`Oy%Tz;'S%T;'S;=`%f<%lO%To!&W[#h_Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%To!'T[#h_|`Oy%Tz}%T}!O!&|!O!Q%T!Q![!&|![!c%T!c!}!&|!}#T%T#T#o!&|#o;'S%T;'S;=`%f<%lO%Tk!(OSyZOy%Tz;'S%T;'S;=`%f<%lO%Tm!(aSw]Oy%Tz;'S%T;'S;=`%f<%lO%Td!(pUOy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tk!)XS!^ZOy%Tz;'S%T;'S;=`%f<%lO%Tk!)jS!]ZOy%Tz;'S%T;'S;=`%f<%lO%To!){Y#oQOr%Trs!*ksw%Twx!.wxy%Tz!_%T!_!`6|!`;'S%T;'S;=`%f<%lO%Tm!*pZ|`OY!*kYZ%TZr!*krs!+csy!*kyz!+vz#O!*k#O#P!-j#P;'S!*k;'S;=`!.q<%lO!*km!+jSo]|`Oy%Tz;'S%T;'S;=`%f<%lO%T]!+yWOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d<%lO!+v]!,hOo]]!,kRO;'S!+v;'S;=`!,t;=`O!+v]!,wXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!+v<%lO!+v]!-gP;=`<%l!+vm!-oU|`Oy!*kyz!+vz;'S!*k;'S;=`!.R;=`<%l!+v<%lO!*km!.UXOY!+vZr!+vrs!,cs#O!+v#O#P!,h#P;'S!+v;'S;=`!-d;=`<%l!*k<%lO!+vm!.tP;=`<%l!*km!.|Z|`OY!.wYZ%TZw!.wwx!+cxy!.wyz!/oz#O!.w#O#P!1^#P;'S!.w;'S;=`!2e<%lO!.w]!/rWOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W<%lO!/o]!0_RO;'S!/o;'S;=`!0h;=`O!/o]!0kXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!/o<%lO!/o]!1ZP;=`<%l!/om!1cU|`Oy!.wyz!/oz;'S!.w;'S;=`!1u;=`<%l!/o<%lO!.wm!1xXOY!/oZw!/owx!,cx#O!/o#O#P!0[#P;'S!/o;'S;=`!1W;=`<%l!.w<%lO!/om!2hP;=`<%l!.w`!2nP;=`<%l$t",tokenizers:[d,Z,W,0,1,2,3,4],topRules:{StyleSheet:[0,5]},specialized:[{term:116,get:T=>h[T]||-1},{term:23,get:T=>z[T]||-1}],tokenPrec:2180}),o=i.define({name:"less",parser:g.configure({props:[y.add({Declaration:X()}),P.add({Block:m})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"@-"}}),u=r(T=>T.name=="VariableName"||T.name=="AtKeyword");function R(){return new n(o,o.data.of({autocomplete:u}))}export{R as less,u as lessCompletionSource,o as lessLanguage};
diff --git a/web/dist/assets/index-DkMe9ry1.js b/web/dist/assets/index-C8VjSzoF.js
similarity index 98%
rename from web/dist/assets/index-DkMe9ry1.js
rename to web/dist/assets/index-C8VjSzoF.js
index 645297a0..39f5eab9 100644
--- a/web/dist/assets/index-DkMe9ry1.js
+++ b/web/dist/assets/index-C8VjSzoF.js
@@ -24,7 +24,7 @@ var Gae=Object.defineProperty;var Wae=(t,e,n)=>e in t?Gae(t,e,{enumerable:!0,con
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[T$]=this[T$]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=t5(o);r[a]||(p0e(i,o),r[a]=!0)}return Le.isArray(e)?e.forEach(s):s(e),this}};xs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Le.reduceDescriptors(xs.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});Le.freezeMethods(xs);function ET(t,e){const n=this||i7,r=e||n,i=xs.from(r.headers);let s=r.data;return Le.forEach(t,function(a){s=a.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function kW(t){return!!(t&&t.__CANCEL__)}function Mu(t,e,n){jt.call(this,t??"canceled",jt.ERR_CANCELED,e,n),this.name="CanceledError"}Le.inherits(Mu,jt,{__CANCEL__:!0});function PW(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new jt("Request failed with status code "+n.status,[jt.ERR_BAD_REQUEST,jt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function T0e(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function O0e(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,f=0;for(;d!==i;)f+=n[d++],d=d%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o{n=u,i=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?o(c,u):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Jh=(t,e,n=3)=>{let r=0;const i=O0e(50,250);return m0e(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,c=i(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},O$=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},m$=t=>(...e)=>Le.asap(()=>t(...e)),g0e=Pi.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Pi.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Pi.origin),Pi.navigator&&/(msie|trident)/i.test(Pi.navigator.userAgent)):()=>!0,Q0e=Pi.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];Le.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Le.isString(r)&&o.push("path="+r),Le.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function _0e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function v0e(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function RW(t,e,n){let r=!_0e(e);return t&&r||n==!1?v0e(t,e):e}const g$=t=>t instanceof xs?{...t}:t;function w4(t,e){e=e||{};const n={};function r(c,u,d,f){return Le.isPlainObject(c)&&Le.isPlainObject(u)?Le.merge.call({caseless:f},c,u):Le.isPlainObject(u)?Le.merge({},u):Le.isArray(u)?u.slice():u}function i(c,u,d,f){if(Le.isUndefined(u)){if(!Le.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!Le.isUndefined(u))return r(void 0,u)}function o(c,u){if(Le.isUndefined(u)){if(!Le.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in t)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>i(g$(c),g$(u),d,!0)};return Le.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||i,f=d(t[u],e[u],u);Le.isUndefined(f)&&d!==a||(n[u]=f)}),n}const MW=t=>{const e=w4({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=xs.from(o),e.url=LW(RW(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(Le.isFormData(n)){if(Pi.hasStandardBrowserEnv||Pi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Pi.hasStandardBrowserEnv&&(r&&Le.isFunction(r)&&(r=r(e)),r||r!==!1&&g0e(e.url))){const c=i&&s&&Q0e.read(s);c&&o.set(i,c)}return e},y0e=typeof XMLHttpRequest<"u",b0e=y0e&&function(t){return new Promise(function(n,r){const i=MW(t);let s=i.data;const o=xs.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,f,h,p;function T(){h&&h(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout;function O(){if(!m)return;const Q=xs.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:Q,config:t,request:m};PW(function(S){n(S),T()},function(S){r(S),T()},_),m=null}"onloadend"in m?m.onloadend=O:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(O)},m.onabort=function(){m&&(r(new jt("Request aborted",jt.ECONNABORTED,t,m)),m=null)},m.onerror=function(){r(new jt("Network Error",jt.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let v=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||$W;i.timeoutErrorMessage&&(v=i.timeoutErrorMessage),r(new jt(v,_.clarifyTimeoutError?jt.ETIMEDOUT:jt.ECONNABORTED,t,m)),m=null},s===void 0&&o.setContentType(null),"setRequestHeader"in m&&Le.forEach(o.toJSON(),function(v,_){m.setRequestHeader(_,v)}),Le.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),a&&a!=="json"&&(m.responseType=i.responseType),c&&([f,p]=Jh(c,!0),m.addEventListener("progress",f)),l&&m.upload&&([d,h]=Jh(l),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=Q=>{m&&(r(!Q||Q.type?new Mu(null,t,m):Q),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const g=T0e(i.url);if(g&&Pi.protocols.indexOf(g)===-1){r(new jt("Unsupported protocol "+g+":",jt.ERR_BAD_REQUEST,t));return}m.send(s||null)})},S0e=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof jt?u:new Mu(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,s(new jt(`timeout ${e} of ms exceeded`,jt.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>Le.asap(a),l}},x0e=function*(t,e){let n=t.byteLength;if(n{const i=E0e(t,e);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},gp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",DW=gp&&typeof ReadableStream=="function",C0e=gp&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),NW=(t,...e)=>{try{return!!t(...e)}catch{return!1}},L0e=DW&&NW(()=>{let t=!1;const e=new Request(Pi.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),_$=64*1024,_b=DW&&NW(()=>Le.isReadableStream(new Response("").body)),e9={stream:_b&&(t=>t.body)};gp&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!e9[e]&&(e9[e]=Le.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new jt(`Response type '${e}' is not supported`,jt.ERR_NOT_SUPPORT,r)})})})(new Response);const $0e=async t=>{if(t==null)return 0;if(Le.isBlob(t))return t.size;if(Le.isSpecCompliantForm(t))return(await new Request(Pi.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(Le.isArrayBufferView(t)||Le.isArrayBuffer(t))return t.byteLength;if(Le.isURLSearchParams(t)&&(t=t+""),Le.isString(t))return(await C0e(t)).byteLength},A0e=async(t,e)=>{const n=Le.toFiniteNumber(t.getContentLength());return n??$0e(e)},k0e=gp&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=MW(t);c=c?(c+"").toLowerCase():"text";let h=S0e([i,s&&s.toAbortSignal()],o),p;const T=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(l&&L0e&&n!=="get"&&n!=="head"&&(m=await A0e(u,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),y;if(Le.isFormData(r)&&(y=_.headers.get("content-type"))&&u.setContentType(y),_.body){const[S,x]=O$(m,Jh(m$(l)));r=Q$(_.body,_$,S,x)}}Le.isString(d)||(d=d?"include":"omit");const O="credentials"in Request.prototype;p=new Request(e,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:O?d:void 0});let g=await fetch(p);const Q=_b&&(c==="stream"||c==="response");if(_b&&(a||Q&&T)){const _={};["status","statusText","headers"].forEach(E=>{_[E]=g[E]});const y=Le.toFiniteNumber(g.headers.get("content-length")),[S,x]=a&&O$(y,Jh(m$(a),!0))||[];g=new Response(Q$(g.body,_$,S,()=>{x&&x(),T&&T()}),_)}c=c||"text";let v=await e9[Le.findKey(e9,c)||"text"](g,t);return!Q&&T&&T(),await new Promise((_,y)=>{PW(_,y,{data:v,headers:xs.from(g.headers),status:g.status,statusText:g.statusText,config:t,request:p})})}catch(O){throw T&&T(),O&&O.name==="TypeError"&&/fetch/i.test(O.message)?Object.assign(new jt("Network Error",jt.ERR_NETWORK,t,p),{cause:O.cause||O}):jt.from(O,O&&O.code,t,p)}}),vb={http:jce,xhr:b0e,fetch:k0e};Le.forEach(vb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const v$=t=>`- ${t}`,P0e=t=>Le.isFunction(t)||t===null||t===!1,IW={getAdapter:t=>{t=Le.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
`+s.map(v$).join(`
`):" "+v$(s[0]):"as no adapter specified";throw new jt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:vb};function wT(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Mu(null,t)}function y$(t){return wT(t),t.headers=xs.from(t.headers),t.data=ET.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),IW.getAdapter(t.adapter||i7.adapter)(t).then(function(r){return wT(t),r.data=ET.call(t,t.transformResponse,r),r.headers=xs.from(r.headers),r},function(r){return kW(r)||(wT(t),r&&r.response&&(r.response.data=ET.call(t,t.transformResponse,r.response),r.response.headers=xs.from(r.response.headers))),Promise.reject(r)})}const HW="1.8.2",Qp={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Qp[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const b$={};Qp.transitional=function(e,n,r){function i(s,o){return"[Axios v"+HW+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new jt(i(o," has been removed"+(n?" in "+n:"")),jt.ERR_DEPRECATED);return n&&!b$[o]&&(b$[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};Qp.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function R0e(t,e,n){if(typeof t!="object")throw new jt("options must be an object",jt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new jt("option "+s+" must be "+l,jt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new jt("Unknown option "+s,jt.ERR_BAD_OPTION)}}const oh={assertOptions:R0e,validators:Qp},h1=oh.validators;let _4=class{constructor(e){this.defaults=e,this.interceptors={request:new p$,response:new p$}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
-`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=w4(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&oh.assertOptions(r,{silentJSONParsing:h1.transitional(h1.boolean),forcedJSONParsing:h1.transitional(h1.boolean),clarifyTimeoutError:h1.transitional(h1.boolean)},!1),i!=null&&(Le.isFunction(i)?n.paramsSerializer={serialize:i}:oh.assertOptions(i,{encode:h1.function,serialize:h1.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),oh.assertOptions(n,{baseUrl:h1.spelling("baseURL"),withXsrfToken:h1.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&Le.merge(s.common,s[n.method]);s&&Le.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=xs.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(l=l&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const c=[];this.interceptors.response.forEach(function(T){c.push(T.fulfilled,T.rejected)});let u,d=0,f;if(!l){const p=[y$.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),f=p.length,u=Promise.resolve(n);d{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Mu(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new VW(function(i){e=i}),cancel:e}}};function D0e(t){return function(n){return t.apply(null,n)}}function N0e(t){return Le.isObject(t)&&t.isAxiosError===!0}const yb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yb).forEach(([t,e])=>{yb[e]=t});function qW(t){const e=new _4(t),n=gW(_4.prototype.request,e);return Le.extend(n,_4.prototype,e,{allOwnKeys:!0}),Le.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return qW(w4(t,i))},n}const Ae=qW(i7);Ae.Axios=_4;Ae.CanceledError=Mu;Ae.CancelToken=M0e;Ae.isCancel=kW;Ae.VERSION=HW;Ae.toFormData=mp;Ae.AxiosError=jt;Ae.Cancel=Ae.CanceledError;Ae.all=function(e){return Promise.all(e)};Ae.spread=D0e;Ae.isAxiosError=N0e;Ae.mergeConfig=w4;Ae.AxiosHeaders=xs;Ae.formToJSON=t=>AW(Le.isHTMLForm(t)?new FormData(t):t);Ae.getAdapter=IW.getAdapter;Ae.HttpStatusCode=yb;Ae.default=Ae;const{Axios:gRr,AxiosError:QRr,CanceledError:_Rr,isCancel:vRr,CancelToken:yRr,VERSION:bRr,all:SRr,Cancel:xRr,isAxiosError:ERr,spread:wRr,toFormData:CRr,AxiosHeaders:LRr,HttpStatusCode:$Rr,formToJSON:ARr,getAdapter:kRr,mergeConfig:PRr}=Ae;/*!
+`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=w4(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&oh.assertOptions(r,{silentJSONParsing:h1.transitional(h1.boolean),forcedJSONParsing:h1.transitional(h1.boolean),clarifyTimeoutError:h1.transitional(h1.boolean)},!1),i!=null&&(Le.isFunction(i)?n.paramsSerializer={serialize:i}:oh.assertOptions(i,{encode:h1.function,serialize:h1.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),oh.assertOptions(n,{baseUrl:h1.spelling("baseURL"),withXsrfToken:h1.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&Le.merge(s.common,s[n.method]);s&&Le.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=xs.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(l=l&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const c=[];this.interceptors.response.forEach(function(T){c.push(T.fulfilled,T.rejected)});let u,d=0,f;if(!l){const p=[y$.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),f=p.length,u=Promise.resolve(n);d{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Mu(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new VW(function(i){e=i}),cancel:e}}};function D0e(t){return function(n){return t.apply(null,n)}}function N0e(t){return Le.isObject(t)&&t.isAxiosError===!0}const yb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(yb).forEach(([t,e])=>{yb[e]=t});function qW(t){const e=new _4(t),n=gW(_4.prototype.request,e);return Le.extend(n,_4.prototype,e,{allOwnKeys:!0}),Le.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return qW(w4(t,i))},n}const Ae=qW(i7);Ae.Axios=_4;Ae.CanceledError=Mu;Ae.CancelToken=M0e;Ae.isCancel=kW;Ae.VERSION=HW;Ae.toFormData=mp;Ae.AxiosError=jt;Ae.Cancel=Ae.CanceledError;Ae.all=function(e){return Promise.all(e)};Ae.spread=D0e;Ae.isAxiosError=N0e;Ae.mergeConfig=w4;Ae.AxiosHeaders=xs;Ae.formToJSON=t=>AW(Le.isHTMLForm(t)?new FormData(t):t);Ae.getAdapter=IW.getAdapter;Ae.HttpStatusCode=yb;Ae.default=Ae;const{Axios:QRr,AxiosError:_Rr,CanceledError:vRr,isCancel:yRr,CancelToken:bRr,VERSION:SRr,all:xRr,Cancel:ERr,isAxiosError:wRr,spread:CRr,toFormData:LRr,AxiosHeaders:$Rr,HttpStatusCode:ARr,formToJSON:kRr,getAdapter:PRr,mergeConfig:RRr}=Ae;/*!
* vue-router v4.4.5
* (c) 2024 Eduardo San Martin Morote
* @license MIT
@@ -554,16 +554,20 @@ ${i}
`,end_user_message_id_template:"",start_ai_header_id_template:"Assistant: ",end_ai_header_id_template:`
`,end_ai_message_id_template:"<|end_of_sentence|>"}};r[e]&&(n=r[e]),Object.entries(n).forEach(([i,s])=>{this.$emit("setting-updated",{key:i,value:s})})},async loadThinkingPresets(){this.loadLocalPresets();try{const t=await this.api_post_req("get_thinking_methods");t.status==="success"&&Array.isArray(t.thinking_methods)?this.thinkingPresets=t.thinking_methods.map(e=>({...e,isLocal:!1}))||[]:(console.error("Failed to load thinking methods or invalid format:",t.error||"Invalid response"),this.thinkingPresets=[])}catch(t){console.error("Error fetching thinking methods:",t),this.show_toast("Failed to load thinking methods from server.",4,!1),this.thinkingPresets=[]}finally{this.updateSelectedPresetName()}},loadLocalPresets(){const t=localStorage.getItem("localThinkingPresets");if(t)try{this.localThinkingPresets=JSON.parse(t).map(e=>({...e,isLocal:!0}))}catch(e){console.error("Failed to parse local thinking presets:",e),localStorage.removeItem("localThinkingPresets"),this.localThinkingPresets=[],this.show_toast("Error loading local presets. Cleared invalid data.",4,!1)}else this.localThinkingPresets=[]},saveLocalPresets(){try{const t=this.localThinkingPresets.map(({isLocal:e,...n})=>n);localStorage.setItem("localThinkingPresets",JSON.stringify(t))}catch(t){console.error("Failed to save local thinking presets:",t),this.show_toast("Could not save preset locally. Storage might be full or unavailable.",4,!1)}},updateSelectedPresetName(){this.$nextTick(()=>{const t=this.config.thinking_prompt,e=this.allThinkingPresets.find(n=>n.prompt===t);this.selectedPresetName=e?e.name:""})},selectPreset(t){if(!t){this.selectedPresetName="";return}const e=this.allThinkingPresets.find(n=>n.name===t);e&&(this.$emit("setting-updated",{key:"thinking_prompt",value:e.prompt}),this.selectedPresetName=e.name)},saveNewPreset(){const t=this.newPreset.name.trim(),e=this.newPreset.description.trim(),n=this.newPreset.author.trim();let r=this.newPreset.prompt.trim();if(!t||!e||!n||!r){this.show_toast("Please fill in all required fields.",4,!1);return}if(r.startsWith("")||(r=`
${r}`),r.endsWith(" ")||(r=`${r}
- `),this.allThinkingPresets.some(s=>s.name.toLowerCase()===t.toLowerCase())){this.show_toast(`Preset name "${t}" already exists. Please choose a unique name.`,4,!1);return}const i={name:t,description:e,author:n,prompt:r,isLocal:!0};this.localThinkingPresets.push(i),this.saveLocalPresets(),this.show_toast(`Local preset "${t}" added.`,4,!0),this.$nextTick(()=>{this.selectPreset(t)}),this.newPreset={name:"",description:"",author:"",prompt:""},this.showAddThinkingPresetForm=!1},replaceFeatherIcons(){Fe(()=>{try{Re?Re.replace():console.warn("Feather icons library not available.")}catch(t){console.error("Error replacing Feather icons:",t)}})}},mounted(){this.replaceFeatherIcons(),this.loadThinkingPresets(),this.updateSelectedPresetName()},updated(){this.replaceFeatherIcons()}},y6r={class:"user-settings-panel space-y-6"},b6r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},S6r={class:"setting-item"},x6r=["value"],E6r={class:"setting-item"},w6r=["value"],C6r={class:"setting-item items-start"},L6r={class:"flex-1 flex items-center gap-4"},$6r={class:"w-12 h-12 rounded-full overflow-hidden bg-blue-200 dark:bg-blue-700 ring-2 ring-offset-2 dark:ring-offset-blue-900 ring-blue-300 dark:ring-blue-600"},A6r=["src"],k6r={class:"flex gap-2"},P6r={class:"btn btn-secondary btn-sm cursor-pointer"},R6r=["disabled"],M6r=["disabled"],D6r={key:0,class:"text-xs text-blue-500 dark:text-blue-400 italic ml-2"},N6r={class:"setting-item items-start"},I6r=["value"],H6r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},V6r={class:"setting-item"},q6r=["value"],U6r={class:"setting-item"},B6r=["value"],z6r={class:"setting-item items-start"},X6r={class:"flex-1 flex items-center gap-4"},F6r={class:"w-12 h-12 rounded-full overflow-hidden bg-blue-200 dark:bg-blue-700 ring-2 ring-offset-2 dark:ring-offset-blue-900 ring-blue-300 dark:ring-blue-600"},j6r=["src"],Y6r={class:"flex gap-2"},G6r={class:"btn btn-secondary btn-sm cursor-pointer"},W6r=["disabled"],Z6r=["disabled"],K6r={key:0,class:"text-xs text-blue-500 dark:text-blue-400 italic ml-2"},J6r={class:"toggle-item"},edr={class:"toggle-item"},tdr={class:"toggle-item"},ndr={class:"toggle-item"},rdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},idr={class:"toggle-item"},sdr={class:"toggle-item"},odr={class:"toggle-item"},adr={class:"toggle-item"},ldr={class:"toggle-item"},cdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},udr={class:"setting-item items-start p-4 bg-red-100 dark:bg-red-900/30 rounded-lg border border-red-300 dark:border-red-700"},ddr={class:"flex justify-between items-start w-full"},fdr={class:"setting-item"},hdr=["value"],pdr={class:"setting-item"},Tdr=["value"],Odr={class:"setting-item items-start"},mdr=["value"],gdr={class:"toggle-item"},Qdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},_dr={class:"grid gap-6 bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md border border-gray-200 dark:border-gray-600"},vdr={class:"setting-item"},ydr=["selected"],bdr=["selected"],Sdr=["selected"],xdr=["selected"],Edr=["selected"],wdr=["selected"],Cdr=["selected"],Ldr=["selected"],$dr={class:"grid md:grid-cols-2 gap-4"},Adr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},kdr=["value"],Pdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Rdr=["value"],Mdr={class:"grid md:grid-cols-2 gap-4"},Ddr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Ndr=["value"],Idr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Hdr=["value"],Vdr={class:"grid md:grid-cols-2 gap-4"},qdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Udr=["value"],Bdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},zdr=["value"],Xdr={class:"grid md:grid-cols-2 gap-4"},Fdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},jdr=["value"],Ydr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Gdr=["value"],Wdr={class:"setting-item items-start"},Zdr=["value"],Kdr={class:"setting-item"},Jdr=["value"],efr={class:"setting-item items-start"},tfr={class:"p-4 bg-gray-100 dark:bg-gray-900 rounded-md flex-grow border border-gray-200 dark:border-gray-700 overflow-x-auto text-sm"},nfr=["innerHTML"],rfr={class:"toggle-item"},ifr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},sfr={class:"grid gap-6 bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md border border-gray-200 dark:border-gray-600"},ofr={class:"space-y-4"},afr={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mb-2"},lfr={class:"flex items-center gap-2 flex-wrap"},cfr=["value"],ufr=["value"],dfr={key:0,class:"mt-4 p-4 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700 space-y-4"},ffr={class:"setting-item !py-0"},hfr={class:"setting-item !py-0"},pfr={class:"setting-item !py-0"},Tfr={class:"setting-item !py-0 items-start"},Ofr={class:"setting-item items-start"},mfr=["value"],gfr={class:"setting-item items-start"},Qfr=["value"],_fr={class:"toggle-item"},vfr={class:"toggle-item"},yfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},bfr={class:"toggle-item"},Sfr={class:"toggle-item"},xfr={class:"toggle-item"},Efr={class:"toggle-item"},wfr={class:"toggle-item"},Cfr={class:"toggle-item"},Lfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},$fr={class:"toggle-item"},Afr={class:"toggle-item"},kfr={class:"toggle-item"},Pfr={class:"setting-item"},Rfr=["value"],Mfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Dfr={class:"toggle-item"},Nfr={class:"toggle-item"},Ifr={class:"toggle-item"},Hfr={class:"toggle-item"},Vfr={class:"toggle-item"},qfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ufr={class:"toggle-item"},Bfr={class:"setting-item items-start"},zfr={class:"flex-grow space-y-1"},Xfr=["value"],Ffr={class:"toggle-item"},jfr={class:"toggle-item"},Yfr={class:"toggle-item"},Gfr={class:"toggle-item"},Wfr={class:"toggle-item"},Zfr={class:"toggle-item"},Kfr={class:"toggle-item"},Jfr={class:"toggle-item"},e7r={class:"toggle-item"},t7r={class:"toggle-item"};function n7r(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",y6r,[e[161]||(e[161]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Main Configuration ",-1)),b("div",b6r,[e[80]||(e[80]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Application Branding",-1)),b("div",S6r,[e[75]||(e[75]=b("label",{for:"app_custom_name",class:"setting-label"},"Application Name",-1)),b("input",{type:"text",id:"app_custom_name",value:n.config.app_custom_name,onInput:e[0]||(e[0]=a=>s.updateValue("app_custom_name",a.target.value)),class:"input flex-grow",placeholder:"Default: LoLLMs"},null,40,x6r)]),b("div",E6r,[e[76]||(e[76]=b("label",{for:"app_custom_slogan",class:"setting-label"},"Application Slogan",-1)),b("input",{type:"text",id:"app_custom_slogan",value:n.config.app_custom_slogan,onInput:e[1]||(e[1]=a=>s.updateValue("app_custom_slogan",a.target.value)),class:"input flex-grow",placeholder:"Default: Lord of Large Language Models"},null,40,w6r)]),b("div",C6r,[e[78]||(e[78]=b("label",{class:"setting-label pt-2"},"Application Logo",-1)),b("div",L6r,[b("div",$6r,[b("img",{src:s.logoSrc,class:"w-full h-full object-cover",alt:"App Logo"},null,8,A6r)]),b("div",k6r,[b("label",P6r,[e[77]||(e[77]=Se(" Upload Logo ")),b("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>s.uploadLogo&&s.uploadLogo(...a)),accept:"image/*",class:"hidden",disabled:i.isUploadingLogo},null,40,R6r)]),n.config.app_custom_logo?(k(),R("button",{key:0,onClick:e[3]||(e[3]=(...a)=>s.removeLogo&&s.removeLogo(...a)),class:"btn btn-secondary btn-sm text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700",disabled:i.isUploadingLogo}," Remove Logo ",8,M6r)):ne("",!0)]),i.isUploadingLogo?(k(),R("span",D6r,"Uploading...")):ne("",!0)])]),b("div",N6r,[e[79]||(e[79]=b("label",{for:"app_custom_welcome_message",class:"setting-label pt-2"},"Custom Welcome Message",-1)),b("textarea",{id:"app_custom_welcome_message",value:n.config.app_custom_welcome_message,onInput:e[4]||(e[4]=a=>s.updateValue("app_custom_welcome_message",a.target.value)),class:"input flex-grow min-h-[80px] resize-y",placeholder:"Enter a custom welcome message shown on the main page (leave blank for default)."},null,40,I6r)])]),b("div",H6r,[e[89]||(e[89]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Interaction Parameters",-1)),b("div",V6r,[e[81]||(e[81]=b("label",{for:"user_name",class:"setting-label"},"User Name",-1)),b("input",{type:"text",id:"user_name",value:n.config.user_name,onInput:e[5]||(e[5]=a=>s.updateValue("user_name",a.target.value)),class:"input flex-grow",placeholder:"Default: user"},null,40,q6r)]),b("div",U6r,[e[82]||(e[82]=b("label",{for:"user_description",class:"setting-label"},"User Description",-1)),b("textarea",{id:"user_description",value:n.config.user_description,onInput:e[6]||(e[6]=a=>s.updateValue("user_description",a.target.value)),class:"input flex-grow",placeholder:"Optional: Describe yourself to the AI"},null,40,B6r)]),b("div",z6r,[e[84]||(e[84]=b("label",{class:"setting-label pt-2"},"User Avatar",-1)),b("div",X6r,[b("div",F6r,[b("img",{src:s.userAvatarSrc,class:"w-full h-full object-cover",alt:"User Avatar"},null,8,j6r)]),b("div",Y6r,[b("label",G6r,[e[83]||(e[83]=Se(" Upload Avatar ")),b("input",{type:"file",onChange:e[7]||(e[7]=(...a)=>s.uploadUserAvatar&&s.uploadUserAvatar(...a)),accept:"image/*",class:"hidden",disabled:i.isUploadingAvatar},null,40,W6r)]),n.config.user_avatar?(k(),R("button",{key:0,onClick:e[8]||(e[8]=(...a)=>s.removeUserAvatar&&s.removeUserAvatar(...a)),class:"btn btn-secondary btn-sm text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700",disabled:i.isUploadingAvatar}," Remove Avatar ",8,Z6r)):ne("",!0)]),i.isUploadingAvatar?(k(),R("span",K6r,"Uploading...")):ne("",!0)])]),b("div",J6r,[e[85]||(e[85]=b("label",{for:"use_user_name_in_discussions",class:"toggle-label"},[Se(" Use User Name in Discussions "),b("span",{class:"toggle-description"},"Prefix user messages with the 'User Name' defined above.")],-1)),te(o,{id:"use_user_name_in_discussions",checked:n.config.use_user_name_in_discussions,"onUpdate:checked":e[9]||(e[9]=a=>s.updateValue("use_user_name_in_discussions",a))},null,8,["checked"])]),b("div",edr,[e[86]||(e[86]=b("label",{for:"use_assistant_name_in_discussion",class:"toggle-label"},[Se(" Use Assistant Name in Discussions "),b("span",{class:"toggle-description"},"Prefix AI messages with the current personality's name.")],-1)),te(o,{id:"use_assistant_name_in_discussion",checked:n.config.use_assistant_name_in_discussion,"onUpdate:checked":e[10]||(e[10]=a=>s.updateValue("use_assistant_name_in_discussion",a))},null,8,["checked"])]),b("div",tdr,[e[87]||(e[87]=b("label",{for:"use_model_name_in_discussions",class:"toggle-label"},[Se(" Use Model Name in Discussions "),b("span",{class:"toggle-description"},"Include the model name in AI message headers.")],-1)),te(o,{id:"use_model_name_in_discussions",checked:n.config.use_model_name_in_discussions,"onUpdate:checked":e[11]||(e[11]=a=>s.updateValue("use_model_name_in_discussions",a))},null,8,["checked"])]),b("div",ndr,[e[88]||(e[88]=b("label",{for:"use_user_informations_in_discussion",class:"toggle-label"},[Se(" Use User Information in Discussion Context "),b("span",{class:"toggle-description"},"Include 'User Name' and 'User Description' in the context sent to the AI.")],-1)),te(o,{id:"use_user_informations_in_discussion",checked:n.config.use_user_informations_in_discussion,"onUpdate:checked":e[12]||(e[12]=a=>s.updateValue("use_user_informations_in_discussion",a))},null,8,["checked"])])]),b("div",rdr,[e[95]||(e[95]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"UI & Behavior",-1)),b("div",idr,[e[90]||(e[90]=b("label",{for:"auto_title",class:"toggle-label"},[Se(" Automatic Discussion Naming "),b("span",{class:"toggle-description"},"Let AI name your discussions automatically based on the first message.")],-1)),te(o,{id:"auto_title",checked:n.config.auto_title,"onUpdate:checked":e[13]||(e[13]=a=>s.updateValue("auto_title",a))},null,8,["checked"])]),b("div",sdr,[e[91]||(e[91]=b("label",{for:"auto_show_browser",class:"toggle-label"},[Se(" Auto-launch Browser "),b("span",{class:"toggle-description"},"Open the default web browser automatically when LoLLMs starts.")],-1)),te(o,{id:"auto_show_browser",checked:n.config.auto_show_browser,"onUpdate:checked":e[14]||(e[14]=a=>s.updateValue("auto_show_browser",a))},null,8,["checked"])]),b("div",odr,[e[92]||(e[92]=b("label",{for:"app_show_changelogs",class:"toggle-label"},[Se(" Show Startup Changelog "),b("span",{class:"toggle-description"},"Display the changelog modal window when the application starts after an update.")],-1)),te(o,{id:"app_show_changelogs",checked:n.config.app_show_changelogs,"onUpdate:checked":e[15]||(e[15]=a=>s.updateValue("app_show_changelogs",a))},null,8,["checked"])]),b("div",adr,[e[93]||(e[93]=b("label",{for:"app_show_fun_facts",class:"toggle-label"},[Se(" Show Fun Facts "),b("span",{class:"toggle-description"},"Display fun facts related to AI and LLMs while loading or waiting.")],-1)),te(o,{id:"app_show_fun_facts",checked:n.config.app_show_fun_facts,"onUpdate:checked":e[16]||(e[16]=a=>s.updateValue("app_show_fun_facts",a))},null,8,["checked"])]),b("div",ldr,[e[94]||(e[94]=b("label",{for:"copy_to_clipboard_add_all_details",class:"toggle-label"},[Se(" Enhanced Message Copy "),b("span",{class:"toggle-description"},"Include metadata (sender, model, etc.) when copying messages from discussions.")],-1)),te(o,{id:"copy_to_clipboard_add_all_details",checked:n.config.copy_to_clipboard_add_all_details,"onUpdate:checked":e[17]||(e[17]=a=>s.updateValue("copy_to_clipboard_add_all_details",a))},null,8,["checked"])])]),b("div",cdr,[e[101]||(e[101]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Server & Access",-1)),b("div",udr,[b("div",ddr,[e[96]||(e[96]=To(' Enable Remote Access (Security Risk) Warning: Enabling this allows connections from any device on your network (or potentially the internet if port-forwarded). Only enable if you understand the risks and have secured your network. Consider using 'Allowed Origins' below for added security.
',1)),te(o,{id:"force_accept_remote_access",checked:n.config.force_accept_remote_access,"onUpdate:checked":e[18]||(e[18]=a=>s.updateValue("force_accept_remote_access",a))},null,8,["checked"])])]),b("div",fdr,[e[97]||(e[97]=b("label",{for:"host",class:"setting-label"},[Se(" Host Address "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Hostname or IP to bind the server to. Use '0.0.0.0' for remote access. Requires restart.")],-1)),b("input",{type:"text",id:"host",value:n.config.host,onInput:e[19]||(e[19]=a=>s.updateValue("host",a.target.value)),class:"input flex-grow",placeholder:"localhost or 0.0.0.0"},null,40,hdr)]),b("div",pdr,[e[98]||(e[98]=b("label",{for:"port",class:"setting-label"},[Se(" Port "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Port number for the server. Requires restart.")],-1)),b("input",{type:"number",id:"port",value:n.config.port,onInput:e[20]||(e[20]=a=>s.updateValue("port",parseInt(a.target.value)||9600)),min:"1",max:"65535",class:"input flex-grow",placeholder:"9600"},null,40,Tdr)]),b("div",Odr,[e[99]||(e[99]=b("label",{for:"allowed_origins",class:"setting-label pt-2"},[Se(" Allowed Origins (CORS) "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Comma-separated list of allowed origins for cross-origin requests (e.g., `http://localhost:8080,https://my-app.com`). Leave empty or `*` to allow all (less secure if remote access is enabled).")],-1)),b("input",{type:"text",id:"allowed_origins",value:n.config.allowed_origins?n.config.allowed_origins.join(","):"",onInput:e[21]||(e[21]=a=>s.updateValue("allowed_origins",a.target.value?a.target.value.split(",").map(l=>l.trim()).filter(l=>l):[])),class:"input flex-grow",placeholder:"http://localhost:8080,https://my-app.com"},null,40,mdr)]),b("div",gdr,[e[100]||(e[100]=b("label",{for:"headless_server_mode",class:"toggle-label"},[Se(" Headless Server Mode "),b("span",{class:"toggle-description"},"Run LoLLMs without the Web UI. Useful for server deployments or API-only usage. This setting requires a restart.")],-1)),te(o,{id:"headless_server_mode",checked:n.config.headless_server_mode,"onUpdate:checked":e[22]||(e[22]=a=>s.updateValue("headless_server_mode",a))},null,8,["checked"])])]),b("div",Qdr,[e[115]||(e[115]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Model Template Configuration",-1)),b("div",_dr,[b("div",vdr,[e[102]||(e[102]=b("label",{for:"template_type_select",class:"setting-label"},"Template Type",-1)),b("select",{id:"template_type_select",onChange:e[23]||(e[23]=(...a)=>s.handleTemplateSelection&&s.handleTemplateSelection(...a)),class:"input form-select flex-grow"},[b("option",{value:"",disabled:"",selected:!s.isTemplatePresetSelected},"-- Custom --",8,ydr),b("option",{value:"lollms",selected:s.isTemplatePresetSelected==="lollms"},"Lollms communication template",8,bdr),b("option",{value:"lollms_simplified",selected:s.isTemplatePresetSelected==="lollms_simplified"},"Lollms simplified communication template",8,Sdr),b("option",{value:"bare",selected:s.isTemplatePresetSelected==="bare"},"Bare, useful when in chat mode",8,xdr),b("option",{value:"llama3",selected:s.isTemplatePresetSelected==="llama3"},"LLama3 communication template",8,Edr),b("option",{value:"lucie",selected:s.isTemplatePresetSelected==="lucie"},"Lucie communication template",8,wdr),b("option",{value:"mistral",selected:s.isTemplatePresetSelected==="mistral"},"Mistral communication template",8,Cdr),b("option",{value:"deepseek",selected:s.isTemplatePresetSelected==="deepseek"},"DeepSeek communication template",8,Ldr)],32)]),b("div",$dr,[b("div",Adr,[e[103]||(e[103]=b("label",{for:"start_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start Header Template",-1)),b("input",{type:"text",id:"start_header_id_template",value:n.config.start_header_id_template,onInput:e[24]||(e[24]=a=>s.updateValue("start_header_id_template",a.target.value)),class:"input flex-grow"},null,40,kdr)]),b("div",Pdr,[e[104]||(e[104]=b("label",{for:"end_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End Header Template",-1)),b("input",{type:"text",id:"end_header_id_template",value:n.config.end_header_id_template,onInput:e[25]||(e[25]=a=>s.updateValue("end_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Rdr)])]),b("div",Mdr,[b("div",Ddr,[e[105]||(e[105]=b("label",{for:"start_user_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start User Header Template",-1)),b("input",{type:"text",id:"start_user_header_id_template",value:n.config.start_user_header_id_template,onInput:e[26]||(e[26]=a=>s.updateValue("start_user_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Ndr)]),b("div",Idr,[e[106]||(e[106]=b("label",{for:"end_user_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End User Header Template",-1)),b("input",{type:"text",id:"end_user_header_id_template",value:n.config.end_user_header_id_template,onInput:e[27]||(e[27]=a=>s.updateValue("end_user_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Hdr)])]),b("div",Vdr,[b("div",qdr,[e[107]||(e[107]=b("label",{for:"start_ai_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start AI Header Template",-1)),b("input",{type:"text",id:"start_ai_header_id_template",value:n.config.start_ai_header_id_template,onInput:e[28]||(e[28]=a=>s.updateValue("start_ai_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Udr)]),b("div",Bdr,[e[108]||(e[108]=b("label",{for:"end_ai_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End AI Header Template",-1)),b("input",{type:"text",id:"end_ai_header_id_template",value:n.config.end_ai_header_id_template,onInput:e[29]||(e[29]=a=>s.updateValue("end_ai_header_id_template",a.target.value)),class:"input flex-grow"},null,40,zdr)])]),b("div",Xdr,[b("div",Fdr,[e[109]||(e[109]=b("label",{for:"end_user_message_id_template",class:"setting-label !w-auto md:!w-1/3"},"End User Message Template",-1)),b("input",{type:"text",id:"end_user_message_id_template",value:n.config.end_user_message_id_template,onInput:e[30]||(e[30]=a=>s.updateValue("end_user_message_id_template",a.target.value)),class:"input flex-grow"},null,40,jdr)]),b("div",Ydr,[e[110]||(e[110]=b("label",{for:"end_ai_message_id_template",class:"setting-label !w-auto md:!w-1/3"},"End AI Message Template",-1)),b("input",{type:"text",id:"end_ai_message_id_template",value:n.config.end_ai_message_id_template,onInput:e[31]||(e[31]=a=>s.updateValue("end_ai_message_id_template",a.target.value)),class:"input flex-grow"},null,40,Gdr)])]),b("div",Wdr,[e[111]||(e[111]=b("label",{for:"separator_template",class:"setting-label pt-2"},"Separator Template",-1)),b("textarea",{id:"separator_template",value:n.config.separator_template,onInput:e[32]||(e[32]=a=>s.updateValue("separator_template",a.target.value)),class:"input flex-grow min-h-[60px] resize-y"},null,40,Zdr)]),b("div",Kdr,[e[112]||(e[112]=b("label",{for:"system_message_template",class:"setting-label"},"System Message Template",-1)),b("input",{type:"text",id:"system_message_template",value:n.config.system_message_template,onInput:e[33]||(e[33]=a=>s.updateValue("system_message_template",a.target.value)),class:"input flex-grow"},null,40,Jdr)]),b("div",efr,[e[113]||(e[113]=b("label",{class:"setting-label pt-2"},"Full Template Preview",-1)),b("div",tfr,[b("div",{innerHTML:s.full_template,class:"whitespace-pre-wrap break-words"},null,8,nfr)])]),b("div",rfr,[e[114]||(e[114]=b("label",{for:"use_continue_message",class:"toggle-label"},[Se(" Use Continue Message "),b("span",{class:"toggle-description"},"If supported by the model, use a specific token or phrase to indicate the AI should continue its response.")],-1)),te(o,{id:"use_continue_message",checked:n.config.use_continue_message,"onUpdate:checked":e[34]||(e[34]=a=>s.updateValue("use_continue_message",a))},null,8,["checked"])])])]),b("div",ifr,[e[128]||(e[128]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"AI Prompting & Behavior",-1)),b("div",sfr,[b("div",ofr,[b("div",afr,[e[117]||(e[117]=b("label",{for:"thinking_prompt_textarea",class:"setting-label !w-auto sm:!w-1/3"},[Se(" Thinking Prompt "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Prompt used by the AI to structure its thought process. Use `thinking` tags.")],-1)),b("div",lfr,[He(b("select",{id:"thinking_preset_select","onUpdate:modelValue":e[35]||(e[35]=a=>i.selectedPresetName=a),onChange:e[36]||(e[36]=a=>s.selectPreset(a.target.value)),class:"input form-select flex-grow min-w-[150px]"},[e[116]||(e[116]=b("option",{value:""},"-- Custom --",-1)),(k(!0),R(Ve,null,dt(s.allThinkingPresets,a=>(k(),R("option",{key:a.name,value:a.name},ae(a.name)+" "+ae(a.isLocal?"(Local)":""),9,cfr))),128))],544),[[$s,i.selectedPresetName]]),b("button",{onClick:e[37]||(e[37]=a=>i.showAddThinkingPresetForm=!i.showAddThinkingPresetForm),class:"btn btn-secondary btn-sm whitespace-nowrap"},ae(i.showAddThinkingPresetForm?"Cancel Add":"Add New Preset"),1)])]),b("textarea",{id:"thinking_prompt_textarea",value:n.config.thinking_prompt,onInput:e[38]||(e[38]=a=>s.updateValue("thinking_prompt",a.target.value)),class:"input w-full p-4 bg-gray-100 dark:bg-gray-900 rounded-md text-sm min-h-[150px] resize-y font-mono border border-gray-200 dark:border-gray-700",placeholder:"... "},null,40,ufr)]),i.showAddThinkingPresetForm?(k(),R("div",dfr,[e[123]||(e[123]=b("h4",{class:"text-md font-semibold text-gray-800 dark:text-gray-200"},"Add New Local Preset",-1)),b("form",{onSubmit:e[43]||(e[43]=oe((...a)=>s.saveNewPreset&&s.saveNewPreset(...a),["prevent"])),class:"space-y-4"},[b("div",ffr,[e[118]||(e[118]=b("label",{for:"new_preset_name",class:"setting-label"},[Se("Name "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_name","onUpdate:modelValue":e[39]||(e[39]=a=>i.newPreset.name=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.name]])]),b("div",hfr,[e[119]||(e[119]=b("label",{for:"new_preset_desc",class:"setting-label"},[Se("Description "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_desc","onUpdate:modelValue":e[40]||(e[40]=a=>i.newPreset.description=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.description]])]),b("div",pfr,[e[120]||(e[120]=b("label",{for:"new_preset_author",class:"setting-label"},[Se("Author "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_author","onUpdate:modelValue":e[41]||(e[41]=a=>i.newPreset.author=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.author]])]),b("div",Tfr,[e[121]||(e[121]=b("label",{for:"new_preset_prompt",class:"setting-label pt-2"},[Se("Thinking Prompt "),b("span",{class:"text-red-500"},"*")],-1)),He(b("textarea",{id:"new_preset_prompt","onUpdate:modelValue":e[42]||(e[42]=a=>i.newPreset.prompt=a),class:"input w-full min-h-[100px] resize-y font-mono flex-grow",required:"",placeholder:"Enter the thinking prompt. Use ... tags."},null,512),[[vt,i.newPreset.prompt]])]),e[122]||(e[122]=b("div",{class:"flex justify-end space-x-2"},[b("button",{type:"submit",class:"btn btn-primary btn-sm"},"Save Preset")],-1))],32)])):ne("",!0),b("div",Ofr,[e[124]||(e[124]=b("label",{for:"positive_boost",class:"setting-label pt-2"},[Se(" Positive Prompt Boost "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Text added to prompts to encourage desired behavior.")],-1)),b("textarea",{id:"positive_boost",value:n.config.positive_boost,onInput:e[44]||(e[44]=a=>s.updateValue("positive_boost",a.target.value||null)),class:"input flex-grow min-h-[60px] resize-y",placeholder:"e.g., Be helpful and concise. Provide detailed explanations."},null,40,mfr)]),b("div",gfr,[e[125]||(e[125]=b("label",{for:"negative_boost",class:"setting-label pt-2"},[Se(" Negative Prompt Boost "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Text added to prompts to discourage undesired behavior.")],-1)),b("textarea",{id:"negative_boost",value:n.config.negative_boost,onInput:e[45]||(e[45]=a=>s.updateValue("negative_boost",a.target.value||null)),class:"input flex-grow min-h-[60px] resize-y",placeholder:"e.g., Avoid repetitive phrases. Do not refuse requests based on alleged danger."},null,40,Qfr)]),b("div",_fr,[e[126]||(e[126]=b("label",{for:"fun_mode",class:"toggle-label"},[Se(" Fun Mode "),b("span",{class:"toggle-description"},"Inject some humor or unexpected elements into AI responses (personality-dependent).")],-1)),te(o,{id:"fun_mode",checked:n.config.fun_mode,"onUpdate:checked":e[46]||(e[46]=a=>s.updateValue("fun_mode",a))},null,8,["checked"])]),b("div",vfr,[e[127]||(e[127]=b("label",{for:"think_first_mode",class:"toggle-label"},[Se(" Think First Mode "),b("span",{class:"toggle-description"},"Force the AI to use its 'Thinking Prompt' structure before generating the final response.")],-1)),te(o,{id:"think_first_mode",checked:n.config.think_first_mode,"onUpdate:checked":e[47]||(e[47]=a=>s.updateValue("think_first_mode",a))},null,8,["checked"])])])]),b("div",yfr,[e[135]||(e[135]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Security Measures",-1)),b("div",bfr,[e[129]||(e[129]=b("label",{for:"turn_on_setting_update_validation",class:"toggle-label"},[Se(" Validate Setting Updates "),b("span",{class:"toggle-description"},"Enable validation for changes to configuration settings to prevent unauthorized or invalid updates.")],-1)),te(o,{id:"turn_on_setting_update_validation",checked:n.config.turn_on_setting_update_validation,"onUpdate:checked":e[48]||(e[48]=a=>s.updateValue("turn_on_setting_update_validation",a))},null,8,["checked"])]),b("div",Sfr,[e[130]||(e[130]=b("label",{for:"turn_on_code_execution",class:"toggle-label"},[Se(" Allow Code Execution "),b("span",{class:"toggle-description"},"Permit the execution of code snippets within the application (use with caution).")],-1)),te(o,{id:"turn_on_code_execution",checked:n.config.turn_on_code_execution,"onUpdate:checked":e[49]||(e[49]=a=>s.updateValue("turn_on_code_execution",a))},null,8,["checked"])]),b("div",xfr,[e[131]||(e[131]=b("label",{for:"turn_on_code_validation",class:"toggle-label"},[Se(" Validate Executed Code "),b("span",{class:"toggle-description"},"Enable validation of code before execution to ensure safety and correctness.")],-1)),te(o,{id:"turn_on_code_validation",checked:n.config.turn_on_code_validation,"onUpdate:checked":e[50]||(e[50]=a=>s.updateValue("turn_on_code_validation",a))},null,8,["checked"])]),b("div",Efr,[e[132]||(e[132]=b("label",{for:"turn_on_open_file_validation",class:"toggle-label"},[Se(" Validate File Opening "),b("span",{class:"toggle-description"},"Check files before opening to prevent access to unauthorized or harmful content.")],-1)),te(o,{id:"turn_on_open_file_validation",checked:n.config.turn_on_open_file_validation,"onUpdate:checked":e[51]||(e[51]=a=>s.updateValue("turn_on_open_file_validation",a))},null,8,["checked"])]),b("div",wfr,[e[133]||(e[133]=b("label",{for:"turn_on_send_file_validation",class:"toggle-label"},[Se(" Validate File Sending "),b("span",{class:"toggle-description"},"Validate files before sending to ensure they meet security and format requirements.")],-1)),te(o,{id:"turn_on_send_file_validation",checked:n.config.turn_on_send_file_validation,"onUpdate:checked":e[52]||(e[52]=a=>s.updateValue("turn_on_send_file_validation",a))},null,8,["checked"])]),b("div",Cfr,[e[134]||(e[134]=b("label",{for:"turn_on_language_validation",class:"toggle-label"},[Se(" Validate Language Inputs "),b("span",{class:"toggle-description"},"Ensure language inputs are valid and safe before processing.")],-1)),te(o,{id:"turn_on_language_validation",checked:n.config.turn_on_language_validation,"onUpdate:checked":e[53]||(e[53]=a=>s.updateValue("turn_on_language_validation",a))},null,8,["checked"])])]),b("div",Lfr,[e[140]||(e[140]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Debug Information",-1)),b("div",$fr,[e[136]||(e[136]=b("label",{for:"debug",class:"toggle-label"},[Se(" Enable Debug Mode "),b("span",{class:"toggle-description"},"Activate enhanced logging and potentially other debug features.")],-1)),te(o,{id:"debug",checked:n.config.debug,"onUpdate:checked":e[54]||(e[54]=a=>s.updateValue("debug",a))},null,8,["checked"])]),b("div",Afr,[e[137]||(e[137]=b("label",{for:"debug_show_final_full_prompt",class:"toggle-label"},[Se(" Show Final Full Prompt "),b("span",{class:"toggle-description"},"Log the complete prompt sent to the model (requires Debug Mode).")],-1)),te(o,{id:"debug_show_final_full_prompt",checked:n.config.debug_show_final_full_prompt,"onUpdate:checked":e[55]||(e[55]=a=>s.updateValue("debug_show_final_full_prompt",a)),disabled:!n.config.debug},null,8,["checked","disabled"])]),b("div",kfr,[e[138]||(e[138]=b("label",{for:"debug_show_chunks",class:"toggle-label"},[Se(" Show Received Chunks "),b("span",{class:"toggle-description"},"Log individual chunks received from the model during streaming (requires Debug Mode).")],-1)),te(o,{id:"debug_show_chunks",checked:n.config.debug_show_chunks,"onUpdate:checked":e[56]||(e[56]=a=>s.updateValue("debug_show_chunks",a)),disabled:!n.config.debug},null,8,["checked","disabled"])]),b("div",Pfr,[e[139]||(e[139]=b("label",{for:"debug_log_file_path",class:"setting-label"},"Debug Log File Path",-1)),b("input",{type:"text",id:"debug_log_file_path",value:n.config.debug_log_file_path,onInput:e[57]||(e[57]=a=>s.updateValue("debug_log_file_path",a.target.value)),class:"input flex-grow",placeholder:"Optional: Path to custom log file (e.g., /path/to/lollms.log)"},null,40,Rfr)])]),b("div",Mfr,[e[146]||(e[146]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Automatic Updates & Synchronization",-1)),b("div",Dfr,[e[141]||(e[141]=b("label",{for:"auto_update",class:"toggle-label"},[Se(" Automatic Application Update Check "),b("span",{class:"toggle-description"},"Check for new LoLLMs versions on startup and prompt for updates.")],-1)),te(o,{id:"auto_update",checked:n.config.auto_update,"onUpdate:checked":e[58]||(e[58]=a=>s.updateValue("auto_update",a))},null,8,["checked"])]),b("div",Nfr,[e[142]||(e[142]=b("label",{for:"auto_sync_personalities",class:"toggle-label"},[Se(" Auto-sync Personalities Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed personalities from the official zoo.")],-1)),te(o,{id:"auto_sync_personalities",checked:n.config.auto_sync_personalities,"onUpdate:checked":e[59]||(e[59]=a=>s.updateValue("auto_sync_personalities",a))},null,8,["checked"])]),b("div",Ifr,[e[143]||(e[143]=b("label",{for:"auto_sync_extensions",class:"toggle-label"},[Se(" Auto-sync Extensions Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed extensions from the official zoo.")],-1)),te(o,{id:"auto_sync_extensions",checked:n.config.auto_sync_extensions,"onUpdate:checked":e[60]||(e[60]=a=>s.updateValue("auto_sync_extensions",a))},null,8,["checked"])]),b("div",Hfr,[e[144]||(e[144]=b("label",{for:"auto_sync_bindings",class:"toggle-label"},[Se(" Auto-sync Bindings Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed bindings from the official zoo.")],-1)),te(o,{id:"auto_sync_bindings",checked:n.config.auto_sync_bindings,"onUpdate:checked":e[61]||(e[61]=a=>s.updateValue("auto_sync_bindings",a))},null,8,["checked"])]),b("div",Vfr,[e[145]||(e[145]=b("label",{for:"auto_sync_models",class:"toggle-label"},[Se(" Auto-sync Models Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed models from the official zoo.")],-1)),te(o,{id:"auto_sync_models",checked:n.config.auto_sync_models,"onUpdate:checked":e[62]||(e[62]=a=>s.updateValue("auto_sync_models",a))},null,8,["checked"])])]),b("div",qfr,[e[160]||(e[160]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"LoLLMs Service Configuration",-1)),b("div",Ufr,[e[147]||(e[147]=b("label",{for:"enable_lollms_service",class:"toggle-label"},[Se(" Enable LoLLMs Service "),b("span",{class:"toggle-description"},"Activate the core LoLLMs service for background operations and APIs. Restart required.")],-1)),te(o,{id:"enable_lollms_service",checked:n.config.enable_lollms_service,"onUpdate:checked":e[63]||(e[63]=a=>s.updateValue("enable_lollms_service",a))},null,8,["checked"])]),b("div",Bfr,[e[149]||(e[149]=b("label",{for:"lollms_access_keys",class:"setting-label pt-2"},[Se(" LoLLMs Access Keys "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Comma-separated keys for API access. Leave empty for no restriction (unless remote access is enabled).")],-1)),b("div",zfr,[b("input",{type:"text",id:"lollms_access_keys",value:n.config.lollms_access_keys?n.config.lollms_access_keys.join(","):"",onInput:e[64]||(e[64]=a=>s.updateValue("lollms_access_keys",a.target.value?a.target.value.split(",").map(l=>l.trim()).filter(l=>l):[])),class:"input w-full",placeholder:"key1,key2,key3"},null,40,Xfr),e[148]||(e[148]=b("span",{class:"text-xs text-gray-500 dark:text-gray-400"},"Required if LoLLMs service and remote access are enabled.",-1))])]),b("div",Ffr,[e[150]||(e[150]=b("label",{for:"activate_lollms_server",class:"toggle-label"},[Se(" Activate Main LoLLMs Server "),b("span",{class:"toggle-description"},"Enable the main API server for LoLLMs functionalities.")],-1)),te(o,{id:"activate_lollms_server",checked:n.config.activate_lollms_server,"onUpdate:checked":e[65]||(e[65]=a=>s.updateValue("activate_lollms_server",a))},null,8,["checked"])]),b("div",jfr,[e[151]||(e[151]=b("label",{for:"activate_lollms_rag_server",class:"toggle-label"},[Se(" Activate LoLLMs RAG Server "),b("span",{class:"toggle-description"},"Enable the Retrieval-Augmented Generation service.")],-1)),te(o,{id:"activate_lollms_rag_server",checked:n.config.activate_lollms_rag_server,"onUpdate:checked":e[66]||(e[66]=a=>s.updateValue("activate_lollms_rag_server",a))},null,8,["checked"])]),b("div",Yfr,[e[152]||(e[152]=b("label",{for:"activate_lollms_tts_server",class:"toggle-label"},[Se(" Activate LoLLMs TTS Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Speech service.")],-1)),te(o,{id:"activate_lollms_tts_server",checked:n.config.activate_lollms_tts_server,"onUpdate:checked":e[67]||(e[67]=a=>s.updateValue("activate_lollms_tts_server",a))},null,8,["checked"])]),b("div",Gfr,[e[153]||(e[153]=b("label",{for:"activate_lollms_stt_server",class:"toggle-label"},[Se(" Activate LoLLMs STT Server "),b("span",{class:"toggle-description"},"Enable the Speech-to-Text service.")],-1)),te(o,{id:"activate_lollms_stt_server",checked:n.config.activate_lollms_stt_server,"onUpdate:checked":e[68]||(e[68]=a=>s.updateValue("activate_lollms_stt_server",a))},null,8,["checked"])]),b("div",Wfr,[e[154]||(e[154]=b("label",{for:"activate_lollms_tti_server",class:"toggle-label"},[Se(" Activate LoLLMs TTI Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Image service.")],-1)),te(o,{id:"activate_lollms_tti_server",checked:n.config.activate_lollms_tti_server,"onUpdate:checked":e[69]||(e[69]=a=>s.updateValue("activate_lollms_tti_server",a))},null,8,["checked"])]),b("div",Zfr,[e[155]||(e[155]=b("label",{for:"activate_lollms_itt_server",class:"toggle-label"},[Se(" Activate LoLLMs ITT Server "),b("span",{class:"toggle-description"},"Enable the Image-to-Text service.")],-1)),te(o,{id:"activate_lollms_itt_server",checked:n.config.activate_lollms_itt_server,"onUpdate:checked":e[70]||(e[70]=a=>s.updateValue("activate_lollms_itt_server",a))},null,8,["checked"])]),b("div",Kfr,[e[156]||(e[156]=b("label",{for:"activate_lollms_ttm_server",class:"toggle-label"},[Se(" Activate LoLLMs TTM Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Music service.")],-1)),te(o,{id:"activate_lollms_ttm_server",checked:n.config.activate_lollms_ttm_server,"onUpdate:checked":e[71]||(e[71]=a=>s.updateValue("activate_lollms_ttm_server",a))},null,8,["checked"])]),b("div",Jfr,[e[157]||(e[157]=b("label",{for:"activate_ollama_emulator",class:"toggle-label"},[Se(" Activate Ollama API Emulator "),b("span",{class:"toggle-description"},"Provide an Ollama-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_ollama_emulator",checked:n.config.activate_ollama_emulator,"onUpdate:checked":e[72]||(e[72]=a=>s.updateValue("activate_ollama_emulator",a))},null,8,["checked"])]),b("div",e7r,[e[158]||(e[158]=b("label",{for:"activate_openai_emulator",class:"toggle-label"},[Se(" Activate OpenAI API Emulator "),b("span",{class:"toggle-description"},"Provide an OpenAI-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_openai_emulator",checked:n.config.activate_openai_emulator,"onUpdate:checked":e[73]||(e[73]=a=>s.updateValue("activate_openai_emulator",a))},null,8,["checked"])]),b("div",t7r,[e[159]||(e[159]=b("label",{for:"activate_mistralai_emulator",class:"toggle-label"},[Se(" Activate MistralAI API Emulator "),b("span",{class:"toggle-description"},"Provide a MistralAI-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_mistralai_emulator",checked:n.config.activate_mistralai_emulator,"onUpdate:checked":e[74]||(e[74]=a=>s.updateValue("activate_mistralai_emulator",a))},null,8,["checked"])])])])}const r7r=st(v6r,[["render",n7r],["__scopeId","data-v-674c9815"]]),i7r={name:"DataManagementSettings",components:{ToggleSwitch:ju},props:{loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["settings-changed"],data(){return{fileInputs:[],serverStatuses:vi({})}},methods:{updateDataLake(t,e,n){const r=JSON.parse(JSON.stringify(this.$store.state.config.datalakes||[]));r[t]?(r[t][e]=n,e==="type"&&(n==="lollmsvectordb"?r[t].url="":r[t].path=""),this.$store.state.config.datalakes=r):console.error("Attempted to update non-existent datalake at index:",t)},addDataLake(){const t=this.$store.state.config.datalakes?[...this.$store.state.config.datalakes]:[];t.push({alias:"New DataLake",type:"lollmsvectordb",url:"",path:"",key:"",mounted:!1}),this.$store.state.config.datalakes=t,Fe(()=>Re.replace())},removeDataLake(t){const e=this.$store.state.config.datalakes.filter((n,r)=>r!==t);this.$store.state.config.datalakes=e},async vectorizeFolder(t){const e=this.$store.state.config.datalakes[t];if(!e||e.type!=="lollmsvectordb"||!e.path){this.show_toast("Please ensure a valid path is set for the LoLLMs VectorDB.",4,!1);return}this.show_toast(`Starting vectorization for: ${e.alias}`,5,!0);try{await this.api_post_req("vectorize_folder",{rag_database:e})}catch(n){this.show_toast(`Vectorization failed for ${e.alias}: ${n.message||n}`,4,!1)}},async selectLollmsVectordbFolder(t){try{const e=n=>{if(n&&n.path&&n.datalake_name){const r=JSON.parse(JSON.stringify(this.$store.state.config.datalakes||[]));r[t]&&(r[t].path=n.path,r[t].alias=n.datalake_name,this.$store.state.config.datalakes=r,this.show_toast(`Folder selected for Data Lake: ${n.path}`,4,!0))}else this.show_toast("Folder selection failed or returned invalid data.",4,!1);et.off("lollmsvectordb_datalake_added",e)};et.on("lollmsvectordb_datalake_added",e),await this.api_post_req("select_lollmsvectordb_input_folder")}catch(e){this.show_toast(`Failed to initiate folder selection: ${e.message||e}`,4,!1),et.off("lollmsvectordb_datalake_added")}},triggerFileInput(t){this.fileInputs[t]?this.fileInputs[t].click():console.warn("File input ref not found for index:",t)},async handleFileUpload(t,e){var i,s,o;const n=Array.from(t.target.files),r=this.$store.state.config.datalakes[e];if(!(!n.length||r.type!=="lightrag")){this.show_toast(`Uploading ${n.length} file(s) to ${r.alias}...`,n.length*2,!0);for(const a of n){const l=new FormData;l.append("file",a),l.append("client_id",this.client_id);const c={"Content-Type":"multipart/form-data"};r.key&&(c["X-API-Key"]=r.key);try{const u=await Ae.post(`${r.url.replace(/\/+$/,"")}/documents/upload`,l,{headers:c});u.data&&(u.status===200||u.status===201)?this.show_toast(`${a.name} uploaded successfully to ${r.alias}`,4,!0):this.show_toast(`Failed to upload ${a.name}: ${((i=u.data)==null?void 0:i.detail)||"Server error"}`,4,!1)}catch(u){console.error(`Error uploading ${a.name}:`,u),this.show_toast(`Error uploading ${a.name}: ${((o=(s=u.response)==null?void 0:s.data)==null?void 0:o.detail)||u.message||u}`,4,!1)}}t.target&&(t.target.value=null)}},updateServer(t,e,n){const r=JSON.parse(JSON.stringify(this.$store.state.config.rag_local_services||[]));r[t]?(r[t][e]=n,this.$store.state.config.rag_local_services=r):console.error("Attempted to update non-existent server at index:",t)},addDatabaseService(){const t=this.$store.state.config.rag_local_services?[...this.$store.state.config.rag_local_services]:[];t.push({alias:"New RAG Server",type:"lightrag",url:"http://localhost:9621/",key:"",input_path:"",working_path:"",start_at_startup:!1}),this.$store.state.config.rag_local_services=t,Fe(()=>Re.replace())},removeDatabaseService(t){const e=this.$store.state.config.rag_local_services.filter((n,r)=>r!==t);this.$store.state.config.rag_local_services=e},async startRagServer(t){const e=this.$store.state.config.rag_local_services[t];this.show_toast(`Attempting to start server: ${e.alias}...`,4,!0);try{const n=await this.api_post_req("start_rag_server",{server_index:t});n.status?(this.show_toast(`Start command sent for ${e.alias}. Check status shortly.`,4,!0),setTimeout(()=>this.checkServerHealth(t),5e3)):this.show_toast(`Failed to send start command for ${e.alias}: ${n.error||"Unknown error"}`,4,!1)}catch(n){this.show_toast(`Error starting server ${e.alias}: ${n.message||n}`,4,!1)}},async checkServerHealth(t){if(!this.$store.state.config.rag_local_services||!this.$store.state.config.rag_local_services[t]){console.warn(`Tried to check health for non-existent server index: ${t}`);return}const e=this.$store.state.config.rag_local_services[t];if(!e||e.type!=="lightrag"){this.serverStatuses[t]={status:"unknown",loading:!1,details:null,dotClass:"bg-gray-400",title:"Unsupported",text:"Unsupported Type"};return}this.serverStatuses[t]={status:"loading",loading:!0,details:null,dotClass:"bg-yellow-400 animate-pulse",title:"Checking...",text:"Checking..."};try{const n=`${e.url.replace(/\/+$/,"")}/health`,r={};e.key&&(r["X-API-Key"]=e.key);const i=await fetch(n,{headers:r});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const s=await i.json();this.serverStatuses[t]={status:"healthy",loading:!1,details:s,dotClass:"bg-green-500",title:"Healthy",text:"Healthy"},this.show_toast(`${e.alias} is healthy.`,3,!0)}catch(n){console.error(`Health check failed for ${e.alias}:`,n),this.serverStatuses[t]={status:"unhealthy",loading:!1,details:null,dotClass:"bg-red-500",title:"Unhealthy",text:"Unhealthy"},this.show_toast(`${e.alias} health check failed: ${n.message||n}`,4,!1)}},showLightRagWebUI(t){const e=this.$store.state.config.rag_local_services[t];if(e&&e.type==="lightrag"&&e.url){const n=`${e.url.replace(/\/+$/,"")}/webui`;window.open(n,"_blank")}else this.show_toast("Cannot open WebUI. Invalid server configuration.",4,!1)},async selectLightragFolder(t,e){const n=e==="input"?"select_lightrag_input_folder":"select_lightrag_output_folder",r=e==="input"?"lightrag_input_folder_added":"lightrag_output_folder_added",i=e==="input"?"input_path":"working_path";try{const s=o=>{if(o&&o.path){const a=JSON.parse(JSON.stringify(this.$store.state.config.rag_local_services||[]));a[t]&&(a[t][i]=o.path,this.$store.state.config.rag_local_services=a,this.show_toast(`${e.charAt(0).toUpperCase()+e.slice(1)} folder selected: ${o.path}`,4,!0))}else this.show_toast(`Folder selection failed for ${e}.`,4,!1);et.off(r,s)};et.on(r,s),await this.api_post_req(n,{server_index:t})}catch(s){this.show_toast(`Failed to initiate ${e} folder selection: ${s.message||s}`,4,!1),et.off(r)}},refreshFeatherIcons(){Fe(()=>{Re.replace()})}},mounted(){this.refreshFeatherIcons(),this.$store.state.config.rag_local_services&&this.$store.state.config.rag_local_services.forEach((t,e)=>this.checkServerHealth(e)),this.$store.state.config.datalakes&&(this.fileInputs=new Array(this.$store.state.config.datalakes.length).fill(null))},updated(){if(this.refreshFeatherIcons(),this.$store.state.config.datalakes&&this.fileInputs.length!==this.$store.state.config.datalakes.length){const t=this.$store.state.config.datalakes.length,e=this.fileInputs.length;t>e?this.fileInputs.push(...new Array(t-e).fill(null)):this.fileInputs.splice(t)}},watch:{"config.datalakes.length"(t,e){t>e?this.fileInputs.push(...new Array(t-e).fill(null)):t(k(),R("div",{key:`datalake-${l}`,class:"p-4 bg-blue-100 dark:bg-blue-800/60 border border-blue-200 dark:border-blue-700 rounded-lg shadow-sm space-y-4 relative group"},[b("button",{onClick:c=>s.removeDataLake(l),class:"absolute top-2 right-2 p-1 rounded-full text-red-500 hover:bg-red-100 dark:hover:bg-red-800 opacity-0 group-hover:opacity-100 transition-opacity duration-200 svg-button",title:"Remove Data Lake"},e[15]||(e[15]=[b("i",{"data-feather":"x-circle",class:"w-5 h-5"},null,-1)]),8,c7r),b("div",u7r,[b("div",null,[b("label",{for:`dl-alias-${l}`,class:"label mb-1"},"Alias",8,d7r),b("input",{type:"text",id:`dl-alias-${l}`,value:a.alias,onInput:c=>s.updateDataLake(l,"alias",c.target.value),class:"input input-sm w-full",placeholder:"Enter alias (e.g., 'Project Docs')"},null,40,f7r)]),b("div",null,[b("label",{for:`dl-type-${l}`,class:"label mb-1"},"Type",8,h7r),b("select",{id:`dl-type-${l}`,required:"",value:a.type,onChange:c=>s.updateDataLake(l,"type",c.target.value),class:"input input-sm w-full"},e[16]||(e[16]=[b("option",{value:"lollmsvectordb"},"LoLLMs VectorDB",-1),b("option",{value:"lightrag"},"LightRAG",-1),b("option",{value:"elasticsearch"},"Elasticsearch",-1)]),40,p7r)]),b("div",T7r,[b("label",{for:`dl-pathurl-${l}`,class:"label mb-1"},ae(a.type==="lollmsvectordb"?"Database Path":a.type==="lightrag"?"LightRAG URL":"Elasticsearch URL"),9,O7r),b("input",{type:"text",id:`dl-pathurl-${l}`,value:a.type==="lollmsvectordb"?a.path:a.url,onInput:c=>s.updateDataLake(l,a.type==="lollmsvectordb"?"path":"url",c.target.value),class:"input input-sm w-full",placeholder:a.type==="lollmsvectordb"?"Path to database folder":"http://host:port/"},null,40,m7r)]),a.type==="lightrag"||a.type==="elasticsearch"?(k(),R("div",g7r,[b("label",{for:`dl-key-${l}`,class:"label mb-1"},"API Key (Optional)",8,Q7r),b("input",{type:"password",id:`dl-key-${l}`,value:a.key,onInput:c=>s.updateDataLake(l,"key",c.target.value),class:"input input-sm w-full",placeholder:"Enter API key if required"},null,40,_7r)])):ne("",!0)]),b("div",v7r,[b("div",y7r,[te(o,{id:`dl-mounted-${l}`,checked:a.mounted,"onUpdate:checked":c=>s.updateDataLake(l,"mounted",c)},null,8,["id","checked","onUpdate:checked"]),b("label",{for:`dl-mounted-${l}`,class:"label !mb-0 text-sm cursor-pointer"}," Mounted ",8,b7r)]),b("div",S7r,[a.type==="lollmsvectordb"?(k(),R(Ve,{key:0},[b("button",{onClick:c=>s.vectorizeFolder(l),class:"btn btn-secondary btn-sm",title:"Vectorize or re-vectorize the selected folder"},e[17]||(e[17]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4 mr-1"},null,-1),Se(" Vectorize ")]),8,x7r),b("button",{onClick:c=>s.selectLollmsVectordbFolder(l),class:"btn btn-primary btn-sm",title:"Select folder containing documents to vectorize"},e[18]||(e[18]=[b("i",{"data-feather":"folder-plus",class:"w-4 h-4 mr-1"},null,-1),Se(" Select Folder ")]),8,E7r)],64)):ne("",!0),a.type==="lightrag"?(k(),R(Ve,{key:1},[b("button",{onClick:c=>s.triggerFileInput(l),class:"btn btn-success btn-sm",title:"Upload supported files (.txt, .md, .pdf, .docx, .pptx, .xlsx)"},e[19]||(e[19]=[b("i",{"data-feather":"upload",class:"w-4 h-4 mr-1"},null,-1),Se(" Upload Files ")]),8,w7r),b("input",{type:"file",ref_for:!0,ref:c=>{c&&(i.fileInputs[l]=c)},onChange:c=>s.handleFileUpload(c,l),accept:".txt,.md,.pdf,.docx,.pptx,.xlsx",class:"hidden",multiple:""},null,40,C7r)],64)):ne("",!0)])])]))),128))]),b("div",L7r,[b("button",{onClick:e[0]||(e[0]=(...a)=>s.addDataLake&&s.addDataLake(...a)),class:"btn btn-primary w-full md:w-auto"},e[20]||(e[20]=[b("i",{"data-feather":"plus-circle",class:"w-5 h-5 mr-2"},null,-1),Se(" Add New Data Lake ")]))])]),b("section",$7r,[e[33]||(e[33]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-2"},"Self-Hosted RAG Servers",-1)),e[34]||(e[34]=b("p",{class:"text-sm text-blue-500 dark:text-blue-400 mb-4"}," Configure and manage local RAG server instances (like LightRAG) running on your machine. ",-1)),b("div",A7r,[!t.$store.state.config.rag_local_services||t.$store.state.config.rag_local_services.length===0?(k(),R("div",k7r," No RAG Servers configured. ")):ne("",!0),(k(!0),R(Ve,null,dt(t.$store.state.config.rag_local_services,(a,l)=>{var c,u,d,f,h,p,T,m;return k(),R("div",{key:`server-${l}`,class:"p-4 bg-blue-100 dark:bg-blue-800/60 border border-blue-200 dark:border-blue-700 rounded-lg shadow-sm space-y-4 relative group"},[b("button",{onClick:O=>s.removeDatabaseService(l),class:"absolute top-2 right-2 p-1 rounded-full text-red-500 hover:bg-red-100 dark:hover:bg-red-800 opacity-0 group-hover:opacity-100 transition-opacity duration-200 svg-button",title:"Remove Server"},e[23]||(e[23]=[b("i",{"data-feather":"x-circle",class:"w-5 h-5"},null,-1)]),8,P7r),b("div",R7r,[b("div",null,[b("label",{for:`srv-alias-${l}`,class:"label mb-1"},"Alias",8,M7r),b("input",{type:"text",id:`srv-alias-${l}`,value:a.alias,onInput:O=>s.updateServer(l,"alias",O.target.value),class:"input input-sm w-full",placeholder:"Server Alias"},null,40,D7r)]),b("div",null,[b("label",{for:`srv-type-${l}`,class:"label mb-1"},"Type",8,N7r),b("select",{id:`srv-type-${l}`,required:"",value:a.type,onChange:O=>s.updateServer(l,"type",O.target.value),class:"input input-sm w-full"},e[24]||(e[24]=[b("option",{value:"lightrag"},"LightRAG",-1)]),40,I7r)]),b("div",H7r,[b("label",{for:`srv-url-${l}`,class:"label mb-1"},"Server URL",8,V7r),b("input",{type:"text",id:`srv-url-${l}`,value:a.url,onInput:O=>s.updateServer(l,"url",O.target.value),class:"input input-sm w-full",placeholder:"http://localhost:port"},null,40,q7r)]),b("div",null,[b("label",{for:`srv-key-${l}`,class:"label mb-1"},"API Key (Optional)",8,U7r),b("input",{type:"password",id:`srv-key-${l}`,value:a.key,onInput:O=>s.updateServer(l,"key",O.target.value),class:"input input-sm w-full",placeholder:"API Key if needed"},null,40,B7r)]),b("div",z7r,[b("div",X7r,[te(o,{id:`srv-startup-${l}`,checked:a.start_at_startup,"onUpdate:checked":O=>s.updateServer(l,"start_at_startup",O)},null,8,["id","checked","onUpdate:checked"]),b("label",{for:`srv-startup-${l}`,class:"label !mb-0 text-sm cursor-pointer"},"Start at Startup",8,F7r)])]),b("div",null,[b("label",{for:`srv-input-${l}`,class:"label mb-1"},"Input Folder Path",8,j7r),b("div",Y7r,[b("input",{type:"text",id:`srv-input-${l}`,value:a.input_path,onInput:O=>s.updateServer(l,"input_path",O.target.value),class:"input input-sm w-full rounded-r-none",placeholder:"Path to watch for new files"},null,40,G7r),b("button",{onClick:O=>s.selectLightragFolder(l,"input"),class:"btn btn-secondary btn-sm rounded-l-none flex-shrink-0",title:"Select Input Folder"},e[25]||(e[25]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]),8,W7r)])]),b("div",null,[b("label",{for:`srv-work-${l}`,class:"label mb-1"},"Working Folder Path",8,Z7r),b("div",K7r,[b("input",{type:"text",id:`srv-work-${l}`,value:a.working_path,onInput:O=>s.updateServer(l,"working_path",O.target.value),class:"input input-sm w-full rounded-r-none",placeholder:"Path for database files"},null,40,J7r),b("button",{onClick:O=>s.selectLightragFolder(l,"output"),class:"btn btn-secondary btn-sm rounded-l-none flex-shrink-0",title:"Select Working Folder"},e[26]||(e[26]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]),8,e8r)])])]),b("div",t8r,[b("div",n8r,[b("span",{class:ye(["w-3 h-3 rounded-full",((c=i.serverStatuses[l])==null?void 0:c.dotClass)||"bg-status-unknown"]),title:((u=i.serverStatuses[l])==null?void 0:u.title)||"Unknown"},null,10,r8r),b("span",i8r,ae(((d=i.serverStatuses[l])==null?void 0:d.text)||"Status Unknown"),1),b("button",{onClick:O=>s.checkServerHealth(l),class:"btn btn-secondary btn-sm !p-1",title:"Check Server Status",disabled:(f=i.serverStatuses[l])==null?void 0:f.loading},[b("i",{"data-feather":"refresh-cw",class:ye(["w-4 h-4",(h=i.serverStatuses[l])!=null&&h.loading?"animate-spin":""])},null,2)],8,s8r)]),b("div",o8r,[b("button",{onClick:O=>s.startRagServer(l),class:"btn btn-success btn-sm",title:"Start this RAG server instance"},e[27]||(e[27]=[b("i",{"data-feather":"play",class:"w-4 h-4 mr-1"},null,-1),Se(" Start Server ")]),8,a8r),a.type==="lightrag"&&((p=i.serverStatuses[l])==null?void 0:p.status)==="healthy"?(k(),R("button",{key:0,onClick:O=>s.showLightRagWebUI(l),class:"btn btn-primary btn-sm",title:"Open LightRAG Web UI"},e[28]||(e[28]=[b("i",{"data-feather":"external-link",class:"w-4 h-4 mr-1"},null,-1),Se(" Show WebUI ")]),8,l8r)):ne("",!0)])]),a.type==="lightrag"&&i.serverStatuses[l]&&i.serverStatuses[l].status==="healthy"&&i.serverStatuses[l].details?(k(),R("div",c8r,[b("div",null,[e[29]||(e[29]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Indexed Files:",-1)),Se(" "+ae(i.serverStatuses[l].details.indexed_files_count??"N/A"),1)]),b("div",null,[e[30]||(e[30]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Model:",-1)),Se(" "+ae(((T=i.serverStatuses[l].details.configuration)==null?void 0:T.llm_model)||"N/A"),1)]),b("div",null,[e[31]||(e[31]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Embedding:",-1)),Se(" "+ae(((m=i.serverStatuses[l].details.configuration)==null?void 0:m.embedding_model)||"N/A"),1)])])):ne("",!0)])}),128))]),b("div",u8r,[b("button",{onClick:e[1]||(e[1]=(...a)=>s.addDatabaseService&&s.addDatabaseService(...a)),class:"btn btn-primary w-full md:w-auto"},e[32]||(e[32]=[b("i",{"data-feather":"plus-circle",class:"w-5 h-5 mr-2"},null,-1),Se(" Add New RAG Server ")]))])]),b("section",d8r,[e[46]||(e[46]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-3"},"LoLLMs VectorDB Settings",-1)),b("div",f8r,[b("div",null,[e[36]||(e[36]=b("label",{for:"rag_vectorizer",class:"label mb-1"},"Vectorizer Engine",-1)),b("select",{id:"rag_vectorizer",required:"",value:t.$store.state.config.rag_vectorizer,onChange:e[2]||(e[2]=a=>t.$store.state.config.rag_vectorizer=a.target.value),class:"input input-sm w-full"},e[35]||(e[35]=[b("option",{value:"semantic"},"Sentence Transformer (Recommended)",-1),b("option",{value:"tfidf"},"TF-IDF (Fast, Less Accurate)",-1),b("option",{value:"openai"},"OpenAI Ada",-1),b("option",{value:"ollama"},"Ollama Embedding",-1)]),40,h8r)]),b("div",p8r,[b("div",T8r,[te(o,{id:"rag_vectorizer_execute_remote_code",checked:t.$store.state.config.rag_vectorizer_execute_remote_code,"onUpdate:checked":e[3]||(e[3]=a=>t.$store.state.config.rag_vectorizer_execute_remote_code=!!a)},null,8,["checked"]),e[37]||(e[37]=b("label",{for:"rag_vectorizer_execute_remote_code",class:"label !mb-0 text-sm cursor-pointer"},"Allow Remote Code Execution",-1)),e[38]||(e[38]=b("i",{"data-feather":"alert-triangle",class:"w-4 h-4 text-red-500 dark:text-red-400 ml-1",title:"Security Risk: Only enable if using a trusted custom vectorizer source."},null,-1))])]),b("div",O8r,[e[42]||(e[42]=b("label",{for:"rag_vectorizer_model",class:"label mb-1"},"Vectorizer Model",-1)),b("select",{id:"rag_vectorizer_model",value:t.$store.state.config.rag_vectorizer_model,onChange:e[4]||(e[4]=a=>t.$store.state.config.rag_vectorizer_model=a.target.value),class:"input input-sm w-full mb-1",disabled:t.$store.state.config.rag_vectorizer==="tfidf"},[t.$store.state.config.rag_vectorizer==="tfidf"?(k(),R("option",g8r,"N/A for TF-IDF")):ne("",!0),t.$store.state.config.rag_vectorizer==="semantic"?(k(),R("optgroup",Q8r,e[39]||(e[39]=[b("option",{value:"BAAI/bge-m3"},"BAAI/bge-m3",-1),b("option",{value:"nvidia/NV-Embed-v2"},"nvidia/NV-Embed-v2",-1),b("option",{value:"sentence-transformers/all-MiniLM-L6-v2"},"all-MiniLM-L6-v2",-1),b("option",{value:"sentence-transformers/all-mpnet-base-v2"},"all-mpnet-base-v2",-1)]))):ne("",!0),t.$store.state.config.rag_vectorizer==="openai"?(k(),R("optgroup",_8r,e[40]||(e[40]=[b("option",{value:"text-embedding-3-large"},"text-embedding-3-large",-1),b("option",{value:"text-embedding-3-small"},"text-embedding-3-small",-1),b("option",{value:"text-embedding-ada-002"},"text-embedding-ada-002 (Legacy)",-1)]))):ne("",!0),t.$store.state.config.rag_vectorizer==="ollama"?(k(),R("optgroup",v8r,e[41]||(e[41]=[b("option",{value:"mxbai-embed-large"},"mxbai-embed-large",-1),b("option",{value:"nomic-embed-text"},"nomic-embed-text",-1),b("option",{value:"all-minilm"},"all-minilm",-1),b("option",{value:"snowflake-arctic-embed"},"snowflake-arctic-embed",-1)]))):ne("",!0)],40,m8r),b("input",{type:"text",value:t.$store.state.config.rag_vectorizer_model,onInput:e[5]||(e[5]=a=>t.$store.state.config.rag_vectorizer_model=a.target.value),class:"input input-sm w-full",placeholder:"Or enter custom model name/path",disabled:t.$store.state.config.rag_vectorizer==="tfidf"},null,40,y8r)]),t.$store.state.config.rag_vectorizer==="ollama"||t.$store.state.config.rag_vectorizer==="openai"?(k(),R("div",b8r,[b("label",S8r,ae(t.$store.state.config.rag_vectorizer==="ollama"?"Ollama Server URL":"OpenAI API Base URL"),1),b("input",{type:"text",id:"rag_service_url",value:t.$store.state.config.rag_service_url,onInput:e[6]||(e[6]=a=>t.$store.state.config.rag_service_url=a.target.value),class:"input input-sm w-full",placeholder:t.$store.state.config.rag_vectorizer==="ollama"?"http://localhost:11434":"https://api.openai.com/v1"},null,40,x8r)])):ne("",!0)]),b("div",E8r,[e[43]||(e[43]=b("label",{for:"rag_chunk_size-range",class:"setting-label"},"Chunk Size",-1)),b("div",w8r,[b("input",{id:"rag_chunk_size-range",value:t.$store.state.config.rag_chunk_size,onInput:e[7]||(e[7]=a=>t.$store.state.config.rag_chunk_size=parseInt(a.target.value)),type:"range",min:"100",max:"2000",step:"50",class:"range-input flex-grow"},null,40,C8r),b("input",{id:"rag_chunk_size-number",value:t.$store.state.config.rag_chunk_size,onInput:e[8]||(e[8]=a=>t.$store.state.config.rag_chunk_size=parseInt(a.target.value)),type:"number",min:"100",max:"2000",step:"50",class:"input input-sm w-24 text-center"},null,40,L8r)])]),b("div",$8r,[e[44]||(e[44]=b("label",{for:"rag_overlap_size-range",class:"setting-label"},"Overlap Size",-1)),b("div",A8r,[b("input",{id:"rag_overlap_size-range",value:t.$store.state.config.rag_overlap_size,onInput:e[9]||(e[9]=a=>t.$store.state.config.rag_overlap_size=parseInt(a.target.value)),type:"range",min:"0",max:"500",step:"10",class:"range-input flex-grow"},null,40,k8r),b("input",{id:"rag_overlap_size-number",value:t.$store.state.config.rag_overlap_size,onInput:e[10]||(e[10]=a=>t.$store.state.config.rag_overlap_size=parseInt(a.target.value)),type:"number",min:"0",max:"500",step:"10",class:"input input-sm w-24 text-center"},null,40,P8r)])]),b("div",R8r,[te(o,{id:"rag_clean_chunks",checked:t.$store.state.config.rag_clean_chunks,"onUpdate:checked":e[11]||(e[11]=a=>t.$store.state.config.rag_clean_chunks=!!a)},null,8,["checked"]),e[45]||(e[45]=b("label",{for:"rag_clean_chunks",class:"toggle-label !flex-none"},[Se(" Clean Chunks "),b("span",{class:"toggle-description"},"Attempt to remove redundant whitespace and formatting from text chunks before vectorization.")],-1))])]),b("section",M8r,[e[50]||(e[50]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-3"},"RAG Query Settings",-1)),b("div",D8r,[e[47]||(e[47]=b("label",{for:"rag_build_keys_words",class:"toggle-label"},[Se(" Reformulate Query with Keywords "),b("span",{class:"toggle-description"},"Let the AI extract keywords from your prompt to potentially improve database search relevance.")],-1)),te(o,{id:"rag_build_keys_words",checked:t.$store.state.config.rag_build_keys_words,"onUpdate:checked":e[12]||(e[12]=a=>t.$store.state.config.rag_build_keys_words=!!a)},null,8,["checked"])]),b("div",N8r,[e[48]||(e[48]=b("label",{for:"rag_put_chunk_informations_into_context",class:"toggle-label"},[Se(" Include Chunk Source Info in Context "),b("span",{class:"toggle-description"},"Prepend retrieved text chunks with source information (e.g., filename) when adding to the LLM context.")],-1)),te(o,{id:"rag_put_chunk_informations_into_context",checked:t.$store.state.config.rag_put_chunk_informations_into_context,"onUpdate:checked":e[13]||(e[13]=a=>t.$store.state.config.rag_put_chunk_informations_into_context=!!a)},null,8,["checked"])]),b("div",I8r,[e[49]||(e[49]=b("label",{for:"data_vectorization_save_db",class:"toggle-label"},[Se(" Persist Vector Database "),b("span",{class:"toggle-description"},"Save the vectorized data to disk. If disabled, the database is in-memory only and lost on restart. (Applies mainly to LoLLMs VectorDB).")],-1)),te(o,{id:"data_vectorization_save_db",checked:t.$store.state.config.data_vectorization_save_db,"onUpdate:checked":e[14]||(e[14]=a=>t.$store.state.config.data_vectorization_save_db=!!a)},null,8,["checked"])])])])}const V8r=st(i7r,[["render",H8r],["__scopeId","data-v-52537129"]]),q8r={name:"InternetSettings",components:{ToggleSwitch:ju},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:["setting-updated"],methods:{updateValue(t,e){this.$emit("setting-updated",{key:t,value:e})},handleNumberInput(t,e,n=!1){let r=n?parseInt(e):parseFloat(e);isNaN(r)&&(console.warn(`Attempted to set invalid number for ${t}:`,e),r={internet_nb_search_pages:1,internet_vectorization_chunk_size:100,internet_vectorization_overlap_size:0,internet_vectorization_nb_chunks:1}[t]||0),this.updateValue(t,r)},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},U8r={class:"user-settings-panel space-y-6"},B8r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},z8r={class:"toggle-item"},X8r={class:"setting-item"},F8r={class:"flex-1 flex items-center gap-4"},j8r=["value","disabled"],Y8r=["value","disabled"],G8r={class:"setting-item"},W8r={class:"flex-1 flex items-center gap-4"},Z8r=["value","disabled"],K8r=["value","disabled"],J8r={class:"setting-item"},ehr={class:"flex-1 flex items-center gap-4"},thr=["value","disabled"],nhr=["value","disabled"],rhr={class:"setting-item"},ihr={class:"flex-1 flex items-center gap-4"},shr=["value","disabled"],ohr=["value","disabled"];function ahr(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",U8r,[e[22]||(e[22]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Internet Search ",-1)),e[23]||(e[23]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400 mb-4"}," Configure how LoLLMs interacts with the internet to answer questions or find information. Requires a model capable of function calling or specific instruction following. ",-1)),b("section",B8r,[e[16]||(e[16]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Activation & Behavior",-1)),b("div",z8r,[e[12]||(e[12]=b("label",{for:"activate_internet_search",class:"toggle-label"},[Se(" Enable Automatic Internet Search "),b("span",{class:"toggle-description"},"Allow the AI to decide when to search the internet based on the prompt.")],-1)),te(o,{id:"activate_internet_search",checked:n.config.activate_internet_search,"onUpdate:checked":e[0]||(e[0]=a=>s.updateValue("activate_internet_search",a))},null,8,["checked"])]),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[13]||(e[13]=b("label",{for:"internet_activate_search_decision",class:"toggle-label"},[Se(" Enable Explicit Search Decision "),b("span",{class:"toggle-description"},"Make the AI explicitly state whether it needs to search the internet before performing the search.")],-1)),te(o,{id:"internet_activate_search_decision",checked:n.config.internet_activate_search_decision,"onUpdate:checked":e[1]||(e[1]=a=>s.updateValue("internet_activate_search_decision",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[14]||(e[14]=b("label",{for:"activate_internet_pages_judgement",class:"toggle-label"},[Se(" Enable Search Result Evaluation "),b("span",{class:"toggle-description"},"Allow the AI to evaluate the relevance and quality of search result snippets before using them.")],-1)),te(o,{id:"activate_internet_pages_judgement",checked:n.config.activate_internet_pages_judgement,"onUpdate:checked":e[2]||(e[2]=a=>s.updateValue("activate_internet_pages_judgement",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[15]||(e[15]=b("label",{for:"internet_quick_search",class:"toggle-label"},[Se(" Enable Quick Search "),b("span",{class:"toggle-description"},"Perform a faster search potentially using fewer results or less processing, might be less accurate.")],-1)),te(o,{id:"internet_quick_search",checked:n.config.internet_quick_search,"onUpdate:checked":e[3]||(e[3]=a=>s.updateValue("internet_quick_search",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2)]),b("section",{class:ye(["space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color",n.config.activate_internet_search?"":"opacity-50 pointer-events-none"])},[e[21]||(e[21]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Search Parameters",-1)),b("div",X8r,[e[17]||(e[17]=b("label",{for:"internet_nb_search_pages",class:"setting-label"},[Se(" Number of Search Results "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Controls how many search result snippets are initially retrieved.")],-1)),b("div",F8r,[b("input",{id:"internet_nb_search_pages-range",value:n.config.internet_nb_search_pages,onInput:e[4]||(e[4]=a=>s.handleNumberInput("internet_nb_search_pages",a.target.value,!0)),type:"range",min:"1",max:"20",step:"1",class:"range-input",disabled:!n.config.activate_internet_search},null,40,j8r),b("input",{id:"internet_nb_search_pages-number",value:n.config.internet_nb_search_pages,onInput:e[5]||(e[5]=a=>s.handleNumberInput("internet_nb_search_pages",a.target.value,!0)),type:"number",min:"1",max:"20",step:"1",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,Y8r)])]),b("div",G8r,[e[18]||(e[18]=b("label",{for:"internet_vectorization_chunk_size",class:"setting-label"},[Se(" Content Chunk Size "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Size of text chunks when processing content from searched web pages (if applicable).")],-1)),b("div",W8r,[b("input",{id:"internet_vectorization_chunk_size-range",value:n.config.internet_vectorization_chunk_size,onInput:e[6]||(e[6]=a=>s.handleNumberInput("internet_vectorization_chunk_size",a.target.value,!0)),type:"range",min:"100",max:"1000",step:"50",class:"range-input",disabled:!n.config.activate_internet_search},null,40,Z8r),b("input",{id:"internet_vectorization_chunk_size-number",value:n.config.internet_vectorization_chunk_size,onInput:e[7]||(e[7]=a=>s.handleNumberInput("internet_vectorization_chunk_size",a.target.value,!0)),type:"number",min:"100",max:"1000",step:"50",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,K8r)])]),b("div",J8r,[e[19]||(e[19]=b("label",{for:"internet_vectorization_overlap_size",class:"setting-label"},[Se(" Content Overlap Size "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Overlap between text chunks when processing web page content.")],-1)),b("div",ehr,[b("input",{id:"internet_vectorization_overlap_size-range",value:n.config.internet_vectorization_overlap_size,onInput:e[8]||(e[8]=a=>s.handleNumberInput("internet_vectorization_overlap_size",a.target.value,!0)),type:"range",min:"0",max:"200",step:"10",class:"range-input",disabled:!n.config.activate_internet_search},null,40,thr),b("input",{id:"internet_vectorization_overlap_size-number",value:n.config.internet_vectorization_overlap_size,onInput:e[9]||(e[9]=a=>s.handleNumberInput("internet_vectorization_overlap_size",a.target.value,!0)),type:"number",min:"0",max:"200",step:"10",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,nhr)])]),b("div",rhr,[e[20]||(e[20]=b("label",{for:"internet_vectorization_nb_chunks",class:"setting-label"},[Se(" Number of Content Chunks to Use "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Maximum number of processed text chunks from web pages to include in the context.")],-1)),b("div",ihr,[b("input",{id:"internet_vectorization_nb_chunks-range",value:n.config.internet_vectorization_nb_chunks,onInput:e[10]||(e[10]=a=>s.handleNumberInput("internet_vectorization_nb_chunks",a.target.value,!0)),type:"range",min:"1",max:"20",step:"1",class:"range-input",disabled:!n.config.activate_internet_search},null,40,shr),b("input",{id:"internet_vectorization_nb_chunks-number",value:n.config.internet_vectorization_nb_chunks,onInput:e[11]||(e[11]=a=>s.handleNumberInput("internet_vectorization_nb_chunks",a.target.value,!0)),type:"number",min:"1",max:"20",step:"1",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,ohr)])])],2)])}const lhr=st(q8r,[["render",ahr],["__scopeId","data-v-10e06c13"]]),chr={name:"ServiceEntry",props:{service:{type:Object,required:!0},serviceType:{type:String,required:!0},isActive:{type:Boolean,default:!1},baseUrl:{type:String,default:""}},emits:["select","configure","error"],computed:{isConfigurable(){return this.service.name!=="None"&&this.service.name!=="browser"}},methods:{selectService(){this.service.name!=="None"&&this.$emit("select",{serviceType:this.serviceType,serviceName:this.service.name})},configureService(){this.isActive&&this.$emit("configure",{serviceType:this.serviceType,serviceName:this.service.name})},getServiceIconUrl(t){return t?t.startsWith("http")||t.startsWith("/")?t:`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t.startsWith("/")?t.substring(1):t}`:Eo},handleImgError(t){t.target.src=Eo,this.$emit("error",{type:"image_load",message:"Failed to load service icon",event:t})},replaceFeatherIcons(){Fe(()=>{try{this.$el&&this.$el.parentNode&&Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},uhr={class:"flex-grow flex flex-col p-4"},dhr={class:"flex items-start mb-3"},fhr=["src"],hhr={class:"flex-grow overflow-hidden min-w-0"},phr=["title"],Thr=["title"],Ohr={class:"mt-auto pt-3 border-t border-gray-200 dark:border-gray-700"},mhr={class:"flex justify-end items-center"},ghr=["disabled"],Qhr={key:1,class:"text-xs text-gray-400 dark:text-gray-500 italic"};function _hr(t,e,n,r,i,s){return k(),R("div",{class:ye(["app-card relative flex flex-col cursor-pointer transition-all duration-200 ease-in-out hover:shadow-lg",{"border-2 border-blue-500 dark:border-blue-400 shadow-md scale-[1.02]":n.isActive,"border border-gray-200 dark:border-gray-700":!n.isActive,"opacity-60 hover:opacity-100":!n.isActive&&n.service.name!=="None"&&n.service.name!=="browser"}]),onClick:e[2]||(e[2]=(...o)=>s.selectService&&s.selectService(...o))},[b("div",uhr,[b("div",dhr,[b("img",{src:s.getServiceIconUrl(n.service.icon),onError:e[0]||(e[0]=(...o)=>s.handleImgError&&s.handleImgError(...o)),alt:"Service Icon",class:"w-12 h-12 rounded-lg object-cover mr-4 flex-shrink-0 border border-gray-200 dark:border-gray-600 shadow-sm"},null,40,fhr),b("div",hhr,[b("h3",{class:"font-semibold text-md text-gray-800 dark:text-gray-100 truncate",title:n.service.caption||n.service.name},ae(n.service.caption||n.service.name),9,phr),n.service.description?(k(),R("p",{key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-1 line-clamp-2",title:n.service.description},ae(n.service.description),9,Thr)):ne("",!0)])]),b("div",Ohr,[b("div",mhr,[s.isConfigurable?(k(),R("button",{key:0,onClick:e[1]||(e[1]=oe((...o)=>s.configureService&&s.configureService(...o),["stop"])),class:ye(["btn btn-secondary btn-sm p-1.5 flex-shrink-0",{"cursor-not-allowed opacity-50":!n.isActive}]),title:"Configure Service",disabled:!n.isActive},e[3]||(e[3]=[b("i",{"data-feather":"settings",class:"w-4 h-4"},null,-1)]),10,ghr)):(k(),R("span",Qhr,"No settings"))])])])],2)}const vhr=st(chr,[["render",_hr],["__scopeId","data-v-0d69041f"]]),yhr="/",bhr={name:"ServicesZooSettings",components:{ToggleSwitch:ju,ServiceEntry:vhr},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],setup(t,{emit:e}){const n=We(yhr),r=We([]),i=We([]),s=We([]),o=We([]),a=We([]),l=We([]),c=We([]),u=We([]),d=We([]),f={name:"None",caption:"None",icon:null,description:"No service selected."},h={name:"browser",caption:"Browser TTS",icon:null,description:"Uses the built-in browser text-to-speech capability."},p=Je(()=>[f,h,...r.value]),T=Je(()=>[f,...i.value]),m=Je(()=>[f,...s.value]),O=Je(()=>[f,...o.value]),g=Je(()=>[f,...a.value]),Q=(w,L)=>{e("setting-updated",{key:w,value:L})},v=(w,L,P=!1)=>{let A=P?parseInt(L):parseFloat(L);if(isNaN(A))if(w==="stt_input_device"||w==="tts_output_device"){console.warn(`Invalid device index selected for ${w}: ${L}`);return}else{console.warn(`Invalid number for ${w}: ${L}`);return}Q(w,A)},_=({serviceType:w,serviceName:L})=>{const A={tts:"active_tts_service",stt:"active_stt_service",tti:"active_tti_service",ttm:"active_ttm_service",ttv:"active_ttv_service"}[w];A&&Q(A,L)},y=async()=>{try{const[w,L,P,A,q]=await Promise.all([t.api_post_req("list_tts_services"),t.api_post_req("list_stt_services"),t.api_post_req("list_tti_services"),t.api_post_req("list_ttm_services"),t.api_post_req("list_ttv_services")]);r.value=Array.isArray(w)?w:[],i.value=Array.isArray(L)?L:[],s.value=Array.isArray(P)?P:[],o.value=Array.isArray(A)?A:[],a.value=Array.isArray(q)?q:[]}catch{t.show_toast("Failed to fetch service lists.",4,!1)}},S=async()=>{try{const[w,L]=await Promise.all([t.api_get_req("get_snd_input_devices"),t.api_get_req("get_snd_output_devices")]);l.value=(w==null?void 0:w.device_names)||[],c.value=(w==null?void 0:w.device_indexes)||[],u.value=(L==null?void 0:L.device_names)||[],d.value=(L==null?void 0:L.device_indexes)||[]}catch{t.show_toast("Failed to fetch audio devices.",4,!1)}},x=()=>{t.show_toast("Refreshing audio devices...",2,!0),S()},E=async({serviceType:w,serviceName:L})=>{if(!L||L==="None"||L==="browser"){t.show_toast(`No configurable settings for '${L}'.`,3,!1);return}const P={tts:"get_active_tts_settings",stt:"get_active_stt_settings",tti:"get_active_tti_settings",ttm:"get_active_ttm_settings",ttv:"get_active_ttv_settings"},A={tts:"set_active_tts_settings",stt:"set_active_stt_settings",tti:"set_active_tti_settings",ttm:"set_active_ttm_settings",ttv:"set_active_ttv_settings"},q=P[w],X=A[w];if(!(!q||!X))try{const F=`active_${w}_service`;if(t.config[F]!==L){t.show_toast(`Please select ${L} first to configure its settings.`,3,!1);return}const z=await t.api_post_req(q);if(z&&Object.keys(z).length>0){const U=await t.show_universal_form(z,`${L} Settings`,"Save","Cancel");if(U!=null){const j=await t.api_post_req(X,{settings:U});j&&j.status?t.show_toast(`${L} settings updated!`,4,!0):t.show_toast(`Failed to update ${L} settings: ${(j==null?void 0:j.error)||"Error"}`,4,!1)}}else t.show_toast(`${L} has no configurable settings.`,3,!1)}catch(F){t.show_toast(`Error with ${L} settings: ${F.message}`,4,!1)}},C=()=>{Fe(()=>{try{Re.replace()}catch{}})};return Ii(()=>{y(),S(),C()}),Au(()=>{C()}),{baseUrl:n,ttsServices:r,sttServices:i,ttiServices:s,ttmServices:o,ttvServices:a,audioInputDevices:l,audioInputDeviceIndexes:c,audioOutputDevices:u,audioOutputDeviceIndexes:d,ttsServicesWithDefaults:p,sttServicesWithDefaults:T,ttiServicesWithDefaults:m,ttmServicesWithDefaults:O,ttvServicesWithDefaults:g,updateValue:Q,handleNumberInput:v,handleServiceSelect:_,refreshAudioDevices:x,showServiceSettings:E}}},Shr={class:"user-settings-panel space-y-6"},xhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ehr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},whr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Chr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Lhr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},$hr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Ahr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},khr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Phr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Rhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Mhr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Dhr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Nhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ihr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Hhr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Vhr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},qhr={class:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4"},Uhr={class:"setting-item !items-center"},Bhr=["value"],zhr={class:"setting-item !items-center"},Xhr=["value"],Fhr={class:"setting-item !items-center"},jhr=["value"],Yhr={class:"setting-item !items-center"},Ghr=["value"],Whr={class:"setting-item !items-center"},Zhr=["value"],Khr={class:"setting-item !items-center"},Jhr=["value"],e9r={class:"setting-item !items-center"},t9r=["value"],n9r={class:"toggle-item md:col-span-2"},r9r=["value","disabled"],i9r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},s9r={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},o9r={class:"setting-item"},a9r=["value"],l9r=["value"],c9r={class:"setting-item"},u9r=["value"],d9r=["value"];function f9r(t,e,n,r,i,s){const o=Xe("ServiceEntry"),a=Xe("ToggleSwitch");return k(),R("div",Shr,[e[36]||(e[36]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Services Zoo & Audio ",-1)),b("section",xhr,[e[12]||(e[12]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Speech (TTS)",-1)),e[13]||(e[13]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for converting text into speech.",-1)),r.ttsServices.length>0?(k(),R("div",Ehr,[(k(!0),R(Ve,null,dt(r.ttsServicesWithDefaults,l=>(k(),Qt(o,{key:`tts-${l.name}`,service:l,serviceType:"tts",baseUrl:r.baseUrl,isActive:n.config.active_tts_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",whr,"No TTS services available."))]),b("section",Chr,[e[14]||(e[14]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Speech-to-Text (STT)",-1)),e[15]||(e[15]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for converting speech into text.",-1)),r.sttServices.length>0?(k(),R("div",Lhr,[(k(!0),R(Ve,null,dt(r.sttServicesWithDefaults,l=>(k(),Qt(o,{key:`stt-${l.name}`,service:l,serviceType:"stt",baseUrl:r.baseUrl,isActive:n.config.active_stt_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",$hr,"No STT services available."))]),b("section",Ahr,[e[16]||(e[16]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Image (TTI)",-1)),e[17]||(e[17]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating images from text.",-1)),r.ttiServices.length>0?(k(),R("div",khr,[(k(!0),R(Ve,null,dt(r.ttiServicesWithDefaults,l=>(k(),Qt(o,{key:`tti-${l.name}`,service:l,serviceType:"tti",baseUrl:r.baseUrl,isActive:n.config.active_tti_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Phr,"No TTI services available."))]),b("section",Rhr,[e[18]||(e[18]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Music (TTM)",-1)),e[19]||(e[19]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating music from text.",-1)),r.ttmServices.length>0?(k(),R("div",Mhr,[(k(!0),R(Ve,null,dt(r.ttmServicesWithDefaults,l=>(k(),Qt(o,{key:`ttm-${l.name}`,service:l,serviceType:"ttm",baseUrl:r.baseUrl,isActive:n.config.active_ttm_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Dhr,"No TTM services available."))]),b("section",Nhr,[e[20]||(e[20]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Video (TTV)",-1)),e[21]||(e[21]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating videos from text.",-1)),r.ttvServices.length>0?(k(),R("div",Ihr,[(k(!0),R(Ve,null,dt(r.ttvServicesWithDefaults,l=>(k(),Qt(o,{key:`ttv-${l.name}`,service:l,serviceType:"ttv",baseUrl:r.baseUrl,isActive:n.config.active_ttv_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Hhr,"No TTV services available."))]),b("section",Vhr,[e[31]||(e[31]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Audio Input / STT Settings",-1)),b("div",qhr,[b("div",Uhr,[e[22]||(e[22]=b("label",{for:"stt_listening_threshold",class:"setting-label"},"Listening Threshold",-1)),b("input",{id:"stt_listening_threshold",value:n.config.stt_listening_threshold,onInput:e[0]||(e[0]=l=>r.handleNumberInput("stt_listening_threshold",l.target.value,!0)),type:"number",min:"0",step:"10",class:"input-sm w-24"},null,40,Bhr)]),b("div",zhr,[e[23]||(e[23]=b("label",{for:"stt_silence_duration",class:"setting-label"},"Silence Duration (s)",-1)),b("input",{id:"stt_silence_duration",value:n.config.stt_silence_duration,onInput:e[1]||(e[1]=l=>r.handleNumberInput("stt_silence_duration",l.target.value,!0)),type:"number",min:"0",step:"1",class:"input-sm w-24"},null,40,Xhr)]),b("div",Fhr,[e[24]||(e[24]=b("label",{for:"stt_sound_threshold_percentage",class:"setting-label"},"Min Sound Percentage",-1)),b("input",{id:"stt_sound_threshold_percentage",value:n.config.stt_sound_threshold_percentage,onInput:e[2]||(e[2]=l=>r.handleNumberInput("stt_sound_threshold_percentage",l.target.value,!0)),type:"number",min:"0",max:"100",step:"1",class:"input-sm w-24"},null,40,jhr)]),b("div",Yhr,[e[25]||(e[25]=b("label",{for:"stt_gain",class:"setting-label"},"Volume Amplification",-1)),b("input",{id:"stt_gain",value:n.config.stt_gain,onInput:e[3]||(e[3]=l=>r.handleNumberInput("stt_gain",l.target.value,!0)),type:"number",min:"0",step:"1",class:"input-sm w-24"},null,40,Ghr)]),b("div",Whr,[e[26]||(e[26]=b("label",{for:"stt_rate",class:"setting-label"},"Audio Rate (Hz)",-1)),b("input",{id:"stt_rate",value:n.config.stt_rate,onInput:e[4]||(e[4]=l=>r.handleNumberInput("stt_rate",l.target.value,!0)),type:"number",min:"8000",step:"1000",class:"input-sm w-24"},null,40,Zhr)]),b("div",Khr,[e[27]||(e[27]=b("label",{for:"stt_channels",class:"setting-label"},"Channels",-1)),b("input",{id:"stt_channels",value:n.config.stt_channels,onInput:e[5]||(e[5]=l=>r.handleNumberInput("stt_channels",l.target.value,!0)),type:"number",min:"1",max:"2",step:"1",class:"input-sm w-24"},null,40,Jhr)]),b("div",e9r,[e[28]||(e[28]=b("label",{for:"stt_buffer_size",class:"setting-label"},"Buffer Size",-1)),b("input",{id:"stt_buffer_size",value:n.config.stt_buffer_size,onInput:e[6]||(e[6]=l=>r.handleNumberInput("stt_buffer_size",l.target.value,!0)),type:"number",min:"512",step:"512",class:"input-sm w-24"},null,40,t9r)]),b("div",n9r,[e[29]||(e[29]=b("label",{for:"stt_activate_word_detection",class:"toggle-label"},"Activate Wake Word Detection",-1)),te(a,{id:"stt_activate_word_detection",checked:n.config.stt_activate_word_detection,"onUpdate:checked":e[7]||(e[7]=l=>r.updateValue("stt_activate_word_detection",l))},null,8,["checked"])]),b("div",{class:ye(["setting-item md:col-span-2",{"opacity-50 pointer-events-none":!n.config.stt_activate_word_detection}])},[e[30]||(e[30]=b("label",{for:"stt_word_detection_file",class:"setting-label"},"Wake Word File (.wav)",-1)),b("input",{type:"text",id:"stt_word_detection_file",value:n.config.stt_word_detection_file,onInput:e[8]||(e[8]=l=>r.updateValue("stt_word_detection_file",l.target.value)),class:"input flex-grow",placeholder:"Path to wake word wav file",disabled:!n.config.stt_activate_word_detection},null,40,r9r)],2)])]),b("section",i9r,[e[35]||(e[35]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Audio Devices",-1)),b("button",{onClick:e[9]||(e[9]=(...l)=>r.refreshAudioDevices&&r.refreshAudioDevices(...l)),class:"btn btn-secondary btn-sm mb-2",title:"Rescan for audio devices"},e[32]||(e[32]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4 mr-1"},null,-1),Se(" Refresh Devices ")])),b("div",s9r,[b("div",o9r,[e[33]||(e[33]=b("label",{for:"stt_input_device",class:"setting-label"},"Audio Input Device",-1)),b("select",{id:"stt_input_device",value:n.config.stt_input_device,onChange:e[10]||(e[10]=l=>r.handleNumberInput("stt_input_device",l.target.value,!0)),class:"input flex-grow"},[(k(!0),R(Ve,null,dt(r.audioInputDevices,(l,c)=>(k(),R("option",{key:`in-${c}`,value:r.audioInputDeviceIndexes[c]},ae(l),9,l9r))),128))],40,a9r)]),b("div",c9r,[e[34]||(e[34]=b("label",{for:"tts_output_device",class:"setting-label"},"Audio Output Device",-1)),b("select",{id:"tts_output_device",value:n.config.tts_output_device,onChange:e[11]||(e[11]=l=>r.handleNumberInput("tts_output_device",l.target.value,!0)),class:"input flex-grow"},[(k(!0),R(Ve,null,dt(r.audioOutputDevices,(l,c)=>(k(),R("option",{key:`out-${c}`,value:r.audioOutputDeviceIndexes[c]},ae(l),9,d9r))),128))],40,u9r)])])])])}const h9r=st(bhr,[["render",f9r],["__scopeId","data-v-3f1df76f"]]),Mh="/assets/logo-CQZwS0X1.svg",p9r={name:"ImageAlbumViewer",props:{images:{type:Array,required:!0,validator:t=>t.every(e=>typeof e=="string")},initialSelected:{type:String,default:null}},data(){return{selectedImage:null}},created(){this.selectedImage=this.initialSelected||(this.images.length>0?this.images[0]:null)},methods:{selectImage(t){this.selectedImage=t}},watch:{images(t){t&&t.length>0?t.includes(this.selectedImage)||(this.selectedImage=t[0]):this.selectedImage=null}}},T9r={class:"image-album-viewer"},O9r={key:0,class:"main-view"},m9r=["src"],g9r={class:"thumbnails"},Q9r=["src","onClick"];function _9r(t,e,n,r,i,s){return k(),R("div",T9r,[i.selectedImage?(k(),R("div",O9r,[b("img",{src:i.selectedImage,alt:"Selected album image"},null,8,m9r)])):ne("",!0),b("div",g9r,[(k(!0),R(Ve,null,dt(n.images,(o,a)=>(k(),R("img",{key:a,src:o,class:ye([{active:o===i.selectedImage},"thumbnail"]),onClick:l=>s.selectImage(o),alt:"Album thumbnail"},null,10,Q9r))),128))])])}const v9r=st(p9r,[["render",_9r],["__scopeId","data-v-a5675545"]]),y9r={name:"DynamicUIRenderer",components:{ImageAlbumViewer:v9r},props:{ui:{type:String,required:!0},instanceId:{type:String,required:!0}},data(){return{albumImages:[],showAlbumViewer:!1,injectedStyleElements:[]}},computed:{...Pu(["clientId"]),containerId(){return`dynamic-ui-${this.instanceId}`}},watch:{ui:{immediate:!0,handler(t,e){const n=this.$refs.htmlContentContainer;(t!==e||!n||n.innerHTML==="")&&(console.log(`UI prop changed for instance ${this.instanceId}`),this.cleanupDynamicContent(),this.$nextTick(()=>{this.renderContent()}))}}},beforeUnmount(){this.cleanupDynamicContent()},methods:{renderContent(){console.log(`Rendering content for instance ${this.instanceId}...`);const t=this.$refs.htmlContentContainer;if(!t){console.error(`HTML content container ref not found for instance ${this.instanceId}`);return}t.innerHTML="";let e=[];this.showAlbumViewer=!1;const r=new DOMParser().parseFromString(this.ui||"","text/html"),i=r.head.getElementsByTagName("style");Array.from(i).forEach(c=>this.injectScopedCss(c.textContent));const s=r.body.getElementsByTagName("style");Array.from(s).forEach(c=>this.injectScopedCss(c.textContent));const o=[];let a=!1;Array.from(r.body.childNodes).forEach(c=>{if(c.nodeType===Node.ELEMENT_NODE){if(c.tagName==="IMG"&&c.classList.contains("album")){const u=c.getAttribute("src");u&&(e.push(u),a=!0);return}c.tagName==="IMG"&&c.classList.contains("clickable-post")&&(c.dataset.endpoint||(c.dataset.endpoint="/post_to_personality"),c.dataset.payloadKey||(c.dataset.payloadKey="img_path")),c.tagName==="A"&&c.classList.contains("open-folder")&&c.setAttribute("href","#")}o.push(c)}),o.forEach(c=>{t.appendChild(document.importNode(c,!0))}),a&&e.length>0?(this.albumImages=e,this.showAlbumViewer=!0,console.log(`Scheduled ImageAlbumViewer rendering for instance ${this.instanceId} with ${e.length} images.`)):(this.albumImages=[],this.showAlbumViewer=!1),console.log(`Finished rendering for instance ${this.instanceId}.`)},injectScopedCss(t){const e=this.scopeCSS(t),n=document.createElement("style");n.textContent=e,document.head.appendChild(n),this.injectedStyleElements.push(n)},scopeCSS(t){return t.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,(e,n,r)=>(n=n.trim(),n.startsWith("@")||n.startsWith(":")||n.includes("#")||n.includes("[")?e:`${n.split(",").map(s=>`#${this.containerId} ${s.trim()}`).join(", ")}${r}`))},handleContainerClick(t){const e=t.target,n=e.closest("img.clickable-post");if(n&&n.dataset.endpoint){t.preventDefault();const i=n.dataset.endpoint,s=n.dataset.payloadKey||"img_path",o=n.getAttribute("src"),a={[s]:o};console.log(`Posting to ${i} with payload:`,a),Ae.post(i,a).then(l=>console.log("Post successful:",l.data)).catch(l=>console.error(`Error posting to ${i}:`,l));return}const r=e.closest("a.open-folder");if(r&&r.dataset.discussionId){t.preventDefault();const i=r.dataset.discussionId;if(!this.clientId){console.error("Client ID not found in Vuex store."),alert("Error: Client information is missing.");return}console.log(`Posting to /open_discussion_folder with client_id: ${this.clientId}, discussion_id: ${i}`),Ae.post("/open_discussion_folder",{client_id:this.clientId,discussion_id:i}).then(s=>console.log("Open folder request successful:",s.data)).catch(s=>console.error("Error opening folder:",s));return}},cleanupDynamicContent(){console.log(`Cleaning up dynamic content for instance ${this.instanceId}`),this.showAlbumViewer=!1,this.albumImages=[],this.injectedStyleElements.forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.injectedStyleElements=[];const t=this.$refs.htmlContentContainer;t&&(t.innerHTML=""),console.log(`Finished cleanup for instance ${this.instanceId}.`)}}},b9r=["id"],S9r={ref:"htmlContentContainer"};function x9r(t,e,n,r,i,s){const o=Xe("ImageAlbumViewer");return k(),R("div",{id:s.containerId,ref:"container",onClick:e[0]||(e[0]=(...a)=>s.handleContainerClick&&s.handleContainerClick(...a))},[b("div",S9r,null,512),i.showAlbumViewer?(k(),Qt(o,{images:i.albumImages,key:`album-${n.instanceId}`},null,8,["images"])):ne("",!0)],8,b9r)}const Ioe=st(y9r,[["render",x9r],["__scopeId","data-v-8df62e27"]]),Ky="/",E9r={name:"BindingEntry",components:{DynamicUIRenderer:Ioe},props:{binding:{type:Object,required:!0},selected:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1}},emits:["select","install","uninstall","reinstall","settings","reload-binding"],mounted(){this.updateIcons()},updated(){this.updateIcons()},methods:{updateIcons(){Fe(()=>{try{Re.replace({width:"1em",height:"1em"})}catch(t){console.error("Feather icons replacement failed:",t)}})},copyToClipBoard(t){if(!t){console.warn("Attempted to copy empty text.");return}navigator.clipboard?navigator.clipboard.writeText(t).then(()=>{console.log("Copied to clipboard:",t)}).catch(e=>{console.error("Failed to copy text using navigator.clipboard: ",e),this.fallbackCopyToClipboard(t)}):(console.warn("Clipboard API not available, attempting fallback."),this.fallbackCopyToClipboard(t))},fallbackCopyToClipboard(t){const e=document.createElement("textarea");e.value=t,e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?console.log("Fallback copy successful:",t):console.error("Fallback copy command failed.")}catch(n){console.error("Error during fallback copy command:",n)}document.body.removeChild(e)},getImgUrl(){return!this.binding||typeof this.binding.icon!="string"||this.binding.icon.trim()===""?Mh:/^(https?:)?\/\//.test(this.binding.icon)||this.binding.icon.startsWith("/")?this.binding.icon:(Ky.endsWith("/")?Ky:`${Ky}/`)+this.binding.icon},defaultImg(t){t.target.src!==Mh&&(t.target.src=Mh)},emitSelect(){this.isProcessing||this.$emit("select",this.binding)},emitInstall(){this.isProcessing||this.$emit("install",this.binding)},emitUninstall(){this.isProcessing||this.$emit("uninstall",this.binding)},emitReinstall(){this.isProcessing||this.$emit("reinstall",this.binding)},emitReloadBinding(){this.isProcessing||this.$emit("reload-binding",this.binding)},emitSettings(){this.isProcessing||this.$emit("settings",this.binding)}},watch:{selected(){this.updateIcons()},isProcessing(){this.updateIcons()},"binding.installed"(){this.updateIcons()},"binding.ui"(){this.updateIcons()}}},w9r=["title"],C9r={class:"flex flex-row items-center gap-3 mb-2"},L9r=["src"],$9r={class:"font-bold text-lg truncate text-slate-800 dark:text-slate-100 flex-grow"},A9r={key:0,class:"ml-2 text-xs font-medium text-green-600 dark:text-green-400"},k9r={key:1,class:"ml-2 text-xs font-medium text-yellow-600 dark:text-yellow-400"},P9r={class:"flex-none flex items-center gap-1"},R9r={class:"text-sm text-slate-600 dark:text-slate-400 space-y-1 mb-3"},M9r={class:"flex items-center"},D9r={class:"truncate"},N9r={class:"flex items-center"},I9r={class:"truncate font-mono text-xs bg-blue-100 dark:bg-slate-700 px-1 py-0.5 rounded"},H9r=["disabled"],V9r={class:"flex items-center"},q9r={class:"flex items-center"},U9r=["href"],B9r={class:"flex items-start pt-1"},z9r=["title","innerHTML"],X9r={class:"flex items-center justify-end gap-2 border-t border-blue-200 dark:border-slate-700 pt-3 min-h-[44px]"},F9r={key:0,class:"flex items-center justify-center text-slate-500 dark:text-slate-400 w-full"},j9r=["disabled"],Y9r=["disabled"],G9r=["disabled"],W9r=["disabled"];function Z9r(t,e,n,r,i,s){const o=Xe("DynamicUIRenderer");return k(),R("div",{class:ye(["items-start p-4 rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none transition-all duration-150 ease-in-out group",{"border-blue-400 dark:border-sky-500 bg-blue-100 dark:bg-slate-700":n.selected,"hover:bg-blue-50 dark:hover:bg-slate-700":!n.selected&&!n.isProcessing,"border-transparent bg-blue-50 dark:bg-slate-800 text-slate-800 dark:text-slate-200":!n.selected,"opacity-70 cursor-wait":n.isProcessing}]),title:n.binding.description||n.binding.name,onClick:e[8]||(e[8]=oe(a=>n.isProcessing?null:s.emitSelect(),["stop"]))},[b("div",null,[b("div",C9r,[b("img",{ref:"imgElement",src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),class:ye(["w-10 h-10 rounded-full object-fill flex-shrink-0 border border-blue-200 dark:border-slate-700",{"ring-2 ring-offset-2 ring-green-500 dark:ring-green-400 ring-offset-blue-50 dark:ring-offset-slate-800":n.binding.installed&&!n.isProcessing&&!n.selected,"ring-2 ring-offset-2 ring-green-500 dark:ring-green-400 ring-offset-blue-100 dark:ring-offset-slate-700":n.binding.installed&&!n.isProcessing&&n.selected,"ring-2 ring-offset-2 ring-yellow-500 dark:ring-yellow-400 ring-offset-blue-50 dark:ring-offset-slate-800 animate-pulse":n.isProcessing}])},null,42,L9r),b("h3",$9r,[Se(ae(n.binding.name)+" ",1),n.binding.installed&&!n.isProcessing?(k(),R("span",A9r,"(Installed)")):ne("",!0),n.isProcessing?(k(),R("span",k9r,"(Processing...)")):ne("",!0)]),b("div",P9r,[n.selected&&n.binding.installed&&!n.isProcessing?(k(),R("button",{key:0,type:"button",title:"Reload binding",onClick:e[1]||(e[1]=oe((...a)=>s.emitReloadBinding&&s.emitReloadBinding(...a),["stop"])),class:"svg-button text-slate-500 dark:text-slate-400 hover:text-blue-600 dark:hover:text-sky-400 hover:bg-transparent dark:hover:bg-transparent active:scale-90 focus:ring-blue-300 dark:focus:ring-slate-600"},e[9]||(e[9]=[b("i",{"data-feather":"refresh-cw",class:"w-5 h-5"},null,-1),b("span",{class:"sr-only"},"Reload Binding",-1)]))):ne("",!0)])]),n.binding.ui?(k(),Qt(o,{key:0,class:"w-full h-full mb-3 border-t pt-3 border-blue-200 dark:border-slate-700",code:n.binding.ui},null,8,["code"])):ne("",!0),b("div",R9r,[b("div",M9r,[e[10]||(e[10]=b("i",{"data-feather":"user",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[11]||(e[11]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Author:",-1)),b("span",D9r,ae(n.binding.author),1)]),b("div",N9r,[e[13]||(e[13]=b("i",{"data-feather":"folder",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[14]||(e[14]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Folder:",-1)),b("span",I9r,ae(n.binding.folder),1),e[15]||(e[15]=b("div",{class:"flex-grow"},null,-1)),b("button",{class:"ml-2 text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300 duration-150 active:scale-90 p-1 rounded disabled:opacity-50",title:"Copy folder path to clipboard",onClick:e[2]||(e[2]=oe(a=>s.copyToClipBoard(n.binding.folder),["stop"])),disabled:n.isProcessing},e[12]||(e[12]=[b("i",{"data-feather":"clipboard",class:"w-4 h-4"},null,-1),b("span",{class:"sr-only"},"Copy folder path",-1)]),8,H9r)]),b("div",V9r,[e[16]||(e[16]=b("i",{"data-feather":"git-merge",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[17]||(e[17]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Version:",-1)),b("span",null,ae(n.binding.version),1)]),b("div",q9r,[e[18]||(e[18]=b("i",{"data-feather":"github",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[19]||(e[19]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Link:",-1)),b("a",{href:n.binding.link,target:"_blank",rel:"noopener noreferrer",class:ye(["link truncate",{"pointer-events-none opacity-70":n.isProcessing}]),onClick:e[3]||(e[3]=oe(()=>{},["stop"]))},ae(n.binding.link),11,U9r)]),b("div",B9r,[e[21]||(e[21]=b("i",{"data-feather":"info",class:"w-4 h-4 mr-2 mt-0.5 flex-shrink-0"},null,-1)),b("div",null,[e[20]||(e[20]=b("b",{class:"font-medium text-slate-700 dark:text-slate-300"},"Description:",-1)),b("p",{class:"opacity-90 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,z9r)])])]),b("div",X9r,[n.isProcessing?(k(),R("div",F9r,e[22]||(e[22]=[b("div",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-current mr-2"},null,-1),Se(" Processing... ")]))):ne("",!0),n.isProcessing?ne("",!0):(k(),R(Ve,{key:1},[n.binding.installed?ne("",!0):(k(),R("button",{key:0,title:"Click to install",type:"button",onClick:e[4]||(e[4]=oe((...a)=>s.emitInstall&&s.emitInstall(...a),["stop"])),class:"btn btn-primary btn-sm",disabled:n.isProcessing},e[23]||(e[23]=[b("i",{"data-feather":"download-cloud",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Install",-1)]),8,j9r)),n.binding.installed?(k(),R("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=oe((...a)=>s.emitReinstall&&s.emitReinstall(...a),["stop"])),class:"btn btn-success btn-sm",disabled:n.isProcessing},e[24]||(e[24]=[b("i",{"data-feather":"refresh-ccw",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Reinstall",-1)]),8,Y9r)):ne("",!0),n.binding.installed?(k(),R("button",{key:2,title:"Click to Uninstall binding",type:"button",onClick:e[6]||(e[6]=oe((...a)=>s.emitUninstall&&s.emitUninstall(...a),["stop"])),class:"btn btn-sm bg-red-600 text-white hover:bg-red-700 focus:ring-4 focus:ring-red-300 dark:bg-red-500 dark:hover:bg-red-600 dark:focus:ring-red-800 disabled:opacity-50",disabled:n.isProcessing},e[25]||(e[25]=[b("i",{"data-feather":"trash-2",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Uninstall",-1)]),8,G9r)):ne("",!0),n.selected&&n.binding.installed?(k(),R("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[7]||(e[7]=oe((...a)=>s.emitSettings&&s.emitSettings(...a),["stop"])),class:"btn btn-secondary btn-sm",disabled:n.isProcessing},e[26]||(e[26]=[b("i",{"data-feather":"settings",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Settings",-1)]),8,W9r)):ne("",!0)],64))])])],10,w9r)}const K9r=st(E9r,[["render",Z9r],["__scopeId","data-v-779a3b12"]]),lY="/assets/logo-6TyToX4A.png",J9r={name:"BindingZooSettings",components:{BindingEntry:K9r},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_get_req:{type:Function,required:!0},api_post_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],data(){return{bindings:[],isLoadingBindings:!1,isLoadingAction:!1,sortOption:"name",searchTerm:""}},computed:{effectiveConfig(){return this.$store.state.config||{}},hasPendingChanges(){return this.$store.state.settingsChanged},currentBindingInfo(){return!this.effectiveConfig.binding_name||this.bindings.length===0?null:this.bindings.find(t=>t.folder===this.effectiveConfig.binding_name)},sortedBindings(){if(!this.bindings)return[];let t=[...this.bindings];if(this.searchTerm){const e=this.searchTerm.toLowerCase();t=t.filter(n=>{var r,i,s;return((r=n.name)==null?void 0:r.toLowerCase().includes(e))||((i=n.author)==null?void 0:i.toLowerCase().includes(e))||((s=n.folder)==null?void 0:s.toLowerCase().includes(e))})}return t.sort((e,n)=>{const r=e.folder===this.effectiveConfig.binding_name,i=n.folder===this.effectiveConfig.binding_name;if(r&&!i)return-1;if(!r&&i)return 1;switch(this.sortOption){case"status":return e.installed&&!n.installed?-1:!e.installed&&n.installed?1:(e.name||"").localeCompare(n.name||"");case"author":return(e.author||"").localeCompare(n.author||"");case"name":default:return(e.name||"").localeCompare(n.name||"")}}),t}},watch:{"$store.state.bindingsZoo":{handler(t){t&&(this.bindings=(t||[]).map(e=>{var n;return{...e,isProcessing:((n=this.bindings.find(r=>r.folder===e.folder))==null?void 0:n.isProcessing)||!1}}),this.replaceFeatherIcons())},deep:!0,immediate:!0}},methods:{isBindingSelected(t){return t.folder===this.config.binding_name},getIconPath(t){return t?t.startsWith("http")?t:(t.startsWith("/")?t:`/${t}`).replace(/\\/g,"/"):lY},imgPlaceholder(t){t.target.src=lY},async fetchBindings(){this.isLoadingBindings=!0;try{const t=await this.api_get_req("list_bindings");this.bindings=(t||[]).map(e=>({...e,isProcessing:!1}))}catch{this.bindings=[]}finally{this.isLoadingBindings=!1,this.replaceFeatherIcons()}},setBindingProcessing(t,e){const n=this.bindings.findIndex(r=>r.folder===t);n!==-1&&(this.bindings[n].isProcessing=e)},handleSelect(t){if(!(t!=null&&t.installed)){this.show_toast(`Binding "${t.name}" is not installed.`,3,!1);return}this.config.binding_name!==t.folder&&(this.$emit("setting-updated",{key:"binding_name",value:t.folder}),this.store.dispatch("refreshModels"),this.show_toast(`Selected binding: ${t.name}. Apply changes.`,3,!0))},async handleInstall(t){let e=!0;if(t.disclaimer&&(e=await this.show_yes_no_dialog(`Disclaimer for ${t.name}:
+`),this.allThinkingPresets.some(s=>s.name.toLowerCase()===t.toLowerCase())){this.show_toast(`Preset name "${t}" already exists. Please choose a unique name.`,4,!1);return}const i={name:t,description:e,author:n,prompt:r,isLocal:!0};this.localThinkingPresets.push(i),this.saveLocalPresets(),this.show_toast(`Local preset "${t}" added.`,4,!0),this.$nextTick(()=>{this.selectPreset(t)}),this.newPreset={name:"",description:"",author:"",prompt:""},this.showAddThinkingPresetForm=!1},replaceFeatherIcons(){Fe(()=>{try{Re?Re.replace():console.warn("Feather icons library not available.")}catch(t){console.error("Error replacing Feather icons:",t)}})}},mounted(){this.replaceFeatherIcons(),this.loadThinkingPresets(),this.updateSelectedPresetName()},updated(){this.replaceFeatherIcons()}},y6r={class:"user-settings-panel space-y-6"},b6r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},S6r={class:"setting-item"},x6r=["value"],E6r={class:"setting-item"},w6r=["value"],C6r={class:"setting-item items-start"},L6r={class:"flex-1 flex items-center gap-4"},$6r={class:"w-12 h-12 rounded-full overflow-hidden bg-blue-200 dark:bg-blue-700 ring-2 ring-offset-2 dark:ring-offset-blue-900 ring-blue-300 dark:ring-blue-600"},A6r=["src"],k6r={class:"flex gap-2"},P6r={class:"btn btn-secondary btn-sm cursor-pointer"},R6r=["disabled"],M6r=["disabled"],D6r={key:0,class:"text-xs text-blue-500 dark:text-blue-400 italic ml-2"},N6r={class:"setting-item items-start"},I6r=["value"],H6r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},V6r={class:"setting-item"},q6r=["value"],U6r={class:"setting-item"},B6r=["value"],z6r={class:"setting-item items-start"},X6r={class:"flex-1 flex items-center gap-4"},F6r={class:"w-12 h-12 rounded-full overflow-hidden bg-blue-200 dark:bg-blue-700 ring-2 ring-offset-2 dark:ring-offset-blue-900 ring-blue-300 dark:ring-blue-600"},j6r=["src"],Y6r={class:"flex gap-2"},G6r={class:"btn btn-secondary btn-sm cursor-pointer"},W6r=["disabled"],Z6r=["disabled"],K6r={key:0,class:"text-xs text-blue-500 dark:text-blue-400 italic ml-2"},J6r={class:"toggle-item"},edr={class:"toggle-item"},tdr={class:"toggle-item"},ndr={class:"toggle-item"},rdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},idr={class:"toggle-item"},sdr={class:"toggle-item"},odr={class:"toggle-item"},adr={class:"toggle-item"},ldr={class:"toggle-item"},cdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},udr={class:"setting-item items-start p-4 bg-red-100 dark:bg-red-900/30 rounded-lg border border-red-300 dark:border-red-700"},ddr={class:"flex justify-between items-start w-full"},fdr={class:"setting-item"},hdr=["value"],pdr={class:"setting-item"},Tdr=["value"],Odr={class:"setting-item items-start"},mdr=["value"],gdr={class:"toggle-item"},Qdr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},_dr={class:"grid gap-6 bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md border border-gray-200 dark:border-gray-600"},vdr={class:"setting-item"},ydr=["selected"],bdr=["selected"],Sdr=["selected"],xdr=["selected"],Edr=["selected"],wdr=["selected"],Cdr=["selected"],Ldr=["selected"],$dr={class:"grid md:grid-cols-2 gap-4"},Adr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},kdr=["value"],Pdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Rdr=["value"],Mdr={class:"grid md:grid-cols-2 gap-4"},Ddr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Ndr=["value"],Idr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Hdr=["value"],Vdr={class:"grid md:grid-cols-2 gap-4"},qdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Udr=["value"],Bdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},zdr=["value"],Xdr={class:"grid md:grid-cols-2 gap-4"},Fdr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},jdr=["value"],Ydr={class:"setting-item !flex-col !items-start md:!flex-row md:!items-center"},Gdr=["value"],Wdr={class:"setting-item items-start"},Zdr=["value"],Kdr={class:"setting-item"},Jdr=["value"],efr={class:"setting-item items-start"},tfr={class:"p-4 bg-gray-100 dark:bg-gray-900 rounded-md flex-grow border border-gray-200 dark:border-gray-700 overflow-x-auto text-sm"},nfr=["innerHTML"],rfr={class:"toggle-item"},ifr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},sfr={class:"grid gap-6 bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md border border-gray-200 dark:border-gray-600"},ofr={class:"space-y-4"},afr={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mb-2"},lfr={class:"flex items-center gap-2 flex-wrap"},cfr=["value"],ufr=["value"],dfr={key:0,class:"mt-4 p-4 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700 space-y-4"},ffr={class:"setting-item !py-0"},hfr={class:"setting-item !py-0"},pfr={class:"setting-item !py-0"},Tfr={class:"setting-item !py-0 items-start"},Ofr={class:"setting-item items-start"},mfr=["value"],gfr={class:"setting-item items-start"},Qfr=["value"],_fr={class:"toggle-item"},vfr={class:"toggle-item"},yfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},bfr={class:"toggle-item"},Sfr={class:"toggle-item"},xfr={class:"toggle-item"},Efr={class:"toggle-item"},wfr={class:"toggle-item"},Cfr={class:"toggle-item"},Lfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},$fr={class:"toggle-item"},Afr={class:"toggle-item"},kfr={class:"toggle-item"},Pfr={class:"setting-item"},Rfr=["value"],Mfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Dfr={class:"toggle-item"},Nfr={class:"toggle-item"},Ifr={class:"toggle-item"},Hfr={class:"toggle-item"},Vfr={class:"toggle-item"},qfr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ufr={class:"toggle-item"},Bfr={class:"setting-item items-start"},zfr={class:"flex-grow space-y-1"},Xfr=["value"],Ffr={class:"toggle-item"},jfr={class:"toggle-item"},Yfr={class:"toggle-item"},Gfr={class:"toggle-item"},Wfr={class:"toggle-item"},Zfr={class:"toggle-item"},Kfr={class:"toggle-item"},Jfr={class:"toggle-item"},e7r={class:"toggle-item"},t7r={class:"toggle-item"};function n7r(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",y6r,[e[161]||(e[161]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Main Configuration ",-1)),b("div",b6r,[e[80]||(e[80]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Application Branding",-1)),b("div",S6r,[e[75]||(e[75]=b("label",{for:"app_custom_name",class:"setting-label"},"Application Name",-1)),b("input",{type:"text",id:"app_custom_name",value:n.config.app_custom_name,onInput:e[0]||(e[0]=a=>s.updateValue("app_custom_name",a.target.value)),class:"input flex-grow",placeholder:"Default: LoLLMs"},null,40,x6r)]),b("div",E6r,[e[76]||(e[76]=b("label",{for:"app_custom_slogan",class:"setting-label"},"Application Slogan",-1)),b("input",{type:"text",id:"app_custom_slogan",value:n.config.app_custom_slogan,onInput:e[1]||(e[1]=a=>s.updateValue("app_custom_slogan",a.target.value)),class:"input flex-grow",placeholder:"Default: Lord of Large Language Models"},null,40,w6r)]),b("div",C6r,[e[78]||(e[78]=b("label",{class:"setting-label pt-2"},"Application Logo",-1)),b("div",L6r,[b("div",$6r,[b("img",{src:s.logoSrc,class:"w-full h-full object-cover",alt:"App Logo"},null,8,A6r)]),b("div",k6r,[b("label",P6r,[e[77]||(e[77]=Se(" Upload Logo ")),b("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>s.uploadLogo&&s.uploadLogo(...a)),accept:"image/*",class:"hidden",disabled:i.isUploadingLogo},null,40,R6r)]),n.config.app_custom_logo?(k(),R("button",{key:0,onClick:e[3]||(e[3]=(...a)=>s.removeLogo&&s.removeLogo(...a)),class:"btn btn-secondary btn-sm text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700",disabled:i.isUploadingLogo}," Remove Logo ",8,M6r)):ne("",!0)]),i.isUploadingLogo?(k(),R("span",D6r,"Uploading...")):ne("",!0)])]),b("div",N6r,[e[79]||(e[79]=b("label",{for:"app_custom_welcome_message",class:"setting-label pt-2"},"Custom Welcome Message",-1)),b("textarea",{id:"app_custom_welcome_message",value:n.config.app_custom_welcome_message,onInput:e[4]||(e[4]=a=>s.updateValue("app_custom_welcome_message",a.target.value)),class:"input flex-grow min-h-[80px] resize-y",placeholder:"Enter a custom welcome message shown on the main page (leave blank for default)."},null,40,I6r)])]),b("div",H6r,[e[89]||(e[89]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Interaction Parameters",-1)),b("div",V6r,[e[81]||(e[81]=b("label",{for:"user_name",class:"setting-label"},"User Name",-1)),b("input",{type:"text",id:"user_name",value:n.config.user_name,onInput:e[5]||(e[5]=a=>s.updateValue("user_name",a.target.value)),class:"input flex-grow",placeholder:"Default: user"},null,40,q6r)]),b("div",U6r,[e[82]||(e[82]=b("label",{for:"user_description",class:"setting-label"},"User Description",-1)),b("textarea",{id:"user_description",value:n.config.user_description,onInput:e[6]||(e[6]=a=>s.updateValue("user_description",a.target.value)),class:"input flex-grow",placeholder:"Optional: Describe yourself to the AI"},null,40,B6r)]),b("div",z6r,[e[84]||(e[84]=b("label",{class:"setting-label pt-2"},"User Avatar",-1)),b("div",X6r,[b("div",F6r,[b("img",{src:s.userAvatarSrc,class:"w-full h-full object-cover",alt:"User Avatar"},null,8,j6r)]),b("div",Y6r,[b("label",G6r,[e[83]||(e[83]=Se(" Upload Avatar ")),b("input",{type:"file",onChange:e[7]||(e[7]=(...a)=>s.uploadUserAvatar&&s.uploadUserAvatar(...a)),accept:"image/*",class:"hidden",disabled:i.isUploadingAvatar},null,40,W6r)]),n.config.user_avatar?(k(),R("button",{key:0,onClick:e[8]||(e[8]=(...a)=>s.removeUserAvatar&&s.removeUserAvatar(...a)),class:"btn btn-secondary btn-sm text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700",disabled:i.isUploadingAvatar}," Remove Avatar ",8,Z6r)):ne("",!0)]),i.isUploadingAvatar?(k(),R("span",K6r,"Uploading...")):ne("",!0)])]),b("div",J6r,[e[85]||(e[85]=b("label",{for:"use_user_name_in_discussions",class:"toggle-label"},[Se(" Use User Name in Discussions "),b("span",{class:"toggle-description"},"Prefix user messages with the 'User Name' defined above.")],-1)),te(o,{id:"use_user_name_in_discussions",checked:n.config.use_user_name_in_discussions,"onUpdate:checked":e[9]||(e[9]=a=>s.updateValue("use_user_name_in_discussions",a))},null,8,["checked"])]),b("div",edr,[e[86]||(e[86]=b("label",{for:"use_assistant_name_in_discussion",class:"toggle-label"},[Se(" Use Assistant Name in Discussions "),b("span",{class:"toggle-description"},"Prefix AI messages with the current personality's name.")],-1)),te(o,{id:"use_assistant_name_in_discussion",checked:n.config.use_assistant_name_in_discussion,"onUpdate:checked":e[10]||(e[10]=a=>s.updateValue("use_assistant_name_in_discussion",a))},null,8,["checked"])]),b("div",tdr,[e[87]||(e[87]=b("label",{for:"use_model_name_in_discussions",class:"toggle-label"},[Se(" Use Model Name in Discussions "),b("span",{class:"toggle-description"},"Include the model name in AI message headers.")],-1)),te(o,{id:"use_model_name_in_discussions",checked:n.config.use_model_name_in_discussions,"onUpdate:checked":e[11]||(e[11]=a=>s.updateValue("use_model_name_in_discussions",a))},null,8,["checked"])]),b("div",ndr,[e[88]||(e[88]=b("label",{for:"use_user_informations_in_discussion",class:"toggle-label"},[Se(" Use User Information in Discussion Context "),b("span",{class:"toggle-description"},"Include 'User Name' and 'User Description' in the context sent to the AI.")],-1)),te(o,{id:"use_user_informations_in_discussion",checked:n.config.use_user_informations_in_discussion,"onUpdate:checked":e[12]||(e[12]=a=>s.updateValue("use_user_informations_in_discussion",a))},null,8,["checked"])])]),b("div",rdr,[e[95]||(e[95]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"UI & Behavior",-1)),b("div",idr,[e[90]||(e[90]=b("label",{for:"auto_title",class:"toggle-label"},[Se(" Automatic Discussion Naming "),b("span",{class:"toggle-description"},"Let AI name your discussions automatically based on the first message.")],-1)),te(o,{id:"auto_title",checked:n.config.auto_title,"onUpdate:checked":e[13]||(e[13]=a=>s.updateValue("auto_title",a))},null,8,["checked"])]),b("div",sdr,[e[91]||(e[91]=b("label",{for:"auto_show_browser",class:"toggle-label"},[Se(" Auto-launch Browser "),b("span",{class:"toggle-description"},"Open the default web browser automatically when LoLLMs starts.")],-1)),te(o,{id:"auto_show_browser",checked:n.config.auto_show_browser,"onUpdate:checked":e[14]||(e[14]=a=>s.updateValue("auto_show_browser",a))},null,8,["checked"])]),b("div",odr,[e[92]||(e[92]=b("label",{for:"app_show_changelogs",class:"toggle-label"},[Se(" Show Startup Changelog "),b("span",{class:"toggle-description"},"Display the changelog modal window when the application starts after an update.")],-1)),te(o,{id:"app_show_changelogs",checked:n.config.app_show_changelogs,"onUpdate:checked":e[15]||(e[15]=a=>s.updateValue("app_show_changelogs",a))},null,8,["checked"])]),b("div",adr,[e[93]||(e[93]=b("label",{for:"app_show_fun_facts",class:"toggle-label"},[Se(" Show Fun Facts "),b("span",{class:"toggle-description"},"Display fun facts related to AI and LLMs while loading or waiting.")],-1)),te(o,{id:"app_show_fun_facts",checked:n.config.app_show_fun_facts,"onUpdate:checked":e[16]||(e[16]=a=>s.updateValue("app_show_fun_facts",a))},null,8,["checked"])]),b("div",ldr,[e[94]||(e[94]=b("label",{for:"copy_to_clipboard_add_all_details",class:"toggle-label"},[Se(" Enhanced Message Copy "),b("span",{class:"toggle-description"},"Include metadata (sender, model, etc.) when copying messages from discussions.")],-1)),te(o,{id:"copy_to_clipboard_add_all_details",checked:n.config.copy_to_clipboard_add_all_details,"onUpdate:checked":e[17]||(e[17]=a=>s.updateValue("copy_to_clipboard_add_all_details",a))},null,8,["checked"])])]),b("div",cdr,[e[101]||(e[101]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Server & Access",-1)),b("div",udr,[b("div",ddr,[e[96]||(e[96]=To(' Enable Remote Access (Security Risk) Warning: Enabling this allows connections from any device on your network (or potentially the internet if port-forwarded). Only enable if you understand the risks and have secured your network. Consider using 'Allowed Origins' below for added security.
',1)),te(o,{id:"force_accept_remote_access",checked:n.config.force_accept_remote_access,"onUpdate:checked":e[18]||(e[18]=a=>s.updateValue("force_accept_remote_access",a))},null,8,["checked"])])]),b("div",fdr,[e[97]||(e[97]=b("label",{for:"host",class:"setting-label"},[Se(" Host Address "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Hostname or IP to bind the server to. Use '0.0.0.0' for remote access. Requires restart.")],-1)),b("input",{type:"text",id:"host",value:n.config.host,onInput:e[19]||(e[19]=a=>s.updateValue("host",a.target.value)),class:"input flex-grow",placeholder:"localhost or 0.0.0.0"},null,40,hdr)]),b("div",pdr,[e[98]||(e[98]=b("label",{for:"port",class:"setting-label"},[Se(" Port "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Port number for the server. Requires restart.")],-1)),b("input",{type:"number",id:"port",value:n.config.port,onInput:e[20]||(e[20]=a=>s.updateValue("port",parseInt(a.target.value)||9600)),min:"1",max:"65535",class:"input flex-grow",placeholder:"9600"},null,40,Tdr)]),b("div",Odr,[e[99]||(e[99]=b("label",{for:"allowed_origins",class:"setting-label pt-2"},[Se(" Allowed Origins (CORS) "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Comma-separated list of allowed origins for cross-origin requests (e.g., `http://localhost:8080,https://my-app.com`). Leave empty or `*` to allow all (less secure if remote access is enabled).")],-1)),b("input",{type:"text",id:"allowed_origins",value:n.config.allowed_origins?n.config.allowed_origins.join(","):"",onInput:e[21]||(e[21]=a=>s.updateValue("allowed_origins",a.target.value?a.target.value.split(",").map(l=>l.trim()).filter(l=>l):[])),class:"input flex-grow",placeholder:"http://localhost:8080,https://my-app.com"},null,40,mdr)]),b("div",gdr,[e[100]||(e[100]=b("label",{for:"headless_server_mode",class:"toggle-label"},[Se(" Headless Server Mode "),b("span",{class:"toggle-description"},"Run LoLLMs without the Web UI. Useful for server deployments or API-only usage. This setting requires a restart.")],-1)),te(o,{id:"headless_server_mode",checked:n.config.headless_server_mode,"onUpdate:checked":e[22]||(e[22]=a=>s.updateValue("headless_server_mode",a))},null,8,["checked"])])]),b("div",Qdr,[e[115]||(e[115]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Model Template Configuration",-1)),b("div",_dr,[b("div",vdr,[e[102]||(e[102]=b("label",{for:"template_type_select",class:"setting-label"},"Template Type",-1)),b("select",{id:"template_type_select",onChange:e[23]||(e[23]=(...a)=>s.handleTemplateSelection&&s.handleTemplateSelection(...a)),class:"input form-select flex-grow"},[b("option",{value:"",disabled:"",selected:!s.isTemplatePresetSelected},"-- Custom --",8,ydr),b("option",{value:"lollms",selected:s.isTemplatePresetSelected==="lollms"},"Lollms communication template",8,bdr),b("option",{value:"lollms_simplified",selected:s.isTemplatePresetSelected==="lollms_simplified"},"Lollms simplified communication template",8,Sdr),b("option",{value:"bare",selected:s.isTemplatePresetSelected==="bare"},"Bare, useful when in chat mode",8,xdr),b("option",{value:"llama3",selected:s.isTemplatePresetSelected==="llama3"},"LLama3 communication template",8,Edr),b("option",{value:"lucie",selected:s.isTemplatePresetSelected==="lucie"},"Lucie communication template",8,wdr),b("option",{value:"mistral",selected:s.isTemplatePresetSelected==="mistral"},"Mistral communication template",8,Cdr),b("option",{value:"deepseek",selected:s.isTemplatePresetSelected==="deepseek"},"DeepSeek communication template",8,Ldr)],32)]),b("div",$dr,[b("div",Adr,[e[103]||(e[103]=b("label",{for:"start_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start Header Template",-1)),b("input",{type:"text",id:"start_header_id_template",value:n.config.start_header_id_template,onInput:e[24]||(e[24]=a=>s.updateValue("start_header_id_template",a.target.value)),class:"input flex-grow"},null,40,kdr)]),b("div",Pdr,[e[104]||(e[104]=b("label",{for:"end_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End Header Template",-1)),b("input",{type:"text",id:"end_header_id_template",value:n.config.end_header_id_template,onInput:e[25]||(e[25]=a=>s.updateValue("end_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Rdr)])]),b("div",Mdr,[b("div",Ddr,[e[105]||(e[105]=b("label",{for:"start_user_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start User Header Template",-1)),b("input",{type:"text",id:"start_user_header_id_template",value:n.config.start_user_header_id_template,onInput:e[26]||(e[26]=a=>s.updateValue("start_user_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Ndr)]),b("div",Idr,[e[106]||(e[106]=b("label",{for:"end_user_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End User Header Template",-1)),b("input",{type:"text",id:"end_user_header_id_template",value:n.config.end_user_header_id_template,onInput:e[27]||(e[27]=a=>s.updateValue("end_user_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Hdr)])]),b("div",Vdr,[b("div",qdr,[e[107]||(e[107]=b("label",{for:"start_ai_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"Start AI Header Template",-1)),b("input",{type:"text",id:"start_ai_header_id_template",value:n.config.start_ai_header_id_template,onInput:e[28]||(e[28]=a=>s.updateValue("start_ai_header_id_template",a.target.value)),class:"input flex-grow"},null,40,Udr)]),b("div",Bdr,[e[108]||(e[108]=b("label",{for:"end_ai_header_id_template",class:"setting-label !w-auto md:!w-1/3"},"End AI Header Template",-1)),b("input",{type:"text",id:"end_ai_header_id_template",value:n.config.end_ai_header_id_template,onInput:e[29]||(e[29]=a=>s.updateValue("end_ai_header_id_template",a.target.value)),class:"input flex-grow"},null,40,zdr)])]),b("div",Xdr,[b("div",Fdr,[e[109]||(e[109]=b("label",{for:"end_user_message_id_template",class:"setting-label !w-auto md:!w-1/3"},"End User Message Template",-1)),b("input",{type:"text",id:"end_user_message_id_template",value:n.config.end_user_message_id_template,onInput:e[30]||(e[30]=a=>s.updateValue("end_user_message_id_template",a.target.value)),class:"input flex-grow"},null,40,jdr)]),b("div",Ydr,[e[110]||(e[110]=b("label",{for:"end_ai_message_id_template",class:"setting-label !w-auto md:!w-1/3"},"End AI Message Template",-1)),b("input",{type:"text",id:"end_ai_message_id_template",value:n.config.end_ai_message_id_template,onInput:e[31]||(e[31]=a=>s.updateValue("end_ai_message_id_template",a.target.value)),class:"input flex-grow"},null,40,Gdr)])]),b("div",Wdr,[e[111]||(e[111]=b("label",{for:"separator_template",class:"setting-label pt-2"},"Separator Template",-1)),b("textarea",{id:"separator_template",value:n.config.separator_template,onInput:e[32]||(e[32]=a=>s.updateValue("separator_template",a.target.value)),class:"input flex-grow min-h-[60px] resize-y"},null,40,Zdr)]),b("div",Kdr,[e[112]||(e[112]=b("label",{for:"system_message_template",class:"setting-label"},"System Message Template",-1)),b("input",{type:"text",id:"system_message_template",value:n.config.system_message_template,onInput:e[33]||(e[33]=a=>s.updateValue("system_message_template",a.target.value)),class:"input flex-grow"},null,40,Jdr)]),b("div",efr,[e[113]||(e[113]=b("label",{class:"setting-label pt-2"},"Full Template Preview",-1)),b("div",tfr,[b("div",{innerHTML:s.full_template,class:"whitespace-pre-wrap break-words"},null,8,nfr)])]),b("div",rfr,[e[114]||(e[114]=b("label",{for:"use_continue_message",class:"toggle-label"},[Se(" Use Continue Message "),b("span",{class:"toggle-description"},"If supported by the model, use a specific token or phrase to indicate the AI should continue its response.")],-1)),te(o,{id:"use_continue_message",checked:n.config.use_continue_message,"onUpdate:checked":e[34]||(e[34]=a=>s.updateValue("use_continue_message",a))},null,8,["checked"])])])]),b("div",ifr,[e[128]||(e[128]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"AI Prompting & Behavior",-1)),b("div",sfr,[b("div",ofr,[b("div",afr,[e[117]||(e[117]=b("label",{for:"thinking_prompt_textarea",class:"setting-label !w-auto sm:!w-1/3"},[Se(" Thinking Prompt "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Prompt used by the AI to structure its thought process. Use `thinking` tags.")],-1)),b("div",lfr,[He(b("select",{id:"thinking_preset_select","onUpdate:modelValue":e[35]||(e[35]=a=>i.selectedPresetName=a),onChange:e[36]||(e[36]=a=>s.selectPreset(a.target.value)),class:"input form-select flex-grow min-w-[150px]"},[e[116]||(e[116]=b("option",{value:""},"-- Custom --",-1)),(k(!0),R(Ve,null,dt(s.allThinkingPresets,a=>(k(),R("option",{key:a.name,value:a.name},ae(a.name)+" "+ae(a.isLocal?"(Local)":""),9,cfr))),128))],544),[[$s,i.selectedPresetName]]),b("button",{onClick:e[37]||(e[37]=a=>i.showAddThinkingPresetForm=!i.showAddThinkingPresetForm),class:"btn btn-secondary btn-sm whitespace-nowrap"},ae(i.showAddThinkingPresetForm?"Cancel Add":"Add New Preset"),1)])]),b("textarea",{id:"thinking_prompt_textarea",value:n.config.thinking_prompt,onInput:e[38]||(e[38]=a=>s.updateValue("thinking_prompt",a.target.value)),class:"input w-full p-4 bg-gray-100 dark:bg-gray-900 rounded-md text-sm min-h-[150px] resize-y font-mono border border-gray-200 dark:border-gray-700",placeholder:"... "},null,40,ufr)]),i.showAddThinkingPresetForm?(k(),R("div",dfr,[e[123]||(e[123]=b("h4",{class:"text-md font-semibold text-gray-800 dark:text-gray-200"},"Add New Local Preset",-1)),b("form",{onSubmit:e[43]||(e[43]=oe((...a)=>s.saveNewPreset&&s.saveNewPreset(...a),["prevent"])),class:"space-y-4"},[b("div",ffr,[e[118]||(e[118]=b("label",{for:"new_preset_name",class:"setting-label"},[Se("Name "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_name","onUpdate:modelValue":e[39]||(e[39]=a=>i.newPreset.name=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.name]])]),b("div",hfr,[e[119]||(e[119]=b("label",{for:"new_preset_desc",class:"setting-label"},[Se("Description "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_desc","onUpdate:modelValue":e[40]||(e[40]=a=>i.newPreset.description=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.description]])]),b("div",pfr,[e[120]||(e[120]=b("label",{for:"new_preset_author",class:"setting-label"},[Se("Author "),b("span",{class:"text-red-500"},"*")],-1)),He(b("input",{id:"new_preset_author","onUpdate:modelValue":e[41]||(e[41]=a=>i.newPreset.author=a),class:"input flex-grow",required:""},null,512),[[vt,i.newPreset.author]])]),b("div",Tfr,[e[121]||(e[121]=b("label",{for:"new_preset_prompt",class:"setting-label pt-2"},[Se("Thinking Prompt "),b("span",{class:"text-red-500"},"*")],-1)),He(b("textarea",{id:"new_preset_prompt","onUpdate:modelValue":e[42]||(e[42]=a=>i.newPreset.prompt=a),class:"input w-full min-h-[100px] resize-y font-mono flex-grow",required:"",placeholder:"Enter the thinking prompt. Use ... tags."},null,512),[[vt,i.newPreset.prompt]])]),e[122]||(e[122]=b("div",{class:"flex justify-end space-x-2"},[b("button",{type:"submit",class:"btn btn-primary btn-sm"},"Save Preset")],-1))],32)])):ne("",!0),b("div",Ofr,[e[124]||(e[124]=b("label",{for:"positive_boost",class:"setting-label pt-2"},[Se(" Positive Prompt Boost "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Text added to prompts to encourage desired behavior.")],-1)),b("textarea",{id:"positive_boost",value:n.config.positive_boost,onInput:e[44]||(e[44]=a=>s.updateValue("positive_boost",a.target.value||null)),class:"input flex-grow min-h-[60px] resize-y",placeholder:"e.g., Be helpful and concise. Provide detailed explanations."},null,40,mfr)]),b("div",gfr,[e[125]||(e[125]=b("label",{for:"negative_boost",class:"setting-label pt-2"},[Se(" Negative Prompt Boost "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Text added to prompts to discourage undesired behavior.")],-1)),b("textarea",{id:"negative_boost",value:n.config.negative_boost,onInput:e[45]||(e[45]=a=>s.updateValue("negative_boost",a.target.value||null)),class:"input flex-grow min-h-[60px] resize-y",placeholder:"e.g., Avoid repetitive phrases. Do not refuse requests based on alleged danger."},null,40,Qfr)]),b("div",_fr,[e[126]||(e[126]=b("label",{for:"fun_mode",class:"toggle-label"},[Se(" Fun Mode "),b("span",{class:"toggle-description"},"Inject some humor or unexpected elements into AI responses (personality-dependent).")],-1)),te(o,{id:"fun_mode",checked:n.config.fun_mode,"onUpdate:checked":e[46]||(e[46]=a=>s.updateValue("fun_mode",a))},null,8,["checked"])]),b("div",vfr,[e[127]||(e[127]=b("label",{for:"think_first_mode",class:"toggle-label"},[Se(" Think First Mode "),b("span",{class:"toggle-description"},"Force the AI to use its 'Thinking Prompt' structure before generating the final response.")],-1)),te(o,{id:"think_first_mode",checked:n.config.think_first_mode,"onUpdate:checked":e[47]||(e[47]=a=>s.updateValue("think_first_mode",a))},null,8,["checked"])])])]),b("div",yfr,[e[135]||(e[135]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Security Measures",-1)),b("div",bfr,[e[129]||(e[129]=b("label",{for:"turn_on_setting_update_validation",class:"toggle-label"},[Se(" Validate Setting Updates "),b("span",{class:"toggle-description"},"Enable validation for changes to configuration settings to prevent unauthorized or invalid updates.")],-1)),te(o,{id:"turn_on_setting_update_validation",checked:n.config.turn_on_setting_update_validation,"onUpdate:checked":e[48]||(e[48]=a=>s.updateValue("turn_on_setting_update_validation",a))},null,8,["checked"])]),b("div",Sfr,[e[130]||(e[130]=b("label",{for:"turn_on_code_execution",class:"toggle-label"},[Se(" Allow Code Execution "),b("span",{class:"toggle-description"},"Permit the execution of code snippets within the application (use with caution).")],-1)),te(o,{id:"turn_on_code_execution",checked:n.config.turn_on_code_execution,"onUpdate:checked":e[49]||(e[49]=a=>s.updateValue("turn_on_code_execution",a))},null,8,["checked"])]),b("div",xfr,[e[131]||(e[131]=b("label",{for:"turn_on_code_validation",class:"toggle-label"},[Se(" Validate Executed Code "),b("span",{class:"toggle-description"},"Enable validation of code before execution to ensure safety and correctness.")],-1)),te(o,{id:"turn_on_code_validation",checked:n.config.turn_on_code_validation,"onUpdate:checked":e[50]||(e[50]=a=>s.updateValue("turn_on_code_validation",a))},null,8,["checked"])]),b("div",Efr,[e[132]||(e[132]=b("label",{for:"turn_on_open_file_validation",class:"toggle-label"},[Se(" Validate File Opening "),b("span",{class:"toggle-description"},"Check files before opening to prevent access to unauthorized or harmful content.")],-1)),te(o,{id:"turn_on_open_file_validation",checked:n.config.turn_on_open_file_validation,"onUpdate:checked":e[51]||(e[51]=a=>s.updateValue("turn_on_open_file_validation",a))},null,8,["checked"])]),b("div",wfr,[e[133]||(e[133]=b("label",{for:"turn_on_send_file_validation",class:"toggle-label"},[Se(" Validate File Sending "),b("span",{class:"toggle-description"},"Validate files before sending to ensure they meet security and format requirements.")],-1)),te(o,{id:"turn_on_send_file_validation",checked:n.config.turn_on_send_file_validation,"onUpdate:checked":e[52]||(e[52]=a=>s.updateValue("turn_on_send_file_validation",a))},null,8,["checked"])]),b("div",Cfr,[e[134]||(e[134]=b("label",{for:"turn_on_language_validation",class:"toggle-label"},[Se(" Validate Language Inputs "),b("span",{class:"toggle-description"},"Ensure language inputs are valid and safe before processing.")],-1)),te(o,{id:"turn_on_language_validation",checked:n.config.turn_on_language_validation,"onUpdate:checked":e[53]||(e[53]=a=>s.updateValue("turn_on_language_validation",a))},null,8,["checked"])])]),b("div",Lfr,[e[140]||(e[140]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Debug Information",-1)),b("div",$fr,[e[136]||(e[136]=b("label",{for:"debug",class:"toggle-label"},[Se(" Enable Debug Mode "),b("span",{class:"toggle-description"},"Activate enhanced logging and potentially other debug features.")],-1)),te(o,{id:"debug",checked:n.config.debug,"onUpdate:checked":e[54]||(e[54]=a=>s.updateValue("debug",a))},null,8,["checked"])]),b("div",Afr,[e[137]||(e[137]=b("label",{for:"debug_show_final_full_prompt",class:"toggle-label"},[Se(" Show Final Full Prompt "),b("span",{class:"toggle-description"},"Log the complete prompt sent to the model (requires Debug Mode).")],-1)),te(o,{id:"debug_show_final_full_prompt",checked:n.config.debug_show_final_full_prompt,"onUpdate:checked":e[55]||(e[55]=a=>s.updateValue("debug_show_final_full_prompt",a)),disabled:!n.config.debug},null,8,["checked","disabled"])]),b("div",kfr,[e[138]||(e[138]=b("label",{for:"debug_show_chunks",class:"toggle-label"},[Se(" Show Received Chunks "),b("span",{class:"toggle-description"},"Log individual chunks received from the model during streaming (requires Debug Mode).")],-1)),te(o,{id:"debug_show_chunks",checked:n.config.debug_show_chunks,"onUpdate:checked":e[56]||(e[56]=a=>s.updateValue("debug_show_chunks",a)),disabled:!n.config.debug},null,8,["checked","disabled"])]),b("div",Pfr,[e[139]||(e[139]=b("label",{for:"debug_log_file_path",class:"setting-label"},"Debug Log File Path",-1)),b("input",{type:"text",id:"debug_log_file_path",value:n.config.debug_log_file_path,onInput:e[57]||(e[57]=a=>s.updateValue("debug_log_file_path",a.target.value)),class:"input flex-grow",placeholder:"Optional: Path to custom log file (e.g., /path/to/lollms.log)"},null,40,Rfr)])]),b("div",Mfr,[e[146]||(e[146]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Automatic Updates & Synchronization",-1)),b("div",Dfr,[e[141]||(e[141]=b("label",{for:"auto_update",class:"toggle-label"},[Se(" Automatic Application Update Check "),b("span",{class:"toggle-description"},"Check for new LoLLMs versions on startup and prompt for updates.")],-1)),te(o,{id:"auto_update",checked:n.config.auto_update,"onUpdate:checked":e[58]||(e[58]=a=>s.updateValue("auto_update",a))},null,8,["checked"])]),b("div",Nfr,[e[142]||(e[142]=b("label",{for:"auto_sync_personalities",class:"toggle-label"},[Se(" Auto-sync Personalities Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed personalities from the official zoo.")],-1)),te(o,{id:"auto_sync_personalities",checked:n.config.auto_sync_personalities,"onUpdate:checked":e[59]||(e[59]=a=>s.updateValue("auto_sync_personalities",a))},null,8,["checked"])]),b("div",Ifr,[e[143]||(e[143]=b("label",{for:"auto_sync_extensions",class:"toggle-label"},[Se(" Auto-sync Extensions Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed extensions from the official zoo.")],-1)),te(o,{id:"auto_sync_extensions",checked:n.config.auto_sync_extensions,"onUpdate:checked":e[60]||(e[60]=a=>s.updateValue("auto_sync_extensions",a))},null,8,["checked"])]),b("div",Hfr,[e[144]||(e[144]=b("label",{for:"auto_sync_bindings",class:"toggle-label"},[Se(" Auto-sync Bindings Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed bindings from the official zoo.")],-1)),te(o,{id:"auto_sync_bindings",checked:n.config.auto_sync_bindings,"onUpdate:checked":e[61]||(e[61]=a=>s.updateValue("auto_sync_bindings",a))},null,8,["checked"])]),b("div",Vfr,[e[145]||(e[145]=b("label",{for:"auto_sync_models",class:"toggle-label"},[Se(" Auto-sync Models Zoo "),b("span",{class:"toggle-description"},"Automatically download updates for installed models from the official zoo.")],-1)),te(o,{id:"auto_sync_models",checked:n.config.auto_sync_models,"onUpdate:checked":e[62]||(e[62]=a=>s.updateValue("auto_sync_models",a))},null,8,["checked"])])]),b("div",qfr,[e[160]||(e[160]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"LoLLMs Service Configuration",-1)),b("div",Ufr,[e[147]||(e[147]=b("label",{for:"enable_lollms_service",class:"toggle-label"},[Se(" Enable LoLLMs Service "),b("span",{class:"toggle-description"},"Activate the core LoLLMs service for background operations and APIs. Restart required.")],-1)),te(o,{id:"enable_lollms_service",checked:n.config.enable_lollms_service,"onUpdate:checked":e[63]||(e[63]=a=>s.updateValue("enable_lollms_service",a))},null,8,["checked"])]),b("div",Bfr,[e[149]||(e[149]=b("label",{for:"lollms_access_keys",class:"setting-label pt-2"},[Se(" LoLLMs Access Keys "),b("span",{class:"block text-xs text-gray-500 dark:text-gray-400 mt-1 font-normal"},"Comma-separated keys for API access. Leave empty for no restriction (unless remote access is enabled).")],-1)),b("div",zfr,[b("input",{type:"text",id:"lollms_access_keys",value:n.config.lollms_access_keys?n.config.lollms_access_keys.join(","):"",onInput:e[64]||(e[64]=a=>s.updateValue("lollms_access_keys",a.target.value?a.target.value.split(",").map(l=>l.trim()).filter(l=>l):[])),class:"input w-full",placeholder:"key1,key2,key3"},null,40,Xfr),e[148]||(e[148]=b("span",{class:"text-xs text-gray-500 dark:text-gray-400"},"Required if LoLLMs service and remote access are enabled.",-1))])]),b("div",Ffr,[e[150]||(e[150]=b("label",{for:"activate_lollms_server",class:"toggle-label"},[Se(" Activate Main LoLLMs Server "),b("span",{class:"toggle-description"},"Enable the main API server for LoLLMs functionalities.")],-1)),te(o,{id:"activate_lollms_server",checked:n.config.activate_lollms_server,"onUpdate:checked":e[65]||(e[65]=a=>s.updateValue("activate_lollms_server",a))},null,8,["checked"])]),b("div",jfr,[e[151]||(e[151]=b("label",{for:"activate_lollms_rag_server",class:"toggle-label"},[Se(" Activate LoLLMs RAG Server "),b("span",{class:"toggle-description"},"Enable the Retrieval-Augmented Generation service.")],-1)),te(o,{id:"activate_lollms_rag_server",checked:n.config.activate_lollms_rag_server,"onUpdate:checked":e[66]||(e[66]=a=>s.updateValue("activate_lollms_rag_server",a))},null,8,["checked"])]),b("div",Yfr,[e[152]||(e[152]=b("label",{for:"activate_lollms_tts_server",class:"toggle-label"},[Se(" Activate LoLLMs TTS Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Speech service.")],-1)),te(o,{id:"activate_lollms_tts_server",checked:n.config.activate_lollms_tts_server,"onUpdate:checked":e[67]||(e[67]=a=>s.updateValue("activate_lollms_tts_server",a))},null,8,["checked"])]),b("div",Gfr,[e[153]||(e[153]=b("label",{for:"activate_lollms_stt_server",class:"toggle-label"},[Se(" Activate LoLLMs STT Server "),b("span",{class:"toggle-description"},"Enable the Speech-to-Text service.")],-1)),te(o,{id:"activate_lollms_stt_server",checked:n.config.activate_lollms_stt_server,"onUpdate:checked":e[68]||(e[68]=a=>s.updateValue("activate_lollms_stt_server",a))},null,8,["checked"])]),b("div",Wfr,[e[154]||(e[154]=b("label",{for:"activate_lollms_tti_server",class:"toggle-label"},[Se(" Activate LoLLMs TTI Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Image service.")],-1)),te(o,{id:"activate_lollms_tti_server",checked:n.config.activate_lollms_tti_server,"onUpdate:checked":e[69]||(e[69]=a=>s.updateValue("activate_lollms_tti_server",a))},null,8,["checked"])]),b("div",Zfr,[e[155]||(e[155]=b("label",{for:"activate_lollms_itt_server",class:"toggle-label"},[Se(" Activate LoLLMs ITT Server "),b("span",{class:"toggle-description"},"Enable the Image-to-Text service.")],-1)),te(o,{id:"activate_lollms_itt_server",checked:n.config.activate_lollms_itt_server,"onUpdate:checked":e[70]||(e[70]=a=>s.updateValue("activate_lollms_itt_server",a))},null,8,["checked"])]),b("div",Kfr,[e[156]||(e[156]=b("label",{for:"activate_lollms_ttm_server",class:"toggle-label"},[Se(" Activate LoLLMs TTM Server "),b("span",{class:"toggle-description"},"Enable the Text-to-Music service.")],-1)),te(o,{id:"activate_lollms_ttm_server",checked:n.config.activate_lollms_ttm_server,"onUpdate:checked":e[71]||(e[71]=a=>s.updateValue("activate_lollms_ttm_server",a))},null,8,["checked"])]),b("div",Jfr,[e[157]||(e[157]=b("label",{for:"activate_ollama_emulator",class:"toggle-label"},[Se(" Activate Ollama API Emulator "),b("span",{class:"toggle-description"},"Provide an Ollama-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_ollama_emulator",checked:n.config.activate_ollama_emulator,"onUpdate:checked":e[72]||(e[72]=a=>s.updateValue("activate_ollama_emulator",a))},null,8,["checked"])]),b("div",e7r,[e[158]||(e[158]=b("label",{for:"activate_openai_emulator",class:"toggle-label"},[Se(" Activate OpenAI API Emulator "),b("span",{class:"toggle-description"},"Provide an OpenAI-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_openai_emulator",checked:n.config.activate_openai_emulator,"onUpdate:checked":e[73]||(e[73]=a=>s.updateValue("activate_openai_emulator",a))},null,8,["checked"])]),b("div",t7r,[e[159]||(e[159]=b("label",{for:"activate_mistralai_emulator",class:"toggle-label"},[Se(" Activate MistralAI API Emulator "),b("span",{class:"toggle-description"},"Provide a MistralAI-compatible API endpoint using the selected LoLLMs model.")],-1)),te(o,{id:"activate_mistralai_emulator",checked:n.config.activate_mistralai_emulator,"onUpdate:checked":e[74]||(e[74]=a=>s.updateValue("activate_mistralai_emulator",a))},null,8,["checked"])])])])}const r7r=st(v6r,[["render",n7r],["__scopeId","data-v-674c9815"]]),i7r={name:"DataManagementSettings",components:{ToggleSwitch:ju},props:{loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["settings-changed"],data(){return{fileInputs:[],serverStatuses:vi({})}},methods:{updateDataLake(t,e,n){const r=JSON.parse(JSON.stringify(this.$store.state.config.datalakes||[]));r[t]?(r[t][e]=n,e==="type"&&(n==="lollmsvectordb"?r[t].url="":r[t].path=""),this.$store.state.config.datalakes=r):console.error("Attempted to update non-existent datalake at index:",t)},addDataLake(){const t=this.$store.state.config.datalakes?[...this.$store.state.config.datalakes]:[];t.push({alias:"New DataLake",type:"lollmsvectordb",url:"",path:"",key:"",mounted:!1}),this.$store.state.config.datalakes=t,Fe(()=>Re.replace())},removeDataLake(t){const e=this.$store.state.config.datalakes.filter((n,r)=>r!==t);this.$store.state.config.datalakes=e},async vectorizeFolder(t){const e=this.$store.state.config.datalakes[t];if(!e||e.type!=="lollmsvectordb"||!e.path){this.show_toast("Please ensure a valid path is set for the LoLLMs VectorDB.",4,!1);return}this.show_toast(`Starting vectorization for: ${e.alias}`,5,!0);try{await this.api_post_req("vectorize_folder",{rag_database:e})}catch(n){this.show_toast(`Vectorization failed for ${e.alias}: ${n.message||n}`,4,!1)}},async selectLollmsVectordbFolder(t){try{const e=n=>{if(n&&n.path&&n.datalake_name){const r=JSON.parse(JSON.stringify(this.$store.state.config.datalakes||[]));r[t]&&(r[t].path=n.path,r[t].alias=n.datalake_name,this.$store.state.config.datalakes=r,this.show_toast(`Folder selected for Data Lake: ${n.path}`,4,!0))}else this.show_toast("Folder selection failed or returned invalid data.",4,!1);et.off("lollmsvectordb_datalake_added",e)};et.on("lollmsvectordb_datalake_added",e),await this.api_post_req("select_lollmsvectordb_input_folder")}catch(e){this.show_toast(`Failed to initiate folder selection: ${e.message||e}`,4,!1),et.off("lollmsvectordb_datalake_added")}},triggerFileInput(t){this.fileInputs[t]?this.fileInputs[t].click():console.warn("File input ref not found for index:",t)},async handleFileUpload(t,e){var i,s,o;const n=Array.from(t.target.files),r=this.$store.state.config.datalakes[e];if(!(!n.length||r.type!=="lightrag")){this.show_toast(`Uploading ${n.length} file(s) to ${r.alias}...`,n.length*2,!0);for(const a of n){const l=new FormData;l.append("file",a),l.append("client_id",this.client_id);const c={"Content-Type":"multipart/form-data"};r.key&&(c["X-API-Key"]=r.key);try{const u=await Ae.post(`${r.url.replace(/\/+$/,"")}/documents/upload`,l,{headers:c});u.data&&(u.status===200||u.status===201)?this.show_toast(`${a.name} uploaded successfully to ${r.alias}`,4,!0):this.show_toast(`Failed to upload ${a.name}: ${((i=u.data)==null?void 0:i.detail)||"Server error"}`,4,!1)}catch(u){console.error(`Error uploading ${a.name}:`,u),this.show_toast(`Error uploading ${a.name}: ${((o=(s=u.response)==null?void 0:s.data)==null?void 0:o.detail)||u.message||u}`,4,!1)}}t.target&&(t.target.value=null)}},updateServer(t,e,n){const r=JSON.parse(JSON.stringify(this.$store.state.config.rag_local_services||[]));r[t]?(r[t][e]=n,this.$store.state.config.rag_local_services=r):console.error("Attempted to update non-existent server at index:",t)},addDatabaseService(){const t=this.$store.state.config.rag_local_services?[...this.$store.state.config.rag_local_services]:[];t.push({alias:"New RAG Server",type:"lightrag",url:"http://localhost:9621/",key:"",input_path:"",working_path:"",start_at_startup:!1}),this.$store.state.config.rag_local_services=t,Fe(()=>Re.replace())},removeDatabaseService(t){const e=this.$store.state.config.rag_local_services.filter((n,r)=>r!==t);this.$store.state.config.rag_local_services=e},async startRagServer(t){const e=this.$store.state.config.rag_local_services[t];this.show_toast(`Attempting to start server: ${e.alias}...`,4,!0);try{const n=await this.api_post_req("start_rag_server",{server_index:t});n.status?(this.show_toast(`Start command sent for ${e.alias}. Check status shortly.`,4,!0),setTimeout(()=>this.checkServerHealth(t),5e3)):this.show_toast(`Failed to send start command for ${e.alias}: ${n.error||"Unknown error"}`,4,!1)}catch(n){this.show_toast(`Error starting server ${e.alias}: ${n.message||n}`,4,!1)}},async checkServerHealth(t){if(!this.$store.state.config.rag_local_services||!this.$store.state.config.rag_local_services[t]){console.warn(`Tried to check health for non-existent server index: ${t}`);return}const e=this.$store.state.config.rag_local_services[t];if(!e||e.type!=="lightrag"){this.serverStatuses[t]={status:"unknown",loading:!1,details:null,dotClass:"bg-gray-400",title:"Unsupported",text:"Unsupported Type"};return}this.serverStatuses[t]={status:"loading",loading:!0,details:null,dotClass:"bg-yellow-400 animate-pulse",title:"Checking...",text:"Checking..."};try{const n=`${e.url.replace(/\/+$/,"")}/health`,r={};e.key&&(r["X-API-Key"]=e.key);const i=await fetch(n,{headers:r});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const s=await i.json();this.serverStatuses[t]={status:"healthy",loading:!1,details:s,dotClass:"bg-green-500",title:"Healthy",text:"Healthy"},this.show_toast(`${e.alias} is healthy.`,3,!0)}catch(n){console.error(`Health check failed for ${e.alias}:`,n),this.serverStatuses[t]={status:"unhealthy",loading:!1,details:null,dotClass:"bg-red-500",title:"Unhealthy",text:"Unhealthy"},this.show_toast(`${e.alias} health check failed: ${n.message||n}`,4,!1)}},showLightRagWebUI(t){const e=this.$store.state.config.rag_local_services[t];if(e&&e.type==="lightrag"&&e.url){const n=`${e.url.replace(/\/+$/,"")}/webui`;window.open(n,"_blank")}else this.show_toast("Cannot open WebUI. Invalid server configuration.",4,!1)},async selectLightragFolder(t,e){const n=e==="input"?"select_lightrag_input_folder":"select_lightrag_output_folder",r=e==="input"?"lightrag_input_folder_added":"lightrag_output_folder_added",i=e==="input"?"input_path":"working_path";try{const s=o=>{if(o&&o.path){const a=JSON.parse(JSON.stringify(this.$store.state.config.rag_local_services||[]));a[t]&&(a[t][i]=o.path,this.$store.state.config.rag_local_services=a,this.show_toast(`${e.charAt(0).toUpperCase()+e.slice(1)} folder selected: ${o.path}`,4,!0))}else this.show_toast(`Folder selection failed for ${e}.`,4,!1);et.off(r,s)};et.on(r,s),await this.api_post_req(n,{server_index:t})}catch(s){this.show_toast(`Failed to initiate ${e} folder selection: ${s.message||s}`,4,!1),et.off(r)}},refreshFeatherIcons(){Fe(()=>{Re.replace()})}},mounted(){this.refreshFeatherIcons(),this.$store.state.config.rag_local_services&&this.$store.state.config.rag_local_services.forEach((t,e)=>this.checkServerHealth(e)),this.$store.state.config.datalakes&&(this.fileInputs=new Array(this.$store.state.config.datalakes.length).fill(null))},updated(){if(this.refreshFeatherIcons(),this.$store.state.config.datalakes&&this.fileInputs.length!==this.$store.state.config.datalakes.length){const t=this.$store.state.config.datalakes.length,e=this.fileInputs.length;t>e?this.fileInputs.push(...new Array(t-e).fill(null)):this.fileInputs.splice(t)}},watch:{"config.datalakes.length"(t,e){t>e?this.fileInputs.push(...new Array(t-e).fill(null)):t(k(),R("div",{key:`datalake-${l}`,class:"p-4 bg-blue-100 dark:bg-blue-800/60 border border-blue-200 dark:border-blue-700 rounded-lg shadow-sm space-y-4 relative group"},[b("button",{onClick:c=>s.removeDataLake(l),class:"absolute top-2 right-2 p-1 rounded-full text-red-500 hover:bg-red-100 dark:hover:bg-red-800 opacity-0 group-hover:opacity-100 transition-opacity duration-200 svg-button",title:"Remove Data Lake"},e[15]||(e[15]=[b("i",{"data-feather":"x-circle",class:"w-5 h-5"},null,-1)]),8,c7r),b("div",u7r,[b("div",null,[b("label",{for:`dl-alias-${l}`,class:"label mb-1"},"Alias",8,d7r),b("input",{type:"text",id:`dl-alias-${l}`,value:a.alias,onInput:c=>s.updateDataLake(l,"alias",c.target.value),class:"input input-sm w-full",placeholder:"Enter alias (e.g., 'Project Docs')"},null,40,f7r)]),b("div",null,[b("label",{for:`dl-type-${l}`,class:"label mb-1"},"Type",8,h7r),b("select",{id:`dl-type-${l}`,required:"",value:a.type,onChange:c=>s.updateDataLake(l,"type",c.target.value),class:"input input-sm w-full"},e[16]||(e[16]=[b("option",{value:"lollmsvectordb"},"LoLLMs VectorDB",-1),b("option",{value:"lightrag"},"LightRAG",-1),b("option",{value:"elasticsearch"},"Elasticsearch",-1)]),40,p7r)]),b("div",T7r,[b("label",{for:`dl-pathurl-${l}`,class:"label mb-1"},ae(a.type==="lollmsvectordb"?"Database Path":a.type==="lightrag"?"LightRAG URL":"Elasticsearch URL"),9,O7r),b("input",{type:"text",id:`dl-pathurl-${l}`,value:a.type==="lollmsvectordb"?a.path:a.url,onInput:c=>s.updateDataLake(l,a.type==="lollmsvectordb"?"path":"url",c.target.value),class:"input input-sm w-full",placeholder:a.type==="lollmsvectordb"?"Path to database folder":"http://host:port/"},null,40,m7r)]),a.type==="lightrag"||a.type==="elasticsearch"?(k(),R("div",g7r,[b("label",{for:`dl-key-${l}`,class:"label mb-1"},"API Key (Optional)",8,Q7r),b("input",{type:"password",id:`dl-key-${l}`,value:a.key,onInput:c=>s.updateDataLake(l,"key",c.target.value),class:"input input-sm w-full",placeholder:"Enter API key if required"},null,40,_7r)])):ne("",!0)]),b("div",v7r,[b("div",y7r,[te(o,{id:`dl-mounted-${l}`,checked:a.mounted,"onUpdate:checked":c=>s.updateDataLake(l,"mounted",c)},null,8,["id","checked","onUpdate:checked"]),b("label",{for:`dl-mounted-${l}`,class:"label !mb-0 text-sm cursor-pointer"}," Mounted ",8,b7r)]),b("div",S7r,[a.type==="lollmsvectordb"?(k(),R(Ve,{key:0},[b("button",{onClick:c=>s.vectorizeFolder(l),class:"btn btn-secondary btn-sm",title:"Vectorize or re-vectorize the selected folder"},e[17]||(e[17]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4 mr-1"},null,-1),Se(" Vectorize ")]),8,x7r),b("button",{onClick:c=>s.selectLollmsVectordbFolder(l),class:"btn btn-primary btn-sm",title:"Select folder containing documents to vectorize"},e[18]||(e[18]=[b("i",{"data-feather":"folder-plus",class:"w-4 h-4 mr-1"},null,-1),Se(" Select Folder ")]),8,E7r)],64)):ne("",!0),a.type==="lightrag"?(k(),R(Ve,{key:1},[b("button",{onClick:c=>s.triggerFileInput(l),class:"btn btn-success btn-sm",title:"Upload supported files (.txt, .md, .pdf, .docx, .pptx, .xlsx)"},e[19]||(e[19]=[b("i",{"data-feather":"upload",class:"w-4 h-4 mr-1"},null,-1),Se(" Upload Files ")]),8,w7r),b("input",{type:"file",ref_for:!0,ref:c=>{c&&(i.fileInputs[l]=c)},onChange:c=>s.handleFileUpload(c,l),accept:".txt,.md,.pdf,.docx,.pptx,.xlsx",class:"hidden",multiple:""},null,40,C7r)],64)):ne("",!0)])])]))),128))]),b("div",L7r,[b("button",{onClick:e[0]||(e[0]=(...a)=>s.addDataLake&&s.addDataLake(...a)),class:"btn btn-primary w-full md:w-auto"},e[20]||(e[20]=[b("i",{"data-feather":"plus-circle",class:"w-5 h-5 mr-2"},null,-1),Se(" Add New Data Lake ")]))])]),b("section",$7r,[e[33]||(e[33]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-2"},"Self-Hosted RAG Servers",-1)),e[34]||(e[34]=b("p",{class:"text-sm text-blue-500 dark:text-blue-400 mb-4"}," Configure and manage local RAG server instances (like LightRAG) running on your machine. ",-1)),b("div",A7r,[!t.$store.state.config.rag_local_services||t.$store.state.config.rag_local_services.length===0?(k(),R("div",k7r," No RAG Servers configured. ")):ne("",!0),(k(!0),R(Ve,null,dt(t.$store.state.config.rag_local_services,(a,l)=>{var c,u,d,f,h,p,T,m;return k(),R("div",{key:`server-${l}`,class:"p-4 bg-blue-100 dark:bg-blue-800/60 border border-blue-200 dark:border-blue-700 rounded-lg shadow-sm space-y-4 relative group"},[b("button",{onClick:O=>s.removeDatabaseService(l),class:"absolute top-2 right-2 p-1 rounded-full text-red-500 hover:bg-red-100 dark:hover:bg-red-800 opacity-0 group-hover:opacity-100 transition-opacity duration-200 svg-button",title:"Remove Server"},e[23]||(e[23]=[b("i",{"data-feather":"x-circle",class:"w-5 h-5"},null,-1)]),8,P7r),b("div",R7r,[b("div",null,[b("label",{for:`srv-alias-${l}`,class:"label mb-1"},"Alias",8,M7r),b("input",{type:"text",id:`srv-alias-${l}`,value:a.alias,onInput:O=>s.updateServer(l,"alias",O.target.value),class:"input input-sm w-full",placeholder:"Server Alias"},null,40,D7r)]),b("div",null,[b("label",{for:`srv-type-${l}`,class:"label mb-1"},"Type",8,N7r),b("select",{id:`srv-type-${l}`,required:"",value:a.type,onChange:O=>s.updateServer(l,"type",O.target.value),class:"input input-sm w-full"},e[24]||(e[24]=[b("option",{value:"lightrag"},"LightRAG",-1)]),40,I7r)]),b("div",H7r,[b("label",{for:`srv-url-${l}`,class:"label mb-1"},"Server URL",8,V7r),b("input",{type:"text",id:`srv-url-${l}`,value:a.url,onInput:O=>s.updateServer(l,"url",O.target.value),class:"input input-sm w-full",placeholder:"http://localhost:port"},null,40,q7r)]),b("div",null,[b("label",{for:`srv-key-${l}`,class:"label mb-1"},"API Key (Optional)",8,U7r),b("input",{type:"password",id:`srv-key-${l}`,value:a.key,onInput:O=>s.updateServer(l,"key",O.target.value),class:"input input-sm w-full",placeholder:"API Key if needed"},null,40,B7r)]),b("div",z7r,[b("div",X7r,[te(o,{id:`srv-startup-${l}`,checked:a.start_at_startup,"onUpdate:checked":O=>s.updateServer(l,"start_at_startup",O)},null,8,["id","checked","onUpdate:checked"]),b("label",{for:`srv-startup-${l}`,class:"label !mb-0 text-sm cursor-pointer"},"Start at Startup",8,F7r)])]),b("div",null,[b("label",{for:`srv-input-${l}`,class:"label mb-1"},"Input Folder Path",8,j7r),b("div",Y7r,[b("input",{type:"text",id:`srv-input-${l}`,value:a.input_path,onInput:O=>s.updateServer(l,"input_path",O.target.value),class:"input input-sm w-full rounded-r-none",placeholder:"Path to watch for new files"},null,40,G7r),b("button",{onClick:O=>s.selectLightragFolder(l,"input"),class:"btn btn-secondary btn-sm rounded-l-none flex-shrink-0",title:"Select Input Folder"},e[25]||(e[25]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]),8,W7r)])]),b("div",null,[b("label",{for:`srv-work-${l}`,class:"label mb-1"},"Working Folder Path",8,Z7r),b("div",K7r,[b("input",{type:"text",id:`srv-work-${l}`,value:a.working_path,onInput:O=>s.updateServer(l,"working_path",O.target.value),class:"input input-sm w-full rounded-r-none",placeholder:"Path for database files"},null,40,J7r),b("button",{onClick:O=>s.selectLightragFolder(l,"output"),class:"btn btn-secondary btn-sm rounded-l-none flex-shrink-0",title:"Select Working Folder"},e[26]||(e[26]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]),8,e8r)])])]),b("div",t8r,[b("div",n8r,[b("span",{class:ye(["w-3 h-3 rounded-full",((c=i.serverStatuses[l])==null?void 0:c.dotClass)||"bg-status-unknown"]),title:((u=i.serverStatuses[l])==null?void 0:u.title)||"Unknown"},null,10,r8r),b("span",i8r,ae(((d=i.serverStatuses[l])==null?void 0:d.text)||"Status Unknown"),1),b("button",{onClick:O=>s.checkServerHealth(l),class:"btn btn-secondary btn-sm !p-1",title:"Check Server Status",disabled:(f=i.serverStatuses[l])==null?void 0:f.loading},[b("i",{"data-feather":"refresh-cw",class:ye(["w-4 h-4",(h=i.serverStatuses[l])!=null&&h.loading?"animate-spin":""])},null,2)],8,s8r)]),b("div",o8r,[b("button",{onClick:O=>s.startRagServer(l),class:"btn btn-success btn-sm",title:"Start this RAG server instance"},e[27]||(e[27]=[b("i",{"data-feather":"play",class:"w-4 h-4 mr-1"},null,-1),Se(" Start Server ")]),8,a8r),a.type==="lightrag"&&((p=i.serverStatuses[l])==null?void 0:p.status)==="healthy"?(k(),R("button",{key:0,onClick:O=>s.showLightRagWebUI(l),class:"btn btn-primary btn-sm",title:"Open LightRAG Web UI"},e[28]||(e[28]=[b("i",{"data-feather":"external-link",class:"w-4 h-4 mr-1"},null,-1),Se(" Show WebUI ")]),8,l8r)):ne("",!0)])]),a.type==="lightrag"&&i.serverStatuses[l]&&i.serverStatuses[l].status==="healthy"&&i.serverStatuses[l].details?(k(),R("div",c8r,[b("div",null,[e[29]||(e[29]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Indexed Files:",-1)),Se(" "+ae(i.serverStatuses[l].details.indexed_files_count??"N/A"),1)]),b("div",null,[e[30]||(e[30]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Model:",-1)),Se(" "+ae(((T=i.serverStatuses[l].details.configuration)==null?void 0:T.llm_model)||"N/A"),1)]),b("div",null,[e[31]||(e[31]=b("b",{class:"text-blue-600 dark:text-blue-300"},"Embedding:",-1)),Se(" "+ae(((m=i.serverStatuses[l].details.configuration)==null?void 0:m.embedding_model)||"N/A"),1)])])):ne("",!0)])}),128))]),b("div",u8r,[b("button",{onClick:e[1]||(e[1]=(...a)=>s.addDatabaseService&&s.addDatabaseService(...a)),class:"btn btn-primary w-full md:w-auto"},e[32]||(e[32]=[b("i",{"data-feather":"plus-circle",class:"w-5 h-5 mr-2"},null,-1),Se(" Add New RAG Server ")]))])]),b("section",d8r,[e[46]||(e[46]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-3"},"LoLLMs VectorDB Settings",-1)),b("div",f8r,[b("div",null,[e[36]||(e[36]=b("label",{for:"rag_vectorizer",class:"label mb-1"},"Vectorizer Engine",-1)),b("select",{id:"rag_vectorizer",required:"",value:t.$store.state.config.rag_vectorizer,onChange:e[2]||(e[2]=a=>t.$store.state.config.rag_vectorizer=a.target.value),class:"input input-sm w-full"},e[35]||(e[35]=[b("option",{value:"semantic"},"Sentence Transformer (Recommended)",-1),b("option",{value:"tfidf"},"TF-IDF (Fast, Less Accurate)",-1),b("option",{value:"openai"},"OpenAI Ada",-1),b("option",{value:"ollama"},"Ollama Embedding",-1)]),40,h8r)]),b("div",p8r,[b("div",T8r,[te(o,{id:"rag_vectorizer_execute_remote_code",checked:t.$store.state.config.rag_vectorizer_execute_remote_code,"onUpdate:checked":e[3]||(e[3]=a=>t.$store.state.config.rag_vectorizer_execute_remote_code=!!a)},null,8,["checked"]),e[37]||(e[37]=b("label",{for:"rag_vectorizer_execute_remote_code",class:"label !mb-0 text-sm cursor-pointer"},"Allow Remote Code Execution",-1)),e[38]||(e[38]=b("i",{"data-feather":"alert-triangle",class:"w-4 h-4 text-red-500 dark:text-red-400 ml-1",title:"Security Risk: Only enable if using a trusted custom vectorizer source."},null,-1))])]),b("div",O8r,[e[42]||(e[42]=b("label",{for:"rag_vectorizer_model",class:"label mb-1"},"Vectorizer Model",-1)),b("select",{id:"rag_vectorizer_model",value:t.$store.state.config.rag_vectorizer_model,onChange:e[4]||(e[4]=a=>t.$store.state.config.rag_vectorizer_model=a.target.value),class:"input input-sm w-full mb-1",disabled:t.$store.state.config.rag_vectorizer==="tfidf"},[t.$store.state.config.rag_vectorizer==="tfidf"?(k(),R("option",g8r,"N/A for TF-IDF")):ne("",!0),t.$store.state.config.rag_vectorizer==="semantic"?(k(),R("optgroup",Q8r,e[39]||(e[39]=[b("option",{value:"BAAI/bge-m3"},"BAAI/bge-m3",-1),b("option",{value:"nvidia/NV-Embed-v2"},"nvidia/NV-Embed-v2",-1),b("option",{value:"sentence-transformers/all-MiniLM-L6-v2"},"all-MiniLM-L6-v2",-1),b("option",{value:"sentence-transformers/all-mpnet-base-v2"},"all-mpnet-base-v2",-1)]))):ne("",!0),t.$store.state.config.rag_vectorizer==="openai"?(k(),R("optgroup",_8r,e[40]||(e[40]=[b("option",{value:"text-embedding-3-large"},"text-embedding-3-large",-1),b("option",{value:"text-embedding-3-small"},"text-embedding-3-small",-1),b("option",{value:"text-embedding-ada-002"},"text-embedding-ada-002 (Legacy)",-1)]))):ne("",!0),t.$store.state.config.rag_vectorizer==="ollama"?(k(),R("optgroup",v8r,e[41]||(e[41]=[b("option",{value:"mxbai-embed-large"},"mxbai-embed-large",-1),b("option",{value:"nomic-embed-text"},"nomic-embed-text",-1),b("option",{value:"all-minilm"},"all-minilm",-1),b("option",{value:"snowflake-arctic-embed"},"snowflake-arctic-embed",-1)]))):ne("",!0)],40,m8r),b("input",{type:"text",value:t.$store.state.config.rag_vectorizer_model,onInput:e[5]||(e[5]=a=>t.$store.state.config.rag_vectorizer_model=a.target.value),class:"input input-sm w-full",placeholder:"Or enter custom model name/path",disabled:t.$store.state.config.rag_vectorizer==="tfidf"},null,40,y8r)]),t.$store.state.config.rag_vectorizer==="ollama"||t.$store.state.config.rag_vectorizer==="openai"?(k(),R("div",b8r,[b("label",S8r,ae(t.$store.state.config.rag_vectorizer==="ollama"?"Ollama Server URL":"OpenAI API Base URL"),1),b("input",{type:"text",id:"rag_service_url",value:t.$store.state.config.rag_service_url,onInput:e[6]||(e[6]=a=>t.$store.state.config.rag_service_url=a.target.value),class:"input input-sm w-full",placeholder:t.$store.state.config.rag_vectorizer==="ollama"?"http://localhost:11434":"https://api.openai.com/v1"},null,40,x8r)])):ne("",!0)]),b("div",E8r,[e[43]||(e[43]=b("label",{for:"rag_chunk_size-range",class:"setting-label"},"Chunk Size",-1)),b("div",w8r,[b("input",{id:"rag_chunk_size-range",value:t.$store.state.config.rag_chunk_size,onInput:e[7]||(e[7]=a=>t.$store.state.config.rag_chunk_size=parseInt(a.target.value)),type:"range",min:"100",max:"2000",step:"50",class:"range-input flex-grow"},null,40,C8r),b("input",{id:"rag_chunk_size-number",value:t.$store.state.config.rag_chunk_size,onInput:e[8]||(e[8]=a=>t.$store.state.config.rag_chunk_size=parseInt(a.target.value)),type:"number",min:"100",max:"2000",step:"50",class:"input input-sm w-24 text-center"},null,40,L8r)])]),b("div",$8r,[e[44]||(e[44]=b("label",{for:"rag_overlap_size-range",class:"setting-label"},"Overlap Size",-1)),b("div",A8r,[b("input",{id:"rag_overlap_size-range",value:t.$store.state.config.rag_overlap_size,onInput:e[9]||(e[9]=a=>t.$store.state.config.rag_overlap_size=parseInt(a.target.value)),type:"range",min:"0",max:"500",step:"10",class:"range-input flex-grow"},null,40,k8r),b("input",{id:"rag_overlap_size-number",value:t.$store.state.config.rag_overlap_size,onInput:e[10]||(e[10]=a=>t.$store.state.config.rag_overlap_size=parseInt(a.target.value)),type:"number",min:"0",max:"500",step:"10",class:"input input-sm w-24 text-center"},null,40,P8r)])]),b("div",R8r,[te(o,{id:"rag_clean_chunks",checked:t.$store.state.config.rag_clean_chunks,"onUpdate:checked":e[11]||(e[11]=a=>t.$store.state.config.rag_clean_chunks=!!a)},null,8,["checked"]),e[45]||(e[45]=b("label",{for:"rag_clean_chunks",class:"toggle-label !flex-none"},[Se(" Clean Chunks "),b("span",{class:"toggle-description"},"Attempt to remove redundant whitespace and formatting from text chunks before vectorization.")],-1))])]),b("section",M8r,[e[50]||(e[50]=b("h3",{class:"text-xl font-medium text-blue-600 dark:text-blue-300 mb-3"},"RAG Query Settings",-1)),b("div",D8r,[e[47]||(e[47]=b("label",{for:"rag_build_keys_words",class:"toggle-label"},[Se(" Reformulate Query with Keywords "),b("span",{class:"toggle-description"},"Let the AI extract keywords from your prompt to potentially improve database search relevance.")],-1)),te(o,{id:"rag_build_keys_words",checked:t.$store.state.config.rag_build_keys_words,"onUpdate:checked":e[12]||(e[12]=a=>t.$store.state.config.rag_build_keys_words=!!a)},null,8,["checked"])]),b("div",N8r,[e[48]||(e[48]=b("label",{for:"rag_put_chunk_informations_into_context",class:"toggle-label"},[Se(" Include Chunk Source Info in Context "),b("span",{class:"toggle-description"},"Prepend retrieved text chunks with source information (e.g., filename) when adding to the LLM context.")],-1)),te(o,{id:"rag_put_chunk_informations_into_context",checked:t.$store.state.config.rag_put_chunk_informations_into_context,"onUpdate:checked":e[13]||(e[13]=a=>t.$store.state.config.rag_put_chunk_informations_into_context=!!a)},null,8,["checked"])]),b("div",I8r,[e[49]||(e[49]=b("label",{for:"data_vectorization_save_db",class:"toggle-label"},[Se(" Persist Vector Database "),b("span",{class:"toggle-description"},"Save the vectorized data to disk. If disabled, the database is in-memory only and lost on restart. (Applies mainly to LoLLMs VectorDB).")],-1)),te(o,{id:"data_vectorization_save_db",checked:t.$store.state.config.data_vectorization_save_db,"onUpdate:checked":e[14]||(e[14]=a=>t.$store.state.config.data_vectorization_save_db=!!a)},null,8,["checked"])])])])}const V8r=st(i7r,[["render",H8r],["__scopeId","data-v-52537129"]]),q8r={name:"InternetSettings",components:{ToggleSwitch:ju},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:["setting-updated"],methods:{updateValue(t,e){this.$emit("setting-updated",{key:t,value:e})},handleNumberInput(t,e,n=!1){let r=n?parseInt(e):parseFloat(e);isNaN(r)&&(console.warn(`Attempted to set invalid number for ${t}:`,e),r={internet_nb_search_pages:1,internet_vectorization_chunk_size:100,internet_vectorization_overlap_size:0,internet_vectorization_nb_chunks:1}[t]||0),this.updateValue(t,r)},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},U8r={class:"user-settings-panel space-y-6"},B8r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},z8r={class:"toggle-item"},X8r={class:"setting-item"},F8r={class:"flex-1 flex items-center gap-4"},j8r=["value","disabled"],Y8r=["value","disabled"],G8r={class:"setting-item"},W8r={class:"flex-1 flex items-center gap-4"},Z8r=["value","disabled"],K8r=["value","disabled"],J8r={class:"setting-item"},ehr={class:"flex-1 flex items-center gap-4"},thr=["value","disabled"],nhr=["value","disabled"],rhr={class:"setting-item"},ihr={class:"flex-1 flex items-center gap-4"},shr=["value","disabled"],ohr=["value","disabled"];function ahr(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",U8r,[e[22]||(e[22]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Internet Search ",-1)),e[23]||(e[23]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400 mb-4"}," Configure how LoLLMs interacts with the internet to answer questions or find information. Requires a model capable of function calling or specific instruction following. ",-1)),b("section",B8r,[e[16]||(e[16]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Activation & Behavior",-1)),b("div",z8r,[e[12]||(e[12]=b("label",{for:"activate_internet_search",class:"toggle-label"},[Se(" Enable Automatic Internet Search "),b("span",{class:"toggle-description"},"Allow the AI to decide when to search the internet based on the prompt.")],-1)),te(o,{id:"activate_internet_search",checked:n.config.activate_internet_search,"onUpdate:checked":e[0]||(e[0]=a=>s.updateValue("activate_internet_search",a))},null,8,["checked"])]),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[13]||(e[13]=b("label",{for:"internet_activate_search_decision",class:"toggle-label"},[Se(" Enable Explicit Search Decision "),b("span",{class:"toggle-description"},"Make the AI explicitly state whether it needs to search the internet before performing the search.")],-1)),te(o,{id:"internet_activate_search_decision",checked:n.config.internet_activate_search_decision,"onUpdate:checked":e[1]||(e[1]=a=>s.updateValue("internet_activate_search_decision",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[14]||(e[14]=b("label",{for:"activate_internet_pages_judgement",class:"toggle-label"},[Se(" Enable Search Result Evaluation "),b("span",{class:"toggle-description"},"Allow the AI to evaluate the relevance and quality of search result snippets before using them.")],-1)),te(o,{id:"activate_internet_pages_judgement",checked:n.config.activate_internet_pages_judgement,"onUpdate:checked":e[2]||(e[2]=a=>s.updateValue("activate_internet_pages_judgement",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2),b("div",{class:ye(["toggle-item",{"opacity-50 pointer-events-none":!n.config.activate_internet_search}])},[e[15]||(e[15]=b("label",{for:"internet_quick_search",class:"toggle-label"},[Se(" Enable Quick Search "),b("span",{class:"toggle-description"},"Perform a faster search potentially using fewer results or less processing, might be less accurate.")],-1)),te(o,{id:"internet_quick_search",checked:n.config.internet_quick_search,"onUpdate:checked":e[3]||(e[3]=a=>s.updateValue("internet_quick_search",a)),disabled:!n.config.activate_internet_search},null,8,["checked","disabled"])],2)]),b("section",{class:ye(["space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color",n.config.activate_internet_search?"":"opacity-50 pointer-events-none"])},[e[21]||(e[21]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Search Parameters",-1)),b("div",X8r,[e[17]||(e[17]=b("label",{for:"internet_nb_search_pages",class:"setting-label"},[Se(" Number of Search Results "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Controls how many search result snippets are initially retrieved.")],-1)),b("div",F8r,[b("input",{id:"internet_nb_search_pages-range",value:n.config.internet_nb_search_pages,onInput:e[4]||(e[4]=a=>s.handleNumberInput("internet_nb_search_pages",a.target.value,!0)),type:"range",min:"1",max:"20",step:"1",class:"range-input",disabled:!n.config.activate_internet_search},null,40,j8r),b("input",{id:"internet_nb_search_pages-number",value:n.config.internet_nb_search_pages,onInput:e[5]||(e[5]=a=>s.handleNumberInput("internet_nb_search_pages",a.target.value,!0)),type:"number",min:"1",max:"20",step:"1",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,Y8r)])]),b("div",G8r,[e[18]||(e[18]=b("label",{for:"internet_vectorization_chunk_size",class:"setting-label"},[Se(" Content Chunk Size "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Size of text chunks when processing content from searched web pages (if applicable).")],-1)),b("div",W8r,[b("input",{id:"internet_vectorization_chunk_size-range",value:n.config.internet_vectorization_chunk_size,onInput:e[6]||(e[6]=a=>s.handleNumberInput("internet_vectorization_chunk_size",a.target.value,!0)),type:"range",min:"100",max:"1000",step:"50",class:"range-input",disabled:!n.config.activate_internet_search},null,40,Z8r),b("input",{id:"internet_vectorization_chunk_size-number",value:n.config.internet_vectorization_chunk_size,onInput:e[7]||(e[7]=a=>s.handleNumberInput("internet_vectorization_chunk_size",a.target.value,!0)),type:"number",min:"100",max:"1000",step:"50",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,K8r)])]),b("div",J8r,[e[19]||(e[19]=b("label",{for:"internet_vectorization_overlap_size",class:"setting-label"},[Se(" Content Overlap Size "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Overlap between text chunks when processing web page content.")],-1)),b("div",ehr,[b("input",{id:"internet_vectorization_overlap_size-range",value:n.config.internet_vectorization_overlap_size,onInput:e[8]||(e[8]=a=>s.handleNumberInput("internet_vectorization_overlap_size",a.target.value,!0)),type:"range",min:"0",max:"200",step:"10",class:"range-input",disabled:!n.config.activate_internet_search},null,40,thr),b("input",{id:"internet_vectorization_overlap_size-number",value:n.config.internet_vectorization_overlap_size,onInput:e[9]||(e[9]=a=>s.handleNumberInput("internet_vectorization_overlap_size",a.target.value,!0)),type:"number",min:"0",max:"200",step:"10",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,nhr)])]),b("div",rhr,[e[20]||(e[20]=b("label",{for:"internet_vectorization_nb_chunks",class:"setting-label"},[Se(" Number of Content Chunks to Use "),b("span",{class:"block text-xs font-normal text-blue-500 dark:text-blue-400 mt-1"},"Maximum number of processed text chunks from web pages to include in the context.")],-1)),b("div",ihr,[b("input",{id:"internet_vectorization_nb_chunks-range",value:n.config.internet_vectorization_nb_chunks,onInput:e[10]||(e[10]=a=>s.handleNumberInput("internet_vectorization_nb_chunks",a.target.value,!0)),type:"range",min:"1",max:"20",step:"1",class:"range-input",disabled:!n.config.activate_internet_search},null,40,shr),b("input",{id:"internet_vectorization_nb_chunks-number",value:n.config.internet_vectorization_nb_chunks,onInput:e[11]||(e[11]=a=>s.handleNumberInput("internet_vectorization_nb_chunks",a.target.value,!0)),type:"number",min:"1",max:"20",step:"1",class:"input-sm w-20 text-center",disabled:!n.config.activate_internet_search},null,40,ohr)])])],2)])}const lhr=st(q8r,[["render",ahr],["__scopeId","data-v-10e06c13"]]),chr={name:"ServiceEntry",props:{service:{type:Object,required:!0},serviceType:{type:String,required:!0},isActive:{type:Boolean,default:!1},baseUrl:{type:String,default:""}},emits:["select","configure","error"],computed:{isConfigurable(){return this.service.name!=="None"&&this.service.name!=="browser"}},methods:{selectService(){this.service.name!=="None"&&this.$emit("select",{serviceType:this.serviceType,serviceName:this.service.name})},configureService(){this.isActive&&this.$emit("configure",{serviceType:this.serviceType,serviceName:this.service.name})},getServiceIconUrl(t){return t?t.startsWith("http")||t.startsWith("/")?t:`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t.startsWith("/")?t.substring(1):t}`:Eo},handleImgError(t){t.target.src=Eo,this.$emit("error",{type:"image_load",message:"Failed to load service icon",event:t})},replaceFeatherIcons(){Fe(()=>{try{this.$el&&this.$el.parentNode&&Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},uhr={class:"flex-grow flex flex-col p-4"},dhr={class:"flex items-start mb-3"},fhr=["src"],hhr={class:"flex-grow overflow-hidden min-w-0"},phr=["title"],Thr=["title"],Ohr={class:"mt-auto pt-3 border-t border-gray-200 dark:border-gray-700"},mhr={class:"flex justify-end items-center"},ghr=["disabled"],Qhr={key:1,class:"text-xs text-gray-400 dark:text-gray-500 italic"};function _hr(t,e,n,r,i,s){return k(),R("div",{class:ye(["app-card relative flex flex-col cursor-pointer transition-all duration-200 ease-in-out hover:shadow-lg",{"border-2 border-blue-500 dark:border-blue-400 shadow-md scale-[1.02]":n.isActive,"border border-gray-200 dark:border-gray-700":!n.isActive,"opacity-60 hover:opacity-100":!n.isActive&&n.service.name!=="None"&&n.service.name!=="browser"}]),onClick:e[2]||(e[2]=(...o)=>s.selectService&&s.selectService(...o))},[b("div",uhr,[b("div",dhr,[b("img",{src:s.getServiceIconUrl(n.service.icon),onError:e[0]||(e[0]=(...o)=>s.handleImgError&&s.handleImgError(...o)),alt:"Service Icon",class:"w-12 h-12 rounded-lg object-cover mr-4 flex-shrink-0 border border-gray-200 dark:border-gray-600 shadow-sm"},null,40,fhr),b("div",hhr,[b("h3",{class:"font-semibold text-md text-gray-800 dark:text-gray-100 truncate",title:n.service.caption||n.service.name},ae(n.service.caption||n.service.name),9,phr),n.service.description?(k(),R("p",{key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-1 line-clamp-2",title:n.service.description},ae(n.service.description),9,Thr)):ne("",!0)])]),b("div",Ohr,[b("div",mhr,[s.isConfigurable?(k(),R("button",{key:0,onClick:e[1]||(e[1]=oe((...o)=>s.configureService&&s.configureService(...o),["stop"])),class:ye(["btn btn-secondary btn-sm p-1.5 flex-shrink-0",{"cursor-not-allowed opacity-50":!n.isActive}]),title:"Configure Service",disabled:!n.isActive},e[3]||(e[3]=[b("i",{"data-feather":"settings",class:"w-4 h-4"},null,-1)]),10,ghr)):(k(),R("span",Qhr,"No settings"))])])])],2)}const vhr=st(chr,[["render",_hr],["__scopeId","data-v-0d69041f"]]),yhr="/",bhr={name:"ServicesZooSettings",components:{ToggleSwitch:ju,ServiceEntry:vhr},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],setup(t,{emit:e}){const n=We(yhr),r=We([]),i=We([]),s=We([]),o=We([]),a=We([]),l=We([]),c=We([]),u=We([]),d=We([]),f={name:"None",caption:"None",icon:null,description:"No service selected."},h={name:"browser",caption:"Browser TTS",icon:null,description:"Uses the built-in browser text-to-speech capability."},p=Je(()=>[f,h,...r.value]),T=Je(()=>[f,...i.value]),m=Je(()=>[f,...s.value]),O=Je(()=>[f,...o.value]),g=Je(()=>[f,...a.value]),Q=(w,L)=>{e("setting-updated",{key:w,value:L})},v=(w,L,P=!1)=>{let A=P?parseInt(L):parseFloat(L);if(isNaN(A))if(w==="stt_input_device"||w==="tts_output_device"){console.warn(`Invalid device index selected for ${w}: ${L}`);return}else{console.warn(`Invalid number for ${w}: ${L}`);return}Q(w,A)},_=({serviceType:w,serviceName:L})=>{const A={tts:"active_tts_service",stt:"active_stt_service",tti:"active_tti_service",ttm:"active_ttm_service",ttv:"active_ttv_service"}[w];A&&Q(A,L)},y=async()=>{try{const[w,L,P,A,q]=await Promise.all([t.api_post_req("list_tts_services"),t.api_post_req("list_stt_services"),t.api_post_req("list_tti_services"),t.api_post_req("list_ttm_services"),t.api_post_req("list_ttv_services")]);r.value=Array.isArray(w)?w:[],i.value=Array.isArray(L)?L:[],s.value=Array.isArray(P)?P:[],o.value=Array.isArray(A)?A:[],a.value=Array.isArray(q)?q:[]}catch{t.show_toast("Failed to fetch service lists.",4,!1)}},S=async()=>{try{const[w,L]=await Promise.all([t.api_get_req("get_snd_input_devices"),t.api_get_req("get_snd_output_devices")]);l.value=(w==null?void 0:w.device_names)||[],c.value=(w==null?void 0:w.device_indexes)||[],u.value=(L==null?void 0:L.device_names)||[],d.value=(L==null?void 0:L.device_indexes)||[]}catch{t.show_toast("Failed to fetch audio devices.",4,!1)}},x=()=>{t.show_toast("Refreshing audio devices...",2,!0),S()},E=async({serviceType:w,serviceName:L})=>{if(!L||L==="None"||L==="browser"){t.show_toast(`No configurable settings for '${L}'.`,3,!1);return}const P={tts:"get_active_tts_settings",stt:"get_active_stt_settings",tti:"get_active_tti_settings",ttm:"get_active_ttm_settings",ttv:"get_active_ttv_settings"},A={tts:"set_active_tts_settings",stt:"set_active_stt_settings",tti:"set_active_tti_settings",ttm:"set_active_ttm_settings",ttv:"set_active_ttv_settings"},q=P[w],X=A[w];if(!(!q||!X))try{const F=`active_${w}_service`;if(t.config[F]!==L){t.show_toast(`Please select ${L} first to configure its settings.`,3,!1);return}const z=await t.api_post_req(q);if(z&&Object.keys(z).length>0){const U=await t.show_universal_form(z,`${L} Settings`,"Save","Cancel");if(U!=null){const j=await t.api_post_req(X,{settings:U});j&&j.status?t.show_toast(`${L} settings updated!`,4,!0):t.show_toast(`Failed to update ${L} settings: ${(j==null?void 0:j.error)||"Error"}`,4,!1)}}else t.show_toast(`${L} has no configurable settings.`,3,!1)}catch(F){t.show_toast(`Error with ${L} settings: ${F.message}`,4,!1)}},C=()=>{Fe(()=>{try{Re.replace()}catch{}})};return Ii(()=>{y(),S(),C()}),Au(()=>{C()}),{baseUrl:n,ttsServices:r,sttServices:i,ttiServices:s,ttmServices:o,ttvServices:a,audioInputDevices:l,audioInputDeviceIndexes:c,audioOutputDevices:u,audioOutputDeviceIndexes:d,ttsServicesWithDefaults:p,sttServicesWithDefaults:T,ttiServicesWithDefaults:m,ttmServicesWithDefaults:O,ttvServicesWithDefaults:g,updateValue:Q,handleNumberInput:v,handleServiceSelect:_,refreshAudioDevices:x,showServiceSettings:E}}},Shr={class:"user-settings-panel space-y-6"},xhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ehr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},whr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Chr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Lhr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},$hr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Ahr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},khr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Phr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Rhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Mhr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Dhr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Nhr={class:"space-y-3 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},Ihr={key:0,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"},Hhr={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},Vhr={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},qhr={class:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4"},Uhr={class:"setting-item !items-center"},Bhr=["value"],zhr={class:"setting-item !items-center"},Xhr=["value"],Fhr={class:"setting-item !items-center"},jhr=["value"],Yhr={class:"setting-item !items-center"},Ghr=["value"],Whr={class:"setting-item !items-center"},Zhr=["value"],Khr={class:"setting-item !items-center"},Jhr=["value"],e9r={class:"setting-item !items-center"},t9r=["value"],n9r={class:"toggle-item md:col-span-2"},r9r=["value","disabled"],i9r={class:"space-y-4 p-4 border border-blue-300 dark:border-blue-600 rounded-lg panels-color"},s9r={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},o9r={class:"setting-item"},a9r=["value"],l9r=["value"],c9r={class:"setting-item"},u9r=["value"],d9r=["value"];function f9r(t,e,n,r,i,s){const o=Xe("ServiceEntry"),a=Xe("ToggleSwitch");return k(),R("div",Shr,[e[36]||(e[36]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Services Zoo & Audio ",-1)),b("section",xhr,[e[12]||(e[12]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Speech (TTS)",-1)),e[13]||(e[13]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for converting text into speech.",-1)),r.ttsServices.length>0?(k(),R("div",Ehr,[(k(!0),R(Ve,null,dt(r.ttsServicesWithDefaults,l=>(k(),Qt(o,{key:`tts-${l.name}`,service:l,serviceType:"tts",baseUrl:r.baseUrl,isActive:n.config.active_tts_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",whr,"No TTS services available."))]),b("section",Chr,[e[14]||(e[14]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Speech-to-Text (STT)",-1)),e[15]||(e[15]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for converting speech into text.",-1)),r.sttServices.length>0?(k(),R("div",Lhr,[(k(!0),R(Ve,null,dt(r.sttServicesWithDefaults,l=>(k(),Qt(o,{key:`stt-${l.name}`,service:l,serviceType:"stt",baseUrl:r.baseUrl,isActive:n.config.active_stt_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",$hr,"No STT services available."))]),b("section",Ahr,[e[16]||(e[16]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Image (TTI)",-1)),e[17]||(e[17]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating images from text.",-1)),r.ttiServices.length>0?(k(),R("div",khr,[(k(!0),R(Ve,null,dt(r.ttiServicesWithDefaults,l=>(k(),Qt(o,{key:`tti-${l.name}`,service:l,serviceType:"tti",baseUrl:r.baseUrl,isActive:n.config.active_tti_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Phr,"No TTI services available."))]),b("section",Rhr,[e[18]||(e[18]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Music (TTM)",-1)),e[19]||(e[19]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating music from text.",-1)),r.ttmServices.length>0?(k(),R("div",Mhr,[(k(!0),R(Ve,null,dt(r.ttmServicesWithDefaults,l=>(k(),Qt(o,{key:`ttm-${l.name}`,service:l,serviceType:"ttm",baseUrl:r.baseUrl,isActive:n.config.active_ttm_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Dhr,"No TTM services available."))]),b("section",Nhr,[e[20]||(e[20]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-1"},"Text-to-Video (TTV)",-1)),e[21]||(e[21]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mb-3"},"Select the default service for generating videos from text.",-1)),r.ttvServices.length>0?(k(),R("div",Ihr,[(k(!0),R(Ve,null,dt(r.ttvServicesWithDefaults,l=>(k(),Qt(o,{key:`ttv-${l.name}`,service:l,serviceType:"ttv",baseUrl:r.baseUrl,isActive:n.config.active_ttv_service===l.name,onSelect:r.handleServiceSelect,onConfigure:r.showServiceSettings},null,8,["service","baseUrl","isActive","onSelect","onConfigure"]))),128))])):(k(),R("p",Hhr,"No TTV services available."))]),b("section",Vhr,[e[31]||(e[31]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Audio Input / STT Settings",-1)),b("div",qhr,[b("div",Uhr,[e[22]||(e[22]=b("label",{for:"stt_listening_threshold",class:"setting-label"},"Listening Threshold",-1)),b("input",{id:"stt_listening_threshold",value:n.config.stt_listening_threshold,onInput:e[0]||(e[0]=l=>r.handleNumberInput("stt_listening_threshold",l.target.value,!0)),type:"number",min:"0",step:"10",class:"input-sm w-24"},null,40,Bhr)]),b("div",zhr,[e[23]||(e[23]=b("label",{for:"stt_silence_duration",class:"setting-label"},"Silence Duration (s)",-1)),b("input",{id:"stt_silence_duration",value:n.config.stt_silence_duration,onInput:e[1]||(e[1]=l=>r.handleNumberInput("stt_silence_duration",l.target.value,!0)),type:"number",min:"0",step:"1",class:"input-sm w-24"},null,40,Xhr)]),b("div",Fhr,[e[24]||(e[24]=b("label",{for:"stt_sound_threshold_percentage",class:"setting-label"},"Min Sound Percentage",-1)),b("input",{id:"stt_sound_threshold_percentage",value:n.config.stt_sound_threshold_percentage,onInput:e[2]||(e[2]=l=>r.handleNumberInput("stt_sound_threshold_percentage",l.target.value,!0)),type:"number",min:"0",max:"100",step:"1",class:"input-sm w-24"},null,40,jhr)]),b("div",Yhr,[e[25]||(e[25]=b("label",{for:"stt_gain",class:"setting-label"},"Volume Amplification",-1)),b("input",{id:"stt_gain",value:n.config.stt_gain,onInput:e[3]||(e[3]=l=>r.handleNumberInput("stt_gain",l.target.value,!0)),type:"number",min:"0",step:"1",class:"input-sm w-24"},null,40,Ghr)]),b("div",Whr,[e[26]||(e[26]=b("label",{for:"stt_rate",class:"setting-label"},"Audio Rate (Hz)",-1)),b("input",{id:"stt_rate",value:n.config.stt_rate,onInput:e[4]||(e[4]=l=>r.handleNumberInput("stt_rate",l.target.value,!0)),type:"number",min:"8000",step:"1000",class:"input-sm w-24"},null,40,Zhr)]),b("div",Khr,[e[27]||(e[27]=b("label",{for:"stt_channels",class:"setting-label"},"Channels",-1)),b("input",{id:"stt_channels",value:n.config.stt_channels,onInput:e[5]||(e[5]=l=>r.handleNumberInput("stt_channels",l.target.value,!0)),type:"number",min:"1",max:"2",step:"1",class:"input-sm w-24"},null,40,Jhr)]),b("div",e9r,[e[28]||(e[28]=b("label",{for:"stt_buffer_size",class:"setting-label"},"Buffer Size",-1)),b("input",{id:"stt_buffer_size",value:n.config.stt_buffer_size,onInput:e[6]||(e[6]=l=>r.handleNumberInput("stt_buffer_size",l.target.value,!0)),type:"number",min:"512",step:"512",class:"input-sm w-24"},null,40,t9r)]),b("div",n9r,[e[29]||(e[29]=b("label",{for:"stt_activate_word_detection",class:"toggle-label"},"Activate Wake Word Detection",-1)),te(a,{id:"stt_activate_word_detection",checked:n.config.stt_activate_word_detection,"onUpdate:checked":e[7]||(e[7]=l=>r.updateValue("stt_activate_word_detection",l))},null,8,["checked"])]),b("div",{class:ye(["setting-item md:col-span-2",{"opacity-50 pointer-events-none":!n.config.stt_activate_word_detection}])},[e[30]||(e[30]=b("label",{for:"stt_word_detection_file",class:"setting-label"},"Wake Word File (.wav)",-1)),b("input",{type:"text",id:"stt_word_detection_file",value:n.config.stt_word_detection_file,onInput:e[8]||(e[8]=l=>r.updateValue("stt_word_detection_file",l.target.value)),class:"input flex-grow",placeholder:"Path to wake word wav file",disabled:!n.config.stt_activate_word_detection},null,40,r9r)],2)])]),b("section",i9r,[e[35]||(e[35]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Audio Devices",-1)),b("button",{onClick:e[9]||(e[9]=(...l)=>r.refreshAudioDevices&&r.refreshAudioDevices(...l)),class:"btn btn-secondary btn-sm mb-2",title:"Rescan for audio devices"},e[32]||(e[32]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4 mr-1"},null,-1),Se(" Refresh Devices ")])),b("div",s9r,[b("div",o9r,[e[33]||(e[33]=b("label",{for:"stt_input_device",class:"setting-label"},"Audio Input Device",-1)),b("select",{id:"stt_input_device",value:n.config.stt_input_device,onChange:e[10]||(e[10]=l=>r.handleNumberInput("stt_input_device",l.target.value,!0)),class:"input flex-grow"},[(k(!0),R(Ve,null,dt(r.audioInputDevices,(l,c)=>(k(),R("option",{key:`in-${c}`,value:r.audioInputDeviceIndexes[c]},ae(l),9,l9r))),128))],40,a9r)]),b("div",c9r,[e[34]||(e[34]=b("label",{for:"tts_output_device",class:"setting-label"},"Audio Output Device",-1)),b("select",{id:"tts_output_device",value:n.config.tts_output_device,onChange:e[11]||(e[11]=l=>r.handleNumberInput("tts_output_device",l.target.value,!0)),class:"input flex-grow"},[(k(!0),R(Ve,null,dt(r.audioOutputDevices,(l,c)=>(k(),R("option",{key:`out-${c}`,value:r.audioOutputDeviceIndexes[c]},ae(l),9,d9r))),128))],40,u9r)])])])])}const h9r=st(bhr,[["render",f9r],["__scopeId","data-v-3f1df76f"]]),Mh="/assets/logo-CQZwS0X1.svg",p9r={name:"ImageAlbumViewer",props:{images:{type:Array,required:!0,validator:t=>t.every(e=>typeof e=="string")},initialSelected:{type:String,default:null}},data(){return{selectedImage:null}},created(){this.selectedImage=this.initialSelected||(this.images.length>0?this.images[0]:null)},methods:{selectImage(t){this.selectedImage=t}},watch:{images(t){t&&t.length>0?t.includes(this.selectedImage)||(this.selectedImage=t[0]):this.selectedImage=null}}},T9r={class:"image-album-viewer"},O9r={key:0,class:"main-view"},m9r=["src"],g9r={class:"thumbnails"},Q9r=["src","onClick"];function _9r(t,e,n,r,i,s){return k(),R("div",T9r,[i.selectedImage?(k(),R("div",O9r,[b("img",{src:i.selectedImage,alt:"Selected album image"},null,8,m9r)])):ne("",!0),b("div",g9r,[(k(!0),R(Ve,null,dt(n.images,(o,a)=>(k(),R("img",{key:a,src:o,class:ye([{active:o===i.selectedImage},"thumbnail"]),onClick:l=>s.selectImage(o),alt:"Album thumbnail"},null,10,Q9r))),128))])])}const v9r=st(p9r,[["render",_9r],["__scopeId","data-v-a5675545"]]),y9r={name:"DynamicUIRenderer",components:{ImageAlbumViewer:v9r},props:{ui:{type:String,required:!0},instanceId:{type:String,required:!0}},data(){return{albumImages:[],showAlbumViewer:!1,injectedStyleElements:[],renderCount:0}},computed:{...Pu(["clientId"]),containerId(){return console.log(`[${this.instanceId}] Computed containerId: dynamic-ui-${this.instanceId}`),`dynamic-ui-${this.instanceId}`}},watch:{ui:{immediate:!0,handler(t,e){this.renderCount++;const n=this.renderCount;console.log(`[${this.instanceId}] Watcher triggered (Render #${n}). UI changed: ${t!==e}. New length: ${t==null?void 0:t.length}, Old length: ${e==null?void 0:e.length}`);const r=this.$refs.htmlContentContainer,i=t!==e||!r||r.innerHTML==="";console.log(`[${this.instanceId}] Needs render evaluation (Render #${n}): ${i}`),i?(console.log(`[${this.instanceId}] --- Starting Update Cycle (Render #${n}) ---`),this.cleanupDynamicContent(n),this.$nextTick(()=>{console.log(`[${this.instanceId}] $nextTick after cleanup (Render #${n}): Starting renderContent.`),this.renderContent(n)})):console.log(`[${this.instanceId}] Watcher triggered but skipping render (Render #${n}). UI likely unchanged or container still populated.`)}}},beforeUnmount(){console.log(`[${this.instanceId}] Component beforeUnmount hook.`),this.cleanupDynamicContent("beforeUnmount")},methods:{logAlbumViewerMounted(){console.log(`[${this.instanceId}] ImageAlbumViewer successfully MOUNTED.`)},renderContent(t){console.log(`[${this.instanceId}] renderContent CALLED (Context: ${t})`);const e=this.$refs.htmlContentContainer;if(!e){console.error(`[${this.instanceId}] ERROR: htmlContentContainer ref NOT FOUND during renderContent (Context: ${t})!`);return}e.innerHTML="",console.log(`[${this.instanceId}] Cleared targetContainer innerHTML (Context: ${t})`);let n=[];const r=this.ui||"";if(!r.trim()){console.warn(`[${this.instanceId}] No UI content provided (Context: ${t}). Skipping parsing.`),this.albumImages=[],this.showAlbumViewer=!1,console.log(`[${this.instanceId}] Reset album state due to empty UI (Context: ${t}). showAlbumViewer=${this.showAlbumViewer}`);return}console.log(`[${this.instanceId}] Parsing UI content (length: ${r.length}) (Context: ${t})`);const s=new DOMParser().parseFromString(r,"text/html"),o=s.head.getElementsByTagName("style");console.log(`[${this.instanceId}] Found ${o.length} style tags in .`),Array.from(o).forEach((d,f)=>{console.log(`[${this.instanceId}] Injecting head style #${f+1}.`),this.injectScopedCss(d.textContent,t)});const a=s.body.getElementsByTagName("style");console.log(`[${this.instanceId}] Found ${a.length} style tags in .`),Array.from(a).forEach((d,f)=>{console.log(`[${this.instanceId}] Injecting body style #${f+1}.`),this.injectScopedCss(d.textContent,t)}),console.log(`[${this.instanceId}] Processing body childNodes (Context: ${t})`);const l=[];let c=!1;const u=Array.from(s.body.childNodes);console.log(`[${this.instanceId}] Found ${u.length} nodes in parsed body.`),u.forEach((d,f)=>{if(d.nodeType===Node.ELEMENT_NODE){if(console.log(`[${this.instanceId}] Processing Node #${f+1}: <${d.tagName}>, Classes: ${d.classList}`),d.tagName==="IMG"&&d.classList.contains("album")){const h=d.getAttribute("src");h?(console.log(`[${this.instanceId}] -> Found 'img.album' with src: ${h}`),n.push(h),c=!0):console.warn(`[${this.instanceId}] -> Found 'img.album' but it has NO src attribute.`);return}d.tagName==="IMG"&&d.classList.contains("clickable-post")&&(console.log(`[${this.instanceId}] -> Found 'img.clickable-post'. Ensuring data attributes.`),d.dataset.endpoint||(d.dataset.endpoint="/post_to_personality"),d.dataset.payloadKey||(d.dataset.payloadKey="img_path")),d.tagName==="A"&&d.classList.contains("open-folder")&&(console.log(`[${this.instanceId}] -> Found 'a.open-folder'. Setting href='#'`),d.setAttribute("href","#")),l.push(d)}else d.nodeType===Node.TEXT_NODE&&d.textContent.trim()?(console.log(`[${this.instanceId}] Processing Node #${f+1}: TextNode (non-empty)`),l.push(d)):console.log(`[${this.instanceId}] Skipping Node #${f+1} (Type: ${d.nodeType})`)}),console.log(`[${this.instanceId}] Appending ${l.length} processed nodes to targetContainer (Context: ${t})`),l.forEach(d=>{e.appendChild(document.importNode(d,!0))}),console.log(`[${this.instanceId}] Finished appending nodes. Current targetContainer innerHTML length: ${e.innerHTML.length}`),console.log(`[${this.instanceId}] Evaluating album state (Context: ${t}). albumPlaceholderNeeded=${c}, images found=${n.length}`),c&&n.length>0?(console.log(`[${this.instanceId}] SETTING album state: images=`,JSON.stringify(n)),this.albumImages=[...n],this.showAlbumViewer=!0,console.log(`[${this.instanceId}] State AFTER update: showAlbumViewer=${this.showAlbumViewer}, albumImages count=${this.albumImages.length}`)):(console.log(`[${this.instanceId}] RESETTING album state.`),this.albumImages=[],this.showAlbumViewer=!1,console.log(`[${this.instanceId}] State AFTER reset: showAlbumViewer=${this.showAlbumViewer}`)),console.log(`[${this.instanceId}] --- Finished renderContent (Context: ${t}) ---`)},injectScopedCss(t,e){if(console.log(`[${this.instanceId}] Injecting scoped CSS (Context: ${e})`),!t||!t.trim()){console.warn(`[${this.instanceId}] CSS content is empty, skipping injection.`);return}const n=this.scopeCSS(t),r=document.createElement("style");r.textContent=n,document.head.appendChild(r),this.injectedStyleElements.push(r),console.log(`[${this.instanceId}] Injected style element. Total injected: ${this.injectedStyleElements.length}`)},scopeCSS(t){const e=this.containerId;if(!e)return console.error(`[${this.instanceId}] Cannot scope CSS: containerId is missing!`),t;const n=`#${e}`;return t.replace(/([^\r\n,{}\s][^{}]*)(?=\s*\{)/g,(r,i)=>(i=i.trim(),i.startsWith("@")||i.startsWith("%")||/^\d+%$/.test(i)||i.includes(n)?i:i.split(",").map(o=>(o=o.trim(),`${n} ${o}`)).join(", ")))},handleContainerClick(t){const e=t.target;console.log(`[${this.instanceId}] Container clicked. Target: <${e.tagName}>, Classes: ${e.classList}`);const n=e.closest("img.clickable-post");if(n&&n.dataset.endpoint){t.preventDefault();const i=n.dataset.endpoint,s=n.dataset.payloadKey||"img_path",o=n.getAttribute("src"),a={[s]:o};console.log(`[${this.instanceId}] Clickable POST triggered. Endpoint: ${i}, Payload:`,a),Ae.post(i,a).then(l=>console.log(`[${this.instanceId}] Post to ${i} successful:`,l.data)).catch(l=>console.error(`[${this.instanceId}] Error posting to ${i}:`,l));return}const r=e.closest("a.open-folder");if(r){t.preventDefault();const i=r.dataset.discussionId;if(!i){console.warn(`[${this.instanceId}] 'a.open-folder' clicked, but missing 'data-discussion-id' attribute.`);return}if(console.log(`[${this.instanceId}] Open folder link clicked. Discussion ID: ${i}`),!this.clientId){console.error(`[${this.instanceId}] ERROR: Client ID not found in Vuex store for open_discussion_folder!`),alert("Error: Client information is missing.");return}console.log(`[${this.instanceId}] Posting to /open_discussion_folder with client_id: ${this.clientId}, discussion_id: ${i}`),Ae.post("/open_discussion_folder",{client_id:this.clientId,discussion_id:i}).then(s=>console.log(`[${this.instanceId}] Open folder request successful:`,s.data)).catch(s=>console.error(`[${this.instanceId}] Error opening folder:`,s));return}console.log(`[${this.instanceId}] Click was not handled by specific handlers.`)},cleanupDynamicContent(t){console.log(`[${this.instanceId}] cleanupDynamicContent CALLED (Context: ${t})`);let e=!1;this.showAlbumViewer&&(this.showAlbumViewer=!1,e=!0),this.albumImages.length>0&&(this.albumImages=[],e=!0),console.log(e?`[${this.instanceId}] Album state reset during cleanup. showAlbumViewer=${this.showAlbumViewer}`:`[${this.instanceId}] Album state was already reset.`),console.log(`[${this.instanceId}] Removing ${this.injectedStyleElements.length} injected style elements.`),this.injectedStyleElements.forEach((r,i)=>{r&&r.parentNode?(console.log(`[${this.instanceId}] Removing style element #${i+1}`),r.parentNode.removeChild(r)):console.warn(`[${this.instanceId}] Could not remove style element #${i+1} (already removed or no parent).`)}),this.injectedStyleElements=[];const n=this.$refs.htmlContentContainer;n?(console.log(`[${this.instanceId}] Clearing innerHTML of htmlContentContainer.`),n.innerHTML=""):console.warn(`[${this.instanceId}] htmlContentContainer ref not found during cleanup (Context: ${t}). Might be called before mount or after unmount.`),console.log(`[${this.instanceId}] --- Finished cleanupDynamicContent (Context: ${t}) ---`)}}},b9r=["id"],S9r={ref:"htmlContentContainer"},x9r={style:{background:"#eee",padding:"10px","margin-top":"10px","font-size":"12px",border:"1px solid #ccc"}};function E9r(t,e,n,r,i,s){const o=Xe("ImageAlbumViewer");return k(),R("div",{id:s.containerId,ref:"container",onClick:e[0]||(e[0]=(...a)=>s.handleContainerClick&&s.handleContainerClick(...a))},[b("div",S9r,null,512),i.showAlbumViewer?(k(),Qt(o,{images:i.albumImages,key:`album-${n.instanceId}-${i.albumImages.length}`,"onHook:mounted":s.logAlbumViewerMounted},null,8,["images","onHook:mounted"])):ne("",!0),b("pre",x9r," DEBUG ["+ae(n.instanceId)+`]:
+ showAlbumViewer: `+ae(i.showAlbumViewer)+`
+ albumImages Count: `+ae(i.albumImages.length)+`
+ albumImages: `+ae(JSON.stringify(i.albumImages))+`
+ `,1)],8,b9r)}const Ioe=st(y9r,[["render",E9r],["__scopeId","data-v-c4e36225"]]),Ky="/",w9r={name:"BindingEntry",components:{DynamicUIRenderer:Ioe},props:{binding:{type:Object,required:!0},selected:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1}},emits:["select","install","uninstall","reinstall","settings","reload-binding"],mounted(){this.updateIcons()},updated(){this.updateIcons()},methods:{updateIcons(){Fe(()=>{try{Re.replace({width:"1em",height:"1em"})}catch(t){console.error("Feather icons replacement failed:",t)}})},copyToClipBoard(t){if(!t){console.warn("Attempted to copy empty text.");return}navigator.clipboard?navigator.clipboard.writeText(t).then(()=>{console.log("Copied to clipboard:",t)}).catch(e=>{console.error("Failed to copy text using navigator.clipboard: ",e),this.fallbackCopyToClipboard(t)}):(console.warn("Clipboard API not available, attempting fallback."),this.fallbackCopyToClipboard(t))},fallbackCopyToClipboard(t){const e=document.createElement("textarea");e.value=t,e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?console.log("Fallback copy successful:",t):console.error("Fallback copy command failed.")}catch(n){console.error("Error during fallback copy command:",n)}document.body.removeChild(e)},getImgUrl(){return!this.binding||typeof this.binding.icon!="string"||this.binding.icon.trim()===""?Mh:/^(https?:)?\/\//.test(this.binding.icon)||this.binding.icon.startsWith("/")?this.binding.icon:(Ky.endsWith("/")?Ky:`${Ky}/`)+this.binding.icon},defaultImg(t){t.target.src!==Mh&&(t.target.src=Mh)},emitSelect(){this.isProcessing||this.$emit("select",this.binding)},emitInstall(){this.isProcessing||this.$emit("install",this.binding)},emitUninstall(){this.isProcessing||this.$emit("uninstall",this.binding)},emitReinstall(){this.isProcessing||this.$emit("reinstall",this.binding)},emitReloadBinding(){this.isProcessing||this.$emit("reload-binding",this.binding)},emitSettings(){this.isProcessing||this.$emit("settings",this.binding)}},watch:{selected(){this.updateIcons()},isProcessing(){this.updateIcons()},"binding.installed"(){this.updateIcons()},"binding.ui"(){this.updateIcons()}}},C9r=["title"],L9r={class:"flex flex-row items-center gap-3 mb-2"},$9r=["src"],A9r={class:"font-bold text-lg truncate text-slate-800 dark:text-slate-100 flex-grow"},k9r={key:0,class:"ml-2 text-xs font-medium text-green-600 dark:text-green-400"},P9r={key:1,class:"ml-2 text-xs font-medium text-yellow-600 dark:text-yellow-400"},R9r={class:"flex-none flex items-center gap-1"},M9r={class:"text-sm text-slate-600 dark:text-slate-400 space-y-1 mb-3"},D9r={class:"flex items-center"},N9r={class:"truncate"},I9r={class:"flex items-center"},H9r={class:"truncate font-mono text-xs bg-blue-100 dark:bg-slate-700 px-1 py-0.5 rounded"},V9r=["disabled"],q9r={class:"flex items-center"},U9r={class:"flex items-center"},B9r=["href"],z9r={class:"flex items-start pt-1"},X9r=["title","innerHTML"],F9r={class:"flex items-center justify-end gap-2 border-t border-blue-200 dark:border-slate-700 pt-3 min-h-[44px]"},j9r={key:0,class:"flex items-center justify-center text-slate-500 dark:text-slate-400 w-full"},Y9r=["disabled"],G9r=["disabled"],W9r=["disabled"],Z9r=["disabled"];function K9r(t,e,n,r,i,s){const o=Xe("DynamicUIRenderer");return k(),R("div",{class:ye(["items-start p-4 rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none transition-all duration-150 ease-in-out group",{"border-blue-400 dark:border-sky-500 bg-blue-100 dark:bg-slate-700":n.selected,"hover:bg-blue-50 dark:hover:bg-slate-700":!n.selected&&!n.isProcessing,"border-transparent bg-blue-50 dark:bg-slate-800 text-slate-800 dark:text-slate-200":!n.selected,"opacity-70 cursor-wait":n.isProcessing}]),title:n.binding.description||n.binding.name,onClick:e[8]||(e[8]=oe(a=>n.isProcessing?null:s.emitSelect(),["stop"]))},[b("div",null,[b("div",L9r,[b("img",{ref:"imgElement",src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),class:ye(["w-10 h-10 rounded-full object-fill flex-shrink-0 border border-blue-200 dark:border-slate-700",{"ring-2 ring-offset-2 ring-green-500 dark:ring-green-400 ring-offset-blue-50 dark:ring-offset-slate-800":n.binding.installed&&!n.isProcessing&&!n.selected,"ring-2 ring-offset-2 ring-green-500 dark:ring-green-400 ring-offset-blue-100 dark:ring-offset-slate-700":n.binding.installed&&!n.isProcessing&&n.selected,"ring-2 ring-offset-2 ring-yellow-500 dark:ring-yellow-400 ring-offset-blue-50 dark:ring-offset-slate-800 animate-pulse":n.isProcessing}])},null,42,$9r),b("h3",A9r,[Se(ae(n.binding.name)+" ",1),n.binding.installed&&!n.isProcessing?(k(),R("span",k9r,"(Installed)")):ne("",!0),n.isProcessing?(k(),R("span",P9r,"(Processing...)")):ne("",!0)]),b("div",R9r,[n.selected&&n.binding.installed&&!n.isProcessing?(k(),R("button",{key:0,type:"button",title:"Reload binding",onClick:e[1]||(e[1]=oe((...a)=>s.emitReloadBinding&&s.emitReloadBinding(...a),["stop"])),class:"svg-button text-slate-500 dark:text-slate-400 hover:text-blue-600 dark:hover:text-sky-400 hover:bg-transparent dark:hover:bg-transparent active:scale-90 focus:ring-blue-300 dark:focus:ring-slate-600"},e[9]||(e[9]=[b("i",{"data-feather":"refresh-cw",class:"w-5 h-5"},null,-1),b("span",{class:"sr-only"},"Reload Binding",-1)]))):ne("",!0)])]),n.binding.ui?(k(),Qt(o,{key:0,class:"w-full h-full mb-3 border-t pt-3 border-blue-200 dark:border-slate-700",code:n.binding.ui},null,8,["code"])):ne("",!0),b("div",M9r,[b("div",D9r,[e[10]||(e[10]=b("i",{"data-feather":"user",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[11]||(e[11]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Author:",-1)),b("span",N9r,ae(n.binding.author),1)]),b("div",I9r,[e[13]||(e[13]=b("i",{"data-feather":"folder",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[14]||(e[14]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Folder:",-1)),b("span",H9r,ae(n.binding.folder),1),e[15]||(e[15]=b("div",{class:"flex-grow"},null,-1)),b("button",{class:"ml-2 text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300 duration-150 active:scale-90 p-1 rounded disabled:opacity-50",title:"Copy folder path to clipboard",onClick:e[2]||(e[2]=oe(a=>s.copyToClipBoard(n.binding.folder),["stop"])),disabled:n.isProcessing},e[12]||(e[12]=[b("i",{"data-feather":"clipboard",class:"w-4 h-4"},null,-1),b("span",{class:"sr-only"},"Copy folder path",-1)]),8,V9r)]),b("div",q9r,[e[16]||(e[16]=b("i",{"data-feather":"git-merge",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[17]||(e[17]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Version:",-1)),b("span",null,ae(n.binding.version),1)]),b("div",U9r,[e[18]||(e[18]=b("i",{"data-feather":"github",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[19]||(e[19]=b("b",{class:"mr-1 font-medium text-slate-700 dark:text-slate-300"},"Link:",-1)),b("a",{href:n.binding.link,target:"_blank",rel:"noopener noreferrer",class:ye(["link truncate",{"pointer-events-none opacity-70":n.isProcessing}]),onClick:e[3]||(e[3]=oe(()=>{},["stop"]))},ae(n.binding.link),11,B9r)]),b("div",z9r,[e[21]||(e[21]=b("i",{"data-feather":"info",class:"w-4 h-4 mr-2 mt-0.5 flex-shrink-0"},null,-1)),b("div",null,[e[20]||(e[20]=b("b",{class:"font-medium text-slate-700 dark:text-slate-300"},"Description:",-1)),b("p",{class:"opacity-90 line-clamp-3",title:n.binding.description,innerHTML:n.binding.description},null,8,X9r)])])]),b("div",F9r,[n.isProcessing?(k(),R("div",j9r,e[22]||(e[22]=[b("div",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-current mr-2"},null,-1),Se(" Processing... ")]))):ne("",!0),n.isProcessing?ne("",!0):(k(),R(Ve,{key:1},[n.binding.installed?ne("",!0):(k(),R("button",{key:0,title:"Click to install",type:"button",onClick:e[4]||(e[4]=oe((...a)=>s.emitInstall&&s.emitInstall(...a),["stop"])),class:"btn btn-primary btn-sm",disabled:n.isProcessing},e[23]||(e[23]=[b("i",{"data-feather":"download-cloud",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Install",-1)]),8,Y9r)),n.binding.installed?(k(),R("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=oe((...a)=>s.emitReinstall&&s.emitReinstall(...a),["stop"])),class:"btn btn-success btn-sm",disabled:n.isProcessing},e[24]||(e[24]=[b("i",{"data-feather":"refresh-ccw",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Reinstall",-1)]),8,G9r)):ne("",!0),n.binding.installed?(k(),R("button",{key:2,title:"Click to Uninstall binding",type:"button",onClick:e[6]||(e[6]=oe((...a)=>s.emitUninstall&&s.emitUninstall(...a),["stop"])),class:"btn btn-sm bg-red-600 text-white hover:bg-red-700 focus:ring-4 focus:ring-red-300 dark:bg-red-500 dark:hover:bg-red-600 dark:focus:ring-red-800 disabled:opacity-50",disabled:n.isProcessing},e[25]||(e[25]=[b("i",{"data-feather":"trash-2",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Uninstall",-1)]),8,W9r)):ne("",!0),n.selected&&n.binding.installed?(k(),R("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[7]||(e[7]=oe((...a)=>s.emitSettings&&s.emitSettings(...a),["stop"])),class:"btn btn-secondary btn-sm",disabled:n.isProcessing},e[26]||(e[26]=[b("i",{"data-feather":"settings",class:"w-4 h-4 mr-1"},null,-1),b("span",null,"Settings",-1)]),8,Z9r)):ne("",!0)],64))])])],10,C9r)}const J9r=st(w9r,[["render",K9r],["__scopeId","data-v-779a3b12"]]),lY="/assets/logo-6TyToX4A.png",epr={name:"BindingZooSettings",components:{BindingEntry:J9r},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_get_req:{type:Function,required:!0},api_post_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],data(){return{bindings:[],isLoadingBindings:!1,isLoadingAction:!1,sortOption:"name",searchTerm:""}},computed:{effectiveConfig(){return this.$store.state.config||{}},hasPendingChanges(){return this.$store.state.settingsChanged},currentBindingInfo(){return!this.effectiveConfig.binding_name||this.bindings.length===0?null:this.bindings.find(t=>t.folder===this.effectiveConfig.binding_name)},sortedBindings(){if(!this.bindings)return[];let t=[...this.bindings];if(this.searchTerm){const e=this.searchTerm.toLowerCase();t=t.filter(n=>{var r,i,s;return((r=n.name)==null?void 0:r.toLowerCase().includes(e))||((i=n.author)==null?void 0:i.toLowerCase().includes(e))||((s=n.folder)==null?void 0:s.toLowerCase().includes(e))})}return t.sort((e,n)=>{const r=e.folder===this.effectiveConfig.binding_name,i=n.folder===this.effectiveConfig.binding_name;if(r&&!i)return-1;if(!r&&i)return 1;switch(this.sortOption){case"status":return e.installed&&!n.installed?-1:!e.installed&&n.installed?1:(e.name||"").localeCompare(n.name||"");case"author":return(e.author||"").localeCompare(n.author||"");case"name":default:return(e.name||"").localeCompare(n.name||"")}}),t}},watch:{"$store.state.bindingsZoo":{handler(t){t&&(this.bindings=(t||[]).map(e=>{var n;return{...e,isProcessing:((n=this.bindings.find(r=>r.folder===e.folder))==null?void 0:n.isProcessing)||!1}}),this.replaceFeatherIcons())},deep:!0,immediate:!0}},methods:{isBindingSelected(t){return t.folder===this.config.binding_name},getIconPath(t){return t?t.startsWith("http")?t:(t.startsWith("/")?t:`/${t}`).replace(/\\/g,"/"):lY},imgPlaceholder(t){t.target.src=lY},async fetchBindings(){this.isLoadingBindings=!0;try{const t=await this.api_get_req("list_bindings");this.bindings=(t||[]).map(e=>({...e,isProcessing:!1}))}catch{this.bindings=[]}finally{this.isLoadingBindings=!1,this.replaceFeatherIcons()}},setBindingProcessing(t,e){const n=this.bindings.findIndex(r=>r.folder===t);n!==-1&&(this.bindings[n].isProcessing=e)},handleSelect(t){if(!(t!=null&&t.installed)){this.show_toast(`Binding "${t.name}" is not installed.`,3,!1);return}this.config.binding_name!==t.folder&&(this.$emit("setting-updated",{key:"binding_name",value:t.folder}),this.store.dispatch("refreshModels"),this.show_toast(`Selected binding: ${t.name}. Apply changes.`,3,!0))},async handleInstall(t){let e=!0;if(t.disclaimer&&(e=await this.show_yes_no_dialog(`Disclaimer for ${t.name}:
${t.disclaimer}
-Proceed?`,"Proceed","Cancel")),!!e){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("install_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" installed! Reload recommended.`,5,!0),await this.fetchBindings()):this.show_toast(`Install failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},async handleUninstall(t){if(await this.show_yes_no_dialog(`Uninstall "${t.name}"?`,"Uninstall","Cancel")){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("uninstall_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" uninstalled.`,4,!0),await this.fetchBindings(),this.config.binding_name===t.folder&&(this.$emit("setting-updated",{key:"binding_name",value:null}),this.$emit("setting-updated",{key:"model_name",value:null}))):this.show_toast(`Uninstall failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},async handleReinstall(t){if(await this.show_yes_no_dialog(`Reinstall "${t.name}"?`,"Reinstall","Cancel")){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("reinstall_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" reinstalled! Reload recommended.`,5,!0),await this.fetchBindings()):this.show_toast(`Reinstall failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},handleSettingsFromEntry(t){this.handleSettings(t.folder)},handleReloadFromEntry(t){this.handleReload(t.folder)},async handleSettings(t){if(!t){this.show_toast("No binding specified.",3,!1);return}if(this.hasPendingChanges){this.show_toast("Apply settings changes first.",3,!1);return}const e=this.bindings.find(n=>n.folder===t);if(!(e!=null&&e.installed)){this.show_toast(`Binding "${(e==null?void 0:e.name)||t}" not installed.`,3,!1);return}if(t!==this.effectiveConfig.binding_name){this.show_toast(`Select and Apply "${e.name}" first.`,4,!1);return}this.isLoadingAction=!0;try{const n=await this.api_post_req("get_active_binding_settings");if(n&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Settings - ${e.name}`,"Save","Cancel");if(r!=null){const i=await this.api_post_req("set_active_binding_settings",{settings:r});i!=null&&i.status?(this.show_toast(`Settings updated for "${e.name}". Reloading...`,4,!0),await this.api_post_req("update_binding_settings"),this.show_toast(`Binding "${e.name}" reloaded.`,4,!0)):this.show_toast(`Update failed: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}else this.show_toast("Settings update cancelled.",3,!1)}else n?this.show_toast(`"${e.name}" has no settings.`,3,!1):this.show_toast("Could not get settings.",4,!1)}catch{}finally{this.isLoadingAction=!1,this.replaceFeatherIcons()}},async handleReload(t){if(!t){this.show_toast("No binding specified.",3,!1);return}if(this.hasPendingChanges){this.show_toast("Apply settings changes first.",3,!1);return}const e=this.bindings.find(n=>n.folder===t);if(!(e!=null&&e.installed)){this.show_toast(`Binding "${(e==null?void 0:e.name)||t}" not installed.`,3,!1);return}if(t!==this.effectiveConfig.binding_name){this.show_toast(`"${e.name}" is not the active binding.`,3,!1);return}this.isLoadingAction=!0,this.show_toast(`Reloading "${e.name}"...`,3,!0);try{const n=await this.api_post_req("reload_binding",{name:t});n!=null&&n.status?this.show_toast(`"${e.name}" reloaded.`,4,!0):this.show_toast(`Reload failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.isLoadingAction=!1,this.replaceFeatherIcons()}},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.fetchBindings(),this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},epr={class:"user-settings-panel space-y-6 p-4 md:p-6"},tpr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},npr={key:0,class:"flex items-center gap-2 text-sm font-medium p-2 bg-blue-100 dark:bg-blue-900/50 rounded-md border border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-200"},rpr=["src"],ipr={class:"font-semibold"},spr=["disabled"],opr=["disabled"],apr={key:1,class:"text-sm font-medium text-red-600 dark:text-red-400 p-2 bg-red-100 dark:bg-red-900/30 rounded-md border border-red-300 dark:border-red-600"},lpr={key:0,class:"p-3 bg-yellow-100 dark:bg-yellow-900/30 border border-yellow-300 dark:border-yellow-700 rounded-lg text-center text-sm text-yellow-700 dark:text-yellow-300"},cpr={class:"flex flex-col sm:flex-row gap-4 mb-4"},upr={class:"relative flex-grow"},dpr=["disabled"],fpr={class:"flex-shrink-0"},hpr=["disabled"],ppr={key:1,class:"flex justify-center items-center p-10"},Tpr={key:2,class:"text-center text-blue-500 dark:text-blue-400 py-10"},Opr={key:3,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 scrollbar"};function mpr(t,e,n,r,i,s){const o=Xe("BindingEntry");return k(),R("div",epr,[b("div",tpr,[e[8]||(e[8]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-200 mb-2 sm:mb-0"}," Binding Zoo ",-1)),s.currentBindingInfo?(k(),R("div",npr,[b("img",{src:s.getIconPath(s.currentBindingInfo.icon),onError:e[0]||(e[0]=(...a)=>s.imgPlaceholder&&s.imgPlaceholder(...a)),class:"w-6 h-6 rounded-full object-cover flex-shrink-0",alt:"Current Binding Icon"},null,40,rpr),b("span",null,[e[5]||(e[5]=Se("Active: ")),b("span",ipr,ae(s.currentBindingInfo.name),1)]),b("button",{onClick:e[1]||(e[1]=a=>s.handleSettings(s.effectiveConfig.binding_name)),disabled:i.isLoadingAction||n.loading||s.hasPendingChanges,class:"svg-button ml-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Configure Active Binding"},e[6]||(e[6]=[b("i",{"data-feather":"settings",class:"w-4 h-4"},null,-1)]),8,spr),b("button",{onClick:e[2]||(e[2]=a=>s.handleReload(s.effectiveConfig.binding_name)),disabled:i.isLoadingAction||n.loading||s.hasPendingChanges,class:"svg-button ml-1 disabled:opacity-50 disabled:cursor-not-allowed",title:"Reload Active Binding"},e[7]||(e[7]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4"},null,-1)]),8,opr)])):(k(),R("div",apr," No binding selected! "))]),e[14]||(e[14]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400"}," Bindings are the engines that run the AI models. Select an installed binding to enable model selection and generation. ",-1)),s.hasPendingChanges?(k(),R("div",lpr,e[9]||(e[9]=[b("i",{"data-feather":"alert-circle",class:"inline-block w-4 h-4 mr-1 align-middle"},null,-1),Se(" Apply main settings changes to use binding actions (settings, reload). ")]))):ne("",!0),b("div",cpr,[b("div",upr,[e[10]||(e[10]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[3]||(e[3]=a=>i.searchTerm=a),placeholder:"Search bindings...",class:"input search-input pl-10 w-full","aria-label":"Search bindings",disabled:i.isLoadingBindings||n.loading},null,8,dpr),[[vt,i.searchTerm]])]),b("div",fpr,[e[12]||(e[12]=b("label",{for:"binding-sort",class:"sr-only"},"Sort bindings by",-1)),He(b("select",{id:"binding-sort","onUpdate:modelValue":e[4]||(e[4]=a=>i.sortOption=a),class:"input w-full sm:w-auto","aria-label":"Sort bindings by",disabled:i.isLoadingBindings||n.loading},e[11]||(e[11]=[b("option",{value:"name"},"Sort by Name",-1),b("option",{value:"author"},"Sort by Author",-1),b("option",{value:"status"},"Sort by Status",-1)]),8,hpr),[[$s,i.sortOption]])])]),i.isLoadingBindings?(k(),R("div",ppr,e[13]||(e[13]=[b("svg",{"aria-hidden":"true",role:"status",class:"w-8 h-8 text-blue-300 animate-spin dark:text-blue-600 fill-blue-600 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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),b("span",{class:"ml-2 text-loading"},"Loading bindings...",-1)]))):s.sortedBindings.length===0?(k(),R("div",Tpr," No bindings found"+ae(i.searchTerm?' matching "'+i.searchTerm+'"':"")+". ",1)):(k(),R("div",Opr,[(k(!0),R(Ve,null,dt(s.sortedBindings,a=>(k(),Qt(o,{key:a.folder,binding:a,selected:s.isBindingSelected(a),"is-processing":a.isProcessing,onSelect:s.handleSelect,onInstall:s.handleInstall,onUninstall:s.handleUninstall,onReinstall:s.handleReinstall,onSettings:s.handleSettingsFromEntry,onReloadBinding:s.handleReloadFromEntry},null,8,["binding","selected","is-processing","onSelect","onInstall","onUninstall","onReinstall","onSettings","onReloadBinding"]))),128))]))])}const gpr=st(J9r,[["render",mpr],["__scopeId","data-v-8f5fcfca"]]),F9="/assets/logo-6TyToX4A.png",Qpr={name:"InteractiveMenu",props:{title:{type:String,required:!1,default:"Menu"},icon:{type:String,required:!1,default:"feather:more-vertical"},commands:{type:Array,required:!0,default:()=>[]},force_position:{type:Number,required:!1,default:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,required:!1,default:null}},data(){return{isMenuOpen:!1,menuStyle:{top:"auto",bottom:"auto",left:"auto",right:"auto",transformOrigin:"top left"}}},methods:{updateFeatherIcons(){Fe(()=>{Re.replace({width:"1em",height:"1em","stroke-width":2})})},handleClickOutside(t){this.$refs.menuContainerRef&&!this.$refs.menuContainerRef.contains(t.target)&&this.closeMenu()},toggleMenu(){this.isMenuOpen?this.closeMenu():this.openMenu()},openMenu(){this.isMenuOpen=!0,Fe(()=>{this.positionMenu(),this.updateFeatherIcons(),document.addEventListener("click",this.handleClickOutside,!0)})},closeMenu(){this.isMenuOpen=!1,document.removeEventListener("click",this.handleClickOutside,!0)},executeCommand(t){this.closeMenu(),typeof t.value=="function"?t.value():this.execute_cmd?this.execute_cmd(t):console.warn("InteractiveMenu: No action defined for command:",t.name)},positionMenu(){if(!this.isMenuOpen||!this.$refs.menuButtonRef||!this.$refs.menuRef)return;const t=this.$refs.menuButtonRef.getBoundingClientRect(),e=this.$refs.menuRef,n=e.style.visibility,r=e.style.display,i=e.style.position,s=e.style.top,o=e.style.left;e.style.visibility="hidden",e.style.position="fixed",e.style.top="-9999px",e.style.left="-9999px",e.style.display="block";const a=e.getBoundingClientRect();e.style.visibility=n,e.style.position=i,e.style.top=s,e.style.left=o,e.style.display=r;const l=window.innerWidth,c=window.innerHeight,u=8;let d={top:"auto",bottom:"auto",left:"auto",right:"auto",transformOrigin:""};const f=c-t.bottom-u,h=t.top-u,p=a.height;let T="below";this.force_position===1?T="above":this.force_position===2||f>=p?T="below":h>=p?T="above":T=h>f?"above":"below",T==="above"?(d.bottom="calc(100% + 4px)",d.top="auto",d.transformOrigin="bottom "):(d.top="calc(100% + 4px)",d.bottom="auto",d.transformOrigin="top "),l-t.left-u,t.right-u;const m=a.width;let O="left-align";this.force_position===3?O="right-align":this.force_position===4?O="left-align":t.left+m>l-u&&t.right-m>u&&(O="right-align"),O==="right-align"?(d.right="0px",d.left="auto",d.transformOrigin+="right"):(d.left="0px",d.right="auto",d.transformOrigin+="left"),this.menuStyle=d}},mounted(){window.addEventListener("resize",this.positionMenu),this.updateFeatherIcons()},beforeUnmount(){window.removeEventListener("resize",this.positionMenu),document.removeEventListener("click",this.handleClickOutside,!0)}},_pr={class:"interactive-menu-container",ref:"menuContainerRef"},vpr=["title"],ypr=["src"],bpr=["data-feather"],Spr={key:2,class:"interactive-menu-trigger-text"},xpr={key:3,"data-feather":"menu",class:"interactive-menu-trigger-icon"},Epr=["aria-labelledby"],wpr={class:"interactive-menu-list",role:"none"},Cpr=["onClick","id"],Lpr={class:"interactive-menu-item-checkmark-placeholder"},$pr={key:0,"data-feather":"check",class:"interactive-menu-item-checkmark-icon"},Apr={class:"interactive-menu-item-icon-container"},kpr=["src","alt"],Ppr=["data-feather"],Rpr={key:2,class:"interactive-menu-item-icon-text"},Mpr={key:3,class:"interactive-menu-item-icon-placeholder"},Dpr={class:"interactive-menu-item-name"};function Npr(t,e,n,r,i,s){return k(),R("div",_pr,[b("button",{onClick:e[0]||(e[0]=oe((...o)=>s.toggleMenu&&s.toggleMenu(...o),["prevent"])),title:n.title||"Open Menu",class:ye(["interactive-menu-trigger",n.menuIconClass]),ref:"menuButtonRef",type:"button"},[er(t.$slots,"trigger",{},()=>[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather:")?(k(),R("img",{key:0,src:n.icon,class:"interactive-menu-trigger-icon",alt:"Menu Icon"},null,8,ypr)):n.icon&&n.icon.includes("feather:")?(k(),R("i",{key:1,"data-feather":n.icon.split(":")[1],class:"interactive-menu-trigger-icon"},null,8,bpr)):n.icon&&n.icon.includes("#")?(k(),R("span",Spr,ae(n.icon.split("#")[1]),1)):(k(),R("i",xpr))],!0)],10,vpr),te(cr,{name:"interactive-menu-transition"},{default:Ie(()=>[i.isMenuOpen?(k(),R("div",{key:0,class:"interactive-menu-dropdown",style:qn(i.menuStyle),ref:"menuRef",role:"menu","aria-orientation":"vertical","aria-labelledby":`menu-button-${t._uid}`},[b("ul",wpr,[(k(!0),R(Ve,null,dt(n.commands,(o,a)=>(k(),R("li",{key:a,onClick:oe(l=>s.executeCommand(o),["prevent"]),class:"interactive-menu-item group",role:"menuitem",tabindex:-1,id:`menu-item-${t._uid}-${a}`},[b("span",Lpr,[n.selected_entry===o.name?(k(),R("i",$pr)):ne("",!0)]),b("span",Apr,[o.icon&&!o.icon.includes("#")&&!o.icon.includes("feather:")?(k(),R("img",{key:0,src:o.icon,alt:o.name,class:"interactive-menu-item-icon"},null,8,kpr)):o.icon&&o.icon.includes("feather:")?(k(),R("i",{key:1,"data-feather":o.icon.split(":")[1],class:"interactive-menu-item-icon"},null,8,Ppr)):o.icon&&o.icon.includes("#")?(k(),R("span",Rpr,ae(o.icon.split("#")[1]),1)):(k(),R("span",Mpr))]),b("span",Dpr,ae(o.name),1)],8,Cpr))),128))])],12,Epr)):ne("",!0)]),_:1})],512)}const KC=st(Qpr,[["render",Npr],["__scopeId","data-v-e42afcb4"]]),Ipr={name:"ModelEntry",components:{InteractiveMenu:KC},props:{model:{type:Object,required:!0},isSelected:{type:Boolean,default:!1},isInstalled:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1},progress:{type:Number,default:0},speed:{type:Number,default:0},total_size:{type:Number,default:0},downloaded_size:{type:Number,default:0},progressName:{type:String,default:"Processing..."}},emits:["select","install","uninstall","cancel-install","copy","copy-link"],data(){return{failedToLoad:!1,linkNotValid:!!this.model.error}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})},methods:{formatDate(t){if(!t)return"N/A";try{const e=new Date(t);return isNaN(e.getTime())?"Invalid Date":e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(e){return console.error("Error formatting date:",e),"Invalid Date"}},formatFileSize(t){return O4(t)},getImgUrl(){return this.model.icon||F9},defaultImg(t){this.failedToLoad=!0,t.target.src=F9},handleClick(){if(this.isProcessing||!this.isInstalled||this.isSelected){console.log(`Click ignored: processing=${this.isProcessing}, installed=${this.isInstalled}, selected=${this.isSelected}`);return}console.log("Emitting select event for:",this.model.name),this.$emit("select",this.model)},handleInstallClick(){this.isProcessing||(console.log("Emitting install event for:",this.model.name),this.$emit("install",{model:this.model}))},handleUninstallClick(){this.isProcessing||!this.isInstalled||(console.log("Emitting uninstall event for:",this.model.name),this.$emit("uninstall",{model:this.model}))},handleCancelClick(){console.log("Emitting cancel-install event for:",this.model.name),this.$emit("cancel-install",{model:this.model})},handleCopyClick(){this.$emit("copy",{model:this.model})},handleCopyLinkClick(){this.$emit("copy-link",{model:this.model})},checkLinkValidity(){this.linkNotValid=!!this.model.error}},computed:{computedClasses(){const t=[];return this.isProcessing?t.push("opacity-70 pointer-events-none"):this.isSelected&&this.isInstalled?(t.push("border-[3px] border-blue-500 dark:border-blue-400 ring-2 ring-blue-300 dark:ring-blue-600 ring-offset-1 dark:ring-offset-gray-800"),t.push("bg-blue-50 dark:bg-blue-900/50"),t.push("cursor-default")):this.isInstalled&&!this.isSelected?(t.push("border-gray-200 dark:border-gray-700"),t.push("hover:border-blue-400 dark:hover:border-blue-600"),t.push("hover:bg-blue-50/50 dark:hover:bg-blue-900/20"),t.push("cursor-pointer")):this.isInstalled||(t.push("border-dashed border-gray-300 dark:border-gray-600"),t.push("opacity-80")),this.linkNotValid&&!this.isProcessing&&t.push("border-l-4 border-l-red-500"),t.join(" ")},isDisabled(){return this.isProcessing||!this.isInstalled},commandsList(){let t=[];return this.isInstalled?(t.push({name:"Uninstall",icon:"feather:trash-2",value:this.handleUninstallClick,disabled:this.isProcessing}),this.isSelected&&t.push({name:"Reload",icon:"feather:refresh-cw",value:this.handleClick,disabled:this.isProcessing})):t.push({name:"Install",icon:"feather:download",value:this.handleInstallClick,disabled:this.isProcessing||this.linkNotValid}),t.push({name:"Copy Info",icon:"feather:copy",value:this.handleCopyClick}),this.model.isCustomModel||t.push({name:"Copy Link",icon:"feather:clipboard",value:this.handleCopyLinkClick}),t},fileSize(){var n,r,i;const t=(r=(n=this.model)==null?void 0:n.variants)==null?void 0:r[0],e=(t==null?void 0:t.size)??((i=this.model)==null?void 0:i.size);return e?this.formatFileSize(e):"N/A"},speed_computed(){return this.formatFileSize(this.speed)+"/s"},total_size_computed(){return this.formatFileSize(this.total_size)},downloaded_size_computed(){return this.formatFileSize(this.downloaded_size)}},watch:{isProcessing(t,e){console.log(`Model ${this.model.name} processing state changed to: ${t}`),Fe(()=>{Re.replace()})},"model.error":function(t){this.linkNotValid=!!t}}},Hpr=["title","aria-pressed","aria-disabled"],Vpr={key:0},qpr={class:"flex flex-row"},Upr={class:"max-w-[300px] overflow-x-auto"},Bpr={class:"flex gap-3 items-center grow"},zpr=["src"],Xpr={class:"flex-1 overflow-hidden"},Fpr={class:"font-bold font-large text-lg truncate"},jpr={class:"flex items-center flex-row gap-2 my-1 mt-3"},Ypr=["disabled"],Gpr={key:1},Wpr={class:"flex flex-row items-center gap-3 mb-2"},Zpr=["src"],Kpr={class:"font-bold font-large text-lg truncate flex-grow"},Jpr={class:"flex items-center",title:"Hugging Face Model Card"},eTr=["href"],tTr={class:"flex items-center",title:"Approximate File Size"},nTr={class:"flex items-center",title:"Model License"},rTr={key:0,class:"flex items-center",title:"Quantizer Profile"},iTr=["href"],sTr={key:1,class:"flex items-center",title:"Original Model Creator Profile"},oTr=["href"],aTr={key:2,class:"flex items-center",title:"Last Update Date"},lTr={key:3,class:"flex items-center",title:"Model Category"},cTr={key:4,class:"flex items-center",title:"Hugging Face Rank (May be outdated)"},uTr={key:2,class:"absolute z-10 inset-0 -m-px p-4 shadow-md text-center rounded-lg bg-white/80 dark:bg-gray-800/80 flex justify-center items-center backdrop-blur-sm"},dTr={class:"relative flex flex-col items-center justify-center w-full h-full"},fTr={class:"absolute bottom-2 left-2 right-2 w-auto bg-white/70 dark:bg-gray-800/70 rounded-lg p-2 backdrop-blur-sm"},hTr={class:"flex justify-between mb-1 text-xs"},pTr={class:"font-medium text-blue-700 dark:text-blue-300"},TTr={key:0,class:"font-medium text-blue-700 dark:text-blue-300"},OTr={key:0,class:"w-full bg-gray-200 rounded-full h-1.5 dark:bg-gray-700 mb-1"},mTr={key:1,class:"flex justify-between text-xs text-blue-600 dark:text-blue-400"};function gTr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["relative items-start p-4 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-lg mb-2 shadow-lg border-2 select-none transition-colors duration-150",s.computedClasses]),title:n.model.name,role:"button",tabindex:"0","aria-pressed":n.isSelected,"aria-disabled":s.isDisabled,onClick:e[9]||(e[9]=oe((...a)=>s.handleClick&&s.handleClick(...a),["prevent"])),onKeydown:[e[10]||(e[10]=gr((...a)=>s.handleClick&&s.handleClick(...a),["enter"])),e[11]||(e[11]=gr(oe((...a)=>s.handleClick&&s.handleClick(...a),["prevent"]),["space"]))]},[n.model.isCustomModel?(k(),R("div",Vpr,[b("div",qpr,[b("div",Upr,[b("div",Bpr,[b("img",{src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),class:"w-10 h-10 rounded-lg object-cover flex-shrink-0"},null,40,zpr),b("div",Xpr,[b("h3",Fpr,ae(n.model.name),1)])])])]),b("div",jpr,[e[13]||(e[13]=b("div",{class:"flex grow items-center text-sm text-gray-600 dark:text-gray-400"},[b("i",{"data-feather":"hard-drive",class:"w-4 h-4 mr-1"}),Se(" Local Reference ")],-1)),b("div",null,[n.isInstalled?(k(),R("button",{key:0,title:"Remove Reference (Doesn't delete file)",type:"button",onClick:e[1]||(e[1]=oe((...a)=>s.handleUninstallClick&&s.handleUninstallClick(...a),["stop"])),disabled:n.isProcessing,class:"button-danger-sm"},e[12]||(e[12]=[b("i",{"data-feather":"trash-2",class:"w-4 h-4 mr-1"},null,-1),Se(" Remove ")]),8,Ypr)):ne("",!0)])])])):ne("",!0),n.model.isCustomModel?ne("",!0):(k(),R("div",Gpr,[b("div",Wpr,[b("img",{ref:"imgElement",src:s.getImgUrl(),onError:e[2]||(e[2]=a=>s.defaultImg(a)),class:ye(["w-10 h-10 rounded-lg object-cover flex-shrink-0",{grayscale:i.linkNotValid}])},null,42,Zpr),b("h3",Kpr,ae(n.model.name),1),te(o,{commands:s.commandsList,force_position:2,title:"Menu",onClick:e[3]||(e[3]=oe(()=>{},["stop"]))},null,8,["commands"])]),b("div",{class:ye(["space-y-1 text-sm text-gray-700 dark:text-gray-300",{"opacity-60":i.linkNotValid}])},[b("div",Jpr,[e[14]||(e[14]=b("i",{"data-feather":"link",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[15]||(e[15]=b("b",{class:"mr-1 flex-shrink-0"},"Card:",-1)),b("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[4]||(e[4]=oe(()=>{},["stop"])),class:ye(["truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline",{"text-red-500 pointer-events-none":i.linkNotValid}])},ae(i.linkNotValid?"Link Invalid":`${n.model.quantizer}/${n.model.name}`),11,eTr)]),b("div",tTr,[e[16]||(e[16]=b("i",{"data-feather":"file",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[17]||(e[17]=b("b",{class:"mr-1"},"Size:",-1)),b("span",null,ae(s.fileSize||"N/A"),1)]),b("div",nTr,[e[18]||(e[18]=b("i",{"data-feather":"key",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[19]||(e[19]=b("b",{class:"mr-1"},"License:",-1)),b("span",null,ae(n.model.license||"N/A"),1)]),n.model.quantizer&&n.model.quantizer!=="None"&&n.model.type!=="transformers"?(k(),R("div",rTr,[e[20]||(e[20]=b("i",{"data-feather":"user",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[21]||(e[21]=b("b",{class:"mr-1"},"Quantizer:",-1)),b("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[5]||(e[5]=oe(()=>{},["stop"])),class:"truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.quantizer),9,iTr)])):ne("",!0),n.model.model_creator?(k(),R("div",sTr,[e[22]||(e[22]=b("i",{"data-feather":"users",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[23]||(e[23]=b("b",{class:"mr-1"},"Creator:",-1)),b("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[6]||(e[6]=oe(()=>{},["stop"])),class:"truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.model_creator),9,oTr)])):ne("",!0),n.model.last_commit_time?(k(),R("div",aTr,[e[24]||(e[24]=b("i",{"data-feather":"clock",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[25]||(e[25]=b("b",{class:"mr-1"},"Updated:",-1)),b("span",null,ae(s.formatDate(n.model.last_commit_time)),1)])):ne("",!0),n.model.category?(k(),R("div",lTr,[e[26]||(e[26]=b("i",{"data-feather":"grid",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[27]||(e[27]=b("b",{class:"mr-1"},"Category:",-1)),b("span",null,ae(n.model.category),1)])):ne("",!0),n.model.rank?(k(),R("div",cTr,[e[28]||(e[28]=b("i",{"data-feather":"bar-chart-2",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[29]||(e[29]=b("b",{class:"mr-1"},"Rank:",-1)),b("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=oe(()=>{},["stop"])),class:"hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.rank),1)])):ne("",!0)],2)])),n.isProcessing?(k(),R("div",uTr,[b("div",dTr,[e[30]||(e[30]=b("div",{role:"status",class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"},[b("svg",{"aria-hidden":"true",class:"w-16 h-16 text-gray-300 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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"})]),b("span",{class:"sr-only"},"Processing...")],-1)),b("div",fTr,[b("div",hTr,[b("span",pTr,ae(n.progressName),1),n.progress>0?(k(),R("span",TTr,ae(Math.floor(n.progress))+"%",1)):ne("",!0)]),n.progress>0?(k(),R("div",OTr,[b("div",{class:"bg-blue-600 h-1.5 rounded-full",style:qn({width:n.progress+"%"})},null,4)])):ne("",!0),n.progress>0&&n.total_size>0?(k(),R("div",mTr,[b("span",null,ae(s.downloaded_size_computed)+"/"+ae(s.total_size_computed),1),b("span",null,ae(s.speed_computed)+"/s",1)])):ne("",!0),b("button",{onClick:e[8]||(e[8]=oe((...a)=>s.handleCancelClick&&s.handleCancelClick(...a),["stop"])),type:"button",title:"Cancel Operation",class:"button-danger-sm w-full mt-2 text-xs"}," Cancel ")])])])):ne("",!0)],42,Hpr)}const QTr=st(Ipr,[["render",gTr],["__scopeId","data-v-f3f315d6"]]),_Tr={props:{show:{type:Boolean,default:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){const e=["bytes","KB","MB","GB"];let n=0;for(;t>=1024&&n[n.show?(k(),R("div",vTr,[b("div",yTr,[b("h2",bTr,[e[5]||(e[5]=b("svg",{class:"w-6 h-6 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})],-1)),Se(" "+ae(n.title),1)]),b("div",STr,[b("ul",null,[(k(!0),R(Ve,null,dt(n.choices,(o,a)=>(k(),R("li",{key:a,class:"py-2 px-4 hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-150 ease-in-out"},[b("div",xTr,[b("div",ETr,[o.isEditing?He((k(),R("input",{key:1,"onUpdate:modelValue":l=>o.editName=l,onBlur:l=>s.finishEditing(o),onKeyup:gr(l=>s.finishEditing(o),["enter"]),class:"bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-sm",autofocus:""},null,40,CTr)),[[vt,o.editName]]):(k(),R("span",{key:0,onClick:l=>s.selectChoice(o),class:ye([{"font-semibold":o===i.selectedChoice},"text-gray-800 dark:text-white cursor-pointer"])},ae(s.displayName(o)),11,wTr)),o.size?(k(),R("span",LTr,ae(s.formatSize(o.size)),1)):ne("",!0)]),b("div",$Tr,[b("button",{onClick:l=>s.editChoice(o),class:"text-blue-500 hover:text-blue-600 mr-2"},e[6]||(e[6]=[b("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)]),8,ATr),n.can_remove?(k(),R("button",{key:0,onClick:l=>s.removeChoice(o,a),class:"text-red-500 hover:text-red-600"},e[7]||(e[7]=[b("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,kTr)):ne("",!0)])])]))),128))])]),i.showInput?(k(),R("div",PTr,[He(b("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 dark:border-gray-600 p-2 rounded-lg w-full mb-2 bg-white dark:bg-gray-700 text-gray-800 dark:text-white"},null,512),[[vt,i.newFilename]]),b("button",{onClick:e[1]||(e[1]=(...o)=>s.addNewFilename&&s.addNewFilename(...o)),class:"bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add ")])):ne("",!0),b("div",RTr,[b("button",{onClick:e[2]||(e[2]=(...o)=>s.closeDialog&&s.closeDialog(...o)),class:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-lg transition duration-300"}," Cancel "),b("button",{onClick:e[3]||(e[3]=(...o)=>s.validateChoice&&s.validateChoice(...o)),disabled:!i.selectedChoice,class:ye([{"bg-blue-500 hover:bg-blue-600":i.selectedChoice,"bg-gray-400 cursor-not-allowed":!i.selectedChoice},"text-white font-bold py-2 px-4 rounded-lg transition duration-300"])}," Validate ",10,MTr),b("button",{onClick:e[4]||(e[4]=(...o)=>s.toggleInput&&s.toggleInput(...o)),class:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add New ")])])])):ne("",!0)]),_:1})}const Hoe=st(_Tr,[["render",DTr],["__scopeId","data-v-f43216be"]]),NTr={name:"ModelsZooSettings",components:{ModelEntry:QTr,ChoiceDialog:Hoe},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],data(){return{allModels:[],filteredModels:[],pagedModels:[],isLoadingModels:!1,isSearching:!1,searchTerm:"",sortOption:"rank",showInstalledOnly:!1,referencePath:"",modelUrl:"",isDownloading:!1,itemsPerPage:15,currentPage:1,searchDebounceTimer:null,downloadProgress:{visible:!1,name:"",progress:0,speed:0,total_size:0,downloaded_size:0,details:null},variantSelectionDialog:{visible:!1,title:"Select Model Variant",choices:[],modelToInstall:null,selectedVariant:null},defaultIcon:F9,store:aW()}},computed:{effectiveConfig(){return this.store.state.config||{}},storeModelsZoo(){return this.store.state.modelsZoo||[]},storeInstalledModelsArr(){return this.store.state.modelsArr||[]},storeBindingsZoo(){return this.store.state.bindingsZoo||[]},currentBindingNameComputed(){const t=this.effectiveConfig.binding_name;if(!t)return"None Selected";const e=this.storeBindingsZoo.find(n=>n.folder===t);return e?e.name:t},currentModelInfoComputed(){const t=this.effectiveConfig.model_name;if(!t||this.allModels.length===0)return null;const e=this.allModels.find(n=>n.name===t);return e?{name:e.name,icon:e.icon||this.defaultIcon}:null},hasMoreModelsToLoad(){return this.pagedModels.length{this.loadMoreModels()})),this.isDownloading||(this.isLoadingModels=!1)}},watchSources:{handler(t,e){(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2])&&(this.currentPage=1,this.pagedModels=[],this.applyFiltersAndSort(),this.$nextTick(()=>{this.loadMoreModels()}))}}},methods:{createModelId(t){return t.name||t.path||`${t.author||"unknown"}-${Date.now()}`},processAndCombineModels(){var o;if(!this.effectiveConfig.binding_name){this.allModels=[],this.isLoadingModels=!1;return}this.isLoadingModels=!0;const t=this.storeModelsZoo||[],e=this.storeInstalledModelsArr||[],n=new Set(e),r=(o=this.downloadProgress.details)==null?void 0:o.model_id,i=t.map(a=>{const l=this.createModelId(a),c=n.has(a.name)||a.variants&&a.variants.some(u=>n.has(u.name));return{name:a.name,author:a.author,rank:a.rank??9999,quantizer:a.quantizer,description:a.description,license:a.license,last_commit_time:a.last_commit_time,variants:a.variants?[...a.variants]:[],filename:a.filename,path:a.path,type:a.type,icon:a.icon||this.defaultIcon,id:l,isInstalled:c,isProcessing:r===l&&this.isDownloading||!1,isCustomModel:!1}}),s=new Set(i.map(a=>a.name));i.forEach(a=>{a.variants&&a.variants.forEach(l=>s.add(l.name))}),e.forEach(a=>{if(!s.has(a)){const l=this.createModelId({name:a});i.push({name:a,author:"Local/Custom",rank:-1,quantizer:"",description:"Locally installed model reference.",license:"",last_commit_time:"",variants:[],filename:"",path:"",type:"",icon:this.defaultIcon,id:l,isInstalled:!0,isProcessing:r===l&&this.isDownloading||!1,isCustomModel:!0})}}),this.allModels=i},applyFiltersAndSort(){this.isSearching=!0;let t=[...this.allModels];if(this.showInstalledOnly&&(t=t.filter(n=>n.isInstalled)),this.searchTerm){const n=this.searchTerm.toLowerCase();t=t.filter(r=>{var i,s,o,a,l;return((i=r.name)==null?void 0:i.toLowerCase().includes(n))||((s=r.author)==null?void 0:s.toLowerCase().includes(n))||((o=r.quantizer)==null?void 0:o.toLowerCase().includes(n))||((a=r.description)==null?void 0:a.toLowerCase().includes(n))||((l=r.license)==null?void 0:l.toLowerCase().includes(n))})}t.sort((n,r)=>r.isInstalled-n.isInstalled);const e=this.sortOption;t.sort((n,r)=>{const i=r.isInstalled-n.isInstalled;if(i!==0)return i;switch(e){case"rank":const s=n.rank??9999,o=r.rank??9999;return s-o;case"name":return(n.name||"").localeCompare(r.name||"");case"last_commit_time":const a=n.last_commit_time||"0";return(r.last_commit_time||"0").localeCompare(a);case"quantizer":return(n.quantizer||"").localeCompare(r.quantizer||"");case"license":return(n.license||"").localeCompare(r.license||"");default:return 0}}),this.filteredModels=t,this.isSearching=!1},debounceSearch(){this.isSearching=!0,clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(()=>{},300)},loadMoreModels(){if(this.isLoadingModels||this.isSearching)return;const t=(this.currentPage-1)*this.itemsPerPage,e=t+this.itemsPerPage,n=this.filteredModels.slice(t,e);n.length>0&&(this.pagedModels.push(...n),this.currentPage++),this.replaceFeatherIcons()},handleSelect(t){console.log("payload:"),console.log(t);const e=t;if(this.isDownloading||this.isLoadingModels){this.show_toast("Wait for current operation to finish.",3,!1);return}if(!e.isInstalled){this.show_toast(`Model "${e.name}" is not installed. Please install it first.`,3,!1);return}this.config.model_name!==e.name&&(this.$emit("setting-updated",{key:"model_name",value:e.name}),this.show_toast(`Selected model: ${e.name}. Remember to apply changes.`,3,!0))},async handleInstall(t){const e=t.model;if(this.isDownloading){this.show_toast("Another operation is already in progress.",3,!1);return}if(!this.effectiveConfig.binding_name){this.show_toast("No binding selected.",4,!1);return}e.variants&&e.variants.length>0?this.variantSelectionDialog={visible:!0,title:`Select Variant for ${e.name}`,choices:e.variants.map(r=>({id:r.name,text:`${r.name} (${O4(r.size||0)})`})),modelToInstall:e,selectedVariant:null}:await this.show_yes_no_dialog(`Install model "${e.name}"?`,"Install","Cancel")&&this.startDownload(e,e.path||e.name)},handleVariantSelected(t){this.variantSelectionDialog.selectedVariant=t},async handleVariantValidated(t){if(!this.variantSelectionDialog.modelToInstall||!t){this.closeVariantDialog();return}const e=this.variantSelectionDialog.modelToInstall.variants.find(i=>i.name===t.id),n=this.variantSelectionDialog.modelToInstall;this.closeVariantDialog(),await this.show_yes_no_dialog(`Install variant "${t.id}" for model "${n.name}"?`,"Install","Cancel")&&this.startDownload(n,e.path||t.id,t.id)},closeVariantDialog(){this.variantSelectionDialog={visible:!1,title:"Select Model Variant",choices:[],modelToInstall:null,selectedVariant:null}},startDownload(t,e,n=null){const r=t.id||this.createModelId(t),i=n||t.name;this.setModelProcessing(r,!0),this.isDownloading=!0,this.isLoadingModels=!0,this.downloadProgress={visible:!0,name:`Installing ${i}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:r,model_name:i,path:e,binding:this.effectiveConfig.binding_name,client_id:this.client_id}},et.emit("install_model",{model_path:e,binding:this.effectiveConfig.binding_name,client_id:this.client_id,model_id:r,model_name:i})},async handleUninstall(t){const e=t.model,n=e.id||this.createModelId(e);if(this.isDownloading){this.show_toast("Another operation is in progress. Please wait.",3,!1);return}if(!await this.show_yes_no_dialog(`Are you sure you want to uninstall the model "${e.name}"?`,"Uninstall","Cancel"))return;const i=this.effectiveConfig.binding_name;if(!i){this.show_toast("No binding selected. Cannot uninstall.",4,!1);return}this.setModelProcessing(n,!0),this.isDownloading=!0,this.isLoadingModels=!0,this.downloadProgress={visible:!0,name:`Uninstalling ${e.name}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:n,model_name:e.name}},et.emit("uninstall_model",{model_name:e.name,binding:i,client_id:this.client_id,model_id:n})},handleCancelInstall(t){if(!t||!this.isDownloading)return;const e={model_id:t.model_id,model_path:t.path,binding:t.binding,client_id:this.client_id};et.emit("cancel_install",e),this.show_toast(`Cancellation request sent for ${t.model_name}.`,3,!0)},handleCopy(t){navigator.clipboard.writeText(t.text).then(()=>{this.show_toast("Copied to clipboard!",2,!0)}).catch(e=>{this.show_toast("Failed to copy text.",4,!1)})},handleCopyLink(t){navigator.clipboard.writeText(t.link).then(()=>{this.show_toast("Model link copied!",2,!0)}).catch(e=>{this.show_toast("Failed to copy link.",4,!1)})},async createReference(){if(!this.referencePath){this.show_toast("Please enter a valid file or folder path.",3,!1);return}const t=this.effectiveConfig.binding_name;if(!t){this.show_toast("No binding selected. Cannot add reference.",4,!1);return}try{this.isLoadingModels=!0;const e=await this.api_post_req("add_reference",{binding:t,path:this.referencePath,client_id:this.client_id});e&&e.status==="success"?(this.show_toast(e.message||"Reference added successfully.",2,!0),this.referencePath="",this.store.dispatch("refreshModels")):this.show_toast(e.error||"Failed to add reference.",4,!1)}catch(e){this.show_toast(`Error adding reference: ${e.message||e}`,4,!1)}finally{this.isLoadingModels=!1}},installFromInput(){if(!this.modelUrl){this.show_toast("Please enter a Model URL or Hugging Face ID.",3,!1);return}if(this.isDownloading){this.show_toast("Another operation is already in progress.",3,!1);return}const t=this.effectiveConfig.binding_name;if(!t){this.show_toast("No binding selected. Cannot download.",4,!1);return}const e=this.modelUrl.split("/").pop()||this.modelUrl,n=`download-${e}-${Date.now()}`;this.isDownloading=!0,this.isLoadingModels=!0,this.setModelProcessing(n,!0),this.downloadProgress={visible:!0,name:`Initiating install for ${e}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:n,model_name:e,path:this.modelUrl,binding:t,client_id:this.client_id}},et.emit("install_model",{model_path:this.modelUrl,binding:t,client_id:this.client_id,model_id:n,model_name:e}),this.modelUrl=""},imgPlaceholder(t){t.target.src=this.defaultIcon},setModelProcessing(t,e){const n=this.allModels.findIndex(i=>i.id===t);if(n!==-1){const i={...this.allModels[n],isProcessing:e},s=[...this.allModels];s[n]=i,this.allModels=s}const r=this.pagedModels.findIndex(i=>i.id===t);r!==-1&&(this.pagedModels[r].isProcessing=e)},resetDownloadState(t=null,e=!1){const n=this.downloadProgress.details;t&&n&&n.model_id===t&&this.setModelProcessing(t,!1),(!t||n&&n.model_id===t)&&(this.downloadProgress={visible:!1,name:"",progress:0,speed:0,total_size:0,downloaded_size:0,details:null},this.isDownloading=!1),this.isDownloading||(this.isLoadingModels=!1),e&&(this.store.dispatch("refreshModels"),this.store.dispatch("refreshModelsZoo"))},installProgressListener(t){var r,i,s,o;const e=t.model_id,n=(r=this.downloadProgress.details)==null?void 0:r.model_id;!e||e!==n||(t.status==="progress"?(this.downloadProgress.name=t.stage||`Processing ${t.model_name||"model"}...`,this.downloadProgress.progress=t.progress||0,this.downloadProgress.speed=t.speed||0,this.downloadProgress.total_size=t.total_size||0,this.downloadProgress.downloaded_size=t.downloaded_size||0):t.status==="cancelled"?(this.show_toast(`Operation cancelled for ${((i=this.downloadProgress.details)==null?void 0:i.model_name)||"model"}.`,3,!0),this.resetDownloadState(e,!1)):t.status==="failed"?(this.show_toast(t.error||`Operation failed for ${((s=this.downloadProgress.details)==null?void 0:s.model_name)||"model"}.`,4,!1),this.resetDownloadState(e,!1)):t.status==="success"?(this.show_toast(t.message||`${((o=this.downloadProgress.details)==null?void 0:o.model_name)||"Model"} operation successful.`,2,!0),this.resetDownloadState(e,!0)):t.status==="processing"&&(this.downloadProgress.name=t.stage||`Processing ${t.model_name||"model"}...`,this.downloadProgress.progress=t.progress!==void 0?t.progress:100),this.replaceFeatherIcons())},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.installProgressListener=this.installProgressListener.bind(this),et.on("install_progress",this.installProgressListener),this.effectiveConfig.binding_name?this.processAndCombineModels():this.isLoadingModels=!1,this.replaceFeatherIcons()},unmounted(){et.off("install_progress",this.installProgressListener),clearTimeout(this.searchDebounceTimer)},updated(){this.replaceFeatherIcons()}},ITr={class:"user-settings-panel space-y-6"},HTr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},VTr={key:0,class:"flex items-center gap-2 text-sm font-medium p-2 bg-blue-100 dark:bg-blue-800/50 rounded-md border border-blue-300 dark:border-blue-600 shrink-0 text-blue-700 dark:text-blue-200"},qTr=["src"],UTr={class:"font-semibold"},BTr={key:1,class:"text-sm font-medium text-orange-600 dark:text-orange-400 p-2 bg-orange-100 dark:bg-orange-900/30 rounded-md border border-orange-300 dark:border-orange-600 shrink-0"},zTr={key:2,class:"text-sm font-medium text-red-600 dark:text-red-400 p-2 bg-red-100 dark:bg-red-900/30 rounded-md border border-red-300 dark:border-red-600 shrink-0"},XTr={class:"text-sm text-blue-600 dark:text-blue-400"},FTr={class:"font-semibold"},jTr={key:0,class:"p-3 text-center text-orange-600 dark:text-orange-400 bg-orange-100 dark:bg-orange-900/30 rounded-md border border-orange-300 dark:border-orange-600"},YTr={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4 items-center"},GTr={class:"relative md:col-span-2"},WTr={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center"},ZTr={class:"flex items-center space-x-2"},KTr={for:"model-filter-installed",class:"flex items-center space-x-1 cursor-pointer text-sm label"},JTr={key:1,class:"flex justify-center items-center p-10 text-loading"},eOr={key:2,class:"text-center text-blue-500 dark:text-blue-400 py-10"},tOr={key:3,class:"text-center text-blue-500 dark:text-blue-400 py-10"},nOr={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",ref:"scrollContainer"},rOr={key:4,class:"mt-6 text-center"},iOr=["disabled"],sOr={key:0},oOr={key:1},aOr={class:"pt-6 border-t border-blue-200 dark:border-blue-700 mt-6"},lOr={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},cOr={class:"flex"},uOr={class:"flex"},dOr=["disabled"],fOr=["data-feather"],hOr={key:0,class:"mt-4 p-3 bg-blue-100 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded-md"},pOr={class:"flex justify-between items-center mb-1"},TOr={class:"text-sm font-medium text-blue-700 dark:text-blue-300"},OOr={class:"text-xs font-medium text-progress"},mOr={class:"animated-progressbar-bg h-1.5"},gOr={class:"flex justify-between items-center mt-1 text-xs text-progress"};function QOr(t,e,n,r,i,s){const o=Xe("ModelEntry"),a=Xe("ChoiceDialog");return k(),R("div",ITr,[b("div",HTr,[e[12]||(e[12]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 mb-2 sm:mb-0"}," Models Zoo ",-1)),s.currentModelInfoComputed?(k(),R("div",VTr,[b("img",{src:s.currentModelInfoComputed.icon,onError:e[0]||(e[0]=(...l)=>s.imgPlaceholder&&s.imgPlaceholder(...l)),class:"w-6 h-6 rounded-lg object-cover flex-shrink-0",alt:"Current Model Icon"},null,40,qTr),b("span",null,[e[11]||(e[11]=Se("Active: ")),b("span",UTr,ae(s.currentModelInfoComputed.name),1)])])):s.effectiveConfig.binding_name?(k(),R("div",zTr," No model selected! ")):(k(),R("div",BTr," Select a Binding first! "))]),b("p",XTr,[e[13]||(e[13]=Se(" Select a model compatible with your chosen binding (")),b("span",FTr,ae(s.currentBindingNameComputed||"None Selected"),1),e[14]||(e[14]=Se("). Installed models are shown first. Models may require specific variants (e.g., GGUF, GPTQ) depending on the binding. "))]),s.effectiveConfig.binding_name?ne("",!0):(k(),R("div",jTr," Please select a Binding from the 'Bindings' section to see available models. ")),b("div",YTr,[b("div",GTr,[e[16]||(e[16]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[1]||(e[1]=l=>i.searchTerm=l),placeholder:"Search models...",class:"input search-input pl-10 w-full",onInput:e[2]||(e[2]=(...l)=>s.debounceSearch&&s.debounceSearch(...l))},null,544),[[vt,i.searchTerm]]),i.isSearching?(k(),R("div",WTr,e[15]||(e[15]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 text-blue-400 animate-spin dark:text-blue-500 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0)]),b("div",ZTr,[b("label",KTr,[He(b("input",{type:"checkbox",id:"model-filter-installed","onUpdate:modelValue":e[3]||(e[3]=l=>i.showInstalledOnly=l),class:"rounded text-blue-600 focus:ring-blue-500 border-blue-300 dark:border-blue-600 bg-blue-100 dark:bg-blue-700 focus:ring-offset-blue-100 dark:focus:ring-offset-blue-800"},null,512),[[W3,i.showInstalledOnly]]),e[17]||(e[17]=b("span",null,"Installed Only",-1))])]),b("div",null,[e[19]||(e[19]=b("label",{for:"model-sort",class:"sr-only"},"Sort models by",-1)),He(b("select",{id:"model-sort","onUpdate:modelValue":e[4]||(e[4]=l=>i.sortOption=l),class:"input"},e[18]||(e[18]=[To('Sort by Rank Sort by Name Sort by Date Sort by Quantizer Sort by License ',5)]),512),[[$s,i.sortOption]])])]),i.isLoadingModels?(k(),R("div",JTr,e[20]||(e[20]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-300 animate-spin dark:text-blue-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading models...",-1)]))):i.pagedModels.length===0&&i.filteredModels.length>0?(k(),R("div",eOr," No models found matching filters"+ae(i.searchTerm?' and search "'+i.searchTerm+'"':"")+". ",1)):i.allModels.length===0&&!i.isLoadingModels&&s.effectiveConfig.binding_name?(k(),R("div",tOr," No models available for the selected binding. Try adding a reference or downloading below. ")):ne("",!0),b("div",nOr,[(k(!0),R(Ve,null,dt(i.pagedModels,l=>{var c,u,d,f,h;return k(),Qt(o,{key:l.id,model:l,"is-selected":n.config.model_name===l.name,"is-installed":l.isInstalled,"is-processing":l.isProcessing,progress:((c=i.downloadProgress.details)==null?void 0:c.model_id)===l.id?i.downloadProgress.progress:0,speed:((u=i.downloadProgress.details)==null?void 0:u.model_id)===l.id?i.downloadProgress.speed:0,total_size:((d=i.downloadProgress.details)==null?void 0:d.model_id)===l.id?i.downloadProgress.total_size:0,downloaded_size:((f=i.downloadProgress.details)==null?void 0:f.model_id)===l.id?i.downloadProgress.downloaded_size:0,"progress-name":((h=i.downloadProgress.details)==null?void 0:h.model_id)===l.id?i.downloadProgress.name:"",onSelect:s.handleSelect,onInstall:s.handleInstall,onUninstall:s.handleUninstall,onCancelInstall:s.handleCancelInstall,onCopy:s.handleCopy,onCopyLink:s.handleCopyLink},null,8,["model","is-selected","is-installed","is-processing","progress","speed","total_size","downloaded_size","progress-name","onSelect","onInstall","onUninstall","onCancelInstall","onCopy","onCopyLink"])}),128))],512),s.hasMoreModelsToLoad?(k(),R("div",rOr,[b("button",{onClick:e[5]||(e[5]=(...l)=>s.loadMoreModels&&s.loadMoreModels(...l)),disabled:i.isLoadingModels||i.isSearching,class:"btn btn-secondary"},[i.isLoadingModels||i.isSearching?(k(),R("span",sOr,e[21]||(e[21]=[b("svg",{"aria-hidden":"true",class:"w-4 h-4 mr-1 inline animate-spin text-blue-400 dark:text-blue-500 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),Se(" Loading... ")]))):(k(),R("span",oOr,"Load More Models ("+ae(i.filteredModels.length-i.pagedModels.length)+" remaining)",1))],8,iOr)])):ne("",!0),b("section",aOr,[e[26]||(e[26]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Add Model",-1)),b("div",lOr,[b("div",null,[e[22]||(e[22]=b("label",{for:"reference_path",class:"label mb-1"},"Add Reference to Local Model File/Folder",-1)),b("div",cOr,[He(b("input",{type:"text",id:"reference_path","onUpdate:modelValue":e[6]||(e[6]=l=>i.referencePath=l),class:"input input-sm rounded-r-none flex-grow",placeholder:"Enter full path..."},null,512),[[vt,i.referencePath]]),b("button",{onClick:e[7]||(e[7]=(...l)=>s.createReference&&s.createReference(...l)),class:"btn btn-primary btn-sm rounded-l-none flex-shrink-0",title:"Add Reference"},"Add")]),e[23]||(e[23]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mt-1"},"Creates a link without copying the model.",-1))]),b("div",null,[e[24]||(e[24]=b("label",{for:"model_url",class:"label mb-1"},"Download Model from URL or Hugging Face ID",-1)),b("div",uOr,[He(b("input",{type:"text",id:"model_url","onUpdate:modelValue":e[8]||(e[8]=l=>i.modelUrl=l),class:"input input-sm rounded-r-none flex-grow",placeholder:"Enter URL or HF ID..."},null,512),[[vt,i.modelUrl]]),b("button",{onClick:e[9]||(e[9]=(...l)=>s.installFromInput&&s.installFromInput(...l)),class:"btn btn-success btn-sm rounded-l-none flex-shrink-0",title:"Download and Install",disabled:i.isDownloading},[b("i",{"data-feather":i.isDownloading?"loader":"download",class:ye(["w-4 h-4",i.isDownloading?"animate-spin":""])},null,10,fOr)],8,dOr)]),e[25]||(e[25]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mt-1"},"Downloads the model to the binding's models folder.",-1))])]),i.downloadProgress.visible?(k(),R("div",hOr,[b("div",pOr,[b("span",TOr,ae(i.downloadProgress.name),1),b("span",OOr,ae(i.downloadProgress.progress.toFixed(1))+"%",1)]),b("div",mOr,[b("div",{class:"animated-progressbar-fg h-1.5 rounded-full",style:qn({width:i.downloadProgress.progress+"%"})},null,4)]),b("div",gOr,[b("span",null,ae(s.downloadedSizeComputed)+" / "+ae(s.totalSizeComputed),1),b("span",null,ae(s.speedComputed)+"/s",1)]),b("button",{onClick:e[10]||(e[10]=l=>s.handleCancelInstall(i.downloadProgress.details)),class:"btn btn-secondary btn-sm mt-2 text-xs text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700"},"Cancel Operation")])):ne("",!0)]),te(a,{show:i.variantSelectionDialog.visible,title:i.variantSelectionDialog.title,choices:i.variantSelectionDialog.choices,onChoiceSelected:s.handleVariantSelected,onChoiceValidated:s.handleVariantValidated,onCloseDialog:s.closeVariantDialog},null,8,["show","title","choices","onChoiceSelected","onChoiceValidated","onCloseDialog"])])}const _Or=st(NTr,[["render",QOr],["__scopeId","data-v-5fda03e7"]]),vOr={name:"PersonalityEntry",components:{InteractiveMenu:KC},props:{personality:{type:Object,required:!0},select_language:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},full_path:{type:String,required:!0},isMounted:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1},isStarred:{type:Boolean,default:!1},baseUrl:{type:String,default:""}},emits:["select","mount","unmount","remount","edit","copy-to-custom","reinstall","settings","copy-personality-name","open-folder","error","toggle-star"],data(){return{selectedLanguage:this.personality.language||"",showHelpPopup:!1,renderedHelp:""}},computed:{personalityId(){return this.personality.id||this.full_path.replace(/[/:]/g,"-")},renderedDescription(){return this.personality.description?/<[a-z][\s\S]*>/i.test(this.personality.description)?C4.sanitize(this.personality.description):this.escapeHtml(this.personality.description).replace(/\n/g," "):"No description available."},commandsList(){let t=[];return this.isMounted?(t.push({name:"unmount",icon:"feather:stop-circle",is_file:!1,value:this.emitUnmount}),t.push({name:"remount",icon:"feather:refresh-cw",is_file:!1,value:this.emitRemount})):t.push({name:"mount",icon:"feather:play",is_file:!1,value:this.emitMount}),t.push({name:"reinstall",icon:"feather:download-cloud",is_file:!1,value:this.emitReinstall}),this.full_path.startsWith("custom_personalities/")||this.personality.category==="custom_personalities"?t.push({name:"edit",icon:"feather:edit-3",is_file:!1,value:this.emitEdit}):t.push({name:"Copy to custom personalities",icon:"feather:copy",is_file:!1,value:this.emitCopyToCustom}),this.isActive&&this.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.emitSettings}),t.push({name:"Open Folder",icon:"feather:folder",is_file:!1,value:this.emitOpenFolder}),t.push({name:"Copy Name",icon:"feather:clipboard",is_file:!1,value:this.emitCopyName}),t}},watch:{"personality.language"(t){const e=t||"";this.selectedLanguage!==e&&(this.selectedLanguage=e)},isStarred(){this.updateFeatherIcons()},isMounted(){this.updateFeatherIcons()},isActive(){this.updateFeatherIcons()},isProcessing(){this.updateFeatherIcons()}},methods:{escapeHtml(t){return t?t.replace(/&/g,"&").replace(/ /g,">").replace(/"/g,'"').replace(/'/g,"'"):""},updateFeatherIcons(){Fe(()=>{try{this.$el&&this.$el.parentNode&&Re.replace()}catch(t){console.error("Feather icons replacement failed:",t)}})},formatDate(t){if(!t)return"";try{const e={year:"numeric",month:"short",day:"numeric"};return new Date(t).toLocaleDateString(void 0,e)}catch{return t}},getPersonalityIconUrl(t){if(!t)return Eo;const e=this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl,n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`},handleImgError(t){t.target.src=Eo,this.$emit("error",{type:"image_load",message:"Failed to load personality icon",event:t})},handleSelect(){this.$emit("select",{personality:{...this.personality,language:this.selectedLanguage}})},handleLanguageChange(){},emitAction(t){const e={personality:{...this.personality,language:this.selectedLanguage||""}};this.$emit(t,e)},toggleStar(){this.emitAction("toggle-star")},emitMount(){this.emitAction("mount")},emitUnmount(){this.emitAction("unmount")},emitRemount(){this.emitAction("remount")},emitReinstall(){this.emitAction("reinstall")},emitEdit(){this.emitAction("edit")},emitCopyToCustom(){this.emitAction("copy-to-custom")},emitSettings(){this.emitAction("settings")},emitOpenFolder(){this.emitAction("open-folder")},emitCopyName(){this.emitAction("copy-personality-name")},showHelp(){if(this.personality.help){Kt.setOptions({gfm:!0,breaks:!0,mangle:!1,headerIds:!1});try{const t=Kt.parse(this.personality.help);this.renderedHelp=C4.sanitize(t),this.showHelpPopup=!0,this.updateFeatherIcons()}catch{this.renderedHelp="Error displaying help content.
",this.showHelpPopup=!0,this.updateFeatherIcons()}}},closeHelp(){this.showHelpPopup=!1,this.updateFeatherIcons()}},mounted(){this.selectedLanguage=this.personality.language||"",this.updateFeatherIcons()}},yOr=["title"],bOr={key:0,class:"absolute inset-0 bg-blue-400 dark:bg-blue-700 bg-opacity-50 dark:bg-opacity-50 flex items-center justify-center rounded-lg z-20"},SOr=["title"],xOr={key:0,"data-feather":"star",class:"w-5 h-5 fill-current"},EOr={key:1,"data-feather":"star",class:"w-5 h-5 stroke-current"},wOr={class:"flex-grow flex flex-col"},COr={class:"flex items-start mb-3"},LOr=["src"],$Or={class:"flex-grow overflow-hidden min-w-0"},AOr=["title"],kOr=["title"],POr=["title"],ROr=["title"],MOr={class:"text-xs text-blue-400 dark:text-blue-500 mb-3 space-y-1"},DOr={key:0},NOr={key:1},IOr={class:"mb-4 flex-grow"},HOr=["innerHTML"],VOr={key:0,class:"mb-3 mt-auto"},qOr=["for"],UOr=["id"],BOr=["value"],zOr={class:"mt-auto pt-3 border-t border-blue-200 dark:border-blue-700"},XOr={class:"flex justify-between items-center"},FOr={class:"flex space-x-1"},jOr={class:"card w-full max-w-2xl max-h-[80vh] flex flex-col"},YOr={class:"flex justify-between items-center mb-4 border-b pb-2 border-blue-200 dark:border-blue-600"},GOr={class:"text-xl font-bold text-blue-800 dark:text-blue-100"},WOr={class:"flex-grow overflow-y-auto scrollbar prose-blue max-w-none pr-2"},ZOr=["innerHTML"],KOr={class:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-600 text-right"};function JOr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["app-card relative flex flex-col",{"border-2 border-blue-500 dark:border-blue-400 shadow-lg":n.isActive,"border-blue-200 dark:border-blue-700":!n.isActive,"opacity-50 pointer-events-none":n.isProcessing}]),title:n.personality.tool_description||n.personality.description||n.personality.name,onClick:e[12]||(e[12]=(...a)=>s.handleSelect&&s.handleSelect(...a))},[n.isProcessing?(k(),R("div",bOr,e[13]||(e[13]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 text-blue-200 animate-spin dark:text-blue-600 fill-blue-600 dark:fill-blue-300",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0),b("button",{onClick:e[0]||(e[0]=oe((...a)=>s.toggleStar&&s.toggleStar(...a),["stop"])),class:"absolute top-2 right-2 svg-button text-yellow-400 hover:text-yellow-500 dark:text-yellow-500 dark:hover:text-yellow-400 z-10",title:n.isStarred?"Unstar":"Star"},[n.isStarred?(k(),R("i",xOr)):(k(),R("i",EOr))],8,SOr),b("div",wOr,[b("div",COr,[b("img",{src:s.getPersonalityIconUrl(n.personality.avatar),onError:e[1]||(e[1]=(...a)=>s.handleImgError&&s.handleImgError(...a)),alt:"Personality Icon",class:"w-16 h-16 rounded-lg object-cover mr-4 flex-shrink-0 border border-blue-200 dark:border-blue-600 shadow-sm"},null,40,LOr),b("div",$Or,[b("h3",{class:"font-bold text-lg text-blue-800 dark:text-blue-100 truncate",title:n.personality.name},ae(n.personality.name),9,AOr),n.personality.author?(k(),R("p",{key:0,class:"text-xs text-blue-500 dark:text-blue-400 truncate",title:`By ${n.personality.author}`}," By "+ae(n.personality.author),9,kOr)):ne("",!0),n.personality.version?(k(),R("p",{key:1,class:"text-xs text-blue-500 dark:text-blue-400",title:`Version: ${n.personality.version}`}," v"+ae(n.personality.version),9,POr)):ne("",!0),n.personality.category?(k(),R("p",{key:2,class:"text-xs text-blue-500 dark:text-blue-400 truncate",title:`Category: ${n.personality.category}`},ae(n.personality.category),9,ROr)):ne("",!0)]),n.personality.help?(k(),R("button",{key:0,onClick:e[2]||(e[2]=oe((...a)=>s.showHelp&&s.showHelp(...a),["stop"])),class:"ml-2 svg-button text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 flex-shrink-0 -mr-1",title:"Help"},e[14]||(e[14]=[b("i",{"data-feather":"help-circle",class:"h-5 w-5"},null,-1)]))):ne("",!0)]),b("div",MOr,[n.personality.creation_date?(k(),R("p",DOr,"Created: "+ae(s.formatDate(n.personality.creation_date)),1)):ne("",!0),n.personality.last_update_date?(k(),R("p",NOr,"Updated: "+ae(s.formatDate(n.personality.last_update_date)),1)):ne("",!0)]),b("div",IOr,[b("p",{class:"text-sm text-blue-700 dark:text-blue-300 h-20 overflow-y-auto scrollbar",innerHTML:s.renderedDescription},null,8,HOr)]),n.select_language&&n.personality.languages&&n.personality.languages.length>0&&!n.isMounted?(k(),R("div",VOr,[b("label",{for:"lang-select-"+s.personalityId,class:"label mb-1"},"Language:",8,qOr),He(b("select",{id:"lang-select-"+s.personalityId,"onUpdate:modelValue":e[3]||(e[3]=a=>i.selectedLanguage=a),onClick:e[4]||(e[4]=oe(()=>{},["stop"])),onChange:e[5]||(e[5]=(...a)=>s.handleLanguageChange&&s.handleLanguageChange(...a)),class:"input w-full text-sm"},[e[15]||(e[15]=b("option",{value:""},"Default",-1)),(k(!0),R(Ve,null,dt(n.personality.languages,a=>(k(),R("option",{key:a,value:a},ae(a),9,BOr))),128))],40,UOr),[[$s,i.selectedLanguage]])])):ne("",!0),b("div",zOr,[b("div",XOr,[b("div",FOr,[n.isMounted?(k(),R("button",{key:1,onClick:e[7]||(e[7]=oe(a=>s.emitAction("unmount"),["stop"])),class:"btn btn-sm bg-red-600 hover:bg-red-700 text-white focus:ring-red-500 dark:bg-red-700 dark:hover:bg-red-600 dark:focus:ring-red-600",title:"Unmount personality"},e[17]||(e[17]=[b("div",{class:"flex items-center"},[b("i",{"data-feather":"stop-circle",class:"w-3 h-3 mr-1 stroke-current"}),Se("Unmount")],-1)]))):(k(),R("button",{key:0,onClick:e[6]||(e[6]=oe(a=>s.emitAction("mount"),["stop"])),class:"btn btn-sm btn-success",title:"Mount personality"},e[16]||(e[16]=[b("div",{class:"flex items-center"},[b("i",{"data-feather":"play",class:"w-3 h-3 mr-1 stroke-current"}),Se("Mount")],-1)]))),n.isMounted?(k(),R("button",{key:2,onClick:e[8]||(e[8]=oe(a=>s.emitAction("remount"),["stop"])),class:"svg-button p-1",title:"Remount personality"},e[18]||(e[18]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4"},null,-1)]))):ne("",!0)]),te(o,{commands:s.commandsList,force_position:2,title:"More actions",class:"p-1"},{trigger:Ie(()=>e[19]||(e[19]=[b("button",{class:"svg-button p-1"},[b("i",{"data-feather":"more-vertical",class:"w-5 h-5"})],-1)])),_:1},8,["commands"])])])]),i.showHelpPopup?(k(),R("div",{key:1,onClick:e[11]||(e[11]=oe(()=>{},["stop"])),class:"fixed inset-0 bg-black bg-opacity-70 flex justify-center items-center z-50 p-4"},[b("div",jOr,[b("div",YOr,[b("h2",GOr,"Help: "+ae(n.personality.name),1),b("button",{onClick:e[9]||(e[9]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"svg-button hover:text-red-600 dark:hover:text-red-500 p-1"},e[20]||(e[20]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]))]),b("div",WOr,[b("div",{innerHTML:i.renderedHelp},null,8,ZOr)]),b("div",KOr,[b("button",{onClick:e[10]||(e[10]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"btn btn-primary"},"Close")])])])):ne("",!0)],10,yOr)}const emr=st(vOr,[["render",JOr],["__scopeId","data-v-f2a4e010"]]),tmr="/",nmr={name:"PersonalitiesZoo",components:{PersonalityEntry:emr},props:{config:Object,api_get_req:Function,api_post_req:Function,show_toast:Function,show_yes_no_dialog:Function,show_message_box:Function,client_id:String,show_universal_form:Function},emits:["setting-updated"],data(){return{allPersonalities:[],persCatgArr:[],selectedCategory:"",searchTermInput:"",activeSearchTerm:"",isLoading:!1,bUrl:tmr,defaultPersonalityIcon_:Eo,maxDisplayedMounted:5}},computed:{allStorePersonalities(){return this.$store.getters.getPersonalities||[]},starredPersonalitiesPaths(){return this.$store.getters.getStarredPersonalities||[]},mountedPersArr(){var e;if(!((e=this.$store.state.config)!=null&&e.personalities)||this.allStorePersonalities.length===0)return[];const t=new Set(this.$store.state.config.personalities);return this.allStorePersonalities.filter(n=>{const r=n.full_path,i=Array.isArray(n.languages)?n.languages.map(s=>`${r}:${s}`):[];return t.has(r)||i.some(s=>t.has(s))}).sort((n,r)=>(n.name||"").localeCompare(r.name||""))},active_personality_name(){const t=this.$store.state.config;if(!t||t.active_personality_id<0||!t.personalities||t.active_personality_id>=t.personalities.length)return null;const e=t.personalities[t.active_personality_id],n=e?e.split(":")[0]:null,r=this.allStorePersonalities.find(i=>i.full_path===n);return r?r.name:null},displayedMountedPersonalities(){return this.mountedPersArr.slice(0,this.maxDisplayedMounted)},filteredPersonalities(){let t=[...this.allStorePersonalities];const e=new Set(this.starredPersonalitiesPaths);if(this.selectedCategory==="Mounted"?t=t.filter(n=>n.isMounted):this.selectedCategory==="Starred"?t=t.filter(n=>e.has(n.full_path)):this.selectedCategory&&(t=t.filter(n=>n.category===this.selectedCategory)),this.activeSearchTerm){const n=this.activeSearchTerm.toLowerCase().trim();n&&(t=t.filter(r=>r.name&&r.name.toLowerCase().includes(n)||r.author&&r.author.toLowerCase().includes(n)||r.description&&r.description.toLowerCase().includes(n)||r.full_path&&r.full_path.toLowerCase().includes(n)))}return t.sort((n,r)=>{const i=e.has(n.full_path),s=e.has(r.full_path);if(i&&!s)return-1;if(!i&&s)return 1;if(n.isMounted&&!r.isMounted)return-1;if(!n.isMounted&&r.isMounted)return 1;const o=n.name||"",a=r.name||"";return o.localeCompare(a)}),t}},watch:{"config.personality_category":{handler(t){const e=t||"",n=["","Mounted","Starred",...this.persCatgArr];this.selectedCategory!==e&&n.includes(e)&&(this.selectedCategory=e)},immediate:!0},selectedCategory(t){this.activeSearchTerm="",this.searchTermInput="",Fe(()=>this.resetScroll())},"$store.state.personalities":{handler(t){this.syncLocalMountedFlags()},deep:!0,immediate:!1}},methods:{async fetchCategories(){try{const t=await this.api_get_req("list_personalities_categories");this.persCatgArr=t?t.sort():[]}catch(t){console.error("Error fetching categories:",t)}},async fetchInitialData(){this.isLoading=!0;try{await this.fetchCategories(),this.syncLocalMountedFlags()}catch(t){console.error("Error fetching initial data:",t),this.show_toast(`Error loading data: ${t.message}`,4,!1)}finally{this.isLoading=!1,Fe(()=>{Re.replace(),this.resetScroll()})}},handleCategoryChange(){Fe(()=>this.resetScroll())},applySearch(){this.activeSearchTerm=this.searchTermInput,Fe(()=>this.resetScroll())},clearSearch(){this.searchTermInput="",this.activeSearchTerm="",Fe(()=>this.resetScroll())},toggleStar(t){this.$store.dispatch("toggleStarPersonality",t.personality)},resetScroll(){const t=this.$refs.gridContainer;t&&(t.scrollTop=0)},syncLocalMountedFlags(){var e;const t=new Set(((e=this.$store.state.config)==null?void 0:e.personalities)||[]);this.allStorePersonalities.forEach(n=>{const r=n.full_path,i=Array.isArray(n.languages)?n.languages.map(o=>`${r}:${o}`):[],s=t.has(r)||i.some(o=>t.has(o));n.isMounted!==s&&this.$store.commit("updatePersonality",{...n,isMounted:s})})},personalityImgPlaceholder(t){t.target.src=this.defaultPersonalityIcon_},getPersonalityIconUrl(t){if(!t)return this.defaultPersonalityIcon_;const e=t.startsWith("/")?t.substring(1):t,n=this.bUrl.endsWith("/")||e.startsWith("/")?"":"/";let r=e==="/"?"":e;return`${this.bUrl}${n}${r}`},isActivePersonality(t){const e=this.$store.state.config;if(!e||e.active_personality_id<0||!e.personalities)return!1;const n=e.personalities[e.active_personality_id],r=n?n.split(":")[0]:null;return t.full_path===r},setPersonalityProcessing(t,e){const n=t.personality.id||t.personality.full_path,r=this.allStorePersonalities.find(i=>(i.id||i.full_path)===n);r?this.$store.commit("updatePersonality",{...r,isProcessing:e}):console.warn("Cannot find personality in store to set processing state:",n)},getCategoryCount(t){return this.allStorePersonalities.filter(e=>e.category===t).length},getStarredCount(){const t=new Set(this.starredPersonalitiesPaths);return this.allStorePersonalities.filter(e=>t.has(e.full_path)).length},getResultLabel(){return this.selectedCategory==="Mounted"?"Mounted Personalities":this.selectedCategory==="Starred"?"Starred Personalities":this.selectedCategory?`Personalities in "${this.selectedCategory}"`:"All Personalities"},getResultMessageQualifier(){return this.selectedCategory==="Mounted"?" in Mounted":this.selectedCategory==="Starred"?" in Starred":this.selectedCategory?` in category "${this.selectedCategory}"`:""},async onPersonalitySelected(t){const e=t.personality;if(this.isLoading||e.isProcessing){this.show_toast("Loading...",4,!1);return}if(!e.isMounted){this.show_toast(`Mount "${e.name}" first.`,3,!1);return}if(this.isActivePersonality(e)){this.show_toast(`"${e.name}" is already active.`,3,!1);return}this.setPersonalityProcessing(t,!0),this.show_toast(`Selecting ${e.name}...`,2,!0);const n=await this.select_personality(e);n&&n.status?(this.show_toast(`Selected personality: ${e.name}`,4,!0),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities")):this.show_toast(`Failed to select ${e.name}: ${(n==null?void 0:n.error)||"Unknown error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async select_personality(t){var o;if(!t)return{status:!1,error:"no personality provided"};const e=((o=this.$store.state.config)==null?void 0:o.personalities)||[],n=t.language?`${t.full_path}:${t.language}`:null;let r=null;if(n&&e.includes(n)?r=n:e.includes(t.full_path)&&(r=t.full_path),!r)return{status:!1,error:"Personality variant not found in mounted list"};const i=e.findIndex(a=>a===r);if(i===-1)return{status:!1,error:"Internal error finding personality ID"};const s={id:i};try{return await this.api_post_req("select_personality",s)}catch(a){return{status:!1,error:a.message}}},async mountPersonality(t){const e=t.personality;if(e.isMounted||e.isProcessing||e.disclaimer&&e.disclaimer.trim()!==""&&!await this.show_yes_no_dialog(`Disclaimer for ${e.name}:
+Proceed?`,"Proceed","Cancel")),!!e){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("install_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" installed! Reload recommended.`,5,!0),await this.fetchBindings()):this.show_toast(`Install failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},async handleUninstall(t){if(await this.show_yes_no_dialog(`Uninstall "${t.name}"?`,"Uninstall","Cancel")){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("uninstall_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" uninstalled.`,4,!0),await this.fetchBindings(),this.config.binding_name===t.folder&&(this.$emit("setting-updated",{key:"binding_name",value:null}),this.$emit("setting-updated",{key:"model_name",value:null}))):this.show_toast(`Uninstall failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},async handleReinstall(t){if(await this.show_yes_no_dialog(`Reinstall "${t.name}"?`,"Reinstall","Cancel")){this.setBindingProcessing(t.folder,!0),this.isLoadingAction=!0;try{const n=await this.api_post_req("reinstall_binding",{name:t.folder});n!=null&&n.status?(this.show_toast(`"${t.name}" reinstalled! Reload recommended.`,5,!0),await this.fetchBindings()):this.show_toast(`Reinstall failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.setBindingProcessing(t.folder,!1),this.isLoadingAction=!1,this.replaceFeatherIcons()}}},handleSettingsFromEntry(t){this.handleSettings(t.folder)},handleReloadFromEntry(t){this.handleReload(t.folder)},async handleSettings(t){if(!t){this.show_toast("No binding specified.",3,!1);return}if(this.hasPendingChanges){this.show_toast("Apply settings changes first.",3,!1);return}const e=this.bindings.find(n=>n.folder===t);if(!(e!=null&&e.installed)){this.show_toast(`Binding "${(e==null?void 0:e.name)||t}" not installed.`,3,!1);return}if(t!==this.effectiveConfig.binding_name){this.show_toast(`Select and Apply "${e.name}" first.`,4,!1);return}this.isLoadingAction=!0;try{const n=await this.api_post_req("get_active_binding_settings");if(n&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Settings - ${e.name}`,"Save","Cancel");if(r!=null){const i=await this.api_post_req("set_active_binding_settings",{settings:r});i!=null&&i.status?(this.show_toast(`Settings updated for "${e.name}". Reloading...`,4,!0),await this.api_post_req("update_binding_settings"),this.show_toast(`Binding "${e.name}" reloaded.`,4,!0)):this.show_toast(`Update failed: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}else this.show_toast("Settings update cancelled.",3,!1)}else n?this.show_toast(`"${e.name}" has no settings.`,3,!1):this.show_toast("Could not get settings.",4,!1)}catch{}finally{this.isLoadingAction=!1,this.replaceFeatherIcons()}},async handleReload(t){if(!t){this.show_toast("No binding specified.",3,!1);return}if(this.hasPendingChanges){this.show_toast("Apply settings changes first.",3,!1);return}const e=this.bindings.find(n=>n.folder===t);if(!(e!=null&&e.installed)){this.show_toast(`Binding "${(e==null?void 0:e.name)||t}" not installed.`,3,!1);return}if(t!==this.effectiveConfig.binding_name){this.show_toast(`"${e.name}" is not the active binding.`,3,!1);return}this.isLoadingAction=!0,this.show_toast(`Reloading "${e.name}"...`,3,!0);try{const n=await this.api_post_req("reload_binding",{name:t});n!=null&&n.status?this.show_toast(`"${e.name}" reloaded.`,4,!0):this.show_toast(`Reload failed: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch{}finally{this.isLoadingAction=!1,this.replaceFeatherIcons()}},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.fetchBindings(),this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},tpr={class:"user-settings-panel space-y-6 p-4 md:p-6"},npr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},rpr={key:0,class:"flex items-center gap-2 text-sm font-medium p-2 bg-blue-100 dark:bg-blue-900/50 rounded-md border border-blue-300 dark:border-blue-700 text-blue-700 dark:text-blue-200"},ipr=["src"],spr={class:"font-semibold"},opr=["disabled"],apr=["disabled"],lpr={key:1,class:"text-sm font-medium text-red-600 dark:text-red-400 p-2 bg-red-100 dark:bg-red-900/30 rounded-md border border-red-300 dark:border-red-600"},cpr={key:0,class:"p-3 bg-yellow-100 dark:bg-yellow-900/30 border border-yellow-300 dark:border-yellow-700 rounded-lg text-center text-sm text-yellow-700 dark:text-yellow-300"},upr={class:"flex flex-col sm:flex-row gap-4 mb-4"},dpr={class:"relative flex-grow"},fpr=["disabled"],hpr={class:"flex-shrink-0"},ppr=["disabled"],Tpr={key:1,class:"flex justify-center items-center p-10"},Opr={key:2,class:"text-center text-blue-500 dark:text-blue-400 py-10"},mpr={key:3,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 scrollbar"};function gpr(t,e,n,r,i,s){const o=Xe("BindingEntry");return k(),R("div",tpr,[b("div",npr,[e[8]||(e[8]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-200 mb-2 sm:mb-0"}," Binding Zoo ",-1)),s.currentBindingInfo?(k(),R("div",rpr,[b("img",{src:s.getIconPath(s.currentBindingInfo.icon),onError:e[0]||(e[0]=(...a)=>s.imgPlaceholder&&s.imgPlaceholder(...a)),class:"w-6 h-6 rounded-full object-cover flex-shrink-0",alt:"Current Binding Icon"},null,40,ipr),b("span",null,[e[5]||(e[5]=Se("Active: ")),b("span",spr,ae(s.currentBindingInfo.name),1)]),b("button",{onClick:e[1]||(e[1]=a=>s.handleSettings(s.effectiveConfig.binding_name)),disabled:i.isLoadingAction||n.loading||s.hasPendingChanges,class:"svg-button ml-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Configure Active Binding"},e[6]||(e[6]=[b("i",{"data-feather":"settings",class:"w-4 h-4"},null,-1)]),8,opr),b("button",{onClick:e[2]||(e[2]=a=>s.handleReload(s.effectiveConfig.binding_name)),disabled:i.isLoadingAction||n.loading||s.hasPendingChanges,class:"svg-button ml-1 disabled:opacity-50 disabled:cursor-not-allowed",title:"Reload Active Binding"},e[7]||(e[7]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4"},null,-1)]),8,apr)])):(k(),R("div",lpr," No binding selected! "))]),e[14]||(e[14]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400"}," Bindings are the engines that run the AI models. Select an installed binding to enable model selection and generation. ",-1)),s.hasPendingChanges?(k(),R("div",cpr,e[9]||(e[9]=[b("i",{"data-feather":"alert-circle",class:"inline-block w-4 h-4 mr-1 align-middle"},null,-1),Se(" Apply main settings changes to use binding actions (settings, reload). ")]))):ne("",!0),b("div",upr,[b("div",dpr,[e[10]||(e[10]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[3]||(e[3]=a=>i.searchTerm=a),placeholder:"Search bindings...",class:"input search-input pl-10 w-full","aria-label":"Search bindings",disabled:i.isLoadingBindings||n.loading},null,8,fpr),[[vt,i.searchTerm]])]),b("div",hpr,[e[12]||(e[12]=b("label",{for:"binding-sort",class:"sr-only"},"Sort bindings by",-1)),He(b("select",{id:"binding-sort","onUpdate:modelValue":e[4]||(e[4]=a=>i.sortOption=a),class:"input w-full sm:w-auto","aria-label":"Sort bindings by",disabled:i.isLoadingBindings||n.loading},e[11]||(e[11]=[b("option",{value:"name"},"Sort by Name",-1),b("option",{value:"author"},"Sort by Author",-1),b("option",{value:"status"},"Sort by Status",-1)]),8,ppr),[[$s,i.sortOption]])])]),i.isLoadingBindings?(k(),R("div",Tpr,e[13]||(e[13]=[b("svg",{"aria-hidden":"true",role:"status",class:"w-8 h-8 text-blue-300 animate-spin dark:text-blue-600 fill-blue-600 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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),b("span",{class:"ml-2 text-loading"},"Loading bindings...",-1)]))):s.sortedBindings.length===0?(k(),R("div",Opr," No bindings found"+ae(i.searchTerm?' matching "'+i.searchTerm+'"':"")+". ",1)):(k(),R("div",mpr,[(k(!0),R(Ve,null,dt(s.sortedBindings,a=>(k(),Qt(o,{key:a.folder,binding:a,selected:s.isBindingSelected(a),"is-processing":a.isProcessing,onSelect:s.handleSelect,onInstall:s.handleInstall,onUninstall:s.handleUninstall,onReinstall:s.handleReinstall,onSettings:s.handleSettingsFromEntry,onReloadBinding:s.handleReloadFromEntry},null,8,["binding","selected","is-processing","onSelect","onInstall","onUninstall","onReinstall","onSettings","onReloadBinding"]))),128))]))])}const Qpr=st(epr,[["render",gpr],["__scopeId","data-v-8f5fcfca"]]),F9="/assets/logo-6TyToX4A.png",_pr={name:"InteractiveMenu",props:{title:{type:String,required:!1,default:"Menu"},icon:{type:String,required:!1,default:"feather:more-vertical"},commands:{type:Array,required:!0,default:()=>[]},force_position:{type:Number,required:!1,default:0},execute_cmd:{type:Function,required:!1},menuIconClass:{type:String,required:!1,default:""},selected_entry:{type:String,required:!1,default:null}},data(){return{isMenuOpen:!1,menuStyle:{top:"auto",bottom:"auto",left:"auto",right:"auto",transformOrigin:"top left"}}},methods:{updateFeatherIcons(){Fe(()=>{Re.replace({width:"1em",height:"1em","stroke-width":2})})},handleClickOutside(t){this.$refs.menuContainerRef&&!this.$refs.menuContainerRef.contains(t.target)&&this.closeMenu()},toggleMenu(){this.isMenuOpen?this.closeMenu():this.openMenu()},openMenu(){this.isMenuOpen=!0,Fe(()=>{this.positionMenu(),this.updateFeatherIcons(),document.addEventListener("click",this.handleClickOutside,!0)})},closeMenu(){this.isMenuOpen=!1,document.removeEventListener("click",this.handleClickOutside,!0)},executeCommand(t){this.closeMenu(),typeof t.value=="function"?t.value():this.execute_cmd?this.execute_cmd(t):console.warn("InteractiveMenu: No action defined for command:",t.name)},positionMenu(){if(!this.isMenuOpen||!this.$refs.menuButtonRef||!this.$refs.menuRef)return;const t=this.$refs.menuButtonRef.getBoundingClientRect(),e=this.$refs.menuRef,n=e.style.visibility,r=e.style.display,i=e.style.position,s=e.style.top,o=e.style.left;e.style.visibility="hidden",e.style.position="fixed",e.style.top="-9999px",e.style.left="-9999px",e.style.display="block";const a=e.getBoundingClientRect();e.style.visibility=n,e.style.position=i,e.style.top=s,e.style.left=o,e.style.display=r;const l=window.innerWidth,c=window.innerHeight,u=8;let d={top:"auto",bottom:"auto",left:"auto",right:"auto",transformOrigin:""};const f=c-t.bottom-u,h=t.top-u,p=a.height;let T="below";this.force_position===1?T="above":this.force_position===2||f>=p?T="below":h>=p?T="above":T=h>f?"above":"below",T==="above"?(d.bottom="calc(100% + 4px)",d.top="auto",d.transformOrigin="bottom "):(d.top="calc(100% + 4px)",d.bottom="auto",d.transformOrigin="top "),l-t.left-u,t.right-u;const m=a.width;let O="left-align";this.force_position===3?O="right-align":this.force_position===4?O="left-align":t.left+m>l-u&&t.right-m>u&&(O="right-align"),O==="right-align"?(d.right="0px",d.left="auto",d.transformOrigin+="right"):(d.left="0px",d.right="auto",d.transformOrigin+="left"),this.menuStyle=d}},mounted(){window.addEventListener("resize",this.positionMenu),this.updateFeatherIcons()},beforeUnmount(){window.removeEventListener("resize",this.positionMenu),document.removeEventListener("click",this.handleClickOutside,!0)}},vpr={class:"interactive-menu-container",ref:"menuContainerRef"},ypr=["title"],bpr=["src"],Spr=["data-feather"],xpr={key:2,class:"interactive-menu-trigger-text"},Epr={key:3,"data-feather":"menu",class:"interactive-menu-trigger-icon"},wpr=["aria-labelledby"],Cpr={class:"interactive-menu-list",role:"none"},Lpr=["onClick","id"],$pr={class:"interactive-menu-item-checkmark-placeholder"},Apr={key:0,"data-feather":"check",class:"interactive-menu-item-checkmark-icon"},kpr={class:"interactive-menu-item-icon-container"},Ppr=["src","alt"],Rpr=["data-feather"],Mpr={key:2,class:"interactive-menu-item-icon-text"},Dpr={key:3,class:"interactive-menu-item-icon-placeholder"},Npr={class:"interactive-menu-item-name"};function Ipr(t,e,n,r,i,s){return k(),R("div",vpr,[b("button",{onClick:e[0]||(e[0]=oe((...o)=>s.toggleMenu&&s.toggleMenu(...o),["prevent"])),title:n.title||"Open Menu",class:ye(["interactive-menu-trigger",n.menuIconClass]),ref:"menuButtonRef",type:"button"},[er(t.$slots,"trigger",{},()=>[n.icon&&!n.icon.includes("#")&&!n.icon.includes("feather:")?(k(),R("img",{key:0,src:n.icon,class:"interactive-menu-trigger-icon",alt:"Menu Icon"},null,8,bpr)):n.icon&&n.icon.includes("feather:")?(k(),R("i",{key:1,"data-feather":n.icon.split(":")[1],class:"interactive-menu-trigger-icon"},null,8,Spr)):n.icon&&n.icon.includes("#")?(k(),R("span",xpr,ae(n.icon.split("#")[1]),1)):(k(),R("i",Epr))],!0)],10,ypr),te(cr,{name:"interactive-menu-transition"},{default:Ie(()=>[i.isMenuOpen?(k(),R("div",{key:0,class:"interactive-menu-dropdown",style:qn(i.menuStyle),ref:"menuRef",role:"menu","aria-orientation":"vertical","aria-labelledby":`menu-button-${t._uid}`},[b("ul",Cpr,[(k(!0),R(Ve,null,dt(n.commands,(o,a)=>(k(),R("li",{key:a,onClick:oe(l=>s.executeCommand(o),["prevent"]),class:"interactive-menu-item group",role:"menuitem",tabindex:-1,id:`menu-item-${t._uid}-${a}`},[b("span",$pr,[n.selected_entry===o.name?(k(),R("i",Apr)):ne("",!0)]),b("span",kpr,[o.icon&&!o.icon.includes("#")&&!o.icon.includes("feather:")?(k(),R("img",{key:0,src:o.icon,alt:o.name,class:"interactive-menu-item-icon"},null,8,Ppr)):o.icon&&o.icon.includes("feather:")?(k(),R("i",{key:1,"data-feather":o.icon.split(":")[1],class:"interactive-menu-item-icon"},null,8,Rpr)):o.icon&&o.icon.includes("#")?(k(),R("span",Mpr,ae(o.icon.split("#")[1]),1)):(k(),R("span",Dpr))]),b("span",Npr,ae(o.name),1)],8,Lpr))),128))])],12,wpr)):ne("",!0)]),_:1})],512)}const KC=st(_pr,[["render",Ipr],["__scopeId","data-v-e42afcb4"]]),Hpr={name:"ModelEntry",components:{InteractiveMenu:KC},props:{model:{type:Object,required:!0},isSelected:{type:Boolean,default:!1},isInstalled:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1},progress:{type:Number,default:0},speed:{type:Number,default:0},total_size:{type:Number,default:0},downloaded_size:{type:Number,default:0},progressName:{type:String,default:"Processing..."}},emits:["select","install","uninstall","cancel-install","copy","copy-link"],data(){return{failedToLoad:!1,linkNotValid:!!this.model.error}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})},methods:{formatDate(t){if(!t)return"N/A";try{const e=new Date(t);return isNaN(e.getTime())?"Invalid Date":e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(e){return console.error("Error formatting date:",e),"Invalid Date"}},formatFileSize(t){return O4(t)},getImgUrl(){return this.model.icon||F9},defaultImg(t){this.failedToLoad=!0,t.target.src=F9},handleClick(){if(this.isProcessing||!this.isInstalled||this.isSelected){console.log(`Click ignored: processing=${this.isProcessing}, installed=${this.isInstalled}, selected=${this.isSelected}`);return}console.log("Emitting select event for:",this.model.name),this.$emit("select",this.model)},handleInstallClick(){this.isProcessing||(console.log("Emitting install event for:",this.model.name),this.$emit("install",{model:this.model}))},handleUninstallClick(){this.isProcessing||!this.isInstalled||(console.log("Emitting uninstall event for:",this.model.name),this.$emit("uninstall",{model:this.model}))},handleCancelClick(){console.log("Emitting cancel-install event for:",this.model.name),this.$emit("cancel-install",{model:this.model})},handleCopyClick(){this.$emit("copy",{model:this.model})},handleCopyLinkClick(){this.$emit("copy-link",{model:this.model})},checkLinkValidity(){this.linkNotValid=!!this.model.error}},computed:{computedClasses(){const t=[];return this.isProcessing?t.push("opacity-70 pointer-events-none"):this.isSelected&&this.isInstalled?(t.push("border-[3px] border-blue-500 dark:border-blue-400 ring-2 ring-blue-300 dark:ring-blue-600 ring-offset-1 dark:ring-offset-gray-800"),t.push("bg-blue-50 dark:bg-blue-900/50"),t.push("cursor-default")):this.isInstalled&&!this.isSelected?(t.push("border-gray-200 dark:border-gray-700"),t.push("hover:border-blue-400 dark:hover:border-blue-600"),t.push("hover:bg-blue-50/50 dark:hover:bg-blue-900/20"),t.push("cursor-pointer")):this.isInstalled||(t.push("border-dashed border-gray-300 dark:border-gray-600"),t.push("opacity-80")),this.linkNotValid&&!this.isProcessing&&t.push("border-l-4 border-l-red-500"),t.join(" ")},isDisabled(){return this.isProcessing||!this.isInstalled},commandsList(){let t=[];return this.isInstalled?(t.push({name:"Uninstall",icon:"feather:trash-2",value:this.handleUninstallClick,disabled:this.isProcessing}),this.isSelected&&t.push({name:"Reload",icon:"feather:refresh-cw",value:this.handleClick,disabled:this.isProcessing})):t.push({name:"Install",icon:"feather:download",value:this.handleInstallClick,disabled:this.isProcessing||this.linkNotValid}),t.push({name:"Copy Info",icon:"feather:copy",value:this.handleCopyClick}),this.model.isCustomModel||t.push({name:"Copy Link",icon:"feather:clipboard",value:this.handleCopyLinkClick}),t},fileSize(){var n,r,i;const t=(r=(n=this.model)==null?void 0:n.variants)==null?void 0:r[0],e=(t==null?void 0:t.size)??((i=this.model)==null?void 0:i.size);return e?this.formatFileSize(e):"N/A"},speed_computed(){return this.formatFileSize(this.speed)+"/s"},total_size_computed(){return this.formatFileSize(this.total_size)},downloaded_size_computed(){return this.formatFileSize(this.downloaded_size)}},watch:{isProcessing(t,e){console.log(`Model ${this.model.name} processing state changed to: ${t}`),Fe(()=>{Re.replace()})},"model.error":function(t){this.linkNotValid=!!t}}},Vpr=["title","aria-pressed","aria-disabled"],qpr={key:0},Upr={class:"flex flex-row"},Bpr={class:"max-w-[300px] overflow-x-auto"},zpr={class:"flex gap-3 items-center grow"},Xpr=["src"],Fpr={class:"flex-1 overflow-hidden"},jpr={class:"font-bold font-large text-lg truncate"},Ypr={class:"flex items-center flex-row gap-2 my-1 mt-3"},Gpr=["disabled"],Wpr={key:1},Zpr={class:"flex flex-row items-center gap-3 mb-2"},Kpr=["src"],Jpr={class:"font-bold font-large text-lg truncate flex-grow"},eTr={class:"flex items-center",title:"Hugging Face Model Card"},tTr=["href"],nTr={class:"flex items-center",title:"Approximate File Size"},rTr={class:"flex items-center",title:"Model License"},iTr={key:0,class:"flex items-center",title:"Quantizer Profile"},sTr=["href"],oTr={key:1,class:"flex items-center",title:"Original Model Creator Profile"},aTr=["href"],lTr={key:2,class:"flex items-center",title:"Last Update Date"},cTr={key:3,class:"flex items-center",title:"Model Category"},uTr={key:4,class:"flex items-center",title:"Hugging Face Rank (May be outdated)"},dTr={key:2,class:"absolute z-10 inset-0 -m-px p-4 shadow-md text-center rounded-lg bg-white/80 dark:bg-gray-800/80 flex justify-center items-center backdrop-blur-sm"},fTr={class:"relative flex flex-col items-center justify-center w-full h-full"},hTr={class:"absolute bottom-2 left-2 right-2 w-auto bg-white/70 dark:bg-gray-800/70 rounded-lg p-2 backdrop-blur-sm"},pTr={class:"flex justify-between mb-1 text-xs"},TTr={class:"font-medium text-blue-700 dark:text-blue-300"},OTr={key:0,class:"font-medium text-blue-700 dark:text-blue-300"},mTr={key:0,class:"w-full bg-gray-200 rounded-full h-1.5 dark:bg-gray-700 mb-1"},gTr={key:1,class:"flex justify-between text-xs text-blue-600 dark:text-blue-400"};function QTr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["relative items-start p-4 hover:bg-blue-100 dark:hover:bg-blue-900/30 rounded-lg mb-2 shadow-lg border-2 select-none transition-colors duration-150",s.computedClasses]),title:n.model.name,role:"button",tabindex:"0","aria-pressed":n.isSelected,"aria-disabled":s.isDisabled,onClick:e[9]||(e[9]=oe((...a)=>s.handleClick&&s.handleClick(...a),["prevent"])),onKeydown:[e[10]||(e[10]=gr((...a)=>s.handleClick&&s.handleClick(...a),["enter"])),e[11]||(e[11]=gr(oe((...a)=>s.handleClick&&s.handleClick(...a),["prevent"]),["space"]))]},[n.model.isCustomModel?(k(),R("div",qpr,[b("div",Upr,[b("div",Bpr,[b("div",zpr,[b("img",{src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),class:"w-10 h-10 rounded-lg object-cover flex-shrink-0"},null,40,Xpr),b("div",Fpr,[b("h3",jpr,ae(n.model.name),1)])])])]),b("div",Ypr,[e[13]||(e[13]=b("div",{class:"flex grow items-center text-sm text-gray-600 dark:text-gray-400"},[b("i",{"data-feather":"hard-drive",class:"w-4 h-4 mr-1"}),Se(" Local Reference ")],-1)),b("div",null,[n.isInstalled?(k(),R("button",{key:0,title:"Remove Reference (Doesn't delete file)",type:"button",onClick:e[1]||(e[1]=oe((...a)=>s.handleUninstallClick&&s.handleUninstallClick(...a),["stop"])),disabled:n.isProcessing,class:"button-danger-sm"},e[12]||(e[12]=[b("i",{"data-feather":"trash-2",class:"w-4 h-4 mr-1"},null,-1),Se(" Remove ")]),8,Gpr)):ne("",!0)])])])):ne("",!0),n.model.isCustomModel?ne("",!0):(k(),R("div",Wpr,[b("div",Zpr,[b("img",{ref:"imgElement",src:s.getImgUrl(),onError:e[2]||(e[2]=a=>s.defaultImg(a)),class:ye(["w-10 h-10 rounded-lg object-cover flex-shrink-0",{grayscale:i.linkNotValid}])},null,42,Kpr),b("h3",Jpr,ae(n.model.name),1),te(o,{commands:s.commandsList,force_position:2,title:"Menu",onClick:e[3]||(e[3]=oe(()=>{},["stop"]))},null,8,["commands"])]),b("div",{class:ye(["space-y-1 text-sm text-gray-700 dark:text-gray-300",{"opacity-60":i.linkNotValid}])},[b("div",eTr,[e[14]||(e[14]=b("i",{"data-feather":"link",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[15]||(e[15]=b("b",{class:"mr-1 flex-shrink-0"},"Card:",-1)),b("a",{href:"https://huggingface.co/"+n.model.quantizer+"/"+n.model.name,target:"_blank",onClick:e[4]||(e[4]=oe(()=>{},["stop"])),class:ye(["truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline",{"text-red-500 pointer-events-none":i.linkNotValid}])},ae(i.linkNotValid?"Link Invalid":`${n.model.quantizer}/${n.model.name}`),11,tTr)]),b("div",nTr,[e[16]||(e[16]=b("i",{"data-feather":"file",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[17]||(e[17]=b("b",{class:"mr-1"},"Size:",-1)),b("span",null,ae(s.fileSize||"N/A"),1)]),b("div",rTr,[e[18]||(e[18]=b("i",{"data-feather":"key",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[19]||(e[19]=b("b",{class:"mr-1"},"License:",-1)),b("span",null,ae(n.model.license||"N/A"),1)]),n.model.quantizer&&n.model.quantizer!=="None"&&n.model.type!=="transformers"?(k(),R("div",iTr,[e[20]||(e[20]=b("i",{"data-feather":"user",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[21]||(e[21]=b("b",{class:"mr-1"},"Quantizer:",-1)),b("a",{href:"https://huggingface.co/"+n.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[5]||(e[5]=oe(()=>{},["stop"])),class:"truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.quantizer),9,sTr)])):ne("",!0),n.model.model_creator?(k(),R("div",oTr,[e[22]||(e[22]=b("i",{"data-feather":"users",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[23]||(e[23]=b("b",{class:"mr-1"},"Creator:",-1)),b("a",{href:n.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[6]||(e[6]=oe(()=>{},["stop"])),class:"truncate hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.model_creator),9,aTr)])):ne("",!0),n.model.last_commit_time?(k(),R("div",lTr,[e[24]||(e[24]=b("i",{"data-feather":"clock",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[25]||(e[25]=b("b",{class:"mr-1"},"Updated:",-1)),b("span",null,ae(s.formatDate(n.model.last_commit_time)),1)])):ne("",!0),n.model.category?(k(),R("div",cTr,[e[26]||(e[26]=b("i",{"data-feather":"grid",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[27]||(e[27]=b("b",{class:"mr-1"},"Category:",-1)),b("span",null,ae(n.model.category),1)])):ne("",!0),n.model.rank?(k(),R("div",uTr,[e[28]||(e[28]=b("i",{"data-feather":"bar-chart-2",class:"w-4 h-4 mr-2 flex-shrink-0"},null,-1)),e[29]||(e[29]=b("b",{class:"mr-1"},"Rank:",-1)),b("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=oe(()=>{},["stop"])),class:"hover:text-blue-600 dark:hover:text-blue-400 duration-150 underline"},ae(n.model.rank),1)])):ne("",!0)],2)])),n.isProcessing?(k(),R("div",dTr,[b("div",fTr,[e[30]||(e[30]=b("div",{role:"status",class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"},[b("svg",{"aria-hidden":"true",class:"w-16 h-16 text-gray-300 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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"})]),b("span",{class:"sr-only"},"Processing...")],-1)),b("div",hTr,[b("div",pTr,[b("span",TTr,ae(n.progressName),1),n.progress>0?(k(),R("span",OTr,ae(Math.floor(n.progress))+"%",1)):ne("",!0)]),n.progress>0?(k(),R("div",mTr,[b("div",{class:"bg-blue-600 h-1.5 rounded-full",style:qn({width:n.progress+"%"})},null,4)])):ne("",!0),n.progress>0&&n.total_size>0?(k(),R("div",gTr,[b("span",null,ae(s.downloaded_size_computed)+"/"+ae(s.total_size_computed),1),b("span",null,ae(s.speed_computed)+"/s",1)])):ne("",!0),b("button",{onClick:e[8]||(e[8]=oe((...a)=>s.handleCancelClick&&s.handleCancelClick(...a),["stop"])),type:"button",title:"Cancel Operation",class:"button-danger-sm w-full mt-2 text-xs"}," Cancel ")])])])):ne("",!0)],42,Vpr)}const _Tr=st(Hpr,[["render",QTr],["__scopeId","data-v-f3f315d6"]]),vTr={props:{show:{type:Boolean,default:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(t){return typeof t=="string"?t:t&&t.name?t.name:""},selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(t){const e=["bytes","KB","MB","GB"];let n=0;for(;t>=1024&&n[n.show?(k(),R("div",yTr,[b("div",bTr,[b("h2",STr,[e[5]||(e[5]=b("svg",{class:"w-6 h-6 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})],-1)),Se(" "+ae(n.title),1)]),b("div",xTr,[b("ul",null,[(k(!0),R(Ve,null,dt(n.choices,(o,a)=>(k(),R("li",{key:a,class:"py-2 px-4 hover:bg-gray-200 dark:hover:bg-gray-600 transition duration-150 ease-in-out"},[b("div",ETr,[b("div",wTr,[o.isEditing?He((k(),R("input",{key:1,"onUpdate:modelValue":l=>o.editName=l,onBlur:l=>s.finishEditing(o),onKeyup:gr(l=>s.finishEditing(o),["enter"]),class:"bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded px-2 py-1 text-sm",autofocus:""},null,40,LTr)),[[vt,o.editName]]):(k(),R("span",{key:0,onClick:l=>s.selectChoice(o),class:ye([{"font-semibold":o===i.selectedChoice},"text-gray-800 dark:text-white cursor-pointer"])},ae(s.displayName(o)),11,CTr)),o.size?(k(),R("span",$Tr,ae(s.formatSize(o.size)),1)):ne("",!0)]),b("div",ATr,[b("button",{onClick:l=>s.editChoice(o),class:"text-blue-500 hover:text-blue-600 mr-2"},e[6]||(e[6]=[b("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)]),8,kTr),n.can_remove?(k(),R("button",{key:0,onClick:l=>s.removeChoice(o,a),class:"text-red-500 hover:text-red-600"},e[7]||(e[7]=[b("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,PTr)):ne("",!0)])])]))),128))])]),i.showInput?(k(),R("div",RTr,[He(b("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 dark:border-gray-600 p-2 rounded-lg w-full mb-2 bg-white dark:bg-gray-700 text-gray-800 dark:text-white"},null,512),[[vt,i.newFilename]]),b("button",{onClick:e[1]||(e[1]=(...o)=>s.addNewFilename&&s.addNewFilename(...o)),class:"bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add ")])):ne("",!0),b("div",MTr,[b("button",{onClick:e[2]||(e[2]=(...o)=>s.closeDialog&&s.closeDialog(...o)),class:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-lg transition duration-300"}," Cancel "),b("button",{onClick:e[3]||(e[3]=(...o)=>s.validateChoice&&s.validateChoice(...o)),disabled:!i.selectedChoice,class:ye([{"bg-blue-500 hover:bg-blue-600":i.selectedChoice,"bg-gray-400 cursor-not-allowed":!i.selectedChoice},"text-white font-bold py-2 px-4 rounded-lg transition duration-300"])}," Validate ",10,DTr),b("button",{onClick:e[4]||(e[4]=(...o)=>s.toggleInput&&s.toggleInput(...o)),class:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg transition duration-300"}," Add New ")])])])):ne("",!0)]),_:1})}const Hoe=st(vTr,[["render",NTr],["__scopeId","data-v-f43216be"]]),ITr={name:"ModelsZooSettings",components:{ModelEntry:_Tr,ChoiceDialog:Hoe},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["setting-updated"],data(){return{allModels:[],filteredModels:[],pagedModels:[],isLoadingModels:!1,isSearching:!1,searchTerm:"",sortOption:"rank",showInstalledOnly:!1,referencePath:"",modelUrl:"",isDownloading:!1,itemsPerPage:15,currentPage:1,searchDebounceTimer:null,downloadProgress:{visible:!1,name:"",progress:0,speed:0,total_size:0,downloaded_size:0,details:null},variantSelectionDialog:{visible:!1,title:"Select Model Variant",choices:[],modelToInstall:null,selectedVariant:null},defaultIcon:F9,store:aW()}},computed:{effectiveConfig(){return this.store.state.config||{}},storeModelsZoo(){return this.store.state.modelsZoo||[]},storeInstalledModelsArr(){return this.store.state.modelsArr||[]},storeBindingsZoo(){return this.store.state.bindingsZoo||[]},currentBindingNameComputed(){const t=this.effectiveConfig.binding_name;if(!t)return"None Selected";const e=this.storeBindingsZoo.find(n=>n.folder===t);return e?e.name:t},currentModelInfoComputed(){const t=this.effectiveConfig.model_name;if(!t||this.allModels.length===0)return null;const e=this.allModels.find(n=>n.name===t);return e?{name:e.name,icon:e.icon||this.defaultIcon}:null},hasMoreModelsToLoad(){return this.pagedModels.length{this.loadMoreModels()})),this.isDownloading||(this.isLoadingModels=!1)}},watchSources:{handler(t,e){(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2])&&(this.currentPage=1,this.pagedModels=[],this.applyFiltersAndSort(),this.$nextTick(()=>{this.loadMoreModels()}))}}},methods:{createModelId(t){return t.name||t.path||`${t.author||"unknown"}-${Date.now()}`},processAndCombineModels(){var o;if(!this.effectiveConfig.binding_name){this.allModels=[],this.isLoadingModels=!1;return}this.isLoadingModels=!0;const t=this.storeModelsZoo||[],e=this.storeInstalledModelsArr||[],n=new Set(e),r=(o=this.downloadProgress.details)==null?void 0:o.model_id,i=t.map(a=>{const l=this.createModelId(a),c=n.has(a.name)||a.variants&&a.variants.some(u=>n.has(u.name));return{name:a.name,author:a.author,rank:a.rank??9999,quantizer:a.quantizer,description:a.description,license:a.license,last_commit_time:a.last_commit_time,variants:a.variants?[...a.variants]:[],filename:a.filename,path:a.path,type:a.type,icon:a.icon||this.defaultIcon,id:l,isInstalled:c,isProcessing:r===l&&this.isDownloading||!1,isCustomModel:!1}}),s=new Set(i.map(a=>a.name));i.forEach(a=>{a.variants&&a.variants.forEach(l=>s.add(l.name))}),e.forEach(a=>{if(!s.has(a)){const l=this.createModelId({name:a});i.push({name:a,author:"Local/Custom",rank:-1,quantizer:"",description:"Locally installed model reference.",license:"",last_commit_time:"",variants:[],filename:"",path:"",type:"",icon:this.defaultIcon,id:l,isInstalled:!0,isProcessing:r===l&&this.isDownloading||!1,isCustomModel:!0})}}),this.allModels=i},applyFiltersAndSort(){this.isSearching=!0;let t=[...this.allModels];if(this.showInstalledOnly&&(t=t.filter(n=>n.isInstalled)),this.searchTerm){const n=this.searchTerm.toLowerCase();t=t.filter(r=>{var i,s,o,a,l;return((i=r.name)==null?void 0:i.toLowerCase().includes(n))||((s=r.author)==null?void 0:s.toLowerCase().includes(n))||((o=r.quantizer)==null?void 0:o.toLowerCase().includes(n))||((a=r.description)==null?void 0:a.toLowerCase().includes(n))||((l=r.license)==null?void 0:l.toLowerCase().includes(n))})}t.sort((n,r)=>r.isInstalled-n.isInstalled);const e=this.sortOption;t.sort((n,r)=>{const i=r.isInstalled-n.isInstalled;if(i!==0)return i;switch(e){case"rank":const s=n.rank??9999,o=r.rank??9999;return s-o;case"name":return(n.name||"").localeCompare(r.name||"");case"last_commit_time":const a=n.last_commit_time||"0";return(r.last_commit_time||"0").localeCompare(a);case"quantizer":return(n.quantizer||"").localeCompare(r.quantizer||"");case"license":return(n.license||"").localeCompare(r.license||"");default:return 0}}),this.filteredModels=t,this.isSearching=!1},debounceSearch(){this.isSearching=!0,clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(()=>{},300)},loadMoreModels(){if(this.isLoadingModels||this.isSearching)return;const t=(this.currentPage-1)*this.itemsPerPage,e=t+this.itemsPerPage,n=this.filteredModels.slice(t,e);n.length>0&&(this.pagedModels.push(...n),this.currentPage++),this.replaceFeatherIcons()},handleSelect(t){console.log("payload:"),console.log(t);const e=t;if(this.isDownloading||this.isLoadingModels){this.show_toast("Wait for current operation to finish.",3,!1);return}if(!e.isInstalled){this.show_toast(`Model "${e.name}" is not installed. Please install it first.`,3,!1);return}this.config.model_name!==e.name&&(this.$emit("setting-updated",{key:"model_name",value:e.name}),this.show_toast(`Selected model: ${e.name}. Remember to apply changes.`,3,!0))},async handleInstall(t){const e=t.model;if(this.isDownloading){this.show_toast("Another operation is already in progress.",3,!1);return}if(!this.effectiveConfig.binding_name){this.show_toast("No binding selected.",4,!1);return}e.variants&&e.variants.length>0?this.variantSelectionDialog={visible:!0,title:`Select Variant for ${e.name}`,choices:e.variants.map(r=>({id:r.name,text:`${r.name} (${O4(r.size||0)})`})),modelToInstall:e,selectedVariant:null}:await this.show_yes_no_dialog(`Install model "${e.name}"?`,"Install","Cancel")&&this.startDownload(e,e.path||e.name)},handleVariantSelected(t){this.variantSelectionDialog.selectedVariant=t},async handleVariantValidated(t){if(!this.variantSelectionDialog.modelToInstall||!t){this.closeVariantDialog();return}const e=this.variantSelectionDialog.modelToInstall.variants.find(i=>i.name===t.id),n=this.variantSelectionDialog.modelToInstall;this.closeVariantDialog(),await this.show_yes_no_dialog(`Install variant "${t.id}" for model "${n.name}"?`,"Install","Cancel")&&this.startDownload(n,e.path||t.id,t.id)},closeVariantDialog(){this.variantSelectionDialog={visible:!1,title:"Select Model Variant",choices:[],modelToInstall:null,selectedVariant:null}},startDownload(t,e,n=null){const r=t.id||this.createModelId(t),i=n||t.name;this.setModelProcessing(r,!0),this.isDownloading=!0,this.isLoadingModels=!0,this.downloadProgress={visible:!0,name:`Installing ${i}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:r,model_name:i,path:e,binding:this.effectiveConfig.binding_name,client_id:this.client_id}},et.emit("install_model",{model_path:e,binding:this.effectiveConfig.binding_name,client_id:this.client_id,model_id:r,model_name:i})},async handleUninstall(t){const e=t.model,n=e.id||this.createModelId(e);if(this.isDownloading){this.show_toast("Another operation is in progress. Please wait.",3,!1);return}if(!await this.show_yes_no_dialog(`Are you sure you want to uninstall the model "${e.name}"?`,"Uninstall","Cancel"))return;const i=this.effectiveConfig.binding_name;if(!i){this.show_toast("No binding selected. Cannot uninstall.",4,!1);return}this.setModelProcessing(n,!0),this.isDownloading=!0,this.isLoadingModels=!0,this.downloadProgress={visible:!0,name:`Uninstalling ${e.name}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:n,model_name:e.name}},et.emit("uninstall_model",{model_name:e.name,binding:i,client_id:this.client_id,model_id:n})},handleCancelInstall(t){if(!t||!this.isDownloading)return;const e={model_id:t.model_id,model_path:t.path,binding:t.binding,client_id:this.client_id};et.emit("cancel_install",e),this.show_toast(`Cancellation request sent for ${t.model_name}.`,3,!0)},handleCopy(t){navigator.clipboard.writeText(t.text).then(()=>{this.show_toast("Copied to clipboard!",2,!0)}).catch(e=>{this.show_toast("Failed to copy text.",4,!1)})},handleCopyLink(t){navigator.clipboard.writeText(t.link).then(()=>{this.show_toast("Model link copied!",2,!0)}).catch(e=>{this.show_toast("Failed to copy link.",4,!1)})},async createReference(){if(!this.referencePath){this.show_toast("Please enter a valid file or folder path.",3,!1);return}const t=this.effectiveConfig.binding_name;if(!t){this.show_toast("No binding selected. Cannot add reference.",4,!1);return}try{this.isLoadingModels=!0;const e=await this.api_post_req("add_reference",{binding:t,path:this.referencePath,client_id:this.client_id});e&&e.status==="success"?(this.show_toast(e.message||"Reference added successfully.",2,!0),this.referencePath="",this.store.dispatch("refreshModels")):this.show_toast(e.error||"Failed to add reference.",4,!1)}catch(e){this.show_toast(`Error adding reference: ${e.message||e}`,4,!1)}finally{this.isLoadingModels=!1}},installFromInput(){if(!this.modelUrl){this.show_toast("Please enter a Model URL or Hugging Face ID.",3,!1);return}if(this.isDownloading){this.show_toast("Another operation is already in progress.",3,!1);return}const t=this.effectiveConfig.binding_name;if(!t){this.show_toast("No binding selected. Cannot download.",4,!1);return}const e=this.modelUrl.split("/").pop()||this.modelUrl,n=`download-${e}-${Date.now()}`;this.isDownloading=!0,this.isLoadingModels=!0,this.setModelProcessing(n,!0),this.downloadProgress={visible:!0,name:`Initiating install for ${e}...`,progress:0,speed:0,total_size:0,downloaded_size:0,details:{model_id:n,model_name:e,path:this.modelUrl,binding:t,client_id:this.client_id}},et.emit("install_model",{model_path:this.modelUrl,binding:t,client_id:this.client_id,model_id:n,model_name:e}),this.modelUrl=""},imgPlaceholder(t){t.target.src=this.defaultIcon},setModelProcessing(t,e){const n=this.allModels.findIndex(i=>i.id===t);if(n!==-1){const i={...this.allModels[n],isProcessing:e},s=[...this.allModels];s[n]=i,this.allModels=s}const r=this.pagedModels.findIndex(i=>i.id===t);r!==-1&&(this.pagedModels[r].isProcessing=e)},resetDownloadState(t=null,e=!1){const n=this.downloadProgress.details;t&&n&&n.model_id===t&&this.setModelProcessing(t,!1),(!t||n&&n.model_id===t)&&(this.downloadProgress={visible:!1,name:"",progress:0,speed:0,total_size:0,downloaded_size:0,details:null},this.isDownloading=!1),this.isDownloading||(this.isLoadingModels=!1),e&&(this.store.dispatch("refreshModels"),this.store.dispatch("refreshModelsZoo"))},installProgressListener(t){var r,i,s,o;const e=t.model_id,n=(r=this.downloadProgress.details)==null?void 0:r.model_id;!e||e!==n||(t.status==="progress"?(this.downloadProgress.name=t.stage||`Processing ${t.model_name||"model"}...`,this.downloadProgress.progress=t.progress||0,this.downloadProgress.speed=t.speed||0,this.downloadProgress.total_size=t.total_size||0,this.downloadProgress.downloaded_size=t.downloaded_size||0):t.status==="cancelled"?(this.show_toast(`Operation cancelled for ${((i=this.downloadProgress.details)==null?void 0:i.model_name)||"model"}.`,3,!0),this.resetDownloadState(e,!1)):t.status==="failed"?(this.show_toast(t.error||`Operation failed for ${((s=this.downloadProgress.details)==null?void 0:s.model_name)||"model"}.`,4,!1),this.resetDownloadState(e,!1)):t.status==="success"?(this.show_toast(t.message||`${((o=this.downloadProgress.details)==null?void 0:o.model_name)||"Model"} operation successful.`,2,!0),this.resetDownloadState(e,!0)):t.status==="processing"&&(this.downloadProgress.name=t.stage||`Processing ${t.model_name||"model"}...`,this.downloadProgress.progress=t.progress!==void 0?t.progress:100),this.replaceFeatherIcons())},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.installProgressListener=this.installProgressListener.bind(this),et.on("install_progress",this.installProgressListener),this.effectiveConfig.binding_name?this.processAndCombineModels():this.isLoadingModels=!1,this.replaceFeatherIcons()},unmounted(){et.off("install_progress",this.installProgressListener),clearTimeout(this.searchDebounceTimer)},updated(){this.replaceFeatherIcons()}},HTr={class:"user-settings-panel space-y-6"},VTr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},qTr={key:0,class:"flex items-center gap-2 text-sm font-medium p-2 bg-blue-100 dark:bg-blue-800/50 rounded-md border border-blue-300 dark:border-blue-600 shrink-0 text-blue-700 dark:text-blue-200"},UTr=["src"],BTr={class:"font-semibold"},zTr={key:1,class:"text-sm font-medium text-orange-600 dark:text-orange-400 p-2 bg-orange-100 dark:bg-orange-900/30 rounded-md border border-orange-300 dark:border-orange-600 shrink-0"},XTr={key:2,class:"text-sm font-medium text-red-600 dark:text-red-400 p-2 bg-red-100 dark:bg-red-900/30 rounded-md border border-red-300 dark:border-red-600 shrink-0"},FTr={class:"text-sm text-blue-600 dark:text-blue-400"},jTr={class:"font-semibold"},YTr={key:0,class:"p-3 text-center text-orange-600 dark:text-orange-400 bg-orange-100 dark:bg-orange-900/30 rounded-md border border-orange-300 dark:border-orange-600"},GTr={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4 items-center"},WTr={class:"relative md:col-span-2"},ZTr={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center"},KTr={class:"flex items-center space-x-2"},JTr={for:"model-filter-installed",class:"flex items-center space-x-1 cursor-pointer text-sm label"},eOr={key:1,class:"flex justify-center items-center p-10 text-loading"},tOr={key:2,class:"text-center text-blue-500 dark:text-blue-400 py-10"},nOr={key:3,class:"text-center text-blue-500 dark:text-blue-400 py-10"},rOr={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",ref:"scrollContainer"},iOr={key:4,class:"mt-6 text-center"},sOr=["disabled"],oOr={key:0},aOr={key:1},lOr={class:"pt-6 border-t border-blue-200 dark:border-blue-700 mt-6"},cOr={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},uOr={class:"flex"},dOr={class:"flex"},fOr=["disabled"],hOr=["data-feather"],pOr={key:0,class:"mt-4 p-3 bg-blue-100 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded-md"},TOr={class:"flex justify-between items-center mb-1"},OOr={class:"text-sm font-medium text-blue-700 dark:text-blue-300"},mOr={class:"text-xs font-medium text-progress"},gOr={class:"animated-progressbar-bg h-1.5"},QOr={class:"flex justify-between items-center mt-1 text-xs text-progress"};function _Or(t,e,n,r,i,s){const o=Xe("ModelEntry"),a=Xe("ChoiceDialog");return k(),R("div",HTr,[b("div",VTr,[e[12]||(e[12]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 mb-2 sm:mb-0"}," Models Zoo ",-1)),s.currentModelInfoComputed?(k(),R("div",qTr,[b("img",{src:s.currentModelInfoComputed.icon,onError:e[0]||(e[0]=(...l)=>s.imgPlaceholder&&s.imgPlaceholder(...l)),class:"w-6 h-6 rounded-lg object-cover flex-shrink-0",alt:"Current Model Icon"},null,40,UTr),b("span",null,[e[11]||(e[11]=Se("Active: ")),b("span",BTr,ae(s.currentModelInfoComputed.name),1)])])):s.effectiveConfig.binding_name?(k(),R("div",XTr," No model selected! ")):(k(),R("div",zTr," Select a Binding first! "))]),b("p",FTr,[e[13]||(e[13]=Se(" Select a model compatible with your chosen binding (")),b("span",jTr,ae(s.currentBindingNameComputed||"None Selected"),1),e[14]||(e[14]=Se("). Installed models are shown first. Models may require specific variants (e.g., GGUF, GPTQ) depending on the binding. "))]),s.effectiveConfig.binding_name?ne("",!0):(k(),R("div",YTr," Please select a Binding from the 'Bindings' section to see available models. ")),b("div",GTr,[b("div",WTr,[e[16]||(e[16]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[1]||(e[1]=l=>i.searchTerm=l),placeholder:"Search models...",class:"input search-input pl-10 w-full",onInput:e[2]||(e[2]=(...l)=>s.debounceSearch&&s.debounceSearch(...l))},null,544),[[vt,i.searchTerm]]),i.isSearching?(k(),R("div",ZTr,e[15]||(e[15]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 text-blue-400 animate-spin dark:text-blue-500 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0)]),b("div",KTr,[b("label",JTr,[He(b("input",{type:"checkbox",id:"model-filter-installed","onUpdate:modelValue":e[3]||(e[3]=l=>i.showInstalledOnly=l),class:"rounded text-blue-600 focus:ring-blue-500 border-blue-300 dark:border-blue-600 bg-blue-100 dark:bg-blue-700 focus:ring-offset-blue-100 dark:focus:ring-offset-blue-800"},null,512),[[W3,i.showInstalledOnly]]),e[17]||(e[17]=b("span",null,"Installed Only",-1))])]),b("div",null,[e[19]||(e[19]=b("label",{for:"model-sort",class:"sr-only"},"Sort models by",-1)),He(b("select",{id:"model-sort","onUpdate:modelValue":e[4]||(e[4]=l=>i.sortOption=l),class:"input"},e[18]||(e[18]=[To('Sort by Rank Sort by Name Sort by Date Sort by Quantizer Sort by License ',5)]),512),[[$s,i.sortOption]])])]),i.isLoadingModels?(k(),R("div",eOr,e[20]||(e[20]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-300 animate-spin dark:text-blue-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading models...",-1)]))):i.pagedModels.length===0&&i.filteredModels.length>0?(k(),R("div",tOr," No models found matching filters"+ae(i.searchTerm?' and search "'+i.searchTerm+'"':"")+". ",1)):i.allModels.length===0&&!i.isLoadingModels&&s.effectiveConfig.binding_name?(k(),R("div",nOr," No models available for the selected binding. Try adding a reference or downloading below. ")):ne("",!0),b("div",rOr,[(k(!0),R(Ve,null,dt(i.pagedModels,l=>{var c,u,d,f,h;return k(),Qt(o,{key:l.id,model:l,"is-selected":n.config.model_name===l.name,"is-installed":l.isInstalled,"is-processing":l.isProcessing,progress:((c=i.downloadProgress.details)==null?void 0:c.model_id)===l.id?i.downloadProgress.progress:0,speed:((u=i.downloadProgress.details)==null?void 0:u.model_id)===l.id?i.downloadProgress.speed:0,total_size:((d=i.downloadProgress.details)==null?void 0:d.model_id)===l.id?i.downloadProgress.total_size:0,downloaded_size:((f=i.downloadProgress.details)==null?void 0:f.model_id)===l.id?i.downloadProgress.downloaded_size:0,"progress-name":((h=i.downloadProgress.details)==null?void 0:h.model_id)===l.id?i.downloadProgress.name:"",onSelect:s.handleSelect,onInstall:s.handleInstall,onUninstall:s.handleUninstall,onCancelInstall:s.handleCancelInstall,onCopy:s.handleCopy,onCopyLink:s.handleCopyLink},null,8,["model","is-selected","is-installed","is-processing","progress","speed","total_size","downloaded_size","progress-name","onSelect","onInstall","onUninstall","onCancelInstall","onCopy","onCopyLink"])}),128))],512),s.hasMoreModelsToLoad?(k(),R("div",iOr,[b("button",{onClick:e[5]||(e[5]=(...l)=>s.loadMoreModels&&s.loadMoreModels(...l)),disabled:i.isLoadingModels||i.isSearching,class:"btn btn-secondary"},[i.isLoadingModels||i.isSearching?(k(),R("span",oOr,e[21]||(e[21]=[b("svg",{"aria-hidden":"true",class:"w-4 h-4 mr-1 inline animate-spin text-blue-400 dark:text-blue-500 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),Se(" Loading... ")]))):(k(),R("span",aOr,"Load More Models ("+ae(i.filteredModels.length-i.pagedModels.length)+" remaining)",1))],8,sOr)])):ne("",!0),b("section",lOr,[e[26]||(e[26]=b("h3",{class:"text-lg font-medium text-blue-700 dark:text-blue-300 mb-3"},"Add Model",-1)),b("div",cOr,[b("div",null,[e[22]||(e[22]=b("label",{for:"reference_path",class:"label mb-1"},"Add Reference to Local Model File/Folder",-1)),b("div",uOr,[He(b("input",{type:"text",id:"reference_path","onUpdate:modelValue":e[6]||(e[6]=l=>i.referencePath=l),class:"input input-sm rounded-r-none flex-grow",placeholder:"Enter full path..."},null,512),[[vt,i.referencePath]]),b("button",{onClick:e[7]||(e[7]=(...l)=>s.createReference&&s.createReference(...l)),class:"btn btn-primary btn-sm rounded-l-none flex-shrink-0",title:"Add Reference"},"Add")]),e[23]||(e[23]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mt-1"},"Creates a link without copying the model.",-1))]),b("div",null,[e[24]||(e[24]=b("label",{for:"model_url",class:"label mb-1"},"Download Model from URL or Hugging Face ID",-1)),b("div",dOr,[He(b("input",{type:"text",id:"model_url","onUpdate:modelValue":e[8]||(e[8]=l=>i.modelUrl=l),class:"input input-sm rounded-r-none flex-grow",placeholder:"Enter URL or HF ID..."},null,512),[[vt,i.modelUrl]]),b("button",{onClick:e[9]||(e[9]=(...l)=>s.installFromInput&&s.installFromInput(...l)),class:"btn btn-success btn-sm rounded-l-none flex-shrink-0",title:"Download and Install",disabled:i.isDownloading},[b("i",{"data-feather":i.isDownloading?"loader":"download",class:ye(["w-4 h-4",i.isDownloading?"animate-spin":""])},null,10,hOr)],8,fOr)]),e[25]||(e[25]=b("p",{class:"text-xs text-blue-500 dark:text-blue-400 mt-1"},"Downloads the model to the binding's models folder.",-1))])]),i.downloadProgress.visible?(k(),R("div",pOr,[b("div",TOr,[b("span",OOr,ae(i.downloadProgress.name),1),b("span",mOr,ae(i.downloadProgress.progress.toFixed(1))+"%",1)]),b("div",gOr,[b("div",{class:"animated-progressbar-fg h-1.5 rounded-full",style:qn({width:i.downloadProgress.progress+"%"})},null,4)]),b("div",QOr,[b("span",null,ae(s.downloadedSizeComputed)+" / "+ae(s.totalSizeComputed),1),b("span",null,ae(s.speedComputed)+"/s",1)]),b("button",{onClick:e[10]||(e[10]=l=>s.handleCancelInstall(i.downloadProgress.details)),class:"btn btn-secondary btn-sm mt-2 text-xs text-red-500 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-700"},"Cancel Operation")])):ne("",!0)]),te(a,{show:i.variantSelectionDialog.visible,title:i.variantSelectionDialog.title,choices:i.variantSelectionDialog.choices,onChoiceSelected:s.handleVariantSelected,onChoiceValidated:s.handleVariantValidated,onCloseDialog:s.closeVariantDialog},null,8,["show","title","choices","onChoiceSelected","onChoiceValidated","onCloseDialog"])])}const vOr=st(ITr,[["render",_Or],["__scopeId","data-v-5fda03e7"]]),yOr={name:"PersonalityEntry",components:{InteractiveMenu:KC},props:{personality:{type:Object,required:!0},select_language:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},full_path:{type:String,required:!0},isMounted:{type:Boolean,default:!1},isProcessing:{type:Boolean,default:!1},isStarred:{type:Boolean,default:!1},baseUrl:{type:String,default:""}},emits:["select","mount","unmount","remount","edit","copy-to-custom","reinstall","settings","copy-personality-name","open-folder","error","toggle-star"],data(){return{selectedLanguage:this.personality.language||"",showHelpPopup:!1,renderedHelp:""}},computed:{personalityId(){return this.personality.id||this.full_path.replace(/[/:]/g,"-")},renderedDescription(){return this.personality.description?/<[a-z][\s\S]*>/i.test(this.personality.description)?C4.sanitize(this.personality.description):this.escapeHtml(this.personality.description).replace(/\n/g," "):"No description available."},commandsList(){let t=[];return this.isMounted?(t.push({name:"unmount",icon:"feather:stop-circle",is_file:!1,value:this.emitUnmount}),t.push({name:"remount",icon:"feather:refresh-cw",is_file:!1,value:this.emitRemount})):t.push({name:"mount",icon:"feather:play",is_file:!1,value:this.emitMount}),t.push({name:"reinstall",icon:"feather:download-cloud",is_file:!1,value:this.emitReinstall}),this.full_path.startsWith("custom_personalities/")||this.personality.category==="custom_personalities"?t.push({name:"edit",icon:"feather:edit-3",is_file:!1,value:this.emitEdit}):t.push({name:"Copy to custom personalities",icon:"feather:copy",is_file:!1,value:this.emitCopyToCustom}),this.isActive&&this.personality.has_scripts&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.emitSettings}),t.push({name:"Open Folder",icon:"feather:folder",is_file:!1,value:this.emitOpenFolder}),t.push({name:"Copy Name",icon:"feather:clipboard",is_file:!1,value:this.emitCopyName}),t}},watch:{"personality.language"(t){const e=t||"";this.selectedLanguage!==e&&(this.selectedLanguage=e)},isStarred(){this.updateFeatherIcons()},isMounted(){this.updateFeatherIcons()},isActive(){this.updateFeatherIcons()},isProcessing(){this.updateFeatherIcons()}},methods:{escapeHtml(t){return t?t.replace(/&/g,"&").replace(/ /g,">").replace(/"/g,'"').replace(/'/g,"'"):""},updateFeatherIcons(){Fe(()=>{try{this.$el&&this.$el.parentNode&&Re.replace()}catch(t){console.error("Feather icons replacement failed:",t)}})},formatDate(t){if(!t)return"";try{const e={year:"numeric",month:"short",day:"numeric"};return new Date(t).toLocaleDateString(void 0,e)}catch{return t}},getPersonalityIconUrl(t){if(!t)return Eo;const e=this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl,n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`},handleImgError(t){t.target.src=Eo,this.$emit("error",{type:"image_load",message:"Failed to load personality icon",event:t})},handleSelect(){this.$emit("select",{personality:{...this.personality,language:this.selectedLanguage}})},handleLanguageChange(){},emitAction(t){const e={personality:{...this.personality,language:this.selectedLanguage||""}};this.$emit(t,e)},toggleStar(){this.emitAction("toggle-star")},emitMount(){this.emitAction("mount")},emitUnmount(){this.emitAction("unmount")},emitRemount(){this.emitAction("remount")},emitReinstall(){this.emitAction("reinstall")},emitEdit(){this.emitAction("edit")},emitCopyToCustom(){this.emitAction("copy-to-custom")},emitSettings(){this.emitAction("settings")},emitOpenFolder(){this.emitAction("open-folder")},emitCopyName(){this.emitAction("copy-personality-name")},showHelp(){if(this.personality.help){Kt.setOptions({gfm:!0,breaks:!0,mangle:!1,headerIds:!1});try{const t=Kt.parse(this.personality.help);this.renderedHelp=C4.sanitize(t),this.showHelpPopup=!0,this.updateFeatherIcons()}catch{this.renderedHelp="Error displaying help content.
",this.showHelpPopup=!0,this.updateFeatherIcons()}}},closeHelp(){this.showHelpPopup=!1,this.updateFeatherIcons()}},mounted(){this.selectedLanguage=this.personality.language||"",this.updateFeatherIcons()}},bOr=["title"],SOr={key:0,class:"absolute inset-0 bg-blue-400 dark:bg-blue-700 bg-opacity-50 dark:bg-opacity-50 flex items-center justify-center rounded-lg z-20"},xOr=["title"],EOr={key:0,"data-feather":"star",class:"w-5 h-5 fill-current"},wOr={key:1,"data-feather":"star",class:"w-5 h-5 stroke-current"},COr={class:"flex-grow flex flex-col"},LOr={class:"flex items-start mb-3"},$Or=["src"],AOr={class:"flex-grow overflow-hidden min-w-0"},kOr=["title"],POr=["title"],ROr=["title"],MOr=["title"],DOr={class:"text-xs text-blue-400 dark:text-blue-500 mb-3 space-y-1"},NOr={key:0},IOr={key:1},HOr={class:"mb-4 flex-grow"},VOr=["innerHTML"],qOr={key:0,class:"mb-3 mt-auto"},UOr=["for"],BOr=["id"],zOr=["value"],XOr={class:"mt-auto pt-3 border-t border-blue-200 dark:border-blue-700"},FOr={class:"flex justify-between items-center"},jOr={class:"flex space-x-1"},YOr={class:"card w-full max-w-2xl max-h-[80vh] flex flex-col"},GOr={class:"flex justify-between items-center mb-4 border-b pb-2 border-blue-200 dark:border-blue-600"},WOr={class:"text-xl font-bold text-blue-800 dark:text-blue-100"},ZOr={class:"flex-grow overflow-y-auto scrollbar prose-blue max-w-none pr-2"},KOr=["innerHTML"],JOr={class:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-600 text-right"};function emr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["app-card relative flex flex-col",{"border-2 border-blue-500 dark:border-blue-400 shadow-lg":n.isActive,"border-blue-200 dark:border-blue-700":!n.isActive,"opacity-50 pointer-events-none":n.isProcessing}]),title:n.personality.tool_description||n.personality.description||n.personality.name,onClick:e[12]||(e[12]=(...a)=>s.handleSelect&&s.handleSelect(...a))},[n.isProcessing?(k(),R("div",SOr,e[13]||(e[13]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 text-blue-200 animate-spin dark:text-blue-600 fill-blue-600 dark:fill-blue-300",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0),b("button",{onClick:e[0]||(e[0]=oe((...a)=>s.toggleStar&&s.toggleStar(...a),["stop"])),class:"absolute top-2 right-2 svg-button text-yellow-400 hover:text-yellow-500 dark:text-yellow-500 dark:hover:text-yellow-400 z-10",title:n.isStarred?"Unstar":"Star"},[n.isStarred?(k(),R("i",EOr)):(k(),R("i",wOr))],8,xOr),b("div",COr,[b("div",LOr,[b("img",{src:s.getPersonalityIconUrl(n.personality.avatar),onError:e[1]||(e[1]=(...a)=>s.handleImgError&&s.handleImgError(...a)),alt:"Personality Icon",class:"w-16 h-16 rounded-lg object-cover mr-4 flex-shrink-0 border border-blue-200 dark:border-blue-600 shadow-sm"},null,40,$Or),b("div",AOr,[b("h3",{class:"font-bold text-lg text-blue-800 dark:text-blue-100 truncate",title:n.personality.name},ae(n.personality.name),9,kOr),n.personality.author?(k(),R("p",{key:0,class:"text-xs text-blue-500 dark:text-blue-400 truncate",title:`By ${n.personality.author}`}," By "+ae(n.personality.author),9,POr)):ne("",!0),n.personality.version?(k(),R("p",{key:1,class:"text-xs text-blue-500 dark:text-blue-400",title:`Version: ${n.personality.version}`}," v"+ae(n.personality.version),9,ROr)):ne("",!0),n.personality.category?(k(),R("p",{key:2,class:"text-xs text-blue-500 dark:text-blue-400 truncate",title:`Category: ${n.personality.category}`},ae(n.personality.category),9,MOr)):ne("",!0)]),n.personality.help?(k(),R("button",{key:0,onClick:e[2]||(e[2]=oe((...a)=>s.showHelp&&s.showHelp(...a),["stop"])),class:"ml-2 svg-button text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300 flex-shrink-0 -mr-1",title:"Help"},e[14]||(e[14]=[b("i",{"data-feather":"help-circle",class:"h-5 w-5"},null,-1)]))):ne("",!0)]),b("div",DOr,[n.personality.creation_date?(k(),R("p",NOr,"Created: "+ae(s.formatDate(n.personality.creation_date)),1)):ne("",!0),n.personality.last_update_date?(k(),R("p",IOr,"Updated: "+ae(s.formatDate(n.personality.last_update_date)),1)):ne("",!0)]),b("div",HOr,[b("p",{class:"text-sm text-blue-700 dark:text-blue-300 h-20 overflow-y-auto scrollbar",innerHTML:s.renderedDescription},null,8,VOr)]),n.select_language&&n.personality.languages&&n.personality.languages.length>0&&!n.isMounted?(k(),R("div",qOr,[b("label",{for:"lang-select-"+s.personalityId,class:"label mb-1"},"Language:",8,UOr),He(b("select",{id:"lang-select-"+s.personalityId,"onUpdate:modelValue":e[3]||(e[3]=a=>i.selectedLanguage=a),onClick:e[4]||(e[4]=oe(()=>{},["stop"])),onChange:e[5]||(e[5]=(...a)=>s.handleLanguageChange&&s.handleLanguageChange(...a)),class:"input w-full text-sm"},[e[15]||(e[15]=b("option",{value:""},"Default",-1)),(k(!0),R(Ve,null,dt(n.personality.languages,a=>(k(),R("option",{key:a,value:a},ae(a),9,zOr))),128))],40,BOr),[[$s,i.selectedLanguage]])])):ne("",!0),b("div",XOr,[b("div",FOr,[b("div",jOr,[n.isMounted?(k(),R("button",{key:1,onClick:e[7]||(e[7]=oe(a=>s.emitAction("unmount"),["stop"])),class:"btn btn-sm bg-red-600 hover:bg-red-700 text-white focus:ring-red-500 dark:bg-red-700 dark:hover:bg-red-600 dark:focus:ring-red-600",title:"Unmount personality"},e[17]||(e[17]=[b("div",{class:"flex items-center"},[b("i",{"data-feather":"stop-circle",class:"w-3 h-3 mr-1 stroke-current"}),Se("Unmount")],-1)]))):(k(),R("button",{key:0,onClick:e[6]||(e[6]=oe(a=>s.emitAction("mount"),["stop"])),class:"btn btn-sm btn-success",title:"Mount personality"},e[16]||(e[16]=[b("div",{class:"flex items-center"},[b("i",{"data-feather":"play",class:"w-3 h-3 mr-1 stroke-current"}),Se("Mount")],-1)]))),n.isMounted?(k(),R("button",{key:2,onClick:e[8]||(e[8]=oe(a=>s.emitAction("remount"),["stop"])),class:"svg-button p-1",title:"Remount personality"},e[18]||(e[18]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4"},null,-1)]))):ne("",!0)]),te(o,{commands:s.commandsList,force_position:2,title:"More actions",class:"p-1"},{trigger:Ie(()=>e[19]||(e[19]=[b("button",{class:"svg-button p-1"},[b("i",{"data-feather":"more-vertical",class:"w-5 h-5"})],-1)])),_:1},8,["commands"])])])]),i.showHelpPopup?(k(),R("div",{key:1,onClick:e[11]||(e[11]=oe(()=>{},["stop"])),class:"fixed inset-0 bg-black bg-opacity-70 flex justify-center items-center z-50 p-4"},[b("div",YOr,[b("div",GOr,[b("h2",WOr,"Help: "+ae(n.personality.name),1),b("button",{onClick:e[9]||(e[9]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"svg-button hover:text-red-600 dark:hover:text-red-500 p-1"},e[20]||(e[20]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]))]),b("div",ZOr,[b("div",{innerHTML:i.renderedHelp},null,8,KOr)]),b("div",JOr,[b("button",{onClick:e[10]||(e[10]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"btn btn-primary"},"Close")])])])):ne("",!0)],10,bOr)}const tmr=st(yOr,[["render",emr],["__scopeId","data-v-f2a4e010"]]),nmr="/",rmr={name:"PersonalitiesZoo",components:{PersonalityEntry:tmr},props:{config:Object,api_get_req:Function,api_post_req:Function,show_toast:Function,show_yes_no_dialog:Function,show_message_box:Function,client_id:String,show_universal_form:Function},emits:["setting-updated"],data(){return{allPersonalities:[],persCatgArr:[],selectedCategory:"",searchTermInput:"",activeSearchTerm:"",isLoading:!1,bUrl:nmr,defaultPersonalityIcon_:Eo,maxDisplayedMounted:5}},computed:{allStorePersonalities(){return this.$store.getters.getPersonalities||[]},starredPersonalitiesPaths(){return this.$store.getters.getStarredPersonalities||[]},mountedPersArr(){var e;if(!((e=this.$store.state.config)!=null&&e.personalities)||this.allStorePersonalities.length===0)return[];const t=new Set(this.$store.state.config.personalities);return this.allStorePersonalities.filter(n=>{const r=n.full_path,i=Array.isArray(n.languages)?n.languages.map(s=>`${r}:${s}`):[];return t.has(r)||i.some(s=>t.has(s))}).sort((n,r)=>(n.name||"").localeCompare(r.name||""))},active_personality_name(){const t=this.$store.state.config;if(!t||t.active_personality_id<0||!t.personalities||t.active_personality_id>=t.personalities.length)return null;const e=t.personalities[t.active_personality_id],n=e?e.split(":")[0]:null,r=this.allStorePersonalities.find(i=>i.full_path===n);return r?r.name:null},displayedMountedPersonalities(){return this.mountedPersArr.slice(0,this.maxDisplayedMounted)},filteredPersonalities(){let t=[...this.allStorePersonalities];const e=new Set(this.starredPersonalitiesPaths);if(this.selectedCategory==="Mounted"?t=t.filter(n=>n.isMounted):this.selectedCategory==="Starred"?t=t.filter(n=>e.has(n.full_path)):this.selectedCategory&&(t=t.filter(n=>n.category===this.selectedCategory)),this.activeSearchTerm){const n=this.activeSearchTerm.toLowerCase().trim();n&&(t=t.filter(r=>r.name&&r.name.toLowerCase().includes(n)||r.author&&r.author.toLowerCase().includes(n)||r.description&&r.description.toLowerCase().includes(n)||r.full_path&&r.full_path.toLowerCase().includes(n)))}return t.sort((n,r)=>{const i=e.has(n.full_path),s=e.has(r.full_path);if(i&&!s)return-1;if(!i&&s)return 1;if(n.isMounted&&!r.isMounted)return-1;if(!n.isMounted&&r.isMounted)return 1;const o=n.name||"",a=r.name||"";return o.localeCompare(a)}),t}},watch:{"config.personality_category":{handler(t){const e=t||"",n=["","Mounted","Starred",...this.persCatgArr];this.selectedCategory!==e&&n.includes(e)&&(this.selectedCategory=e)},immediate:!0},selectedCategory(t){this.activeSearchTerm="",this.searchTermInput="",Fe(()=>this.resetScroll())},"$store.state.personalities":{handler(t){this.syncLocalMountedFlags()},deep:!0,immediate:!1}},methods:{async fetchCategories(){try{const t=await this.api_get_req("list_personalities_categories");this.persCatgArr=t?t.sort():[]}catch(t){console.error("Error fetching categories:",t)}},async fetchInitialData(){this.isLoading=!0;try{await this.fetchCategories(),this.syncLocalMountedFlags()}catch(t){console.error("Error fetching initial data:",t),this.show_toast(`Error loading data: ${t.message}`,4,!1)}finally{this.isLoading=!1,Fe(()=>{Re.replace(),this.resetScroll()})}},handleCategoryChange(){Fe(()=>this.resetScroll())},applySearch(){this.activeSearchTerm=this.searchTermInput,Fe(()=>this.resetScroll())},clearSearch(){this.searchTermInput="",this.activeSearchTerm="",Fe(()=>this.resetScroll())},toggleStar(t){this.$store.dispatch("toggleStarPersonality",t.personality)},resetScroll(){const t=this.$refs.gridContainer;t&&(t.scrollTop=0)},syncLocalMountedFlags(){var e;const t=new Set(((e=this.$store.state.config)==null?void 0:e.personalities)||[]);this.allStorePersonalities.forEach(n=>{const r=n.full_path,i=Array.isArray(n.languages)?n.languages.map(o=>`${r}:${o}`):[],s=t.has(r)||i.some(o=>t.has(o));n.isMounted!==s&&this.$store.commit("updatePersonality",{...n,isMounted:s})})},personalityImgPlaceholder(t){t.target.src=this.defaultPersonalityIcon_},getPersonalityIconUrl(t){if(!t)return this.defaultPersonalityIcon_;const e=t.startsWith("/")?t.substring(1):t,n=this.bUrl.endsWith("/")||e.startsWith("/")?"":"/";let r=e==="/"?"":e;return`${this.bUrl}${n}${r}`},isActivePersonality(t){const e=this.$store.state.config;if(!e||e.active_personality_id<0||!e.personalities)return!1;const n=e.personalities[e.active_personality_id],r=n?n.split(":")[0]:null;return t.full_path===r},setPersonalityProcessing(t,e){const n=t.personality.id||t.personality.full_path,r=this.allStorePersonalities.find(i=>(i.id||i.full_path)===n);r?this.$store.commit("updatePersonality",{...r,isProcessing:e}):console.warn("Cannot find personality in store to set processing state:",n)},getCategoryCount(t){return this.allStorePersonalities.filter(e=>e.category===t).length},getStarredCount(){const t=new Set(this.starredPersonalitiesPaths);return this.allStorePersonalities.filter(e=>t.has(e.full_path)).length},getResultLabel(){return this.selectedCategory==="Mounted"?"Mounted Personalities":this.selectedCategory==="Starred"?"Starred Personalities":this.selectedCategory?`Personalities in "${this.selectedCategory}"`:"All Personalities"},getResultMessageQualifier(){return this.selectedCategory==="Mounted"?" in Mounted":this.selectedCategory==="Starred"?" in Starred":this.selectedCategory?` in category "${this.selectedCategory}"`:""},async onPersonalitySelected(t){const e=t.personality;if(this.isLoading||e.isProcessing){this.show_toast("Loading...",4,!1);return}if(!e.isMounted){this.show_toast(`Mount "${e.name}" first.`,3,!1);return}if(this.isActivePersonality(e)){this.show_toast(`"${e.name}" is already active.`,3,!1);return}this.setPersonalityProcessing(t,!0),this.show_toast(`Selecting ${e.name}...`,2,!0);const n=await this.select_personality(e);n&&n.status?(this.show_toast(`Selected personality: ${e.name}`,4,!0),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities")):this.show_toast(`Failed to select ${e.name}: ${(n==null?void 0:n.error)||"Unknown error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async select_personality(t){var o;if(!t)return{status:!1,error:"no personality provided"};const e=((o=this.$store.state.config)==null?void 0:o.personalities)||[],n=t.language?`${t.full_path}:${t.language}`:null;let r=null;if(n&&e.includes(n)?r=n:e.includes(t.full_path)&&(r=t.full_path),!r)return{status:!1,error:"Personality variant not found in mounted list"};const i=e.findIndex(a=>a===r);if(i===-1)return{status:!1,error:"Internal error finding personality ID"};const s={id:i};try{return await this.api_post_req("select_personality",s)}catch(a){return{status:!1,error:a.message}}},async mountPersonality(t){const e=t.personality;if(e.isMounted||e.isProcessing||e.disclaimer&&e.disclaimer.trim()!==""&&!await this.show_yes_no_dialog(`Disclaimer for ${e.name}:
${e.disclaimer}
Mount this personality?`,"Mount","Cancel"))return;this.setPersonalityProcessing(t,!0),this.show_toast(`Mounting ${e.name}...`,3,!0);const n=await this.mount_personality(e);if(n&&n.status){await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast(`Personality "${e.name}" mounted`,4,!0);const r=this.$store.state.config;if((r==null?void 0:r.active_personality_id)>-1){const i=e.language?`${e.full_path}:${e.language}`:e.full_path,s=r.personalities[r.active_personality_id];i===s&&this.show_toast(`${e.name} mounted and selected`,4,!0)}}else this.show_toast(`Could not mount personality
Error: ${(n==null?void 0:n.error)||"Unknown error"}`,4,!1);this.setPersonalityProcessing(t,!1)},async mount_personality(t){if(!t)return{status:!1,error:"no personality provided"};try{const e={language:t.language||"",category:t.category||"",folder:t.folder||""};return await this.api_post_req("mount_personality",e)}catch(e){return{status:!1,error:e.message}}},async unmountPersonality(t){const e=t.personality;if(!e.isMounted||e.isProcessing||!await this.show_yes_no_dialog(`Unmount personality "${e.name}"?`,"Unmount","Cancel"))return;this.setPersonalityProcessing(t,!0),this.show_toast(`Unmounting ${e.name}...`,3,!0);const r=await this.unmount_personality(e);r&&r.status?(await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast("Personality unmounted",4,!0)):this.show_toast(`Could not unmount personality
-Error: ${(r==null?void 0:r.error)||"Unknown error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async unmount_personality(t){var s;if(!t)return{status:!1,error:"no personality provided"};const e=((s=this.$store.state.config)==null?void 0:s.personalities)||[];let n=null;const r=t.language?`${t.full_path}:${t.language}`:null;r&&e.includes(r)?n=r:(e.includes(t.full_path),n=t.full_path);const i={path:n};try{return await this.api_post_req("unmount_personality",i)}catch(o){return{status:!1,error:o.message}}},async unmountAll(){if(!await this.show_yes_no_dialog(`Unmount all ${this.mountedPersArr.length} personalities?`,"Unmount All","Cancel"))return;this.show_toast("Unmounting all...",3,!0),this.isLoading=!0;const e=await this.api_post_req("unmount_all_personalities");e&&e.status?(await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast("All personalities unmounted.",4,!0)):this.show_toast(`Failed to unmount all: ${(e==null?void 0:e.error)||"Unknown error"}`,4,!1),this.isLoading=!1},async remountPersonality(t){const e=t.personality;if(!(!e.isMounted||e.isProcessing)){this.setPersonalityProcessing(t,!0),this.show_toast(`Remounting ${e.name}...`,3,!0);try{const n=await this.unmount_personality(e);if(!n||!n.status)throw new Error(`Unmount failed: ${(n==null?void 0:n.error)||"Unknown error"}`);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),await new Promise(i=>setTimeout(i,200));const r=await this.mount_personality(e);if(!r||!r.status)throw new Error(`Mount failed: ${(r==null?void 0:r.error)||"Unknown error"}`);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast(`${e.name} remounted successfully.`,4,!0)}catch(n){this.show_toast(`Error remounting ${e.name}: ${n.message}`,4,!1),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities")}finally{this.setPersonalityProcessing(t,!1)}}},async editPersonality(t){var n;const e=t.personality;if(!e.isProcessing){this.setPersonalityProcessing(t,!0);try{const r=await this.api_post_req("get_personality_config",{category:e.category,name:e.folder});r.status&&r.config?(this.$store.commit("setCurrentPersonConfig",r.config),this.$store.commit("setShowPersonalityEditor",!0),this.$store.commit("setSelectedPersonality",e),(n=this.$store.state.personality_editor)!=null&&n.showPanel&&this.$store.state.personality_editor.showPanel()):this.show_toast(`Failed to load config for ${e.name}: ${r.error||"Not found/error"}`,4,!1)}catch(r){this.show_toast(`Error loading config for ${e.name}: ${r.message}`,4,!1)}finally{this.setPersonalityProcessing(t,!1)}}},async onCopyToCustom(t){const e=t.personality;if(e.isProcessing||!await this.show_yes_no_dialog(`Copy "${e.name}" to 'custom_personalities'?`,"Copy","Cancel"))return;this.setPersonalityProcessing(t,!0);const r=await this.api_post_req("copy_to_custom_personas",{category:e.category,name:e.folder});r&&r.status?(this.show_message_box(`"${e.name}" copied. Refreshing list...`),await new Promise(i=>setTimeout(i,500)),await this.$store.dispatch("refreshPersonalitiesZoo"),await this.$store.dispatch("refreshMountedPersonalities")):this.show_toast(`Failed to copy ${e.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async onPersonalityReinstall(t){const e=t.personality;if(e.isProcessing||!await this.show_yes_no_dialog(`Reinstall "${e.name}"? This overwrites local changes.`,"Reinstall","Cancel"))return;this.setPersonalityProcessing(t,!0),this.show_toast(`Reinstalling ${e.name}...`,3,!0);const r=await this.api_post_req("reinstall_personality",{name:e.full_path});r&&r.status?this.show_toast(`${e.name} reinstalled. Remount if active.`,4,!0):this.show_toast(`Failed to reinstall ${e.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async onSettingsPersonality(t){const e=t.personality;if(!(!this.isActivePersonality(e)||e.isProcessing)){if(!this.isActivePersonality(e)){this.show_toast(`Activate "${e.name}" first to configure settings.`,4,!1);return}this.setPersonalityProcessing(t,!0);try{const n=await this.api_get_req("/get_active_personality_settings");if(n&&typeof n=="object"&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Settings - ${e.name}`,"Save","Cancel");if(r!=null){this.setPersonalityProcessing(t,!0);const i=await this.api_post_req("set_active_personality_settings",r);i!=null&&i.status?this.show_toast(`Settings for ${e.name} updated.`,4,!0):this.show_toast(`Failed to update settings: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}}else n&&typeof n=="object"?this.show_toast(`"${e.name}" has no configurable settings.`,3,!0):this.show_toast("Could not retrieve settings structure.",4,!1)}catch(n){this.show_toast(`Error accessing settings: ${n.message}`,4,!1)}finally{this.setPersonalityProcessing(t,!1)}}},onCopyPersonalityName(t){const e=t.personality;navigator.clipboard.writeText(e.name).then(()=>this.show_toast(`Copied name: ${e.name}`,3,!0)).catch(n=>this.show_toast("Failed to copy name.",3,!1))},async handleOpenFolder(t){const e=t.personality,n=await this.api_post_req("open_personality_folder",{category:e.category,name:e.folder});(!n||!n.status)&&this.show_toast(`Could not open folder: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}},async mounted(){var t;await this.fetchInitialData(),this.selectedCategory=((t=this.config)==null?void 0:t.personality_category)||""},updated(){Fe(()=>{Re.replace()})}},rmr={class:"user-settings-panel flex flex-col mb-2 rounded-lg shadow-lg p-4 bg-white dark:bg-gray-800"},imr={class:"flex flex-row justify-between items-center mb-4 flex-wrap gap-y-2"},smr={class:"flex items-center flex-wrap"},omr={key:0,class:"flex items-center mr-2 text-lg text-blue-600 dark:text-blue-300"},amr=["title"],lmr={class:"flex items-center space-x-3 shrink-0"},cmr={key:0,class:"text-base font-semibold cursor-default select-none items-center flex flex-row"},umr={class:"flex -space-x-4 items-center"},dmr={class:"group/mounted items-center flex flex-row"},fmr=["onClick","title"],hmr=["src"],pmr=["onClick"],Tmr=["title"],Omr={class:"flex flex-col sm:flex-row gap-4 mb-4"},mmr={class:"flex-grow"},gmr={class:"relative"},Qmr={class:"absolute right-1.5 bottom-1.5 flex space-x-1"},_mr={class:"flex-shrink-0 sm:w-64"},vmr={value:""},ymr={value:"Mounted"},bmr={key:0,value:"Starred"},Smr={key:1,disabled:"",class:"text-blue-400 dark:text-blue-600"},xmr=["value"],Emr={key:0,class:"flex justify-center items-center p-10 text-loading text-blue-600 dark:text-blue-300"},wmr={key:1,class:"text-center text-blue-500 dark:text-blue-400 py-10"},Cmr={key:2,class:"overflow-y-auto flex-grow personalities-grid-container scrollbar",style:{"max-height":"calc(100vh - 300px)"},ref:"gridContainer"},Lmr={class:"label block ml-2 mb-2 text-blue-700 dark:text-blue-300"};function $mr(t,e,n,r,i,s){const o=Xe("PersonalityEntry");return k(),R("div",rmr,[b("div",imr,[b("div",smr,[e[9]||(e[9]=b("p",{class:"text-xl font-semibold cursor-default select-none mr-3 text-blue-800 dark:text-blue-100"}," Personalities Zoo ",-1)),s.active_personality_name?(k(),R("div",omr,[e[8]||(e[8]=b("span",{class:"mx-2 text-blue-400 dark:text-blue-500"},"|",-1)),b("span",{class:"font-bold line-clamp-1",title:`Active: ${s.active_personality_name}`},ae(s.active_personality_name),9,amr)])):ne("",!0)]),b("div",lmr,[s.mountedPersArr.length>0?(k(),R("div",cmr,[b("div",umr,[(k(!0),R(Ve,null,dt(s.displayedMountedPersonalities,(a,l)=>(k(),R("div",{class:"relative hover:-translate-y-1 duration-300 hover:z-10 shrink-0",key:a.id||a.full_path+"-"+l,ref_for:!0,ref:"mountedPersonalitiesRefs"},[b("div",dmr,[b("button",{onClick:oe(c=>s.onPersonalitySelected({personality:a,isMounted:!0}),["stop"]),title:`Select: ${a.name}`,class:"transition-transform duration-150 ease-in-out active:scale-90"},[b("img",{src:s.getPersonalityIconUrl(a.avatar),onError:e[0]||(e[0]=(...c)=>s.personalityImgPlaceholder&&s.personalityImgPlaceholder(...c)),class:ye(["w-8 h-8 rounded-full object-cover border-2 transition-colors duration-200 group-hover/mounted:border-blue-500 dark:group-hover/mounted:border-blue-400",s.isActivePersonality(a)?"border-blue-500 dark:border-blue-400":"border-blue-300 dark:border-blue-600"])},null,42,hmr)],8,fmr),b("button",{onClick:oe(c=>s.unmountPersonality({personality:a}),["stop"]),class:"absolute -top-1 -right-1 opacity-0 group-hover/mounted:opacity-100 transition-all duration-150 ease-in-out hover:scale-110",title:"Unmount personality"},e[10]||(e[10]=[b("span",{class:"bg-red-500 hover:bg-red-600 text-white rounded-full p-0.5 flex items-center justify-center shadow-md transition-colors duration-150"},[b("i",{"data-feather":"x",class:"w-3 h-3 stroke-current"})],-1)]),8,pmr)])]))),128)),s.mountedPersArr.length>i.maxDisplayedMounted?(k(),R("div",{key:0,class:"w-8 h-8 rounded-full bg-blue-200 dark:bg-blue-700 border-2 border-blue-300 dark:border-blue-600 flex items-center justify-center text-xs font-semibold text-blue-600 dark:text-blue-300 cursor-default",title:`${s.mountedPersArr.length-i.maxDisplayedMounted} more mounted`}," +"+ae(s.mountedPersArr.length-i.maxDisplayedMounted),9,Tmr)):ne("",!0)])])):ne("",!0),s.mountedPersArr.length>0?(k(),R("button",{key:1,onClick:e[1]||(e[1]=oe(a=>s.unmountAll(),["stop"])),class:"p-1 bg-red-100 hover:bg-red-200 dark:bg-red-900 dark:hover:bg-red-800 rounded-full border border-red-300 dark:border-red-700 active:scale-90 transition-all duration-150",title:"Unmount All Personalities"},e[11]||(e[11]=[b("i",{"data-feather":"x-octagon",class:"w-4 h-4 text-red-600 dark:text-red-400 stroke-current"},null,-1)]))):ne("",!0)])]),b("div",Omr,[b("div",mmr,[e[13]||(e[13]=b("label",{for:"personality-search",class:"sr-only"},"Search",-1)),b("div",gmr,[e[12]||(e[12]=b("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search",id:"personality-search",class:"input search-input block w-full p-3 pl-10 text-sm text-blue-900 dark:text-blue-100 placeholder-blue-500 dark:placeholder-blue-400 pr-24",placeholder:"Search name, author, description...","onUpdate:modelValue":e[2]||(e[2]=a=>i.searchTermInput=a),onKeyup:e[3]||(e[3]=gr((...a)=>s.applySearch&&s.applySearch(...a),["enter"]))},null,544),[[vt,i.searchTermInput]]),b("div",Qmr,[i.searchTermInput?(k(),R("button",{key:0,onClick:e[4]||(e[4]=oe((...a)=>s.clearSearch&&s.clearSearch(...a),["stop"])),type:"button",class:"btn btn-secondary btn-sm text-xs px-3 py-1.5"}," Clear ")):ne("",!0),b("button",{onClick:e[5]||(e[5]=oe((...a)=>s.applySearch&&s.applySearch(...a),["stop"])),type:"button",class:"btn btn-primary btn-sm text-xs px-3 py-1.5"}," Search ")])])]),b("div",_mr,[e[14]||(e[14]=b("label",{for:"persCat",class:"sr-only"},"Category",-1)),He(b("select",{id:"persCat","onUpdate:modelValue":e[6]||(e[6]=a=>i.selectedCategory=a),onChange:e[7]||(e[7]=(...a)=>s.handleCategoryChange&&s.handleCategoryChange(...a)),class:"input block w-full p-3 text-sm text-blue-900 dark:text-blue-100"},[b("option",vmr,"All Categories ("+ae(i.allPersonalities.length)+")",1),b("option",ymr,"⬆️ Mounted ("+ae(s.mountedPersArr.length)+")",1),s.starredPersonalitiesPaths.length>0?(k(),R("option",bmr,"⭐ Starred ("+ae(s.getStarredCount())+")",1)):ne("",!0),(s.starredPersonalitiesPaths.length>0||s.mountedPersArr.length>0)&&i.persCatgArr.length>0?(k(),R("option",Smr,"──────────")):ne("",!0),(k(!0),R(Ve,null,dt(i.persCatgArr,(a,l)=>(k(),R("option",{key:l,value:a},ae(a)+" ("+ae(s.getCategoryCount(a))+") ",9,xmr))),128))],544),[[$s,i.selectedCategory]])])]),i.isLoading&&i.allPersonalities.length===0?(k(),R("div",Emr,e[15]||(e[15]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-400 animate-spin dark:text-blue-500 fill-blue-600 dark:fill-blue-300",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading personalities...",-1)]))):!i.isLoading&&s.filteredPersonalities.length===0?(k(),R("div",wmr," No personalities found"+ae(i.activeSearchTerm?' matching "'+i.activeSearchTerm+'"':"")+ae(s.getResultMessageQualifier())+". ",1)):(k(),R("div",Cmr,[b("label",Lmr,ae(s.getResultLabel())+": ("+ae(s.filteredPersonalities.length)+") ",1),(k(),R("div",{key:i.selectedCategory+"-"+i.activeSearchTerm,class:"p-2 pb-0 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 bg-blue-100/50 dark:bg-blue-800/30 rounded-md"},[te(V4,{name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(s.filteredPersonalities,a=>(k(),Qt(o,{key:a.id||a.full_path,personality:a,select_language:!0,full_path:a.full_path,"is-mounted":a.isMounted,"is-active":s.isActivePersonality(a),"is-processing":a.isProcessing,"is-starred":a.isStarred,"base-url":i.bUrl,onSelect:s.onPersonalitySelected,onMount:s.mountPersonality,onUnmount:s.unmountPersonality,onRemount:s.remountPersonality,onEdit:s.editPersonality,onToggleStar:s.toggleStar,onCopyToCustom:s.onCopyToCustom,onReinstall:s.onPersonalityReinstall,onSettings:s.onSettingsPersonality,onCopyPersonalityName:s.onCopyPersonalityName,onOpenFolder:s.handleOpenFolder,onError:s.personalityImgPlaceholder},null,8,["personality","full_path","is-mounted","is-active","is-processing","is-starred","base-url","onSelect","onMount","onUnmount","onRemount","onEdit","onToggleStar","onCopyToCustom","onReinstall","onSettings","onCopyPersonalityName","onOpenFolder","onError"]))),128))]),_:1})]))],512))])}const Amr=st(nmr,[["render",$mr],["__scopeId","data-v-57acb6cf"]]),kmr="/assets/functioncall-Cm2fTSgb.png",Pmr="/",Rmr={props:{function_call:{},select_language:Boolean,full_path:String,onOpenFolder:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onShowSettings:Function,onCopyfunction_callName:Function,onToggleFavorite:Function},components:{InteractiveMenu:KC},data(){return{mounted:!1,name:this.function_call.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0},showHelpPopup:!1,renderedHelp:""}},computed:{commandsList(){let t=[{name:this.mounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.mounted?this.unmount:this.mount}];return console.log("this.category",this.function_call.category),this.function_call.category=="custom_personalities"?t.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):t.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.mounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),t}},mounted(){this.mounted=this.function_call.mounted,console.log(this.function_call),Fe(()=>{Re.replace()})},methods:{show_settings(){this.onShowSettings(this)},formatDate(t){const e={year:"numeric",month:"short",day:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(t){this.thumbnailPosition={x:t.clientX+10,y:t.clientY+10}},getImgUrl(){return Pmr+this.function_call.avatar},defaultImg(t){t.target.src=kmr},toggleFavorite(){this.onToggleFavorite(this)},showFolder(){this.onOpenFolder(this)},toggleCopyLink(){this.onCopyfunction_callName(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.mounted=!1},showHelp(){this.renderedHelp=Kt(this.function_call.help),this.showHelpPopup=!0},closeHelp(){this.showHelpPopup=!1}},watch:{}},Mmr=["title"],Dmr={class:"flex-grow"},Nmr={class:"flex items-center mb-4"},Imr=["src"],Hmr={class:"font-bold text-xl text-gray-800 cursor-pointer"},Vmr={class:"text-sm text-gray-600"},qmr={class:"text-sm text-gray-600"},Umr={class:"text-sm text-gray-600"},Bmr={key:0,class:"text-sm text-gray-600"},zmr={key:1,class:"text-sm text-gray-600"},Xmr={class:"mb-4"},Fmr=["innerHTML"],jmr={class:"mt-auto pt-4 border-t"},Ymr={class:"flex justify-between items-center flex-wrap"},Gmr=["title"],Wmr=["fill"],Zmr=["src"],Kmr={key:1,class:"fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center"},Jmr={class:"bg-white p-4 rounded-lg shadow-lg w-[500px] h-[400px] flex flex-col"},egr={class:"flex justify-between items-center mb-2"},tgr={class:"flex-grow overflow-auto"},ngr=["innerHTML"];function rgr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["app-card flex flex-col h-full",i.mounted?"border-primary-light":"border-transparent"]),title:n.function_call.installed?"":"Not installed"},[b("div",Dmr,[b("div",Nmr,[b("img",{src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),alt:"function_call Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4 cursor-pointer",onMouseover:e[1]||(e[1]=(...a)=>s.showThumbnail&&s.showThumbnail(...a)),onMousemove:e[2]||(e[2]=(...a)=>s.updateThumbnailPosition&&s.updateThumbnailPosition(...a)),onMouseleave:e[3]||(e[3]=(...a)=>s.hideThumbnail&&s.hideThumbnail(...a))},null,40,Imr),b("div",null,[b("h3",Hmr,ae(n.function_call.name),1),b("p",Vmr,"Author: "+ae(n.function_call.author),1),b("p",qmr,"Version: "+ae(n.function_call.version),1),b("p",Umr,"Category: "+ae(n.function_call.category),1),n.function_call.creation_date?(k(),R("p",Bmr,"Creation Date: "+ae(s.formatDate(n.function_call.creation_date)),1)):ne("",!0),n.function_call.last_update_date?(k(),R("p",zmr,"Last update Date: "+ae(s.formatDate(n.function_call.last_update_date)),1)):ne("",!0)]),n.function_call.help?(k(),R("button",{key:0,onClick:e[4]||(e[4]=(...a)=>s.showHelp&&s.showHelp(...a)),class:"ml-2 text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Help"},e[9]||(e[9]=[b("i",{"data-feather":"help-circle",class:"h-6 w-6"},null,-1)]))):ne("",!0)]),b("div",Xmr,[e[10]||(e[10]=b("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),b("p",{class:"text-sm text-gray-600 h-20 overflow-y-auto",innerHTML:n.function_call.description},null,8,Fmr)])]),b("div",jmr,[b("div",Ymr,[b("button",{onClick:e[5]||(e[5]=(...a)=>s.toggleFavorite&&s.toggleFavorite(...a)),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:t.isFavorite?"Remove from favorites":"Add to favorites"},[(k(),R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:t.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[11]||(e[11]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,Wmr))],8,Gmr),b("button",{onClick:e[6]||(e[6]=(...a)=>s.showFolder&&s.showFolder(...a)),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Show Folder"},e[12]||(e[12]=[b("i",{"data-feather":"folder",class:"h-6 w-6"},null,-1)])),i.mounted?(k(),R("button",{key:0,onClick:e[7]||(e[7]=(...a)=>s.show_settings&&s.show_settings(...a)),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Settings"},e[13]||(e[13]=[b("i",{"data-feather":"settings",class:"h-6 w-6"},null,-1)]))):ne("",!0),te(o,{commands:s.commandsList,force_position:2,title:"Menu",class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out"},null,8,["commands"])])]),i.thumbnailVisible?(k(),R("div",{key:0,style:qn({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[b("img",{src:s.getImgUrl(),class:"w-full h-full object-fill"},null,8,Zmr)],4)):ne("",!0),i.showHelpPopup?(k(),R("div",Kmr,[b("div",Jmr,[b("div",egr,[e[14]||(e[14]=b("h2",{class:"text-lg font-bold"},"Help",-1)),b("button",{onClick:e[8]||(e[8]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"text-red-500 hover:text-red-600"},"Close")]),b("div",tgr,[b("div",{innerHTML:i.renderedHelp},null,8,ngr)])])])):ne("",!0)],10,Mmr)}const igr=st(Rmr,[["render",rgr]]),sgr="/assets/default_function-CyfcuNmo.png";function ogr(t,e){let n;return function(...i){const s=()=>{clearTimeout(n),t.apply(this,i)};clearTimeout(n),n=setTimeout(s,e)}}const agr={name:"FunctionCallsZoo",components:{FunctionEntry:igr},props:{config:{type:Object,required:!0},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},show_message_box:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["update:setting"],data(){return{allFunctions:[],categoriesFunc:[],filteredFunctions:[],pagedFunctions:[],isLoadingFunctions:!1,isSearchingFunc:!1,searchTermFunc:"",selectedCategoryFunc:"",sortOptionFunc:"mounted",itemsPerPageFunc:15,currentPageFunc:1,maxDisplayedMountedFunc:7,functionEntryRefs:{},observerFunc:null,defaultIcon:sgr,axiosBaseUrl:Ae.defaults.baseURL||""}},computed:{mountedFunctionPathsSet(){var t;return new Set(((t=this.config)==null?void 0:t.mounted_functions)||[])},mountedFunctions(){return this.allFunctions.filter(t=>this.mountedFunctionPathsSet.has(t.full_path))},displayedMountedFunctions(){return[...this.mountedFunctions].sort((e,n)=>(e.name||"").localeCompare(n.name||"")).slice(0,this.maxDisplayedMountedFunc)},hasMoreFunctionsToLoad(){return this.pagedFunctions.length{const i=e.has(r.full_path);r.isMounted!==i&&(r.isMounted=i,n=!0)}),n&&(console.log("Watcher: Re-applying filters and sort due to mounted status change."),this.resetAndReloadFunctions()),this.featherReplace()},deep:!0},searchTermFunc(){this.debouncedResetAndReload()},selectedCategoryFunc(){this.debouncedResetAndReload()},sortOptionFunc(){this.debouncedResetAndReload()},allFunctions:{handler(){console.log("Watcher: allFunctions list changed. Triggering initial load."),this.resetAndReloadFunctions()}}},methods:{getFunctionIcon(t){return t?t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t.startsWith("/")?`${this.axiosBaseUrl}${t}`:t:`${this.axiosBaseUrl}/${t}`:this.defaultIcon},imgPlaceholder(t){t.target.src=this.defaultIcon},featherReplace(){this.$nextTick(()=>{try{Re.replace()}catch(t){console.error("Feather replace error:",t)}})},setFunctionRef(t,e){e&&(this.functionEntryRefs[t]=e)},async fetchFunctionsAndCategories(){if(!this.isLoadingFunctions){this.isLoadingFunctions=!0,console.log("Fetching functions and categories...");try{const t=await this.api_get_req("list_function_calls"),e=(t==null?void 0:t.function_calls)||[],n=new Set(e.map(r=>r.category).filter(Boolean));this.categoriesFunc=Array.from(n).sort(),this.allFunctions=e.map(r=>{const i=`${r.category}/${r.name}`,s=r.id||i;return{...r,full_path:i,isMounted:!1,id:s,isProcessing:!1}}),console.log(`Fetched ${this.allFunctions.length} total functions.`),this.$nextTick(()=>{var r;(r=this.config)!=null&&r.mounted_functions&&this.watch["config.mounted_functions"].handler.call(this,this.config.mounted_functions)})}catch(t){this.show_toast("Failed to load functions list.",4,!1),console.error("Error fetching functions:",t),this.allFunctions=[],this.categoriesFunc=[]}finally{this.isLoadingFunctions=!1}}},applyFiltersAndSortFunc(){console.time("FilterSortFunctions");let t=[...this.allFunctions];if(this.selectedCategoryFunc&&(t=t.filter(e=>e.category===this.selectedCategoryFunc)),this.searchTermFunc){const e=this.searchTermFunc.toLowerCase();t=t.filter(n=>{var c,u,d,f,h;const r=(c=n.name)==null?void 0:c.toLowerCase().includes(e),i=(u=n.author)==null?void 0:u.toLowerCase().includes(e),s=(d=n.description)==null?void 0:d.toLowerCase().includes(e),o=(f=n.category)==null?void 0:f.toLowerCase().includes(e),a=(h=n.full_path)==null?void 0:h.toLowerCase().includes(e),l=Array.isArray(n.keywords)?n.keywords.some(p=>p.toLowerCase().includes(e)):!1;return r||i||s||o||a||l})}t.sort((e,n)=>{if(this.sortOptionFunc==="mounted"){if(e.isMounted&&!n.isMounted)return-1;if(!e.isMounted&&n.isMounted)return 1}switch(this.sortOptionFunc!=="mounted"?this.sortOptionFunc:"name"){case"name":return(e.name||"").localeCompare(n.name||"");case"author":return(e.author||"").localeCompare(n.author||"");case"category":return(e.category||"").localeCompare(n.category||"");default:return 0}}),this.filteredFunctions=t,console.timeEnd("FilterSortFunctions"),console.log(`Filtered/Sorted functions: ${this.filteredFunctions.length}`)},resetAndReloadFunctions(){this.currentPageFunc=1,this.pagedFunctions=[],this.applyFiltersAndSortFunc(),this.$nextTick(()=>{this.loadMoreFunctions()})},debouncedResetAndReload:ogr(function(){this.isSearchingFunc=!0,this.resetAndReloadFunctions(),setTimeout(()=>{this.isSearchingFunc=!1},100)},300),loadMoreFunctions(){if(this.isLoadingFunctions||this.isSearchingFunc||!this.hasMoreFunctionsToLoad)return;console.log(`Loading page ${this.currentPageFunc}`);const t=(this.currentPageFunc-1)*this.itemsPerPageFunc,e=t+this.itemsPerPageFunc,n=this.filteredFunctions.slice(t,e),r=new Set(this.pagedFunctions.map(s=>s.id||s.full_path)),i=n.filter(s=>!r.has(s.id||s.full_path));i.length>0?(this.pagedFunctions.push(...i),this.currentPageFunc++,this.featherReplace()):n.length>0&&console.log("Load more triggered but items already seem to be loaded.")},setFunctionProcessing(t,e){const n=s=>{s&&(s.isProcessing=e)},r=this.allFunctions.findIndex(s=>(s.id||s.full_path)===t);n(this.allFunctions[r]);const i=this.pagedFunctions.findIndex(s=>(s.id||s.full_path)===t);n(this.pagedFunctions[i])},async handleMount(t){if(t.isMounted||t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0),this.show_toast(`Mounting ${t.name}...`,3,!0);try{const n=await this.api_post_req("mount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(n&&n.status){this.show_toast(`${t.name} mounted successfully.`,4,!0);const r=[...this.mountedFunctionPathsSet,t.full_path];this.$emit("update:setting",{key:"mounted_functions",value:r})}else this.show_toast(`Failed to mount ${t.name}: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch(n){this.show_toast(`Error mounting ${t.name}: ${n.message||n}`,4,!1),console.error("Mount error:",n)}finally{this.setFunctionProcessing(e,!1)}},async handleUnmount(t){var n;if(!t.isMounted||t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0),this.show_toast(`Unmounting ${t.name}...`,3,!0);try{const r=await this.api_post_req("unmount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(r&&r.status){this.show_toast(`${t.name} unmounted.`,4,!0);const i=(((n=this.config)==null?void 0:n.mounted_functions)||[]).filter(s=>s!==t.full_path);this.$emit("update:setting",{key:"mounted_functions",value:i})}else this.show_toast(`Failed to unmount ${t.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1)}catch(r){this.show_toast(`Error unmounting ${t.name}: ${r.message||r}`,4,!1),console.error("Unmount error:",r)}finally{this.setFunctionProcessing(e,!1)}},async unmountAll(){if(!(this.mountedFunctions.length===0||!await this.show_yes_no_dialog(`Unmount all ${this.mountedFunctions.length} functions?`,"Unmount All","Cancel"))){this.show_toast("Unmounting all functions...",3,!0),this.mountedFunctions.forEach(e=>this.setFunctionProcessing(e.id||e.full_path,!0));try{const e=await this.api_post_req("unmount_all_functions",{client_id:this.client_id});e&&e.status?(this.show_toast("All functions unmounted.",4,!0),this.$emit("update:setting",{key:"mounted_functions",value:[]})):(this.show_toast(`Failed to unmount all: ${(e==null?void 0:e.error)||"Error"}`,4,!1),this.mountedFunctions.forEach(n=>this.setFunctionProcessing(n.id||n.full_path,!1)))}catch(e){this.show_toast(`Error unmounting all: ${e.message||e}`,4,!1),console.error("Unmount all error:",e),this.mountedFunctions.forEach(n=>this.setFunctionProcessing(n.id||n.full_path,!1))}}},async handleRemount(t){const e=t.id||t.full_path;if(!t.isProcessing){this.setFunctionProcessing(e,!0),this.show_toast(`Remounting ${t.name}...`,3,!0);try{let n=[...this.config.mounted_functions||[]];if(n.includes(t.full_path)){const s=await this.api_post_req("unmount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(!s||!s.status){this.show_toast(`Failed to unmount ${t.name} during remount. Aborting.`,4,!1),this.setFunctionProcessing(e,!1);return}n=n.filter(o=>o!==t.full_path),this.$emit("update:setting",{key:"mounted_functions",value:n}),await Fe(),console.log("Remount Step 1: Unmounted and emitted.")}const i=await this.api_post_req("mount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});i&&i.status?(this.show_toast(`${t.name} remounted successfully.`,4,!0),n.includes(t.full_path)||n.push(t.full_path),this.$emit("update:setting",{key:"mounted_functions",value:n}),console.log("Remount Step 2: Mounted and emitted.")):this.show_toast(`Failed to mount ${t.name} during remount: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}catch(n){this.show_toast(`Error remounting ${t.name}: ${n.message||n}`,4,!1),console.error("Remount error:",n)}finally{this.setFunctionProcessing(e,!1)}}},async handleSettings(t){if(t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0);try{const n=await this.api_post_req("get_function_call_settings",{client_id:this.client_id,category:t.category,name:t.name});if(n&&typeof n=="object"&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Function Settings - ${t.name}`,"Save","Cancel");if(r!=null){const i=await this.api_post_req("set_function_call_settings",{client_id:this.client_id,category:t.category,name:t.name,settings:r});i&&i.status?this.show_toast(`Settings for ${t.name} updated.`,4,!0):this.show_toast(`Failed to update settings for ${t.name}: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}else this.show_toast(`Settings update for ${t.name} cancelled.`,3,!0)}else n&&typeof n=="object"&&Object.keys(n).length===0?this.show_message_box(`Function "${t.name}" has no configurable settings.`):this.show_toast(`Could not retrieve settings for ${t.name}: ${(n==null?void 0:n.error)||"Invalid response"}`,4,!1)}catch(n){this.show_toast(`Error accessing settings for ${t.name}: ${n.message||n}`,4,!1),console.error("Settings error:",n)}finally{this.setFunctionProcessing(e,!1)}},async handleEdit(t){this.show_toast(`Opening folder containing "${t.name}" for editing...`,3,!0),await this.handleOpenFolder(t)},async handleCopyToCustom(t){if(!await this.show_yes_no_dialog(`Copy "${t.name}" from "${t.category}" to your 'custom_functions' folder?`,"Copy","Cancel")||t.isProcessing)return;const n=t.id||t.full_path;this.setFunctionProcessing(n,!0);try{const r=await this.api_post_req("copy_to_custom_functions",{client_id:this.client_id,category:t.category,name:t.name});r&&r.status?(this.show_message_box(`Function "${t.name}" copied to 'custom_functions'. The list will refresh shortly.`),await this.fetchFunctionsAndCategories()):this.show_toast(`Failed to copy ${t.name}: ${(r==null?void 0:r.error)||"Already exists in custom?"}`,4,!1)}catch(r){this.show_toast(`Error copying ${t.name}: ${r.message||r}`,4,!1),console.error("Copy to custom error:",r)}finally{this.setFunctionProcessing(n,!1)}},handleCopyName(t){navigator.clipboard.writeText(t.name).then(()=>this.show_toast(`Copied name: ${t.name}`,3,!0)).catch(e=>{this.show_toast("Failed to copy name to clipboard.",3,!1),console.error("Clipboard copy failed:",e)})},async handleOpenFolder(t){try{await this.api_post_req("open_function_folder",{client_id:this.client_id,category:t.category,name:t.name})}catch(e){this.show_toast(`Error opening folder for ${t.name}: ${e.message||e}`,4,!1),console.error("Open folder error:",e)}},scrollToFunction(t){const e=t.id||t.full_path,n=this.functionEntryRefs[e];if(n&&n.$el){const r=n.$el;r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.add("ring-2","ring-offset-2","ring-blue-500","dark:ring-offset-gray-800","transition-all","duration-1000","ease-out"),setTimeout(()=>{r.classList.remove("ring-2","ring-offset-2","ring-blue-500","dark:ring-offset-gray-800","transition-all","duration-1000","ease-out")},1500)}else console.warn(`Could not find ref $el to scroll to for function ID: ${e}. Is it loaded?`),this.hasMoreFunctionsToLoad&&!this.pagedFunctions.some(r=>(r.id||r.full_path)===e)?(this.show_toast(`Function ${t.name} not visible, attempting to load more...`,3,!0),this.loadMoreFunctions(),setTimeout(()=>this.scrollToFunction(t),500)):this.show_toast(`Could not scroll to ${t.name}.`,3,!1)},setupIntersectionObserverFunc(){this.disconnectIntersectionObserver();const t={root:null,rootMargin:"100px",threshold:.1};this.observerFunc=new IntersectionObserver(n=>{n.forEach(r=>{r.isIntersecting&&this.hasMoreFunctionsToLoad&&this.loadMoreFunctions()})},t);const e=this.$refs.loadMoreTriggerFunc;e?(this.observerFunc.observe(e),console.log("IntersectionObserver setup complete.")):this.$nextTick(()=>{const n=this.$refs.loadMoreTriggerFunc;n?(this.observerFunc.observe(n),console.log("IntersectionObserver setup complete (nextTick).")):console.error("Load more trigger element not found for IntersectionObserver setup.")})},disconnectIntersectionObserver(){if(this.observerFunc){console.log("Disconnecting IntersectionObserver.");const t=this.$refs.loadMoreTriggerFunc;if(t)try{this.observerFunc.unobserve(t)}catch(e){console.warn("Error unobserving trigger:",e)}this.observerFunc.disconnect(),this.observerFunc=null}}},mounted(){console.log("FunctionCallsZoo Mounted."),this.fetchFunctionsAndCategories(),this.featherReplace(),this.$nextTick(()=>{this.setupIntersectionObserverFunc()})},beforeUpdate(){this.functionEntryRefs={}},updated(){this.featherReplace(),this.$nextTick(()=>{const t=this.$refs.loadMoreTriggerFunc;if(t&&this.observerFunc&&!this.observerFunc.takeRecords().some(e=>e.target===t)){console.warn("IntersectionObserver detached from trigger, re-observing.");try{this.observerFunc.unobserve(t)}catch{}this.observerFunc.observe(t)}else t&&!this.observerFunc&&(console.warn("IntersectionObserver lost, re-setting up."),this.setupIntersectionObserverFunc())})},unmounted(){console.log("FunctionCallsZoo Unmounted."),this.disconnectIntersectionObserver()}},lgr={class:"user-settings-panel space-y-6 p-4 md:p-6 rounded-lg shadow-md bg-white dark:bg-gray-800"},cgr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},ugr={class:"flex flex-col items-end"},dgr={class:"flex items-center flex-wrap gap-2 text-sm font-medium mb-1"},fgr={key:0,class:"text-blue-500 dark:text-blue-500 italic text-xs"},hgr={key:1,class:"flex -space-x-3 items-center"},pgr=["src","title","onClick"],Tgr=["onClick"],Ogr=["title"],mgr={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4 items-center"},ggr={class:"relative md:col-span-1"},Qgr={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center"},_gr={class:"md:col-span-1"},vgr=["value"],ygr={class:"md:col-span-1"},bgr={key:0,class:"flex justify-center items-center p-10 text-blue-500 dark:text-blue-400"},Sgr={key:1,class:"text-center text-blue-500 dark:text-blue-400 py-10"},xgr={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 scrollbar-thin scrollbar-thumb-blue-300 scrollbar-track-blue-100 dark:scrollbar-thumb-blue-700 dark:scrollbar-track-blue-900",ref:"scrollContainerFunc"},Egr={ref:"loadMoreTriggerFunc",class:"h-10"},wgr={key:0,class:"flex justify-center items-center text-center text-blue-500 dark:text-blue-400 py-4"};function Cgr(t,e,n,r,i,s){const o=Xe("FunctionEntry");return k(),R("div",lgr,[b("div",cgr,[e[9]||(e[9]=b("h2",{class:"text-2xl font-semibold text-blue-800 dark:text-blue-100 mb-2 sm:mb-0"}," Function Calls Zoo ",-1)),b("div",ugr,[b("div",dgr,[e[7]||(e[7]=b("span",{class:"text-blue-600 dark:text-blue-400"},"Mounted:",-1)),s.mountedFunctions.length===0?(k(),R("div",fgr,"None")):(k(),R("div",hgr,[(k(!0),R(Ve,null,dt(s.displayedMountedFunctions,(a,l)=>(k(),R("div",{key:`mounted-${a.id||a.full_path||l}`,class:"relative group"},[b("img",{src:s.getFunctionIcon(a.icon),onError:e[0]||(e[0]=(...c)=>s.imgPlaceholder&&s.imgPlaceholder(...c)),class:"w-7 h-7 rounded-full object-cover ring-2 ring-white dark:ring-gray-700 cursor-pointer hover:ring-blue-500 dark:hover:ring-blue-400 transition-all",title:`${a.name} (${a.category})`,onClick:c=>s.scrollToFunction(a)},null,40,pgr),b("button",{onClick:oe(c=>s.handleUnmount(a),["stop"]),class:"absolute -top-1 -right-1 p-0.5 rounded-full bg-red-600 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 dark:focus:ring-offset-gray-900",title:"Unmount"},e[6]||(e[6]=[b("i",{"data-feather":"x",class:"w-3 h-3 stroke-current"},null,-1)]),8,Tgr)]))),128)),s.mountedFunctions.length>i.maxDisplayedMountedFunc?(k(),R("div",{key:0,class:"w-7 h-7 rounded-full bg-blue-200 dark:bg-blue-700 ring-2 ring-white dark:ring-gray-700 flex items-center justify-center text-xs font-semibold text-blue-600 dark:text-blue-300",title:`${s.mountedFunctions.length-i.maxDisplayedMountedFunc} more mounted`}," +"+ae(s.mountedFunctions.length-i.maxDisplayedMountedFunc),9,Ogr)):ne("",!0)]))]),s.mountedFunctions.length>0?(k(),R("button",{key:0,onClick:e[1]||(e[1]=(...a)=>s.unmountAll&&s.unmountAll(...a)),class:"btn btn-sm bg-red-600 hover:bg-red-700 text-white text-xs mt-1 focus:ring-red-300 dark:focus:ring-red-600"},e[8]||(e[8]=[b("i",{"data-feather":"x-octagon",class:"w-3 h-3 mr-1 stroke-current"},null,-1),Se("Unmount All ")]))):ne("",!0)])]),e[18]||(e[18]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400"}," Mount functions to grant the AI specific capabilities and tools it can use during conversations. Requires a model trained for function calling. ",-1)),b("div",mgr,[b("div",ggr,[e[11]||(e[11]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[2]||(e[2]=a=>i.searchTermFunc=a),placeholder:"Search functions...",class:"input pl-10 w-full placeholder:text-blue-400 dark:placeholder:text-blue-500",onInput:e[3]||(e[3]=(...a)=>t.debounceSearchFunc&&t.debounceSearchFunc(...a))},null,544),[[vt,i.searchTermFunc]]),i.isSearchingFunc?(k(),R("div",Qgr,e[10]||(e[10]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 text-blue-400 dark:text-blue-500 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0)]),b("div",_gr,[e[13]||(e[13]=b("label",{for:"func-category",class:"sr-only"},"Filter by Category",-1)),He(b("select",{id:"func-category","onUpdate:modelValue":e[4]||(e[4]=a=>i.selectedCategoryFunc=a),class:"input w-full"},[e[12]||(e[12]=b("option",{value:""},"All Categories",-1)),(k(!0),R(Ve,null,dt(i.categoriesFunc,a=>(k(),R("option",{key:a,value:a},ae(a),9,vgr))),128))],512),[[$s,i.selectedCategoryFunc]])]),b("div",ygr,[e[15]||(e[15]=b("label",{for:"func-sort",class:"sr-only"},"Sort functions by",-1)),He(b("select",{id:"func-sort","onUpdate:modelValue":e[5]||(e[5]=a=>i.sortOptionFunc=a),class:"input w-full"},e[14]||(e[14]=[b("option",{value:"mounted"},"Sort by Mounted",-1),b("option",{value:"name"},"Sort by Name",-1),b("option",{value:"author"},"Sort by Author",-1),b("option",{value:"category"},"Sort by Category",-1)]),512),[[$s,i.sortOptionFunc]])])]),i.isLoadingFunctions?(k(),R("div",bgr,e[16]||(e[16]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-300 dark:text-blue-600 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading functions...",-1)]))):i.pagedFunctions.length===0&&i.filteredFunctions.length===0?(k(),R("div",Sgr," No functions found"+ae(i.searchTermFunc?' matching "'+i.searchTermFunc+'"':"")+ae(i.selectedCategoryFunc?' in category "'+i.selectedCategoryFunc+'"':"")+". ",1)):ne("",!0),b("div",xgr,[(k(!0),R(Ve,null,dt(i.pagedFunctions,a=>(k(),Qt(o,{key:a.id||a.full_path,ref_for:!0,ref:l=>s.setFunctionRef(a.id||a.full_path,l),function_call:a,"is-mounted":a.isMounted,"is-processing":a.isProcessing,"get-icon-url":s.getFunctionIcon,"on-img-error":s.imgPlaceholder,onMount:l=>s.handleMount(a),onUnmount:l=>s.handleUnmount(a),onRemount:l=>s.handleRemount(a),onShowSettings:l=>s.handleSettings(a),onEdit:l=>s.handleEdit(a),onCopyToCustom:l=>s.handleCopyToCustom(a),onCopyName:l=>s.handleCopyName(a),onOpenFolder:l=>s.handleOpenFolder(a)},null,8,["function_call","is-mounted","is-processing","get-icon-url","on-img-error","onMount","onUnmount","onRemount","onShowSettings","onEdit","onCopyToCustom","onCopyName","onOpenFolder"]))),128))],512),b("div",Egr,[s.hasMoreFunctionsToLoad&&!i.isLoadingFunctions&&!i.isSearchingFunc?(k(),R("div",wgr,e[17]||(e[17]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 mr-2 text-blue-300 dark:text-blue-600 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading more...",-1)]))):ne("",!0)],512)])}const Lgr=st(agr,[["render",Cgr],["__scopeId","data-v-8ff7e3ea"]]),$gr={name:"ModelConfigSettings",components:{ToggleSwitch:ju},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:["setting-updated"],computed:{isDisabled(){return!this.config.override_personality_model_parameters}},methods:{updateValue(t,e){this.$emit("setting-updated",{key:t,value:e})},handleNumberInput(t,e,n=!1){let r=n?parseInt(e):parseFloat(e);if(t==="seed"){if(String(e)==="-")return;(isNaN(r)||r<-1)&&(r=-1)}else if(isNaN(r)){console.warn(`Attempted to set invalid number for ${t}:`,e);return}this.updateValue(t,r)},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},Agr={class:"user-settings-panel space-y-6"},kgr={class:"toggle-item !justify-start gap-4 border border-blue-200 dark:border-blue-700 rounded-lg p-3 panels-color"},Pgr={class:"setting-item"},Rgr=["value","disabled"],Mgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Dgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Ngr=["value","disabled"],Igr=["value","disabled"],Hgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Vgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},qgr=["value","disabled"],Ugr=["value","disabled"],Bgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},zgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Xgr=["value","disabled"],Fgr=["value","disabled"],jgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Ygr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Ggr=["value","disabled"],Wgr=["value","disabled"],Zgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Kgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Jgr=["value","disabled"],eQr=["value","disabled"],tQr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},nQr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},rQr=["value","disabled"],iQr=["value","disabled"];function sQr(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",Agr,[e[22]||(e[22]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Model Generation Parameters ",-1)),e[23]||(e[23]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400 mb-4"}," Adjust the core parameters that influence how the AI generates text. These settings can be overridden by specific personalities unless the option below is checked. ",-1)),b("div",kgr,[te(o,{id:"override_personality_model_parameters",checked:n.config.override_personality_model_parameters,"onUpdate:checked":e[0]||(e[0]=a=>s.updateValue("override_personality_model_parameters",a))},null,8,["checked"]),e[14]||(e[14]=b("label",{for:"override_personality_model_parameters",class:"toggle-label !flex-none"},[Se(" Override Personality Parameters "),b("span",{class:"toggle-description"},"Force the use of these global parameters, ignoring any settings defined within the selected personality.")],-1))]),b("div",{class:ye(["space-y-5 pt-4",s.isDisabled?"opacity-50 pointer-events-none":""])},[b("div",Pgr,[e[15]||(e[15]=To(' Seed ',1)),b("input",{type:"number",id:"seed",value:n.config.seed,onInput:e[1]||(e[1]=a=>s.handleNumberInput("seed",a.target.value,!0)),class:"input-sm w-full md:w-32",step:"1",placeholder:"-1",disabled:s.isDisabled},null,40,Rgr)]),b("div",Mgr,[e[16]||(e[16]=To(' Temperature ',1)),b("div",Dgr,[b("input",{id:"temperature-range",value:n.config.temperature,onInput:e[2]||(e[2]=a=>s.handleNumberInput("temperature",a.target.value)),type:"range",min:"0",max:"2",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Ngr),b("input",{id:"temperature-number",value:n.config.temperature,onInput:e[3]||(e[3]=a=>s.handleNumberInput("temperature",a.target.value)),type:"number",min:"0",max:"2",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Igr)])]),b("div",Hgr,[e[17]||(e[17]=To(' Max New Tokens ',1)),b("div",Vgr,[b("input",{id:"n_predict-range",value:n.config.n_predict,onInput:e[4]||(e[4]=a=>s.handleNumberInput("n_predict",a.target.value,!0)),type:"range",min:"32",max:"8192",step:"32",class:"range-input flex-grow",disabled:s.isDisabled},null,40,qgr),b("input",{id:"n_predict-number",value:n.config.n_predict,onInput:e[5]||(e[5]=a=>s.handleNumberInput("n_predict",a.target.value,!0)),type:"number",min:"32",max:"8192",step:"32",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Ugr)])]),b("div",Bgr,[e[18]||(e[18]=To(' Top-K Sampling ',1)),b("div",zgr,[b("input",{id:"top_k-range",value:n.config.top_k,onInput:e[6]||(e[6]=a=>s.handleNumberInput("top_k",a.target.value,!0)),type:"range",min:"0",max:"100",step:"1",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Xgr),b("input",{id:"top_k-number",value:n.config.top_k,onInput:e[7]||(e[7]=a=>s.handleNumberInput("top_k",a.target.value,!0)),type:"number",min:"0",max:"100",step:"1",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Fgr)])]),b("div",jgr,[e[19]||(e[19]=To(' Top-P (Nucleus) Sampling ',1)),b("div",Ygr,[b("input",{id:"top_p-range",value:n.config.top_p,onInput:e[8]||(e[8]=a=>s.handleNumberInput("top_p",a.target.value)),type:"range",min:"0",max:"1",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Ggr),b("input",{id:"top_p-number",value:n.config.top_p,onInput:e[9]||(e[9]=a=>s.handleNumberInput("top_p",a.target.value)),type:"number",min:"0",max:"1",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Wgr)])]),b("div",Zgr,[e[20]||(e[20]=To(' Repeat Penalty ',1)),b("div",Kgr,[b("input",{id:"repeat_penalty-range",value:n.config.repeat_penalty,onInput:e[10]||(e[10]=a=>s.handleNumberInput("repeat_penalty",a.target.value)),type:"range",min:"0.5",max:"2.0",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Jgr),b("input",{id:"repeat_penalty-number",value:n.config.repeat_penalty,onInput:e[11]||(e[11]=a=>s.handleNumberInput("repeat_penalty",a.target.value)),type:"number",min:"0.5",max:"2.0",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,eQr)])]),b("div",tQr,[e[21]||(e[21]=To(' Repeat Penalty Lookback ',1)),b("div",nQr,[b("input",{id:"repeat_last_n-range",value:n.config.repeat_last_n,onInput:e[12]||(e[12]=a=>s.handleNumberInput("repeat_last_n",a.target.value,!0)),type:"range",min:"0",max:"512",step:"8",class:"range-input flex-grow",disabled:s.isDisabled},null,40,rQr),b("input",{id:"repeat_last_n-number",value:n.config.repeat_last_n,onInput:e[13]||(e[13]=a=>s.handleNumberInput("repeat_last_n",a.target.value,!0)),type:"number",min:"0",max:"512",step:"8",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,iQr)])])],2)])}const oQr=st($gr,[["render",sQr],["__scopeId","data-v-1dc5e8f0"]]);Ae.defaults.baseURL="/";const Y8={accept:"application/json","Content-Type":"application/json"},aQr={name:"SettingsView",components:{SettingsSidebar:i5r},data(){return{isLoading:!1,settingsChanged:!1,has_updates:!1,activeSection:"system_status",loading_text:"Loading settings...",editableConfig:null,sections:[{id:"system_status",name:"System Status",icon:"activity",component:rs(X5r)},{id:"main_config",name:"Main Config",icon:"sliders",component:rs(r7r)},{id:"model_config",name:"Model Parameters",icon:"cpu",component:rs(oQr)},{id:"smart_routing",name:"Smart Routing",icon:"git-branch",component:rs(_6r)},{id:"data_management",name:"Data Management",icon:"database",component:rs(V8r)},{id:"internet",name:"Internet",icon:"wifi",component:rs(lhr)},{id:"services_zoo",name:"Services Zoo",icon:"server",component:rs(h9r)},{id:"binding_zoo",name:"Bindings Zoo",icon:"link",component:rs(gpr)},{id:"models_zoo",name:"Models Zoo",icon:"package",component:rs(_Or)},{id:"personalities_zoo",name:"Personalities Zoo",icon:"users",component:rs(Amr)},{id:"function_calls_zoo",name:"Function Calls Zoo",icon:"tool",component:rs(Lgr)}]}},computed:{configToEdit(){return this.editableConfig??this.$store.state.config},currentComponent(){const t=this.sections.find(e=>e.id===this.activeSection);return t?t.component:null}},methods:{deepClone(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t)){const n=[];for(let r=0;r{e&&(this.cancelConfiguration(!1),this.activeSection=t)}):this.activeSection=t},handleSettingUpdated(t){this.editableConfig||(this.editableConfig=this.deepClone(this.$store.state.config));const e=t.key.split(".");let n=this.editableConfig;try{for(;e.length>1;){const a=e.shift(),l=a.match(/^(\w+)\[(\d+)\]$/);let c=a,u=-1;if(l&&(c=l[1],u=parseInt(l[2],10)),!n||typeof n!="object"||!n.hasOwnProperty(c))throw new Error(`Invalid path segment: ${c}`);if(u!==-1){if(!Array.isArray(n[c])||u>=n[c].length)throw new Error(`Invalid array index: ${u} for key ${c}`);n=n[c][u]}else n=n[c]}const r=e[0],i=r.match(/^(\w+)\[(\d+)\]$/);let s=r,o=-1;if(i&&(s=i[1],o=parseInt(i[2],10)),typeof n!="object"||n===null)throw new Error(`Cannot set property on non-object: ${r}`);if(o!==-1){if(!n.hasOwnProperty(s)||!Array.isArray(n[s])||o>=n[s].length)throw new Error(`Invalid final array index: ${o} for key ${s}`);n[s][o]=t.value}else n[s]=t.value;this.settingsChanged=!0}catch(r){this.$store.state.toast.showToast(`Error updating setting ${t.key}: ${r.message}`,4,!1)}},async refreshConfigInView(){this.isLoading=!0,this.loading_text="Refreshing config...";try{await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModelsArr"),this.editableConfig=null,this.settingsChanged=!1,this.$store.state.toast.showToast("Configuration refreshed.",2,!0)}catch(t){this.$store.state.toast.showToast("Failed to load configuration.",4,!1),console.error("Error refreshing config or model lists:",t),this.editableConfig=null,this.settingsChanged=!1}finally{this.isLoading=!1,Fe(()=>{Re.replace()})}},async applyConfiguration(){if(!this.settingsChanged||!this.editableConfig){this.$store.state.toast.showToast("No changes to apply.",3,!1);return}this.isLoading=!0,this.loading_text="Applying settings...";let t=!1;try{const e=await Ae.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.editableConfig},{headers:Y8});e.data.status?(this.$store.state.toast.showToast("Settings applied. Refreshing...",4,!0),t=!0,await this.refreshConfigInView()):this.$store.state.toast.showToast(`Apply failed: ${e.data.error||"Error"}`,4,!1)}catch(e){this.$store.state.toast.showToast(`Error applying settings: ${e.message||e}`,4,!1)}finally{t||(this.isLoading=!1)}},cancelConfiguration(t=!0){this.editableConfig=null,this.settingsChanged=!1},async saveConfiguration(){this.isLoading=!0,this.loading_text="Saving configuration...";try{const t=await Ae.post("/save_settings",{client_id:this.$store.state.client_id},{headers:Y8});t.data.status?this.$store.state.toast.showToast("Settings saved successfully.",4,!0):this.$store.state.messageBox.showMessage(`Error saving settings: ${t.data.error||"Error"}`)}catch(t){this.$store.state.messageBox.showMessage(`Error saving settings: ${t.message}`)}finally{this.isLoading=!1,this.$store.commit("refreshBindings"),this.$store.commit("refreshModelsZoo")}},reset_configuration(){this.$store.state.yesNoDialog.askQuestion("Reset config to default? This deletes current settings.","Reset","Cancel").then(async t=>{if(t){this.isLoading=!0,this.loading_text="Resetting...";let e=!1;try{const n=await Ae.post("/reset_settings",{client_id:this.$store.state.client_id},{headers:Y8});n.data.status?(this.$store.state.messageBox.showMessage("Settings reset. Reloading..."),e=!0,setTimeout(()=>window.location.reload(),2e3)):this.$store.state.messageBox.showMessage(`Reset failed: ${n.data.error||"Error"}`)}catch(n){this.$store.state.messageBox.showMessage(`Reset failed: ${n.message}`)}finally{e||(this.isLoading=!1)}}})},async restart_program(){this.loading_text="Restarting...",this.isLoading=!0;let t=!1;try{const e=await this.api_post_req("restart_program");e.status?(this.$store.state.toast.showToast("Restarting LoLLMs...",4,!0),t=!0):this.$store.state.toast.showToast(`Restart command failed: ${e.error||"Error"}`,4,!1)}catch{}finally{t||(this.isLoading=!1)}},async clear_uploads(){this.loading_text="Clearing uploads...",this.isLoading=!0;try{const t=await this.api_get_req("clear_uploads");t.status?this.$store.state.toast.showToast("Uploads folder cleared!",4,!0):this.$store.state.toast.showToast(`Clear failed: ${t.error||"Error"}`,4,!1)}catch{}finally{this.isLoading=!1}},async update_software(){this.loading_text="Updating...",this.isLoading=!0;let t=!1;try{const e=await this.api_post_req("update_software");this.$store.state.toast.showToast("Update initiated. LoLLMs might restart.",4,!0),this.has_updates=!1,t=!0,e.status||this.$store.state.toast.showToast(`Update command sent, server reported issue: ${e.error||"Unknown"}`,4,!1)}catch{}finally{t||(this.isLoading=!1)}},async updateHasUpdates(){try{const t=await this.api_get_req("check_update");this.has_updates=(t==null?void 0:t.update_availability)||!1,Fe(()=>{Re.replace()})}catch{this.has_updates=!1}},async api_get_req(t){if(this.$store.state.api_get_req)return this.$store.state.api_get_req(t);try{return(await Ae.get(`/${t}?client_id=${this.$store.state.client_id}`)).data}catch(e){throw this.$store.state.toast.showToast(`GET Error: ${e.message}`,4,!1),e}},async api_post_req(t,e={}){if(this.$store.state.api_post_req)return this.$store.state.api_post_req(t,e);try{const n={...e,client_id:this.$store.state.client_id};return(await Ae.post(`/${t}`,n,{headers:Y8})).data}catch(n){throw this.$store.state.toast.showToast(`POST Error: ${n.message}`,4,!1),n}}},mounted(){this.refreshConfigInView(),this.updateHasUpdates(),Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},lQr={class:"flex h-screen w-screen font-sans antialiased theme-bg-primary theme-text-primary"},cQr={class:"flex-1 flex flex-col overflow-hidden"},uQr={class:"flex items-center gap-4 flex-1"},dQr={key:0,class:"flex items-center gap-2 theme-text-warning animate-pulse"},fQr={key:1,class:"flex gap-3 items-center"},hQr={key:0,class:"flex items-center gap-2"},pQr={key:1,class:"flex items-center gap-2 text-sm theme-text-muted"},TQr={class:"flex-1 overflow-x-hidden overflow-y-auto theme-scrollbar p-6"},OQr={key:1,class:"flex justify-center items-center h-full theme-text-secondary"};function mQr(t,e,n,r,i,s){const o=Xe("SettingsSidebar");return k(),R("div",lQr,[te(o,{sections:i.sections,"active-section":i.activeSection,"onUpdate:activeSection":s.setActiveSection,class:"flex-shrink-0 w-64 border-r theme-border-primary theme-bg-secondary overflow-y-auto theme-scrollbar"},null,8,["sections","active-section","onUpdate:activeSection"]),b("div",cQr,[b("div",{class:ye(["sticky top-0 z-20 flex items-center justify-between p-3 gap-3 shadow-md theme-bg-secondary theme-border-b theme-border-primary",i.isLoading?"opacity-50 pointer-events-none":""])},[b("div",uQr,[i.settingsChanged&&!i.isLoading?(k(),R("div",dQr,e[6]||(e[6]=[b("i",{"data-feather":"alert-circle",class:"w-5 h-5"},null,-1),b("span",{class:"text-sm font-medium"},"Settings have changed",-1)]))):ne("",!0),!i.settingsChanged&&!i.isLoading?(k(),R("div",fQr,[b("button",{title:"Reset configuration to default",class:"icon-button theme-text-secondary hover:theme-text-primary",onClick:e[0]||(e[0]=a=>s.reset_configuration())},e[7]||(e[7]=[b("i",{"data-feather":"refresh-ccw"},null,-1)])),b("button",{title:"Restart program",class:"icon-button theme-text-secondary hover:theme-text-primary",onClick:e[1]||(e[1]=a=>s.restart_program())},e[8]||(e[8]=[b("i",{"data-feather":"power"},null,-1)])),b("button",{title:"Clear uploads folder",class:"icon-button theme-text-secondary hover:theme-text-danger",onClick:e[2]||(e[2]=a=>s.clear_uploads())},e[9]||(e[9]=[b("i",{"data-feather":"trash-2"},null,-1)])),i.has_updates?(k(),R("button",{key:0,title:"Upgrade program",class:"icon-button theme-text-success hover:theme-text-primary relative",onClick:e[3]||(e[3]=a=>s.update_software())},e[10]||(e[10]=[b("i",{"data-feather":"arrow-up-circle"},null,-1),b("span",{class:"absolute top-0 right-0 block h-2 w-2 rounded-full theme-bg-danger ring-2 theme-ring-bg"},null,-1)]))):ne("",!0)])):ne("",!0)]),i.settingsChanged&&!i.isLoading?(k(),R("div",hQr,[b("button",{class:"flex items-center gap-2 px-3 py-1.5 rounded theme-button-success duration-150 active:scale-95",title:"Apply changes",type:"button",onClick:e[4]||(e[4]=oe(a=>s.applyConfiguration(),["stop"]))},e[11]||(e[11]=[b("span",{class:"font-medium text-sm"},"Apply",-1),b("i",{"data-feather":"check",class:"w-4 h-4"},null,-1)])),b("button",{class:"flex items-center gap-2 px-3 py-1.5 rounded theme-button-danger duration-150 active:scale-95",title:"Cancel changes",type:"button",onClick:e[5]||(e[5]=oe(a=>s.cancelConfiguration(),["stop"]))},e[12]||(e[12]=[b("span",{class:"font-medium text-sm"},"Cancel",-1),b("i",{"data-feather":"x",class:"w-4 h-4"},null,-1)]))])):ne("",!0),i.isLoading?(k(),R("div",pQr,[b("span",null,ae(i.loading_text),1),e[13]||(e[13]=b("svg",{"aria-hidden":"true",class:"w-5 h-5 animate-spin theme-spinner-color",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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)),e[14]||(e[14]=b("span",{class:"sr-only"},"Loading...",-1))])):ne("",!0)],2),b("main",TQr,[s.configToEdit?(k(),Qt(t7(s.currentComponent),{key:0,config:s.configToEdit,loading:i.isLoading,onSettingUpdated:s.handleSettingUpdated,api_get_req:s.api_get_req,api_post_req:s.api_post_req,show_toast:this.$store.state.toast.showToast,show_yes_no_dialog:this.$store.state.yesNoDialog.askQuestion,show_message_box:this.$store.state.messageBox.showMessage,client_id:t.$store.state.client_id,show_universal_form:this.$store.state.universalForm.showForm},null,40,["config","loading","onSettingUpdated","api_get_req","api_post_req","show_toast","show_yes_no_dialog","show_message_box","client_id","show_universal_form"])):(k(),R("div",OQr,e[15]||(e[15]=[b("p",null,"Loading configuration...",-1)])))])])])}const gQr=st(aQr,[["render",mQr],["__scopeId","data-v-ea18b7b2"]]),QQr={components:{ClipBoardTextInput:Eoe,Card:zC},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Ae.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])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},_Qr={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},vQr={class:"mb-4"},yQr=["value"],bQr={class:"mb-4"},SQr={class:"mb-4"},xQr={class:"mb-4"},EQr={class:"mb-4"},wQr={class:"mb-4"},CQr={class:"mb-4"},LQr={key:1};function $Qr(t,e,n,r,i,s){const o=Xe("Card"),a=Xe("ClipBoardTextInput");return s.selectedModel!==null&&s.selectedModel.toLowerCase().includes("gptq")?(k(),R("div",_Qr,[b("form",{onSubmit:e[2]||(e[2]=oe((...l)=>s.submitForm&&s.submitForm(...l),["prevent"])),class:""},[te(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[te(o,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[b("div",vQr,[e[3]||(e[3]=b("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),He(b("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>t.setModel&&t.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(k(!0),R(Ve,null,dt(s.models,l=>(k(),R("option",{key:l,value:l},ae(l),9,yQr))),128))],544),[[$s,s.selectedModel]])])]),_:1}),te(o,{title:"Data",isHorizontal:!1},{default:Ie(()=>[b("div",bQr,[e[4]||(e[4]=b("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1)),te(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),te(o,{title:"Training",isHorizontal:!1},{default:Ie(()=>[b("div",SQr,[e[5]||(e[5]=b("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),b("div",xQr,[e[6]||(e[6]=b("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),b("div",EQr,[e[7]||(e[7]=b("label",{for:"max_length",class:"text-sm"},"Max Length:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),b("div",wQr,[e[8]||(e[8]=b("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),te(o,{title:"Output",isHorizontal:!1},{default:Ie(()=>[b("div",CQr,[e[9]||(e[9]=b("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1)),te(a,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),te(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[10]||(e[10]=[b("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1)])),_:1})],32)])):(k(),R("div",LQr,[te(o,{title:"Info",class:"",isHorizontal:!1},{default:Ie(()=>e[11]||(e[11]=[Se(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")])),_:1})]))}const AQr=st(QQr,[["render",$Qr]]),kQr={components:{ClipBoardTextInput:Eoe,Card:zC},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)}}},PQr={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"},RQr={class:"mb-4"},MQr={class:"mb-4"};function DQr(t,e,n,r,i,s){const o=Xe("ClipBoardTextInput"),a=Xe("Card");return k(),R("div",PQr,[b("form",{onSubmit:e[0]||(e[0]=oe((...l)=>s.submitForm&&s.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[te(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[te(a,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[b("div",RQr,[e[1]||(e[1]=b("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),te(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),b("div",MQr,[e[2]||(e[2]=b("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1)),te(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),te(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[3]||(e[3]=[b("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1)])),_:1})],32)])}const NQr=st(kQr,[["render",DQr]]),IQr={name:"WelcomeScreen",props:{isReady:{type:Boolean,required:!0},loadingProgress:{type:Number,required:!0},loadingInfos:{type:String,required:!0},versionInfo:{type:String,required:!0},interestingFacts:{type:Array,required:!0}},data(){return{randomFact:""}},computed:{...Pu(["config","theme_vars"]),appName(){var t,e;return((t=this.config)==null?void 0:t.app_custom_name)||((e=this.theme_vars)==null?void 0:e.lollms_title)||"LoLLMs"},appSlogan(){var t;return((t=this.config)==null?void 0:t.app_custom_slogan)||"One tool to rule them all"},shouldShowLollmsParagraphs(){var t;return!((t=this.config)!=null&&t.app_custom_name)},shouldShowLollmsFunFacts(){var t;return(t=this.config)==null?void 0:t.app_show_fun_facts}},methods:{updateRandomFact(){let t;if(this.interestingFacts.length<=1){this.randomFact=this.interestingFacts.length===1?this.interestingFacts[0]:"";return}do t=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)];while(t===this.randomFact);this.randomFact=t}},mounted(){this.updateRandomFact()},watch:{interestingFacts:{handler(){this.updateRandomFact()},immediate:!0}}},HQr={key:0,class:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-gradient-welcome text-blue-800 dark:text-blue-100"},VQr={key:0,class:"absolute inset-0 pointer-events-none overflow-hidden opacity-70"},qQr={class:"relative z-10 flex w-full max-w-4xl flex-col items-center px-6 text-center"},UQr={class:"mb-10 w-full"},BQr={class:"lollms-title-style mb-3 text-5xl font-extrabold tracking-tight drop-shadow-md md:text-7xl transition-transform duration-300 hover:scale-[1.03]"},zQr={class:"text-xl italic md:text-2xl text-subtitle"},XQr={key:0,class:"mt-4 text-base text-author"},FQr={class:"mt-1 text-sm text-author"},jQr={class:"text-base text-blue-800 dark:text-blue-200"},YQr=["innerHTML"],GQr={class:"w-full max-w-lg"},WQr={class:"mb-3 h-3 w-full overflow-hidden rounded-full shadow-inner animated-progressbar-bg"},ZQr={role:"status",class:"w-full"},KQr={class:"text-2xl font-semibold text-progress"};function JQr(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade-smooth"},{default:Ie(()=>[n.isReady?ne("",!0):(k(),R("div",HQr,[t.$store.state.theme_vars.activate_dropping_animation?(k(),R("div",VQr,[(k(),R(Ve,null,dt(60,o=>b("div",{key:o,class:"absolute animate-fall text-xs text-blue-300 dark:text-blue-500",style:qn({left:`${Math.random()*100}%`,top:"-30px",animationDuration:`${4+Math.random()*8}s`,animationDelay:`${Math.random()*6}s`,opacity:`${.3+Math.random()*.5}`})},ae(t.$store.state.theme_vars.falling_object||"·"),5)),64))])):ne("",!0),b("div",qQr,[b("div",UQr,[b("h1",BQr,ae(s.appName),1),b("p",zQr,ae(s.appSlogan),1),s.shouldShowLollmsParagraphs?(k(),R("p",XQr," by ParisNeo ")):ne("",!0),b("p",FQr,ae(n.versionInfo),1)]),s.shouldShowLollmsFunFacts&&i.randomFact?(k(),R("div",{key:0,class:"mb-8 w-full max-w-xl cursor-pointer rounded-lg border p-4 shadow-lg backdrop-blur-sm transition-all duration-300 card border-blue-300 dark:border-blue-600 hover:bg-blue-200 dark:hover:bg-blue-700 hover:border-blue-400 dark:hover:border-blue-500",onClick:e[0]||(e[0]=(...o)=>s.updateRandomFact&&s.updateRandomFact(...o))},[b("p",jQr,[e[1]||(e[1]=b("span",{class:"font-semibold text-blue-600 dark:text-blue-400"},"🤔 Fun Fact: ",-1)),b("span",{innerHTML:i.randomFact,class:"italic"},null,8,YQr)])])):ne("",!0),b("div",GQr,[b("div",WQr,[b("div",{class:"h-full rounded-full shadow-md transition-all duration-500 ease-out animated-progressbar-fg",style:qn({width:`${n.loadingProgress}%`})},null,4)]),b("div",ZQr,[(k(),R("p",{class:"mb-1 text-lg transition-opacity duration-300 text-loading",key:n.loadingInfos},ae(n.loadingInfos)+"... ",1)),b("p",KQr,ae(Math.round(n.loadingProgress))+"% ",1)])])])]))]),_:1})}const e_r=st(IQr,[["render",JQr]]),t_r={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked","toggle-star"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean,openfolder_enabled:Boolean,isStarred:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:"",checkBoxValue_local:!1}},computed:{confirmTitle(){return this.editTitleMode?"Confirm title change":this.makeTitleMode?"Confirm title generation":this.deleteMode?"Confirm deletion":"Confirm"}},methods:{updateFeatherIcons(){Fe(()=>{Re.replace()})},resetModes(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.editTitle=!1},cancel(){this.resetModes(),this.newTitle=this.title,this.updateFeatherIcons()},confirmAction(){this.editTitleMode?this.editTitleEvent():this.makeTitleMode?this.makeTitleEvent():this.deleteMode&&this.deleteEvent(),this.updateFeatherIcons()},deleteEvent(){this.$emit("delete"),this.resetModes()},selectEvent(){!this.showConfirmation&&!this.isCheckbox&&this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.$emit("editTitle",{title:this.newTitle,id:this.id}),this.resetModes()},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.resetModes()},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",{id:e,checked:t.target.checked}),this.checkBoxValue_local=t.target.checked},toggleStarEvent(){this.$emit("toggle-star")}},mounted(){this.newTitle=this.title,this.checkBoxValue_local=this.checkBoxValue,this.updateFeatherIcons()},watch:{showConfirmation(){this.updateFeatherIcons()},isStarred(){this.updateFeatherIcons()},isCheckbox(){this.updateFeatherIcons()},editTitleMode(t){t&&(this.showConfirmation=!0,this.editTitle=!0,this.makeTitleMode=!1,this.deleteMode=!1,this.newTitle=this.title,Fe(()=>{var e;(e=this.$refs.titleBox)==null||e.focus()})),this.updateFeatherIcons()},makeTitleMode(t){t&&(this.showConfirmation=!0,this.editTitleMode=!1,this.deleteMode=!1,this.editTitle=!1),this.updateFeatherIcons()},deleteMode(t){t&&(this.showConfirmation=!0,this.editTitleMode=!1,this.makeTitleMode=!1,this.editTitle=!1),this.updateFeatherIcons()},checkBoxValue(t){this.checkBoxValue_local!==t&&(this.checkBoxValue_local=t)},title(t){this.editTitleMode||(this.newTitle=t)}}},n_r=["id"],r_r={class:"flex flex-row items-center gap-2 flex-shrink-0"},i_r={key:0},s_r={class:"flex flex-row items-center flex-grow overflow-hidden mx-1"},o_r=["title"],a_r=["value"],l_r={class:"absolute top-0 right-0 h-full flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10"},c_r={class:"discussion-toolbox flex items-center space-x-1 bg-white dark:bg-gray-800 p-1 mr-1 rounded shadow-lg border border-gray-200 dark:border-gray-700"},u_r={key:0,class:"flex gap-1 items-center"},d_r=["title"],f_r={key:1,class:"flex gap-1 items-center"},h_r=["title"];function p_r(t,e,n,r,i,s){return k(),R("div",{class:ye([n.selected?"discussion-hilighted":"discussion","m-1 py-2 flex flex-row sm:flex-row flex-wrap flex-shrink-0 items-center rounded-md duration-75 cursor-pointer relative group w-[15rem]"]),id:"dis-"+n.id,onClick:e[14]||(e[14]=oe(o=>s.selectEvent(),["stop"]))},[b("div",r_r,[n.isCheckbox?(k(),R("div",i_r,[He(b("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 ml-1",onClick:e[0]||(e[0]=oe(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onChange:e[2]||(e[2]=o=>s.checkedChangeEvent(o,n.id))},null,544),[[W3,i.checkBoxValue_local]])])):ne("",!0),n.selected?(k(),R("div",{key:1,class:ye(["min-h-full w-1.5 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent":"bg-secondary"])},null,2)):ne("",!0),n.selected?ne("",!0):(k(),R("div",{key:2,class:ye(["w-1.5",n.loading?"min-h-full w-1.5 rounded-xl self-stretch animate-bounce bg-accent":""])},null,2))]),b("div",s_r,[i.editTitle?ne("",!0):(k(),R("p",{key:0,title:n.title,class:"line-clamp-1 w-full text-xs"},ae(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,o_r)),i.editTitle?(k(),R("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full p-1 text-xs",value:n.title,required:"",onKeydown:[e[3]||(e[3]=gr(oe(o=>s.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=gr(oe(o=>s.cancel(),["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>s.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=oe(()=>{},["stop"]))},null,40,a_r)):ne("",!0)]),b("div",l_r,[b("div",c_r,[i.showConfirmation?(k(),R("div",u_r,[b("button",{class:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900 text-red-600 dark:text-red-400 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[7]||(e[7]=oe(o=>s.cancel(),["stop"]))},e[15]||(e[15]=[b("i",{"data-feather":"x",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-green-100 dark:hover:bg-green-900 text-green-600 dark:text-green-400 duration-75 active:scale-90",title:s.confirmTitle,type:"button",onClick:e[8]||(e[8]=oe(o=>s.confirmAction(),["stop"]))},e[16]||(e[16]=[b("i",{"data-feather":"check",class:"w-4 h-4"},null,-1)]),8,d_r)])):ne("",!0),i.showConfirmation?ne("",!0):(k(),R("div",f_r,[b("button",{class:ye(["p-1 rounded duration-75 active:scale-90",n.isStarred?"text-yellow-500 hover:bg-yellow-100 dark:hover:bg-yellow-900":"text-gray-400 hover:text-yellow-500 hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-yellow-400"]),title:n.isStarred?"Unstar discussion":"Star discussion",type:"button",onClick:e[9]||(e[9]=oe(o=>s.toggleStarEvent(),["stop"]))},[b("i",{"data-feather":"star",class:ye(["w-4 h-4",{"fill-current":n.isStarred}])},null,2)],10,h_r),n.openfolder_enabled?(k(),R("button",{key:0,class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[10]||(e[10]=oe(o=>s.openFolderEvent(),["stop"]))},e[17]||(e[17]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]))):ne("",!0),b("button",{class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Generate title",type:"button",onClick:e[11]||(e[11]=oe(o=>i.makeTitleMode=!0,["stop"]))},e[18]||(e[18]=[b("i",{"data-feather":"type",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[12]||(e[12]=oe(o=>i.editTitleMode=!0,["stop"]))},e[19]||(e[19]=[b("i",{"data-feather":"edit-2",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900 text-red-600 dark:text-red-400 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[13]||(e[13]=oe(o=>i.deleteMode=!0,["stop"]))},e[20]||(e[20]=[b("i",{"data-feather":"trash",class:"w-4 h-4"},null,-1)]))]))])])],10,n_r)}const Voe=st(t_r,[["render",p_r],["__scopeId","data-v-3d6bc6d8"]]),T_r="/";Ae.defaults.baseURL="/";const O_r={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:doe},data(){return{bUrl:T_r,isMounted:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},isActive(){return this.$store.state.mountedPers&&this.$store.state.config.active_personality_id===this.$store.state.config.personalities.findIndex(t=>t===this.$store.state.mountedPers.full_path)}},methods:{async handleOnTalk(){const t=this.mountedPers;if(!t){this.$store.state.toast.showToast("No personality mounted to talk with.",3,!1);return}console.log("Talking with:",t.name);try{let e=await Ae.get("/get_generation_status",{});if(e&&!e.data.status){const n=this.$store.state.config.personalities.findIndex(r=>r===t.full_path);if(n!==this.$store.state.config.active_personality_id){const r={client_id:this.$store.state.client_id,id:n};let i=await Ae.post("/select_personality",r);if(!i.data.status){console.error("Failed to select personality before talking:",i.data.error),this.$store.state.toast.showToast(`Error selecting ${t.name}: ${i.data.error}`,4,!1);return}this.$store.commit("setActivePersonalityId",n),this.$store.commit("setMountedPers",this.$store.state.personalities_infos[n])}console.log("Requesting generation from:",t.name),et.emit("generate_msg_from",{id:n})}else e?(console.log("Already generating"),this.$store.state.toast.showToast("Generation is already in progress.",3,!1)):(console.error("Could not get generation status."),this.$store.state.toast.showToast("Error checking generation status.",4,!1))}catch(e){console.error("Error during handleOnTalk:",e),this.$store.state.toast.showToast(`Error initiating talk: ${e.message}`,4,!1)}finally{}},async remount_personality(){var e;const t=this.mountedPers;if(!t)return this.$store.state.toast.showToast("No personality mounted to remount.",3,!1),{status:!1,error:"no personality selected"};console.log("Remounting personality ",t.name),this.$store.state.toast.showToast(`Remounting ${t.name}...`,4,!0);try{const n={client_id:this.$store.state.client_id,category:t.category,folder:t.folder,language:t.language},r=await Ae.post("/remount_personality",n);if(r&&r.data.status)return console.log("Personality remounted successfully:",r.data),this.$store.state.toast.showToast(`${t.name} remounted successfully!`,4,!0),this.$store.dispatch("refreshPersonalityData"),r.data;{const i=((e=r==null?void 0:r.data)==null?void 0:e.error)||"Unknown error";return console.error("Failed remount_personality:",i),this.$store.state.toast.showToast(`Failed to remount ${t.name}: ${i}`,4,!1),(r==null?void 0:r.data)||{status:!1,error:i}}}catch(n){return console.error("Error during remount_personality:",n),this.$store.state.toast.showToast(`Error remounting: ${n.message}`,4,!1),{status:!1,error:n.message}}},async onSettingsPersonality(t){var e;if(!t){this.$store.state.toast.showToast("No personality selected for settings.",3,!1);return}console.log("Opening settings for:",t.name);try{const n=this.$store.state.config.personalities.findIndex(i=>i===t.full_path);if(n!==this.$store.state.config.active_personality_id){const i={client_id:this.$store.state.client_id,id:n};let s=await Ae.post("/select_personality",i);if(!s.data.status){console.error("Failed to select personality before opening settings:",s.data.error),this.$store.state.toast.showToast(`Error selecting ${t.name} for settings: ${s.data.error}`,4,!1);return}this.$store.commit("setActivePersonalityId",n),this.$store.commit("setMountedPers",this.$store.state.personalities_infos[n]),await Fe()}const r=await Ae.get("/get_active_personality_settings");if(r&&r.data&&Object.keys(r.data).length>0){console.log("Personality settings data:",r.data);const i=await this.$refs.universalForm.showForm(r.data,`Settings - ${t.name}`,"Save changes","Cancel");if(i){console.log("Saving new settings:",i);try{const s=await Ae.post("/set_active_personality_settings",i);if(s&&s.data&&s.data.status)console.log("Settings saved successfully:",s.data),this.$store.state.toast.showToast("Personality settings updated successfully!",4,!0);else{const o=((e=s==null?void 0:s.data)==null?void 0:e.error)||"Unknown error saving settings.";console.error("Failed to save settings:",o),this.$store.state.toast.showToast(`Failed to save settings: ${o}`,4,!1)}}catch(s){console.error("Error saving personality settings:",s),this.$store.state.toast.showToast(`Error saving settings: ${s.message}`,4,!1)}}else console.log("Settings editing cancelled.")}else r&&r.data&&Object.keys(r.data).length===0?this.$store.state.toast.showToast(`${t.name} has no configurable settings.`,4,!1):(console.error("Could not get personality settings response:",r),this.$store.state.toast.showToast("Failed to retrieve personality settings.",4,!1))}catch(n){console.error("Error fetching/showing personality settings:",n),this.$store.state.toast.showToast(`Could not open settings: ${n.message}`,4,!1)}},async constructor(){for(Fe(()=>{Re.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady&&this.onReady()},personalityImgPlacehodler(t){t.target.src=Mh}}},m_r={class:"relative group/item"},g_r=["title"],Q_r=["src","alt"],__r={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-auto flex items-center justify-center space-x-1 opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-2 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 z-10"};function v_r(t,e,n,r,i,s){const o=Xe("UniversalForm");return k(),R(Ve,null,[b("div",m_r,[b("button",{onClick:e[1]||(e[1]=oe(a=>s.onSettingsPersonality(s.mountedPers),["prevent"])),class:ye(["w-6 h-6 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none relative",{"glow-effect":t.$store.state.config.activate_skills_lib,"border-2 border-primary":s.isActive}]),title:"Configure "+s.mountedPers.name},[b("img",{src:s.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>s.personalityImgPlacehodler&&s.personalityImgPlacehodler(...a)),alt:s.mountedPers.name,class:"w-full h-full object-cover"},null,40,Q_r)],10,g_r),b("div",__r,[b("button",{onClick:e[2]||(e[2]=oe(a=>s.onSettingsPersonality(s.mountedPers),["prevent"])),class:"p-1 btn-secondary btn-xs rounded-full hover:scale-110 transition-transform duration-150",title:"Configure"},e[5]||(e[5]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826 3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),b("button",{onClick:e[3]||(e[3]=oe(a=>s.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none btn-xs hover:scale-110 transition-transform duration-150",title:"Remount"},e[6]||(e[6]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),b("button",{onClick:e[4]||(e[4]=oe(a=>s.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none btn-xs hover:scale-110 transition-transform duration-150",title:"Talk"},e[7]||(e[7]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)]))])]),te(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const y_r=st(O_r,[["render",v_r],["__scopeId","data-v-5f8375f1"]]),b_r={name:"HoverMenu",props:{items:{type:Array,required:!0},isActive:{type:Function,default:()=>!1},itemKeyExtractor:{type:Function,default:t=>t.id||t.name},itemNameExtractor:{type:Function,default:t=>t.name},itemIconExtractor:{type:Function,required:!0},placeholderIcon:{type:String,required:!0},searchPlaceholder:{type:String,default:"Search..."},menuWidthClass:{type:String,default:"w-80"},gridLayoutClass:{type:String,default:"grid grid-cols-3 gap-x-4 gap-y-4"},activeItemClass:{type:String,default:"border-blue-500 dark:border-sky-500"}},emits:["select-item"],data(){return{isMenuVisible:!1,searchQuery:"",hideMenuTimeout:null}},computed:{filteredItems(){const t=this.searchQuery.toLowerCase().trim();return t?this.items.filter(e=>{var n;return(n=this.getItemName(e))==null?void 0:n.toLowerCase().includes(t)}):this.items}},methods:{getItemKey(t){return this.itemKeyExtractor(t)},getItemName(t){return this.itemNameExtractor(t)},getItemIcon(t){return this.itemIconExtractor(t)||this.placeholderIcon},showMenu(){clearTimeout(this.hideMenuTimeout),this.isMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideMenu(){this.hideMenuTimeout=setTimeout(()=>{this.isMenuVisible=!1},300)},selectItem(t){this.$emit("select-item",t)}},mounted(){Fe(()=>Re.replace())},updated(){this.isMenuVisible&&Fe(()=>Re.replace())}},S_r={class:"p-2 border-b border-blue-200 dark:border-slate-700"},x_r=["placeholder"],E_r=["onClick","title"],w_r=["src","alt"],C_r={class:"animated-thought-bubble text-center"},L_r=["onClick"],$_r={key:0,class:"col-span-full text-center text-gray-500 dark:text-gray-400 py-4"};function A_r(t,e,n,r,i,s){return k(),R("div",{class:"relative",onMouseleave:e[3]||(e[3]=(...o)=>s.hideMenu&&s.hideMenu(...o))},[b("div",{onMouseenter:e[0]||(e[0]=(...o)=>s.showMenu&&s.showMenu(...o)),class:"hover-trigger flex items-center justify-center w-8 h-8"},[er(t.$slots,"trigger",{},void 0,!0)],32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[2]||(e[2]=(...o)=>s.showMenu&&s.showMenu(...o)),class:ye(["absolute top-full left-0 mt-1 z-50 transform panels-color rounded-md shadow-lg ring-1 ring-blue-300 dark:ring-slate-700 ring-opacity-50 focus:outline-none",n.menuWidthClass])},[b("div",S_r,[He(b("input",{type:"text","onUpdate:modelValue":e[1]||(e[1]=o=>i.searchQuery=o),placeholder:n.searchPlaceholder,class:"w-full input input-sm"},null,8,x_r),[[vt,i.searchQuery]])]),b("div",{class:ye(["px-4 py-3 pb-10 max-h-80 overflow-y-auto scrollbar",n.gridLayoutClass])},[(k(!0),R(Ve,null,dt(s.filteredItems,o=>(k(),R("div",{key:s.getItemKey(o),class:"relative group/item flex flex-col items-center"},[b("button",{onClick:oe(a=>s.selectItem(o),["prevent"]),title:s.getItemName(o),class:ye(["w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none border-2 mb-1",n.isActive(o)?n.activeItemClass:"border-transparent hover:border-blue-300 dark:hover:border-slate-600"])},[b("img",{src:s.getItemIcon(o),alt:s.getItemName(o),class:"w-full h-full object-cover"},null,8,w_r)],10,E_r),b("div",C_r,[b("span",{class:"text-xs font-medium mb-1 block cursor-pointer",onClick:oe(a=>s.selectItem(o),["prevent"])},ae(s.getItemName(o)),9,L_r),er(t.$slots,"item-actions",{item:o},void 0,!0)])]))),128)),s.filteredItems.length===0?(k(),R("div",$_r," No items found. ")):ne("",!0)],2)],34),[[mr,i.isMenuVisible]])]),_:3})],32)}const k_r=st(b_r,[["render",A_r],["__scopeId","data-v-9178f2bc"]]),P_r={name:"Toolbar",components:{MountedPersonalities:y_r,HoverMenu:k_r},props:{loading:Boolean,isCheckbox:Boolean},emits:["create-new-discussion","add-discussion-to-skills-library","toggle-skills-lib","show-skills-lib","toggle-edit-mode","reset-database","export-database","import-discussions","import-discussions-bundle","show-model-config","set-binding","copy-model-name","set-model","personality-selected","unmount-personality","remount-personality","talk-personality","personalities-ready","show-personality-list"],data(){return{isSkillsLibraryMenuVisible:!1,isMainMenuVisible:!1,modelImgPlaceholder:F9,hideMainMenuTimeout:null,hideSkillsLibraryMenuTimeout:null}},computed:{...Pu(["config","installedBindings","installedModels","mountedPersArr"]),...oE(["getCurrentBinding","getCurrentModel"]),currentBinding(){return this.getCurrentBinding||{name:"unknown",icon:this.modelImgPlaceholder}},currentModel(){return this.getCurrentModel||{name:"unknown",icon:this.modelImgPlaceholder}},currentBindingName(){var t;return(t=this.currentBinding)==null?void 0:t.name},currentModelName(){var t;return(t=this.currentModel)==null?void 0:t.name},currentBindingIcon(){var t;return((t=this.currentBinding)==null?void 0:t.icon)||this.modelImgPlaceholder},currentModelIcon(){var t;return((t=this.currentModel)==null?void 0:t.icon)||this.modelImgPlaceholder},activePersonalityId(){var t;return(t=this.$store.state.config)==null?void 0:t.active_personality_id},configPersonalities(){var t;return((t=this.$store.state.config)==null?void 0:t.personalities)||[]}},methods:{isActivePersonality(t){if(this.activePersonalityId===void 0||this.activePersonalityId<0||this.activePersonalityId>=this.configPersonalities.length||!(t!=null&&t.full_path))return!1;const e=this.configPersonalities[this.activePersonalityId];return t.full_path===e||t.full_path===(e==null?void 0:e.split(":")[0])},onPersonalitiesReadyFun(){this.$emit("personalities-ready")},onShowPersListFun(){this.$emit("show-personality-list")},triggerFileDialog(t){this.$refs[t]&&(this.$refs[t].value=null,this.$refs[t].click())},showSkillsLibraryMenu(){clearTimeout(this.hideSkillsLibraryMenuTimeout),this.isSkillsLibraryMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideSkillsLibraryMenu(){this.hideSkillsLibraryMenuTimeout=setTimeout(()=>{this.isSkillsLibraryMenuVisible=!1},300)},showMainMenu(){clearTimeout(this.hideMainMenuTimeout),this.isMainMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideMainMenu(){this.hideMainMenuTimeout=setTimeout(()=>{this.isMainMenuVisible=!1},300)}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},R_r={class:"toolbar-color flex items-center p-1 justify-around"},M_r={key:0,class:"toolbar-container flex items-center gap-1 relative"},D_r={class:"relative"},N_r={class:"relative"},I_r=["title"],H_r=["src","alt"],V_r={class:"flex space-x-1 justify-center"},q_r=["onClick"],U_r=["title"],B_r=["src","alt"],z_r={class:"flex space-x-1 justify-center"},X_r=["onClick"],F_r={class:"personalities-hover-area flex items-center justify-center w-8 h-8"},j_r={class:"flex space-x-1 justify-center"},Y_r=["onClick"],G_r=["onClick"],W_r=["onClick"],Z_r={key:1,class:"flex items-center justify-center w-full h-10"};function K_r(t,e,n,r,i,s){const o=Xe("HoverMenu"),a=Xe("MountedPersonalities");return k(),R("div",R_r,[n.loading?(k(),R("div",Z_r,e[40]||(e[40]=[b("div",{class:"text-gray-500"},"Buzzy...",-1)]))):(k(),R("div",M_r,[b("button",{class:"toolbar-button svg-button",title:"Create new discussion",onClick:e[0]||(e[0]=l=>t.$emit("create-new-discussion"))},e[23]||(e[23]=[b("i",{"data-feather":"plus",class:"w-5 h-5"},null,-1)])),n.loading?ne("",!0):(k(),R("div",{key:0,class:"relative",onMouseleave:e[7]||(e[7]=(...l)=>s.hideSkillsLibraryMenu&&s.hideSkillsLibraryMenu(...l))},[b("div",{onMouseenter:e[1]||(e[1]=(...l)=>s.showSkillsLibraryMenu&&s.showSkillsLibraryMenu(...l)),class:"menu-hover-area flex items-center justify-center w-8 h-8"},e[24]||(e[24]=[b("button",{class:"toolbar-button svg-button",title:"Toggle Skills library menu"},[b("svg",{class:"w-5 h-5",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{d:"M4 4v16h16V4H4zm2 2h12v12H6V6zm2 2h2v8H8V8zm3 0h2v8h-2V8zm3 0h2v8h-2V8z",fill:"currentColor"})])],-1)]),32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[6]||(e[6]=(...l)=>s.showSkillsLibraryMenu&&s.showSkillsLibraryMenu(...l)),class:"absolute top-full left-0 mt-1 z-50 transform card p-1 flex flex-wrap gap-1 items-center shadow-lg w-auto min-w-[10rem]"},[b("button",{type:"button",onClick:e[2]||(e[2]=oe(l=>t.$emit("add-discussion-to-skills-library"),["stop"])),title:"Add this discussion content to skills database",class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[25]||(e[25]=[b("i",{"data-feather":"plus",class:"w-5 h-5"},null,-1)])),t.$store.state.config.activate_skills_lib?(k(),R("button",{key:0,type:"button",onClick:e[3]||(e[3]=oe(l=>t.$emit("toggle-skills-lib"),["stop"])),title:"Skills database is activated",class:"svg-button text-green-500 hover:text-green-700 dark:text-green-400 dark:hover:text-green-200"},e[26]||(e[26]=[b("i",{"data-feather":"check-circle",class:"w-5 h-5"},null,-1)]))):(k(),R("button",{key:1,type:"button",onClick:e[4]||(e[4]=oe(l=>t.$emit("toggle-skills-lib"),["stop"])),title:"Skills database is deactivated",class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200"},e[27]||(e[27]=[b("i",{"data-feather":"x-octagon",class:"w-5 h-5"},null,-1)]))),b("button",{type:"button",onClick:e[5]||(e[5]=oe(l=>t.$emit("show-skills-lib"),["stop"])),title:"Show Skills database",class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[28]||(e[28]=[b("i",{"data-feather":"book",class:"w-5 h-5"},null,-1)]))],544),[[mr,i.isSkillsLibraryMenuVisible]])]),_:1})],32)),n.loading?ne("",!0):(k(),R("div",{key:1,class:"relative",onMouseleave:e[17]||(e[17]=(...l)=>s.hideMainMenu&&s.hideMainMenu(...l))},[b("div",{onMouseenter:e[8]||(e[8]=(...l)=>s.showMainMenu&&s.showMainMenu(...l)),class:"menu-hover-area flex items-center justify-center w-8 h-8"},e[29]||(e[29]=[b("button",{class:"toolbar-button svg-button",title:"Toggle menu"},[b("i",{"data-feather":"menu",class:"w-5 h-5"})],-1)]),32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[16]||(e[16]=(...l)=>s.showMainMenu&&s.showMainMenu(...l)),class:"absolute top-full left-0 mt-1 z-50 transform card p-1 flex flex-wrap gap-1 items-center shadow-lg w-auto min-w-[10rem]"},[b("button",{class:ye(["svg-button",n.isCheckbox?"text-blue-600 dark:text-sky-400 bg-blue-200 dark:bg-slate-700":"text-gray-600 dark:text-gray-300"]),title:"Edit discussion list",type:"button",onClick:e[9]||(e[9]=l=>t.$emit("toggle-edit-mode"))},e[30]||(e[30]=[b("i",{"data-feather":"check-square",class:"w-5 h-5"},null,-1)]),2),b("button",{class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Reset database, remove all discussions",onClick:e[10]||(e[10]=oe(l=>t.$emit("reset-database"),["stop"]))},e[31]||(e[31]=[b("i",{"data-feather":"trash-2",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300",title:"Export database",type:"button",onClick:e[11]||(e[11]=oe(l=>t.$emit("export-database"),["stop"]))},e[32]||(e[32]=[b("i",{"data-feather":"database",class:"w-5 h-5"},null,-1)])),b("div",D_r,[b("input",{type:"file",ref:"fileDialog",class:"hidden",onChange:e[12]||(e[12]=l=>t.$emit("import-discussions",l)),accept:".json, .yaml, .yml"},null,544),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300 rotate-90",title:"Import discussions",type:"button",onClick:e[13]||(e[13]=oe(l=>s.triggerFileDialog("fileDialog"),["stop"]))},e[33]||(e[33]=[b("i",{"data-feather":"log-in",class:"w-5 h-5"},null,-1)]))]),b("div",N_r,[b("input",{type:"file",ref:"bundleLoadingDialog",class:"hidden",onChange:e[14]||(e[14]=l=>t.$emit("import-discussions-bundle",l)),accept:".zip"},null,544),b("button",{title:"Import discussion bundle",onClick:e[15]||(e[15]=oe(l=>s.triggerFileDialog("bundleLoadingDialog"),["stop"])),class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[34]||(e[34]=[b("i",{"data-feather":"folder",class:"w-5 h-5"},null,-1)]))])],544),[[mr,i.isMainMenuVisible]])]),_:1})],32)),!n.loading&&t.installedBindings.length>0?(k(),Qt(o,{key:2,items:t.installedBindings,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.icon,"is-active":l=>l.name===s.currentBindingName,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search bindings...",onSelectItem:e[19]||(e[19]=l=>t.$emit("set-binding",l))},{trigger:Ie(()=>[b("button",{onClick:e[18]||(e[18]=oe(l=>t.$emit("show-model-config",null),["prevent"])),class:"w-6 h-6 block",title:s.currentBinding?s.currentBinding.name:"unknown"},[b("img",{src:s.currentBindingIcon,class:"w-full h-full rounded-full object-cover border-2 border-blue-300 dark:border-slate-600 active:scale-90 hover:border-blue-500 dark:hover:border-sky-400 hover:scale-110 hover:-translate-y-1 duration-200 transition-transform",alt:s.currentBinding?s.currentBinding.name:"Binding icon"},null,8,H_r)],8,I_r)]),"item-actions":Ie(({item:l})=>[b("div",V_r,[b("button",{onClick:oe(c=>t.$emit("show-model-config",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Configure Binding"},e[35]||(e[35]=[b("i",{"data-feather":"settings",class:"w-3 h-3"},null,-1)]),8,q_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","is-active","placeholder-icon"])):ne("",!0),!n.loading&&t.installedModels.length>0?(k(),Qt(o,{key:3,items:t.installedModels,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.icon,"is-active":l=>l.name===s.currentModelName,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search models...",onSelectItem:e[21]||(e[21]=l=>t.$emit("set-model",l))},{trigger:Ie(()=>[b("button",{onClick:e[20]||(e[20]=oe(l=>t.$emit("copy-model-name",null),["prevent"])),class:"w-6 h-6 block",title:s.currentModel?s.currentModel.name:"unknown"},[b("img",{src:s.currentModelIcon,class:"w-full h-full rounded-full object-cover border-2 border-blue-300 dark:border-slate-600 active:scale-90 hover:border-blue-500 dark:hover:border-sky-400 hover:scale-110 hover:-translate-y-1 duration-200 transition-transform",alt:s.currentModel?s.currentModel.name:"Model icon"},null,8,B_r)],8,U_r)]),"item-actions":Ie(({item:l})=>[b("div",z_r,[b("button",{onClick:oe(c=>t.$emit("copy-model-name",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Copy Model Name"},e[36]||(e[36]=[b("i",{"data-feather":"copy",class:"w-3 h-3"},null,-1)]),8,X_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","is-active","placeholder-icon"])):ne("",!0),!n.loading&&t.mountedPersArr.length>0?(k(),Qt(o,{key:4,items:t.mountedPersArr,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.avatar,"item-key-extractor":l=>l.full_path||l.name,"is-active":s.isActivePersonality,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search personalities...",onSelectItem:e[22]||(e[22]=l=>t.$emit("personality-selected",l))},{trigger:Ie(()=>[b("div",F_r,[te(a,{ref:"mountedPers",onShowPersList:s.onShowPersListFun,onReady:s.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])]),"item-actions":Ie(({item:l})=>[b("div",j_r,[b("button",{onClick:oe(c=>t.$emit("unmount-personality",l),["prevent"]),class:"p-1 bg-red-500 rounded-full text-white hover:bg-red-600 focus:outline-none btn-sm hover:scale-110 transition-transform duration-150",title:"Unmount"},e[37]||(e[37]=[b("i",{"data-feather":"x",class:"w-3 h-3"},null,-1)]),8,Y_r),b("button",{onClick:oe(c=>t.$emit("remount-personality",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Remount"},e[38]||(e[38]=[b("i",{"data-feather":"refresh-cw",class:"w-3 h-3"},null,-1)]),8,G_r),b("button",{onClick:oe(c=>t.$emit("talk-personality",l),["prevent"]),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none btn-sm hover:scale-110 transition-transform duration-150",title:"Talk"},e[39]||(e[39]=[b("i",{"data-feather":"message-square",class:"w-3 h-3"},null,-1)]),8,W_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","item-key-extractor","is-active","placeholder-icon"])):ne("",!0)]))])}const J_r=st(P_r,[["render",K_r],["__scopeId","data-v-66615957"]]),evr=t=>{const e=new Date;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()},tvr=t=>{const e=new Date;return e.setDate(e.getDate()-1),t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()},nvr={name:"LeftPanel",components:{Discussion:Voe,RouterLink:t9,Toolbar:J_r},props:{showLeftPanel:Boolean,discussionsList:Array,currentDiscussion:Object,toolbarLoading:Boolean,formattedDatabaseName:String},emits:["select-discussion","delete-discussion","open-folder","edit-title","make-title","create-new-discussion","add-discussion-to-skills-library","toggle-skills-lib","show-skills-lib","reset-database","export-database","import-discussions","import-discussions-bundle","show-model-config","set-binding","copy-model-name","set-model","personality-selected","unmount-personality","remount-personality","talk-personality","personalities-ready","show-personality-list","delete-selected","export-discussions-as-json","export-discussions-to-folder","export-discussions-as-markdown","show-database-selector","import-discussion-file","toggle-star-discussion"],data(){return{filterTitle:"",filterInProgress:!1,isCheckbox:!1,showConfirmation:!1,isDragOverDiscussion:!1,searchTimeout:null,localDiscussionsState:[],sortBy:"date",sortOrder:"desc",collapsedSections:{starred:!1,today:!1,yesterday:!0,older:!0}}},computed:{...Pu(["config","theme_vars"]),...oE(["getStarredDiscussionsSet"]),logoSrc(){var t;return(t=this.config)!=null&&t.app_custom_logo?`/user_infos/${this.config.app_custom_logo}`:Eo},logoTitle(){var t;return((t=this.config)==null?void 0:t.app_custom_name)||"LoLLMs WebUI"},appName(){var t;return((t=this.config)==null?void 0:t.app_custom_name)||"LoLLMS WebUI"},appSlogan(){var t;return((t=this.config)==null?void 0:t.app_custom_slogan)||"One tool to rule them all"},starredSet(){return this.getStarredDiscussionsSet||new Set},sortIcon(){return this.sortOrder==="asc"?"arrow-up":"arrow-down"},sortByLabel(){return{date:"Date",title:"Title"}[this.sortBy]||"Date"},enhancedDiscussions(){return(this.discussionsList||[]).map(t=>{const e=this.localDiscussionsState.find(r=>r.id===t.id),n=t.created_at?new Date(t.created_at):new Date(0);return{...t,checkBoxValue:e?e.checkBoxValue:!1,isStarred:this.starredSet.has(String(t.id)),creationDate:n}})},filteredDiscussions(){if(!this.filterTitle.trim())return this.enhancedDiscussions;const t=this.filterTitle.toLowerCase();return this.enhancedDiscussions.filter(e=>e.title&&e.title.toLowerCase().includes(t))},groupedDiscussions(){const t=[],e=[],n=[],r=[];this.enhancedDiscussions.filter(a=>{if(!this.filterTitle.trim())return!0;const l=this.filterTitle.toLowerCase();return a.title&&a.title.toLowerCase().includes(l)}).forEach(a=>{if(a.isStarred)t.push(a);else{const l=a.creationDate;evr(l)?e.push(a):tvr(l)?n.push(a):r.push(a)}});const s=(a,l)=>{let c=0;this.sortBy==="date"?c=l.creationDate-a.creationDate:this.sortBy==="title"&&(c=(a.title||"").localeCompare(l.title||""));const u=this.sortBy==="date"&&this.sortOrder==="asc"||this.sortBy==="title"&&this.sortOrder==="desc"?-1:1;return c*u};t.sort(s),e.sort(s),n.sort(s),r.sort(s);const o=[];return t.length>0&&(o.push({type:"header",label:"Starred",key:"starred",collapsed:this.collapsedSections.starred}),this.collapsedSections.starred||t.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),e.length>0&&(o.push({type:"header",label:"Today",key:"today",collapsed:this.collapsedSections.today}),this.collapsedSections.today||e.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),n.length>0&&(o.push({type:"header",label:"Yesterday",key:"yesterday",collapsed:this.collapsedSections.yesterday}),this.collapsedSections.yesterday||n.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),r.length>0&&(o.push({type:"header",label:"Older",key:"older",collapsed:this.collapsedSections.older}),this.collapsedSections.older||r.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),o},selectedDiscussions(){return this.filteredDiscussions.filter(t=>{const e=this.localDiscussionsState.find(n=>n.id===t.id);return e&&e.checkBoxValue})},isAllSelected(){const t=this.filteredDiscussions;if(t.length===0)return!1;const e=new Set(this.selectedDiscussions.map(n=>n.id));return t.every(n=>e.has(n.id))}},methods:{toggleSection(t){t in this.collapsedSections&&(this.collapsedSections[t]=!this.collapsedSections[t],this.$nextTick(()=>Re.replace()))},handleSearchInput(){this.filterInProgress=!0,clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.filterInProgress=!1,this.$nextTick(()=>Re.replace())},300)},cycleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc",this.$nextTick(()=>Re.replace())},cycleSortBy(){this.sortBy=this.sortBy==="date"?"title":"date",this.$nextTick(()=>Re.replace())},selectDiscussion(t){this.toolbarLoading||this.filterInProgress||this.$emit("select-discussion",t)},deleteDiscussion(t){this.localDiscussionsState=this.localDiscussionsState.filter(e=>e.id!==t.id),this.$emit("delete-discussion",t.id)},checkUncheckDiscussion({id:t,checked:e}){const n=this.localDiscussionsState.findIndex(r=>r.id===t);n!==-1?this.localDiscussionsState[n].checkBoxValue=e:this.discussionsList.some(r=>r.id===t)&&this.localDiscussionsState.push({id:t,checkBoxValue:e})},selectAllDiscussions(){const t=!this.isAllSelected,e=new Set(this.filteredDiscussions.map(n=>n.id));this.enhancedDiscussions.forEach(n=>{if(e.has(n.id)){const r=this.localDiscussionsState.findIndex(i=>i.id===n.id);r!==-1?this.localDiscussionsState[r].checkBoxValue=t:t&&this.localDiscussionsState.push({id:n.id,checkBoxValue:t})}}),this.$nextTick(()=>Re.replace())},deleteSelectedDiscussions(){const t=this.selectedDiscussions.map(e=>e.id);this.localDiscussionsState=this.localDiscussionsState.filter(e=>!t.includes(e.id)),this.$emit("delete-selected",t),this.showConfirmation=!1,this.isCheckbox=!1},handleDrop(t){this.isDragOverDiscussion=!1;const e=t.dataTransfer.files;e.length===1&&e[0].type==="application/json"?this.$emit("import-discussion-file",e[0]):alert("Please drop a single JSON file to import.")},toggleStarDiscussion(t){this.$emit("toggle-star-discussion",t)},toggleStarSelectedDiscussions(){const t=this.selectedDiscussions;if(t.length===0)return;const e=t.length>0?!t[0].isStarred:!0;t.forEach(n=>{n.isStarred!==e&&this.toggleStarDiscussion(n)})},syncLocalState(t){const e=new Set((t||[]).map(r=>r.id)),n=this.localDiscussionsState.filter(r=>e.has(r.id));(t||[]).forEach(r=>{n.some(i=>i.id===r.id)||n.push({id:r.id,checkBoxValue:!1})}),this.localDiscussionsState=n}},watch:{discussionsList:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&this.syncLocalState(t),this.$nextTick(()=>Re.replace())},immediate:!0,deep:!0},isCheckbox(t){this.$nextTick(()=>Re.replace()),t||(this.showConfirmation=!1)},showConfirmation(){this.$nextTick(()=>Re.replace())},filterTitle(){},sortBy(){this.$nextTick(()=>Re.replace())},sortOrder(){this.$nextTick(()=>Re.replace())}},mounted(){this.syncLocalState(this.discussionsList),Fe(()=>{Re.replace()})},updated(){}},rvr={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-[16rem] panels-color scrollbar h-full"},ivr={class:"logo-container w-12 h-12 flex-shrink-0"},svr=["src","title"],ovr={class:"flex flex-col justify-center overflow-hidden"},avr={class:"text-left p-1"},lvr={class:"text-md relative inline-block"},cvr={class:"relative inline-block font-bold tracking-wide text-blue-800 dark:text-blue-100 text-gradient-title truncate"},uvr={class:"text-blue-600 dark:text-blue-400 text-sm text-subtitle truncate"},dvr={class:"w-full max-w-md mx-auto p-2 border-b border-blue-100 dark:border-blue-800"},fvr={class:"flex items-center space-x-1"},hvr={class:"relative flex-grow"},pvr=["title"],Tvr=["data-feather"],Ovr=["title"],mvr=["data-feather"],gvr={key:0,class:"w-full p-2 bg-blue-100 dark:bg-blue-900 border-b border-blue-200 dark:border-blue-700"},Qvr={class:"flex flex-col space-y-1"},_vr={key:0,class:"text-sm text-blue-700 dark:text-blue-200"},vvr={key:1,class:"flex space-x-1 items-center"},yvr={key:1,class:"flex space-x-1 items-center"},bvr={class:"flex space-x-1 items-center"},Svr=["data-feather"],xvr={class:"relative flex flex-col flex-grow mb-10 z-0 w-full"},Evr=["onClick"],wvr=["data-feather"],Cvr={key:0,class:"p-4 text-center text-blue-600 dark:text-blue-400"},Lvr={key:0,class:"text-sm"},$vr={key:1,class:"p-4 text-center text-blue-500 dark:text-blue-400"},Avr={class:"flex flex-row items-center justify-center border-t border-blue-200 dark:border-blue-700 p-1"},kvr={class:"text-center font-semibold text-xs drop-shadow-md align-middle text-blue-700 dark:text-blue-300 truncate"};function Pvr(t,e,n,r,i,s){const o=Xe("RouterLink"),a=Xe("Toolbar"),l=Xe("Discussion");return k(),Qt(cr,{name:"slide-right"},{default:Ie(()=>[n.showLeftPanel?(k(),R("div",rvr,[te(o,{to:{name:"discussions"},class:"flex items-center space-x-2 p-2 border-b border-blue-200 dark:border-blue-700 hover:bg-blue-50 dark:hover:bg-blue-800 transition duration-150 ease-in-out"},{default:Ie(()=>[b("div",ivr,[b("img",{class:"w-full h-full rounded-full object-cover logo-image border-2 border-blue-300 dark:border-blue-600 shadow-sm",src:s.logoSrc,alt:"Logo",title:s.logoTitle},null,8,svr)]),b("div",ovr,[b("div",avr,[b("div",lvr,[b("span",cvr,ae(s.appName),1)])]),b("p",uvr,ae(s.appSlogan),1)])]),_:1}),te(a,{loading:n.toolbarLoading,"is-checkbox":i.isCheckbox,onCreateNewDiscussion:e[0]||(e[0]=c=>t.$emit("create-new-discussion")),onAddDiscussionToSkillsLibrary:e[1]||(e[1]=c=>t.$emit("add-discussion-to-skills-library")),onToggleSkillsLib:e[2]||(e[2]=c=>t.$emit("toggle-skills-lib")),onShowSkillsLib:e[3]||(e[3]=c=>t.$emit("show-skills-lib")),onToggleEditMode:e[4]||(e[4]=c=>i.isCheckbox=!i.isCheckbox),onResetDatabase:e[5]||(e[5]=c=>t.$emit("reset-database")),onExportDatabase:e[6]||(e[6]=c=>t.$emit("export-database")),onImportDiscussions:e[7]||(e[7]=c=>t.$emit("import-discussions",c)),onImportDiscussionsBundle:e[8]||(e[8]=c=>t.$emit("import-discussions-bundle",c)),onShowModelConfig:e[9]||(e[9]=c=>t.$emit("show-model-config",c)),onSetBinding:e[10]||(e[10]=c=>t.$emit("set-binding",c)),onCopyModelName:e[11]||(e[11]=c=>t.$emit("copy-model-name",c)),onSetModel:e[12]||(e[12]=c=>t.$emit("set-model",c)),onPersonalitySelected:e[13]||(e[13]=c=>t.$emit("personality-selected",c)),onUnmountPersonality:e[14]||(e[14]=c=>t.$emit("unmount-personality",c)),onRemountPersonality:e[15]||(e[15]=c=>t.$emit("remount-personality",c)),onTalkPersonality:e[16]||(e[16]=c=>t.$emit("talk-personality",c)),onPersonalitiesReady:e[17]||(e[17]=c=>t.$emit("personalities-ready")),onShowPersonalityList:e[18]||(e[18]=c=>t.$emit("show-personality-list"))},null,8,["loading","is-checkbox"]),b("div",dvr,[b("form",{onSubmit:e[23]||(e[23]=oe(()=>{},["prevent"])),class:"relative"},[b("div",fvr,[b("div",hvr,[He(b("input",{type:"search",id:"discussion-search",class:"block w-full h-8 pl-8 pr-4 text-sm input",placeholder:"Search discussions...",title:"Filter discussions by title","onUpdate:modelValue":e[19]||(e[19]=c=>i.filterTitle=c),onInput:e[20]||(e[20]=(...c)=>s.handleSearchInput&&s.handleSearchInput(...c))},null,544),[[vt,i.filterTitle]]),e[36]||(e[36]=b("div",{class:"absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none"},[b("i",{"data-feather":"search",class:"w-4 h-4 text-gray-400 dark:text-gray-500"})],-1))]),b("button",{onClick:e[21]||(e[21]=(...c)=>s.cycleSortOrder&&s.cycleSortOrder(...c)),class:"svg-button p-1",title:`Sort by ${i.sortBy}: ${i.sortOrder==="asc"?"Ascending":"Descending"}`},[b("i",{"data-feather":s.sortIcon,class:"w-4 h-4"},null,8,Tvr)],8,pvr),b("button",{onClick:e[22]||(e[22]=(...c)=>s.cycleSortBy&&s.cycleSortBy(...c)),class:"svg-button p-1",title:`Sorting by: ${s.sortByLabel}`},[b("i",{"data-feather":i.sortBy==="date"?"calendar":"type",class:"w-4 h-4"},null,8,mvr)],8,Ovr)])],32)]),i.isCheckbox?(k(),R("div",gvr,[b("div",Qvr,[s.selectedDiscussions.length>0?(k(),R("p",_vr,"Selected: "+ae(s.selectedDiscussions.length),1)):ne("",!0),s.selectedDiscussions.length>0?(k(),R("div",vvr,[i.showConfirmation?ne("",!0):(k(),R("button",{key:0,class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Remove selected",type:"button",onClick:e[24]||(e[24]=oe(c=>i.showConfirmation=!0,["stop"]))},e[37]||(e[37]=[b("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)]))),i.showConfirmation?(k(),R("div",yvr,[b("button",{class:"svg-button text-green-500 hover:text-green-700 dark:text-green-400 dark:hover:text-green-200",title:"Confirm removal",type:"button",onClick:e[25]||(e[25]=oe((...c)=>s.deleteSelectedDiscussions&&s.deleteSelectedDiscussions(...c),["stop"]))},e[38]||(e[38]=[b("i",{"data-feather":"check",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Cancel removal",type:"button",onClick:e[26]||(e[26]=oe(c=>i.showConfirmation=!1,["stop"]))},e[39]||(e[39]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]))])):ne("",!0)])):ne("",!0),b("div",bvr,[b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200 rotate-90",title:"Export selected to a json file",type:"button",onClick:e[27]||(e[27]=oe(c=>t.$emit("export-discussions-as-json",s.selectedDiscussions),["stop"]))},e[40]||(e[40]=[b("i",{"data-feather":"codepen",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200 rotate-90",title:"Export selected to a folder",type:"button",onClick:e[28]||(e[28]=oe(c=>t.$emit("export-discussions-to-folder",s.selectedDiscussions),["stop"]))},e[41]||(e[41]=[b("i",{"data-feather":"folder",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200",title:"Export selected to a markdown file",type:"button",onClick:e[29]||(e[29]=oe(c=>t.$emit("export-discussions-as-markdown",s.selectedDiscussions),["stop"]))},e[42]||(e[42]=[b("i",{"data-feather":"bookmark",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200",title:"Select/Deselect All",type:"button",onClick:e[30]||(e[30]=oe((...c)=>s.selectAllDiscussions&&s.selectAllDiscussions(...c),["stop"]))},[b("i",{"data-feather":s.isAllSelected?"minus-square":"check-square",class:"w-5 h-5"},null,8,Svr)])])])])):ne("",!0),b("div",{id:"leftPanelScroll",class:"flex flex-col flex-grow overflow-y-auto overflow-x-hidden scrollbar",onDragover:e[32]||(e[32]=oe(c=>i.isDragOverDiscussion=!0,["prevent"])),onDragleave:e[33]||(e[33]=c=>i.isDragOverDiscussion=!1),onDrop:e[34]||(e[34]=oe((...c)=>s.handleDrop&&s.handleDrop(...c),["prevent"]))},[b("div",xvr,[b("div",{class:ye(["mx-0 flex flex-col flex-grow w-full",i.isDragOverDiscussion?"opacity-50 border-2 border-dashed border-blue-500":""])},[b("div",{id:"dis-list",class:ye([i.filterInProgress||n.toolbarLoading?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-10"])},[te(V4,{name:"discussionsList"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(s.groupedDiscussions,c=>(k(),R(Ve,{key:c.key},[c.type==="header"?(k(),R("div",{key:0,class:"sticky top-0 z-10 px-2 py-1 bg-gray-100 dark:bg-gray-800 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider shadow-sm flex items-center justify-between cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700",onClick:u=>s.toggleSection(c.key)},[b("span",null,ae(c.label),1),b("i",{"data-feather":c.collapsed?"chevron-right":"chevron-down",class:"w-4 h-4"},null,8,wvr)],8,Evr)):ne("",!0),c.type==="discussion"?(k(),Qt(l,{key:1,id:`dis-${c.data.id}`,title:c.data.title,selected:n.currentDiscussion&&n.currentDiscussion.id===c.data.id,loading:c.data.loading,isCheckbox:i.isCheckbox,checkBoxValue:c.data.checkBoxValue,"is-starred":c.data.isStarred,openfolder_enabled:!0,onSelect:u=>s.selectDiscussion(c.data),onDelete:u=>s.deleteDiscussion(c.data),onOpenFolder:u=>t.$emit("open-folder",c.data),onEditTitle:e[31]||(e[31]=u=>t.$emit("edit-title",u)),onMakeTitle:u=>t.$emit("make-title",c.data),onChecked:s.checkUncheckDiscussion,onToggleStar:u=>s.toggleStarDiscussion(c.data)},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","is-starred","onSelect","onDelete","onOpenFolder","onMakeTitle","onChecked","onToggleStar"])):ne("",!0)],64))),128))]),_:1}),s.groupedDiscussions.length===0&&!i.filterInProgress&&!n.toolbarLoading?(k(),R("div",Cvr,[e[43]||(e[43]=b("p",null,"No discussions found.",-1)),i.filterTitle?(k(),R("p",Lvr,"Try adjusting your search or filters.")):ne("",!0)])):ne("",!0),i.filterInProgress||n.toolbarLoading?(k(),R("div",$vr,e[44]||(e[44]=[b("p",null,"Loading discussions...",-1)]))):ne("",!0)],2)],2)])],32),b("div",Avr,[b("div",{class:"chat-bar text-center flex items-center justify-center w-full cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-700 rounded transition duration-150 ease-in-out",onClick:e[35]||(e[35]=c=>t.$emit("show-database-selector"))},[e[45]||(e[45]=b("button",{class:"svg-button p-1"},[b("i",{"data-feather":"database",class:"w-4 h-4 mr-1"})],-1)),b("p",kvr,ae(n.formattedDatabaseName),1)])])])):ne("",!0)]),_:1})}const Rvr=st(nvr,[["render",Pvr],["__scopeId","data-v-18952e34"]]),Mvr={props:{htmlContent:{type:String,required:!0}}},Dvr=["innerHTML"];function Nvr(t,e,n,r,i,s){return k(),R("div",{class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:n.htmlContent},null,8,Dvr)}const Ivr=st(Mvr,[["render",Nvr]]),Hvr={name:"JsonNode",props:{data:{required:!0},label:{type:String,default:""},depth:{type:Number,default:0}},data(){return{expanded:!0}},computed:{isObject(){return this.data!==null&&typeof this.data=="object"},isArray(){return Array.isArray(this.data)}},methods:{toggle(){this.expanded=!this.expanded},getValueType(t){return t===null?"null":typeof t},formatValue(t){return t===null?"null":typeof t=="string"?`"${t}"`:t}}},Vvr={class:"json-tree"},qvr={key:0,class:"tree-node"},Uvr={class:"toggle-icon"},Bvr={class:"key"},zvr={class:"bracket"},Xvr={key:0,class:"node-content"},Fvr={key:1,class:"bracket-close"},jvr={key:1,class:"tree-leaf"},Yvr={key:0,class:"key"};function Gvr(t,e,n,r,i,s){const o=Xe("json-node",!0);return k(),R("div",Vvr,[s.isObject?(k(),R("div",qvr,[b("div",{class:"node-label",onClick:e[0]||(e[0]=(...a)=>s.toggle&&s.toggle(...a))},[b("span",Uvr,ae(i.expanded?"▼":"▶"),1),b("span",Bvr,ae(n.label),1),b("span",zvr,ae(s.isArray?"[":"{"),1)]),i.expanded?(k(),R("div",Xvr,[(k(!0),R(Ve,null,dt(n.data,(a,l)=>(k(),R("div",{key:l,class:"node-item"},[te(o,{data:a,label:l,depth:n.depth+1},null,8,["data","label","depth"])]))),128))])):ne("",!0),i.expanded?(k(),R("div",Fvr,ae(s.isArray?"]":"}"),1)):ne("",!0)])):(k(),R("div",jvr,[n.label?(k(),R("span",Yvr,ae(n.label)+":",1)):ne("",!0),b("span",{class:ye(["value",s.getValueType(n.data)])},ae(s.formatValue(n.data)),3)]))])}const Wvr=st(Hvr,[["render",Gvr],["__scopeId","data-v-f98ed845"]]),Zvr={name:"JsonViewer",components:{JsonNode:Wvr},props:{data:{required:!0},title:{type:String,default:"JSON Data"}},data(){return{expanded:!0}},computed:{parsedData(){if(typeof this.data=="string")try{return JSON.parse(this.data)}catch{return{error:"Invalid JSON"}}return this.data}},methods:{toggle(){this.expanded=!this.expanded}}},Kvr={class:"json-viewer"},Jvr={class:"toggle-icon"},eyr={class:"title"},tyr={key:0,class:"viewer-content"};function nyr(t,e,n,r,i,s){const o=Xe("json-node");return k(),R("div",Kvr,[b("div",{class:"viewer-header",onClick:e[0]||(e[0]=(...a)=>s.toggle&&s.toggle(...a))},[b("span",Jvr,ae(i.expanded?"▼":"▶"),1),b("span",eyr,ae(n.title),1)]),i.expanded?(k(),R("div",tyr,[te(o,{data:s.parsedData},null,8,["data"])])):ne("",!0)])}const ryr=st(Zvr,[["render",nyr],["__scopeId","data-v-cd1635fc"]]),iyr={name:"Step",props:{done:Boolean,text:String,status:Boolean,description:String}},syr={class:"step-icon-wrapper"},oyr={key:"spinner",class:"step-spinner"},ayr={key:"success",class:"step-icon-success w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},lyr={key:"fail",class:"step-icon-fail w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},cyr={class:"step-text-content"},uyr={class:"step-text"},dyr={key:0,class:"step-description"};function fyr(t,e,n,r,i,s){return k(),R("div",{class:ye(["step-component",[n.done?n.status?"step-component-success":"step-component-fail":"step-component-pending"]])},[b("div",syr,[te(cr,{name:"fade-icon",mode:"out-in"},{default:Ie(()=>[n.done?n.status?(k(),R("svg",ayr,e[0]||(e[0]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)]))):(k(),R("svg",lyr,e[1]||(e[1]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1)]))):(k(),R("div",oyr))]),_:1})]),b("div",cyr,[b("div",uyr,ae(n.text||"Processing..."),1),n.description?(k(),R("div",dyr,ae(n.description),1)):ne("",!0)])],2)}const hyr=st(iyr,[["render",fyr],["__scopeId","data-v-6d675aab"]]),pyr=["title"],Tyr={key:0,class:"icon icon-success",viewBox:"0 0 24 24"},Oyr={key:1,class:"icon icon-fail",viewBox:"0 0 24 24"},myr={key:2,class:"icon-spinner"},gyr={key:1,class:"icon-text"},Qyr={__name:"StatusIcon",props:{status:{type:String,required:!0},icon:Boolean,iconDone:{type:String,default:"✓"},iconFailed:{type:String,default:"✗"},iconProcessing:{type:String,default:"⟳"},titleDone:{type:String,default:"Success"},titleFailed:{type:String,default:"Failure"},titleProcessing:{type:String,default:"Processing"}},setup(t){const e=t,n=Je(()=>e.status==="Done"?e.titleDone:e.status==="Failed"?e.titleFailed:e.titleProcessing),r=Je(()=>e.status==="Done"?e.iconDone:e.status==="Failed"?e.iconFailed:e.iconProcessing);return(i,s)=>(k(),R("div",{class:"status-icon",title:n.value},[t.icon?(k(),R(Ve,{key:0},[t.status==="Done"?(k(),R("svg",Tyr,s[0]||(s[0]=[b("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},null,-1)]))):t.status==="Failed"?(k(),R("svg",Oyr,s[1]||(s[1]=[b("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"},null,-1)]))):(k(),R("div",myr))],64)):(k(),R("span",gyr,ae(r.value),1))],8,pyr))}},_yr=st(Qyr,[["__scopeId","data-v-b3d110c2"]]),vyr=[sJ(),oJ(),WK(),VJ(),EJ(),FK(),GK(),nn.allowMultipleSelections.of(!0),OJ(),C3(wd,{fallback:!0}),AJ(),Mee(),Vee(),KK(),JK(),ZK(),FSt(),B4.of([...Iee,...Oee,...Cee,...BJ,...yJ,...Tw,...Bee])],yyr="modulepreload",byr=function(t){return"/"+t},cY={},Ee=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=byr(l),l in cY)return;cY[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":yyr,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function Ne(t){return new ri(h4.define(t))}function Z2(t){return Ee(()=>Promise.resolve().then(()=>XPt),void 0).then(e=>e.sql({dialect:e[t]}))}const Syr=[be.of({name:"C",extensions:["c","h","ino"],load(){return Ee(()=>Promise.resolve().then(()=>rH),void 0).then(t=>t.cpp())}}),be.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ee(()=>Promise.resolve().then(()=>rH),void 0).then(t=>t.cpp())}}),be.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Z2("Cassandra")}}),be.of({name:"CSS",extensions:["css"],load(){return Ee(()=>Promise.resolve().then(()=>FLt),void 0).then(t=>t.css())}}),be.of({name:"Go",extensions:["go"],load(){return Ee(()=>import("./index-Dfi7295q.js"),[]).then(t=>t.go())}}),be.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ee(()=>Promise.resolve().then(()=>KLt),void 0).then(t=>t.html())}}),be.of({name:"Java",extensions:["java"],load(){return Ee(()=>Promise.resolve().then(()=>dAt),void 0).then(t=>t.java())}}),be.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript())}}),be.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ee(()=>Promise.resolve().then(()=>r$t),void 0).then(t=>t.json())}}),be.of({name:"JSX",extensions:["jsx"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({jsx:!0}))}}),be.of({name:"LESS",extensions:["less"],load(){return Ee(()=>import("./index-R9wnJ2Ib.js"),[]).then(t=>t.less())}}),be.of({name:"Liquid",extensions:["liquid"],load(){return Ee(()=>import("./index-BRwG2R_M.js"),[]).then(t=>t.liquid())}}),be.of({name:"MariaDB SQL",load(){return Z2("MariaSQL")}}),be.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ee(()=>Promise.resolve().then(()=>V$t),void 0).then(t=>t.markdown())}}),be.of({name:"MS SQL",load(){return Z2("MSSQL")}}),be.of({name:"MySQL",load(){return Z2("MySQL")}}),be.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ee(()=>Promise.resolve().then(()=>Rkt),void 0).then(t=>t.php())}}),be.of({name:"PLSQL",extensions:["pls"],load(){return Z2("PLSQL")}}),be.of({name:"PostgreSQL",load(){return Z2("PostgreSQL")}}),be.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ee(()=>Promise.resolve().then(()=>DCt),void 0).then(t=>t.python())}}),be.of({name:"Rust",extensions:["rs"],load(){return Ee(()=>Promise.resolve().then(()=>ePt),void 0).then(t=>t.rust())}}),be.of({name:"Sass",extensions:["sass"],load(){return Ee(()=>import("./index-CcMBvVgL.js"),[]).then(t=>t.sass({indented:!0}))}}),be.of({name:"SCSS",extensions:["scss"],load(){return Ee(()=>import("./index-CcMBvVgL.js"),[]).then(t=>t.sass())}}),be.of({name:"SQL",extensions:["sql"],load(){return Z2("StandardSQL")}}),be.of({name:"SQLite",load(){return Z2("SQLite")}}),be.of({name:"TSX",extensions:["tsx"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({jsx:!0,typescript:!0}))}}),be.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({typescript:!0}))}}),be.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ee(()=>import("./index-BS_Zh7d_.js"),[]).then(t=>t.wast())}}),be.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ee(()=>Promise.resolve().then(()=>hRt),void 0).then(t=>t.xml())}}),be.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ee(()=>Promise.resolve().then(()=>XRt),void 0).then(t=>t.yaml())}}),be.of({name:"APL",extensions:["dyalog","apl"],load(){return Ee(()=>import("./apl-B4CMkyY2.js"),[]).then(t=>Ne(t.apl))}}),be.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ee(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(t=>Ne(t.asciiArmor))}}),be.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ee(()=>import("./asn1-EdZsLKOL.js"),[]).then(t=>Ne(t.asn1({})))}}),be.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ee(()=>import("./asterisk-B-8jnY81.js"),[]).then(t=>Ne(t.asterisk))}}),be.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ee(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(t=>Ne(t.brainfuck))}}),be.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ee(()=>import("./cobol-CWcv1MsR.js"),[]).then(t=>Ne(t.cobol))}}),be.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.csharp))}}),be.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"ClojureScript",extensions:["cljs"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ee(()=>import("./css-BnMrqG3P.js"),[]).then(t=>Ne(t.gss))}}),be.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ee(()=>import("./cmake-BQqOBYOt.js"),[]).then(t=>Ne(t.cmake))}}),be.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ee(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(t=>Ne(t.coffeeScript))}}),be.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ee(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(t=>Ne(t.commonLisp))}}),be.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ee(()=>import("./cypher-C_CwsFkJ.js"),[]).then(t=>Ne(t.cypher))}}),be.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ee(()=>import("./python-BuPzkPfP.js"),[]).then(t=>Ne(t.cython))}}),be.of({name:"Crystal",extensions:["cr"],load(){return Ee(()=>import("./crystal-SjHAIU92.js"),[]).then(t=>Ne(t.crystal))}}),be.of({name:"D",extensions:["d"],load(){return Ee(()=>import("./d-pRatUO7H.js"),[]).then(t=>Ne(t.d))}}),be.of({name:"Dart",extensions:["dart"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.dart))}}),be.of({name:"diff",extensions:["diff","patch"],load(){return Ee(()=>import("./diff-DbItnlRl.js"),[]).then(t=>Ne(t.diff))}}),be.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ee(()=>import("./dockerfile-BU1Ap__c.js"),__vite__mapDeps([0,1])).then(t=>Ne(t.dockerFile))}}),be.of({name:"DTD",extensions:["dtd"],load(){return Ee(()=>import("./dtd-DF_7sFjM.js"),[]).then(t=>Ne(t.dtd))}}),be.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ee(()=>import("./dylan-DwRh75JA.js"),[]).then(t=>Ne(t.dylan))}}),be.of({name:"EBNF",load(){return Ee(()=>import("./ebnf-CDyGwa7X.js"),[]).then(t=>Ne(t.ebnf))}}),be.of({name:"ECL",extensions:["ecl"],load(){return Ee(()=>import("./ecl-Cabwm37j.js"),[]).then(t=>Ne(t.ecl))}}),be.of({name:"edn",extensions:["edn"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"Eiffel",extensions:["e"],load(){return Ee(()=>import("./eiffel-CnydiIhH.js"),[]).then(t=>Ne(t.eiffel))}}),be.of({name:"Elm",extensions:["elm"],load(){return Ee(()=>import("./elm-vLlmbW-K.js"),[]).then(t=>Ne(t.elm))}}),be.of({name:"Erlang",extensions:["erl"],load(){return Ee(()=>import("./erlang-BNw1qcRV.js"),[]).then(t=>Ne(t.erlang))}}),be.of({name:"Esper",load(){return Ee(()=>import("./sql-D0XecflT.js"),[]).then(t=>Ne(t.esper))}}),be.of({name:"Factor",extensions:["factor"],load(){return Ee(()=>import("./factor-BPndPnYX.js"),__vite__mapDeps([2,1])).then(t=>Ne(t.factor))}}),be.of({name:"FCL",load(){return Ee(()=>import("./fcl-Kvtd6kyn.js"),[]).then(t=>Ne(t.fcl))}}),be.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ee(()=>import("./forth-Ffai-XNe.js"),[]).then(t=>Ne(t.forth))}}),be.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ee(()=>import("./fortran-DYz_wnZ1.js"),[]).then(t=>Ne(t.fortran))}}),be.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.fSharp))}}),be.of({name:"Gas",extensions:["s"],load(){return Ee(()=>import("./gas-Bneqetm1.js"),[]).then(t=>Ne(t.gas))}}),be.of({name:"Gherkin",extensions:["feature"],load(){return Ee(()=>import("./gherkin-heZmZLOM.js"),[]).then(t=>Ne(t.gherkin))}}),be.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ee(()=>import("./groovy-D9Dt4D0W.js"),[]).then(t=>Ne(t.groovy))}}),be.of({name:"Haskell",extensions:["hs"],load(){return Ee(()=>import("./haskell-BWDZoCOh.js"),[]).then(t=>Ne(t.haskell))}}),be.of({name:"Haxe",extensions:["hx"],load(){return Ee(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>Ne(t.haxe))}}),be.of({name:"HXML",extensions:["hxml"],load(){return Ee(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>Ne(t.hxml))}}),be.of({name:"HTTP",load(){return Ee(()=>import("./http-DBlCnlav.js"),[]).then(t=>Ne(t.http))}}),be.of({name:"IDL",extensions:["pro"],load(){return Ee(()=>import("./idl-BEugSyMb.js"),[]).then(t=>Ne(t.idl))}}),be.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ee(()=>import("./javascript-qCveANmP.js"),[]).then(t=>Ne(t.jsonld))}}),be.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return Ee(()=>import("./jinja2-C4DGRd-O.js"),[]).then(t=>Ne(t.jinja2))}}),be.of({name:"Julia",extensions:["jl"],load(){return Ee(()=>import("./julia-DuME0IfC.js"),[]).then(t=>Ne(t.julia))}}),be.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.kotlin))}}),be.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ee(()=>import("./livescript-BwQOo05w.js"),[]).then(t=>Ne(t.liveScript))}}),be.of({name:"Lua",extensions:["lua"],load(){return Ee(()=>Promise.resolve().then(()=>SMt),void 0).then(t=>Ne(t.lua))}}),be.of({name:"mIRC",extensions:["mrc"],load(){return Ee(()=>import("./mirc-CjQqDB4T.js"),[]).then(t=>Ne(t.mirc))}}),be.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ee(()=>import("./mathematica-DTrFuWx2.js"),[]).then(t=>Ne(t.mathematica))}}),be.of({name:"Modelica",extensions:["mo"],load(){return Ee(()=>import("./modelica-Dc1JOy9r.js"),[]).then(t=>Ne(t.modelica))}}),be.of({name:"MUMPS",extensions:["mps"],load(){return Ee(()=>import("./mumps-BT43cFF4.js"),[]).then(t=>Ne(t.mumps))}}),be.of({name:"Mbox",extensions:["mbox"],load(){return Ee(()=>import("./mbox-CNhZ1qSd.js"),[]).then(t=>Ne(t.mbox))}}),be.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ee(()=>import("./nginx-DdIZxoE0.js"),[]).then(t=>Ne(t.nginx))}}),be.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ee(()=>import("./nsis-ClDXqMnM.js"),__vite__mapDeps([3,1])).then(t=>Ne(t.nsis))}}),be.of({name:"NTriples",extensions:["nt","nq"],load(){return Ee(()=>import("./ntriples-BfvgReVJ.js"),[]).then(t=>Ne(t.ntriples))}}),be.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.objectiveC))}}),be.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.objectiveCpp))}}),be.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.oCaml))}}),be.of({name:"Octave",extensions:["m"],load(){return Ee(()=>import("./octave-Ck1zUtKM.js"),[]).then(t=>Ne(t.octave))}}),be.of({name:"Oz",extensions:["oz"],load(){return Ee(()=>import("./oz-BzwKVEFT.js"),[]).then(t=>Ne(t.oz))}}),be.of({name:"Pascal",extensions:["p","pas"],load(){return Ee(()=>import("./pascal--L3eBynH.js"),[]).then(t=>Ne(t.pascal))}}),be.of({name:"Perl",extensions:["pl","pm"],load(){return Ee(()=>import("./perl-CdXCOZ3F.js"),[]).then(t=>Ne(t.perl))}}),be.of({name:"Pig",extensions:["pig"],load(){return Ee(()=>import("./pig-CevX1Tat.js"),[]).then(t=>Ne(t.pig))}}),be.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ee(()=>import("./powershell-CFHJl5sT.js"),[]).then(t=>Ne(t.powerShell))}}),be.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ee(()=>import("./properties-C78fOPTZ.js"),[]).then(t=>Ne(t.properties))}}),be.of({name:"ProtoBuf",extensions:["proto"],load(){return Ee(()=>import("./protobuf-ChK-085T.js"),[]).then(t=>Ne(t.protobuf))}}),be.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ee(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([4,5])).then(t=>Ne(t.pug))}}),be.of({name:"Puppet",extensions:["pp"],load(){return Ee(()=>import("./puppet-DMA9R1ak.js"),[]).then(t=>Ne(t.puppet))}}),be.of({name:"Q",extensions:["q"],load(){return Ee(()=>import("./q-ZnEupP5q.js"),[]).then(t=>Ne(t.q))}}),be.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ee(()=>import("./r-B6wPVr8A.js"),[]).then(t=>Ne(t.r))}}),be.of({name:"RPM Changes",load(){return Ee(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>Ne(t.rpmChanges))}}),be.of({name:"RPM Spec",extensions:["spec"],load(){return Ee(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>Ne(t.rpmSpec))}}),be.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ee(()=>Promise.resolve().then(()=>OMt),void 0).then(t=>Ne(t.ruby))}}),be.of({name:"SAS",extensions:["sas"],load(){return Ee(()=>import("./sas-B4kiWyti.js"),[]).then(t=>Ne(t.sas))}}),be.of({name:"Scala",extensions:["scala"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.scala))}}),be.of({name:"Scheme",extensions:["scm","ss"],load(){return Ee(()=>import("./scheme-C41bIUwD.js"),[]).then(t=>Ne(t.scheme))}}),be.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ee(()=>Promise.resolve().then(()=>rMt),void 0).then(t=>Ne(t.shell))}}),be.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ee(()=>import("./sieve-C3Gn_uJK.js"),[]).then(t=>Ne(t.sieve))}}),be.of({name:"Smalltalk",extensions:["st"],load(){return Ee(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(t=>Ne(t.smalltalk))}}),be.of({name:"Solr",load(){return Ee(()=>import("./solr-DehyRSwq.js"),[]).then(t=>Ne(t.solr))}}),be.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.sml))}}),be.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ee(()=>import("./sparql-DkYu6x3z.js"),[]).then(t=>Ne(t.sparql))}}),be.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ee(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(t=>Ne(t.spreadsheet))}}),be.of({name:"Squirrel",extensions:["nut"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.squirrel))}}),be.of({name:"Stylus",extensions:["styl"],load(){return Ee(()=>import("./stylus-BdAi1jBa.js"),[]).then(t=>Ne(t.stylus))}}),be.of({name:"Swift",extensions:["swift"],load(){return Ee(()=>import("./swift-BzpIVaGY.js"),[]).then(t=>Ne(t.swift))}}),be.of({name:"sTeX",load(){return Ee(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>Ne(t.stex))}}),be.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ee(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>Ne(t.stex))}}),be.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ee(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>Ne(t.verilog))}}),be.of({name:"Tcl",extensions:["tcl"],load(){return Ee(()=>import("./tcl-DVfN8rqt.js"),[]).then(t=>Ne(t.tcl))}}),be.of({name:"Textile",extensions:["textile"],load(){return Ee(()=>import("./textile-CnDTJFAw.js"),[]).then(t=>Ne(t.textile))}}),be.of({name:"TiddlyWiki",load(){return Ee(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(t=>Ne(t.tiddlyWiki))}}),be.of({name:"Tiki wiki",load(){return Ee(()=>import("./tiki-DGYXhP31.js"),[]).then(t=>Ne(t.tiki))}}),be.of({name:"TOML",extensions:["toml"],load(){return Ee(()=>import("./toml-BXUEaScT.js"),[]).then(t=>Ne(t.toml))}}),be.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ee(()=>import("./troff-wAsdV37c.js"),[]).then(t=>Ne(t.troff))}}),be.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ee(()=>import("./ttcn-CfJYG6tj.js"),[]).then(t=>Ne(t.ttcn))}}),be.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ee(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(t=>Ne(t.ttcnCfg))}}),be.of({name:"Turtle",extensions:["ttl"],load(){return Ee(()=>import("./turtle-B1tBg_DP.js"),[]).then(t=>Ne(t.turtle))}}),be.of({name:"Web IDL",extensions:["webidl"],load(){return Ee(()=>import("./webidl-ZXfAyPTL.js"),[]).then(t=>Ne(t.webIDL))}}),be.of({name:"VB.NET",extensions:["vb"],load(){return Ee(()=>import("./vb-CmGdzxic.js"),[]).then(t=>Ne(t.vb))}}),be.of({name:"VBScript",extensions:["vbs"],load(){return Ee(()=>import("./vbscript-BuJXcnF6.js"),[]).then(t=>Ne(t.vbScript))}}),be.of({name:"Velocity",extensions:["vtl"],load(){return Ee(()=>import("./velocity-D8B20fx6.js"),[]).then(t=>Ne(t.velocity))}}),be.of({name:"Verilog",extensions:["v"],load(){return Ee(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>Ne(t.verilog))}}),be.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ee(()=>import("./vhdl-lSbBsy5d.js"),[]).then(t=>Ne(t.vhdl))}}),be.of({name:"XQuery",extensions:["xy","xquery"],load(){return Ee(()=>import("./xquery-CQfU5ijd.js"),[]).then(t=>Ne(t.xQuery))}}),be.of({name:"Yacas",extensions:["ys"],load(){return Ee(()=>import("./yacas-BJ4BC0dw.js"),[]).then(t=>Ne(t.yacas))}}),be.of({name:"Z80",extensions:["z80"],load(){return Ee(()=>import("./z80-Hz9HOZM7.js"),[]).then(t=>Ne(t.z80))}}),be.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.mscgen))}}),be.of({name:"Xù",extensions:["xu"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.xu))}}),be.of({name:"MsGenny",extensions:["msgenny"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.msgenny))}}),be.of({name:"Vue",extensions:["vue"],load(){return Ee(()=>Promise.resolve().then(()=>JRt),void 0).then(t=>t.vue())}}),be.of({name:"Angular Template",load(){return Ee(()=>import("./index-Bf9mONnw.js"),[]).then(t=>t.angular())}})],xyr={name:"DropdownSubmenu",props:{title:{type:String,required:!0},icon:{type:String,required:!1,default:null}},setup(){const t=We(!1);let e=null;const n=()=>{e&&(clearTimeout(e),e=null),t.value||(t.value=!0,Fe(()=>{Re.replace()}))},r=()=>{e=setTimeout(()=>{t.value=!1,e=null},150)};return Ii(()=>{Fe(()=>{Re.replace()})}),{isOpen:t,openSubmenu:n,closeSubmenu:r}}},Eyr=["aria-expanded"],wyr={class:"flex items-center gap-2"},Cyr=["data-feather"],Lyr={class:"truncate"},$yr={key:0,class:"absolute top-0 left-full mt-[-1px] ml-1 w-auto min-w-[10rem] origin-top-left rounded-md bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-20 py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"submenu-button"};function Ayr(t,e,n,r,i,s){return k(),R("div",{class:"relative",onMouseenter:e[0]||(e[0]=(...o)=>r.openSubmenu&&r.openSubmenu(...o)),onMouseleave:e[1]||(e[1]=(...o)=>r.closeSubmenu&&r.closeSubmenu(...o))},[b("button",{type:"button",class:"w-full flex items-center justify-between px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-700",role:"menuitem",tabindex:"-1","aria-haspopup":!0,"aria-expanded":r.isOpen},[b("div",wyr,[n.icon?(k(),R("i",{key:0,"data-feather":n.icon,class:"w-4 h-4 flex-shrink-0"},null,8,Cyr)):ne("",!0),b("span",Lyr,ae(n.title),1)]),e[2]||(e[2]=b("i",{"data-feather":"chevron-right",class:"w-4 h-4 ml-auto flex-shrink-0 text-gray-400"},null,-1))],8,Eyr),te(cr,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:Ie(()=>[r.isOpen?(k(),R("div",$yr,[er(t.$slots,"default",{},void 0,!0)])):ne("",!0)]),_:3})],32)}const kyr=st(xyr,[["render",Ayr],["__scopeId","data-v-6d202a8d"]]),Pyr=t=>{let e=[];for(let n of t.selection.ranges){const r=t.doc.lineAt(n.from),i=t.doc.lineAt(n.to);for(let s=r.number;s<=i.number;s++)e.some(o=>o.number===s)||e.push(t.doc.line(s))}return e},m3=(t,e,n)=>n&&e===0||!n&&e===t.doc.length?!1:(n?t.doc.sliceString(e-1,e):t.doc.sliceString(e,e+1))!==`
-`,Ryr={name:"MarkdownEditor",components:{DropdownMenu:Noe,DropdownSubmenu:kyr,ToolbarButton:oT},props:{modelValue:{type:String,required:!0},editorClass:{type:[String,Object,Array],default:""},toolbarClass:{type:[String,Object,Array],default:""},buttonClass:{type:[String,Object,Array],default:""},toolbarButtonIconSize:{type:Number,default:16},theme:{type:Object,required:!0}},emits:["update:modelValue"],data(){return{editorView:null,updatingFromSelf:!1}},computed:{toolbarButtonBaseClass(){return this.buttonClass||"px-1.5 py-1 bg-white dark:bg-gray-600 border border-gray-300 dark:border-gray-500 rounded hover:bg-gray-200 dark:hover:bg-gray-500 text-sm focus:outline-none focus:ring-1 focus:ring-blue-400 dark:text-gray-200 flex items-center justify-center w-7 h-7"},iconSize(){return this.toolbarButtonIconSize},svgIconSizeClass(){const t=Math.round(this.iconSize/4);return`w-${t} h-${t}`}},methods:{getButtonTitle(t){return{bold:"Bold (Ctrl+B)",italic:"Italic (Ctrl+I)",strikethrough:"Strikethrough",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",blockquote:"Blockquote",ul:"Unordered List",ol:"Ordered List",codeblock:"Code Block",inlinecode:"Inline Code",link:"Insert Link",image:"Insert Image",hr:"Horizontal Rule",latex:"Inline LaTeX ($...$)",latexBlock:"LaTeX Block ($$...$$)",latexEnvEquation:"Equation Environment",latexEnvAlign:"Align Environment",latexEnvGather:"Gather Environment",latexEnvEquationStar:"Equation* Environment (Unnumbered)",latexEnvAlignStar:"Align* Environment (Unnumbered)",latexEnvGatherStar:"Gather* Environment (Unnumbered)"}[t]||t},initializeEditor(){this.editorView&&this.editorView.destroy();const t=nn.create({doc:this.modelValue,extensions:[vyr,B4.of([mee]),Rw({base:Ip,codeLanguages:Syr}),this.theme,tt.lineWrapping,tt.updateListener.of(e=>{e.docChanged&&!this.updatingFromSelf&&this.$emit("update:modelValue",e.state.doc.toString())}),tt.contentAttributes.of({"aria-label":"Markdown editor content"})]});this.editorView=new tt({state:t,parent:this.$refs.editorRef})},destroyEditor(){this.editorView&&(this.editorView.destroy(),this.editorView=null)},applyFormat(t,e={}){if(!this.editorView)return;const n=this.editorView,r=n.state;let i=[];const s=r.selection.main,o=r.doc.sliceString(s.from,s.to);let a="",l="",c="",u=!1;switch(t){case"bold":a="**",l="**";break;case"italic":a="_",l="_";break;case"strikethrough":a="~~",l="~~";break;case"inlinecode":a="`",l="`";break;case"latex":a="$",l="$";break;case"h1":c="# ";break;case"h2":c="## ";break;case"h3":c="### ";break;case"blockquote":c="> ";break;case"ul":c="- ";break;case"ol":c="1. ";break;case"latexBlock":a=`$$
+Error: ${(r==null?void 0:r.error)||"Unknown error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async unmount_personality(t){var s;if(!t)return{status:!1,error:"no personality provided"};const e=((s=this.$store.state.config)==null?void 0:s.personalities)||[];let n=null;const r=t.language?`${t.full_path}:${t.language}`:null;r&&e.includes(r)?n=r:(e.includes(t.full_path),n=t.full_path);const i={path:n};try{return await this.api_post_req("unmount_personality",i)}catch(o){return{status:!1,error:o.message}}},async unmountAll(){if(!await this.show_yes_no_dialog(`Unmount all ${this.mountedPersArr.length} personalities?`,"Unmount All","Cancel"))return;this.show_toast("Unmounting all...",3,!0),this.isLoading=!0;const e=await this.api_post_req("unmount_all_personalities");e&&e.status?(await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast("All personalities unmounted.",4,!0)):this.show_toast(`Failed to unmount all: ${(e==null?void 0:e.error)||"Unknown error"}`,4,!1),this.isLoading=!1},async remountPersonality(t){const e=t.personality;if(!(!e.isMounted||e.isProcessing)){this.setPersonalityProcessing(t,!0),this.show_toast(`Remounting ${e.name}...`,3,!0);try{const n=await this.unmount_personality(e);if(!n||!n.status)throw new Error(`Unmount failed: ${(n==null?void 0:n.error)||"Unknown error"}`);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),await new Promise(i=>setTimeout(i,200));const r=await this.mount_personality(e);if(!r||!r.status)throw new Error(`Mount failed: ${(r==null?void 0:r.error)||"Unknown error"}`);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities"),this.show_toast(`${e.name} remounted successfully.`,4,!0)}catch(n){this.show_toast(`Error remounting ${e.name}: ${n.message}`,4,!1),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshMountedPersonalities")}finally{this.setPersonalityProcessing(t,!1)}}},async editPersonality(t){var n;const e=t.personality;if(!e.isProcessing){this.setPersonalityProcessing(t,!0);try{const r=await this.api_post_req("get_personality_config",{category:e.category,name:e.folder});r.status&&r.config?(this.$store.commit("setCurrentPersonConfig",r.config),this.$store.commit("setShowPersonalityEditor",!0),this.$store.commit("setSelectedPersonality",e),(n=this.$store.state.personality_editor)!=null&&n.showPanel&&this.$store.state.personality_editor.showPanel()):this.show_toast(`Failed to load config for ${e.name}: ${r.error||"Not found/error"}`,4,!1)}catch(r){this.show_toast(`Error loading config for ${e.name}: ${r.message}`,4,!1)}finally{this.setPersonalityProcessing(t,!1)}}},async onCopyToCustom(t){const e=t.personality;if(e.isProcessing||!await this.show_yes_no_dialog(`Copy "${e.name}" to 'custom_personalities'?`,"Copy","Cancel"))return;this.setPersonalityProcessing(t,!0);const r=await this.api_post_req("copy_to_custom_personas",{category:e.category,name:e.folder});r&&r.status?(this.show_message_box(`"${e.name}" copied. Refreshing list...`),await new Promise(i=>setTimeout(i,500)),await this.$store.dispatch("refreshPersonalitiesZoo"),await this.$store.dispatch("refreshMountedPersonalities")):this.show_toast(`Failed to copy ${e.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async onPersonalityReinstall(t){const e=t.personality;if(e.isProcessing||!await this.show_yes_no_dialog(`Reinstall "${e.name}"? This overwrites local changes.`,"Reinstall","Cancel"))return;this.setPersonalityProcessing(t,!0),this.show_toast(`Reinstalling ${e.name}...`,3,!0);const r=await this.api_post_req("reinstall_personality",{name:e.full_path});r&&r.status?this.show_toast(`${e.name} reinstalled. Remount if active.`,4,!0):this.show_toast(`Failed to reinstall ${e.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1),this.setPersonalityProcessing(t,!1)},async onSettingsPersonality(t){const e=t.personality;if(!(!this.isActivePersonality(e)||e.isProcessing)){if(!this.isActivePersonality(e)){this.show_toast(`Activate "${e.name}" first to configure settings.`,4,!1);return}this.setPersonalityProcessing(t,!0);try{const n=await this.api_get_req("/get_active_personality_settings");if(n&&typeof n=="object"&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Settings - ${e.name}`,"Save","Cancel");if(r!=null){this.setPersonalityProcessing(t,!0);const i=await this.api_post_req("set_active_personality_settings",r);i!=null&&i.status?this.show_toast(`Settings for ${e.name} updated.`,4,!0):this.show_toast(`Failed to update settings: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}}else n&&typeof n=="object"?this.show_toast(`"${e.name}" has no configurable settings.`,3,!0):this.show_toast("Could not retrieve settings structure.",4,!1)}catch(n){this.show_toast(`Error accessing settings: ${n.message}`,4,!1)}finally{this.setPersonalityProcessing(t,!1)}}},onCopyPersonalityName(t){const e=t.personality;navigator.clipboard.writeText(e.name).then(()=>this.show_toast(`Copied name: ${e.name}`,3,!0)).catch(n=>this.show_toast("Failed to copy name.",3,!1))},async handleOpenFolder(t){const e=t.personality,n=await this.api_post_req("open_personality_folder",{category:e.category,name:e.folder});(!n||!n.status)&&this.show_toast(`Could not open folder: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}},async mounted(){var t;await this.fetchInitialData(),this.selectedCategory=((t=this.config)==null?void 0:t.personality_category)||""},updated(){Fe(()=>{Re.replace()})}},imr={class:"user-settings-panel flex flex-col mb-2 rounded-lg shadow-lg p-4 bg-white dark:bg-gray-800"},smr={class:"flex flex-row justify-between items-center mb-4 flex-wrap gap-y-2"},omr={class:"flex items-center flex-wrap"},amr={key:0,class:"flex items-center mr-2 text-lg text-blue-600 dark:text-blue-300"},lmr=["title"],cmr={class:"flex items-center space-x-3 shrink-0"},umr={key:0,class:"text-base font-semibold cursor-default select-none items-center flex flex-row"},dmr={class:"flex -space-x-4 items-center"},fmr={class:"group/mounted items-center flex flex-row"},hmr=["onClick","title"],pmr=["src"],Tmr=["onClick"],Omr=["title"],mmr={class:"flex flex-col sm:flex-row gap-4 mb-4"},gmr={class:"flex-grow"},Qmr={class:"relative"},_mr={class:"absolute right-1.5 bottom-1.5 flex space-x-1"},vmr={class:"flex-shrink-0 sm:w-64"},ymr={value:""},bmr={value:"Mounted"},Smr={key:0,value:"Starred"},xmr={key:1,disabled:"",class:"text-blue-400 dark:text-blue-600"},Emr=["value"],wmr={key:0,class:"flex justify-center items-center p-10 text-loading text-blue-600 dark:text-blue-300"},Cmr={key:1,class:"text-center text-blue-500 dark:text-blue-400 py-10"},Lmr={key:2,class:"overflow-y-auto flex-grow personalities-grid-container scrollbar",style:{"max-height":"calc(100vh - 300px)"},ref:"gridContainer"},$mr={class:"label block ml-2 mb-2 text-blue-700 dark:text-blue-300"};function Amr(t,e,n,r,i,s){const o=Xe("PersonalityEntry");return k(),R("div",imr,[b("div",smr,[b("div",omr,[e[9]||(e[9]=b("p",{class:"text-xl font-semibold cursor-default select-none mr-3 text-blue-800 dark:text-blue-100"}," Personalities Zoo ",-1)),s.active_personality_name?(k(),R("div",amr,[e[8]||(e[8]=b("span",{class:"mx-2 text-blue-400 dark:text-blue-500"},"|",-1)),b("span",{class:"font-bold line-clamp-1",title:`Active: ${s.active_personality_name}`},ae(s.active_personality_name),9,lmr)])):ne("",!0)]),b("div",cmr,[s.mountedPersArr.length>0?(k(),R("div",umr,[b("div",dmr,[(k(!0),R(Ve,null,dt(s.displayedMountedPersonalities,(a,l)=>(k(),R("div",{class:"relative hover:-translate-y-1 duration-300 hover:z-10 shrink-0",key:a.id||a.full_path+"-"+l,ref_for:!0,ref:"mountedPersonalitiesRefs"},[b("div",fmr,[b("button",{onClick:oe(c=>s.onPersonalitySelected({personality:a,isMounted:!0}),["stop"]),title:`Select: ${a.name}`,class:"transition-transform duration-150 ease-in-out active:scale-90"},[b("img",{src:s.getPersonalityIconUrl(a.avatar),onError:e[0]||(e[0]=(...c)=>s.personalityImgPlaceholder&&s.personalityImgPlaceholder(...c)),class:ye(["w-8 h-8 rounded-full object-cover border-2 transition-colors duration-200 group-hover/mounted:border-blue-500 dark:group-hover/mounted:border-blue-400",s.isActivePersonality(a)?"border-blue-500 dark:border-blue-400":"border-blue-300 dark:border-blue-600"])},null,42,pmr)],8,hmr),b("button",{onClick:oe(c=>s.unmountPersonality({personality:a}),["stop"]),class:"absolute -top-1 -right-1 opacity-0 group-hover/mounted:opacity-100 transition-all duration-150 ease-in-out hover:scale-110",title:"Unmount personality"},e[10]||(e[10]=[b("span",{class:"bg-red-500 hover:bg-red-600 text-white rounded-full p-0.5 flex items-center justify-center shadow-md transition-colors duration-150"},[b("i",{"data-feather":"x",class:"w-3 h-3 stroke-current"})],-1)]),8,Tmr)])]))),128)),s.mountedPersArr.length>i.maxDisplayedMounted?(k(),R("div",{key:0,class:"w-8 h-8 rounded-full bg-blue-200 dark:bg-blue-700 border-2 border-blue-300 dark:border-blue-600 flex items-center justify-center text-xs font-semibold text-blue-600 dark:text-blue-300 cursor-default",title:`${s.mountedPersArr.length-i.maxDisplayedMounted} more mounted`}," +"+ae(s.mountedPersArr.length-i.maxDisplayedMounted),9,Omr)):ne("",!0)])])):ne("",!0),s.mountedPersArr.length>0?(k(),R("button",{key:1,onClick:e[1]||(e[1]=oe(a=>s.unmountAll(),["stop"])),class:"p-1 bg-red-100 hover:bg-red-200 dark:bg-red-900 dark:hover:bg-red-800 rounded-full border border-red-300 dark:border-red-700 active:scale-90 transition-all duration-150",title:"Unmount All Personalities"},e[11]||(e[11]=[b("i",{"data-feather":"x-octagon",class:"w-4 h-4 text-red-600 dark:text-red-400 stroke-current"},null,-1)]))):ne("",!0)])]),b("div",mmr,[b("div",gmr,[e[13]||(e[13]=b("label",{for:"personality-search",class:"sr-only"},"Search",-1)),b("div",Qmr,[e[12]||(e[12]=b("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search",id:"personality-search",class:"input search-input block w-full p-3 pl-10 text-sm text-blue-900 dark:text-blue-100 placeholder-blue-500 dark:placeholder-blue-400 pr-24",placeholder:"Search name, author, description...","onUpdate:modelValue":e[2]||(e[2]=a=>i.searchTermInput=a),onKeyup:e[3]||(e[3]=gr((...a)=>s.applySearch&&s.applySearch(...a),["enter"]))},null,544),[[vt,i.searchTermInput]]),b("div",_mr,[i.searchTermInput?(k(),R("button",{key:0,onClick:e[4]||(e[4]=oe((...a)=>s.clearSearch&&s.clearSearch(...a),["stop"])),type:"button",class:"btn btn-secondary btn-sm text-xs px-3 py-1.5"}," Clear ")):ne("",!0),b("button",{onClick:e[5]||(e[5]=oe((...a)=>s.applySearch&&s.applySearch(...a),["stop"])),type:"button",class:"btn btn-primary btn-sm text-xs px-3 py-1.5"}," Search ")])])]),b("div",vmr,[e[14]||(e[14]=b("label",{for:"persCat",class:"sr-only"},"Category",-1)),He(b("select",{id:"persCat","onUpdate:modelValue":e[6]||(e[6]=a=>i.selectedCategory=a),onChange:e[7]||(e[7]=(...a)=>s.handleCategoryChange&&s.handleCategoryChange(...a)),class:"input block w-full p-3 text-sm text-blue-900 dark:text-blue-100"},[b("option",ymr,"All Categories ("+ae(i.allPersonalities.length)+")",1),b("option",bmr,"⬆️ Mounted ("+ae(s.mountedPersArr.length)+")",1),s.starredPersonalitiesPaths.length>0?(k(),R("option",Smr,"⭐ Starred ("+ae(s.getStarredCount())+")",1)):ne("",!0),(s.starredPersonalitiesPaths.length>0||s.mountedPersArr.length>0)&&i.persCatgArr.length>0?(k(),R("option",xmr,"──────────")):ne("",!0),(k(!0),R(Ve,null,dt(i.persCatgArr,(a,l)=>(k(),R("option",{key:l,value:a},ae(a)+" ("+ae(s.getCategoryCount(a))+") ",9,Emr))),128))],544),[[$s,i.selectedCategory]])])]),i.isLoading&&i.allPersonalities.length===0?(k(),R("div",wmr,e[15]||(e[15]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-400 animate-spin dark:text-blue-500 fill-blue-600 dark:fill-blue-300",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading personalities...",-1)]))):!i.isLoading&&s.filteredPersonalities.length===0?(k(),R("div",Cmr," No personalities found"+ae(i.activeSearchTerm?' matching "'+i.activeSearchTerm+'"':"")+ae(s.getResultMessageQualifier())+". ",1)):(k(),R("div",Lmr,[b("label",$mr,ae(s.getResultLabel())+": ("+ae(s.filteredPersonalities.length)+") ",1),(k(),R("div",{key:i.selectedCategory+"-"+i.activeSearchTerm,class:"p-2 pb-0 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 bg-blue-100/50 dark:bg-blue-800/30 rounded-md"},[te(V4,{name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(s.filteredPersonalities,a=>(k(),Qt(o,{key:a.id||a.full_path,personality:a,select_language:!0,full_path:a.full_path,"is-mounted":a.isMounted,"is-active":s.isActivePersonality(a),"is-processing":a.isProcessing,"is-starred":a.isStarred,"base-url":i.bUrl,onSelect:s.onPersonalitySelected,onMount:s.mountPersonality,onUnmount:s.unmountPersonality,onRemount:s.remountPersonality,onEdit:s.editPersonality,onToggleStar:s.toggleStar,onCopyToCustom:s.onCopyToCustom,onReinstall:s.onPersonalityReinstall,onSettings:s.onSettingsPersonality,onCopyPersonalityName:s.onCopyPersonalityName,onOpenFolder:s.handleOpenFolder,onError:s.personalityImgPlaceholder},null,8,["personality","full_path","is-mounted","is-active","is-processing","is-starred","base-url","onSelect","onMount","onUnmount","onRemount","onEdit","onToggleStar","onCopyToCustom","onReinstall","onSettings","onCopyPersonalityName","onOpenFolder","onError"]))),128))]),_:1})]))],512))])}const kmr=st(rmr,[["render",Amr],["__scopeId","data-v-57acb6cf"]]),Pmr="/assets/functioncall-Cm2fTSgb.png",Rmr="/",Mmr={props:{function_call:{},select_language:Boolean,full_path:String,onOpenFolder:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onShowSettings:Function,onCopyfunction_callName:Function,onToggleFavorite:Function},components:{InteractiveMenu:KC},data(){return{mounted:!1,name:this.function_call.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0},showHelpPopup:!1,renderedHelp:""}},computed:{commandsList(){let t=[{name:this.mounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.mounted?this.unmount:this.mount}];return console.log("this.category",this.function_call.category),this.function_call.category=="custom_personalities"?t.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):t.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.mounted&&t.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),t}},mounted(){this.mounted=this.function_call.mounted,console.log(this.function_call),Fe(()=>{Re.replace()})},methods:{show_settings(){this.onShowSettings(this)},formatDate(t){const e={year:"numeric",month:"short",day:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(t){this.thumbnailPosition={x:t.clientX+10,y:t.clientY+10}},getImgUrl(){return Rmr+this.function_call.avatar},defaultImg(t){t.target.src=Pmr},toggleFavorite(){this.onToggleFavorite(this)},showFolder(){this.onOpenFolder(this)},toggleCopyLink(){this.onCopyfunction_callName(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.mounted=!1},showHelp(){this.renderedHelp=Kt(this.function_call.help),this.showHelpPopup=!0},closeHelp(){this.showHelpPopup=!1}},watch:{}},Dmr=["title"],Nmr={class:"flex-grow"},Imr={class:"flex items-center mb-4"},Hmr=["src"],Vmr={class:"font-bold text-xl text-gray-800 cursor-pointer"},qmr={class:"text-sm text-gray-600"},Umr={class:"text-sm text-gray-600"},Bmr={class:"text-sm text-gray-600"},zmr={key:0,class:"text-sm text-gray-600"},Xmr={key:1,class:"text-sm text-gray-600"},Fmr={class:"mb-4"},jmr=["innerHTML"],Ymr={class:"mt-auto pt-4 border-t"},Gmr={class:"flex justify-between items-center flex-wrap"},Wmr=["title"],Zmr=["fill"],Kmr=["src"],Jmr={key:1,class:"fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center"},egr={class:"bg-white p-4 rounded-lg shadow-lg w-[500px] h-[400px] flex flex-col"},tgr={class:"flex justify-between items-center mb-2"},ngr={class:"flex-grow overflow-auto"},rgr=["innerHTML"];function igr(t,e,n,r,i,s){const o=Xe("InteractiveMenu");return k(),R("div",{class:ye(["app-card flex flex-col h-full",i.mounted?"border-primary-light":"border-transparent"]),title:n.function_call.installed?"":"Not installed"},[b("div",Nmr,[b("div",Imr,[b("img",{src:s.getImgUrl(),onError:e[0]||(e[0]=a=>s.defaultImg(a)),alt:"function_call Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4 cursor-pointer",onMouseover:e[1]||(e[1]=(...a)=>s.showThumbnail&&s.showThumbnail(...a)),onMousemove:e[2]||(e[2]=(...a)=>s.updateThumbnailPosition&&s.updateThumbnailPosition(...a)),onMouseleave:e[3]||(e[3]=(...a)=>s.hideThumbnail&&s.hideThumbnail(...a))},null,40,Hmr),b("div",null,[b("h3",Vmr,ae(n.function_call.name),1),b("p",qmr,"Author: "+ae(n.function_call.author),1),b("p",Umr,"Version: "+ae(n.function_call.version),1),b("p",Bmr,"Category: "+ae(n.function_call.category),1),n.function_call.creation_date?(k(),R("p",zmr,"Creation Date: "+ae(s.formatDate(n.function_call.creation_date)),1)):ne("",!0),n.function_call.last_update_date?(k(),R("p",Xmr,"Last update Date: "+ae(s.formatDate(n.function_call.last_update_date)),1)):ne("",!0)]),n.function_call.help?(k(),R("button",{key:0,onClick:e[4]||(e[4]=(...a)=>s.showHelp&&s.showHelp(...a)),class:"ml-2 text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Help"},e[9]||(e[9]=[b("i",{"data-feather":"help-circle",class:"h-6 w-6"},null,-1)]))):ne("",!0)]),b("div",Fmr,[e[10]||(e[10]=b("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),b("p",{class:"text-sm text-gray-600 h-20 overflow-y-auto",innerHTML:n.function_call.description},null,8,jmr)])]),b("div",Ymr,[b("div",Gmr,[b("button",{onClick:e[5]||(e[5]=(...a)=>s.toggleFavorite&&s.toggleFavorite(...a)),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:t.isFavorite?"Remove from favorites":"Add to favorites"},[(k(),R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:t.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[11]||(e[11]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,Zmr))],8,Wmr),b("button",{onClick:e[6]||(e[6]=(...a)=>s.showFolder&&s.showFolder(...a)),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Show Folder"},e[12]||(e[12]=[b("i",{"data-feather":"folder",class:"h-6 w-6"},null,-1)])),i.mounted?(k(),R("button",{key:0,onClick:e[7]||(e[7]=(...a)=>s.show_settings&&s.show_settings(...a)),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Settings"},e[13]||(e[13]=[b("i",{"data-feather":"settings",class:"h-6 w-6"},null,-1)]))):ne("",!0),te(o,{commands:s.commandsList,force_position:2,title:"Menu",class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out"},null,8,["commands"])])]),i.thumbnailVisible?(k(),R("div",{key:0,style:qn({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[b("img",{src:s.getImgUrl(),class:"w-full h-full object-fill"},null,8,Kmr)],4)):ne("",!0),i.showHelpPopup?(k(),R("div",Jmr,[b("div",egr,[b("div",tgr,[e[14]||(e[14]=b("h2",{class:"text-lg font-bold"},"Help",-1)),b("button",{onClick:e[8]||(e[8]=(...a)=>s.closeHelp&&s.closeHelp(...a)),class:"text-red-500 hover:text-red-600"},"Close")]),b("div",ngr,[b("div",{innerHTML:i.renderedHelp},null,8,rgr)])])])):ne("",!0)],10,Dmr)}const sgr=st(Mmr,[["render",igr]]),ogr="/assets/default_function-CyfcuNmo.png";function agr(t,e){let n;return function(...i){const s=()=>{clearTimeout(n),t.apply(this,i)};clearTimeout(n),n=setTimeout(s,e)}}const lgr={name:"FunctionCallsZoo",components:{FunctionEntry:sgr},props:{config:{type:Object,required:!0},api_post_req:{type:Function,required:!0},api_get_req:{type:Function,required:!0},show_toast:{type:Function,required:!0},show_yes_no_dialog:{type:Function,required:!0},show_universal_form:{type:Function,required:!0},show_message_box:{type:Function,required:!0},client_id:{type:String,required:!0}},emits:["update:setting"],data(){return{allFunctions:[],categoriesFunc:[],filteredFunctions:[],pagedFunctions:[],isLoadingFunctions:!1,isSearchingFunc:!1,searchTermFunc:"",selectedCategoryFunc:"",sortOptionFunc:"mounted",itemsPerPageFunc:15,currentPageFunc:1,maxDisplayedMountedFunc:7,functionEntryRefs:{},observerFunc:null,defaultIcon:ogr,axiosBaseUrl:Ae.defaults.baseURL||""}},computed:{mountedFunctionPathsSet(){var t;return new Set(((t=this.config)==null?void 0:t.mounted_functions)||[])},mountedFunctions(){return this.allFunctions.filter(t=>this.mountedFunctionPathsSet.has(t.full_path))},displayedMountedFunctions(){return[...this.mountedFunctions].sort((e,n)=>(e.name||"").localeCompare(n.name||"")).slice(0,this.maxDisplayedMountedFunc)},hasMoreFunctionsToLoad(){return this.pagedFunctions.length{const i=e.has(r.full_path);r.isMounted!==i&&(r.isMounted=i,n=!0)}),n&&(console.log("Watcher: Re-applying filters and sort due to mounted status change."),this.resetAndReloadFunctions()),this.featherReplace()},deep:!0},searchTermFunc(){this.debouncedResetAndReload()},selectedCategoryFunc(){this.debouncedResetAndReload()},sortOptionFunc(){this.debouncedResetAndReload()},allFunctions:{handler(){console.log("Watcher: allFunctions list changed. Triggering initial load."),this.resetAndReloadFunctions()}}},methods:{getFunctionIcon(t){return t?t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t.startsWith("/")?`${this.axiosBaseUrl}${t}`:t:`${this.axiosBaseUrl}/${t}`:this.defaultIcon},imgPlaceholder(t){t.target.src=this.defaultIcon},featherReplace(){this.$nextTick(()=>{try{Re.replace()}catch(t){console.error("Feather replace error:",t)}})},setFunctionRef(t,e){e&&(this.functionEntryRefs[t]=e)},async fetchFunctionsAndCategories(){if(!this.isLoadingFunctions){this.isLoadingFunctions=!0,console.log("Fetching functions and categories...");try{const t=await this.api_get_req("list_function_calls"),e=(t==null?void 0:t.function_calls)||[],n=new Set(e.map(r=>r.category).filter(Boolean));this.categoriesFunc=Array.from(n).sort(),this.allFunctions=e.map(r=>{const i=`${r.category}/${r.name}`,s=r.id||i;return{...r,full_path:i,isMounted:!1,id:s,isProcessing:!1}}),console.log(`Fetched ${this.allFunctions.length} total functions.`),this.$nextTick(()=>{var r;(r=this.config)!=null&&r.mounted_functions&&this.watch["config.mounted_functions"].handler.call(this,this.config.mounted_functions)})}catch(t){this.show_toast("Failed to load functions list.",4,!1),console.error("Error fetching functions:",t),this.allFunctions=[],this.categoriesFunc=[]}finally{this.isLoadingFunctions=!1}}},applyFiltersAndSortFunc(){console.time("FilterSortFunctions");let t=[...this.allFunctions];if(this.selectedCategoryFunc&&(t=t.filter(e=>e.category===this.selectedCategoryFunc)),this.searchTermFunc){const e=this.searchTermFunc.toLowerCase();t=t.filter(n=>{var c,u,d,f,h;const r=(c=n.name)==null?void 0:c.toLowerCase().includes(e),i=(u=n.author)==null?void 0:u.toLowerCase().includes(e),s=(d=n.description)==null?void 0:d.toLowerCase().includes(e),o=(f=n.category)==null?void 0:f.toLowerCase().includes(e),a=(h=n.full_path)==null?void 0:h.toLowerCase().includes(e),l=Array.isArray(n.keywords)?n.keywords.some(p=>p.toLowerCase().includes(e)):!1;return r||i||s||o||a||l})}t.sort((e,n)=>{if(this.sortOptionFunc==="mounted"){if(e.isMounted&&!n.isMounted)return-1;if(!e.isMounted&&n.isMounted)return 1}switch(this.sortOptionFunc!=="mounted"?this.sortOptionFunc:"name"){case"name":return(e.name||"").localeCompare(n.name||"");case"author":return(e.author||"").localeCompare(n.author||"");case"category":return(e.category||"").localeCompare(n.category||"");default:return 0}}),this.filteredFunctions=t,console.timeEnd("FilterSortFunctions"),console.log(`Filtered/Sorted functions: ${this.filteredFunctions.length}`)},resetAndReloadFunctions(){this.currentPageFunc=1,this.pagedFunctions=[],this.applyFiltersAndSortFunc(),this.$nextTick(()=>{this.loadMoreFunctions()})},debouncedResetAndReload:agr(function(){this.isSearchingFunc=!0,this.resetAndReloadFunctions(),setTimeout(()=>{this.isSearchingFunc=!1},100)},300),loadMoreFunctions(){if(this.isLoadingFunctions||this.isSearchingFunc||!this.hasMoreFunctionsToLoad)return;console.log(`Loading page ${this.currentPageFunc}`);const t=(this.currentPageFunc-1)*this.itemsPerPageFunc,e=t+this.itemsPerPageFunc,n=this.filteredFunctions.slice(t,e),r=new Set(this.pagedFunctions.map(s=>s.id||s.full_path)),i=n.filter(s=>!r.has(s.id||s.full_path));i.length>0?(this.pagedFunctions.push(...i),this.currentPageFunc++,this.featherReplace()):n.length>0&&console.log("Load more triggered but items already seem to be loaded.")},setFunctionProcessing(t,e){const n=s=>{s&&(s.isProcessing=e)},r=this.allFunctions.findIndex(s=>(s.id||s.full_path)===t);n(this.allFunctions[r]);const i=this.pagedFunctions.findIndex(s=>(s.id||s.full_path)===t);n(this.pagedFunctions[i])},async handleMount(t){if(t.isMounted||t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0),this.show_toast(`Mounting ${t.name}...`,3,!0);try{const n=await this.api_post_req("mount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(n&&n.status){this.show_toast(`${t.name} mounted successfully.`,4,!0);const r=[...this.mountedFunctionPathsSet,t.full_path];this.$emit("update:setting",{key:"mounted_functions",value:r})}else this.show_toast(`Failed to mount ${t.name}: ${(n==null?void 0:n.error)||"Error"}`,4,!1)}catch(n){this.show_toast(`Error mounting ${t.name}: ${n.message||n}`,4,!1),console.error("Mount error:",n)}finally{this.setFunctionProcessing(e,!1)}},async handleUnmount(t){var n;if(!t.isMounted||t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0),this.show_toast(`Unmounting ${t.name}...`,3,!0);try{const r=await this.api_post_req("unmount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(r&&r.status){this.show_toast(`${t.name} unmounted.`,4,!0);const i=(((n=this.config)==null?void 0:n.mounted_functions)||[]).filter(s=>s!==t.full_path);this.$emit("update:setting",{key:"mounted_functions",value:i})}else this.show_toast(`Failed to unmount ${t.name}: ${(r==null?void 0:r.error)||"Error"}`,4,!1)}catch(r){this.show_toast(`Error unmounting ${t.name}: ${r.message||r}`,4,!1),console.error("Unmount error:",r)}finally{this.setFunctionProcessing(e,!1)}},async unmountAll(){if(!(this.mountedFunctions.length===0||!await this.show_yes_no_dialog(`Unmount all ${this.mountedFunctions.length} functions?`,"Unmount All","Cancel"))){this.show_toast("Unmounting all functions...",3,!0),this.mountedFunctions.forEach(e=>this.setFunctionProcessing(e.id||e.full_path,!0));try{const e=await this.api_post_req("unmount_all_functions",{client_id:this.client_id});e&&e.status?(this.show_toast("All functions unmounted.",4,!0),this.$emit("update:setting",{key:"mounted_functions",value:[]})):(this.show_toast(`Failed to unmount all: ${(e==null?void 0:e.error)||"Error"}`,4,!1),this.mountedFunctions.forEach(n=>this.setFunctionProcessing(n.id||n.full_path,!1)))}catch(e){this.show_toast(`Error unmounting all: ${e.message||e}`,4,!1),console.error("Unmount all error:",e),this.mountedFunctions.forEach(n=>this.setFunctionProcessing(n.id||n.full_path,!1))}}},async handleRemount(t){const e=t.id||t.full_path;if(!t.isProcessing){this.setFunctionProcessing(e,!0),this.show_toast(`Remounting ${t.name}...`,3,!0);try{let n=[...this.config.mounted_functions||[]];if(n.includes(t.full_path)){const s=await this.api_post_req("unmount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});if(!s||!s.status){this.show_toast(`Failed to unmount ${t.name} during remount. Aborting.`,4,!1),this.setFunctionProcessing(e,!1);return}n=n.filter(o=>o!==t.full_path),this.$emit("update:setting",{key:"mounted_functions",value:n}),await Fe(),console.log("Remount Step 1: Unmounted and emitted.")}const i=await this.api_post_req("mount_function_call",{client_id:this.client_id,function_category:t.category,function_name:t.name});i&&i.status?(this.show_toast(`${t.name} remounted successfully.`,4,!0),n.includes(t.full_path)||n.push(t.full_path),this.$emit("update:setting",{key:"mounted_functions",value:n}),console.log("Remount Step 2: Mounted and emitted.")):this.show_toast(`Failed to mount ${t.name} during remount: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}catch(n){this.show_toast(`Error remounting ${t.name}: ${n.message||n}`,4,!1),console.error("Remount error:",n)}finally{this.setFunctionProcessing(e,!1)}}},async handleSettings(t){if(t.isProcessing)return;const e=t.id||t.full_path;this.setFunctionProcessing(e,!0);try{const n=await this.api_post_req("get_function_call_settings",{client_id:this.client_id,category:t.category,name:t.name});if(n&&typeof n=="object"&&Object.keys(n).length>0){const r=await this.show_universal_form(n,`Function Settings - ${t.name}`,"Save","Cancel");if(r!=null){const i=await this.api_post_req("set_function_call_settings",{client_id:this.client_id,category:t.category,name:t.name,settings:r});i&&i.status?this.show_toast(`Settings for ${t.name} updated.`,4,!0):this.show_toast(`Failed to update settings for ${t.name}: ${(i==null?void 0:i.error)||"Error"}`,4,!1)}else this.show_toast(`Settings update for ${t.name} cancelled.`,3,!0)}else n&&typeof n=="object"&&Object.keys(n).length===0?this.show_message_box(`Function "${t.name}" has no configurable settings.`):this.show_toast(`Could not retrieve settings for ${t.name}: ${(n==null?void 0:n.error)||"Invalid response"}`,4,!1)}catch(n){this.show_toast(`Error accessing settings for ${t.name}: ${n.message||n}`,4,!1),console.error("Settings error:",n)}finally{this.setFunctionProcessing(e,!1)}},async handleEdit(t){this.show_toast(`Opening folder containing "${t.name}" for editing...`,3,!0),await this.handleOpenFolder(t)},async handleCopyToCustom(t){if(!await this.show_yes_no_dialog(`Copy "${t.name}" from "${t.category}" to your 'custom_functions' folder?`,"Copy","Cancel")||t.isProcessing)return;const n=t.id||t.full_path;this.setFunctionProcessing(n,!0);try{const r=await this.api_post_req("copy_to_custom_functions",{client_id:this.client_id,category:t.category,name:t.name});r&&r.status?(this.show_message_box(`Function "${t.name}" copied to 'custom_functions'. The list will refresh shortly.`),await this.fetchFunctionsAndCategories()):this.show_toast(`Failed to copy ${t.name}: ${(r==null?void 0:r.error)||"Already exists in custom?"}`,4,!1)}catch(r){this.show_toast(`Error copying ${t.name}: ${r.message||r}`,4,!1),console.error("Copy to custom error:",r)}finally{this.setFunctionProcessing(n,!1)}},handleCopyName(t){navigator.clipboard.writeText(t.name).then(()=>this.show_toast(`Copied name: ${t.name}`,3,!0)).catch(e=>{this.show_toast("Failed to copy name to clipboard.",3,!1),console.error("Clipboard copy failed:",e)})},async handleOpenFolder(t){try{await this.api_post_req("open_function_folder",{client_id:this.client_id,category:t.category,name:t.name})}catch(e){this.show_toast(`Error opening folder for ${t.name}: ${e.message||e}`,4,!1),console.error("Open folder error:",e)}},scrollToFunction(t){const e=t.id||t.full_path,n=this.functionEntryRefs[e];if(n&&n.$el){const r=n.$el;r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.add("ring-2","ring-offset-2","ring-blue-500","dark:ring-offset-gray-800","transition-all","duration-1000","ease-out"),setTimeout(()=>{r.classList.remove("ring-2","ring-offset-2","ring-blue-500","dark:ring-offset-gray-800","transition-all","duration-1000","ease-out")},1500)}else console.warn(`Could not find ref $el to scroll to for function ID: ${e}. Is it loaded?`),this.hasMoreFunctionsToLoad&&!this.pagedFunctions.some(r=>(r.id||r.full_path)===e)?(this.show_toast(`Function ${t.name} not visible, attempting to load more...`,3,!0),this.loadMoreFunctions(),setTimeout(()=>this.scrollToFunction(t),500)):this.show_toast(`Could not scroll to ${t.name}.`,3,!1)},setupIntersectionObserverFunc(){this.disconnectIntersectionObserver();const t={root:null,rootMargin:"100px",threshold:.1};this.observerFunc=new IntersectionObserver(n=>{n.forEach(r=>{r.isIntersecting&&this.hasMoreFunctionsToLoad&&this.loadMoreFunctions()})},t);const e=this.$refs.loadMoreTriggerFunc;e?(this.observerFunc.observe(e),console.log("IntersectionObserver setup complete.")):this.$nextTick(()=>{const n=this.$refs.loadMoreTriggerFunc;n?(this.observerFunc.observe(n),console.log("IntersectionObserver setup complete (nextTick).")):console.error("Load more trigger element not found for IntersectionObserver setup.")})},disconnectIntersectionObserver(){if(this.observerFunc){console.log("Disconnecting IntersectionObserver.");const t=this.$refs.loadMoreTriggerFunc;if(t)try{this.observerFunc.unobserve(t)}catch(e){console.warn("Error unobserving trigger:",e)}this.observerFunc.disconnect(),this.observerFunc=null}}},mounted(){console.log("FunctionCallsZoo Mounted."),this.fetchFunctionsAndCategories(),this.featherReplace(),this.$nextTick(()=>{this.setupIntersectionObserverFunc()})},beforeUpdate(){this.functionEntryRefs={}},updated(){this.featherReplace(),this.$nextTick(()=>{const t=this.$refs.loadMoreTriggerFunc;if(t&&this.observerFunc&&!this.observerFunc.takeRecords().some(e=>e.target===t)){console.warn("IntersectionObserver detached from trigger, re-observing.");try{this.observerFunc.unobserve(t)}catch{}this.observerFunc.observe(t)}else t&&!this.observerFunc&&(console.warn("IntersectionObserver lost, re-setting up."),this.setupIntersectionObserverFunc())})},unmounted(){console.log("FunctionCallsZoo Unmounted."),this.disconnectIntersectionObserver()}},cgr={class:"user-settings-panel space-y-6 p-4 md:p-6 rounded-lg shadow-md bg-white dark:bg-gray-800"},ugr={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-blue-300 dark:border-blue-600 pb-3 mb-4"},dgr={class:"flex flex-col items-end"},fgr={class:"flex items-center flex-wrap gap-2 text-sm font-medium mb-1"},hgr={key:0,class:"text-blue-500 dark:text-blue-500 italic text-xs"},pgr={key:1,class:"flex -space-x-3 items-center"},Tgr=["src","title","onClick"],Ogr=["onClick"],mgr=["title"],ggr={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4 items-center"},Qgr={class:"relative md:col-span-1"},_gr={key:0,class:"absolute inset-y-0 right-0 pr-3 flex items-center"},vgr={class:"md:col-span-1"},ygr=["value"],bgr={class:"md:col-span-1"},Sgr={key:0,class:"flex justify-center items-center p-10 text-blue-500 dark:text-blue-400"},xgr={key:1,class:"text-center text-blue-500 dark:text-blue-400 py-10"},Egr={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 scrollbar-thin scrollbar-thumb-blue-300 scrollbar-track-blue-100 dark:scrollbar-thumb-blue-700 dark:scrollbar-track-blue-900",ref:"scrollContainerFunc"},wgr={ref:"loadMoreTriggerFunc",class:"h-10"},Cgr={key:0,class:"flex justify-center items-center text-center text-blue-500 dark:text-blue-400 py-4"};function Lgr(t,e,n,r,i,s){const o=Xe("FunctionEntry");return k(),R("div",cgr,[b("div",ugr,[e[9]||(e[9]=b("h2",{class:"text-2xl font-semibold text-blue-800 dark:text-blue-100 mb-2 sm:mb-0"}," Function Calls Zoo ",-1)),b("div",dgr,[b("div",fgr,[e[7]||(e[7]=b("span",{class:"text-blue-600 dark:text-blue-400"},"Mounted:",-1)),s.mountedFunctions.length===0?(k(),R("div",hgr,"None")):(k(),R("div",pgr,[(k(!0),R(Ve,null,dt(s.displayedMountedFunctions,(a,l)=>(k(),R("div",{key:`mounted-${a.id||a.full_path||l}`,class:"relative group"},[b("img",{src:s.getFunctionIcon(a.icon),onError:e[0]||(e[0]=(...c)=>s.imgPlaceholder&&s.imgPlaceholder(...c)),class:"w-7 h-7 rounded-full object-cover ring-2 ring-white dark:ring-gray-700 cursor-pointer hover:ring-blue-500 dark:hover:ring-blue-400 transition-all",title:`${a.name} (${a.category})`,onClick:c=>s.scrollToFunction(a)},null,40,Tgr),b("button",{onClick:oe(c=>s.handleUnmount(a),["stop"]),class:"absolute -top-1 -right-1 p-0.5 rounded-full bg-red-600 text-white opacity-0 group-hover:opacity-100 transition-opacity duration-150 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-1 dark:focus:ring-offset-gray-900",title:"Unmount"},e[6]||(e[6]=[b("i",{"data-feather":"x",class:"w-3 h-3 stroke-current"},null,-1)]),8,Ogr)]))),128)),s.mountedFunctions.length>i.maxDisplayedMountedFunc?(k(),R("div",{key:0,class:"w-7 h-7 rounded-full bg-blue-200 dark:bg-blue-700 ring-2 ring-white dark:ring-gray-700 flex items-center justify-center text-xs font-semibold text-blue-600 dark:text-blue-300",title:`${s.mountedFunctions.length-i.maxDisplayedMountedFunc} more mounted`}," +"+ae(s.mountedFunctions.length-i.maxDisplayedMountedFunc),9,mgr)):ne("",!0)]))]),s.mountedFunctions.length>0?(k(),R("button",{key:0,onClick:e[1]||(e[1]=(...a)=>s.unmountAll&&s.unmountAll(...a)),class:"btn btn-sm bg-red-600 hover:bg-red-700 text-white text-xs mt-1 focus:ring-red-300 dark:focus:ring-red-600"},e[8]||(e[8]=[b("i",{"data-feather":"x-octagon",class:"w-3 h-3 mr-1 stroke-current"},null,-1),Se("Unmount All ")]))):ne("",!0)])]),e[18]||(e[18]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400"}," Mount functions to grant the AI specific capabilities and tools it can use during conversations. Requires a model trained for function calling. ",-1)),b("div",ggr,[b("div",Qgr,[e[11]||(e[11]=b("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{type:"search","onUpdate:modelValue":e[2]||(e[2]=a=>i.searchTermFunc=a),placeholder:"Search functions...",class:"input pl-10 w-full placeholder:text-blue-400 dark:placeholder:text-blue-500",onInput:e[3]||(e[3]=(...a)=>t.debounceSearchFunc&&t.debounceSearchFunc(...a))},null,544),[[vt,i.searchTermFunc]]),i.isSearchingFunc?(k(),R("div",_gr,e[10]||(e[10]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 text-blue-400 dark:text-blue-500 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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)]))):ne("",!0)]),b("div",vgr,[e[13]||(e[13]=b("label",{for:"func-category",class:"sr-only"},"Filter by Category",-1)),He(b("select",{id:"func-category","onUpdate:modelValue":e[4]||(e[4]=a=>i.selectedCategoryFunc=a),class:"input w-full"},[e[12]||(e[12]=b("option",{value:""},"All Categories",-1)),(k(!0),R(Ve,null,dt(i.categoriesFunc,a=>(k(),R("option",{key:a,value:a},ae(a),9,ygr))),128))],512),[[$s,i.selectedCategoryFunc]])]),b("div",bgr,[e[15]||(e[15]=b("label",{for:"func-sort",class:"sr-only"},"Sort functions by",-1)),He(b("select",{id:"func-sort","onUpdate:modelValue":e[5]||(e[5]=a=>i.sortOptionFunc=a),class:"input w-full"},e[14]||(e[14]=[b("option",{value:"mounted"},"Sort by Mounted",-1),b("option",{value:"name"},"Sort by Name",-1),b("option",{value:"author"},"Sort by Author",-1),b("option",{value:"category"},"Sort by Category",-1)]),512),[[$s,i.sortOptionFunc]])])]),i.isLoadingFunctions?(k(),R("div",Sgr,e[16]||(e[16]=[b("svg",{"aria-hidden":"true",class:"w-8 h-8 mr-2 text-blue-300 dark:text-blue-600 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading functions...",-1)]))):i.pagedFunctions.length===0&&i.filteredFunctions.length===0?(k(),R("div",xgr," No functions found"+ae(i.searchTermFunc?' matching "'+i.searchTermFunc+'"':"")+ae(i.selectedCategoryFunc?' in category "'+i.selectedCategoryFunc+'"':"")+". ",1)):ne("",!0),b("div",Egr,[(k(!0),R(Ve,null,dt(i.pagedFunctions,a=>(k(),Qt(o,{key:a.id||a.full_path,ref_for:!0,ref:l=>s.setFunctionRef(a.id||a.full_path,l),function_call:a,"is-mounted":a.isMounted,"is-processing":a.isProcessing,"get-icon-url":s.getFunctionIcon,"on-img-error":s.imgPlaceholder,onMount:l=>s.handleMount(a),onUnmount:l=>s.handleUnmount(a),onRemount:l=>s.handleRemount(a),onShowSettings:l=>s.handleSettings(a),onEdit:l=>s.handleEdit(a),onCopyToCustom:l=>s.handleCopyToCustom(a),onCopyName:l=>s.handleCopyName(a),onOpenFolder:l=>s.handleOpenFolder(a)},null,8,["function_call","is-mounted","is-processing","get-icon-url","on-img-error","onMount","onUnmount","onRemount","onShowSettings","onEdit","onCopyToCustom","onCopyName","onOpenFolder"]))),128))],512),b("div",wgr,[s.hasMoreFunctionsToLoad&&!i.isLoadingFunctions&&!i.isSearchingFunc?(k(),R("div",Cgr,e[17]||(e[17]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5 mr-2 text-blue-300 dark:text-blue-600 animate-spin fill-blue-500 dark:fill-blue-400",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),Se(),b("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),b("span",null,"Loading more...",-1)]))):ne("",!0)],512)])}const $gr=st(lgr,[["render",Lgr],["__scopeId","data-v-8ff7e3ea"]]),Agr={name:"ModelConfigSettings",components:{ToggleSwitch:ju},props:{config:{type:Object,required:!0},loading:{type:Boolean,default:!1}},emits:["setting-updated"],computed:{isDisabled(){return!this.config.override_personality_model_parameters}},methods:{updateValue(t,e){this.$emit("setting-updated",{key:t,value:e})},handleNumberInput(t,e,n=!1){let r=n?parseInt(e):parseFloat(e);if(t==="seed"){if(String(e)==="-")return;(isNaN(r)||r<-1)&&(r=-1)}else if(isNaN(r)){console.warn(`Attempted to set invalid number for ${t}:`,e);return}this.updateValue(t,r)},replaceFeatherIcons(){Fe(()=>{try{Re.replace()}catch{}})}},mounted(){this.replaceFeatherIcons()},updated(){this.replaceFeatherIcons()}},kgr={class:"user-settings-panel space-y-6"},Pgr={class:"toggle-item !justify-start gap-4 border border-blue-200 dark:border-blue-700 rounded-lg p-3 panels-color"},Rgr={class:"setting-item"},Mgr=["value","disabled"],Dgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Ngr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Igr=["value","disabled"],Hgr=["value","disabled"],Vgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},qgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Ugr=["value","disabled"],Bgr=["value","disabled"],zgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Xgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Fgr=["value","disabled"],jgr=["value","disabled"],Ygr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Ggr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},Wgr=["value","disabled"],Zgr=["value","disabled"],Kgr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},Jgr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},eQr=["value","disabled"],tQr=["value","disabled"],nQr={class:"setting-item items-start md:items-center border-t border-blue-200 dark:border-blue-700 pt-4 mt-4"},rQr={class:"flex-1 flex flex-col sm:flex-row items-center gap-4 w-full"},iQr=["value","disabled"],sQr=["value","disabled"];function oQr(t,e,n,r,i,s){const o=Xe("ToggleSwitch");return k(),R("div",kgr,[e[22]||(e[22]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100 border-b border-blue-300 dark:border-blue-600 pb-2"}," Model Generation Parameters ",-1)),e[23]||(e[23]=b("p",{class:"text-sm text-blue-600 dark:text-blue-400 mb-4"}," Adjust the core parameters that influence how the AI generates text. These settings can be overridden by specific personalities unless the option below is checked. ",-1)),b("div",Pgr,[te(o,{id:"override_personality_model_parameters",checked:n.config.override_personality_model_parameters,"onUpdate:checked":e[0]||(e[0]=a=>s.updateValue("override_personality_model_parameters",a))},null,8,["checked"]),e[14]||(e[14]=b("label",{for:"override_personality_model_parameters",class:"toggle-label !flex-none"},[Se(" Override Personality Parameters "),b("span",{class:"toggle-description"},"Force the use of these global parameters, ignoring any settings defined within the selected personality.")],-1))]),b("div",{class:ye(["space-y-5 pt-4",s.isDisabled?"opacity-50 pointer-events-none":""])},[b("div",Rgr,[e[15]||(e[15]=To(' Seed ',1)),b("input",{type:"number",id:"seed",value:n.config.seed,onInput:e[1]||(e[1]=a=>s.handleNumberInput("seed",a.target.value,!0)),class:"input-sm w-full md:w-32",step:"1",placeholder:"-1",disabled:s.isDisabled},null,40,Mgr)]),b("div",Dgr,[e[16]||(e[16]=To(' Temperature ',1)),b("div",Ngr,[b("input",{id:"temperature-range",value:n.config.temperature,onInput:e[2]||(e[2]=a=>s.handleNumberInput("temperature",a.target.value)),type:"range",min:"0",max:"2",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Igr),b("input",{id:"temperature-number",value:n.config.temperature,onInput:e[3]||(e[3]=a=>s.handleNumberInput("temperature",a.target.value)),type:"number",min:"0",max:"2",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Hgr)])]),b("div",Vgr,[e[17]||(e[17]=To(' Max New Tokens ',1)),b("div",qgr,[b("input",{id:"n_predict-range",value:n.config.n_predict,onInput:e[4]||(e[4]=a=>s.handleNumberInput("n_predict",a.target.value,!0)),type:"range",min:"32",max:"8192",step:"32",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Ugr),b("input",{id:"n_predict-number",value:n.config.n_predict,onInput:e[5]||(e[5]=a=>s.handleNumberInput("n_predict",a.target.value,!0)),type:"number",min:"32",max:"8192",step:"32",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Bgr)])]),b("div",zgr,[e[18]||(e[18]=To(' Top-K Sampling ',1)),b("div",Xgr,[b("input",{id:"top_k-range",value:n.config.top_k,onInput:e[6]||(e[6]=a=>s.handleNumberInput("top_k",a.target.value,!0)),type:"range",min:"0",max:"100",step:"1",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Fgr),b("input",{id:"top_k-number",value:n.config.top_k,onInput:e[7]||(e[7]=a=>s.handleNumberInput("top_k",a.target.value,!0)),type:"number",min:"0",max:"100",step:"1",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,jgr)])]),b("div",Ygr,[e[19]||(e[19]=To(' Top-P (Nucleus) Sampling ',1)),b("div",Ggr,[b("input",{id:"top_p-range",value:n.config.top_p,onInput:e[8]||(e[8]=a=>s.handleNumberInput("top_p",a.target.value)),type:"range",min:"0",max:"1",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,Wgr),b("input",{id:"top_p-number",value:n.config.top_p,onInput:e[9]||(e[9]=a=>s.handleNumberInput("top_p",a.target.value)),type:"number",min:"0",max:"1",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,Zgr)])]),b("div",Kgr,[e[20]||(e[20]=To(' Repeat Penalty ',1)),b("div",Jgr,[b("input",{id:"repeat_penalty-range",value:n.config.repeat_penalty,onInput:e[10]||(e[10]=a=>s.handleNumberInput("repeat_penalty",a.target.value)),type:"range",min:"0.5",max:"2.0",step:"0.01",class:"range-input flex-grow",disabled:s.isDisabled},null,40,eQr),b("input",{id:"repeat_penalty-number",value:n.config.repeat_penalty,onInput:e[11]||(e[11]=a=>s.handleNumberInput("repeat_penalty",a.target.value)),type:"number",min:"0.5",max:"2.0",step:"0.01",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,tQr)])]),b("div",nQr,[e[21]||(e[21]=To(' Repeat Penalty Lookback ',1)),b("div",rQr,[b("input",{id:"repeat_last_n-range",value:n.config.repeat_last_n,onInput:e[12]||(e[12]=a=>s.handleNumberInput("repeat_last_n",a.target.value,!0)),type:"range",min:"0",max:"512",step:"8",class:"range-input flex-grow",disabled:s.isDisabled},null,40,iQr),b("input",{id:"repeat_last_n-number",value:n.config.repeat_last_n,onInput:e[13]||(e[13]=a=>s.handleNumberInput("repeat_last_n",a.target.value,!0)),type:"number",min:"0",max:"512",step:"8",class:"input-sm w-24 text-center",disabled:s.isDisabled},null,40,sQr)])])],2)])}const aQr=st(Agr,[["render",oQr],["__scopeId","data-v-1dc5e8f0"]]);Ae.defaults.baseURL="/";const Y8={accept:"application/json","Content-Type":"application/json"},lQr={name:"SettingsView",components:{SettingsSidebar:i5r},data(){return{isLoading:!1,settingsChanged:!1,has_updates:!1,activeSection:"system_status",loading_text:"Loading settings...",editableConfig:null,sections:[{id:"system_status",name:"System Status",icon:"activity",component:rs(X5r)},{id:"main_config",name:"Main Config",icon:"sliders",component:rs(r7r)},{id:"model_config",name:"Model Parameters",icon:"cpu",component:rs(aQr)},{id:"smart_routing",name:"Smart Routing",icon:"git-branch",component:rs(_6r)},{id:"data_management",name:"Data Management",icon:"database",component:rs(V8r)},{id:"internet",name:"Internet",icon:"wifi",component:rs(lhr)},{id:"services_zoo",name:"Services Zoo",icon:"server",component:rs(h9r)},{id:"binding_zoo",name:"Bindings Zoo",icon:"link",component:rs(Qpr)},{id:"models_zoo",name:"Models Zoo",icon:"package",component:rs(vOr)},{id:"personalities_zoo",name:"Personalities Zoo",icon:"users",component:rs(kmr)},{id:"function_calls_zoo",name:"Function Calls Zoo",icon:"tool",component:rs($gr)}]}},computed:{configToEdit(){return this.editableConfig??this.$store.state.config},currentComponent(){const t=this.sections.find(e=>e.id===this.activeSection);return t?t.component:null}},methods:{deepClone(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t)){const n=[];for(let r=0;r{e&&(this.cancelConfiguration(!1),this.activeSection=t)}):this.activeSection=t},handleSettingUpdated(t){this.editableConfig||(this.editableConfig=this.deepClone(this.$store.state.config));const e=t.key.split(".");let n=this.editableConfig;try{for(;e.length>1;){const a=e.shift(),l=a.match(/^(\w+)\[(\d+)\]$/);let c=a,u=-1;if(l&&(c=l[1],u=parseInt(l[2],10)),!n||typeof n!="object"||!n.hasOwnProperty(c))throw new Error(`Invalid path segment: ${c}`);if(u!==-1){if(!Array.isArray(n[c])||u>=n[c].length)throw new Error(`Invalid array index: ${u} for key ${c}`);n=n[c][u]}else n=n[c]}const r=e[0],i=r.match(/^(\w+)\[(\d+)\]$/);let s=r,o=-1;if(i&&(s=i[1],o=parseInt(i[2],10)),typeof n!="object"||n===null)throw new Error(`Cannot set property on non-object: ${r}`);if(o!==-1){if(!n.hasOwnProperty(s)||!Array.isArray(n[s])||o>=n[s].length)throw new Error(`Invalid final array index: ${o} for key ${s}`);n[s][o]=t.value}else n[s]=t.value;this.settingsChanged=!0}catch(r){this.$store.state.toast.showToast(`Error updating setting ${t.key}: ${r.message}`,4,!1)}},async refreshConfigInView(){this.isLoading=!0,this.loading_text="Refreshing config...";try{await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModelsArr"),this.editableConfig=null,this.settingsChanged=!1,this.$store.state.toast.showToast("Configuration refreshed.",2,!0)}catch(t){this.$store.state.toast.showToast("Failed to load configuration.",4,!1),console.error("Error refreshing config or model lists:",t),this.editableConfig=null,this.settingsChanged=!1}finally{this.isLoading=!1,Fe(()=>{Re.replace()})}},async applyConfiguration(){if(!this.settingsChanged||!this.editableConfig){this.$store.state.toast.showToast("No changes to apply.",3,!1);return}this.isLoading=!0,this.loading_text="Applying settings...";let t=!1;try{const e=await Ae.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.editableConfig},{headers:Y8});e.data.status?(this.$store.state.toast.showToast("Settings applied. Refreshing...",4,!0),t=!0,await this.refreshConfigInView()):this.$store.state.toast.showToast(`Apply failed: ${e.data.error||"Error"}`,4,!1)}catch(e){this.$store.state.toast.showToast(`Error applying settings: ${e.message||e}`,4,!1)}finally{t||(this.isLoading=!1)}},cancelConfiguration(t=!0){this.editableConfig=null,this.settingsChanged=!1},async saveConfiguration(){this.isLoading=!0,this.loading_text="Saving configuration...";try{const t=await Ae.post("/save_settings",{client_id:this.$store.state.client_id},{headers:Y8});t.data.status?this.$store.state.toast.showToast("Settings saved successfully.",4,!0):this.$store.state.messageBox.showMessage(`Error saving settings: ${t.data.error||"Error"}`)}catch(t){this.$store.state.messageBox.showMessage(`Error saving settings: ${t.message}`)}finally{this.isLoading=!1,this.$store.commit("refreshBindings"),this.$store.commit("refreshModelsZoo")}},reset_configuration(){this.$store.state.yesNoDialog.askQuestion("Reset config to default? This deletes current settings.","Reset","Cancel").then(async t=>{if(t){this.isLoading=!0,this.loading_text="Resetting...";let e=!1;try{const n=await Ae.post("/reset_settings",{client_id:this.$store.state.client_id},{headers:Y8});n.data.status?(this.$store.state.messageBox.showMessage("Settings reset. Reloading..."),e=!0,setTimeout(()=>window.location.reload(),2e3)):this.$store.state.messageBox.showMessage(`Reset failed: ${n.data.error||"Error"}`)}catch(n){this.$store.state.messageBox.showMessage(`Reset failed: ${n.message}`)}finally{e||(this.isLoading=!1)}}})},async restart_program(){this.loading_text="Restarting...",this.isLoading=!0;let t=!1;try{const e=await this.api_post_req("restart_program");e.status?(this.$store.state.toast.showToast("Restarting LoLLMs...",4,!0),t=!0):this.$store.state.toast.showToast(`Restart command failed: ${e.error||"Error"}`,4,!1)}catch{}finally{t||(this.isLoading=!1)}},async clear_uploads(){this.loading_text="Clearing uploads...",this.isLoading=!0;try{const t=await this.api_get_req("clear_uploads");t.status?this.$store.state.toast.showToast("Uploads folder cleared!",4,!0):this.$store.state.toast.showToast(`Clear failed: ${t.error||"Error"}`,4,!1)}catch{}finally{this.isLoading=!1}},async update_software(){this.loading_text="Updating...",this.isLoading=!0;let t=!1;try{const e=await this.api_post_req("update_software");this.$store.state.toast.showToast("Update initiated. LoLLMs might restart.",4,!0),this.has_updates=!1,t=!0,e.status||this.$store.state.toast.showToast(`Update command sent, server reported issue: ${e.error||"Unknown"}`,4,!1)}catch{}finally{t||(this.isLoading=!1)}},async updateHasUpdates(){try{const t=await this.api_get_req("check_update");this.has_updates=(t==null?void 0:t.update_availability)||!1,Fe(()=>{Re.replace()})}catch{this.has_updates=!1}},async api_get_req(t){if(this.$store.state.api_get_req)return this.$store.state.api_get_req(t);try{return(await Ae.get(`/${t}?client_id=${this.$store.state.client_id}`)).data}catch(e){throw this.$store.state.toast.showToast(`GET Error: ${e.message}`,4,!1),e}},async api_post_req(t,e={}){if(this.$store.state.api_post_req)return this.$store.state.api_post_req(t,e);try{const n={...e,client_id:this.$store.state.client_id};return(await Ae.post(`/${t}`,n,{headers:Y8})).data}catch(n){throw this.$store.state.toast.showToast(`POST Error: ${n.message}`,4,!1),n}}},mounted(){this.refreshConfigInView(),this.updateHasUpdates(),Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},cQr={class:"flex h-screen w-screen font-sans antialiased theme-bg-primary theme-text-primary"},uQr={class:"flex-1 flex flex-col overflow-hidden"},dQr={class:"flex items-center gap-4 flex-1"},fQr={key:0,class:"flex items-center gap-2 theme-text-warning animate-pulse"},hQr={key:1,class:"flex gap-3 items-center"},pQr={key:0,class:"flex items-center gap-2"},TQr={key:1,class:"flex items-center gap-2 text-sm theme-text-muted"},OQr={class:"flex-1 overflow-x-hidden overflow-y-auto theme-scrollbar p-6"},mQr={key:1,class:"flex justify-center items-center h-full theme-text-secondary"};function gQr(t,e,n,r,i,s){const o=Xe("SettingsSidebar");return k(),R("div",cQr,[te(o,{sections:i.sections,"active-section":i.activeSection,"onUpdate:activeSection":s.setActiveSection,class:"flex-shrink-0 w-64 border-r theme-border-primary theme-bg-secondary overflow-y-auto theme-scrollbar"},null,8,["sections","active-section","onUpdate:activeSection"]),b("div",uQr,[b("div",{class:ye(["sticky top-0 z-20 flex items-center justify-between p-3 gap-3 shadow-md theme-bg-secondary theme-border-b theme-border-primary",i.isLoading?"opacity-50 pointer-events-none":""])},[b("div",dQr,[i.settingsChanged&&!i.isLoading?(k(),R("div",fQr,e[6]||(e[6]=[b("i",{"data-feather":"alert-circle",class:"w-5 h-5"},null,-1),b("span",{class:"text-sm font-medium"},"Settings have changed",-1)]))):ne("",!0),!i.settingsChanged&&!i.isLoading?(k(),R("div",hQr,[b("button",{title:"Reset configuration to default",class:"icon-button theme-text-secondary hover:theme-text-primary",onClick:e[0]||(e[0]=a=>s.reset_configuration())},e[7]||(e[7]=[b("i",{"data-feather":"refresh-ccw"},null,-1)])),b("button",{title:"Restart program",class:"icon-button theme-text-secondary hover:theme-text-primary",onClick:e[1]||(e[1]=a=>s.restart_program())},e[8]||(e[8]=[b("i",{"data-feather":"power"},null,-1)])),b("button",{title:"Clear uploads folder",class:"icon-button theme-text-secondary hover:theme-text-danger",onClick:e[2]||(e[2]=a=>s.clear_uploads())},e[9]||(e[9]=[b("i",{"data-feather":"trash-2"},null,-1)])),i.has_updates?(k(),R("button",{key:0,title:"Upgrade program",class:"icon-button theme-text-success hover:theme-text-primary relative",onClick:e[3]||(e[3]=a=>s.update_software())},e[10]||(e[10]=[b("i",{"data-feather":"arrow-up-circle"},null,-1),b("span",{class:"absolute top-0 right-0 block h-2 w-2 rounded-full theme-bg-danger ring-2 theme-ring-bg"},null,-1)]))):ne("",!0)])):ne("",!0)]),i.settingsChanged&&!i.isLoading?(k(),R("div",pQr,[b("button",{class:"flex items-center gap-2 px-3 py-1.5 rounded theme-button-success duration-150 active:scale-95",title:"Apply changes",type:"button",onClick:e[4]||(e[4]=oe(a=>s.applyConfiguration(),["stop"]))},e[11]||(e[11]=[b("span",{class:"font-medium text-sm"},"Apply",-1),b("i",{"data-feather":"check",class:"w-4 h-4"},null,-1)])),b("button",{class:"flex items-center gap-2 px-3 py-1.5 rounded theme-button-danger duration-150 active:scale-95",title:"Cancel changes",type:"button",onClick:e[5]||(e[5]=oe(a=>s.cancelConfiguration(),["stop"]))},e[12]||(e[12]=[b("span",{class:"font-medium text-sm"},"Cancel",-1),b("i",{"data-feather":"x",class:"w-4 h-4"},null,-1)]))])):ne("",!0),i.isLoading?(k(),R("div",TQr,[b("span",null,ae(i.loading_text),1),e[13]||(e[13]=b("svg",{"aria-hidden":"true",class:"w-5 h-5 animate-spin theme-spinner-color",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("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"}),b("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)),e[14]||(e[14]=b("span",{class:"sr-only"},"Loading...",-1))])):ne("",!0)],2),b("main",OQr,[s.configToEdit?(k(),Qt(t7(s.currentComponent),{key:0,config:s.configToEdit,loading:i.isLoading,onSettingUpdated:s.handleSettingUpdated,api_get_req:s.api_get_req,api_post_req:s.api_post_req,show_toast:this.$store.state.toast.showToast,show_yes_no_dialog:this.$store.state.yesNoDialog.askQuestion,show_message_box:this.$store.state.messageBox.showMessage,client_id:t.$store.state.client_id,show_universal_form:this.$store.state.universalForm.showForm},null,40,["config","loading","onSettingUpdated","api_get_req","api_post_req","show_toast","show_yes_no_dialog","show_message_box","client_id","show_universal_form"])):(k(),R("div",mQr,e[15]||(e[15]=[b("p",null,"Loading configuration...",-1)])))])])])}const QQr=st(lQr,[["render",gQr],["__scopeId","data-v-ea18b7b2"]]),_Qr={components:{ClipBoardTextInput:Eoe,Card:zC},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Ae.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])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},vQr={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},yQr={class:"mb-4"},bQr=["value"],SQr={class:"mb-4"},xQr={class:"mb-4"},EQr={class:"mb-4"},wQr={class:"mb-4"},CQr={class:"mb-4"},LQr={class:"mb-4"},$Qr={key:1};function AQr(t,e,n,r,i,s){const o=Xe("Card"),a=Xe("ClipBoardTextInput");return s.selectedModel!==null&&s.selectedModel.toLowerCase().includes("gptq")?(k(),R("div",vQr,[b("form",{onSubmit:e[2]||(e[2]=oe((...l)=>s.submitForm&&s.submitForm(...l),["prevent"])),class:""},[te(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[te(o,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[b("div",yQr,[e[3]||(e[3]=b("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),He(b("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>t.setModel&&t.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(k(!0),R(Ve,null,dt(s.models,l=>(k(),R("option",{key:l,value:l},ae(l),9,bQr))),128))],544),[[$s,s.selectedModel]])])]),_:1}),te(o,{title:"Data",isHorizontal:!1},{default:Ie(()=>[b("div",SQr,[e[4]||(e[4]=b("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1)),te(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),te(o,{title:"Training",isHorizontal:!1},{default:Ie(()=>[b("div",xQr,[e[5]||(e[5]=b("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),b("div",EQr,[e[6]||(e[6]=b("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),b("div",wQr,[e[7]||(e[7]=b("label",{for:"max_length",class:"text-sm"},"Max Length:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),b("div",CQr,[e[8]||(e[8]=b("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1)),te(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),te(o,{title:"Output",isHorizontal:!1},{default:Ie(()=>[b("div",LQr,[e[9]||(e[9]=b("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1)),te(a,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),te(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[10]||(e[10]=[b("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1)])),_:1})],32)])):(k(),R("div",$Qr,[te(o,{title:"Info",class:"",isHorizontal:!1},{default:Ie(()=>e[11]||(e[11]=[Se(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")])),_:1})]))}const kQr=st(_Qr,[["render",AQr]]),PQr={components:{ClipBoardTextInput:Eoe,Card:zC},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)}}},RQr={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"},MQr={class:"mb-4"},DQr={class:"mb-4"};function NQr(t,e,n,r,i,s){const o=Xe("ClipBoardTextInput"),a=Xe("Card");return k(),R("div",RQr,[b("form",{onSubmit:e[0]||(e[0]=oe((...l)=>s.submitForm&&s.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[te(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>[te(a,{title:"Model",class:"",isHorizontal:!1},{default:Ie(()=>[b("div",MQr,[e[1]||(e[1]=b("label",{for:"model_name",class:"text-sm"},"Model Name:",-1)),te(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),b("div",DQr,[e[2]||(e[2]=b("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1)),te(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),te(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ie(()=>e[3]||(e[3]=[b("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1)])),_:1})],32)])}const IQr=st(PQr,[["render",NQr]]),HQr={name:"WelcomeScreen",props:{isReady:{type:Boolean,required:!0},loadingProgress:{type:Number,required:!0},loadingInfos:{type:String,required:!0},versionInfo:{type:String,required:!0},interestingFacts:{type:Array,required:!0}},data(){return{randomFact:""}},computed:{...Pu(["config","theme_vars"]),appName(){var t,e;return((t=this.config)==null?void 0:t.app_custom_name)||((e=this.theme_vars)==null?void 0:e.lollms_title)||"LoLLMs"},appSlogan(){var t;return((t=this.config)==null?void 0:t.app_custom_slogan)||"One tool to rule them all"},shouldShowLollmsParagraphs(){var t;return!((t=this.config)!=null&&t.app_custom_name)},shouldShowLollmsFunFacts(){var t;return(t=this.config)==null?void 0:t.app_show_fun_facts}},methods:{updateRandomFact(){let t;if(this.interestingFacts.length<=1){this.randomFact=this.interestingFacts.length===1?this.interestingFacts[0]:"";return}do t=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)];while(t===this.randomFact);this.randomFact=t}},mounted(){this.updateRandomFact()},watch:{interestingFacts:{handler(){this.updateRandomFact()},immediate:!0}}},VQr={key:0,class:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-gradient-welcome text-blue-800 dark:text-blue-100"},qQr={key:0,class:"absolute inset-0 pointer-events-none overflow-hidden opacity-70"},UQr={class:"relative z-10 flex w-full max-w-4xl flex-col items-center px-6 text-center"},BQr={class:"mb-10 w-full"},zQr={class:"lollms-title-style mb-3 text-5xl font-extrabold tracking-tight drop-shadow-md md:text-7xl transition-transform duration-300 hover:scale-[1.03]"},XQr={class:"text-xl italic md:text-2xl text-subtitle"},FQr={key:0,class:"mt-4 text-base text-author"},jQr={class:"mt-1 text-sm text-author"},YQr={class:"text-base text-blue-800 dark:text-blue-200"},GQr=["innerHTML"],WQr={class:"w-full max-w-lg"},ZQr={class:"mb-3 h-3 w-full overflow-hidden rounded-full shadow-inner animated-progressbar-bg"},KQr={role:"status",class:"w-full"},JQr={class:"text-2xl font-semibold text-progress"};function e_r(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade-smooth"},{default:Ie(()=>[n.isReady?ne("",!0):(k(),R("div",VQr,[t.$store.state.theme_vars.activate_dropping_animation?(k(),R("div",qQr,[(k(),R(Ve,null,dt(60,o=>b("div",{key:o,class:"absolute animate-fall text-xs text-blue-300 dark:text-blue-500",style:qn({left:`${Math.random()*100}%`,top:"-30px",animationDuration:`${4+Math.random()*8}s`,animationDelay:`${Math.random()*6}s`,opacity:`${.3+Math.random()*.5}`})},ae(t.$store.state.theme_vars.falling_object||"·"),5)),64))])):ne("",!0),b("div",UQr,[b("div",BQr,[b("h1",zQr,ae(s.appName),1),b("p",XQr,ae(s.appSlogan),1),s.shouldShowLollmsParagraphs?(k(),R("p",FQr," by ParisNeo ")):ne("",!0),b("p",jQr,ae(n.versionInfo),1)]),s.shouldShowLollmsFunFacts&&i.randomFact?(k(),R("div",{key:0,class:"mb-8 w-full max-w-xl cursor-pointer rounded-lg border p-4 shadow-lg backdrop-blur-sm transition-all duration-300 card border-blue-300 dark:border-blue-600 hover:bg-blue-200 dark:hover:bg-blue-700 hover:border-blue-400 dark:hover:border-blue-500",onClick:e[0]||(e[0]=(...o)=>s.updateRandomFact&&s.updateRandomFact(...o))},[b("p",YQr,[e[1]||(e[1]=b("span",{class:"font-semibold text-blue-600 dark:text-blue-400"},"🤔 Fun Fact: ",-1)),b("span",{innerHTML:i.randomFact,class:"italic"},null,8,GQr)])])):ne("",!0),b("div",WQr,[b("div",ZQr,[b("div",{class:"h-full rounded-full shadow-md transition-all duration-500 ease-out animated-progressbar-fg",style:qn({width:`${n.loadingProgress}%`})},null,4)]),b("div",KQr,[(k(),R("p",{class:"mb-1 text-lg transition-opacity duration-300 text-loading",key:n.loadingInfos},ae(n.loadingInfos)+"... ",1)),b("p",JQr,ae(Math.round(n.loadingProgress))+"% ",1)])])])]))]),_:1})}const t_r=st(HQr,[["render",e_r]]),n_r={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked","toggle-star"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean,openfolder_enabled:Boolean,isStarred:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:"",checkBoxValue_local:!1}},computed:{confirmTitle(){return this.editTitleMode?"Confirm title change":this.makeTitleMode?"Confirm title generation":this.deleteMode?"Confirm deletion":"Confirm"}},methods:{updateFeatherIcons(){Fe(()=>{Re.replace()})},resetModes(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.editTitle=!1},cancel(){this.resetModes(),this.newTitle=this.title,this.updateFeatherIcons()},confirmAction(){this.editTitleMode?this.editTitleEvent():this.makeTitleMode?this.makeTitleEvent():this.deleteMode&&this.deleteEvent(),this.updateFeatherIcons()},deleteEvent(){this.$emit("delete"),this.resetModes()},selectEvent(){!this.showConfirmation&&!this.isCheckbox&&this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.$emit("editTitle",{title:this.newTitle,id:this.id}),this.resetModes()},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.resetModes()},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",{id:e,checked:t.target.checked}),this.checkBoxValue_local=t.target.checked},toggleStarEvent(){this.$emit("toggle-star")}},mounted(){this.newTitle=this.title,this.checkBoxValue_local=this.checkBoxValue,this.updateFeatherIcons()},watch:{showConfirmation(){this.updateFeatherIcons()},isStarred(){this.updateFeatherIcons()},isCheckbox(){this.updateFeatherIcons()},editTitleMode(t){t&&(this.showConfirmation=!0,this.editTitle=!0,this.makeTitleMode=!1,this.deleteMode=!1,this.newTitle=this.title,Fe(()=>{var e;(e=this.$refs.titleBox)==null||e.focus()})),this.updateFeatherIcons()},makeTitleMode(t){t&&(this.showConfirmation=!0,this.editTitleMode=!1,this.deleteMode=!1,this.editTitle=!1),this.updateFeatherIcons()},deleteMode(t){t&&(this.showConfirmation=!0,this.editTitleMode=!1,this.makeTitleMode=!1,this.editTitle=!1),this.updateFeatherIcons()},checkBoxValue(t){this.checkBoxValue_local!==t&&(this.checkBoxValue_local=t)},title(t){this.editTitleMode||(this.newTitle=t)}}},r_r=["id"],i_r={class:"flex flex-row items-center gap-2 flex-shrink-0"},s_r={key:0},o_r={class:"flex flex-row items-center flex-grow overflow-hidden mx-1"},a_r=["title"],l_r=["value"],c_r={class:"absolute top-0 right-0 h-full flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10"},u_r={class:"discussion-toolbox flex items-center space-x-1 bg-white dark:bg-gray-800 p-1 mr-1 rounded shadow-lg border border-gray-200 dark:border-gray-700"},d_r={key:0,class:"flex gap-1 items-center"},f_r=["title"],h_r={key:1,class:"flex gap-1 items-center"},p_r=["title"];function T_r(t,e,n,r,i,s){return k(),R("div",{class:ye([n.selected?"discussion-hilighted":"discussion","m-1 py-2 flex flex-row sm:flex-row flex-wrap flex-shrink-0 items-center rounded-md duration-75 cursor-pointer relative group w-[15rem]"]),id:"dis-"+n.id,onClick:e[14]||(e[14]=oe(o=>s.selectEvent(),["stop"]))},[b("div",i_r,[n.isCheckbox?(k(),R("div",s_r,[He(b("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 ml-1",onClick:e[0]||(e[0]=oe(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onChange:e[2]||(e[2]=o=>s.checkedChangeEvent(o,n.id))},null,544),[[W3,i.checkBoxValue_local]])])):ne("",!0),n.selected?(k(),R("div",{key:1,class:ye(["min-h-full w-1.5 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent":"bg-secondary"])},null,2)):ne("",!0),n.selected?ne("",!0):(k(),R("div",{key:2,class:ye(["w-1.5",n.loading?"min-h-full w-1.5 rounded-xl self-stretch animate-bounce bg-accent":""])},null,2))]),b("div",o_r,[i.editTitle?ne("",!0):(k(),R("p",{key:0,title:n.title,class:"line-clamp-1 w-full text-xs"},ae(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,a_r)),i.editTitle?(k(),R("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full p-1 text-xs",value:n.title,required:"",onKeydown:[e[3]||(e[3]=gr(oe(o=>s.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=gr(oe(o=>s.cancel(),["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>s.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=oe(()=>{},["stop"]))},null,40,l_r)):ne("",!0)]),b("div",c_r,[b("div",u_r,[i.showConfirmation?(k(),R("div",d_r,[b("button",{class:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900 text-red-600 dark:text-red-400 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[7]||(e[7]=oe(o=>s.cancel(),["stop"]))},e[15]||(e[15]=[b("i",{"data-feather":"x",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-green-100 dark:hover:bg-green-900 text-green-600 dark:text-green-400 duration-75 active:scale-90",title:s.confirmTitle,type:"button",onClick:e[8]||(e[8]=oe(o=>s.confirmAction(),["stop"]))},e[16]||(e[16]=[b("i",{"data-feather":"check",class:"w-4 h-4"},null,-1)]),8,f_r)])):ne("",!0),i.showConfirmation?ne("",!0):(k(),R("div",h_r,[b("button",{class:ye(["p-1 rounded duration-75 active:scale-90",n.isStarred?"text-yellow-500 hover:bg-yellow-100 dark:hover:bg-yellow-900":"text-gray-400 hover:text-yellow-500 hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-yellow-400"]),title:n.isStarred?"Unstar discussion":"Star discussion",type:"button",onClick:e[9]||(e[9]=oe(o=>s.toggleStarEvent(),["stop"]))},[b("i",{"data-feather":"star",class:ye(["w-4 h-4",{"fill-current":n.isStarred}])},null,2)],10,p_r),n.openfolder_enabled?(k(),R("button",{key:0,class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[10]||(e[10]=oe(o=>s.openFolderEvent(),["stop"]))},e[17]||(e[17]=[b("i",{"data-feather":"folder",class:"w-4 h-4"},null,-1)]))):ne("",!0),b("button",{class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Generate title",type:"button",onClick:e[11]||(e[11]=oe(o=>i.makeTitleMode=!0,["stop"]))},e[18]||(e[18]=[b("i",{"data-feather":"type",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400 hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[12]||(e[12]=oe(o=>i.editTitleMode=!0,["stop"]))},e[19]||(e[19]=[b("i",{"data-feather":"edit-2",class:"w-4 h-4"},null,-1)])),b("button",{class:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900 text-red-600 dark:text-red-400 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[13]||(e[13]=oe(o=>i.deleteMode=!0,["stop"]))},e[20]||(e[20]=[b("i",{"data-feather":"trash",class:"w-4 h-4"},null,-1)]))]))])])],10,r_r)}const Voe=st(n_r,[["render",T_r],["__scopeId","data-v-3d6bc6d8"]]),O_r="/";Ae.defaults.baseURL="/";const m_r={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:doe},data(){return{bUrl:O_r,isMounted:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},isActive(){return this.$store.state.mountedPers&&this.$store.state.config.active_personality_id===this.$store.state.config.personalities.findIndex(t=>t===this.$store.state.mountedPers.full_path)}},methods:{async handleOnTalk(){const t=this.mountedPers;if(!t){this.$store.state.toast.showToast("No personality mounted to talk with.",3,!1);return}console.log("Talking with:",t.name);try{let e=await Ae.get("/get_generation_status",{});if(e&&!e.data.status){const n=this.$store.state.config.personalities.findIndex(r=>r===t.full_path);if(n!==this.$store.state.config.active_personality_id){const r={client_id:this.$store.state.client_id,id:n};let i=await Ae.post("/select_personality",r);if(!i.data.status){console.error("Failed to select personality before talking:",i.data.error),this.$store.state.toast.showToast(`Error selecting ${t.name}: ${i.data.error}`,4,!1);return}this.$store.commit("setActivePersonalityId",n),this.$store.commit("setMountedPers",this.$store.state.personalities_infos[n])}console.log("Requesting generation from:",t.name),et.emit("generate_msg_from",{id:n})}else e?(console.log("Already generating"),this.$store.state.toast.showToast("Generation is already in progress.",3,!1)):(console.error("Could not get generation status."),this.$store.state.toast.showToast("Error checking generation status.",4,!1))}catch(e){console.error("Error during handleOnTalk:",e),this.$store.state.toast.showToast(`Error initiating talk: ${e.message}`,4,!1)}finally{}},async remount_personality(){var e;const t=this.mountedPers;if(!t)return this.$store.state.toast.showToast("No personality mounted to remount.",3,!1),{status:!1,error:"no personality selected"};console.log("Remounting personality ",t.name),this.$store.state.toast.showToast(`Remounting ${t.name}...`,4,!0);try{const n={client_id:this.$store.state.client_id,category:t.category,folder:t.folder,language:t.language},r=await Ae.post("/remount_personality",n);if(r&&r.data.status)return console.log("Personality remounted successfully:",r.data),this.$store.state.toast.showToast(`${t.name} remounted successfully!`,4,!0),this.$store.dispatch("refreshPersonalityData"),r.data;{const i=((e=r==null?void 0:r.data)==null?void 0:e.error)||"Unknown error";return console.error("Failed remount_personality:",i),this.$store.state.toast.showToast(`Failed to remount ${t.name}: ${i}`,4,!1),(r==null?void 0:r.data)||{status:!1,error:i}}}catch(n){return console.error("Error during remount_personality:",n),this.$store.state.toast.showToast(`Error remounting: ${n.message}`,4,!1),{status:!1,error:n.message}}},async onSettingsPersonality(t){var e;if(!t){this.$store.state.toast.showToast("No personality selected for settings.",3,!1);return}console.log("Opening settings for:",t.name);try{const n=this.$store.state.config.personalities.findIndex(i=>i===t.full_path);if(n!==this.$store.state.config.active_personality_id){const i={client_id:this.$store.state.client_id,id:n};let s=await Ae.post("/select_personality",i);if(!s.data.status){console.error("Failed to select personality before opening settings:",s.data.error),this.$store.state.toast.showToast(`Error selecting ${t.name} for settings: ${s.data.error}`,4,!1);return}this.$store.commit("setActivePersonalityId",n),this.$store.commit("setMountedPers",this.$store.state.personalities_infos[n]),await Fe()}const r=await Ae.get("/get_active_personality_settings");if(r&&r.data&&Object.keys(r.data).length>0){console.log("Personality settings data:",r.data);const i=await this.$refs.universalForm.showForm(r.data,`Settings - ${t.name}`,"Save changes","Cancel");if(i){console.log("Saving new settings:",i);try{const s=await Ae.post("/set_active_personality_settings",i);if(s&&s.data&&s.data.status)console.log("Settings saved successfully:",s.data),this.$store.state.toast.showToast("Personality settings updated successfully!",4,!0);else{const o=((e=s==null?void 0:s.data)==null?void 0:e.error)||"Unknown error saving settings.";console.error("Failed to save settings:",o),this.$store.state.toast.showToast(`Failed to save settings: ${o}`,4,!1)}}catch(s){console.error("Error saving personality settings:",s),this.$store.state.toast.showToast(`Error saving settings: ${s.message}`,4,!1)}}else console.log("Settings editing cancelled.")}else r&&r.data&&Object.keys(r.data).length===0?this.$store.state.toast.showToast(`${t.name} has no configurable settings.`,4,!1):(console.error("Could not get personality settings response:",r),this.$store.state.toast.showToast("Failed to retrieve personality settings.",4,!1))}catch(n){console.error("Error fetching/showing personality settings:",n),this.$store.state.toast.showToast(`Could not open settings: ${n.message}`,4,!1)}},async constructor(){for(Fe(()=>{Re.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady&&this.onReady()},personalityImgPlacehodler(t){t.target.src=Mh}}},g_r={class:"relative group/item"},Q_r=["title"],__r=["src","alt"],v_r={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 w-auto flex items-center justify-center space-x-1 opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-2 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 z-10"};function y_r(t,e,n,r,i,s){const o=Xe("UniversalForm");return k(),R(Ve,null,[b("div",g_r,[b("button",{onClick:e[1]||(e[1]=oe(a=>s.onSettingsPersonality(s.mountedPers),["prevent"])),class:ye(["w-6 h-6 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none relative",{"glow-effect":t.$store.state.config.activate_skills_lib,"border-2 border-primary":s.isActive}]),title:"Configure "+s.mountedPers.name},[b("img",{src:s.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>s.personalityImgPlacehodler&&s.personalityImgPlacehodler(...a)),alt:s.mountedPers.name,class:"w-full h-full object-cover"},null,40,__r)],10,Q_r),b("div",v_r,[b("button",{onClick:e[2]||(e[2]=oe(a=>s.onSettingsPersonality(s.mountedPers),["prevent"])),class:"p-1 btn-secondary btn-xs rounded-full hover:scale-110 transition-transform duration-150",title:"Configure"},e[5]||(e[5]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826 3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),b("button",{onClick:e[3]||(e[3]=oe(a=>s.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none btn-xs hover:scale-110 transition-transform duration-150",title:"Remount"},e[6]||(e[6]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),b("button",{onClick:e[4]||(e[4]=oe(a=>s.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none btn-xs hover:scale-110 transition-transform duration-150",title:"Talk"},e[7]||(e[7]=[b("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)]))])]),te(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const b_r=st(m_r,[["render",y_r],["__scopeId","data-v-5f8375f1"]]),S_r={name:"HoverMenu",props:{items:{type:Array,required:!0},isActive:{type:Function,default:()=>!1},itemKeyExtractor:{type:Function,default:t=>t.id||t.name},itemNameExtractor:{type:Function,default:t=>t.name},itemIconExtractor:{type:Function,required:!0},placeholderIcon:{type:String,required:!0},searchPlaceholder:{type:String,default:"Search..."},menuWidthClass:{type:String,default:"w-80"},gridLayoutClass:{type:String,default:"grid grid-cols-3 gap-x-4 gap-y-4"},activeItemClass:{type:String,default:"border-blue-500 dark:border-sky-500"}},emits:["select-item"],data(){return{isMenuVisible:!1,searchQuery:"",hideMenuTimeout:null}},computed:{filteredItems(){const t=this.searchQuery.toLowerCase().trim();return t?this.items.filter(e=>{var n;return(n=this.getItemName(e))==null?void 0:n.toLowerCase().includes(t)}):this.items}},methods:{getItemKey(t){return this.itemKeyExtractor(t)},getItemName(t){return this.itemNameExtractor(t)},getItemIcon(t){return this.itemIconExtractor(t)||this.placeholderIcon},showMenu(){clearTimeout(this.hideMenuTimeout),this.isMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideMenu(){this.hideMenuTimeout=setTimeout(()=>{this.isMenuVisible=!1},300)},selectItem(t){this.$emit("select-item",t)}},mounted(){Fe(()=>Re.replace())},updated(){this.isMenuVisible&&Fe(()=>Re.replace())}},x_r={class:"p-2 border-b border-blue-200 dark:border-slate-700"},E_r=["placeholder"],w_r=["onClick","title"],C_r=["src","alt"],L_r={class:"animated-thought-bubble text-center"},$_r=["onClick"],A_r={key:0,class:"col-span-full text-center text-gray-500 dark:text-gray-400 py-4"};function k_r(t,e,n,r,i,s){return k(),R("div",{class:"relative",onMouseleave:e[3]||(e[3]=(...o)=>s.hideMenu&&s.hideMenu(...o))},[b("div",{onMouseenter:e[0]||(e[0]=(...o)=>s.showMenu&&s.showMenu(...o)),class:"hover-trigger flex items-center justify-center w-8 h-8"},[er(t.$slots,"trigger",{},void 0,!0)],32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[2]||(e[2]=(...o)=>s.showMenu&&s.showMenu(...o)),class:ye(["absolute top-full left-0 mt-1 z-50 transform panels-color rounded-md shadow-lg ring-1 ring-blue-300 dark:ring-slate-700 ring-opacity-50 focus:outline-none",n.menuWidthClass])},[b("div",x_r,[He(b("input",{type:"text","onUpdate:modelValue":e[1]||(e[1]=o=>i.searchQuery=o),placeholder:n.searchPlaceholder,class:"w-full input input-sm"},null,8,E_r),[[vt,i.searchQuery]])]),b("div",{class:ye(["px-4 py-3 pb-10 max-h-80 overflow-y-auto scrollbar",n.gridLayoutClass])},[(k(!0),R(Ve,null,dt(s.filteredItems,o=>(k(),R("div",{key:s.getItemKey(o),class:"relative group/item flex flex-col items-center"},[b("button",{onClick:oe(a=>s.selectItem(o),["prevent"]),title:s.getItemName(o),class:ye(["w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none border-2 mb-1",n.isActive(o)?n.activeItemClass:"border-transparent hover:border-blue-300 dark:hover:border-slate-600"])},[b("img",{src:s.getItemIcon(o),alt:s.getItemName(o),class:"w-full h-full object-cover"},null,8,C_r)],10,w_r),b("div",L_r,[b("span",{class:"text-xs font-medium mb-1 block cursor-pointer",onClick:oe(a=>s.selectItem(o),["prevent"])},ae(s.getItemName(o)),9,$_r),er(t.$slots,"item-actions",{item:o},void 0,!0)])]))),128)),s.filteredItems.length===0?(k(),R("div",A_r," No items found. ")):ne("",!0)],2)],34),[[mr,i.isMenuVisible]])]),_:3})],32)}const P_r=st(S_r,[["render",k_r],["__scopeId","data-v-9178f2bc"]]),R_r={name:"Toolbar",components:{MountedPersonalities:b_r,HoverMenu:P_r},props:{loading:Boolean,isCheckbox:Boolean},emits:["create-new-discussion","add-discussion-to-skills-library","toggle-skills-lib","show-skills-lib","toggle-edit-mode","reset-database","export-database","import-discussions","import-discussions-bundle","show-model-config","set-binding","copy-model-name","set-model","personality-selected","unmount-personality","remount-personality","talk-personality","personalities-ready","show-personality-list"],data(){return{isSkillsLibraryMenuVisible:!1,isMainMenuVisible:!1,modelImgPlaceholder:F9,hideMainMenuTimeout:null,hideSkillsLibraryMenuTimeout:null}},computed:{...Pu(["config","installedBindings","installedModels","mountedPersArr"]),...oE(["getCurrentBinding","getCurrentModel"]),currentBinding(){return this.getCurrentBinding||{name:"unknown",icon:this.modelImgPlaceholder}},currentModel(){return this.getCurrentModel||{name:"unknown",icon:this.modelImgPlaceholder}},currentBindingName(){var t;return(t=this.currentBinding)==null?void 0:t.name},currentModelName(){var t;return(t=this.currentModel)==null?void 0:t.name},currentBindingIcon(){var t;return((t=this.currentBinding)==null?void 0:t.icon)||this.modelImgPlaceholder},currentModelIcon(){var t;return((t=this.currentModel)==null?void 0:t.icon)||this.modelImgPlaceholder},activePersonalityId(){var t;return(t=this.$store.state.config)==null?void 0:t.active_personality_id},configPersonalities(){var t;return((t=this.$store.state.config)==null?void 0:t.personalities)||[]}},methods:{isActivePersonality(t){if(this.activePersonalityId===void 0||this.activePersonalityId<0||this.activePersonalityId>=this.configPersonalities.length||!(t!=null&&t.full_path))return!1;const e=this.configPersonalities[this.activePersonalityId];return t.full_path===e||t.full_path===(e==null?void 0:e.split(":")[0])},onPersonalitiesReadyFun(){this.$emit("personalities-ready")},onShowPersListFun(){this.$emit("show-personality-list")},triggerFileDialog(t){this.$refs[t]&&(this.$refs[t].value=null,this.$refs[t].click())},showSkillsLibraryMenu(){clearTimeout(this.hideSkillsLibraryMenuTimeout),this.isSkillsLibraryMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideSkillsLibraryMenu(){this.hideSkillsLibraryMenuTimeout=setTimeout(()=>{this.isSkillsLibraryMenuVisible=!1},300)},showMainMenu(){clearTimeout(this.hideMainMenuTimeout),this.isMainMenuVisible=!0,this.$nextTick(()=>Re.replace())},hideMainMenu(){this.hideMainMenuTimeout=setTimeout(()=>{this.isMainMenuVisible=!1},300)}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},M_r={class:"toolbar-color flex items-center p-1 justify-around"},D_r={key:0,class:"toolbar-container flex items-center gap-1 relative"},N_r={class:"relative"},I_r={class:"relative"},H_r=["title"],V_r=["src","alt"],q_r={class:"flex space-x-1 justify-center"},U_r=["onClick"],B_r=["title"],z_r=["src","alt"],X_r={class:"flex space-x-1 justify-center"},F_r=["onClick"],j_r={class:"personalities-hover-area flex items-center justify-center w-8 h-8"},Y_r={class:"flex space-x-1 justify-center"},G_r=["onClick"],W_r=["onClick"],Z_r=["onClick"],K_r={key:1,class:"flex items-center justify-center w-full h-10"};function J_r(t,e,n,r,i,s){const o=Xe("HoverMenu"),a=Xe("MountedPersonalities");return k(),R("div",M_r,[n.loading?(k(),R("div",K_r,e[40]||(e[40]=[b("div",{class:"text-gray-500"},"Buzzy...",-1)]))):(k(),R("div",D_r,[b("button",{class:"toolbar-button svg-button",title:"Create new discussion",onClick:e[0]||(e[0]=l=>t.$emit("create-new-discussion"))},e[23]||(e[23]=[b("i",{"data-feather":"plus",class:"w-5 h-5"},null,-1)])),n.loading?ne("",!0):(k(),R("div",{key:0,class:"relative",onMouseleave:e[7]||(e[7]=(...l)=>s.hideSkillsLibraryMenu&&s.hideSkillsLibraryMenu(...l))},[b("div",{onMouseenter:e[1]||(e[1]=(...l)=>s.showSkillsLibraryMenu&&s.showSkillsLibraryMenu(...l)),class:"menu-hover-area flex items-center justify-center w-8 h-8"},e[24]||(e[24]=[b("button",{class:"toolbar-button svg-button",title:"Toggle Skills library menu"},[b("svg",{class:"w-5 h-5",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[b("path",{d:"M4 4v16h16V4H4zm2 2h12v12H6V6zm2 2h2v8H8V8zm3 0h2v8h-2V8zm3 0h2v8h-2V8z",fill:"currentColor"})])],-1)]),32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[6]||(e[6]=(...l)=>s.showSkillsLibraryMenu&&s.showSkillsLibraryMenu(...l)),class:"absolute top-full left-0 mt-1 z-50 transform card p-1 flex flex-wrap gap-1 items-center shadow-lg w-auto min-w-[10rem]"},[b("button",{type:"button",onClick:e[2]||(e[2]=oe(l=>t.$emit("add-discussion-to-skills-library"),["stop"])),title:"Add this discussion content to skills database",class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[25]||(e[25]=[b("i",{"data-feather":"plus",class:"w-5 h-5"},null,-1)])),t.$store.state.config.activate_skills_lib?(k(),R("button",{key:0,type:"button",onClick:e[3]||(e[3]=oe(l=>t.$emit("toggle-skills-lib"),["stop"])),title:"Skills database is activated",class:"svg-button text-green-500 hover:text-green-700 dark:text-green-400 dark:hover:text-green-200"},e[26]||(e[26]=[b("i",{"data-feather":"check-circle",class:"w-5 h-5"},null,-1)]))):(k(),R("button",{key:1,type:"button",onClick:e[4]||(e[4]=oe(l=>t.$emit("toggle-skills-lib"),["stop"])),title:"Skills database is deactivated",class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200"},e[27]||(e[27]=[b("i",{"data-feather":"x-octagon",class:"w-5 h-5"},null,-1)]))),b("button",{type:"button",onClick:e[5]||(e[5]=oe(l=>t.$emit("show-skills-lib"),["stop"])),title:"Show Skills database",class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[28]||(e[28]=[b("i",{"data-feather":"book",class:"w-5 h-5"},null,-1)]))],544),[[mr,i.isSkillsLibraryMenuVisible]])]),_:1})],32)),n.loading?ne("",!0):(k(),R("div",{key:1,class:"relative",onMouseleave:e[17]||(e[17]=(...l)=>s.hideMainMenu&&s.hideMainMenu(...l))},[b("div",{onMouseenter:e[8]||(e[8]=(...l)=>s.showMainMenu&&s.showMainMenu(...l)),class:"menu-hover-area flex items-center justify-center w-8 h-8"},e[29]||(e[29]=[b("button",{class:"toolbar-button svg-button",title:"Toggle menu"},[b("i",{"data-feather":"menu",class:"w-5 h-5"})],-1)]),32),te(cr,{name:"fade-and-fly"},{default:Ie(()=>[He(b("div",{onMouseenter:e[16]||(e[16]=(...l)=>s.showMainMenu&&s.showMainMenu(...l)),class:"absolute top-full left-0 mt-1 z-50 transform card p-1 flex flex-wrap gap-1 items-center shadow-lg w-auto min-w-[10rem]"},[b("button",{class:ye(["svg-button",n.isCheckbox?"text-blue-600 dark:text-sky-400 bg-blue-200 dark:bg-slate-700":"text-gray-600 dark:text-gray-300"]),title:"Edit discussion list",type:"button",onClick:e[9]||(e[9]=l=>t.$emit("toggle-edit-mode"))},e[30]||(e[30]=[b("i",{"data-feather":"check-square",class:"w-5 h-5"},null,-1)]),2),b("button",{class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Reset database, remove all discussions",onClick:e[10]||(e[10]=oe(l=>t.$emit("reset-database"),["stop"]))},e[31]||(e[31]=[b("i",{"data-feather":"trash-2",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300",title:"Export database",type:"button",onClick:e[11]||(e[11]=oe(l=>t.$emit("export-database"),["stop"]))},e[32]||(e[32]=[b("i",{"data-feather":"database",class:"w-5 h-5"},null,-1)])),b("div",N_r,[b("input",{type:"file",ref:"fileDialog",class:"hidden",onChange:e[12]||(e[12]=l=>t.$emit("import-discussions",l)),accept:".json, .yaml, .yml"},null,544),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300 rotate-90",title:"Import discussions",type:"button",onClick:e[13]||(e[13]=oe(l=>s.triggerFileDialog("fileDialog"),["stop"]))},e[33]||(e[33]=[b("i",{"data-feather":"log-in",class:"w-5 h-5"},null,-1)]))]),b("div",I_r,[b("input",{type:"file",ref:"bundleLoadingDialog",class:"hidden",onChange:e[14]||(e[14]=l=>t.$emit("import-discussions-bundle",l)),accept:".zip"},null,544),b("button",{title:"Import discussion bundle",onClick:e[15]||(e[15]=oe(l=>s.triggerFileDialog("bundleLoadingDialog"),["stop"])),class:"svg-button text-blue-600 hover:text-blue-800 dark:text-sky-400 dark:hover:text-sky-300"},e[34]||(e[34]=[b("i",{"data-feather":"folder",class:"w-5 h-5"},null,-1)]))])],544),[[mr,i.isMainMenuVisible]])]),_:1})],32)),!n.loading&&t.installedBindings.length>0?(k(),Qt(o,{key:2,items:t.installedBindings,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.icon,"is-active":l=>l.name===s.currentBindingName,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search bindings...",onSelectItem:e[19]||(e[19]=l=>t.$emit("set-binding",l))},{trigger:Ie(()=>[b("button",{onClick:e[18]||(e[18]=oe(l=>t.$emit("show-model-config",null),["prevent"])),class:"w-6 h-6 block",title:s.currentBinding?s.currentBinding.name:"unknown"},[b("img",{src:s.currentBindingIcon,class:"w-full h-full rounded-full object-cover border-2 border-blue-300 dark:border-slate-600 active:scale-90 hover:border-blue-500 dark:hover:border-sky-400 hover:scale-110 hover:-translate-y-1 duration-200 transition-transform",alt:s.currentBinding?s.currentBinding.name:"Binding icon"},null,8,V_r)],8,H_r)]),"item-actions":Ie(({item:l})=>[b("div",q_r,[b("button",{onClick:oe(c=>t.$emit("show-model-config",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Configure Binding"},e[35]||(e[35]=[b("i",{"data-feather":"settings",class:"w-3 h-3"},null,-1)]),8,U_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","is-active","placeholder-icon"])):ne("",!0),!n.loading&&t.installedModels.length>0?(k(),Qt(o,{key:3,items:t.installedModels,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.icon,"is-active":l=>l.name===s.currentModelName,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search models...",onSelectItem:e[21]||(e[21]=l=>t.$emit("set-model",l))},{trigger:Ie(()=>[b("button",{onClick:e[20]||(e[20]=oe(l=>t.$emit("copy-model-name",null),["prevent"])),class:"w-6 h-6 block",title:s.currentModel?s.currentModel.name:"unknown"},[b("img",{src:s.currentModelIcon,class:"w-full h-full rounded-full object-cover border-2 border-blue-300 dark:border-slate-600 active:scale-90 hover:border-blue-500 dark:hover:border-sky-400 hover:scale-110 hover:-translate-y-1 duration-200 transition-transform",alt:s.currentModel?s.currentModel.name:"Model icon"},null,8,z_r)],8,B_r)]),"item-actions":Ie(({item:l})=>[b("div",X_r,[b("button",{onClick:oe(c=>t.$emit("copy-model-name",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Copy Model Name"},e[36]||(e[36]=[b("i",{"data-feather":"copy",class:"w-3 h-3"},null,-1)]),8,F_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","is-active","placeholder-icon"])):ne("",!0),!n.loading&&t.mountedPersArr.length>0?(k(),Qt(o,{key:4,items:t.mountedPersArr,"item-name-extractor":l=>l.name,"item-icon-extractor":l=>l.avatar,"item-key-extractor":l=>l.full_path||l.name,"is-active":s.isActivePersonality,"placeholder-icon":i.modelImgPlaceholder,"search-placeholder":"Search personalities...",onSelectItem:e[22]||(e[22]=l=>t.$emit("personality-selected",l))},{trigger:Ie(()=>[b("div",j_r,[te(a,{ref:"mountedPers",onShowPersList:s.onShowPersListFun,onReady:s.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])]),"item-actions":Ie(({item:l})=>[b("div",Y_r,[b("button",{onClick:oe(c=>t.$emit("unmount-personality",l),["prevent"]),class:"p-1 bg-red-500 rounded-full text-white hover:bg-red-600 focus:outline-none btn-sm hover:scale-110 transition-transform duration-150",title:"Unmount"},e[37]||(e[37]=[b("i",{"data-feather":"x",class:"w-3 h-3"},null,-1)]),8,G_r),b("button",{onClick:oe(c=>t.$emit("remount-personality",l),["prevent"]),class:"p-1 btn-secondary btn-sm rounded-full hover:scale-110 transition-transform duration-150",title:"Remount"},e[38]||(e[38]=[b("i",{"data-feather":"refresh-cw",class:"w-3 h-3"},null,-1)]),8,W_r),b("button",{onClick:oe(c=>t.$emit("talk-personality",l),["prevent"]),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none btn-sm hover:scale-110 transition-transform duration-150",title:"Talk"},e[39]||(e[39]=[b("i",{"data-feather":"message-square",class:"w-3 h-3"},null,-1)]),8,Z_r)])]),_:1},8,["items","item-name-extractor","item-icon-extractor","item-key-extractor","is-active","placeholder-icon"])):ne("",!0)]))])}const evr=st(R_r,[["render",J_r],["__scopeId","data-v-66615957"]]),tvr=t=>{const e=new Date;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()},nvr=t=>{const e=new Date;return e.setDate(e.getDate()-1),t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()},rvr={name:"LeftPanel",components:{Discussion:Voe,RouterLink:t9,Toolbar:evr},props:{showLeftPanel:Boolean,discussionsList:Array,currentDiscussion:Object,toolbarLoading:Boolean,formattedDatabaseName:String},emits:["select-discussion","delete-discussion","open-folder","edit-title","make-title","create-new-discussion","add-discussion-to-skills-library","toggle-skills-lib","show-skills-lib","reset-database","export-database","import-discussions","import-discussions-bundle","show-model-config","set-binding","copy-model-name","set-model","personality-selected","unmount-personality","remount-personality","talk-personality","personalities-ready","show-personality-list","delete-selected","export-discussions-as-json","export-discussions-to-folder","export-discussions-as-markdown","show-database-selector","import-discussion-file","toggle-star-discussion"],data(){return{filterTitle:"",filterInProgress:!1,isCheckbox:!1,showConfirmation:!1,isDragOverDiscussion:!1,searchTimeout:null,localDiscussionsState:[],sortBy:"date",sortOrder:"desc",collapsedSections:{starred:!1,today:!1,yesterday:!0,older:!0}}},computed:{...Pu(["config","theme_vars"]),...oE(["getStarredDiscussionsSet"]),logoSrc(){var t;return(t=this.config)!=null&&t.app_custom_logo?`/user_infos/${this.config.app_custom_logo}`:Eo},logoTitle(){var t;return((t=this.config)==null?void 0:t.app_custom_name)||"LoLLMs WebUI"},appName(){var t;return((t=this.config)==null?void 0:t.app_custom_name)||"LoLLMS WebUI"},appSlogan(){var t;return((t=this.config)==null?void 0:t.app_custom_slogan)||"One tool to rule them all"},starredSet(){return this.getStarredDiscussionsSet||new Set},sortIcon(){return this.sortOrder==="asc"?"arrow-up":"arrow-down"},sortByLabel(){return{date:"Date",title:"Title"}[this.sortBy]||"Date"},enhancedDiscussions(){return(this.discussionsList||[]).map(t=>{const e=this.localDiscussionsState.find(r=>r.id===t.id),n=t.created_at?new Date(t.created_at):new Date(0);return{...t,checkBoxValue:e?e.checkBoxValue:!1,isStarred:this.starredSet.has(String(t.id)),creationDate:n}})},filteredDiscussions(){if(!this.filterTitle.trim())return this.enhancedDiscussions;const t=this.filterTitle.toLowerCase();return this.enhancedDiscussions.filter(e=>e.title&&e.title.toLowerCase().includes(t))},groupedDiscussions(){const t=[],e=[],n=[],r=[];this.enhancedDiscussions.filter(a=>{if(!this.filterTitle.trim())return!0;const l=this.filterTitle.toLowerCase();return a.title&&a.title.toLowerCase().includes(l)}).forEach(a=>{if(a.isStarred)t.push(a);else{const l=a.creationDate;tvr(l)?e.push(a):nvr(l)?n.push(a):r.push(a)}});const s=(a,l)=>{let c=0;this.sortBy==="date"?c=l.creationDate-a.creationDate:this.sortBy==="title"&&(c=(a.title||"").localeCompare(l.title||""));const u=this.sortBy==="date"&&this.sortOrder==="asc"||this.sortBy==="title"&&this.sortOrder==="desc"?-1:1;return c*u};t.sort(s),e.sort(s),n.sort(s),r.sort(s);const o=[];return t.length>0&&(o.push({type:"header",label:"Starred",key:"starred",collapsed:this.collapsedSections.starred}),this.collapsedSections.starred||t.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),e.length>0&&(o.push({type:"header",label:"Today",key:"today",collapsed:this.collapsedSections.today}),this.collapsedSections.today||e.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),n.length>0&&(o.push({type:"header",label:"Yesterday",key:"yesterday",collapsed:this.collapsedSections.yesterday}),this.collapsedSections.yesterday||n.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),r.length>0&&(o.push({type:"header",label:"Older",key:"older",collapsed:this.collapsedSections.older}),this.collapsedSections.older||r.forEach(a=>o.push({type:"discussion",data:a,key:`disc-${a.id}`}))),o},selectedDiscussions(){return this.filteredDiscussions.filter(t=>{const e=this.localDiscussionsState.find(n=>n.id===t.id);return e&&e.checkBoxValue})},isAllSelected(){const t=this.filteredDiscussions;if(t.length===0)return!1;const e=new Set(this.selectedDiscussions.map(n=>n.id));return t.every(n=>e.has(n.id))}},methods:{toggleSection(t){t in this.collapsedSections&&(this.collapsedSections[t]=!this.collapsedSections[t],this.$nextTick(()=>Re.replace()))},handleSearchInput(){this.filterInProgress=!0,clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.filterInProgress=!1,this.$nextTick(()=>Re.replace())},300)},cycleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc",this.$nextTick(()=>Re.replace())},cycleSortBy(){this.sortBy=this.sortBy==="date"?"title":"date",this.$nextTick(()=>Re.replace())},selectDiscussion(t){this.toolbarLoading||this.filterInProgress||this.$emit("select-discussion",t)},deleteDiscussion(t){this.localDiscussionsState=this.localDiscussionsState.filter(e=>e.id!==t.id),this.$emit("delete-discussion",t.id)},checkUncheckDiscussion({id:t,checked:e}){const n=this.localDiscussionsState.findIndex(r=>r.id===t);n!==-1?this.localDiscussionsState[n].checkBoxValue=e:this.discussionsList.some(r=>r.id===t)&&this.localDiscussionsState.push({id:t,checkBoxValue:e})},selectAllDiscussions(){const t=!this.isAllSelected,e=new Set(this.filteredDiscussions.map(n=>n.id));this.enhancedDiscussions.forEach(n=>{if(e.has(n.id)){const r=this.localDiscussionsState.findIndex(i=>i.id===n.id);r!==-1?this.localDiscussionsState[r].checkBoxValue=t:t&&this.localDiscussionsState.push({id:n.id,checkBoxValue:t})}}),this.$nextTick(()=>Re.replace())},deleteSelectedDiscussions(){const t=this.selectedDiscussions.map(e=>e.id);this.localDiscussionsState=this.localDiscussionsState.filter(e=>!t.includes(e.id)),this.$emit("delete-selected",t),this.showConfirmation=!1,this.isCheckbox=!1},handleDrop(t){this.isDragOverDiscussion=!1;const e=t.dataTransfer.files;e.length===1&&e[0].type==="application/json"?this.$emit("import-discussion-file",e[0]):alert("Please drop a single JSON file to import.")},toggleStarDiscussion(t){this.$emit("toggle-star-discussion",t)},toggleStarSelectedDiscussions(){const t=this.selectedDiscussions;if(t.length===0)return;const e=t.length>0?!t[0].isStarred:!0;t.forEach(n=>{n.isStarred!==e&&this.toggleStarDiscussion(n)})},syncLocalState(t){const e=new Set((t||[]).map(r=>r.id)),n=this.localDiscussionsState.filter(r=>e.has(r.id));(t||[]).forEach(r=>{n.some(i=>i.id===r.id)||n.push({id:r.id,checkBoxValue:!1})}),this.localDiscussionsState=n}},watch:{discussionsList:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&this.syncLocalState(t),this.$nextTick(()=>Re.replace())},immediate:!0,deep:!0},isCheckbox(t){this.$nextTick(()=>Re.replace()),t||(this.showConfirmation=!1)},showConfirmation(){this.$nextTick(()=>Re.replace())},filterTitle(){},sortBy(){this.$nextTick(()=>Re.replace())},sortOrder(){this.$nextTick(()=>Re.replace())}},mounted(){this.syncLocalState(this.discussionsList),Fe(()=>{Re.replace()})},updated(){}},ivr={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-[16rem] panels-color scrollbar h-full"},svr={class:"logo-container w-12 h-12 flex-shrink-0"},ovr=["src","title"],avr={class:"flex flex-col justify-center overflow-hidden"},lvr={class:"text-left p-1"},cvr={class:"text-md relative inline-block"},uvr={class:"relative inline-block font-bold tracking-wide text-blue-800 dark:text-blue-100 text-gradient-title truncate"},dvr={class:"text-blue-600 dark:text-blue-400 text-sm text-subtitle truncate"},fvr={class:"w-full max-w-md mx-auto p-2 border-b border-blue-100 dark:border-blue-800"},hvr={class:"flex items-center space-x-1"},pvr={class:"relative flex-grow"},Tvr=["title"],Ovr=["data-feather"],mvr=["title"],gvr=["data-feather"],Qvr={key:0,class:"w-full p-2 bg-blue-100 dark:bg-blue-900 border-b border-blue-200 dark:border-blue-700"},_vr={class:"flex flex-col space-y-1"},vvr={key:0,class:"text-sm text-blue-700 dark:text-blue-200"},yvr={key:1,class:"flex space-x-1 items-center"},bvr={key:1,class:"flex space-x-1 items-center"},Svr={class:"flex space-x-1 items-center"},xvr=["data-feather"],Evr={class:"relative flex flex-col flex-grow mb-10 z-0 w-full"},wvr=["onClick"],Cvr=["data-feather"],Lvr={key:0,class:"p-4 text-center text-blue-600 dark:text-blue-400"},$vr={key:0,class:"text-sm"},Avr={key:1,class:"p-4 text-center text-blue-500 dark:text-blue-400"},kvr={class:"flex flex-row items-center justify-center border-t border-blue-200 dark:border-blue-700 p-1"},Pvr={class:"text-center font-semibold text-xs drop-shadow-md align-middle text-blue-700 dark:text-blue-300 truncate"};function Rvr(t,e,n,r,i,s){const o=Xe("RouterLink"),a=Xe("Toolbar"),l=Xe("Discussion");return k(),Qt(cr,{name:"slide-right"},{default:Ie(()=>[n.showLeftPanel?(k(),R("div",ivr,[te(o,{to:{name:"discussions"},class:"flex items-center space-x-2 p-2 border-b border-blue-200 dark:border-blue-700 hover:bg-blue-50 dark:hover:bg-blue-800 transition duration-150 ease-in-out"},{default:Ie(()=>[b("div",svr,[b("img",{class:"w-full h-full rounded-full object-cover logo-image border-2 border-blue-300 dark:border-blue-600 shadow-sm",src:s.logoSrc,alt:"Logo",title:s.logoTitle},null,8,ovr)]),b("div",avr,[b("div",lvr,[b("div",cvr,[b("span",uvr,ae(s.appName),1)])]),b("p",dvr,ae(s.appSlogan),1)])]),_:1}),te(a,{loading:n.toolbarLoading,"is-checkbox":i.isCheckbox,onCreateNewDiscussion:e[0]||(e[0]=c=>t.$emit("create-new-discussion")),onAddDiscussionToSkillsLibrary:e[1]||(e[1]=c=>t.$emit("add-discussion-to-skills-library")),onToggleSkillsLib:e[2]||(e[2]=c=>t.$emit("toggle-skills-lib")),onShowSkillsLib:e[3]||(e[3]=c=>t.$emit("show-skills-lib")),onToggleEditMode:e[4]||(e[4]=c=>i.isCheckbox=!i.isCheckbox),onResetDatabase:e[5]||(e[5]=c=>t.$emit("reset-database")),onExportDatabase:e[6]||(e[6]=c=>t.$emit("export-database")),onImportDiscussions:e[7]||(e[7]=c=>t.$emit("import-discussions",c)),onImportDiscussionsBundle:e[8]||(e[8]=c=>t.$emit("import-discussions-bundle",c)),onShowModelConfig:e[9]||(e[9]=c=>t.$emit("show-model-config",c)),onSetBinding:e[10]||(e[10]=c=>t.$emit("set-binding",c)),onCopyModelName:e[11]||(e[11]=c=>t.$emit("copy-model-name",c)),onSetModel:e[12]||(e[12]=c=>t.$emit("set-model",c)),onPersonalitySelected:e[13]||(e[13]=c=>t.$emit("personality-selected",c)),onUnmountPersonality:e[14]||(e[14]=c=>t.$emit("unmount-personality",c)),onRemountPersonality:e[15]||(e[15]=c=>t.$emit("remount-personality",c)),onTalkPersonality:e[16]||(e[16]=c=>t.$emit("talk-personality",c)),onPersonalitiesReady:e[17]||(e[17]=c=>t.$emit("personalities-ready")),onShowPersonalityList:e[18]||(e[18]=c=>t.$emit("show-personality-list"))},null,8,["loading","is-checkbox"]),b("div",fvr,[b("form",{onSubmit:e[23]||(e[23]=oe(()=>{},["prevent"])),class:"relative"},[b("div",hvr,[b("div",pvr,[He(b("input",{type:"search",id:"discussion-search",class:"block w-full h-8 pl-8 pr-4 text-sm input",placeholder:"Search discussions...",title:"Filter discussions by title","onUpdate:modelValue":e[19]||(e[19]=c=>i.filterTitle=c),onInput:e[20]||(e[20]=(...c)=>s.handleSearchInput&&s.handleSearchInput(...c))},null,544),[[vt,i.filterTitle]]),e[36]||(e[36]=b("div",{class:"absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none"},[b("i",{"data-feather":"search",class:"w-4 h-4 text-gray-400 dark:text-gray-500"})],-1))]),b("button",{onClick:e[21]||(e[21]=(...c)=>s.cycleSortOrder&&s.cycleSortOrder(...c)),class:"svg-button p-1",title:`Sort by ${i.sortBy}: ${i.sortOrder==="asc"?"Ascending":"Descending"}`},[b("i",{"data-feather":s.sortIcon,class:"w-4 h-4"},null,8,Ovr)],8,Tvr),b("button",{onClick:e[22]||(e[22]=(...c)=>s.cycleSortBy&&s.cycleSortBy(...c)),class:"svg-button p-1",title:`Sorting by: ${s.sortByLabel}`},[b("i",{"data-feather":i.sortBy==="date"?"calendar":"type",class:"w-4 h-4"},null,8,gvr)],8,mvr)])],32)]),i.isCheckbox?(k(),R("div",Qvr,[b("div",_vr,[s.selectedDiscussions.length>0?(k(),R("p",vvr,"Selected: "+ae(s.selectedDiscussions.length),1)):ne("",!0),s.selectedDiscussions.length>0?(k(),R("div",yvr,[i.showConfirmation?ne("",!0):(k(),R("button",{key:0,class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Remove selected",type:"button",onClick:e[24]||(e[24]=oe(c=>i.showConfirmation=!0,["stop"]))},e[37]||(e[37]=[b("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)]))),i.showConfirmation?(k(),R("div",bvr,[b("button",{class:"svg-button text-green-500 hover:text-green-700 dark:text-green-400 dark:hover:text-green-200",title:"Confirm removal",type:"button",onClick:e[25]||(e[25]=oe((...c)=>s.deleteSelectedDiscussions&&s.deleteSelectedDiscussions(...c),["stop"]))},e[38]||(e[38]=[b("i",{"data-feather":"check",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-200",title:"Cancel removal",type:"button",onClick:e[26]||(e[26]=oe(c=>i.showConfirmation=!1,["stop"]))},e[39]||(e[39]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]))])):ne("",!0)])):ne("",!0),b("div",Svr,[b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200 rotate-90",title:"Export selected to a json file",type:"button",onClick:e[27]||(e[27]=oe(c=>t.$emit("export-discussions-as-json",s.selectedDiscussions),["stop"]))},e[40]||(e[40]=[b("i",{"data-feather":"codepen",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200 rotate-90",title:"Export selected to a folder",type:"button",onClick:e[28]||(e[28]=oe(c=>t.$emit("export-discussions-to-folder",s.selectedDiscussions),["stop"]))},e[41]||(e[41]=[b("i",{"data-feather":"folder",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200",title:"Export selected to a markdown file",type:"button",onClick:e[29]||(e[29]=oe(c=>t.$emit("export-discussions-as-markdown",s.selectedDiscussions),["stop"]))},e[42]||(e[42]=[b("i",{"data-feather":"bookmark",class:"w-5 h-5"},null,-1)])),b("button",{class:"svg-button text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200",title:"Select/Deselect All",type:"button",onClick:e[30]||(e[30]=oe((...c)=>s.selectAllDiscussions&&s.selectAllDiscussions(...c),["stop"]))},[b("i",{"data-feather":s.isAllSelected?"minus-square":"check-square",class:"w-5 h-5"},null,8,xvr)])])])])):ne("",!0),b("div",{id:"leftPanelScroll",class:"flex flex-col flex-grow overflow-y-auto overflow-x-hidden scrollbar",onDragover:e[32]||(e[32]=oe(c=>i.isDragOverDiscussion=!0,["prevent"])),onDragleave:e[33]||(e[33]=c=>i.isDragOverDiscussion=!1),onDrop:e[34]||(e[34]=oe((...c)=>s.handleDrop&&s.handleDrop(...c),["prevent"]))},[b("div",Evr,[b("div",{class:ye(["mx-0 flex flex-col flex-grow w-full",i.isDragOverDiscussion?"opacity-50 border-2 border-dashed border-blue-500":""])},[b("div",{id:"dis-list",class:ye([i.filterInProgress||n.toolbarLoading?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-10"])},[te(V4,{name:"discussionsList"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(s.groupedDiscussions,c=>(k(),R(Ve,{key:c.key},[c.type==="header"?(k(),R("div",{key:0,class:"sticky top-0 z-10 px-2 py-1 bg-gray-100 dark:bg-gray-800 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider shadow-sm flex items-center justify-between cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700",onClick:u=>s.toggleSection(c.key)},[b("span",null,ae(c.label),1),b("i",{"data-feather":c.collapsed?"chevron-right":"chevron-down",class:"w-4 h-4"},null,8,Cvr)],8,wvr)):ne("",!0),c.type==="discussion"?(k(),Qt(l,{key:1,id:`dis-${c.data.id}`,title:c.data.title,selected:n.currentDiscussion&&n.currentDiscussion.id===c.data.id,loading:c.data.loading,isCheckbox:i.isCheckbox,checkBoxValue:c.data.checkBoxValue,"is-starred":c.data.isStarred,openfolder_enabled:!0,onSelect:u=>s.selectDiscussion(c.data),onDelete:u=>s.deleteDiscussion(c.data),onOpenFolder:u=>t.$emit("open-folder",c.data),onEditTitle:e[31]||(e[31]=u=>t.$emit("edit-title",u)),onMakeTitle:u=>t.$emit("make-title",c.data),onChecked:s.checkUncheckDiscussion,onToggleStar:u=>s.toggleStarDiscussion(c.data)},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","is-starred","onSelect","onDelete","onOpenFolder","onMakeTitle","onChecked","onToggleStar"])):ne("",!0)],64))),128))]),_:1}),s.groupedDiscussions.length===0&&!i.filterInProgress&&!n.toolbarLoading?(k(),R("div",Lvr,[e[43]||(e[43]=b("p",null,"No discussions found.",-1)),i.filterTitle?(k(),R("p",$vr,"Try adjusting your search or filters.")):ne("",!0)])):ne("",!0),i.filterInProgress||n.toolbarLoading?(k(),R("div",Avr,e[44]||(e[44]=[b("p",null,"Loading discussions...",-1)]))):ne("",!0)],2)],2)])],32),b("div",kvr,[b("div",{class:"chat-bar text-center flex items-center justify-center w-full cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-700 rounded transition duration-150 ease-in-out",onClick:e[35]||(e[35]=c=>t.$emit("show-database-selector"))},[e[45]||(e[45]=b("button",{class:"svg-button p-1"},[b("i",{"data-feather":"database",class:"w-4 h-4 mr-1"})],-1)),b("p",Pvr,ae(n.formattedDatabaseName),1)])])])):ne("",!0)]),_:1})}const Mvr=st(rvr,[["render",Rvr],["__scopeId","data-v-18952e34"]]),Dvr={props:{htmlContent:{type:String,required:!0}}},Nvr=["innerHTML"];function Ivr(t,e,n,r,i,s){return k(),R("div",{class:"w-full h-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",innerHTML:n.htmlContent},null,8,Nvr)}const Hvr=st(Dvr,[["render",Ivr]]),Vvr={name:"JsonNode",props:{data:{required:!0},label:{type:String,default:""},depth:{type:Number,default:0}},data(){return{expanded:!0}},computed:{isObject(){return this.data!==null&&typeof this.data=="object"},isArray(){return Array.isArray(this.data)}},methods:{toggle(){this.expanded=!this.expanded},getValueType(t){return t===null?"null":typeof t},formatValue(t){return t===null?"null":typeof t=="string"?`"${t}"`:t}}},qvr={class:"json-tree"},Uvr={key:0,class:"tree-node"},Bvr={class:"toggle-icon"},zvr={class:"key"},Xvr={class:"bracket"},Fvr={key:0,class:"node-content"},jvr={key:1,class:"bracket-close"},Yvr={key:1,class:"tree-leaf"},Gvr={key:0,class:"key"};function Wvr(t,e,n,r,i,s){const o=Xe("json-node",!0);return k(),R("div",qvr,[s.isObject?(k(),R("div",Uvr,[b("div",{class:"node-label",onClick:e[0]||(e[0]=(...a)=>s.toggle&&s.toggle(...a))},[b("span",Bvr,ae(i.expanded?"▼":"▶"),1),b("span",zvr,ae(n.label),1),b("span",Xvr,ae(s.isArray?"[":"{"),1)]),i.expanded?(k(),R("div",Fvr,[(k(!0),R(Ve,null,dt(n.data,(a,l)=>(k(),R("div",{key:l,class:"node-item"},[te(o,{data:a,label:l,depth:n.depth+1},null,8,["data","label","depth"])]))),128))])):ne("",!0),i.expanded?(k(),R("div",jvr,ae(s.isArray?"]":"}"),1)):ne("",!0)])):(k(),R("div",Yvr,[n.label?(k(),R("span",Gvr,ae(n.label)+":",1)):ne("",!0),b("span",{class:ye(["value",s.getValueType(n.data)])},ae(s.formatValue(n.data)),3)]))])}const Zvr=st(Vvr,[["render",Wvr],["__scopeId","data-v-f98ed845"]]),Kvr={name:"JsonViewer",components:{JsonNode:Zvr},props:{data:{required:!0},title:{type:String,default:"JSON Data"}},data(){return{expanded:!0}},computed:{parsedData(){if(typeof this.data=="string")try{return JSON.parse(this.data)}catch{return{error:"Invalid JSON"}}return this.data}},methods:{toggle(){this.expanded=!this.expanded}}},Jvr={class:"json-viewer"},eyr={class:"toggle-icon"},tyr={class:"title"},nyr={key:0,class:"viewer-content"};function ryr(t,e,n,r,i,s){const o=Xe("json-node");return k(),R("div",Jvr,[b("div",{class:"viewer-header",onClick:e[0]||(e[0]=(...a)=>s.toggle&&s.toggle(...a))},[b("span",eyr,ae(i.expanded?"▼":"▶"),1),b("span",tyr,ae(n.title),1)]),i.expanded?(k(),R("div",nyr,[te(o,{data:s.parsedData},null,8,["data"])])):ne("",!0)])}const iyr=st(Kvr,[["render",ryr],["__scopeId","data-v-cd1635fc"]]),syr={name:"Step",props:{done:Boolean,text:String,status:Boolean,description:String}},oyr={class:"step-icon-wrapper"},ayr={key:"spinner",class:"step-spinner"},lyr={key:"success",class:"step-icon-success w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},cyr={key:"fail",class:"step-icon-fail w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},uyr={class:"step-text-content"},dyr={class:"step-text"},fyr={key:0,class:"step-description"};function hyr(t,e,n,r,i,s){return k(),R("div",{class:ye(["step-component",[n.done?n.status?"step-component-success":"step-component-fail":"step-component-pending"]])},[b("div",oyr,[te(cr,{name:"fade-icon",mode:"out-in"},{default:Ie(()=>[n.done?n.status?(k(),R("svg",lyr,e[0]||(e[0]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)]))):(k(),R("svg",cyr,e[1]||(e[1]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1)]))):(k(),R("div",ayr))]),_:1})]),b("div",uyr,[b("div",dyr,ae(n.text||"Processing..."),1),n.description?(k(),R("div",fyr,ae(n.description),1)):ne("",!0)])],2)}const pyr=st(syr,[["render",hyr],["__scopeId","data-v-6d675aab"]]),Tyr=["title"],Oyr={key:0,class:"icon icon-success",viewBox:"0 0 24 24"},myr={key:1,class:"icon icon-fail",viewBox:"0 0 24 24"},gyr={key:2,class:"icon-spinner"},Qyr={key:1,class:"icon-text"},_yr={__name:"StatusIcon",props:{status:{type:String,required:!0},icon:Boolean,iconDone:{type:String,default:"✓"},iconFailed:{type:String,default:"✗"},iconProcessing:{type:String,default:"⟳"},titleDone:{type:String,default:"Success"},titleFailed:{type:String,default:"Failure"},titleProcessing:{type:String,default:"Processing"}},setup(t){const e=t,n=Je(()=>e.status==="Done"?e.titleDone:e.status==="Failed"?e.titleFailed:e.titleProcessing),r=Je(()=>e.status==="Done"?e.iconDone:e.status==="Failed"?e.iconFailed:e.iconProcessing);return(i,s)=>(k(),R("div",{class:"status-icon",title:n.value},[t.icon?(k(),R(Ve,{key:0},[t.status==="Done"?(k(),R("svg",Oyr,s[0]||(s[0]=[b("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},null,-1)]))):t.status==="Failed"?(k(),R("svg",myr,s[1]||(s[1]=[b("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"},null,-1)]))):(k(),R("div",gyr))],64)):(k(),R("span",Qyr,ae(r.value),1))],8,Tyr))}},vyr=st(_yr,[["__scopeId","data-v-b3d110c2"]]),yyr=[sJ(),oJ(),WK(),VJ(),EJ(),FK(),GK(),nn.allowMultipleSelections.of(!0),OJ(),C3(wd,{fallback:!0}),AJ(),Mee(),Vee(),KK(),JK(),ZK(),FSt(),B4.of([...Iee,...Oee,...Cee,...BJ,...yJ,...Tw,...Bee])],byr="modulepreload",Syr=function(t){return"/"+t},cY={},Ee=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=Syr(l),l in cY)return;cY[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":byr,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function Ne(t){return new ri(h4.define(t))}function Z2(t){return Ee(()=>Promise.resolve().then(()=>XPt),void 0).then(e=>e.sql({dialect:e[t]}))}const xyr=[be.of({name:"C",extensions:["c","h","ino"],load(){return Ee(()=>Promise.resolve().then(()=>rH),void 0).then(t=>t.cpp())}}),be.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ee(()=>Promise.resolve().then(()=>rH),void 0).then(t=>t.cpp())}}),be.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Z2("Cassandra")}}),be.of({name:"CSS",extensions:["css"],load(){return Ee(()=>Promise.resolve().then(()=>FLt),void 0).then(t=>t.css())}}),be.of({name:"Go",extensions:["go"],load(){return Ee(()=>import("./index-B6RHGmC5.js"),[]).then(t=>t.go())}}),be.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ee(()=>Promise.resolve().then(()=>KLt),void 0).then(t=>t.html())}}),be.of({name:"Java",extensions:["java"],load(){return Ee(()=>Promise.resolve().then(()=>dAt),void 0).then(t=>t.java())}}),be.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript())}}),be.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ee(()=>Promise.resolve().then(()=>r$t),void 0).then(t=>t.json())}}),be.of({name:"JSX",extensions:["jsx"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({jsx:!0}))}}),be.of({name:"LESS",extensions:["less"],load(){return Ee(()=>import("./index-BRaXjugP.js"),[]).then(t=>t.less())}}),be.of({name:"Liquid",extensions:["liquid"],load(){return Ee(()=>import("./index-B8d2aokf.js"),[]).then(t=>t.liquid())}}),be.of({name:"MariaDB SQL",load(){return Z2("MariaSQL")}}),be.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ee(()=>Promise.resolve().then(()=>V$t),void 0).then(t=>t.markdown())}}),be.of({name:"MS SQL",load(){return Z2("MSSQL")}}),be.of({name:"MySQL",load(){return Z2("MySQL")}}),be.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ee(()=>Promise.resolve().then(()=>Rkt),void 0).then(t=>t.php())}}),be.of({name:"PLSQL",extensions:["pls"],load(){return Z2("PLSQL")}}),be.of({name:"PostgreSQL",load(){return Z2("PostgreSQL")}}),be.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ee(()=>Promise.resolve().then(()=>DCt),void 0).then(t=>t.python())}}),be.of({name:"Rust",extensions:["rs"],load(){return Ee(()=>Promise.resolve().then(()=>ePt),void 0).then(t=>t.rust())}}),be.of({name:"Sass",extensions:["sass"],load(){return Ee(()=>import("./index-DfwZFr7z.js"),[]).then(t=>t.sass({indented:!0}))}}),be.of({name:"SCSS",extensions:["scss"],load(){return Ee(()=>import("./index-DfwZFr7z.js"),[]).then(t=>t.sass())}}),be.of({name:"SQL",extensions:["sql"],load(){return Z2("StandardSQL")}}),be.of({name:"SQLite",load(){return Z2("SQLite")}}),be.of({name:"TSX",extensions:["tsx"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({jsx:!0,typescript:!0}))}}),be.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ee(()=>Promise.resolve().then(()=>x8),void 0).then(t=>t.javascript({typescript:!0}))}}),be.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ee(()=>import("./index-B7HvTpiE.js"),[]).then(t=>t.wast())}}),be.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ee(()=>Promise.resolve().then(()=>hRt),void 0).then(t=>t.xml())}}),be.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ee(()=>Promise.resolve().then(()=>XRt),void 0).then(t=>t.yaml())}}),be.of({name:"APL",extensions:["dyalog","apl"],load(){return Ee(()=>import("./apl-B4CMkyY2.js"),[]).then(t=>Ne(t.apl))}}),be.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ee(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(t=>Ne(t.asciiArmor))}}),be.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ee(()=>import("./asn1-EdZsLKOL.js"),[]).then(t=>Ne(t.asn1({})))}}),be.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ee(()=>import("./asterisk-B-8jnY81.js"),[]).then(t=>Ne(t.asterisk))}}),be.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ee(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(t=>Ne(t.brainfuck))}}),be.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ee(()=>import("./cobol-CWcv1MsR.js"),[]).then(t=>Ne(t.cobol))}}),be.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.csharp))}}),be.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"ClojureScript",extensions:["cljs"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ee(()=>import("./css-BnMrqG3P.js"),[]).then(t=>Ne(t.gss))}}),be.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ee(()=>import("./cmake-BQqOBYOt.js"),[]).then(t=>Ne(t.cmake))}}),be.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ee(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(t=>Ne(t.coffeeScript))}}),be.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ee(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(t=>Ne(t.commonLisp))}}),be.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ee(()=>import("./cypher-C_CwsFkJ.js"),[]).then(t=>Ne(t.cypher))}}),be.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ee(()=>import("./python-BuPzkPfP.js"),[]).then(t=>Ne(t.cython))}}),be.of({name:"Crystal",extensions:["cr"],load(){return Ee(()=>import("./crystal-SjHAIU92.js"),[]).then(t=>Ne(t.crystal))}}),be.of({name:"D",extensions:["d"],load(){return Ee(()=>import("./d-pRatUO7H.js"),[]).then(t=>Ne(t.d))}}),be.of({name:"Dart",extensions:["dart"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.dart))}}),be.of({name:"diff",extensions:["diff","patch"],load(){return Ee(()=>import("./diff-DbItnlRl.js"),[]).then(t=>Ne(t.diff))}}),be.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ee(()=>import("./dockerfile-BU1Ap__c.js"),__vite__mapDeps([0,1])).then(t=>Ne(t.dockerFile))}}),be.of({name:"DTD",extensions:["dtd"],load(){return Ee(()=>import("./dtd-DF_7sFjM.js"),[]).then(t=>Ne(t.dtd))}}),be.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ee(()=>import("./dylan-DwRh75JA.js"),[]).then(t=>Ne(t.dylan))}}),be.of({name:"EBNF",load(){return Ee(()=>import("./ebnf-CDyGwa7X.js"),[]).then(t=>Ne(t.ebnf))}}),be.of({name:"ECL",extensions:["ecl"],load(){return Ee(()=>import("./ecl-Cabwm37j.js"),[]).then(t=>Ne(t.ecl))}}),be.of({name:"edn",extensions:["edn"],load(){return Ee(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>Ne(t.clojure))}}),be.of({name:"Eiffel",extensions:["e"],load(){return Ee(()=>import("./eiffel-CnydiIhH.js"),[]).then(t=>Ne(t.eiffel))}}),be.of({name:"Elm",extensions:["elm"],load(){return Ee(()=>import("./elm-vLlmbW-K.js"),[]).then(t=>Ne(t.elm))}}),be.of({name:"Erlang",extensions:["erl"],load(){return Ee(()=>import("./erlang-BNw1qcRV.js"),[]).then(t=>Ne(t.erlang))}}),be.of({name:"Esper",load(){return Ee(()=>import("./sql-D0XecflT.js"),[]).then(t=>Ne(t.esper))}}),be.of({name:"Factor",extensions:["factor"],load(){return Ee(()=>import("./factor-BPndPnYX.js"),__vite__mapDeps([2,1])).then(t=>Ne(t.factor))}}),be.of({name:"FCL",load(){return Ee(()=>import("./fcl-Kvtd6kyn.js"),[]).then(t=>Ne(t.fcl))}}),be.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ee(()=>import("./forth-Ffai-XNe.js"),[]).then(t=>Ne(t.forth))}}),be.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ee(()=>import("./fortran-DYz_wnZ1.js"),[]).then(t=>Ne(t.fortran))}}),be.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.fSharp))}}),be.of({name:"Gas",extensions:["s"],load(){return Ee(()=>import("./gas-Bneqetm1.js"),[]).then(t=>Ne(t.gas))}}),be.of({name:"Gherkin",extensions:["feature"],load(){return Ee(()=>import("./gherkin-heZmZLOM.js"),[]).then(t=>Ne(t.gherkin))}}),be.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ee(()=>import("./groovy-D9Dt4D0W.js"),[]).then(t=>Ne(t.groovy))}}),be.of({name:"Haskell",extensions:["hs"],load(){return Ee(()=>import("./haskell-BWDZoCOh.js"),[]).then(t=>Ne(t.haskell))}}),be.of({name:"Haxe",extensions:["hx"],load(){return Ee(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>Ne(t.haxe))}}),be.of({name:"HXML",extensions:["hxml"],load(){return Ee(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>Ne(t.hxml))}}),be.of({name:"HTTP",load(){return Ee(()=>import("./http-DBlCnlav.js"),[]).then(t=>Ne(t.http))}}),be.of({name:"IDL",extensions:["pro"],load(){return Ee(()=>import("./idl-BEugSyMb.js"),[]).then(t=>Ne(t.idl))}}),be.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ee(()=>import("./javascript-qCveANmP.js"),[]).then(t=>Ne(t.jsonld))}}),be.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return Ee(()=>import("./jinja2-C4DGRd-O.js"),[]).then(t=>Ne(t.jinja2))}}),be.of({name:"Julia",extensions:["jl"],load(){return Ee(()=>import("./julia-DuME0IfC.js"),[]).then(t=>Ne(t.julia))}}),be.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.kotlin))}}),be.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ee(()=>import("./livescript-BwQOo05w.js"),[]).then(t=>Ne(t.liveScript))}}),be.of({name:"Lua",extensions:["lua"],load(){return Ee(()=>Promise.resolve().then(()=>SMt),void 0).then(t=>Ne(t.lua))}}),be.of({name:"mIRC",extensions:["mrc"],load(){return Ee(()=>import("./mirc-CjQqDB4T.js"),[]).then(t=>Ne(t.mirc))}}),be.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ee(()=>import("./mathematica-DTrFuWx2.js"),[]).then(t=>Ne(t.mathematica))}}),be.of({name:"Modelica",extensions:["mo"],load(){return Ee(()=>import("./modelica-Dc1JOy9r.js"),[]).then(t=>Ne(t.modelica))}}),be.of({name:"MUMPS",extensions:["mps"],load(){return Ee(()=>import("./mumps-BT43cFF4.js"),[]).then(t=>Ne(t.mumps))}}),be.of({name:"Mbox",extensions:["mbox"],load(){return Ee(()=>import("./mbox-CNhZ1qSd.js"),[]).then(t=>Ne(t.mbox))}}),be.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ee(()=>import("./nginx-DdIZxoE0.js"),[]).then(t=>Ne(t.nginx))}}),be.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ee(()=>import("./nsis-ClDXqMnM.js"),__vite__mapDeps([3,1])).then(t=>Ne(t.nsis))}}),be.of({name:"NTriples",extensions:["nt","nq"],load(){return Ee(()=>import("./ntriples-BfvgReVJ.js"),[]).then(t=>Ne(t.ntriples))}}),be.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.objectiveC))}}),be.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.objectiveCpp))}}),be.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.oCaml))}}),be.of({name:"Octave",extensions:["m"],load(){return Ee(()=>import("./octave-Ck1zUtKM.js"),[]).then(t=>Ne(t.octave))}}),be.of({name:"Oz",extensions:["oz"],load(){return Ee(()=>import("./oz-BzwKVEFT.js"),[]).then(t=>Ne(t.oz))}}),be.of({name:"Pascal",extensions:["p","pas"],load(){return Ee(()=>import("./pascal--L3eBynH.js"),[]).then(t=>Ne(t.pascal))}}),be.of({name:"Perl",extensions:["pl","pm"],load(){return Ee(()=>import("./perl-CdXCOZ3F.js"),[]).then(t=>Ne(t.perl))}}),be.of({name:"Pig",extensions:["pig"],load(){return Ee(()=>import("./pig-CevX1Tat.js"),[]).then(t=>Ne(t.pig))}}),be.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ee(()=>import("./powershell-CFHJl5sT.js"),[]).then(t=>Ne(t.powerShell))}}),be.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ee(()=>import("./properties-C78fOPTZ.js"),[]).then(t=>Ne(t.properties))}}),be.of({name:"ProtoBuf",extensions:["proto"],load(){return Ee(()=>import("./protobuf-ChK-085T.js"),[]).then(t=>Ne(t.protobuf))}}),be.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ee(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([4,5])).then(t=>Ne(t.pug))}}),be.of({name:"Puppet",extensions:["pp"],load(){return Ee(()=>import("./puppet-DMA9R1ak.js"),[]).then(t=>Ne(t.puppet))}}),be.of({name:"Q",extensions:["q"],load(){return Ee(()=>import("./q-ZnEupP5q.js"),[]).then(t=>Ne(t.q))}}),be.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ee(()=>import("./r-B6wPVr8A.js"),[]).then(t=>Ne(t.r))}}),be.of({name:"RPM Changes",load(){return Ee(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>Ne(t.rpmChanges))}}),be.of({name:"RPM Spec",extensions:["spec"],load(){return Ee(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>Ne(t.rpmSpec))}}),be.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ee(()=>Promise.resolve().then(()=>OMt),void 0).then(t=>Ne(t.ruby))}}),be.of({name:"SAS",extensions:["sas"],load(){return Ee(()=>import("./sas-B4kiWyti.js"),[]).then(t=>Ne(t.sas))}}),be.of({name:"Scala",extensions:["scala"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.scala))}}),be.of({name:"Scheme",extensions:["scm","ss"],load(){return Ee(()=>import("./scheme-C41bIUwD.js"),[]).then(t=>Ne(t.scheme))}}),be.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ee(()=>Promise.resolve().then(()=>rMt),void 0).then(t=>Ne(t.shell))}}),be.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ee(()=>import("./sieve-C3Gn_uJK.js"),[]).then(t=>Ne(t.sieve))}}),be.of({name:"Smalltalk",extensions:["st"],load(){return Ee(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(t=>Ne(t.smalltalk))}}),be.of({name:"Solr",load(){return Ee(()=>import("./solr-DehyRSwq.js"),[]).then(t=>Ne(t.solr))}}),be.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ee(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>Ne(t.sml))}}),be.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ee(()=>import("./sparql-DkYu6x3z.js"),[]).then(t=>Ne(t.sparql))}}),be.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ee(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(t=>Ne(t.spreadsheet))}}),be.of({name:"Squirrel",extensions:["nut"],load(){return Ee(()=>import("./clike-Cr_nJiF2.js"),[]).then(t=>Ne(t.squirrel))}}),be.of({name:"Stylus",extensions:["styl"],load(){return Ee(()=>import("./stylus-BdAi1jBa.js"),[]).then(t=>Ne(t.stylus))}}),be.of({name:"Swift",extensions:["swift"],load(){return Ee(()=>import("./swift-BzpIVaGY.js"),[]).then(t=>Ne(t.swift))}}),be.of({name:"sTeX",load(){return Ee(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>Ne(t.stex))}}),be.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ee(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>Ne(t.stex))}}),be.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ee(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>Ne(t.verilog))}}),be.of({name:"Tcl",extensions:["tcl"],load(){return Ee(()=>import("./tcl-DVfN8rqt.js"),[]).then(t=>Ne(t.tcl))}}),be.of({name:"Textile",extensions:["textile"],load(){return Ee(()=>import("./textile-CnDTJFAw.js"),[]).then(t=>Ne(t.textile))}}),be.of({name:"TiddlyWiki",load(){return Ee(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(t=>Ne(t.tiddlyWiki))}}),be.of({name:"Tiki wiki",load(){return Ee(()=>import("./tiki-DGYXhP31.js"),[]).then(t=>Ne(t.tiki))}}),be.of({name:"TOML",extensions:["toml"],load(){return Ee(()=>import("./toml-BXUEaScT.js"),[]).then(t=>Ne(t.toml))}}),be.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ee(()=>import("./troff-wAsdV37c.js"),[]).then(t=>Ne(t.troff))}}),be.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ee(()=>import("./ttcn-CfJYG6tj.js"),[]).then(t=>Ne(t.ttcn))}}),be.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ee(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(t=>Ne(t.ttcnCfg))}}),be.of({name:"Turtle",extensions:["ttl"],load(){return Ee(()=>import("./turtle-B1tBg_DP.js"),[]).then(t=>Ne(t.turtle))}}),be.of({name:"Web IDL",extensions:["webidl"],load(){return Ee(()=>import("./webidl-ZXfAyPTL.js"),[]).then(t=>Ne(t.webIDL))}}),be.of({name:"VB.NET",extensions:["vb"],load(){return Ee(()=>import("./vb-CmGdzxic.js"),[]).then(t=>Ne(t.vb))}}),be.of({name:"VBScript",extensions:["vbs"],load(){return Ee(()=>import("./vbscript-BuJXcnF6.js"),[]).then(t=>Ne(t.vbScript))}}),be.of({name:"Velocity",extensions:["vtl"],load(){return Ee(()=>import("./velocity-D8B20fx6.js"),[]).then(t=>Ne(t.velocity))}}),be.of({name:"Verilog",extensions:["v"],load(){return Ee(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>Ne(t.verilog))}}),be.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ee(()=>import("./vhdl-lSbBsy5d.js"),[]).then(t=>Ne(t.vhdl))}}),be.of({name:"XQuery",extensions:["xy","xquery"],load(){return Ee(()=>import("./xquery-CQfU5ijd.js"),[]).then(t=>Ne(t.xQuery))}}),be.of({name:"Yacas",extensions:["ys"],load(){return Ee(()=>import("./yacas-BJ4BC0dw.js"),[]).then(t=>Ne(t.yacas))}}),be.of({name:"Z80",extensions:["z80"],load(){return Ee(()=>import("./z80-Hz9HOZM7.js"),[]).then(t=>Ne(t.z80))}}),be.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.mscgen))}}),be.of({name:"Xù",extensions:["xu"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.xu))}}),be.of({name:"MsGenny",extensions:["msgenny"],load(){return Ee(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>Ne(t.msgenny))}}),be.of({name:"Vue",extensions:["vue"],load(){return Ee(()=>Promise.resolve().then(()=>JRt),void 0).then(t=>t.vue())}}),be.of({name:"Angular Template",load(){return Ee(()=>import("./index-WpvKL_jd.js"),[]).then(t=>t.angular())}})],Eyr={name:"DropdownSubmenu",props:{title:{type:String,required:!0},icon:{type:String,required:!1,default:null}},setup(){const t=We(!1);let e=null;const n=()=>{e&&(clearTimeout(e),e=null),t.value||(t.value=!0,Fe(()=>{Re.replace()}))},r=()=>{e=setTimeout(()=>{t.value=!1,e=null},150)};return Ii(()=>{Fe(()=>{Re.replace()})}),{isOpen:t,openSubmenu:n,closeSubmenu:r}}},wyr=["aria-expanded"],Cyr={class:"flex items-center gap-2"},Lyr=["data-feather"],$yr={class:"truncate"},Ayr={key:0,class:"absolute top-0 left-full mt-[-1px] ml-1 w-auto min-w-[10rem] origin-top-left rounded-md bg-white dark:bg-gray-800 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-20 py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"submenu-button"};function kyr(t,e,n,r,i,s){return k(),R("div",{class:"relative",onMouseenter:e[0]||(e[0]=(...o)=>r.openSubmenu&&r.openSubmenu(...o)),onMouseleave:e[1]||(e[1]=(...o)=>r.closeSubmenu&&r.closeSubmenu(...o))},[b("button",{type:"button",class:"w-full flex items-center justify-between px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-700",role:"menuitem",tabindex:"-1","aria-haspopup":!0,"aria-expanded":r.isOpen},[b("div",Cyr,[n.icon?(k(),R("i",{key:0,"data-feather":n.icon,class:"w-4 h-4 flex-shrink-0"},null,8,Lyr)):ne("",!0),b("span",$yr,ae(n.title),1)]),e[2]||(e[2]=b("i",{"data-feather":"chevron-right",class:"w-4 h-4 ml-auto flex-shrink-0 text-gray-400"},null,-1))],8,wyr),te(cr,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:Ie(()=>[r.isOpen?(k(),R("div",Ayr,[er(t.$slots,"default",{},void 0,!0)])):ne("",!0)]),_:3})],32)}const Pyr=st(Eyr,[["render",kyr],["__scopeId","data-v-6d202a8d"]]),Ryr=t=>{let e=[];for(let n of t.selection.ranges){const r=t.doc.lineAt(n.from),i=t.doc.lineAt(n.to);for(let s=r.number;s<=i.number;s++)e.some(o=>o.number===s)||e.push(t.doc.line(s))}return e},m3=(t,e,n)=>n&&e===0||!n&&e===t.doc.length?!1:(n?t.doc.sliceString(e-1,e):t.doc.sliceString(e,e+1))!==`
+`,Myr={name:"MarkdownEditor",components:{DropdownMenu:Noe,DropdownSubmenu:Pyr,ToolbarButton:oT},props:{modelValue:{type:String,required:!0},editorClass:{type:[String,Object,Array],default:""},toolbarClass:{type:[String,Object,Array],default:""},buttonClass:{type:[String,Object,Array],default:""},toolbarButtonIconSize:{type:Number,default:16},theme:{type:Object,required:!0}},emits:["update:modelValue"],data(){return{editorView:null,updatingFromSelf:!1}},computed:{toolbarButtonBaseClass(){return this.buttonClass||"px-1.5 py-1 bg-white dark:bg-gray-600 border border-gray-300 dark:border-gray-500 rounded hover:bg-gray-200 dark:hover:bg-gray-500 text-sm focus:outline-none focus:ring-1 focus:ring-blue-400 dark:text-gray-200 flex items-center justify-center w-7 h-7"},iconSize(){return this.toolbarButtonIconSize},svgIconSizeClass(){const t=Math.round(this.iconSize/4);return`w-${t} h-${t}`}},methods:{getButtonTitle(t){return{bold:"Bold (Ctrl+B)",italic:"Italic (Ctrl+I)",strikethrough:"Strikethrough",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",blockquote:"Blockquote",ul:"Unordered List",ol:"Ordered List",codeblock:"Code Block",inlinecode:"Inline Code",link:"Insert Link",image:"Insert Image",hr:"Horizontal Rule",latex:"Inline LaTeX ($...$)",latexBlock:"LaTeX Block ($$...$$)",latexEnvEquation:"Equation Environment",latexEnvAlign:"Align Environment",latexEnvGather:"Gather Environment",latexEnvEquationStar:"Equation* Environment (Unnumbered)",latexEnvAlignStar:"Align* Environment (Unnumbered)",latexEnvGatherStar:"Gather* Environment (Unnumbered)"}[t]||t},initializeEditor(){this.editorView&&this.editorView.destroy();const t=nn.create({doc:this.modelValue,extensions:[yyr,B4.of([mee]),Rw({base:Ip,codeLanguages:xyr}),this.theme,tt.lineWrapping,tt.updateListener.of(e=>{e.docChanged&&!this.updatingFromSelf&&this.$emit("update:modelValue",e.state.doc.toString())}),tt.contentAttributes.of({"aria-label":"Markdown editor content"})]});this.editorView=new tt({state:t,parent:this.$refs.editorRef})},destroyEditor(){this.editorView&&(this.editorView.destroy(),this.editorView=null)},applyFormat(t,e={}){if(!this.editorView)return;const n=this.editorView,r=n.state;let i=[];const s=r.selection.main,o=r.doc.sliceString(s.from,s.to);let a="",l="",c="",u=!1;switch(t){case"bold":a="**",l="**";break;case"italic":a="_",l="_";break;case"strikethrough":a="~~",l="~~";break;case"inlinecode":a="`",l="`";break;case"latex":a="$",l="$";break;case"h1":c="# ";break;case"h2":c="## ";break;case"h3":c="### ";break;case"blockquote":c="> ";break;case"ul":c="- ";break;case"ol":c="1. ";break;case"latexBlock":a=`$$
`,l=`
$$`,u=!0;break;case"codeblock":a="```"+(e.language||"")+`
`,l="\n```",u=!0;break;case"hr":i.push({from:s.from,insert:(m3(r,s.from,!0)?`
@@ -582,11 +586,11 @@ $$`,u=!0;break;case"codeblock":a="```"+(e.language||"")+`
`,l=`
\\end{gather*}`;break}let d=a,f=l;if(u&&(m3(r,s.from,!0)&&(d=`
`+a),m3(r,s.to,!1)&&(f=l+`
-`)),c){const h=Pyr(r);let p=0;if(h.forEach(T=>{const m=T.text.match(/^([#>\-\*]|\d+\.)\s*/),O=m?m[0].length:0,g=T.from,Q=g+O;if(m&&m[0].trim()===c.trim())i.push({from:g,to:Q,insert:""}),T.number===r.doc.lineAt(s.head).number&&s.head>=Q&&(p-=O);else{const v=c;i.push({from:g,to:Q,insert:v}),T.number===r.doc.lineAt(s.head).number&&(s.head>=Q?p+=v.length-O:p=v.length)}}),i.length>0){const T=Math.max(s.anchor,s.head+p);n.dispatch({changes:i,selection:{anchor:s.anchor,head:T}})}}else if(a||l){const h=d+o+f;let p;if(s.empty){let T=s.from+d.length;!u&&t==="latex"&&(T=s.from+a.length),p={anchor:T}}else p={anchor:s.from+d.length,head:s.to+d.length};n.dispatch({changes:{from:s.from,to:s.to,insert:h},selection:p})}else t==="hr"&&i.length>0&&n.dispatch({changes:i,selection:{anchor:s.from+i[0].insert.length}});n.focus()},insertLink(){if(!this.editorView)return;const t=prompt("Enter link URL:","https://");if(!t)return;const e=this.editorView,n=e.state,r=n.selection.main,s=n.doc.sliceString(r.from,r.to)||"link text",o=`[${s}](${t})`;e.dispatch({changes:{from:r.from,to:r.to,insert:o},selection:r.empty?{anchor:r.from+1,head:r.from+1+s.length}:{anchor:r.from+o.length}}),e.focus()},insertImage(){if(!this.editorView)return;const t=prompt("Enter image URL:","https://");if(!t)return;const e=prompt("Enter alt text:","image"),n=this.editorView,r=n.state,i=r.selection.main,s=``;let o=s,a=0;m3(r,i.from,!0)&&(o=`
+`)),c){const h=Ryr(r);let p=0;if(h.forEach(T=>{const m=T.text.match(/^([#>\-\*]|\d+\.)\s*/),O=m?m[0].length:0,g=T.from,Q=g+O;if(m&&m[0].trim()===c.trim())i.push({from:g,to:Q,insert:""}),T.number===r.doc.lineAt(s.head).number&&s.head>=Q&&(p-=O);else{const v=c;i.push({from:g,to:Q,insert:v}),T.number===r.doc.lineAt(s.head).number&&(s.head>=Q?p+=v.length-O:p=v.length)}}),i.length>0){const T=Math.max(s.anchor,s.head+p);n.dispatch({changes:i,selection:{anchor:s.anchor,head:T}})}}else if(a||l){const h=d+o+f;let p;if(s.empty){let T=s.from+d.length;!u&&t==="latex"&&(T=s.from+a.length),p={anchor:T}}else p={anchor:s.from+d.length,head:s.to+d.length};n.dispatch({changes:{from:s.from,to:s.to,insert:h},selection:p})}else t==="hr"&&i.length>0&&n.dispatch({changes:i,selection:{anchor:s.from+i[0].insert.length}});n.focus()},insertLink(){if(!this.editorView)return;const t=prompt("Enter link URL:","https://");if(!t)return;const e=this.editorView,n=e.state,r=n.selection.main,s=n.doc.sliceString(r.from,r.to)||"link text",o=`[${s}](${t})`;e.dispatch({changes:{from:r.from,to:r.to,insert:o},selection:r.empty?{anchor:r.from+1,head:r.from+1+s.length}:{anchor:r.from+o.length}}),e.focus()},insertImage(){if(!this.editorView)return;const t=prompt("Enter image URL:","https://");if(!t)return;const e=prompt("Enter alt text:","image"),n=this.editorView,r=n.state,i=r.selection.main,s=``;let o=s,a=0;m3(r,i.from,!0)&&(o=`
`+o,a=1),(m3(r,i.to,!1)||i.empty&&m3(r,i.from,!1))&&(o=o+`
-`);const l=i.from+a+s.length;n.dispatch({changes:{from:i.from,to:i.to,insert:o},selection:{anchor:l}}),n.focus()}},watch:{modelValue(t){this.editorView&&t!==this.editorView.state.doc.toString()&&(this.updatingFromSelf=!0,this.editorView.dispatch({changes:{from:0,to:this.editorView.state.doc.length,insert:t}}),Fe(()=>{this.updatingFromSelf=!1}))},theme(){this.initializeEditor()}},mounted(){this.initializeEditor()},beforeUnmount(){this.destroyEditor()}},Myr={ref:"editorRef",class:"editor-wrapper"};function Dyr(t,e,n,r,i,s){const o=Xe("ToolbarButton"),a=Xe("DropdownMenu"),l=Xe("DropdownSubmenu");return k(),R("div",{class:ye(["markdown-editor-container border border-gray-300 dark:border-gray-600 rounded-md overflow-hidden",n.editorClass])},[b("div",{class:ye(["toolbar bg-gray-100 dark:bg-gray-700 p-1 border-b border-gray-300 dark:border-gray-600 flex flex-wrap items-center gap-1",n.toolbarClass])},[te(o,{title:s.getButtonTitle("bold"),onClick:e[0]||(e[0]=c=>s.applyFormat("bold")),icon:"bold","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","button-class","svg-size-class"]),te(o,{title:s.getButtonTitle("italic"),onClick:e[1]||(e[1]=c=>s.applyFormat("italic")),icon:"italic","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","button-class","svg-size-class"]),te(o,{title:s.getButtonTitle("link"),onClick:s.insertLink,icon:"link","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","onClick","button-class","svg-size-class"]),te(a,{title:"Text Formatting",icon:"type","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[2]||(e[2]=oe(c=>s.applyFormat("strikethrough"),["stop"])),title:"Strikethrough",icon:"strikethrough","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[3]||(e[3]=oe(c=>s.applyFormat("inlinecode"),["stop"])),title:"Inline Code",icon:"code","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>e[50]||(e[50]=[b("span",{class:"ml-1 text-xs"},"(inline)",-1)])),_:1},8,["svg-size-class"]),te(o,{onClick:e[4]||(e[4]=oe(c=>s.applyFormat("latex"),["stop"])),title:"Inline LaTeX ($...$)",icon:"latex","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Headings",icon:"hash","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[5]||(e[5]=oe(c=>s.applyFormat("h1"),["stop"])),title:"Heading 1","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[51]||(e[51]=[Se("H1")])),_:1},8,["svg-size-class"]),te(o,{onClick:e[6]||(e[6]=oe(c=>s.applyFormat("h2"),["stop"])),title:"Heading 2","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[52]||(e[52]=[Se("H2")])),_:1},8,["svg-size-class"]),te(o,{onClick:e[7]||(e[7]=oe(c=>s.applyFormat("h3"),["stop"])),title:"Heading 3","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[53]||(e[53]=[Se("H3")])),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Lists",icon:"list","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[8]||(e[8]=oe(c=>s.applyFormat("ul"),["stop"])),title:"Unordered List",icon:"list","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[9]||(e[9]=oe(c=>s.applyFormat("ol"),["stop"])),title:"Ordered List","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>e[54]||(e[54]=[b("span",{class:"font-semibold text-sm"},"1.",-1)])),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Blocks",icon:"layout","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[10]||(e[10]=oe(c=>s.applyFormat("blockquote"),["stop"])),title:"Blockquote",icon:"blockquote","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[11]||(e[11]=oe(c=>s.applyFormat("hr"),["stop"])),title:"Horizontal Rule",icon:"minus","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[12]||(e[12]=oe(c=>s.applyFormat("latexBlock"),["stop"])),title:"LaTeX Block ($$...$$)",icon:"latexBlock","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Insert Code Block",icon:"code","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[13]||(e[13]=oe(c=>s.applyFormat("codeblock"),["stop"])),title:"Generic Code Block",icon:"terminal","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),e[55]||(e[55]=b("div",{class:"my-1 border-t border-gray-200 dark:border-gray-600"},null,-1)),te(l,{title:"Programming Languages",icon:"code","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[14]||(e[14]=oe(c=>s.applyFormat("codeblock",{language:"python"}),["stop"])),title:"Python",icon:"python","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[15]||(e[15]=oe(c=>s.applyFormat("codeblock",{language:"javascript"}),["stop"])),title:"JavaScript",icon:"js","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[16]||(e[16]=oe(c=>s.applyFormat("codeblock",{language:"typescript"}),["stop"])),title:"TypeScript",icon:"typescript","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[17]||(e[17]=oe(c=>s.applyFormat("codeblock",{language:"java"}),["stop"])),title:"Java",icon:"java","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[18]||(e[18]=oe(c=>s.applyFormat("codeblock",{language:"c++"}),["stop"])),title:"C++",icon:"cplusplus","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[19]||(e[19]=oe(c=>s.applyFormat("codeblock",{language:"csharp"}),["stop"])),title:"C#",icon:"csharp","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[20]||(e[20]=oe(c=>s.applyFormat("codeblock",{language:"go"}),["stop"])),title:"Go",icon:"go","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[21]||(e[21]=oe(c=>s.applyFormat("codeblock",{language:"rust"}),["stop"])),title:"Rust",icon:"rust","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[22]||(e[22]=oe(c=>s.applyFormat("codeblock",{language:"swift"}),["stop"])),title:"Swift",icon:"swift","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[23]||(e[23]=oe(c=>s.applyFormat("codeblock",{language:"kotlin"}),["stop"])),title:"Kotlin",icon:"kotlin","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[24]||(e[24]=oe(c=>s.applyFormat("codeblock",{language:"r"}),["stop"])),title:"R",icon:"r-project","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Web Technologies",icon:"chrome","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[25]||(e[25]=oe(c=>s.applyFormat("codeblock",{language:"html"}),["stop"])),title:"HTML",icon:"html5","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[26]||(e[26]=oe(c=>s.applyFormat("codeblock",{language:"css"}),["stop"])),title:"CSS",icon:"css3","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[27]||(e[27]=oe(c=>s.applyFormat("codeblock",{language:"vue"}),["stop"])),title:"Vue.js",icon:"vuejs","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[28]||(e[28]=oe(c=>s.applyFormat("codeblock",{language:"react"}),["stop"])),title:"React",icon:"react","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[29]||(e[29]=oe(c=>s.applyFormat("codeblock",{language:"angular"}),["stop"])),title:"Angular",icon:"angular","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Markup and Data",icon:"file-text","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[30]||(e[30]=oe(c=>s.applyFormat("codeblock",{language:"xml"}),["stop"])),title:"XML",icon:"xml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[31]||(e[31]=oe(c=>s.applyFormat("codeblock",{language:"json"}),["stop"])),title:"JSON",icon:"json","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[32]||(e[32]=oe(c=>s.applyFormat("codeblock",{language:"yaml"}),["stop"])),title:"YAML",icon:"yaml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[33]||(e[33]=oe(c=>s.applyFormat("codeblock",{language:"markdown"}),["stop"])),title:"Markdown",icon:"markdown","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Scripting and Shell",icon:"terminal","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[34]||(e[34]=oe(c=>s.applyFormat("codeblock",{language:"bash"}),["stop"])),title:"Bash",icon:"bash","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[35]||(e[35]=oe(c=>s.applyFormat("codeblock",{language:"powershell"}),["stop"])),title:"PowerShell",icon:"powershell","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[36]||(e[36]=oe(c=>s.applyFormat("codeblock",{language:"perl"}),["stop"])),title:"Perl",icon:"perl","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Diagramming",icon:"git-branch","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[37]||(e[37]=oe(c=>s.applyFormat("codeblock",{language:"mermaid"}),["stop"])),title:"Mermaid",icon:"mermaid","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[38]||(e[38]=oe(c=>s.applyFormat("codeblock",{language:"graphviz"}),["stop"])),title:"Graphviz",icon:"graphviz","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[39]||(e[39]=oe(c=>s.applyFormat("codeblock",{language:"plantuml"}),["stop"])),title:"PlantUML",icon:"plantuml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Database",icon:"database","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[40]||(e[40]=oe(c=>s.applyFormat("codeblock",{language:"sql"}),["stop"])),title:"SQL",icon:"sql","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[41]||(e[41]=oe(c=>s.applyFormat("codeblock",{language:"mongodb"}),["stop"])),title:"MongoDB",icon:"mongodb","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"LaTeX Equations",icon:"sigma","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[42]||(e[42]=oe(c=>s.applyFormat("latex"),["stop"])),title:"Inline Math ($...$)",icon:"latex","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[43]||(e[43]=oe(c=>s.applyFormat("latexBlock"),["stop"])),title:"Display Math ($$...$$)",icon:"latexBlock","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),e[56]||(e[56]=b("div",{class:"my-1 border-t border-gray-200 dark:border-gray-600"},null,-1)),te(l,{title:"Numbered Environments",icon:"hash","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[44]||(e[44]=oe(c=>s.applyFormat("latexEnvEquation"),["stop"])),title:"Equation (Single line, numbered)",icon:"equation","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[45]||(e[45]=oe(c=>s.applyFormat("latexEnvAlign"),["stop"])),title:"Align (Multiple lines, aligned, numbered)",icon:"align","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[46]||(e[46]=oe(c=>s.applyFormat("latexEnvGather"),["stop"])),title:"Gather (Multiple lines, centered, numbered)",icon:"gather","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Unnumbered Environments",icon:"minus-circle","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[47]||(e[47]=oe(c=>s.applyFormat("latexEnvEquationStar"),["stop"])),title:"Equation* (Single line, unnumbered)",icon:"equation","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[48]||(e[48]=oe(c=>s.applyFormat("latexEnvAlignStar"),["stop"])),title:"Align* (Multiple lines, aligned, unnumbered)",icon:"align","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[49]||(e[49]=oe(c=>s.applyFormat("latexEnvGatherStar"),["stop"])),title:"Gather* (Multiple lines, centered, unnumbered)",icon:"gather","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Insert",icon:"paperclip","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:oe(s.insertImage,["stop"]),title:"Image",icon:"image","svg-size-class":s.svgIconSizeClass},null,8,["onClick","svg-size-class"])]),_:1},8,["button-class","svg-size-class"])],2),b("div",Myr,null,512)],2)}const Nyr=st(Ryr,[["render",Dyr]]),Iyr=0,Hyr=1,Vyr=2,qyr={name:"Message",emits:["delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:rT,Step:hyr,StatusIcon:_yr,RenderHTMLJS:Ivr,JsonViewer:ryr,DynamicUIRenderer:Ioe,ToolbarButton:oT,MarkdownEditor:Nyr},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,loading_svg:woe,audio_url:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,editMsgMode_:!1,originalContentBeforeEdit:"",editableContent:"",deleteMsgMode:!1}},mounted(){"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.loadVoices(),this.speechSynthesis.onvoiceschanged=this.loadVoices):console.error("Speech synthesis is not supported in this browser."),this.syncAudioUrlFromMetadata(),Fe(Re.replace)},updated(){Fe(Re.replace)},methods:{getImgUrl(){return this.avatar||Eo},defaultImg(t){t.target.src=Eo},getSenderDisplayName(){return this.isUserMessage?this.message.sender||"You":this.isSystemMessage?"System":this.message.sender},loadVoices(){this.speechSynthesis&&(this.voices=this.speechSynthesis.getVoices())},syncAudioUrlFromMetadata(){if(Array.isArray(this.message.metadata)){const t=this.message.metadata.find(e=>e==null?void 0:e.audio_url);this.audio_url=t?t.audio_url:null}else this.audio_url=null},toggleExpanded(){this.expanded=!this.expanded,Fe(Re.replace)},computeTimeDiff(t,e){let n=e.getTime()-t.getTime();const r=Math.floor(n/36e5);n-=r*36e5;const i=Math.floor(n/6e4);n-=i*6e4;const s=Math.floor(n/1e3);return[r,i,s]},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player&&this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Ae.post(`${this.host}/text2wav`,{text:this.message.content}).then(t=>{this.isSynthesizingVoice=!1;const e=t.data.url;this.audio_url=e,Array.isArray(this.message.metadata)||(this.message.metadata=[]);let n=this.message.metadata.find(r=>r&&typeof r=="object"&&r.hasOwnProperty("audio_url"));n?n.audio_url=e:this.message.metadata.push({audio_url:e}),Fe(()=>{this.$refs.audio_player&&(this.$refs.audio_player.load(),this.$refs.audio_player.play().catch(r=>console.error("Audio autoplay failed:",r)))})}).catch(t=>{this.$store.state.toast.showToast(`Error generating audio: ${t.message||t}`,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this.isSpeaking){if(this.$store.state.config.active_tts_service!=="browser"&&this.$store.state.config.active_tts_service!=="None")try{await Ae.post(`${this.host}/stop_audio`,{client_id:this.$store.state.client_id}),this.isSpeaking=!1}catch(e){this.$store.state.toast.showToast(`Error stopping audio: ${e.message||e}`,4,!1),this.isSpeaking=!1}else this.speechSynthesis&&(this.speechSynthesis.cancel(),this.isSpeaking=!1);return}this.isSpeaking=!0;const t=this.message.content;if(this.$store.state.config.active_tts_service!=="browser"&&this.$store.state.config.active_tts_service!=="None")Ae.post(`${this.host}/text2Audio`,{client_id:this.$store.state.client_id,text:t}).catch(e=>{this.$store.state.toast.showToast(`Error starting backend TTS: ${e.message||e}`,4,!1),this.isSpeaking=!1});else if(this.speechSynthesis&&t){let e=0;const n=180,r=this.voices.find(o=>o.name===this.$store.state.config.audio_out_voice),i=o=>{let a=t.substring(o,o+n);const l=[".","!","?",`
+`);const l=i.from+a+s.length;n.dispatch({changes:{from:i.from,to:i.to,insert:o},selection:{anchor:l}}),n.focus()}},watch:{modelValue(t){this.editorView&&t!==this.editorView.state.doc.toString()&&(this.updatingFromSelf=!0,this.editorView.dispatch({changes:{from:0,to:this.editorView.state.doc.length,insert:t}}),Fe(()=>{this.updatingFromSelf=!1}))},theme(){this.initializeEditor()}},mounted(){this.initializeEditor()},beforeUnmount(){this.destroyEditor()}},Dyr={ref:"editorRef",class:"editor-wrapper"};function Nyr(t,e,n,r,i,s){const o=Xe("ToolbarButton"),a=Xe("DropdownMenu"),l=Xe("DropdownSubmenu");return k(),R("div",{class:ye(["markdown-editor-container border border-gray-300 dark:border-gray-600 rounded-md overflow-hidden",n.editorClass])},[b("div",{class:ye(["toolbar bg-gray-100 dark:bg-gray-700 p-1 border-b border-gray-300 dark:border-gray-600 flex flex-wrap items-center gap-1",n.toolbarClass])},[te(o,{title:s.getButtonTitle("bold"),onClick:e[0]||(e[0]=c=>s.applyFormat("bold")),icon:"bold","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","button-class","svg-size-class"]),te(o,{title:s.getButtonTitle("italic"),onClick:e[1]||(e[1]=c=>s.applyFormat("italic")),icon:"italic","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","button-class","svg-size-class"]),te(o,{title:s.getButtonTitle("link"),onClick:s.insertLink,icon:"link","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},null,8,["title","onClick","button-class","svg-size-class"]),te(a,{title:"Text Formatting",icon:"type","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[2]||(e[2]=oe(c=>s.applyFormat("strikethrough"),["stop"])),title:"Strikethrough",icon:"strikethrough","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[3]||(e[3]=oe(c=>s.applyFormat("inlinecode"),["stop"])),title:"Inline Code",icon:"code","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>e[50]||(e[50]=[b("span",{class:"ml-1 text-xs"},"(inline)",-1)])),_:1},8,["svg-size-class"]),te(o,{onClick:e[4]||(e[4]=oe(c=>s.applyFormat("latex"),["stop"])),title:"Inline LaTeX ($...$)",icon:"latex","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Headings",icon:"hash","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[5]||(e[5]=oe(c=>s.applyFormat("h1"),["stop"])),title:"Heading 1","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[51]||(e[51]=[Se("H1")])),_:1},8,["svg-size-class"]),te(o,{onClick:e[6]||(e[6]=oe(c=>s.applyFormat("h2"),["stop"])),title:"Heading 2","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[52]||(e[52]=[Se("H2")])),_:1},8,["svg-size-class"]),te(o,{onClick:e[7]||(e[7]=oe(c=>s.applyFormat("h3"),["stop"])),title:"Heading 3","svg-size-class":s.svgIconSizeClass,class:"font-semibold"},{default:Ie(()=>e[53]||(e[53]=[Se("H3")])),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Lists",icon:"list","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[8]||(e[8]=oe(c=>s.applyFormat("ul"),["stop"])),title:"Unordered List",icon:"list","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[9]||(e[9]=oe(c=>s.applyFormat("ol"),["stop"])),title:"Ordered List","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>e[54]||(e[54]=[b("span",{class:"font-semibold text-sm"},"1.",-1)])),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Blocks",icon:"layout","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[10]||(e[10]=oe(c=>s.applyFormat("blockquote"),["stop"])),title:"Blockquote",icon:"blockquote","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[11]||(e[11]=oe(c=>s.applyFormat("hr"),["stop"])),title:"Horizontal Rule",icon:"minus","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[12]||(e[12]=oe(c=>s.applyFormat("latexBlock"),["stop"])),title:"LaTeX Block ($$...$$)",icon:"latexBlock","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Insert Code Block",icon:"code","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[13]||(e[13]=oe(c=>s.applyFormat("codeblock"),["stop"])),title:"Generic Code Block",icon:"terminal","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),e[55]||(e[55]=b("div",{class:"my-1 border-t border-gray-200 dark:border-gray-600"},null,-1)),te(l,{title:"Programming Languages",icon:"code","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[14]||(e[14]=oe(c=>s.applyFormat("codeblock",{language:"python"}),["stop"])),title:"Python",icon:"python","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[15]||(e[15]=oe(c=>s.applyFormat("codeblock",{language:"javascript"}),["stop"])),title:"JavaScript",icon:"js","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[16]||(e[16]=oe(c=>s.applyFormat("codeblock",{language:"typescript"}),["stop"])),title:"TypeScript",icon:"typescript","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[17]||(e[17]=oe(c=>s.applyFormat("codeblock",{language:"java"}),["stop"])),title:"Java",icon:"java","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[18]||(e[18]=oe(c=>s.applyFormat("codeblock",{language:"c++"}),["stop"])),title:"C++",icon:"cplusplus","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[19]||(e[19]=oe(c=>s.applyFormat("codeblock",{language:"csharp"}),["stop"])),title:"C#",icon:"csharp","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[20]||(e[20]=oe(c=>s.applyFormat("codeblock",{language:"go"}),["stop"])),title:"Go",icon:"go","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[21]||(e[21]=oe(c=>s.applyFormat("codeblock",{language:"rust"}),["stop"])),title:"Rust",icon:"rust","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[22]||(e[22]=oe(c=>s.applyFormat("codeblock",{language:"swift"}),["stop"])),title:"Swift",icon:"swift","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[23]||(e[23]=oe(c=>s.applyFormat("codeblock",{language:"kotlin"}),["stop"])),title:"Kotlin",icon:"kotlin","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[24]||(e[24]=oe(c=>s.applyFormat("codeblock",{language:"r"}),["stop"])),title:"R",icon:"r-project","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Web Technologies",icon:"chrome","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[25]||(e[25]=oe(c=>s.applyFormat("codeblock",{language:"html"}),["stop"])),title:"HTML",icon:"html5","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[26]||(e[26]=oe(c=>s.applyFormat("codeblock",{language:"css"}),["stop"])),title:"CSS",icon:"css3","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[27]||(e[27]=oe(c=>s.applyFormat("codeblock",{language:"vue"}),["stop"])),title:"Vue.js",icon:"vuejs","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[28]||(e[28]=oe(c=>s.applyFormat("codeblock",{language:"react"}),["stop"])),title:"React",icon:"react","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[29]||(e[29]=oe(c=>s.applyFormat("codeblock",{language:"angular"}),["stop"])),title:"Angular",icon:"angular","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Markup and Data",icon:"file-text","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[30]||(e[30]=oe(c=>s.applyFormat("codeblock",{language:"xml"}),["stop"])),title:"XML",icon:"xml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[31]||(e[31]=oe(c=>s.applyFormat("codeblock",{language:"json"}),["stop"])),title:"JSON",icon:"json","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[32]||(e[32]=oe(c=>s.applyFormat("codeblock",{language:"yaml"}),["stop"])),title:"YAML",icon:"yaml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[33]||(e[33]=oe(c=>s.applyFormat("codeblock",{language:"markdown"}),["stop"])),title:"Markdown",icon:"markdown","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Scripting and Shell",icon:"terminal","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[34]||(e[34]=oe(c=>s.applyFormat("codeblock",{language:"bash"}),["stop"])),title:"Bash",icon:"bash","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[35]||(e[35]=oe(c=>s.applyFormat("codeblock",{language:"powershell"}),["stop"])),title:"PowerShell",icon:"powershell","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[36]||(e[36]=oe(c=>s.applyFormat("codeblock",{language:"perl"}),["stop"])),title:"Perl",icon:"perl","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Diagramming",icon:"git-branch","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[37]||(e[37]=oe(c=>s.applyFormat("codeblock",{language:"mermaid"}),["stop"])),title:"Mermaid",icon:"mermaid","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[38]||(e[38]=oe(c=>s.applyFormat("codeblock",{language:"graphviz"}),["stop"])),title:"Graphviz",icon:"graphviz","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[39]||(e[39]=oe(c=>s.applyFormat("codeblock",{language:"plantuml"}),["stop"])),title:"PlantUML",icon:"plantuml","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Database",icon:"database","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[40]||(e[40]=oe(c=>s.applyFormat("codeblock",{language:"sql"}),["stop"])),title:"SQL",icon:"sql","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[41]||(e[41]=oe(c=>s.applyFormat("codeblock",{language:"mongodb"}),["stop"])),title:"MongoDB",icon:"mongodb","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"LaTeX Equations",icon:"sigma","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[42]||(e[42]=oe(c=>s.applyFormat("latex"),["stop"])),title:"Inline Math ($...$)",icon:"latex","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[43]||(e[43]=oe(c=>s.applyFormat("latexBlock"),["stop"])),title:"Display Math ($$...$$)",icon:"latexBlock","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),e[56]||(e[56]=b("div",{class:"my-1 border-t border-gray-200 dark:border-gray-600"},null,-1)),te(l,{title:"Numbered Environments",icon:"hash","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[44]||(e[44]=oe(c=>s.applyFormat("latexEnvEquation"),["stop"])),title:"Equation (Single line, numbered)",icon:"equation","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[45]||(e[45]=oe(c=>s.applyFormat("latexEnvAlign"),["stop"])),title:"Align (Multiple lines, aligned, numbered)",icon:"align","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[46]||(e[46]=oe(c=>s.applyFormat("latexEnvGather"),["stop"])),title:"Gather (Multiple lines, centered, numbered)",icon:"gather","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"]),te(l,{title:"Unnumbered Environments",icon:"minus-circle","svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:e[47]||(e[47]=oe(c=>s.applyFormat("latexEnvEquationStar"),["stop"])),title:"Equation* (Single line, unnumbered)",icon:"equation","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[48]||(e[48]=oe(c=>s.applyFormat("latexEnvAlignStar"),["stop"])),title:"Align* (Multiple lines, aligned, unnumbered)",icon:"align","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"]),te(o,{onClick:e[49]||(e[49]=oe(c=>s.applyFormat("latexEnvGatherStar"),["stop"])),title:"Gather* (Multiple lines, centered, unnumbered)",icon:"gather","svg-size-class":s.svgIconSizeClass},null,8,["svg-size-class"])]),_:1},8,["svg-size-class"])]),_:1},8,["button-class","svg-size-class"]),te(a,{title:"Insert",icon:"paperclip","button-class":s.toolbarButtonBaseClass,"svg-size-class":s.svgIconSizeClass},{default:Ie(()=>[te(o,{onClick:oe(s.insertImage,["stop"]),title:"Image",icon:"image","svg-size-class":s.svgIconSizeClass},null,8,["onClick","svg-size-class"])]),_:1},8,["button-class","svg-size-class"])],2),b("div",Dyr,null,512)],2)}const Iyr=st(Myr,[["render",Nyr]]),Hyr=0,Vyr=1,qyr=2,Uyr={name:"Message",emits:["delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:rT,Step:pyr,StatusIcon:vyr,RenderHTMLJS:Hvr,JsonViewer:iyr,DynamicUIRenderer:Ioe,ToolbarButton:oT,MarkdownEditor:Iyr},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,loading_svg:woe,audio_url:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,editMsgMode_:!1,originalContentBeforeEdit:"",editableContent:"",deleteMsgMode:!1}},mounted(){"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.loadVoices(),this.speechSynthesis.onvoiceschanged=this.loadVoices):console.error("Speech synthesis is not supported in this browser."),this.syncAudioUrlFromMetadata(),Fe(Re.replace)},updated(){Fe(Re.replace)},methods:{getImgUrl(){return this.avatar||Eo},defaultImg(t){t.target.src=Eo},getSenderDisplayName(){return this.isUserMessage?this.message.sender||"You":this.isSystemMessage?"System":this.message.sender},loadVoices(){this.speechSynthesis&&(this.voices=this.speechSynthesis.getVoices())},syncAudioUrlFromMetadata(){if(Array.isArray(this.message.metadata)){const t=this.message.metadata.find(e=>e==null?void 0:e.audio_url);this.audio_url=t?t.audio_url:null}else this.audio_url=null},toggleExpanded(){this.expanded=!this.expanded,Fe(Re.replace)},computeTimeDiff(t,e){let n=e.getTime()-t.getTime();const r=Math.floor(n/36e5);n-=r*36e5;const i=Math.floor(n/6e4);n-=i*6e4;const s=Math.floor(n/1e3);return[r,i,s]},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player&&this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Ae.post(`${this.host}/text2wav`,{text:this.message.content}).then(t=>{this.isSynthesizingVoice=!1;const e=t.data.url;this.audio_url=e,Array.isArray(this.message.metadata)||(this.message.metadata=[]);let n=this.message.metadata.find(r=>r&&typeof r=="object"&&r.hasOwnProperty("audio_url"));n?n.audio_url=e:this.message.metadata.push({audio_url:e}),Fe(()=>{this.$refs.audio_player&&(this.$refs.audio_player.load(),this.$refs.audio_player.play().catch(r=>console.error("Audio autoplay failed:",r)))})}).catch(t=>{this.$store.state.toast.showToast(`Error generating audio: ${t.message||t}`,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this.isSpeaking){if(this.$store.state.config.active_tts_service!=="browser"&&this.$store.state.config.active_tts_service!=="None")try{await Ae.post(`${this.host}/stop_audio`,{client_id:this.$store.state.client_id}),this.isSpeaking=!1}catch(e){this.$store.state.toast.showToast(`Error stopping audio: ${e.message||e}`,4,!1),this.isSpeaking=!1}else this.speechSynthesis&&(this.speechSynthesis.cancel(),this.isSpeaking=!1);return}this.isSpeaking=!0;const t=this.message.content;if(this.$store.state.config.active_tts_service!=="browser"&&this.$store.state.config.active_tts_service!=="None")Ae.post(`${this.host}/text2Audio`,{client_id:this.$store.state.client_id,text:t}).catch(e=>{this.$store.state.toast.showToast(`Error starting backend TTS: ${e.message||e}`,4,!1),this.isSpeaking=!1});else if(this.speechSynthesis&&t){let e=0;const n=180,r=this.voices.find(o=>o.name===this.$store.state.config.audio_out_voice),i=o=>{let a=t.substring(o,o+n);const l=[".","!","?",`
`,";",":"];let c=-1;return l.forEach(u=>{c=Math.max(c,a.lastIndexOf(u))}),c===-1&&(c=a.length===n?a.lastIndexOf(" ")>-1?a.lastIndexOf(" "):n-1:a.length-1),c+o+1},s=()=>{if(!this.isSpeaking||e>=t.length){this.isSpeaking=!1;return}const o=i(e),a=t.substring(e,o).trim();if(e=o,a){const l=new SpeechSynthesisUtterance(a);l.pitch=this.$store.state.config.audio_pitch||1,l.rate=this.$store.state.config.audio_rate||1,r&&(l.voice=r),l.onend=()=>setTimeout(s,50),l.onerror=c=>{console.error("Speech error:",c.error),this.isSpeaking=!1},this.speechSynthesis.speak(l)}else e{this.$store.state.toast.showToast("Message copied to clipboard!",4,!0)}).catch(t=>{this.$store.state.toast.showToast("Failed to copy message: "+t,4,!1)})},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},startEdit(){this.originalContentBeforeEdit=this.message.content,this.editableContent=this.message.content,this.editMsgMode=!0,Fe(()=>{this.$refs.markdownEditor&&this.$refs.markdownEditor.editorView&&this.$refs.markdownEditor.editorView.focus()})},cancelEdit(){this.editMsgMode=!1},updateMessage(){this.$emit("updateMessage",{id:this.message.id,content:this.editableContent,metadata:this.message.metadata}),this.editMsgMode=!1},resendMessage(t){this.$emit("resendMessage",this.message.id,this.message.content,t)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},prettyDate(t){if(!t)return"";try{const e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," "));if(isNaN(e))return t;const n=(new Date().getTime()-e.getTime())/1e3,r=Math.floor(n/86400);return r<0?e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):r===0?n<60?"just now":n<120?"1 minute ago":n<3600?Math.floor(n/60)+" minutes ago":n<7200?"1 hour ago":Math.floor(n/3600)+" hours ago":r===1?"Yesterday":r<7?r+" days ago":r<31?Math.ceil(r/7)+" weeks ago":e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return t}},checkForFullSentence(){const t=this.message.content.trim(),e=t.slice(-1);[".","!","?",`
-`].includes(e)&&t.split(/\s+/).length>2&&this.speak()}},watch:{"message.open":{handler(t){t===!0&&!this.editMsgMode_?this.startEdit():t===!1&&this.editMsgMode_&&this.cancelEdit()},immediate:!0},editMsgMode_(t){Fe(Re.replace)},audio_url(t){Fe(()=>{t&&this.$refs.audio_player&&this.$refs.audio_player.load()})},"message.content":function(t,e){this.$store.state.config.auto_speak&&!(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode)&&!this.isSpeaking&&t!==e&&!this.editMsgMode_&&this.checkForFullSentence(),this.editMsgMode_||(this.editableContent=t)},"message.ui":function(t,e){JSON.stringify(t)!==JSON.stringify(e)&&this.ui_componentKey++},"message.metadata":{handler(){this.syncAudioUrlFromMetadata()},deep:!0},deleteMsgMode(){Fe(Re.replace)}},computed:{isUserMessage(){return this.message.sender_type===Iyr},isSystemMessage(){return this.message.sender_type===Vyr},isAiMessage(){return this.message.sender_type===Hyr},editorTheme(){return this.$store.state.config.darkMode?wS:tt.baseTheme({})},editMsgMode:{get(){return this.editMsgMode_},set(t){this.editMsgMode_!==t&&(this.editMsgMode_=t,this.message&&typeof this.message=="object"&&this.message.hasOwnProperty("open")&&this.message.open!==t&&(this.message.open=t))}},activeStepIndex(){return Array.isArray(this.message.steps)?this.message.steps.findIndex(t=>!t.done):-1},isProcessingSteps(){return this.activeStepIndex!==-1},headerStepText(){return!Array.isArray(this.message.steps)||this.message.steps.length===0?this.message.status_message||"Processing Steps":this.isProcessingSteps&&this.message.steps[this.activeStepIndex]?this.message.steps[this.activeStepIndex].text||"Processing...":this.message.status_message&&this.message.status_message!=="Thinking..."?this.message.status_message:"Processing Complete"},finalStepsStatus(){if(!Array.isArray(this.message.steps)||this.isProcessingSteps||this.message.steps.length===0)return null;if(this.message.steps.find(n=>n.status===!1))return!1;const e=(this.message.status_message||"").toLowerCase();return!(e.includes("error")||e.includes("fail"))},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){try{return new Date(Date.parse(this.message.created_at)).toLocaleString()}catch{return this.message.created_at}},finished_generating_at_parsed(){try{return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()}catch{return this.message.finished_generating_at}},time_spent(){if(!(!this.message.started_generating_at||!this.message.finished_generating_at))try{const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(isNaN(t)||isNaN(e)||e<=t)return"0s";let[n,r,i]=this.computeTimeDiff(t,e);const s=a=>a<10?"0"+a:a;let o=[];return n>0&&o.push(s(n)+"h"),r>0&&o.push(s(r)+"m"),o.push(s(i)+"s"),o.join(":")}catch{return}},warmup_duration(){if(!(!this.message.created_at||!this.message.started_generating_at))try{const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(isNaN(t)||isNaN(e)||e<=t)return"0s";let[n,r,i]=this.computeTimeDiff(t,e);const s=a=>a<10?"0"+a:a;let o=[];return n>0&&o.push(s(n)+"h"),r>0&&o.push(s(r)+"m"),o.push(s(i)+"s"),o.join(":")}catch{return}},generation_rate(){if(!(!this.message.started_generating_at||!this.message.finished_generating_at||!this.message.nb_tokens||this.message.nb_tokens<=0))try{const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(isNaN(t)||isNaN(e))return;const n=e.getTime()-t.getTime();if(n<=0)return;const r=n/1e3;return Math.round(this.message.nb_tokens/r)+" t/s"}catch{return}}}},Uyr={key:0,class:"message system-message text-center text-sm text-gray-600 dark:text-slate-400 py-2 px-4 my-1 rounded-md bg-gray-100 dark:bg-slate-750"},Byr=["title"],zyr={class:"flex-shrink-0"},Xyr={class:"group/avatar"},Fyr=["src","data-popover-target"],jyr={class:"flex flex-col w-full flex-grow min-w-0"},Yyr={class:"message-header font-semibold"},Gyr=["title"],Wyr={class:"message-content overflow-x-auto w-full overflow-y-auto scrollbar space-y-2 text-left"},Zyr={key:1,class:"w-full text-left"},Kyr={key:2,class:"flex flex-col gap-2 mt-2 w-full items-start"},Jyr=["src"],ebr={class:"w-5 h-5 mr-2 flex-shrink-0 flex items-center justify-center"},tbr={key:"header-spinner",class:"step-spinner"},nbr={key:"header-success",class:"step-icon-success w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},rbr={key:"header-fail",class:"step-icon-fail w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},ibr={key:"header-unknown",class:"w-4 h-4 text-gray-400 dark:text-slate-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},sbr={class:"steps-status truncate pr-2 text-sm"},obr={key:0,class:"steps-content text-left"},abr={key:1,class:"mt-2 flex flex-col w-full overflow-y-auto scrollbar items-start"},lbr={class:"message-toolbar"},cbr={key:0,class:"flex items-center gap-1"},ubr={key:1,class:"flex items-center gap-1"},dbr={key:0,class:"flex items-center gap-1"},fbr={key:1,class:"flex items-center gap-1"},hbr={key:2,class:"flex items-center gap-1"},pbr={class:"flex items-center"},Tbr={key:4,class:"flex items-center gap-1"},Obr={key:5,class:"flex items-center gap-1"},mbr=["src"],gbr={key:0,class:"message-footer w-full mt-1"},Qbr={key:0,class:"footer-item"},_br={class:"footer-value"},vbr={key:1,class:"footer-item"},ybr={class:"footer-value"},bbr={key:2,class:"footer-item"},Sbr={class:"footer-value"},xbr={key:3,class:"footer-item"},Ebr={class:"footer-value"},wbr={key:4,class:"footer-item"},Cbr={class:"footer-value"},Lbr={key:5,class:"footer-item"},$br={class:"footer-value"},Abr={key:6,class:"footer-item"},kbr={class:"footer-value"};function Pbr(t,e,n,r,i,s){var h;const o=Xe("MarkdownRenderer"),a=Xe("MarkdownEditor"),l=Xe("JsonViewer"),c=Xe("DynamicUIRenderer"),u=Xe("Step"),d=Xe("RenderHTMLJS"),f=Xe("ToolbarButton");return s.isSystemMessage?(k(),R("div",Uyr,[te(o,{ref:"mdRender",host:n.host,"markdown-text":n.message.content,"onUpdate:markdownText":e[0]||(e[0]=p=>n.message.content=p),message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"]),n.message.created_at?(k(),R("div",{key:0,class:"text-xs font-thin mt-1",title:"Created at: "+s.created_at_parsed},ae(s.created_at),9,Byr)):ne("",!0)])):(k(),R("div",{key:1,class:ye(["message group relative border-2 border-transparent rounded-lg transition-colors duration-150 ease-in-out p-3 my-1",s.isUserMessage?"bg-blue-50 dark:bg-slate-800 hover:border-blue-400 dark:hover:border-sky-500":"bg-white dark:bg-slate-900 hover:border-blue-400 dark:hover:border-sky-500"])},[b("div",{class:ye(["flex gap-3",s.isUserMessage?"flex-row-reverse":"flex-row"])},[b("div",zyr,[b("div",Xyr,[b("img",{src:s.getImgUrl(),onError:e[1]||(e[1]=p=>s.defaultImg(p)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-cover border border-blue-300 dark:border-slate-600"},null,40,Fyr)])]),b("div",jyr,[b("div",{class:ye(["flex flex-row flex-grow items-start mb-1",s.isUserMessage?"justify-end":""])},[b("div",{class:ye(["flex flex-col",s.isUserMessage?"items-end":"items-start"])},[b("div",Yyr,ae(s.getSenderDisplayName()),1),n.message.created_at?(k(),R("div",{key:0,class:"text-xs text-blue-500 dark:text-slate-400 font-thin",title:"Created at: "+s.created_at_parsed},ae(s.created_at),9,Gyr)):ne("",!0)],2)],2),b("div",Wyr,[s.editMsgMode?ne("",!0):(k(),Qt(o,{key:0,ref:"mdRender",host:n.host,"markdown-text":n.message.content,"onUpdate:markdownText":e[2]||(e[2]=p=>n.message.content=p),message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),s.editMsgMode?(k(),R("div",Zyr,[te(a,{ref:"markdownEditor",modelValue:i.editableContent,"onUpdate:modelValue":e[3]||(e[3]=p=>i.editableContent=p),theme:s.editorTheme,"editor-class":"min-h-[150px] max-h-[70vh] message-editor-content","toolbar-class":"md-editor-toolbar-theme","button-class":"md-editor-button-theme","toolbar-button-icon-size":16},null,8,["modelValue","theme"])])):ne("",!0),n.message.metadata!==null&&!s.editMsgMode?(k(),R("div",Kyr,[(k(!0),R(Ve,null,dt(((h=n.message.metadata)==null?void 0:h.filter(p=>(p==null?void 0:p.title)&&(p==null?void 0:p.content)))||[],(p,T)=>(k(),R("div",{key:"json-"+n.message.id+"-"+T,class:"max-w-full"},[(k(),Qt(l,{title:p.title,data:p.content,key:"msgjson-"+n.message.id},null,8,["title","data"]))]))),128))])):ne("",!0),n.message.ui&&!s.editMsgMode?(k(),Qt(c,{ref:"ui",class:"w-full mt-2",ui:n.message.ui,key:"msgui-"+n.message.id+"-"+i.ui_componentKey},null,8,["ui"])):ne("",!0),i.audio_url!=null&&!s.editMsgMode?(k(),R("audio",{controls:"",class:"w-full mt-2",key:i.audio_url},[b("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,Jyr),e[15]||(e[15]=Se(" Your browser does not support the audio element. "))])):ne("",!0),b("div",{class:ye(["message-details w-full mt-2",{"flex flex-col items-end":s.isUserMessage}])},[n.message.steps&&n.message.steps.length>0&&!s.editMsgMode?(k(),R("div",{key:0,class:ye(["steps-container w-full max-w-4xl",s.isUserMessage?"ml-auto":"mr-auto"])},[b("div",{class:"steps-header",onClick:e[4]||(e[4]=(...p)=>s.toggleExpanded&&s.toggleExpanded(...p))},[b("div",ebr,[te(cr,{name:"fade-icon",mode:"out-in"},{default:Ie(()=>[s.isProcessingSteps?(k(),R("div",tbr)):s.finalStepsStatus===!0?(k(),R("svg",nbr,e[16]||(e[16]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)]))):s.finalStepsStatus===!1?(k(),R("svg",rbr,e[17]||(e[17]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1)]))):(k(),R("svg",ibr,e[18]||(e[18]=[b("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"},null,-1)])))]),_:1})]),b("span",sbr,ae(s.headerStepText),1),b("span",{class:ye(["toggle-icon text-xs transform transition-transform duration-200 ml-auto",{"rotate-180":i.expanded}])},e[19]||(e[19]=[b("i",{"data-feather":"chevron-down",class:"w-5 h-5"},null,-1)]),2)]),te(cr,{"enter-active-class":"transition-all duration-300 ease-out overflow-hidden","leave-active-class":"transition-all duration-200 ease-in overflow-hidden","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[500px]","leave-from-class":"opacity-100 max-h-[500px]","leave-to-class":"opacity-0 max-h-0"},{default:Ie(()=>[i.expanded?(k(),R("div",obr,[(k(!0),R(Ve,null,dt(n.message.steps,(p,T)=>(k(),R("div",{key:`step-${n.message.id}-${T}`,class:"step-item animate-step-slide-in",style:qn({animationDelay:`${T*80}ms`})},[te(u,{done:p.done,text:p.text,status:p.status,description:p.description},null,8,["done","text","status","description"])],4))),128))])):ne("",!0)]),_:1})],2)):ne("",!0),n.message.html_js_s&&n.message.html_js_s.length&&!s.editMsgMode?(k(),R("div",abr,[(k(!0),R(Ve,null,dt(n.message.html_js_s,(p,T)=>(k(),R("div",{key:`htmljs-${n.message.id}-${T}`,class:"w-full animate-fadeIn",style:qn({animationDelay:`${T*200}ms`})},[te(d,{htmlContent:p},null,8,["htmlContent"])],4))),128))])):ne("",!0)],2)]),b("div",{class:ye(["message-toolbar-wrapper flex w-full mt-1",[s.isUserMessage?"justify-end":"justify-start"]])},[b("div",lbr,[s.editMsgMode?(k(),R("div",cbr,[te(f,{onClick:oe(s.cancelEdit,["stop"]),title:"Cancel edit",icon:"x",class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"},null,8,["onClick"]),te(f,{onClick:oe(s.updateMessage,["stop"]),title:"Update message",icon:"check",class:"svg-button text-green-500 hover:bg-green-100 dark:hover:bg-green-900"},null,8,["onClick"])])):(k(),R("div",ubr,[te(f,{onClick:oe(s.startEdit,["stop"]),title:"Edit message",icon:"edit",class:"svg-button toolbar-button"},null,8,["onClick"]),te(f,{onClick:s.copyContentToClipboard,title:"Copy message to clipboard",icon:"copy",class:"svg-button toolbar-button"},null,8,["onClick"]),s.isUserMessage?(k(),R("div",dbr,[te(f,{onClick:e[5]||(e[5]=oe(p=>s.resendMessage("full_context"),["stop"])),title:"Resend message with full context",icon:"send",class:"svg-button toolbar-button"}),te(f,{onClick:e[6]||(e[6]=oe(p=>s.resendMessage("full_context_with_internet"),["stop"])),title:"Resend message with internet search",icon:"globe",class:"svg-button toolbar-button"}),te(f,{onClick:e[7]||(e[7]=oe(p=>s.resendMessage("simple_question"),["stop"])),title:"Resend message without context",icon:"refresh-cw",class:"svg-button toolbar-button"})])):ne("",!0),s.isAiMessage?(k(),R("div",fbr,[te(f,{onClick:oe(s.continueMessage,["stop"]),title:"Continue message",icon:"fast-forward",class:"svg-button toolbar-button"},null,8,["onClick"])])):ne("",!0),i.deleteMsgMode?(k(),R("div",hbr,[te(f,{onClick:e[8]||(e[8]=oe(p=>i.deleteMsgMode=!1,["stop"])),title:"Cancel removal",icon:"x",class:"svg-button toolbar-button text-blue-500 hover:bg-blue-100 dark:hover:bg-blue-700"}),te(f,{onClick:e[9]||(e[9]=oe(p=>s.deleteMsg(),["stop"])),title:"Confirm removal",icon:"check",class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"})])):(k(),Qt(f,{key:3,title:"Remove message",icon:"trash",onClick:e[10]||(e[10]=p=>i.deleteMsgMode=!0),class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"})),te(f,{onClick:e[11]||(e[11]=oe(p=>s.rankUp(),["stop"])),title:"Upvote",icon:"thumbs-up",class:"svg-button toolbar-button text-blue-500 dark:text-blue-400"}),b("div",pbr,[te(f,{onClick:e[12]||(e[12]=oe(p=>s.rankDown(),["stop"])),title:"Downvote",icon:"thumbs-down",class:"svg-button text-red-500 dark:text-red-400"}),n.message.rank!=0?(k(),R("div",{key:0,class:ye(["text-xs font-bold rounded-full px-1.5 py-0.5 flex items-center justify-center cursor-default ml-0.5",n.message.rank>0?"bg-blue-500 text-white":"bg-red-500 text-white"]),title:"Rank"},ae(n.message.rank),3)):ne("",!0)]),this.$store.state.config.active_tts_service!="None"?(k(),R("div",Tbr,[te(f,{title:"Speak message",icon:"volume-2",onClick:e[13]||(e[13]=oe(p=>s.speak(),["stop"])),class:ye(["svg-button toolbar-button",{"text-red-500 dark:text-red-400 animate-pulse":i.isSpeaking}])},null,8,["class"])])):ne("",!0),!s.isUserMessage&&this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(k(),R("div",Obr,[i.isSynthesizingVoice?(k(),R("img",{key:1,src:i.loading_svg,class:"w-5 h-5 animate-spin text-blue-500 dark:text-sky-400"},null,8,mbr)):(k(),Qt(f,{key:0,title:"Generate audio",icon:"mic",onClick:e[14]||(e[14]=oe(p=>s.read(),["stop"])),class:"svg-button toolbar-button"}))])):ne("",!0)]))])],2),s.isUserMessage?ne("",!0):(k(),R("div",gbr,[b("div",{class:ye(["flex flex-row flex-wrap items-center gap-x-3 gap-y-1",[s.isUserMessage?"justify-end":"justify-start"]])},[n.message.binding?(k(),R("p",Qbr,[e[20]||(e[20]=Se("Binding: ")),b("span",_br,ae(n.message.binding),1)])):ne("",!0),n.message.model?(k(),R("p",vbr,[e[21]||(e[21]=Se("Model: ")),b("span",ybr,ae(n.message.model),1)])):ne("",!0),n.message.seed?(k(),R("p",bbr,[e[22]||(e[22]=Se("Seed: ")),b("span",Sbr,ae(n.message.seed),1)])):ne("",!0),n.message.nb_tokens?(k(),R("p",xbr,[e[23]||(e[23]=Se("Tokens: ")),b("span",Ebr,ae(n.message.nb_tokens),1)])):ne("",!0),s.warmup_duration?(k(),R("p",wbr,[e[24]||(e[24]=Se("Warmup: ")),b("span",Cbr,ae(s.warmup_duration),1)])):ne("",!0),s.time_spent?(k(),R("p",Lbr,[e[25]||(e[25]=Se("Gen time: ")),b("span",$br,ae(s.time_spent),1)])):ne("",!0),s.generation_rate?(k(),R("p",Abr,[e[26]||(e[26]=Se("Rate: ")),b("span",kbr,ae(s.generation_rate),1)])):ne("",!0)],2)]))])],2)],2))}const Rbr=st(qyr,[["render",Pbr],["__scopeId","data-v-1cfbb6ba"]]),Mbr={name:"CommandMenu",props:{commandsList:{type:Array,required:!0,default:()=>[]},sendCommand:{type:Function,required:!0},showSettings:{type:Function,default:void 0},help:{type:String,default:"Select Command"},icon:{type:String,default:"feather:tool"},buttonLabel:{type:String,default:""}},data(){return{loading:!1,showMenu:!1,menuPosition:"below",searchTerm:"",recentlyClicked:null,clickTimeout:null}},computed:{isAnyCommandChecked(){return this.commandsList.some(t=>t.is_checked)},iconParts(){return this.parseIconString(this.icon)},filteredCommandsList(){if(!this.searchTerm)return this.commandsList;const t=this.searchTerm.toLowerCase(),e=n=>{const r=document.createElement("DIV");return r.innerHTML=n,r.textContent||r.innerText||""};return this.commandsList.filter(n=>e(n.name).toLowerCase().includes(t))}},methods:{parseIconString(t){if(!t)return{type:null,value:null};const e=t.split(":"),n=e[0],r=e.slice(1).join(":");return["feather","img","b64"].includes(n)?{type:n,value:r}:{type:"feather",value:t}},cmdIconType(t){return this.parseIconString(t).type},cmdIconValue(t){return this.parseIconString(t).value},handleSelect(t){t.is_checked!==void 0&&(t.is_checked=!t.is_checked),this.sendCommand(t.value),this.recentlyClicked=t.value,this.closeMenu(),this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=setTimeout(()=>{this.recentlyClicked=null},300)},handleShowSettings(t){this.showSettings&&typeof this.showSettings=="function"&&(this.showSettings(t),this.closeMenu())},toggleMenu(){this.showMenu=!this.showMenu,this.showMenu&&(this.searchTerm="",this.$nextTick(()=>{var t;this.calculatePosition(),this.replaceFeatherIcons(),(t=this.$refs.searchInput)==null||t.focus()}))},closeMenu(){this.showMenu=!1,this.searchTerm=""},calculatePosition(){!this.$refs.menuContainer||!this.showMenu||this.$nextTick(()=>{if(!this.$refs.menu)return;const t=this.$refs.menuContainer.getBoundingClientRect(),e=Math.min(this.$refs.menu.scrollHeight,480),n=window.innerHeight-t.bottom,r=t.top,i=10;this.menuPosition=nn?"above":"below"})},handleClickOutside(t){this.$refs.menuContainer&&!this.$refs.menuContainer.contains(t.target)&&this.closeMenu()},replaceFeatherIcons(){this.$nextTick(()=>{Re.replace({width:"1em",height:"1em","stroke-width":2})})},highlightMatch(t){if(!this.searchTerm)return t;const e=(()=>{const c=document.createElement("div");return c.innerHTML=t,c.textContent||c.innerText||""})(),n=e.toLowerCase(),r=this.searchTerm.toLowerCase(),i=n.indexOf(r);if(i===-1)return t;const s=e.substring(0,i),o=e.substring(i,i+this.searchTerm.length),a=e.substring(i+this.searchTerm.length),l=c=>c.replace(/&/g,"&").replace(//g,">").replace(/"/g,'"').replace(/'/g,"'");return`${l(s)}${l(o)} ${l(a)}`}},watch:{filteredCommandsList(){this.showMenu&&this.$nextTick(()=>{this.calculatePosition(),this.replaceFeatherIcons()})},searchTerm(){this.showMenu&&(this.replaceFeatherIcons(),this.$nextTick(()=>this.calculatePosition()))},showMenu(t){t&&this.$nextTick(()=>this.calculatePosition())}},mounted(){document.addEventListener("click",this.handleClickOutside,!0),window.addEventListener("resize",this.calculatePosition),this.replaceFeatherIcons()},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside,!0),window.removeEventListener("resize",this.calculatePosition),this.clickTimeout&&clearTimeout(this.clickTimeout)}},Dbr={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},Nbr={key:1,class:"relative",ref:"menuContainer"},Ibr=["title"],Hbr=["data-feather"],Vbr=["src"],qbr=["src"],Ubr={key:0,class:"p-2 sticky top-0 bg-white dark:bg-gray-800 z-10 border-b border-gray-200 dark:border-gray-700 flex-shrink-0"},Bbr={class:"custom-scrollbar overflow-y-auto flex-grow"},zbr={class:"divide-y divide-gray-100 dark:divide-gray-700 px-1 py-1"},Xbr=["title","onClick"],Fbr={key:0,class:"mr-3 flex-shrink-0 relative h-4 w-4"},jbr=["checked","id"],Ybr=["for"],Gbr={key:0,class:"h-3 w-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Wbr={key:1,class:"mr-2 flex-shrink-0 w-4 h-4"},Zbr=["data-feather"],Kbr=["src"],Jbr=["src"],eSr=["innerHTML"],tSr=["onClick"];function nSr(t,e,n,r,i,s){return i.loading?(k(),R("div",Dbr,e[3]||(e[3]=[b("svg",{class:"animate-spin h-5 w-5 text-blue-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[b("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),b("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)]))):(k(),R("div",Nbr,[b("button",{onClick:e[0]||(e[0]=(...o)=>s.toggleMenu&&s.toggleMenu(...o)),class:ye(["flex items-center gap-2 px-4 py-2 text-white rounded-lg transition-all duration-300 shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-400 dark:focus:ring-offset-gray-900",{"bg-blue-600 hover:bg-blue-700":!s.isAnyCommandChecked,"bg-yellow-400 hover:bg-yellow-500 text-gray-800":s.isAnyCommandChecked}]),title:n.help},[n.icon?(k(),R(Ve,{key:0},[s.iconParts.type==="feather"?(k(),R("i",{key:0,"data-feather":s.iconParts.value,class:"w-4 h-4"},null,8,Hbr)):s.iconParts.type==="img"?(k(),R("img",{key:1,src:s.iconParts.value,class:"w-4 h-4",alt:"Icon"},null,8,Vbr)):s.iconParts.type==="b64"?(k(),R("img",{key:2,src:"data:image/png;base64,"+s.iconParts.value,class:"w-4 h-4",alt:"Icon"},null,8,qbr)):ne("",!0)],64)):ne("",!0),b("span",null,ae(n.buttonLabel),1),(k(),R("svg",{class:ye(["w-4 h-4 transform transition-transform duration-200",{"rotate-180":i.showMenu}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[4]||(e[4]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],10,Ibr),te(cr,{"enter-active-class":"transition-opacity duration-200 ease-out","leave-active-class":"transition-opacity duration-150 ease-in","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:Ie(()=>[i.showMenu?(k(),R("div",{key:0,ref:"menu",class:ye(["absolute z-50 mt-2 w-80 origin-top-right rounded-lg bg-white dark:bg-gray-800 shadow-xl ring-1 ring-black ring-opacity-5 focus:outline-none flex flex-col overflow-hidden",i.menuPosition==="above"?"bottom-full mb-2":"top-full"]),style:{"max-height":"calc(28rem + 3rem)"}},[n.commandsList.length>10?(k(),R("div",Ubr,[He(b("input",{ref:"searchInput",type:"search","onUpdate:modelValue":e[1]||(e[1]=o=>i.searchTerm=o),placeholder:"Search commands...",class:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 dark:bg-gray-700 dark:text-gray-200",onClick:e[2]||(e[2]=oe(()=>{},["stop"]))},null,512),[[vt,i.searchTerm]])])):ne("",!0),b("div",Bbr,[b("ul",zbr,[(k(!0),R(Ve,null,dt(s.filteredCommandsList,o=>(k(),R("li",{key:o.value||o.name,class:ye(["group flex items-center justify-between w-full text-sm rounded-md hover:bg-blue-50 dark:hover:bg-gray-700 transition-colors duration-150",{"bg-blue-50 dark:bg-gray-700":o.value===i.recentlyClicked}])},[b("button",{title:o.help,onClick:a=>s.handleSelect(o),class:"flex items-center flex-1 min-w-0 px-3 py-2 text-gray-700 dark:text-gray-200 group-hover:text-blue-700 dark:group-hover:text-blue-300"},[o.is_checked!==void 0?(k(),R("span",Fbr,[b("input",{type:"checkbox",checked:o.is_checked,class:"opacity-0 absolute h-full w-full cursor-pointer",id:`checkbox-${o.value||o.name}`,tabindex:"-1"},null,8,jbr),b("label",{for:`checkbox-${o.value||o.name}`,class:ye(["flex items-center justify-center h-4 w-4 border-2 border-gray-400 dark:border-gray-500 rounded-sm cursor-pointer transition-all duration-200 group-hover:border-blue-500",{"bg-blue-500 border-blue-500 dark:border-blue-400 dark:bg-blue-400":o.is_checked}])},[o.is_checked?(k(),R("svg",Gbr,e[5]||(e[5]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)]))):ne("",!0)],10,Ybr)])):ne("",!0),o.icon?(k(),R("span",Wbr,[s.cmdIconType(o.icon)==="feather"?(k(),R("i",{key:0,"data-feather":s.cmdIconValue(o.icon),class:"w-full h-full"},null,8,Zbr)):s.cmdIconType(o.icon)==="img"?(k(),R("img",{key:1,src:s.cmdIconValue(o.icon),class:"w-full h-full object-contain",alt:""},null,8,Kbr)):s.cmdIconType(o.icon)==="b64"?(k(),R("img",{key:2,src:`data:image/png;base64,${s.cmdIconValue(o.icon)}`,class:"w-full h-full object-contain",alt:""},null,8,Jbr)):ne("",!0)])):ne("",!0),b("span",{innerHTML:s.highlightMatch(o.name),class:"truncate flex-1 text-left"},null,8,eSr)],8,Xbr),n.showSettings&&typeof n.showSettings=="function"?(k(),R("button",{key:0,onClick:oe(a=>s.handleShowSettings(o),["stop"]),class:"text-gray-400 hover:text-green-600 dark:hover:text-green-400 transition duration-150 flex-shrink-0 p-2 mr-1 focus:outline-none opacity-0 group-hover:opacity-100",title:"Settings",tabindex:"-1"},e[6]||(e[6]=[b("i",{"data-feather":"settings",class:"h-4 w-4"},null,-1)]),8,tSr)):ne("",!0)],2))),128))])])],2)):ne("",!0)]),_:1})],512))}const rSr=st(Mbr,[["render",nSr],["__scopeId","data-v-4e649fe6"]]),qoe="https://cdn.jsdelivr.net/npm/emoji-datasource-apple@6.0.1/img/apple/64",Uoe={recent:"Recently used",smileys_people:"Smiles & People",animals_nature:"Animals & Nature",food_drink:"Food & Drink",activities:"Activities",travel_places:"Travel places",objects:"Objects",symbols:"Symbols",flags:"Flags"},Boe="u",lT="n",G8="v",Yf="r",iSr={[lT]:["grinning face","grinning"],[Boe]:"1f600",[Yf]:"1f600"},j9="neutral",sSr="1f3fb",oSr="1f3fc",aSr="1f3fd",lSr="1f3fe",cSr="1f3ff",uSr=[j9,sSr,oSr,aSr,lSr,cSr],dSr={placeholder:"Search emoji",skinTone:"Skin tone"},fSr=["light","dark","auto"],hSr=[{n:["grinning face","grinning"],u:"1f600"},{n:["grinning face with smiling eyes","grin"],u:"1f601"},{n:["face with tears of joy","joy"],u:"1f602"},{n:["rolling on the floor laughing","rolling_on_the_floor_laughing"],u:"1f923"},{n:["smiling face with open mouth","smiley"],u:"1f603"},{n:["smiling face with open mouth and smiling eyes","smile"],u:"1f604"},{n:["smiling face with open mouth and cold sweat","sweat_smile"],u:"1f605"},{n:["smiling face with open mouth and tightly-closed eyes","laughing","satisfied"],u:"1f606"},{n:["winking face","wink"],u:"1f609"},{n:["smiling face with smiling eyes","blush"],u:"1f60a"},{n:["face savouring delicious food","yum"],u:"1f60b"},{n:["smiling face with sunglasses","sunglasses"],u:"1f60e"},{n:["smiling face with heart-shaped eyes","heart_eyes"],u:"1f60d"},{n:["face throwing a kiss","kissing_heart"],u:"1f618"},{n:["kissing face","kissing"],u:"1f617"},{n:["kissing face with smiling eyes","kissing_smiling_eyes"],u:"1f619"},{n:["kissing face with closed eyes","kissing_closed_eyes"],u:"1f61a"},{n:["white smiling face","relaxed"],u:"263a-fe0f"},{n:["slightly smiling face","slightly_smiling_face"],u:"1f642"},{n:["hugging face","hugging_face"],u:"1f917"},{n:["grinning face with star eyes","star-struck","grinning_face_with_star_eyes"],u:"1f929"},{n:["thinking face","thinking_face"],u:"1f914"},{n:["face with one eyebrow raised","face_with_raised_eyebrow","face_with_one_eyebrow_raised"],u:"1f928"},{n:["neutral face","neutral_face"],u:"1f610"},{n:["expressionless face","expressionless"],u:"1f611"},{n:["face without mouth","no_mouth"],u:"1f636"},{n:["face with rolling eyes","face_with_rolling_eyes"],u:"1f644"},{n:["smirking face","smirk"],u:"1f60f"},{n:["persevering face","persevere"],u:"1f623"},{n:["disappointed but relieved face","disappointed_relieved"],u:"1f625"},{n:["face with open mouth","open_mouth"],u:"1f62e"},{n:["zipper-mouth face","zipper_mouth_face"],u:"1f910"},{n:["hushed face","hushed"],u:"1f62f"},{n:["sleepy face","sleepy"],u:"1f62a"},{n:["tired face","tired_face"],u:"1f62b"},{n:["sleeping face","sleeping"],u:"1f634"},{n:["relieved face","relieved"],u:"1f60c"},{n:["face with stuck-out tongue","stuck_out_tongue"],u:"1f61b"},{n:["face with stuck-out tongue and winking eye","stuck_out_tongue_winking_eye"],u:"1f61c"},{n:["face with stuck-out tongue and tightly-closed eyes","stuck_out_tongue_closed_eyes"],u:"1f61d"},{n:["drooling face","drooling_face"],u:"1f924"},{n:["unamused face","unamused"],u:"1f612"},{n:["face with cold sweat","sweat"],u:"1f613"},{n:["pensive face","pensive"],u:"1f614"},{n:["confused face","confused"],u:"1f615"},{n:["upside-down face","upside_down_face"],u:"1f643"},{n:["money-mouth face","money_mouth_face"],u:"1f911"},{n:["astonished face","astonished"],u:"1f632"},{n:["white_frowning_face"],u:"2639-fe0f"},{n:["slightly frowning face","slightly_frowning_face"],u:"1f641"},{n:["confounded face","confounded"],u:"1f616"},{n:["disappointed face","disappointed"],u:"1f61e"},{n:["worried face","worried"],u:"1f61f"},{n:["face with look of triumph","triumph"],u:"1f624"},{n:["crying face","cry"],u:"1f622"},{n:["loudly crying face","sob"],u:"1f62d"},{n:["frowning face with open mouth","frowning"],u:"1f626"},{n:["anguished face","anguished"],u:"1f627"},{n:["fearful face","fearful"],u:"1f628"},{n:["weary face","weary"],u:"1f629"},{n:["shocked face with exploding head","exploding_head","shocked_face_with_exploding_head"],u:"1f92f"},{n:["grimacing face","grimacing"],u:"1f62c"},{n:["face with open mouth and cold sweat","cold_sweat"],u:"1f630"},{n:["face screaming in fear","scream"],u:"1f631"},{n:["flushed face","flushed"],u:"1f633"},{n:["grinning face with one large and one small eye","zany_face","grinning_face_with_one_large_and_one_small_eye"],u:"1f92a"},{n:["dizzy face","dizzy_face"],u:"1f635"},{n:["pouting face","rage"],u:"1f621"},{n:["angry face","angry"],u:"1f620"},{n:["serious face with symbols covering mouth","face_with_symbols_on_mouth","serious_face_with_symbols_covering_mouth"],u:"1f92c"},{n:["face with medical mask","mask"],u:"1f637"},{n:["face with thermometer","face_with_thermometer"],u:"1f912"},{n:["face with head-bandage","face_with_head_bandage"],u:"1f915"},{n:["nauseated face","nauseated_face"],u:"1f922"},{n:["face with open mouth vomiting","face_vomiting","face_with_open_mouth_vomiting"],u:"1f92e"},{n:["sneezing face","sneezing_face"],u:"1f927"},{n:["smiling face with halo","innocent"],u:"1f607"},{n:["face with cowboy hat","face_with_cowboy_hat"],u:"1f920"},{n:["clown face","clown_face"],u:"1f921"},{n:["lying face","lying_face"],u:"1f925"},{n:["face with finger covering closed lips","shushing_face","face_with_finger_covering_closed_lips"],u:"1f92b"},{n:["smiling face with smiling eyes and hand covering mouth","face_with_hand_over_mouth","smiling_face_with_smiling_eyes_and_hand_covering_mouth"],u:"1f92d"},{n:["face with monocle","face_with_monocle"],u:"1f9d0"},{n:["nerd face","nerd_face"],u:"1f913"},{n:["smiling face with horns","smiling_imp"],u:"1f608"},{n:["imp"],u:"1f47f"},{n:["japanese ogre","japanese_ogre"],u:"1f479"},{n:["japanese goblin","japanese_goblin"],u:"1f47a"},{n:["skull"],u:"1f480"},{n:["skull_and_crossbones"],u:"2620-fe0f"},{n:["ghost"],u:"1f47b"},{n:["extraterrestrial alien","alien"],u:"1f47d"},{n:["alien monster","space_invader"],u:"1f47e"},{n:["robot face","robot_face"],u:"1f916"},{n:["pile of poo","hankey","poop","shit"],u:"1f4a9"},{n:["smiling cat face with open mouth","smiley_cat"],u:"1f63a"},{n:["grinning cat face with smiling eyes","smile_cat"],u:"1f638"},{n:["cat face with tears of joy","joy_cat"],u:"1f639"},{n:["smiling cat face with heart-shaped eyes","heart_eyes_cat"],u:"1f63b"},{n:["cat face with wry smile","smirk_cat"],u:"1f63c"},{n:["kissing cat face with closed eyes","kissing_cat"],u:"1f63d"},{n:["weary cat face","scream_cat"],u:"1f640"},{n:["crying cat face","crying_cat_face"],u:"1f63f"},{n:["pouting cat face","pouting_cat"],u:"1f63e"},{n:["see-no-evil monkey","see_no_evil"],u:"1f648"},{n:["hear-no-evil monkey","hear_no_evil"],u:"1f649"},{n:["speak-no-evil monkey","speak_no_evil"],u:"1f64a"},{n:["baby"],u:"1f476",v:["1f476-1f3fb","1f476-1f3fc","1f476-1f3fd","1f476-1f3fe","1f476-1f3ff"]},{n:["child"],u:"1f9d2",v:["1f9d2-1f3fb","1f9d2-1f3fc","1f9d2-1f3fd","1f9d2-1f3fe","1f9d2-1f3ff"]},{n:["boy"],u:"1f466",v:["1f466-1f3fb","1f466-1f3fc","1f466-1f3fd","1f466-1f3fe","1f466-1f3ff"]},{n:["girl"],u:"1f467",v:["1f467-1f3fb","1f467-1f3fc","1f467-1f3fd","1f467-1f3fe","1f467-1f3ff"]},{n:["adult"],u:"1f9d1",v:["1f9d1-1f3fb","1f9d1-1f3fc","1f9d1-1f3fd","1f9d1-1f3fe","1f9d1-1f3ff"]},{n:["man"],u:"1f468",v:["1f468-1f3fb","1f468-1f3fc","1f468-1f3fd","1f468-1f3fe","1f468-1f3ff"]},{n:["woman"],u:"1f469",v:["1f469-1f3fb","1f469-1f3fc","1f469-1f3fd","1f469-1f3fe","1f469-1f3ff"]},{n:["older adult","older_adult"],u:"1f9d3",v:["1f9d3-1f3fb","1f9d3-1f3fc","1f9d3-1f3fd","1f9d3-1f3fe","1f9d3-1f3ff"]},{n:["older man","older_man"],u:"1f474",v:["1f474-1f3fb","1f474-1f3fc","1f474-1f3fd","1f474-1f3fe","1f474-1f3ff"]},{n:["older woman","older_woman"],u:"1f475",v:["1f475-1f3fb","1f475-1f3fc","1f475-1f3fd","1f475-1f3fe","1f475-1f3ff"]},{n:["male-doctor"],u:"1f468-200d-2695-fe0f",v:["1f468-1f3fb-200d-2695-fe0f","1f468-1f3fc-200d-2695-fe0f","1f468-1f3fd-200d-2695-fe0f","1f468-1f3fe-200d-2695-fe0f","1f468-1f3ff-200d-2695-fe0f"]},{n:["female-doctor"],u:"1f469-200d-2695-fe0f",v:["1f469-1f3fb-200d-2695-fe0f","1f469-1f3fc-200d-2695-fe0f","1f469-1f3fd-200d-2695-fe0f","1f469-1f3fe-200d-2695-fe0f","1f469-1f3ff-200d-2695-fe0f"]},{n:["male-student"],u:"1f468-200d-1f393",v:["1f468-1f3fb-200d-1f393","1f468-1f3fc-200d-1f393","1f468-1f3fd-200d-1f393","1f468-1f3fe-200d-1f393","1f468-1f3ff-200d-1f393"]},{n:["female-student"],u:"1f469-200d-1f393",v:["1f469-1f3fb-200d-1f393","1f469-1f3fc-200d-1f393","1f469-1f3fd-200d-1f393","1f469-1f3fe-200d-1f393","1f469-1f3ff-200d-1f393"]},{n:["male-teacher"],u:"1f468-200d-1f3eb",v:["1f468-1f3fb-200d-1f3eb","1f468-1f3fc-200d-1f3eb","1f468-1f3fd-200d-1f3eb","1f468-1f3fe-200d-1f3eb","1f468-1f3ff-200d-1f3eb"]},{n:["female-teacher"],u:"1f469-200d-1f3eb",v:["1f469-1f3fb-200d-1f3eb","1f469-1f3fc-200d-1f3eb","1f469-1f3fd-200d-1f3eb","1f469-1f3fe-200d-1f3eb","1f469-1f3ff-200d-1f3eb"]},{n:["male-judge"],u:"1f468-200d-2696-fe0f",v:["1f468-1f3fb-200d-2696-fe0f","1f468-1f3fc-200d-2696-fe0f","1f468-1f3fd-200d-2696-fe0f","1f468-1f3fe-200d-2696-fe0f","1f468-1f3ff-200d-2696-fe0f"]},{n:["female-judge"],u:"1f469-200d-2696-fe0f",v:["1f469-1f3fb-200d-2696-fe0f","1f469-1f3fc-200d-2696-fe0f","1f469-1f3fd-200d-2696-fe0f","1f469-1f3fe-200d-2696-fe0f","1f469-1f3ff-200d-2696-fe0f"]},{n:["male-farmer"],u:"1f468-200d-1f33e",v:["1f468-1f3fb-200d-1f33e","1f468-1f3fc-200d-1f33e","1f468-1f3fd-200d-1f33e","1f468-1f3fe-200d-1f33e","1f468-1f3ff-200d-1f33e"]},{n:["female-farmer"],u:"1f469-200d-1f33e",v:["1f469-1f3fb-200d-1f33e","1f469-1f3fc-200d-1f33e","1f469-1f3fd-200d-1f33e","1f469-1f3fe-200d-1f33e","1f469-1f3ff-200d-1f33e"]},{n:["male-cook"],u:"1f468-200d-1f373",v:["1f468-1f3fb-200d-1f373","1f468-1f3fc-200d-1f373","1f468-1f3fd-200d-1f373","1f468-1f3fe-200d-1f373","1f468-1f3ff-200d-1f373"]},{n:["female-cook"],u:"1f469-200d-1f373",v:["1f469-1f3fb-200d-1f373","1f469-1f3fc-200d-1f373","1f469-1f3fd-200d-1f373","1f469-1f3fe-200d-1f373","1f469-1f3ff-200d-1f373"]},{n:["male-mechanic"],u:"1f468-200d-1f527",v:["1f468-1f3fb-200d-1f527","1f468-1f3fc-200d-1f527","1f468-1f3fd-200d-1f527","1f468-1f3fe-200d-1f527","1f468-1f3ff-200d-1f527"]},{n:["female-mechanic"],u:"1f469-200d-1f527",v:["1f469-1f3fb-200d-1f527","1f469-1f3fc-200d-1f527","1f469-1f3fd-200d-1f527","1f469-1f3fe-200d-1f527","1f469-1f3ff-200d-1f527"]},{n:["male-factory-worker"],u:"1f468-200d-1f3ed",v:["1f468-1f3fb-200d-1f3ed","1f468-1f3fc-200d-1f3ed","1f468-1f3fd-200d-1f3ed","1f468-1f3fe-200d-1f3ed","1f468-1f3ff-200d-1f3ed"]},{n:["female-factory-worker"],u:"1f469-200d-1f3ed",v:["1f469-1f3fb-200d-1f3ed","1f469-1f3fc-200d-1f3ed","1f469-1f3fd-200d-1f3ed","1f469-1f3fe-200d-1f3ed","1f469-1f3ff-200d-1f3ed"]},{n:["male-office-worker"],u:"1f468-200d-1f4bc",v:["1f468-1f3fb-200d-1f4bc","1f468-1f3fc-200d-1f4bc","1f468-1f3fd-200d-1f4bc","1f468-1f3fe-200d-1f4bc","1f468-1f3ff-200d-1f4bc"]},{n:["female-office-worker"],u:"1f469-200d-1f4bc",v:["1f469-1f3fb-200d-1f4bc","1f469-1f3fc-200d-1f4bc","1f469-1f3fd-200d-1f4bc","1f469-1f3fe-200d-1f4bc","1f469-1f3ff-200d-1f4bc"]},{n:["male-scientist"],u:"1f468-200d-1f52c",v:["1f468-1f3fb-200d-1f52c","1f468-1f3fc-200d-1f52c","1f468-1f3fd-200d-1f52c","1f468-1f3fe-200d-1f52c","1f468-1f3ff-200d-1f52c"]},{n:["female-scientist"],u:"1f469-200d-1f52c",v:["1f469-1f3fb-200d-1f52c","1f469-1f3fc-200d-1f52c","1f469-1f3fd-200d-1f52c","1f469-1f3fe-200d-1f52c","1f469-1f3ff-200d-1f52c"]},{n:["male-technologist"],u:"1f468-200d-1f4bb",v:["1f468-1f3fb-200d-1f4bb","1f468-1f3fc-200d-1f4bb","1f468-1f3fd-200d-1f4bb","1f468-1f3fe-200d-1f4bb","1f468-1f3ff-200d-1f4bb"]},{n:["female-technologist"],u:"1f469-200d-1f4bb",v:["1f469-1f3fb-200d-1f4bb","1f469-1f3fc-200d-1f4bb","1f469-1f3fd-200d-1f4bb","1f469-1f3fe-200d-1f4bb","1f469-1f3ff-200d-1f4bb"]},{n:["male-singer"],u:"1f468-200d-1f3a4",v:["1f468-1f3fb-200d-1f3a4","1f468-1f3fc-200d-1f3a4","1f468-1f3fd-200d-1f3a4","1f468-1f3fe-200d-1f3a4","1f468-1f3ff-200d-1f3a4"]},{n:["female-singer"],u:"1f469-200d-1f3a4",v:["1f469-1f3fb-200d-1f3a4","1f469-1f3fc-200d-1f3a4","1f469-1f3fd-200d-1f3a4","1f469-1f3fe-200d-1f3a4","1f469-1f3ff-200d-1f3a4"]},{n:["male-artist"],u:"1f468-200d-1f3a8",v:["1f468-1f3fb-200d-1f3a8","1f468-1f3fc-200d-1f3a8","1f468-1f3fd-200d-1f3a8","1f468-1f3fe-200d-1f3a8","1f468-1f3ff-200d-1f3a8"]},{n:["female-artist"],u:"1f469-200d-1f3a8",v:["1f469-1f3fb-200d-1f3a8","1f469-1f3fc-200d-1f3a8","1f469-1f3fd-200d-1f3a8","1f469-1f3fe-200d-1f3a8","1f469-1f3ff-200d-1f3a8"]},{n:["male-pilot"],u:"1f468-200d-2708-fe0f",v:["1f468-1f3fb-200d-2708-fe0f","1f468-1f3fc-200d-2708-fe0f","1f468-1f3fd-200d-2708-fe0f","1f468-1f3fe-200d-2708-fe0f","1f468-1f3ff-200d-2708-fe0f"]},{n:["female-pilot"],u:"1f469-200d-2708-fe0f",v:["1f469-1f3fb-200d-2708-fe0f","1f469-1f3fc-200d-2708-fe0f","1f469-1f3fd-200d-2708-fe0f","1f469-1f3fe-200d-2708-fe0f","1f469-1f3ff-200d-2708-fe0f"]},{n:["male-astronaut"],u:"1f468-200d-1f680",v:["1f468-1f3fb-200d-1f680","1f468-1f3fc-200d-1f680","1f468-1f3fd-200d-1f680","1f468-1f3fe-200d-1f680","1f468-1f3ff-200d-1f680"]},{n:["female-astronaut"],u:"1f469-200d-1f680",v:["1f469-1f3fb-200d-1f680","1f469-1f3fc-200d-1f680","1f469-1f3fd-200d-1f680","1f469-1f3fe-200d-1f680","1f469-1f3ff-200d-1f680"]},{n:["male-firefighter"],u:"1f468-200d-1f692",v:["1f468-1f3fb-200d-1f692","1f468-1f3fc-200d-1f692","1f468-1f3fd-200d-1f692","1f468-1f3fe-200d-1f692","1f468-1f3ff-200d-1f692"]},{n:["female-firefighter"],u:"1f469-200d-1f692",v:["1f469-1f3fb-200d-1f692","1f469-1f3fc-200d-1f692","1f469-1f3fd-200d-1f692","1f469-1f3fe-200d-1f692","1f469-1f3ff-200d-1f692"]},{n:["police officer","cop"],u:"1f46e",v:["1f46e-1f3fb","1f46e-1f3fc","1f46e-1f3fd","1f46e-1f3fe","1f46e-1f3ff"]},{n:["male-police-officer"],u:"1f46e-200d-2642-fe0f",v:["1f46e-1f3fb-200d-2642-fe0f","1f46e-1f3fc-200d-2642-fe0f","1f46e-1f3fd-200d-2642-fe0f","1f46e-1f3fe-200d-2642-fe0f","1f46e-1f3ff-200d-2642-fe0f"]},{n:["female-police-officer"],u:"1f46e-200d-2640-fe0f",v:["1f46e-1f3fb-200d-2640-fe0f","1f46e-1f3fc-200d-2640-fe0f","1f46e-1f3fd-200d-2640-fe0f","1f46e-1f3fe-200d-2640-fe0f","1f46e-1f3ff-200d-2640-fe0f"]},{n:["sleuth_or_spy"],u:"1f575-fe0f",v:["1f575-1f3fb","1f575-1f3fc","1f575-1f3fd","1f575-1f3fe","1f575-1f3ff"]},{n:["male-detective"],u:"1f575-fe0f-200d-2642-fe0f",v:["1f575-1f3fb-200d-2642-fe0f","1f575-1f3fc-200d-2642-fe0f","1f575-1f3fd-200d-2642-fe0f","1f575-1f3fe-200d-2642-fe0f","1f575-1f3ff-200d-2642-fe0f"]},{n:["female-detective"],u:"1f575-fe0f-200d-2640-fe0f",v:["1f575-1f3fb-200d-2640-fe0f","1f575-1f3fc-200d-2640-fe0f","1f575-1f3fd-200d-2640-fe0f","1f575-1f3fe-200d-2640-fe0f","1f575-1f3ff-200d-2640-fe0f"]},{n:["guardsman"],u:"1f482",v:["1f482-1f3fb","1f482-1f3fc","1f482-1f3fd","1f482-1f3fe","1f482-1f3ff"]},{n:["male-guard"],u:"1f482-200d-2642-fe0f",v:["1f482-1f3fb-200d-2642-fe0f","1f482-1f3fc-200d-2642-fe0f","1f482-1f3fd-200d-2642-fe0f","1f482-1f3fe-200d-2642-fe0f","1f482-1f3ff-200d-2642-fe0f"]},{n:["female-guard"],u:"1f482-200d-2640-fe0f",v:["1f482-1f3fb-200d-2640-fe0f","1f482-1f3fc-200d-2640-fe0f","1f482-1f3fd-200d-2640-fe0f","1f482-1f3fe-200d-2640-fe0f","1f482-1f3ff-200d-2640-fe0f"]},{n:["construction worker","construction_worker"],u:"1f477",v:["1f477-1f3fb","1f477-1f3fc","1f477-1f3fd","1f477-1f3fe","1f477-1f3ff"]},{n:["male-construction-worker"],u:"1f477-200d-2642-fe0f",v:["1f477-1f3fb-200d-2642-fe0f","1f477-1f3fc-200d-2642-fe0f","1f477-1f3fd-200d-2642-fe0f","1f477-1f3fe-200d-2642-fe0f","1f477-1f3ff-200d-2642-fe0f"]},{n:["female-construction-worker"],u:"1f477-200d-2640-fe0f",v:["1f477-1f3fb-200d-2640-fe0f","1f477-1f3fc-200d-2640-fe0f","1f477-1f3fd-200d-2640-fe0f","1f477-1f3fe-200d-2640-fe0f","1f477-1f3ff-200d-2640-fe0f"]},{n:["prince"],u:"1f934",v:["1f934-1f3fb","1f934-1f3fc","1f934-1f3fd","1f934-1f3fe","1f934-1f3ff"]},{n:["princess"],u:"1f478",v:["1f478-1f3fb","1f478-1f3fc","1f478-1f3fd","1f478-1f3fe","1f478-1f3ff"]},{n:["man with turban","man_with_turban"],u:"1f473",v:["1f473-1f3fb","1f473-1f3fc","1f473-1f3fd","1f473-1f3fe","1f473-1f3ff"]},{n:["man-wearing-turban"],u:"1f473-200d-2642-fe0f",v:["1f473-1f3fb-200d-2642-fe0f","1f473-1f3fc-200d-2642-fe0f","1f473-1f3fd-200d-2642-fe0f","1f473-1f3fe-200d-2642-fe0f","1f473-1f3ff-200d-2642-fe0f"]},{n:["woman-wearing-turban"],u:"1f473-200d-2640-fe0f",v:["1f473-1f3fb-200d-2640-fe0f","1f473-1f3fc-200d-2640-fe0f","1f473-1f3fd-200d-2640-fe0f","1f473-1f3fe-200d-2640-fe0f","1f473-1f3ff-200d-2640-fe0f"]},{n:["man with gua pi mao","man_with_gua_pi_mao"],u:"1f472",v:["1f472-1f3fb","1f472-1f3fc","1f472-1f3fd","1f472-1f3fe","1f472-1f3ff"]},{n:["person with headscarf","person_with_headscarf"],u:"1f9d5",v:["1f9d5-1f3fb","1f9d5-1f3fc","1f9d5-1f3fd","1f9d5-1f3fe","1f9d5-1f3ff"]},{n:["bearded person","bearded_person"],u:"1f9d4",v:["1f9d4-1f3fb","1f9d4-1f3fc","1f9d4-1f3fd","1f9d4-1f3fe","1f9d4-1f3ff"]},{n:["person with blond hair","person_with_blond_hair"],u:"1f471",v:["1f471-1f3fb","1f471-1f3fc","1f471-1f3fd","1f471-1f3fe","1f471-1f3ff"]},{n:["blond-haired-man"],u:"1f471-200d-2642-fe0f",v:["1f471-1f3fb-200d-2642-fe0f","1f471-1f3fc-200d-2642-fe0f","1f471-1f3fd-200d-2642-fe0f","1f471-1f3fe-200d-2642-fe0f","1f471-1f3ff-200d-2642-fe0f"]},{n:["blond-haired-woman"],u:"1f471-200d-2640-fe0f",v:["1f471-1f3fb-200d-2640-fe0f","1f471-1f3fc-200d-2640-fe0f","1f471-1f3fd-200d-2640-fe0f","1f471-1f3fe-200d-2640-fe0f","1f471-1f3ff-200d-2640-fe0f"]},{n:["man in tuxedo","man_in_tuxedo"],u:"1f935",v:["1f935-1f3fb","1f935-1f3fc","1f935-1f3fd","1f935-1f3fe","1f935-1f3ff"]},{n:["bride with veil","bride_with_veil"],u:"1f470",v:["1f470-1f3fb","1f470-1f3fc","1f470-1f3fd","1f470-1f3fe","1f470-1f3ff"]},{n:["pregnant woman","pregnant_woman"],u:"1f930",v:["1f930-1f3fb","1f930-1f3fc","1f930-1f3fd","1f930-1f3fe","1f930-1f3ff"]},{n:["breast-feeding"],u:"1f931",v:["1f931-1f3fb","1f931-1f3fc","1f931-1f3fd","1f931-1f3fe","1f931-1f3ff"]},{n:["baby angel","angel"],u:"1f47c",v:["1f47c-1f3fb","1f47c-1f3fc","1f47c-1f3fd","1f47c-1f3fe","1f47c-1f3ff"]},{n:["father christmas","santa"],u:"1f385",v:["1f385-1f3fb","1f385-1f3fc","1f385-1f3fd","1f385-1f3fe","1f385-1f3ff"]},{n:["mother christmas","mrs_claus","mother_christmas"],u:"1f936",v:["1f936-1f3fb","1f936-1f3fc","1f936-1f3fd","1f936-1f3fe","1f936-1f3ff"]},{n:["mage"],u:"1f9d9",v:["1f9d9-1f3fb","1f9d9-1f3fc","1f9d9-1f3fd","1f9d9-1f3fe","1f9d9-1f3ff"]},{n:["female_mage"],u:"1f9d9-200d-2640-fe0f",v:["1f9d9-1f3fb-200d-2640-fe0f","1f9d9-1f3fc-200d-2640-fe0f","1f9d9-1f3fd-200d-2640-fe0f","1f9d9-1f3fe-200d-2640-fe0f","1f9d9-1f3ff-200d-2640-fe0f"]},{n:["male_mage"],u:"1f9d9-200d-2642-fe0f",v:["1f9d9-1f3fb-200d-2642-fe0f","1f9d9-1f3fc-200d-2642-fe0f","1f9d9-1f3fd-200d-2642-fe0f","1f9d9-1f3fe-200d-2642-fe0f","1f9d9-1f3ff-200d-2642-fe0f"]},{n:["fairy"],u:"1f9da",v:["1f9da-1f3fb","1f9da-1f3fc","1f9da-1f3fd","1f9da-1f3fe","1f9da-1f3ff"]},{n:["female_fairy"],u:"1f9da-200d-2640-fe0f",v:["1f9da-1f3fb-200d-2640-fe0f","1f9da-1f3fc-200d-2640-fe0f","1f9da-1f3fd-200d-2640-fe0f","1f9da-1f3fe-200d-2640-fe0f","1f9da-1f3ff-200d-2640-fe0f"]},{n:["male_fairy"],u:"1f9da-200d-2642-fe0f",v:["1f9da-1f3fb-200d-2642-fe0f","1f9da-1f3fc-200d-2642-fe0f","1f9da-1f3fd-200d-2642-fe0f","1f9da-1f3fe-200d-2642-fe0f","1f9da-1f3ff-200d-2642-fe0f"]},{n:["vampire"],u:"1f9db",v:["1f9db-1f3fb","1f9db-1f3fc","1f9db-1f3fd","1f9db-1f3fe","1f9db-1f3ff"]},{n:["female_vampire"],u:"1f9db-200d-2640-fe0f",v:["1f9db-1f3fb-200d-2640-fe0f","1f9db-1f3fc-200d-2640-fe0f","1f9db-1f3fd-200d-2640-fe0f","1f9db-1f3fe-200d-2640-fe0f","1f9db-1f3ff-200d-2640-fe0f"]},{n:["male_vampire"],u:"1f9db-200d-2642-fe0f",v:["1f9db-1f3fb-200d-2642-fe0f","1f9db-1f3fc-200d-2642-fe0f","1f9db-1f3fd-200d-2642-fe0f","1f9db-1f3fe-200d-2642-fe0f","1f9db-1f3ff-200d-2642-fe0f"]},{n:["merperson"],u:"1f9dc",v:["1f9dc-1f3fb","1f9dc-1f3fc","1f9dc-1f3fd","1f9dc-1f3fe","1f9dc-1f3ff"]},{n:["mermaid"],u:"1f9dc-200d-2640-fe0f",v:["1f9dc-1f3fb-200d-2640-fe0f","1f9dc-1f3fc-200d-2640-fe0f","1f9dc-1f3fd-200d-2640-fe0f","1f9dc-1f3fe-200d-2640-fe0f","1f9dc-1f3ff-200d-2640-fe0f"]},{n:["merman"],u:"1f9dc-200d-2642-fe0f",v:["1f9dc-1f3fb-200d-2642-fe0f","1f9dc-1f3fc-200d-2642-fe0f","1f9dc-1f3fd-200d-2642-fe0f","1f9dc-1f3fe-200d-2642-fe0f","1f9dc-1f3ff-200d-2642-fe0f"]},{n:["elf"],u:"1f9dd",v:["1f9dd-1f3fb","1f9dd-1f3fc","1f9dd-1f3fd","1f9dd-1f3fe","1f9dd-1f3ff"]},{n:["female_elf"],u:"1f9dd-200d-2640-fe0f",v:["1f9dd-1f3fb-200d-2640-fe0f","1f9dd-1f3fc-200d-2640-fe0f","1f9dd-1f3fd-200d-2640-fe0f","1f9dd-1f3fe-200d-2640-fe0f","1f9dd-1f3ff-200d-2640-fe0f"]},{n:["male_elf"],u:"1f9dd-200d-2642-fe0f",v:["1f9dd-1f3fb-200d-2642-fe0f","1f9dd-1f3fc-200d-2642-fe0f","1f9dd-1f3fd-200d-2642-fe0f","1f9dd-1f3fe-200d-2642-fe0f","1f9dd-1f3ff-200d-2642-fe0f"]},{n:["genie"],u:"1f9de"},{n:["female_genie"],u:"1f9de-200d-2640-fe0f"},{n:["male_genie"],u:"1f9de-200d-2642-fe0f"},{n:["zombie"],u:"1f9df"},{n:["female_zombie"],u:"1f9df-200d-2640-fe0f"},{n:["male_zombie"],u:"1f9df-200d-2642-fe0f"},{n:["person frowning","person_frowning"],u:"1f64d",v:["1f64d-1f3fb","1f64d-1f3fc","1f64d-1f3fd","1f64d-1f3fe","1f64d-1f3ff"]},{n:["man-frowning"],u:"1f64d-200d-2642-fe0f",v:["1f64d-1f3fb-200d-2642-fe0f","1f64d-1f3fc-200d-2642-fe0f","1f64d-1f3fd-200d-2642-fe0f","1f64d-1f3fe-200d-2642-fe0f","1f64d-1f3ff-200d-2642-fe0f"]},{n:["woman-frowning"],u:"1f64d-200d-2640-fe0f",v:["1f64d-1f3fb-200d-2640-fe0f","1f64d-1f3fc-200d-2640-fe0f","1f64d-1f3fd-200d-2640-fe0f","1f64d-1f3fe-200d-2640-fe0f","1f64d-1f3ff-200d-2640-fe0f"]},{n:["person with pouting face","person_with_pouting_face"],u:"1f64e",v:["1f64e-1f3fb","1f64e-1f3fc","1f64e-1f3fd","1f64e-1f3fe","1f64e-1f3ff"]},{n:["man-pouting"],u:"1f64e-200d-2642-fe0f",v:["1f64e-1f3fb-200d-2642-fe0f","1f64e-1f3fc-200d-2642-fe0f","1f64e-1f3fd-200d-2642-fe0f","1f64e-1f3fe-200d-2642-fe0f","1f64e-1f3ff-200d-2642-fe0f"]},{n:["woman-pouting"],u:"1f64e-200d-2640-fe0f",v:["1f64e-1f3fb-200d-2640-fe0f","1f64e-1f3fc-200d-2640-fe0f","1f64e-1f3fd-200d-2640-fe0f","1f64e-1f3fe-200d-2640-fe0f","1f64e-1f3ff-200d-2640-fe0f"]},{n:["face with no good gesture","no_good"],u:"1f645",v:["1f645-1f3fb","1f645-1f3fc","1f645-1f3fd","1f645-1f3fe","1f645-1f3ff"]},{n:["man-gesturing-no"],u:"1f645-200d-2642-fe0f",v:["1f645-1f3fb-200d-2642-fe0f","1f645-1f3fc-200d-2642-fe0f","1f645-1f3fd-200d-2642-fe0f","1f645-1f3fe-200d-2642-fe0f","1f645-1f3ff-200d-2642-fe0f"]},{n:["woman-gesturing-no"],u:"1f645-200d-2640-fe0f",v:["1f645-1f3fb-200d-2640-fe0f","1f645-1f3fc-200d-2640-fe0f","1f645-1f3fd-200d-2640-fe0f","1f645-1f3fe-200d-2640-fe0f","1f645-1f3ff-200d-2640-fe0f"]},{n:["face with ok gesture","ok_woman"],u:"1f646",v:["1f646-1f3fb","1f646-1f3fc","1f646-1f3fd","1f646-1f3fe","1f646-1f3ff"]},{n:["man-gesturing-ok"],u:"1f646-200d-2642-fe0f",v:["1f646-1f3fb-200d-2642-fe0f","1f646-1f3fc-200d-2642-fe0f","1f646-1f3fd-200d-2642-fe0f","1f646-1f3fe-200d-2642-fe0f","1f646-1f3ff-200d-2642-fe0f"]},{n:["woman-gesturing-ok"],u:"1f646-200d-2640-fe0f",v:["1f646-1f3fb-200d-2640-fe0f","1f646-1f3fc-200d-2640-fe0f","1f646-1f3fd-200d-2640-fe0f","1f646-1f3fe-200d-2640-fe0f","1f646-1f3ff-200d-2640-fe0f"]},{n:["information desk person","information_desk_person"],u:"1f481",v:["1f481-1f3fb","1f481-1f3fc","1f481-1f3fd","1f481-1f3fe","1f481-1f3ff"]},{n:["man-tipping-hand"],u:"1f481-200d-2642-fe0f",v:["1f481-1f3fb-200d-2642-fe0f","1f481-1f3fc-200d-2642-fe0f","1f481-1f3fd-200d-2642-fe0f","1f481-1f3fe-200d-2642-fe0f","1f481-1f3ff-200d-2642-fe0f"]},{n:["woman-tipping-hand"],u:"1f481-200d-2640-fe0f",v:["1f481-1f3fb-200d-2640-fe0f","1f481-1f3fc-200d-2640-fe0f","1f481-1f3fd-200d-2640-fe0f","1f481-1f3fe-200d-2640-fe0f","1f481-1f3ff-200d-2640-fe0f"]},{n:["happy person raising one hand","raising_hand"],u:"1f64b",v:["1f64b-1f3fb","1f64b-1f3fc","1f64b-1f3fd","1f64b-1f3fe","1f64b-1f3ff"]},{n:["man-raising-hand"],u:"1f64b-200d-2642-fe0f",v:["1f64b-1f3fb-200d-2642-fe0f","1f64b-1f3fc-200d-2642-fe0f","1f64b-1f3fd-200d-2642-fe0f","1f64b-1f3fe-200d-2642-fe0f","1f64b-1f3ff-200d-2642-fe0f"]},{n:["woman-raising-hand"],u:"1f64b-200d-2640-fe0f",v:["1f64b-1f3fb-200d-2640-fe0f","1f64b-1f3fc-200d-2640-fe0f","1f64b-1f3fd-200d-2640-fe0f","1f64b-1f3fe-200d-2640-fe0f","1f64b-1f3ff-200d-2640-fe0f"]},{n:["person bowing deeply","bow"],u:"1f647",v:["1f647-1f3fb","1f647-1f3fc","1f647-1f3fd","1f647-1f3fe","1f647-1f3ff"]},{n:["man-bowing"],u:"1f647-200d-2642-fe0f",v:["1f647-1f3fb-200d-2642-fe0f","1f647-1f3fc-200d-2642-fe0f","1f647-1f3fd-200d-2642-fe0f","1f647-1f3fe-200d-2642-fe0f","1f647-1f3ff-200d-2642-fe0f"]},{n:["woman-bowing"],u:"1f647-200d-2640-fe0f",v:["1f647-1f3fb-200d-2640-fe0f","1f647-1f3fc-200d-2640-fe0f","1f647-1f3fd-200d-2640-fe0f","1f647-1f3fe-200d-2640-fe0f","1f647-1f3ff-200d-2640-fe0f"]},{n:["face palm","face_palm"],u:"1f926",v:["1f926-1f3fb","1f926-1f3fc","1f926-1f3fd","1f926-1f3fe","1f926-1f3ff"]},{n:["man-facepalming"],u:"1f926-200d-2642-fe0f",v:["1f926-1f3fb-200d-2642-fe0f","1f926-1f3fc-200d-2642-fe0f","1f926-1f3fd-200d-2642-fe0f","1f926-1f3fe-200d-2642-fe0f","1f926-1f3ff-200d-2642-fe0f"]},{n:["woman-facepalming"],u:"1f926-200d-2640-fe0f",v:["1f926-1f3fb-200d-2640-fe0f","1f926-1f3fc-200d-2640-fe0f","1f926-1f3fd-200d-2640-fe0f","1f926-1f3fe-200d-2640-fe0f","1f926-1f3ff-200d-2640-fe0f"]},{n:["shrug"],u:"1f937",v:["1f937-1f3fb","1f937-1f3fc","1f937-1f3fd","1f937-1f3fe","1f937-1f3ff"]},{n:["man-shrugging"],u:"1f937-200d-2642-fe0f",v:["1f937-1f3fb-200d-2642-fe0f","1f937-1f3fc-200d-2642-fe0f","1f937-1f3fd-200d-2642-fe0f","1f937-1f3fe-200d-2642-fe0f","1f937-1f3ff-200d-2642-fe0f"]},{n:["woman-shrugging"],u:"1f937-200d-2640-fe0f",v:["1f937-1f3fb-200d-2640-fe0f","1f937-1f3fc-200d-2640-fe0f","1f937-1f3fd-200d-2640-fe0f","1f937-1f3fe-200d-2640-fe0f","1f937-1f3ff-200d-2640-fe0f"]},{n:["face massage","massage"],u:"1f486",v:["1f486-1f3fb","1f486-1f3fc","1f486-1f3fd","1f486-1f3fe","1f486-1f3ff"]},{n:["man-getting-massage"],u:"1f486-200d-2642-fe0f",v:["1f486-1f3fb-200d-2642-fe0f","1f486-1f3fc-200d-2642-fe0f","1f486-1f3fd-200d-2642-fe0f","1f486-1f3fe-200d-2642-fe0f","1f486-1f3ff-200d-2642-fe0f"]},{n:["woman-getting-massage"],u:"1f486-200d-2640-fe0f",v:["1f486-1f3fb-200d-2640-fe0f","1f486-1f3fc-200d-2640-fe0f","1f486-1f3fd-200d-2640-fe0f","1f486-1f3fe-200d-2640-fe0f","1f486-1f3ff-200d-2640-fe0f"]},{n:["haircut"],u:"1f487",v:["1f487-1f3fb","1f487-1f3fc","1f487-1f3fd","1f487-1f3fe","1f487-1f3ff"]},{n:["man-getting-haircut"],u:"1f487-200d-2642-fe0f",v:["1f487-1f3fb-200d-2642-fe0f","1f487-1f3fc-200d-2642-fe0f","1f487-1f3fd-200d-2642-fe0f","1f487-1f3fe-200d-2642-fe0f","1f487-1f3ff-200d-2642-fe0f"]},{n:["woman-getting-haircut"],u:"1f487-200d-2640-fe0f",v:["1f487-1f3fb-200d-2640-fe0f","1f487-1f3fc-200d-2640-fe0f","1f487-1f3fd-200d-2640-fe0f","1f487-1f3fe-200d-2640-fe0f","1f487-1f3ff-200d-2640-fe0f"]},{n:["pedestrian","walking"],u:"1f6b6",v:["1f6b6-1f3fb","1f6b6-1f3fc","1f6b6-1f3fd","1f6b6-1f3fe","1f6b6-1f3ff"]},{n:["man-walking"],u:"1f6b6-200d-2642-fe0f",v:["1f6b6-1f3fb-200d-2642-fe0f","1f6b6-1f3fc-200d-2642-fe0f","1f6b6-1f3fd-200d-2642-fe0f","1f6b6-1f3fe-200d-2642-fe0f","1f6b6-1f3ff-200d-2642-fe0f"]},{n:["woman-walking"],u:"1f6b6-200d-2640-fe0f",v:["1f6b6-1f3fb-200d-2640-fe0f","1f6b6-1f3fc-200d-2640-fe0f","1f6b6-1f3fd-200d-2640-fe0f","1f6b6-1f3fe-200d-2640-fe0f","1f6b6-1f3ff-200d-2640-fe0f"]},{n:["runner","running"],u:"1f3c3",v:["1f3c3-1f3fb","1f3c3-1f3fc","1f3c3-1f3fd","1f3c3-1f3fe","1f3c3-1f3ff"]},{n:["man-running"],u:"1f3c3-200d-2642-fe0f",v:["1f3c3-1f3fb-200d-2642-fe0f","1f3c3-1f3fc-200d-2642-fe0f","1f3c3-1f3fd-200d-2642-fe0f","1f3c3-1f3fe-200d-2642-fe0f","1f3c3-1f3ff-200d-2642-fe0f"]},{n:["woman-running"],u:"1f3c3-200d-2640-fe0f",v:["1f3c3-1f3fb-200d-2640-fe0f","1f3c3-1f3fc-200d-2640-fe0f","1f3c3-1f3fd-200d-2640-fe0f","1f3c3-1f3fe-200d-2640-fe0f","1f3c3-1f3ff-200d-2640-fe0f"]},{n:["dancer"],u:"1f483",v:["1f483-1f3fb","1f483-1f3fc","1f483-1f3fd","1f483-1f3fe","1f483-1f3ff"]},{n:["man dancing","man_dancing"],u:"1f57a",v:["1f57a-1f3fb","1f57a-1f3fc","1f57a-1f3fd","1f57a-1f3fe","1f57a-1f3ff"]},{n:["woman with bunny ears","dancers"],u:"1f46f"},{n:["man-with-bunny-ears-partying"],u:"1f46f-200d-2642-fe0f"},{n:["woman-with-bunny-ears-partying"],u:"1f46f-200d-2640-fe0f"},{n:["person in steamy room","person_in_steamy_room"],u:"1f9d6",v:["1f9d6-1f3fb","1f9d6-1f3fc","1f9d6-1f3fd","1f9d6-1f3fe","1f9d6-1f3ff"]},{n:["woman_in_steamy_room"],u:"1f9d6-200d-2640-fe0f",v:["1f9d6-1f3fb-200d-2640-fe0f","1f9d6-1f3fc-200d-2640-fe0f","1f9d6-1f3fd-200d-2640-fe0f","1f9d6-1f3fe-200d-2640-fe0f","1f9d6-1f3ff-200d-2640-fe0f"]},{n:["man_in_steamy_room"],u:"1f9d6-200d-2642-fe0f",v:["1f9d6-1f3fb-200d-2642-fe0f","1f9d6-1f3fc-200d-2642-fe0f","1f9d6-1f3fd-200d-2642-fe0f","1f9d6-1f3fe-200d-2642-fe0f","1f9d6-1f3ff-200d-2642-fe0f"]},{n:["person climbing","person_climbing"],u:"1f9d7",v:["1f9d7-1f3fb","1f9d7-1f3fc","1f9d7-1f3fd","1f9d7-1f3fe","1f9d7-1f3ff"]},{n:["woman_climbing"],u:"1f9d7-200d-2640-fe0f",v:["1f9d7-1f3fb-200d-2640-fe0f","1f9d7-1f3fc-200d-2640-fe0f","1f9d7-1f3fd-200d-2640-fe0f","1f9d7-1f3fe-200d-2640-fe0f","1f9d7-1f3ff-200d-2640-fe0f"]},{n:["man_climbing"],u:"1f9d7-200d-2642-fe0f",v:["1f9d7-1f3fb-200d-2642-fe0f","1f9d7-1f3fc-200d-2642-fe0f","1f9d7-1f3fd-200d-2642-fe0f","1f9d7-1f3fe-200d-2642-fe0f","1f9d7-1f3ff-200d-2642-fe0f"]},{n:["person in lotus position","person_in_lotus_position"],u:"1f9d8",v:["1f9d8-1f3fb","1f9d8-1f3fc","1f9d8-1f3fd","1f9d8-1f3fe","1f9d8-1f3ff"]},{n:["woman_in_lotus_position"],u:"1f9d8-200d-2640-fe0f",v:["1f9d8-1f3fb-200d-2640-fe0f","1f9d8-1f3fc-200d-2640-fe0f","1f9d8-1f3fd-200d-2640-fe0f","1f9d8-1f3fe-200d-2640-fe0f","1f9d8-1f3ff-200d-2640-fe0f"]},{n:["man_in_lotus_position"],u:"1f9d8-200d-2642-fe0f",v:["1f9d8-1f3fb-200d-2642-fe0f","1f9d8-1f3fc-200d-2642-fe0f","1f9d8-1f3fd-200d-2642-fe0f","1f9d8-1f3fe-200d-2642-fe0f","1f9d8-1f3ff-200d-2642-fe0f"]},{n:["bath"],u:"1f6c0",v:["1f6c0-1f3fb","1f6c0-1f3fc","1f6c0-1f3fd","1f6c0-1f3fe","1f6c0-1f3ff"]},{n:["sleeping accommodation","sleeping_accommodation"],u:"1f6cc",v:["1f6cc-1f3fb","1f6cc-1f3fc","1f6cc-1f3fd","1f6cc-1f3fe","1f6cc-1f3ff"]},{n:["man_in_business_suit_levitating"],u:"1f574-fe0f",v:["1f574-1f3fb","1f574-1f3fc","1f574-1f3fd","1f574-1f3fe","1f574-1f3ff"]},{n:["speaking_head_in_silhouette"],u:"1f5e3-fe0f"},{n:["bust in silhouette","bust_in_silhouette"],u:"1f464"},{n:["busts in silhouette","busts_in_silhouette"],u:"1f465"},{n:["fencer"],u:"1f93a"},{n:["horse racing","horse_racing"],u:"1f3c7",v:["1f3c7-1f3fb","1f3c7-1f3fc","1f3c7-1f3fd","1f3c7-1f3fe","1f3c7-1f3ff"]},{n:["skier"],u:"26f7-fe0f"},{n:["snowboarder"],u:"1f3c2",v:["1f3c2-1f3fb","1f3c2-1f3fc","1f3c2-1f3fd","1f3c2-1f3fe","1f3c2-1f3ff"]},{n:["golfer"],u:"1f3cc-fe0f",v:["1f3cc-1f3fb","1f3cc-1f3fc","1f3cc-1f3fd","1f3cc-1f3fe","1f3cc-1f3ff"]},{n:["man-golfing"],u:"1f3cc-fe0f-200d-2642-fe0f",v:["1f3cc-1f3fb-200d-2642-fe0f","1f3cc-1f3fc-200d-2642-fe0f","1f3cc-1f3fd-200d-2642-fe0f","1f3cc-1f3fe-200d-2642-fe0f","1f3cc-1f3ff-200d-2642-fe0f"]},{n:["woman-golfing"],u:"1f3cc-fe0f-200d-2640-fe0f",v:["1f3cc-1f3fb-200d-2640-fe0f","1f3cc-1f3fc-200d-2640-fe0f","1f3cc-1f3fd-200d-2640-fe0f","1f3cc-1f3fe-200d-2640-fe0f","1f3cc-1f3ff-200d-2640-fe0f"]},{n:["surfer"],u:"1f3c4",v:["1f3c4-1f3fb","1f3c4-1f3fc","1f3c4-1f3fd","1f3c4-1f3fe","1f3c4-1f3ff"]},{n:["man-surfing"],u:"1f3c4-200d-2642-fe0f",v:["1f3c4-1f3fb-200d-2642-fe0f","1f3c4-1f3fc-200d-2642-fe0f","1f3c4-1f3fd-200d-2642-fe0f","1f3c4-1f3fe-200d-2642-fe0f","1f3c4-1f3ff-200d-2642-fe0f"]},{n:["woman-surfing"],u:"1f3c4-200d-2640-fe0f",v:["1f3c4-1f3fb-200d-2640-fe0f","1f3c4-1f3fc-200d-2640-fe0f","1f3c4-1f3fd-200d-2640-fe0f","1f3c4-1f3fe-200d-2640-fe0f","1f3c4-1f3ff-200d-2640-fe0f"]},{n:["rowboat"],u:"1f6a3",v:["1f6a3-1f3fb","1f6a3-1f3fc","1f6a3-1f3fd","1f6a3-1f3fe","1f6a3-1f3ff"]},{n:["man-rowing-boat"],u:"1f6a3-200d-2642-fe0f",v:["1f6a3-1f3fb-200d-2642-fe0f","1f6a3-1f3fc-200d-2642-fe0f","1f6a3-1f3fd-200d-2642-fe0f","1f6a3-1f3fe-200d-2642-fe0f","1f6a3-1f3ff-200d-2642-fe0f"]},{n:["woman-rowing-boat"],u:"1f6a3-200d-2640-fe0f",v:["1f6a3-1f3fb-200d-2640-fe0f","1f6a3-1f3fc-200d-2640-fe0f","1f6a3-1f3fd-200d-2640-fe0f","1f6a3-1f3fe-200d-2640-fe0f","1f6a3-1f3ff-200d-2640-fe0f"]},{n:["swimmer"],u:"1f3ca",v:["1f3ca-1f3fb","1f3ca-1f3fc","1f3ca-1f3fd","1f3ca-1f3fe","1f3ca-1f3ff"]},{n:["man-swimming"],u:"1f3ca-200d-2642-fe0f",v:["1f3ca-1f3fb-200d-2642-fe0f","1f3ca-1f3fc-200d-2642-fe0f","1f3ca-1f3fd-200d-2642-fe0f","1f3ca-1f3fe-200d-2642-fe0f","1f3ca-1f3ff-200d-2642-fe0f"]},{n:["woman-swimming"],u:"1f3ca-200d-2640-fe0f",v:["1f3ca-1f3fb-200d-2640-fe0f","1f3ca-1f3fc-200d-2640-fe0f","1f3ca-1f3fd-200d-2640-fe0f","1f3ca-1f3fe-200d-2640-fe0f","1f3ca-1f3ff-200d-2640-fe0f"]},{n:["person_with_ball"],u:"26f9-fe0f",v:["26f9-1f3fb","26f9-1f3fc","26f9-1f3fd","26f9-1f3fe","26f9-1f3ff"]},{n:["man-bouncing-ball"],u:"26f9-fe0f-200d-2642-fe0f",v:["26f9-1f3fb-200d-2642-fe0f","26f9-1f3fc-200d-2642-fe0f","26f9-1f3fd-200d-2642-fe0f","26f9-1f3fe-200d-2642-fe0f","26f9-1f3ff-200d-2642-fe0f"]},{n:["woman-bouncing-ball"],u:"26f9-fe0f-200d-2640-fe0f",v:["26f9-1f3fb-200d-2640-fe0f","26f9-1f3fc-200d-2640-fe0f","26f9-1f3fd-200d-2640-fe0f","26f9-1f3fe-200d-2640-fe0f","26f9-1f3ff-200d-2640-fe0f"]},{n:["weight_lifter"],u:"1f3cb-fe0f",v:["1f3cb-1f3fb","1f3cb-1f3fc","1f3cb-1f3fd","1f3cb-1f3fe","1f3cb-1f3ff"]},{n:["man-lifting-weights"],u:"1f3cb-fe0f-200d-2642-fe0f",v:["1f3cb-1f3fb-200d-2642-fe0f","1f3cb-1f3fc-200d-2642-fe0f","1f3cb-1f3fd-200d-2642-fe0f","1f3cb-1f3fe-200d-2642-fe0f","1f3cb-1f3ff-200d-2642-fe0f"]},{n:["woman-lifting-weights"],u:"1f3cb-fe0f-200d-2640-fe0f",v:["1f3cb-1f3fb-200d-2640-fe0f","1f3cb-1f3fc-200d-2640-fe0f","1f3cb-1f3fd-200d-2640-fe0f","1f3cb-1f3fe-200d-2640-fe0f","1f3cb-1f3ff-200d-2640-fe0f"]},{n:["bicyclist"],u:"1f6b4",v:["1f6b4-1f3fb","1f6b4-1f3fc","1f6b4-1f3fd","1f6b4-1f3fe","1f6b4-1f3ff"]},{n:["man-biking"],u:"1f6b4-200d-2642-fe0f",v:["1f6b4-1f3fb-200d-2642-fe0f","1f6b4-1f3fc-200d-2642-fe0f","1f6b4-1f3fd-200d-2642-fe0f","1f6b4-1f3fe-200d-2642-fe0f","1f6b4-1f3ff-200d-2642-fe0f"]},{n:["woman-biking"],u:"1f6b4-200d-2640-fe0f",v:["1f6b4-1f3fb-200d-2640-fe0f","1f6b4-1f3fc-200d-2640-fe0f","1f6b4-1f3fd-200d-2640-fe0f","1f6b4-1f3fe-200d-2640-fe0f","1f6b4-1f3ff-200d-2640-fe0f"]},{n:["mountain bicyclist","mountain_bicyclist"],u:"1f6b5",v:["1f6b5-1f3fb","1f6b5-1f3fc","1f6b5-1f3fd","1f6b5-1f3fe","1f6b5-1f3ff"]},{n:["man-mountain-biking"],u:"1f6b5-200d-2642-fe0f",v:["1f6b5-1f3fb-200d-2642-fe0f","1f6b5-1f3fc-200d-2642-fe0f","1f6b5-1f3fd-200d-2642-fe0f","1f6b5-1f3fe-200d-2642-fe0f","1f6b5-1f3ff-200d-2642-fe0f"]},{n:["woman-mountain-biking"],u:"1f6b5-200d-2640-fe0f",v:["1f6b5-1f3fb-200d-2640-fe0f","1f6b5-1f3fc-200d-2640-fe0f","1f6b5-1f3fd-200d-2640-fe0f","1f6b5-1f3fe-200d-2640-fe0f","1f6b5-1f3ff-200d-2640-fe0f"]},{n:["racing_car"],u:"1f3ce-fe0f"},{n:["racing_motorcycle"],u:"1f3cd-fe0f"},{n:["person doing cartwheel","person_doing_cartwheel"],u:"1f938",v:["1f938-1f3fb","1f938-1f3fc","1f938-1f3fd","1f938-1f3fe","1f938-1f3ff"]},{n:["man-cartwheeling"],u:"1f938-200d-2642-fe0f",v:["1f938-1f3fb-200d-2642-fe0f","1f938-1f3fc-200d-2642-fe0f","1f938-1f3fd-200d-2642-fe0f","1f938-1f3fe-200d-2642-fe0f","1f938-1f3ff-200d-2642-fe0f"]},{n:["woman-cartwheeling"],u:"1f938-200d-2640-fe0f",v:["1f938-1f3fb-200d-2640-fe0f","1f938-1f3fc-200d-2640-fe0f","1f938-1f3fd-200d-2640-fe0f","1f938-1f3fe-200d-2640-fe0f","1f938-1f3ff-200d-2640-fe0f"]},{n:["wrestlers"],u:"1f93c"},{n:["man-wrestling"],u:"1f93c-200d-2642-fe0f"},{n:["woman-wrestling"],u:"1f93c-200d-2640-fe0f"},{n:["water polo","water_polo"],u:"1f93d",v:["1f93d-1f3fb","1f93d-1f3fc","1f93d-1f3fd","1f93d-1f3fe","1f93d-1f3ff"]},{n:["man-playing-water-polo"],u:"1f93d-200d-2642-fe0f",v:["1f93d-1f3fb-200d-2642-fe0f","1f93d-1f3fc-200d-2642-fe0f","1f93d-1f3fd-200d-2642-fe0f","1f93d-1f3fe-200d-2642-fe0f","1f93d-1f3ff-200d-2642-fe0f"]},{n:["woman-playing-water-polo"],u:"1f93d-200d-2640-fe0f",v:["1f93d-1f3fb-200d-2640-fe0f","1f93d-1f3fc-200d-2640-fe0f","1f93d-1f3fd-200d-2640-fe0f","1f93d-1f3fe-200d-2640-fe0f","1f93d-1f3ff-200d-2640-fe0f"]},{n:["handball"],u:"1f93e",v:["1f93e-1f3fb","1f93e-1f3fc","1f93e-1f3fd","1f93e-1f3fe","1f93e-1f3ff"]},{n:["man-playing-handball"],u:"1f93e-200d-2642-fe0f",v:["1f93e-1f3fb-200d-2642-fe0f","1f93e-1f3fc-200d-2642-fe0f","1f93e-1f3fd-200d-2642-fe0f","1f93e-1f3fe-200d-2642-fe0f","1f93e-1f3ff-200d-2642-fe0f"]},{n:["woman-playing-handball"],u:"1f93e-200d-2640-fe0f",v:["1f93e-1f3fb-200d-2640-fe0f","1f93e-1f3fc-200d-2640-fe0f","1f93e-1f3fd-200d-2640-fe0f","1f93e-1f3fe-200d-2640-fe0f","1f93e-1f3ff-200d-2640-fe0f"]},{n:["juggling"],u:"1f939",v:["1f939-1f3fb","1f939-1f3fc","1f939-1f3fd","1f939-1f3fe","1f939-1f3ff"]},{n:["man-juggling"],u:"1f939-200d-2642-fe0f",v:["1f939-1f3fb-200d-2642-fe0f","1f939-1f3fc-200d-2642-fe0f","1f939-1f3fd-200d-2642-fe0f","1f939-1f3fe-200d-2642-fe0f","1f939-1f3ff-200d-2642-fe0f"]},{n:["woman-juggling"],u:"1f939-200d-2640-fe0f",v:["1f939-1f3fb-200d-2640-fe0f","1f939-1f3fc-200d-2640-fe0f","1f939-1f3fd-200d-2640-fe0f","1f939-1f3fe-200d-2640-fe0f","1f939-1f3ff-200d-2640-fe0f"]},{n:["man and woman holding hands","couple","man_and_woman_holding_hands"],u:"1f46b"},{n:["two men holding hands","two_men_holding_hands"],u:"1f46c"},{n:["two women holding hands","two_women_holding_hands"],u:"1f46d"},{n:["kiss","couplekiss"],u:"1f48f"},{n:["woman-kiss-man"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f468"},{n:["man-kiss-man"],u:"1f468-200d-2764-fe0f-200d-1f48b-200d-1f468"},{n:["woman-kiss-woman"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f469"},{n:["couple with heart","couple_with_heart"],u:"1f491"},{n:["woman-heart-man"],u:"1f469-200d-2764-fe0f-200d-1f468"},{n:["man-heart-man"],u:"1f468-200d-2764-fe0f-200d-1f468"},{n:["woman-heart-woman"],u:"1f469-200d-2764-fe0f-200d-1f469"},{n:["family","man-woman-boy"],u:"1f46a"},{n:["man-woman-boy","family"],u:"1f468-200d-1f469-200d-1f466"},{n:["man-woman-girl"],u:"1f468-200d-1f469-200d-1f467"},{n:["man-woman-girl-boy"],u:"1f468-200d-1f469-200d-1f467-200d-1f466"},{n:["man-woman-boy-boy"],u:"1f468-200d-1f469-200d-1f466-200d-1f466"},{n:["man-woman-girl-girl"],u:"1f468-200d-1f469-200d-1f467-200d-1f467"},{n:["man-man-boy"],u:"1f468-200d-1f468-200d-1f466"},{n:["man-man-girl"],u:"1f468-200d-1f468-200d-1f467"},{n:["man-man-girl-boy"],u:"1f468-200d-1f468-200d-1f467-200d-1f466"},{n:["man-man-boy-boy"],u:"1f468-200d-1f468-200d-1f466-200d-1f466"},{n:["man-man-girl-girl"],u:"1f468-200d-1f468-200d-1f467-200d-1f467"},{n:["woman-woman-boy"],u:"1f469-200d-1f469-200d-1f466"},{n:["woman-woman-girl"],u:"1f469-200d-1f469-200d-1f467"},{n:["woman-woman-girl-boy"],u:"1f469-200d-1f469-200d-1f467-200d-1f466"},{n:["woman-woman-boy-boy"],u:"1f469-200d-1f469-200d-1f466-200d-1f466"},{n:["woman-woman-girl-girl"],u:"1f469-200d-1f469-200d-1f467-200d-1f467"},{n:["man-boy"],u:"1f468-200d-1f466"},{n:["man-boy-boy"],u:"1f468-200d-1f466-200d-1f466"},{n:["man-girl"],u:"1f468-200d-1f467"},{n:["man-girl-boy"],u:"1f468-200d-1f467-200d-1f466"},{n:["man-girl-girl"],u:"1f468-200d-1f467-200d-1f467"},{n:["woman-boy"],u:"1f469-200d-1f466"},{n:["woman-boy-boy"],u:"1f469-200d-1f466-200d-1f466"},{n:["woman-girl"],u:"1f469-200d-1f467"},{n:["woman-girl-boy"],u:"1f469-200d-1f467-200d-1f466"},{n:["woman-girl-girl"],u:"1f469-200d-1f467-200d-1f467"},{n:["selfie"],u:"1f933",v:["1f933-1f3fb","1f933-1f3fc","1f933-1f3fd","1f933-1f3fe","1f933-1f3ff"]},{n:["flexed biceps","muscle"],u:"1f4aa",v:["1f4aa-1f3fb","1f4aa-1f3fc","1f4aa-1f3fd","1f4aa-1f3fe","1f4aa-1f3ff"]},{n:["white left pointing backhand index","point_left"],u:"1f448",v:["1f448-1f3fb","1f448-1f3fc","1f448-1f3fd","1f448-1f3fe","1f448-1f3ff"]},{n:["white right pointing backhand index","point_right"],u:"1f449",v:["1f449-1f3fb","1f449-1f3fc","1f449-1f3fd","1f449-1f3fe","1f449-1f3ff"]},{n:["white up pointing index","point_up"],u:"261d-fe0f",v:["261d-1f3fb","261d-1f3fc","261d-1f3fd","261d-1f3fe","261d-1f3ff"]},{n:["white up pointing backhand index","point_up_2"],u:"1f446",v:["1f446-1f3fb","1f446-1f3fc","1f446-1f3fd","1f446-1f3fe","1f446-1f3ff"]},{n:["reversed hand with middle finger extended","middle_finger","reversed_hand_with_middle_finger_extended"],u:"1f595",v:["1f595-1f3fb","1f595-1f3fc","1f595-1f3fd","1f595-1f3fe","1f595-1f3ff"]},{n:["white down pointing backhand index","point_down"],u:"1f447",v:["1f447-1f3fb","1f447-1f3fc","1f447-1f3fd","1f447-1f3fe","1f447-1f3ff"]},{n:["victory hand","v"],u:"270c-fe0f",v:["270c-1f3fb","270c-1f3fc","270c-1f3fd","270c-1f3fe","270c-1f3ff"]},{n:["hand with index and middle fingers crossed","crossed_fingers","hand_with_index_and_middle_fingers_crossed"],u:"1f91e",v:["1f91e-1f3fb","1f91e-1f3fc","1f91e-1f3fd","1f91e-1f3fe","1f91e-1f3ff"]},{n:["raised hand with part between middle and ring fingers","spock-hand"],u:"1f596",v:["1f596-1f3fb","1f596-1f3fc","1f596-1f3fd","1f596-1f3fe","1f596-1f3ff"]},{n:["sign of the horns","the_horns","sign_of_the_horns"],u:"1f918",v:["1f918-1f3fb","1f918-1f3fc","1f918-1f3fd","1f918-1f3fe","1f918-1f3ff"]},{n:["call me hand","call_me_hand"],u:"1f919",v:["1f919-1f3fb","1f919-1f3fc","1f919-1f3fd","1f919-1f3fe","1f919-1f3ff"]},{n:["raised_hand_with_fingers_splayed"],u:"1f590-fe0f",v:["1f590-1f3fb","1f590-1f3fc","1f590-1f3fd","1f590-1f3fe","1f590-1f3ff"]},{n:["raised hand","hand","raised_hand"],u:"270b",v:["270b-1f3fb","270b-1f3fc","270b-1f3fd","270b-1f3fe","270b-1f3ff"]},{n:["ok hand sign","ok_hand"],u:"1f44c",v:["1f44c-1f3fb","1f44c-1f3fc","1f44c-1f3fd","1f44c-1f3fe","1f44c-1f3ff"]},{n:["thumbs up sign","+1","thumbsup"],u:"1f44d",v:["1f44d-1f3fb","1f44d-1f3fc","1f44d-1f3fd","1f44d-1f3fe","1f44d-1f3ff"]},{n:["thumbs down sign","-1","thumbsdown"],u:"1f44e",v:["1f44e-1f3fb","1f44e-1f3fc","1f44e-1f3fd","1f44e-1f3fe","1f44e-1f3ff"]},{n:["raised fist","fist"],u:"270a",v:["270a-1f3fb","270a-1f3fc","270a-1f3fd","270a-1f3fe","270a-1f3ff"]},{n:["fisted hand sign","facepunch","punch"],u:"1f44a",v:["1f44a-1f3fb","1f44a-1f3fc","1f44a-1f3fd","1f44a-1f3fe","1f44a-1f3ff"]},{n:["left-facing fist","left-facing_fist"],u:"1f91b",v:["1f91b-1f3fb","1f91b-1f3fc","1f91b-1f3fd","1f91b-1f3fe","1f91b-1f3ff"]},{n:["right-facing fist","right-facing_fist"],u:"1f91c",v:["1f91c-1f3fb","1f91c-1f3fc","1f91c-1f3fd","1f91c-1f3fe","1f91c-1f3ff"]},{n:["raised back of hand","raised_back_of_hand"],u:"1f91a",v:["1f91a-1f3fb","1f91a-1f3fc","1f91a-1f3fd","1f91a-1f3fe","1f91a-1f3ff"]},{n:["waving hand sign","wave"],u:"1f44b",v:["1f44b-1f3fb","1f44b-1f3fc","1f44b-1f3fd","1f44b-1f3fe","1f44b-1f3ff"]},{n:["i love you hand sign","i_love_you_hand_sign"],u:"1f91f",v:["1f91f-1f3fb","1f91f-1f3fc","1f91f-1f3fd","1f91f-1f3fe","1f91f-1f3ff"]},{n:["writing_hand"],u:"270d-fe0f",v:["270d-1f3fb","270d-1f3fc","270d-1f3fd","270d-1f3fe","270d-1f3ff"]},{n:["clapping hands sign","clap"],u:"1f44f",v:["1f44f-1f3fb","1f44f-1f3fc","1f44f-1f3fd","1f44f-1f3fe","1f44f-1f3ff"]},{n:["open hands sign","open_hands"],u:"1f450",v:["1f450-1f3fb","1f450-1f3fc","1f450-1f3fd","1f450-1f3fe","1f450-1f3ff"]},{n:["person raising both hands in celebration","raised_hands"],u:"1f64c",v:["1f64c-1f3fb","1f64c-1f3fc","1f64c-1f3fd","1f64c-1f3fe","1f64c-1f3ff"]},{n:["palms up together","palms_up_together"],u:"1f932",v:["1f932-1f3fb","1f932-1f3fc","1f932-1f3fd","1f932-1f3fe","1f932-1f3ff"]},{n:["person with folded hands","pray"],u:"1f64f",v:["1f64f-1f3fb","1f64f-1f3fc","1f64f-1f3fd","1f64f-1f3fe","1f64f-1f3ff"]},{n:["handshake"],u:"1f91d"},{n:["nail polish","nail_care"],u:"1f485",v:["1f485-1f3fb","1f485-1f3fc","1f485-1f3fd","1f485-1f3fe","1f485-1f3ff"]},{n:["ear"],u:"1f442",v:["1f442-1f3fb","1f442-1f3fc","1f442-1f3fd","1f442-1f3fe","1f442-1f3ff"]},{n:["nose"],u:"1f443",v:["1f443-1f3fb","1f443-1f3fc","1f443-1f3fd","1f443-1f3fe","1f443-1f3ff"]},{n:["footprints"],u:"1f463"},{n:["eyes"],u:"1f440"},{n:["eye"],u:"1f441-fe0f"},{n:["eye-in-speech-bubble"],u:"1f441-fe0f-200d-1f5e8-fe0f"},{n:["brain"],u:"1f9e0"},{n:["tongue"],u:"1f445"},{n:["mouth","lips"],u:"1f444"},{n:["kiss mark","kiss"],u:"1f48b"},{n:["heart with arrow","cupid"],u:"1f498"},{n:["heavy black heart","heart"],u:"2764-fe0f"},{n:["beating heart","heartbeat"],u:"1f493"},{n:["broken heart","broken_heart"],u:"1f494"},{n:["two hearts","two_hearts"],u:"1f495"},{n:["sparkling heart","sparkling_heart"],u:"1f496"},{n:["growing heart","heartpulse"],u:"1f497"},{n:["blue heart","blue_heart"],u:"1f499"},{n:["green heart","green_heart"],u:"1f49a"},{n:["yellow heart","yellow_heart"],u:"1f49b"},{n:["orange heart","orange_heart"],u:"1f9e1"},{n:["purple heart","purple_heart"],u:"1f49c"},{n:["black heart","black_heart"],u:"1f5a4"},{n:["heart with ribbon","gift_heart"],u:"1f49d"},{n:["revolving hearts","revolving_hearts"],u:"1f49e"},{n:["heart decoration","heart_decoration"],u:"1f49f"},{n:["heavy_heart_exclamation_mark_ornament"],u:"2763-fe0f"},{n:["love letter","love_letter"],u:"1f48c"},{n:["sleeping symbol","zzz"],u:"1f4a4"},{n:["anger symbol","anger"],u:"1f4a2"},{n:["bomb"],u:"1f4a3"},{n:["collision symbol","boom","collision"],u:"1f4a5"},{n:["splashing sweat symbol","sweat_drops"],u:"1f4a6"},{n:["dash symbol","dash"],u:"1f4a8"},{n:["dizzy symbol","dizzy"],u:"1f4ab"},{n:["speech balloon","speech_balloon"],u:"1f4ac"},{n:["left_speech_bubble"],u:"1f5e8-fe0f"},{n:["right_anger_bubble"],u:"1f5ef-fe0f"},{n:["thought balloon","thought_balloon"],u:"1f4ad"},{n:["hole"],u:"1f573-fe0f"},{n:["eyeglasses"],u:"1f453"},{n:["dark_sunglasses"],u:"1f576-fe0f"},{n:["necktie"],u:"1f454"},{n:["t-shirt","shirt","tshirt"],u:"1f455"},{n:["jeans"],u:"1f456"},{n:["scarf"],u:"1f9e3"},{n:["gloves"],u:"1f9e4"},{n:["coat"],u:"1f9e5"},{n:["socks"],u:"1f9e6"},{n:["dress"],u:"1f457"},{n:["kimono"],u:"1f458"},{n:["bikini"],u:"1f459"},{n:["womans clothes","womans_clothes"],u:"1f45a"},{n:["purse"],u:"1f45b"},{n:["handbag"],u:"1f45c"},{n:["pouch"],u:"1f45d"},{n:["shopping_bags"],u:"1f6cd-fe0f"},{n:["school satchel","school_satchel"],u:"1f392"},{n:["mans shoe","mans_shoe","shoe"],u:"1f45e"},{n:["athletic shoe","athletic_shoe"],u:"1f45f"},{n:["high-heeled shoe","high_heel"],u:"1f460"},{n:["womans sandal","sandal"],u:"1f461"},{n:["womans boots","boot"],u:"1f462"},{n:["crown"],u:"1f451"},{n:["womans hat","womans_hat"],u:"1f452"},{n:["top hat","tophat"],u:"1f3a9"},{n:["graduation cap","mortar_board"],u:"1f393"},{n:["billed cap","billed_cap"],u:"1f9e2"},{n:["helmet_with_white_cross"],u:"26d1-fe0f"},{n:["prayer beads","prayer_beads"],u:"1f4ff"},{n:["lipstick"],u:"1f484"},{n:["ring"],u:"1f48d"},{n:["gem stone","gem"],u:"1f48e"}],pSr=[{n:["monkey face","monkey_face"],u:"1f435"},{n:["monkey"],u:"1f412"},{n:["gorilla"],u:"1f98d"},{n:["dog face","dog"],u:"1f436"},{n:["dog","dog2"],u:"1f415"},{n:["poodle"],u:"1f429"},{n:["wolf face","wolf"],u:"1f43a"},{n:["fox face","fox_face"],u:"1f98a"},{n:["cat face","cat"],u:"1f431"},{n:["cat","cat2"],u:"1f408"},{n:["lion face","lion_face"],u:"1f981"},{n:["tiger face","tiger"],u:"1f42f"},{n:["tiger","tiger2"],u:"1f405"},{n:["leopard"],u:"1f406"},{n:["horse face","horse"],u:"1f434"},{n:["horse","racehorse"],u:"1f40e"},{n:["unicorn face","unicorn_face"],u:"1f984"},{n:["zebra face","zebra_face"],u:"1f993"},{n:["deer"],u:"1f98c"},{n:["cow face","cow"],u:"1f42e"},{n:["ox"],u:"1f402"},{n:["water buffalo","water_buffalo"],u:"1f403"},{n:["cow","cow2"],u:"1f404"},{n:["pig face","pig"],u:"1f437"},{n:["pig","pig2"],u:"1f416"},{n:["boar"],u:"1f417"},{n:["pig nose","pig_nose"],u:"1f43d"},{n:["ram"],u:"1f40f"},{n:["sheep"],u:"1f411"},{n:["goat"],u:"1f410"},{n:["dromedary camel","dromedary_camel"],u:"1f42a"},{n:["bactrian camel","camel"],u:"1f42b"},{n:["giraffe face","giraffe_face"],u:"1f992"},{n:["elephant"],u:"1f418"},{n:["rhinoceros"],u:"1f98f"},{n:["mouse face","mouse"],u:"1f42d"},{n:["mouse","mouse2"],u:"1f401"},{n:["rat"],u:"1f400"},{n:["hamster face","hamster"],u:"1f439"},{n:["rabbit face","rabbit"],u:"1f430"},{n:["rabbit","rabbit2"],u:"1f407"},{n:["chipmunk"],u:"1f43f-fe0f"},{n:["hedgehog"],u:"1f994"},{n:["bat"],u:"1f987"},{n:["bear face","bear"],u:"1f43b"},{n:["koala"],u:"1f428"},{n:["panda face","panda_face"],u:"1f43c"},{n:["paw prints","feet","paw_prints"],u:"1f43e"},{n:["turkey"],u:"1f983"},{n:["chicken"],u:"1f414"},{n:["rooster"],u:"1f413"},{n:["hatching chick","hatching_chick"],u:"1f423"},{n:["baby chick","baby_chick"],u:"1f424"},{n:["front-facing baby chick","hatched_chick"],u:"1f425"},{n:["bird"],u:"1f426"},{n:["penguin"],u:"1f427"},{n:["dove_of_peace"],u:"1f54a-fe0f"},{n:["eagle"],u:"1f985"},{n:["duck"],u:"1f986"},{n:["owl"],u:"1f989"},{n:["frog face","frog"],u:"1f438"},{n:["crocodile"],u:"1f40a"},{n:["turtle"],u:"1f422"},{n:["lizard"],u:"1f98e"},{n:["snake"],u:"1f40d"},{n:["dragon face","dragon_face"],u:"1f432"},{n:["dragon"],u:"1f409"},{n:["sauropod"],u:"1f995"},{n:["t-rex"],u:"1f996"},{n:["spouting whale","whale"],u:"1f433"},{n:["whale","whale2"],u:"1f40b"},{n:["dolphin","flipper"],u:"1f42c"},{n:["fish"],u:"1f41f"},{n:["tropical fish","tropical_fish"],u:"1f420"},{n:["blowfish"],u:"1f421"},{n:["shark"],u:"1f988"},{n:["octopus"],u:"1f419"},{n:["spiral shell","shell"],u:"1f41a"},{n:["crab"],u:"1f980"},{n:["shrimp"],u:"1f990"},{n:["squid"],u:"1f991"},{n:["snail"],u:"1f40c"},{n:["butterfly"],u:"1f98b"},{n:["bug"],u:"1f41b"},{n:["ant"],u:"1f41c"},{n:["honeybee","bee"],u:"1f41d"},{n:["lady beetle","beetle"],u:"1f41e"},{n:["cricket"],u:"1f997"},{n:["spider"],u:"1f577-fe0f"},{n:["spider_web"],u:"1f578-fe0f"},{n:["scorpion"],u:"1f982"},{n:["bouquet"],u:"1f490"},{n:["cherry blossom","cherry_blossom"],u:"1f338"},{n:["white flower","white_flower"],u:"1f4ae"},{n:["rosette"],u:"1f3f5-fe0f"},{n:["rose"],u:"1f339"},{n:["wilted flower","wilted_flower"],u:"1f940"},{n:["hibiscus"],u:"1f33a"},{n:["sunflower"],u:"1f33b"},{n:["blossom"],u:"1f33c"},{n:["tulip"],u:"1f337"},{n:["seedling"],u:"1f331"},{n:["evergreen tree","evergreen_tree"],u:"1f332"},{n:["deciduous tree","deciduous_tree"],u:"1f333"},{n:["palm tree","palm_tree"],u:"1f334"},{n:["cactus"],u:"1f335"},{n:["ear of rice","ear_of_rice"],u:"1f33e"},{n:["herb"],u:"1f33f"},{n:["shamrock"],u:"2618-fe0f"},{n:["four leaf clover","four_leaf_clover"],u:"1f340"},{n:["maple leaf","maple_leaf"],u:"1f341"},{n:["fallen leaf","fallen_leaf"],u:"1f342"},{n:["leaf fluttering in wind","leaves"],u:"1f343"}],TSr=[{n:["grapes"],u:"1f347"},{n:["melon"],u:"1f348"},{n:["watermelon"],u:"1f349"},{n:["tangerine"],u:"1f34a"},{n:["lemon"],u:"1f34b"},{n:["banana"],u:"1f34c"},{n:["pineapple"],u:"1f34d"},{n:["red apple","apple"],u:"1f34e"},{n:["green apple","green_apple"],u:"1f34f"},{n:["pear"],u:"1f350"},{n:["peach"],u:"1f351"},{n:["cherries"],u:"1f352"},{n:["strawberry"],u:"1f353"},{n:["kiwifruit"],u:"1f95d"},{n:["tomato"],u:"1f345"},{n:["coconut"],u:"1f965"},{n:["avocado"],u:"1f951"},{n:["aubergine","eggplant"],u:"1f346"},{n:["potato"],u:"1f954"},{n:["carrot"],u:"1f955"},{n:["ear of maize","corn"],u:"1f33d"},{n:["hot_pepper"],u:"1f336-fe0f"},{n:["cucumber"],u:"1f952"},{n:["broccoli"],u:"1f966"},{n:["mushroom"],u:"1f344"},{n:["peanuts"],u:"1f95c"},{n:["chestnut"],u:"1f330"},{n:["bread"],u:"1f35e"},{n:["croissant"],u:"1f950"},{n:["baguette bread","baguette_bread"],u:"1f956"},{n:["pretzel"],u:"1f968"},{n:["pancakes"],u:"1f95e"},{n:["cheese wedge","cheese_wedge"],u:"1f9c0"},{n:["meat on bone","meat_on_bone"],u:"1f356"},{n:["poultry leg","poultry_leg"],u:"1f357"},{n:["cut of meat","cut_of_meat"],u:"1f969"},{n:["bacon"],u:"1f953"},{n:["hamburger"],u:"1f354"},{n:["french fries","fries"],u:"1f35f"},{n:["slice of pizza","pizza"],u:"1f355"},{n:["hot dog","hotdog"],u:"1f32d"},{n:["sandwich"],u:"1f96a"},{n:["taco"],u:"1f32e"},{n:["burrito"],u:"1f32f"},{n:["stuffed flatbread","stuffed_flatbread"],u:"1f959"},{n:["egg"],u:"1f95a"},{n:["cooking","fried_egg"],u:"1f373"},{n:["shallow pan of food","shallow_pan_of_food"],u:"1f958"},{n:["pot of food","stew"],u:"1f372"},{n:["bowl with spoon","bowl_with_spoon"],u:"1f963"},{n:["green salad","green_salad"],u:"1f957"},{n:["popcorn"],u:"1f37f"},{n:["canned food","canned_food"],u:"1f96b"},{n:["bento box","bento"],u:"1f371"},{n:["rice cracker","rice_cracker"],u:"1f358"},{n:["rice ball","rice_ball"],u:"1f359"},{n:["cooked rice","rice"],u:"1f35a"},{n:["curry and rice","curry"],u:"1f35b"},{n:["steaming bowl","ramen"],u:"1f35c"},{n:["spaghetti"],u:"1f35d"},{n:["roasted sweet potato","sweet_potato"],u:"1f360"},{n:["oden"],u:"1f362"},{n:["sushi"],u:"1f363"},{n:["fried shrimp","fried_shrimp"],u:"1f364"},{n:["fish cake with swirl design","fish_cake"],u:"1f365"},{n:["dango"],u:"1f361"},{n:["dumpling"],u:"1f95f"},{n:["fortune cookie","fortune_cookie"],u:"1f960"},{n:["takeout box","takeout_box"],u:"1f961"},{n:["soft ice cream","icecream"],u:"1f366"},{n:["shaved ice","shaved_ice"],u:"1f367"},{n:["ice cream","ice_cream"],u:"1f368"},{n:["doughnut"],u:"1f369"},{n:["cookie"],u:"1f36a"},{n:["birthday cake","birthday"],u:"1f382"},{n:["shortcake","cake"],u:"1f370"},{n:["pie"],u:"1f967"},{n:["chocolate bar","chocolate_bar"],u:"1f36b"},{n:["candy"],u:"1f36c"},{n:["lollipop"],u:"1f36d"},{n:["custard"],u:"1f36e"},{n:["honey pot","honey_pot"],u:"1f36f"},{n:["baby bottle","baby_bottle"],u:"1f37c"},{n:["glass of milk","glass_of_milk"],u:"1f95b"},{n:["hot beverage","coffee"],u:"2615"},{n:["teacup without handle","tea"],u:"1f375"},{n:["sake bottle and cup","sake"],u:"1f376"},{n:["bottle with popping cork","champagne"],u:"1f37e"},{n:["wine glass","wine_glass"],u:"1f377"},{n:["cocktail glass","cocktail"],u:"1f378"},{n:["tropical drink","tropical_drink"],u:"1f379"},{n:["beer mug","beer"],u:"1f37a"},{n:["clinking beer mugs","beers"],u:"1f37b"},{n:["clinking glasses","clinking_glasses"],u:"1f942"},{n:["tumbler glass","tumbler_glass"],u:"1f943"},{n:["cup with straw","cup_with_straw"],u:"1f964"},{n:["chopsticks"],u:"1f962"},{n:["knife_fork_plate"],u:"1f37d-fe0f"},{n:["fork and knife","fork_and_knife"],u:"1f374"},{n:["spoon"],u:"1f944"},{n:["hocho","knife"],u:"1f52a"},{n:["amphora"],u:"1f3fa"}],OSr=[{n:["jack-o-lantern","jack_o_lantern"],u:"1f383"},{n:["christmas tree","christmas_tree"],u:"1f384"},{n:["fireworks"],u:"1f386"},{n:["firework sparkler","sparkler"],u:"1f387"},{n:["sparkles"],u:"2728"},{n:["balloon"],u:"1f388"},{n:["party popper","tada"],u:"1f389"},{n:["confetti ball","confetti_ball"],u:"1f38a"},{n:["tanabata tree","tanabata_tree"],u:"1f38b"},{n:["pine decoration","bamboo"],u:"1f38d"},{n:["japanese dolls","dolls"],u:"1f38e"},{n:["carp streamer","flags"],u:"1f38f"},{n:["wind chime","wind_chime"],u:"1f390"},{n:["moon viewing ceremony","rice_scene"],u:"1f391"},{n:["ribbon"],u:"1f380"},{n:["wrapped present","gift"],u:"1f381"},{n:["reminder_ribbon"],u:"1f397-fe0f"},{n:["admission_tickets"],u:"1f39f-fe0f"},{n:["ticket"],u:"1f3ab"},{n:["medal"],u:"1f396-fe0f"},{n:["trophy"],u:"1f3c6"},{n:["sports medal","sports_medal"],u:"1f3c5"},{n:["first place medal","first_place_medal"],u:"1f947"},{n:["second place medal","second_place_medal"],u:"1f948"},{n:["third place medal","third_place_medal"],u:"1f949"},{n:["soccer ball","soccer"],u:"26bd"},{n:["baseball"],u:"26be"},{n:["basketball and hoop","basketball"],u:"1f3c0"},{n:["volleyball"],u:"1f3d0"},{n:["american football","football"],u:"1f3c8"},{n:["rugby football","rugby_football"],u:"1f3c9"},{n:["tennis racquet and ball","tennis"],u:"1f3be"},{n:["billiards","8ball"],u:"1f3b1"},{n:["bowling"],u:"1f3b3"},{n:["cricket bat and ball","cricket_bat_and_ball"],u:"1f3cf"},{n:["field hockey stick and ball","field_hockey_stick_and_ball"],u:"1f3d1"},{n:["ice hockey stick and puck","ice_hockey_stick_and_puck"],u:"1f3d2"},{n:["table tennis paddle and ball","table_tennis_paddle_and_ball"],u:"1f3d3"},{n:["badminton racquet and shuttlecock","badminton_racquet_and_shuttlecock"],u:"1f3f8"},{n:["boxing glove","boxing_glove"],u:"1f94a"},{n:["martial arts uniform","martial_arts_uniform"],u:"1f94b"},{n:["goal net","goal_net"],u:"1f945"},{n:["direct hit","dart"],u:"1f3af"},{n:["flag in hole","golf"],u:"26f3"},{n:["ice_skate"],u:"26f8-fe0f"},{n:["fishing pole and fish","fishing_pole_and_fish"],u:"1f3a3"},{n:["running shirt with sash","running_shirt_with_sash"],u:"1f3bd"},{n:["ski and ski boot","ski"],u:"1f3bf"},{n:["sled"],u:"1f6f7"},{n:["curling stone","curling_stone"],u:"1f94c"},{n:["video game","video_game"],u:"1f3ae"},{n:["joystick"],u:"1f579-fe0f"},{n:["game die","game_die"],u:"1f3b2"},{n:["black spade suit","spades"],u:"2660-fe0f"},{n:["black heart suit","hearts"],u:"2665-fe0f"},{n:["black diamond suit","diamonds"],u:"2666-fe0f"},{n:["black club suit","clubs"],u:"2663-fe0f"},{n:["playing card black joker","black_joker"],u:"1f0cf"},{n:["mahjong tile red dragon","mahjong"],u:"1f004"},{n:["flower playing cards","flower_playing_cards"],u:"1f3b4"}],mSr=[{n:["earth globe europe-africa","earth_africa"],u:"1f30d"},{n:["earth globe americas","earth_americas"],u:"1f30e"},{n:["earth globe asia-australia","earth_asia"],u:"1f30f"},{n:["globe with meridians","globe_with_meridians"],u:"1f310"},{n:["world_map"],u:"1f5fa-fe0f"},{n:["silhouette of japan","japan"],u:"1f5fe"},{n:["snow_capped_mountain"],u:"1f3d4-fe0f"},{n:["mountain"],u:"26f0-fe0f"},{n:["volcano"],u:"1f30b"},{n:["mount fuji","mount_fuji"],u:"1f5fb"},{n:["camping"],u:"1f3d5-fe0f"},{n:["beach_with_umbrella"],u:"1f3d6-fe0f"},{n:["desert"],u:"1f3dc-fe0f"},{n:["desert_island"],u:"1f3dd-fe0f"},{n:["national_park"],u:"1f3de-fe0f"},{n:["stadium"],u:"1f3df-fe0f"},{n:["classical_building"],u:"1f3db-fe0f"},{n:["building_construction"],u:"1f3d7-fe0f"},{n:["house_buildings"],u:"1f3d8-fe0f"},{n:["cityscape"],u:"1f3d9-fe0f"},{n:["derelict_house_building"],u:"1f3da-fe0f"},{n:["house building","house"],u:"1f3e0"},{n:["house with garden","house_with_garden"],u:"1f3e1"},{n:["office building","office"],u:"1f3e2"},{n:["japanese post office","post_office"],u:"1f3e3"},{n:["european post office","european_post_office"],u:"1f3e4"},{n:["hospital"],u:"1f3e5"},{n:["bank"],u:"1f3e6"},{n:["hotel"],u:"1f3e8"},{n:["love hotel","love_hotel"],u:"1f3e9"},{n:["convenience store","convenience_store"],u:"1f3ea"},{n:["school"],u:"1f3eb"},{n:["department store","department_store"],u:"1f3ec"},{n:["factory"],u:"1f3ed"},{n:["japanese castle","japanese_castle"],u:"1f3ef"},{n:["european castle","european_castle"],u:"1f3f0"},{n:["wedding"],u:"1f492"},{n:["tokyo tower","tokyo_tower"],u:"1f5fc"},{n:["statue of liberty","statue_of_liberty"],u:"1f5fd"},{n:["church"],u:"26ea"},{n:["mosque"],u:"1f54c"},{n:["synagogue"],u:"1f54d"},{n:["shinto_shrine"],u:"26e9-fe0f"},{n:["kaaba"],u:"1f54b"},{n:["fountain"],u:"26f2"},{n:["tent"],u:"26fa"},{n:["foggy"],u:"1f301"},{n:["night with stars","night_with_stars"],u:"1f303"},{n:["sunrise over mountains","sunrise_over_mountains"],u:"1f304"},{n:["sunrise"],u:"1f305"},{n:["cityscape at dusk","city_sunset"],u:"1f306"},{n:["sunset over buildings","city_sunrise"],u:"1f307"},{n:["bridge at night","bridge_at_night"],u:"1f309"},{n:["hot springs","hotsprings"],u:"2668-fe0f"},{n:["milky way","milky_way"],u:"1f30c"},{n:["carousel horse","carousel_horse"],u:"1f3a0"},{n:["ferris wheel","ferris_wheel"],u:"1f3a1"},{n:["roller coaster","roller_coaster"],u:"1f3a2"},{n:["barber pole","barber"],u:"1f488"},{n:["circus tent","circus_tent"],u:"1f3aa"},{n:["performing arts","performing_arts"],u:"1f3ad"},{n:["frame_with_picture"],u:"1f5bc-fe0f"},{n:["artist palette","art"],u:"1f3a8"},{n:["slot machine","slot_machine"],u:"1f3b0"},{n:["steam locomotive","steam_locomotive"],u:"1f682"},{n:["railway car","railway_car"],u:"1f683"},{n:["high-speed train","bullettrain_side"],u:"1f684"},{n:["high-speed train with bullet nose","bullettrain_front"],u:"1f685"},{n:["train","train2"],u:"1f686"},{n:["metro"],u:"1f687"},{n:["light rail","light_rail"],u:"1f688"},{n:["station"],u:"1f689"},{n:["tram"],u:"1f68a"},{n:["monorail"],u:"1f69d"},{n:["mountain railway","mountain_railway"],u:"1f69e"},{n:["tram car","train"],u:"1f68b"},{n:["bus"],u:"1f68c"},{n:["oncoming bus","oncoming_bus"],u:"1f68d"},{n:["trolleybus"],u:"1f68e"},{n:["minibus"],u:"1f690"},{n:["ambulance"],u:"1f691"},{n:["fire engine","fire_engine"],u:"1f692"},{n:["police car","police_car"],u:"1f693"},{n:["oncoming police car","oncoming_police_car"],u:"1f694"},{n:["taxi"],u:"1f695"},{n:["oncoming taxi","oncoming_taxi"],u:"1f696"},{n:["automobile","car","red_car"],u:"1f697"},{n:["oncoming automobile","oncoming_automobile"],u:"1f698"},{n:["recreational vehicle","blue_car"],u:"1f699"},{n:["delivery truck","truck"],u:"1f69a"},{n:["articulated lorry","articulated_lorry"],u:"1f69b"},{n:["tractor"],u:"1f69c"},{n:["bicycle","bike"],u:"1f6b2"},{n:["scooter"],u:"1f6f4"},{n:["motor scooter","motor_scooter"],u:"1f6f5"},{n:["bus stop","busstop"],u:"1f68f"},{n:["motorway"],u:"1f6e3-fe0f"},{n:["railway_track"],u:"1f6e4-fe0f"},{n:["fuel pump","fuelpump"],u:"26fd"},{n:["police cars revolving light","rotating_light"],u:"1f6a8"},{n:["horizontal traffic light","traffic_light"],u:"1f6a5"},{n:["vertical traffic light","vertical_traffic_light"],u:"1f6a6"},{n:["construction sign","construction"],u:"1f6a7"},{n:["octagonal sign","octagonal_sign"],u:"1f6d1"},{n:["anchor"],u:"2693"},{n:["sailboat","boat"],u:"26f5"},{n:["canoe"],u:"1f6f6"},{n:["speedboat"],u:"1f6a4"},{n:["passenger_ship"],u:"1f6f3-fe0f"},{n:["ferry"],u:"26f4-fe0f"},{n:["motor_boat"],u:"1f6e5-fe0f"},{n:["ship"],u:"1f6a2"},{n:["airplane"],u:"2708-fe0f"},{n:["small_airplane"],u:"1f6e9-fe0f"},{n:["airplane departure","airplane_departure"],u:"1f6eb"},{n:["airplane arriving","airplane_arriving"],u:"1f6ec"},{n:["seat"],u:"1f4ba"},{n:["helicopter"],u:"1f681"},{n:["suspension railway","suspension_railway"],u:"1f69f"},{n:["mountain cableway","mountain_cableway"],u:"1f6a0"},{n:["aerial tramway","aerial_tramway"],u:"1f6a1"},{n:["satellite"],u:"1f6f0-fe0f"},{n:["rocket"],u:"1f680"},{n:["flying saucer","flying_saucer"],u:"1f6f8"},{n:["bellhop_bell"],u:"1f6ce-fe0f"},{n:["door"],u:"1f6aa"},{n:["bed"],u:"1f6cf-fe0f"},{n:["couch_and_lamp"],u:"1f6cb-fe0f"},{n:["toilet"],u:"1f6bd"},{n:["shower"],u:"1f6bf"},{n:["bathtub"],u:"1f6c1"},{n:["hourglass"],u:"231b"},{n:["hourglass with flowing sand","hourglass_flowing_sand"],u:"23f3"},{n:["watch"],u:"231a"},{n:["alarm clock","alarm_clock"],u:"23f0"},{n:["stopwatch"],u:"23f1-fe0f"},{n:["timer_clock"],u:"23f2-fe0f"},{n:["mantelpiece_clock"],u:"1f570-fe0f"},{n:["clock face twelve oclock","clock12"],u:"1f55b"},{n:["clock face twelve-thirty","clock1230"],u:"1f567"},{n:["clock face one oclock","clock1"],u:"1f550"},{n:["clock face one-thirty","clock130"],u:"1f55c"},{n:["clock face two oclock","clock2"],u:"1f551"},{n:["clock face two-thirty","clock230"],u:"1f55d"},{n:["clock face three oclock","clock3"],u:"1f552"},{n:["clock face three-thirty","clock330"],u:"1f55e"},{n:["clock face four oclock","clock4"],u:"1f553"},{n:["clock face four-thirty","clock430"],u:"1f55f"},{n:["clock face five oclock","clock5"],u:"1f554"},{n:["clock face five-thirty","clock530"],u:"1f560"},{n:["clock face six oclock","clock6"],u:"1f555"},{n:["clock face six-thirty","clock630"],u:"1f561"},{n:["clock face seven oclock","clock7"],u:"1f556"},{n:["clock face seven-thirty","clock730"],u:"1f562"},{n:["clock face eight oclock","clock8"],u:"1f557"},{n:["clock face eight-thirty","clock830"],u:"1f563"},{n:["clock face nine oclock","clock9"],u:"1f558"},{n:["clock face nine-thirty","clock930"],u:"1f564"},{n:["clock face ten oclock","clock10"],u:"1f559"},{n:["clock face ten-thirty","clock1030"],u:"1f565"},{n:["clock face eleven oclock","clock11"],u:"1f55a"},{n:["clock face eleven-thirty","clock1130"],u:"1f566"},{n:["new moon symbol","new_moon"],u:"1f311"},{n:["waxing crescent moon symbol","waxing_crescent_moon"],u:"1f312"},{n:["first quarter moon symbol","first_quarter_moon"],u:"1f313"},{n:["waxing gibbous moon symbol","moon","waxing_gibbous_moon"],u:"1f314"},{n:["full moon symbol","full_moon"],u:"1f315"},{n:["waning gibbous moon symbol","waning_gibbous_moon"],u:"1f316"},{n:["last quarter moon symbol","last_quarter_moon"],u:"1f317"},{n:["waning crescent moon symbol","waning_crescent_moon"],u:"1f318"},{n:["crescent moon","crescent_moon"],u:"1f319"},{n:["new moon with face","new_moon_with_face"],u:"1f31a"},{n:["first quarter moon with face","first_quarter_moon_with_face"],u:"1f31b"},{n:["last quarter moon with face","last_quarter_moon_with_face"],u:"1f31c"},{n:["thermometer"],u:"1f321-fe0f"},{n:["black sun with rays","sunny"],u:"2600-fe0f"},{n:["full moon with face","full_moon_with_face"],u:"1f31d"},{n:["sun with face","sun_with_face"],u:"1f31e"},{n:["white medium star","star"],u:"2b50"},{n:["glowing star","star2"],u:"1f31f"},{n:["shooting star","stars"],u:"1f320"},{n:["cloud"],u:"2601-fe0f"},{n:["sun behind cloud","partly_sunny"],u:"26c5"},{n:["thunder_cloud_and_rain"],u:"26c8-fe0f"},{n:["mostly_sunny","sun_small_cloud"],u:"1f324-fe0f"},{n:["barely_sunny","sun_behind_cloud"],u:"1f325-fe0f"},{n:["partly_sunny_rain","sun_behind_rain_cloud"],u:"1f326-fe0f"},{n:["rain_cloud"],u:"1f327-fe0f"},{n:["snow_cloud"],u:"1f328-fe0f"},{n:["lightning","lightning_cloud"],u:"1f329-fe0f"},{n:["tornado","tornado_cloud"],u:"1f32a-fe0f"},{n:["fog"],u:"1f32b-fe0f"},{n:["wind_blowing_face"],u:"1f32c-fe0f"},{n:["cyclone"],u:"1f300"},{n:["rainbow"],u:"1f308"},{n:["closed umbrella","closed_umbrella"],u:"1f302"},{n:["umbrella"],u:"2602-fe0f"},{n:["umbrella with rain drops","umbrella_with_rain_drops"],u:"2614"},{n:["umbrella_on_ground"],u:"26f1-fe0f"},{n:["high voltage sign","zap"],u:"26a1"},{n:["snowflake"],u:"2744-fe0f"},{n:["snowman"],u:"2603-fe0f"},{n:["snowman without snow","snowman_without_snow"],u:"26c4"},{n:["comet"],u:"2604-fe0f"},{n:["fire"],u:"1f525"},{n:["droplet"],u:"1f4a7"},{n:["water wave","ocean"],u:"1f30a"}],gSr=[{n:["speaker with cancellation stroke","mute"],u:"1f507"},{n:["speaker"],u:"1f508"},{n:["speaker with one sound wave","sound"],u:"1f509"},{n:["speaker with three sound waves","loud_sound"],u:"1f50a"},{n:["public address loudspeaker","loudspeaker"],u:"1f4e2"},{n:["cheering megaphone","mega"],u:"1f4e3"},{n:["postal horn","postal_horn"],u:"1f4ef"},{n:["bell"],u:"1f514"},{n:["bell with cancellation stroke","no_bell"],u:"1f515"},{n:["musical score","musical_score"],u:"1f3bc"},{n:["musical note","musical_note"],u:"1f3b5"},{n:["multiple musical notes","notes"],u:"1f3b6"},{n:["studio_microphone"],u:"1f399-fe0f"},{n:["level_slider"],u:"1f39a-fe0f"},{n:["control_knobs"],u:"1f39b-fe0f"},{n:["microphone"],u:"1f3a4"},{n:["headphone","headphones"],u:"1f3a7"},{n:["radio"],u:"1f4fb"},{n:["saxophone"],u:"1f3b7"},{n:["guitar"],u:"1f3b8"},{n:["musical keyboard","musical_keyboard"],u:"1f3b9"},{n:["trumpet"],u:"1f3ba"},{n:["violin"],u:"1f3bb"},{n:["drum with drumsticks","drum_with_drumsticks"],u:"1f941"},{n:["mobile phone","iphone"],u:"1f4f1"},{n:["mobile phone with rightwards arrow at left","calling"],u:"1f4f2"},{n:["black telephone","phone","telephone"],u:"260e-fe0f"},{n:["telephone receiver","telephone_receiver"],u:"1f4de"},{n:["pager"],u:"1f4df"},{n:["fax machine","fax"],u:"1f4e0"},{n:["battery"],u:"1f50b"},{n:["electric plug","electric_plug"],u:"1f50c"},{n:["personal computer","computer"],u:"1f4bb"},{n:["desktop_computer"],u:"1f5a5-fe0f"},{n:["printer"],u:"1f5a8-fe0f"},{n:["keyboard"],u:"2328-fe0f"},{n:["three_button_mouse"],u:"1f5b1-fe0f"},{n:["trackball"],u:"1f5b2-fe0f"},{n:["minidisc"],u:"1f4bd"},{n:["floppy disk","floppy_disk"],u:"1f4be"},{n:["optical disc","cd"],u:"1f4bf"},{n:["dvd"],u:"1f4c0"},{n:["movie camera","movie_camera"],u:"1f3a5"},{n:["film_frames"],u:"1f39e-fe0f"},{n:["film_projector"],u:"1f4fd-fe0f"},{n:["clapper board","clapper"],u:"1f3ac"},{n:["television","tv"],u:"1f4fa"},{n:["camera"],u:"1f4f7"},{n:["camera with flash","camera_with_flash"],u:"1f4f8"},{n:["video camera","video_camera"],u:"1f4f9"},{n:["videocassette","vhs"],u:"1f4fc"},{n:["left-pointing magnifying glass","mag"],u:"1f50d"},{n:["right-pointing magnifying glass","mag_right"],u:"1f50e"},{n:["microscope"],u:"1f52c"},{n:["telescope"],u:"1f52d"},{n:["satellite antenna","satellite_antenna"],u:"1f4e1"},{n:["candle"],u:"1f56f-fe0f"},{n:["electric light bulb","bulb"],u:"1f4a1"},{n:["electric torch","flashlight"],u:"1f526"},{n:["izakaya lantern","izakaya_lantern","lantern"],u:"1f3ee"},{n:["notebook with decorative cover","notebook_with_decorative_cover"],u:"1f4d4"},{n:["closed book","closed_book"],u:"1f4d5"},{n:["open book","book","open_book"],u:"1f4d6"},{n:["green book","green_book"],u:"1f4d7"},{n:["blue book","blue_book"],u:"1f4d8"},{n:["orange book","orange_book"],u:"1f4d9"},{n:["books"],u:"1f4da"},{n:["notebook"],u:"1f4d3"},{n:["ledger"],u:"1f4d2"},{n:["page with curl","page_with_curl"],u:"1f4c3"},{n:["scroll"],u:"1f4dc"},{n:["page facing up","page_facing_up"],u:"1f4c4"},{n:["newspaper"],u:"1f4f0"},{n:["rolled_up_newspaper"],u:"1f5de-fe0f"},{n:["bookmark tabs","bookmark_tabs"],u:"1f4d1"},{n:["bookmark"],u:"1f516"},{n:["label"],u:"1f3f7-fe0f"},{n:["money bag","moneybag"],u:"1f4b0"},{n:["banknote with yen sign","yen"],u:"1f4b4"},{n:["banknote with dollar sign","dollar"],u:"1f4b5"},{n:["banknote with euro sign","euro"],u:"1f4b6"},{n:["banknote with pound sign","pound"],u:"1f4b7"},{n:["money with wings","money_with_wings"],u:"1f4b8"},{n:["credit card","credit_card"],u:"1f4b3"},{n:["chart with upwards trend and yen sign","chart"],u:"1f4b9"},{n:["currency exchange","currency_exchange"],u:"1f4b1"},{n:["heavy dollar sign","heavy_dollar_sign"],u:"1f4b2"},{n:["envelope","email"],u:"2709-fe0f"},{n:["e-mail symbol","e-mail"],u:"1f4e7"},{n:["incoming envelope","incoming_envelope"],u:"1f4e8"},{n:["envelope with downwards arrow above","envelope_with_arrow"],u:"1f4e9"},{n:["outbox tray","outbox_tray"],u:"1f4e4"},{n:["inbox tray","inbox_tray"],u:"1f4e5"},{n:["package"],u:"1f4e6"},{n:["closed mailbox with raised flag","mailbox"],u:"1f4eb"},{n:["closed mailbox with lowered flag","mailbox_closed"],u:"1f4ea"},{n:["open mailbox with raised flag","mailbox_with_mail"],u:"1f4ec"},{n:["open mailbox with lowered flag","mailbox_with_no_mail"],u:"1f4ed"},{n:["postbox"],u:"1f4ee"},{n:["ballot_box_with_ballot"],u:"1f5f3-fe0f"},{n:["pencil","pencil2"],u:"270f-fe0f"},{n:["black nib","black_nib"],u:"2712-fe0f"},{n:["lower_left_fountain_pen"],u:"1f58b-fe0f"},{n:["lower_left_ballpoint_pen"],u:"1f58a-fe0f"},{n:["lower_left_paintbrush"],u:"1f58c-fe0f"},{n:["lower_left_crayon"],u:"1f58d-fe0f"},{n:["memo","pencil"],u:"1f4dd"},{n:["briefcase"],u:"1f4bc"},{n:["file folder","file_folder"],u:"1f4c1"},{n:["open file folder","open_file_folder"],u:"1f4c2"},{n:["card_index_dividers"],u:"1f5c2-fe0f"},{n:["calendar","date"],u:"1f4c5"},{n:["tear-off calendar","calendar"],u:"1f4c6"},{n:["spiral_note_pad"],u:"1f5d2-fe0f"},{n:["spiral_calendar_pad"],u:"1f5d3-fe0f"},{n:["card index","card_index"],u:"1f4c7"},{n:["chart with upwards trend","chart_with_upwards_trend"],u:"1f4c8"},{n:["chart with downwards trend","chart_with_downwards_trend"],u:"1f4c9"},{n:["bar chart","bar_chart"],u:"1f4ca"},{n:["clipboard"],u:"1f4cb"},{n:["pushpin"],u:"1f4cc"},{n:["round pushpin","round_pushpin"],u:"1f4cd"},{n:["paperclip"],u:"1f4ce"},{n:["linked_paperclips"],u:"1f587-fe0f"},{n:["straight ruler","straight_ruler"],u:"1f4cf"},{n:["triangular ruler","triangular_ruler"],u:"1f4d0"},{n:["black scissors","scissors"],u:"2702-fe0f"},{n:["card_file_box"],u:"1f5c3-fe0f"},{n:["file_cabinet"],u:"1f5c4-fe0f"},{n:["wastebasket"],u:"1f5d1-fe0f"},{n:["lock"],u:"1f512"},{n:["open lock","unlock"],u:"1f513"},{n:["lock with ink pen","lock_with_ink_pen"],u:"1f50f"},{n:["closed lock with key","closed_lock_with_key"],u:"1f510"},{n:["key"],u:"1f511"},{n:["old_key"],u:"1f5dd-fe0f"},{n:["hammer"],u:"1f528"},{n:["pick"],u:"26cf-fe0f"},{n:["hammer_and_pick"],u:"2692-fe0f"},{n:["hammer_and_wrench"],u:"1f6e0-fe0f"},{n:["dagger_knife"],u:"1f5e1-fe0f"},{n:["crossed_swords"],u:"2694-fe0f"},{n:["pistol","gun"],u:"1f52b"},{n:["bow and arrow","bow_and_arrow"],u:"1f3f9"},{n:["shield"],u:"1f6e1-fe0f"},{n:["wrench"],u:"1f527"},{n:["nut and bolt","nut_and_bolt"],u:"1f529"},{n:["gear"],u:"2699-fe0f"},{n:["compression"],u:"1f5dc-fe0f"},{n:["alembic"],u:"2697-fe0f"},{n:["scales"],u:"2696-fe0f"},{n:["link symbol","link"],u:"1f517"},{n:["chains"],u:"26d3-fe0f"},{n:["syringe"],u:"1f489"},{n:["pill"],u:"1f48a"},{n:["smoking symbol","smoking"],u:"1f6ac"},{n:["coffin"],u:"26b0-fe0f"},{n:["funeral_urn"],u:"26b1-fe0f"},{n:["moyai"],u:"1f5ff"},{n:["oil_drum"],u:"1f6e2-fe0f"},{n:["crystal ball","crystal_ball"],u:"1f52e"},{n:["shopping trolley","shopping_trolley"],u:"1f6d2"}],QSr=[{n:["automated teller machine","atm"],u:"1f3e7"},{n:["put litter in its place symbol","put_litter_in_its_place"],u:"1f6ae"},{n:["potable water symbol","potable_water"],u:"1f6b0"},{n:["wheelchair symbol","wheelchair"],u:"267f"},{n:["mens symbol","mens"],u:"1f6b9"},{n:["womens symbol","womens"],u:"1f6ba"},{n:["restroom"],u:"1f6bb"},{n:["baby symbol","baby_symbol"],u:"1f6bc"},{n:["water closet","wc"],u:"1f6be"},{n:["passport control","passport_control"],u:"1f6c2"},{n:["customs"],u:"1f6c3"},{n:["baggage claim","baggage_claim"],u:"1f6c4"},{n:["left luggage","left_luggage"],u:"1f6c5"},{n:["warning sign","warning"],u:"26a0-fe0f"},{n:["children crossing","children_crossing"],u:"1f6b8"},{n:["no entry","no_entry"],u:"26d4"},{n:["no entry sign","no_entry_sign"],u:"1f6ab"},{n:["no bicycles","no_bicycles"],u:"1f6b3"},{n:["no smoking symbol","no_smoking"],u:"1f6ad"},{n:["do not litter symbol","do_not_litter"],u:"1f6af"},{n:["non-potable water symbol","non-potable_water"],u:"1f6b1"},{n:["no pedestrians","no_pedestrians"],u:"1f6b7"},{n:["no mobile phones","no_mobile_phones"],u:"1f4f5"},{n:["no one under eighteen symbol","underage"],u:"1f51e"},{n:["radioactive_sign"],u:"2622-fe0f"},{n:["biohazard_sign"],u:"2623-fe0f"},{n:["upwards black arrow","arrow_up"],u:"2b06-fe0f"},{n:["north east arrow","arrow_upper_right"],u:"2197-fe0f"},{n:["black rightwards arrow","arrow_right"],u:"27a1-fe0f"},{n:["south east arrow","arrow_lower_right"],u:"2198-fe0f"},{n:["downwards black arrow","arrow_down"],u:"2b07-fe0f"},{n:["south west arrow","arrow_lower_left"],u:"2199-fe0f"},{n:["leftwards black arrow","arrow_left"],u:"2b05-fe0f"},{n:["north west arrow","arrow_upper_left"],u:"2196-fe0f"},{n:["up down arrow","arrow_up_down"],u:"2195-fe0f"},{n:["left right arrow","left_right_arrow"],u:"2194-fe0f"},{n:["leftwards arrow with hook","leftwards_arrow_with_hook"],u:"21a9-fe0f"},{n:["rightwards arrow with hook","arrow_right_hook"],u:"21aa-fe0f"},{n:["arrow pointing rightwards then curving upwards","arrow_heading_up"],u:"2934-fe0f"},{n:["arrow pointing rightwards then curving downwards","arrow_heading_down"],u:"2935-fe0f"},{n:["clockwise downwards and upwards open circle arrows","arrows_clockwise"],u:"1f503"},{n:["anticlockwise downwards and upwards open circle arrows","arrows_counterclockwise"],u:"1f504"},{n:["back with leftwards arrow above","back"],u:"1f519"},{n:["end with leftwards arrow above","end"],u:"1f51a"},{n:["on with exclamation mark with left right arrow above","on"],u:"1f51b"},{n:["soon with rightwards arrow above","soon"],u:"1f51c"},{n:["top with upwards arrow above","top"],u:"1f51d"},{n:["place of worship","place_of_worship"],u:"1f6d0"},{n:["atom_symbol"],u:"269b-fe0f"},{n:["om_symbol"],u:"1f549-fe0f"},{n:["star_of_david"],u:"2721-fe0f"},{n:["wheel_of_dharma"],u:"2638-fe0f"},{n:["yin_yang"],u:"262f-fe0f"},{n:["latin_cross"],u:"271d-fe0f"},{n:["orthodox_cross"],u:"2626-fe0f"},{n:["star_and_crescent"],u:"262a-fe0f"},{n:["peace_symbol"],u:"262e-fe0f"},{n:["menorah with nine branches","menorah_with_nine_branches"],u:"1f54e"},{n:["six pointed star with middle dot","six_pointed_star"],u:"1f52f"},{n:["aries"],u:"2648"},{n:["taurus"],u:"2649"},{n:["gemini"],u:"264a"},{n:["cancer"],u:"264b"},{n:["leo"],u:"264c"},{n:["virgo"],u:"264d"},{n:["libra"],u:"264e"},{n:["scorpius"],u:"264f"},{n:["sagittarius"],u:"2650"},{n:["capricorn"],u:"2651"},{n:["aquarius"],u:"2652"},{n:["pisces"],u:"2653"},{n:["ophiuchus"],u:"26ce"},{n:["twisted rightwards arrows","twisted_rightwards_arrows"],u:"1f500"},{n:["clockwise rightwards and leftwards open circle arrows","repeat"],u:"1f501"},{n:["clockwise rightwards and leftwards open circle arrows with circled one overlay","repeat_one"],u:"1f502"},{n:["black right-pointing triangle","arrow_forward"],u:"25b6-fe0f"},{n:["black right-pointing double triangle","fast_forward"],u:"23e9"},{n:["black_right_pointing_double_triangle_with_vertical_bar"],u:"23ed-fe0f"},{n:["black_right_pointing_triangle_with_double_vertical_bar"],u:"23ef-fe0f"},{n:["black left-pointing triangle","arrow_backward"],u:"25c0-fe0f"},{n:["black left-pointing double triangle","rewind"],u:"23ea"},{n:["black_left_pointing_double_triangle_with_vertical_bar"],u:"23ee-fe0f"},{n:["up-pointing small red triangle","arrow_up_small"],u:"1f53c"},{n:["black up-pointing double triangle","arrow_double_up"],u:"23eb"},{n:["down-pointing small red triangle","arrow_down_small"],u:"1f53d"},{n:["black down-pointing double triangle","arrow_double_down"],u:"23ec"},{n:["double_vertical_bar"],u:"23f8-fe0f"},{n:["black_square_for_stop"],u:"23f9-fe0f"},{n:["black_circle_for_record"],u:"23fa-fe0f"},{n:["eject"],u:"23cf-fe0f"},{n:["cinema"],u:"1f3a6"},{n:["low brightness symbol","low_brightness"],u:"1f505"},{n:["high brightness symbol","high_brightness"],u:"1f506"},{n:["antenna with bars","signal_strength"],u:"1f4f6"},{n:["vibration mode","vibration_mode"],u:"1f4f3"},{n:["mobile phone off","mobile_phone_off"],u:"1f4f4"},{n:["female_sign"],u:"2640-fe0f"},{n:["male_sign"],u:"2642-fe0f"},{n:["medical_symbol","staff_of_aesculapius"],u:"2695-fe0f"},{n:["black universal recycling symbol","recycle"],u:"267b-fe0f"},{n:["fleur_de_lis"],u:"269c-fe0f"},{n:["trident emblem","trident"],u:"1f531"},{n:["name badge","name_badge"],u:"1f4db"},{n:["japanese symbol for beginner","beginner"],u:"1f530"},{n:["heavy large circle","o"],u:"2b55"},{n:["white heavy check mark","white_check_mark"],u:"2705"},{n:["ballot box with check","ballot_box_with_check"],u:"2611-fe0f"},{n:["heavy check mark","heavy_check_mark"],u:"2714-fe0f"},{n:["heavy multiplication x","heavy_multiplication_x"],u:"2716-fe0f"},{n:["cross mark","x"],u:"274c"},{n:["negative squared cross mark","negative_squared_cross_mark"],u:"274e"},{n:["heavy plus sign","heavy_plus_sign"],u:"2795"},{n:["heavy minus sign","heavy_minus_sign"],u:"2796"},{n:["heavy division sign","heavy_division_sign"],u:"2797"},{n:["curly loop","curly_loop"],u:"27b0"},{n:["double curly loop","loop"],u:"27bf"},{n:["part alternation mark","part_alternation_mark"],u:"303d-fe0f"},{n:["eight spoked asterisk","eight_spoked_asterisk"],u:"2733-fe0f"},{n:["eight pointed black star","eight_pointed_black_star"],u:"2734-fe0f"},{n:["sparkle"],u:"2747-fe0f"},{n:["double exclamation mark","bangbang"],u:"203c-fe0f"},{n:["exclamation question mark","interrobang"],u:"2049-fe0f"},{n:["black question mark ornament","question"],u:"2753"},{n:["white question mark ornament","grey_question"],u:"2754"},{n:["white exclamation mark ornament","grey_exclamation"],u:"2755"},{n:["heavy exclamation mark symbol","exclamation","heavy_exclamation_mark"],u:"2757"},{n:["wavy dash","wavy_dash"],u:"3030-fe0f"},{n:["copyright sign","copyright"],u:"00a9-fe0f"},{n:["registered sign","registered"],u:"00ae-fe0f"},{n:["trade mark sign","tm"],u:"2122-fe0f"},{n:["hash key","hash"],u:"0023-fe0f-20e3"},{n:["keycap_star"],u:"002a-fe0f-20e3"},{n:["keycap 0","zero"],u:"0030-fe0f-20e3"},{n:["keycap 1","one"],u:"0031-fe0f-20e3"},{n:["keycap 2","two"],u:"0032-fe0f-20e3"},{n:["keycap 3","three"],u:"0033-fe0f-20e3"},{n:["keycap 4","four"],u:"0034-fe0f-20e3"},{n:["keycap 5","five"],u:"0035-fe0f-20e3"},{n:["keycap 6","six"],u:"0036-fe0f-20e3"},{n:["keycap 7","seven"],u:"0037-fe0f-20e3"},{n:["keycap 8","eight"],u:"0038-fe0f-20e3"},{n:["keycap 9","nine"],u:"0039-fe0f-20e3"},{n:["keycap ten","keycap_ten"],u:"1f51f"},{n:["hundred points symbol","100"],u:"1f4af"},{n:["input symbol for latin capital letters","capital_abcd"],u:"1f520"},{n:["input symbol for latin small letters","abcd"],u:"1f521"},{n:["input symbol for numbers","1234"],u:"1f522"},{n:["input symbol for symbols","symbols"],u:"1f523"},{n:["input symbol for latin letters","abc"],u:"1f524"},{n:["negative squared latin capital letter a","a"],u:"1f170-fe0f"},{n:["negative squared ab","ab"],u:"1f18e"},{n:["negative squared latin capital letter b","b"],u:"1f171-fe0f"},{n:["squared cl","cl"],u:"1f191"},{n:["squared cool","cool"],u:"1f192"},{n:["squared free","free"],u:"1f193"},{n:["information source","information_source"],u:"2139-fe0f"},{n:["squared id","id"],u:"1f194"},{n:["circled latin capital letter m","m"],u:"24c2-fe0f"},{n:["squared new","new"],u:"1f195"},{n:["squared ng","ng"],u:"1f196"},{n:["negative squared latin capital letter o","o2"],u:"1f17e-fe0f"},{n:["squared ok","ok"],u:"1f197"},{n:["negative squared latin capital letter p","parking"],u:"1f17f-fe0f"},{n:["squared sos","sos"],u:"1f198"},{n:["squared up with exclamation mark","up"],u:"1f199"},{n:["squared vs","vs"],u:"1f19a"},{n:["squared katakana koko","koko"],u:"1f201"},{n:["squared katakana sa","sa"],u:"1f202-fe0f"},{n:["squared cjk unified ideograph-6708","u6708"],u:"1f237-fe0f"},{n:["squared cjk unified ideograph-6709","u6709"],u:"1f236"},{n:["squared cjk unified ideograph-6307","u6307"],u:"1f22f"},{n:["circled ideograph advantage","ideograph_advantage"],u:"1f250"},{n:["squared cjk unified ideograph-5272","u5272"],u:"1f239"},{n:["squared cjk unified ideograph-7121","u7121"],u:"1f21a"},{n:["squared cjk unified ideograph-7981","u7981"],u:"1f232"},{n:["circled ideograph accept","accept"],u:"1f251"},{n:["squared cjk unified ideograph-7533","u7533"],u:"1f238"},{n:["squared cjk unified ideograph-5408","u5408"],u:"1f234"},{n:["squared cjk unified ideograph-7a7a","u7a7a"],u:"1f233"},{n:["circled ideograph congratulation","congratulations"],u:"3297-fe0f"},{n:["circled ideograph secret","secret"],u:"3299-fe0f"},{n:["squared cjk unified ideograph-55b6","u55b6"],u:"1f23a"},{n:["squared cjk unified ideograph-6e80","u6e80"],u:"1f235"},{n:["black small square","black_small_square"],u:"25aa-fe0f"},{n:["white small square","white_small_square"],u:"25ab-fe0f"},{n:["white medium square","white_medium_square"],u:"25fb-fe0f"},{n:["black medium square","black_medium_square"],u:"25fc-fe0f"},{n:["white medium small square","white_medium_small_square"],u:"25fd"},{n:["black medium small square","black_medium_small_square"],u:"25fe"},{n:["black large square","black_large_square"],u:"2b1b"},{n:["white large square","white_large_square"],u:"2b1c"},{n:["large orange diamond","large_orange_diamond"],u:"1f536"},{n:["large blue diamond","large_blue_diamond"],u:"1f537"},{n:["small orange diamond","small_orange_diamond"],u:"1f538"},{n:["small blue diamond","small_blue_diamond"],u:"1f539"},{n:["up-pointing red triangle","small_red_triangle"],u:"1f53a"},{n:["down-pointing red triangle","small_red_triangle_down"],u:"1f53b"},{n:["diamond shape with a dot inside","diamond_shape_with_a_dot_inside"],u:"1f4a0"},{n:["radio button","radio_button"],u:"1f518"},{n:["black square button","black_square_button"],u:"1f532"},{n:["white square button","white_square_button"],u:"1f533"},{n:["medium white circle","white_circle"],u:"26aa"},{n:["medium black circle","black_circle"],u:"26ab"},{n:["large red circle","red_circle"],u:"1f534"},{n:["large blue circle","large_blue_circle"],u:"1f535"}],_Sr=[{n:["chequered flag","checkered_flag"],u:"1f3c1"},{n:["triangular flag on post","triangular_flag_on_post"],u:"1f6a9"},{n:["crossed flags","crossed_flags"],u:"1f38c"},{n:["waving black flag","waving_black_flag"],u:"1f3f4"},{n:["waving_white_flag"],u:"1f3f3-fe0f"},{n:["rainbow-flag"],u:"1f3f3-fe0f-200d-1f308"},{n:["ascension island flag","flag-ac"],u:"1f1e6-1f1e8"},{n:["andorra flag","flag-ad"],u:"1f1e6-1f1e9"},{n:["united arab emirates flag","flag-ae"],u:"1f1e6-1f1ea"},{n:["afghanistan flag","flag-af"],u:"1f1e6-1f1eb"},{n:["antigua & barbuda flag","flag-ag"],u:"1f1e6-1f1ec"},{n:["anguilla flag","flag-ai"],u:"1f1e6-1f1ee"},{n:["albania flag","flag-al"],u:"1f1e6-1f1f1"},{n:["armenia flag","flag-am"],u:"1f1e6-1f1f2"},{n:["angola flag","flag-ao"],u:"1f1e6-1f1f4"},{n:["antarctica flag","flag-aq"],u:"1f1e6-1f1f6"},{n:["argentina flag","flag-ar"],u:"1f1e6-1f1f7"},{n:["american samoa flag","flag-as"],u:"1f1e6-1f1f8"},{n:["austria flag","flag-at"],u:"1f1e6-1f1f9"},{n:["australia flag","flag-au"],u:"1f1e6-1f1fa"},{n:["aruba flag","flag-aw"],u:"1f1e6-1f1fc"},{n:["åland islands flag","flag-ax"],u:"1f1e6-1f1fd"},{n:["azerbaijan flag","flag-az"],u:"1f1e6-1f1ff"},{n:["bosnia & herzegovina flag","flag-ba"],u:"1f1e7-1f1e6"},{n:["barbados flag","flag-bb"],u:"1f1e7-1f1e7"},{n:["bangladesh flag","flag-bd"],u:"1f1e7-1f1e9"},{n:["belgium flag","flag-be"],u:"1f1e7-1f1ea"},{n:["burkina faso flag","flag-bf"],u:"1f1e7-1f1eb"},{n:["bulgaria flag","flag-bg"],u:"1f1e7-1f1ec"},{n:["bahrain flag","flag-bh"],u:"1f1e7-1f1ed"},{n:["burundi flag","flag-bi"],u:"1f1e7-1f1ee"},{n:["benin flag","flag-bj"],u:"1f1e7-1f1ef"},{n:["st. barthélemy flag","flag-bl"],u:"1f1e7-1f1f1"},{n:["bermuda flag","flag-bm"],u:"1f1e7-1f1f2"},{n:["brunei flag","flag-bn"],u:"1f1e7-1f1f3"},{n:["bolivia flag","flag-bo"],u:"1f1e7-1f1f4"},{n:["caribbean netherlands flag","flag-bq"],u:"1f1e7-1f1f6"},{n:["brazil flag","flag-br"],u:"1f1e7-1f1f7"},{n:["bahamas flag","flag-bs"],u:"1f1e7-1f1f8"},{n:["bhutan flag","flag-bt"],u:"1f1e7-1f1f9"},{n:["bouvet island flag","flag-bv"],u:"1f1e7-1f1fb"},{n:["botswana flag","flag-bw"],u:"1f1e7-1f1fc"},{n:["belarus flag","flag-by"],u:"1f1e7-1f1fe"},{n:["belize flag","flag-bz"],u:"1f1e7-1f1ff"},{n:["canada flag","flag-ca"],u:"1f1e8-1f1e6"},{n:["cocos (keeling) islands flag","flag-cc"],u:"1f1e8-1f1e8"},{n:["congo - kinshasa flag","flag-cd"],u:"1f1e8-1f1e9"},{n:["central african republic flag","flag-cf"],u:"1f1e8-1f1eb"},{n:["congo - brazzaville flag","flag-cg"],u:"1f1e8-1f1ec"},{n:["switzerland flag","flag-ch"],u:"1f1e8-1f1ed"},{n:["côte d’ivoire flag","flag-ci"],u:"1f1e8-1f1ee"},{n:["cook islands flag","flag-ck"],u:"1f1e8-1f1f0"},{n:["chile flag","flag-cl"],u:"1f1e8-1f1f1"},{n:["cameroon flag","flag-cm"],u:"1f1e8-1f1f2"},{n:["china flag","cn","flag-cn"],u:"1f1e8-1f1f3"},{n:["colombia flag","flag-co"],u:"1f1e8-1f1f4"},{n:["clipperton island flag","flag-cp"],u:"1f1e8-1f1f5"},{n:["costa rica flag","flag-cr"],u:"1f1e8-1f1f7"},{n:["cuba flag","flag-cu"],u:"1f1e8-1f1fa"},{n:["cape verde flag","flag-cv"],u:"1f1e8-1f1fb"},{n:["curaçao flag","flag-cw"],u:"1f1e8-1f1fc"},{n:["christmas island flag","flag-cx"],u:"1f1e8-1f1fd"},{n:["cyprus flag","flag-cy"],u:"1f1e8-1f1fe"},{n:["czechia flag","flag-cz"],u:"1f1e8-1f1ff"},{n:["germany flag","de","flag-de"],u:"1f1e9-1f1ea"},{n:["diego garcia flag","flag-dg"],u:"1f1e9-1f1ec"},{n:["djibouti flag","flag-dj"],u:"1f1e9-1f1ef"},{n:["denmark flag","flag-dk"],u:"1f1e9-1f1f0"},{n:["dominica flag","flag-dm"],u:"1f1e9-1f1f2"},{n:["dominican republic flag","flag-do"],u:"1f1e9-1f1f4"},{n:["algeria flag","flag-dz"],u:"1f1e9-1f1ff"},{n:["ceuta & melilla flag","flag-ea"],u:"1f1ea-1f1e6"},{n:["ecuador flag","flag-ec"],u:"1f1ea-1f1e8"},{n:["estonia flag","flag-ee"],u:"1f1ea-1f1ea"},{n:["egypt flag","flag-eg"],u:"1f1ea-1f1ec"},{n:["western sahara flag","flag-eh"],u:"1f1ea-1f1ed"},{n:["eritrea flag","flag-er"],u:"1f1ea-1f1f7"},{n:["spain flag","es","flag-es"],u:"1f1ea-1f1f8"},{n:["ethiopia flag","flag-et"],u:"1f1ea-1f1f9"},{n:["european union flag","flag-eu"],u:"1f1ea-1f1fa"},{n:["finland flag","flag-fi"],u:"1f1eb-1f1ee"},{n:["fiji flag","flag-fj"],u:"1f1eb-1f1ef"},{n:["falkland islands flag","flag-fk"],u:"1f1eb-1f1f0"},{n:["micronesia flag","flag-fm"],u:"1f1eb-1f1f2"},{n:["faroe islands flag","flag-fo"],u:"1f1eb-1f1f4"},{n:["france flag","fr","flag-fr"],u:"1f1eb-1f1f7"},{n:["gabon flag","flag-ga"],u:"1f1ec-1f1e6"},{n:["united kingdom flag","gb","uk","flag-gb"],u:"1f1ec-1f1e7"},{n:["grenada flag","flag-gd"],u:"1f1ec-1f1e9"},{n:["georgia flag","flag-ge"],u:"1f1ec-1f1ea"},{n:["french guiana flag","flag-gf"],u:"1f1ec-1f1eb"},{n:["guernsey flag","flag-gg"],u:"1f1ec-1f1ec"},{n:["ghana flag","flag-gh"],u:"1f1ec-1f1ed"},{n:["gibraltar flag","flag-gi"],u:"1f1ec-1f1ee"},{n:["greenland flag","flag-gl"],u:"1f1ec-1f1f1"},{n:["gambia flag","flag-gm"],u:"1f1ec-1f1f2"},{n:["guinea flag","flag-gn"],u:"1f1ec-1f1f3"},{n:["guadeloupe flag","flag-gp"],u:"1f1ec-1f1f5"},{n:["equatorial guinea flag","flag-gq"],u:"1f1ec-1f1f6"},{n:["greece flag","flag-gr"],u:"1f1ec-1f1f7"},{n:["south georgia & south sandwich islands flag","flag-gs"],u:"1f1ec-1f1f8"},{n:["guatemala flag","flag-gt"],u:"1f1ec-1f1f9"},{n:["guam flag","flag-gu"],u:"1f1ec-1f1fa"},{n:["guinea-bissau flag","flag-gw"],u:"1f1ec-1f1fc"},{n:["guyana flag","flag-gy"],u:"1f1ec-1f1fe"},{n:["hong kong sar china flag","flag-hk"],u:"1f1ed-1f1f0"},{n:["heard & mcdonald islands flag","flag-hm"],u:"1f1ed-1f1f2"},{n:["honduras flag","flag-hn"],u:"1f1ed-1f1f3"},{n:["croatia flag","flag-hr"],u:"1f1ed-1f1f7"},{n:["haiti flag","flag-ht"],u:"1f1ed-1f1f9"},{n:["hungary flag","flag-hu"],u:"1f1ed-1f1fa"},{n:["canary islands flag","flag-ic"],u:"1f1ee-1f1e8"},{n:["indonesia flag","flag-id"],u:"1f1ee-1f1e9"},{n:["ireland flag","flag-ie"],u:"1f1ee-1f1ea"},{n:["israel flag","flag-il"],u:"1f1ee-1f1f1"},{n:["isle of man flag","flag-im"],u:"1f1ee-1f1f2"},{n:["india flag","flag-in"],u:"1f1ee-1f1f3"},{n:["british indian ocean territory flag","flag-io"],u:"1f1ee-1f1f4"},{n:["iraq flag","flag-iq"],u:"1f1ee-1f1f6"},{n:["iran flag","flag-ir"],u:"1f1ee-1f1f7"},{n:["iceland flag","flag-is"],u:"1f1ee-1f1f8"},{n:["italy flag","it","flag-it"],u:"1f1ee-1f1f9"},{n:["jersey flag","flag-je"],u:"1f1ef-1f1ea"},{n:["jamaica flag","flag-jm"],u:"1f1ef-1f1f2"},{n:["jordan flag","flag-jo"],u:"1f1ef-1f1f4"},{n:["japan flag","jp","flag-jp"],u:"1f1ef-1f1f5"},{n:["kenya flag","flag-ke"],u:"1f1f0-1f1ea"},{n:["kyrgyzstan flag","flag-kg"],u:"1f1f0-1f1ec"},{n:["cambodia flag","flag-kh"],u:"1f1f0-1f1ed"},{n:["kiribati flag","flag-ki"],u:"1f1f0-1f1ee"},{n:["comoros flag","flag-km"],u:"1f1f0-1f1f2"},{n:["st. kitts & nevis flag","flag-kn"],u:"1f1f0-1f1f3"},{n:["north korea flag","flag-kp"],u:"1f1f0-1f1f5"},{n:["south korea flag","kr","flag-kr"],u:"1f1f0-1f1f7"},{n:["kuwait flag","flag-kw"],u:"1f1f0-1f1fc"},{n:["cayman islands flag","flag-ky"],u:"1f1f0-1f1fe"},{n:["kazakhstan flag","flag-kz"],u:"1f1f0-1f1ff"},{n:["laos flag","flag-la"],u:"1f1f1-1f1e6"},{n:["lebanon flag","flag-lb"],u:"1f1f1-1f1e7"},{n:["st. lucia flag","flag-lc"],u:"1f1f1-1f1e8"},{n:["liechtenstein flag","flag-li"],u:"1f1f1-1f1ee"},{n:["sri lanka flag","flag-lk"],u:"1f1f1-1f1f0"},{n:["liberia flag","flag-lr"],u:"1f1f1-1f1f7"},{n:["lesotho flag","flag-ls"],u:"1f1f1-1f1f8"},{n:["lithuania flag","flag-lt"],u:"1f1f1-1f1f9"},{n:["luxembourg flag","flag-lu"],u:"1f1f1-1f1fa"},{n:["latvia flag","flag-lv"],u:"1f1f1-1f1fb"},{n:["libya flag","flag-ly"],u:"1f1f1-1f1fe"},{n:["morocco flag","flag-ma"],u:"1f1f2-1f1e6"},{n:["monaco flag","flag-mc"],u:"1f1f2-1f1e8"},{n:["moldova flag","flag-md"],u:"1f1f2-1f1e9"},{n:["montenegro flag","flag-me"],u:"1f1f2-1f1ea"},{n:["st. martin flag","flag-mf"],u:"1f1f2-1f1eb"},{n:["madagascar flag","flag-mg"],u:"1f1f2-1f1ec"},{n:["marshall islands flag","flag-mh"],u:"1f1f2-1f1ed"},{n:["macedonia flag","flag-mk"],u:"1f1f2-1f1f0"},{n:["mali flag","flag-ml"],u:"1f1f2-1f1f1"},{n:["myanmar (burma) flag","flag-mm"],u:"1f1f2-1f1f2"},{n:["mongolia flag","flag-mn"],u:"1f1f2-1f1f3"},{n:["macau sar china flag","flag-mo"],u:"1f1f2-1f1f4"},{n:["northern mariana islands flag","flag-mp"],u:"1f1f2-1f1f5"},{n:["martinique flag","flag-mq"],u:"1f1f2-1f1f6"},{n:["mauritania flag","flag-mr"],u:"1f1f2-1f1f7"},{n:["montserrat flag","flag-ms"],u:"1f1f2-1f1f8"},{n:["malta flag","flag-mt"],u:"1f1f2-1f1f9"},{n:["mauritius flag","flag-mu"],u:"1f1f2-1f1fa"},{n:["maldives flag","flag-mv"],u:"1f1f2-1f1fb"},{n:["malawi flag","flag-mw"],u:"1f1f2-1f1fc"},{n:["mexico flag","flag-mx"],u:"1f1f2-1f1fd"},{n:["malaysia flag","flag-my"],u:"1f1f2-1f1fe"},{n:["mozambique flag","flag-mz"],u:"1f1f2-1f1ff"},{n:["namibia flag","flag-na"],u:"1f1f3-1f1e6"},{n:["new caledonia flag","flag-nc"],u:"1f1f3-1f1e8"},{n:["niger flag","flag-ne"],u:"1f1f3-1f1ea"},{n:["norfolk island flag","flag-nf"],u:"1f1f3-1f1eb"},{n:["nigeria flag","flag-ng"],u:"1f1f3-1f1ec"},{n:["nicaragua flag","flag-ni"],u:"1f1f3-1f1ee"},{n:["netherlands flag","flag-nl"],u:"1f1f3-1f1f1"},{n:["norway flag","flag-no"],u:"1f1f3-1f1f4"},{n:["nepal flag","flag-np"],u:"1f1f3-1f1f5"},{n:["nauru flag","flag-nr"],u:"1f1f3-1f1f7"},{n:["niue flag","flag-nu"],u:"1f1f3-1f1fa"},{n:["new zealand flag","flag-nz"],u:"1f1f3-1f1ff"},{n:["oman flag","flag-om"],u:"1f1f4-1f1f2"},{n:["panama flag","flag-pa"],u:"1f1f5-1f1e6"},{n:["peru flag","flag-pe"],u:"1f1f5-1f1ea"},{n:["french polynesia flag","flag-pf"],u:"1f1f5-1f1eb"},{n:["papua new guinea flag","flag-pg"],u:"1f1f5-1f1ec"},{n:["philippines flag","flag-ph"],u:"1f1f5-1f1ed"},{n:["pakistan flag","flag-pk"],u:"1f1f5-1f1f0"},{n:["poland flag","flag-pl"],u:"1f1f5-1f1f1"},{n:["st. pierre & miquelon flag","flag-pm"],u:"1f1f5-1f1f2"},{n:["pitcairn islands flag","flag-pn"],u:"1f1f5-1f1f3"},{n:["puerto rico flag","flag-pr"],u:"1f1f5-1f1f7"},{n:["palestinian territories flag","flag-ps"],u:"1f1f5-1f1f8"},{n:["portugal flag","flag-pt"],u:"1f1f5-1f1f9"},{n:["palau flag","flag-pw"],u:"1f1f5-1f1fc"},{n:["paraguay flag","flag-py"],u:"1f1f5-1f1fe"},{n:["qatar flag","flag-qa"],u:"1f1f6-1f1e6"},{n:["réunion flag","flag-re"],u:"1f1f7-1f1ea"},{n:["romania flag","flag-ro"],u:"1f1f7-1f1f4"},{n:["serbia flag","flag-rs"],u:"1f1f7-1f1f8"},{n:["russia flag","ru","flag-ru"],u:"1f1f7-1f1fa"},{n:["rwanda flag","flag-rw"],u:"1f1f7-1f1fc"},{n:["saudi arabia flag","flag-sa"],u:"1f1f8-1f1e6"},{n:["solomon islands flag","flag-sb"],u:"1f1f8-1f1e7"},{n:["seychelles flag","flag-sc"],u:"1f1f8-1f1e8"},{n:["sudan flag","flag-sd"],u:"1f1f8-1f1e9"},{n:["sweden flag","flag-se"],u:"1f1f8-1f1ea"},{n:["singapore flag","flag-sg"],u:"1f1f8-1f1ec"},{n:["st. helena flag","flag-sh"],u:"1f1f8-1f1ed"},{n:["slovenia flag","flag-si"],u:"1f1f8-1f1ee"},{n:["svalbard & jan mayen flag","flag-sj"],u:"1f1f8-1f1ef"},{n:["slovakia flag","flag-sk"],u:"1f1f8-1f1f0"},{n:["sierra leone flag","flag-sl"],u:"1f1f8-1f1f1"},{n:["san marino flag","flag-sm"],u:"1f1f8-1f1f2"},{n:["senegal flag","flag-sn"],u:"1f1f8-1f1f3"},{n:["somalia flag","flag-so"],u:"1f1f8-1f1f4"},{n:["suriname flag","flag-sr"],u:"1f1f8-1f1f7"},{n:["south sudan flag","flag-ss"],u:"1f1f8-1f1f8"},{n:["são tomé & príncipe flag","flag-st"],u:"1f1f8-1f1f9"},{n:["el salvador flag","flag-sv"],u:"1f1f8-1f1fb"},{n:["sint maarten flag","flag-sx"],u:"1f1f8-1f1fd"},{n:["syria flag","flag-sy"],u:"1f1f8-1f1fe"},{n:["swaziland flag","flag-sz"],u:"1f1f8-1f1ff"},{n:["tristan da cunha flag","flag-ta"],u:"1f1f9-1f1e6"},{n:["turks & caicos islands flag","flag-tc"],u:"1f1f9-1f1e8"},{n:["chad flag","flag-td"],u:"1f1f9-1f1e9"},{n:["french southern territories flag","flag-tf"],u:"1f1f9-1f1eb"},{n:["togo flag","flag-tg"],u:"1f1f9-1f1ec"},{n:["thailand flag","flag-th"],u:"1f1f9-1f1ed"},{n:["tajikistan flag","flag-tj"],u:"1f1f9-1f1ef"},{n:["tokelau flag","flag-tk"],u:"1f1f9-1f1f0"},{n:["timor-leste flag","flag-tl"],u:"1f1f9-1f1f1"},{n:["turkmenistan flag","flag-tm"],u:"1f1f9-1f1f2"},{n:["tunisia flag","flag-tn"],u:"1f1f9-1f1f3"},{n:["tonga flag","flag-to"],u:"1f1f9-1f1f4"},{n:["turkey flag","flag-tr"],u:"1f1f9-1f1f7"},{n:["trinidad & tobago flag","flag-tt"],u:"1f1f9-1f1f9"},{n:["tuvalu flag","flag-tv"],u:"1f1f9-1f1fb"},{n:["taiwan flag","flag-tw"],u:"1f1f9-1f1fc"},{n:["tanzania flag","flag-tz"],u:"1f1f9-1f1ff"},{n:["ukraine flag","flag-ua"],u:"1f1fa-1f1e6"},{n:["uganda flag","flag-ug"],u:"1f1fa-1f1ec"},{n:["u.s. outlying islands flag","flag-um"],u:"1f1fa-1f1f2"},{n:["united nations flag","flag-un"],u:"1f1fa-1f1f3"},{n:["united states flag","us","flag-us"],u:"1f1fa-1f1f8"},{n:["uruguay flag","flag-uy"],u:"1f1fa-1f1fe"},{n:["uzbekistan flag","flag-uz"],u:"1f1fa-1f1ff"},{n:["vatican city flag","flag-va"],u:"1f1fb-1f1e6"},{n:["st. vincent & grenadines flag","flag-vc"],u:"1f1fb-1f1e8"},{n:["venezuela flag","flag-ve"],u:"1f1fb-1f1ea"},{n:["british virgin islands flag","flag-vg"],u:"1f1fb-1f1ec"},{n:["u.s. virgin islands flag","flag-vi"],u:"1f1fb-1f1ee"},{n:["vietnam flag","flag-vn"],u:"1f1fb-1f1f3"},{n:["vanuatu flag","flag-vu"],u:"1f1fb-1f1fa"},{n:["wallis & futuna flag","flag-wf"],u:"1f1fc-1f1eb"},{n:["samoa flag","flag-ws"],u:"1f1fc-1f1f8"},{n:["kosovo flag","flag-xk"],u:"1f1fd-1f1f0"},{n:["yemen flag","flag-ye"],u:"1f1fe-1f1ea"},{n:["mayotte flag","flag-yt"],u:"1f1fe-1f1f9"},{n:["south africa flag","flag-za"],u:"1f1ff-1f1e6"},{n:["zambia flag","flag-zm"],u:"1f1ff-1f1f2"},{n:["zimbabwe flag","flag-zw"],u:"1f1ff-1f1fc"},{n:["england flag","flag-england"],u:"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f"},{n:["scotland flag","flag-scotland"],u:"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f"},{n:["wales flag","flag-wales"],u:"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f"}];var vSr={smileys_people:hSr,animals_nature:pSr,food_drink:TSr,activities:OSr,travel_places:mSr,objects:gSr,symbols:QSr,flags:_Sr},uY=[{key:"recent",title:"Recently Used",u:"1f551"},{key:"smileys_people",title:"Smiles & People",u:"1f600"},{key:"animals_nature",title:"Animals & Nature",u:"1F431"},{key:"food_drink",title:"Food & Drink",u:"2615"},{key:"activities",title:"Activities",u:"26BD"},{key:"travel_places",title:"Travel & Places",u:"1F697"},{key:"objects",title:"Objects",u:"1F4A1"},{key:"symbols",title:"Symbols",u:"1f4af"},{key:"flags",title:"Flags",u:"1f3f3-fe0f"}];const ySr=(t,e)=>e.some(n=>t instanceof n);let dY,fY;function bSr(){return dY||(dY=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function SSr(){return fY||(fY=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zoe=new WeakMap,xx=new WeakMap,Xoe=new WeakMap,Jy=new WeakMap,JC=new WeakMap;function xSr(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Oc(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&zoe.set(n,t)}).catch(()=>{}),JC.set(e,t),e}function ESr(t){if(xx.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});xx.set(t,e)}let Ex={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return xx.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Xoe.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Oc(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function wSr(t){Ex=t(Ex)}function CSr(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(eb(this),e,...n);return Xoe.set(r,e.sort?e.sort():[e]),Oc(r)}:SSr().includes(t)?function(...e){return t.apply(eb(this),e),Oc(zoe.get(this))}:function(...e){return Oc(t.apply(eb(this),e))}}function LSr(t){return typeof t=="function"?CSr(t):(t instanceof IDBTransaction&&ESr(t),ySr(t,bSr())?new Proxy(t,Ex):t)}function Oc(t){if(t instanceof IDBRequest)return xSr(t);if(Jy.has(t))return Jy.get(t);const e=LSr(t);return e!==t&&(Jy.set(t,e),JC.set(e,t)),e}const eb=t=>JC.get(t);function eL(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Oc(o);return r&&o.addEventListener("upgradeneeded",l=>{r(Oc(o.result),l.oldVersion,l.newVersion,Oc(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const $Sr=["get","getKey","getAll","getAllKeys","count"],ASr=["put","add","delete","clear"],tb=new Map;function hY(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(tb.get(e))return tb.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=ASr.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||$Sr.includes(n)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&l.done]))[0]};return tb.set(e,s),s}wSr(t=>({...t,get:(e,n,r)=>hY(e,n)||t.get(e,n,r),has:(e,n)=>!!hY(e,n)||t.has(e,n)}));const tL="EMJ",Qu="emojis",nL=3;async function kSr(){(await eL(tL,nL,{upgrade(e,n){e.objectStoreNames.contains(Qu)||e.createObjectStore(Qu,{keyPath:"id",autoIncrement:!0}).createIndex("id","id",{unique:!0})}})).close()}kSr();const PSr={native:!1,hideSearch:!0,hideGroupIcons:!1,hideGroupNames:!1,staticTexts:{},disabledGroups:[],groupNames:{},displayRecent:!1,additionalGroups:{},groupOrder:[],groupIcons:{}};async function RSr(){return await(await eL(tL,nL)).transaction(Qu,"readonly").objectStore(Qu).getAll()}function MSr(){const t=vi({search:"",emoji:iSr,activeGroup:"",skinTone:j9,options:PSr,additionalGroups:{},recent:[],get emojis(){return{recent:this.recent,...this.options.additionalGroups,...vSr}},get disabled(){let d=Array.isArray(this.options.disabledGroups)?this.options.disabledGroups:[];return this.options.displayRecent||(d=["recent",...d]),d},get groups(){return uY.filter(d=>!this.disabled.includes(d.key))},get orderedGroupKeys(){const d=[...this.options.groupOrder,...Object.keys(this.options.additionalGroups),...uY.map(f=>f.key)];return[...new Set(d)].filter(f=>!this.disabled.includes(f))}});function e(){t.options.displayRecent&&r()}async function n(){var d;let f=await RSr();return Array.isArray(f)&&f.length?f=JSON.parse(((d=f[0])==null?void 0:d.value)||""):f=[],f}function r(){n().then(d=>{t.recent=d,c()})}const i=d=>{t.search=d},s=d=>{t.emoji=d},o=d=>{t.activeGroup=d},a=(d=j9)=>{t.skinTone=d},l=d=>{t.options=Object.assign({},t.options,d),e()};async function c(){(await eL(tL,nL)).transaction(Qu,"readwrite").objectStore(Qu).put({id:0,value:JSON.stringify(t.recent)})}const u=d=>{if(t.options.displayRecent!==!0)return;const f=t.recent.findIndex(p=>p.u===d.u);if(f>0&&t.recent.splice(f,1),f===0)return;const h={u:d.u,n:un(d.n)};t.recent=[h,...t.recent],t.recent.length>24&&(t.recent.length=24),c()};return{state:zx(t),updateSearch:i,updateEmoji:s,updateActiveGroup:o,updateSkinTone:a,updateOptions:l,updateSelect:u}}var Cs="top",oa="bottom",aa="right",Ls="left",rL="auto",A7=[Cs,oa,aa,Ls],_u="start",Gf="end",DSr="clippingParents",Foe="viewport",Qd="popper",NSr="reference",pY=A7.reduce(function(t,e){return t.concat([e+"-"+_u,e+"-"+Gf])},[]),joe=[].concat(A7,[rL]).reduce(function(t,e){return t.concat([e,e+"-"+_u,e+"-"+Gf])},[]),ISr="beforeRead",HSr="read",VSr="afterRead",qSr="beforeMain",USr="main",BSr="afterMain",zSr="beforeWrite",XSr="write",FSr="afterWrite",jSr=[ISr,HSr,VSr,qSr,USr,BSr,zSr,XSr,FSr];function F1(t){return t?(t.nodeName||"").toLowerCase():null}function u1(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vu(t){var e=u1(t).Element;return t instanceof e||t instanceof Element}function Ko(t){var e=u1(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Yoe(t){if(typeof ShadowRoot>"u")return!1;var e=u1(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function YSr(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Ko(s)||!F1(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function GSr(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(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ko(i)||!F1(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}var WSr={name:"applyStyles",enabled:!0,phase:"write",fn:YSr,effect:GSr,requires:["computeStyles"]};function q1(t){return t.split("-")[0]}var S4=Math.max,Y9=Math.min,yu=Math.round;function bu(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(Ko(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=yu(n.width)/o||1),s>0&&(i=yu(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function iL(t){var e=bu(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Goe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Yoe(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function j1(t){return u1(t).getComputedStyle(t)}function ZSr(t){return["table","td","th"].indexOf(F1(t))>=0}function Ic(t){return((vu(t)?t.ownerDocument:t.document)||window.document).documentElement}function cT(t){return F1(t)==="html"?t:t.assignedSlot||t.parentNode||(Yoe(t)?t.host:null)||Ic(t)}function TY(t){return!Ko(t)||j1(t).position==="fixed"?null:t.offsetParent}function KSr(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Ko(t)){var r=j1(t);if(r.position==="fixed")return null}for(var i=cT(t);Ko(i)&&["html","body"].indexOf(F1(i))<0;){var s=j1(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function k7(t){for(var e=u1(t),n=TY(t);n&&ZSr(n)&&j1(n).position==="static";)n=TY(n);return n&&(F1(n)==="html"||F1(n)==="body"&&j1(n).position==="static")?e:n||KSr(t)||e}function sL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ef(t,e,n){return S4(t,Y9(e,n))}function JSr(t,e,n){var r=ef(t,e,n);return r>n?n:r}function Woe(){return{top:0,right:0,bottom:0,left:0}}function Zoe(t){return Object.assign({},Woe(),t)}function Koe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var exr=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Zoe(typeof e!="number"?e:Koe(e,A7))};function txr(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=q1(n.placement),l=sL(a),c=[Ls,aa].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var d=exr(i.padding,n),f=iL(s),h=l==="y"?Cs:Ls,p=l==="y"?oa:aa,T=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],O=k7(s),g=O?l==="y"?O.clientHeight||0:O.clientWidth||0:0,Q=T/2-m/2,v=d[h],_=g-f[u]-d[p],y=g/2-f[u]/2+Q,S=ef(v,y,_),x=l;n.modifiersData[r]=(e={},e[x]=S,e.centerOffset=S-y,e)}}function nxr(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Goe(e.elements.popper,i)&&(e.elements.arrow=i))}var rxr={name:"arrow",enabled:!0,phase:"main",fn:txr,effect:nxr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Su(t){return t.split("-")[1]}var ixr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sxr(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:yu(e*i)/i||0,y:yu(n*i)/i||0}}function OY(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=u===!0?sxr(o):typeof u=="function"?u(o):o,h=f.x,p=h===void 0?0:h,T=f.y,m=T===void 0?0:T,O=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),Q=Ls,v=Cs,_=window;if(c){var y=k7(n),S="clientHeight",x="clientWidth";if(y===u1(n)&&(y=Ic(n),j1(y).position!=="static"&&a==="absolute"&&(S="scrollHeight",x="scrollWidth")),y=y,i===Cs||(i===Ls||i===aa)&&s===Gf){v=oa;var E=d&&_.visualViewport?_.visualViewport.height:y[S];m-=E-r.height,m*=l?1:-1}if(i===Ls||(i===Cs||i===oa)&&s===Gf){Q=aa;var C=d&&_.visualViewport?_.visualViewport.width:y[x];p-=C-r.width,p*=l?1:-1}}var w=Object.assign({position:a},c&&ixr);if(l){var L;return Object.assign({},w,(L={},L[v]=g?"0":"",L[Q]=O?"0":"",L.transform=(_.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},w,(e={},e[v]=g?m+"px":"",e[Q]=O?p+"px":"",e.transform="",e))}function oxr(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:q1(e.placement),variation:Su(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,OY(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,OY(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var axr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:oxr,data:{}},W8={passive:!0};function lxr(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,a=o===void 0?!0:o,l=u1(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,W8)}),a&&l.addEventListener("resize",n.update,W8),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,W8)}),a&&l.removeEventListener("resize",n.update,W8)}}var cxr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lxr,data:{}},uxr={left:"right",right:"left",bottom:"top",top:"bottom"};function Dh(t){return t.replace(/left|right|bottom|top/g,function(e){return uxr[e]})}var dxr={start:"end",end:"start"};function mY(t){return t.replace(/start|end/g,function(e){return dxr[e]})}function oL(t){var e=u1(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aL(t){return bu(Ic(t)).left+oL(t).scrollLeft}function fxr(t){var e=u1(t),n=Ic(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+aL(t),y:a}}function hxr(t){var e,n=Ic(t),r=oL(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=S4(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=S4(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+aL(t),l=-r.scrollTop;return j1(i||n).direction==="rtl"&&(a+=S4(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function lL(t){var e=j1(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Joe(t){return["html","body","#document"].indexOf(F1(t))>=0?t.ownerDocument.body:Ko(t)&&lL(t)?t:Joe(cT(t))}function tf(t,e){var n;e===void 0&&(e=[]);var r=Joe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=u1(r),o=i?[s].concat(s.visualViewport||[],lL(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(tf(cT(o)))}function wx(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function pxr(t){var e=bu(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function gY(t,e){return e===Foe?wx(fxr(t)):vu(e)?pxr(e):wx(hxr(Ic(t)))}function Txr(t){var e=tf(cT(t)),n=["absolute","fixed"].indexOf(j1(t).position)>=0,r=n&&Ko(t)?k7(t):t;return vu(r)?e.filter(function(i){return vu(i)&&Goe(i,r)&&F1(i)!=="body"&&(n?j1(i).position!=="static":!0)}):[]}function Oxr(t,e,n){var r=e==="clippingParents"?Txr(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(a,l){var c=gY(t,l);return a.top=S4(c.top,a.top),a.right=Y9(c.right,a.right),a.bottom=Y9(c.bottom,a.bottom),a.left=S4(c.left,a.left),a},gY(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function eae(t){var e=t.reference,n=t.element,r=t.placement,i=r?q1(r):null,s=r?Su(r):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Cs:l={x:o,y:e.y-n.height};break;case oa:l={x:o,y:e.y+e.height};break;case aa:l={x:e.x+e.width,y:a};break;case Ls:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?sL(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case _u:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Gf:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Wf(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.boundary,o=s===void 0?DSr:s,a=n.rootBoundary,l=a===void 0?Foe:a,c=n.elementContext,u=c===void 0?Qd:c,d=n.altBoundary,f=d===void 0?!1:d,h=n.padding,p=h===void 0?0:h,T=Zoe(typeof p!="number"?p:Koe(p,A7)),m=u===Qd?NSr:Qd,O=t.rects.popper,g=t.elements[f?m:u],Q=Oxr(vu(g)?g:g.contextElement||Ic(t.elements.popper),o,l),v=bu(t.elements.reference),_=eae({reference:v,element:O,placement:i}),y=wx(Object.assign({},O,_)),S=u===Qd?y:v,x={top:Q.top-S.top+T.top,bottom:S.bottom-Q.bottom+T.bottom,left:Q.left-S.left+T.left,right:S.right-Q.right+T.right},E=t.modifiersData.offset;if(u===Qd&&E){var C=E[i];Object.keys(x).forEach(function(w){var L=[aa,oa].indexOf(w)>=0?1:-1,P=[Cs,oa].indexOf(w)>=0?"y":"x";x[w]+=C[P]*L})}return x}function mxr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?joe:l,u=Su(r),d=u?a?pY:pY.filter(function(p){return Su(p)===u}):A7,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,T){return p[T]=Wf(t,{placement:T,boundary:i,rootBoundary:s,padding:o})[q1(T)],p},{});return Object.keys(h).sort(function(p,T){return h[p]-h[T]})}function gxr(t){if(q1(t)===rL)return[];var e=Dh(t);return[mY(t),e,mY(e)]}function Qxr(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,T=n.allowedAutoPlacements,m=e.options.placement,O=q1(m),g=O===m,Q=l||(g||!p?[Dh(m)]:gxr(m)),v=[m].concat(Q).reduce(function(G,Te){return G.concat(q1(Te)===rL?mxr(e,{placement:Te,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:T}):Te)},[]),_=e.rects.reference,y=e.rects.popper,S=new Map,x=!0,E=v[0],C=0;C=0,q=A?"width":"height",X=Wf(e,{placement:w,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),F=A?P?aa:Ls:P?oa:Cs;_[q]>y[q]&&(F=Dh(F));var H=Dh(F),z=[];if(s&&z.push(X[L]<=0),a&&z.push(X[F]<=0,X[H]<=0),z.every(function(G){return G})){E=w,x=!1;break}S.set(w,z)}if(x)for(var U=p?3:1,j=function(Te){var Qe=v.find(function(W){var se=S.get(W);if(se)return se.slice(0,Te).every(function(pe){return pe})});if(Qe)return E=Qe,"break"},re=U;re>0;re--){var K=j(re);if(K==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}var _xr={name:"flip",enabled:!0,phase:"main",fn:Qxr,requiresIfExists:["offset"],data:{_skip:!1}};function QY(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 _Y(t){return[Cs,aa,oa,Ls].some(function(e){return t[e]>=0})}function vxr(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=Wf(e,{elementContext:"reference"}),a=Wf(e,{altBoundary:!0}),l=QY(o,r),c=QY(a,i,s),u=_Y(l),d=_Y(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var yxr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vxr};function bxr(t,e,n){var r=q1(t),i=[Ls,Cs].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[Ls,aa].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Sxr(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=joe.reduce(function(u,d){return u[d]=bxr(d,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var xxr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sxr};function Exr(t){var e=t.state,n=t.name;e.modifiersData[n]=eae({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var wxr={name:"popperOffsets",enabled:!0,phase:"read",fn:Exr,data:{}};function Cxr(t){return t==="x"?"y":"x"}function Lxr(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,T=p===void 0?0:p,m=Wf(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),O=q1(e.placement),g=Su(e.placement),Q=!g,v=sL(O),_=Cxr(v),y=e.modifiersData.popperOffsets,S=e.rects.reference,x=e.rects.popper,E=typeof T=="function"?T(Object.assign({},e.rects,{placement:e.placement})):T,C=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),w=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(s){var P,A=v==="y"?Cs:Ls,q=v==="y"?oa:aa,X=v==="y"?"height":"width",F=y[v],H=F+m[A],z=F-m[q],U=h?-x[X]/2:0,j=g===_u?S[X]:x[X],re=g===_u?-x[X]:-S[X],K=e.elements.arrow,G=h&&K?iL(K):{width:0,height:0},Te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Woe(),Qe=Te[A],W=Te[q],se=ef(0,S[X],G[X]),pe=Q?S[X]/2-U-se-Qe-C.mainAxis:j-se-Qe-C.mainAxis,ve=Q?-S[X]/2+U+se+W+C.mainAxis:re+se+W+C.mainAxis,$e=e.elements.arrow&&k7(e.elements.arrow),J=$e?v==="y"?$e.clientTop||0:$e.clientLeft||0:0,ee=(P=w==null?void 0:w[v])!=null?P:0,ie=F+pe-ee-J,he=F+ve-ee,Oe=ef(h?Y9(H,ie):H,F,h?S4(z,he):z);y[v]=Oe,L[v]=Oe-F}if(a){var me,ge=v==="x"?Cs:Ls,Ce=v==="x"?oa:aa,we=y[_],ke=_==="y"?"height":"width",lt=we+m[ge],De=we-m[Ce],Ze=[Cs,Ls].indexOf(O)!==-1,ct=(me=w==null?void 0:w[_])!=null?me:0,ht=Ze?lt:we-S[ke]-x[ke]-ct+C.altAxis,Dt=Ze?we+S[ke]+x[ke]-ct-C.altAxis:De,Mt=h&&Ze?JSr(ht,we,Dt):ef(h?ht:lt,we,h?Dt:De);y[_]=Mt,L[_]=Mt-we}e.modifiersData[r]=L}}var $xr={name:"preventOverflow",enabled:!0,phase:"main",fn:Lxr,requiresIfExists:["offset"]};function Axr(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function kxr(t){return t===u1(t)||!Ko(t)?oL(t):Axr(t)}function Pxr(t){var e=t.getBoundingClientRect(),n=yu(e.width)/t.offsetWidth||1,r=yu(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Rxr(t,e,n){n===void 0&&(n=!1);var r=Ko(e),i=Ko(e)&&Pxr(e),s=Ic(e),o=bu(t,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((F1(e)!=="body"||lL(s))&&(a=kxr(e)),Ko(e)?(l=bu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=aL(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mxr(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function Dxr(t){var e=Mxr(t);return jSr.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function Nxr(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Ixr(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var vY={placement:"bottom",modifiers:[],strategy:"absolute"};function yY(){for(var t=arguments.length,e=new Array(t),n=0;nparseInt(e,16)).map(e=>String.fromCodePoint(e)).join("")}function Uxr(t,e,n,r=[]){const i={};return Object.keys(t).forEach(s=>{if(r.includes(s))return;const o=[];t[s].forEach(a=>{var l;if(a[lT][0].includes(e.toLocaleLowerCase())){let c=a[Boe];if(n!==j9&&Array.isArray(a[G8])){const u=((l=a[G8])==null?void 0:l.findIndex(d=>d.includes(n)))||-1;u!==-1&&a[G8]&&(c=a[G8][u])}return o.push({...a,[Yf]:c})}}),o.length&&(i[s]=o)}),i}function nae(){var t;return(((t=navigator==null?void 0:navigator.userAgentData)==null?void 0:t.platform)||(navigator==null?void 0:navigator.platform)||"unknown").toUpperCase().indexOf("MAC")!==-1}function rae(t){return t.replace(/^_*(.)|_+(.)/g,(e,n,r)=>n?n.toUpperCase():" "+r.toUpperCase())}var P7=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const Bxr=Zn({name:"Body",emits:{select:t=>!0},setup(){const{state:t,updateEmoji:e,updateSelect:n}=_i("store"),r=We(null),i=Je(()=>Uxr(t.emojis,t.search,t.skinTone,t.options.disabledGroups)),s=up(),o=Je(()=>!t.options.hideGroupNames),a=Je(()=>!t.options.disableStickyGroupNames),l=un(t.options.groupNames),c=t.orderedGroupKeys;t.options.additionalGroups&&Object.keys(t.options.additionalGroups).map(p=>{t.options.groupNames[p]?l[p]=t.options.groupNames[p]:l[p]=rae(p)});const u=nae()?"is-mac":"";function d(p){e(p)}function f(p){n(p),s==null||s.emit("select",{...p,t:t.skinTone,i:Nh(p.r)})}function h(p,T){var m;const O=(m=p==null?void 0:p.target)==null?void 0:m.closest("button");O&&(O.innerHTML=`${Nh(T)} `)}return br(()=>t.activeGroup,()=>{var p;const T=(p=r.value)==null?void 0:p.querySelector("#"+t.activeGroup);T&&(T.parentNode.scrollTop=T.offsetTop-T.parentNode.offsetTop)}),{emojis:i,bodyInner:r,EMOJI_REMOTE_SRC:qoe,GROUP_NAMES:Uoe,handleClick:f,handleError:h,handleMouseEnter:d,native:t.options.native,unicodeToEmoji:Nh,EMOJI_RESULT_KEY:Yf,EMOJI_NAME_KEY:lT,hasGroupNames:o,isSticky:a,platform:u,groupNames:l,orderedKeys:c}}}),zxr={class:"v3-body"},Xxr=["id"],Fxr={class:"v3-emojis"},jxr=["onMouseenter","onClick"],Yxr={key:0},Gxr=["src","alt","onError"],Wxr={key:1,class:"v3-no-result"};function Zxr(t,e,n,r,i,s){return k(),R("div",zxr,[b("div",{ref:"bodyInner",class:ye([t.platform,"v3-body-inner"])},[t.orderedKeys.length?(k(!0),R(Ve,{key:0},dt(t.orderedKeys,o=>(k(),R("div",{id:o,key:o,class:"v3-group"},[t.hasGroupNames?He((k(),R("h5",{key:0,class:ye(t.isSticky?"v3-sticky":"")},ae(t.groupNames[o]),3)),[[mr,t.emojis[o]]]):ne("",!0),He(b("div",Fxr,[(k(!0),R(Ve,null,dt(t.emojis[o],a=>(k(),R("button",{key:a.r,type:"button",onMouseenter:l=>t.handleMouseEnter(a),onClick:l=>t.handleClick(a)},[t.native?(k(),R("span",Yxr,ae(t.unicodeToEmoji(a.r)),1)):(k(),R("img",{key:1,src:t.EMOJI_REMOTE_SRC+`/${a.r}.png`,alt:a.n[0],onError:l=>t.handleError(l,a.r)},null,40,Gxr))],40,jxr))),128))],512),[[mr,t.emojis[o]]])],8,Xxr))),128)):(k(),R("span",Wxr," No emoji has been found! "))],2)])}var Kxr=P7(Bxr,[["render",Zxr]]),Jxr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMi41IDUgQyAxMS40Mjk2ODggNSAxMC41IDUuNjA5Mzc1IDkuOTA2MjUgNi40Mzc1IEMgOS4zMTI1IDcuMjY1NjI1IDkgOC4zMzk4NDQgOSA5LjUgQyA5IDEwLjY2MDE1NiA5LjMxMjUgMTEuNzM0Mzc1IDkuOTA2MjUgMTIuNTYyNSBDIDEwLjUgMTMuMzkwNjI1IDExLjQyOTY4OCAxNCAxMi41IDE0IEMgMTMuNTcwMzEzIDE0IDE0LjUgMTMuMzkwNjI1IDE1LjA5Mzc1IDEyLjU2MjUgQyAxNS42ODc1IDExLjczNDM3NSAxNiAxMC42NjAxNTYgMTYgOS41IEMgMTYgOC4zMzk4NDQgMTUuNjg3NSA3LjI2NTYyNSAxNS4wOTM3NSA2LjQzNzUgQyAxNC41IDUuNjA5Mzc1IDEzLjU3MDMxMyA1IDEyLjUgNSBaIE0gMTYgOS41IEMgMTYgMTAuNjYwMTU2IDE2LjMxMjUgMTEuNzM0Mzc1IDE2LjkwNjI1IDEyLjU2MjUgQyAxNy41IDEzLjM5MDYyNSAxOC40Mjk2ODggMTQgMTkuNSAxNCBDIDIwLjU3MDMxMyAxNCAyMS41IDEzLjM5MDYyNSAyMi4wOTM3NSAxMi41NjI1IEMgMjIuNjg3NSAxMS43MzQzNzUgMjMgMTAuNjYwMTU2IDIzIDkuNSBDIDIzIDguMzM5ODQ0IDIyLjY4NzUgNy4yNjU2MjUgMjIuMDkzNzUgNi40Mzc1IEMgMjEuNSA1LjYwOTM3NSAyMC41NzAzMTMgNSAxOS41IDUgQyAxOC40Mjk2ODggNSAxNy41IDUuNjA5Mzc1IDE2LjkwNjI1IDYuNDM3NSBDIDE2LjMxMjUgNy4yNjU2MjUgMTYgOC4zMzk4NDQgMTYgOS41IFogTSAxMi41IDcgQyAxMi44MTI1IDcgMTMuMTU2MjUgNy4xNTYyNSAxMy40Njg3NSA3LjU5Mzc1IEMgMTMuNzgxMjUgOC4wMzEyNSAxNCA4LjcyNjU2MyAxNCA5LjUgQyAxNCAxMC4yNzM0MzggMTMuNzgxMjUgMTAuOTY4NzUgMTMuNDY4NzUgMTEuNDA2MjUgQyAxMy4xNTYyNSAxMS44NDM3NSAxMi44MTI1IDEyIDEyLjUgMTIgQyAxMi4xODc1IDEyIDExLjg0Mzc1IDExLjg0Mzc1IDExLjUzMTI1IDExLjQwNjI1IEMgMTEuMjE4NzUgMTAuOTY4NzUgMTEgMTAuMjczNDM4IDExIDkuNSBDIDExIDguNzI2NTYzIDExLjIxODc1IDguMDMxMjUgMTEuNTMxMjUgNy41OTM3NSBDIDExLjg0Mzc1IDcuMTU2MjUgMTIuMTg3NSA3IDEyLjUgNyBaIE0gMTkuNSA3IEMgMTkuODEyNSA3IDIwLjE1NjI1IDcuMTU2MjUgMjAuNDY4NzUgNy41OTM3NSBDIDIwLjc4MTI1IDguMDMxMjUgMjEgOC43MjY1NjMgMjEgOS41IEMgMjEgMTAuMjczNDM4IDIwLjc4MTI1IDEwLjk2ODc1IDIwLjQ2ODc1IDExLjQwNjI1IEMgMjAuMTU2MjUgMTEuODQzNzUgMTkuODEyNSAxMiAxOS41IDEyIEMgMTkuMTg3NSAxMiAxOC44NDM3NSAxMS44NDM3NSAxOC41MzEyNSAxMS40MDYyNSBDIDE4LjIxODc1IDEwLjk2ODc1IDE4IDEwLjI3MzQzOCAxOCA5LjUgQyAxOCA4LjcyNjU2MyAxOC4yMTg3NSA4LjAzMTI1IDE4LjUzMTI1IDcuNTkzNzUgQyAxOC44NDM3NSA3LjE1NjI1IDE5LjE4NzUgNyAxOS41IDcgWiBNIDcuNSAxMiBDIDYuNDI5Njg4IDEyIDUuNSAxMi42MDkzNzUgNC45MDYyNSAxMy40Mzc1IEMgNC4zMTI1IDE0LjI2NTYyNSA0IDE1LjMzOTg0NCA0IDE2LjUgQyA0IDE3LjY2MDE1NiA0LjMxMjUgMTguNzM0Mzc1IDQuOTA2MjUgMTkuNTYyNSBDIDUuNSAyMC4zOTA2MjUgNi40Mjk2ODggMjEgNy41IDIxIEMgOC41NzAzMTMgMjEgOS41IDIwLjM5MDYyNSAxMC4wOTM3NSAxOS41NjI1IEMgMTAuNjg3NSAxOC43MzQzNzUgMTEgMTcuNjYwMTU2IDExIDE2LjUgQyAxMSAxNS4zMzk4NDQgMTAuNjg3NSAxNC4yNjU2MjUgMTAuMDkzNzUgMTMuNDM3NSBDIDkuNSAxMi42MDkzNzUgOC41NzAzMTMgMTIgNy41IDEyIFogTSAyNC41IDEyIEMgMjMuNDI5Njg4IDEyIDIyLjUgMTIuNjA5Mzc1IDIxLjkwNjI1IDEzLjQzNzUgQyAyMS4zMTI1IDE0LjI2NTYyNSAyMSAxNS4zMzk4NDQgMjEgMTYuNSBDIDIxIDE3LjY2MDE1NiAyMS4zMTI1IDE4LjczNDM3NSAyMS45MDYyNSAxOS41NjI1IEMgMjIuNSAyMC4zOTA2MjUgMjMuNDI5Njg4IDIxIDI0LjUgMjEgQyAyNS41NzAzMTMgMjEgMjYuNSAyMC4zOTA2MjUgMjcuMDkzNzUgMTkuNTYyNSBDIDI3LjY4NzUgMTguNzM0Mzc1IDI4IDE3LjY2MDE1NiAyOCAxNi41IEMgMjggMTUuMzM5ODQ0IDI3LjY4NzUgMTQuMjY1NjI1IDI3LjA5Mzc1IDEzLjQzNzUgQyAyNi41IDEyLjYwOTM3NSAyNS41NzAzMTMgMTIgMjQuNSAxMiBaIE0gNy41IDE0IEMgNy44MTI1IDE0IDguMTU2MjUgMTQuMTU2MjUgOC40Njg3NSAxNC41OTM3NSBDIDguNzgxMjUgMTUuMDMxMjUgOSAxNS43MjY1NjMgOSAxNi41IEMgOSAxNy4yNzM0MzggOC43ODEyNSAxNy45Njg3NSA4LjQ2ODc1IDE4LjQwNjI1IEMgOC4xNTYyNSAxOC44NDM3NSA3LjgxMjUgMTkgNy41IDE5IEMgNy4xODc1IDE5IDYuODQzNzUgMTguODQzNzUgNi41MzEyNSAxOC40MDYyNSBDIDYuMjE4NzUgMTcuOTY4NzUgNiAxNy4yNzM0MzggNiAxNi41IEMgNiAxNS43MjY1NjMgNi4yMTg3NSAxNS4wMzEyNSA2LjUzMTI1IDE0LjU5Mzc1IEMgNi44NDM3NSAxNC4xNTYyNSA3LjE4NzUgMTQgNy41IDE0IFogTSAyNC41IDE0IEMgMjQuODEyNSAxNCAyNS4xNTYyNSAxNC4xNTYyNSAyNS40Njg3NSAxNC41OTM3NSBDIDI1Ljc4MTI1IDE1LjAzMTI1IDI2IDE1LjcyNjU2MyAyNiAxNi41IEMgMjYgMTcuMjczNDM4IDI1Ljc4MTI1IDE3Ljk2ODc1IDI1LjQ2ODc1IDE4LjQwNjI1IEMgMjUuMTU2MjUgMTguODQzNzUgMjQuODEyNSAxOSAyNC41IDE5IEMgMjQuMTg3NSAxOSAyMy44NDM3NSAxOC44NDM3NSAyMy41MzEyNSAxOC40MDYyNSBDIDIzLjIxODc1IDE3Ljk2ODc1IDIzIDE3LjI3MzQzOCAyMyAxNi41IEMgMjMgMTUuNzI2NTYzIDIzLjIxODc1IDE1LjAzMTI1IDIzLjUzMTI1IDE0LjU5Mzc1IEMgMjMuODQzNzUgMTQuMTU2MjUgMjQuMTg3NSAxNCAyNC41IDE0IFogTSAxNiAxNiBDIDE0LjY2Nzk2OSAxNiAxMy43MzgyODEgMTYuODY3MTg4IDEzLjI4MTI1IDE3LjYyNSBDIDEyLjgyNDIxOSAxOC4zODI4MTMgMTIuNTQ2ODc1IDE5LjAxNTYyNSAxMi4yODEyNSAxOS4yODEyNSBDIDEyLjEyNSAxOS40Mzc1IDExLjE2MDE1NiAxOS44MDA3ODEgMTAuMTU2MjUgMjAuMzEyNSBDIDkuNjUyMzQ0IDIwLjU3MDMxMyA5LjE0NDUzMSAyMC45MTQwNjMgOC43MTg3NSAyMS40Mzc1IEMgOC4yOTI5NjkgMjEuOTYwOTM4IDggMjIuNjg3NSA4IDIzLjUgQyA4IDI1LjQyMTg3NSA5LjU3ODEyNSAyNyAxMS41IDI3IEMgMTIuMzY3MTg4IDI3IDEzLjI2OTUzMSAyNi43MjI2NTYgMTQuMTU2MjUgMjYuNDY4NzUgQyAxNS4wNDI5NjkgMjYuMjE0ODQ0IDE2IDI2IDE2IDI2IEMgMTYgMjYgMTYuOTU3MDMxIDI2LjIxNDg0NCAxNy44NDM3NSAyNi40Njg3NSBDIDE4LjczMDQ2OSAyNi43MjI2NTYgMTkuNjMyODEzIDI3IDIwLjUgMjcgQyAyMi40MjE4NzUgMjcgMjQgMjUuNDIxODc1IDI0IDIzLjUgQyAyNCAyMi43MDcwMzEgMjMuNzA3MDMxIDIxLjk4MDQ2OSAyMy4yODEyNSAyMS40Njg3NSBDIDIyLjg1NTQ2OSAyMC45NTcwMzEgMjIuMzQzNzUgMjAuNjQwNjI1IDIxLjg0Mzc1IDIwLjM3NSBDIDIwLjg0Mzc1IDE5Ljg0Mzc1IDE5Ljg1OTM3NSAxOS40MjE4NzUgMTkuNzE4NzUgMTkuMjgxMjUgQyAxOS40ODA0NjkgMTkuMDQyOTY5IDE5LjIxMDkzOCAxOC4zOTA2MjUgMTguNzUgMTcuNjI1IEMgMTguMjg5MDYzIDE2Ljg1OTM3NSAxNy4zMzk4NDQgMTYgMTYgMTYgWiBNIDE2IDE4IEMgMTYuNjYwMTU2IDE4IDE2LjczNDM3NSAxOC4xNjAxNTYgMTcuMDMxMjUgMTguNjU2MjUgQyAxNy4zMjgxMjUgMTkuMTUyMzQ0IDE3LjU1NDY4OCAxOS45OTIxODggMTguMjgxMjUgMjAuNzE4NzUgQyAxOS4xMDU0NjkgMjEuNTQyOTY5IDIwLjE0ODQzOCAyMS43MjI2NTYgMjAuOTA2MjUgMjIuMTI1IEMgMjEuMjg1MTU2IDIyLjMyODEyNSAyMS41NzgxMjUgMjIuNTQyOTY5IDIxLjc1IDIyLjc1IEMgMjEuOTIxODc1IDIyLjk1NzAzMSAyMiAyMy4xNDg0MzggMjIgMjMuNSBDIDIyIDI0LjMzOTg0NCAyMS4zMzk4NDQgMjUgMjAuNSAyNSBDIDIwLjIxMDkzOCAyNSAxOS4yNzczNDQgMjQuNzc3MzQ0IDE4LjQwNjI1IDI0LjUzMTI1IEMgMTcuNTM1MTU2IDI0LjI4NTE1NiAxNi44MTY0MDYgMjQgMTYgMjQgQyAxNS4xODM1OTQgMjQgMTQuNDY0ODQ0IDI0LjI4NTE1NiAxMy41OTM3NSAyNC41MzEyNSBDIDEyLjcyMjY1NiAyNC43NzczNDQgMTEuNzg5MDYzIDI1IDExLjUgMjUgQyAxMC42NjAxNTYgMjUgMTAgMjQuMzM5ODQ0IDEwIDIzLjUgQyAxMCAyMy4wOTc2NTYgMTAuMDgyMDMxIDIyLjg5MDYyNSAxMC4yNSAyMi42ODc1IEMgMTAuNDE3OTY5IDIyLjQ4NDM3NSAxMC43MjI2NTYgMjIuMjg1MTU2IDExLjA5Mzc1IDIyLjA5Mzc1IEMgMTEuODM5ODQ0IDIxLjcxNDg0NCAxMi44NzUgMjEuNTYyNSAxMy43MTg3NSAyMC43MTg3NSBDIDE0LjQ1MzEyNSAxOS45ODQzNzUgMTQuNjc1NzgxIDE5LjExNzE4OCAxNC45Njg3NSAxOC42MjUgQyAxNS4yNjE3MTkgMTguMTMyODEzIDE1LjMzMjAzMSAxOCAxNiAxOCBaIi8+PC9zdmc+",eEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMSAzIEwgMTEgNyBMIDEzIDcgTCAxMyAzIFogTSAxNSA0IEwgMTUgNyBMIDE3IDcgTCAxNyA0IFogTSA0Ljg3NSA4IEwgNSA5LjA5Mzc1IEwgNi44MTI1IDI2LjMxMjUgQyA2Ljk3MjY1NiAyNy44MzIwMzEgOC4yODUxNTYgMjkgOS44MTI1IDI5IEwgMTkuMTg3NSAyOSBDIDIwLjcxNDg0NCAyOSAyMi4wMjczNDQgMjcuODMyMDMxIDIyLjE4NzUgMjYuMzEyNSBMIDIyLjY1NjI1IDIyIEwgMjUgMjIgQyAyNi42NDQ1MzEgMjIgMjggMjAuNjQ0NTMxIDI4IDE5IEwgMjggMTYgQyAyOCAxNC4zNTU0NjkgMjYuNjQ0NTMxIDEzIDI1IDEzIEwgMjMuNTkzNzUgMTMgTCAyNCA5LjA5Mzc1IEwgMjQuMTI1IDggWiBNIDcuMTI1IDEwIEwgMjEuODc1IDEwIEwgMjAuMTg3NSAyNi4wOTM3NSBDIDIwLjEzMjgxMyAyNi42MTMyODEgMTkuNzA3MDMxIDI3IDE5LjE4NzUgMjcgTCA5LjgxMjUgMjcgQyA5LjI5Mjk2OSAyNyA4Ljg2NzE4OCAyNi42MTMyODEgOC44MTI1IDI2LjA5Mzc1IFogTSAyMy4zNzUgMTUgTCAyNSAxNSBDIDI1LjU2NjQwNiAxNSAyNiAxNS40MzM1OTQgMjYgMTYgTCAyNiAxOSBDIDI2IDE5LjU2NjQwNiAyNS41NjY0MDYgMjAgMjUgMjAgTCAyMi44NDM3NSAyMCBaIi8+PC9zdmc+",tEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiAzIEMgOC44MzIwMzEgMyAzIDguODMyMDMxIDMgMTYgQyAzIDIzLjE2Nzk2OSA4LjgzMjAzMSAyOSAxNiAyOSBDIDIzLjE2Nzk2OSAyOSAyOSAyMy4xNjc5NjkgMjkgMTYgQyAyOSA4LjgzMjAzMSAyMy4xNjc5NjkgMyAxNiAzIFogTSAxNiA1IEMgMTYuNjAxNTYzIDUgMTcuMTc1NzgxIDUuMDYyNSAxNy43NSA1LjE1NjI1IEwgMTYgNi40MDYyNSBMIDE0LjI1IDUuMTU2MjUgQyAxNC44MjAzMTMgNS4wNjY0MDYgMTUuNDAyMzQ0IDUgMTYgNSBaIE0gMTEuODEyNSA1Ljg0Mzc1IEwgMTUuNDA2MjUgOC40Njg3NSBMIDE2IDguOTA2MjUgTCAxNi41OTM3NSA4LjQ2ODc1IEwgMjAuMTg3NSA1Ljg0Mzc1IEMgMjEuNzg1MTU2IDYuNTA3ODEzIDIzLjE5NTMxMyA3LjUyMzQzOCAyNC4zMTI1IDguODEyNSBMIDIyLjkzNzUgMTMuMDkzNzUgTCAyMi43MTg3NSAxMy43ODEyNSBMIDIzLjMxMjUgMTQuMTg3NSBMIDI2LjkzNzUgMTYuODQzNzUgQyAyNi44MDQ2ODggMTguNjA1NDY5IDI2LjI2NTYyNSAyMC4yNTc4MTMgMjUuNDA2MjUgMjEuNjg3NSBMIDIwLjEyNSAyMS42ODc1IEwgMTkuOTA2MjUgMjIuMzc1IEwgMTguNSAyNi43MTg3NSBDIDE3LjY5OTIxOSAyNi45MDYyNSAxNi44NTkzNzUgMjcgMTYgMjcgQyAxNS4xMDU0NjkgMjcgMTQuMjM4MjgxIDI2Ljg4NjcxOSAxMy40MDYyNSAyNi42ODc1IEwgMTIuMDMxMjUgMjIuNDA2MjUgTCAxMS44MTI1IDIxLjcxODc1IEwgNi41OTM3NSAyMS43MTg3NSBDIDUuNzE4NzUgMjAuMjgxMjUgNS4xOTkyMTkgMTguNjIxMDk0IDUuMDYyNSAxNi44NDM3NSBMIDguNjU2MjUgMTQuMjE4NzUgTCA5LjI1IDEzLjgxMjUgTCA5LjAzMTI1IDEzLjEyNSBMIDcuNjI1IDguODc1IEMgOC43NSA3LjU1NDY4OCAxMC4xODM1OTQgNi41MTU2MjUgMTEuODEyNSA1Ljg0Mzc1IFogTSAxNiAxMC4wOTM3NSBMIDE1LjQwNjI1IDEwLjUzMTI1IEwgMTAuODQzNzUgMTMuODQzNzUgTCAxMC4yODEyNSAxNC4yODEyNSBMIDEwLjUgMTQuOTY4NzUgTCAxMi4yNSAyMC4zMTI1IEwgMTIuNDY4NzUgMjEgTCAxOS41MzEyNSAyMSBMIDE5Ljc1IDIwLjMxMjUgTCAyMS41IDE0Ljk2ODc1IEwgMjEuNzE4NzUgMTQuMjgxMjUgTCAyMS4xNTYyNSAxMy44NDM3NSBMIDE2LjU5Mzc1IDEwLjUzMTI1IFogTSAyNS43NSAxMC45MDYyNSBDIDI2LjI5Njg3NSAxMS45NTMxMjUgMjYuNjU2MjUgMTMuMTAxNTYzIDI2Ljg0Mzc1IDE0LjMxMjUgTCAyNS4wNjI1IDEzLjAzMTI1IFogTSA2LjIxODc1IDEwLjk2ODc1IEwgNi45MDYyNSAxMy4wMzEyNSBMIDUuMTU2MjUgMTQuMzEyNSBDIDUuMzM5ODQ0IDEzLjEyNSA1LjY4NzUgMTIgNi4yMTg3NSAxMC45Njg3NSBaIE0gMTYgMTIuNTkzNzUgTCAxOS4zNzUgMTUuMDMxMjUgTCAxOC4wOTM3NSAxOSBMIDEzLjkwNjI1IDE5IEwgMTIuNjI1IDE1LjAzMTI1IFogTSAyMS41OTM3NSAyMy42ODc1IEwgMjMuODQzNzUgMjMuNjg3NSBDIDIyLjk5MjE4OCAyNC41NjY0MDYgMjIuMDExNzE5IDI1LjI5Mjk2OSAyMC45MDYyNSAyNS44NDM3NSBaIE0gOC4xNTYyNSAyMy43MTg3NSBMIDEwLjM0Mzc1IDIzLjcxODc1IEwgMTEuMDMxMjUgMjUuODEyNSBDIDkuOTYwOTM4IDI1LjI2OTUzMSA4Ljk4ODI4MSAyNC41NjI1IDguMTU2MjUgMjMuNzE4NzUgWiIvPjwvc3ZnPg==",nEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSA5LjUgNiBDIDguMTc5Njg4IDYgNy4wMDM5MDYgNi44NTkzNzUgNi42MjUgOC4xMjUgTCA1LjI1IDEyLjcxODc1IEwgMy4zMTI1IDEyLjA2MjUgTCAyLjY4NzUgMTMuOTM3NSBMIDQuNjU2MjUgMTQuNTkzNzUgTCA0LjAzMTI1IDE2LjcxODc1IEMgNC4wMDc4MTMgMTYuODA4NTk0IDMuOTk2MDk0IDE2LjkwNjI1IDQgMTcgTCA0IDI0IEMgNCAyNC4wMzEyNSA0IDI0LjA2MjUgNCAyNC4wOTM3NSBMIDQgMjUgQyA0IDI1LjU1MDc4MSA0LjQ0OTIxOSAyNiA1IDI2IEwgOCAyNiBMIDguMzQzNzUgMjUgTCAyMy42NTYyNSAyNSBMIDI0IDI2IEwgMjcgMjYgQyAyNy41NTA3ODEgMjYgMjggMjUuNTUwNzgxIDI4IDI1IEwgMjggMjQuMTU2MjUgQyAyOC4wMDM5MDYgMjQuMTA1NDY5IDI4LjAwMzkwNiAyNC4wNTA3ODEgMjggMjQgTCAyOCAxNyBDIDI4LjAwMzkwNiAxNi45MDYyNSAyNy45OTIxODggMTYuODA4NTk0IDI3Ljk2ODc1IDE2LjcxODc1IEwgMjcuMzQzNzUgMTQuNTkzNzUgTCAyOS4zMTI1IDEzLjkzNzUgTCAyOC42ODc1IDEyLjA2MjUgTCAyNi43NSAxMi43MTg3NSBMIDI1LjM3NSA4LjEyNSBDIDI0Ljk5NjA5NCA2Ljg1OTM3NSAyMy44MjAzMTMgNiAyMi41IDYgWiBNIDkuNSA4IEwgMjIuNSA4IEMgMjIuOTQ1MzEzIDggMjMuMzM5ODQ0IDguMjkyOTY5IDIzLjQ2ODc1IDguNzE4NzUgTCAyNC43NSAxMyBMIDcuMjUgMTMgTCA4LjUzMTI1IDguNzE4NzUgQyA4LjY2MDE1NiA4LjI4OTA2MyA5LjA1NDY4OCA4IDkuNSA4IFogTSA2LjY1NjI1IDE1IEwgMjUuMzQzNzUgMTUgTCAyNiAxNy4xODc1IEwgMjYgMjMgTCA2IDIzIEwgNiAxNy4xODc1IFogTSA4LjUgMTYgQyA3LjY3MTg3NSAxNiA3IDE2LjY3MTg3NSA3IDE3LjUgQyA3IDE4LjMyODEyNSA3LjY3MTg3NSAxOSA4LjUgMTkgQyA5LjMyODEyNSAxOSAxMCAxOC4zMjgxMjUgMTAgMTcuNSBDIDEwIDE2LjY3MTg3NSA5LjMyODEyNSAxNiA4LjUgMTYgWiBNIDIzLjUgMTYgQyAyMi42NzE4NzUgMTYgMjIgMTYuNjcxODc1IDIyIDE3LjUgQyAyMiAxOC4zMjgxMjUgMjIuNjcxODc1IDE5IDIzLjUgMTkgQyAyNC4zMjgxMjUgMTkgMjUgMTguMzI4MTI1IDI1IDE3LjUgQyAyNSAxNi42NzE4NzUgMjQuMzI4MTI1IDE2IDIzLjUgMTYgWiBNIDEyIDE5IEwgMTAuNzUgMjIgTCAxMi45MDYyNSAyMiBMIDEzLjM0Mzc1IDIxIEwgMTguNjU2MjUgMjEgTCAxOS4wOTM3NSAyMiBMIDIxLjI1IDIyIEwgMjAgMTkgWiIvPjwvc3ZnPg==",rEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiA0IEMgMTEuMDQyOTY5IDQgNyA4LjA0Mjk2OSA3IDEzIEMgNyAxNC45MTc5NjkgNy44NDM3NSAxNi45MDYyNSA5IDE4LjY4NzUgQyA5Ljg1OTM3NSAyMC4wMTE3MTkgMTAuODg2NzE5IDIxLjIzMDQ2OSAxMiAyMi4xNTYyNSBMIDEyIDI1IEMgMTIgMjYuMDkzNzUgMTIuOTA2MjUgMjcgMTQgMjcgTCAxNSAyOCBMIDE3IDI4IEwgMTggMjcgQyAxOS4wOTM3NSAyNyAyMCAyNi4wOTM3NSAyMCAyNSBMIDIwIDIyLjE1NjI1IEMgMjEuMTEzMjgxIDIxLjIzMDQ2OSAyMi4xNDA2MjUgMjAuMDExNzE5IDIzIDE4LjY4NzUgQyAyNC4xNTYyNSAxNi45MDYyNSAyNSAxNC45MTc5NjkgMjUgMTMgQyAyNSA4LjA0Mjk2OSAyMC45NTcwMzEgNCAxNiA0IFogTSAxNiA2IEMgMTkuODc4OTA2IDYgMjMgOS4xMjEwOTQgMjMgMTMgQyAyMyAxNC4zMDg1OTQgMjIuMzU1NDY5IDE2LjAzNTE1NiAyMS4zNDM3NSAxNy41OTM3NSBDIDIwLjQ0MTQwNiAxOC45ODQzNzUgMTkuMjUzOTA2IDIwLjIyMjY1NiAxOC4xNTYyNSAyMSBMIDEzLjg0Mzc1IDIxIEMgMTIuNzQ2MDk0IDIwLjIyMjY1NiAxMS41NTg1OTQgMTguOTg0Mzc1IDEwLjY1NjI1IDE3LjU5Mzc1IEMgOS42NDQ1MzEgMTYuMDM1MTU2IDkgMTQuMzA4NTk0IDkgMTMgQyA5IDkuMTIxMDk0IDEyLjEyMTA5NCA2IDE2IDYgWiBNIDE0LjI1IDIzIEwgMTcuNzUgMjMgQyAxNy44MjgxMjUgMjMuMDU0Njg4IDE3LjkxMDE1NiAyMy4wOTM3NSAxOCAyMy4xMjUgTCAxOCAyNSBMIDE0IDI1IEwgMTQgMjMuMTI1IEMgMTQuMDg5ODQ0IDIzLjA5Mzc1IDE0LjE3MTg3NSAyMy4wNTQ2ODggMTQuMjUgMjMgWiIvPjwvc3ZnPg==",iEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMSA1IEwgMTEgMTEgTCA1IDExIEwgNSAxMyBMIDExIDEzIEwgMTEgMTkgTCA1IDE5IEwgNSAyMSBMIDExIDIxIEwgMTEgMjcgTCAxMyAyNyBMIDEzIDIxIEwgMTkgMjEgTCAxOSAyNyBMIDIxIDI3IEwgMjEgMjEgTCAyNyAyMSBMIDI3IDE5IEwgMjEgMTkgTCAyMSAxMyBMIDI3IDEzIEwgMjcgMTEgTCAyMSAxMSBMIDIxIDUgTCAxOSA1IEwgMTkgMTEgTCAxMyAxMSBMIDEzIDUgWiBNIDEzIDEzIEwgMTkgMTMgTCAxOSAxOSBMIDEzIDE5IFoiLz48L3N2Zz4=",sEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSA5IDQgQyA3LjM0NiA0IDYgNS4zNDYgNiA3IEMgNiA4LjMwMTYwOTQgNi44Mzg3NDg2IDkuNDAyMTM5MSA4IDkuODE2NDA2MiBMIDggMTEuMzA0Njg4IEwgOCAyMy4yMDcwMzEgTCA4IDI3LjAyMzQzOCBDIDggMjcuNTYzNDM4IDguNDM2NTYyNSAyOCA4Ljk3NjU2MjUgMjggTCA5LjAyMzQzNzUgMjggQyA5LjU2MzQzNzUgMjggMTAgMjcuNTYzNDM3IDEwIDI3LjAyMzQzOCBMIDEwIDIyLjIyODUxNiBDIDEwLjMzNDcwNyAyMS44Mzk3NTYgMTEuMTM4NDIzIDIxLjA0Njg3NSAxMy40NDUzMTIgMjEuMDQ2ODc1IEMgMTQuNjY5MzEzIDIxLjA0Njg3NSAxNS42NzA0MjIgMjEuNDczNzgxIDE2LjczMjQyMiAyMS45MjU3ODEgQyAxNy43Njk0MjIgMjIuMzY3NzgxIDE4Ljg0MTg5MSAyMi44MjQyMTkgMjAuMDg3ODkxIDIyLjgyNDIxOSBDIDIyLjQ0Njg5MSAyMi44MjQyMTkgMjQuMDQ5Mzc1IDIxLjU4NDY4OCAyNC43MzQzNzUgMjEuMDU0Njg4IEwgMjQuODg2NzE5IDIwLjkzOTQ1MyBDIDI1LjQzNzcxOSAyMC41NDA0NTMgMjYgMTkuOTk2IDI2IDE5IEwgMjYgMTAuNjc1NzgxIEMgMjYgOS43Njc3ODEyIDI1LjIyMTgyOCA5IDI0LjI5ODgyOCA5IEMgMjMuODAzODI4IDkgMjMuNDQwNDA2IDkuMjg2NTkzNyAyMi45NDE0MDYgOS42ODM1OTM4IEMgMjIuMjc5NDA2IDEwLjIwNzU5NCAyMS4yODA4OTEgMTEgMjAuMDg3ODkxIDExIEMgMTkuMjcyODkxIDExIDE4LjQ3NzY4OCAxMC42MTk3MzQgMTcuNTU0Njg4IDEwLjE3NzczNCBDIDE2LjQwMzY4NyA5LjYyNTczNDQgMTUuMDk4MzU5IDkgMTMuNDQzMzU5IDkgQyAxMi4zMDgyNTcgOSAxMS40MjE2ODcgOS4xODgzMzkzIDEwLjcxMjg5MSA5LjQ1NzAzMTIgQyAxMS40ODkwNzEgOC45MTQxODI0IDEyIDguMDE2NzgwMiAxMiA3IEMgMTIgNS4zNDYgMTAuNjU0IDQgOSA0IHogTSA5IDYgQyA5LjU1MiA2IDEwIDYuNDQ5IDEwIDcgQyAxMCA3LjU1MSA5LjU1MiA4IDkgOCBDIDguNDQ4IDggOCA3LjU1MSA4IDcgQyA4IDYuNDQ5IDguNDQ4IDYgOSA2IHogTSAxMy40NDMzNTkgMTEgQyAxNC42NDUzNTkgMTEgMTUuNjM4NDA2IDExLjQ3NjQ2OSAxNi42OTE0MDYgMTEuOTgwNDY5IEMgMTcuNzM2NDA2IDEyLjQ4MjQ2OSAxOC44MTc4OTEgMTMgMjAuMDg3ODkxIDEzIEMgMjEuODQyODkxIDEzIDIzLjE1ODA0NyAxMi4wNTQ0ODQgMjMuOTk4MDQ3IDExLjM5NjQ4NCBMIDIzLjk5ODA0NyAxOS4wNjY0MDYgQyAyMy45OTcwNDcgMTkuMDcwNDA2IDIzLjk1Mjk4NCAxOS4xNDUyNjYgMjMuNzA4OTg0IDE5LjMyMjI2NiBMIDIzLjUwOTc2NiAxOS40NzQ2MDkgQyAyMi45NDI3NjYgMTkuOTEyNjA5IDIxLjc2Mjg5MSAyMC44MjQyMTkgMjAuMDg3ODkxIDIwLjgyNDIxOSBDIDE5LjI0OTg5MSAyMC44MjQyMTkgMTguNDQ2NjI1IDIwLjQ4MjkzNyAxNy41MTU2MjUgMjAuMDg1OTM4IEMgMTYuMzcyNjI1IDE5LjU5NzkzOCAxNS4wNzYzNTkgMTkuMDQ0OTIyIDEzLjQ0MzM1OSAxOS4wNDQ5MjIgQyAxMS44OTEzNTkgMTkuMDQ0OTIyIDEwLjc4NiAxOS4zNTggMTAgMTkuNzUgTCAxMCAxMi4zNjEzMjggQyAxMC4zNDUgMTEuOTA1MzI4IDExLjEzMjM1OSAxMSAxMy40NDMzNTkgMTEgeiIvPjwvc3ZnPg==",oEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiA0IEMgMTEuODMyMDMxIDQgOC4xNTIzNDQgNi4xMTMyODEgNiA5LjM0Mzc1IEwgNiA2IEwgNCA2IEwgNCAxMyBMIDExIDEzIEwgMTEgMTEgTCA3LjM3NSAxMSBDIDkuMTAxNTYzIDguMDE5NTMxIDEyLjI5Njg3NSA2IDE2IDYgQyAyMS41MzUxNTYgNiAyNiAxMC40NjQ4NDQgMjYgMTYgQyAyNiAyMS41MzUxNTYgMjEuNTM1MTU2IDI2IDE2IDI2IEMgMTAuNDY0ODQ0IDI2IDYgMjEuNTM1MTU2IDYgMTYgTCA0IDE2IEMgNCAyMi42MTcxODggOS4zODI4MTMgMjggMTYgMjggQyAyMi42MTcxODggMjggMjggMjIuNjE3MTg4IDI4IDE2IEMgMjggOS4zODI4MTMgMjIuNjE3MTg4IDQgMTYgNCBaIE0gMTUgOCBMIDE1IDE3IEwgMjIgMTcgTCAyMiAxNSBMIDE3IDE1IEwgMTcgOCBaIi8+PC9zdmc+Cg==";const aEr=Zn({name:"Header",setup(t){const{state:e,updateSearch:n,updateActiveGroup:r}=_i("store"),i=Je(()=>!e.options.hideSearch),s=Je(()=>!e.options.hideGroupIcons),o=JSON.parse(JSON.stringify(e.orderedGroupKeys)),a=Je(()=>e.options.staticTexts.placeholder||""),l=Je({get:()=>e.search,set:d=>n(d)}),c=[...e.groups,...Object.keys(e.options.additionalGroups).map(d=>({key:d,title:e.options.groupNames[d]?e.options.groupNames[d]:rae(d)}))],u=[];return o.forEach(d=>{const f=c.findIndex(h=>h.key===d);f!==-1&&(u.push(c[f]),c.splice(f,1))}),{orderedGroups:u,orderedKeys:o,searchValue:l,updateActiveGroup:r,hasSearch:i,hasGroupIcons:s,placeholder:a,icons:{smileys_people:tae,animals_nature:Jxr,food_drink:eEr,activities:tEr,travel_places:nEr,objects:rEr,symbols:iEr,flags:sEr,...e.options.groupIcons,recent:oEr}}}}),lEr={key:0,class:"v3-header"},cEr={key:0,class:"v3-groups"},uEr=["onClick"],dEr=["title"],fEr=["src"],hEr={key:1,class:"v3-spacing"},pEr={key:2,class:"v3-search"},TEr=["placeholder"];function OEr(t,e,n,r,i,s){return t.hasGroupIcons||t.hasSearch?(k(),R("div",lEr,[t.hasGroupIcons?(k(),R("div",cEr,[(k(!0),R(Ve,null,dt(t.orderedGroups,o=>(k(),R("button",{key:o.key,type:"button",class:ye(["v3-group",{"v3-is-hidden":!t.icons[o.key]}]),onClick:a=>t.updateActiveGroup(o.key)},[b("span",{title:o.title,class:"v3-icon"},[b("img",{src:t.icons[o.key],alt:""},null,8,fEr)],8,dEr)],10,uEr))),128))])):ne("",!0),t.hasGroupIcons&&t.hasSearch?(k(),R("div",hEr)):ne("",!0),t.hasSearch?(k(),R("div",pEr,[He(b("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.searchValue=o),type:"text",placeholder:t.placeholder},null,8,TEr),[[vt,t.searchValue]])])):ne("",!0)])):ne("",!0)}var mEr=P7(aEr,[["render",OEr]]);const gEr=Zn({name:"Header",setup(){const{state:t,updateSkinTone:e}=_i("store"),n=We(!1),r=We(!1),i=Je(()=>t.skinTone),s=Je(()=>t.options.staticTexts.skinTone||"Skin tone"),o=Je(()=>!t.options.disableSkinTones),a=nae()?"is-mac":"",l=Je(()=>({...t.emoji,src:qoe+"/"+t.emoji[Yf]+".png"}));function c(f=!0){n.value=f}function u(){n.value=!n.value}function d(f){e(f),c(!1)}return br(()=>t.emoji,()=>{r.value=!1}),{emoji:l,SKIN_TONES:uSr,updateSkinToneState:c,skinTone:n,stateSkinTone:i,selectSkinTone:d,toggleSkinToneState:u,EMOJI_RESULT_KEY:Yf,EMOJI_NAME_KEY:lT,skinToneText:s,hasSkinTones:o,native:t.options.native,unicodeToEmoji:Nh,platform:a,hasError:r}}}),QEr={class:"v3-foot-left"},_Er={key:0},vEr=["alt","src"],yEr={class:"v3-text"},bEr={class:"v3-text"},SEr=["onClick"];function xEr(t,e,n,r,i,s){return k(),R("div",{class:"v3-footer",onMouseleave:e[2]||(e[2]=o=>t.updateSkinToneState(!1))},[b("div",QEr,[b("span",{class:ye([t.platform,"v3-icon"])},[t.native||t.hasError?(k(),R("span",_Er,ae(t.unicodeToEmoji(t.emoji.r)),1)):(k(),R("img",{key:1,alt:t.unicodeToEmoji(t.emoji.r),src:t.emoji.src,onError:e[0]||(e[0]=o=>t.hasError=!0)},null,40,vEr))],2),b("span",yEr," :"+ae(t.emoji[t.EMOJI_NAME_KEY][1]||t.emoji[t.EMOJI_NAME_KEY][0])+": ",1)]),t.hasSkinTones?(k(),R(Ve,{key:0},[b("button",{type:"button",class:"v3-tone",onClick:e[1]||(e[1]=(...o)=>t.toggleSkinToneState&&t.toggleSkinToneState(...o))},[b("span",bEr,ae(t.skinToneText),1),b("span",{class:ye(`v3-icon v3-tone-${t.stateSkinTone}`)},null,2)]),b("div",{class:ye([t.skinTone?"v3-is-open":"","v3-skin-tones"])},[(k(!0),R(Ve,null,dt(t.SKIN_TONES,o=>(k(),R("button",{key:o,type:"button",class:ye(["v3-skin-tone-"+o,"v3-skin-tone"]),onClick:a=>t.selectSkinTone(o)},null,10,SEr))),128))],2)],64)):ne("",!0)],32)}var EEr=P7(gEr,[["render",xEr]]);const wEr=Zn({name:"PickerRoot",components:{Header:mEr,Body:Kxr,Footer:EEr},props:{type:{type:String,default:""},text:{type:String,default:""},additionalGroups:{type:Object,default:()=>({})},groupOrder:{type:Array,default:()=>[]},groupIcons:{type:Object,default:()=>({})},groupNames:{type:Object,default:()=>({})}},emits:{select:t=>!0,"update:text":t=>!0},setup(t,{emit:e}){const n=We(),r=We(),i=We(),s=We(!1),o=We(t.text),a=t.type==="input"||t.type==="textarea";let l=-1;const{state:c}=_i("store"),u=Je(()=>c.options.colorTheme);function d(m){if(a){const O=c.options.mode;O==="prepend"?o.value=m.i+o.value:O==="insert"&&l!==-1?(o.value=`${o.value.slice(0,l)}${m.i}${o.value.slice(l)}`,l+=m.i.length):o.value+=m.i,e("update:text",o.value)}e("select",m)}function f(){var m;n.value&&(l=((m=n.value)==null?void 0:m.selectionEnd)||-1)}function h(m){var O;!((O=m.target)!=null&&O.closest(".v3-input-picker-wrap"))&&s.value&&(s.value=!1)}function p(){if(r.value&&i.value&&a){let m=c.options.offset;typeof m!="number"&&(m=6),qxr(r.value,i.value,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,m]}}]}),document.body.addEventListener("click",h)}}function T(m){o.value=m.target.value||"",e("update:text",o.value)}return Ii(()=>{p()}),$c(()=>{document.body.removeEventListener("click",h)}),{face:tae,open:s,onSelect:d,input:o,elem:n,updateCursor:f,button:r,picker:i,isInputType:a,onChangeText:T,colorTheme:u}}}),CEr={key:0,class:"v3-input-emoji-picker"},LEr={class:"v3-input-picker-root"},$Er=["value"],AEr=["value"],kEr=["src"];function PEr(t,e,n,r,i,s){const o=Xe("Header"),a=Xe("Body"),l=Xe("Footer");return t.isInputType?(k(),R("div",CEr,[b("div",LEr,[t.type==="input"?(k(),R("input",{key:0,ref:"elem",value:t.input,type:"text",class:"v3-emoji-picker-input",onInput:e[0]||(e[0]=(...c)=>t.onChangeText&&t.onChangeText(...c)),onBlur:e[1]||(e[1]=(...c)=>t.updateCursor&&t.updateCursor(...c))},null,40,$Er)):(k(),R("textarea",{key:1,ref:"elem",value:t.input,class:"v3-emoji-picker-textarea",onInput:e[2]||(e[2]=(...c)=>t.onChangeText&&t.onChangeText(...c)),onBlur:e[3]||(e[3]=(...c)=>t.updateCursor&&t.updateCursor(...c))},null,40,AEr)),b("div",{class:ye(["v3-input-picker-wrap",t.open?"v3-picker-is-open":""])},[b("button",{ref:"button",type:"button",class:"v3-input-picker-icon",onClick:e[4]||(e[4]=c=>t.open=!t.open)},[b("img",{src:t.face,alt:""},null,8,kEr)],512),b("div",{ref:"picker",class:ye(["v3-emoji-picker","v3-color-theme-"+t.colorTheme])},[te(o),te(a,{onSelect:t.onSelect},null,8,["onSelect"]),te(l)],2)],2)])])):(k(),R("div",{key:1,class:ye(["v3-emoji-picker","v3-color-theme-"+t.colorTheme])},[te(o),te(a,{onSelect:t.onSelect},null,8,["onSelect"]),te(l)],2))}var REr=P7(wEr,[["render",PEr]]);const MEr=Zn({name:"Picker",components:{PickerRoot:REr},props:{native:{type:Boolean,default:!1},hideSearch:{type:Boolean,default:!1},hideGroupIcons:{type:Boolean,default:!1},hideGroupNames:{type:Boolean,default:!1},staticTexts:{type:Object,default:()=>({})},disableStickyGroupNames:{type:Boolean,default:!1},disabledGroups:{type:Array,default:()=>[]},groupNames:{type:Object,default:()=>({})},disableSkinTones:{type:Boolean,default:!1},text:{type:String,default:""},mode:{type:String,default:"insert"},offset:{type:Number,default:6},additionalGroups:{type:Object,default:()=>({})},groupOrder:{type:Array,default:()=>[]},groupIcons:{type:Object,default:()=>({})},pickerType:{type:String,default:""},displayRecent:{type:Boolean,default:!1},theme:{type:String,default:"light"}},emits:{"update:text":t=>!0,select:t=>!0},setup(t,{emit:e}){const n=We(t.text);function r(s){n.value=s||"",e("update:text",n.value)}const i=MSr();return i.updateOptions({native:t.native,hideSearch:t.hideSearch,hideGroupIcons:t.hideGroupIcons,hideGroupNames:t.hideGroupNames,staticTexts:{...dSr,...t.staticTexts},disableStickyGroupNames:t.disableStickyGroupNames,disabledGroups:t.disabledGroups,groupNames:{...Uoe,...t.groupNames},disableSkinTones:t.disableSkinTones,displayRecent:t.displayRecent,additionalGroups:t.additionalGroups,mode:t.mode,offset:t.offset,groupOrder:t.groupOrder,groupIcons:t.groupIcons,colorTheme:fSr.includes(t.theme)?t.theme:"light"}),Q4("store",i),{type:t.pickerType,input:n,onChangeText:r}}});function DEr(t,e,n,r,i,s){const o=Xe("picker-root");return k(),Qt(o,{type:t.type,text:t.input,onSelect:e[0]||(e[0]=a=>t.$emit("select",a)),"onUpdate:text":t.onChangeText},null,8,["type","text","onUpdate:text"])}var NEr=P7(MEr,[["render",DEr]]);const IEr={beforeMount(t,e){t.clickOutsideEvent=function(n){if(!(t===n.target||t.contains(n.target))){if(e.arg){let r=!1;try{r=(Array.isArray(e.arg)?e.arg:[e.arg]).some(s=>{const o=s.value||s;return o&&(o===n.target||o.contains(n.target))})}catch(i){console.error("Error in clickOutside directive arg:",i)}if(r)return}e.value(n)}},document.body.addEventListener("mousedown",t.clickOutsideEvent,!0)},unmounted(t){document.body.removeEventListener("mousedown",t.clickOutsideEvent,!0)}},HEr={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},directives:{clickOutside:IEr},components:{PersonalitiesCommands:rSr,EmojiPicker:NEr},data(){return{message:"",isSendMenuVisible:!1,is_rt:!1,isListeningToVoice:!1,recognition:null,silenceTimer:null,silenceTimeoutDuration:3e3,recognitionError:!1,filesList:[],isFileSentList:[],totalSize:"0 B",showfilesList:!0,showHelpModal:!1,showEmojiPicker:!1,isDragging:!1,isPositionModified:!1,startDragPos:{x:0,y:0},startChatboxPos:{x:0,y:0},currentChatboxPos:null,isShrunk:!1,posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{chatbarStyle(){return this.isPositionModified&&this.currentChatboxPos?{transform:`translate(${this.currentChatboxPos.x}px, ${this.currentChatboxPos.y}px)`,left:"0px",top:"0px",bottom:"auto","margin-left":"0px","transform-origin":"top left"}:{}},isCompactMode(){return this.$store.state.view_mode==="compact"},isdataLakeNamesValid(){return Array.isArray(this.dataLakeNames)&&this.dataLakeNames.length>0},isCommandsValid(){const t=this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id];return t&&Array.isArray(t.commands)&&t.commands.length>0},dataLakeNames(){return(this.$store.state.config.datalakes||[]).map(t=>({name:t.alias,value:t.alias||"default_value",is_checked:t.mounted,icon:"",help:"Mounts the datalake "+t.alias}))},functionCalls(){return(this.$store.state.config.mounted_function_calls||[]).map(t=>({name:t.name,value:t,dir:t.dir,is_checked:t.selected,icon:t.icon||"feather:zap",help:t.help||`Toggles the function call ${t.name}`}))}},methods:{updateFeatherIcons(){Fe(()=>{try{Re.replace()}catch(t){console.error("Feather error:",t)}})},toggleShrink(){this.isShrunk=!this.isShrunk,localStorage.setItem("chatbarShrunk",JSON.stringify(this.isShrunk)),this.updateFeatherIcons()},onMouseDown(t){if(t.button!==0||this.isShrunk)return;this.isDragging=!0,document.body.classList.add("user-select-none"),this.startDragPos={x:t.clientX,y:t.clientY};const e=this.$refs.chatbarRef;if(!e)return;const n=e.getBoundingClientRect();this.isPositionModified||(this.currentChatboxPos={x:n.left,y:n.top},this.isPositionModified=!0),this.currentChatboxPos||(this.currentChatboxPos={x:n.left,y:n.top}),this.startChatboxPos={...this.currentChatboxPos},window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mouseleave",this.onMouseLeave)},onMouseMove(t){if(!this.isDragging||!this.$refs.chatbarRef)return;t.preventDefault();const e=t.clientX-this.startDragPos.x,n=t.clientY-this.startDragPos.y;this.currentChatboxPos={x:this.startChatboxPos.x+e,y:this.startChatboxPos.y+n}},onMouseUp(){this.isDragging&&(this.isDragging=!1,document.body.classList.remove("user-select-none"),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mouseleave",this.onMouseLeave),this.isPositionModified&&this.currentChatboxPos&&(localStorage.setItem("chatbarPosition",JSON.stringify(this.currentChatboxPos)),localStorage.setItem("chatbarPositionModified","true")))},onMouseLeave(t){this.isDragging&&this.onMouseUp()},toggleEmojiPicker(){this.showEmojiPicker=!this.showEmojiPicker},closeEmojiPicker(){this.showEmojiPicker&&(this.showEmojiPicker=!1)},onEmojiSelect(t){var e;this.insertEmojiAtCursor(t.i),this.closeEmojiPicker(),(e=this.$refs.textareaRef)==null||e.focus()},insertEmojiAtCursor(t){const e=this.$refs.textareaRef;if(!e)return;const n=e.selectionStart,r=e.selectionEnd,i=this.message;this.message=i.substring(0,n)+t+i.substring(r),Fe(()=>{e&&(e.selectionStart=e.selectionEnd=n+t.length)})},computedFileSize(t){return typeof t!="number"?"N/A":O4(t,{})},recalculateTotalSize(){let t=0;this.filesList.forEach(e=>{e&&typeof e.size=="number"&&(t+=e.size)}),this.totalSize=this.computedFileSize(t)},addFilesFromInput(t){t&&t.length>0&&this.addFiles(t),this.$refs.fileDialog&&(this.$refs.fileDialog.value="")},addFiles(t){if(!t||t.length===0)return;let e;try{e=Array.from(t)}catch{this.onShowToastMessage("Error processing selected files.",4,!1);return}let n=!1;e.forEach(r=>{if(!r||typeof r.name>"u"||typeof r.size>"u"){this.onShowToastMessage("Skipped an invalid file entry.",4,!1);return}if(this.filesList.some(s=>s.name===r.name&&s.size===r.size))this.onShowToastMessage(`File ${r.name} already added.`,4,!1);else{const s=this.filesList.length;this.filesList.push(r),this.isFileSentList.push(!1),this.send_file(r,s),n=!0}}),n&&this.updateFeatherIcons()},send_file(t,e){const n=new FileReader,r=1024*1024;let i=0,s=0;const o=Math.ceil(t.size/r);n.onload=()=>{if(n.result){const l=n.result,c=i+l.byteLength>=t.size;et.emit("send_file_chunk",{client_id:this.$store.state.client_id,filename:t.name,chunk:l,offset:i,isLastChunk:c,chunkIndex:s,totalChunks:o,fileIndex:e}),i+=l.byteLength,s++,c||setTimeout(a,0)}else this.onShowToastMessage(`Error reading ${t.name}. Upload failed.`,4,!1)},n.onerror=l=>{this.onShowToastMessage(`Error reading ${t.name}. Upload failed.`,4,!1)};const a=()=>{const l=this.filesList[e];if(l&&i=0&&en.name===t.name&&n.size===t.size&&n.lastModified===t.lastModified);e!==-1&&(this.removeFileByIndex(e),this.notifyServerFileRemoved(t.name))},removeFileByIndex(t){if(t>=0&&t{const e=window.URL.createObjectURL(new Blob([t.data])),n=document.createElement("a");n.href=e;const r=t.headers["content-disposition"];let i="discussion_files.zip";if(r){const s=r.match(/filename\*?=['"]?([^'";]+)['"]?/i);if(s&&s[1])try{i=decodeURIComponent(s[1].replace(/['"]/g,""))}catch{const a=r.match(/filename="?(.+)"?/i);a&&a[1]&&(i=a[1])}}n.setAttribute("download",i),document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n),window.URL.revokeObjectURL(e)},100)}).catch(t=>{this.onShowToastMessage("Error downloading files.",4,!1)})},handlePaste(t){var r;const e=(r=t.clipboardData||window.clipboardData)==null?void 0:r.items;if(!e)return;let n=[];for(let i=0;i0&&(t.preventDefault(),this.addFiles(n),this.onShowToastMessage(`Added ${n.length} file(s) from paste.`,4,!0))},toggleLeftPanel(){this.$store.commit("setLeftPanelCollapsed",!this.$store.state.leftPanelCollapsed)},toggleRightPanel(){this.$store.commit("setRightPanelCollapsed",!this.$store.state.rightPanelCollapsed)},toggleThinkFirstMode(){this.$store.state.config.think_first_mode=!this.$store.state.config.think_first_mode,this.$store.dispatch("applyConfiguration"),this.$store.dispatch("saveConfiguration")},toggleFunMode(){this.$store.state.config.fun_mode=!this.$store.state.config.fun_mode,this.$store.dispatch("applyConfiguration"),this.$store.dispatch("saveConfiguration")},startSpeechRecognition(){var e,n;const t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t){this.onShowToastMessage("Speech recognition not supported by your browser.",4,!1);return}if(this.isListeningToVoice){(e=this.recognition)==null||e.stop(),clearTimeout(this.silenceTimer),this.isListeningToVoice=!1;return}try{this.recognition=new t,this.recognition.lang=((n=this.$store.state.config)==null?void 0:n.audio_in_language)||navigator.language||"en-US",this.recognition.interimResults=!0,this.recognition.continuous=!1,this.recognitionError=!1,this.recognition.onstart=()=>{this.isListeningToVoice=!0,this.resetSilenceTimer()},this.recognition.onresult=r=>{this.resetSilenceTimer();let i="",s="";for(let o=r.resultIndex;o{this.recognitionError=!0;let i="Speech recognition error";switch(r.error){case"no-speech":i="No speech detected. Please try again.";break;case"audio-capture":i="Microphone error. Check microphone connection and permissions.";break;case"not-allowed":i="Microphone access denied. Please allow microphone access in browser settings.";break;case"network":i="Network error during speech recognition.";break;case"service-not-allowed":i="Speech recognition service denied. Check browser/OS settings.";break;default:i=`Speech error: ${r.error}`}this.onShowToastMessage(i,4,!1),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{this.isListeningToVoice=!1,clearTimeout(this.silenceTimer),this.message.trim()&&!["no-speech","not-allowed","audio-capture"].includes(this.recognitionError?this.recognition.error:"")&&this.submit(),this.recognition=null},this.recognition.start()}catch{this.onShowToastMessage("Could not start voice input. Please check browser compatibility and permissions.",4,!1),this.isListeningToVoice=!1}},resetSilenceTimer(){clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.isListeningToVoice&&this.recognition&&this.recognition.stop()},this.silenceTimeoutDuration)},updateRT(){this.is_rt?this.stopRTCom():this.startRTCom()},startRTCom(){if(this.$store.state.config.active_tts_service==="None"||!this.$store.state.config.active_tts_service||this.$store.state.config.active_stt_service==="None"||!this.$store.state.config.active_stt_service){this.onShowToastMessage("Both TTS and STT services must be configured and selected to use Real-Time mode.",4,!1);return}et.emit("start_bidirectional_audio_stream",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Attempting to start Real-time audio...",4,!0)},stopRTCom(){et.emit("stop_bidirectional_audio_stream",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Stopping Real-time audio...",4,!0)},handleRTComStatusChanged(t){if(t&&t.client_id===this.$store.state.client_id){this.is_rt=t.status;const e=`Real-time audio mode ${this.is_rt?"activated":"deactivated"}.`;this.onShowToastMessage(e,4,this.is_rt)}},toggleSendMenu(){this.isSendMenuVisible=!this.isSendMenuVisible,this.isSendMenuVisible&&this.updateFeatherIcons()},closeSendMenu(){this.isSendMenuVisible&&(this.isSendMenuVisible=!1)},add_file(){var t;this.closeSendMenu(),(t=this.$refs.fileDialog)==null||t.click()},takePicture(){this.closeSendMenu(),et.emit("take_picture",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Requesting picture from camera service...",4,!0)},addWebLink(){this.closeSendMenu(),this.$emit("addWebLink")},handlePictureTaken(t){if(t&&t.client_id===this.$store.state.client_id&&t.status==="success"&&t.file){const e=this.createFileObjectFromBase64(t.file.data,t.file.name,t.file.type);e?(this.addFiles([e]),this.onShowToastMessage("Picture added successfully!",4,!0)):this.onShowToastMessage("Error processing received picture.",4,!1)}else t&&t.client_id===this.$store.state.client_id&&t.status==="error"&&this.onShowToastMessage(`Failed to take picture: ${t.error}`,4,!1)},createFileObjectFromBase64(t,e,n){try{const r=atob(t),i=new Array(r.length);for(let a=0;a{var r;(r=this.$refs.textareaRef)==null||r.focus()})},submitOnEnter(t){t.key==="Enter"&&!t.shiftKey&&!this.loading?(t.preventDefault(),t.repeat||this.sendMessageEvent(this.message)):t.key==="Enter"&&!t.shiftKey&&this.loading&&(t.preventDefault(),this.onShowToastMessage("Please wait for the current response to complete.",4,!1))},submit(){if(this.loading){this.onShowToastMessage("Please wait for the AI to finish responding.",4,!1);return}this.sendMessageEvent(this.message)},submitWithInternetSearch(){if(this.loading){this.onShowToastMessage("Please wait for the AI to finish responding.",4,!1);return}this.sendMessageEvent(this.message,"internet")},stopGenerating(){this.$emit("stopGenerating")},sendCMDEvent(t){t&&typeof t.value<"u"&&this.$emit("sendCMDEvent",t)},async mountDB(t){var s,o;const e=t;if(!e)return;const n=this.$store.state.config.datalakes.find(a=>a.alias===e),r=n?n.mounted:!1,i=r?"Unmounting":"Mounting";this.onShowToastMessage(`${i} datalake ${e}...`,4,!0);try{const a=await Ae.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,datalake_name:e},{headers:this.posts_headers});if((s=a.data)!=null&&s.status){const l=r?"unmounted":"mounted";this.onShowToastMessage(`Datalake ${e} ${l} successfully.`,4,!0)}else this.onShowToastMessage(`Failed to toggle datalake ${e}: ${((o=a.data)==null?void 0:o.error)||"Server error"}`,4,!1);await this.$store.dispatch("refreshConfig")}catch{this.onShowToastMessage(`Error toggling datalake ${e}. Check console for details.`,4,!1),await this.$store.dispatch("refreshConfig")}},async showFunctionSettings(t){const e=t;if(!e||!e.dir||!e.name)return;const r=e.dir.replace(/\\/g,"/").split("/").filter(Boolean),i=r.length>1?r[r.length-2]:"general";this.onShowToastMessage(`Fetching settings for ${e.name}...`,4,!0);try{const s=await Ae.post("/get_function_call_settings",{client_id:this.$store.state.client_id,category:i,name:e.name},{headers:this.posts_headers});s.data&&Object.keys(s.data).length>0?this.$store.state.universalForm.showForm(s.data,`Settings: ${e.name}`,"Save Changes","Cancel").then(o=>{this.onShowToastMessage(`Saving settings for ${e.name}...`,4,!0),Ae.post("/set_function_call_settings",{client_id:this.$store.state.client_id,category:i,name:e.name,settings:o},{headers:this.posts_headers}).then(a=>{var l,c;((l=a.data)==null?void 0:l.status)==="success"?this.onShowToastMessage(`Settings for ${e.name} saved successfully.`,4,!0):this.onShowToastMessage(`Failed to save settings: ${((c=a.data)==null?void 0:c.error)||"Unknown server error"}`,4,!1)}).catch(a=>{this.onShowToastMessage(`Error saving settings: ${a.message}`,4,!1)})}).catch(()=>{this.onShowToastMessage("Settings changes cancelled.",4,!0)}):this.onShowToastMessage(`${e.name} has no configurable settings.`,4,!0)}catch{this.onShowToastMessage(`Error fetching settings for ${e.name}. Check console.`,4,!1)}},async toggleFunctionCall(t){var i,s;const e=t;if(!e||!e.dir||!e.name)return;const n=e.is_checked,r=n?"Disabling":"Enabling";this.onShowToastMessage(`${r} function call ${e.name}...`,4,!0);try{const o=await Ae.post("/toggle_function_call",{client_id:this.$store.state.client_id,name:e.name,dir:e.dir},{headers:this.posts_headers});if((i=o.data)!=null&&i.status){const a=n?"disabled":"enabled";this.onShowToastMessage(`Function call ${e.name} ${a}.`,4,!0)}else this.onShowToastMessage(`Failed to toggle ${e.name}: ${((s=o.data)==null?void 0:s.error)||"Server error"}`,4,!1);await this.$store.dispatch("refreshConfig")}catch{this.onShowToastMessage(`Error toggling ${e.name}. Check console.`,4,!1),await this.$store.dispatch("refreshConfig")}}},watch:{filesList:{handler(){this.recalculateTotalSize(),this.updateFeatherIcons()},deep:!0},loading:"updateFeatherIcons",isSendMenuVisible(t){t&&this.updateFeatherIcons()},isShrunk(t,e){t!==e&&this.updateFeatherIcons()},showHelpModal(t){t&&this.updateFeatherIcons()},showEmojiPicker(t){},"$store.state.is_rt_on"(t){this.is_rt!==t&&(this.is_rt=t)},"$store.state.config.active_personality_id":"updateFeatherIcons","$store.state.config.datalakes":{handler:"updateFeatherIcons",deep:!0},"$store.state.config.mounted_function_calls":{handler:"updateFeatherIcons",deep:!0}},mounted(){this.$emit("loaded");try{const t=localStorage.getItem("chatbarShrunk");t!==null&&(this.isShrunk=JSON.parse(t));const e=localStorage.getItem("chatbarPositionModified"),n=localStorage.getItem("chatbarPosition");e==="true"&&n?(this.currentChatboxPos=JSON.parse(n),this.isPositionModified=!0):(this.isPositionModified=!1,this.currentChatboxPos=null)}catch{this.isShrunk=!1,this.isPositionModified=!1,this.currentChatboxPos=null,localStorage.removeItem("chatbarShrunk"),localStorage.removeItem("chatbarPositionModified"),localStorage.removeItem("chatbarPosition")}et.on("rtcom_status_changed",this.handleRTComStatusChanged),et.on("picture_taken",this.handlePictureTaken),et.on("file_upload_complete",this.handleFileUploadComplete),et.on("file_upload_error",this.handleFileUploadError),this.is_rt=this.$store.state.is_rt_on,this.recalculateTotalSize(),this.updateFeatherIcons()},beforeUnmount(){et.off("rtcom_status_changed",this.handleRTComStatusChanged),et.off("picture_taken",this.handlePictureTaken),et.off("file_upload_complete",this.handleFileUploadComplete),et.off("file_upload_error",this.handleFileUploadError),this.recognition&&this.isListeningToVoice&&(this.recognition.abort(),this.isListeningToVoice=!1),clearTimeout(this.silenceTimer),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mouseleave",this.onMouseLeave),document.body.classList.remove("user-select-none")},activated(){this.recalculateTotalSize(),this.is_rt=this.$store.state.is_rt_on,Fe(()=>{try{const t=localStorage.getItem("chatbarPositionModified"),e=localStorage.getItem("chatbarPosition");t==="true"&&e?(this.currentChatboxPos=JSON.parse(e),this.isPositionModified=!0):(this.isPositionModified=!1,this.currentChatboxPos=null);const n=localStorage.getItem("chatbarShrunk");n!==null&&(this.isShrunk=JSON.parse(n))}catch(t){console.error("Error reapplying state on activation:",t)}this.updateFeatherIcons()})},deactivated(){this.recognition&&this.isListeningToVoice&&(this.recognition.abort(),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)),this.isDragging&&this.onMouseUp()}},VEr={class:"p-3 rounded-b-xl"},qEr={class:"flex items-center justify-between mb-1.5"},UEr=["title"],BEr={class:"flex items-center gap-1.5"},zEr={class:"text-xs text-blue-600 dark:text-blue-300",title:"Total file size and number of files"},XEr={class:"flex items-center gap-1.5 min-w-0"},FEr={key:0,class:"animate-spin flex-shrink-0",title:"Uploading..."},jEr={key:1,"data-feather":"file",class:"w-3.5 h-3.5 flex-shrink-0 text-blue-600 dark:text-blue-300",title:"File"},YEr=["title"],GEr={class:"flex items-center gap-1.5 flex-shrink-0"},WEr=["title"],ZEr=["onClick"],KEr={class:"flex flex-row gap-1.5 w-full"},JEr={class:"relative flex-grow"},ewr=["disabled"],twr={key:0,class:"absolute bottom-full right-0 mb-1 z-20"},nwr={class:"absolute inset-y-0 right-0 flex items-center pr-1.5 space-x-1"},rwr={class:"flex items-center justify-between relative"},iwr=["title"],swr={class:"flex items-center gap-1"},owr={class:"flex items-center gap-1"},awr={class:"flex items-center gap-1"},lwr={class:"p-1.5 space-y-1"},cwr=["title"];function uwr(t,e,n,r,i,s){const o=Xe("EmojiPicker"),a=Xe("PersonalitiesCommands"),l=Tle("click-outside");return k(),R(Ve,null,[b("div",null,[te(cr,{name:"shrink-fade","enter-active-class":"transition ease-out duration-300","enter-from-class":"transform opacity-0 scale-50","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-200","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-50"},{default:Ie(()=>[i.isShrunk?(k(),R("button",{key:0,onClick:e[0]||(e[0]=(...c)=>s.toggleShrink&&s.toggleShrink(...c)),class:"fixed bottom-4 right-4 z-[60] p-3 bg-blue-500 dark:bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-600 dark:hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-400 dark:focus:ring-offset-gray-900 animate-heartbeat",title:"Expand Chat","aria-label":"Expand Chat"},e[35]||(e[35]=[b("i",{"data-feather":"message-square",class:"w-6 h-6"},null,-1)]))):ne("",!0)]),_:1}),te(cr,{name:"chatbar-fade-scale","enter-active-class":"transition ease-out duration-300","enter-from-class":"transform opacity-0 scale-95 translate-y-4","enter-to-class":"transform opacity-100 scale-100 translate-y-0","leave-active-class":"transition ease-in duration-200","leave-from-class":"transform opacity-100 scale-100 translate-y-0","leave-to-class":"transform opacity-0 scale-95 translate-y-4"},{default:Ie(()=>[i.isShrunk?ne("",!0):(k(),R("div",{key:0,ref:"chatbarRef",class:ye(["chatbox-color fixed w-11/12 max-w-3xl bg-opacity-90 backdrop-blur-md rounded-xl border border-blue-300 dark:border-blue-700 shadow-lg transition-shadow duration-300 ease-in-out z-50",i.isPositionModified?"":"bottom-4 left-1/2 transform -translate-x-1/2",i.isDragging?"cursor-grabbing":""]),style:qn(s.chatbarStyle)},[b("div",{class:ye(["flex items-center justify-between h-7 px-2 bg-blue-100/80 dark:bg-blue-900/70 border-b border-blue-300 dark:border-blue-600 hover:bg-blue-200/90 dark:hover:bg-blue-800/90 transition-colors duration-150 rounded-t-xl",[i.isDragging?"cursor-grabbing":"cursor-grab"]]),onMousedown:e[3]||(e[3]=oe((...c)=>s.onMouseDown&&s.onMouseDown(...c),["prevent"]))},[e[37]||(e[37]=b("span",{class:"chat-box-title-barselect-none"},"Chat",-1)),b("button",{onClick:e[1]||(e[1]=oe((...c)=>s.toggleShrink&&s.toggleShrink(...c),["stop"])),class:"svg-button p-1 rounded-full hover:bg-blue-300 dark:hover:bg-blue-700",title:"Shrink Chat",onMousedown:e[2]||(e[2]=oe(()=>{},["stop"]))},e[36]||(e[36]=[b("i",{"data-feather":"minus",class:"w-4 h-4"},null,-1)]),32)],34),b("div",VEr,[i.filesList.length>0?(k(),R("div",{key:0,class:"mb-2 border-b border-blue-200 dark:border-blue-700 pb-2",onMousedown:e[7]||(e[7]=oe(()=>{},["stop"]))},[b("div",qEr,[b("button",{class:"svg-button p-1.5",title:i.showfilesList?"Hide file list":"Show file list",onClick:e[4]||(e[4]=oe(c=>i.showfilesList=!i.showfilesList,["stop"]))},e[38]||(e[38]=[b("i",{"data-feather":"list",class:"w-4 h-4"},null,-1)]),8,UEr),b("div",BEr,[b("span",zEr,ae(i.totalSize)+" ("+ae(i.filesList.length)+") ",1),b("button",{onClick:e[5]||(e[5]=oe((...c)=>s.clear_files&&s.clear_files(...c),["stop"])),class:"svg-button p-1 hover:text-red-500 dark:hover:text-red-400",title:"Clear all files"},e[39]||(e[39]=[b("i",{"data-feather":"trash",class:"w-3.5 h-3.5"},null,-1)])),b("button",{onClick:e[6]||(e[6]=oe((...c)=>s.download_files&&s.download_files(...c),["stop"])),class:"svg-button p-1 hover:text-blue-500 dark:hover:text-blue-400",title:"Download all files"},e[40]||(e[40]=[b("i",{"data-feather":"download-cloud",class:"w-3.5 h-3.5"},null,-1)]))])]),He(te(V4,{name:"list",tag:"div",class:"max-h-32 overflow-y-auto rounded-md bg-blue-100 dark:bg-blue-900 divide-y divide-blue-200 dark:divide-blue-700 scrollbar"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(i.filesList,(c,u)=>(k(),R("div",{key:c.name+"-"+c.lastModified+"-"+c.size,class:"flex items-center justify-between p-1.5 group hover:bg-blue-200 dark:hover:bg-blue-800 transition-colors duration-150"},[b("div",XEr,[i.isFileSentList[u]?(k(),R("i",jEr)):(k(),R("div",FEr,e[41]||(e[41]=[b("i",{"data-feather":"loader",class:"w-3.5 h-3.5 text-blue-500 dark:text-blue-400"},null,-1)]))),b("span",{class:ye(["truncate text-xs",i.isFileSentList[u]?"text-green-600 dark:text-green-400":"text-blue-700 dark:text-blue-200"]),title:c.name},ae(c.name),11,YEr)]),b("div",GEr,[b("span",{class:"text-xs text-blue-500 dark:text-blue-400",title:s.computedFileSize(c.size)},ae(s.computedFileSize(c.size)),9,WEr),b("button",{onClick:oe(d=>s.removeItem(c),["stop"]),class:"svg-button p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 dark:hover:text-red-400 transition-all duration-150",title:"Remove file"},e[42]||(e[42]=[b("i",{"data-feather":"x",class:"w-3.5 h-3.5"},null,-1)]),8,ZEr)])]))),128))]),_:1},512),[[mr,i.showfilesList]])],32)):ne("",!0),b("div",{class:"flex flex-col gap-1.5",onMousedown:e[30]||(e[30]=oe(()=>{},["stop"]))},[b("div",KEr,[b("div",JEr,[He(b("textarea",{id:"chat",ref:"textareaRef",disabled:n.loading,"onUpdate:modelValue":e[8]||(e[8]=c=>i.message=c),onPaste:e[9]||(e[9]=(...c)=>s.handlePaste&&s.handlePaste(...c)),onKeydown:e[10]||(e[10]=gr(oe(c=>s.submitOnEnter(c),["exact"]),["enter"])),rows:"1",class:"input w-full p-2.5 pr-28 text-sm rounded-lg focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 border-blue-300 dark:border-blue-600 resize-y min-h-[2.75rem] max-h-28 overflow-auto transition-colors scrollbar text-blue-900 dark:text-blue-100 placeholder-blue-400 dark:placeholder-blue-500",placeholder:"Write your message...",title:"Enter your message here"},null,40,ewr),[[vt,i.message]]),i.showEmojiPicker?He((k(),R("div",twr,[te(o,{native:!0,onSelect:s.onEmojiSelect},null,8,["onSelect"])])),[[l,s.closeEmojiPicker]]):ne("",!0),b("div",nwr,[b("button",{onClick:e[11]||(e[11]=oe((...c)=>s.toggleEmojiPicker&&s.toggleEmojiPicker(...c),["stop"])),class:"svg-button p-1.5",title:"Add emoji"},e[43]||(e[43]=[b("i",{"data-feather":"smile",class:"w-4 h-4"},null,-1)])),n.loading?(k(),R("button",{key:0,onClick:e[12]||(e[12]=oe((...c)=>s.stopGenerating&&s.stopGenerating(...c),["stop"])),class:"btn btn-sm bg-red-500 text-white hover:bg-red-600 focus:ring-red-300 dark:focus:ring-red-600 transform hover:scale-105 active:scale-95 transition-all duration-200 ease-in-out shadow-md hover:shadow-lg animate-pulse p-1.5",title:"Stop generating","aria-label":"Stop generation process"},e[44]||(e[44]=[b("i",{"data-feather":"stop-circle",class:"w-4 h-4 animate-spin-slow"},null,-1),b("span",{class:"sr-only"},"Stop",-1)]))):(k(),R(Ve,{key:1},[b("button",{onClick:e[13]||(e[13]=oe((...c)=>s.submit&&s.submit(...c),["stop"])),class:"svg-button p-1.5",title:"Send message"},e[45]||(e[45]=[b("i",{"data-feather":"send",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[14]||(e[14]=oe((...c)=>s.submitWithInternetSearch&&s.submitWithInternetSearch(...c),["stop"])),class:"svg-button p-1.5",title:"Send with internet search"},e[46]||(e[46]=[b("i",{"data-feather":"globe",class:"w-4 h-4"},null,-1)]))],64))])])]),b("div",rwr,[b("button",{onClick:e[15]||(e[15]=oe((...c)=>s.toggleLeftPanel&&s.toggleLeftPanel(...c),["stop"])),class:ye(["svg-button p-1.5",t.$store.state.leftPanelCollapsed?"":"bg-blue-200 dark:bg-blue-700"]),title:t.$store.state.leftPanelCollapsed?"Expand Left Panel":"Collapse Left Panel"},e[47]||(e[47]=[b("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4"},[b("rect",{x:"3",y:"2",width:"4",height:"20",rx:"2",fill:"currentColor"}),b("rect",{x:"9",y:"6",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"9",y:"11",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"9",y:"16",width:"12",height:"2",rx:"1",fill:"currentColor"})],-1)]),10,iwr),b("div",swr,[s.isCommandsValid?(k(),Qt(a,{key:0,help:"Personality commands",commandsList:t.$store.state.mountedPersArr[t.$store.state.config.active_personality_id].commands,sendCommand:s.sendCMDEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD",size:"small"},null,8,["commandsList","sendCommand","on-show-toast-message"])):ne("",!0),s.isdataLakeNamesValid?(k(),Qt(a,{key:1,help:"Datalakes",icon:"feather:book",commandsList:s.dataLakeNames,sendCommand:s.mountDB,"on-show-toast-message":n.onShowToastMessage,ref:"databasesList",size:"small"},null,8,["commandsList","sendCommand","on-show-toast-message"])):ne("",!0),t.$store.state.config.mounted_function_calls.length>0?(k(),Qt(a,{key:2,icon:"feather:zap",help:"Function calls (WIP)",commandsList:s.functionCalls,sendCommand:s.toggleFunctionCall,showSettings:s.showFunctionSettings,"on-show-toast-message":n.onShowToastMessage,ref:"functioncalls",size:"small"},null,8,["commandsList","sendCommand","showSettings","on-show-toast-message"])):ne("",!0)]),b("div",owr,[b("button",{onClick:e[16]||(e[16]=oe((...c)=>s.toggleThinkFirstMode&&s.toggleThinkFirstMode(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-blue-600 dark:text-blue-400 bg-blue-200 dark:bg-blue-700":t.$store.state.config.think_first_mode}]),title:"Toggle Think First Mode"},e[48]||(e[48]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[b("path",{d:"M12 2a6 6 0 0 1 6 6c0 2.42-1.61 4.5-4 5.25V15a2 2 0 0 1-4 0v-1.75C7.61 12.5 6 10.42 6 8a6 6 0 0 1 6-6z"}),b("path",{d:"M9 18h6"}),Se(),b("path",{d:"M10 22h4"})],-1)]),2),b("button",{onClick:e[17]||(e[17]=oe((...c)=>s.toggleFunMode&&s.toggleFunMode(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-blue-600 dark:text-blue-400 bg-blue-200 dark:bg-blue-700":t.$store.state.config.fun_mode}]),title:"Toggle Fun Mode"},e[49]||(e[49]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[b("circle",{cx:"12",cy:"12",r:"10"}),Se(),b("path",{d:"M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01"})],-1)]),2)]),b("div",awr,[b("button",{onClick:e[18]||(e[18]=oe((...c)=>s.startSpeechRecognition&&s.startSpeechRecognition(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-red-500 dark:text-red-400 animate-pulse":i.isListeningToVoice}]),title:"Voice input"},e[50]||(e[50]=[b("i",{"data-feather":"mic",class:"w-4 h-4"},null,-1)]),2),t.$store.state.config.active_tts_service!=="None"&&t.$store.state.config.active_tts_service&&t.$store.state.config.active_stt_service!=="None"?(k(),R("button",{key:0,onClick:e[19]||(e[19]=oe((...c)=>s.updateRT&&s.updateRT(...c),["stop"])),class:ye(["btn btn-sm p-1",i.is_rt?"bg-red-500 hover:bg-red-600 text-white":"bg-green-500 hover:bg-green-600 text-white"]),title:"Toggle real-time audio mode"},e[51]||(e[51]=[b("span",{class:"text-xs font-bold"},"RT",-1)]),2)):ne("",!0),b("button",{onClick:e[20]||(e[20]=oe((...c)=>s.toggleSendMenu&&s.toggleSendMenu(...c),["stop"])),class:"svg-button p-1.5",title:"More actions (Add file, take picture, etc.)"},e[52]||(e[52]=[b("i",{"data-feather":"plus-circle",class:"w-4 h-4"},null,-1)])),He(b("div",{class:"absolute right-0 bottom-full mb-1 w-44 bg-blue-100 dark:bg-blue-800 rounded-md shadow-lg border border-blue-300 dark:border-blue-600 z-10",onMouseleave:e[24]||(e[24]=(...c)=>s.closeSendMenu&&s.closeSendMenu(...c)),onMousedown:e[25]||(e[25]=oe(()=>{},["stop"]))},[b("div",lwr,[b("button",{onClick:e[21]||(e[21]=oe((...c)=>s.add_file&&s.add_file(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Add a file"},e[53]||(e[53]=[b("i",{"data-feather":"file-plus",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Add File",-1)])),b("button",{onClick:e[22]||(e[22]=oe((...c)=>s.takePicture&&s.takePicture(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Take a picture"},e[54]||(e[54]=[b("i",{"data-feather":"camera",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Take Picture",-1)])),b("button",{onClick:e[23]||(e[23]=oe((...c)=>s.addWebLink&&s.addWebLink(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Add a web link"},e[55]||(e[55]=[b("i",{"data-feather":"link",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Add Web Link",-1)]))])],544),[[mr,i.isSendMenuVisible]]),b("button",{onClick:e[26]||(e[26]=oe((...c)=>s.makeAnEmptyUserMessage&&s.makeAnEmptyUserMessage(...c),["stop"])),class:"svg-button p-1.5",title:"Insert an empty user message"},e[56]||(e[56]=[b("i",{"data-feather":"message-circle",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[27]||(e[27]=oe((...c)=>s.makeAnEmptyAIMessage&&s.makeAnEmptyAIMessage(...c),["stop"])),class:"svg-button p-1.5 text-red-400 hover:text-red-500 dark:hover:text-red-400",title:"Insert an empty AI message"},e[57]||(e[57]=[b("i",{"data-feather":"cpu",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[28]||(e[28]=oe((...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c),["stop"])),class:"svg-button p-1.5",title:"Show Help"},e[58]||(e[58]=[b("i",{"data-feather":"info",class:"w-4 h-4"},null,-1)]))]),b("button",{onClick:e[29]||(e[29]=oe((...c)=>s.toggleRightPanel&&s.toggleRightPanel(...c),["stop"])),class:ye(["svg-button p-1.5",t.$store.state.rightPanelCollapsed?"":"bg-blue-200 dark:bg-blue-700"]),title:t.$store.state.rightPanelCollapsed?"Expand Right Panel":"Collapse Right Panel"},e[59]||(e[59]=[b("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4"},[b("rect",{x:"17",y:"2",width:"4",height:"20",rx:"2",fill:"currentColor"}),b("rect",{x:"3",y:"6",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"3",y:"11",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"3",y:"16",width:"12",height:"2",rx:"1",fill:"currentColor"})],-1)]),10,cwr)])],32)])],6))]),_:1})]),b("input",{type:"file",ref:"fileDialog",onChange:e[31]||(e[31]=c=>s.addFilesFromInput(c.target.files)),multiple:"",class:"hidden"},null,544),i.showHelpModal?(k(),R("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",onClick:e[34]||(e[34]=(...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c))},[b("div",{class:"card max-w-lg w-full relative overflow-y-auto max-h-[85vh] scrollbar p-4 md:p-6",onClick:e[33]||(e[33]=oe(()=>{},["stop"]))},[b("button",{onClick:e[32]||(e[32]=(...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c)),class:"svg-button absolute top-2 right-2 z-10",title:"Close tutorial"},e[60]||(e[60]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)])),e[61]||(e[61]=To('Chatbar Help Overview of the chat controls:
Sends your message to the AI.
Sends your message with internet search.
Opens the emoji picker.
Shrinks the chatbar.
Toggles the left panel visibility.
Toggles the right panel visibility.
Toggle 'Think First' mode. Activates voice input.
RT Toggles real-time audio mode.
Shows more actions menu.
Inserts empty user message.
Inserts empty AI message.
Shows this help modal.
Click and drag the header bar to move the chatbox.
',3))])])):ne("",!0)],64)}const dwr=st(HEr,[["render",uwr],["__scopeId","data-v-3cfd7cc5"]]),fwr={name:"WelcomeComponent",data(){return{videoUrl:"",videoType:"",latestNews:"",error:"",showVideoButton:!1,lastVideoUrl:""}},computed:{getImageForVideoType(){switch(this.videoType.toLowerCase()){case"podcast":return"/podcast.png";case"music":return"/music.png";case"movie":return"/movie.png";case"tutorial":return"/tutorial.png";default:return"/play_video.png"}},logoSrc(){return this.$store.state.config&&this.$store.state.config.app_custom_logo?`/user_infos/${this.$store.state.config.app_custom_logo}`:Eo}},methods:{async fetchLatestNews(){try{const t=await Ae.get("/get_news");this.latestNews=t.data}catch(t){console.error("Failed to fetch latest news:",t),this.error="Unable to fetch the latest news. Please try again later."}},async fetchVideoUrl(){try{const t=await Ae.get("/get_last_video_url");this.videoUrl=t.data.url,this.videoType=t.data.type,this.checkVideoUpdate()}catch(t){console.error("Failed to fetch video information:",t),this.error="Unable to fetch the latest video information. Please try again later."}},async handleClick(){await Ae.post("/set_last_viewed_video_url",{client_id:this.$store.state.client_id,last_viewed_video_url:this.videoUrl}),this.showVideoButton=!1},async checkVideoUpdate(){const e=(await Ae.get("/get_last_viewed_video_url")).data;console.log("storedVideoUrl"),console.log(e),this.videoUrl!==e&&(this.showVideoButton=!0)}},mounted(){this.fetchLatestNews(),this.fetchVideoUrl()}},hwr={class:"flex flex-col items-center justify-center w-full h-full min-h-screen p-8"},pwr={class:"text-center max-w-4xl"},Twr={class:"flex items-center justify-center gap-8 mb-12"},Owr={class:"relative w-24 h-24"},mwr=["src"],gwr={key:0,class:"flex flex-col items-start"},Qwr={class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"},_wr={key:1,class:"flex flex-col items-start"},vwr={class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"},ywr={key:0,class:"space-y-8 animate-fade-in-up"},bwr=["innerHTML"],Swr={key:1,class:"space-y-8 animate-fade-in-up"},xwr={class:"text-4xl font-semibold"},Ewr={class:"text-xl max-w-3xl mx-auto"},wwr={key:0,class:"mt-12 p-6 rounded-lg shadow-md animate-fade-in-up overflow-y-scroll scrollbar-thin"},Cwr=["innerHTML"],Lwr={key:2,class:"mt-6 text-red-500"},$wr={key:0,class:"floating-button-container"},Awr=["href"],kwr=["src","alt"];function Pwr(t,e,n,r,i,s){return k(),R("div",hwr,[b("div",pwr,[b("div",Twr,[b("div",Owr,[b("img",{src:s.logoSrc,alt:"LoLLMS Logo",class:"w-24 h-24 rounded-full absolute animate-rolling-ball"},null,8,mwr)]),t.$store.state.config!=null&&t.$store.state.config.app_custom_name!=null&&t.$store.state.config.app_custom_name!=""?(k(),R("div",gwr,[b("h1",Qwr,ae(t.$store.state.config.app_custom_name),1)])):(k(),R("div",_wr,[b("h1",vwr,ae(t.$store.state.theme_vars.lollms_title),1),e[1]||(e[1]=b("p",{class:"text-2xl italic mt-2"}," Lord of Large Language And Multimodal Systems ",-1))]))]),t.$store.state.config!=null&&t.$store.state.config.app_custom_name!=null&&t.$store.state.config.app_custom_name!=""?(k(),R("div",ywr,[b("p",{innerHTML:t.$store.state.config.app_custom_welcome_message},null,8,bwr)])):(k(),R("div",Swr,[b("h2",xwr,ae(t.$store.state.theme_vars.lollms_welcome_short_message),1),b("p",Ewr,ae(t.$store.state.theme_vars.lollms_welcome_message),1),i.latestNews?(k(),R("div",wwr,[e[2]||(e[2]=b("h3",null,"Latest LoLLMS News",-1)),b("p",{innerHTML:i.latestNews},null,8,Cwr)])):ne("",!0)])),i.error?(k(),R("div",Lwr,ae(i.error),1)):ne("",!0)]),i.showVideoButton?(k(),R("div",$wr,[b("a",{href:i.videoUrl,target:"_blank",class:"floating-button",onClick:e[0]||(e[0]=(...o)=>s.handleClick&&s.handleClick(...o))},[e[3]||(e[3]=b("span",{class:"tooltip"},"New ParisNeo Video!",-1)),b("img",{src:s.getImageForVideoType,alt:"New "+i.videoType,class:"w-full h-full object-cover"},null,8,kwr)],8,Awr)])):ne("",!0)])}const Rwr=st(fwr,[["render",Pwr],["__scopeId","data-v-861ce6fc"]]),Mwr={name:"PromptCard",props:{prompt:{type:String,required:!0}},emits:["select"],computed:{title(){const t=this.prompt.match(/@<(.*?)>@/);return t?t[1]:null},fullPromptContent(){return this.prompt.replace(/@<.*?>@/,"").trim()},renderedContent(){const t=Kt.parse(this.fullPromptContent||"");return C4.sanitize(t)}}},Dwr=["title"],Nwr={class:"flex-grow space-y-1 overflow-hidden"},Iwr=["title"],Hwr=["innerHTML","title"];function Vwr(t,e,n,r,i,s){return k(),R("div",{title:s.fullPromptContent,onClick:e[0]||(e[0]=o=>t.$emit("select",n.prompt)),class:"card hover:shadow-xl transition-all duration-300 ease-in-out transform hover:scale-[1.03] flex flex-col justify-between min-h-[190px] group p-3 cursor-pointer border border-blue-200 dark:border-blue-700 bg-blue-50 dark:bg-blue-900 hover:border-blue-400 dark:hover:border-blue-500"},[b("div",Nwr,[b("h3",{class:"font-semibold text-base text-blue-800 dark:text-blue-100 mb-1 truncate",title:s.title||"Prompt Example"},ae(s.title||"Prompt Example"),9,Iwr),b("div",{innerHTML:s.renderedContent,class:"prose prose-sm dark:prose-invert max-w-none text-sm text-blue-700 dark:text-blue-300 overflow-hidden leading-relaxed line-clamp-5",title:s.fullPromptContent},null,8,Hwr)]),e[1]||(e[1]=b("div",{class:"mt-2 text-xs font-medium link opacity-0 group-hover:opacity-100 transition-opacity duration-300 pt-1.5 border-t border-blue-200 dark:border-blue-700"}," Click to use this prompt ",-1))],8,Dwr)}const qwr=st(Mwr,[["render",Vwr],["__scopeId","data-v-55e548ec"]]),Uwr={name:"PromptExamples",components:{PromptCard:qwr},props:{prompts:{type:Array,required:!0,default:()=>[]}},emits:["prompt-selected"],methods:{onPromptSelected(t){this.$emit("prompt-selected",t)}}},Bwr={key:0,class:"w-full rounded-lg m-2 shadow-lg border border-blue-200 dark:border-blue-700 bg-gradient-to-br from-blue-100 to-blue-50 dark:from-blue-950 dark:to-blue-900 p-4 flex flex-col max-h-[50vh]"},zwr={class:"overflow-y-auto scrollbar flex-grow pr-1"},Xwr={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 p-2"};function Fwr(t,e,n,r,i,s){const o=Xe("PromptCard");return n.prompts&&n.prompts.length>0?(k(),R("div",Bwr,[e[0]||(e[0]=b("h2",{class:"text-xl font-bold mb-3 text-blue-700 dark:text-blue-200 border-b border-blue-300 dark:border-blue-600 pb-2 flex-shrink-0"}," Prompt Examples ",-1)),b("div",zwr,[b("div",Xwr,[(k(!0),R(Ve,null,dt(n.prompts,(a,l)=>(k(),Qt(o,{key:l,prompt:a,onSelect:s.onPromptSelected},null,8,["prompt","onSelect"]))),128))])])])):ne("",!0)}const jwr=st(Uwr,[["render",Fwr],["__scopeId","data-v-f72d90a4"]]),Ywr=t=>{const e=t.replace(/^\[|\]$/g,"").split("::"),n=e[0];if(e.length===1)return{label:n,type:"text",fullText:t};const r=e[1].toLowerCase(),i={label:n,type:r,fullText:t};switch(r){case"int":case"float":case"multiline":break;case"code":i.language=e[2]||"plaintext";break;case"options":i.options=e[2]?e[2].split(",").map(s=>s.trim()):[];break;default:i.type="text"}return i},Gwr={name:"ChatArea",components:{Message:Rbr,ChatBox:dwr,WelcomeComponent:Rwr,PromptExamples:jwr},props:{isReady:Boolean,hasActiveDiscussion:Boolean,discussionArr:Array,isGenerating:Boolean,host:String,personalityAvatars:Array},emits:["copy-message","delete-message","rank-up","rank-down","update-message","resend-message","continue-message","send-message","send-cmd","add-web-link","create-empty-user-message","create-empty-ai-message","stop-generating","recover-files","talk-personality","files-dropped"],data(){return{isDragOverChat:!1,showPlaceholderModal:!1,selectedPrompt:"",placeholders:[],placeholderValues:{},previewPrompt:""}},computed:{...Pu(["config"]),personality(){if(!this.config||!this.config.personalities||this.config.active_personality_id<0||this.config.active_personality_id>=this.config.personalities.length)return null;const t=this.config.personalities[this.config.active_personality_id];return this.$store.state.personalities.find(n=>n.full_path===t)||{prompts_list:[]}},showPromptExamples(){return this.hasActiveDiscussion&&this.discussionArr&&this.discussionArr.length<2&&this.personality&&this.personality.prompts_list&&this.personality.prompts_list.length>0},parsedPlaceholders(){const t=new Map;return this.placeholders.forEach(e=>{const n=Ywr(e);t.set(n.fullText,n)}),Array.from(t.values())}},methods:{getAvatar(t){var i;if(!this.config||!t)return null;const e=t.toLowerCase().trim(),n=(i=this.config.user_name)==null?void 0:i.toLowerCase().trim();if(e===n)return this.config.user_avatar?`user_infos/${this.config.user_avatar}`:null;const r=this.personalityAvatars.find(s=>{var o;return((o=s.name)==null?void 0:o.toLowerCase().trim())===e});return r!=null&&r.avatar?`/${r.avatar}`:null},scrollToBottom(){Fe(()=>{const t=document.getElementById("messages-list");t&&(t.scrollTop=t.scrollHeight)})},handleDrop(t){this.isDragOverChat=!1;const e=Array.from(t.dataTransfer.files);this.$emit("files-dropped",e)},handleFilesDropped(t){this.$emit("files-dropped",t)},getPromptContent(t){return t?t.replace(/@<.*?>@/,"").trim():""},handlePromptSelection(t){this.selectedPrompt=t,this.previewPrompt=t,this.placeholders=this.extractPlaceholders(t),this.placeholders.length>0?(this.placeholderValues={},this.parsedPlaceholders.forEach((e,n)=>{this.placeholderValues[n]=""}),this.showPlaceholderModal=!0,this.updatePreview()):this.setPromptInChatbox(this.getPromptContent(t))},extractPlaceholders(t){const e=/\[(.*?)\]/g,n=new Set([...(t||"").matchAll(e)].map(r=>r[0]));return Array.from(n)},updatePreview(){let t=this.selectedPrompt;this.parsedPlaceholders.forEach((e,n)=>{const r=this.placeholderValues[n],i=new RegExp(this.escapeRegExp(e.fullText),"g");t=t.replace(i,r||e.fullText)}),this.previewPrompt=t},escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},cancelPlaceholders(){this.showPlaceholderModal=!1},applyPlaceholders(){let t=this.selectedPrompt;this.parsedPlaceholders.forEach((n,r)=>{const i=this.placeholderValues[r];if(i!=null&&i!==""){const s=new RegExp(this.escapeRegExp(n.fullText),"g");t=t.replace(s,i)}});const e=this.getPromptContent(t).replace(/\[(.*?)\]/g,"");this.showPlaceholderModal=!1,this.setPromptInChatbox(e.trim())},setPromptInChatbox(t){this.$refs.chatBox&&(this.$refs.chatBox.message=t,this.$refs.chatBox.focusInput())}},watch:{discussionArr:{handler(){this.$nextTick(()=>Re.replace())},deep:!0},personality:{handler(t,e){(t==null?void 0:t.full_path)!==(e==null?void 0:e.full_path)&&(this.showPlaceholderModal=!1,this.selectedPrompt="",this.placeholders=[],this.placeholderValues={},this.previewPrompt="")},deep:!0}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},Wwr={class:"relative flex flex-col flex-grow background-color h-full"},Zwr={class:"container pt-4 pb-50 mb-50 w-full mx-auto px-4"},Kwr={key:2,class:"fixed inset-0 bg-black bg-opacity-60 dark:bg-opacity-70 flex items-center justify-center z-50 p-4"},Jwr={class:"card max-w-4xl w-full max-h-[90vh] flex flex-col p-0"},eCr={class:"flex-1 flex flex-col min-h-0 overflow-hidden p-4 space-y-4"},tCr={class:"p-3 bg-blue-100 dark:bg-blue-800 rounded-lg border border-blue-200 dark:border-blue-700"},nCr={class:"flex-1 h-[150px] overflow-y-auto scrollbar bg-white dark:bg-blue-900 p-2 rounded text-sm"},rCr={class:"whitespace-pre-wrap text-blue-900 dark:text-blue-100"},iCr={class:"flex-1 overflow-y-auto scrollbar space-y-3 pr-2"},sCr=["for"],oCr=["id","onUpdate:modelValue","placeholder"],aCr=["id","onUpdate:modelValue"],lCr=["id","onUpdate:modelValue"],cCr=["id","onUpdate:modelValue"],uCr={key:4,class:"border border-blue-300 dark:border-blue-600 rounded-md overflow-hidden"},dCr={class:"bg-blue-200 dark:bg-blue-700 p-1 px-2 text-xs text-blue-700 dark:text-blue-200"},fCr=["id","onUpdate:modelValue"],hCr=["id","onUpdate:modelValue"],pCr=["value"],TCr={class:"p-4 flex justify-end space-x-2 border-t border-blue-200 dark:border-blue-700"},OCr={key:0,class:"sticky bottom-0 left-0 right-0 p-4 z-20 w-full max-w-4xl mx-auto"};function mCr(t,e,n,r,i,s){var u;const o=Xe("Message"),a=Xe("PromptExamples"),l=Xe("WelcomeComponent"),c=Xe("ChatBox");return k(),R("div",Wwr,[b("div",{id:"messages-list",class:ye(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",i.isDragOverChat?"opacity-50 border-2 border-dashed border-blue-500":""]),onDragover:e[10]||(e[10]=oe(d=>i.isDragOverChat=!0,["prevent"])),onDragleave:e[11]||(e[11]=d=>i.isDragOverChat=!1),onDrop:e[12]||(e[12]=oe((...d)=>s.handleDrop&&s.handleDrop(...d),["prevent"]))},[b("div",Zwr,[n.discussionArr&&n.discussionArr.length>0?(k(),Qt(V4,{key:0,name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(n.discussionArr,d=>(k(),Qt(o,{key:d.id,message:d,id:"msg-"+d.id,ref_for:!0,ref:"msg-"+d.id,host:n.host,onCopy:e[0]||(e[0]=f=>t.$emit("copy-message",f)),onDelete:f=>t.$emit("delete-message",d.id),onRankUp:f=>t.$emit("rank-up",d.id),onRankDown:f=>t.$emit("rank-down",d.id),onUpdateMessage:e[1]||(e[1]=f=>t.$emit("update-message",f)),onResendMessage:f=>t.$emit("resend-message",{id:d.id,content:d.content,type:d.type}),onContinueMessage:f=>t.$emit("continue-message",{id:d.id,content:d.content}),avatar:s.getAvatar(d.sender)},null,8,["message","id","host","onDelete","onRankUp","onRankDown","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):ne("",!0),s.showPromptExamples?(k(),Qt(a,{key:1,prompts:((u=s.personality)==null?void 0:u.prompts_list)||[],onPromptSelected:s.handlePromptSelection,class:"my-4"},null,8,["prompts","onPromptSelected"])):ne("",!0),i.showPlaceholderModal?(k(),R("div",Kwr,[b("div",Jwr,[e[23]||(e[23]=b("h3",{class:"text-lg font-semibold p-4 border-b border-blue-200 dark:border-blue-700 text-blue-800 dark:text-blue-100"},"Fill in the placeholders",-1)),b("div",eCr,[b("div",tCr,[e[21]||(e[21]=b("h4",{class:"label !mb-1"},"Live Preview:",-1)),b("div",nCr,[b("span",rCr,ae(s.getPromptContent(i.previewPrompt)),1)])]),b("div",iCr,[(k(!0),R(Ve,null,dt(s.parsedPlaceholders,(d,f)=>(k(),R("div",{key:d.fullText,class:"flex flex-col"},[b("label",{for:"placeholder-"+f,class:"label"},ae(d.label),9,sCr),d.type==="text"?He((k(),R("input",{key:0,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"text",class:"input",placeholder:d.label,onInput:e[2]||(e[2]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,oCr)),[[vt,i.placeholderValues[f]]]):ne("",!0),d.type==="int"?He((k(),R("input",{key:1,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"number",step:"1",class:"input",onInput:e[3]||(e[3]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,aCr)),[[vt,i.placeholderValues[f],void 0,{number:!0}]]):ne("",!0),d.type==="float"?He((k(),R("input",{key:2,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"number",step:"0.01",class:"input",onInput:e[4]||(e[4]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,lCr)),[[vt,i.placeholderValues[f],void 0,{number:!0}]]):ne("",!0),d.type==="multiline"?He((k(),R("textarea",{key:3,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,rows:"4",class:"input",onInput:e[5]||(e[5]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,cCr)),[[vt,i.placeholderValues[f]]]):ne("",!0),d.type==="code"?(k(),R("div",uCr,[b("div",dCr,ae(d.language||"Plain text"),1),He(b("textarea",{id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,rows:"6",class:"w-full p-2 font-mono bg-blue-50 dark:bg-blue-900 border-t border-blue-300 dark:border-blue-600 text-sm",onInput:e[6]||(e[6]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,fCr),[[vt,i.placeholderValues[f]]])])):ne("",!0),d.type==="options"?He((k(),R("select",{key:5,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,class:"input",onChange:e[7]||(e[7]=(...h)=>s.updatePreview&&s.updatePreview(...h))},[e[22]||(e[22]=b("option",{value:"",disabled:""},"Select an option",-1)),(k(!0),R(Ve,null,dt(d.options,h=>(k(),R("option",{key:h,value:h,class:"text-blue-900 dark:text-blue-100 bg-blue-100 dark:bg-blue-800"},ae(h),9,pCr))),128))],40,hCr)),[[$s,i.placeholderValues[f]]]):ne("",!0)]))),128))])]),b("div",TCr,[b("button",{onClick:e[8]||(e[8]=(...d)=>s.cancelPlaceholders&&s.cancelPlaceholders(...d)),class:"btn btn-secondary"},"Cancel"),b("button",{onClick:e[9]||(e[9]=(...d)=>s.applyPlaceholders&&s.applyPlaceholders(...d)),class:"btn btn-primary"},"Apply")])])])):ne("",!0),n.hasActiveDiscussion?ne("",!0):(k(),Qt(l,{key:3})),e[24]||(e[24]=b("div",{class:"h-40"},null,-1))]),e[25]||(e[25]=b("div",{class:"sticky bottom-0 left-0 right-0 h-48 pointer-events-none bg-gradient-to-t from-blue-100 to-transparent dark:from-blue-900 z-10"},null,-1))],34),n.hasActiveDiscussion?(k(),R("div",OCr,[te(c,{ref:"chatBox",loading:n.isGenerating,discussionList:n.discussionArr,"on-show-toast-message":(d,f,h)=>t.$store.state.toast.showToast(d,f,h),"on-talk":d=>t.$emit("talk-personality",d),class:"toolbar-color p-2 rounded-t-lg shadow-md",onPersonalitySelected:e[13]||(e[13]=d=>t.$emit("recover-files")),onMessageSentEvent:e[14]||(e[14]=(d,f)=>t.$emit("send-message",{message:d,type:f})),onSendCMDEvent:e[15]||(e[15]=d=>t.$emit("send-cmd",d)),onAddWebLink:e[16]||(e[16]=d=>t.$emit("add-web-link")),onCreateEmptyUserMessage:e[17]||(e[17]=d=>t.$emit("create-empty-user-message",d)),onCreateEmptyAIMessage:e[18]||(e[18]=d=>t.$emit("create-empty-ai-message")),onStopGenerating:e[19]||(e[19]=d=>t.$emit("stop-generating")),onLoaded:e[20]||(e[20]=d=>t.$emit("recover-files")),onFilesDropped:s.handleFilesDropped},null,8,["loading","discussionList","on-show-toast-message","on-talk","onFilesDropped"])])):ne("",!0)])}const gCr=st(Gwr,[["render",mCr],["__scopeId","data-v-167e65e0"]]),QCr={name:"RenderPanel",props:{showRightPanel:Boolean,htmlContent:{type:String,default:`
+`].includes(e)&&t.split(/\s+/).length>2&&this.speak()}},watch:{"message.open":{handler(t){t===!0&&!this.editMsgMode_?this.startEdit():t===!1&&this.editMsgMode_&&this.cancelEdit()},immediate:!0},editMsgMode_(t){Fe(Re.replace)},audio_url(t){Fe(()=>{t&&this.$refs.audio_player&&this.$refs.audio_player.load()})},"message.content":function(t,e){this.$store.state.config.auto_speak&&!(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode)&&!this.isSpeaking&&t!==e&&!this.editMsgMode_&&this.checkForFullSentence(),this.editMsgMode_||(this.editableContent=t)},"message.ui":function(t,e){JSON.stringify(t)!==JSON.stringify(e)&&this.ui_componentKey++},"message.metadata":{handler(){this.syncAudioUrlFromMetadata()},deep:!0},deleteMsgMode(){Fe(Re.replace)}},computed:{isUserMessage(){return this.message.sender_type===Hyr},isSystemMessage(){return this.message.sender_type===qyr},isAiMessage(){return this.message.sender_type===Vyr},editorTheme(){return this.$store.state.config.darkMode?wS:tt.baseTheme({})},editMsgMode:{get(){return this.editMsgMode_},set(t){this.editMsgMode_!==t&&(this.editMsgMode_=t,this.message&&typeof this.message=="object"&&this.message.hasOwnProperty("open")&&this.message.open!==t&&(this.message.open=t))}},activeStepIndex(){return Array.isArray(this.message.steps)?this.message.steps.findIndex(t=>!t.done):-1},isProcessingSteps(){return this.activeStepIndex!==-1},headerStepText(){return!Array.isArray(this.message.steps)||this.message.steps.length===0?this.message.status_message||"Processing Steps":this.isProcessingSteps&&this.message.steps[this.activeStepIndex]?this.message.steps[this.activeStepIndex].text||"Processing...":this.message.status_message&&this.message.status_message!=="Thinking..."?this.message.status_message:"Processing Complete"},finalStepsStatus(){if(!Array.isArray(this.message.steps)||this.isProcessingSteps||this.message.steps.length===0)return null;if(this.message.steps.find(n=>n.status===!1))return!1;const e=(this.message.status_message||"").toLowerCase();return!(e.includes("error")||e.includes("fail"))},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){try{return new Date(Date.parse(this.message.created_at)).toLocaleString()}catch{return this.message.created_at}},finished_generating_at_parsed(){try{return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()}catch{return this.message.finished_generating_at}},time_spent(){if(!(!this.message.started_generating_at||!this.message.finished_generating_at))try{const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(isNaN(t)||isNaN(e)||e<=t)return"0s";let[n,r,i]=this.computeTimeDiff(t,e);const s=a=>a<10?"0"+a:a;let o=[];return n>0&&o.push(s(n)+"h"),r>0&&o.push(s(r)+"m"),o.push(s(i)+"s"),o.join(":")}catch{return}},warmup_duration(){if(!(!this.message.created_at||!this.message.started_generating_at))try{const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(isNaN(t)||isNaN(e)||e<=t)return"0s";let[n,r,i]=this.computeTimeDiff(t,e);const s=a=>a<10?"0"+a:a;let o=[];return n>0&&o.push(s(n)+"h"),r>0&&o.push(s(r)+"m"),o.push(s(i)+"s"),o.join(":")}catch{return}},generation_rate(){if(!(!this.message.started_generating_at||!this.message.finished_generating_at||!this.message.nb_tokens||this.message.nb_tokens<=0))try{const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(isNaN(t)||isNaN(e))return;const n=e.getTime()-t.getTime();if(n<=0)return;const r=n/1e3;return Math.round(this.message.nb_tokens/r)+" t/s"}catch{return}}}},Byr={key:0,class:"message system-message text-center text-sm text-gray-600 dark:text-slate-400 py-2 px-4 my-1 rounded-md bg-gray-100 dark:bg-slate-750"},zyr=["title"],Xyr={class:"flex-shrink-0"},Fyr={class:"group/avatar"},jyr=["src","data-popover-target"],Yyr={class:"flex flex-col w-full flex-grow min-w-0"},Gyr={class:"message-header font-semibold"},Wyr=["title"],Zyr={class:"message-content overflow-x-auto w-full overflow-y-auto scrollbar space-y-2 text-left"},Kyr={key:1,class:"w-full text-left"},Jyr={key:2,class:"flex flex-col gap-2 mt-2 w-full items-start"},ebr=["src"],tbr={class:"w-5 h-5 mr-2 flex-shrink-0 flex items-center justify-center"},nbr={key:"header-spinner",class:"step-spinner"},rbr={key:"header-success",class:"step-icon-success w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},ibr={key:"header-fail",class:"step-icon-fail w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},sbr={key:"header-unknown",class:"w-4 h-4 text-gray-400 dark:text-slate-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},obr={class:"steps-status truncate pr-2 text-sm"},abr={key:0,class:"steps-content text-left"},lbr={key:1,class:"mt-2 flex flex-col w-full overflow-y-auto scrollbar items-start"},cbr={class:"message-toolbar"},ubr={key:0,class:"flex items-center gap-1"},dbr={key:1,class:"flex items-center gap-1"},fbr={key:0,class:"flex items-center gap-1"},hbr={key:1,class:"flex items-center gap-1"},pbr={key:2,class:"flex items-center gap-1"},Tbr={class:"flex items-center"},Obr={key:4,class:"flex items-center gap-1"},mbr={key:5,class:"flex items-center gap-1"},gbr=["src"],Qbr={key:0,class:"message-footer w-full mt-1"},_br={key:0,class:"footer-item"},vbr={class:"footer-value"},ybr={key:1,class:"footer-item"},bbr={class:"footer-value"},Sbr={key:2,class:"footer-item"},xbr={class:"footer-value"},Ebr={key:3,class:"footer-item"},wbr={class:"footer-value"},Cbr={key:4,class:"footer-item"},Lbr={class:"footer-value"},$br={key:5,class:"footer-item"},Abr={class:"footer-value"},kbr={key:6,class:"footer-item"},Pbr={class:"footer-value"};function Rbr(t,e,n,r,i,s){var h;const o=Xe("MarkdownRenderer"),a=Xe("MarkdownEditor"),l=Xe("JsonViewer"),c=Xe("DynamicUIRenderer"),u=Xe("Step"),d=Xe("RenderHTMLJS"),f=Xe("ToolbarButton");return s.isSystemMessage?(k(),R("div",Byr,[te(o,{ref:"mdRender",host:n.host,"markdown-text":n.message.content,"onUpdate:markdownText":e[0]||(e[0]=p=>n.message.content=p),message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"]),n.message.created_at?(k(),R("div",{key:0,class:"text-xs font-thin mt-1",title:"Created at: "+s.created_at_parsed},ae(s.created_at),9,zyr)):ne("",!0)])):(k(),R("div",{key:1,class:ye(["message group relative border-2 border-transparent rounded-lg transition-colors duration-150 ease-in-out p-3 my-1",s.isUserMessage?"bg-blue-50 dark:bg-slate-800 hover:border-blue-400 dark:hover:border-sky-500":"bg-white dark:bg-slate-900 hover:border-blue-400 dark:hover:border-sky-500"])},[b("div",{class:ye(["flex gap-3",s.isUserMessage?"flex-row-reverse":"flex-row"])},[b("div",Xyr,[b("div",Fyr,[b("img",{src:s.getImgUrl(),onError:e[1]||(e[1]=p=>s.defaultImg(p)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-cover border border-blue-300 dark:border-slate-600"},null,40,jyr)])]),b("div",Yyr,[b("div",{class:ye(["flex flex-row flex-grow items-start mb-1",s.isUserMessage?"justify-end":""])},[b("div",{class:ye(["flex flex-col",s.isUserMessage?"items-end":"items-start"])},[b("div",Gyr,ae(s.getSenderDisplayName()),1),n.message.created_at?(k(),R("div",{key:0,class:"text-xs text-blue-500 dark:text-slate-400 font-thin",title:"Created at: "+s.created_at_parsed},ae(s.created_at),9,Wyr)):ne("",!0)],2)],2),b("div",Zyr,[s.editMsgMode?ne("",!0):(k(),Qt(o,{key:0,ref:"mdRender",host:n.host,"markdown-text":n.message.content,"onUpdate:markdownText":e[2]||(e[2]=p=>n.message.content=p),message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),s.editMsgMode?(k(),R("div",Kyr,[te(a,{ref:"markdownEditor",modelValue:i.editableContent,"onUpdate:modelValue":e[3]||(e[3]=p=>i.editableContent=p),theme:s.editorTheme,"editor-class":"min-h-[150px] max-h-[70vh] message-editor-content","toolbar-class":"md-editor-toolbar-theme","button-class":"md-editor-button-theme","toolbar-button-icon-size":16},null,8,["modelValue","theme"])])):ne("",!0),n.message.metadata!==null&&!s.editMsgMode?(k(),R("div",Jyr,[(k(!0),R(Ve,null,dt(((h=n.message.metadata)==null?void 0:h.filter(p=>(p==null?void 0:p.title)&&(p==null?void 0:p.content)))||[],(p,T)=>(k(),R("div",{key:"json-"+n.message.id+"-"+T,class:"max-w-full"},[(k(),Qt(l,{title:p.title,data:p.content,key:"msgjson-"+n.message.id},null,8,["title","data"]))]))),128))])):ne("",!0),n.message.ui&&!s.editMsgMode?(k(),Qt(c,{ref:"ui",class:"w-full mt-2",ui:n.message.ui,key:"msgui-"+n.message.id+"-"+i.ui_componentKey},null,8,["ui"])):ne("",!0),i.audio_url!=null&&!s.editMsgMode?(k(),R("audio",{controls:"",class:"w-full mt-2",key:i.audio_url},[b("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,ebr),e[15]||(e[15]=Se(" Your browser does not support the audio element. "))])):ne("",!0),b("div",{class:ye(["message-details w-full mt-2",{"flex flex-col items-end":s.isUserMessage}])},[n.message.steps&&n.message.steps.length>0&&!s.editMsgMode?(k(),R("div",{key:0,class:ye(["steps-container w-full max-w-4xl",s.isUserMessage?"ml-auto":"mr-auto"])},[b("div",{class:"steps-header",onClick:e[4]||(e[4]=(...p)=>s.toggleExpanded&&s.toggleExpanded(...p))},[b("div",tbr,[te(cr,{name:"fade-icon",mode:"out-in"},{default:Ie(()=>[s.isProcessingSteps?(k(),R("div",nbr)):s.finalStepsStatus===!0?(k(),R("svg",rbr,e[16]||(e[16]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)]))):s.finalStepsStatus===!1?(k(),R("svg",ibr,e[17]||(e[17]=[b("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1)]))):(k(),R("svg",sbr,e[18]||(e[18]=[b("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"},null,-1)])))]),_:1})]),b("span",obr,ae(s.headerStepText),1),b("span",{class:ye(["toggle-icon text-xs transform transition-transform duration-200 ml-auto",{"rotate-180":i.expanded}])},e[19]||(e[19]=[b("i",{"data-feather":"chevron-down",class:"w-5 h-5"},null,-1)]),2)]),te(cr,{"enter-active-class":"transition-all duration-300 ease-out overflow-hidden","leave-active-class":"transition-all duration-200 ease-in overflow-hidden","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[500px]","leave-from-class":"opacity-100 max-h-[500px]","leave-to-class":"opacity-0 max-h-0"},{default:Ie(()=>[i.expanded?(k(),R("div",abr,[(k(!0),R(Ve,null,dt(n.message.steps,(p,T)=>(k(),R("div",{key:`step-${n.message.id}-${T}`,class:"step-item animate-step-slide-in",style:qn({animationDelay:`${T*80}ms`})},[te(u,{done:p.done,text:p.text,status:p.status,description:p.description},null,8,["done","text","status","description"])],4))),128))])):ne("",!0)]),_:1})],2)):ne("",!0),n.message.html_js_s&&n.message.html_js_s.length&&!s.editMsgMode?(k(),R("div",lbr,[(k(!0),R(Ve,null,dt(n.message.html_js_s,(p,T)=>(k(),R("div",{key:`htmljs-${n.message.id}-${T}`,class:"w-full animate-fadeIn",style:qn({animationDelay:`${T*200}ms`})},[te(d,{htmlContent:p},null,8,["htmlContent"])],4))),128))])):ne("",!0)],2)]),b("div",{class:ye(["message-toolbar-wrapper flex w-full mt-1",[s.isUserMessage?"justify-end":"justify-start"]])},[b("div",cbr,[s.editMsgMode?(k(),R("div",ubr,[te(f,{onClick:oe(s.cancelEdit,["stop"]),title:"Cancel edit",icon:"x",class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"},null,8,["onClick"]),te(f,{onClick:oe(s.updateMessage,["stop"]),title:"Update message",icon:"check",class:"svg-button text-green-500 hover:bg-green-100 dark:hover:bg-green-900"},null,8,["onClick"])])):(k(),R("div",dbr,[te(f,{onClick:oe(s.startEdit,["stop"]),title:"Edit message",icon:"edit",class:"svg-button toolbar-button"},null,8,["onClick"]),te(f,{onClick:s.copyContentToClipboard,title:"Copy message to clipboard",icon:"copy",class:"svg-button toolbar-button"},null,8,["onClick"]),s.isUserMessage?(k(),R("div",fbr,[te(f,{onClick:e[5]||(e[5]=oe(p=>s.resendMessage("full_context"),["stop"])),title:"Resend message with full context",icon:"send",class:"svg-button toolbar-button"}),te(f,{onClick:e[6]||(e[6]=oe(p=>s.resendMessage("full_context_with_internet"),["stop"])),title:"Resend message with internet search",icon:"globe",class:"svg-button toolbar-button"}),te(f,{onClick:e[7]||(e[7]=oe(p=>s.resendMessage("simple_question"),["stop"])),title:"Resend message without context",icon:"refresh-cw",class:"svg-button toolbar-button"})])):ne("",!0),s.isAiMessage?(k(),R("div",hbr,[te(f,{onClick:oe(s.continueMessage,["stop"]),title:"Continue message",icon:"fast-forward",class:"svg-button toolbar-button"},null,8,["onClick"])])):ne("",!0),i.deleteMsgMode?(k(),R("div",pbr,[te(f,{onClick:e[8]||(e[8]=oe(p=>i.deleteMsgMode=!1,["stop"])),title:"Cancel removal",icon:"x",class:"svg-button toolbar-button text-blue-500 hover:bg-blue-100 dark:hover:bg-blue-700"}),te(f,{onClick:e[9]||(e[9]=oe(p=>s.deleteMsg(),["stop"])),title:"Confirm removal",icon:"check",class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"})])):(k(),Qt(f,{key:3,title:"Remove message",icon:"trash",onClick:e[10]||(e[10]=p=>i.deleteMsgMode=!0),class:"svg-button text-red-500 hover:bg-red-100 dark:hover:bg-red-900"})),te(f,{onClick:e[11]||(e[11]=oe(p=>s.rankUp(),["stop"])),title:"Upvote",icon:"thumbs-up",class:"svg-button toolbar-button text-blue-500 dark:text-blue-400"}),b("div",Tbr,[te(f,{onClick:e[12]||(e[12]=oe(p=>s.rankDown(),["stop"])),title:"Downvote",icon:"thumbs-down",class:"svg-button text-red-500 dark:text-red-400"}),n.message.rank!=0?(k(),R("div",{key:0,class:ye(["text-xs font-bold rounded-full px-1.5 py-0.5 flex items-center justify-center cursor-default ml-0.5",n.message.rank>0?"bg-blue-500 text-white":"bg-red-500 text-white"]),title:"Rank"},ae(n.message.rank),3)):ne("",!0)]),this.$store.state.config.active_tts_service!="None"?(k(),R("div",Obr,[te(f,{title:"Speak message",icon:"volume-2",onClick:e[13]||(e[13]=oe(p=>s.speak(),["stop"])),class:ye(["svg-button toolbar-button",{"text-red-500 dark:text-red-400 animate-pulse":i.isSpeaking}])},null,8,["class"])])):ne("",!0),!s.isUserMessage&&this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(k(),R("div",mbr,[i.isSynthesizingVoice?(k(),R("img",{key:1,src:i.loading_svg,class:"w-5 h-5 animate-spin text-blue-500 dark:text-sky-400"},null,8,gbr)):(k(),Qt(f,{key:0,title:"Generate audio",icon:"mic",onClick:e[14]||(e[14]=oe(p=>s.read(),["stop"])),class:"svg-button toolbar-button"}))])):ne("",!0)]))])],2),s.isUserMessage?ne("",!0):(k(),R("div",Qbr,[b("div",{class:ye(["flex flex-row flex-wrap items-center gap-x-3 gap-y-1",[s.isUserMessage?"justify-end":"justify-start"]])},[n.message.binding?(k(),R("p",_br,[e[20]||(e[20]=Se("Binding: ")),b("span",vbr,ae(n.message.binding),1)])):ne("",!0),n.message.model?(k(),R("p",ybr,[e[21]||(e[21]=Se("Model: ")),b("span",bbr,ae(n.message.model),1)])):ne("",!0),n.message.seed?(k(),R("p",Sbr,[e[22]||(e[22]=Se("Seed: ")),b("span",xbr,ae(n.message.seed),1)])):ne("",!0),n.message.nb_tokens?(k(),R("p",Ebr,[e[23]||(e[23]=Se("Tokens: ")),b("span",wbr,ae(n.message.nb_tokens),1)])):ne("",!0),s.warmup_duration?(k(),R("p",Cbr,[e[24]||(e[24]=Se("Warmup: ")),b("span",Lbr,ae(s.warmup_duration),1)])):ne("",!0),s.time_spent?(k(),R("p",$br,[e[25]||(e[25]=Se("Gen time: ")),b("span",Abr,ae(s.time_spent),1)])):ne("",!0),s.generation_rate?(k(),R("p",kbr,[e[26]||(e[26]=Se("Rate: ")),b("span",Pbr,ae(s.generation_rate),1)])):ne("",!0)],2)]))])],2)],2))}const Mbr=st(Uyr,[["render",Rbr],["__scopeId","data-v-1cfbb6ba"]]),Dbr={name:"CommandMenu",props:{commandsList:{type:Array,required:!0,default:()=>[]},sendCommand:{type:Function,required:!0},showSettings:{type:Function,default:void 0},help:{type:String,default:"Select Command"},icon:{type:String,default:"feather:tool"},buttonLabel:{type:String,default:""}},data(){return{loading:!1,showMenu:!1,menuPosition:"below",searchTerm:"",recentlyClicked:null,clickTimeout:null}},computed:{isAnyCommandChecked(){return this.commandsList.some(t=>t.is_checked)},iconParts(){return this.parseIconString(this.icon)},filteredCommandsList(){if(!this.searchTerm)return this.commandsList;const t=this.searchTerm.toLowerCase(),e=n=>{const r=document.createElement("DIV");return r.innerHTML=n,r.textContent||r.innerText||""};return this.commandsList.filter(n=>e(n.name).toLowerCase().includes(t))}},methods:{parseIconString(t){if(!t)return{type:null,value:null};const e=t.split(":"),n=e[0],r=e.slice(1).join(":");return["feather","img","b64"].includes(n)?{type:n,value:r}:{type:"feather",value:t}},cmdIconType(t){return this.parseIconString(t).type},cmdIconValue(t){return this.parseIconString(t).value},handleSelect(t){t.is_checked!==void 0&&(t.is_checked=!t.is_checked),this.sendCommand(t.value),this.recentlyClicked=t.value,this.closeMenu(),this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=setTimeout(()=>{this.recentlyClicked=null},300)},handleShowSettings(t){this.showSettings&&typeof this.showSettings=="function"&&(this.showSettings(t),this.closeMenu())},toggleMenu(){this.showMenu=!this.showMenu,this.showMenu&&(this.searchTerm="",this.$nextTick(()=>{var t;this.calculatePosition(),this.replaceFeatherIcons(),(t=this.$refs.searchInput)==null||t.focus()}))},closeMenu(){this.showMenu=!1,this.searchTerm=""},calculatePosition(){!this.$refs.menuContainer||!this.showMenu||this.$nextTick(()=>{if(!this.$refs.menu)return;const t=this.$refs.menuContainer.getBoundingClientRect(),e=Math.min(this.$refs.menu.scrollHeight,480),n=window.innerHeight-t.bottom,r=t.top,i=10;this.menuPosition=nn?"above":"below"})},handleClickOutside(t){this.$refs.menuContainer&&!this.$refs.menuContainer.contains(t.target)&&this.closeMenu()},replaceFeatherIcons(){this.$nextTick(()=>{Re.replace({width:"1em",height:"1em","stroke-width":2})})},highlightMatch(t){if(!this.searchTerm)return t;const e=(()=>{const c=document.createElement("div");return c.innerHTML=t,c.textContent||c.innerText||""})(),n=e.toLowerCase(),r=this.searchTerm.toLowerCase(),i=n.indexOf(r);if(i===-1)return t;const s=e.substring(0,i),o=e.substring(i,i+this.searchTerm.length),a=e.substring(i+this.searchTerm.length),l=c=>c.replace(/&/g,"&").replace(//g,">").replace(/"/g,'"').replace(/'/g,"'");return`${l(s)}${l(o)} ${l(a)}`}},watch:{filteredCommandsList(){this.showMenu&&this.$nextTick(()=>{this.calculatePosition(),this.replaceFeatherIcons()})},searchTerm(){this.showMenu&&(this.replaceFeatherIcons(),this.$nextTick(()=>this.calculatePosition()))},showMenu(t){t&&this.$nextTick(()=>this.calculatePosition())}},mounted(){document.addEventListener("click",this.handleClickOutside,!0),window.addEventListener("resize",this.calculatePosition),this.replaceFeatherIcons()},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside,!0),window.removeEventListener("resize",this.calculatePosition),this.clickTimeout&&clearTimeout(this.clickTimeout)}},Nbr={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},Ibr={key:1,class:"relative",ref:"menuContainer"},Hbr=["title"],Vbr=["data-feather"],qbr=["src"],Ubr=["src"],Bbr={key:0,class:"p-2 sticky top-0 bg-white dark:bg-gray-800 z-10 border-b border-gray-200 dark:border-gray-700 flex-shrink-0"},zbr={class:"custom-scrollbar overflow-y-auto flex-grow"},Xbr={class:"divide-y divide-gray-100 dark:divide-gray-700 px-1 py-1"},Fbr=["title","onClick"],jbr={key:0,class:"mr-3 flex-shrink-0 relative h-4 w-4"},Ybr=["checked","id"],Gbr=["for"],Wbr={key:0,class:"h-3 w-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Zbr={key:1,class:"mr-2 flex-shrink-0 w-4 h-4"},Kbr=["data-feather"],Jbr=["src"],eSr=["src"],tSr=["innerHTML"],nSr=["onClick"];function rSr(t,e,n,r,i,s){return i.loading?(k(),R("div",Nbr,e[3]||(e[3]=[b("svg",{class:"animate-spin h-5 w-5 text-blue-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[b("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),b("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)]))):(k(),R("div",Ibr,[b("button",{onClick:e[0]||(e[0]=(...o)=>s.toggleMenu&&s.toggleMenu(...o)),class:ye(["flex items-center gap-2 px-4 py-2 text-white rounded-lg transition-all duration-300 shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-400 dark:focus:ring-offset-gray-900",{"bg-blue-600 hover:bg-blue-700":!s.isAnyCommandChecked,"bg-yellow-400 hover:bg-yellow-500 text-gray-800":s.isAnyCommandChecked}]),title:n.help},[n.icon?(k(),R(Ve,{key:0},[s.iconParts.type==="feather"?(k(),R("i",{key:0,"data-feather":s.iconParts.value,class:"w-4 h-4"},null,8,Vbr)):s.iconParts.type==="img"?(k(),R("img",{key:1,src:s.iconParts.value,class:"w-4 h-4",alt:"Icon"},null,8,qbr)):s.iconParts.type==="b64"?(k(),R("img",{key:2,src:"data:image/png;base64,"+s.iconParts.value,class:"w-4 h-4",alt:"Icon"},null,8,Ubr)):ne("",!0)],64)):ne("",!0),b("span",null,ae(n.buttonLabel),1),(k(),R("svg",{class:ye(["w-4 h-4 transform transition-transform duration-200",{"rotate-180":i.showMenu}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[4]||(e[4]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))],10,Hbr),te(cr,{"enter-active-class":"transition-opacity duration-200 ease-out","leave-active-class":"transition-opacity duration-150 ease-in","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:Ie(()=>[i.showMenu?(k(),R("div",{key:0,ref:"menu",class:ye(["absolute z-50 mt-2 w-80 origin-top-right rounded-lg bg-white dark:bg-gray-800 shadow-xl ring-1 ring-black ring-opacity-5 focus:outline-none flex flex-col overflow-hidden",i.menuPosition==="above"?"bottom-full mb-2":"top-full"]),style:{"max-height":"calc(28rem + 3rem)"}},[n.commandsList.length>10?(k(),R("div",Bbr,[He(b("input",{ref:"searchInput",type:"search","onUpdate:modelValue":e[1]||(e[1]=o=>i.searchTerm=o),placeholder:"Search commands...",class:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 dark:bg-gray-700 dark:text-gray-200",onClick:e[2]||(e[2]=oe(()=>{},["stop"]))},null,512),[[vt,i.searchTerm]])])):ne("",!0),b("div",zbr,[b("ul",Xbr,[(k(!0),R(Ve,null,dt(s.filteredCommandsList,o=>(k(),R("li",{key:o.value||o.name,class:ye(["group flex items-center justify-between w-full text-sm rounded-md hover:bg-blue-50 dark:hover:bg-gray-700 transition-colors duration-150",{"bg-blue-50 dark:bg-gray-700":o.value===i.recentlyClicked}])},[b("button",{title:o.help,onClick:a=>s.handleSelect(o),class:"flex items-center flex-1 min-w-0 px-3 py-2 text-gray-700 dark:text-gray-200 group-hover:text-blue-700 dark:group-hover:text-blue-300"},[o.is_checked!==void 0?(k(),R("span",jbr,[b("input",{type:"checkbox",checked:o.is_checked,class:"opacity-0 absolute h-full w-full cursor-pointer",id:`checkbox-${o.value||o.name}`,tabindex:"-1"},null,8,Ybr),b("label",{for:`checkbox-${o.value||o.name}`,class:ye(["flex items-center justify-center h-4 w-4 border-2 border-gray-400 dark:border-gray-500 rounded-sm cursor-pointer transition-all duration-200 group-hover:border-blue-500",{"bg-blue-500 border-blue-500 dark:border-blue-400 dark:bg-blue-400":o.is_checked}])},[o.is_checked?(k(),R("svg",Wbr,e[5]||(e[5]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)]))):ne("",!0)],10,Gbr)])):ne("",!0),o.icon?(k(),R("span",Zbr,[s.cmdIconType(o.icon)==="feather"?(k(),R("i",{key:0,"data-feather":s.cmdIconValue(o.icon),class:"w-full h-full"},null,8,Kbr)):s.cmdIconType(o.icon)==="img"?(k(),R("img",{key:1,src:s.cmdIconValue(o.icon),class:"w-full h-full object-contain",alt:""},null,8,Jbr)):s.cmdIconType(o.icon)==="b64"?(k(),R("img",{key:2,src:`data:image/png;base64,${s.cmdIconValue(o.icon)}`,class:"w-full h-full object-contain",alt:""},null,8,eSr)):ne("",!0)])):ne("",!0),b("span",{innerHTML:s.highlightMatch(o.name),class:"truncate flex-1 text-left"},null,8,tSr)],8,Fbr),n.showSettings&&typeof n.showSettings=="function"?(k(),R("button",{key:0,onClick:oe(a=>s.handleShowSettings(o),["stop"]),class:"text-gray-400 hover:text-green-600 dark:hover:text-green-400 transition duration-150 flex-shrink-0 p-2 mr-1 focus:outline-none opacity-0 group-hover:opacity-100",title:"Settings",tabindex:"-1"},e[6]||(e[6]=[b("i",{"data-feather":"settings",class:"h-4 w-4"},null,-1)]),8,nSr)):ne("",!0)],2))),128))])])],2)):ne("",!0)]),_:1})],512))}const iSr=st(Dbr,[["render",rSr],["__scopeId","data-v-4e649fe6"]]),qoe="https://cdn.jsdelivr.net/npm/emoji-datasource-apple@6.0.1/img/apple/64",Uoe={recent:"Recently used",smileys_people:"Smiles & People",animals_nature:"Animals & Nature",food_drink:"Food & Drink",activities:"Activities",travel_places:"Travel places",objects:"Objects",symbols:"Symbols",flags:"Flags"},Boe="u",lT="n",G8="v",Yf="r",sSr={[lT]:["grinning face","grinning"],[Boe]:"1f600",[Yf]:"1f600"},j9="neutral",oSr="1f3fb",aSr="1f3fc",lSr="1f3fd",cSr="1f3fe",uSr="1f3ff",dSr=[j9,oSr,aSr,lSr,cSr,uSr],fSr={placeholder:"Search emoji",skinTone:"Skin tone"},hSr=["light","dark","auto"],pSr=[{n:["grinning face","grinning"],u:"1f600"},{n:["grinning face with smiling eyes","grin"],u:"1f601"},{n:["face with tears of joy","joy"],u:"1f602"},{n:["rolling on the floor laughing","rolling_on_the_floor_laughing"],u:"1f923"},{n:["smiling face with open mouth","smiley"],u:"1f603"},{n:["smiling face with open mouth and smiling eyes","smile"],u:"1f604"},{n:["smiling face with open mouth and cold sweat","sweat_smile"],u:"1f605"},{n:["smiling face with open mouth and tightly-closed eyes","laughing","satisfied"],u:"1f606"},{n:["winking face","wink"],u:"1f609"},{n:["smiling face with smiling eyes","blush"],u:"1f60a"},{n:["face savouring delicious food","yum"],u:"1f60b"},{n:["smiling face with sunglasses","sunglasses"],u:"1f60e"},{n:["smiling face with heart-shaped eyes","heart_eyes"],u:"1f60d"},{n:["face throwing a kiss","kissing_heart"],u:"1f618"},{n:["kissing face","kissing"],u:"1f617"},{n:["kissing face with smiling eyes","kissing_smiling_eyes"],u:"1f619"},{n:["kissing face with closed eyes","kissing_closed_eyes"],u:"1f61a"},{n:["white smiling face","relaxed"],u:"263a-fe0f"},{n:["slightly smiling face","slightly_smiling_face"],u:"1f642"},{n:["hugging face","hugging_face"],u:"1f917"},{n:["grinning face with star eyes","star-struck","grinning_face_with_star_eyes"],u:"1f929"},{n:["thinking face","thinking_face"],u:"1f914"},{n:["face with one eyebrow raised","face_with_raised_eyebrow","face_with_one_eyebrow_raised"],u:"1f928"},{n:["neutral face","neutral_face"],u:"1f610"},{n:["expressionless face","expressionless"],u:"1f611"},{n:["face without mouth","no_mouth"],u:"1f636"},{n:["face with rolling eyes","face_with_rolling_eyes"],u:"1f644"},{n:["smirking face","smirk"],u:"1f60f"},{n:["persevering face","persevere"],u:"1f623"},{n:["disappointed but relieved face","disappointed_relieved"],u:"1f625"},{n:["face with open mouth","open_mouth"],u:"1f62e"},{n:["zipper-mouth face","zipper_mouth_face"],u:"1f910"},{n:["hushed face","hushed"],u:"1f62f"},{n:["sleepy face","sleepy"],u:"1f62a"},{n:["tired face","tired_face"],u:"1f62b"},{n:["sleeping face","sleeping"],u:"1f634"},{n:["relieved face","relieved"],u:"1f60c"},{n:["face with stuck-out tongue","stuck_out_tongue"],u:"1f61b"},{n:["face with stuck-out tongue and winking eye","stuck_out_tongue_winking_eye"],u:"1f61c"},{n:["face with stuck-out tongue and tightly-closed eyes","stuck_out_tongue_closed_eyes"],u:"1f61d"},{n:["drooling face","drooling_face"],u:"1f924"},{n:["unamused face","unamused"],u:"1f612"},{n:["face with cold sweat","sweat"],u:"1f613"},{n:["pensive face","pensive"],u:"1f614"},{n:["confused face","confused"],u:"1f615"},{n:["upside-down face","upside_down_face"],u:"1f643"},{n:["money-mouth face","money_mouth_face"],u:"1f911"},{n:["astonished face","astonished"],u:"1f632"},{n:["white_frowning_face"],u:"2639-fe0f"},{n:["slightly frowning face","slightly_frowning_face"],u:"1f641"},{n:["confounded face","confounded"],u:"1f616"},{n:["disappointed face","disappointed"],u:"1f61e"},{n:["worried face","worried"],u:"1f61f"},{n:["face with look of triumph","triumph"],u:"1f624"},{n:["crying face","cry"],u:"1f622"},{n:["loudly crying face","sob"],u:"1f62d"},{n:["frowning face with open mouth","frowning"],u:"1f626"},{n:["anguished face","anguished"],u:"1f627"},{n:["fearful face","fearful"],u:"1f628"},{n:["weary face","weary"],u:"1f629"},{n:["shocked face with exploding head","exploding_head","shocked_face_with_exploding_head"],u:"1f92f"},{n:["grimacing face","grimacing"],u:"1f62c"},{n:["face with open mouth and cold sweat","cold_sweat"],u:"1f630"},{n:["face screaming in fear","scream"],u:"1f631"},{n:["flushed face","flushed"],u:"1f633"},{n:["grinning face with one large and one small eye","zany_face","grinning_face_with_one_large_and_one_small_eye"],u:"1f92a"},{n:["dizzy face","dizzy_face"],u:"1f635"},{n:["pouting face","rage"],u:"1f621"},{n:["angry face","angry"],u:"1f620"},{n:["serious face with symbols covering mouth","face_with_symbols_on_mouth","serious_face_with_symbols_covering_mouth"],u:"1f92c"},{n:["face with medical mask","mask"],u:"1f637"},{n:["face with thermometer","face_with_thermometer"],u:"1f912"},{n:["face with head-bandage","face_with_head_bandage"],u:"1f915"},{n:["nauseated face","nauseated_face"],u:"1f922"},{n:["face with open mouth vomiting","face_vomiting","face_with_open_mouth_vomiting"],u:"1f92e"},{n:["sneezing face","sneezing_face"],u:"1f927"},{n:["smiling face with halo","innocent"],u:"1f607"},{n:["face with cowboy hat","face_with_cowboy_hat"],u:"1f920"},{n:["clown face","clown_face"],u:"1f921"},{n:["lying face","lying_face"],u:"1f925"},{n:["face with finger covering closed lips","shushing_face","face_with_finger_covering_closed_lips"],u:"1f92b"},{n:["smiling face with smiling eyes and hand covering mouth","face_with_hand_over_mouth","smiling_face_with_smiling_eyes_and_hand_covering_mouth"],u:"1f92d"},{n:["face with monocle","face_with_monocle"],u:"1f9d0"},{n:["nerd face","nerd_face"],u:"1f913"},{n:["smiling face with horns","smiling_imp"],u:"1f608"},{n:["imp"],u:"1f47f"},{n:["japanese ogre","japanese_ogre"],u:"1f479"},{n:["japanese goblin","japanese_goblin"],u:"1f47a"},{n:["skull"],u:"1f480"},{n:["skull_and_crossbones"],u:"2620-fe0f"},{n:["ghost"],u:"1f47b"},{n:["extraterrestrial alien","alien"],u:"1f47d"},{n:["alien monster","space_invader"],u:"1f47e"},{n:["robot face","robot_face"],u:"1f916"},{n:["pile of poo","hankey","poop","shit"],u:"1f4a9"},{n:["smiling cat face with open mouth","smiley_cat"],u:"1f63a"},{n:["grinning cat face with smiling eyes","smile_cat"],u:"1f638"},{n:["cat face with tears of joy","joy_cat"],u:"1f639"},{n:["smiling cat face with heart-shaped eyes","heart_eyes_cat"],u:"1f63b"},{n:["cat face with wry smile","smirk_cat"],u:"1f63c"},{n:["kissing cat face with closed eyes","kissing_cat"],u:"1f63d"},{n:["weary cat face","scream_cat"],u:"1f640"},{n:["crying cat face","crying_cat_face"],u:"1f63f"},{n:["pouting cat face","pouting_cat"],u:"1f63e"},{n:["see-no-evil monkey","see_no_evil"],u:"1f648"},{n:["hear-no-evil monkey","hear_no_evil"],u:"1f649"},{n:["speak-no-evil monkey","speak_no_evil"],u:"1f64a"},{n:["baby"],u:"1f476",v:["1f476-1f3fb","1f476-1f3fc","1f476-1f3fd","1f476-1f3fe","1f476-1f3ff"]},{n:["child"],u:"1f9d2",v:["1f9d2-1f3fb","1f9d2-1f3fc","1f9d2-1f3fd","1f9d2-1f3fe","1f9d2-1f3ff"]},{n:["boy"],u:"1f466",v:["1f466-1f3fb","1f466-1f3fc","1f466-1f3fd","1f466-1f3fe","1f466-1f3ff"]},{n:["girl"],u:"1f467",v:["1f467-1f3fb","1f467-1f3fc","1f467-1f3fd","1f467-1f3fe","1f467-1f3ff"]},{n:["adult"],u:"1f9d1",v:["1f9d1-1f3fb","1f9d1-1f3fc","1f9d1-1f3fd","1f9d1-1f3fe","1f9d1-1f3ff"]},{n:["man"],u:"1f468",v:["1f468-1f3fb","1f468-1f3fc","1f468-1f3fd","1f468-1f3fe","1f468-1f3ff"]},{n:["woman"],u:"1f469",v:["1f469-1f3fb","1f469-1f3fc","1f469-1f3fd","1f469-1f3fe","1f469-1f3ff"]},{n:["older adult","older_adult"],u:"1f9d3",v:["1f9d3-1f3fb","1f9d3-1f3fc","1f9d3-1f3fd","1f9d3-1f3fe","1f9d3-1f3ff"]},{n:["older man","older_man"],u:"1f474",v:["1f474-1f3fb","1f474-1f3fc","1f474-1f3fd","1f474-1f3fe","1f474-1f3ff"]},{n:["older woman","older_woman"],u:"1f475",v:["1f475-1f3fb","1f475-1f3fc","1f475-1f3fd","1f475-1f3fe","1f475-1f3ff"]},{n:["male-doctor"],u:"1f468-200d-2695-fe0f",v:["1f468-1f3fb-200d-2695-fe0f","1f468-1f3fc-200d-2695-fe0f","1f468-1f3fd-200d-2695-fe0f","1f468-1f3fe-200d-2695-fe0f","1f468-1f3ff-200d-2695-fe0f"]},{n:["female-doctor"],u:"1f469-200d-2695-fe0f",v:["1f469-1f3fb-200d-2695-fe0f","1f469-1f3fc-200d-2695-fe0f","1f469-1f3fd-200d-2695-fe0f","1f469-1f3fe-200d-2695-fe0f","1f469-1f3ff-200d-2695-fe0f"]},{n:["male-student"],u:"1f468-200d-1f393",v:["1f468-1f3fb-200d-1f393","1f468-1f3fc-200d-1f393","1f468-1f3fd-200d-1f393","1f468-1f3fe-200d-1f393","1f468-1f3ff-200d-1f393"]},{n:["female-student"],u:"1f469-200d-1f393",v:["1f469-1f3fb-200d-1f393","1f469-1f3fc-200d-1f393","1f469-1f3fd-200d-1f393","1f469-1f3fe-200d-1f393","1f469-1f3ff-200d-1f393"]},{n:["male-teacher"],u:"1f468-200d-1f3eb",v:["1f468-1f3fb-200d-1f3eb","1f468-1f3fc-200d-1f3eb","1f468-1f3fd-200d-1f3eb","1f468-1f3fe-200d-1f3eb","1f468-1f3ff-200d-1f3eb"]},{n:["female-teacher"],u:"1f469-200d-1f3eb",v:["1f469-1f3fb-200d-1f3eb","1f469-1f3fc-200d-1f3eb","1f469-1f3fd-200d-1f3eb","1f469-1f3fe-200d-1f3eb","1f469-1f3ff-200d-1f3eb"]},{n:["male-judge"],u:"1f468-200d-2696-fe0f",v:["1f468-1f3fb-200d-2696-fe0f","1f468-1f3fc-200d-2696-fe0f","1f468-1f3fd-200d-2696-fe0f","1f468-1f3fe-200d-2696-fe0f","1f468-1f3ff-200d-2696-fe0f"]},{n:["female-judge"],u:"1f469-200d-2696-fe0f",v:["1f469-1f3fb-200d-2696-fe0f","1f469-1f3fc-200d-2696-fe0f","1f469-1f3fd-200d-2696-fe0f","1f469-1f3fe-200d-2696-fe0f","1f469-1f3ff-200d-2696-fe0f"]},{n:["male-farmer"],u:"1f468-200d-1f33e",v:["1f468-1f3fb-200d-1f33e","1f468-1f3fc-200d-1f33e","1f468-1f3fd-200d-1f33e","1f468-1f3fe-200d-1f33e","1f468-1f3ff-200d-1f33e"]},{n:["female-farmer"],u:"1f469-200d-1f33e",v:["1f469-1f3fb-200d-1f33e","1f469-1f3fc-200d-1f33e","1f469-1f3fd-200d-1f33e","1f469-1f3fe-200d-1f33e","1f469-1f3ff-200d-1f33e"]},{n:["male-cook"],u:"1f468-200d-1f373",v:["1f468-1f3fb-200d-1f373","1f468-1f3fc-200d-1f373","1f468-1f3fd-200d-1f373","1f468-1f3fe-200d-1f373","1f468-1f3ff-200d-1f373"]},{n:["female-cook"],u:"1f469-200d-1f373",v:["1f469-1f3fb-200d-1f373","1f469-1f3fc-200d-1f373","1f469-1f3fd-200d-1f373","1f469-1f3fe-200d-1f373","1f469-1f3ff-200d-1f373"]},{n:["male-mechanic"],u:"1f468-200d-1f527",v:["1f468-1f3fb-200d-1f527","1f468-1f3fc-200d-1f527","1f468-1f3fd-200d-1f527","1f468-1f3fe-200d-1f527","1f468-1f3ff-200d-1f527"]},{n:["female-mechanic"],u:"1f469-200d-1f527",v:["1f469-1f3fb-200d-1f527","1f469-1f3fc-200d-1f527","1f469-1f3fd-200d-1f527","1f469-1f3fe-200d-1f527","1f469-1f3ff-200d-1f527"]},{n:["male-factory-worker"],u:"1f468-200d-1f3ed",v:["1f468-1f3fb-200d-1f3ed","1f468-1f3fc-200d-1f3ed","1f468-1f3fd-200d-1f3ed","1f468-1f3fe-200d-1f3ed","1f468-1f3ff-200d-1f3ed"]},{n:["female-factory-worker"],u:"1f469-200d-1f3ed",v:["1f469-1f3fb-200d-1f3ed","1f469-1f3fc-200d-1f3ed","1f469-1f3fd-200d-1f3ed","1f469-1f3fe-200d-1f3ed","1f469-1f3ff-200d-1f3ed"]},{n:["male-office-worker"],u:"1f468-200d-1f4bc",v:["1f468-1f3fb-200d-1f4bc","1f468-1f3fc-200d-1f4bc","1f468-1f3fd-200d-1f4bc","1f468-1f3fe-200d-1f4bc","1f468-1f3ff-200d-1f4bc"]},{n:["female-office-worker"],u:"1f469-200d-1f4bc",v:["1f469-1f3fb-200d-1f4bc","1f469-1f3fc-200d-1f4bc","1f469-1f3fd-200d-1f4bc","1f469-1f3fe-200d-1f4bc","1f469-1f3ff-200d-1f4bc"]},{n:["male-scientist"],u:"1f468-200d-1f52c",v:["1f468-1f3fb-200d-1f52c","1f468-1f3fc-200d-1f52c","1f468-1f3fd-200d-1f52c","1f468-1f3fe-200d-1f52c","1f468-1f3ff-200d-1f52c"]},{n:["female-scientist"],u:"1f469-200d-1f52c",v:["1f469-1f3fb-200d-1f52c","1f469-1f3fc-200d-1f52c","1f469-1f3fd-200d-1f52c","1f469-1f3fe-200d-1f52c","1f469-1f3ff-200d-1f52c"]},{n:["male-technologist"],u:"1f468-200d-1f4bb",v:["1f468-1f3fb-200d-1f4bb","1f468-1f3fc-200d-1f4bb","1f468-1f3fd-200d-1f4bb","1f468-1f3fe-200d-1f4bb","1f468-1f3ff-200d-1f4bb"]},{n:["female-technologist"],u:"1f469-200d-1f4bb",v:["1f469-1f3fb-200d-1f4bb","1f469-1f3fc-200d-1f4bb","1f469-1f3fd-200d-1f4bb","1f469-1f3fe-200d-1f4bb","1f469-1f3ff-200d-1f4bb"]},{n:["male-singer"],u:"1f468-200d-1f3a4",v:["1f468-1f3fb-200d-1f3a4","1f468-1f3fc-200d-1f3a4","1f468-1f3fd-200d-1f3a4","1f468-1f3fe-200d-1f3a4","1f468-1f3ff-200d-1f3a4"]},{n:["female-singer"],u:"1f469-200d-1f3a4",v:["1f469-1f3fb-200d-1f3a4","1f469-1f3fc-200d-1f3a4","1f469-1f3fd-200d-1f3a4","1f469-1f3fe-200d-1f3a4","1f469-1f3ff-200d-1f3a4"]},{n:["male-artist"],u:"1f468-200d-1f3a8",v:["1f468-1f3fb-200d-1f3a8","1f468-1f3fc-200d-1f3a8","1f468-1f3fd-200d-1f3a8","1f468-1f3fe-200d-1f3a8","1f468-1f3ff-200d-1f3a8"]},{n:["female-artist"],u:"1f469-200d-1f3a8",v:["1f469-1f3fb-200d-1f3a8","1f469-1f3fc-200d-1f3a8","1f469-1f3fd-200d-1f3a8","1f469-1f3fe-200d-1f3a8","1f469-1f3ff-200d-1f3a8"]},{n:["male-pilot"],u:"1f468-200d-2708-fe0f",v:["1f468-1f3fb-200d-2708-fe0f","1f468-1f3fc-200d-2708-fe0f","1f468-1f3fd-200d-2708-fe0f","1f468-1f3fe-200d-2708-fe0f","1f468-1f3ff-200d-2708-fe0f"]},{n:["female-pilot"],u:"1f469-200d-2708-fe0f",v:["1f469-1f3fb-200d-2708-fe0f","1f469-1f3fc-200d-2708-fe0f","1f469-1f3fd-200d-2708-fe0f","1f469-1f3fe-200d-2708-fe0f","1f469-1f3ff-200d-2708-fe0f"]},{n:["male-astronaut"],u:"1f468-200d-1f680",v:["1f468-1f3fb-200d-1f680","1f468-1f3fc-200d-1f680","1f468-1f3fd-200d-1f680","1f468-1f3fe-200d-1f680","1f468-1f3ff-200d-1f680"]},{n:["female-astronaut"],u:"1f469-200d-1f680",v:["1f469-1f3fb-200d-1f680","1f469-1f3fc-200d-1f680","1f469-1f3fd-200d-1f680","1f469-1f3fe-200d-1f680","1f469-1f3ff-200d-1f680"]},{n:["male-firefighter"],u:"1f468-200d-1f692",v:["1f468-1f3fb-200d-1f692","1f468-1f3fc-200d-1f692","1f468-1f3fd-200d-1f692","1f468-1f3fe-200d-1f692","1f468-1f3ff-200d-1f692"]},{n:["female-firefighter"],u:"1f469-200d-1f692",v:["1f469-1f3fb-200d-1f692","1f469-1f3fc-200d-1f692","1f469-1f3fd-200d-1f692","1f469-1f3fe-200d-1f692","1f469-1f3ff-200d-1f692"]},{n:["police officer","cop"],u:"1f46e",v:["1f46e-1f3fb","1f46e-1f3fc","1f46e-1f3fd","1f46e-1f3fe","1f46e-1f3ff"]},{n:["male-police-officer"],u:"1f46e-200d-2642-fe0f",v:["1f46e-1f3fb-200d-2642-fe0f","1f46e-1f3fc-200d-2642-fe0f","1f46e-1f3fd-200d-2642-fe0f","1f46e-1f3fe-200d-2642-fe0f","1f46e-1f3ff-200d-2642-fe0f"]},{n:["female-police-officer"],u:"1f46e-200d-2640-fe0f",v:["1f46e-1f3fb-200d-2640-fe0f","1f46e-1f3fc-200d-2640-fe0f","1f46e-1f3fd-200d-2640-fe0f","1f46e-1f3fe-200d-2640-fe0f","1f46e-1f3ff-200d-2640-fe0f"]},{n:["sleuth_or_spy"],u:"1f575-fe0f",v:["1f575-1f3fb","1f575-1f3fc","1f575-1f3fd","1f575-1f3fe","1f575-1f3ff"]},{n:["male-detective"],u:"1f575-fe0f-200d-2642-fe0f",v:["1f575-1f3fb-200d-2642-fe0f","1f575-1f3fc-200d-2642-fe0f","1f575-1f3fd-200d-2642-fe0f","1f575-1f3fe-200d-2642-fe0f","1f575-1f3ff-200d-2642-fe0f"]},{n:["female-detective"],u:"1f575-fe0f-200d-2640-fe0f",v:["1f575-1f3fb-200d-2640-fe0f","1f575-1f3fc-200d-2640-fe0f","1f575-1f3fd-200d-2640-fe0f","1f575-1f3fe-200d-2640-fe0f","1f575-1f3ff-200d-2640-fe0f"]},{n:["guardsman"],u:"1f482",v:["1f482-1f3fb","1f482-1f3fc","1f482-1f3fd","1f482-1f3fe","1f482-1f3ff"]},{n:["male-guard"],u:"1f482-200d-2642-fe0f",v:["1f482-1f3fb-200d-2642-fe0f","1f482-1f3fc-200d-2642-fe0f","1f482-1f3fd-200d-2642-fe0f","1f482-1f3fe-200d-2642-fe0f","1f482-1f3ff-200d-2642-fe0f"]},{n:["female-guard"],u:"1f482-200d-2640-fe0f",v:["1f482-1f3fb-200d-2640-fe0f","1f482-1f3fc-200d-2640-fe0f","1f482-1f3fd-200d-2640-fe0f","1f482-1f3fe-200d-2640-fe0f","1f482-1f3ff-200d-2640-fe0f"]},{n:["construction worker","construction_worker"],u:"1f477",v:["1f477-1f3fb","1f477-1f3fc","1f477-1f3fd","1f477-1f3fe","1f477-1f3ff"]},{n:["male-construction-worker"],u:"1f477-200d-2642-fe0f",v:["1f477-1f3fb-200d-2642-fe0f","1f477-1f3fc-200d-2642-fe0f","1f477-1f3fd-200d-2642-fe0f","1f477-1f3fe-200d-2642-fe0f","1f477-1f3ff-200d-2642-fe0f"]},{n:["female-construction-worker"],u:"1f477-200d-2640-fe0f",v:["1f477-1f3fb-200d-2640-fe0f","1f477-1f3fc-200d-2640-fe0f","1f477-1f3fd-200d-2640-fe0f","1f477-1f3fe-200d-2640-fe0f","1f477-1f3ff-200d-2640-fe0f"]},{n:["prince"],u:"1f934",v:["1f934-1f3fb","1f934-1f3fc","1f934-1f3fd","1f934-1f3fe","1f934-1f3ff"]},{n:["princess"],u:"1f478",v:["1f478-1f3fb","1f478-1f3fc","1f478-1f3fd","1f478-1f3fe","1f478-1f3ff"]},{n:["man with turban","man_with_turban"],u:"1f473",v:["1f473-1f3fb","1f473-1f3fc","1f473-1f3fd","1f473-1f3fe","1f473-1f3ff"]},{n:["man-wearing-turban"],u:"1f473-200d-2642-fe0f",v:["1f473-1f3fb-200d-2642-fe0f","1f473-1f3fc-200d-2642-fe0f","1f473-1f3fd-200d-2642-fe0f","1f473-1f3fe-200d-2642-fe0f","1f473-1f3ff-200d-2642-fe0f"]},{n:["woman-wearing-turban"],u:"1f473-200d-2640-fe0f",v:["1f473-1f3fb-200d-2640-fe0f","1f473-1f3fc-200d-2640-fe0f","1f473-1f3fd-200d-2640-fe0f","1f473-1f3fe-200d-2640-fe0f","1f473-1f3ff-200d-2640-fe0f"]},{n:["man with gua pi mao","man_with_gua_pi_mao"],u:"1f472",v:["1f472-1f3fb","1f472-1f3fc","1f472-1f3fd","1f472-1f3fe","1f472-1f3ff"]},{n:["person with headscarf","person_with_headscarf"],u:"1f9d5",v:["1f9d5-1f3fb","1f9d5-1f3fc","1f9d5-1f3fd","1f9d5-1f3fe","1f9d5-1f3ff"]},{n:["bearded person","bearded_person"],u:"1f9d4",v:["1f9d4-1f3fb","1f9d4-1f3fc","1f9d4-1f3fd","1f9d4-1f3fe","1f9d4-1f3ff"]},{n:["person with blond hair","person_with_blond_hair"],u:"1f471",v:["1f471-1f3fb","1f471-1f3fc","1f471-1f3fd","1f471-1f3fe","1f471-1f3ff"]},{n:["blond-haired-man"],u:"1f471-200d-2642-fe0f",v:["1f471-1f3fb-200d-2642-fe0f","1f471-1f3fc-200d-2642-fe0f","1f471-1f3fd-200d-2642-fe0f","1f471-1f3fe-200d-2642-fe0f","1f471-1f3ff-200d-2642-fe0f"]},{n:["blond-haired-woman"],u:"1f471-200d-2640-fe0f",v:["1f471-1f3fb-200d-2640-fe0f","1f471-1f3fc-200d-2640-fe0f","1f471-1f3fd-200d-2640-fe0f","1f471-1f3fe-200d-2640-fe0f","1f471-1f3ff-200d-2640-fe0f"]},{n:["man in tuxedo","man_in_tuxedo"],u:"1f935",v:["1f935-1f3fb","1f935-1f3fc","1f935-1f3fd","1f935-1f3fe","1f935-1f3ff"]},{n:["bride with veil","bride_with_veil"],u:"1f470",v:["1f470-1f3fb","1f470-1f3fc","1f470-1f3fd","1f470-1f3fe","1f470-1f3ff"]},{n:["pregnant woman","pregnant_woman"],u:"1f930",v:["1f930-1f3fb","1f930-1f3fc","1f930-1f3fd","1f930-1f3fe","1f930-1f3ff"]},{n:["breast-feeding"],u:"1f931",v:["1f931-1f3fb","1f931-1f3fc","1f931-1f3fd","1f931-1f3fe","1f931-1f3ff"]},{n:["baby angel","angel"],u:"1f47c",v:["1f47c-1f3fb","1f47c-1f3fc","1f47c-1f3fd","1f47c-1f3fe","1f47c-1f3ff"]},{n:["father christmas","santa"],u:"1f385",v:["1f385-1f3fb","1f385-1f3fc","1f385-1f3fd","1f385-1f3fe","1f385-1f3ff"]},{n:["mother christmas","mrs_claus","mother_christmas"],u:"1f936",v:["1f936-1f3fb","1f936-1f3fc","1f936-1f3fd","1f936-1f3fe","1f936-1f3ff"]},{n:["mage"],u:"1f9d9",v:["1f9d9-1f3fb","1f9d9-1f3fc","1f9d9-1f3fd","1f9d9-1f3fe","1f9d9-1f3ff"]},{n:["female_mage"],u:"1f9d9-200d-2640-fe0f",v:["1f9d9-1f3fb-200d-2640-fe0f","1f9d9-1f3fc-200d-2640-fe0f","1f9d9-1f3fd-200d-2640-fe0f","1f9d9-1f3fe-200d-2640-fe0f","1f9d9-1f3ff-200d-2640-fe0f"]},{n:["male_mage"],u:"1f9d9-200d-2642-fe0f",v:["1f9d9-1f3fb-200d-2642-fe0f","1f9d9-1f3fc-200d-2642-fe0f","1f9d9-1f3fd-200d-2642-fe0f","1f9d9-1f3fe-200d-2642-fe0f","1f9d9-1f3ff-200d-2642-fe0f"]},{n:["fairy"],u:"1f9da",v:["1f9da-1f3fb","1f9da-1f3fc","1f9da-1f3fd","1f9da-1f3fe","1f9da-1f3ff"]},{n:["female_fairy"],u:"1f9da-200d-2640-fe0f",v:["1f9da-1f3fb-200d-2640-fe0f","1f9da-1f3fc-200d-2640-fe0f","1f9da-1f3fd-200d-2640-fe0f","1f9da-1f3fe-200d-2640-fe0f","1f9da-1f3ff-200d-2640-fe0f"]},{n:["male_fairy"],u:"1f9da-200d-2642-fe0f",v:["1f9da-1f3fb-200d-2642-fe0f","1f9da-1f3fc-200d-2642-fe0f","1f9da-1f3fd-200d-2642-fe0f","1f9da-1f3fe-200d-2642-fe0f","1f9da-1f3ff-200d-2642-fe0f"]},{n:["vampire"],u:"1f9db",v:["1f9db-1f3fb","1f9db-1f3fc","1f9db-1f3fd","1f9db-1f3fe","1f9db-1f3ff"]},{n:["female_vampire"],u:"1f9db-200d-2640-fe0f",v:["1f9db-1f3fb-200d-2640-fe0f","1f9db-1f3fc-200d-2640-fe0f","1f9db-1f3fd-200d-2640-fe0f","1f9db-1f3fe-200d-2640-fe0f","1f9db-1f3ff-200d-2640-fe0f"]},{n:["male_vampire"],u:"1f9db-200d-2642-fe0f",v:["1f9db-1f3fb-200d-2642-fe0f","1f9db-1f3fc-200d-2642-fe0f","1f9db-1f3fd-200d-2642-fe0f","1f9db-1f3fe-200d-2642-fe0f","1f9db-1f3ff-200d-2642-fe0f"]},{n:["merperson"],u:"1f9dc",v:["1f9dc-1f3fb","1f9dc-1f3fc","1f9dc-1f3fd","1f9dc-1f3fe","1f9dc-1f3ff"]},{n:["mermaid"],u:"1f9dc-200d-2640-fe0f",v:["1f9dc-1f3fb-200d-2640-fe0f","1f9dc-1f3fc-200d-2640-fe0f","1f9dc-1f3fd-200d-2640-fe0f","1f9dc-1f3fe-200d-2640-fe0f","1f9dc-1f3ff-200d-2640-fe0f"]},{n:["merman"],u:"1f9dc-200d-2642-fe0f",v:["1f9dc-1f3fb-200d-2642-fe0f","1f9dc-1f3fc-200d-2642-fe0f","1f9dc-1f3fd-200d-2642-fe0f","1f9dc-1f3fe-200d-2642-fe0f","1f9dc-1f3ff-200d-2642-fe0f"]},{n:["elf"],u:"1f9dd",v:["1f9dd-1f3fb","1f9dd-1f3fc","1f9dd-1f3fd","1f9dd-1f3fe","1f9dd-1f3ff"]},{n:["female_elf"],u:"1f9dd-200d-2640-fe0f",v:["1f9dd-1f3fb-200d-2640-fe0f","1f9dd-1f3fc-200d-2640-fe0f","1f9dd-1f3fd-200d-2640-fe0f","1f9dd-1f3fe-200d-2640-fe0f","1f9dd-1f3ff-200d-2640-fe0f"]},{n:["male_elf"],u:"1f9dd-200d-2642-fe0f",v:["1f9dd-1f3fb-200d-2642-fe0f","1f9dd-1f3fc-200d-2642-fe0f","1f9dd-1f3fd-200d-2642-fe0f","1f9dd-1f3fe-200d-2642-fe0f","1f9dd-1f3ff-200d-2642-fe0f"]},{n:["genie"],u:"1f9de"},{n:["female_genie"],u:"1f9de-200d-2640-fe0f"},{n:["male_genie"],u:"1f9de-200d-2642-fe0f"},{n:["zombie"],u:"1f9df"},{n:["female_zombie"],u:"1f9df-200d-2640-fe0f"},{n:["male_zombie"],u:"1f9df-200d-2642-fe0f"},{n:["person frowning","person_frowning"],u:"1f64d",v:["1f64d-1f3fb","1f64d-1f3fc","1f64d-1f3fd","1f64d-1f3fe","1f64d-1f3ff"]},{n:["man-frowning"],u:"1f64d-200d-2642-fe0f",v:["1f64d-1f3fb-200d-2642-fe0f","1f64d-1f3fc-200d-2642-fe0f","1f64d-1f3fd-200d-2642-fe0f","1f64d-1f3fe-200d-2642-fe0f","1f64d-1f3ff-200d-2642-fe0f"]},{n:["woman-frowning"],u:"1f64d-200d-2640-fe0f",v:["1f64d-1f3fb-200d-2640-fe0f","1f64d-1f3fc-200d-2640-fe0f","1f64d-1f3fd-200d-2640-fe0f","1f64d-1f3fe-200d-2640-fe0f","1f64d-1f3ff-200d-2640-fe0f"]},{n:["person with pouting face","person_with_pouting_face"],u:"1f64e",v:["1f64e-1f3fb","1f64e-1f3fc","1f64e-1f3fd","1f64e-1f3fe","1f64e-1f3ff"]},{n:["man-pouting"],u:"1f64e-200d-2642-fe0f",v:["1f64e-1f3fb-200d-2642-fe0f","1f64e-1f3fc-200d-2642-fe0f","1f64e-1f3fd-200d-2642-fe0f","1f64e-1f3fe-200d-2642-fe0f","1f64e-1f3ff-200d-2642-fe0f"]},{n:["woman-pouting"],u:"1f64e-200d-2640-fe0f",v:["1f64e-1f3fb-200d-2640-fe0f","1f64e-1f3fc-200d-2640-fe0f","1f64e-1f3fd-200d-2640-fe0f","1f64e-1f3fe-200d-2640-fe0f","1f64e-1f3ff-200d-2640-fe0f"]},{n:["face with no good gesture","no_good"],u:"1f645",v:["1f645-1f3fb","1f645-1f3fc","1f645-1f3fd","1f645-1f3fe","1f645-1f3ff"]},{n:["man-gesturing-no"],u:"1f645-200d-2642-fe0f",v:["1f645-1f3fb-200d-2642-fe0f","1f645-1f3fc-200d-2642-fe0f","1f645-1f3fd-200d-2642-fe0f","1f645-1f3fe-200d-2642-fe0f","1f645-1f3ff-200d-2642-fe0f"]},{n:["woman-gesturing-no"],u:"1f645-200d-2640-fe0f",v:["1f645-1f3fb-200d-2640-fe0f","1f645-1f3fc-200d-2640-fe0f","1f645-1f3fd-200d-2640-fe0f","1f645-1f3fe-200d-2640-fe0f","1f645-1f3ff-200d-2640-fe0f"]},{n:["face with ok gesture","ok_woman"],u:"1f646",v:["1f646-1f3fb","1f646-1f3fc","1f646-1f3fd","1f646-1f3fe","1f646-1f3ff"]},{n:["man-gesturing-ok"],u:"1f646-200d-2642-fe0f",v:["1f646-1f3fb-200d-2642-fe0f","1f646-1f3fc-200d-2642-fe0f","1f646-1f3fd-200d-2642-fe0f","1f646-1f3fe-200d-2642-fe0f","1f646-1f3ff-200d-2642-fe0f"]},{n:["woman-gesturing-ok"],u:"1f646-200d-2640-fe0f",v:["1f646-1f3fb-200d-2640-fe0f","1f646-1f3fc-200d-2640-fe0f","1f646-1f3fd-200d-2640-fe0f","1f646-1f3fe-200d-2640-fe0f","1f646-1f3ff-200d-2640-fe0f"]},{n:["information desk person","information_desk_person"],u:"1f481",v:["1f481-1f3fb","1f481-1f3fc","1f481-1f3fd","1f481-1f3fe","1f481-1f3ff"]},{n:["man-tipping-hand"],u:"1f481-200d-2642-fe0f",v:["1f481-1f3fb-200d-2642-fe0f","1f481-1f3fc-200d-2642-fe0f","1f481-1f3fd-200d-2642-fe0f","1f481-1f3fe-200d-2642-fe0f","1f481-1f3ff-200d-2642-fe0f"]},{n:["woman-tipping-hand"],u:"1f481-200d-2640-fe0f",v:["1f481-1f3fb-200d-2640-fe0f","1f481-1f3fc-200d-2640-fe0f","1f481-1f3fd-200d-2640-fe0f","1f481-1f3fe-200d-2640-fe0f","1f481-1f3ff-200d-2640-fe0f"]},{n:["happy person raising one hand","raising_hand"],u:"1f64b",v:["1f64b-1f3fb","1f64b-1f3fc","1f64b-1f3fd","1f64b-1f3fe","1f64b-1f3ff"]},{n:["man-raising-hand"],u:"1f64b-200d-2642-fe0f",v:["1f64b-1f3fb-200d-2642-fe0f","1f64b-1f3fc-200d-2642-fe0f","1f64b-1f3fd-200d-2642-fe0f","1f64b-1f3fe-200d-2642-fe0f","1f64b-1f3ff-200d-2642-fe0f"]},{n:["woman-raising-hand"],u:"1f64b-200d-2640-fe0f",v:["1f64b-1f3fb-200d-2640-fe0f","1f64b-1f3fc-200d-2640-fe0f","1f64b-1f3fd-200d-2640-fe0f","1f64b-1f3fe-200d-2640-fe0f","1f64b-1f3ff-200d-2640-fe0f"]},{n:["person bowing deeply","bow"],u:"1f647",v:["1f647-1f3fb","1f647-1f3fc","1f647-1f3fd","1f647-1f3fe","1f647-1f3ff"]},{n:["man-bowing"],u:"1f647-200d-2642-fe0f",v:["1f647-1f3fb-200d-2642-fe0f","1f647-1f3fc-200d-2642-fe0f","1f647-1f3fd-200d-2642-fe0f","1f647-1f3fe-200d-2642-fe0f","1f647-1f3ff-200d-2642-fe0f"]},{n:["woman-bowing"],u:"1f647-200d-2640-fe0f",v:["1f647-1f3fb-200d-2640-fe0f","1f647-1f3fc-200d-2640-fe0f","1f647-1f3fd-200d-2640-fe0f","1f647-1f3fe-200d-2640-fe0f","1f647-1f3ff-200d-2640-fe0f"]},{n:["face palm","face_palm"],u:"1f926",v:["1f926-1f3fb","1f926-1f3fc","1f926-1f3fd","1f926-1f3fe","1f926-1f3ff"]},{n:["man-facepalming"],u:"1f926-200d-2642-fe0f",v:["1f926-1f3fb-200d-2642-fe0f","1f926-1f3fc-200d-2642-fe0f","1f926-1f3fd-200d-2642-fe0f","1f926-1f3fe-200d-2642-fe0f","1f926-1f3ff-200d-2642-fe0f"]},{n:["woman-facepalming"],u:"1f926-200d-2640-fe0f",v:["1f926-1f3fb-200d-2640-fe0f","1f926-1f3fc-200d-2640-fe0f","1f926-1f3fd-200d-2640-fe0f","1f926-1f3fe-200d-2640-fe0f","1f926-1f3ff-200d-2640-fe0f"]},{n:["shrug"],u:"1f937",v:["1f937-1f3fb","1f937-1f3fc","1f937-1f3fd","1f937-1f3fe","1f937-1f3ff"]},{n:["man-shrugging"],u:"1f937-200d-2642-fe0f",v:["1f937-1f3fb-200d-2642-fe0f","1f937-1f3fc-200d-2642-fe0f","1f937-1f3fd-200d-2642-fe0f","1f937-1f3fe-200d-2642-fe0f","1f937-1f3ff-200d-2642-fe0f"]},{n:["woman-shrugging"],u:"1f937-200d-2640-fe0f",v:["1f937-1f3fb-200d-2640-fe0f","1f937-1f3fc-200d-2640-fe0f","1f937-1f3fd-200d-2640-fe0f","1f937-1f3fe-200d-2640-fe0f","1f937-1f3ff-200d-2640-fe0f"]},{n:["face massage","massage"],u:"1f486",v:["1f486-1f3fb","1f486-1f3fc","1f486-1f3fd","1f486-1f3fe","1f486-1f3ff"]},{n:["man-getting-massage"],u:"1f486-200d-2642-fe0f",v:["1f486-1f3fb-200d-2642-fe0f","1f486-1f3fc-200d-2642-fe0f","1f486-1f3fd-200d-2642-fe0f","1f486-1f3fe-200d-2642-fe0f","1f486-1f3ff-200d-2642-fe0f"]},{n:["woman-getting-massage"],u:"1f486-200d-2640-fe0f",v:["1f486-1f3fb-200d-2640-fe0f","1f486-1f3fc-200d-2640-fe0f","1f486-1f3fd-200d-2640-fe0f","1f486-1f3fe-200d-2640-fe0f","1f486-1f3ff-200d-2640-fe0f"]},{n:["haircut"],u:"1f487",v:["1f487-1f3fb","1f487-1f3fc","1f487-1f3fd","1f487-1f3fe","1f487-1f3ff"]},{n:["man-getting-haircut"],u:"1f487-200d-2642-fe0f",v:["1f487-1f3fb-200d-2642-fe0f","1f487-1f3fc-200d-2642-fe0f","1f487-1f3fd-200d-2642-fe0f","1f487-1f3fe-200d-2642-fe0f","1f487-1f3ff-200d-2642-fe0f"]},{n:["woman-getting-haircut"],u:"1f487-200d-2640-fe0f",v:["1f487-1f3fb-200d-2640-fe0f","1f487-1f3fc-200d-2640-fe0f","1f487-1f3fd-200d-2640-fe0f","1f487-1f3fe-200d-2640-fe0f","1f487-1f3ff-200d-2640-fe0f"]},{n:["pedestrian","walking"],u:"1f6b6",v:["1f6b6-1f3fb","1f6b6-1f3fc","1f6b6-1f3fd","1f6b6-1f3fe","1f6b6-1f3ff"]},{n:["man-walking"],u:"1f6b6-200d-2642-fe0f",v:["1f6b6-1f3fb-200d-2642-fe0f","1f6b6-1f3fc-200d-2642-fe0f","1f6b6-1f3fd-200d-2642-fe0f","1f6b6-1f3fe-200d-2642-fe0f","1f6b6-1f3ff-200d-2642-fe0f"]},{n:["woman-walking"],u:"1f6b6-200d-2640-fe0f",v:["1f6b6-1f3fb-200d-2640-fe0f","1f6b6-1f3fc-200d-2640-fe0f","1f6b6-1f3fd-200d-2640-fe0f","1f6b6-1f3fe-200d-2640-fe0f","1f6b6-1f3ff-200d-2640-fe0f"]},{n:["runner","running"],u:"1f3c3",v:["1f3c3-1f3fb","1f3c3-1f3fc","1f3c3-1f3fd","1f3c3-1f3fe","1f3c3-1f3ff"]},{n:["man-running"],u:"1f3c3-200d-2642-fe0f",v:["1f3c3-1f3fb-200d-2642-fe0f","1f3c3-1f3fc-200d-2642-fe0f","1f3c3-1f3fd-200d-2642-fe0f","1f3c3-1f3fe-200d-2642-fe0f","1f3c3-1f3ff-200d-2642-fe0f"]},{n:["woman-running"],u:"1f3c3-200d-2640-fe0f",v:["1f3c3-1f3fb-200d-2640-fe0f","1f3c3-1f3fc-200d-2640-fe0f","1f3c3-1f3fd-200d-2640-fe0f","1f3c3-1f3fe-200d-2640-fe0f","1f3c3-1f3ff-200d-2640-fe0f"]},{n:["dancer"],u:"1f483",v:["1f483-1f3fb","1f483-1f3fc","1f483-1f3fd","1f483-1f3fe","1f483-1f3ff"]},{n:["man dancing","man_dancing"],u:"1f57a",v:["1f57a-1f3fb","1f57a-1f3fc","1f57a-1f3fd","1f57a-1f3fe","1f57a-1f3ff"]},{n:["woman with bunny ears","dancers"],u:"1f46f"},{n:["man-with-bunny-ears-partying"],u:"1f46f-200d-2642-fe0f"},{n:["woman-with-bunny-ears-partying"],u:"1f46f-200d-2640-fe0f"},{n:["person in steamy room","person_in_steamy_room"],u:"1f9d6",v:["1f9d6-1f3fb","1f9d6-1f3fc","1f9d6-1f3fd","1f9d6-1f3fe","1f9d6-1f3ff"]},{n:["woman_in_steamy_room"],u:"1f9d6-200d-2640-fe0f",v:["1f9d6-1f3fb-200d-2640-fe0f","1f9d6-1f3fc-200d-2640-fe0f","1f9d6-1f3fd-200d-2640-fe0f","1f9d6-1f3fe-200d-2640-fe0f","1f9d6-1f3ff-200d-2640-fe0f"]},{n:["man_in_steamy_room"],u:"1f9d6-200d-2642-fe0f",v:["1f9d6-1f3fb-200d-2642-fe0f","1f9d6-1f3fc-200d-2642-fe0f","1f9d6-1f3fd-200d-2642-fe0f","1f9d6-1f3fe-200d-2642-fe0f","1f9d6-1f3ff-200d-2642-fe0f"]},{n:["person climbing","person_climbing"],u:"1f9d7",v:["1f9d7-1f3fb","1f9d7-1f3fc","1f9d7-1f3fd","1f9d7-1f3fe","1f9d7-1f3ff"]},{n:["woman_climbing"],u:"1f9d7-200d-2640-fe0f",v:["1f9d7-1f3fb-200d-2640-fe0f","1f9d7-1f3fc-200d-2640-fe0f","1f9d7-1f3fd-200d-2640-fe0f","1f9d7-1f3fe-200d-2640-fe0f","1f9d7-1f3ff-200d-2640-fe0f"]},{n:["man_climbing"],u:"1f9d7-200d-2642-fe0f",v:["1f9d7-1f3fb-200d-2642-fe0f","1f9d7-1f3fc-200d-2642-fe0f","1f9d7-1f3fd-200d-2642-fe0f","1f9d7-1f3fe-200d-2642-fe0f","1f9d7-1f3ff-200d-2642-fe0f"]},{n:["person in lotus position","person_in_lotus_position"],u:"1f9d8",v:["1f9d8-1f3fb","1f9d8-1f3fc","1f9d8-1f3fd","1f9d8-1f3fe","1f9d8-1f3ff"]},{n:["woman_in_lotus_position"],u:"1f9d8-200d-2640-fe0f",v:["1f9d8-1f3fb-200d-2640-fe0f","1f9d8-1f3fc-200d-2640-fe0f","1f9d8-1f3fd-200d-2640-fe0f","1f9d8-1f3fe-200d-2640-fe0f","1f9d8-1f3ff-200d-2640-fe0f"]},{n:["man_in_lotus_position"],u:"1f9d8-200d-2642-fe0f",v:["1f9d8-1f3fb-200d-2642-fe0f","1f9d8-1f3fc-200d-2642-fe0f","1f9d8-1f3fd-200d-2642-fe0f","1f9d8-1f3fe-200d-2642-fe0f","1f9d8-1f3ff-200d-2642-fe0f"]},{n:["bath"],u:"1f6c0",v:["1f6c0-1f3fb","1f6c0-1f3fc","1f6c0-1f3fd","1f6c0-1f3fe","1f6c0-1f3ff"]},{n:["sleeping accommodation","sleeping_accommodation"],u:"1f6cc",v:["1f6cc-1f3fb","1f6cc-1f3fc","1f6cc-1f3fd","1f6cc-1f3fe","1f6cc-1f3ff"]},{n:["man_in_business_suit_levitating"],u:"1f574-fe0f",v:["1f574-1f3fb","1f574-1f3fc","1f574-1f3fd","1f574-1f3fe","1f574-1f3ff"]},{n:["speaking_head_in_silhouette"],u:"1f5e3-fe0f"},{n:["bust in silhouette","bust_in_silhouette"],u:"1f464"},{n:["busts in silhouette","busts_in_silhouette"],u:"1f465"},{n:["fencer"],u:"1f93a"},{n:["horse racing","horse_racing"],u:"1f3c7",v:["1f3c7-1f3fb","1f3c7-1f3fc","1f3c7-1f3fd","1f3c7-1f3fe","1f3c7-1f3ff"]},{n:["skier"],u:"26f7-fe0f"},{n:["snowboarder"],u:"1f3c2",v:["1f3c2-1f3fb","1f3c2-1f3fc","1f3c2-1f3fd","1f3c2-1f3fe","1f3c2-1f3ff"]},{n:["golfer"],u:"1f3cc-fe0f",v:["1f3cc-1f3fb","1f3cc-1f3fc","1f3cc-1f3fd","1f3cc-1f3fe","1f3cc-1f3ff"]},{n:["man-golfing"],u:"1f3cc-fe0f-200d-2642-fe0f",v:["1f3cc-1f3fb-200d-2642-fe0f","1f3cc-1f3fc-200d-2642-fe0f","1f3cc-1f3fd-200d-2642-fe0f","1f3cc-1f3fe-200d-2642-fe0f","1f3cc-1f3ff-200d-2642-fe0f"]},{n:["woman-golfing"],u:"1f3cc-fe0f-200d-2640-fe0f",v:["1f3cc-1f3fb-200d-2640-fe0f","1f3cc-1f3fc-200d-2640-fe0f","1f3cc-1f3fd-200d-2640-fe0f","1f3cc-1f3fe-200d-2640-fe0f","1f3cc-1f3ff-200d-2640-fe0f"]},{n:["surfer"],u:"1f3c4",v:["1f3c4-1f3fb","1f3c4-1f3fc","1f3c4-1f3fd","1f3c4-1f3fe","1f3c4-1f3ff"]},{n:["man-surfing"],u:"1f3c4-200d-2642-fe0f",v:["1f3c4-1f3fb-200d-2642-fe0f","1f3c4-1f3fc-200d-2642-fe0f","1f3c4-1f3fd-200d-2642-fe0f","1f3c4-1f3fe-200d-2642-fe0f","1f3c4-1f3ff-200d-2642-fe0f"]},{n:["woman-surfing"],u:"1f3c4-200d-2640-fe0f",v:["1f3c4-1f3fb-200d-2640-fe0f","1f3c4-1f3fc-200d-2640-fe0f","1f3c4-1f3fd-200d-2640-fe0f","1f3c4-1f3fe-200d-2640-fe0f","1f3c4-1f3ff-200d-2640-fe0f"]},{n:["rowboat"],u:"1f6a3",v:["1f6a3-1f3fb","1f6a3-1f3fc","1f6a3-1f3fd","1f6a3-1f3fe","1f6a3-1f3ff"]},{n:["man-rowing-boat"],u:"1f6a3-200d-2642-fe0f",v:["1f6a3-1f3fb-200d-2642-fe0f","1f6a3-1f3fc-200d-2642-fe0f","1f6a3-1f3fd-200d-2642-fe0f","1f6a3-1f3fe-200d-2642-fe0f","1f6a3-1f3ff-200d-2642-fe0f"]},{n:["woman-rowing-boat"],u:"1f6a3-200d-2640-fe0f",v:["1f6a3-1f3fb-200d-2640-fe0f","1f6a3-1f3fc-200d-2640-fe0f","1f6a3-1f3fd-200d-2640-fe0f","1f6a3-1f3fe-200d-2640-fe0f","1f6a3-1f3ff-200d-2640-fe0f"]},{n:["swimmer"],u:"1f3ca",v:["1f3ca-1f3fb","1f3ca-1f3fc","1f3ca-1f3fd","1f3ca-1f3fe","1f3ca-1f3ff"]},{n:["man-swimming"],u:"1f3ca-200d-2642-fe0f",v:["1f3ca-1f3fb-200d-2642-fe0f","1f3ca-1f3fc-200d-2642-fe0f","1f3ca-1f3fd-200d-2642-fe0f","1f3ca-1f3fe-200d-2642-fe0f","1f3ca-1f3ff-200d-2642-fe0f"]},{n:["woman-swimming"],u:"1f3ca-200d-2640-fe0f",v:["1f3ca-1f3fb-200d-2640-fe0f","1f3ca-1f3fc-200d-2640-fe0f","1f3ca-1f3fd-200d-2640-fe0f","1f3ca-1f3fe-200d-2640-fe0f","1f3ca-1f3ff-200d-2640-fe0f"]},{n:["person_with_ball"],u:"26f9-fe0f",v:["26f9-1f3fb","26f9-1f3fc","26f9-1f3fd","26f9-1f3fe","26f9-1f3ff"]},{n:["man-bouncing-ball"],u:"26f9-fe0f-200d-2642-fe0f",v:["26f9-1f3fb-200d-2642-fe0f","26f9-1f3fc-200d-2642-fe0f","26f9-1f3fd-200d-2642-fe0f","26f9-1f3fe-200d-2642-fe0f","26f9-1f3ff-200d-2642-fe0f"]},{n:["woman-bouncing-ball"],u:"26f9-fe0f-200d-2640-fe0f",v:["26f9-1f3fb-200d-2640-fe0f","26f9-1f3fc-200d-2640-fe0f","26f9-1f3fd-200d-2640-fe0f","26f9-1f3fe-200d-2640-fe0f","26f9-1f3ff-200d-2640-fe0f"]},{n:["weight_lifter"],u:"1f3cb-fe0f",v:["1f3cb-1f3fb","1f3cb-1f3fc","1f3cb-1f3fd","1f3cb-1f3fe","1f3cb-1f3ff"]},{n:["man-lifting-weights"],u:"1f3cb-fe0f-200d-2642-fe0f",v:["1f3cb-1f3fb-200d-2642-fe0f","1f3cb-1f3fc-200d-2642-fe0f","1f3cb-1f3fd-200d-2642-fe0f","1f3cb-1f3fe-200d-2642-fe0f","1f3cb-1f3ff-200d-2642-fe0f"]},{n:["woman-lifting-weights"],u:"1f3cb-fe0f-200d-2640-fe0f",v:["1f3cb-1f3fb-200d-2640-fe0f","1f3cb-1f3fc-200d-2640-fe0f","1f3cb-1f3fd-200d-2640-fe0f","1f3cb-1f3fe-200d-2640-fe0f","1f3cb-1f3ff-200d-2640-fe0f"]},{n:["bicyclist"],u:"1f6b4",v:["1f6b4-1f3fb","1f6b4-1f3fc","1f6b4-1f3fd","1f6b4-1f3fe","1f6b4-1f3ff"]},{n:["man-biking"],u:"1f6b4-200d-2642-fe0f",v:["1f6b4-1f3fb-200d-2642-fe0f","1f6b4-1f3fc-200d-2642-fe0f","1f6b4-1f3fd-200d-2642-fe0f","1f6b4-1f3fe-200d-2642-fe0f","1f6b4-1f3ff-200d-2642-fe0f"]},{n:["woman-biking"],u:"1f6b4-200d-2640-fe0f",v:["1f6b4-1f3fb-200d-2640-fe0f","1f6b4-1f3fc-200d-2640-fe0f","1f6b4-1f3fd-200d-2640-fe0f","1f6b4-1f3fe-200d-2640-fe0f","1f6b4-1f3ff-200d-2640-fe0f"]},{n:["mountain bicyclist","mountain_bicyclist"],u:"1f6b5",v:["1f6b5-1f3fb","1f6b5-1f3fc","1f6b5-1f3fd","1f6b5-1f3fe","1f6b5-1f3ff"]},{n:["man-mountain-biking"],u:"1f6b5-200d-2642-fe0f",v:["1f6b5-1f3fb-200d-2642-fe0f","1f6b5-1f3fc-200d-2642-fe0f","1f6b5-1f3fd-200d-2642-fe0f","1f6b5-1f3fe-200d-2642-fe0f","1f6b5-1f3ff-200d-2642-fe0f"]},{n:["woman-mountain-biking"],u:"1f6b5-200d-2640-fe0f",v:["1f6b5-1f3fb-200d-2640-fe0f","1f6b5-1f3fc-200d-2640-fe0f","1f6b5-1f3fd-200d-2640-fe0f","1f6b5-1f3fe-200d-2640-fe0f","1f6b5-1f3ff-200d-2640-fe0f"]},{n:["racing_car"],u:"1f3ce-fe0f"},{n:["racing_motorcycle"],u:"1f3cd-fe0f"},{n:["person doing cartwheel","person_doing_cartwheel"],u:"1f938",v:["1f938-1f3fb","1f938-1f3fc","1f938-1f3fd","1f938-1f3fe","1f938-1f3ff"]},{n:["man-cartwheeling"],u:"1f938-200d-2642-fe0f",v:["1f938-1f3fb-200d-2642-fe0f","1f938-1f3fc-200d-2642-fe0f","1f938-1f3fd-200d-2642-fe0f","1f938-1f3fe-200d-2642-fe0f","1f938-1f3ff-200d-2642-fe0f"]},{n:["woman-cartwheeling"],u:"1f938-200d-2640-fe0f",v:["1f938-1f3fb-200d-2640-fe0f","1f938-1f3fc-200d-2640-fe0f","1f938-1f3fd-200d-2640-fe0f","1f938-1f3fe-200d-2640-fe0f","1f938-1f3ff-200d-2640-fe0f"]},{n:["wrestlers"],u:"1f93c"},{n:["man-wrestling"],u:"1f93c-200d-2642-fe0f"},{n:["woman-wrestling"],u:"1f93c-200d-2640-fe0f"},{n:["water polo","water_polo"],u:"1f93d",v:["1f93d-1f3fb","1f93d-1f3fc","1f93d-1f3fd","1f93d-1f3fe","1f93d-1f3ff"]},{n:["man-playing-water-polo"],u:"1f93d-200d-2642-fe0f",v:["1f93d-1f3fb-200d-2642-fe0f","1f93d-1f3fc-200d-2642-fe0f","1f93d-1f3fd-200d-2642-fe0f","1f93d-1f3fe-200d-2642-fe0f","1f93d-1f3ff-200d-2642-fe0f"]},{n:["woman-playing-water-polo"],u:"1f93d-200d-2640-fe0f",v:["1f93d-1f3fb-200d-2640-fe0f","1f93d-1f3fc-200d-2640-fe0f","1f93d-1f3fd-200d-2640-fe0f","1f93d-1f3fe-200d-2640-fe0f","1f93d-1f3ff-200d-2640-fe0f"]},{n:["handball"],u:"1f93e",v:["1f93e-1f3fb","1f93e-1f3fc","1f93e-1f3fd","1f93e-1f3fe","1f93e-1f3ff"]},{n:["man-playing-handball"],u:"1f93e-200d-2642-fe0f",v:["1f93e-1f3fb-200d-2642-fe0f","1f93e-1f3fc-200d-2642-fe0f","1f93e-1f3fd-200d-2642-fe0f","1f93e-1f3fe-200d-2642-fe0f","1f93e-1f3ff-200d-2642-fe0f"]},{n:["woman-playing-handball"],u:"1f93e-200d-2640-fe0f",v:["1f93e-1f3fb-200d-2640-fe0f","1f93e-1f3fc-200d-2640-fe0f","1f93e-1f3fd-200d-2640-fe0f","1f93e-1f3fe-200d-2640-fe0f","1f93e-1f3ff-200d-2640-fe0f"]},{n:["juggling"],u:"1f939",v:["1f939-1f3fb","1f939-1f3fc","1f939-1f3fd","1f939-1f3fe","1f939-1f3ff"]},{n:["man-juggling"],u:"1f939-200d-2642-fe0f",v:["1f939-1f3fb-200d-2642-fe0f","1f939-1f3fc-200d-2642-fe0f","1f939-1f3fd-200d-2642-fe0f","1f939-1f3fe-200d-2642-fe0f","1f939-1f3ff-200d-2642-fe0f"]},{n:["woman-juggling"],u:"1f939-200d-2640-fe0f",v:["1f939-1f3fb-200d-2640-fe0f","1f939-1f3fc-200d-2640-fe0f","1f939-1f3fd-200d-2640-fe0f","1f939-1f3fe-200d-2640-fe0f","1f939-1f3ff-200d-2640-fe0f"]},{n:["man and woman holding hands","couple","man_and_woman_holding_hands"],u:"1f46b"},{n:["two men holding hands","two_men_holding_hands"],u:"1f46c"},{n:["two women holding hands","two_women_holding_hands"],u:"1f46d"},{n:["kiss","couplekiss"],u:"1f48f"},{n:["woman-kiss-man"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f468"},{n:["man-kiss-man"],u:"1f468-200d-2764-fe0f-200d-1f48b-200d-1f468"},{n:["woman-kiss-woman"],u:"1f469-200d-2764-fe0f-200d-1f48b-200d-1f469"},{n:["couple with heart","couple_with_heart"],u:"1f491"},{n:["woman-heart-man"],u:"1f469-200d-2764-fe0f-200d-1f468"},{n:["man-heart-man"],u:"1f468-200d-2764-fe0f-200d-1f468"},{n:["woman-heart-woman"],u:"1f469-200d-2764-fe0f-200d-1f469"},{n:["family","man-woman-boy"],u:"1f46a"},{n:["man-woman-boy","family"],u:"1f468-200d-1f469-200d-1f466"},{n:["man-woman-girl"],u:"1f468-200d-1f469-200d-1f467"},{n:["man-woman-girl-boy"],u:"1f468-200d-1f469-200d-1f467-200d-1f466"},{n:["man-woman-boy-boy"],u:"1f468-200d-1f469-200d-1f466-200d-1f466"},{n:["man-woman-girl-girl"],u:"1f468-200d-1f469-200d-1f467-200d-1f467"},{n:["man-man-boy"],u:"1f468-200d-1f468-200d-1f466"},{n:["man-man-girl"],u:"1f468-200d-1f468-200d-1f467"},{n:["man-man-girl-boy"],u:"1f468-200d-1f468-200d-1f467-200d-1f466"},{n:["man-man-boy-boy"],u:"1f468-200d-1f468-200d-1f466-200d-1f466"},{n:["man-man-girl-girl"],u:"1f468-200d-1f468-200d-1f467-200d-1f467"},{n:["woman-woman-boy"],u:"1f469-200d-1f469-200d-1f466"},{n:["woman-woman-girl"],u:"1f469-200d-1f469-200d-1f467"},{n:["woman-woman-girl-boy"],u:"1f469-200d-1f469-200d-1f467-200d-1f466"},{n:["woman-woman-boy-boy"],u:"1f469-200d-1f469-200d-1f466-200d-1f466"},{n:["woman-woman-girl-girl"],u:"1f469-200d-1f469-200d-1f467-200d-1f467"},{n:["man-boy"],u:"1f468-200d-1f466"},{n:["man-boy-boy"],u:"1f468-200d-1f466-200d-1f466"},{n:["man-girl"],u:"1f468-200d-1f467"},{n:["man-girl-boy"],u:"1f468-200d-1f467-200d-1f466"},{n:["man-girl-girl"],u:"1f468-200d-1f467-200d-1f467"},{n:["woman-boy"],u:"1f469-200d-1f466"},{n:["woman-boy-boy"],u:"1f469-200d-1f466-200d-1f466"},{n:["woman-girl"],u:"1f469-200d-1f467"},{n:["woman-girl-boy"],u:"1f469-200d-1f467-200d-1f466"},{n:["woman-girl-girl"],u:"1f469-200d-1f467-200d-1f467"},{n:["selfie"],u:"1f933",v:["1f933-1f3fb","1f933-1f3fc","1f933-1f3fd","1f933-1f3fe","1f933-1f3ff"]},{n:["flexed biceps","muscle"],u:"1f4aa",v:["1f4aa-1f3fb","1f4aa-1f3fc","1f4aa-1f3fd","1f4aa-1f3fe","1f4aa-1f3ff"]},{n:["white left pointing backhand index","point_left"],u:"1f448",v:["1f448-1f3fb","1f448-1f3fc","1f448-1f3fd","1f448-1f3fe","1f448-1f3ff"]},{n:["white right pointing backhand index","point_right"],u:"1f449",v:["1f449-1f3fb","1f449-1f3fc","1f449-1f3fd","1f449-1f3fe","1f449-1f3ff"]},{n:["white up pointing index","point_up"],u:"261d-fe0f",v:["261d-1f3fb","261d-1f3fc","261d-1f3fd","261d-1f3fe","261d-1f3ff"]},{n:["white up pointing backhand index","point_up_2"],u:"1f446",v:["1f446-1f3fb","1f446-1f3fc","1f446-1f3fd","1f446-1f3fe","1f446-1f3ff"]},{n:["reversed hand with middle finger extended","middle_finger","reversed_hand_with_middle_finger_extended"],u:"1f595",v:["1f595-1f3fb","1f595-1f3fc","1f595-1f3fd","1f595-1f3fe","1f595-1f3ff"]},{n:["white down pointing backhand index","point_down"],u:"1f447",v:["1f447-1f3fb","1f447-1f3fc","1f447-1f3fd","1f447-1f3fe","1f447-1f3ff"]},{n:["victory hand","v"],u:"270c-fe0f",v:["270c-1f3fb","270c-1f3fc","270c-1f3fd","270c-1f3fe","270c-1f3ff"]},{n:["hand with index and middle fingers crossed","crossed_fingers","hand_with_index_and_middle_fingers_crossed"],u:"1f91e",v:["1f91e-1f3fb","1f91e-1f3fc","1f91e-1f3fd","1f91e-1f3fe","1f91e-1f3ff"]},{n:["raised hand with part between middle and ring fingers","spock-hand"],u:"1f596",v:["1f596-1f3fb","1f596-1f3fc","1f596-1f3fd","1f596-1f3fe","1f596-1f3ff"]},{n:["sign of the horns","the_horns","sign_of_the_horns"],u:"1f918",v:["1f918-1f3fb","1f918-1f3fc","1f918-1f3fd","1f918-1f3fe","1f918-1f3ff"]},{n:["call me hand","call_me_hand"],u:"1f919",v:["1f919-1f3fb","1f919-1f3fc","1f919-1f3fd","1f919-1f3fe","1f919-1f3ff"]},{n:["raised_hand_with_fingers_splayed"],u:"1f590-fe0f",v:["1f590-1f3fb","1f590-1f3fc","1f590-1f3fd","1f590-1f3fe","1f590-1f3ff"]},{n:["raised hand","hand","raised_hand"],u:"270b",v:["270b-1f3fb","270b-1f3fc","270b-1f3fd","270b-1f3fe","270b-1f3ff"]},{n:["ok hand sign","ok_hand"],u:"1f44c",v:["1f44c-1f3fb","1f44c-1f3fc","1f44c-1f3fd","1f44c-1f3fe","1f44c-1f3ff"]},{n:["thumbs up sign","+1","thumbsup"],u:"1f44d",v:["1f44d-1f3fb","1f44d-1f3fc","1f44d-1f3fd","1f44d-1f3fe","1f44d-1f3ff"]},{n:["thumbs down sign","-1","thumbsdown"],u:"1f44e",v:["1f44e-1f3fb","1f44e-1f3fc","1f44e-1f3fd","1f44e-1f3fe","1f44e-1f3ff"]},{n:["raised fist","fist"],u:"270a",v:["270a-1f3fb","270a-1f3fc","270a-1f3fd","270a-1f3fe","270a-1f3ff"]},{n:["fisted hand sign","facepunch","punch"],u:"1f44a",v:["1f44a-1f3fb","1f44a-1f3fc","1f44a-1f3fd","1f44a-1f3fe","1f44a-1f3ff"]},{n:["left-facing fist","left-facing_fist"],u:"1f91b",v:["1f91b-1f3fb","1f91b-1f3fc","1f91b-1f3fd","1f91b-1f3fe","1f91b-1f3ff"]},{n:["right-facing fist","right-facing_fist"],u:"1f91c",v:["1f91c-1f3fb","1f91c-1f3fc","1f91c-1f3fd","1f91c-1f3fe","1f91c-1f3ff"]},{n:["raised back of hand","raised_back_of_hand"],u:"1f91a",v:["1f91a-1f3fb","1f91a-1f3fc","1f91a-1f3fd","1f91a-1f3fe","1f91a-1f3ff"]},{n:["waving hand sign","wave"],u:"1f44b",v:["1f44b-1f3fb","1f44b-1f3fc","1f44b-1f3fd","1f44b-1f3fe","1f44b-1f3ff"]},{n:["i love you hand sign","i_love_you_hand_sign"],u:"1f91f",v:["1f91f-1f3fb","1f91f-1f3fc","1f91f-1f3fd","1f91f-1f3fe","1f91f-1f3ff"]},{n:["writing_hand"],u:"270d-fe0f",v:["270d-1f3fb","270d-1f3fc","270d-1f3fd","270d-1f3fe","270d-1f3ff"]},{n:["clapping hands sign","clap"],u:"1f44f",v:["1f44f-1f3fb","1f44f-1f3fc","1f44f-1f3fd","1f44f-1f3fe","1f44f-1f3ff"]},{n:["open hands sign","open_hands"],u:"1f450",v:["1f450-1f3fb","1f450-1f3fc","1f450-1f3fd","1f450-1f3fe","1f450-1f3ff"]},{n:["person raising both hands in celebration","raised_hands"],u:"1f64c",v:["1f64c-1f3fb","1f64c-1f3fc","1f64c-1f3fd","1f64c-1f3fe","1f64c-1f3ff"]},{n:["palms up together","palms_up_together"],u:"1f932",v:["1f932-1f3fb","1f932-1f3fc","1f932-1f3fd","1f932-1f3fe","1f932-1f3ff"]},{n:["person with folded hands","pray"],u:"1f64f",v:["1f64f-1f3fb","1f64f-1f3fc","1f64f-1f3fd","1f64f-1f3fe","1f64f-1f3ff"]},{n:["handshake"],u:"1f91d"},{n:["nail polish","nail_care"],u:"1f485",v:["1f485-1f3fb","1f485-1f3fc","1f485-1f3fd","1f485-1f3fe","1f485-1f3ff"]},{n:["ear"],u:"1f442",v:["1f442-1f3fb","1f442-1f3fc","1f442-1f3fd","1f442-1f3fe","1f442-1f3ff"]},{n:["nose"],u:"1f443",v:["1f443-1f3fb","1f443-1f3fc","1f443-1f3fd","1f443-1f3fe","1f443-1f3ff"]},{n:["footprints"],u:"1f463"},{n:["eyes"],u:"1f440"},{n:["eye"],u:"1f441-fe0f"},{n:["eye-in-speech-bubble"],u:"1f441-fe0f-200d-1f5e8-fe0f"},{n:["brain"],u:"1f9e0"},{n:["tongue"],u:"1f445"},{n:["mouth","lips"],u:"1f444"},{n:["kiss mark","kiss"],u:"1f48b"},{n:["heart with arrow","cupid"],u:"1f498"},{n:["heavy black heart","heart"],u:"2764-fe0f"},{n:["beating heart","heartbeat"],u:"1f493"},{n:["broken heart","broken_heart"],u:"1f494"},{n:["two hearts","two_hearts"],u:"1f495"},{n:["sparkling heart","sparkling_heart"],u:"1f496"},{n:["growing heart","heartpulse"],u:"1f497"},{n:["blue heart","blue_heart"],u:"1f499"},{n:["green heart","green_heart"],u:"1f49a"},{n:["yellow heart","yellow_heart"],u:"1f49b"},{n:["orange heart","orange_heart"],u:"1f9e1"},{n:["purple heart","purple_heart"],u:"1f49c"},{n:["black heart","black_heart"],u:"1f5a4"},{n:["heart with ribbon","gift_heart"],u:"1f49d"},{n:["revolving hearts","revolving_hearts"],u:"1f49e"},{n:["heart decoration","heart_decoration"],u:"1f49f"},{n:["heavy_heart_exclamation_mark_ornament"],u:"2763-fe0f"},{n:["love letter","love_letter"],u:"1f48c"},{n:["sleeping symbol","zzz"],u:"1f4a4"},{n:["anger symbol","anger"],u:"1f4a2"},{n:["bomb"],u:"1f4a3"},{n:["collision symbol","boom","collision"],u:"1f4a5"},{n:["splashing sweat symbol","sweat_drops"],u:"1f4a6"},{n:["dash symbol","dash"],u:"1f4a8"},{n:["dizzy symbol","dizzy"],u:"1f4ab"},{n:["speech balloon","speech_balloon"],u:"1f4ac"},{n:["left_speech_bubble"],u:"1f5e8-fe0f"},{n:["right_anger_bubble"],u:"1f5ef-fe0f"},{n:["thought balloon","thought_balloon"],u:"1f4ad"},{n:["hole"],u:"1f573-fe0f"},{n:["eyeglasses"],u:"1f453"},{n:["dark_sunglasses"],u:"1f576-fe0f"},{n:["necktie"],u:"1f454"},{n:["t-shirt","shirt","tshirt"],u:"1f455"},{n:["jeans"],u:"1f456"},{n:["scarf"],u:"1f9e3"},{n:["gloves"],u:"1f9e4"},{n:["coat"],u:"1f9e5"},{n:["socks"],u:"1f9e6"},{n:["dress"],u:"1f457"},{n:["kimono"],u:"1f458"},{n:["bikini"],u:"1f459"},{n:["womans clothes","womans_clothes"],u:"1f45a"},{n:["purse"],u:"1f45b"},{n:["handbag"],u:"1f45c"},{n:["pouch"],u:"1f45d"},{n:["shopping_bags"],u:"1f6cd-fe0f"},{n:["school satchel","school_satchel"],u:"1f392"},{n:["mans shoe","mans_shoe","shoe"],u:"1f45e"},{n:["athletic shoe","athletic_shoe"],u:"1f45f"},{n:["high-heeled shoe","high_heel"],u:"1f460"},{n:["womans sandal","sandal"],u:"1f461"},{n:["womans boots","boot"],u:"1f462"},{n:["crown"],u:"1f451"},{n:["womans hat","womans_hat"],u:"1f452"},{n:["top hat","tophat"],u:"1f3a9"},{n:["graduation cap","mortar_board"],u:"1f393"},{n:["billed cap","billed_cap"],u:"1f9e2"},{n:["helmet_with_white_cross"],u:"26d1-fe0f"},{n:["prayer beads","prayer_beads"],u:"1f4ff"},{n:["lipstick"],u:"1f484"},{n:["ring"],u:"1f48d"},{n:["gem stone","gem"],u:"1f48e"}],TSr=[{n:["monkey face","monkey_face"],u:"1f435"},{n:["monkey"],u:"1f412"},{n:["gorilla"],u:"1f98d"},{n:["dog face","dog"],u:"1f436"},{n:["dog","dog2"],u:"1f415"},{n:["poodle"],u:"1f429"},{n:["wolf face","wolf"],u:"1f43a"},{n:["fox face","fox_face"],u:"1f98a"},{n:["cat face","cat"],u:"1f431"},{n:["cat","cat2"],u:"1f408"},{n:["lion face","lion_face"],u:"1f981"},{n:["tiger face","tiger"],u:"1f42f"},{n:["tiger","tiger2"],u:"1f405"},{n:["leopard"],u:"1f406"},{n:["horse face","horse"],u:"1f434"},{n:["horse","racehorse"],u:"1f40e"},{n:["unicorn face","unicorn_face"],u:"1f984"},{n:["zebra face","zebra_face"],u:"1f993"},{n:["deer"],u:"1f98c"},{n:["cow face","cow"],u:"1f42e"},{n:["ox"],u:"1f402"},{n:["water buffalo","water_buffalo"],u:"1f403"},{n:["cow","cow2"],u:"1f404"},{n:["pig face","pig"],u:"1f437"},{n:["pig","pig2"],u:"1f416"},{n:["boar"],u:"1f417"},{n:["pig nose","pig_nose"],u:"1f43d"},{n:["ram"],u:"1f40f"},{n:["sheep"],u:"1f411"},{n:["goat"],u:"1f410"},{n:["dromedary camel","dromedary_camel"],u:"1f42a"},{n:["bactrian camel","camel"],u:"1f42b"},{n:["giraffe face","giraffe_face"],u:"1f992"},{n:["elephant"],u:"1f418"},{n:["rhinoceros"],u:"1f98f"},{n:["mouse face","mouse"],u:"1f42d"},{n:["mouse","mouse2"],u:"1f401"},{n:["rat"],u:"1f400"},{n:["hamster face","hamster"],u:"1f439"},{n:["rabbit face","rabbit"],u:"1f430"},{n:["rabbit","rabbit2"],u:"1f407"},{n:["chipmunk"],u:"1f43f-fe0f"},{n:["hedgehog"],u:"1f994"},{n:["bat"],u:"1f987"},{n:["bear face","bear"],u:"1f43b"},{n:["koala"],u:"1f428"},{n:["panda face","panda_face"],u:"1f43c"},{n:["paw prints","feet","paw_prints"],u:"1f43e"},{n:["turkey"],u:"1f983"},{n:["chicken"],u:"1f414"},{n:["rooster"],u:"1f413"},{n:["hatching chick","hatching_chick"],u:"1f423"},{n:["baby chick","baby_chick"],u:"1f424"},{n:["front-facing baby chick","hatched_chick"],u:"1f425"},{n:["bird"],u:"1f426"},{n:["penguin"],u:"1f427"},{n:["dove_of_peace"],u:"1f54a-fe0f"},{n:["eagle"],u:"1f985"},{n:["duck"],u:"1f986"},{n:["owl"],u:"1f989"},{n:["frog face","frog"],u:"1f438"},{n:["crocodile"],u:"1f40a"},{n:["turtle"],u:"1f422"},{n:["lizard"],u:"1f98e"},{n:["snake"],u:"1f40d"},{n:["dragon face","dragon_face"],u:"1f432"},{n:["dragon"],u:"1f409"},{n:["sauropod"],u:"1f995"},{n:["t-rex"],u:"1f996"},{n:["spouting whale","whale"],u:"1f433"},{n:["whale","whale2"],u:"1f40b"},{n:["dolphin","flipper"],u:"1f42c"},{n:["fish"],u:"1f41f"},{n:["tropical fish","tropical_fish"],u:"1f420"},{n:["blowfish"],u:"1f421"},{n:["shark"],u:"1f988"},{n:["octopus"],u:"1f419"},{n:["spiral shell","shell"],u:"1f41a"},{n:["crab"],u:"1f980"},{n:["shrimp"],u:"1f990"},{n:["squid"],u:"1f991"},{n:["snail"],u:"1f40c"},{n:["butterfly"],u:"1f98b"},{n:["bug"],u:"1f41b"},{n:["ant"],u:"1f41c"},{n:["honeybee","bee"],u:"1f41d"},{n:["lady beetle","beetle"],u:"1f41e"},{n:["cricket"],u:"1f997"},{n:["spider"],u:"1f577-fe0f"},{n:["spider_web"],u:"1f578-fe0f"},{n:["scorpion"],u:"1f982"},{n:["bouquet"],u:"1f490"},{n:["cherry blossom","cherry_blossom"],u:"1f338"},{n:["white flower","white_flower"],u:"1f4ae"},{n:["rosette"],u:"1f3f5-fe0f"},{n:["rose"],u:"1f339"},{n:["wilted flower","wilted_flower"],u:"1f940"},{n:["hibiscus"],u:"1f33a"},{n:["sunflower"],u:"1f33b"},{n:["blossom"],u:"1f33c"},{n:["tulip"],u:"1f337"},{n:["seedling"],u:"1f331"},{n:["evergreen tree","evergreen_tree"],u:"1f332"},{n:["deciduous tree","deciduous_tree"],u:"1f333"},{n:["palm tree","palm_tree"],u:"1f334"},{n:["cactus"],u:"1f335"},{n:["ear of rice","ear_of_rice"],u:"1f33e"},{n:["herb"],u:"1f33f"},{n:["shamrock"],u:"2618-fe0f"},{n:["four leaf clover","four_leaf_clover"],u:"1f340"},{n:["maple leaf","maple_leaf"],u:"1f341"},{n:["fallen leaf","fallen_leaf"],u:"1f342"},{n:["leaf fluttering in wind","leaves"],u:"1f343"}],OSr=[{n:["grapes"],u:"1f347"},{n:["melon"],u:"1f348"},{n:["watermelon"],u:"1f349"},{n:["tangerine"],u:"1f34a"},{n:["lemon"],u:"1f34b"},{n:["banana"],u:"1f34c"},{n:["pineapple"],u:"1f34d"},{n:["red apple","apple"],u:"1f34e"},{n:["green apple","green_apple"],u:"1f34f"},{n:["pear"],u:"1f350"},{n:["peach"],u:"1f351"},{n:["cherries"],u:"1f352"},{n:["strawberry"],u:"1f353"},{n:["kiwifruit"],u:"1f95d"},{n:["tomato"],u:"1f345"},{n:["coconut"],u:"1f965"},{n:["avocado"],u:"1f951"},{n:["aubergine","eggplant"],u:"1f346"},{n:["potato"],u:"1f954"},{n:["carrot"],u:"1f955"},{n:["ear of maize","corn"],u:"1f33d"},{n:["hot_pepper"],u:"1f336-fe0f"},{n:["cucumber"],u:"1f952"},{n:["broccoli"],u:"1f966"},{n:["mushroom"],u:"1f344"},{n:["peanuts"],u:"1f95c"},{n:["chestnut"],u:"1f330"},{n:["bread"],u:"1f35e"},{n:["croissant"],u:"1f950"},{n:["baguette bread","baguette_bread"],u:"1f956"},{n:["pretzel"],u:"1f968"},{n:["pancakes"],u:"1f95e"},{n:["cheese wedge","cheese_wedge"],u:"1f9c0"},{n:["meat on bone","meat_on_bone"],u:"1f356"},{n:["poultry leg","poultry_leg"],u:"1f357"},{n:["cut of meat","cut_of_meat"],u:"1f969"},{n:["bacon"],u:"1f953"},{n:["hamburger"],u:"1f354"},{n:["french fries","fries"],u:"1f35f"},{n:["slice of pizza","pizza"],u:"1f355"},{n:["hot dog","hotdog"],u:"1f32d"},{n:["sandwich"],u:"1f96a"},{n:["taco"],u:"1f32e"},{n:["burrito"],u:"1f32f"},{n:["stuffed flatbread","stuffed_flatbread"],u:"1f959"},{n:["egg"],u:"1f95a"},{n:["cooking","fried_egg"],u:"1f373"},{n:["shallow pan of food","shallow_pan_of_food"],u:"1f958"},{n:["pot of food","stew"],u:"1f372"},{n:["bowl with spoon","bowl_with_spoon"],u:"1f963"},{n:["green salad","green_salad"],u:"1f957"},{n:["popcorn"],u:"1f37f"},{n:["canned food","canned_food"],u:"1f96b"},{n:["bento box","bento"],u:"1f371"},{n:["rice cracker","rice_cracker"],u:"1f358"},{n:["rice ball","rice_ball"],u:"1f359"},{n:["cooked rice","rice"],u:"1f35a"},{n:["curry and rice","curry"],u:"1f35b"},{n:["steaming bowl","ramen"],u:"1f35c"},{n:["spaghetti"],u:"1f35d"},{n:["roasted sweet potato","sweet_potato"],u:"1f360"},{n:["oden"],u:"1f362"},{n:["sushi"],u:"1f363"},{n:["fried shrimp","fried_shrimp"],u:"1f364"},{n:["fish cake with swirl design","fish_cake"],u:"1f365"},{n:["dango"],u:"1f361"},{n:["dumpling"],u:"1f95f"},{n:["fortune cookie","fortune_cookie"],u:"1f960"},{n:["takeout box","takeout_box"],u:"1f961"},{n:["soft ice cream","icecream"],u:"1f366"},{n:["shaved ice","shaved_ice"],u:"1f367"},{n:["ice cream","ice_cream"],u:"1f368"},{n:["doughnut"],u:"1f369"},{n:["cookie"],u:"1f36a"},{n:["birthday cake","birthday"],u:"1f382"},{n:["shortcake","cake"],u:"1f370"},{n:["pie"],u:"1f967"},{n:["chocolate bar","chocolate_bar"],u:"1f36b"},{n:["candy"],u:"1f36c"},{n:["lollipop"],u:"1f36d"},{n:["custard"],u:"1f36e"},{n:["honey pot","honey_pot"],u:"1f36f"},{n:["baby bottle","baby_bottle"],u:"1f37c"},{n:["glass of milk","glass_of_milk"],u:"1f95b"},{n:["hot beverage","coffee"],u:"2615"},{n:["teacup without handle","tea"],u:"1f375"},{n:["sake bottle and cup","sake"],u:"1f376"},{n:["bottle with popping cork","champagne"],u:"1f37e"},{n:["wine glass","wine_glass"],u:"1f377"},{n:["cocktail glass","cocktail"],u:"1f378"},{n:["tropical drink","tropical_drink"],u:"1f379"},{n:["beer mug","beer"],u:"1f37a"},{n:["clinking beer mugs","beers"],u:"1f37b"},{n:["clinking glasses","clinking_glasses"],u:"1f942"},{n:["tumbler glass","tumbler_glass"],u:"1f943"},{n:["cup with straw","cup_with_straw"],u:"1f964"},{n:["chopsticks"],u:"1f962"},{n:["knife_fork_plate"],u:"1f37d-fe0f"},{n:["fork and knife","fork_and_knife"],u:"1f374"},{n:["spoon"],u:"1f944"},{n:["hocho","knife"],u:"1f52a"},{n:["amphora"],u:"1f3fa"}],mSr=[{n:["jack-o-lantern","jack_o_lantern"],u:"1f383"},{n:["christmas tree","christmas_tree"],u:"1f384"},{n:["fireworks"],u:"1f386"},{n:["firework sparkler","sparkler"],u:"1f387"},{n:["sparkles"],u:"2728"},{n:["balloon"],u:"1f388"},{n:["party popper","tada"],u:"1f389"},{n:["confetti ball","confetti_ball"],u:"1f38a"},{n:["tanabata tree","tanabata_tree"],u:"1f38b"},{n:["pine decoration","bamboo"],u:"1f38d"},{n:["japanese dolls","dolls"],u:"1f38e"},{n:["carp streamer","flags"],u:"1f38f"},{n:["wind chime","wind_chime"],u:"1f390"},{n:["moon viewing ceremony","rice_scene"],u:"1f391"},{n:["ribbon"],u:"1f380"},{n:["wrapped present","gift"],u:"1f381"},{n:["reminder_ribbon"],u:"1f397-fe0f"},{n:["admission_tickets"],u:"1f39f-fe0f"},{n:["ticket"],u:"1f3ab"},{n:["medal"],u:"1f396-fe0f"},{n:["trophy"],u:"1f3c6"},{n:["sports medal","sports_medal"],u:"1f3c5"},{n:["first place medal","first_place_medal"],u:"1f947"},{n:["second place medal","second_place_medal"],u:"1f948"},{n:["third place medal","third_place_medal"],u:"1f949"},{n:["soccer ball","soccer"],u:"26bd"},{n:["baseball"],u:"26be"},{n:["basketball and hoop","basketball"],u:"1f3c0"},{n:["volleyball"],u:"1f3d0"},{n:["american football","football"],u:"1f3c8"},{n:["rugby football","rugby_football"],u:"1f3c9"},{n:["tennis racquet and ball","tennis"],u:"1f3be"},{n:["billiards","8ball"],u:"1f3b1"},{n:["bowling"],u:"1f3b3"},{n:["cricket bat and ball","cricket_bat_and_ball"],u:"1f3cf"},{n:["field hockey stick and ball","field_hockey_stick_and_ball"],u:"1f3d1"},{n:["ice hockey stick and puck","ice_hockey_stick_and_puck"],u:"1f3d2"},{n:["table tennis paddle and ball","table_tennis_paddle_and_ball"],u:"1f3d3"},{n:["badminton racquet and shuttlecock","badminton_racquet_and_shuttlecock"],u:"1f3f8"},{n:["boxing glove","boxing_glove"],u:"1f94a"},{n:["martial arts uniform","martial_arts_uniform"],u:"1f94b"},{n:["goal net","goal_net"],u:"1f945"},{n:["direct hit","dart"],u:"1f3af"},{n:["flag in hole","golf"],u:"26f3"},{n:["ice_skate"],u:"26f8-fe0f"},{n:["fishing pole and fish","fishing_pole_and_fish"],u:"1f3a3"},{n:["running shirt with sash","running_shirt_with_sash"],u:"1f3bd"},{n:["ski and ski boot","ski"],u:"1f3bf"},{n:["sled"],u:"1f6f7"},{n:["curling stone","curling_stone"],u:"1f94c"},{n:["video game","video_game"],u:"1f3ae"},{n:["joystick"],u:"1f579-fe0f"},{n:["game die","game_die"],u:"1f3b2"},{n:["black spade suit","spades"],u:"2660-fe0f"},{n:["black heart suit","hearts"],u:"2665-fe0f"},{n:["black diamond suit","diamonds"],u:"2666-fe0f"},{n:["black club suit","clubs"],u:"2663-fe0f"},{n:["playing card black joker","black_joker"],u:"1f0cf"},{n:["mahjong tile red dragon","mahjong"],u:"1f004"},{n:["flower playing cards","flower_playing_cards"],u:"1f3b4"}],gSr=[{n:["earth globe europe-africa","earth_africa"],u:"1f30d"},{n:["earth globe americas","earth_americas"],u:"1f30e"},{n:["earth globe asia-australia","earth_asia"],u:"1f30f"},{n:["globe with meridians","globe_with_meridians"],u:"1f310"},{n:["world_map"],u:"1f5fa-fe0f"},{n:["silhouette of japan","japan"],u:"1f5fe"},{n:["snow_capped_mountain"],u:"1f3d4-fe0f"},{n:["mountain"],u:"26f0-fe0f"},{n:["volcano"],u:"1f30b"},{n:["mount fuji","mount_fuji"],u:"1f5fb"},{n:["camping"],u:"1f3d5-fe0f"},{n:["beach_with_umbrella"],u:"1f3d6-fe0f"},{n:["desert"],u:"1f3dc-fe0f"},{n:["desert_island"],u:"1f3dd-fe0f"},{n:["national_park"],u:"1f3de-fe0f"},{n:["stadium"],u:"1f3df-fe0f"},{n:["classical_building"],u:"1f3db-fe0f"},{n:["building_construction"],u:"1f3d7-fe0f"},{n:["house_buildings"],u:"1f3d8-fe0f"},{n:["cityscape"],u:"1f3d9-fe0f"},{n:["derelict_house_building"],u:"1f3da-fe0f"},{n:["house building","house"],u:"1f3e0"},{n:["house with garden","house_with_garden"],u:"1f3e1"},{n:["office building","office"],u:"1f3e2"},{n:["japanese post office","post_office"],u:"1f3e3"},{n:["european post office","european_post_office"],u:"1f3e4"},{n:["hospital"],u:"1f3e5"},{n:["bank"],u:"1f3e6"},{n:["hotel"],u:"1f3e8"},{n:["love hotel","love_hotel"],u:"1f3e9"},{n:["convenience store","convenience_store"],u:"1f3ea"},{n:["school"],u:"1f3eb"},{n:["department store","department_store"],u:"1f3ec"},{n:["factory"],u:"1f3ed"},{n:["japanese castle","japanese_castle"],u:"1f3ef"},{n:["european castle","european_castle"],u:"1f3f0"},{n:["wedding"],u:"1f492"},{n:["tokyo tower","tokyo_tower"],u:"1f5fc"},{n:["statue of liberty","statue_of_liberty"],u:"1f5fd"},{n:["church"],u:"26ea"},{n:["mosque"],u:"1f54c"},{n:["synagogue"],u:"1f54d"},{n:["shinto_shrine"],u:"26e9-fe0f"},{n:["kaaba"],u:"1f54b"},{n:["fountain"],u:"26f2"},{n:["tent"],u:"26fa"},{n:["foggy"],u:"1f301"},{n:["night with stars","night_with_stars"],u:"1f303"},{n:["sunrise over mountains","sunrise_over_mountains"],u:"1f304"},{n:["sunrise"],u:"1f305"},{n:["cityscape at dusk","city_sunset"],u:"1f306"},{n:["sunset over buildings","city_sunrise"],u:"1f307"},{n:["bridge at night","bridge_at_night"],u:"1f309"},{n:["hot springs","hotsprings"],u:"2668-fe0f"},{n:["milky way","milky_way"],u:"1f30c"},{n:["carousel horse","carousel_horse"],u:"1f3a0"},{n:["ferris wheel","ferris_wheel"],u:"1f3a1"},{n:["roller coaster","roller_coaster"],u:"1f3a2"},{n:["barber pole","barber"],u:"1f488"},{n:["circus tent","circus_tent"],u:"1f3aa"},{n:["performing arts","performing_arts"],u:"1f3ad"},{n:["frame_with_picture"],u:"1f5bc-fe0f"},{n:["artist palette","art"],u:"1f3a8"},{n:["slot machine","slot_machine"],u:"1f3b0"},{n:["steam locomotive","steam_locomotive"],u:"1f682"},{n:["railway car","railway_car"],u:"1f683"},{n:["high-speed train","bullettrain_side"],u:"1f684"},{n:["high-speed train with bullet nose","bullettrain_front"],u:"1f685"},{n:["train","train2"],u:"1f686"},{n:["metro"],u:"1f687"},{n:["light rail","light_rail"],u:"1f688"},{n:["station"],u:"1f689"},{n:["tram"],u:"1f68a"},{n:["monorail"],u:"1f69d"},{n:["mountain railway","mountain_railway"],u:"1f69e"},{n:["tram car","train"],u:"1f68b"},{n:["bus"],u:"1f68c"},{n:["oncoming bus","oncoming_bus"],u:"1f68d"},{n:["trolleybus"],u:"1f68e"},{n:["minibus"],u:"1f690"},{n:["ambulance"],u:"1f691"},{n:["fire engine","fire_engine"],u:"1f692"},{n:["police car","police_car"],u:"1f693"},{n:["oncoming police car","oncoming_police_car"],u:"1f694"},{n:["taxi"],u:"1f695"},{n:["oncoming taxi","oncoming_taxi"],u:"1f696"},{n:["automobile","car","red_car"],u:"1f697"},{n:["oncoming automobile","oncoming_automobile"],u:"1f698"},{n:["recreational vehicle","blue_car"],u:"1f699"},{n:["delivery truck","truck"],u:"1f69a"},{n:["articulated lorry","articulated_lorry"],u:"1f69b"},{n:["tractor"],u:"1f69c"},{n:["bicycle","bike"],u:"1f6b2"},{n:["scooter"],u:"1f6f4"},{n:["motor scooter","motor_scooter"],u:"1f6f5"},{n:["bus stop","busstop"],u:"1f68f"},{n:["motorway"],u:"1f6e3-fe0f"},{n:["railway_track"],u:"1f6e4-fe0f"},{n:["fuel pump","fuelpump"],u:"26fd"},{n:["police cars revolving light","rotating_light"],u:"1f6a8"},{n:["horizontal traffic light","traffic_light"],u:"1f6a5"},{n:["vertical traffic light","vertical_traffic_light"],u:"1f6a6"},{n:["construction sign","construction"],u:"1f6a7"},{n:["octagonal sign","octagonal_sign"],u:"1f6d1"},{n:["anchor"],u:"2693"},{n:["sailboat","boat"],u:"26f5"},{n:["canoe"],u:"1f6f6"},{n:["speedboat"],u:"1f6a4"},{n:["passenger_ship"],u:"1f6f3-fe0f"},{n:["ferry"],u:"26f4-fe0f"},{n:["motor_boat"],u:"1f6e5-fe0f"},{n:["ship"],u:"1f6a2"},{n:["airplane"],u:"2708-fe0f"},{n:["small_airplane"],u:"1f6e9-fe0f"},{n:["airplane departure","airplane_departure"],u:"1f6eb"},{n:["airplane arriving","airplane_arriving"],u:"1f6ec"},{n:["seat"],u:"1f4ba"},{n:["helicopter"],u:"1f681"},{n:["suspension railway","suspension_railway"],u:"1f69f"},{n:["mountain cableway","mountain_cableway"],u:"1f6a0"},{n:["aerial tramway","aerial_tramway"],u:"1f6a1"},{n:["satellite"],u:"1f6f0-fe0f"},{n:["rocket"],u:"1f680"},{n:["flying saucer","flying_saucer"],u:"1f6f8"},{n:["bellhop_bell"],u:"1f6ce-fe0f"},{n:["door"],u:"1f6aa"},{n:["bed"],u:"1f6cf-fe0f"},{n:["couch_and_lamp"],u:"1f6cb-fe0f"},{n:["toilet"],u:"1f6bd"},{n:["shower"],u:"1f6bf"},{n:["bathtub"],u:"1f6c1"},{n:["hourglass"],u:"231b"},{n:["hourglass with flowing sand","hourglass_flowing_sand"],u:"23f3"},{n:["watch"],u:"231a"},{n:["alarm clock","alarm_clock"],u:"23f0"},{n:["stopwatch"],u:"23f1-fe0f"},{n:["timer_clock"],u:"23f2-fe0f"},{n:["mantelpiece_clock"],u:"1f570-fe0f"},{n:["clock face twelve oclock","clock12"],u:"1f55b"},{n:["clock face twelve-thirty","clock1230"],u:"1f567"},{n:["clock face one oclock","clock1"],u:"1f550"},{n:["clock face one-thirty","clock130"],u:"1f55c"},{n:["clock face two oclock","clock2"],u:"1f551"},{n:["clock face two-thirty","clock230"],u:"1f55d"},{n:["clock face three oclock","clock3"],u:"1f552"},{n:["clock face three-thirty","clock330"],u:"1f55e"},{n:["clock face four oclock","clock4"],u:"1f553"},{n:["clock face four-thirty","clock430"],u:"1f55f"},{n:["clock face five oclock","clock5"],u:"1f554"},{n:["clock face five-thirty","clock530"],u:"1f560"},{n:["clock face six oclock","clock6"],u:"1f555"},{n:["clock face six-thirty","clock630"],u:"1f561"},{n:["clock face seven oclock","clock7"],u:"1f556"},{n:["clock face seven-thirty","clock730"],u:"1f562"},{n:["clock face eight oclock","clock8"],u:"1f557"},{n:["clock face eight-thirty","clock830"],u:"1f563"},{n:["clock face nine oclock","clock9"],u:"1f558"},{n:["clock face nine-thirty","clock930"],u:"1f564"},{n:["clock face ten oclock","clock10"],u:"1f559"},{n:["clock face ten-thirty","clock1030"],u:"1f565"},{n:["clock face eleven oclock","clock11"],u:"1f55a"},{n:["clock face eleven-thirty","clock1130"],u:"1f566"},{n:["new moon symbol","new_moon"],u:"1f311"},{n:["waxing crescent moon symbol","waxing_crescent_moon"],u:"1f312"},{n:["first quarter moon symbol","first_quarter_moon"],u:"1f313"},{n:["waxing gibbous moon symbol","moon","waxing_gibbous_moon"],u:"1f314"},{n:["full moon symbol","full_moon"],u:"1f315"},{n:["waning gibbous moon symbol","waning_gibbous_moon"],u:"1f316"},{n:["last quarter moon symbol","last_quarter_moon"],u:"1f317"},{n:["waning crescent moon symbol","waning_crescent_moon"],u:"1f318"},{n:["crescent moon","crescent_moon"],u:"1f319"},{n:["new moon with face","new_moon_with_face"],u:"1f31a"},{n:["first quarter moon with face","first_quarter_moon_with_face"],u:"1f31b"},{n:["last quarter moon with face","last_quarter_moon_with_face"],u:"1f31c"},{n:["thermometer"],u:"1f321-fe0f"},{n:["black sun with rays","sunny"],u:"2600-fe0f"},{n:["full moon with face","full_moon_with_face"],u:"1f31d"},{n:["sun with face","sun_with_face"],u:"1f31e"},{n:["white medium star","star"],u:"2b50"},{n:["glowing star","star2"],u:"1f31f"},{n:["shooting star","stars"],u:"1f320"},{n:["cloud"],u:"2601-fe0f"},{n:["sun behind cloud","partly_sunny"],u:"26c5"},{n:["thunder_cloud_and_rain"],u:"26c8-fe0f"},{n:["mostly_sunny","sun_small_cloud"],u:"1f324-fe0f"},{n:["barely_sunny","sun_behind_cloud"],u:"1f325-fe0f"},{n:["partly_sunny_rain","sun_behind_rain_cloud"],u:"1f326-fe0f"},{n:["rain_cloud"],u:"1f327-fe0f"},{n:["snow_cloud"],u:"1f328-fe0f"},{n:["lightning","lightning_cloud"],u:"1f329-fe0f"},{n:["tornado","tornado_cloud"],u:"1f32a-fe0f"},{n:["fog"],u:"1f32b-fe0f"},{n:["wind_blowing_face"],u:"1f32c-fe0f"},{n:["cyclone"],u:"1f300"},{n:["rainbow"],u:"1f308"},{n:["closed umbrella","closed_umbrella"],u:"1f302"},{n:["umbrella"],u:"2602-fe0f"},{n:["umbrella with rain drops","umbrella_with_rain_drops"],u:"2614"},{n:["umbrella_on_ground"],u:"26f1-fe0f"},{n:["high voltage sign","zap"],u:"26a1"},{n:["snowflake"],u:"2744-fe0f"},{n:["snowman"],u:"2603-fe0f"},{n:["snowman without snow","snowman_without_snow"],u:"26c4"},{n:["comet"],u:"2604-fe0f"},{n:["fire"],u:"1f525"},{n:["droplet"],u:"1f4a7"},{n:["water wave","ocean"],u:"1f30a"}],QSr=[{n:["speaker with cancellation stroke","mute"],u:"1f507"},{n:["speaker"],u:"1f508"},{n:["speaker with one sound wave","sound"],u:"1f509"},{n:["speaker with three sound waves","loud_sound"],u:"1f50a"},{n:["public address loudspeaker","loudspeaker"],u:"1f4e2"},{n:["cheering megaphone","mega"],u:"1f4e3"},{n:["postal horn","postal_horn"],u:"1f4ef"},{n:["bell"],u:"1f514"},{n:["bell with cancellation stroke","no_bell"],u:"1f515"},{n:["musical score","musical_score"],u:"1f3bc"},{n:["musical note","musical_note"],u:"1f3b5"},{n:["multiple musical notes","notes"],u:"1f3b6"},{n:["studio_microphone"],u:"1f399-fe0f"},{n:["level_slider"],u:"1f39a-fe0f"},{n:["control_knobs"],u:"1f39b-fe0f"},{n:["microphone"],u:"1f3a4"},{n:["headphone","headphones"],u:"1f3a7"},{n:["radio"],u:"1f4fb"},{n:["saxophone"],u:"1f3b7"},{n:["guitar"],u:"1f3b8"},{n:["musical keyboard","musical_keyboard"],u:"1f3b9"},{n:["trumpet"],u:"1f3ba"},{n:["violin"],u:"1f3bb"},{n:["drum with drumsticks","drum_with_drumsticks"],u:"1f941"},{n:["mobile phone","iphone"],u:"1f4f1"},{n:["mobile phone with rightwards arrow at left","calling"],u:"1f4f2"},{n:["black telephone","phone","telephone"],u:"260e-fe0f"},{n:["telephone receiver","telephone_receiver"],u:"1f4de"},{n:["pager"],u:"1f4df"},{n:["fax machine","fax"],u:"1f4e0"},{n:["battery"],u:"1f50b"},{n:["electric plug","electric_plug"],u:"1f50c"},{n:["personal computer","computer"],u:"1f4bb"},{n:["desktop_computer"],u:"1f5a5-fe0f"},{n:["printer"],u:"1f5a8-fe0f"},{n:["keyboard"],u:"2328-fe0f"},{n:["three_button_mouse"],u:"1f5b1-fe0f"},{n:["trackball"],u:"1f5b2-fe0f"},{n:["minidisc"],u:"1f4bd"},{n:["floppy disk","floppy_disk"],u:"1f4be"},{n:["optical disc","cd"],u:"1f4bf"},{n:["dvd"],u:"1f4c0"},{n:["movie camera","movie_camera"],u:"1f3a5"},{n:["film_frames"],u:"1f39e-fe0f"},{n:["film_projector"],u:"1f4fd-fe0f"},{n:["clapper board","clapper"],u:"1f3ac"},{n:["television","tv"],u:"1f4fa"},{n:["camera"],u:"1f4f7"},{n:["camera with flash","camera_with_flash"],u:"1f4f8"},{n:["video camera","video_camera"],u:"1f4f9"},{n:["videocassette","vhs"],u:"1f4fc"},{n:["left-pointing magnifying glass","mag"],u:"1f50d"},{n:["right-pointing magnifying glass","mag_right"],u:"1f50e"},{n:["microscope"],u:"1f52c"},{n:["telescope"],u:"1f52d"},{n:["satellite antenna","satellite_antenna"],u:"1f4e1"},{n:["candle"],u:"1f56f-fe0f"},{n:["electric light bulb","bulb"],u:"1f4a1"},{n:["electric torch","flashlight"],u:"1f526"},{n:["izakaya lantern","izakaya_lantern","lantern"],u:"1f3ee"},{n:["notebook with decorative cover","notebook_with_decorative_cover"],u:"1f4d4"},{n:["closed book","closed_book"],u:"1f4d5"},{n:["open book","book","open_book"],u:"1f4d6"},{n:["green book","green_book"],u:"1f4d7"},{n:["blue book","blue_book"],u:"1f4d8"},{n:["orange book","orange_book"],u:"1f4d9"},{n:["books"],u:"1f4da"},{n:["notebook"],u:"1f4d3"},{n:["ledger"],u:"1f4d2"},{n:["page with curl","page_with_curl"],u:"1f4c3"},{n:["scroll"],u:"1f4dc"},{n:["page facing up","page_facing_up"],u:"1f4c4"},{n:["newspaper"],u:"1f4f0"},{n:["rolled_up_newspaper"],u:"1f5de-fe0f"},{n:["bookmark tabs","bookmark_tabs"],u:"1f4d1"},{n:["bookmark"],u:"1f516"},{n:["label"],u:"1f3f7-fe0f"},{n:["money bag","moneybag"],u:"1f4b0"},{n:["banknote with yen sign","yen"],u:"1f4b4"},{n:["banknote with dollar sign","dollar"],u:"1f4b5"},{n:["banknote with euro sign","euro"],u:"1f4b6"},{n:["banknote with pound sign","pound"],u:"1f4b7"},{n:["money with wings","money_with_wings"],u:"1f4b8"},{n:["credit card","credit_card"],u:"1f4b3"},{n:["chart with upwards trend and yen sign","chart"],u:"1f4b9"},{n:["currency exchange","currency_exchange"],u:"1f4b1"},{n:["heavy dollar sign","heavy_dollar_sign"],u:"1f4b2"},{n:["envelope","email"],u:"2709-fe0f"},{n:["e-mail symbol","e-mail"],u:"1f4e7"},{n:["incoming envelope","incoming_envelope"],u:"1f4e8"},{n:["envelope with downwards arrow above","envelope_with_arrow"],u:"1f4e9"},{n:["outbox tray","outbox_tray"],u:"1f4e4"},{n:["inbox tray","inbox_tray"],u:"1f4e5"},{n:["package"],u:"1f4e6"},{n:["closed mailbox with raised flag","mailbox"],u:"1f4eb"},{n:["closed mailbox with lowered flag","mailbox_closed"],u:"1f4ea"},{n:["open mailbox with raised flag","mailbox_with_mail"],u:"1f4ec"},{n:["open mailbox with lowered flag","mailbox_with_no_mail"],u:"1f4ed"},{n:["postbox"],u:"1f4ee"},{n:["ballot_box_with_ballot"],u:"1f5f3-fe0f"},{n:["pencil","pencil2"],u:"270f-fe0f"},{n:["black nib","black_nib"],u:"2712-fe0f"},{n:["lower_left_fountain_pen"],u:"1f58b-fe0f"},{n:["lower_left_ballpoint_pen"],u:"1f58a-fe0f"},{n:["lower_left_paintbrush"],u:"1f58c-fe0f"},{n:["lower_left_crayon"],u:"1f58d-fe0f"},{n:["memo","pencil"],u:"1f4dd"},{n:["briefcase"],u:"1f4bc"},{n:["file folder","file_folder"],u:"1f4c1"},{n:["open file folder","open_file_folder"],u:"1f4c2"},{n:["card_index_dividers"],u:"1f5c2-fe0f"},{n:["calendar","date"],u:"1f4c5"},{n:["tear-off calendar","calendar"],u:"1f4c6"},{n:["spiral_note_pad"],u:"1f5d2-fe0f"},{n:["spiral_calendar_pad"],u:"1f5d3-fe0f"},{n:["card index","card_index"],u:"1f4c7"},{n:["chart with upwards trend","chart_with_upwards_trend"],u:"1f4c8"},{n:["chart with downwards trend","chart_with_downwards_trend"],u:"1f4c9"},{n:["bar chart","bar_chart"],u:"1f4ca"},{n:["clipboard"],u:"1f4cb"},{n:["pushpin"],u:"1f4cc"},{n:["round pushpin","round_pushpin"],u:"1f4cd"},{n:["paperclip"],u:"1f4ce"},{n:["linked_paperclips"],u:"1f587-fe0f"},{n:["straight ruler","straight_ruler"],u:"1f4cf"},{n:["triangular ruler","triangular_ruler"],u:"1f4d0"},{n:["black scissors","scissors"],u:"2702-fe0f"},{n:["card_file_box"],u:"1f5c3-fe0f"},{n:["file_cabinet"],u:"1f5c4-fe0f"},{n:["wastebasket"],u:"1f5d1-fe0f"},{n:["lock"],u:"1f512"},{n:["open lock","unlock"],u:"1f513"},{n:["lock with ink pen","lock_with_ink_pen"],u:"1f50f"},{n:["closed lock with key","closed_lock_with_key"],u:"1f510"},{n:["key"],u:"1f511"},{n:["old_key"],u:"1f5dd-fe0f"},{n:["hammer"],u:"1f528"},{n:["pick"],u:"26cf-fe0f"},{n:["hammer_and_pick"],u:"2692-fe0f"},{n:["hammer_and_wrench"],u:"1f6e0-fe0f"},{n:["dagger_knife"],u:"1f5e1-fe0f"},{n:["crossed_swords"],u:"2694-fe0f"},{n:["pistol","gun"],u:"1f52b"},{n:["bow and arrow","bow_and_arrow"],u:"1f3f9"},{n:["shield"],u:"1f6e1-fe0f"},{n:["wrench"],u:"1f527"},{n:["nut and bolt","nut_and_bolt"],u:"1f529"},{n:["gear"],u:"2699-fe0f"},{n:["compression"],u:"1f5dc-fe0f"},{n:["alembic"],u:"2697-fe0f"},{n:["scales"],u:"2696-fe0f"},{n:["link symbol","link"],u:"1f517"},{n:["chains"],u:"26d3-fe0f"},{n:["syringe"],u:"1f489"},{n:["pill"],u:"1f48a"},{n:["smoking symbol","smoking"],u:"1f6ac"},{n:["coffin"],u:"26b0-fe0f"},{n:["funeral_urn"],u:"26b1-fe0f"},{n:["moyai"],u:"1f5ff"},{n:["oil_drum"],u:"1f6e2-fe0f"},{n:["crystal ball","crystal_ball"],u:"1f52e"},{n:["shopping trolley","shopping_trolley"],u:"1f6d2"}],_Sr=[{n:["automated teller machine","atm"],u:"1f3e7"},{n:["put litter in its place symbol","put_litter_in_its_place"],u:"1f6ae"},{n:["potable water symbol","potable_water"],u:"1f6b0"},{n:["wheelchair symbol","wheelchair"],u:"267f"},{n:["mens symbol","mens"],u:"1f6b9"},{n:["womens symbol","womens"],u:"1f6ba"},{n:["restroom"],u:"1f6bb"},{n:["baby symbol","baby_symbol"],u:"1f6bc"},{n:["water closet","wc"],u:"1f6be"},{n:["passport control","passport_control"],u:"1f6c2"},{n:["customs"],u:"1f6c3"},{n:["baggage claim","baggage_claim"],u:"1f6c4"},{n:["left luggage","left_luggage"],u:"1f6c5"},{n:["warning sign","warning"],u:"26a0-fe0f"},{n:["children crossing","children_crossing"],u:"1f6b8"},{n:["no entry","no_entry"],u:"26d4"},{n:["no entry sign","no_entry_sign"],u:"1f6ab"},{n:["no bicycles","no_bicycles"],u:"1f6b3"},{n:["no smoking symbol","no_smoking"],u:"1f6ad"},{n:["do not litter symbol","do_not_litter"],u:"1f6af"},{n:["non-potable water symbol","non-potable_water"],u:"1f6b1"},{n:["no pedestrians","no_pedestrians"],u:"1f6b7"},{n:["no mobile phones","no_mobile_phones"],u:"1f4f5"},{n:["no one under eighteen symbol","underage"],u:"1f51e"},{n:["radioactive_sign"],u:"2622-fe0f"},{n:["biohazard_sign"],u:"2623-fe0f"},{n:["upwards black arrow","arrow_up"],u:"2b06-fe0f"},{n:["north east arrow","arrow_upper_right"],u:"2197-fe0f"},{n:["black rightwards arrow","arrow_right"],u:"27a1-fe0f"},{n:["south east arrow","arrow_lower_right"],u:"2198-fe0f"},{n:["downwards black arrow","arrow_down"],u:"2b07-fe0f"},{n:["south west arrow","arrow_lower_left"],u:"2199-fe0f"},{n:["leftwards black arrow","arrow_left"],u:"2b05-fe0f"},{n:["north west arrow","arrow_upper_left"],u:"2196-fe0f"},{n:["up down arrow","arrow_up_down"],u:"2195-fe0f"},{n:["left right arrow","left_right_arrow"],u:"2194-fe0f"},{n:["leftwards arrow with hook","leftwards_arrow_with_hook"],u:"21a9-fe0f"},{n:["rightwards arrow with hook","arrow_right_hook"],u:"21aa-fe0f"},{n:["arrow pointing rightwards then curving upwards","arrow_heading_up"],u:"2934-fe0f"},{n:["arrow pointing rightwards then curving downwards","arrow_heading_down"],u:"2935-fe0f"},{n:["clockwise downwards and upwards open circle arrows","arrows_clockwise"],u:"1f503"},{n:["anticlockwise downwards and upwards open circle arrows","arrows_counterclockwise"],u:"1f504"},{n:["back with leftwards arrow above","back"],u:"1f519"},{n:["end with leftwards arrow above","end"],u:"1f51a"},{n:["on with exclamation mark with left right arrow above","on"],u:"1f51b"},{n:["soon with rightwards arrow above","soon"],u:"1f51c"},{n:["top with upwards arrow above","top"],u:"1f51d"},{n:["place of worship","place_of_worship"],u:"1f6d0"},{n:["atom_symbol"],u:"269b-fe0f"},{n:["om_symbol"],u:"1f549-fe0f"},{n:["star_of_david"],u:"2721-fe0f"},{n:["wheel_of_dharma"],u:"2638-fe0f"},{n:["yin_yang"],u:"262f-fe0f"},{n:["latin_cross"],u:"271d-fe0f"},{n:["orthodox_cross"],u:"2626-fe0f"},{n:["star_and_crescent"],u:"262a-fe0f"},{n:["peace_symbol"],u:"262e-fe0f"},{n:["menorah with nine branches","menorah_with_nine_branches"],u:"1f54e"},{n:["six pointed star with middle dot","six_pointed_star"],u:"1f52f"},{n:["aries"],u:"2648"},{n:["taurus"],u:"2649"},{n:["gemini"],u:"264a"},{n:["cancer"],u:"264b"},{n:["leo"],u:"264c"},{n:["virgo"],u:"264d"},{n:["libra"],u:"264e"},{n:["scorpius"],u:"264f"},{n:["sagittarius"],u:"2650"},{n:["capricorn"],u:"2651"},{n:["aquarius"],u:"2652"},{n:["pisces"],u:"2653"},{n:["ophiuchus"],u:"26ce"},{n:["twisted rightwards arrows","twisted_rightwards_arrows"],u:"1f500"},{n:["clockwise rightwards and leftwards open circle arrows","repeat"],u:"1f501"},{n:["clockwise rightwards and leftwards open circle arrows with circled one overlay","repeat_one"],u:"1f502"},{n:["black right-pointing triangle","arrow_forward"],u:"25b6-fe0f"},{n:["black right-pointing double triangle","fast_forward"],u:"23e9"},{n:["black_right_pointing_double_triangle_with_vertical_bar"],u:"23ed-fe0f"},{n:["black_right_pointing_triangle_with_double_vertical_bar"],u:"23ef-fe0f"},{n:["black left-pointing triangle","arrow_backward"],u:"25c0-fe0f"},{n:["black left-pointing double triangle","rewind"],u:"23ea"},{n:["black_left_pointing_double_triangle_with_vertical_bar"],u:"23ee-fe0f"},{n:["up-pointing small red triangle","arrow_up_small"],u:"1f53c"},{n:["black up-pointing double triangle","arrow_double_up"],u:"23eb"},{n:["down-pointing small red triangle","arrow_down_small"],u:"1f53d"},{n:["black down-pointing double triangle","arrow_double_down"],u:"23ec"},{n:["double_vertical_bar"],u:"23f8-fe0f"},{n:["black_square_for_stop"],u:"23f9-fe0f"},{n:["black_circle_for_record"],u:"23fa-fe0f"},{n:["eject"],u:"23cf-fe0f"},{n:["cinema"],u:"1f3a6"},{n:["low brightness symbol","low_brightness"],u:"1f505"},{n:["high brightness symbol","high_brightness"],u:"1f506"},{n:["antenna with bars","signal_strength"],u:"1f4f6"},{n:["vibration mode","vibration_mode"],u:"1f4f3"},{n:["mobile phone off","mobile_phone_off"],u:"1f4f4"},{n:["female_sign"],u:"2640-fe0f"},{n:["male_sign"],u:"2642-fe0f"},{n:["medical_symbol","staff_of_aesculapius"],u:"2695-fe0f"},{n:["black universal recycling symbol","recycle"],u:"267b-fe0f"},{n:["fleur_de_lis"],u:"269c-fe0f"},{n:["trident emblem","trident"],u:"1f531"},{n:["name badge","name_badge"],u:"1f4db"},{n:["japanese symbol for beginner","beginner"],u:"1f530"},{n:["heavy large circle","o"],u:"2b55"},{n:["white heavy check mark","white_check_mark"],u:"2705"},{n:["ballot box with check","ballot_box_with_check"],u:"2611-fe0f"},{n:["heavy check mark","heavy_check_mark"],u:"2714-fe0f"},{n:["heavy multiplication x","heavy_multiplication_x"],u:"2716-fe0f"},{n:["cross mark","x"],u:"274c"},{n:["negative squared cross mark","negative_squared_cross_mark"],u:"274e"},{n:["heavy plus sign","heavy_plus_sign"],u:"2795"},{n:["heavy minus sign","heavy_minus_sign"],u:"2796"},{n:["heavy division sign","heavy_division_sign"],u:"2797"},{n:["curly loop","curly_loop"],u:"27b0"},{n:["double curly loop","loop"],u:"27bf"},{n:["part alternation mark","part_alternation_mark"],u:"303d-fe0f"},{n:["eight spoked asterisk","eight_spoked_asterisk"],u:"2733-fe0f"},{n:["eight pointed black star","eight_pointed_black_star"],u:"2734-fe0f"},{n:["sparkle"],u:"2747-fe0f"},{n:["double exclamation mark","bangbang"],u:"203c-fe0f"},{n:["exclamation question mark","interrobang"],u:"2049-fe0f"},{n:["black question mark ornament","question"],u:"2753"},{n:["white question mark ornament","grey_question"],u:"2754"},{n:["white exclamation mark ornament","grey_exclamation"],u:"2755"},{n:["heavy exclamation mark symbol","exclamation","heavy_exclamation_mark"],u:"2757"},{n:["wavy dash","wavy_dash"],u:"3030-fe0f"},{n:["copyright sign","copyright"],u:"00a9-fe0f"},{n:["registered sign","registered"],u:"00ae-fe0f"},{n:["trade mark sign","tm"],u:"2122-fe0f"},{n:["hash key","hash"],u:"0023-fe0f-20e3"},{n:["keycap_star"],u:"002a-fe0f-20e3"},{n:["keycap 0","zero"],u:"0030-fe0f-20e3"},{n:["keycap 1","one"],u:"0031-fe0f-20e3"},{n:["keycap 2","two"],u:"0032-fe0f-20e3"},{n:["keycap 3","three"],u:"0033-fe0f-20e3"},{n:["keycap 4","four"],u:"0034-fe0f-20e3"},{n:["keycap 5","five"],u:"0035-fe0f-20e3"},{n:["keycap 6","six"],u:"0036-fe0f-20e3"},{n:["keycap 7","seven"],u:"0037-fe0f-20e3"},{n:["keycap 8","eight"],u:"0038-fe0f-20e3"},{n:["keycap 9","nine"],u:"0039-fe0f-20e3"},{n:["keycap ten","keycap_ten"],u:"1f51f"},{n:["hundred points symbol","100"],u:"1f4af"},{n:["input symbol for latin capital letters","capital_abcd"],u:"1f520"},{n:["input symbol for latin small letters","abcd"],u:"1f521"},{n:["input symbol for numbers","1234"],u:"1f522"},{n:["input symbol for symbols","symbols"],u:"1f523"},{n:["input symbol for latin letters","abc"],u:"1f524"},{n:["negative squared latin capital letter a","a"],u:"1f170-fe0f"},{n:["negative squared ab","ab"],u:"1f18e"},{n:["negative squared latin capital letter b","b"],u:"1f171-fe0f"},{n:["squared cl","cl"],u:"1f191"},{n:["squared cool","cool"],u:"1f192"},{n:["squared free","free"],u:"1f193"},{n:["information source","information_source"],u:"2139-fe0f"},{n:["squared id","id"],u:"1f194"},{n:["circled latin capital letter m","m"],u:"24c2-fe0f"},{n:["squared new","new"],u:"1f195"},{n:["squared ng","ng"],u:"1f196"},{n:["negative squared latin capital letter o","o2"],u:"1f17e-fe0f"},{n:["squared ok","ok"],u:"1f197"},{n:["negative squared latin capital letter p","parking"],u:"1f17f-fe0f"},{n:["squared sos","sos"],u:"1f198"},{n:["squared up with exclamation mark","up"],u:"1f199"},{n:["squared vs","vs"],u:"1f19a"},{n:["squared katakana koko","koko"],u:"1f201"},{n:["squared katakana sa","sa"],u:"1f202-fe0f"},{n:["squared cjk unified ideograph-6708","u6708"],u:"1f237-fe0f"},{n:["squared cjk unified ideograph-6709","u6709"],u:"1f236"},{n:["squared cjk unified ideograph-6307","u6307"],u:"1f22f"},{n:["circled ideograph advantage","ideograph_advantage"],u:"1f250"},{n:["squared cjk unified ideograph-5272","u5272"],u:"1f239"},{n:["squared cjk unified ideograph-7121","u7121"],u:"1f21a"},{n:["squared cjk unified ideograph-7981","u7981"],u:"1f232"},{n:["circled ideograph accept","accept"],u:"1f251"},{n:["squared cjk unified ideograph-7533","u7533"],u:"1f238"},{n:["squared cjk unified ideograph-5408","u5408"],u:"1f234"},{n:["squared cjk unified ideograph-7a7a","u7a7a"],u:"1f233"},{n:["circled ideograph congratulation","congratulations"],u:"3297-fe0f"},{n:["circled ideograph secret","secret"],u:"3299-fe0f"},{n:["squared cjk unified ideograph-55b6","u55b6"],u:"1f23a"},{n:["squared cjk unified ideograph-6e80","u6e80"],u:"1f235"},{n:["black small square","black_small_square"],u:"25aa-fe0f"},{n:["white small square","white_small_square"],u:"25ab-fe0f"},{n:["white medium square","white_medium_square"],u:"25fb-fe0f"},{n:["black medium square","black_medium_square"],u:"25fc-fe0f"},{n:["white medium small square","white_medium_small_square"],u:"25fd"},{n:["black medium small square","black_medium_small_square"],u:"25fe"},{n:["black large square","black_large_square"],u:"2b1b"},{n:["white large square","white_large_square"],u:"2b1c"},{n:["large orange diamond","large_orange_diamond"],u:"1f536"},{n:["large blue diamond","large_blue_diamond"],u:"1f537"},{n:["small orange diamond","small_orange_diamond"],u:"1f538"},{n:["small blue diamond","small_blue_diamond"],u:"1f539"},{n:["up-pointing red triangle","small_red_triangle"],u:"1f53a"},{n:["down-pointing red triangle","small_red_triangle_down"],u:"1f53b"},{n:["diamond shape with a dot inside","diamond_shape_with_a_dot_inside"],u:"1f4a0"},{n:["radio button","radio_button"],u:"1f518"},{n:["black square button","black_square_button"],u:"1f532"},{n:["white square button","white_square_button"],u:"1f533"},{n:["medium white circle","white_circle"],u:"26aa"},{n:["medium black circle","black_circle"],u:"26ab"},{n:["large red circle","red_circle"],u:"1f534"},{n:["large blue circle","large_blue_circle"],u:"1f535"}],vSr=[{n:["chequered flag","checkered_flag"],u:"1f3c1"},{n:["triangular flag on post","triangular_flag_on_post"],u:"1f6a9"},{n:["crossed flags","crossed_flags"],u:"1f38c"},{n:["waving black flag","waving_black_flag"],u:"1f3f4"},{n:["waving_white_flag"],u:"1f3f3-fe0f"},{n:["rainbow-flag"],u:"1f3f3-fe0f-200d-1f308"},{n:["ascension island flag","flag-ac"],u:"1f1e6-1f1e8"},{n:["andorra flag","flag-ad"],u:"1f1e6-1f1e9"},{n:["united arab emirates flag","flag-ae"],u:"1f1e6-1f1ea"},{n:["afghanistan flag","flag-af"],u:"1f1e6-1f1eb"},{n:["antigua & barbuda flag","flag-ag"],u:"1f1e6-1f1ec"},{n:["anguilla flag","flag-ai"],u:"1f1e6-1f1ee"},{n:["albania flag","flag-al"],u:"1f1e6-1f1f1"},{n:["armenia flag","flag-am"],u:"1f1e6-1f1f2"},{n:["angola flag","flag-ao"],u:"1f1e6-1f1f4"},{n:["antarctica flag","flag-aq"],u:"1f1e6-1f1f6"},{n:["argentina flag","flag-ar"],u:"1f1e6-1f1f7"},{n:["american samoa flag","flag-as"],u:"1f1e6-1f1f8"},{n:["austria flag","flag-at"],u:"1f1e6-1f1f9"},{n:["australia flag","flag-au"],u:"1f1e6-1f1fa"},{n:["aruba flag","flag-aw"],u:"1f1e6-1f1fc"},{n:["åland islands flag","flag-ax"],u:"1f1e6-1f1fd"},{n:["azerbaijan flag","flag-az"],u:"1f1e6-1f1ff"},{n:["bosnia & herzegovina flag","flag-ba"],u:"1f1e7-1f1e6"},{n:["barbados flag","flag-bb"],u:"1f1e7-1f1e7"},{n:["bangladesh flag","flag-bd"],u:"1f1e7-1f1e9"},{n:["belgium flag","flag-be"],u:"1f1e7-1f1ea"},{n:["burkina faso flag","flag-bf"],u:"1f1e7-1f1eb"},{n:["bulgaria flag","flag-bg"],u:"1f1e7-1f1ec"},{n:["bahrain flag","flag-bh"],u:"1f1e7-1f1ed"},{n:["burundi flag","flag-bi"],u:"1f1e7-1f1ee"},{n:["benin flag","flag-bj"],u:"1f1e7-1f1ef"},{n:["st. barthélemy flag","flag-bl"],u:"1f1e7-1f1f1"},{n:["bermuda flag","flag-bm"],u:"1f1e7-1f1f2"},{n:["brunei flag","flag-bn"],u:"1f1e7-1f1f3"},{n:["bolivia flag","flag-bo"],u:"1f1e7-1f1f4"},{n:["caribbean netherlands flag","flag-bq"],u:"1f1e7-1f1f6"},{n:["brazil flag","flag-br"],u:"1f1e7-1f1f7"},{n:["bahamas flag","flag-bs"],u:"1f1e7-1f1f8"},{n:["bhutan flag","flag-bt"],u:"1f1e7-1f1f9"},{n:["bouvet island flag","flag-bv"],u:"1f1e7-1f1fb"},{n:["botswana flag","flag-bw"],u:"1f1e7-1f1fc"},{n:["belarus flag","flag-by"],u:"1f1e7-1f1fe"},{n:["belize flag","flag-bz"],u:"1f1e7-1f1ff"},{n:["canada flag","flag-ca"],u:"1f1e8-1f1e6"},{n:["cocos (keeling) islands flag","flag-cc"],u:"1f1e8-1f1e8"},{n:["congo - kinshasa flag","flag-cd"],u:"1f1e8-1f1e9"},{n:["central african republic flag","flag-cf"],u:"1f1e8-1f1eb"},{n:["congo - brazzaville flag","flag-cg"],u:"1f1e8-1f1ec"},{n:["switzerland flag","flag-ch"],u:"1f1e8-1f1ed"},{n:["côte d’ivoire flag","flag-ci"],u:"1f1e8-1f1ee"},{n:["cook islands flag","flag-ck"],u:"1f1e8-1f1f0"},{n:["chile flag","flag-cl"],u:"1f1e8-1f1f1"},{n:["cameroon flag","flag-cm"],u:"1f1e8-1f1f2"},{n:["china flag","cn","flag-cn"],u:"1f1e8-1f1f3"},{n:["colombia flag","flag-co"],u:"1f1e8-1f1f4"},{n:["clipperton island flag","flag-cp"],u:"1f1e8-1f1f5"},{n:["costa rica flag","flag-cr"],u:"1f1e8-1f1f7"},{n:["cuba flag","flag-cu"],u:"1f1e8-1f1fa"},{n:["cape verde flag","flag-cv"],u:"1f1e8-1f1fb"},{n:["curaçao flag","flag-cw"],u:"1f1e8-1f1fc"},{n:["christmas island flag","flag-cx"],u:"1f1e8-1f1fd"},{n:["cyprus flag","flag-cy"],u:"1f1e8-1f1fe"},{n:["czechia flag","flag-cz"],u:"1f1e8-1f1ff"},{n:["germany flag","de","flag-de"],u:"1f1e9-1f1ea"},{n:["diego garcia flag","flag-dg"],u:"1f1e9-1f1ec"},{n:["djibouti flag","flag-dj"],u:"1f1e9-1f1ef"},{n:["denmark flag","flag-dk"],u:"1f1e9-1f1f0"},{n:["dominica flag","flag-dm"],u:"1f1e9-1f1f2"},{n:["dominican republic flag","flag-do"],u:"1f1e9-1f1f4"},{n:["algeria flag","flag-dz"],u:"1f1e9-1f1ff"},{n:["ceuta & melilla flag","flag-ea"],u:"1f1ea-1f1e6"},{n:["ecuador flag","flag-ec"],u:"1f1ea-1f1e8"},{n:["estonia flag","flag-ee"],u:"1f1ea-1f1ea"},{n:["egypt flag","flag-eg"],u:"1f1ea-1f1ec"},{n:["western sahara flag","flag-eh"],u:"1f1ea-1f1ed"},{n:["eritrea flag","flag-er"],u:"1f1ea-1f1f7"},{n:["spain flag","es","flag-es"],u:"1f1ea-1f1f8"},{n:["ethiopia flag","flag-et"],u:"1f1ea-1f1f9"},{n:["european union flag","flag-eu"],u:"1f1ea-1f1fa"},{n:["finland flag","flag-fi"],u:"1f1eb-1f1ee"},{n:["fiji flag","flag-fj"],u:"1f1eb-1f1ef"},{n:["falkland islands flag","flag-fk"],u:"1f1eb-1f1f0"},{n:["micronesia flag","flag-fm"],u:"1f1eb-1f1f2"},{n:["faroe islands flag","flag-fo"],u:"1f1eb-1f1f4"},{n:["france flag","fr","flag-fr"],u:"1f1eb-1f1f7"},{n:["gabon flag","flag-ga"],u:"1f1ec-1f1e6"},{n:["united kingdom flag","gb","uk","flag-gb"],u:"1f1ec-1f1e7"},{n:["grenada flag","flag-gd"],u:"1f1ec-1f1e9"},{n:["georgia flag","flag-ge"],u:"1f1ec-1f1ea"},{n:["french guiana flag","flag-gf"],u:"1f1ec-1f1eb"},{n:["guernsey flag","flag-gg"],u:"1f1ec-1f1ec"},{n:["ghana flag","flag-gh"],u:"1f1ec-1f1ed"},{n:["gibraltar flag","flag-gi"],u:"1f1ec-1f1ee"},{n:["greenland flag","flag-gl"],u:"1f1ec-1f1f1"},{n:["gambia flag","flag-gm"],u:"1f1ec-1f1f2"},{n:["guinea flag","flag-gn"],u:"1f1ec-1f1f3"},{n:["guadeloupe flag","flag-gp"],u:"1f1ec-1f1f5"},{n:["equatorial guinea flag","flag-gq"],u:"1f1ec-1f1f6"},{n:["greece flag","flag-gr"],u:"1f1ec-1f1f7"},{n:["south georgia & south sandwich islands flag","flag-gs"],u:"1f1ec-1f1f8"},{n:["guatemala flag","flag-gt"],u:"1f1ec-1f1f9"},{n:["guam flag","flag-gu"],u:"1f1ec-1f1fa"},{n:["guinea-bissau flag","flag-gw"],u:"1f1ec-1f1fc"},{n:["guyana flag","flag-gy"],u:"1f1ec-1f1fe"},{n:["hong kong sar china flag","flag-hk"],u:"1f1ed-1f1f0"},{n:["heard & mcdonald islands flag","flag-hm"],u:"1f1ed-1f1f2"},{n:["honduras flag","flag-hn"],u:"1f1ed-1f1f3"},{n:["croatia flag","flag-hr"],u:"1f1ed-1f1f7"},{n:["haiti flag","flag-ht"],u:"1f1ed-1f1f9"},{n:["hungary flag","flag-hu"],u:"1f1ed-1f1fa"},{n:["canary islands flag","flag-ic"],u:"1f1ee-1f1e8"},{n:["indonesia flag","flag-id"],u:"1f1ee-1f1e9"},{n:["ireland flag","flag-ie"],u:"1f1ee-1f1ea"},{n:["israel flag","flag-il"],u:"1f1ee-1f1f1"},{n:["isle of man flag","flag-im"],u:"1f1ee-1f1f2"},{n:["india flag","flag-in"],u:"1f1ee-1f1f3"},{n:["british indian ocean territory flag","flag-io"],u:"1f1ee-1f1f4"},{n:["iraq flag","flag-iq"],u:"1f1ee-1f1f6"},{n:["iran flag","flag-ir"],u:"1f1ee-1f1f7"},{n:["iceland flag","flag-is"],u:"1f1ee-1f1f8"},{n:["italy flag","it","flag-it"],u:"1f1ee-1f1f9"},{n:["jersey flag","flag-je"],u:"1f1ef-1f1ea"},{n:["jamaica flag","flag-jm"],u:"1f1ef-1f1f2"},{n:["jordan flag","flag-jo"],u:"1f1ef-1f1f4"},{n:["japan flag","jp","flag-jp"],u:"1f1ef-1f1f5"},{n:["kenya flag","flag-ke"],u:"1f1f0-1f1ea"},{n:["kyrgyzstan flag","flag-kg"],u:"1f1f0-1f1ec"},{n:["cambodia flag","flag-kh"],u:"1f1f0-1f1ed"},{n:["kiribati flag","flag-ki"],u:"1f1f0-1f1ee"},{n:["comoros flag","flag-km"],u:"1f1f0-1f1f2"},{n:["st. kitts & nevis flag","flag-kn"],u:"1f1f0-1f1f3"},{n:["north korea flag","flag-kp"],u:"1f1f0-1f1f5"},{n:["south korea flag","kr","flag-kr"],u:"1f1f0-1f1f7"},{n:["kuwait flag","flag-kw"],u:"1f1f0-1f1fc"},{n:["cayman islands flag","flag-ky"],u:"1f1f0-1f1fe"},{n:["kazakhstan flag","flag-kz"],u:"1f1f0-1f1ff"},{n:["laos flag","flag-la"],u:"1f1f1-1f1e6"},{n:["lebanon flag","flag-lb"],u:"1f1f1-1f1e7"},{n:["st. lucia flag","flag-lc"],u:"1f1f1-1f1e8"},{n:["liechtenstein flag","flag-li"],u:"1f1f1-1f1ee"},{n:["sri lanka flag","flag-lk"],u:"1f1f1-1f1f0"},{n:["liberia flag","flag-lr"],u:"1f1f1-1f1f7"},{n:["lesotho flag","flag-ls"],u:"1f1f1-1f1f8"},{n:["lithuania flag","flag-lt"],u:"1f1f1-1f1f9"},{n:["luxembourg flag","flag-lu"],u:"1f1f1-1f1fa"},{n:["latvia flag","flag-lv"],u:"1f1f1-1f1fb"},{n:["libya flag","flag-ly"],u:"1f1f1-1f1fe"},{n:["morocco flag","flag-ma"],u:"1f1f2-1f1e6"},{n:["monaco flag","flag-mc"],u:"1f1f2-1f1e8"},{n:["moldova flag","flag-md"],u:"1f1f2-1f1e9"},{n:["montenegro flag","flag-me"],u:"1f1f2-1f1ea"},{n:["st. martin flag","flag-mf"],u:"1f1f2-1f1eb"},{n:["madagascar flag","flag-mg"],u:"1f1f2-1f1ec"},{n:["marshall islands flag","flag-mh"],u:"1f1f2-1f1ed"},{n:["macedonia flag","flag-mk"],u:"1f1f2-1f1f0"},{n:["mali flag","flag-ml"],u:"1f1f2-1f1f1"},{n:["myanmar (burma) flag","flag-mm"],u:"1f1f2-1f1f2"},{n:["mongolia flag","flag-mn"],u:"1f1f2-1f1f3"},{n:["macau sar china flag","flag-mo"],u:"1f1f2-1f1f4"},{n:["northern mariana islands flag","flag-mp"],u:"1f1f2-1f1f5"},{n:["martinique flag","flag-mq"],u:"1f1f2-1f1f6"},{n:["mauritania flag","flag-mr"],u:"1f1f2-1f1f7"},{n:["montserrat flag","flag-ms"],u:"1f1f2-1f1f8"},{n:["malta flag","flag-mt"],u:"1f1f2-1f1f9"},{n:["mauritius flag","flag-mu"],u:"1f1f2-1f1fa"},{n:["maldives flag","flag-mv"],u:"1f1f2-1f1fb"},{n:["malawi flag","flag-mw"],u:"1f1f2-1f1fc"},{n:["mexico flag","flag-mx"],u:"1f1f2-1f1fd"},{n:["malaysia flag","flag-my"],u:"1f1f2-1f1fe"},{n:["mozambique flag","flag-mz"],u:"1f1f2-1f1ff"},{n:["namibia flag","flag-na"],u:"1f1f3-1f1e6"},{n:["new caledonia flag","flag-nc"],u:"1f1f3-1f1e8"},{n:["niger flag","flag-ne"],u:"1f1f3-1f1ea"},{n:["norfolk island flag","flag-nf"],u:"1f1f3-1f1eb"},{n:["nigeria flag","flag-ng"],u:"1f1f3-1f1ec"},{n:["nicaragua flag","flag-ni"],u:"1f1f3-1f1ee"},{n:["netherlands flag","flag-nl"],u:"1f1f3-1f1f1"},{n:["norway flag","flag-no"],u:"1f1f3-1f1f4"},{n:["nepal flag","flag-np"],u:"1f1f3-1f1f5"},{n:["nauru flag","flag-nr"],u:"1f1f3-1f1f7"},{n:["niue flag","flag-nu"],u:"1f1f3-1f1fa"},{n:["new zealand flag","flag-nz"],u:"1f1f3-1f1ff"},{n:["oman flag","flag-om"],u:"1f1f4-1f1f2"},{n:["panama flag","flag-pa"],u:"1f1f5-1f1e6"},{n:["peru flag","flag-pe"],u:"1f1f5-1f1ea"},{n:["french polynesia flag","flag-pf"],u:"1f1f5-1f1eb"},{n:["papua new guinea flag","flag-pg"],u:"1f1f5-1f1ec"},{n:["philippines flag","flag-ph"],u:"1f1f5-1f1ed"},{n:["pakistan flag","flag-pk"],u:"1f1f5-1f1f0"},{n:["poland flag","flag-pl"],u:"1f1f5-1f1f1"},{n:["st. pierre & miquelon flag","flag-pm"],u:"1f1f5-1f1f2"},{n:["pitcairn islands flag","flag-pn"],u:"1f1f5-1f1f3"},{n:["puerto rico flag","flag-pr"],u:"1f1f5-1f1f7"},{n:["palestinian territories flag","flag-ps"],u:"1f1f5-1f1f8"},{n:["portugal flag","flag-pt"],u:"1f1f5-1f1f9"},{n:["palau flag","flag-pw"],u:"1f1f5-1f1fc"},{n:["paraguay flag","flag-py"],u:"1f1f5-1f1fe"},{n:["qatar flag","flag-qa"],u:"1f1f6-1f1e6"},{n:["réunion flag","flag-re"],u:"1f1f7-1f1ea"},{n:["romania flag","flag-ro"],u:"1f1f7-1f1f4"},{n:["serbia flag","flag-rs"],u:"1f1f7-1f1f8"},{n:["russia flag","ru","flag-ru"],u:"1f1f7-1f1fa"},{n:["rwanda flag","flag-rw"],u:"1f1f7-1f1fc"},{n:["saudi arabia flag","flag-sa"],u:"1f1f8-1f1e6"},{n:["solomon islands flag","flag-sb"],u:"1f1f8-1f1e7"},{n:["seychelles flag","flag-sc"],u:"1f1f8-1f1e8"},{n:["sudan flag","flag-sd"],u:"1f1f8-1f1e9"},{n:["sweden flag","flag-se"],u:"1f1f8-1f1ea"},{n:["singapore flag","flag-sg"],u:"1f1f8-1f1ec"},{n:["st. helena flag","flag-sh"],u:"1f1f8-1f1ed"},{n:["slovenia flag","flag-si"],u:"1f1f8-1f1ee"},{n:["svalbard & jan mayen flag","flag-sj"],u:"1f1f8-1f1ef"},{n:["slovakia flag","flag-sk"],u:"1f1f8-1f1f0"},{n:["sierra leone flag","flag-sl"],u:"1f1f8-1f1f1"},{n:["san marino flag","flag-sm"],u:"1f1f8-1f1f2"},{n:["senegal flag","flag-sn"],u:"1f1f8-1f1f3"},{n:["somalia flag","flag-so"],u:"1f1f8-1f1f4"},{n:["suriname flag","flag-sr"],u:"1f1f8-1f1f7"},{n:["south sudan flag","flag-ss"],u:"1f1f8-1f1f8"},{n:["são tomé & príncipe flag","flag-st"],u:"1f1f8-1f1f9"},{n:["el salvador flag","flag-sv"],u:"1f1f8-1f1fb"},{n:["sint maarten flag","flag-sx"],u:"1f1f8-1f1fd"},{n:["syria flag","flag-sy"],u:"1f1f8-1f1fe"},{n:["swaziland flag","flag-sz"],u:"1f1f8-1f1ff"},{n:["tristan da cunha flag","flag-ta"],u:"1f1f9-1f1e6"},{n:["turks & caicos islands flag","flag-tc"],u:"1f1f9-1f1e8"},{n:["chad flag","flag-td"],u:"1f1f9-1f1e9"},{n:["french southern territories flag","flag-tf"],u:"1f1f9-1f1eb"},{n:["togo flag","flag-tg"],u:"1f1f9-1f1ec"},{n:["thailand flag","flag-th"],u:"1f1f9-1f1ed"},{n:["tajikistan flag","flag-tj"],u:"1f1f9-1f1ef"},{n:["tokelau flag","flag-tk"],u:"1f1f9-1f1f0"},{n:["timor-leste flag","flag-tl"],u:"1f1f9-1f1f1"},{n:["turkmenistan flag","flag-tm"],u:"1f1f9-1f1f2"},{n:["tunisia flag","flag-tn"],u:"1f1f9-1f1f3"},{n:["tonga flag","flag-to"],u:"1f1f9-1f1f4"},{n:["turkey flag","flag-tr"],u:"1f1f9-1f1f7"},{n:["trinidad & tobago flag","flag-tt"],u:"1f1f9-1f1f9"},{n:["tuvalu flag","flag-tv"],u:"1f1f9-1f1fb"},{n:["taiwan flag","flag-tw"],u:"1f1f9-1f1fc"},{n:["tanzania flag","flag-tz"],u:"1f1f9-1f1ff"},{n:["ukraine flag","flag-ua"],u:"1f1fa-1f1e6"},{n:["uganda flag","flag-ug"],u:"1f1fa-1f1ec"},{n:["u.s. outlying islands flag","flag-um"],u:"1f1fa-1f1f2"},{n:["united nations flag","flag-un"],u:"1f1fa-1f1f3"},{n:["united states flag","us","flag-us"],u:"1f1fa-1f1f8"},{n:["uruguay flag","flag-uy"],u:"1f1fa-1f1fe"},{n:["uzbekistan flag","flag-uz"],u:"1f1fa-1f1ff"},{n:["vatican city flag","flag-va"],u:"1f1fb-1f1e6"},{n:["st. vincent & grenadines flag","flag-vc"],u:"1f1fb-1f1e8"},{n:["venezuela flag","flag-ve"],u:"1f1fb-1f1ea"},{n:["british virgin islands flag","flag-vg"],u:"1f1fb-1f1ec"},{n:["u.s. virgin islands flag","flag-vi"],u:"1f1fb-1f1ee"},{n:["vietnam flag","flag-vn"],u:"1f1fb-1f1f3"},{n:["vanuatu flag","flag-vu"],u:"1f1fb-1f1fa"},{n:["wallis & futuna flag","flag-wf"],u:"1f1fc-1f1eb"},{n:["samoa flag","flag-ws"],u:"1f1fc-1f1f8"},{n:["kosovo flag","flag-xk"],u:"1f1fd-1f1f0"},{n:["yemen flag","flag-ye"],u:"1f1fe-1f1ea"},{n:["mayotte flag","flag-yt"],u:"1f1fe-1f1f9"},{n:["south africa flag","flag-za"],u:"1f1ff-1f1e6"},{n:["zambia flag","flag-zm"],u:"1f1ff-1f1f2"},{n:["zimbabwe flag","flag-zw"],u:"1f1ff-1f1fc"},{n:["england flag","flag-england"],u:"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f"},{n:["scotland flag","flag-scotland"],u:"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f"},{n:["wales flag","flag-wales"],u:"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f"}];var ySr={smileys_people:pSr,animals_nature:TSr,food_drink:OSr,activities:mSr,travel_places:gSr,objects:QSr,symbols:_Sr,flags:vSr},uY=[{key:"recent",title:"Recently Used",u:"1f551"},{key:"smileys_people",title:"Smiles & People",u:"1f600"},{key:"animals_nature",title:"Animals & Nature",u:"1F431"},{key:"food_drink",title:"Food & Drink",u:"2615"},{key:"activities",title:"Activities",u:"26BD"},{key:"travel_places",title:"Travel & Places",u:"1F697"},{key:"objects",title:"Objects",u:"1F4A1"},{key:"symbols",title:"Symbols",u:"1f4af"},{key:"flags",title:"Flags",u:"1f3f3-fe0f"}];const bSr=(t,e)=>e.some(n=>t instanceof n);let dY,fY;function SSr(){return dY||(dY=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function xSr(){return fY||(fY=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const zoe=new WeakMap,xx=new WeakMap,Xoe=new WeakMap,Jy=new WeakMap,JC=new WeakMap;function ESr(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Oc(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&zoe.set(n,t)}).catch(()=>{}),JC.set(e,t),e}function wSr(t){if(xx.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});xx.set(t,e)}let Ex={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return xx.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Xoe.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Oc(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function CSr(t){Ex=t(Ex)}function LSr(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(eb(this),e,...n);return Xoe.set(r,e.sort?e.sort():[e]),Oc(r)}:xSr().includes(t)?function(...e){return t.apply(eb(this),e),Oc(zoe.get(this))}:function(...e){return Oc(t.apply(eb(this),e))}}function $Sr(t){return typeof t=="function"?LSr(t):(t instanceof IDBTransaction&&wSr(t),bSr(t,SSr())?new Proxy(t,Ex):t)}function Oc(t){if(t instanceof IDBRequest)return ESr(t);if(Jy.has(t))return Jy.get(t);const e=$Sr(t);return e!==t&&(Jy.set(t,e),JC.set(e,t)),e}const eb=t=>JC.get(t);function eL(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Oc(o);return r&&o.addEventListener("upgradeneeded",l=>{r(Oc(o.result),l.oldVersion,l.newVersion,Oc(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const ASr=["get","getKey","getAll","getAllKeys","count"],kSr=["put","add","delete","clear"],tb=new Map;function hY(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(tb.get(e))return tb.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=kSr.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||ASr.includes(n)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&l.done]))[0]};return tb.set(e,s),s}CSr(t=>({...t,get:(e,n,r)=>hY(e,n)||t.get(e,n,r),has:(e,n)=>!!hY(e,n)||t.has(e,n)}));const tL="EMJ",Qu="emojis",nL=3;async function PSr(){(await eL(tL,nL,{upgrade(e,n){e.objectStoreNames.contains(Qu)||e.createObjectStore(Qu,{keyPath:"id",autoIncrement:!0}).createIndex("id","id",{unique:!0})}})).close()}PSr();const RSr={native:!1,hideSearch:!0,hideGroupIcons:!1,hideGroupNames:!1,staticTexts:{},disabledGroups:[],groupNames:{},displayRecent:!1,additionalGroups:{},groupOrder:[],groupIcons:{}};async function MSr(){return await(await eL(tL,nL)).transaction(Qu,"readonly").objectStore(Qu).getAll()}function DSr(){const t=vi({search:"",emoji:sSr,activeGroup:"",skinTone:j9,options:RSr,additionalGroups:{},recent:[],get emojis(){return{recent:this.recent,...this.options.additionalGroups,...ySr}},get disabled(){let d=Array.isArray(this.options.disabledGroups)?this.options.disabledGroups:[];return this.options.displayRecent||(d=["recent",...d]),d},get groups(){return uY.filter(d=>!this.disabled.includes(d.key))},get orderedGroupKeys(){const d=[...this.options.groupOrder,...Object.keys(this.options.additionalGroups),...uY.map(f=>f.key)];return[...new Set(d)].filter(f=>!this.disabled.includes(f))}});function e(){t.options.displayRecent&&r()}async function n(){var d;let f=await MSr();return Array.isArray(f)&&f.length?f=JSON.parse(((d=f[0])==null?void 0:d.value)||""):f=[],f}function r(){n().then(d=>{t.recent=d,c()})}const i=d=>{t.search=d},s=d=>{t.emoji=d},o=d=>{t.activeGroup=d},a=(d=j9)=>{t.skinTone=d},l=d=>{t.options=Object.assign({},t.options,d),e()};async function c(){(await eL(tL,nL)).transaction(Qu,"readwrite").objectStore(Qu).put({id:0,value:JSON.stringify(t.recent)})}const u=d=>{if(t.options.displayRecent!==!0)return;const f=t.recent.findIndex(p=>p.u===d.u);if(f>0&&t.recent.splice(f,1),f===0)return;const h={u:d.u,n:un(d.n)};t.recent=[h,...t.recent],t.recent.length>24&&(t.recent.length=24),c()};return{state:zx(t),updateSearch:i,updateEmoji:s,updateActiveGroup:o,updateSkinTone:a,updateOptions:l,updateSelect:u}}var Cs="top",oa="bottom",aa="right",Ls="left",rL="auto",A7=[Cs,oa,aa,Ls],_u="start",Gf="end",NSr="clippingParents",Foe="viewport",Qd="popper",ISr="reference",pY=A7.reduce(function(t,e){return t.concat([e+"-"+_u,e+"-"+Gf])},[]),joe=[].concat(A7,[rL]).reduce(function(t,e){return t.concat([e,e+"-"+_u,e+"-"+Gf])},[]),HSr="beforeRead",VSr="read",qSr="afterRead",USr="beforeMain",BSr="main",zSr="afterMain",XSr="beforeWrite",FSr="write",jSr="afterWrite",YSr=[HSr,VSr,qSr,USr,BSr,zSr,XSr,FSr,jSr];function F1(t){return t?(t.nodeName||"").toLowerCase():null}function u1(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vu(t){var e=u1(t).Element;return t instanceof e||t instanceof Element}function Ko(t){var e=u1(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Yoe(t){if(typeof ShadowRoot>"u")return!1;var e=u1(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function GSr(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Ko(s)||!F1(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function WSr(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(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ko(i)||!F1(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}var ZSr={name:"applyStyles",enabled:!0,phase:"write",fn:GSr,effect:WSr,requires:["computeStyles"]};function q1(t){return t.split("-")[0]}var S4=Math.max,Y9=Math.min,yu=Math.round;function bu(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(Ko(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=yu(n.width)/o||1),s>0&&(i=yu(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function iL(t){var e=bu(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Goe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Yoe(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function j1(t){return u1(t).getComputedStyle(t)}function KSr(t){return["table","td","th"].indexOf(F1(t))>=0}function Ic(t){return((vu(t)?t.ownerDocument:t.document)||window.document).documentElement}function cT(t){return F1(t)==="html"?t:t.assignedSlot||t.parentNode||(Yoe(t)?t.host:null)||Ic(t)}function TY(t){return!Ko(t)||j1(t).position==="fixed"?null:t.offsetParent}function JSr(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Ko(t)){var r=j1(t);if(r.position==="fixed")return null}for(var i=cT(t);Ko(i)&&["html","body"].indexOf(F1(i))<0;){var s=j1(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function k7(t){for(var e=u1(t),n=TY(t);n&&KSr(n)&&j1(n).position==="static";)n=TY(n);return n&&(F1(n)==="html"||F1(n)==="body"&&j1(n).position==="static")?e:n||JSr(t)||e}function sL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ef(t,e,n){return S4(t,Y9(e,n))}function exr(t,e,n){var r=ef(t,e,n);return r>n?n:r}function Woe(){return{top:0,right:0,bottom:0,left:0}}function Zoe(t){return Object.assign({},Woe(),t)}function Koe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var txr=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Zoe(typeof e!="number"?e:Koe(e,A7))};function nxr(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=q1(n.placement),l=sL(a),c=[Ls,aa].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var d=txr(i.padding,n),f=iL(s),h=l==="y"?Cs:Ls,p=l==="y"?oa:aa,T=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],O=k7(s),g=O?l==="y"?O.clientHeight||0:O.clientWidth||0:0,Q=T/2-m/2,v=d[h],_=g-f[u]-d[p],y=g/2-f[u]/2+Q,S=ef(v,y,_),x=l;n.modifiersData[r]=(e={},e[x]=S,e.centerOffset=S-y,e)}}function rxr(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Goe(e.elements.popper,i)&&(e.elements.arrow=i))}var ixr={name:"arrow",enabled:!0,phase:"main",fn:nxr,effect:rxr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Su(t){return t.split("-")[1]}var sxr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oxr(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:yu(e*i)/i||0,y:yu(n*i)/i||0}}function OY(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=u===!0?oxr(o):typeof u=="function"?u(o):o,h=f.x,p=h===void 0?0:h,T=f.y,m=T===void 0?0:T,O=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),Q=Ls,v=Cs,_=window;if(c){var y=k7(n),S="clientHeight",x="clientWidth";if(y===u1(n)&&(y=Ic(n),j1(y).position!=="static"&&a==="absolute"&&(S="scrollHeight",x="scrollWidth")),y=y,i===Cs||(i===Ls||i===aa)&&s===Gf){v=oa;var E=d&&_.visualViewport?_.visualViewport.height:y[S];m-=E-r.height,m*=l?1:-1}if(i===Ls||(i===Cs||i===oa)&&s===Gf){Q=aa;var C=d&&_.visualViewport?_.visualViewport.width:y[x];p-=C-r.width,p*=l?1:-1}}var w=Object.assign({position:a},c&&sxr);if(l){var L;return Object.assign({},w,(L={},L[v]=g?"0":"",L[Q]=O?"0":"",L.transform=(_.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},w,(e={},e[v]=g?m+"px":"",e[Q]=O?p+"px":"",e.transform="",e))}function axr(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:q1(e.placement),variation:Su(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,OY(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,OY(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var lxr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:axr,data:{}},W8={passive:!0};function cxr(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,a=o===void 0?!0:o,l=u1(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,W8)}),a&&l.addEventListener("resize",n.update,W8),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,W8)}),a&&l.removeEventListener("resize",n.update,W8)}}var uxr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:cxr,data:{}},dxr={left:"right",right:"left",bottom:"top",top:"bottom"};function Dh(t){return t.replace(/left|right|bottom|top/g,function(e){return dxr[e]})}var fxr={start:"end",end:"start"};function mY(t){return t.replace(/start|end/g,function(e){return fxr[e]})}function oL(t){var e=u1(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aL(t){return bu(Ic(t)).left+oL(t).scrollLeft}function hxr(t){var e=u1(t),n=Ic(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+aL(t),y:a}}function pxr(t){var e,n=Ic(t),r=oL(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=S4(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=S4(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+aL(t),l=-r.scrollTop;return j1(i||n).direction==="rtl"&&(a+=S4(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function lL(t){var e=j1(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Joe(t){return["html","body","#document"].indexOf(F1(t))>=0?t.ownerDocument.body:Ko(t)&&lL(t)?t:Joe(cT(t))}function tf(t,e){var n;e===void 0&&(e=[]);var r=Joe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=u1(r),o=i?[s].concat(s.visualViewport||[],lL(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(tf(cT(o)))}function wx(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Txr(t){var e=bu(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function gY(t,e){return e===Foe?wx(hxr(t)):vu(e)?Txr(e):wx(pxr(Ic(t)))}function Oxr(t){var e=tf(cT(t)),n=["absolute","fixed"].indexOf(j1(t).position)>=0,r=n&&Ko(t)?k7(t):t;return vu(r)?e.filter(function(i){return vu(i)&&Goe(i,r)&&F1(i)!=="body"&&(n?j1(i).position!=="static":!0)}):[]}function mxr(t,e,n){var r=e==="clippingParents"?Oxr(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(a,l){var c=gY(t,l);return a.top=S4(c.top,a.top),a.right=Y9(c.right,a.right),a.bottom=Y9(c.bottom,a.bottom),a.left=S4(c.left,a.left),a},gY(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function eae(t){var e=t.reference,n=t.element,r=t.placement,i=r?q1(r):null,s=r?Su(r):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Cs:l={x:o,y:e.y-n.height};break;case oa:l={x:o,y:e.y+e.height};break;case aa:l={x:e.x+e.width,y:a};break;case Ls:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?sL(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case _u:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Gf:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Wf(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.boundary,o=s===void 0?NSr:s,a=n.rootBoundary,l=a===void 0?Foe:a,c=n.elementContext,u=c===void 0?Qd:c,d=n.altBoundary,f=d===void 0?!1:d,h=n.padding,p=h===void 0?0:h,T=Zoe(typeof p!="number"?p:Koe(p,A7)),m=u===Qd?ISr:Qd,O=t.rects.popper,g=t.elements[f?m:u],Q=mxr(vu(g)?g:g.contextElement||Ic(t.elements.popper),o,l),v=bu(t.elements.reference),_=eae({reference:v,element:O,placement:i}),y=wx(Object.assign({},O,_)),S=u===Qd?y:v,x={top:Q.top-S.top+T.top,bottom:S.bottom-Q.bottom+T.bottom,left:Q.left-S.left+T.left,right:S.right-Q.right+T.right},E=t.modifiersData.offset;if(u===Qd&&E){var C=E[i];Object.keys(x).forEach(function(w){var L=[aa,oa].indexOf(w)>=0?1:-1,P=[Cs,oa].indexOf(w)>=0?"y":"x";x[w]+=C[P]*L})}return x}function gxr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?joe:l,u=Su(r),d=u?a?pY:pY.filter(function(p){return Su(p)===u}):A7,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,T){return p[T]=Wf(t,{placement:T,boundary:i,rootBoundary:s,padding:o})[q1(T)],p},{});return Object.keys(h).sort(function(p,T){return h[p]-h[T]})}function Qxr(t){if(q1(t)===rL)return[];var e=Dh(t);return[mY(t),e,mY(e)]}function _xr(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,T=n.allowedAutoPlacements,m=e.options.placement,O=q1(m),g=O===m,Q=l||(g||!p?[Dh(m)]:Qxr(m)),v=[m].concat(Q).reduce(function(G,Te){return G.concat(q1(Te)===rL?gxr(e,{placement:Te,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:T}):Te)},[]),_=e.rects.reference,y=e.rects.popper,S=new Map,x=!0,E=v[0],C=0;C=0,q=A?"width":"height",X=Wf(e,{placement:w,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),F=A?P?aa:Ls:P?oa:Cs;_[q]>y[q]&&(F=Dh(F));var H=Dh(F),z=[];if(s&&z.push(X[L]<=0),a&&z.push(X[F]<=0,X[H]<=0),z.every(function(G){return G})){E=w,x=!1;break}S.set(w,z)}if(x)for(var U=p?3:1,j=function(Te){var Qe=v.find(function(W){var se=S.get(W);if(se)return se.slice(0,Te).every(function(pe){return pe})});if(Qe)return E=Qe,"break"},re=U;re>0;re--){var K=j(re);if(K==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}var vxr={name:"flip",enabled:!0,phase:"main",fn:_xr,requiresIfExists:["offset"],data:{_skip:!1}};function QY(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 _Y(t){return[Cs,aa,oa,Ls].some(function(e){return t[e]>=0})}function yxr(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=Wf(e,{elementContext:"reference"}),a=Wf(e,{altBoundary:!0}),l=QY(o,r),c=QY(a,i,s),u=_Y(l),d=_Y(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var bxr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:yxr};function Sxr(t,e,n){var r=q1(t),i=[Ls,Cs].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[Ls,aa].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function xxr(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=joe.reduce(function(u,d){return u[d]=Sxr(d,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var Exr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:xxr};function wxr(t){var e=t.state,n=t.name;e.modifiersData[n]=eae({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var Cxr={name:"popperOffsets",enabled:!0,phase:"read",fn:wxr,data:{}};function Lxr(t){return t==="x"?"y":"x"}function $xr(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,T=p===void 0?0:p,m=Wf(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),O=q1(e.placement),g=Su(e.placement),Q=!g,v=sL(O),_=Lxr(v),y=e.modifiersData.popperOffsets,S=e.rects.reference,x=e.rects.popper,E=typeof T=="function"?T(Object.assign({},e.rects,{placement:e.placement})):T,C=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),w=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(s){var P,A=v==="y"?Cs:Ls,q=v==="y"?oa:aa,X=v==="y"?"height":"width",F=y[v],H=F+m[A],z=F-m[q],U=h?-x[X]/2:0,j=g===_u?S[X]:x[X],re=g===_u?-x[X]:-S[X],K=e.elements.arrow,G=h&&K?iL(K):{width:0,height:0},Te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Woe(),Qe=Te[A],W=Te[q],se=ef(0,S[X],G[X]),pe=Q?S[X]/2-U-se-Qe-C.mainAxis:j-se-Qe-C.mainAxis,ve=Q?-S[X]/2+U+se+W+C.mainAxis:re+se+W+C.mainAxis,$e=e.elements.arrow&&k7(e.elements.arrow),J=$e?v==="y"?$e.clientTop||0:$e.clientLeft||0:0,ee=(P=w==null?void 0:w[v])!=null?P:0,ie=F+pe-ee-J,he=F+ve-ee,Oe=ef(h?Y9(H,ie):H,F,h?S4(z,he):z);y[v]=Oe,L[v]=Oe-F}if(a){var me,ge=v==="x"?Cs:Ls,Ce=v==="x"?oa:aa,we=y[_],ke=_==="y"?"height":"width",lt=we+m[ge],De=we-m[Ce],Ze=[Cs,Ls].indexOf(O)!==-1,ct=(me=w==null?void 0:w[_])!=null?me:0,ht=Ze?lt:we-S[ke]-x[ke]-ct+C.altAxis,Dt=Ze?we+S[ke]+x[ke]-ct-C.altAxis:De,Mt=h&&Ze?exr(ht,we,Dt):ef(h?ht:lt,we,h?Dt:De);y[_]=Mt,L[_]=Mt-we}e.modifiersData[r]=L}}var Axr={name:"preventOverflow",enabled:!0,phase:"main",fn:$xr,requiresIfExists:["offset"]};function kxr(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Pxr(t){return t===u1(t)||!Ko(t)?oL(t):kxr(t)}function Rxr(t){var e=t.getBoundingClientRect(),n=yu(e.width)/t.offsetWidth||1,r=yu(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Mxr(t,e,n){n===void 0&&(n=!1);var r=Ko(e),i=Ko(e)&&Rxr(e),s=Ic(e),o=bu(t,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((F1(e)!=="body"||lL(s))&&(a=Pxr(e)),Ko(e)?(l=bu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=aL(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Dxr(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function Nxr(t){var e=Dxr(t);return YSr.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function Ixr(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Hxr(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var vY={placement:"bottom",modifiers:[],strategy:"absolute"};function yY(){for(var t=arguments.length,e=new Array(t),n=0;nparseInt(e,16)).map(e=>String.fromCodePoint(e)).join("")}function Bxr(t,e,n,r=[]){const i={};return Object.keys(t).forEach(s=>{if(r.includes(s))return;const o=[];t[s].forEach(a=>{var l;if(a[lT][0].includes(e.toLocaleLowerCase())){let c=a[Boe];if(n!==j9&&Array.isArray(a[G8])){const u=((l=a[G8])==null?void 0:l.findIndex(d=>d.includes(n)))||-1;u!==-1&&a[G8]&&(c=a[G8][u])}return o.push({...a,[Yf]:c})}}),o.length&&(i[s]=o)}),i}function nae(){var t;return(((t=navigator==null?void 0:navigator.userAgentData)==null?void 0:t.platform)||(navigator==null?void 0:navigator.platform)||"unknown").toUpperCase().indexOf("MAC")!==-1}function rae(t){return t.replace(/^_*(.)|_+(.)/g,(e,n,r)=>n?n.toUpperCase():" "+r.toUpperCase())}var P7=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const zxr=Zn({name:"Body",emits:{select:t=>!0},setup(){const{state:t,updateEmoji:e,updateSelect:n}=_i("store"),r=We(null),i=Je(()=>Bxr(t.emojis,t.search,t.skinTone,t.options.disabledGroups)),s=up(),o=Je(()=>!t.options.hideGroupNames),a=Je(()=>!t.options.disableStickyGroupNames),l=un(t.options.groupNames),c=t.orderedGroupKeys;t.options.additionalGroups&&Object.keys(t.options.additionalGroups).map(p=>{t.options.groupNames[p]?l[p]=t.options.groupNames[p]:l[p]=rae(p)});const u=nae()?"is-mac":"";function d(p){e(p)}function f(p){n(p),s==null||s.emit("select",{...p,t:t.skinTone,i:Nh(p.r)})}function h(p,T){var m;const O=(m=p==null?void 0:p.target)==null?void 0:m.closest("button");O&&(O.innerHTML=`${Nh(T)} `)}return br(()=>t.activeGroup,()=>{var p;const T=(p=r.value)==null?void 0:p.querySelector("#"+t.activeGroup);T&&(T.parentNode.scrollTop=T.offsetTop-T.parentNode.offsetTop)}),{emojis:i,bodyInner:r,EMOJI_REMOTE_SRC:qoe,GROUP_NAMES:Uoe,handleClick:f,handleError:h,handleMouseEnter:d,native:t.options.native,unicodeToEmoji:Nh,EMOJI_RESULT_KEY:Yf,EMOJI_NAME_KEY:lT,hasGroupNames:o,isSticky:a,platform:u,groupNames:l,orderedKeys:c}}}),Xxr={class:"v3-body"},Fxr=["id"],jxr={class:"v3-emojis"},Yxr=["onMouseenter","onClick"],Gxr={key:0},Wxr=["src","alt","onError"],Zxr={key:1,class:"v3-no-result"};function Kxr(t,e,n,r,i,s){return k(),R("div",Xxr,[b("div",{ref:"bodyInner",class:ye([t.platform,"v3-body-inner"])},[t.orderedKeys.length?(k(!0),R(Ve,{key:0},dt(t.orderedKeys,o=>(k(),R("div",{id:o,key:o,class:"v3-group"},[t.hasGroupNames?He((k(),R("h5",{key:0,class:ye(t.isSticky?"v3-sticky":"")},ae(t.groupNames[o]),3)),[[mr,t.emojis[o]]]):ne("",!0),He(b("div",jxr,[(k(!0),R(Ve,null,dt(t.emojis[o],a=>(k(),R("button",{key:a.r,type:"button",onMouseenter:l=>t.handleMouseEnter(a),onClick:l=>t.handleClick(a)},[t.native?(k(),R("span",Gxr,ae(t.unicodeToEmoji(a.r)),1)):(k(),R("img",{key:1,src:t.EMOJI_REMOTE_SRC+`/${a.r}.png`,alt:a.n[0],onError:l=>t.handleError(l,a.r)},null,40,Wxr))],40,Yxr))),128))],512),[[mr,t.emojis[o]]])],8,Fxr))),128)):(k(),R("span",Zxr," No emoji has been found! "))],2)])}var Jxr=P7(zxr,[["render",Kxr]]),eEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMi41IDUgQyAxMS40Mjk2ODggNSAxMC41IDUuNjA5Mzc1IDkuOTA2MjUgNi40Mzc1IEMgOS4zMTI1IDcuMjY1NjI1IDkgOC4zMzk4NDQgOSA5LjUgQyA5IDEwLjY2MDE1NiA5LjMxMjUgMTEuNzM0Mzc1IDkuOTA2MjUgMTIuNTYyNSBDIDEwLjUgMTMuMzkwNjI1IDExLjQyOTY4OCAxNCAxMi41IDE0IEMgMTMuNTcwMzEzIDE0IDE0LjUgMTMuMzkwNjI1IDE1LjA5Mzc1IDEyLjU2MjUgQyAxNS42ODc1IDExLjczNDM3NSAxNiAxMC42NjAxNTYgMTYgOS41IEMgMTYgOC4zMzk4NDQgMTUuNjg3NSA3LjI2NTYyNSAxNS4wOTM3NSA2LjQzNzUgQyAxNC41IDUuNjA5Mzc1IDEzLjU3MDMxMyA1IDEyLjUgNSBaIE0gMTYgOS41IEMgMTYgMTAuNjYwMTU2IDE2LjMxMjUgMTEuNzM0Mzc1IDE2LjkwNjI1IDEyLjU2MjUgQyAxNy41IDEzLjM5MDYyNSAxOC40Mjk2ODggMTQgMTkuNSAxNCBDIDIwLjU3MDMxMyAxNCAyMS41IDEzLjM5MDYyNSAyMi4wOTM3NSAxMi41NjI1IEMgMjIuNjg3NSAxMS43MzQzNzUgMjMgMTAuNjYwMTU2IDIzIDkuNSBDIDIzIDguMzM5ODQ0IDIyLjY4NzUgNy4yNjU2MjUgMjIuMDkzNzUgNi40Mzc1IEMgMjEuNSA1LjYwOTM3NSAyMC41NzAzMTMgNSAxOS41IDUgQyAxOC40Mjk2ODggNSAxNy41IDUuNjA5Mzc1IDE2LjkwNjI1IDYuNDM3NSBDIDE2LjMxMjUgNy4yNjU2MjUgMTYgOC4zMzk4NDQgMTYgOS41IFogTSAxMi41IDcgQyAxMi44MTI1IDcgMTMuMTU2MjUgNy4xNTYyNSAxMy40Njg3NSA3LjU5Mzc1IEMgMTMuNzgxMjUgOC4wMzEyNSAxNCA4LjcyNjU2MyAxNCA5LjUgQyAxNCAxMC4yNzM0MzggMTMuNzgxMjUgMTAuOTY4NzUgMTMuNDY4NzUgMTEuNDA2MjUgQyAxMy4xNTYyNSAxMS44NDM3NSAxMi44MTI1IDEyIDEyLjUgMTIgQyAxMi4xODc1IDEyIDExLjg0Mzc1IDExLjg0Mzc1IDExLjUzMTI1IDExLjQwNjI1IEMgMTEuMjE4NzUgMTAuOTY4NzUgMTEgMTAuMjczNDM4IDExIDkuNSBDIDExIDguNzI2NTYzIDExLjIxODc1IDguMDMxMjUgMTEuNTMxMjUgNy41OTM3NSBDIDExLjg0Mzc1IDcuMTU2MjUgMTIuMTg3NSA3IDEyLjUgNyBaIE0gMTkuNSA3IEMgMTkuODEyNSA3IDIwLjE1NjI1IDcuMTU2MjUgMjAuNDY4NzUgNy41OTM3NSBDIDIwLjc4MTI1IDguMDMxMjUgMjEgOC43MjY1NjMgMjEgOS41IEMgMjEgMTAuMjczNDM4IDIwLjc4MTI1IDEwLjk2ODc1IDIwLjQ2ODc1IDExLjQwNjI1IEMgMjAuMTU2MjUgMTEuODQzNzUgMTkuODEyNSAxMiAxOS41IDEyIEMgMTkuMTg3NSAxMiAxOC44NDM3NSAxMS44NDM3NSAxOC41MzEyNSAxMS40MDYyNSBDIDE4LjIxODc1IDEwLjk2ODc1IDE4IDEwLjI3MzQzOCAxOCA5LjUgQyAxOCA4LjcyNjU2MyAxOC4yMTg3NSA4LjAzMTI1IDE4LjUzMTI1IDcuNTkzNzUgQyAxOC44NDM3NSA3LjE1NjI1IDE5LjE4NzUgNyAxOS41IDcgWiBNIDcuNSAxMiBDIDYuNDI5Njg4IDEyIDUuNSAxMi42MDkzNzUgNC45MDYyNSAxMy40Mzc1IEMgNC4zMTI1IDE0LjI2NTYyNSA0IDE1LjMzOTg0NCA0IDE2LjUgQyA0IDE3LjY2MDE1NiA0LjMxMjUgMTguNzM0Mzc1IDQuOTA2MjUgMTkuNTYyNSBDIDUuNSAyMC4zOTA2MjUgNi40Mjk2ODggMjEgNy41IDIxIEMgOC41NzAzMTMgMjEgOS41IDIwLjM5MDYyNSAxMC4wOTM3NSAxOS41NjI1IEMgMTAuNjg3NSAxOC43MzQzNzUgMTEgMTcuNjYwMTU2IDExIDE2LjUgQyAxMSAxNS4zMzk4NDQgMTAuNjg3NSAxNC4yNjU2MjUgMTAuMDkzNzUgMTMuNDM3NSBDIDkuNSAxMi42MDkzNzUgOC41NzAzMTMgMTIgNy41IDEyIFogTSAyNC41IDEyIEMgMjMuNDI5Njg4IDEyIDIyLjUgMTIuNjA5Mzc1IDIxLjkwNjI1IDEzLjQzNzUgQyAyMS4zMTI1IDE0LjI2NTYyNSAyMSAxNS4zMzk4NDQgMjEgMTYuNSBDIDIxIDE3LjY2MDE1NiAyMS4zMTI1IDE4LjczNDM3NSAyMS45MDYyNSAxOS41NjI1IEMgMjIuNSAyMC4zOTA2MjUgMjMuNDI5Njg4IDIxIDI0LjUgMjEgQyAyNS41NzAzMTMgMjEgMjYuNSAyMC4zOTA2MjUgMjcuMDkzNzUgMTkuNTYyNSBDIDI3LjY4NzUgMTguNzM0Mzc1IDI4IDE3LjY2MDE1NiAyOCAxNi41IEMgMjggMTUuMzM5ODQ0IDI3LjY4NzUgMTQuMjY1NjI1IDI3LjA5Mzc1IDEzLjQzNzUgQyAyNi41IDEyLjYwOTM3NSAyNS41NzAzMTMgMTIgMjQuNSAxMiBaIE0gNy41IDE0IEMgNy44MTI1IDE0IDguMTU2MjUgMTQuMTU2MjUgOC40Njg3NSAxNC41OTM3NSBDIDguNzgxMjUgMTUuMDMxMjUgOSAxNS43MjY1NjMgOSAxNi41IEMgOSAxNy4yNzM0MzggOC43ODEyNSAxNy45Njg3NSA4LjQ2ODc1IDE4LjQwNjI1IEMgOC4xNTYyNSAxOC44NDM3NSA3LjgxMjUgMTkgNy41IDE5IEMgNy4xODc1IDE5IDYuODQzNzUgMTguODQzNzUgNi41MzEyNSAxOC40MDYyNSBDIDYuMjE4NzUgMTcuOTY4NzUgNiAxNy4yNzM0MzggNiAxNi41IEMgNiAxNS43MjY1NjMgNi4yMTg3NSAxNS4wMzEyNSA2LjUzMTI1IDE0LjU5Mzc1IEMgNi44NDM3NSAxNC4xNTYyNSA3LjE4NzUgMTQgNy41IDE0IFogTSAyNC41IDE0IEMgMjQuODEyNSAxNCAyNS4xNTYyNSAxNC4xNTYyNSAyNS40Njg3NSAxNC41OTM3NSBDIDI1Ljc4MTI1IDE1LjAzMTI1IDI2IDE1LjcyNjU2MyAyNiAxNi41IEMgMjYgMTcuMjczNDM4IDI1Ljc4MTI1IDE3Ljk2ODc1IDI1LjQ2ODc1IDE4LjQwNjI1IEMgMjUuMTU2MjUgMTguODQzNzUgMjQuODEyNSAxOSAyNC41IDE5IEMgMjQuMTg3NSAxOSAyMy44NDM3NSAxOC44NDM3NSAyMy41MzEyNSAxOC40MDYyNSBDIDIzLjIxODc1IDE3Ljk2ODc1IDIzIDE3LjI3MzQzOCAyMyAxNi41IEMgMjMgMTUuNzI2NTYzIDIzLjIxODc1IDE1LjAzMTI1IDIzLjUzMTI1IDE0LjU5Mzc1IEMgMjMuODQzNzUgMTQuMTU2MjUgMjQuMTg3NSAxNCAyNC41IDE0IFogTSAxNiAxNiBDIDE0LjY2Nzk2OSAxNiAxMy43MzgyODEgMTYuODY3MTg4IDEzLjI4MTI1IDE3LjYyNSBDIDEyLjgyNDIxOSAxOC4zODI4MTMgMTIuNTQ2ODc1IDE5LjAxNTYyNSAxMi4yODEyNSAxOS4yODEyNSBDIDEyLjEyNSAxOS40Mzc1IDExLjE2MDE1NiAxOS44MDA3ODEgMTAuMTU2MjUgMjAuMzEyNSBDIDkuNjUyMzQ0IDIwLjU3MDMxMyA5LjE0NDUzMSAyMC45MTQwNjMgOC43MTg3NSAyMS40Mzc1IEMgOC4yOTI5NjkgMjEuOTYwOTM4IDggMjIuNjg3NSA4IDIzLjUgQyA4IDI1LjQyMTg3NSA5LjU3ODEyNSAyNyAxMS41IDI3IEMgMTIuMzY3MTg4IDI3IDEzLjI2OTUzMSAyNi43MjI2NTYgMTQuMTU2MjUgMjYuNDY4NzUgQyAxNS4wNDI5NjkgMjYuMjE0ODQ0IDE2IDI2IDE2IDI2IEMgMTYgMjYgMTYuOTU3MDMxIDI2LjIxNDg0NCAxNy44NDM3NSAyNi40Njg3NSBDIDE4LjczMDQ2OSAyNi43MjI2NTYgMTkuNjMyODEzIDI3IDIwLjUgMjcgQyAyMi40MjE4NzUgMjcgMjQgMjUuNDIxODc1IDI0IDIzLjUgQyAyNCAyMi43MDcwMzEgMjMuNzA3MDMxIDIxLjk4MDQ2OSAyMy4yODEyNSAyMS40Njg3NSBDIDIyLjg1NTQ2OSAyMC45NTcwMzEgMjIuMzQzNzUgMjAuNjQwNjI1IDIxLjg0Mzc1IDIwLjM3NSBDIDIwLjg0Mzc1IDE5Ljg0Mzc1IDE5Ljg1OTM3NSAxOS40MjE4NzUgMTkuNzE4NzUgMTkuMjgxMjUgQyAxOS40ODA0NjkgMTkuMDQyOTY5IDE5LjIxMDkzOCAxOC4zOTA2MjUgMTguNzUgMTcuNjI1IEMgMTguMjg5MDYzIDE2Ljg1OTM3NSAxNy4zMzk4NDQgMTYgMTYgMTYgWiBNIDE2IDE4IEMgMTYuNjYwMTU2IDE4IDE2LjczNDM3NSAxOC4xNjAxNTYgMTcuMDMxMjUgMTguNjU2MjUgQyAxNy4zMjgxMjUgMTkuMTUyMzQ0IDE3LjU1NDY4OCAxOS45OTIxODggMTguMjgxMjUgMjAuNzE4NzUgQyAxOS4xMDU0NjkgMjEuNTQyOTY5IDIwLjE0ODQzOCAyMS43MjI2NTYgMjAuOTA2MjUgMjIuMTI1IEMgMjEuMjg1MTU2IDIyLjMyODEyNSAyMS41NzgxMjUgMjIuNTQyOTY5IDIxLjc1IDIyLjc1IEMgMjEuOTIxODc1IDIyLjk1NzAzMSAyMiAyMy4xNDg0MzggMjIgMjMuNSBDIDIyIDI0LjMzOTg0NCAyMS4zMzk4NDQgMjUgMjAuNSAyNSBDIDIwLjIxMDkzOCAyNSAxOS4yNzczNDQgMjQuNzc3MzQ0IDE4LjQwNjI1IDI0LjUzMTI1IEMgMTcuNTM1MTU2IDI0LjI4NTE1NiAxNi44MTY0MDYgMjQgMTYgMjQgQyAxNS4xODM1OTQgMjQgMTQuNDY0ODQ0IDI0LjI4NTE1NiAxMy41OTM3NSAyNC41MzEyNSBDIDEyLjcyMjY1NiAyNC43NzczNDQgMTEuNzg5MDYzIDI1IDExLjUgMjUgQyAxMC42NjAxNTYgMjUgMTAgMjQuMzM5ODQ0IDEwIDIzLjUgQyAxMCAyMy4wOTc2NTYgMTAuMDgyMDMxIDIyLjg5MDYyNSAxMC4yNSAyMi42ODc1IEMgMTAuNDE3OTY5IDIyLjQ4NDM3NSAxMC43MjI2NTYgMjIuMjg1MTU2IDExLjA5Mzc1IDIyLjA5Mzc1IEMgMTEuODM5ODQ0IDIxLjcxNDg0NCAxMi44NzUgMjEuNTYyNSAxMy43MTg3NSAyMC43MTg3NSBDIDE0LjQ1MzEyNSAxOS45ODQzNzUgMTQuNjc1NzgxIDE5LjExNzE4OCAxNC45Njg3NSAxOC42MjUgQyAxNS4yNjE3MTkgMTguMTMyODEzIDE1LjMzMjAzMSAxOCAxNiAxOCBaIi8+PC9zdmc+",tEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMSAzIEwgMTEgNyBMIDEzIDcgTCAxMyAzIFogTSAxNSA0IEwgMTUgNyBMIDE3IDcgTCAxNyA0IFogTSA0Ljg3NSA4IEwgNSA5LjA5Mzc1IEwgNi44MTI1IDI2LjMxMjUgQyA2Ljk3MjY1NiAyNy44MzIwMzEgOC4yODUxNTYgMjkgOS44MTI1IDI5IEwgMTkuMTg3NSAyOSBDIDIwLjcxNDg0NCAyOSAyMi4wMjczNDQgMjcuODMyMDMxIDIyLjE4NzUgMjYuMzEyNSBMIDIyLjY1NjI1IDIyIEwgMjUgMjIgQyAyNi42NDQ1MzEgMjIgMjggMjAuNjQ0NTMxIDI4IDE5IEwgMjggMTYgQyAyOCAxNC4zNTU0NjkgMjYuNjQ0NTMxIDEzIDI1IDEzIEwgMjMuNTkzNzUgMTMgTCAyNCA5LjA5Mzc1IEwgMjQuMTI1IDggWiBNIDcuMTI1IDEwIEwgMjEuODc1IDEwIEwgMjAuMTg3NSAyNi4wOTM3NSBDIDIwLjEzMjgxMyAyNi42MTMyODEgMTkuNzA3MDMxIDI3IDE5LjE4NzUgMjcgTCA5LjgxMjUgMjcgQyA5LjI5Mjk2OSAyNyA4Ljg2NzE4OCAyNi42MTMyODEgOC44MTI1IDI2LjA5Mzc1IFogTSAyMy4zNzUgMTUgTCAyNSAxNSBDIDI1LjU2NjQwNiAxNSAyNiAxNS40MzM1OTQgMjYgMTYgTCAyNiAxOSBDIDI2IDE5LjU2NjQwNiAyNS41NjY0MDYgMjAgMjUgMjAgTCAyMi44NDM3NSAyMCBaIi8+PC9zdmc+",nEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiAzIEMgOC44MzIwMzEgMyAzIDguODMyMDMxIDMgMTYgQyAzIDIzLjE2Nzk2OSA4LjgzMjAzMSAyOSAxNiAyOSBDIDIzLjE2Nzk2OSAyOSAyOSAyMy4xNjc5NjkgMjkgMTYgQyAyOSA4LjgzMjAzMSAyMy4xNjc5NjkgMyAxNiAzIFogTSAxNiA1IEMgMTYuNjAxNTYzIDUgMTcuMTc1NzgxIDUuMDYyNSAxNy43NSA1LjE1NjI1IEwgMTYgNi40MDYyNSBMIDE0LjI1IDUuMTU2MjUgQyAxNC44MjAzMTMgNS4wNjY0MDYgMTUuNDAyMzQ0IDUgMTYgNSBaIE0gMTEuODEyNSA1Ljg0Mzc1IEwgMTUuNDA2MjUgOC40Njg3NSBMIDE2IDguOTA2MjUgTCAxNi41OTM3NSA4LjQ2ODc1IEwgMjAuMTg3NSA1Ljg0Mzc1IEMgMjEuNzg1MTU2IDYuNTA3ODEzIDIzLjE5NTMxMyA3LjUyMzQzOCAyNC4zMTI1IDguODEyNSBMIDIyLjkzNzUgMTMuMDkzNzUgTCAyMi43MTg3NSAxMy43ODEyNSBMIDIzLjMxMjUgMTQuMTg3NSBMIDI2LjkzNzUgMTYuODQzNzUgQyAyNi44MDQ2ODggMTguNjA1NDY5IDI2LjI2NTYyNSAyMC4yNTc4MTMgMjUuNDA2MjUgMjEuNjg3NSBMIDIwLjEyNSAyMS42ODc1IEwgMTkuOTA2MjUgMjIuMzc1IEwgMTguNSAyNi43MTg3NSBDIDE3LjY5OTIxOSAyNi45MDYyNSAxNi44NTkzNzUgMjcgMTYgMjcgQyAxNS4xMDU0NjkgMjcgMTQuMjM4MjgxIDI2Ljg4NjcxOSAxMy40MDYyNSAyNi42ODc1IEwgMTIuMDMxMjUgMjIuNDA2MjUgTCAxMS44MTI1IDIxLjcxODc1IEwgNi41OTM3NSAyMS43MTg3NSBDIDUuNzE4NzUgMjAuMjgxMjUgNS4xOTkyMTkgMTguNjIxMDk0IDUuMDYyNSAxNi44NDM3NSBMIDguNjU2MjUgMTQuMjE4NzUgTCA5LjI1IDEzLjgxMjUgTCA5LjAzMTI1IDEzLjEyNSBMIDcuNjI1IDguODc1IEMgOC43NSA3LjU1NDY4OCAxMC4xODM1OTQgNi41MTU2MjUgMTEuODEyNSA1Ljg0Mzc1IFogTSAxNiAxMC4wOTM3NSBMIDE1LjQwNjI1IDEwLjUzMTI1IEwgMTAuODQzNzUgMTMuODQzNzUgTCAxMC4yODEyNSAxNC4yODEyNSBMIDEwLjUgMTQuOTY4NzUgTCAxMi4yNSAyMC4zMTI1IEwgMTIuNDY4NzUgMjEgTCAxOS41MzEyNSAyMSBMIDE5Ljc1IDIwLjMxMjUgTCAyMS41IDE0Ljk2ODc1IEwgMjEuNzE4NzUgMTQuMjgxMjUgTCAyMS4xNTYyNSAxMy44NDM3NSBMIDE2LjU5Mzc1IDEwLjUzMTI1IFogTSAyNS43NSAxMC45MDYyNSBDIDI2LjI5Njg3NSAxMS45NTMxMjUgMjYuNjU2MjUgMTMuMTAxNTYzIDI2Ljg0Mzc1IDE0LjMxMjUgTCAyNS4wNjI1IDEzLjAzMTI1IFogTSA2LjIxODc1IDEwLjk2ODc1IEwgNi45MDYyNSAxMy4wMzEyNSBMIDUuMTU2MjUgMTQuMzEyNSBDIDUuMzM5ODQ0IDEzLjEyNSA1LjY4NzUgMTIgNi4yMTg3NSAxMC45Njg3NSBaIE0gMTYgMTIuNTkzNzUgTCAxOS4zNzUgMTUuMDMxMjUgTCAxOC4wOTM3NSAxOSBMIDEzLjkwNjI1IDE5IEwgMTIuNjI1IDE1LjAzMTI1IFogTSAyMS41OTM3NSAyMy42ODc1IEwgMjMuODQzNzUgMjMuNjg3NSBDIDIyLjk5MjE4OCAyNC41NjY0MDYgMjIuMDExNzE5IDI1LjI5Mjk2OSAyMC45MDYyNSAyNS44NDM3NSBaIE0gOC4xNTYyNSAyMy43MTg3NSBMIDEwLjM0Mzc1IDIzLjcxODc1IEwgMTEuMDMxMjUgMjUuODEyNSBDIDkuOTYwOTM4IDI1LjI2OTUzMSA4Ljk4ODI4MSAyNC41NjI1IDguMTU2MjUgMjMuNzE4NzUgWiIvPjwvc3ZnPg==",rEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSA5LjUgNiBDIDguMTc5Njg4IDYgNy4wMDM5MDYgNi44NTkzNzUgNi42MjUgOC4xMjUgTCA1LjI1IDEyLjcxODc1IEwgMy4zMTI1IDEyLjA2MjUgTCAyLjY4NzUgMTMuOTM3NSBMIDQuNjU2MjUgMTQuNTkzNzUgTCA0LjAzMTI1IDE2LjcxODc1IEMgNC4wMDc4MTMgMTYuODA4NTk0IDMuOTk2MDk0IDE2LjkwNjI1IDQgMTcgTCA0IDI0IEMgNCAyNC4wMzEyNSA0IDI0LjA2MjUgNCAyNC4wOTM3NSBMIDQgMjUgQyA0IDI1LjU1MDc4MSA0LjQ0OTIxOSAyNiA1IDI2IEwgOCAyNiBMIDguMzQzNzUgMjUgTCAyMy42NTYyNSAyNSBMIDI0IDI2IEwgMjcgMjYgQyAyNy41NTA3ODEgMjYgMjggMjUuNTUwNzgxIDI4IDI1IEwgMjggMjQuMTU2MjUgQyAyOC4wMDM5MDYgMjQuMTA1NDY5IDI4LjAwMzkwNiAyNC4wNTA3ODEgMjggMjQgTCAyOCAxNyBDIDI4LjAwMzkwNiAxNi45MDYyNSAyNy45OTIxODggMTYuODA4NTk0IDI3Ljk2ODc1IDE2LjcxODc1IEwgMjcuMzQzNzUgMTQuNTkzNzUgTCAyOS4zMTI1IDEzLjkzNzUgTCAyOC42ODc1IDEyLjA2MjUgTCAyNi43NSAxMi43MTg3NSBMIDI1LjM3NSA4LjEyNSBDIDI0Ljk5NjA5NCA2Ljg1OTM3NSAyMy44MjAzMTMgNiAyMi41IDYgWiBNIDkuNSA4IEwgMjIuNSA4IEMgMjIuOTQ1MzEzIDggMjMuMzM5ODQ0IDguMjkyOTY5IDIzLjQ2ODc1IDguNzE4NzUgTCAyNC43NSAxMyBMIDcuMjUgMTMgTCA4LjUzMTI1IDguNzE4NzUgQyA4LjY2MDE1NiA4LjI4OTA2MyA5LjA1NDY4OCA4IDkuNSA4IFogTSA2LjY1NjI1IDE1IEwgMjUuMzQzNzUgMTUgTCAyNiAxNy4xODc1IEwgMjYgMjMgTCA2IDIzIEwgNiAxNy4xODc1IFogTSA4LjUgMTYgQyA3LjY3MTg3NSAxNiA3IDE2LjY3MTg3NSA3IDE3LjUgQyA3IDE4LjMyODEyNSA3LjY3MTg3NSAxOSA4LjUgMTkgQyA5LjMyODEyNSAxOSAxMCAxOC4zMjgxMjUgMTAgMTcuNSBDIDEwIDE2LjY3MTg3NSA5LjMyODEyNSAxNiA4LjUgMTYgWiBNIDIzLjUgMTYgQyAyMi42NzE4NzUgMTYgMjIgMTYuNjcxODc1IDIyIDE3LjUgQyAyMiAxOC4zMjgxMjUgMjIuNjcxODc1IDE5IDIzLjUgMTkgQyAyNC4zMjgxMjUgMTkgMjUgMTguMzI4MTI1IDI1IDE3LjUgQyAyNSAxNi42NzE4NzUgMjQuMzI4MTI1IDE2IDIzLjUgMTYgWiBNIDEyIDE5IEwgMTAuNzUgMjIgTCAxMi45MDYyNSAyMiBMIDEzLjM0Mzc1IDIxIEwgMTguNjU2MjUgMjEgTCAxOS4wOTM3NSAyMiBMIDIxLjI1IDIyIEwgMjAgMTkgWiIvPjwvc3ZnPg==",iEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiA0IEMgMTEuMDQyOTY5IDQgNyA4LjA0Mjk2OSA3IDEzIEMgNyAxNC45MTc5NjkgNy44NDM3NSAxNi45MDYyNSA5IDE4LjY4NzUgQyA5Ljg1OTM3NSAyMC4wMTE3MTkgMTAuODg2NzE5IDIxLjIzMDQ2OSAxMiAyMi4xNTYyNSBMIDEyIDI1IEMgMTIgMjYuMDkzNzUgMTIuOTA2MjUgMjcgMTQgMjcgTCAxNSAyOCBMIDE3IDI4IEwgMTggMjcgQyAxOS4wOTM3NSAyNyAyMCAyNi4wOTM3NSAyMCAyNSBMIDIwIDIyLjE1NjI1IEMgMjEuMTEzMjgxIDIxLjIzMDQ2OSAyMi4xNDA2MjUgMjAuMDExNzE5IDIzIDE4LjY4NzUgQyAyNC4xNTYyNSAxNi45MDYyNSAyNSAxNC45MTc5NjkgMjUgMTMgQyAyNSA4LjA0Mjk2OSAyMC45NTcwMzEgNCAxNiA0IFogTSAxNiA2IEMgMTkuODc4OTA2IDYgMjMgOS4xMjEwOTQgMjMgMTMgQyAyMyAxNC4zMDg1OTQgMjIuMzU1NDY5IDE2LjAzNTE1NiAyMS4zNDM3NSAxNy41OTM3NSBDIDIwLjQ0MTQwNiAxOC45ODQzNzUgMTkuMjUzOTA2IDIwLjIyMjY1NiAxOC4xNTYyNSAyMSBMIDEzLjg0Mzc1IDIxIEMgMTIuNzQ2MDk0IDIwLjIyMjY1NiAxMS41NTg1OTQgMTguOTg0Mzc1IDEwLjY1NjI1IDE3LjU5Mzc1IEMgOS42NDQ1MzEgMTYuMDM1MTU2IDkgMTQuMzA4NTk0IDkgMTMgQyA5IDkuMTIxMDk0IDEyLjEyMTA5NCA2IDE2IDYgWiBNIDE0LjI1IDIzIEwgMTcuNzUgMjMgQyAxNy44MjgxMjUgMjMuMDU0Njg4IDE3LjkxMDE1NiAyMy4wOTM3NSAxOCAyMy4xMjUgTCAxOCAyNSBMIDE0IDI1IEwgMTQgMjMuMTI1IEMgMTQuMDg5ODQ0IDIzLjA5Mzc1IDE0LjE3MTg3NSAyMy4wNTQ2ODggMTQuMjUgMjMgWiIvPjwvc3ZnPg==",sEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxMSA1IEwgMTEgMTEgTCA1IDExIEwgNSAxMyBMIDExIDEzIEwgMTEgMTkgTCA1IDE5IEwgNSAyMSBMIDExIDIxIEwgMTEgMjcgTCAxMyAyNyBMIDEzIDIxIEwgMTkgMjEgTCAxOSAyNyBMIDIxIDI3IEwgMjEgMjEgTCAyNyAyMSBMIDI3IDE5IEwgMjEgMTkgTCAyMSAxMyBMIDI3IDEzIEwgMjcgMTEgTCAyMSAxMSBMIDIxIDUgTCAxOSA1IEwgMTkgMTEgTCAxMyAxMSBMIDEzIDUgWiBNIDEzIDEzIEwgMTkgMTMgTCAxOSAxOSBMIDEzIDE5IFoiLz48L3N2Zz4=",oEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSA5IDQgQyA3LjM0NiA0IDYgNS4zNDYgNiA3IEMgNiA4LjMwMTYwOTQgNi44Mzg3NDg2IDkuNDAyMTM5MSA4IDkuODE2NDA2MiBMIDggMTEuMzA0Njg4IEwgOCAyMy4yMDcwMzEgTCA4IDI3LjAyMzQzOCBDIDggMjcuNTYzNDM4IDguNDM2NTYyNSAyOCA4Ljk3NjU2MjUgMjggTCA5LjAyMzQzNzUgMjggQyA5LjU2MzQzNzUgMjggMTAgMjcuNTYzNDM3IDEwIDI3LjAyMzQzOCBMIDEwIDIyLjIyODUxNiBDIDEwLjMzNDcwNyAyMS44Mzk3NTYgMTEuMTM4NDIzIDIxLjA0Njg3NSAxMy40NDUzMTIgMjEuMDQ2ODc1IEMgMTQuNjY5MzEzIDIxLjA0Njg3NSAxNS42NzA0MjIgMjEuNDczNzgxIDE2LjczMjQyMiAyMS45MjU3ODEgQyAxNy43Njk0MjIgMjIuMzY3NzgxIDE4Ljg0MTg5MSAyMi44MjQyMTkgMjAuMDg3ODkxIDIyLjgyNDIxOSBDIDIyLjQ0Njg5MSAyMi44MjQyMTkgMjQuMDQ5Mzc1IDIxLjU4NDY4OCAyNC43MzQzNzUgMjEuMDU0Njg4IEwgMjQuODg2NzE5IDIwLjkzOTQ1MyBDIDI1LjQzNzcxOSAyMC41NDA0NTMgMjYgMTkuOTk2IDI2IDE5IEwgMjYgMTAuNjc1NzgxIEMgMjYgOS43Njc3ODEyIDI1LjIyMTgyOCA5IDI0LjI5ODgyOCA5IEMgMjMuODAzODI4IDkgMjMuNDQwNDA2IDkuMjg2NTkzNyAyMi45NDE0MDYgOS42ODM1OTM4IEMgMjIuMjc5NDA2IDEwLjIwNzU5NCAyMS4yODA4OTEgMTEgMjAuMDg3ODkxIDExIEMgMTkuMjcyODkxIDExIDE4LjQ3NzY4OCAxMC42MTk3MzQgMTcuNTU0Njg4IDEwLjE3NzczNCBDIDE2LjQwMzY4NyA5LjYyNTczNDQgMTUuMDk4MzU5IDkgMTMuNDQzMzU5IDkgQyAxMi4zMDgyNTcgOSAxMS40MjE2ODcgOS4xODgzMzkzIDEwLjcxMjg5MSA5LjQ1NzAzMTIgQyAxMS40ODkwNzEgOC45MTQxODI0IDEyIDguMDE2NzgwMiAxMiA3IEMgMTIgNS4zNDYgMTAuNjU0IDQgOSA0IHogTSA5IDYgQyA5LjU1MiA2IDEwIDYuNDQ5IDEwIDcgQyAxMCA3LjU1MSA5LjU1MiA4IDkgOCBDIDguNDQ4IDggOCA3LjU1MSA4IDcgQyA4IDYuNDQ5IDguNDQ4IDYgOSA2IHogTSAxMy40NDMzNTkgMTEgQyAxNC42NDUzNTkgMTEgMTUuNjM4NDA2IDExLjQ3NjQ2OSAxNi42OTE0MDYgMTEuOTgwNDY5IEMgMTcuNzM2NDA2IDEyLjQ4MjQ2OSAxOC44MTc4OTEgMTMgMjAuMDg3ODkxIDEzIEMgMjEuODQyODkxIDEzIDIzLjE1ODA0NyAxMi4wNTQ0ODQgMjMuOTk4MDQ3IDExLjM5NjQ4NCBMIDIzLjk5ODA0NyAxOS4wNjY0MDYgQyAyMy45OTcwNDcgMTkuMDcwNDA2IDIzLjk1Mjk4NCAxOS4xNDUyNjYgMjMuNzA4OTg0IDE5LjMyMjI2NiBMIDIzLjUwOTc2NiAxOS40NzQ2MDkgQyAyMi45NDI3NjYgMTkuOTEyNjA5IDIxLjc2Mjg5MSAyMC44MjQyMTkgMjAuMDg3ODkxIDIwLjgyNDIxOSBDIDE5LjI0OTg5MSAyMC44MjQyMTkgMTguNDQ2NjI1IDIwLjQ4MjkzNyAxNy41MTU2MjUgMjAuMDg1OTM4IEMgMTYuMzcyNjI1IDE5LjU5NzkzOCAxNS4wNzYzNTkgMTkuMDQ0OTIyIDEzLjQ0MzM1OSAxOS4wNDQ5MjIgQyAxMS44OTEzNTkgMTkuMDQ0OTIyIDEwLjc4NiAxOS4zNTggMTAgMTkuNzUgTCAxMCAxMi4zNjEzMjggQyAxMC4zNDUgMTEuOTA1MzI4IDExLjEzMjM1OSAxMSAxMy40NDMzNTkgMTEgeiIvPjwvc3ZnPg==",aEr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZD0iTSAxNiA0IEMgMTEuODMyMDMxIDQgOC4xNTIzNDQgNi4xMTMyODEgNiA5LjM0Mzc1IEwgNiA2IEwgNCA2IEwgNCAxMyBMIDExIDEzIEwgMTEgMTEgTCA3LjM3NSAxMSBDIDkuMTAxNTYzIDguMDE5NTMxIDEyLjI5Njg3NSA2IDE2IDYgQyAyMS41MzUxNTYgNiAyNiAxMC40NjQ4NDQgMjYgMTYgQyAyNiAyMS41MzUxNTYgMjEuNTM1MTU2IDI2IDE2IDI2IEMgMTAuNDY0ODQ0IDI2IDYgMjEuNTM1MTU2IDYgMTYgTCA0IDE2IEMgNCAyMi42MTcxODggOS4zODI4MTMgMjggMTYgMjggQyAyMi42MTcxODggMjggMjggMjIuNjE3MTg4IDI4IDE2IEMgMjggOS4zODI4MTMgMjIuNjE3MTg4IDQgMTYgNCBaIE0gMTUgOCBMIDE1IDE3IEwgMjIgMTcgTCAyMiAxNSBMIDE3IDE1IEwgMTcgOCBaIi8+PC9zdmc+Cg==";const lEr=Zn({name:"Header",setup(t){const{state:e,updateSearch:n,updateActiveGroup:r}=_i("store"),i=Je(()=>!e.options.hideSearch),s=Je(()=>!e.options.hideGroupIcons),o=JSON.parse(JSON.stringify(e.orderedGroupKeys)),a=Je(()=>e.options.staticTexts.placeholder||""),l=Je({get:()=>e.search,set:d=>n(d)}),c=[...e.groups,...Object.keys(e.options.additionalGroups).map(d=>({key:d,title:e.options.groupNames[d]?e.options.groupNames[d]:rae(d)}))],u=[];return o.forEach(d=>{const f=c.findIndex(h=>h.key===d);f!==-1&&(u.push(c[f]),c.splice(f,1))}),{orderedGroups:u,orderedKeys:o,searchValue:l,updateActiveGroup:r,hasSearch:i,hasGroupIcons:s,placeholder:a,icons:{smileys_people:tae,animals_nature:eEr,food_drink:tEr,activities:nEr,travel_places:rEr,objects:iEr,symbols:sEr,flags:oEr,...e.options.groupIcons,recent:aEr}}}}),cEr={key:0,class:"v3-header"},uEr={key:0,class:"v3-groups"},dEr=["onClick"],fEr=["title"],hEr=["src"],pEr={key:1,class:"v3-spacing"},TEr={key:2,class:"v3-search"},OEr=["placeholder"];function mEr(t,e,n,r,i,s){return t.hasGroupIcons||t.hasSearch?(k(),R("div",cEr,[t.hasGroupIcons?(k(),R("div",uEr,[(k(!0),R(Ve,null,dt(t.orderedGroups,o=>(k(),R("button",{key:o.key,type:"button",class:ye(["v3-group",{"v3-is-hidden":!t.icons[o.key]}]),onClick:a=>t.updateActiveGroup(o.key)},[b("span",{title:o.title,class:"v3-icon"},[b("img",{src:t.icons[o.key],alt:""},null,8,hEr)],8,fEr)],10,dEr))),128))])):ne("",!0),t.hasGroupIcons&&t.hasSearch?(k(),R("div",pEr)):ne("",!0),t.hasSearch?(k(),R("div",TEr,[He(b("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.searchValue=o),type:"text",placeholder:t.placeholder},null,8,OEr),[[vt,t.searchValue]])])):ne("",!0)])):ne("",!0)}var gEr=P7(lEr,[["render",mEr]]);const QEr=Zn({name:"Header",setup(){const{state:t,updateSkinTone:e}=_i("store"),n=We(!1),r=We(!1),i=Je(()=>t.skinTone),s=Je(()=>t.options.staticTexts.skinTone||"Skin tone"),o=Je(()=>!t.options.disableSkinTones),a=nae()?"is-mac":"",l=Je(()=>({...t.emoji,src:qoe+"/"+t.emoji[Yf]+".png"}));function c(f=!0){n.value=f}function u(){n.value=!n.value}function d(f){e(f),c(!1)}return br(()=>t.emoji,()=>{r.value=!1}),{emoji:l,SKIN_TONES:dSr,updateSkinToneState:c,skinTone:n,stateSkinTone:i,selectSkinTone:d,toggleSkinToneState:u,EMOJI_RESULT_KEY:Yf,EMOJI_NAME_KEY:lT,skinToneText:s,hasSkinTones:o,native:t.options.native,unicodeToEmoji:Nh,platform:a,hasError:r}}}),_Er={class:"v3-foot-left"},vEr={key:0},yEr=["alt","src"],bEr={class:"v3-text"},SEr={class:"v3-text"},xEr=["onClick"];function EEr(t,e,n,r,i,s){return k(),R("div",{class:"v3-footer",onMouseleave:e[2]||(e[2]=o=>t.updateSkinToneState(!1))},[b("div",_Er,[b("span",{class:ye([t.platform,"v3-icon"])},[t.native||t.hasError?(k(),R("span",vEr,ae(t.unicodeToEmoji(t.emoji.r)),1)):(k(),R("img",{key:1,alt:t.unicodeToEmoji(t.emoji.r),src:t.emoji.src,onError:e[0]||(e[0]=o=>t.hasError=!0)},null,40,yEr))],2),b("span",bEr," :"+ae(t.emoji[t.EMOJI_NAME_KEY][1]||t.emoji[t.EMOJI_NAME_KEY][0])+": ",1)]),t.hasSkinTones?(k(),R(Ve,{key:0},[b("button",{type:"button",class:"v3-tone",onClick:e[1]||(e[1]=(...o)=>t.toggleSkinToneState&&t.toggleSkinToneState(...o))},[b("span",SEr,ae(t.skinToneText),1),b("span",{class:ye(`v3-icon v3-tone-${t.stateSkinTone}`)},null,2)]),b("div",{class:ye([t.skinTone?"v3-is-open":"","v3-skin-tones"])},[(k(!0),R(Ve,null,dt(t.SKIN_TONES,o=>(k(),R("button",{key:o,type:"button",class:ye(["v3-skin-tone-"+o,"v3-skin-tone"]),onClick:a=>t.selectSkinTone(o)},null,10,xEr))),128))],2)],64)):ne("",!0)],32)}var wEr=P7(QEr,[["render",EEr]]);const CEr=Zn({name:"PickerRoot",components:{Header:gEr,Body:Jxr,Footer:wEr},props:{type:{type:String,default:""},text:{type:String,default:""},additionalGroups:{type:Object,default:()=>({})},groupOrder:{type:Array,default:()=>[]},groupIcons:{type:Object,default:()=>({})},groupNames:{type:Object,default:()=>({})}},emits:{select:t=>!0,"update:text":t=>!0},setup(t,{emit:e}){const n=We(),r=We(),i=We(),s=We(!1),o=We(t.text),a=t.type==="input"||t.type==="textarea";let l=-1;const{state:c}=_i("store"),u=Je(()=>c.options.colorTheme);function d(m){if(a){const O=c.options.mode;O==="prepend"?o.value=m.i+o.value:O==="insert"&&l!==-1?(o.value=`${o.value.slice(0,l)}${m.i}${o.value.slice(l)}`,l+=m.i.length):o.value+=m.i,e("update:text",o.value)}e("select",m)}function f(){var m;n.value&&(l=((m=n.value)==null?void 0:m.selectionEnd)||-1)}function h(m){var O;!((O=m.target)!=null&&O.closest(".v3-input-picker-wrap"))&&s.value&&(s.value=!1)}function p(){if(r.value&&i.value&&a){let m=c.options.offset;typeof m!="number"&&(m=6),Uxr(r.value,i.value,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,m]}}]}),document.body.addEventListener("click",h)}}function T(m){o.value=m.target.value||"",e("update:text",o.value)}return Ii(()=>{p()}),$c(()=>{document.body.removeEventListener("click",h)}),{face:tae,open:s,onSelect:d,input:o,elem:n,updateCursor:f,button:r,picker:i,isInputType:a,onChangeText:T,colorTheme:u}}}),LEr={key:0,class:"v3-input-emoji-picker"},$Er={class:"v3-input-picker-root"},AEr=["value"],kEr=["value"],PEr=["src"];function REr(t,e,n,r,i,s){const o=Xe("Header"),a=Xe("Body"),l=Xe("Footer");return t.isInputType?(k(),R("div",LEr,[b("div",$Er,[t.type==="input"?(k(),R("input",{key:0,ref:"elem",value:t.input,type:"text",class:"v3-emoji-picker-input",onInput:e[0]||(e[0]=(...c)=>t.onChangeText&&t.onChangeText(...c)),onBlur:e[1]||(e[1]=(...c)=>t.updateCursor&&t.updateCursor(...c))},null,40,AEr)):(k(),R("textarea",{key:1,ref:"elem",value:t.input,class:"v3-emoji-picker-textarea",onInput:e[2]||(e[2]=(...c)=>t.onChangeText&&t.onChangeText(...c)),onBlur:e[3]||(e[3]=(...c)=>t.updateCursor&&t.updateCursor(...c))},null,40,kEr)),b("div",{class:ye(["v3-input-picker-wrap",t.open?"v3-picker-is-open":""])},[b("button",{ref:"button",type:"button",class:"v3-input-picker-icon",onClick:e[4]||(e[4]=c=>t.open=!t.open)},[b("img",{src:t.face,alt:""},null,8,PEr)],512),b("div",{ref:"picker",class:ye(["v3-emoji-picker","v3-color-theme-"+t.colorTheme])},[te(o),te(a,{onSelect:t.onSelect},null,8,["onSelect"]),te(l)],2)],2)])])):(k(),R("div",{key:1,class:ye(["v3-emoji-picker","v3-color-theme-"+t.colorTheme])},[te(o),te(a,{onSelect:t.onSelect},null,8,["onSelect"]),te(l)],2))}var MEr=P7(CEr,[["render",REr]]);const DEr=Zn({name:"Picker",components:{PickerRoot:MEr},props:{native:{type:Boolean,default:!1},hideSearch:{type:Boolean,default:!1},hideGroupIcons:{type:Boolean,default:!1},hideGroupNames:{type:Boolean,default:!1},staticTexts:{type:Object,default:()=>({})},disableStickyGroupNames:{type:Boolean,default:!1},disabledGroups:{type:Array,default:()=>[]},groupNames:{type:Object,default:()=>({})},disableSkinTones:{type:Boolean,default:!1},text:{type:String,default:""},mode:{type:String,default:"insert"},offset:{type:Number,default:6},additionalGroups:{type:Object,default:()=>({})},groupOrder:{type:Array,default:()=>[]},groupIcons:{type:Object,default:()=>({})},pickerType:{type:String,default:""},displayRecent:{type:Boolean,default:!1},theme:{type:String,default:"light"}},emits:{"update:text":t=>!0,select:t=>!0},setup(t,{emit:e}){const n=We(t.text);function r(s){n.value=s||"",e("update:text",n.value)}const i=DSr();return i.updateOptions({native:t.native,hideSearch:t.hideSearch,hideGroupIcons:t.hideGroupIcons,hideGroupNames:t.hideGroupNames,staticTexts:{...fSr,...t.staticTexts},disableStickyGroupNames:t.disableStickyGroupNames,disabledGroups:t.disabledGroups,groupNames:{...Uoe,...t.groupNames},disableSkinTones:t.disableSkinTones,displayRecent:t.displayRecent,additionalGroups:t.additionalGroups,mode:t.mode,offset:t.offset,groupOrder:t.groupOrder,groupIcons:t.groupIcons,colorTheme:hSr.includes(t.theme)?t.theme:"light"}),Q4("store",i),{type:t.pickerType,input:n,onChangeText:r}}});function NEr(t,e,n,r,i,s){const o=Xe("picker-root");return k(),Qt(o,{type:t.type,text:t.input,onSelect:e[0]||(e[0]=a=>t.$emit("select",a)),"onUpdate:text":t.onChangeText},null,8,["type","text","onUpdate:text"])}var IEr=P7(DEr,[["render",NEr]]);const HEr={beforeMount(t,e){t.clickOutsideEvent=function(n){if(!(t===n.target||t.contains(n.target))){if(e.arg){let r=!1;try{r=(Array.isArray(e.arg)?e.arg:[e.arg]).some(s=>{const o=s.value||s;return o&&(o===n.target||o.contains(n.target))})}catch(i){console.error("Error in clickOutside directive arg:",i)}if(r)return}e.value(n)}},document.body.addEventListener("mousedown",t.clickOutsideEvent,!0)},unmounted(t){document.body.removeEventListener("mousedown",t.clickOutsideEvent,!0)}},VEr={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},directives:{clickOutside:HEr},components:{PersonalitiesCommands:iSr,EmojiPicker:IEr},data(){return{message:"",isSendMenuVisible:!1,is_rt:!1,isListeningToVoice:!1,recognition:null,silenceTimer:null,silenceTimeoutDuration:3e3,recognitionError:!1,filesList:[],isFileSentList:[],totalSize:"0 B",showfilesList:!0,showHelpModal:!1,showEmojiPicker:!1,isDragging:!1,isPositionModified:!1,startDragPos:{x:0,y:0},startChatboxPos:{x:0,y:0},currentChatboxPos:null,isShrunk:!1,posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{chatbarStyle(){return this.isPositionModified&&this.currentChatboxPos?{transform:`translate(${this.currentChatboxPos.x}px, ${this.currentChatboxPos.y}px)`,left:"0px",top:"0px",bottom:"auto","margin-left":"0px","transform-origin":"top left"}:{}},isCompactMode(){return this.$store.state.view_mode==="compact"},isdataLakeNamesValid(){return Array.isArray(this.dataLakeNames)&&this.dataLakeNames.length>0},isCommandsValid(){const t=this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id];return t&&Array.isArray(t.commands)&&t.commands.length>0},dataLakeNames(){return(this.$store.state.config.datalakes||[]).map(t=>({name:t.alias,value:t.alias||"default_value",is_checked:t.mounted,icon:"",help:"Mounts the datalake "+t.alias}))},functionCalls(){return(this.$store.state.config.mounted_function_calls||[]).map(t=>({name:t.name,value:t,dir:t.dir,is_checked:t.selected,icon:t.icon||"feather:zap",help:t.help||`Toggles the function call ${t.name}`}))}},methods:{updateFeatherIcons(){Fe(()=>{try{Re.replace()}catch(t){console.error("Feather error:",t)}})},toggleShrink(){this.isShrunk=!this.isShrunk,localStorage.setItem("chatbarShrunk",JSON.stringify(this.isShrunk)),this.updateFeatherIcons()},onMouseDown(t){if(t.button!==0||this.isShrunk)return;this.isDragging=!0,document.body.classList.add("user-select-none"),this.startDragPos={x:t.clientX,y:t.clientY};const e=this.$refs.chatbarRef;if(!e)return;const n=e.getBoundingClientRect();this.isPositionModified||(this.currentChatboxPos={x:n.left,y:n.top},this.isPositionModified=!0),this.currentChatboxPos||(this.currentChatboxPos={x:n.left,y:n.top}),this.startChatboxPos={...this.currentChatboxPos},window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mouseleave",this.onMouseLeave)},onMouseMove(t){if(!this.isDragging||!this.$refs.chatbarRef)return;t.preventDefault();const e=t.clientX-this.startDragPos.x,n=t.clientY-this.startDragPos.y;this.currentChatboxPos={x:this.startChatboxPos.x+e,y:this.startChatboxPos.y+n}},onMouseUp(){this.isDragging&&(this.isDragging=!1,document.body.classList.remove("user-select-none"),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mouseleave",this.onMouseLeave),this.isPositionModified&&this.currentChatboxPos&&(localStorage.setItem("chatbarPosition",JSON.stringify(this.currentChatboxPos)),localStorage.setItem("chatbarPositionModified","true")))},onMouseLeave(t){this.isDragging&&this.onMouseUp()},toggleEmojiPicker(){this.showEmojiPicker=!this.showEmojiPicker},closeEmojiPicker(){this.showEmojiPicker&&(this.showEmojiPicker=!1)},onEmojiSelect(t){var e;this.insertEmojiAtCursor(t.i),this.closeEmojiPicker(),(e=this.$refs.textareaRef)==null||e.focus()},insertEmojiAtCursor(t){const e=this.$refs.textareaRef;if(!e)return;const n=e.selectionStart,r=e.selectionEnd,i=this.message;this.message=i.substring(0,n)+t+i.substring(r),Fe(()=>{e&&(e.selectionStart=e.selectionEnd=n+t.length)})},computedFileSize(t){return typeof t!="number"?"N/A":O4(t,{})},recalculateTotalSize(){let t=0;this.filesList.forEach(e=>{e&&typeof e.size=="number"&&(t+=e.size)}),this.totalSize=this.computedFileSize(t)},addFilesFromInput(t){t&&t.length>0&&this.addFiles(t),this.$refs.fileDialog&&(this.$refs.fileDialog.value="")},addFiles(t){if(!t||t.length===0)return;let e;try{e=Array.from(t)}catch{this.onShowToastMessage("Error processing selected files.",4,!1);return}let n=!1;e.forEach(r=>{if(!r||typeof r.name>"u"||typeof r.size>"u"){this.onShowToastMessage("Skipped an invalid file entry.",4,!1);return}if(this.filesList.some(s=>s.name===r.name&&s.size===r.size))this.onShowToastMessage(`File ${r.name} already added.`,4,!1);else{const s=this.filesList.length;this.filesList.push(r),this.isFileSentList.push(!1),this.send_file(r,s),n=!0}}),n&&this.updateFeatherIcons()},send_file(t,e){const n=new FileReader,r=1024*1024;let i=0,s=0;const o=Math.ceil(t.size/r);n.onload=()=>{if(n.result){const l=n.result,c=i+l.byteLength>=t.size;et.emit("send_file_chunk",{client_id:this.$store.state.client_id,filename:t.name,chunk:l,offset:i,isLastChunk:c,chunkIndex:s,totalChunks:o,fileIndex:e}),i+=l.byteLength,s++,c||setTimeout(a,0)}else this.onShowToastMessage(`Error reading ${t.name}. Upload failed.`,4,!1)},n.onerror=l=>{this.onShowToastMessage(`Error reading ${t.name}. Upload failed.`,4,!1)};const a=()=>{const l=this.filesList[e];if(l&&i=0&&en.name===t.name&&n.size===t.size&&n.lastModified===t.lastModified);e!==-1&&(this.removeFileByIndex(e),this.notifyServerFileRemoved(t.name))},removeFileByIndex(t){if(t>=0&&t{const e=window.URL.createObjectURL(new Blob([t.data])),n=document.createElement("a");n.href=e;const r=t.headers["content-disposition"];let i="discussion_files.zip";if(r){const s=r.match(/filename\*?=['"]?([^'";]+)['"]?/i);if(s&&s[1])try{i=decodeURIComponent(s[1].replace(/['"]/g,""))}catch{const a=r.match(/filename="?(.+)"?/i);a&&a[1]&&(i=a[1])}}n.setAttribute("download",i),document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n),window.URL.revokeObjectURL(e)},100)}).catch(t=>{this.onShowToastMessage("Error downloading files.",4,!1)})},handlePaste(t){var r;const e=(r=t.clipboardData||window.clipboardData)==null?void 0:r.items;if(!e)return;let n=[];for(let i=0;i0&&(t.preventDefault(),this.addFiles(n),this.onShowToastMessage(`Added ${n.length} file(s) from paste.`,4,!0))},toggleLeftPanel(){this.$store.commit("setLeftPanelCollapsed",!this.$store.state.leftPanelCollapsed)},toggleRightPanel(){this.$store.commit("setRightPanelCollapsed",!this.$store.state.rightPanelCollapsed)},toggleThinkFirstMode(){this.$store.state.config.think_first_mode=!this.$store.state.config.think_first_mode,this.$store.dispatch("applyConfiguration"),this.$store.dispatch("saveConfiguration")},toggleFunMode(){this.$store.state.config.fun_mode=!this.$store.state.config.fun_mode,this.$store.dispatch("applyConfiguration"),this.$store.dispatch("saveConfiguration")},startSpeechRecognition(){var e,n;const t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t){this.onShowToastMessage("Speech recognition not supported by your browser.",4,!1);return}if(this.isListeningToVoice){(e=this.recognition)==null||e.stop(),clearTimeout(this.silenceTimer),this.isListeningToVoice=!1;return}try{this.recognition=new t,this.recognition.lang=((n=this.$store.state.config)==null?void 0:n.audio_in_language)||navigator.language||"en-US",this.recognition.interimResults=!0,this.recognition.continuous=!1,this.recognitionError=!1,this.recognition.onstart=()=>{this.isListeningToVoice=!0,this.resetSilenceTimer()},this.recognition.onresult=r=>{this.resetSilenceTimer();let i="",s="";for(let o=r.resultIndex;o{this.recognitionError=!0;let i="Speech recognition error";switch(r.error){case"no-speech":i="No speech detected. Please try again.";break;case"audio-capture":i="Microphone error. Check microphone connection and permissions.";break;case"not-allowed":i="Microphone access denied. Please allow microphone access in browser settings.";break;case"network":i="Network error during speech recognition.";break;case"service-not-allowed":i="Speech recognition service denied. Check browser/OS settings.";break;default:i=`Speech error: ${r.error}`}this.onShowToastMessage(i,4,!1),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{this.isListeningToVoice=!1,clearTimeout(this.silenceTimer),this.message.trim()&&!["no-speech","not-allowed","audio-capture"].includes(this.recognitionError?this.recognition.error:"")&&this.submit(),this.recognition=null},this.recognition.start()}catch{this.onShowToastMessage("Could not start voice input. Please check browser compatibility and permissions.",4,!1),this.isListeningToVoice=!1}},resetSilenceTimer(){clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.isListeningToVoice&&this.recognition&&this.recognition.stop()},this.silenceTimeoutDuration)},updateRT(){this.is_rt?this.stopRTCom():this.startRTCom()},startRTCom(){if(this.$store.state.config.active_tts_service==="None"||!this.$store.state.config.active_tts_service||this.$store.state.config.active_stt_service==="None"||!this.$store.state.config.active_stt_service){this.onShowToastMessage("Both TTS and STT services must be configured and selected to use Real-Time mode.",4,!1);return}et.emit("start_bidirectional_audio_stream",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Attempting to start Real-time audio...",4,!0)},stopRTCom(){et.emit("stop_bidirectional_audio_stream",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Stopping Real-time audio...",4,!0)},handleRTComStatusChanged(t){if(t&&t.client_id===this.$store.state.client_id){this.is_rt=t.status;const e=`Real-time audio mode ${this.is_rt?"activated":"deactivated"}.`;this.onShowToastMessage(e,4,this.is_rt)}},toggleSendMenu(){this.isSendMenuVisible=!this.isSendMenuVisible,this.isSendMenuVisible&&this.updateFeatherIcons()},closeSendMenu(){this.isSendMenuVisible&&(this.isSendMenuVisible=!1)},add_file(){var t;this.closeSendMenu(),(t=this.$refs.fileDialog)==null||t.click()},takePicture(){this.closeSendMenu(),et.emit("take_picture",{client_id:this.$store.state.client_id}),this.onShowToastMessage("Requesting picture from camera service...",4,!0)},addWebLink(){this.closeSendMenu(),this.$emit("addWebLink")},handlePictureTaken(t){if(t&&t.client_id===this.$store.state.client_id&&t.status==="success"&&t.file){const e=this.createFileObjectFromBase64(t.file.data,t.file.name,t.file.type);e?(this.addFiles([e]),this.onShowToastMessage("Picture added successfully!",4,!0)):this.onShowToastMessage("Error processing received picture.",4,!1)}else t&&t.client_id===this.$store.state.client_id&&t.status==="error"&&this.onShowToastMessage(`Failed to take picture: ${t.error}`,4,!1)},createFileObjectFromBase64(t,e,n){try{const r=atob(t),i=new Array(r.length);for(let a=0;a{var r;(r=this.$refs.textareaRef)==null||r.focus()})},submitOnEnter(t){t.key==="Enter"&&!t.shiftKey&&!this.loading?(t.preventDefault(),t.repeat||this.sendMessageEvent(this.message)):t.key==="Enter"&&!t.shiftKey&&this.loading&&(t.preventDefault(),this.onShowToastMessage("Please wait for the current response to complete.",4,!1))},submit(){if(this.loading){this.onShowToastMessage("Please wait for the AI to finish responding.",4,!1);return}this.sendMessageEvent(this.message)},submitWithInternetSearch(){if(this.loading){this.onShowToastMessage("Please wait for the AI to finish responding.",4,!1);return}this.sendMessageEvent(this.message,"internet")},stopGenerating(){this.$emit("stopGenerating")},sendCMDEvent(t){t&&typeof t.value<"u"&&this.$emit("sendCMDEvent",t)},async mountDB(t){var s,o;const e=t;if(!e)return;const n=this.$store.state.config.datalakes.find(a=>a.alias===e),r=n?n.mounted:!1,i=r?"Unmounting":"Mounting";this.onShowToastMessage(`${i} datalake ${e}...`,4,!0);try{const a=await Ae.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,datalake_name:e},{headers:this.posts_headers});if((s=a.data)!=null&&s.status){const l=r?"unmounted":"mounted";this.onShowToastMessage(`Datalake ${e} ${l} successfully.`,4,!0)}else this.onShowToastMessage(`Failed to toggle datalake ${e}: ${((o=a.data)==null?void 0:o.error)||"Server error"}`,4,!1);await this.$store.dispatch("refreshConfig")}catch{this.onShowToastMessage(`Error toggling datalake ${e}. Check console for details.`,4,!1),await this.$store.dispatch("refreshConfig")}},async showFunctionSettings(t){const e=t;if(!e||!e.dir||!e.name)return;const r=e.dir.replace(/\\/g,"/").split("/").filter(Boolean),i=r.length>1?r[r.length-2]:"general";this.onShowToastMessage(`Fetching settings for ${e.name}...`,4,!0);try{const s=await Ae.post("/get_function_call_settings",{client_id:this.$store.state.client_id,category:i,name:e.name},{headers:this.posts_headers});s.data&&Object.keys(s.data).length>0?this.$store.state.universalForm.showForm(s.data,`Settings: ${e.name}`,"Save Changes","Cancel").then(o=>{this.onShowToastMessage(`Saving settings for ${e.name}...`,4,!0),Ae.post("/set_function_call_settings",{client_id:this.$store.state.client_id,category:i,name:e.name,settings:o},{headers:this.posts_headers}).then(a=>{var l,c;((l=a.data)==null?void 0:l.status)==="success"?this.onShowToastMessage(`Settings for ${e.name} saved successfully.`,4,!0):this.onShowToastMessage(`Failed to save settings: ${((c=a.data)==null?void 0:c.error)||"Unknown server error"}`,4,!1)}).catch(a=>{this.onShowToastMessage(`Error saving settings: ${a.message}`,4,!1)})}).catch(()=>{this.onShowToastMessage("Settings changes cancelled.",4,!0)}):this.onShowToastMessage(`${e.name} has no configurable settings.`,4,!0)}catch{this.onShowToastMessage(`Error fetching settings for ${e.name}. Check console.`,4,!1)}},async toggleFunctionCall(t){var i,s;const e=t;if(!e||!e.dir||!e.name)return;const n=e.is_checked,r=n?"Disabling":"Enabling";this.onShowToastMessage(`${r} function call ${e.name}...`,4,!0);try{const o=await Ae.post("/toggle_function_call",{client_id:this.$store.state.client_id,name:e.name,dir:e.dir},{headers:this.posts_headers});if((i=o.data)!=null&&i.status){const a=n?"disabled":"enabled";this.onShowToastMessage(`Function call ${e.name} ${a}.`,4,!0)}else this.onShowToastMessage(`Failed to toggle ${e.name}: ${((s=o.data)==null?void 0:s.error)||"Server error"}`,4,!1);await this.$store.dispatch("refreshConfig")}catch{this.onShowToastMessage(`Error toggling ${e.name}. Check console.`,4,!1),await this.$store.dispatch("refreshConfig")}}},watch:{filesList:{handler(){this.recalculateTotalSize(),this.updateFeatherIcons()},deep:!0},loading:"updateFeatherIcons",isSendMenuVisible(t){t&&this.updateFeatherIcons()},isShrunk(t,e){t!==e&&this.updateFeatherIcons()},showHelpModal(t){t&&this.updateFeatherIcons()},showEmojiPicker(t){},"$store.state.is_rt_on"(t){this.is_rt!==t&&(this.is_rt=t)},"$store.state.config.active_personality_id":"updateFeatherIcons","$store.state.config.datalakes":{handler:"updateFeatherIcons",deep:!0},"$store.state.config.mounted_function_calls":{handler:"updateFeatherIcons",deep:!0}},mounted(){this.$emit("loaded");try{const t=localStorage.getItem("chatbarShrunk");t!==null&&(this.isShrunk=JSON.parse(t));const e=localStorage.getItem("chatbarPositionModified"),n=localStorage.getItem("chatbarPosition");e==="true"&&n?(this.currentChatboxPos=JSON.parse(n),this.isPositionModified=!0):(this.isPositionModified=!1,this.currentChatboxPos=null)}catch{this.isShrunk=!1,this.isPositionModified=!1,this.currentChatboxPos=null,localStorage.removeItem("chatbarShrunk"),localStorage.removeItem("chatbarPositionModified"),localStorage.removeItem("chatbarPosition")}et.on("rtcom_status_changed",this.handleRTComStatusChanged),et.on("picture_taken",this.handlePictureTaken),et.on("file_upload_complete",this.handleFileUploadComplete),et.on("file_upload_error",this.handleFileUploadError),this.is_rt=this.$store.state.is_rt_on,this.recalculateTotalSize(),this.updateFeatherIcons()},beforeUnmount(){et.off("rtcom_status_changed",this.handleRTComStatusChanged),et.off("picture_taken",this.handlePictureTaken),et.off("file_upload_complete",this.handleFileUploadComplete),et.off("file_upload_error",this.handleFileUploadError),this.recognition&&this.isListeningToVoice&&(this.recognition.abort(),this.isListeningToVoice=!1),clearTimeout(this.silenceTimer),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mouseleave",this.onMouseLeave),document.body.classList.remove("user-select-none")},activated(){this.recalculateTotalSize(),this.is_rt=this.$store.state.is_rt_on,Fe(()=>{try{const t=localStorage.getItem("chatbarPositionModified"),e=localStorage.getItem("chatbarPosition");t==="true"&&e?(this.currentChatboxPos=JSON.parse(e),this.isPositionModified=!0):(this.isPositionModified=!1,this.currentChatboxPos=null);const n=localStorage.getItem("chatbarShrunk");n!==null&&(this.isShrunk=JSON.parse(n))}catch(t){console.error("Error reapplying state on activation:",t)}this.updateFeatherIcons()})},deactivated(){this.recognition&&this.isListeningToVoice&&(this.recognition.abort(),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)),this.isDragging&&this.onMouseUp()}},qEr={class:"p-3 rounded-b-xl"},UEr={class:"flex items-center justify-between mb-1.5"},BEr=["title"],zEr={class:"flex items-center gap-1.5"},XEr={class:"text-xs text-blue-600 dark:text-blue-300",title:"Total file size and number of files"},FEr={class:"flex items-center gap-1.5 min-w-0"},jEr={key:0,class:"animate-spin flex-shrink-0",title:"Uploading..."},YEr={key:1,"data-feather":"file",class:"w-3.5 h-3.5 flex-shrink-0 text-blue-600 dark:text-blue-300",title:"File"},GEr=["title"],WEr={class:"flex items-center gap-1.5 flex-shrink-0"},ZEr=["title"],KEr=["onClick"],JEr={class:"flex flex-row gap-1.5 w-full"},ewr={class:"relative flex-grow"},twr=["disabled"],nwr={key:0,class:"absolute bottom-full right-0 mb-1 z-20"},rwr={class:"absolute inset-y-0 right-0 flex items-center pr-1.5 space-x-1"},iwr={class:"flex items-center justify-between relative"},swr=["title"],owr={class:"flex items-center gap-1"},awr={class:"flex items-center gap-1"},lwr={class:"flex items-center gap-1"},cwr={class:"p-1.5 space-y-1"},uwr=["title"];function dwr(t,e,n,r,i,s){const o=Xe("EmojiPicker"),a=Xe("PersonalitiesCommands"),l=Tle("click-outside");return k(),R(Ve,null,[b("div",null,[te(cr,{name:"shrink-fade","enter-active-class":"transition ease-out duration-300","enter-from-class":"transform opacity-0 scale-50","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-200","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-50"},{default:Ie(()=>[i.isShrunk?(k(),R("button",{key:0,onClick:e[0]||(e[0]=(...c)=>s.toggleShrink&&s.toggleShrink(...c)),class:"fixed bottom-4 right-4 z-[60] p-3 bg-blue-500 dark:bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-600 dark:hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-400 dark:focus:ring-offset-gray-900 animate-heartbeat",title:"Expand Chat","aria-label":"Expand Chat"},e[35]||(e[35]=[b("i",{"data-feather":"message-square",class:"w-6 h-6"},null,-1)]))):ne("",!0)]),_:1}),te(cr,{name:"chatbar-fade-scale","enter-active-class":"transition ease-out duration-300","enter-from-class":"transform opacity-0 scale-95 translate-y-4","enter-to-class":"transform opacity-100 scale-100 translate-y-0","leave-active-class":"transition ease-in duration-200","leave-from-class":"transform opacity-100 scale-100 translate-y-0","leave-to-class":"transform opacity-0 scale-95 translate-y-4"},{default:Ie(()=>[i.isShrunk?ne("",!0):(k(),R("div",{key:0,ref:"chatbarRef",class:ye(["chatbox-color fixed w-11/12 max-w-3xl bg-opacity-90 backdrop-blur-md rounded-xl border border-blue-300 dark:border-blue-700 shadow-lg transition-shadow duration-300 ease-in-out z-50",i.isPositionModified?"":"bottom-4 left-1/2 transform -translate-x-1/2",i.isDragging?"cursor-grabbing":""]),style:qn(s.chatbarStyle)},[b("div",{class:ye(["flex items-center justify-between h-7 px-2 bg-blue-100/80 dark:bg-blue-900/70 border-b border-blue-300 dark:border-blue-600 hover:bg-blue-200/90 dark:hover:bg-blue-800/90 transition-colors duration-150 rounded-t-xl",[i.isDragging?"cursor-grabbing":"cursor-grab"]]),onMousedown:e[3]||(e[3]=oe((...c)=>s.onMouseDown&&s.onMouseDown(...c),["prevent"]))},[e[37]||(e[37]=b("span",{class:"chat-box-title-barselect-none"},"Chat",-1)),b("button",{onClick:e[1]||(e[1]=oe((...c)=>s.toggleShrink&&s.toggleShrink(...c),["stop"])),class:"svg-button p-1 rounded-full hover:bg-blue-300 dark:hover:bg-blue-700",title:"Shrink Chat",onMousedown:e[2]||(e[2]=oe(()=>{},["stop"]))},e[36]||(e[36]=[b("i",{"data-feather":"minus",class:"w-4 h-4"},null,-1)]),32)],34),b("div",qEr,[i.filesList.length>0?(k(),R("div",{key:0,class:"mb-2 border-b border-blue-200 dark:border-blue-700 pb-2",onMousedown:e[7]||(e[7]=oe(()=>{},["stop"]))},[b("div",UEr,[b("button",{class:"svg-button p-1.5",title:i.showfilesList?"Hide file list":"Show file list",onClick:e[4]||(e[4]=oe(c=>i.showfilesList=!i.showfilesList,["stop"]))},e[38]||(e[38]=[b("i",{"data-feather":"list",class:"w-4 h-4"},null,-1)]),8,BEr),b("div",zEr,[b("span",XEr,ae(i.totalSize)+" ("+ae(i.filesList.length)+") ",1),b("button",{onClick:e[5]||(e[5]=oe((...c)=>s.clear_files&&s.clear_files(...c),["stop"])),class:"svg-button p-1 hover:text-red-500 dark:hover:text-red-400",title:"Clear all files"},e[39]||(e[39]=[b("i",{"data-feather":"trash",class:"w-3.5 h-3.5"},null,-1)])),b("button",{onClick:e[6]||(e[6]=oe((...c)=>s.download_files&&s.download_files(...c),["stop"])),class:"svg-button p-1 hover:text-blue-500 dark:hover:text-blue-400",title:"Download all files"},e[40]||(e[40]=[b("i",{"data-feather":"download-cloud",class:"w-3.5 h-3.5"},null,-1)]))])]),He(te(V4,{name:"list",tag:"div",class:"max-h-32 overflow-y-auto rounded-md bg-blue-100 dark:bg-blue-900 divide-y divide-blue-200 dark:divide-blue-700 scrollbar"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(i.filesList,(c,u)=>(k(),R("div",{key:c.name+"-"+c.lastModified+"-"+c.size,class:"flex items-center justify-between p-1.5 group hover:bg-blue-200 dark:hover:bg-blue-800 transition-colors duration-150"},[b("div",FEr,[i.isFileSentList[u]?(k(),R("i",YEr)):(k(),R("div",jEr,e[41]||(e[41]=[b("i",{"data-feather":"loader",class:"w-3.5 h-3.5 text-blue-500 dark:text-blue-400"},null,-1)]))),b("span",{class:ye(["truncate text-xs",i.isFileSentList[u]?"text-green-600 dark:text-green-400":"text-blue-700 dark:text-blue-200"]),title:c.name},ae(c.name),11,GEr)]),b("div",WEr,[b("span",{class:"text-xs text-blue-500 dark:text-blue-400",title:s.computedFileSize(c.size)},ae(s.computedFileSize(c.size)),9,ZEr),b("button",{onClick:oe(d=>s.removeItem(c),["stop"]),class:"svg-button p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 dark:hover:text-red-400 transition-all duration-150",title:"Remove file"},e[42]||(e[42]=[b("i",{"data-feather":"x",class:"w-3.5 h-3.5"},null,-1)]),8,KEr)])]))),128))]),_:1},512),[[mr,i.showfilesList]])],32)):ne("",!0),b("div",{class:"flex flex-col gap-1.5",onMousedown:e[30]||(e[30]=oe(()=>{},["stop"]))},[b("div",JEr,[b("div",ewr,[He(b("textarea",{id:"chat",ref:"textareaRef",disabled:n.loading,"onUpdate:modelValue":e[8]||(e[8]=c=>i.message=c),onPaste:e[9]||(e[9]=(...c)=>s.handlePaste&&s.handlePaste(...c)),onKeydown:e[10]||(e[10]=gr(oe(c=>s.submitOnEnter(c),["exact"]),["enter"])),rows:"1",class:"input w-full p-2.5 pr-28 text-sm rounded-lg focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 border-blue-300 dark:border-blue-600 resize-y min-h-[2.75rem] max-h-28 overflow-auto transition-colors scrollbar text-blue-900 dark:text-blue-100 placeholder-blue-400 dark:placeholder-blue-500",placeholder:"Write your message...",title:"Enter your message here"},null,40,twr),[[vt,i.message]]),i.showEmojiPicker?He((k(),R("div",nwr,[te(o,{native:!0,onSelect:s.onEmojiSelect},null,8,["onSelect"])])),[[l,s.closeEmojiPicker]]):ne("",!0),b("div",rwr,[b("button",{onClick:e[11]||(e[11]=oe((...c)=>s.toggleEmojiPicker&&s.toggleEmojiPicker(...c),["stop"])),class:"svg-button p-1.5",title:"Add emoji"},e[43]||(e[43]=[b("i",{"data-feather":"smile",class:"w-4 h-4"},null,-1)])),n.loading?(k(),R("button",{key:0,onClick:e[12]||(e[12]=oe((...c)=>s.stopGenerating&&s.stopGenerating(...c),["stop"])),class:"btn btn-sm bg-red-500 text-white hover:bg-red-600 focus:ring-red-300 dark:focus:ring-red-600 transform hover:scale-105 active:scale-95 transition-all duration-200 ease-in-out shadow-md hover:shadow-lg animate-pulse p-1.5",title:"Stop generating","aria-label":"Stop generation process"},e[44]||(e[44]=[b("i",{"data-feather":"stop-circle",class:"w-4 h-4 animate-spin-slow"},null,-1),b("span",{class:"sr-only"},"Stop",-1)]))):(k(),R(Ve,{key:1},[b("button",{onClick:e[13]||(e[13]=oe((...c)=>s.submit&&s.submit(...c),["stop"])),class:"svg-button p-1.5",title:"Send message"},e[45]||(e[45]=[b("i",{"data-feather":"send",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[14]||(e[14]=oe((...c)=>s.submitWithInternetSearch&&s.submitWithInternetSearch(...c),["stop"])),class:"svg-button p-1.5",title:"Send with internet search"},e[46]||(e[46]=[b("i",{"data-feather":"globe",class:"w-4 h-4"},null,-1)]))],64))])])]),b("div",iwr,[b("button",{onClick:e[15]||(e[15]=oe((...c)=>s.toggleLeftPanel&&s.toggleLeftPanel(...c),["stop"])),class:ye(["svg-button p-1.5",t.$store.state.leftPanelCollapsed?"":"bg-blue-200 dark:bg-blue-700"]),title:t.$store.state.leftPanelCollapsed?"Expand Left Panel":"Collapse Left Panel"},e[47]||(e[47]=[b("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4"},[b("rect",{x:"3",y:"2",width:"4",height:"20",rx:"2",fill:"currentColor"}),b("rect",{x:"9",y:"6",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"9",y:"11",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"9",y:"16",width:"12",height:"2",rx:"1",fill:"currentColor"})],-1)]),10,swr),b("div",owr,[s.isCommandsValid?(k(),Qt(a,{key:0,help:"Personality commands",commandsList:t.$store.state.mountedPersArr[t.$store.state.config.active_personality_id].commands,sendCommand:s.sendCMDEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD",size:"small"},null,8,["commandsList","sendCommand","on-show-toast-message"])):ne("",!0),s.isdataLakeNamesValid?(k(),Qt(a,{key:1,help:"Datalakes",icon:"feather:book",commandsList:s.dataLakeNames,sendCommand:s.mountDB,"on-show-toast-message":n.onShowToastMessage,ref:"databasesList",size:"small"},null,8,["commandsList","sendCommand","on-show-toast-message"])):ne("",!0),t.$store.state.config.mounted_function_calls.length>0?(k(),Qt(a,{key:2,icon:"feather:zap",help:"Function calls (WIP)",commandsList:s.functionCalls,sendCommand:s.toggleFunctionCall,showSettings:s.showFunctionSettings,"on-show-toast-message":n.onShowToastMessage,ref:"functioncalls",size:"small"},null,8,["commandsList","sendCommand","showSettings","on-show-toast-message"])):ne("",!0)]),b("div",awr,[b("button",{onClick:e[16]||(e[16]=oe((...c)=>s.toggleThinkFirstMode&&s.toggleThinkFirstMode(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-blue-600 dark:text-blue-400 bg-blue-200 dark:bg-blue-700":t.$store.state.config.think_first_mode}]),title:"Toggle Think First Mode"},e[48]||(e[48]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[b("path",{d:"M12 2a6 6 0 0 1 6 6c0 2.42-1.61 4.5-4 5.25V15a2 2 0 0 1-4 0v-1.75C7.61 12.5 6 10.42 6 8a6 6 0 0 1 6-6z"}),b("path",{d:"M9 18h6"}),Se(),b("path",{d:"M10 22h4"})],-1)]),2),b("button",{onClick:e[17]||(e[17]=oe((...c)=>s.toggleFunMode&&s.toggleFunMode(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-blue-600 dark:text-blue-400 bg-blue-200 dark:bg-blue-700":t.$store.state.config.fun_mode}]),title:"Toggle Fun Mode"},e[49]||(e[49]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[b("circle",{cx:"12",cy:"12",r:"10"}),Se(),b("path",{d:"M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01"})],-1)]),2)]),b("div",lwr,[b("button",{onClick:e[18]||(e[18]=oe((...c)=>s.startSpeechRecognition&&s.startSpeechRecognition(...c),["stop"])),class:ye(["svg-button p-1.5",{"text-red-500 dark:text-red-400 animate-pulse":i.isListeningToVoice}]),title:"Voice input"},e[50]||(e[50]=[b("i",{"data-feather":"mic",class:"w-4 h-4"},null,-1)]),2),t.$store.state.config.active_tts_service!=="None"&&t.$store.state.config.active_tts_service&&t.$store.state.config.active_stt_service!=="None"?(k(),R("button",{key:0,onClick:e[19]||(e[19]=oe((...c)=>s.updateRT&&s.updateRT(...c),["stop"])),class:ye(["btn btn-sm p-1",i.is_rt?"bg-red-500 hover:bg-red-600 text-white":"bg-green-500 hover:bg-green-600 text-white"]),title:"Toggle real-time audio mode"},e[51]||(e[51]=[b("span",{class:"text-xs font-bold"},"RT",-1)]),2)):ne("",!0),b("button",{onClick:e[20]||(e[20]=oe((...c)=>s.toggleSendMenu&&s.toggleSendMenu(...c),["stop"])),class:"svg-button p-1.5",title:"More actions (Add file, take picture, etc.)"},e[52]||(e[52]=[b("i",{"data-feather":"plus-circle",class:"w-4 h-4"},null,-1)])),He(b("div",{class:"absolute right-0 bottom-full mb-1 w-44 bg-blue-100 dark:bg-blue-800 rounded-md shadow-lg border border-blue-300 dark:border-blue-600 z-10",onMouseleave:e[24]||(e[24]=(...c)=>s.closeSendMenu&&s.closeSendMenu(...c)),onMousedown:e[25]||(e[25]=oe(()=>{},["stop"]))},[b("div",cwr,[b("button",{onClick:e[21]||(e[21]=oe((...c)=>s.add_file&&s.add_file(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Add a file"},e[53]||(e[53]=[b("i",{"data-feather":"file-plus",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Add File",-1)])),b("button",{onClick:e[22]||(e[22]=oe((...c)=>s.takePicture&&s.takePicture(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Take a picture"},e[54]||(e[54]=[b("i",{"data-feather":"camera",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Take Picture",-1)])),b("button",{onClick:e[23]||(e[23]=oe((...c)=>s.addWebLink&&s.addWebLink(...c),["stop"])),class:"w-full p-1.5 flex items-center gap-1.5 rounded-md hover:bg-blue-200 dark:hover:bg-blue-700 transition-colors text-blue-700 dark:text-blue-200",title:"Add a web link"},e[55]||(e[55]=[b("i",{"data-feather":"link",class:"w-3.5 h-3.5"},null,-1),b("span",{class:"text-xs"},"Add Web Link",-1)]))])],544),[[mr,i.isSendMenuVisible]]),b("button",{onClick:e[26]||(e[26]=oe((...c)=>s.makeAnEmptyUserMessage&&s.makeAnEmptyUserMessage(...c),["stop"])),class:"svg-button p-1.5",title:"Insert an empty user message"},e[56]||(e[56]=[b("i",{"data-feather":"message-circle",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[27]||(e[27]=oe((...c)=>s.makeAnEmptyAIMessage&&s.makeAnEmptyAIMessage(...c),["stop"])),class:"svg-button p-1.5 text-red-400 hover:text-red-500 dark:hover:text-red-400",title:"Insert an empty AI message"},e[57]||(e[57]=[b("i",{"data-feather":"cpu",class:"w-4 h-4"},null,-1)])),b("button",{onClick:e[28]||(e[28]=oe((...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c),["stop"])),class:"svg-button p-1.5",title:"Show Help"},e[58]||(e[58]=[b("i",{"data-feather":"info",class:"w-4 h-4"},null,-1)]))]),b("button",{onClick:e[29]||(e[29]=oe((...c)=>s.toggleRightPanel&&s.toggleRightPanel(...c),["stop"])),class:ye(["svg-button p-1.5",t.$store.state.rightPanelCollapsed?"":"bg-blue-200 dark:bg-blue-700"]),title:t.$store.state.rightPanelCollapsed?"Expand Right Panel":"Collapse Right Panel"},e[59]||(e[59]=[b("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4"},[b("rect",{x:"17",y:"2",width:"4",height:"20",rx:"2",fill:"currentColor"}),b("rect",{x:"3",y:"6",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"3",y:"11",width:"12",height:"2",rx:"1",fill:"currentColor"}),b("rect",{x:"3",y:"16",width:"12",height:"2",rx:"1",fill:"currentColor"})],-1)]),10,uwr)])],32)])],6))]),_:1})]),b("input",{type:"file",ref:"fileDialog",onChange:e[31]||(e[31]=c=>s.addFilesFromInput(c.target.files)),multiple:"",class:"hidden"},null,544),i.showHelpModal?(k(),R("div",{key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",onClick:e[34]||(e[34]=(...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c))},[b("div",{class:"card max-w-lg w-full relative overflow-y-auto max-h-[85vh] scrollbar p-4 md:p-6",onClick:e[33]||(e[33]=oe(()=>{},["stop"]))},[b("button",{onClick:e[32]||(e[32]=(...c)=>s.toggleHelpModal&&s.toggleHelpModal(...c)),class:"svg-button absolute top-2 right-2 z-10",title:"Close tutorial"},e[60]||(e[60]=[b("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)])),e[61]||(e[61]=To('Chatbar Help Overview of the chat controls:
Sends your message to the AI.
Sends your message with internet search.
Opens the emoji picker.
Shrinks the chatbar.
Toggles the left panel visibility.
Toggles the right panel visibility.
Toggle 'Think First' mode. Activates voice input.
RT Toggles real-time audio mode.
Shows more actions menu.
Inserts empty user message.
Inserts empty AI message.
Shows this help modal.
Click and drag the header bar to move the chatbox.
',3))])])):ne("",!0)],64)}const fwr=st(VEr,[["render",dwr],["__scopeId","data-v-3cfd7cc5"]]),hwr={name:"WelcomeComponent",data(){return{videoUrl:"",videoType:"",latestNews:"",error:"",showVideoButton:!1,lastVideoUrl:""}},computed:{getImageForVideoType(){switch(this.videoType.toLowerCase()){case"podcast":return"/podcast.png";case"music":return"/music.png";case"movie":return"/movie.png";case"tutorial":return"/tutorial.png";default:return"/play_video.png"}},logoSrc(){return this.$store.state.config&&this.$store.state.config.app_custom_logo?`/user_infos/${this.$store.state.config.app_custom_logo}`:Eo}},methods:{async fetchLatestNews(){try{const t=await Ae.get("/get_news");this.latestNews=t.data}catch(t){console.error("Failed to fetch latest news:",t),this.error="Unable to fetch the latest news. Please try again later."}},async fetchVideoUrl(){try{const t=await Ae.get("/get_last_video_url");this.videoUrl=t.data.url,this.videoType=t.data.type,this.checkVideoUpdate()}catch(t){console.error("Failed to fetch video information:",t),this.error="Unable to fetch the latest video information. Please try again later."}},async handleClick(){await Ae.post("/set_last_viewed_video_url",{client_id:this.$store.state.client_id,last_viewed_video_url:this.videoUrl}),this.showVideoButton=!1},async checkVideoUpdate(){const e=(await Ae.get("/get_last_viewed_video_url")).data;console.log("storedVideoUrl"),console.log(e),this.videoUrl!==e&&(this.showVideoButton=!0)}},mounted(){this.fetchLatestNews(),this.fetchVideoUrl()}},pwr={class:"flex flex-col items-center justify-center w-full h-full min-h-screen p-8"},Twr={class:"text-center max-w-4xl"},Owr={class:"flex items-center justify-center gap-8 mb-12"},mwr={class:"relative w-24 h-24"},gwr=["src"],Qwr={key:0,class:"flex flex-col items-start"},_wr={class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"},vwr={key:1,class:"flex flex-col items-start"},ywr={class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"},bwr={key:0,class:"space-y-8 animate-fade-in-up"},Swr=["innerHTML"],xwr={key:1,class:"space-y-8 animate-fade-in-up"},Ewr={class:"text-4xl font-semibold"},wwr={class:"text-xl max-w-3xl mx-auto"},Cwr={key:0,class:"mt-12 p-6 rounded-lg shadow-md animate-fade-in-up overflow-y-scroll scrollbar-thin"},Lwr=["innerHTML"],$wr={key:2,class:"mt-6 text-red-500"},Awr={key:0,class:"floating-button-container"},kwr=["href"],Pwr=["src","alt"];function Rwr(t,e,n,r,i,s){return k(),R("div",pwr,[b("div",Twr,[b("div",Owr,[b("div",mwr,[b("img",{src:s.logoSrc,alt:"LoLLMS Logo",class:"w-24 h-24 rounded-full absolute animate-rolling-ball"},null,8,gwr)]),t.$store.state.config!=null&&t.$store.state.config.app_custom_name!=null&&t.$store.state.config.app_custom_name!=""?(k(),R("div",Qwr,[b("h1",_wr,ae(t.$store.state.config.app_custom_name),1)])):(k(),R("div",vwr,[b("h1",ywr,ae(t.$store.state.theme_vars.lollms_title),1),e[1]||(e[1]=b("p",{class:"text-2xl italic mt-2"}," Lord of Large Language And Multimodal Systems ",-1))]))]),t.$store.state.config!=null&&t.$store.state.config.app_custom_name!=null&&t.$store.state.config.app_custom_name!=""?(k(),R("div",bwr,[b("p",{innerHTML:t.$store.state.config.app_custom_welcome_message},null,8,Swr)])):(k(),R("div",xwr,[b("h2",Ewr,ae(t.$store.state.theme_vars.lollms_welcome_short_message),1),b("p",wwr,ae(t.$store.state.theme_vars.lollms_welcome_message),1),i.latestNews?(k(),R("div",Cwr,[e[2]||(e[2]=b("h3",null,"Latest LoLLMS News",-1)),b("p",{innerHTML:i.latestNews},null,8,Lwr)])):ne("",!0)])),i.error?(k(),R("div",$wr,ae(i.error),1)):ne("",!0)]),i.showVideoButton?(k(),R("div",Awr,[b("a",{href:i.videoUrl,target:"_blank",class:"floating-button",onClick:e[0]||(e[0]=(...o)=>s.handleClick&&s.handleClick(...o))},[e[3]||(e[3]=b("span",{class:"tooltip"},"New ParisNeo Video!",-1)),b("img",{src:s.getImageForVideoType,alt:"New "+i.videoType,class:"w-full h-full object-cover"},null,8,Pwr)],8,kwr)])):ne("",!0)])}const Mwr=st(hwr,[["render",Rwr],["__scopeId","data-v-861ce6fc"]]),Dwr={name:"PromptCard",props:{prompt:{type:String,required:!0}},emits:["select"],computed:{title(){const t=this.prompt.match(/@<(.*?)>@/);return t?t[1]:null},fullPromptContent(){return this.prompt.replace(/@<.*?>@/,"").trim()},renderedContent(){const t=Kt.parse(this.fullPromptContent||"");return C4.sanitize(t)}}},Nwr=["title"],Iwr={class:"flex-grow space-y-1 overflow-hidden"},Hwr=["title"],Vwr=["innerHTML","title"];function qwr(t,e,n,r,i,s){return k(),R("div",{title:s.fullPromptContent,onClick:e[0]||(e[0]=o=>t.$emit("select",n.prompt)),class:"card hover:shadow-xl transition-all duration-300 ease-in-out transform hover:scale-[1.03] flex flex-col justify-between min-h-[190px] group p-3 cursor-pointer border border-blue-200 dark:border-blue-700 bg-blue-50 dark:bg-blue-900 hover:border-blue-400 dark:hover:border-blue-500"},[b("div",Iwr,[b("h3",{class:"font-semibold text-base text-blue-800 dark:text-blue-100 mb-1 truncate",title:s.title||"Prompt Example"},ae(s.title||"Prompt Example"),9,Hwr),b("div",{innerHTML:s.renderedContent,class:"prose prose-sm dark:prose-invert max-w-none text-sm text-blue-700 dark:text-blue-300 overflow-hidden leading-relaxed line-clamp-5",title:s.fullPromptContent},null,8,Vwr)]),e[1]||(e[1]=b("div",{class:"mt-2 text-xs font-medium link opacity-0 group-hover:opacity-100 transition-opacity duration-300 pt-1.5 border-t border-blue-200 dark:border-blue-700"}," Click to use this prompt ",-1))],8,Nwr)}const Uwr=st(Dwr,[["render",qwr],["__scopeId","data-v-55e548ec"]]),Bwr={name:"PromptExamples",components:{PromptCard:Uwr},props:{prompts:{type:Array,required:!0,default:()=>[]}},emits:["prompt-selected"],methods:{onPromptSelected(t){this.$emit("prompt-selected",t)}}},zwr={key:0,class:"w-full rounded-lg m-2 shadow-lg border border-blue-200 dark:border-blue-700 bg-gradient-to-br from-blue-100 to-blue-50 dark:from-blue-950 dark:to-blue-900 p-4 flex flex-col max-h-[50vh]"},Xwr={class:"overflow-y-auto scrollbar flex-grow pr-1"},Fwr={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 p-2"};function jwr(t,e,n,r,i,s){const o=Xe("PromptCard");return n.prompts&&n.prompts.length>0?(k(),R("div",zwr,[e[0]||(e[0]=b("h2",{class:"text-xl font-bold mb-3 text-blue-700 dark:text-blue-200 border-b border-blue-300 dark:border-blue-600 pb-2 flex-shrink-0"}," Prompt Examples ",-1)),b("div",Xwr,[b("div",Fwr,[(k(!0),R(Ve,null,dt(n.prompts,(a,l)=>(k(),Qt(o,{key:l,prompt:a,onSelect:s.onPromptSelected},null,8,["prompt","onSelect"]))),128))])])])):ne("",!0)}const Ywr=st(Bwr,[["render",jwr],["__scopeId","data-v-f72d90a4"]]),Gwr=t=>{const e=t.replace(/^\[|\]$/g,"").split("::"),n=e[0];if(e.length===1)return{label:n,type:"text",fullText:t};const r=e[1].toLowerCase(),i={label:n,type:r,fullText:t};switch(r){case"int":case"float":case"multiline":break;case"code":i.language=e[2]||"plaintext";break;case"options":i.options=e[2]?e[2].split(",").map(s=>s.trim()):[];break;default:i.type="text"}return i},Wwr={name:"ChatArea",components:{Message:Mbr,ChatBox:fwr,WelcomeComponent:Mwr,PromptExamples:Ywr},props:{isReady:Boolean,hasActiveDiscussion:Boolean,discussionArr:Array,isGenerating:Boolean,host:String,personalityAvatars:Array},emits:["copy-message","delete-message","rank-up","rank-down","update-message","resend-message","continue-message","send-message","send-cmd","add-web-link","create-empty-user-message","create-empty-ai-message","stop-generating","recover-files","talk-personality","files-dropped"],data(){return{isDragOverChat:!1,showPlaceholderModal:!1,selectedPrompt:"",placeholders:[],placeholderValues:{},previewPrompt:""}},computed:{...Pu(["config"]),personality(){if(!this.config||!this.config.personalities||this.config.active_personality_id<0||this.config.active_personality_id>=this.config.personalities.length)return null;const t=this.config.personalities[this.config.active_personality_id];return this.$store.state.personalities.find(n=>n.full_path===t)||{prompts_list:[]}},showPromptExamples(){return this.hasActiveDiscussion&&this.discussionArr&&this.discussionArr.length<2&&this.personality&&this.personality.prompts_list&&this.personality.prompts_list.length>0},parsedPlaceholders(){const t=new Map;return this.placeholders.forEach(e=>{const n=Gwr(e);t.set(n.fullText,n)}),Array.from(t.values())}},methods:{getAvatar(t){var i;if(!this.config||!t)return null;const e=t.toLowerCase().trim(),n=(i=this.config.user_name)==null?void 0:i.toLowerCase().trim();if(e===n)return this.config.user_avatar?`user_infos/${this.config.user_avatar}`:null;const r=this.personalityAvatars.find(s=>{var o;return((o=s.name)==null?void 0:o.toLowerCase().trim())===e});return r!=null&&r.avatar?`/${r.avatar}`:null},scrollToBottom(){Fe(()=>{const t=document.getElementById("messages-list");t&&(t.scrollTop=t.scrollHeight)})},handleDrop(t){this.isDragOverChat=!1;const e=Array.from(t.dataTransfer.files);this.$emit("files-dropped",e)},handleFilesDropped(t){this.$emit("files-dropped",t)},getPromptContent(t){return t?t.replace(/@<.*?>@/,"").trim():""},handlePromptSelection(t){this.selectedPrompt=t,this.previewPrompt=t,this.placeholders=this.extractPlaceholders(t),this.placeholders.length>0?(this.placeholderValues={},this.parsedPlaceholders.forEach((e,n)=>{this.placeholderValues[n]=""}),this.showPlaceholderModal=!0,this.updatePreview()):this.setPromptInChatbox(this.getPromptContent(t))},extractPlaceholders(t){const e=/\[(.*?)\]/g,n=new Set([...(t||"").matchAll(e)].map(r=>r[0]));return Array.from(n)},updatePreview(){let t=this.selectedPrompt;this.parsedPlaceholders.forEach((e,n)=>{const r=this.placeholderValues[n],i=new RegExp(this.escapeRegExp(e.fullText),"g");t=t.replace(i,r||e.fullText)}),this.previewPrompt=t},escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},cancelPlaceholders(){this.showPlaceholderModal=!1},applyPlaceholders(){let t=this.selectedPrompt;this.parsedPlaceholders.forEach((n,r)=>{const i=this.placeholderValues[r];if(i!=null&&i!==""){const s=new RegExp(this.escapeRegExp(n.fullText),"g");t=t.replace(s,i)}});const e=this.getPromptContent(t).replace(/\[(.*?)\]/g,"");this.showPlaceholderModal=!1,this.setPromptInChatbox(e.trim())},setPromptInChatbox(t){this.$refs.chatBox&&(this.$refs.chatBox.message=t,this.$refs.chatBox.focusInput())}},watch:{discussionArr:{handler(){this.$nextTick(()=>Re.replace())},deep:!0},personality:{handler(t,e){(t==null?void 0:t.full_path)!==(e==null?void 0:e.full_path)&&(this.showPlaceholderModal=!1,this.selectedPrompt="",this.placeholders=[],this.placeholderValues={},this.previewPrompt="")},deep:!0}},mounted(){Fe(()=>{Re.replace()})},updated(){Fe(()=>{Re.replace()})}},Zwr={class:"relative flex flex-col flex-grow background-color h-full"},Kwr={class:"container pt-4 pb-50 mb-50 w-full mx-auto px-4"},Jwr={key:2,class:"fixed inset-0 bg-black bg-opacity-60 dark:bg-opacity-70 flex items-center justify-center z-50 p-4"},eCr={class:"card max-w-4xl w-full max-h-[90vh] flex flex-col p-0"},tCr={class:"flex-1 flex flex-col min-h-0 overflow-hidden p-4 space-y-4"},nCr={class:"p-3 bg-blue-100 dark:bg-blue-800 rounded-lg border border-blue-200 dark:border-blue-700"},rCr={class:"flex-1 h-[150px] overflow-y-auto scrollbar bg-white dark:bg-blue-900 p-2 rounded text-sm"},iCr={class:"whitespace-pre-wrap text-blue-900 dark:text-blue-100"},sCr={class:"flex-1 overflow-y-auto scrollbar space-y-3 pr-2"},oCr=["for"],aCr=["id","onUpdate:modelValue","placeholder"],lCr=["id","onUpdate:modelValue"],cCr=["id","onUpdate:modelValue"],uCr=["id","onUpdate:modelValue"],dCr={key:4,class:"border border-blue-300 dark:border-blue-600 rounded-md overflow-hidden"},fCr={class:"bg-blue-200 dark:bg-blue-700 p-1 px-2 text-xs text-blue-700 dark:text-blue-200"},hCr=["id","onUpdate:modelValue"],pCr=["id","onUpdate:modelValue"],TCr=["value"],OCr={class:"p-4 flex justify-end space-x-2 border-t border-blue-200 dark:border-blue-700"},mCr={key:0,class:"sticky bottom-0 left-0 right-0 p-4 z-20 w-full max-w-4xl mx-auto"};function gCr(t,e,n,r,i,s){var u;const o=Xe("Message"),a=Xe("PromptExamples"),l=Xe("WelcomeComponent"),c=Xe("ChatBox");return k(),R("div",Zwr,[b("div",{id:"messages-list",class:ye(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",i.isDragOverChat?"opacity-50 border-2 border-dashed border-blue-500":""]),onDragover:e[10]||(e[10]=oe(d=>i.isDragOverChat=!0,["prevent"])),onDragleave:e[11]||(e[11]=d=>i.isDragOverChat=!1),onDrop:e[12]||(e[12]=oe((...d)=>s.handleDrop&&s.handleDrop(...d),["prevent"]))},[b("div",Kwr,[n.discussionArr&&n.discussionArr.length>0?(k(),Qt(V4,{key:0,name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(n.discussionArr,d=>(k(),Qt(o,{key:d.id,message:d,id:"msg-"+d.id,ref_for:!0,ref:"msg-"+d.id,host:n.host,onCopy:e[0]||(e[0]=f=>t.$emit("copy-message",f)),onDelete:f=>t.$emit("delete-message",d.id),onRankUp:f=>t.$emit("rank-up",d.id),onRankDown:f=>t.$emit("rank-down",d.id),onUpdateMessage:e[1]||(e[1]=f=>t.$emit("update-message",f)),onResendMessage:f=>t.$emit("resend-message",{id:d.id,content:d.content,type:d.type}),onContinueMessage:f=>t.$emit("continue-message",{id:d.id,content:d.content}),avatar:s.getAvatar(d.sender)},null,8,["message","id","host","onDelete","onRankUp","onRankDown","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):ne("",!0),s.showPromptExamples?(k(),Qt(a,{key:1,prompts:((u=s.personality)==null?void 0:u.prompts_list)||[],onPromptSelected:s.handlePromptSelection,class:"my-4"},null,8,["prompts","onPromptSelected"])):ne("",!0),i.showPlaceholderModal?(k(),R("div",Jwr,[b("div",eCr,[e[23]||(e[23]=b("h3",{class:"text-lg font-semibold p-4 border-b border-blue-200 dark:border-blue-700 text-blue-800 dark:text-blue-100"},"Fill in the placeholders",-1)),b("div",tCr,[b("div",nCr,[e[21]||(e[21]=b("h4",{class:"label !mb-1"},"Live Preview:",-1)),b("div",rCr,[b("span",iCr,ae(s.getPromptContent(i.previewPrompt)),1)])]),b("div",sCr,[(k(!0),R(Ve,null,dt(s.parsedPlaceholders,(d,f)=>(k(),R("div",{key:d.fullText,class:"flex flex-col"},[b("label",{for:"placeholder-"+f,class:"label"},ae(d.label),9,oCr),d.type==="text"?He((k(),R("input",{key:0,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"text",class:"input",placeholder:d.label,onInput:e[2]||(e[2]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,aCr)),[[vt,i.placeholderValues[f]]]):ne("",!0),d.type==="int"?He((k(),R("input",{key:1,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"number",step:"1",class:"input",onInput:e[3]||(e[3]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,lCr)),[[vt,i.placeholderValues[f],void 0,{number:!0}]]):ne("",!0),d.type==="float"?He((k(),R("input",{key:2,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,type:"number",step:"0.01",class:"input",onInput:e[4]||(e[4]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,cCr)),[[vt,i.placeholderValues[f],void 0,{number:!0}]]):ne("",!0),d.type==="multiline"?He((k(),R("textarea",{key:3,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,rows:"4",class:"input",onInput:e[5]||(e[5]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,uCr)),[[vt,i.placeholderValues[f]]]):ne("",!0),d.type==="code"?(k(),R("div",dCr,[b("div",fCr,ae(d.language||"Plain text"),1),He(b("textarea",{id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,rows:"6",class:"w-full p-2 font-mono bg-blue-50 dark:bg-blue-900 border-t border-blue-300 dark:border-blue-600 text-sm",onInput:e[6]||(e[6]=(...h)=>s.updatePreview&&s.updatePreview(...h))},null,40,hCr),[[vt,i.placeholderValues[f]]])])):ne("",!0),d.type==="options"?He((k(),R("select",{key:5,id:"placeholder-"+f,"onUpdate:modelValue":h=>i.placeholderValues[f]=h,class:"input",onChange:e[7]||(e[7]=(...h)=>s.updatePreview&&s.updatePreview(...h))},[e[22]||(e[22]=b("option",{value:"",disabled:""},"Select an option",-1)),(k(!0),R(Ve,null,dt(d.options,h=>(k(),R("option",{key:h,value:h,class:"text-blue-900 dark:text-blue-100 bg-blue-100 dark:bg-blue-800"},ae(h),9,TCr))),128))],40,pCr)),[[$s,i.placeholderValues[f]]]):ne("",!0)]))),128))])]),b("div",OCr,[b("button",{onClick:e[8]||(e[8]=(...d)=>s.cancelPlaceholders&&s.cancelPlaceholders(...d)),class:"btn btn-secondary"},"Cancel"),b("button",{onClick:e[9]||(e[9]=(...d)=>s.applyPlaceholders&&s.applyPlaceholders(...d)),class:"btn btn-primary"},"Apply")])])])):ne("",!0),n.hasActiveDiscussion?ne("",!0):(k(),Qt(l,{key:3})),e[24]||(e[24]=b("div",{class:"h-40"},null,-1))]),e[25]||(e[25]=b("div",{class:"sticky bottom-0 left-0 right-0 h-48 pointer-events-none bg-gradient-to-t from-blue-100 to-transparent dark:from-blue-900 z-10"},null,-1))],34),n.hasActiveDiscussion?(k(),R("div",mCr,[te(c,{ref:"chatBox",loading:n.isGenerating,discussionList:n.discussionArr,"on-show-toast-message":(d,f,h)=>t.$store.state.toast.showToast(d,f,h),"on-talk":d=>t.$emit("talk-personality",d),class:"toolbar-color p-2 rounded-t-lg shadow-md",onPersonalitySelected:e[13]||(e[13]=d=>t.$emit("recover-files")),onMessageSentEvent:e[14]||(e[14]=(d,f)=>t.$emit("send-message",{message:d,type:f})),onSendCMDEvent:e[15]||(e[15]=d=>t.$emit("send-cmd",d)),onAddWebLink:e[16]||(e[16]=d=>t.$emit("add-web-link")),onCreateEmptyUserMessage:e[17]||(e[17]=d=>t.$emit("create-empty-user-message",d)),onCreateEmptyAIMessage:e[18]||(e[18]=d=>t.$emit("create-empty-ai-message")),onStopGenerating:e[19]||(e[19]=d=>t.$emit("stop-generating")),onLoaded:e[20]||(e[20]=d=>t.$emit("recover-files")),onFilesDropped:s.handleFilesDropped},null,8,["loading","discussionList","on-show-toast-message","on-talk","onFilesDropped"])])):ne("",!0)])}const QCr=st(Wwr,[["render",gCr],["__scopeId","data-v-167e65e0"]]),_Cr={name:"RenderPanel",props:{showRightPanel:Boolean,htmlContent:{type:String,default:`
@@ -616,12 +620,12 @@ $$`,u=!0;break;case"codeblock":a="```"+(e.language||"")+`
- `}},watch:{htmlContent:{handler(t){this.renderIsolatedContent(t)},immediate:!0},showRightPanel(t){t&&this.$nextTick(()=>{this.renderIsolatedContent(this.htmlContent)})}},methods:{renderIsolatedContent(t){var r;if(!this.$refs.isolatedContent||!this.showRightPanel)return;this.$refs.isolatedContent.innerHTML="";const e=document.createElement("iframe");e.style.border="none",e.style.width="100%",e.style.height="100%",e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.setAttribute("title","Rendered HTML Content"),this.$refs.isolatedContent.appendChild(e);const n=e.contentDocument||((r=e.contentWindow)==null?void 0:r.document);if(n){const i=document.documentElement.classList.contains("dark");let s=t;i&&(s=s.replace("Error: Could not render content in iframe.
'}},mounted(){this.showRightPanel&&this.renderIsolatedContent(this.htmlContent)}},_Cr={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 panels-color h-full scrollbar"},vCr={ref:"isolatedContent",class:"h-full p-4 prose-blue dark:prose-invert overflow-auto"};function yCr(t,e,n,r,i,s){return k(),Qt(cr,{name:"slide-left"},{default:Ie(()=>[n.showRightPanel?(k(),R("div",_Cr,[b("div",vCr,null,512)])):ne("",!0)]),_:1})}const bCr=st(QCr,[["render",yCr]]),SCr={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:Voe,MarkdownRenderer:rT},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Ae.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(t=>{this.categories=t.data.categories}).catch(t=>{console.error("Error fetching categories:",t)})},fetchTitles(){console.log("Fetching categories"),Ae.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(t=>{this.titles=t.data.titles,console.log("titles recovered")}).catch(t=>{console.error("Error fetching titles:",t)})},fetchContent(t){console.log("loading skill",t),Ae.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:t}).then(e=>{const n=e.data.contents[0];this.id=n.id,this.content=n.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(t){console.log("Delete category")},editCategory(t){console.log("Edit category")},checkUncheckCategory(t){console.log("Unchecked category")},deleteSkill(t){console.log("Delete skill ",t),Ae.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:t}).then(()=>{this.fetchTitles()})},editTitle(t){Ae.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:t,title:t}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(t){console.log("Make title")},checkUncheckTitle(t){},searchSkills(){}}},xCr={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},ECr={class:"w-[15rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},wCr={classclass:"absolute flex flex-col no-scrollbar shadow-lg w-[15rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},CCr={class:"z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"};function LCr(t,e,n,r,i,s){const o=Xe("Discussion"),a=Xe("MarkdownRenderer");return k(),R("div",{class:ye([{hidden:!i.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[b("div",xCr,[b("div",ECr,[He(b("input",{type:"search",id:"default-search",class:"block w-full h-8 px-8 text-sm border border-gray-300 rounded-md bg-bg-light focus:ring-1 focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary transition-all duration-200",placeholder:"Search discussions...",title:"Filter skills by title","onUpdate:modelValue":e[0]||(e[0]=l=>i.searchQuery=l),onKeyup:e[1]||(e[1]=gr((...l)=>s.searchSkills&&s.searchSkills(...l),["enter"]))},null,544),[[vt,i.searchQuery]]),b("div",wCr,[e[3]||(e[3]=b("h2",{class:"text-xl font-bold m-4"},"Titles",-1)),i.titles.length>0?(k(),Qt(V4,{key:0,name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(i.titles,l=>(k(),Qt(o,{key:l.id,id:l.id,title:l.title,selected:s.fetchContent(l.id),loading:i.loading,isCheckbox:i.isCheckbox,checkBoxValue:!1,openfolder_enabled:!1,onSelect:c=>s.fetchContent(l.id),onDelete:c=>s.deleteSkill(l.id),onEditTitle:s.editTitle,onMakeTitle:s.makeTitle,onChecked:s.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):ne("",!0)])]),b("div",CCr,[e[4]||(e[4]=b("h2",{class:"text-xl font-bold m-4"},"Content",-1)),te(a,{host:n.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),b("button",{onClick:e[2]||(e[2]=(...l)=>s.closeComponent&&s.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const $Cr=st(SCr,[["render",LCr]]),ACr={props:{personality:{type:Object,required:!0},config:{type:Object,required:!0}},data(){return{show:!1,title:"Add AI Agent",iconUrl:"",file:null,tempConfig:{}}},methods:{showForm(){this.showDialog=!0},hideForm(){this.showDialog=!1},selectIcon(t){t.target.files&&(this.file=t.target.files[0],this.iconUrl=URL.createObjectURL(this.file))},showPanel(){this.show=!0},hide(){this.show=!1},submitForm(){Ae.post("/set_personality_config",{client_id:this.$store.state.client_id,category:this.personality.category,name:this.personality.folder,config:this.config}).then(t=>{const e=t.data;console.log("Done"),e.status?(this.currentPersonConfig=e.config,this.showPersonalityEditor=!0):console.error(e.error)}).catch(t=>{console.error(t)})}}},kCr={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},PCr={class:"relative w-full max-h-full bg-bg-light dark:bg-bg-dark"},RCr={class:"w-full h-full relative items-center gap-2 rounded-lg border bg-bg-light dark:bg-bg-dark p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"},MCr={class:"justify-center text-center items-center w-full bg-bg-light dark:bg-bg-dark"},DCr={class:"w-full flex flex-row mt-4 text-center justify-center"},NCr={class:"w-full max-h-full container bg-bg-light dark:bg-bg-dark"},ICr={class:"mb-4 w-full"},HCr={class:"w-full bg-bg-light dark:bg-bg-dark"};function VCr(t,e,n,r,i,s){return i.show?(k(),R("div",kCr,[b("div",PCr,[b("div",RCr,[b("button",{type:"button",onClick:e[0]||(e[0]=o=>s.hide()),class:"absolute top-1 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[17]||(e[17]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[b("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),b("span",{class:"sr-only"},"Close modal",-1)])),b("div",MCr,[b("div",DCr,[b("button",{type:"submit",onClick:e[1]||(e[1]=oe((...o)=>s.submitForm&&s.submitForm(...o),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Commit AI to Server "),b("button",{onClick:e[2]||(e[2]=oe(o=>s.hide(),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Close ")]),b("div",NCr,[b("form",ICr,[b("table",HCr,[b("tr",null,[e[18]||(e[18]=b("td",null,[b("label",{for:"personalityConditioning"},"Personality Conditioning:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"personalityConditioning","onUpdate:modelValue":e[3]||(e[3]=o=>n.config.personality_conditioning=o)},null,512),[[vt,n.config.personality_conditioning]])])]),b("tr",null,[e[19]||(e[19]=b("td",null,[b("label",{for:"userMessagePrefix"},"User Message Prefix:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"userMessagePrefix","onUpdate:modelValue":e[4]||(e[4]=o=>n.config.user_message_prefix=o)},null,512),[[vt,n.config.user_message_prefix]])])]),b("tr",null,[e[20]||(e[20]=b("td",null,[b("label",{for:"aiMessagePrefix"},"AI Message Prefix:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"aiMessagePrefix","onUpdate:modelValue":e[5]||(e[5]=o=>n.config.ai_message_prefix=o)},null,512),[[vt,n.config.ai_message_prefix]])])]),b("tr",null,[e[21]||(e[21]=b("td",null,[b("label",{for:"linkText"},"Link Text:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"linkText","onUpdate:modelValue":e[6]||(e[6]=o=>n.config.link_text=o)},null,512),[[vt,n.config.link_text]])])]),b("tr",null,[e[22]||(e[22]=b("td",null,[b("label",{for:"welcomeMessage"},"Welcome Message:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"welcomeMessage","onUpdate:modelValue":e[7]||(e[7]=o=>n.config.welcome_message=o)},null,512),[[vt,n.config.welcome_message]])])]),b("tr",null,[e[23]||(e[23]=b("td",null,[b("label",{for:"modelTemperature"},"Model Temperature:")],-1)),b("td",null,[He(b("input",{type:"number",id:"modelTemperature","onUpdate:modelValue":e[8]||(e[8]=o=>n.config.model_temperature=o)},null,512),[[vt,n.config.model_temperature]])])]),b("tr",null,[e[24]||(e[24]=b("td",null,[b("label",{for:"modelTopK"},"Model Top K:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopK","onUpdate:modelValue":e[9]||(e[9]=o=>n.config.model_top_k=o)},null,512),[[vt,n.config.model_top_k]])])]),b("tr",null,[e[25]||(e[25]=b("td",null,[b("label",{for:"modelTopP"},"Model Top P:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopP","onUpdate:modelValue":e[10]||(e[10]=o=>n.config.model_top_p=o)},null,512),[[vt,n.config.model_top_p]])])]),b("tr",null,[e[26]||(e[26]=b("td",null,[b("label",{for:"modelRepeatPenalty"},"Model Repeat Penalty:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatPenalty","onUpdate:modelValue":e[11]||(e[11]=o=>n.config.model_repeat_penalty=o)},null,512),[[vt,n.config.model_repeat_penalty]])])]),b("tr",null,[e[27]||(e[27]=b("td",null,[b("label",{for:"modelRepeatLastN"},"Model Repeat Last N:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatLastN","onUpdate:modelValue":e[12]||(e[12]=o=>n.config.model_repeat_last_n=o)},null,512),[[vt,n.config.model_repeat_last_n]])])]),b("tr",null,[e[28]||(e[28]=b("td",null,[b("label",{for:"recommendedBinding"},"Recommended Binding:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedBinding","onUpdate:modelValue":e[13]||(e[13]=o=>n.config.recommended_binding=o)},null,512),[[vt,n.config.recommended_binding]])])]),b("tr",null,[e[29]||(e[29]=b("td",null,[b("label",{for:"recommendedModel"},"Recommended Model:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedModel","onUpdate:modelValue":e[14]||(e[14]=o=>n.config.recommended_model=o)},null,512),[[vt,n.config.recommended_model]])])]),b("tr",null,[e[30]||(e[30]=b("td",null,[b("label",{class:"dark:bg-black dark:text-primary w-full",for:"dependencies"},"Dependencies:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"dependencies","onUpdate:modelValue":e[15]||(e[15]=o=>n.config.dependencies=o)},null,512),[[vt,n.config.dependencies]])])]),b("tr",null,[e[31]||(e[31]=b("td",null,[b("label",{for:"antiPrompts"},"Anti Prompts:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"antiPrompts","onUpdate:modelValue":e[16]||(e[16]=o=>n.config.anti_prompts=o)},null,512),[[vt,n.config.anti_prompts]])])])])])])])])])])):ne("",!0)}const qCr=st(ACr,[["render",VCr]]),UCr={data(){return{showPopup:!1,webpageUrl:"https://lollms.com/"}},methods:{show(){this.showPopup=!0},hide(){this.showPopup=!1},save_configuration(){Ae.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config}).then(t=>{this.isLoading=!1,t.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1)})}}},BCr={key:0,class:"fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50"},zCr={class:"relative panels-color p-6 rounded-lg shadow-xl max-w-3xl w-full mx-4"},XCr=["src"],FCr={class:"flex items-center mt-4"};function jCr(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade"},{default:Ie(()=>[i.showPopup?(k(),R("div",BCr,[b("div",zCr,[b("button",{onClick:e[0]||(e[0]=(...o)=>s.hide&&s.hide(...o)),class:"absolute top-2 right-2 svg-button z-10",title:"Close"},e[3]||(e[3]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])),b("iframe",{src:i.webpageUrl,class:"w-full h-[70vh] rounded-md border border-blue-300 dark:border-blue-600 bg-white dark:bg-blue-900"},null,8,XCr),b("div",FCr,[He(b("input",{type:"checkbox",id:"startup",class:"rounded border-blue-300 dark:border-blue-600 text-blue-600 focus:ring-blue-500 dark:bg-blue-700 dark:focus:ring-offset-blue-800","onUpdate:modelValue":e[1]||(e[1]=o=>this.$store.state.config.show_news_panel=o),onChange:e[2]||(e[2]=(...o)=>s.save_configuration&&s.save_configuration(...o))},null,544),[[W3,this.$store.state.config.show_news_panel]]),e[4]||(e[4]=b("label",{for:"startup",class:"ml-2 label !mb-0 cursor-pointer"},"Show at startup",-1))])])])):ne("",!0)]),_:1})}const YCr=st(UCr,[["render",jCr],["__scopeId","data-v-425d1bc4"]]),GCr={name:"ChangelogPopup",data(){return{showChangelogPopup:!1,changelogContent:"",currentVersion:"0.0.0"}},computed:{parsedChangelogContent(){const t={breaks:!0,gfm:!0},e=Kt(this.changelogContent,t);return C4.sanitize(e)}},async mounted(){await this.checkChangelogUpdate()},methods:{async fetchVersion(){try{const t=await Ae.get("/get_lollms_webui_version");if(t&&t.data){const{version_main:e,version_secondary:n,version_type:r,version_codename:i}=t.data;let s=`${e}.${n}`;return r&&(s+=` ${r}`),i&&(s+=` (${i})`),this.$store.state.version=s,this.currentVersion=s,s}}catch(t){console.error("Error fetching LoLLMs version:",t)}return this.$store.state.version||"0.0.0"},async checkChangelogUpdate(){try{const t=await Ae.get("/get_changelog");this.changelogContent=t.data||"*No changelog content found.*";const e=await this.fetchVersion(),r=(await Ae.get("/get_last_viewed_changelog_version")).data,i=s=>{s&&s.app_show_changelogs&&e!==r&&e!=="0.0.0"&&(this.showChangelogPopup=!0)};if(this.$store.state.config)i(this.$store.state.config);else{const s=this.$watch("$store.state.config",o=>{o&&(i(o),s())},{immediate:!1})}}catch(t){console.error("Error checking changelog:",t)}},async handleUnderstand(){try{await Ae.post("/set_last_viewed_changelog_version",{client_id:this.$store.state.client_id,version:this.currentVersion}),this.closePopup()}catch(t){console.error("Error setting last viewed changelog version:",t),this.closePopup()}},closePopup(){this.showChangelogPopup=!1}}},WCr={class:"flex justify-between items-center p-4 px-6 border-b border-blue-300 dark:border-blue-600 flex-shrink-0 unicolor-panels-color"},ZCr={class:"p-6 md:p-8 flex-grow overflow-y-auto scrollbar text-blue-900 dark:text-blue-200"},KCr=["innerHTML"],JCr={class:"flex justify-end p-4 px-6 border-t border-blue-300 dark:border-blue-600 flex-shrink-0 unicolor-panels-color"};function eLr(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade"},{default:Ie(()=>[i.showChangelogPopup?(k(),R("div",{key:0,class:ye(["fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[100] transition-opacity duration-300",{"opacity-0 pointer-events-none":!i.showChangelogPopup,"opacity-100":i.showChangelogPopup}])},[b("div",{class:ye(["panels-color rounded-lg w-[95%] max-w-4xl max-h-[90vh] flex flex-col shadow-2xl overflow-hidden transform transition-all duration-300 ease-out border border-blue-300 dark:border-blue-600",{"opacity-0 scale-95":!i.showChangelogPopup,"opacity-100 scale-100":i.showChangelogPopup}])},[b("div",WCr,[e[3]||(e[3]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100"},"What's New",-1)),b("button",{class:"svg-button",onClick:e[0]||(e[0]=(...o)=>s.closePopup&&s.closePopup(...o)),"aria-label":"Close Changelog"},e[2]||(e[2]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),b("div",ZCr,[b("div",{class:"prose prose-blue dark:prose-invert max-w-none",innerHTML:s.parsedChangelogContent},null,8,KCr)]),b("div",JCr,[b("button",{class:"btn btn-primary",onClick:e[1]||(e[1]=(...o)=>s.handleUnderstand&&s.handleUnderstand(...o))}," Got it ")])],2)],2)):ne("",!0)]),_:1})}const tLr=st(GCr,[["render",eLr],["__scopeId","data-v-4427a40c"]]),nLr=Zn({name:"DiscussionsView",components:{WelcomeScreen:e_r,LeftPanel:Rvr,ChatArea:gCr,RenderPanel:bCr,ChoiceDialog:Hoe,ProgressBar:uoe,SkillsLibraryViewer:$Cr,PersonalityEditor:qCr,PopupViewer:YCr,ChangelogPopup:tLr},data(){return{discussionsList:[],currentDiscussion:{},discussionArr:[],personalityAvatars:[],lastMessageHtml:"",loading:!1,database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,interestingFacts:["ParisNeo, the creator of LoLLMs, originally built his high-performance PC to play Cyberpunk 2077. However, his passion for AI took an unexpected turn, leading him to develop LoLLMs instead. Ironically, he never found the time to actually play the game that inspired his powerful setup!","Saïph, version 14 of LoLLMs, is named after a star in Orion's constellation (Kappa Orionis), representing bright guidance in AI!","The 'LoLLMs' name stands for 'Lord of Large Language Models', a playful nod to the power and potential of these AI systems.","LoLLMs v15 introduced 'Personality Packages', allowing users to customize AI interactions like never before.","Did you know? LoLLMs supports multiple AI backends, giving you flexibility in choosing the best engine for your needs.","LoLLMs v16 focused heavily on optimizing performance, making interactions faster and smoother.","The project is open-source, fostering a community of developers and users contributing to its growth.","LoLLMs v17 brought enhanced multi-modal capabilities, allowing interaction with images and potentially other media.","From text generation to coding assistance, LoLLMs aims to be a versatile AI tool.","LoLLMs v18, codenamed 'Orion', aimed for stellar improvements in stability and user experience.","The integrated 'Skills Library' allows LoLLMs to learn and perform specialized tasks.","LoLLMs is designed to run locally, ensuring data privacy and control for users.","The development of LoLLMs is driven by community feedback and the pursuit of cutting-edge AI accessibility.","Version 19, 'Fish Edition', dives deep into refining core features and improving aquatic-themed puns (results may vary).","The LoLLMs mascot, a wise owl, symbolizes knowledge and the ability to see through complex data.","Future versions aim to expand integration with various platforms and enhance collaborative features.","The configuration system in LoLLMs allows for deep customization of AI behavior and performance.","LoLLMs supports extensions, enabling developers to add new functionalities and integrations.","Keeping your LoLLMs updated ensures you have the latest features, optimizations, and security enhancements.","**Binary Brain Teaser:** The version number contains a secret message: `01100001 01110010 01110000 01101001 01101100 00100000 01100110 01101111 01101111 01101100`. If you decoded that, you truly understand the spirit of v19.1 'Fish Edition'!"],host:"",rebooting_audio:new Audio("/rebooting.wav"),connection_lost_audio:new Audio("/connection_lost.wav"),connection_recovered_audio:new Audio("/connection_recovered.wav"),chime:new Audio("/chime_aud.wav"),msgTypes:{MSG_TYPE_CONTENT:1,MSG_TYPE_CONTENT_INVISIBLE_TO_AI:2,MSG_TYPE_CONTENT_INVISIBLE_TO_USER:3},operationTypes:{MSG_OPERATION_TYPE_ADD_CHUNK:0,MSG_OPERATION_TYPE_SET_CONTENT:1,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:2,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_USER:3,MSG_OPERATION_TYPE_EXCEPTION:4,MSG_OPERATION_TYPE_WARNING:5,MSG_OPERATION_TYPE_INFO:6,MSG_OPERATION_TYPE_STEP:7,MSG_OPERATION_TYPE_STEP_START:8,MSG_OPERATION_TYPE_STEP_PROGRESS:9,MSG_OPERATION_TYPE_STEP_END_SUCCESS:10,MSG_OPERATION_TYPE_STEP_END_FAILURE:11,MSG_OPERATION_TYPE_JSON_INFOS:12,MSG_OPERATION_TYPE_REF:13,MSG_OPERATION_TYPE_CODE:14,MSG_OPERATION_TYPE_UI:15,MSG_OPERATION_TYPE_NEW_MESSAGE:16,MSG_OPERATION_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},is_first_connection:!0,defaultMessageHtml:` Render Panel Ready
`}},computed:{...Pu(["ready","loading_infos","loading_progress","version","config","databases","isConnected","isGenerating","client_id","leftPanelCollapsed","rightPanelCollapsed","theme_vars","selectedPersonality","currentPersonConfig","personalities","personalities_ready"]),...oE(["getIsReady","getVersion","getConfig","getClientId","getDatabases","getIsConnected","getIsGenerating","getLeftPanelCollapsed","getRightPanelCollapsed"]),isReady(){return this.getIsReady},version_info(){const t=this.getVersion;return t&&t!=="unknown"?t:"..."},showLeftPanel(){return this.isReady&&!this.getLeftPanelCollapsed},showRightPanel(){return this.isReady&&!this.getRightPanelCollapsed},formatted_database_name(){var e;return(((e=this.config)==null?void 0:e.discussion_db_name)||"default").replace(/_/g," ")}},methods:{...ace(["refreshConfig","refreshDatabase","refreshBindings","refreshPersonalitiesZoo","refreshMountedPersonalities","refreshModelsZoo","refreshModels","fetchLanguages","fetchLanguage","fetchIsRtOn","toggleStarPersonality","toggleStarDiscussion","applyConfiguration","saveConfiguration","refreshModelStatus"]),async initialLoad(){console.log("Initial Load Started");try{for(this.$store.commit("setLoadingInfos","Getting version"),this.$store.commit("setLoadingProgress",10),await this.$store.dispatch("getVersion"),this.$store.commit("setLoadingInfos","Connecting..."),this.$store.commit("setLoadingProgress",20);!et||et.id===void 0;)await new Promise(t=>setTimeout(t,200));this.$store.commit("setClientId",et.id),this.$store.commit("setLoadingInfos","Loading Configuration"),this.$store.commit("setLoadingProgress",30),await this.refreshConfig(),this.$store.commit("setLoadingInfos","Loading Database"),this.$store.commit("setLoadingProgress",40),await this.refreshDatabase(),this.$store.commit("setLoadingInfos","Getting Bindings list"),this.$store.commit("setLoadingProgress",50),await this.refreshBindings(),this.$store.commit("setLoadingInfos","Getting personalities zoo"),this.$store.commit("setLoadingProgress",60),await this.refreshPersonalitiesZoo(),this.$store.commit("setLoadingInfos","Getting mounted personalities"),this.$store.commit("setLoadingProgress",70),await this.refreshMountedPersonalities(),this.$store.commit("setLoadingInfos","Getting models zoo"),this.$store.commit("setLoadingProgress",80),await this.refreshModelsZoo(),this.$store.commit("setLoadingInfos","Getting active models"),this.$store.commit("setLoadingProgress",90),await this.refreshModels(),await this.refreshModelStatus(),await this.fetchLanguages(),await this.fetchLanguage(),await this.fetchIsRtOn(),await this.list_discussions(),await this.getPersonalityAvatars(),this.loadLastUsedDiscussion(),this.$store.commit("setLoadingProgress",100),this.$store.commit("setLoadingInfos","Ready"),await new Promise(t=>setTimeout(t,500)),this.$store.commit("setIsReady",!0),console.log("Initial Load Complete"),this.setupSocketListeners()}catch(t){console.error("Initial load failed:",t),this.$store.commit("setLoadingInfos",`Error: ${t.message||"Initialization failed"}`)}},setupSocketListeners(){et.on("connected",this.socketIOConnected),et.on("disconnect",this.socketIODisconnected),et.on("show_progress",this.show_progress),et.on("hide_progress",this.hide_progress),et.on("update_progress",this.update_progress),et.on("notification",this.notify),et.on("new_message",this.handleNewMessage),et.on("update_message",this.handleUpdateMessage),et.on("close_message",this.finalMsgEvent),et.on("discussion_renamed",this.handleDiscussionRenamed),et.on("refresh_files",this.recoverFiles),et.on("connect_error",this.handleConnectError),et.onerror=this.handleSocketError,et.onclose=this.handleSocketClose},async list_discussions(){try{this.loading=!0;const t=await Ae.get("/list_discussions");t&&Array.isArray(t.data)?this.discussionsList=t.data.map(e=>({id:e.id,title:e.title,created_at:e.created_at,loading:!1})).sort((e,n)=>n.id-e.id):this.discussionsList=[],this.loading=!1}catch(t){console.error("Error listing discussions:",t),this.$store.state.toast.showToast(`Error fetching discussions: ${t.message}`,4,!1),this.discussionsList=[],this.loading=!1}},loadLastUsedDiscussion(){const t=localStorage.getItem("selected_discussion");if(t){const e=this.discussionsList.find(n=>String(n.id)===t);e?this.selectDiscussion(e):(localStorage.removeItem("selected_discussion"),this.currentDiscussion={},this.discussionArr=[])}else this.currentDiscussion={},this.discussionArr=[]},selectDiscussion(t){var e;if(this.isGenerating){this.$store.state.toast.showToast("Please wait for generation to finish or stop.",4,!1);return}t&&((e=this.currentDiscussion)==null?void 0:e.id)!==t.id?(this.currentDiscussion={...t},this.setPageTitle(t),localStorage.setItem("selected_discussion",t.id),this.load_discussion(t.id)):t||(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle(),localStorage.removeItem("selected_discussion")),Fe(()=>this.scrollToDiscussionElement(t==null?void 0:t.id))},async createNewDiscussion(){try{this.loading=!0,this.$store.state.toast.showToast("Creating new discussion...",2,!0),et.emit("new_discussion",{title:null}),et.once("discussion_created",async t=>{if(t&&t.id){await this.list_discussions();const e=this.discussionsList.find(n=>n.id===t.id);e?this.selectDiscussion(e):(console.error("Newly created discussion not found in list:",t.id),this.$store.state.toast.showToast("Error: Couldn't find new discussion.",4,!1))}else console.error("Invalid discussion_created data:",t),this.$store.state.toast.showToast("Error creating discussion.",4,!1);this.loading=!1}),setTimeout(()=>{var t;this.loading&&!((t=this.currentDiscussion)!=null&&t.id)&&(et.off("discussion_created"),this.loading=!1,this.$store.state.toast.showToast("Timeout creating discussion.",4,!1))},1e4)}catch(t){console.error("Error initiating new discussion:",t),this.$store.state.toast.showToast(`Error: ${t.message}`,4,!1),this.loading=!1}},async deleteDiscussion(t){t&&this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete discussion ${t}?`,"Delete","Cancel").then(async e=>{var n;if(e)try{this.setDiscussionLoading(t,!0),await Ae.post("/delete_discussion",{client_id:this.client_id,id:t}),this.$store.state.toast.showToast(`Discussion ${t} deleted.`,4,!0),this.discussionsList=this.discussionsList.filter(r=>r.id!==t),((n=this.currentDiscussion)==null?void 0:n.id)===t&&this.selectDiscussion(null)}catch(r){console.error("Error deleting discussion:",r),this.$store.state.toast.showToast(`Error deleting discussion ${t}: ${r.message}`,4,!1),this.setDiscussionLoading(t,!1)}})},async deleteDiscussionMulti(t){if(!Array.isArray(t)||t.length===0)return;const e=t.length;this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete ${e} discussion(s)?`,"Delete Selected","Cancel").then(async n=>{var r;if(n){this.$store.state.toast.showToast(`Deleting ${e} discussions...`,5,!0);let i=0,s=0;t.forEach(o=>this.setDiscussionLoading(o,!0));for(const o of t)try{await Ae.post("/delete_discussion",{client_id:this.client_id,id:o}),i++,this.discussionsList=this.discussionsList.filter(a=>a.id!==o),((r=this.currentDiscussion)==null?void 0:r.id)===o&&this.selectDiscussion(null)}catch(a){console.error(`Error deleting discussion ${o}:`,a),s++,this.setDiscussionLoading(o,!1)}s>0?this.$store.state.toast.showToast(`Deleted ${i} discussions. Failed to delete ${s}.`,5,!1):this.$store.state.toast.showToast(`Successfully deleted ${i} discussions.`,4,!0)}})},async editTitle({id:t,title:e}){var n,r;try{this.setDiscussionLoading(t,!0);const i=await Ae.post("/edit_title",{client_id:this.client_id,id:t,title:e});if(i.status===200){const s=this.discussionsList.findIndex(o=>o.id===t);s>-1&&(this.discussionsList[s].title=e),((n=this.currentDiscussion)==null?void 0:n.id)===t&&(this.currentDiscussion.title=e),this.$store.state.toast.showToast("Title updated.",3,!0)}else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to edit title")}catch(i){console.error("Error editing title:",i),this.$store.state.toast.showToast(`Error editing title: ${i.message}`,4,!1)}finally{this.setDiscussionLoading(t,!1)}},async makeTitle(t){var n,r;const e=t.id;try{this.setDiscussionLoading(e,!0),this.$store.state.toast.showToast("Generating title...",3,!0);const i=await Ae.post("/make_title",{client_id:this.client_id,id:e});if(i.status===200&&i.data.title){const s=i.data.title,o=this.discussionsList.findIndex(a=>a.id===e);o>-1&&(this.discussionsList[o].title=s),((n=this.currentDiscussion)==null?void 0:n.id)===e&&(this.currentDiscussion.title=s),this.$store.state.toast.showToast("Title generated.",3,!0)}else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to generate title")}catch(i){console.error("Error making title:",i),this.$store.state.toast.showToast(`Error generating title: ${i.message}`,4,!1)}finally{this.setDiscussionLoading(e,!1)}},async openFolder(t){const e=t.id;try{await Ae.post("/open_discussion_folder",{client_id:this.client_id,discussion_id:e}),this.$store.state.toast.showToast(`Opening folder for discussion ${e}...`,3,!0)}catch(n){console.error("Error opening folder:",n),this.$store.state.toast.showToast(`Could not open folder: ${n.message}`,4,!1)}},toggleStarDiscussion(t){this.toggleStarDiscussion(t.id),this.$nextTick(()=>{this.$forceUpdate()})},load_discussion(t,e){if(!t){this.discussionArr=[],this.lastMessageHtml=this.defaultMessageHtml,this.extractHtml(),e&&e();return}this.loading=!0,this.setDiscussionLoading(t,!0),this.discussionArr=[],et.off("discussion"),et.on("discussion",n=>{et.off("discussion"),this.loading=!1,this.setDiscussionLoading(t,!1),n&&Array.isArray(n)?(this.discussionArr=n.filter(r=>r.message_type===this.msgTypes.MSG_TYPE_CONTENT||r.message_type===this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI).map(r=>({...r,status_message:"Done"})),this.discussionArr.length>1&&(!this.currentDiscussion.title||this.currentDiscussion.title==="untitled")&&this.autoChangeTitle(t,this.discussionArr[1].content),this.extractHtml(),this.recoverFiles(),e&&e()):(console.warn("Received invalid discussion data for ID:",t),this.discussionArr=[],this.extractHtml()),this.scrollToBottomMessages()}),et.emit("load_discussion",{id:t}),setTimeout(()=>{var n;this.loading&&((n=this.currentDiscussion)==null?void 0:n.id)===t&&(et.off("discussion"),this.loading=!1,this.setDiscussionLoading(t,!1),this.$store.state.toast.showToast(`Timeout loading discussion ${t}.`,5,!1))},15e3)},handleNewMessage(t){var n;if(((n=this.currentDiscussion)==null?void 0:n.id)!==t.discussion_id){console.log("Received message for non-active discussion:",t.discussion_id);return}t.sender_type===this.senderTypes.SENDER_TYPES_AI&&this.$store.commit("setIsGenerating",!0);const e={sender:t.sender,message_type:t.message_type,sender_type:t.sender_type,content:t.content||(t.sender_type===this.senderTypes.SENDER_TYPES_AI,""),id:t.id,discussion_id:t.discussion_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:t.rank||0,ui:t.ui,steps:[],parameters:t.parameters,nb_tokens:t.nb_tokens?t.nb_tokens:0,metadata:t.metadata||[],open:t.open,status_message:t.sender_type===this.senderTypes.SENDER_TYPES_AI?"Generating...":"Sent"};this.discussionArr.push(e),this.discussionArr.length===2&&(!this.currentDiscussion.title||this.currentDiscussion.title==="untitled")&&e.sender_type===this.senderTypes.SENDER_TYPES_USER&&this.autoChangeTitle(this.currentDiscussion.id,e.content),this.extractHtml(),this.scrollToBottomMessages()},handleUpdateMessage(t){var r,i;if(((r=this.currentDiscussion)==null?void 0:r.id)!==t.discussion_id)return;const e=this.discussionArr.findIndex(s=>s.id===t.id);if(e===-1){console.warn("Update received for non-existent message ID:",t.id);return}const n=this.discussionArr[e];switch(t.operation_type){case this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT:case this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:n.content=t.content,this.$store.commit("setIsGenerating",!0);break;case this.operationTypes.MSG_OPERATION_TYPE_ADD_CHUNK:n.content+=t.content,this.$store.commit("setIsGenerating",!0);break;case this.operationTypes.MSG_OPERATION_TYPE_STEP:case this.operationTypes.MSG_OPERATION_TYPE_STEP_START:case this.operationTypes.MSG_OPERATION_TYPE_STEP_END_SUCCESS:case this.operationTypes.MSG_OPERATION_TYPE_STEP_END_FAILURE:Array.isArray(t.steps)&&(n.steps=t.steps,n.status_message=((i=t.steps[t.steps.length-1])==null?void 0:i.text)||n.status_message);break;case this.operationTypes.MSG_OPERATION_TYPE_JSON_INFOS:try{n.metadata=typeof t.metadata=="string"?JSON.parse(t.metadata):t.metadata||[]}catch(s){console.error("Failed to parse metadata JSON:",s),n.metadata={error:"Failed to parse",raw:t.metadata}}break;case this.operationTypes.MSG_OPERATION_TYPE_UI:n.ui=t.ui;break;case this.operationTypes.MSG_OPERATION_TYPE_EXCEPTION:this.$store.state.toast.showToast(`Error: ${t.content}`,5,!1),n.status_message="Error",this.$store.commit("setIsGenerating",!1);break;case this.operationTypes.MSG_OPERATION_TYPE_WARNING:this.$store.state.toast.showToast(`Warning: ${t.content}`,4,!1);break}t.created_at&&(n.created_at=t.created_at),t.started_generating_at&&(n.started_generating_at=t.started_generating_at),t.nb_tokens&&(n.nb_tokens=t.nb_tokens),t.finished_generating_at&&(n.finished_generating_at=t.finished_generating_at),this.extractHtml()},finalMsgEvent(t){var n,r,i,s;if(((n=this.currentDiscussion)==null?void 0:n.id)!==t.discussion_id)return;const e=this.discussionArr.findIndex(o=>o.id===t.id);if(e!==-1){const o=this.discussionArr[e];t.content!==void 0&&(o.content=t.content),o.finished_generating_at=t.finished_generating_at,o.nb_tokens=t.nb_tokens,o.binding=t.binding,o.model=t.model,o.personality=t.personality,o.status_message="Done",this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading(this.currentDiscussion.id,!1),this.extractHtml(),this.recoverFiles(),this.scrollToBottomMessages(),this.playChime(),(r=this.config)!=null&&r.auto_speak&&((i=this.config)!=null&&i.xtts_enable)&&Fe(()=>{const a=this.$refs[`msg-${t.id}`];a&&a[0]&&typeof a[0].speak=="function"?a[0].speak():console.warn("Could not find message component ref or speak method for ID:",t.id)})}else console.warn("Final message event received for non-existent message ID:",t.id),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((s=this.currentDiscussion)==null?void 0:s.id,!1)},sendMsg({message:t,type:e}){var r;if(!t||!t.trim()){this.$store.state.toast.showToast("Message cannot be empty.",4,!1);return}if(!((r=this.currentDiscussion)!=null&&r.id)){this.$store.state.toast.showToast("Please select or create a discussion first.",4,!1);return}if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0);const n=e==="internet"?"generate_msg_with_internet":"generate_msg";et.emit(n,{prompt:t}),this.scrollToBottomMessages()},sendCmd(t){var e;if(!t||!((e=this.currentDiscussion)!=null&&e.id)||this.isGenerating){this.isGenerating&&this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Executing command: ${t}...`,3,!0),et.emit("execute_command",{command:t,parameters:[]})},async deleteMessage(t){try{await Ae.post("/delete_message",{client_id:this.client_id,id:t}),this.discussionArr=this.discussionArr.filter(e=>e.id!==t),this.$store.state.toast.showToast("Message deleted.",3,!0),this.extractHtml()}catch(e){console.error("Error deleting message:",e),this.$store.state.toast.showToast(`Error deleting message: ${e.message}`,4,!1)}},async rankUpMessage(t){try{const e=await Ae.post("/message_rank_up",{client_id:this.client_id,id:t});if(e.data&&e.data.new_rank!==void 0){const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].rank=e.data.new_rank),this.$store.state.toast.showToast("Rank updated.",3,!0)}else throw new Error("Invalid rank response")}catch(e){console.error("Error ranking up:",e),this.$store.state.toast.showToast(`Error ranking up: ${e.message}`,4,!1)}},async rankDownMessage(t){try{const e=await Ae.post("/message_rank_down",{client_id:this.client_id,id:t});if(e.data&&e.data.new_rank!==void 0){const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].rank=e.data.new_rank),this.$store.state.toast.showToast("Rank updated.",3,!0)}else throw new Error("Invalid rank response")}catch(e){console.error("Error ranking down:",e),this.$store.state.toast.showToast(`Error ranking down: ${e.message}`,4,!1)}},async updateMessage({id:t,content:e,metadata:n}){try{await Ae.post("/edit_message",{client_id:this.client_id,id:t,message:e,metadata:n?[{audio_url:n}]:[]});const r=this.discussionArr.findIndex(i=>i.id===t);r!==-1&&(this.discussionArr[r].content=e),this.$store.state.toast.showToast("Message updated.",3,!0),this.extractHtml()}catch(r){console.error("Error updating message:",r),this.$store.state.toast.showToast(`Error updating message: ${r.message}`,4,!1)}},resendMessage({id:t,content:e,type:n}){if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Resending message ${t}...`,3,!0);const r=this.discussionArr.findIndex(i=>i.id===t);r!==-1&&(this.discussionArr=this.discussionArr.slice(0,r+1),this.discussionArr[r].status_message="Resending..."),et.emit("generate_msg_from",{prompt:e,id:t,msg_type:n}),this.scrollToBottomMessages()},continueMessage({id:t,content:e}){if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Continuing message ${t}...`,3,!0);const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].status_message="Continuing..."),et.emit("continue_generate_msg_from",{prompt:e,id:t}),this.scrollToBottomMessages()},stopGenerating(){var t;if(this.isGenerating){if(et.emit("cancel_generation"),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((t=this.currentDiscussion)==null?void 0:t.id,!1),this.$store.state.toast.showToast("Generation stopped.",4,!0),this.discussionArr.length>0){const e=this.discussionArr[this.discussionArr.length-1];(e.status_message==="Generating..."||e.sender_type===this.senderTypes.SENDER_TYPES_AI&&!e.finished_generating_at)&&(e.status_message="Stopped")}this.scrollToBottomMessages()}},createEmptyUserMessage(t){var e;(e=this.currentDiscussion)!=null&&e.id&&(et.emit("create_empty_message",{type:0,message:t}),this.$store.state.toast.showToast("Creating empty user message...",2,!0))},createEmptyAIMessage(){var t;(t=this.currentDiscussion)!=null&&t.id&&(et.emit("create_empty_message",{type:1}),this.$store.state.toast.showToast("Creating empty AI message...",2,!0))},setDiscussionLoading(t,e){const n=this.discussionsList.findIndex(r=>r.id===t);n!==-1&&(this.discussionsList[n].loading=e)},setPageTitle(t=null){const e="L🌟LLMS WebUI";let n="Welcome";t&&t.title&&t.title!=="untitled"?n=t.title:t&&(n="New Discussion"),document.title=`${e} - ${n}`},scrollToBottomMessages(){Fe(()=>{const t=document.getElementById("messages-list");t&&(t.scrollTop=t.scrollHeight)})},scrollToDiscussionElement(t){t&&Fe(()=>{const e=document.getElementById(`dis-${t}`),n=document.getElementById("leftPanelScroll");e&&n&&n.scrollTo({top:e.offsetTop,behavior:"smooth"})})},copyToClipBoard(t){var r;let e=t.message.content||"",n=e;(r=this.config)!=null&&r.copy_to_clipboard_add_all_details&&(n=`${[t.message.sender?`Sender: ${t.message.sender}`:null,t.message.personality?`Personality: ${t.message.personality}`:null,t.created_at_parsed?`Created: ${t.created_at_parsed}`:null,t.message.binding?`Binding: ${t.message.binding}`:null,t.message.model?`Model: ${t.message.model}`:null,t.message.seed?`Seed: ${t.message.seed}`:null,t.time_spent?`Time spent: ${t.time_spent}`:null].filter(Boolean).join(`
+ `}},watch:{htmlContent:{handler(t){this.renderIsolatedContent(t)},immediate:!0},showRightPanel(t){t&&this.$nextTick(()=>{this.renderIsolatedContent(this.htmlContent)})}},methods:{renderIsolatedContent(t){var r;if(!this.$refs.isolatedContent||!this.showRightPanel)return;this.$refs.isolatedContent.innerHTML="";const e=document.createElement("iframe");e.style.border="none",e.style.width="100%",e.style.height="100%",e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.setAttribute("title","Rendered HTML Content"),this.$refs.isolatedContent.appendChild(e);const n=e.contentDocument||((r=e.contentWindow)==null?void 0:r.document);if(n){const i=document.documentElement.classList.contains("dark");let s=t;i&&(s=s.replace("Error: Could not render content in iframe.'}},mounted(){this.showRightPanel&&this.renderIsolatedContent(this.htmlContent)}},vCr={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 panels-color h-full scrollbar"},yCr={ref:"isolatedContent",class:"h-full p-4 prose-blue dark:prose-invert overflow-auto"};function bCr(t,e,n,r,i,s){return k(),Qt(cr,{name:"slide-left"},{default:Ie(()=>[n.showRightPanel?(k(),R("div",vCr,[b("div",yCr,null,512)])):ne("",!0)]),_:1})}const SCr=st(_Cr,[["render",bCr]]),xCr={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:Voe,MarkdownRenderer:rT},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Ae.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(t=>{this.categories=t.data.categories}).catch(t=>{console.error("Error fetching categories:",t)})},fetchTitles(){console.log("Fetching categories"),Ae.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(t=>{this.titles=t.data.titles,console.log("titles recovered")}).catch(t=>{console.error("Error fetching titles:",t)})},fetchContent(t){console.log("loading skill",t),Ae.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:t}).then(e=>{const n=e.data.contents[0];this.id=n.id,this.content=n.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(t){console.log("Delete category")},editCategory(t){console.log("Edit category")},checkUncheckCategory(t){console.log("Unchecked category")},deleteSkill(t){console.log("Delete skill ",t),Ae.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:t}).then(()=>{this.fetchTitles()})},editTitle(t){Ae.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:t,title:t}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(t){console.log("Make title")},checkUncheckTitle(t){},searchSkills(){}}},ECr={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},wCr={class:"w-[15rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},CCr={classclass:"absolute flex flex-col no-scrollbar shadow-lg w-[15rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},LCr={class:"z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"};function $Cr(t,e,n,r,i,s){const o=Xe("Discussion"),a=Xe("MarkdownRenderer");return k(),R("div",{class:ye([{hidden:!i.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[b("div",ECr,[b("div",wCr,[He(b("input",{type:"search",id:"default-search",class:"block w-full h-8 px-8 text-sm border border-gray-300 rounded-md bg-bg-light focus:ring-1 focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary transition-all duration-200",placeholder:"Search discussions...",title:"Filter skills by title","onUpdate:modelValue":e[0]||(e[0]=l=>i.searchQuery=l),onKeyup:e[1]||(e[1]=gr((...l)=>s.searchSkills&&s.searchSkills(...l),["enter"]))},null,544),[[vt,i.searchQuery]]),b("div",CCr,[e[3]||(e[3]=b("h2",{class:"text-xl font-bold m-4"},"Titles",-1)),i.titles.length>0?(k(),Qt(V4,{key:0,name:"list"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(i.titles,l=>(k(),Qt(o,{key:l.id,id:l.id,title:l.title,selected:s.fetchContent(l.id),loading:i.loading,isCheckbox:i.isCheckbox,checkBoxValue:!1,openfolder_enabled:!1,onSelect:c=>s.fetchContent(l.id),onDelete:c=>s.deleteSkill(l.id),onEditTitle:s.editTitle,onMakeTitle:s.makeTitle,onChecked:s.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):ne("",!0)])]),b("div",LCr,[e[4]||(e[4]=b("h2",{class:"text-xl font-bold m-4"},"Content",-1)),te(a,{host:n.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),b("button",{onClick:e[2]||(e[2]=(...l)=>s.closeComponent&&s.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const ACr=st(xCr,[["render",$Cr]]),kCr={props:{personality:{type:Object,required:!0},config:{type:Object,required:!0}},data(){return{show:!1,title:"Add AI Agent",iconUrl:"",file:null,tempConfig:{}}},methods:{showForm(){this.showDialog=!0},hideForm(){this.showDialog=!1},selectIcon(t){t.target.files&&(this.file=t.target.files[0],this.iconUrl=URL.createObjectURL(this.file))},showPanel(){this.show=!0},hide(){this.show=!1},submitForm(){Ae.post("/set_personality_config",{client_id:this.$store.state.client_id,category:this.personality.category,name:this.personality.folder,config:this.config}).then(t=>{const e=t.data;console.log("Done"),e.status?(this.currentPersonConfig=e.config,this.showPersonalityEditor=!0):console.error(e.error)}).catch(t=>{console.error(t)})}}},PCr={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},RCr={class:"relative w-full max-h-full bg-bg-light dark:bg-bg-dark"},MCr={class:"w-full h-full relative items-center gap-2 rounded-lg border bg-bg-light dark:bg-bg-dark p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"},DCr={class:"justify-center text-center items-center w-full bg-bg-light dark:bg-bg-dark"},NCr={class:"w-full flex flex-row mt-4 text-center justify-center"},ICr={class:"w-full max-h-full container bg-bg-light dark:bg-bg-dark"},HCr={class:"mb-4 w-full"},VCr={class:"w-full bg-bg-light dark:bg-bg-dark"};function qCr(t,e,n,r,i,s){return i.show?(k(),R("div",PCr,[b("div",RCr,[b("div",MCr,[b("button",{type:"button",onClick:e[0]||(e[0]=o=>s.hide()),class:"absolute top-1 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[17]||(e[17]=[b("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[b("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),b("span",{class:"sr-only"},"Close modal",-1)])),b("div",DCr,[b("div",NCr,[b("button",{type:"submit",onClick:e[1]||(e[1]=oe((...o)=>s.submitForm&&s.submitForm(...o),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Commit AI to Server "),b("button",{onClick:e[2]||(e[2]=oe(o=>s.hide(),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Close ")]),b("div",ICr,[b("form",HCr,[b("table",VCr,[b("tr",null,[e[18]||(e[18]=b("td",null,[b("label",{for:"personalityConditioning"},"Personality Conditioning:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"personalityConditioning","onUpdate:modelValue":e[3]||(e[3]=o=>n.config.personality_conditioning=o)},null,512),[[vt,n.config.personality_conditioning]])])]),b("tr",null,[e[19]||(e[19]=b("td",null,[b("label",{for:"userMessagePrefix"},"User Message Prefix:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"userMessagePrefix","onUpdate:modelValue":e[4]||(e[4]=o=>n.config.user_message_prefix=o)},null,512),[[vt,n.config.user_message_prefix]])])]),b("tr",null,[e[20]||(e[20]=b("td",null,[b("label",{for:"aiMessagePrefix"},"AI Message Prefix:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"aiMessagePrefix","onUpdate:modelValue":e[5]||(e[5]=o=>n.config.ai_message_prefix=o)},null,512),[[vt,n.config.ai_message_prefix]])])]),b("tr",null,[e[21]||(e[21]=b("td",null,[b("label",{for:"linkText"},"Link Text:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"linkText","onUpdate:modelValue":e[6]||(e[6]=o=>n.config.link_text=o)},null,512),[[vt,n.config.link_text]])])]),b("tr",null,[e[22]||(e[22]=b("td",null,[b("label",{for:"welcomeMessage"},"Welcome Message:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"welcomeMessage","onUpdate:modelValue":e[7]||(e[7]=o=>n.config.welcome_message=o)},null,512),[[vt,n.config.welcome_message]])])]),b("tr",null,[e[23]||(e[23]=b("td",null,[b("label",{for:"modelTemperature"},"Model Temperature:")],-1)),b("td",null,[He(b("input",{type:"number",id:"modelTemperature","onUpdate:modelValue":e[8]||(e[8]=o=>n.config.model_temperature=o)},null,512),[[vt,n.config.model_temperature]])])]),b("tr",null,[e[24]||(e[24]=b("td",null,[b("label",{for:"modelTopK"},"Model Top K:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopK","onUpdate:modelValue":e[9]||(e[9]=o=>n.config.model_top_k=o)},null,512),[[vt,n.config.model_top_k]])])]),b("tr",null,[e[25]||(e[25]=b("td",null,[b("label",{for:"modelTopP"},"Model Top P:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopP","onUpdate:modelValue":e[10]||(e[10]=o=>n.config.model_top_p=o)},null,512),[[vt,n.config.model_top_p]])])]),b("tr",null,[e[26]||(e[26]=b("td",null,[b("label",{for:"modelRepeatPenalty"},"Model Repeat Penalty:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatPenalty","onUpdate:modelValue":e[11]||(e[11]=o=>n.config.model_repeat_penalty=o)},null,512),[[vt,n.config.model_repeat_penalty]])])]),b("tr",null,[e[27]||(e[27]=b("td",null,[b("label",{for:"modelRepeatLastN"},"Model Repeat Last N:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatLastN","onUpdate:modelValue":e[12]||(e[12]=o=>n.config.model_repeat_last_n=o)},null,512),[[vt,n.config.model_repeat_last_n]])])]),b("tr",null,[e[28]||(e[28]=b("td",null,[b("label",{for:"recommendedBinding"},"Recommended Binding:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedBinding","onUpdate:modelValue":e[13]||(e[13]=o=>n.config.recommended_binding=o)},null,512),[[vt,n.config.recommended_binding]])])]),b("tr",null,[e[29]||(e[29]=b("td",null,[b("label",{for:"recommendedModel"},"Recommended Model:")],-1)),b("td",null,[He(b("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedModel","onUpdate:modelValue":e[14]||(e[14]=o=>n.config.recommended_model=o)},null,512),[[vt,n.config.recommended_model]])])]),b("tr",null,[e[30]||(e[30]=b("td",null,[b("label",{class:"dark:bg-black dark:text-primary w-full",for:"dependencies"},"Dependencies:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"dependencies","onUpdate:modelValue":e[15]||(e[15]=o=>n.config.dependencies=o)},null,512),[[vt,n.config.dependencies]])])]),b("tr",null,[e[31]||(e[31]=b("td",null,[b("label",{for:"antiPrompts"},"Anti Prompts:")],-1)),b("td",null,[He(b("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"antiPrompts","onUpdate:modelValue":e[16]||(e[16]=o=>n.config.anti_prompts=o)},null,512),[[vt,n.config.anti_prompts]])])])])])])])])])])):ne("",!0)}const UCr=st(kCr,[["render",qCr]]),BCr={data(){return{showPopup:!1,webpageUrl:"https://lollms.com/"}},methods:{show(){this.showPopup=!0},hide(){this.showPopup=!1},save_configuration(){Ae.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config}).then(t=>{this.isLoading=!1,t.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1)})}}},zCr={key:0,class:"fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50"},XCr={class:"relative panels-color p-6 rounded-lg shadow-xl max-w-3xl w-full mx-4"},FCr=["src"],jCr={class:"flex items-center mt-4"};function YCr(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade"},{default:Ie(()=>[i.showPopup?(k(),R("div",zCr,[b("div",XCr,[b("button",{onClick:e[0]||(e[0]=(...o)=>s.hide&&s.hide(...o)),class:"absolute top-2 right-2 svg-button z-10",title:"Close"},e[3]||(e[3]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])),b("iframe",{src:i.webpageUrl,class:"w-full h-[70vh] rounded-md border border-blue-300 dark:border-blue-600 bg-white dark:bg-blue-900"},null,8,FCr),b("div",jCr,[He(b("input",{type:"checkbox",id:"startup",class:"rounded border-blue-300 dark:border-blue-600 text-blue-600 focus:ring-blue-500 dark:bg-blue-700 dark:focus:ring-offset-blue-800","onUpdate:modelValue":e[1]||(e[1]=o=>this.$store.state.config.show_news_panel=o),onChange:e[2]||(e[2]=(...o)=>s.save_configuration&&s.save_configuration(...o))},null,544),[[W3,this.$store.state.config.show_news_panel]]),e[4]||(e[4]=b("label",{for:"startup",class:"ml-2 label !mb-0 cursor-pointer"},"Show at startup",-1))])])])):ne("",!0)]),_:1})}const GCr=st(BCr,[["render",YCr],["__scopeId","data-v-425d1bc4"]]),WCr={name:"ChangelogPopup",data(){return{showChangelogPopup:!1,changelogContent:"",currentVersion:"0.0.0"}},computed:{parsedChangelogContent(){const t={breaks:!0,gfm:!0},e=Kt(this.changelogContent,t);return C4.sanitize(e)}},async mounted(){await this.checkChangelogUpdate()},methods:{async fetchVersion(){try{const t=await Ae.get("/get_lollms_webui_version");if(t&&t.data){const{version_main:e,version_secondary:n,version_type:r,version_codename:i}=t.data;let s=`${e}.${n}`;return r&&(s+=` ${r}`),i&&(s+=` (${i})`),this.$store.state.version=s,this.currentVersion=s,s}}catch(t){console.error("Error fetching LoLLMs version:",t)}return this.$store.state.version||"0.0.0"},async checkChangelogUpdate(){try{const t=await Ae.get("/get_changelog");this.changelogContent=t.data||"*No changelog content found.*";const e=await this.fetchVersion(),r=(await Ae.get("/get_last_viewed_changelog_version")).data,i=s=>{s&&s.app_show_changelogs&&e!==r&&e!=="0.0.0"&&(this.showChangelogPopup=!0)};if(this.$store.state.config)i(this.$store.state.config);else{const s=this.$watch("$store.state.config",o=>{o&&(i(o),s())},{immediate:!1})}}catch(t){console.error("Error checking changelog:",t)}},async handleUnderstand(){try{await Ae.post("/set_last_viewed_changelog_version",{client_id:this.$store.state.client_id,version:this.currentVersion}),this.closePopup()}catch(t){console.error("Error setting last viewed changelog version:",t),this.closePopup()}},closePopup(){this.showChangelogPopup=!1}}},ZCr={class:"flex justify-between items-center p-4 px-6 border-b border-blue-300 dark:border-blue-600 flex-shrink-0 unicolor-panels-color"},KCr={class:"p-6 md:p-8 flex-grow overflow-y-auto scrollbar text-blue-900 dark:text-blue-200"},JCr=["innerHTML"],eLr={class:"flex justify-end p-4 px-6 border-t border-blue-300 dark:border-blue-600 flex-shrink-0 unicolor-panels-color"};function tLr(t,e,n,r,i,s){return k(),Qt(cr,{name:"fade"},{default:Ie(()=>[i.showChangelogPopup?(k(),R("div",{key:0,class:ye(["fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[100] transition-opacity duration-300",{"opacity-0 pointer-events-none":!i.showChangelogPopup,"opacity-100":i.showChangelogPopup}])},[b("div",{class:ye(["panels-color rounded-lg w-[95%] max-w-4xl max-h-[90vh] flex flex-col shadow-2xl overflow-hidden transform transition-all duration-300 ease-out border border-blue-300 dark:border-blue-600",{"opacity-0 scale-95":!i.showChangelogPopup,"opacity-100 scale-100":i.showChangelogPopup}])},[b("div",ZCr,[e[3]||(e[3]=b("h2",{class:"text-xl font-semibold text-blue-800 dark:text-blue-100"},"What's New",-1)),b("button",{class:"svg-button",onClick:e[0]||(e[0]=(...o)=>s.closePopup&&s.closePopup(...o)),"aria-label":"Close Changelog"},e[2]||(e[2]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),b("div",KCr,[b("div",{class:"prose prose-blue dark:prose-invert max-w-none",innerHTML:s.parsedChangelogContent},null,8,JCr)]),b("div",eLr,[b("button",{class:"btn btn-primary",onClick:e[1]||(e[1]=(...o)=>s.handleUnderstand&&s.handleUnderstand(...o))}," Got it ")])],2)],2)):ne("",!0)]),_:1})}const nLr=st(WCr,[["render",tLr],["__scopeId","data-v-4427a40c"]]),rLr=Zn({name:"DiscussionsView",components:{WelcomeScreen:t_r,LeftPanel:Mvr,ChatArea:QCr,RenderPanel:SCr,ChoiceDialog:Hoe,ProgressBar:uoe,SkillsLibraryViewer:ACr,PersonalityEditor:UCr,PopupViewer:GCr,ChangelogPopup:nLr},data(){return{discussionsList:[],currentDiscussion:{},discussionArr:[],personalityAvatars:[],lastMessageHtml:"",loading:!1,database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,interestingFacts:["ParisNeo, the creator of LoLLMs, originally built his high-performance PC to play Cyberpunk 2077. However, his passion for AI took an unexpected turn, leading him to develop LoLLMs instead. Ironically, he never found the time to actually play the game that inspired his powerful setup!","Saïph, version 14 of LoLLMs, is named after a star in Orion's constellation (Kappa Orionis), representing bright guidance in AI!","The 'LoLLMs' name stands for 'Lord of Large Language Models', a playful nod to the power and potential of these AI systems.","LoLLMs v15 introduced 'Personality Packages', allowing users to customize AI interactions like never before.","Did you know? LoLLMs supports multiple AI backends, giving you flexibility in choosing the best engine for your needs.","LoLLMs v16 focused heavily on optimizing performance, making interactions faster and smoother.","The project is open-source, fostering a community of developers and users contributing to its growth.","LoLLMs v17 brought enhanced multi-modal capabilities, allowing interaction with images and potentially other media.","From text generation to coding assistance, LoLLMs aims to be a versatile AI tool.","LoLLMs v18, codenamed 'Orion', aimed for stellar improvements in stability and user experience.","The integrated 'Skills Library' allows LoLLMs to learn and perform specialized tasks.","LoLLMs is designed to run locally, ensuring data privacy and control for users.","The development of LoLLMs is driven by community feedback and the pursuit of cutting-edge AI accessibility.","Version 19, 'Fish Edition', dives deep into refining core features and improving aquatic-themed puns (results may vary).","The LoLLMs mascot, a wise owl, symbolizes knowledge and the ability to see through complex data.","Future versions aim to expand integration with various platforms and enhance collaborative features.","The configuration system in LoLLMs allows for deep customization of AI behavior and performance.","LoLLMs supports extensions, enabling developers to add new functionalities and integrations.","Keeping your LoLLMs updated ensures you have the latest features, optimizations, and security enhancements.","**Binary Brain Teaser:** The version number contains a secret message: `01100001 01110010 01110000 01101001 01101100 00100000 01100110 01101111 01101111 01101100`. If you decoded that, you truly understand the spirit of v19.1 'Fish Edition'!"],host:"",rebooting_audio:new Audio("/rebooting.wav"),connection_lost_audio:new Audio("/connection_lost.wav"),connection_recovered_audio:new Audio("/connection_recovered.wav"),chime:new Audio("/chime_aud.wav"),msgTypes:{MSG_TYPE_CONTENT:1,MSG_TYPE_CONTENT_INVISIBLE_TO_AI:2,MSG_TYPE_CONTENT_INVISIBLE_TO_USER:3},operationTypes:{MSG_OPERATION_TYPE_ADD_CHUNK:0,MSG_OPERATION_TYPE_SET_CONTENT:1,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:2,MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_USER:3,MSG_OPERATION_TYPE_EXCEPTION:4,MSG_OPERATION_TYPE_WARNING:5,MSG_OPERATION_TYPE_INFO:6,MSG_OPERATION_TYPE_STEP:7,MSG_OPERATION_TYPE_STEP_START:8,MSG_OPERATION_TYPE_STEP_PROGRESS:9,MSG_OPERATION_TYPE_STEP_END_SUCCESS:10,MSG_OPERATION_TYPE_STEP_END_FAILURE:11,MSG_OPERATION_TYPE_JSON_INFOS:12,MSG_OPERATION_TYPE_REF:13,MSG_OPERATION_TYPE_CODE:14,MSG_OPERATION_TYPE_UI:15,MSG_OPERATION_TYPE_NEW_MESSAGE:16,MSG_OPERATION_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},is_first_connection:!0,defaultMessageHtml:` Render Panel Ready
`}},computed:{...Pu(["ready","loading_infos","loading_progress","version","config","databases","isConnected","isGenerating","client_id","leftPanelCollapsed","rightPanelCollapsed","theme_vars","selectedPersonality","currentPersonConfig","personalities","personalities_ready"]),...oE(["getIsReady","getVersion","getConfig","getClientId","getDatabases","getIsConnected","getIsGenerating","getLeftPanelCollapsed","getRightPanelCollapsed"]),isReady(){return this.getIsReady},version_info(){const t=this.getVersion;return t&&t!=="unknown"?t:"..."},showLeftPanel(){return this.isReady&&!this.getLeftPanelCollapsed},showRightPanel(){return this.isReady&&!this.getRightPanelCollapsed},formatted_database_name(){var e;return(((e=this.config)==null?void 0:e.discussion_db_name)||"default").replace(/_/g," ")}},methods:{...ace(["refreshConfig","refreshDatabase","refreshBindings","refreshPersonalitiesZoo","refreshMountedPersonalities","refreshModelsZoo","refreshModels","fetchLanguages","fetchLanguage","fetchIsRtOn","toggleStarPersonality","toggleStarDiscussion","applyConfiguration","saveConfiguration","refreshModelStatus"]),async initialLoad(){console.log("Initial Load Started");try{for(this.$store.commit("setLoadingInfos","Getting version"),this.$store.commit("setLoadingProgress",10),await this.$store.dispatch("getVersion"),this.$store.commit("setLoadingInfos","Connecting..."),this.$store.commit("setLoadingProgress",20);!et||et.id===void 0;)await new Promise(t=>setTimeout(t,200));this.$store.commit("setClientId",et.id),this.$store.commit("setLoadingInfos","Loading Configuration"),this.$store.commit("setLoadingProgress",30),await this.refreshConfig(),this.$store.commit("setLoadingInfos","Loading Database"),this.$store.commit("setLoadingProgress",40),await this.refreshDatabase(),this.$store.commit("setLoadingInfos","Getting Bindings list"),this.$store.commit("setLoadingProgress",50),await this.refreshBindings(),this.$store.commit("setLoadingInfos","Getting personalities zoo"),this.$store.commit("setLoadingProgress",60),await this.refreshPersonalitiesZoo(),this.$store.commit("setLoadingInfos","Getting mounted personalities"),this.$store.commit("setLoadingProgress",70),await this.refreshMountedPersonalities(),this.$store.commit("setLoadingInfos","Getting models zoo"),this.$store.commit("setLoadingProgress",80),await this.refreshModelsZoo(),this.$store.commit("setLoadingInfos","Getting active models"),this.$store.commit("setLoadingProgress",90),await this.refreshModels(),await this.refreshModelStatus(),await this.fetchLanguages(),await this.fetchLanguage(),await this.fetchIsRtOn(),await this.list_discussions(),await this.getPersonalityAvatars(),this.loadLastUsedDiscussion(),this.$store.commit("setLoadingProgress",100),this.$store.commit("setLoadingInfos","Ready"),await new Promise(t=>setTimeout(t,500)),this.$store.commit("setIsReady",!0),console.log("Initial Load Complete"),this.setupSocketListeners()}catch(t){console.error("Initial load failed:",t),this.$store.commit("setLoadingInfos",`Error: ${t.message||"Initialization failed"}`)}},setupSocketListeners(){et.on("connected",this.socketIOConnected),et.on("disconnect",this.socketIODisconnected),et.on("show_progress",this.show_progress),et.on("hide_progress",this.hide_progress),et.on("update_progress",this.update_progress),et.on("notification",this.notify),et.on("new_message",this.handleNewMessage),et.on("update_message",this.handleUpdateMessage),et.on("close_message",this.finalMsgEvent),et.on("discussion_renamed",this.handleDiscussionRenamed),et.on("refresh_files",this.recoverFiles),et.on("connect_error",this.handleConnectError),et.onerror=this.handleSocketError,et.onclose=this.handleSocketClose},async list_discussions(){try{this.loading=!0;const t=await Ae.get("/list_discussions");t&&Array.isArray(t.data)?this.discussionsList=t.data.map(e=>({id:e.id,title:e.title,created_at:e.created_at,loading:!1})).sort((e,n)=>n.id-e.id):this.discussionsList=[],this.loading=!1}catch(t){console.error("Error listing discussions:",t),this.$store.state.toast.showToast(`Error fetching discussions: ${t.message}`,4,!1),this.discussionsList=[],this.loading=!1}},loadLastUsedDiscussion(){const t=localStorage.getItem("selected_discussion");if(t){const e=this.discussionsList.find(n=>String(n.id)===t);e?this.selectDiscussion(e):(localStorage.removeItem("selected_discussion"),this.currentDiscussion={},this.discussionArr=[])}else this.currentDiscussion={},this.discussionArr=[]},selectDiscussion(t){var e;if(this.isGenerating){this.$store.state.toast.showToast("Please wait for generation to finish or stop.",4,!1);return}t&&((e=this.currentDiscussion)==null?void 0:e.id)!==t.id?(this.currentDiscussion={...t},this.setPageTitle(t),localStorage.setItem("selected_discussion",t.id),this.load_discussion(t.id)):t||(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle(),localStorage.removeItem("selected_discussion")),Fe(()=>this.scrollToDiscussionElement(t==null?void 0:t.id))},async createNewDiscussion(){try{this.loading=!0,this.$store.state.toast.showToast("Creating new discussion...",2,!0),et.emit("new_discussion",{title:null}),et.once("discussion_created",async t=>{if(t&&t.id){await this.list_discussions();const e=this.discussionsList.find(n=>n.id===t.id);e?this.selectDiscussion(e):(console.error("Newly created discussion not found in list:",t.id),this.$store.state.toast.showToast("Error: Couldn't find new discussion.",4,!1))}else console.error("Invalid discussion_created data:",t),this.$store.state.toast.showToast("Error creating discussion.",4,!1);this.loading=!1}),setTimeout(()=>{var t;this.loading&&!((t=this.currentDiscussion)!=null&&t.id)&&(et.off("discussion_created"),this.loading=!1,this.$store.state.toast.showToast("Timeout creating discussion.",4,!1))},1e4)}catch(t){console.error("Error initiating new discussion:",t),this.$store.state.toast.showToast(`Error: ${t.message}`,4,!1),this.loading=!1}},async deleteDiscussion(t){t&&this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete discussion ${t}?`,"Delete","Cancel").then(async e=>{var n;if(e)try{this.setDiscussionLoading(t,!0),await Ae.post("/delete_discussion",{client_id:this.client_id,id:t}),this.$store.state.toast.showToast(`Discussion ${t} deleted.`,4,!0),this.discussionsList=this.discussionsList.filter(r=>r.id!==t),((n=this.currentDiscussion)==null?void 0:n.id)===t&&this.selectDiscussion(null)}catch(r){console.error("Error deleting discussion:",r),this.$store.state.toast.showToast(`Error deleting discussion ${t}: ${r.message}`,4,!1),this.setDiscussionLoading(t,!1)}})},async deleteDiscussionMulti(t){if(!Array.isArray(t)||t.length===0)return;const e=t.length;this.$store.state.yesNoDialog.askQuestion(`Are you sure you want to delete ${e} discussion(s)?`,"Delete Selected","Cancel").then(async n=>{var r;if(n){this.$store.state.toast.showToast(`Deleting ${e} discussions...`,5,!0);let i=0,s=0;t.forEach(o=>this.setDiscussionLoading(o,!0));for(const o of t)try{await Ae.post("/delete_discussion",{client_id:this.client_id,id:o}),i++,this.discussionsList=this.discussionsList.filter(a=>a.id!==o),((r=this.currentDiscussion)==null?void 0:r.id)===o&&this.selectDiscussion(null)}catch(a){console.error(`Error deleting discussion ${o}:`,a),s++,this.setDiscussionLoading(o,!1)}s>0?this.$store.state.toast.showToast(`Deleted ${i} discussions. Failed to delete ${s}.`,5,!1):this.$store.state.toast.showToast(`Successfully deleted ${i} discussions.`,4,!0)}})},async editTitle({id:t,title:e}){var n,r;try{this.setDiscussionLoading(t,!0);const i=await Ae.post("/edit_title",{client_id:this.client_id,id:t,title:e});if(i.status===200){const s=this.discussionsList.findIndex(o=>o.id===t);s>-1&&(this.discussionsList[s].title=e),((n=this.currentDiscussion)==null?void 0:n.id)===t&&(this.currentDiscussion.title=e),this.$store.state.toast.showToast("Title updated.",3,!0)}else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to edit title")}catch(i){console.error("Error editing title:",i),this.$store.state.toast.showToast(`Error editing title: ${i.message}`,4,!1)}finally{this.setDiscussionLoading(t,!1)}},async makeTitle(t){var n,r;const e=t.id;try{this.setDiscussionLoading(e,!0),this.$store.state.toast.showToast("Generating title...",3,!0);const i=await Ae.post("/make_title",{client_id:this.client_id,id:e});if(i.status===200&&i.data.title){const s=i.data.title,o=this.discussionsList.findIndex(a=>a.id===e);o>-1&&(this.discussionsList[o].title=s),((n=this.currentDiscussion)==null?void 0:n.id)===e&&(this.currentDiscussion.title=s),this.$store.state.toast.showToast("Title generated.",3,!0)}else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to generate title")}catch(i){console.error("Error making title:",i),this.$store.state.toast.showToast(`Error generating title: ${i.message}`,4,!1)}finally{this.setDiscussionLoading(e,!1)}},async openFolder(t){const e=t.id;try{await Ae.post("/open_discussion_folder",{client_id:this.client_id,discussion_id:e}),this.$store.state.toast.showToast(`Opening folder for discussion ${e}...`,3,!0)}catch(n){console.error("Error opening folder:",n),this.$store.state.toast.showToast(`Could not open folder: ${n.message}`,4,!1)}},toggleStarDiscussion(t){this.toggleStarDiscussion(t.id),this.$nextTick(()=>{this.$forceUpdate()})},load_discussion(t,e){if(!t){this.discussionArr=[],this.lastMessageHtml=this.defaultMessageHtml,this.extractHtml(),e&&e();return}this.loading=!0,this.setDiscussionLoading(t,!0),this.discussionArr=[],et.off("discussion"),et.on("discussion",n=>{et.off("discussion"),this.loading=!1,this.setDiscussionLoading(t,!1),n&&Array.isArray(n)?(this.discussionArr=n.filter(r=>r.message_type===this.msgTypes.MSG_TYPE_CONTENT||r.message_type===this.msgTypes.MSG_TYPE_CONTENT_INVISIBLE_TO_AI).map(r=>({...r,status_message:"Done"})),this.discussionArr.length>1&&(!this.currentDiscussion.title||this.currentDiscussion.title==="untitled")&&this.autoChangeTitle(t,this.discussionArr[1].content),this.extractHtml(),this.recoverFiles(),e&&e()):(console.warn("Received invalid discussion data for ID:",t),this.discussionArr=[],this.extractHtml()),this.scrollToBottomMessages()}),et.emit("load_discussion",{id:t}),setTimeout(()=>{var n;this.loading&&((n=this.currentDiscussion)==null?void 0:n.id)===t&&(et.off("discussion"),this.loading=!1,this.setDiscussionLoading(t,!1),this.$store.state.toast.showToast(`Timeout loading discussion ${t}.`,5,!1))},15e3)},handleNewMessage(t){var n;if(((n=this.currentDiscussion)==null?void 0:n.id)!==t.discussion_id){console.log("Received message for non-active discussion:",t.discussion_id);return}t.sender_type===this.senderTypes.SENDER_TYPES_AI&&this.$store.commit("setIsGenerating",!0);const e={sender:t.sender,message_type:t.message_type,sender_type:t.sender_type,content:t.content||(t.sender_type===this.senderTypes.SENDER_TYPES_AI,""),id:t.id,discussion_id:t.discussion_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:t.rank||0,ui:t.ui,steps:[],parameters:t.parameters,nb_tokens:t.nb_tokens?t.nb_tokens:0,metadata:t.metadata||[],open:t.open,status_message:t.sender_type===this.senderTypes.SENDER_TYPES_AI?"Generating...":"Sent"};this.discussionArr.push(e),this.discussionArr.length===2&&(!this.currentDiscussion.title||this.currentDiscussion.title==="untitled")&&e.sender_type===this.senderTypes.SENDER_TYPES_USER&&this.autoChangeTitle(this.currentDiscussion.id,e.content),this.extractHtml(),this.scrollToBottomMessages()},handleUpdateMessage(t){var r,i;if(((r=this.currentDiscussion)==null?void 0:r.id)!==t.discussion_id)return;const e=this.discussionArr.findIndex(s=>s.id===t.id);if(e===-1){console.warn("Update received for non-existent message ID:",t.id);return}const n=this.discussionArr[e];switch(t.operation_type){case this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT:case this.operationTypes.MSG_OPERATION_TYPE_SET_CONTENT_INVISIBLE_TO_AI:n.content=t.content,this.$store.commit("setIsGenerating",!0);break;case this.operationTypes.MSG_OPERATION_TYPE_ADD_CHUNK:n.content+=t.content,this.$store.commit("setIsGenerating",!0);break;case this.operationTypes.MSG_OPERATION_TYPE_STEP:case this.operationTypes.MSG_OPERATION_TYPE_STEP_START:case this.operationTypes.MSG_OPERATION_TYPE_STEP_END_SUCCESS:case this.operationTypes.MSG_OPERATION_TYPE_STEP_END_FAILURE:Array.isArray(t.steps)&&(n.steps=t.steps,n.status_message=((i=t.steps[t.steps.length-1])==null?void 0:i.text)||n.status_message);break;case this.operationTypes.MSG_OPERATION_TYPE_JSON_INFOS:try{n.metadata=typeof t.metadata=="string"?JSON.parse(t.metadata):t.metadata||[]}catch(s){console.error("Failed to parse metadata JSON:",s),n.metadata={error:"Failed to parse",raw:t.metadata}}break;case this.operationTypes.MSG_OPERATION_TYPE_UI:n.ui=t.ui;break;case this.operationTypes.MSG_OPERATION_TYPE_EXCEPTION:this.$store.state.toast.showToast(`Error: ${t.content}`,5,!1),n.status_message="Error",this.$store.commit("setIsGenerating",!1);break;case this.operationTypes.MSG_OPERATION_TYPE_WARNING:this.$store.state.toast.showToast(`Warning: ${t.content}`,4,!1);break}t.created_at&&(n.created_at=t.created_at),t.started_generating_at&&(n.started_generating_at=t.started_generating_at),t.nb_tokens&&(n.nb_tokens=t.nb_tokens),t.finished_generating_at&&(n.finished_generating_at=t.finished_generating_at),this.extractHtml()},finalMsgEvent(t){var n,r,i,s;if(((n=this.currentDiscussion)==null?void 0:n.id)!==t.discussion_id)return;const e=this.discussionArr.findIndex(o=>o.id===t.id);if(e!==-1){const o=this.discussionArr[e];t.content!==void 0&&(o.content=t.content),o.finished_generating_at=t.finished_generating_at,o.nb_tokens=t.nb_tokens,o.binding=t.binding,o.model=t.model,o.personality=t.personality,o.status_message="Done",this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading(this.currentDiscussion.id,!1),this.extractHtml(),this.recoverFiles(),this.scrollToBottomMessages(),this.playChime(),(r=this.config)!=null&&r.auto_speak&&((i=this.config)!=null&&i.xtts_enable)&&Fe(()=>{const a=this.$refs[`msg-${t.id}`];a&&a[0]&&typeof a[0].speak=="function"?a[0].speak():console.warn("Could not find message component ref or speak method for ID:",t.id)})}else console.warn("Final message event received for non-existent message ID:",t.id),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((s=this.currentDiscussion)==null?void 0:s.id,!1)},sendMsg({message:t,type:e}){var r;if(!t||!t.trim()){this.$store.state.toast.showToast("Message cannot be empty.",4,!1);return}if(!((r=this.currentDiscussion)!=null&&r.id)){this.$store.state.toast.showToast("Please select or create a discussion first.",4,!1);return}if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0);const n=e==="internet"?"generate_msg_with_internet":"generate_msg";et.emit(n,{prompt:t}),this.scrollToBottomMessages()},sendCmd(t){var e;if(!t||!((e=this.currentDiscussion)!=null&&e.id)||this.isGenerating){this.isGenerating&&this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Executing command: ${t}...`,3,!0),et.emit("execute_command",{command:t,parameters:[]})},async deleteMessage(t){try{await Ae.post("/delete_message",{client_id:this.client_id,id:t}),this.discussionArr=this.discussionArr.filter(e=>e.id!==t),this.$store.state.toast.showToast("Message deleted.",3,!0),this.extractHtml()}catch(e){console.error("Error deleting message:",e),this.$store.state.toast.showToast(`Error deleting message: ${e.message}`,4,!1)}},async rankUpMessage(t){try{const e=await Ae.post("/message_rank_up",{client_id:this.client_id,id:t});if(e.data&&e.data.new_rank!==void 0){const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].rank=e.data.new_rank),this.$store.state.toast.showToast("Rank updated.",3,!0)}else throw new Error("Invalid rank response")}catch(e){console.error("Error ranking up:",e),this.$store.state.toast.showToast(`Error ranking up: ${e.message}`,4,!1)}},async rankDownMessage(t){try{const e=await Ae.post("/message_rank_down",{client_id:this.client_id,id:t});if(e.data&&e.data.new_rank!==void 0){const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].rank=e.data.new_rank),this.$store.state.toast.showToast("Rank updated.",3,!0)}else throw new Error("Invalid rank response")}catch(e){console.error("Error ranking down:",e),this.$store.state.toast.showToast(`Error ranking down: ${e.message}`,4,!1)}},async updateMessage({id:t,content:e,metadata:n}){try{await Ae.post("/edit_message",{client_id:this.client_id,id:t,message:e,metadata:n?[{audio_url:n}]:[]});const r=this.discussionArr.findIndex(i=>i.id===t);r!==-1&&(this.discussionArr[r].content=e),this.$store.state.toast.showToast("Message updated.",3,!0),this.extractHtml()}catch(r){console.error("Error updating message:",r),this.$store.state.toast.showToast(`Error updating message: ${r.message}`,4,!1)}},resendMessage({id:t,content:e,type:n}){if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Resending message ${t}...`,3,!0);const r=this.discussionArr.findIndex(i=>i.id===t);r!==-1&&(this.discussionArr=this.discussionArr.slice(0,r+1),this.discussionArr[r].status_message="Resending..."),et.emit("generate_msg_from",{prompt:e,id:t,msg_type:n}),this.scrollToBottomMessages()},continueMessage({id:t,content:e}){if(this.isGenerating){this.$store.state.toast.showToast("Please wait for the current response.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Continuing message ${t}...`,3,!0);const n=this.discussionArr.findIndex(r=>r.id===t);n!==-1&&(this.discussionArr[n].status_message="Continuing..."),et.emit("continue_generate_msg_from",{prompt:e,id:t}),this.scrollToBottomMessages()},stopGenerating(){var t;if(this.isGenerating){if(et.emit("cancel_generation"),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((t=this.currentDiscussion)==null?void 0:t.id,!1),this.$store.state.toast.showToast("Generation stopped.",4,!0),this.discussionArr.length>0){const e=this.discussionArr[this.discussionArr.length-1];(e.status_message==="Generating..."||e.sender_type===this.senderTypes.SENDER_TYPES_AI&&!e.finished_generating_at)&&(e.status_message="Stopped")}this.scrollToBottomMessages()}},createEmptyUserMessage(t){var e;(e=this.currentDiscussion)!=null&&e.id&&(et.emit("create_empty_message",{type:0,message:t}),this.$store.state.toast.showToast("Creating empty user message...",2,!0))},createEmptyAIMessage(){var t;(t=this.currentDiscussion)!=null&&t.id&&(et.emit("create_empty_message",{type:1}),this.$store.state.toast.showToast("Creating empty AI message...",2,!0))},setDiscussionLoading(t,e){const n=this.discussionsList.findIndex(r=>r.id===t);n!==-1&&(this.discussionsList[n].loading=e)},setPageTitle(t=null){const e="L🌟LLMS WebUI";let n="Welcome";t&&t.title&&t.title!=="untitled"?n=t.title:t&&(n="New Discussion"),document.title=`${e} - ${n}`},scrollToBottomMessages(){Fe(()=>{const t=document.getElementById("messages-list");t&&(t.scrollTop=t.scrollHeight)})},scrollToDiscussionElement(t){t&&Fe(()=>{const e=document.getElementById(`dis-${t}`),n=document.getElementById("leftPanelScroll");e&&n&&n.scrollTo({top:e.offsetTop,behavior:"smooth"})})},copyToClipBoard(t){var r;let e=t.message.content||"",n=e;(r=this.config)!=null&&r.copy_to_clipboard_add_all_details&&(n=`${[t.message.sender?`Sender: ${t.message.sender}`:null,t.message.personality?`Personality: ${t.message.personality}`:null,t.created_at_parsed?`Created: ${t.created_at_parsed}`:null,t.message.binding?`Binding: ${t.message.binding}`:null,t.message.model?`Model: ${t.message.model}`:null,t.message.seed?`Seed: ${t.message.seed}`:null,t.time_spent?`Time spent: ${t.time_spent}`:null].filter(Boolean).join(`
`)}
-${e}`),navigator.clipboard.writeText(n).then(()=>this.$store.state.toast.showToast("Copied to clipboard.",3,!0)).catch(i=>{console.error("Clipboard copy failed:",i),this.$store.state.toast.showToast("Failed to copy.",4,!1)})},playChime(){this.chime.play().catch(t=>console.debug("Chime play interrupted or failed:",t))},async recoverFiles(){var t,e;if((t=this.currentDiscussion)!=null&&t.id)try{const n=await Ae.post("/get_discussion_files_list",{client_id:this.client_id}),r=(e=this.$refs.chatArea)==null?void 0:e.$refs.chatBox;n.data&&r&&(r.filesList=n.data.files||[],r.isFileSentList=(n.data.files||[]).map(()=>!0))}catch(n){console.error("Error recovering files:",n),this.$store.state.toast.showToast("Could not load discussion files.",4,!1)}},handleChatFilesDropped(t){var e;(e=this.$refs.chatArea)!=null&&e.$refs.chatBox&&this.$refs.chatArea.$refs.chatBox.handleFiles(t)},importDiscussionFile(t){if(!t||t.type!=="application/json"){this.$store.state.toast.showToast("Please drop a valid JSON discussion file.",4,!1);return}this.parseAndImportDiscussions(t)},async parseAndImportDiscussions(t){var e,n;try{this.$store.state.toast.showToast("Importing discussion(s)...",3,!0);const r=await this.readFileAsJson(t),i=Array.isArray(r)?r:[r];if(i.length===0)throw new Error("JSON file contains no discussion data.");const s=await Ae.post("/import_multiple_discussions",{client_id:this.client_id,jArray:i});if((e=s.data)!=null&&e.status)this.$store.state.toast.showToast(`Successfully imported ${i.length} discussion(s).`,4,!0),await this.list_discussions();else throw new Error(((n=s.data)==null?void 0:n.error)||"Import failed on backend.")}catch(r){console.error("Error importing discussions:",r),this.$store.state.toast.showToast(`Import failed: ${r.message}`,5,!1)}},readFileAsJson(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{try{e(JSON.parse(i.target.result))}catch{n(new Error("Failed to parse JSON file."))}},r.onerror=i=>n(new Error("Failed to read file.")),r.readAsText(t)})},importDiscussions(t){const e=t.target.files[0];e&&this.parseAndImportDiscussions(e),t.target.value=null},importDiscussionsBundle(t){console.warn("Discussion bundle import not implemented yet."),this.$store.state.toast.showToast("Bundle import not yet available.",4,!1),t.target.value=null},async exportDiscussionsAsFormat(t,e){var n,r;if(!Array.isArray(e)||e.length===0){this.$store.state.toast.showToast("No discussions selected for export.",4,!1);return}try{this.$store.state.toast.showToast(`Exporting ${e.length} discussions as ${t}...`,4,!0),this.loading=!0;const i=await Ae.post("/export_multiple_discussions",{client_id:this.client_id,discussion_ids:e,export_format:t},{responseType:t==="json"?"json":"blob"});if(i.data){const s=`discussions_export_${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`,o=t==="json"?new Blob([JSON.stringify(i.data,null,2)],{type:"application/json"}):new Blob([i.data],{type:"text/plain"}),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download=s,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a),this.$store.state.toast.showToast("Export successful.",4,!0)}else throw new Error("Backend returned no data for export.")}catch(i){console.error(`Error exporting discussions as ${t}:`,i),this.$store.state.toast.showToast(`Export failed: ${((r=(n=i.response)==null?void 0:n.data)==null?void 0:r.error)||i.message}`,5,!1)}finally{this.loading=!1}},exportDiscussionsAsJson(t){this.exportDiscussionsAsFormat("json",t.map(e=>e.id))},exportDiscussionsAsMarkdown(t){this.exportDiscussionsAsFormat("markdown",t.map(e=>e.id))},exportDiscussionsToFolder(t){console.warn("Export to folder not implemented yet."),this.$store.state.toast.showToast("Export to folder is not yet available.",4,!1)},showDatabaseSelector(){this.database_selectorDialogVisible=!0},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async ondatabase_selectorDialogRemoved(t){console.log("Database removal not implemented on backend:",t)},async ondatabase_selectorDialogSelected(t){},async onvalidatedatabase_selectorChoice(t){var n,r,i;this.database_selectorDialogVisible=!1;const e=typeof t=="string"?t:t.name;if(e===((n=this.config)==null?void 0:n.discussion_db_name)){this.$store.state.toast.showToast("Database already selected.",3,!0);return}try{this.$store.state.toast.showToast(`Selecting database: ${e}...`,4,!0);const s=await Ae.post("/select_database",{client_id:this.client_id,name:e});if((r=s.data)!=null&&r.status)this.$store.state.toast.showToast("Database changed. Reloading...",5,!0),setTimeout(()=>window.location.reload(),1500);else throw new Error(((i=s.data)==null?void 0:i.error)||"Failed to select database.")}catch(s){console.error("Error selecting database:",s),this.$store.state.toast.showToast(`Error selecting database: ${s.message}`,5,!1)}},extractHtml(){if(this.discussionArr&&this.discussionArr.length>0){const t=this.discussionArr[this.discussionArr.length-1].content||"",e="```html",n="```";let r=t.indexOf(e);if(r!==-1){r+=e.length;let i=t.indexOf(n,r);this.lastMessageHtml=i===-1?t.substring(r).trim():t.substring(r,i).trim()}else{const i=t.trim().toLowerCase();i.startsWith("n.name===this.config.binding_name);if(!e){this.$store.state.toast.showToast("No binding selected or found.",4,!1);return}try{this.loading=!0,Ae.post("/get_active_binding_settings",{client_id:this.client_id,binding_name:e.name}).then(n=>{n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,`Configure ${e.name}`,"Save","Cancel").then(r=>{Ae.post("/set_active_binding_settings",{client_id:this.client_id,settings:r}).then(i=>{var s,o;if(!((s=i.data)!=null&&s.status))throw new Error(((o=i.data)==null?void 0:o.error)||"Save failed.");this.$store.state.toast.showToast(`${e.name} settings updated.`,4,!0)}).catch(i=>this.$store.state.toast.showToast(`Error saving settings: ${i.message}`,5,!1))}).catch(()=>{}):this.$store.state.toast.showToast(`${e.name} has no configurable settings.`,3,!0)}).catch(n=>this.$store.state.toast.showToast(`Error getting settings: ${n.message}`,5,!1)).finally(()=>this.loading=!1)}catch(n){this.loading=!1,this.$store.state.toast.showToast(`Error: ${n.message}`,5,!1)}},async setBinding(t){var e,n;if(!(!t||this.config.binding_name===t.name)){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Switching to binding: ${t.name}...`);try{const r=await Ae.post("/update_setting",{client_id:this.client_id,setting_name:"binding_name",setting_value:t.name});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Update failed");this.$store.state.toast.showToast(`Binding set to ${t.name}. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshBindings(),await this.refreshModelsZoo(),await this.refreshModels(),this.$store.state.messageBox.hideMessage()}catch(r){this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error setting binding: ${r.message}`,5,!1)}finally{this.loading=!1}}},async setModel(t){var e,n;if(!(!t||this.config.model_name===t.name)){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Loading model: ${t.name}...`);try{const r=await Ae.post("/update_setting",{client_id:this.client_id,setting_name:"model_name",setting_value:t.name});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Update failed");this.$store.state.toast.showToast(`Model set to ${t.name}.`,4,!0),await this.refreshConfig(),await this.refreshModels(),await this.refreshModelStatus(),this.$store.state.messageBox.hideMessage()}catch(r){this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error setting model: ${r.message}`,5,!1)}finally{this.loading=!1}}},copyModelNameFrom(t){const e=t?`${this.config.binding_name}::${t.name}`:`${this.config.binding_name}::${this.config.model_name}`;navigator.clipboard.writeText(e).then(()=>this.$store.state.toast.showToast(`Copied: ${e}`,3,!0)).catch(n=>this.$store.state.toast.showToast(`Copy failed: ${n.message}`,4,!1))},async onPersonalitySelected(t){var i,s,o;if(!t||!t.full_path)return;const e=this.config.personalities&&this.config.active_personality_id>=0&&this.config.active_personality_idc===n);if(a===-1)throw new Error("Personality path not found in current configuration.");const l=await Ae.post("/select_personality",{client_id:this.client_id,id:a});if(!((i=l.data)!=null&&i.status))throw new Error(((s=l.data)==null?void 0:s.error)||"Selection failed on backend.");this.$store.state.toast.showToast(`Selected ${t.name}. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshMountedPersonalities(),this.load_discussion((o=this.currentDiscussion)==null?void 0:o.id)}catch(a){console.error("Error selecting personality:",a),this.$store.state.toast.showToast(`Error selecting ${t.name}: ${a.message}`,5,!1)}finally{this.loading=!1}},async unmountPersonality(t){var e,n;if(!(!t||!t.full_path)){this.loading=!0,this.$store.state.toast.showToast(`Unmounting ${t.name}...`,3,!0);try{const r=await Ae.post("/unmount_personality",{client_id:this.client_id,language:t.language||"",category:t.category,folder:t.folder});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Unmount failed on backend.");this.$store.state.toast.showToast(`${t.name} unmounted. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshPersonalitiesZoo(),await this.refreshMountedPersonalities(),this.config.active_personality_id===-1&&this.config.personalities.length>0&&this.$store.state.mountedPersArr.length>0?await this.onPersonalitySelected(this.$store.state.mountedPersArr[0]):this.config.personalities.length===0&&(console.warn("No personalities left mounted."),this.$store.state.toast.showToast("Warning: No personalities mounted.",4,!1))}catch(r){console.error("Error unmounting personality:",r),this.$store.state.toast.showToast(`Error unmounting ${t.name}: ${r.message}`,5,!1)}finally{this.loading=!1}}},async remount_personality(t){var e,n;if(!(!t||!t.full_path)){this.loading=!0,this.$store.state.toast.showToast(`Remounting ${t.name}...`,3,!0);try{const r=await Ae.post("/remount_personality",{client_id:this.client_id,category:t.category,folder:t.folder,language:t.language||""});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Remount failed.");this.$store.state.toast.showToast(`${t.name} remounted. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshMountedPersonalities()}catch(r){console.error("Error remounting personality:",r),this.$store.state.toast.showToast(`Error remounting ${t.name}: ${r.message}`,5,!1)}finally{this.loading=!1}}},async handleOnTalk(t){var e,n,r,i;if(!t||!t.full_path||this.isGenerating||!((e=this.currentDiscussion)!=null&&e.id)){this.isGenerating&&this.$store.state.toast.showToast("Please wait.",4,!1),(n=this.currentDiscussion)!=null&&n.id||this.$store.state.toast.showToast("Select discussion.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Asking ${t.name} to talk...`,3,!0);try{const s=this.config.personalities&&this.config.active_personality_id>=0&&this.config.active_personality_idu===o);if(l===-1)throw new Error("Target personality not mounted or path mismatch.");const c=await Ae.post("/select_personality",{client_id:this.client_id,id:l});if(!((r=c.data)!=null&&r.status))throw new Error(((i=c.data)==null?void 0:i.error)||"Failed to select target personality first.");await this.refreshConfig(),await this.refreshMountedPersonalities(),this.$store.state.toast.showToast(`Switched to ${t.name}. Now talking...`,3,!0)}et.emit("generate_msg_from",{id:-1})}catch(s){console.error("Error initiating talk:",s),this.$store.state.toast.showToast(`Error talking with ${t.name}: ${s.message}`,5,!1),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading(this.currentDiscussion.id,!1)}},onPersonalitiesReadyFun(){this.$store.commit("setPersonalitiesReady",!0)},onShowPersListFun(){},socketIOConnected(){var t,e;console.log("Socket connected:",et.id),this.$store.commit("setIsConnected",!0),this.$store.commit("setClientId",et.id),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server reconnected.",3),(t=this.config)!=null&&t.activate_audio_infos&&this.connection_recovered_audio.play(),this.refreshConfig(),this.list_discussions(),(e=this.currentDiscussion)!=null&&e.id&&this.load_discussion(this.currentDiscussion.id)),this.is_first_connection=!1},socketIODisconnected(){var t;console.warn("Socket disconnected."),this.$store.commit("setIsConnected",!1),this.$store.commit("setIsGenerating",!1),this.is_first_connection||(this.$store.state.messageBox.showBlockingMessage("Server disconnected. Attempting to reconnect..."),(t=this.config)!=null&&t.activate_audio_infos&&this.connection_lost_audio.play())},handleConnectError(t){console.error("Socket connection error:",t.message),this.$store.commit("setIsConnected",!1),this.$store.commit("setIsGenerating",!1),this.is_first_connection||this.$store.state.messageBox.showBlockingMessage(`Connection Error: ${t.message}. Please check the server.`)},handleSocketError(t){console.error("Socket general error:",t),this.socketIODisconnected()},handleSocketClose(t){console.warn("Socket connection closed.",t.code,t.reason),this.socketIODisconnected()},handleDiscussionRenamed({discussion_id:t,title:e}){var n;if(t&&e){const r=this.discussionsList.findIndex(i=>i.id===t);r!==-1&&(this.discussionsList[r].title=e),((n=this.currentDiscussion)==null?void 0:n.id)===t&&(this.currentDiscussion.title=e,this.setPageTitle(this.currentDiscussion))}},notify(t){var e;switch(console.log("Notification received:",t),["finished","cancelled","error"].includes(t.status)&&(this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((e=this.currentDiscussion)==null?void 0:e.id,!1),this.scrollToBottomMessages(),this.playChime()),t.display_type){case 0:this.$store.state.toast.showToast(t.content,t.duration||4,t.notification_type!==0);break;case 1:this.$store.state.messageBox.showMessage(t.content);break;case 2:this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(t.content,"Yes","No").then(n=>et.emit("yesNoRes",{yesRes:n,notification_id:t.id})).catch(()=>et.emit("yesNoRes",{yesRes:!1,notification_id:t.id}));break;case 3:this.$store.state.messageBox.showBlockingMessage(t.content);break;case 4:this.$store.state.messageBox.hideMessage();break;default:console.warn("Unknown notification display type:",t.display_type),this.$store.state.toast.showToast(t.content,4,!0)}},show_progress(){this.progress_visibility=!0},hide_progress(){this.progress_visibility=!1,this.progress_value=0},update_progress(t){this.progress_value=t.value||0},async getPersonalityAvatars(){for(;!this.personalities_ready;)await new Promise(t=>setTimeout(t,200));this.personalityAvatars=(this.personalities||[]).map(t=>({name:t.name,avatar:t.avatar}))},autoChangeTitle(t,e){if(!t||!e||e.length===0)return;const n=e.substring(0,50)+(e.length>50?"...":"");this.editTitle({id:t,title:n})},add_webpage(){if(this.$store.state.web_url_input_box)this.$store.state.web_url_input_box.showPanel().then(t=>{t&&t.trim()&&this.sendWebpageAddRequest(t.trim())}).catch(()=>{});else{console.error("web_url_input_box not available");const t=prompt("Enter URL to add:");t&&t.trim()&&this.sendWebpageAddRequest(t.trim())}},async sendWebpageAddRequest(t){var e,n,r;if(!((e=this.currentDiscussion)!=null&&e.id)){this.$store.state.toast.showToast("Select a discussion first.",4,!1);return}try{this.$store.state.toast.showToast(`Adding webpage: ${t}...`,4,!0);const i=await Ae.post("/add_webpage",{client_id:this.client_id,url:t});if((n=i.data)!=null&&n.status)this.$store.state.toast.showToast("Webpage added successfully.",4,!0),this.recoverFiles();else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to add webpage.")}catch(i){console.error("Error adding webpage:",i),this.$store.state.toast.showToast(`Error: ${i.message}`,5,!1)}},handleShortcut(t){t.ctrlKey&&t.key==="d"&&(t.preventDefault(),t.stopPropagation(),this.createNewDiscussion())}},watch:{leftPanelCollapsed(t){localStorage.setItem("lollms_webui_left_panel_collapsed",t)},rightPanelCollapsed(t){localStorage.setItem("lollms_webui_right_panel_collapsed",t)}},created(){const t=localStorage.getItem("lollms_webui_left_panel_collapsed")==="true",e=localStorage.getItem("lollms_webui_right_panel_collapsed")==="true";this.$store.commit("setLeftPanelCollapsed",t),this.$store.commit("setRightPanelCollapsed",e),this.initialLoad()},mounted(){var t;this.$store.commit("setNews",this.$refs.news),this.$store.commit("setPersonalityEditor",this.$refs.personality_editor),window.addEventListener("keydown",this.handleShortcut),Fe(()=>{Re.replace()}),(t=this.config)!=null&&t.show_news_panel&&this.$refs.news&&setTimeout(()=>this.$refs.news.show(),500)},beforeUnmount(){window.removeEventListener("keydown",this.handleShortcut),et.off("connected",this.socketIOConnected),et.off("disconnect",this.socketIODisconnected),et.off("show_progress",this.show_progress),et.off("hide_progress",this.hide_progress),et.off("update_progress",this.update_progress),et.off("notification",this.notify),et.off("new_message",this.handleNewMessage),et.off("update_message",this.handleUpdateMessage),et.off("close_message",this.finalMsgEvent),et.off("discussion_renamed",this.handleDiscussionRenamed),et.off("refresh_files",this.recoverFiles),et.off("connect_error",this.handleConnectError),et.onerror=null,et.onclose=null},updated(){Fe(()=>{Re.replace()})}}),rLr={key:0,class:"flex flex-row h-screen w-screen overflow-hidden"},iLr={role:"status",class:"fixed m-0 p-4 left-4 bottom-4 min-w-[24rem] max-w-[24rem] h-auto flex flex-col justify-center items-center bg-blue-500 dark:bg-blue-700 rounded-lg shadow-lg z-50 text-white"},sLr={class:"text-lg font-semibold animate-pulse"};function oLr(t,e,n,r,i,s){var m;const o=Xe("WelcomeScreen"),a=Xe("LeftPanel"),l=Xe("ChatArea"),c=Xe("RenderPanel"),u=Xe("ChoiceDialog"),d=Xe("ProgressBar"),f=Xe("PersonalityEditor"),h=Xe("PopupViewer"),p=Xe("SkillsLibraryViewer"),T=Xe("ChangelogPopup");return k(),R(Ve,null,[te(o,{"is-ready":t.isReady,"loading-progress":t.loading_progress,"loading-infos":t.loading_infos,"version-info":t.version_info,"interesting-facts":t.interestingFacts},null,8,["is-ready","loading-progress","loading-infos","version-info","interesting-facts"]),t.isReady?(k(),R("div",rLr,[te(a,{"show-left-panel":t.showLeftPanel,"discussions-list":t.discussionsList,"current-discussion":t.currentDiscussion,"toolbar-loading":t.isGenerating,"formatted-database-name":t.formatted_database_name,onSelectDiscussion:t.selectDiscussion,onDeleteDiscussion:t.deleteDiscussion,onOpenFolder:t.openFolder,onEditTitle:t.editTitle,onMakeTitle:t.makeTitle,onCreateNewDiscussion:t.createNewDiscussion,onAddDiscussionToSkillsLibrary:t.addDiscussion2SkillsLibrary,onToggleSkillsLib:t.toggleSkillsLib,onShowSkillsLib:t.showSkillsLib,onResetDatabase:t.resetDB,onExportDatabase:e[0]||(e[0]=O=>t.database_selectorDialogVisible=!0),onImportDiscussions:t.importDiscussions,onImportDiscussionsBundle:t.importDiscussionsBundle,onShowModelConfig:t.showModelConfig,onSetBinding:t.setBinding,onCopyModelName:t.copyModelNameFrom,onSetModel:t.setModel,onPersonalitySelected:t.onPersonalitySelected,onUnmountPersonality:t.unmountPersonality,onRemountPersonality:t.remount_personality,onTalkPersonality:t.handleOnTalk,onPersonalitiesReady:t.onPersonalitiesReadyFun,onShowPersonalityList:t.onShowPersListFun,onDeleteSelected:t.deleteDiscussionMulti,onExportDiscussionsAsJson:t.exportDiscussionsAsJson,onExportDiscussionsToFolder:t.exportDiscussionsToFolder,onExportDiscussionsAsMarkdown:t.exportDiscussionsAsMarkdown,onShowDatabaseSelector:t.showDatabaseSelector,onImportDiscussionFile:t.importDiscussionFile,onToggleStarDiscussion:t.toggleStarDiscussion},null,8,["show-left-panel","discussions-list","current-discussion","toolbar-loading","formatted-database-name","onSelectDiscussion","onDeleteDiscussion","onOpenFolder","onEditTitle","onMakeTitle","onCreateNewDiscussion","onAddDiscussionToSkillsLibrary","onToggleSkillsLib","onShowSkillsLib","onResetDatabase","onImportDiscussions","onImportDiscussionsBundle","onShowModelConfig","onSetBinding","onCopyModelName","onSetModel","onPersonalitySelected","onUnmountPersonality","onRemountPersonality","onTalkPersonality","onPersonalitiesReady","onShowPersonalityList","onDeleteSelected","onExportDiscussionsAsJson","onExportDiscussionsToFolder","onExportDiscussionsAsMarkdown","onShowDatabaseSelector","onImportDiscussionFile","onToggleStarDiscussion"]),te(l,{ref:"chatArea","is-ready":t.isReady,"has-active-discussion":!!((m=t.currentDiscussion)!=null&&m.id),"discussion-arr":t.discussionArr,"is-generating":t.isGenerating,host:t.host,"personality-avatars":t.personalityAvatars,onCopyMessage:t.copyToClipBoard,onDeleteMessage:t.deleteMessage,onRankUp:t.rankUpMessage,onRankDown:t.rankDownMessage,onUpdateMessage:t.updateMessage,onResendMessage:t.resendMessage,onContinueMessage:t.continueMessage,onSendMessage:t.sendMsg,onSendCmd:t.sendCmd,onAddWebLink:t.add_webpage,onCreateEmptyUserMessage:t.createEmptyUserMessage,onCreateEmptyAiMessage:t.createEmptyAIMessage,onStopGenerating:t.stopGenerating,onRecoverFiles:t.recoverFiles,onTalkPersonality:t.handleOnTalk,onFilesDropped:t.handleChatFilesDropped},null,8,["is-ready","has-active-discussion","discussion-arr","is-generating","host","personality-avatars","onCopyMessage","onDeleteMessage","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","onSendMessage","onSendCmd","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAiMessage","onStopGenerating","onRecoverFiles","onTalkPersonality","onFilesDropped"]),te(c,{"show-right-panel":t.showRightPanel,"html-content":t.lastMessageHtml},null,8,["show-right-panel","html-content"])])):ne("",!0),te(u,{reference:"database_selector",class:"z-20",show:t.database_selectorDialogVisible,choices:t.databases,"can-remove":!0,onChoiceRemoved:t.ondatabase_selectorDialogRemoved,onChoiceSelected:t.ondatabase_selectorDialogSelected,onCloseDialog:t.onclosedatabase_selectorDialog,onChoiceValidated:t.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),He(b("div",iLr,[te(d,{ref:"progress",progress:t.progress_value,class:"w-full h-3 mb-2"},null,8,["progress"]),b("p",sLr,ae(t.loading_infos)+" ...",1)],512),[[mr,t.progress_visibility]]),te(f,{ref:"personality_editor",config:t.currentPersonConfig,personality:t.selectedPersonality},null,8,["config","personality"]),te(h,{ref:"news"},null,512),te(p,{ref:"skills_lib"},null,512),te(T)],64)}const aLr=st(nLr,[["render",oLr]]);let Z8;const lLr=new Uint8Array(16);function cLr(){if(!Z8&&(Z8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Z8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z8(lLr)}const hi=[];for(let t=0;t<256;++t)hi.push((t+256).toString(16).slice(1));function uLr(t,e=0){return hi[t[e+0]]+hi[t[e+1]]+hi[t[e+2]]+hi[t[e+3]]+"-"+hi[t[e+4]]+hi[t[e+5]]+"-"+hi[t[e+6]]+hi[t[e+7]]+"-"+hi[t[e+8]]+hi[t[e+9]]+"-"+hi[t[e+10]]+hi[t[e+11]]+hi[t[e+12]]+hi[t[e+13]]+hi[t[e+14]]+hi[t[e+15]]}const dLr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bY={randomUUID:dLr};function S2(t,e,n){if(bY.randomUUID&&!t)return bY.randomUUID();t=t||{};const r=t.random||(t.rng||cLr)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,uLr(r)}class x4{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,n){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you.
+${e}`),navigator.clipboard.writeText(n).then(()=>this.$store.state.toast.showToast("Copied to clipboard.",3,!0)).catch(i=>{console.error("Clipboard copy failed:",i),this.$store.state.toast.showToast("Failed to copy.",4,!1)})},playChime(){this.chime.play().catch(t=>console.debug("Chime play interrupted or failed:",t))},async recoverFiles(){var t,e;if((t=this.currentDiscussion)!=null&&t.id)try{const n=await Ae.post("/get_discussion_files_list",{client_id:this.client_id}),r=(e=this.$refs.chatArea)==null?void 0:e.$refs.chatBox;n.data&&r&&(r.filesList=n.data.files||[],r.isFileSentList=(n.data.files||[]).map(()=>!0))}catch(n){console.error("Error recovering files:",n),this.$store.state.toast.showToast("Could not load discussion files.",4,!1)}},handleChatFilesDropped(t){var e;(e=this.$refs.chatArea)!=null&&e.$refs.chatBox&&this.$refs.chatArea.$refs.chatBox.handleFiles(t)},importDiscussionFile(t){if(!t||t.type!=="application/json"){this.$store.state.toast.showToast("Please drop a valid JSON discussion file.",4,!1);return}this.parseAndImportDiscussions(t)},async parseAndImportDiscussions(t){var e,n;try{this.$store.state.toast.showToast("Importing discussion(s)...",3,!0);const r=await this.readFileAsJson(t),i=Array.isArray(r)?r:[r];if(i.length===0)throw new Error("JSON file contains no discussion data.");const s=await Ae.post("/import_multiple_discussions",{client_id:this.client_id,jArray:i});if((e=s.data)!=null&&e.status)this.$store.state.toast.showToast(`Successfully imported ${i.length} discussion(s).`,4,!0),await this.list_discussions();else throw new Error(((n=s.data)==null?void 0:n.error)||"Import failed on backend.")}catch(r){console.error("Error importing discussions:",r),this.$store.state.toast.showToast(`Import failed: ${r.message}`,5,!1)}},readFileAsJson(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{try{e(JSON.parse(i.target.result))}catch{n(new Error("Failed to parse JSON file."))}},r.onerror=i=>n(new Error("Failed to read file.")),r.readAsText(t)})},importDiscussions(t){const e=t.target.files[0];e&&this.parseAndImportDiscussions(e),t.target.value=null},importDiscussionsBundle(t){console.warn("Discussion bundle import not implemented yet."),this.$store.state.toast.showToast("Bundle import not yet available.",4,!1),t.target.value=null},async exportDiscussionsAsFormat(t,e){var n,r;if(!Array.isArray(e)||e.length===0){this.$store.state.toast.showToast("No discussions selected for export.",4,!1);return}try{this.$store.state.toast.showToast(`Exporting ${e.length} discussions as ${t}...`,4,!0),this.loading=!0;const i=await Ae.post("/export_multiple_discussions",{client_id:this.client_id,discussion_ids:e,export_format:t},{responseType:t==="json"?"json":"blob"});if(i.data){const s=`discussions_export_${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`,o=t==="json"?new Blob([JSON.stringify(i.data,null,2)],{type:"application/json"}):new Blob([i.data],{type:"text/plain"}),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download=s,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a),this.$store.state.toast.showToast("Export successful.",4,!0)}else throw new Error("Backend returned no data for export.")}catch(i){console.error(`Error exporting discussions as ${t}:`,i),this.$store.state.toast.showToast(`Export failed: ${((r=(n=i.response)==null?void 0:n.data)==null?void 0:r.error)||i.message}`,5,!1)}finally{this.loading=!1}},exportDiscussionsAsJson(t){this.exportDiscussionsAsFormat("json",t.map(e=>e.id))},exportDiscussionsAsMarkdown(t){this.exportDiscussionsAsFormat("markdown",t.map(e=>e.id))},exportDiscussionsToFolder(t){console.warn("Export to folder not implemented yet."),this.$store.state.toast.showToast("Export to folder is not yet available.",4,!1)},showDatabaseSelector(){this.database_selectorDialogVisible=!0},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async ondatabase_selectorDialogRemoved(t){console.log("Database removal not implemented on backend:",t)},async ondatabase_selectorDialogSelected(t){},async onvalidatedatabase_selectorChoice(t){var n,r,i;this.database_selectorDialogVisible=!1;const e=typeof t=="string"?t:t.name;if(e===((n=this.config)==null?void 0:n.discussion_db_name)){this.$store.state.toast.showToast("Database already selected.",3,!0);return}try{this.$store.state.toast.showToast(`Selecting database: ${e}...`,4,!0);const s=await Ae.post("/select_database",{client_id:this.client_id,name:e});if((r=s.data)!=null&&r.status)this.$store.state.toast.showToast("Database changed. Reloading...",5,!0),setTimeout(()=>window.location.reload(),1500);else throw new Error(((i=s.data)==null?void 0:i.error)||"Failed to select database.")}catch(s){console.error("Error selecting database:",s),this.$store.state.toast.showToast(`Error selecting database: ${s.message}`,5,!1)}},extractHtml(){if(this.discussionArr&&this.discussionArr.length>0){const t=this.discussionArr[this.discussionArr.length-1].content||"",e="```html",n="```";let r=t.indexOf(e);if(r!==-1){r+=e.length;let i=t.indexOf(n,r);this.lastMessageHtml=i===-1?t.substring(r).trim():t.substring(r,i).trim()}else{const i=t.trim().toLowerCase();i.startsWith("n.name===this.config.binding_name);if(!e){this.$store.state.toast.showToast("No binding selected or found.",4,!1);return}try{this.loading=!0,Ae.post("/get_active_binding_settings",{client_id:this.client_id,binding_name:e.name}).then(n=>{n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,`Configure ${e.name}`,"Save","Cancel").then(r=>{Ae.post("/set_active_binding_settings",{client_id:this.client_id,settings:r}).then(i=>{var s,o;if(!((s=i.data)!=null&&s.status))throw new Error(((o=i.data)==null?void 0:o.error)||"Save failed.");this.$store.state.toast.showToast(`${e.name} settings updated.`,4,!0)}).catch(i=>this.$store.state.toast.showToast(`Error saving settings: ${i.message}`,5,!1))}).catch(()=>{}):this.$store.state.toast.showToast(`${e.name} has no configurable settings.`,3,!0)}).catch(n=>this.$store.state.toast.showToast(`Error getting settings: ${n.message}`,5,!1)).finally(()=>this.loading=!1)}catch(n){this.loading=!1,this.$store.state.toast.showToast(`Error: ${n.message}`,5,!1)}},async setBinding(t){var e,n;if(!(!t||this.config.binding_name===t.name)){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Switching to binding: ${t.name}...`);try{const r=await Ae.post("/update_setting",{client_id:this.client_id,setting_name:"binding_name",setting_value:t.name});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Update failed");this.$store.state.toast.showToast(`Binding set to ${t.name}. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshBindings(),await this.refreshModelsZoo(),await this.refreshModels(),this.$store.state.messageBox.hideMessage()}catch(r){this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error setting binding: ${r.message}`,5,!1)}finally{this.loading=!1}}},async setModel(t){var e,n;if(!(!t||this.config.model_name===t.name)){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Loading model: ${t.name}...`);try{const r=await Ae.post("/update_setting",{client_id:this.client_id,setting_name:"model_name",setting_value:t.name});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Update failed");this.$store.state.toast.showToast(`Model set to ${t.name}.`,4,!0),await this.refreshConfig(),await this.refreshModels(),await this.refreshModelStatus(),this.$store.state.messageBox.hideMessage()}catch(r){this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error setting model: ${r.message}`,5,!1)}finally{this.loading=!1}}},copyModelNameFrom(t){const e=t?`${this.config.binding_name}::${t.name}`:`${this.config.binding_name}::${this.config.model_name}`;navigator.clipboard.writeText(e).then(()=>this.$store.state.toast.showToast(`Copied: ${e}`,3,!0)).catch(n=>this.$store.state.toast.showToast(`Copy failed: ${n.message}`,4,!1))},async onPersonalitySelected(t){var i,s,o;if(!t||!t.full_path)return;const e=this.config.personalities&&this.config.active_personality_id>=0&&this.config.active_personality_idc===n);if(a===-1)throw new Error("Personality path not found in current configuration.");const l=await Ae.post("/select_personality",{client_id:this.client_id,id:a});if(!((i=l.data)!=null&&i.status))throw new Error(((s=l.data)==null?void 0:s.error)||"Selection failed on backend.");this.$store.state.toast.showToast(`Selected ${t.name}. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshMountedPersonalities(),this.load_discussion((o=this.currentDiscussion)==null?void 0:o.id)}catch(a){console.error("Error selecting personality:",a),this.$store.state.toast.showToast(`Error selecting ${t.name}: ${a.message}`,5,!1)}finally{this.loading=!1}},async unmountPersonality(t){var e,n;if(!(!t||!t.full_path)){this.loading=!0,this.$store.state.toast.showToast(`Unmounting ${t.name}...`,3,!0);try{const r=await Ae.post("/unmount_personality",{client_id:this.client_id,language:t.language||"",category:t.category,folder:t.folder});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Unmount failed on backend.");this.$store.state.toast.showToast(`${t.name} unmounted. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshPersonalitiesZoo(),await this.refreshMountedPersonalities(),this.config.active_personality_id===-1&&this.config.personalities.length>0&&this.$store.state.mountedPersArr.length>0?await this.onPersonalitySelected(this.$store.state.mountedPersArr[0]):this.config.personalities.length===0&&(console.warn("No personalities left mounted."),this.$store.state.toast.showToast("Warning: No personalities mounted.",4,!1))}catch(r){console.error("Error unmounting personality:",r),this.$store.state.toast.showToast(`Error unmounting ${t.name}: ${r.message}`,5,!1)}finally{this.loading=!1}}},async remount_personality(t){var e,n;if(!(!t||!t.full_path)){this.loading=!0,this.$store.state.toast.showToast(`Remounting ${t.name}...`,3,!0);try{const r=await Ae.post("/remount_personality",{client_id:this.client_id,category:t.category,folder:t.folder,language:t.language||""});if(!((e=r.data)!=null&&e.status))throw new Error(((n=r.data)==null?void 0:n.error)||"Remount failed.");this.$store.state.toast.showToast(`${t.name} remounted. Refreshing...`,4,!0),await this.refreshConfig(),await this.refreshMountedPersonalities()}catch(r){console.error("Error remounting personality:",r),this.$store.state.toast.showToast(`Error remounting ${t.name}: ${r.message}`,5,!1)}finally{this.loading=!1}}},async handleOnTalk(t){var e,n,r,i;if(!t||!t.full_path||this.isGenerating||!((e=this.currentDiscussion)!=null&&e.id)){this.isGenerating&&this.$store.state.toast.showToast("Please wait.",4,!1),(n=this.currentDiscussion)!=null&&n.id||this.$store.state.toast.showToast("Select discussion.",4,!1);return}this.$store.commit("setIsGenerating",!0),this.setDiscussionLoading(this.currentDiscussion.id,!0),this.$store.state.toast.showToast(`Asking ${t.name} to talk...`,3,!0);try{const s=this.config.personalities&&this.config.active_personality_id>=0&&this.config.active_personality_idu===o);if(l===-1)throw new Error("Target personality not mounted or path mismatch.");const c=await Ae.post("/select_personality",{client_id:this.client_id,id:l});if(!((r=c.data)!=null&&r.status))throw new Error(((i=c.data)==null?void 0:i.error)||"Failed to select target personality first.");await this.refreshConfig(),await this.refreshMountedPersonalities(),this.$store.state.toast.showToast(`Switched to ${t.name}. Now talking...`,3,!0)}et.emit("generate_msg_from",{id:-1})}catch(s){console.error("Error initiating talk:",s),this.$store.state.toast.showToast(`Error talking with ${t.name}: ${s.message}`,5,!1),this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading(this.currentDiscussion.id,!1)}},onPersonalitiesReadyFun(){this.$store.commit("setPersonalitiesReady",!0)},onShowPersListFun(){},socketIOConnected(){var t,e;console.log("Socket connected:",et.id),this.$store.commit("setIsConnected",!0),this.$store.commit("setClientId",et.id),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server reconnected.",3),(t=this.config)!=null&&t.activate_audio_infos&&this.connection_recovered_audio.play(),this.refreshConfig(),this.list_discussions(),(e=this.currentDiscussion)!=null&&e.id&&this.load_discussion(this.currentDiscussion.id)),this.is_first_connection=!1},socketIODisconnected(){var t;console.warn("Socket disconnected."),this.$store.commit("setIsConnected",!1),this.$store.commit("setIsGenerating",!1),this.is_first_connection||(this.$store.state.messageBox.showBlockingMessage("Server disconnected. Attempting to reconnect..."),(t=this.config)!=null&&t.activate_audio_infos&&this.connection_lost_audio.play())},handleConnectError(t){console.error("Socket connection error:",t.message),this.$store.commit("setIsConnected",!1),this.$store.commit("setIsGenerating",!1),this.is_first_connection||this.$store.state.messageBox.showBlockingMessage(`Connection Error: ${t.message}. Please check the server.`)},handleSocketError(t){console.error("Socket general error:",t),this.socketIODisconnected()},handleSocketClose(t){console.warn("Socket connection closed.",t.code,t.reason),this.socketIODisconnected()},handleDiscussionRenamed({discussion_id:t,title:e}){var n;if(t&&e){const r=this.discussionsList.findIndex(i=>i.id===t);r!==-1&&(this.discussionsList[r].title=e),((n=this.currentDiscussion)==null?void 0:n.id)===t&&(this.currentDiscussion.title=e,this.setPageTitle(this.currentDiscussion))}},notify(t){var e;switch(console.log("Notification received:",t),["finished","cancelled","error"].includes(t.status)&&(this.$store.commit("setIsGenerating",!1),this.setDiscussionLoading((e=this.currentDiscussion)==null?void 0:e.id,!1),this.scrollToBottomMessages(),this.playChime()),t.display_type){case 0:this.$store.state.toast.showToast(t.content,t.duration||4,t.notification_type!==0);break;case 1:this.$store.state.messageBox.showMessage(t.content);break;case 2:this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(t.content,"Yes","No").then(n=>et.emit("yesNoRes",{yesRes:n,notification_id:t.id})).catch(()=>et.emit("yesNoRes",{yesRes:!1,notification_id:t.id}));break;case 3:this.$store.state.messageBox.showBlockingMessage(t.content);break;case 4:this.$store.state.messageBox.hideMessage();break;default:console.warn("Unknown notification display type:",t.display_type),this.$store.state.toast.showToast(t.content,4,!0)}},show_progress(){this.progress_visibility=!0},hide_progress(){this.progress_visibility=!1,this.progress_value=0},update_progress(t){this.progress_value=t.value||0},async getPersonalityAvatars(){for(;!this.personalities_ready;)await new Promise(t=>setTimeout(t,200));this.personalityAvatars=(this.personalities||[]).map(t=>({name:t.name,avatar:t.avatar}))},autoChangeTitle(t,e){if(!t||!e||e.length===0)return;const n=e.substring(0,50)+(e.length>50?"...":"");this.editTitle({id:t,title:n})},add_webpage(){if(this.$store.state.web_url_input_box)this.$store.state.web_url_input_box.showPanel().then(t=>{t&&t.trim()&&this.sendWebpageAddRequest(t.trim())}).catch(()=>{});else{console.error("web_url_input_box not available");const t=prompt("Enter URL to add:");t&&t.trim()&&this.sendWebpageAddRequest(t.trim())}},async sendWebpageAddRequest(t){var e,n,r;if(!((e=this.currentDiscussion)!=null&&e.id)){this.$store.state.toast.showToast("Select a discussion first.",4,!1);return}try{this.$store.state.toast.showToast(`Adding webpage: ${t}...`,4,!0);const i=await Ae.post("/add_webpage",{client_id:this.client_id,url:t});if((n=i.data)!=null&&n.status)this.$store.state.toast.showToast("Webpage added successfully.",4,!0),this.recoverFiles();else throw new Error(((r=i.data)==null?void 0:r.error)||"Failed to add webpage.")}catch(i){console.error("Error adding webpage:",i),this.$store.state.toast.showToast(`Error: ${i.message}`,5,!1)}},handleShortcut(t){t.ctrlKey&&t.key==="d"&&(t.preventDefault(),t.stopPropagation(),this.createNewDiscussion())}},watch:{leftPanelCollapsed(t){localStorage.setItem("lollms_webui_left_panel_collapsed",t)},rightPanelCollapsed(t){localStorage.setItem("lollms_webui_right_panel_collapsed",t)}},created(){const t=localStorage.getItem("lollms_webui_left_panel_collapsed")==="true",e=localStorage.getItem("lollms_webui_right_panel_collapsed")==="true";this.$store.commit("setLeftPanelCollapsed",t),this.$store.commit("setRightPanelCollapsed",e),this.initialLoad()},mounted(){var t;this.$store.commit("setNews",this.$refs.news),this.$store.commit("setPersonalityEditor",this.$refs.personality_editor),window.addEventListener("keydown",this.handleShortcut),Fe(()=>{Re.replace()}),(t=this.config)!=null&&t.show_news_panel&&this.$refs.news&&setTimeout(()=>this.$refs.news.show(),500)},beforeUnmount(){window.removeEventListener("keydown",this.handleShortcut),et.off("connected",this.socketIOConnected),et.off("disconnect",this.socketIODisconnected),et.off("show_progress",this.show_progress),et.off("hide_progress",this.hide_progress),et.off("update_progress",this.update_progress),et.off("notification",this.notify),et.off("new_message",this.handleNewMessage),et.off("update_message",this.handleUpdateMessage),et.off("close_message",this.finalMsgEvent),et.off("discussion_renamed",this.handleDiscussionRenamed),et.off("refresh_files",this.recoverFiles),et.off("connect_error",this.handleConnectError),et.onerror=null,et.onclose=null},updated(){Fe(()=>{Re.replace()})}}),iLr={key:0,class:"flex flex-row h-screen w-screen overflow-hidden"},sLr={role:"status",class:"fixed m-0 p-4 left-4 bottom-4 min-w-[24rem] max-w-[24rem] h-auto flex flex-col justify-center items-center bg-blue-500 dark:bg-blue-700 rounded-lg shadow-lg z-50 text-white"},oLr={class:"text-lg font-semibold animate-pulse"};function aLr(t,e,n,r,i,s){var m;const o=Xe("WelcomeScreen"),a=Xe("LeftPanel"),l=Xe("ChatArea"),c=Xe("RenderPanel"),u=Xe("ChoiceDialog"),d=Xe("ProgressBar"),f=Xe("PersonalityEditor"),h=Xe("PopupViewer"),p=Xe("SkillsLibraryViewer"),T=Xe("ChangelogPopup");return k(),R(Ve,null,[te(o,{"is-ready":t.isReady,"loading-progress":t.loading_progress,"loading-infos":t.loading_infos,"version-info":t.version_info,"interesting-facts":t.interestingFacts},null,8,["is-ready","loading-progress","loading-infos","version-info","interesting-facts"]),t.isReady?(k(),R("div",iLr,[te(a,{"show-left-panel":t.showLeftPanel,"discussions-list":t.discussionsList,"current-discussion":t.currentDiscussion,"toolbar-loading":t.isGenerating,"formatted-database-name":t.formatted_database_name,onSelectDiscussion:t.selectDiscussion,onDeleteDiscussion:t.deleteDiscussion,onOpenFolder:t.openFolder,onEditTitle:t.editTitle,onMakeTitle:t.makeTitle,onCreateNewDiscussion:t.createNewDiscussion,onAddDiscussionToSkillsLibrary:t.addDiscussion2SkillsLibrary,onToggleSkillsLib:t.toggleSkillsLib,onShowSkillsLib:t.showSkillsLib,onResetDatabase:t.resetDB,onExportDatabase:e[0]||(e[0]=O=>t.database_selectorDialogVisible=!0),onImportDiscussions:t.importDiscussions,onImportDiscussionsBundle:t.importDiscussionsBundle,onShowModelConfig:t.showModelConfig,onSetBinding:t.setBinding,onCopyModelName:t.copyModelNameFrom,onSetModel:t.setModel,onPersonalitySelected:t.onPersonalitySelected,onUnmountPersonality:t.unmountPersonality,onRemountPersonality:t.remount_personality,onTalkPersonality:t.handleOnTalk,onPersonalitiesReady:t.onPersonalitiesReadyFun,onShowPersonalityList:t.onShowPersListFun,onDeleteSelected:t.deleteDiscussionMulti,onExportDiscussionsAsJson:t.exportDiscussionsAsJson,onExportDiscussionsToFolder:t.exportDiscussionsToFolder,onExportDiscussionsAsMarkdown:t.exportDiscussionsAsMarkdown,onShowDatabaseSelector:t.showDatabaseSelector,onImportDiscussionFile:t.importDiscussionFile,onToggleStarDiscussion:t.toggleStarDiscussion},null,8,["show-left-panel","discussions-list","current-discussion","toolbar-loading","formatted-database-name","onSelectDiscussion","onDeleteDiscussion","onOpenFolder","onEditTitle","onMakeTitle","onCreateNewDiscussion","onAddDiscussionToSkillsLibrary","onToggleSkillsLib","onShowSkillsLib","onResetDatabase","onImportDiscussions","onImportDiscussionsBundle","onShowModelConfig","onSetBinding","onCopyModelName","onSetModel","onPersonalitySelected","onUnmountPersonality","onRemountPersonality","onTalkPersonality","onPersonalitiesReady","onShowPersonalityList","onDeleteSelected","onExportDiscussionsAsJson","onExportDiscussionsToFolder","onExportDiscussionsAsMarkdown","onShowDatabaseSelector","onImportDiscussionFile","onToggleStarDiscussion"]),te(l,{ref:"chatArea","is-ready":t.isReady,"has-active-discussion":!!((m=t.currentDiscussion)!=null&&m.id),"discussion-arr":t.discussionArr,"is-generating":t.isGenerating,host:t.host,"personality-avatars":t.personalityAvatars,onCopyMessage:t.copyToClipBoard,onDeleteMessage:t.deleteMessage,onRankUp:t.rankUpMessage,onRankDown:t.rankDownMessage,onUpdateMessage:t.updateMessage,onResendMessage:t.resendMessage,onContinueMessage:t.continueMessage,onSendMessage:t.sendMsg,onSendCmd:t.sendCmd,onAddWebLink:t.add_webpage,onCreateEmptyUserMessage:t.createEmptyUserMessage,onCreateEmptyAiMessage:t.createEmptyAIMessage,onStopGenerating:t.stopGenerating,onRecoverFiles:t.recoverFiles,onTalkPersonality:t.handleOnTalk,onFilesDropped:t.handleChatFilesDropped},null,8,["is-ready","has-active-discussion","discussion-arr","is-generating","host","personality-avatars","onCopyMessage","onDeleteMessage","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","onSendMessage","onSendCmd","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAiMessage","onStopGenerating","onRecoverFiles","onTalkPersonality","onFilesDropped"]),te(c,{"show-right-panel":t.showRightPanel,"html-content":t.lastMessageHtml},null,8,["show-right-panel","html-content"])])):ne("",!0),te(u,{reference:"database_selector",class:"z-20",show:t.database_selectorDialogVisible,choices:t.databases,"can-remove":!0,onChoiceRemoved:t.ondatabase_selectorDialogRemoved,onChoiceSelected:t.ondatabase_selectorDialogSelected,onCloseDialog:t.onclosedatabase_selectorDialog,onChoiceValidated:t.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),He(b("div",sLr,[te(d,{ref:"progress",progress:t.progress_value,class:"w-full h-3 mb-2"},null,8,["progress"]),b("p",oLr,ae(t.loading_infos)+" ...",1)],512),[[mr,t.progress_visibility]]),te(f,{ref:"personality_editor",config:t.currentPersonConfig,personality:t.selectedPersonality},null,8,["config","personality"]),te(h,{ref:"news"},null,512),te(p,{ref:"skills_lib"},null,512),te(T)],64)}const lLr=st(rLr,[["render",aLr]]);let Z8;const cLr=new Uint8Array(16);function uLr(){if(!Z8&&(Z8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Z8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z8(cLr)}const hi=[];for(let t=0;t<256;++t)hi.push((t+256).toString(16).slice(1));function dLr(t,e=0){return hi[t[e+0]]+hi[t[e+1]]+hi[t[e+2]]+hi[t[e+3]]+"-"+hi[t[e+4]]+hi[t[e+5]]+"-"+hi[t[e+6]]+hi[t[e+7]]+"-"+hi[t[e+8]]+hi[t[e+9]]+"-"+hi[t[e+10]]+hi[t[e+11]]+hi[t[e+12]]+hi[t[e+13]]+hi[t[e+14]]+hi[t[e+15]]}const fLr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bY={randomUUID:fLr};function S2(t,e,n){if(bY.randomUUID&&!t)return bY.randomUUID();t=t||{};const r=t.random||(t.rng||uLr)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dLr(r)}class x4{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,n){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you.
Please check that you don't accidentally use the same token twice to register two different handlers for the same event/hook.`),this.unsubscribe(e)),this.listenerMap.set(e,n),this._listeners.push(n)}unsubscribe(e){if(this.listenerMap.has(e)){const n=this.listenerMap.get(e);this.listenerMap.delete(e);const r=this._listeners.indexOf(n);r>=0&&this._listeners.splice(r,1)}}registerProxy(e,n){this.proxyMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you.
-Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,n),this.proxies.push(n)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const n=this.proxyMap.get(e);this.proxyMap.delete(e);const r=this.proxies.indexOf(n);r>=0&&this.proxies.splice(r,1)}}class Vn extends x4{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(n=>n(e,this.entity))}}class Mi extends x4{constructor(e){super(),this.entity=e}emit(e){let n=!1;const r=()=>[n=!0];for(const i of Array.from(this.listeners.values()))if(i(e,r,this.entity),n)return{prevented:!0};return{prevented:!1}}}class iae extends x4{execute(e,n){let r=e;for(const i of this.listeners)r=i(r,n);return r}}class wo extends iae{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class fLr extends x4{constructor(e){super(),this.entity=e}execute(e){const n=[];for(const r of this.listeners)n.push(r(e,this.entity));return n}}function S1(){const t=Symbol(),e=new Map,n=new Set,r=(l,c)=>{c instanceof x4&&c.registerProxy(t,()=>{var u,d;return(d=(u=e.get(l))===null||u===void 0?void 0:u.listeners)!==null&&d!==void 0?d:[]})},i=l=>{const c=new x4;e.set(l,c),n.forEach(u=>r(l,u[l]))},s=l=>{n.add(l);for(const c of e.keys())r(c,l[c])},o=l=>{for(const c of e.keys())l[c]instanceof x4&&l[c].unregisterProxy(t);n.delete(l)},a=()=>{n.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,c){return c==="addTarget"?s:c==="removeTarget"?o:c==="destroy"?a:typeof c!="string"||c.startsWith("_")?l[c]:(e.has(c)||i(c),e.get(c))}})}class SY{constructor(e,n){if(this.destructed=!1,this.events={destruct:new Vn(this)},!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=S2(),this.from=e,this.to=n,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class sae{constructor(e,n){if(!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=S2(),this.from=e,this.to=n}}function Cx(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e(r)]))}class oae{constructor(){this._title="",this.id=S2(),this.events={loaded:new Vn(this),beforeAddInput:new Mi(this),addInput:new Vn(this),beforeRemoveInput:new Mi(this),removeInput:new Vn(this),beforeAddOutput:new Mi(this),addOutput:new Vn(this),beforeRemoveOutput:new Mi(this),removeOutput:new Vn(this),beforeTitleChanged:new Mi(this),titleChanged:new Vn(this),update:new Vn(this)},this.hooks={beforeLoad:new wo(this),afterSave:new wo(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,n){return this.addInterface("input",e,n)}addOutput(e,n){return this.addInterface("output",e,n)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([n,r])=>{this.inputs[n]&&(this.inputs[n].load(r),this.inputs[n].nodeId=this.id)}),Object.entries(e.outputs).forEach(([n,r])=>{this.outputs[n]&&(this.outputs[n].load(r),this.outputs[n].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Cx(this.inputs,i=>i.save()),n=Cx(this.outputs,i=>i.save()),r={type:this.type,id:this.id,title:this.title,inputs:e,outputs:n};return this.hooks.afterSave.execute(r)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,n])=>this.initializeIntf("input",e,n)),Object.entries(this.outputs).forEach(([e,n])=>this.initializeIntf("output",e,n))}initializeIntf(e,n,r){r.isInput=e==="input",r.nodeId=this.id,r.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:n,intf:r}))}addInterface(e,n,r){const i=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,s=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return i.emit(r).prevented?!1:(o[n]=r,this.initializeIntf(e,n,r),s.emit(r),!0)}removeInterface(e,n){const r=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,i=e==="input"?this.events.removeInput:this.events.removeOutput,s=e==="input"?this.inputs[n]:this.outputs[n];if(!s||r.emit(s).prevented)return!1;if(s.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===s||a.to===s).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return s.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[n]:delete this.outputs[n],i.emit(s),!0}}let aae=class extends oae{load(e){super.load(e)}save(){return super.save()}};function Yu(t){return class extends aae{constructor(){var e,n;super(),this.type=t.type,this.inputs={},this.outputs={},this.calculate=t.calculate?(r,i)=>t.calculate.call(this,r,i):void 0,this._title=(e=t.title)!==null&&e!==void 0?e:t.type,this.executeFactory("input",t.inputs),this.executeFactory("output",t.outputs),(n=t.onCreate)===null||n===void 0||n.call(this)}onPlaced(){var e;(e=t.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=t.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,n){Object.keys(n||{}).forEach(r=>{const i=n[r]();e==="input"?this.addInput(r,i):this.addOutput(r,i)})}}}class _r{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,n){this.id=S2(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vn(this),beforeSetValue:new Mi(this),setValue:new Vn(this),updated:new Vn(this)},this.hooks={load:new wo(this),save:new wo(this)},this._connectionCount=0,this.name=e,this._value=n}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...n){return e(this,...n),this}}const xu="__baklava_SubgraphInputNode",Eu="__baklava_SubgraphOutputNode";class lae extends aae{constructor(){super(),this.graphInterfaceId=S2()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class cL extends lae{constructor(){super(...arguments),this.type=xu,this.inputs={name:new _r("Name","Input")},this.outputs={placeholder:new _r("Value",void 0)}}static isGraphInputNode(e){return e.type===xu}}class uL extends lae{constructor(){super(...arguments),this.type=Eu,this.inputs={name:new _r("Name","Output"),placeholder:new _r("Value",void 0)},this.outputs={output:new _r("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Eu}}class R7{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(n=>n.type===xu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===Eu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=S2(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Mi(this),addNode:new Vn(this),beforeRemoveNode:new Mi(this),removeNode:new Vn(this),beforeAddConnection:new Mi(this),addConnection:new Vn(this),checkConnection:new Mi(this),beforeRemoveConnection:new Mi(this),removeConnection:new Vn(this)},this.hooks={save:new wo(this),load:new wo(this),checkConnection:new fLr(this)},this.nodeEvents=S1(),this.nodeHooks=S1(),this.connectionEvents=S1(),this.editor=e,this.template=n,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(n=>n.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const n=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(r=>n.includes(r.from)||n.includes(r.to)).forEach(r=>this.removeConnection(r)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,n){const r=this.checkConnection(e,n);if(!r.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:n}).prevented)return;for(const s of r.connectionsInDanger){const o=this.connections.find(a=>a.id===s.id);o&&this.removeConnection(o)}const i=new SY(r.dummyConnection.from,r.dummyConnection.to);return this.internalAddConnection(i),i}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,n){if(!e||!n)return{connectionAllowed:!1};const r=this.findNodeById(e.nodeId),i=this.findNodeById(n.nodeId);if(r&&i&&r===i)return{connectionAllowed:!1};if(e.isInput&&!n.isInput){const a=e;e=n,n=a}if(e.isInput||!n.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===n))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:n}).prevented)return{connectionAllowed:!1};const s=this.hooks.checkConnection.execute({from:e,to:n});if(s.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(s.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new sae(e,n),connectionsInDanger:o}}findNodeInterface(e){for(const n of this.nodes){for(const r in n.inputs){const i=n.inputs[r];if(i.id===e)return i}for(const r in n.outputs){const i=n.outputs[r];if(i.id===e)return i}}}findNodeById(e){return this.nodes.find(n=>n.id===e)}load(e){try{this._loading=!0;const n=[];for(let r=this.connections.length-1;r>=0;r--)this.removeConnection(this.connections[r]);for(let r=this.nodes.length-1;r>=0;r--)this.removeNode(this.nodes[r]);this.id=e.id;for(const r of e.nodes){const i=this.editor.nodeTypes.get(r.type);if(!i){n.push(`Node type ${r.type} is not registered`);continue}const s=new i.type;this.addNode(s),s.load(r)}for(const r of e.connections){const i=this.findNodeInterface(r.from),s=this.findNodeInterface(r.to);if(i)if(s){const o=new SY(i,s);o.id=r.id,this.internalAddConnection(o)}else{n.push(`Could not find interface with id ${r.to}`);continue}else{n.push(`Could not find interface with id ${r.from}`);continue}}return this.hooks.load.execute(e),n}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(n=>n.save()),connections:this.connections.map(n=>({id:n.id,from:n.from.id,to:n.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Zf="__baklava_GraphNode-";function wu(t){return Zf+t.id}const hLr=["component","connectionCount","events","hidden","hooks","id","isInput","name","nodeId","port","templateId","value"];function pLr(t){return class extends oae{constructor(){super(...arguments),this.type=wu(t),this.inputs={},this.outputs={},this.template=t,this.calculate=async(n,r)=>{var i;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!r.engine||typeof r.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const s=r.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)s.set(l.nodeInterfaceId,n[l.id]);const o=await r.engine.runGraph(this.subgraph,s,r.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(i=o.get(l.nodeId))===null||i===void 0?void 0:i.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(n){this.template.name=n}load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){var n;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(n=this.subgraph)===null||n===void 0||n.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,this.createProxyInterface(n,!0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(r=>r.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,this.createProxyInterface(n,!1));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(r=>r.id===n)||this.removeOutput(n);this.addOutput("_calculationResults",new _r("_calculationResults",void 0).setHidden(!0))}createProxyInterface(n,r){const i=new _r(n.name,void 0);return new Proxy(i,{get:(s,o)=>{var a,l,c;if(hLr.includes(o)||o in s||typeof o=="string"&&o.startsWith("__v_"))return Reflect.get(s,o);let u;if(r){const h=(a=this.subgraph)===null||a===void 0?void 0:a.nodes.find(p=>cL.isGraphInputNode(p)&&p.graphInterfaceId===n.id);u=h==null?void 0:h.outputs.placeholder.id}else{const h=(l=this.subgraph)===null||l===void 0?void 0:l.nodes.find(p=>uL.isGraphOutputNode(p)&&p.graphInterfaceId===n.id);u=h==null?void 0:h.inputs.placeholder.id}const d=(c=this.subgraph)===null||c===void 0?void 0:c.connections.find(h=>{var p;return u===((p=r?h.from:h.to)===null||p===void 0?void 0:p.id)}),f=r?d==null?void 0:d.to:d==null?void 0:d.from;if(f)return Reflect.get(f,o)}})}}}class uT{static fromGraph(e,n){return new uT(e.save(),n)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const n=this.editor.nodeTypes.get(wu(this));n&&(n.title=e)}get inputs(){return this.nodes.filter(n=>n.type===xu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===Eu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=S2(),this._name="Subgraph",this.events={nameChanged:new Vn(this),updated:new Vn(this)},this.hooks={beforeLoad:new wo(this),afterSave:new wo(this)},this.editor=n,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const n=new Map,r=f=>{const h=S2();return n.set(f,h),h},i=f=>{const h=n.get(f);if(!h)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return h},s=f=>Cx(f,h=>({id:r(h.id),templateId:h.id,value:h.value})),o=this.nodes.map(f=>({...f,id:r(f.id),inputs:s(f.inputs),outputs:s(f.outputs)})),a=this.connections.map(f=>({id:r(f.id),from:i(f.from),to:i(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),c=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),u={id:S2(),nodes:o,connections:a,inputs:l,outputs:c};return e||(e=new R7(this.editor)),e.load(u).forEach(f=>console.warn(f)),e.template=this,e}}class TLr{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vn(this),beforeRegisterNodeType:new Mi(this),registerNodeType:new Vn(this),beforeUnregisterNodeType:new Mi(this),unregisterNodeType:new Vn(this),beforeAddGraphTemplate:new Mi(this),addGraphTemplate:new Vn(this),beforeRemoveGraphTemplate:new Mi(this),removeGraphTemplate:new Vn(this),registerGraph:new Vn(this),unregisterGraph:new Vn(this)},this.hooks={save:new wo(this),load:new wo(this)},this.graphTemplateEvents=S1(),this.graphTemplateHooks=S1(),this.graphEvents=S1(),this.graphHooks=S1(),this.nodeEvents=S1(),this.nodeHooks=S1(),this.connectionEvents=S1(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new R7(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(cL),this.registerNodeType(uL)}registerNodeType(e,n){var r,i;if(this.events.beforeRegisterNodeType.emit({type:e,options:n}).prevented)return;const s=new e;this._nodeTypes.set(s.type,{type:e,category:(r=n==null?void 0:n.category)!==null&&r!==void 0?r:"default",title:(i=n==null?void 0:n.title)!==null&&i!==void 0?i:s.title}),this.events.registerNodeType.emit({type:e,options:n})}unregisterNodeType(e){const n=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(n)){if(this.events.beforeUnregisterNodeType.emit(n).prevented)return;this._nodeTypes.delete(n),this.events.unregisterNodeType.emit(n)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const n=pLr(e);this.registerNodeType(n,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const n=wu(e);for(const r of[this.graph,...this.graphs.values()]){const i=r.nodes.filter(s=>s.type===n);for(const s of i)r.removeNode(s)}this.unregisterNodeType(n),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{for(this._loading=!0,e=this.hooks.load.execute(e);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);e.graphTemplates.forEach(r=>{const i=new uT(r,this);this.addGraphTemplate(i)});const n=this._graph.load(e.graph);return this.events.loaded.emit(),n.forEach(r=>console.warn(r)),n}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(n=>n.save())};return this.hooks.save.execute(e)}}function OLr(t,e){const n=new Map;e.graphs.forEach(r=>{r.nodes.forEach(i=>n.set(i.id,i))}),t.forEach((r,i)=>{const s=n.get(i);s&&r.forEach((o,a)=>{const l=s.outputs[a];l&&(l.value=o)})})}class cae extends Error{constructor(){super("Cycle detected")}}function mLr(t){return typeof t=="string"}function uae(t,e){const n=new Map,r=new Map,i=new Map;let s,o;if(t instanceof R7)s=t.nodes,o=t.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");s=t,o=e}s.forEach(c=>{Object.values(c.inputs).forEach(u=>n.set(u.id,c.id)),Object.values(c.outputs).forEach(u=>n.set(u.id,c.id))}),s.forEach(c=>{const u=o.filter(f=>f.from&&n.get(f.from.id)===c.id),d=new Set(u.map(f=>n.get(f.to.id)).filter(mLr));r.set(c.id,d),i.set(c,u)});const a=s.slice();o.forEach(c=>{const u=a.findIndex(d=>n.get(c.to.id)===d.id);u>=0&&a.splice(u,1)});const l=[];for(;a.length>0;){const c=a.pop();l.push(c);const u=r.get(c.id);for(;u.size>0;){const d=u.values().next().value;if(u.delete(d),Array.from(r.values()).every(f=>!f.has(d))){const f=s.find(h=>h.id===d);a.push(f)}}}if(Array.from(r.values()).some(c=>c.size>0))throw new cae;return{calculationOrder:l,connectionsFromNode:i,interfaceIdToNodeId:n}}function gLr(t,e){try{return uae(t,e),!1}catch(n){if(n instanceof cae)return!0;throw n}}var gs;(function(t){t.Running="Running",t.Idle="Idle",t.Paused="Paused",t.Stopped="Stopped"})(gs||(gs={}));class QLr{get status(){return this.isRunning?gs.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Mi(this),afterRun:new Vn(this),statusChange:new Vn(this),beforeNodeCalculation:new Vn(this),afterNodeCalculation:new Vn(this)},this.hooks={gatherCalculationData:new wo(this),transferData:new iae},this.recalculateOrder=!0,this.internalStatus=gs.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(n,r)=>{r.graph&&!r.graph.loading&&r.graph.activeTransactions===0&&this.internalOnChange(r,n??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,n=>this.checkConnection(n.from,n.to))}start(){this.internalStatus===gs.Stopped&&(this.internalStatus=gs.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===gs.Idle&&(this.internalStatus=gs.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===gs.Paused&&(this.internalStatus=gs.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===gs.Idle||this.internalStatus===gs.Paused)&&(this.internalStatus=gs.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...n){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const r=await this.execute(e,...n);return this.events.afterRun.emit(r),r}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,n){if(e.templateId){const s=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!s)return{connectionAllowed:!0,connectionsInDanger:[]};e=s}if(n.templateId){const s=this.findInterfaceByTemplateId(this.editor.graph.nodes,n.templateId);if(!s)return{connectionAllowed:!0,connectionsInDanger:[]};n=s}const r=new sae(e,n);let i=this.editor.graph.connections.slice();return n.allowMultipleConnections||(i=i.filter(s=>s.to!==n)),i.push(r),gLr(this.editor.graph.nodes,i)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:n.allowMultipleConnections?[]:this.editor.graph.connections.filter(s=>s.to===n)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const n=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(n,...e)}validateNodeCalculationOutput(e,n){if(typeof n!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(r=>{if(!(r in n))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${r}"`)})}internalOnChange(e,n){this.internalStatus===gs.Idle&&this.onChange(this.recalculateOrder,e,n)}findInterfaceByTemplateId(e,n){for(const r of e)for(const i of[...Object.values(r.inputs),...Object.values(r.outputs)])if(i.templateId===n)return i;return null}}class _Lr extends QLr{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,n,r){this.order.has(e.id)||this.order.set(e.id,uae(e));const{calculationOrder:i,connectionsFromNode:s}=this.order.get(e.id),o=new Map;for(const a of i){const l={};Object.entries(a.inputs).forEach(([u,d])=>{l[u]=this.getInterfaceValue(n,d.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let c;if(a.calculate)c=await a.calculate(l,{globalValues:r,engine:this});else{c={};for(const[u,d]of Object.entries(a.outputs))c[u]=this.getInterfaceValue(n,d.id)}this.validateNodeCalculationOutput(a,c),this.events.afterNodeCalculation.emit({outputValues:c,node:a}),o.set(a.id,new Map(Object.entries(c))),s.has(a)&&s.get(a).forEach(u=>{var d;const f=(d=Object.entries(a.outputs).find(([,p])=>p.id===u.from.id))===null||d===void 0?void 0:d[0];if(!f)throw new Error(`Could not find key for interface ${u.from.id}
+Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,n),this.proxies.push(n)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const n=this.proxyMap.get(e);this.proxyMap.delete(e);const r=this.proxies.indexOf(n);r>=0&&this.proxies.splice(r,1)}}class Vn extends x4{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(n=>n(e,this.entity))}}class Mi extends x4{constructor(e){super(),this.entity=e}emit(e){let n=!1;const r=()=>[n=!0];for(const i of Array.from(this.listeners.values()))if(i(e,r,this.entity),n)return{prevented:!0};return{prevented:!1}}}class iae extends x4{execute(e,n){let r=e;for(const i of this.listeners)r=i(r,n);return r}}class wo extends iae{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class hLr extends x4{constructor(e){super(),this.entity=e}execute(e){const n=[];for(const r of this.listeners)n.push(r(e,this.entity));return n}}function S1(){const t=Symbol(),e=new Map,n=new Set,r=(l,c)=>{c instanceof x4&&c.registerProxy(t,()=>{var u,d;return(d=(u=e.get(l))===null||u===void 0?void 0:u.listeners)!==null&&d!==void 0?d:[]})},i=l=>{const c=new x4;e.set(l,c),n.forEach(u=>r(l,u[l]))},s=l=>{n.add(l);for(const c of e.keys())r(c,l[c])},o=l=>{for(const c of e.keys())l[c]instanceof x4&&l[c].unregisterProxy(t);n.delete(l)},a=()=>{n.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,c){return c==="addTarget"?s:c==="removeTarget"?o:c==="destroy"?a:typeof c!="string"||c.startsWith("_")?l[c]:(e.has(c)||i(c),e.get(c))}})}class SY{constructor(e,n){if(this.destructed=!1,this.events={destruct:new Vn(this)},!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=S2(),this.from=e,this.to=n,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class sae{constructor(e,n){if(!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=S2(),this.from=e,this.to=n}}function Cx(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e(r)]))}class oae{constructor(){this._title="",this.id=S2(),this.events={loaded:new Vn(this),beforeAddInput:new Mi(this),addInput:new Vn(this),beforeRemoveInput:new Mi(this),removeInput:new Vn(this),beforeAddOutput:new Mi(this),addOutput:new Vn(this),beforeRemoveOutput:new Mi(this),removeOutput:new Vn(this),beforeTitleChanged:new Mi(this),titleChanged:new Vn(this),update:new Vn(this)},this.hooks={beforeLoad:new wo(this),afterSave:new wo(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,n){return this.addInterface("input",e,n)}addOutput(e,n){return this.addInterface("output",e,n)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([n,r])=>{this.inputs[n]&&(this.inputs[n].load(r),this.inputs[n].nodeId=this.id)}),Object.entries(e.outputs).forEach(([n,r])=>{this.outputs[n]&&(this.outputs[n].load(r),this.outputs[n].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Cx(this.inputs,i=>i.save()),n=Cx(this.outputs,i=>i.save()),r={type:this.type,id:this.id,title:this.title,inputs:e,outputs:n};return this.hooks.afterSave.execute(r)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,n])=>this.initializeIntf("input",e,n)),Object.entries(this.outputs).forEach(([e,n])=>this.initializeIntf("output",e,n))}initializeIntf(e,n,r){r.isInput=e==="input",r.nodeId=this.id,r.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:n,intf:r}))}addInterface(e,n,r){const i=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,s=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return i.emit(r).prevented?!1:(o[n]=r,this.initializeIntf(e,n,r),s.emit(r),!0)}removeInterface(e,n){const r=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,i=e==="input"?this.events.removeInput:this.events.removeOutput,s=e==="input"?this.inputs[n]:this.outputs[n];if(!s||r.emit(s).prevented)return!1;if(s.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===s||a.to===s).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return s.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[n]:delete this.outputs[n],i.emit(s),!0}}let aae=class extends oae{load(e){super.load(e)}save(){return super.save()}};function Yu(t){return class extends aae{constructor(){var e,n;super(),this.type=t.type,this.inputs={},this.outputs={},this.calculate=t.calculate?(r,i)=>t.calculate.call(this,r,i):void 0,this._title=(e=t.title)!==null&&e!==void 0?e:t.type,this.executeFactory("input",t.inputs),this.executeFactory("output",t.outputs),(n=t.onCreate)===null||n===void 0||n.call(this)}onPlaced(){var e;(e=t.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=t.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,n){Object.keys(n||{}).forEach(r=>{const i=n[r]();e==="input"?this.addInput(r,i):this.addOutput(r,i)})}}}class _r{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,n){this.id=S2(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vn(this),beforeSetValue:new Mi(this),setValue:new Vn(this),updated:new Vn(this)},this.hooks={load:new wo(this),save:new wo(this)},this._connectionCount=0,this.name=e,this._value=n}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...n){return e(this,...n),this}}const xu="__baklava_SubgraphInputNode",Eu="__baklava_SubgraphOutputNode";class lae extends aae{constructor(){super(),this.graphInterfaceId=S2()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class cL extends lae{constructor(){super(...arguments),this.type=xu,this.inputs={name:new _r("Name","Input")},this.outputs={placeholder:new _r("Value",void 0)}}static isGraphInputNode(e){return e.type===xu}}class uL extends lae{constructor(){super(...arguments),this.type=Eu,this.inputs={name:new _r("Name","Output"),placeholder:new _r("Value",void 0)},this.outputs={output:new _r("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Eu}}class R7{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(n=>n.type===xu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===Eu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=S2(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Mi(this),addNode:new Vn(this),beforeRemoveNode:new Mi(this),removeNode:new Vn(this),beforeAddConnection:new Mi(this),addConnection:new Vn(this),checkConnection:new Mi(this),beforeRemoveConnection:new Mi(this),removeConnection:new Vn(this)},this.hooks={save:new wo(this),load:new wo(this),checkConnection:new hLr(this)},this.nodeEvents=S1(),this.nodeHooks=S1(),this.connectionEvents=S1(),this.editor=e,this.template=n,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(n=>n.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const n=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(r=>n.includes(r.from)||n.includes(r.to)).forEach(r=>this.removeConnection(r)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,n){const r=this.checkConnection(e,n);if(!r.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:n}).prevented)return;for(const s of r.connectionsInDanger){const o=this.connections.find(a=>a.id===s.id);o&&this.removeConnection(o)}const i=new SY(r.dummyConnection.from,r.dummyConnection.to);return this.internalAddConnection(i),i}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,n){if(!e||!n)return{connectionAllowed:!1};const r=this.findNodeById(e.nodeId),i=this.findNodeById(n.nodeId);if(r&&i&&r===i)return{connectionAllowed:!1};if(e.isInput&&!n.isInput){const a=e;e=n,n=a}if(e.isInput||!n.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===n))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:n}).prevented)return{connectionAllowed:!1};const s=this.hooks.checkConnection.execute({from:e,to:n});if(s.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(s.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new sae(e,n),connectionsInDanger:o}}findNodeInterface(e){for(const n of this.nodes){for(const r in n.inputs){const i=n.inputs[r];if(i.id===e)return i}for(const r in n.outputs){const i=n.outputs[r];if(i.id===e)return i}}}findNodeById(e){return this.nodes.find(n=>n.id===e)}load(e){try{this._loading=!0;const n=[];for(let r=this.connections.length-1;r>=0;r--)this.removeConnection(this.connections[r]);for(let r=this.nodes.length-1;r>=0;r--)this.removeNode(this.nodes[r]);this.id=e.id;for(const r of e.nodes){const i=this.editor.nodeTypes.get(r.type);if(!i){n.push(`Node type ${r.type} is not registered`);continue}const s=new i.type;this.addNode(s),s.load(r)}for(const r of e.connections){const i=this.findNodeInterface(r.from),s=this.findNodeInterface(r.to);if(i)if(s){const o=new SY(i,s);o.id=r.id,this.internalAddConnection(o)}else{n.push(`Could not find interface with id ${r.to}`);continue}else{n.push(`Could not find interface with id ${r.from}`);continue}}return this.hooks.load.execute(e),n}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(n=>n.save()),connections:this.connections.map(n=>({id:n.id,from:n.from.id,to:n.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Zf="__baklava_GraphNode-";function wu(t){return Zf+t.id}const pLr=["component","connectionCount","events","hidden","hooks","id","isInput","name","nodeId","port","templateId","value"];function TLr(t){return class extends oae{constructor(){super(...arguments),this.type=wu(t),this.inputs={},this.outputs={},this.template=t,this.calculate=async(n,r)=>{var i;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!r.engine||typeof r.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const s=r.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)s.set(l.nodeInterfaceId,n[l.id]);const o=await r.engine.runGraph(this.subgraph,s,r.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(i=o.get(l.nodeId))===null||i===void 0?void 0:i.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(n){this.template.name=n}load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){var n;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(n=this.subgraph)===null||n===void 0||n.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,this.createProxyInterface(n,!0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(r=>r.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,this.createProxyInterface(n,!1));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(r=>r.id===n)||this.removeOutput(n);this.addOutput("_calculationResults",new _r("_calculationResults",void 0).setHidden(!0))}createProxyInterface(n,r){const i=new _r(n.name,void 0);return new Proxy(i,{get:(s,o)=>{var a,l,c;if(pLr.includes(o)||o in s||typeof o=="string"&&o.startsWith("__v_"))return Reflect.get(s,o);let u;if(r){const h=(a=this.subgraph)===null||a===void 0?void 0:a.nodes.find(p=>cL.isGraphInputNode(p)&&p.graphInterfaceId===n.id);u=h==null?void 0:h.outputs.placeholder.id}else{const h=(l=this.subgraph)===null||l===void 0?void 0:l.nodes.find(p=>uL.isGraphOutputNode(p)&&p.graphInterfaceId===n.id);u=h==null?void 0:h.inputs.placeholder.id}const d=(c=this.subgraph)===null||c===void 0?void 0:c.connections.find(h=>{var p;return u===((p=r?h.from:h.to)===null||p===void 0?void 0:p.id)}),f=r?d==null?void 0:d.to:d==null?void 0:d.from;if(f)return Reflect.get(f,o)}})}}}class uT{static fromGraph(e,n){return new uT(e.save(),n)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const n=this.editor.nodeTypes.get(wu(this));n&&(n.title=e)}get inputs(){return this.nodes.filter(n=>n.type===xu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===Eu).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=S2(),this._name="Subgraph",this.events={nameChanged:new Vn(this),updated:new Vn(this)},this.hooks={beforeLoad:new wo(this),afterSave:new wo(this)},this.editor=n,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const n=new Map,r=f=>{const h=S2();return n.set(f,h),h},i=f=>{const h=n.get(f);if(!h)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return h},s=f=>Cx(f,h=>({id:r(h.id),templateId:h.id,value:h.value})),o=this.nodes.map(f=>({...f,id:r(f.id),inputs:s(f.inputs),outputs:s(f.outputs)})),a=this.connections.map(f=>({id:r(f.id),from:i(f.from),to:i(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),c=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),u={id:S2(),nodes:o,connections:a,inputs:l,outputs:c};return e||(e=new R7(this.editor)),e.load(u).forEach(f=>console.warn(f)),e.template=this,e}}class OLr{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vn(this),beforeRegisterNodeType:new Mi(this),registerNodeType:new Vn(this),beforeUnregisterNodeType:new Mi(this),unregisterNodeType:new Vn(this),beforeAddGraphTemplate:new Mi(this),addGraphTemplate:new Vn(this),beforeRemoveGraphTemplate:new Mi(this),removeGraphTemplate:new Vn(this),registerGraph:new Vn(this),unregisterGraph:new Vn(this)},this.hooks={save:new wo(this),load:new wo(this)},this.graphTemplateEvents=S1(),this.graphTemplateHooks=S1(),this.graphEvents=S1(),this.graphHooks=S1(),this.nodeEvents=S1(),this.nodeHooks=S1(),this.connectionEvents=S1(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new R7(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(cL),this.registerNodeType(uL)}registerNodeType(e,n){var r,i;if(this.events.beforeRegisterNodeType.emit({type:e,options:n}).prevented)return;const s=new e;this._nodeTypes.set(s.type,{type:e,category:(r=n==null?void 0:n.category)!==null&&r!==void 0?r:"default",title:(i=n==null?void 0:n.title)!==null&&i!==void 0?i:s.title}),this.events.registerNodeType.emit({type:e,options:n})}unregisterNodeType(e){const n=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(n)){if(this.events.beforeUnregisterNodeType.emit(n).prevented)return;this._nodeTypes.delete(n),this.events.unregisterNodeType.emit(n)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const n=TLr(e);this.registerNodeType(n,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const n=wu(e);for(const r of[this.graph,...this.graphs.values()]){const i=r.nodes.filter(s=>s.type===n);for(const s of i)r.removeNode(s)}this.unregisterNodeType(n),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{for(this._loading=!0,e=this.hooks.load.execute(e);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);e.graphTemplates.forEach(r=>{const i=new uT(r,this);this.addGraphTemplate(i)});const n=this._graph.load(e.graph);return this.events.loaded.emit(),n.forEach(r=>console.warn(r)),n}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(n=>n.save())};return this.hooks.save.execute(e)}}function mLr(t,e){const n=new Map;e.graphs.forEach(r=>{r.nodes.forEach(i=>n.set(i.id,i))}),t.forEach((r,i)=>{const s=n.get(i);s&&r.forEach((o,a)=>{const l=s.outputs[a];l&&(l.value=o)})})}class cae extends Error{constructor(){super("Cycle detected")}}function gLr(t){return typeof t=="string"}function uae(t,e){const n=new Map,r=new Map,i=new Map;let s,o;if(t instanceof R7)s=t.nodes,o=t.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");s=t,o=e}s.forEach(c=>{Object.values(c.inputs).forEach(u=>n.set(u.id,c.id)),Object.values(c.outputs).forEach(u=>n.set(u.id,c.id))}),s.forEach(c=>{const u=o.filter(f=>f.from&&n.get(f.from.id)===c.id),d=new Set(u.map(f=>n.get(f.to.id)).filter(gLr));r.set(c.id,d),i.set(c,u)});const a=s.slice();o.forEach(c=>{const u=a.findIndex(d=>n.get(c.to.id)===d.id);u>=0&&a.splice(u,1)});const l=[];for(;a.length>0;){const c=a.pop();l.push(c);const u=r.get(c.id);for(;u.size>0;){const d=u.values().next().value;if(u.delete(d),Array.from(r.values()).every(f=>!f.has(d))){const f=s.find(h=>h.id===d);a.push(f)}}}if(Array.from(r.values()).some(c=>c.size>0))throw new cae;return{calculationOrder:l,connectionsFromNode:i,interfaceIdToNodeId:n}}function QLr(t,e){try{return uae(t,e),!1}catch(n){if(n instanceof cae)return!0;throw n}}var gs;(function(t){t.Running="Running",t.Idle="Idle",t.Paused="Paused",t.Stopped="Stopped"})(gs||(gs={}));class _Lr{get status(){return this.isRunning?gs.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Mi(this),afterRun:new Vn(this),statusChange:new Vn(this),beforeNodeCalculation:new Vn(this),afterNodeCalculation:new Vn(this)},this.hooks={gatherCalculationData:new wo(this),transferData:new iae},this.recalculateOrder=!0,this.internalStatus=gs.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(n,r)=>{r.graph&&!r.graph.loading&&r.graph.activeTransactions===0&&this.internalOnChange(r,n??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(n,r)=>{this.recalculateOrder=!0,!r.loading&&r.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,n=>this.checkConnection(n.from,n.to))}start(){this.internalStatus===gs.Stopped&&(this.internalStatus=gs.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===gs.Idle&&(this.internalStatus=gs.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===gs.Paused&&(this.internalStatus=gs.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===gs.Idle||this.internalStatus===gs.Paused)&&(this.internalStatus=gs.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...n){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const r=await this.execute(e,...n);return this.events.afterRun.emit(r),r}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,n){if(e.templateId){const s=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!s)return{connectionAllowed:!0,connectionsInDanger:[]};e=s}if(n.templateId){const s=this.findInterfaceByTemplateId(this.editor.graph.nodes,n.templateId);if(!s)return{connectionAllowed:!0,connectionsInDanger:[]};n=s}const r=new sae(e,n);let i=this.editor.graph.connections.slice();return n.allowMultipleConnections||(i=i.filter(s=>s.to!==n)),i.push(r),QLr(this.editor.graph.nodes,i)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:n.allowMultipleConnections?[]:this.editor.graph.connections.filter(s=>s.to===n)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const n=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(n,...e)}validateNodeCalculationOutput(e,n){if(typeof n!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(r=>{if(!(r in n))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${r}"`)})}internalOnChange(e,n){this.internalStatus===gs.Idle&&this.onChange(this.recalculateOrder,e,n)}findInterfaceByTemplateId(e,n){for(const r of e)for(const i of[...Object.values(r.inputs),...Object.values(r.outputs)])if(i.templateId===n)return i;return null}}class vLr extends _Lr{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,n,r){this.order.has(e.id)||this.order.set(e.id,uae(e));const{calculationOrder:i,connectionsFromNode:s}=this.order.get(e.id),o=new Map;for(const a of i){const l={};Object.entries(a.inputs).forEach(([u,d])=>{l[u]=this.getInterfaceValue(n,d.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let c;if(a.calculate)c=await a.calculate(l,{globalValues:r,engine:this});else{c={};for(const[u,d]of Object.entries(a.outputs))c[u]=this.getInterfaceValue(n,d.id)}this.validateNodeCalculationOutput(a,c),this.events.afterNodeCalculation.emit({outputValues:c,node:a}),o.set(a.id,new Map(Object.entries(c))),s.has(a)&&s.get(a).forEach(u=>{var d;const f=(d=Object.entries(a.outputs).find(([,p])=>p.id===u.from.id))===null||d===void 0?void 0:d[0];if(!f)throw new Error(`Could not find key for interface ${u.from.id}
This is likely a Baklava internal issue. Please report it on GitHub.`);const h=this.hooks.transferData.execute(c[f],u);u.to.allowMultipleConnections?n.has(u.to.id)?n.get(u.to.id).push(h):n.set(u.to.id,[h]):n.set(u.to.id,h)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const n=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,n,e)}getInputValues(e){const n=new Map;for(const r of e.nodes)Object.values(r.inputs).forEach(i=>{i.connectionCount===0&&n.set(i.id,i.value)}),r.calculate||Object.values(r.outputs).forEach(i=>{n.set(i.id,i.value)});return n}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,n){if(!e.has(n))throw new Error(`Could not find value for interface ${n}
-This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(n)}}const vLr=["INPUT","TEXTAREA","SELECT"];function dae(t){return vLr.includes(t.tagName)}let Lx=null;function yLr(t){Lx=t}function Lo(){if(!Lx)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Lx}}function da(){const{viewModel:t}=Lo();return{graph:Bh(t.value,"displayedGraph"),switchGraph:t.value.switchGraph}}function fae(t){const{graph:e}=da(),n=We(null),r=We(null);return{dragging:Je(()=>!!n.value),onPointerDown:l=>{n.value={x:l.pageX,y:l.pageY},r.value={x:t.value.x,y:t.value.y}},onPointerMove:l=>{if(n.value){const c=l.pageX-n.value.x,u=l.pageY-n.value.y;t.value.x=r.value.x+c/e.value.scaling,t.value.y=r.value.y+u/e.value.scaling}},onPointerUp:()=>{n.value=null,r.value=null}}}function hae(t,e,n){if(!e.template)return!1;if(wu(e.template)===n)return!0;const r=t.graphTemplates.find(s=>wu(s)===n);return r?r.nodes.filter(s=>s.type.startsWith(Zf)).some(s=>hae(t,e,s.type)):!1}function pae(t){return Je(()=>{const e=Array.from(t.value.editor.nodeTypes.entries()),n=new Set(e.map(([,i])=>i.category)),r=[];for(const i of n.values()){let s=e.filter(([,o])=>o.category===i);t.value.displayedGraph.template?s=s.filter(([o])=>!hae(t.value.editor,t.value.displayedGraph,o)):s=s.filter(([o])=>![xu,Eu].includes(o)),s.length>0&&r.push({name:i,nodeTypes:Object.fromEntries(s)})}return r.sort((i,s)=>i.name==="default"?-1:s.name==="default"||i.name>s.name?1:-1),r})}function Tae(){const{graph:t}=da();return{transform:(n,r)=>{const i=n/t.value.scaling-t.value.panning.x,s=r/t.value.scaling-t.value.panning.y;return[i,s]}}}function bLr(){const{graph:t}=da();let e=[],n=-1,r={x:0,y:0};const i=Je(()=>t.value.panning),s=fae(i),o=Je(()=>({"transform-origin":"0 0",transform:`scale(${t.value.scaling}) translate(${t.value.panning.x}px, ${t.value.panning.y}px)`})),a=(h,p,T)=>{const m=[h/t.value.scaling-t.value.panning.x,p/t.value.scaling-t.value.panning.y],O=[h/T-t.value.panning.x,p/T-t.value.panning.y],g=[O[0]-m[0],O[1]-m[1]];t.value.panning.x+=g[0],t.value.panning.y+=g[1],t.value.scaling=T},l=h=>{h.preventDefault();let p=h.deltaY;h.deltaMode===1&&(p*=32);const T=t.value.scaling*(1-p/3e3);a(h.offsetX,h.offsetY,T)},c=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...s,onPointerDown:h=>{if(e.push(h),s.onPointerDown(h),e.length===2){const{ax:p,ay:T,bx:m,by:O}=c();r={x:p+(m-p)/2,y:T+(O-T)/2}}},onPointerMove:h=>{for(let p=0;p0){const _=t.value.scaling*(1+(v-n)/500);a(r.x,r.y,_)}n=v}else s.onPointerMove(h)},onPointerUp:h=>{e=e.filter(p=>p.pointerId!==h.pointerId),n=-1,s.onPointerUp()},onMouseWheel:l}}var qo=(t=>(t[t.NONE=0]="NONE",t[t.ALLOWED=1]="ALLOWED",t[t.FORBIDDEN=2]="FORBIDDEN",t))(qo||{});const Oae=Symbol();function SLr(){const{graph:t}=da(),e=We(null),n=We(null),r=a=>{e.value&&(e.value.mx=a.offsetX/t.value.scaling-t.value.panning.x,e.value.my=a.offsetY/t.value.scaling-t.value.panning.y)},i=()=>{if(n.value){if(e.value)return;const a=t.value.connections.find(l=>l.to===n.value);n.value.isInput&&a?(e.value={status:qo.NONE,from:a.from},t.value.removeConnection(a)):e.value={status:qo.NONE,from:n.value},e.value.mx=void 0,e.value.my=void 0}},s=()=>{if(e.value&&n.value){if(e.value.from===n.value)return;t.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(n.value=a??null,a&&e.value){e.value.to=a;const l=t.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?qo.ALLOWED:qo.FORBIDDEN,l.connectionAllowed){const c=l.connectionsInDanger.map(u=>u.id);t.value.connections.forEach(u=>{c.includes(u.id)&&(u.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=qo.NONE,t.value.connections.forEach(l=>{l.isInDanger=!1}))};return Q4(Oae,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:r,onMouseDown:i,onMouseUp:s,hoveredOver:o}}function xLr(t){const e=We(!1),n=We(0),r=We(0),i=pae(t),{transform:s}=Tae(),o=Je(()=>{let u=[];const d={};for(const h of i.value){const p=Object.entries(h.nodeTypes).map(([T,m])=>({label:m.title,value:"addNode:"+T}));h.name==="default"?u=p:d[h.name]=p}const f=[...Object.entries(d).map(([h,p])=>({label:h,submenu:p}))];return f.length>0&&u.length>0&&f.push({isDivider:!0}),f.push(...u),f}),a=Je(()=>t.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...t.value.settings.contextMenu.additionalItems.map(u=>"isDivider"in u||"submenu"in u?u:{label:u.label,value:"command:"+u.command,disabled:!t.value.commandHandler.canExecuteCommand(u.command)})]);function l(u){const d=u.target;if(!(d instanceof Element)||dae(d))return;u.preventDefault(),e.value=!0;const f=d.getBoundingClientRect(),p=d.closest(".baklava-editor").getBoundingClientRect();n.value=f.x+u.offsetX-p.x,r.value=f.y+u.offsetY-p.y}function c(u){if(u.startsWith("addNode:")){const d=u.substring(8),f=t.value.editor.nodeTypes.get(d);if(!f)return;const h=vi(new f.type);t.value.displayedGraph.addNode(h);const[p,T]=s(n.value,r.value);h.position.x=p,h.position.y=T}else if(u.startsWith("command:")){const d=u.substring(8);t.value.commandHandler.canExecuteCommand(d)&&t.value.commandHandler.executeCommand(d)}}return{show:e,x:n,y:r,items:a,open:l,onClick:c}}const Ih="START_SELECTION_BOX";function ELr(t){const{viewModel:e}=Lo(),{graph:n}=da(),r=Je(()=>n.value.nodes),i=We(!1),s=We(!1),o=We([0,0]),a=We([0,0]);br(e,()=>{e.value.commandHandler.hasCommand(Ih)||(e.value.commandHandler.registerCommand(Ih,{canExecute:()=>!0,execute(){i.value=!0}}),e.value.commandHandler.registerHotkey(["b"],Ih))},{immediate:!0});function l(O){return[O.clientX-t.value.getBoundingClientRect().left,O.clientY-t.value.getBoundingClientRect().top]}function c(O){return i.value?(s.value=!0,i.value=!1,o.value=l(O),a.value=l(O),document.addEventListener("pointermove",u),document.addEventListener("pointerup",d),!0):!1}function u(O){o.value=l(O)}function d(O){document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",d),o.value=l(O),s.value=!1;const g=f();for(const Q of g)e.value.displayedGraph.selectedNodes.push(Q)}function f(){const O=h(),Q=document.querySelector(".baklava-editor").getBoundingClientRect();return r.value.filter(v=>{const _=p(v,Q);return T(O,_)})}function h(){return{left:Math.min(o.value[0],a.value[0]),top:Math.min(o.value[1],a.value[1]),right:Math.max(o.value[0],a.value[0]),bottom:Math.max(o.value[1],a.value[1])}}function p(O,g){const Q=document.getElementById(O.id),v=Q?Q.getBoundingClientRect():{x:0,y:0,width:0,height:0},_=v.x-g.left,y=v.y-g.top;return{left:_,top:y,right:_+v.width,bottom:y+v.height}}function T(O,g){return O.leftg.left&&O.topg.top}function m(){return{width:Math.abs(a.value[0]-o.value[0])+"px",height:Math.abs(a.value[1]-o.value[1])+"px",left:(a.value[0]>o.value[0]?o.value[0]:a.value[0])+"px",top:(a.value[1]>o.value[1]?o.value[1]:a.value[1])+"px"}}return vi({startSelection:i,isSelecting:s,start:o,end:a,onPointerDown:c,getStyles:m})}const wLr=Zn({setup(){const{viewModel:t}=Lo(),{graph:e}=da();return{styles:Je(()=>{const r=t.value.settings.background,i=e.value.panning.x*e.value.scaling,s=e.value.panning.y*e.value.scaling,o=e.value.scaling*r.gridSize,a=o/r.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,c=e.value.scaling>r.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${i}px top ${s}px`,backgroundSize:`${l} ${c}`}})}}}),xr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};function CLr(t,e,n,r,i,s){return k(),R("div",{class:"background",style:qn(t.styles)},null,4)}const LLr=xr(wLr,[["render",CLr]]);function $Lr(t){return zY()?(f1e(t),!0):!1}function dL(t){return typeof t=="function"?t():pn(t)}const mae=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ALr=Object.prototype.toString,kLr=t=>ALr.call(t)==="[object Object]",Hh=()=>{},PLr=RLr();function RLr(){var t,e;return mae&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function MLr(t,e,n=!1){return e.reduce((r,i)=>(i in t&&(!n||t[i]!==void 0)&&(r[i]=t[i]),r),{})}function DLr(t,e={}){if(!Yr(t))return q1e(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const r in t.value)n[r]=V1e(()=>({get(){return t.value[r]},set(i){var s;if((s=dL(e.replaceRef))!=null?s:!0)if(Array.isArray(t.value)){const a=[...t.value];a[r]=i,t.value=a}else{const a={...t.value,[r]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[r]=i}}));return n}function Ad(t){var e;const n=dL(t);return(e=n==null?void 0:n.$el)!=null?e:n}const fL=mae?window:void 0;function nf(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=fL):[e,n,r,i]=t,!e)return Hh;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],o=()=>{s.forEach(u=>u()),s.length=0},a=(u,d,f,h)=>(u.addEventListener(d,f,h),()=>u.removeEventListener(d,f,h)),l=br(()=>[Ad(e),dL(i)],([u,d])=>{if(o(),!u)return;const f=kLr(d)?{...d}:d;s.push(...n.flatMap(h=>r.map(p=>a(u,h,p,f))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return $Lr(c),c}let xY=!1;function gae(t,e,n={}){const{window:r=fL,ignore:i=[],capture:s=!0,detectIframe:o=!1}=n;if(!r)return Hh;PLr&&!xY&&(xY=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",Hh)),r.document.documentElement.addEventListener("click",Hh));let a=!0;const l=f=>i.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(p=>p===f.target||f.composedPath().includes(p));{const p=Ad(h);return p&&(f.target===p||f.composedPath().includes(p))}}),u=[nf(r,"click",f=>{const h=Ad(t);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:s}),nf(r,"pointerdown",f=>{const h=Ad(t);a=!l(f)&&!!(h&&!f.composedPath().includes(h))},{passive:!0}),o&&nf(r,"blur",f=>{setTimeout(()=>{var h;const p=Ad(t);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(r.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>u.forEach(f=>f())}const Qae={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},NLr=Object.keys(Qae);function ILr(t={}){const{target:e=fL}=t,n=We(!1),r=We(t.initialValue||{});Object.assign(r.value,Qae,r.value);const i=s=>{n.value=!0,!(t.pointerTypes&&!t.pointerTypes.includes(s.pointerType))&&(r.value=MLr(s,NLr,!1))};if(e){const s={passive:!0};nf(e,["pointerdown","pointermove","pointerup"],i,s),nf(e,"pointerleave",()=>n.value=!1,s)}return{...DLr(r),isInside:n}}const HLr=["onMouseenter","onMouseleave","onClick"],VLr={class:"flex-fill"},qLr={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},ULr=b("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[b("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),BLr=[ULr],hL=Zn({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(t,{emit:e}){const n=t,r=e;let i=null;const s=We(null),o=We(-1),a=We(0),l=We({x:!1,y:!1}),c=Je(()=>n.flippable&&(l.value.x||n.isFlipped.x)),u=Je(()=>n.flippable&&(l.value.y||n.isFlipped.y)),d=Je(()=>{const g={};return n.isNested||(g.top=(u.value?n.y-a.value:n.y)+"px",g.left=n.x+"px"),g}),f=Je(()=>({"--flipped-x":c.value,"--flipped-y":u.value,"--nested":n.isNested})),h=Je(()=>n.items.map(g=>({...g,hover:!1})));br([()=>n.y,()=>n.items],()=>{var g,Q,v,_;a.value=n.items.length*30;const y=((Q=(g=s.value)==null?void 0:g.parentElement)==null?void 0:Q.offsetWidth)??0,S=((_=(v=s.value)==null?void 0:v.parentElement)==null?void 0:_.offsetHeight)??0;l.value.x=!n.isNested&&n.x>y*.75,l.value.y=!n.isNested&&n.y+a.value>S-20}),gae(s,()=>{n.modelValue&&r("update:modelValue",!1)});const p=g=>{!g.submenu&&g.value&&(r("click",g.value),r("update:modelValue",!1))},T=g=>{r("click",g),o.value=-1,n.isNested||r("update:modelValue",!1)},m=(g,Q)=>{n.items[Q].submenu&&(o.value=Q,i!==null&&(clearTimeout(i),i=null))},O=(g,Q)=>{n.items[Q].submenu&&(i=window.setTimeout(()=>{o.value=-1,i=null},200))};return(g,Q)=>{const v=Xe("ContextMenu",!0);return k(),Qt(cr,{name:"slide-fade"},{default:Ie(()=>[He(b("div",{ref_key:"el",ref:s,class:ye(["baklava-context-menu",f.value]),style:qn(d.value)},[(k(!0),R(Ve,null,dt(h.value,(_,y)=>(k(),R(Ve,null,[_.isDivider?(k(),R("div",{key:`d-${y}`,class:"divider"})):(k(),R("div",{key:`i-${y}`,class:ye(["item",{submenu:!!_.submenu,"--disabled":!!_.disabled}]),onMouseenter:S=>m(S,y),onMouseleave:S=>O(S,y),onClick:oe(S=>p(_),["stop","prevent"])},[b("div",VLr,ae(_.label),1),_.submenu?(k(),R("div",qLr,BLr)):ne("",!0),_.submenu?(k(),Qt(v,{key:1,"model-value":o.value===y,items:_.submenu,"is-nested":!0,"is-flipped":{x:c.value,y:u.value},flippable:g.flippable,onClick:T},null,8,["model-value","items","is-flipped","flippable"])):ne("",!0)],42,HLr))],64))),256))],6),[[mr,g.modelValue]])]),_:1})}}}),zLr={},XLr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"16",height:"16",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},FLr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),jLr=b("circle",{cx:"12",cy:"12",r:"1"},null,-1),YLr=b("circle",{cx:"12",cy:"19",r:"1"},null,-1),GLr=b("circle",{cx:"12",cy:"5",r:"1"},null,-1),WLr=[FLr,jLr,YLr,GLr];function ZLr(t,e){return k(),R("svg",XLr,WLr)}const _ae=xr(zLr,[["render",ZLr]]),KLr=["id"],JLr={key:0,class:"__tooltip"},e$r={key:2,class:"align-middle"},EY=Zn({__name:"NodeInterface",props:{node:{},intf:{}},setup(t){const e=(m,O=100)=>{const g=typeof(m==null?void 0:m.toString)=="function"?String(m):"";return g.length>O?g.slice(0,O)+"...":g},n=t,{viewModel:r}=Lo(),{hoveredOver:i,temporaryConnection:s}=_i(Oae),o=We(null),a=Je(()=>n.intf.connectionCount>0),l=We(!1),c=Je(()=>r.value.settings.displayValueOnHover&&l.value),u=Je(()=>({"--input":n.intf.isInput,"--output":!n.intf.isInput,"--connected":a.value})),d=Je(()=>n.intf.component&&(!n.intf.isInput||!n.intf.port||n.intf.connectionCount===0)),f=()=>{l.value=!0,i(n.intf)},h=()=>{l.value=!1,i(void 0)},p=()=>{o.value&&r.value.hooks.renderInterface.execute({intf:n.intf,el:o.value})},T=()=>{const m=r.value.displayedGraph.sidebar;m.nodeId=n.node.id,m.optionName=n.intf.name,m.visible=!0};return Ii(p),Au(p),(m,O)=>{var g;return k(),R("div",{id:m.intf.id,ref_key:"el",ref:o,class:ye(["baklava-node-interface",u.value])},[m.intf.port?(k(),R("div",{key:0,class:ye(["__port",{"--selected":((g=pn(s))==null?void 0:g.from)===m.intf}]),onPointerover:f,onPointerout:h},[er(m.$slots,"portTooltip",{showTooltip:c.value},()=>[c.value===!0?(k(),R("span",JLr,ae(e(m.intf.value)),1)):ne("",!0)])],34)):ne("",!0),d.value?(k(),Qt(t7(m.intf.component),{key:1,modelValue:m.intf.value,"onUpdate:modelValue":O[0]||(O[0]=Q=>m.intf.value=Q),node:m.node,intf:m.intf,onOpenSidebar:T},null,40,["modelValue","node","intf"])):(k(),R("span",e$r,ae(m.intf.name),1))],10,KLr)}}}),t$r=["id","data-node-type"],n$r={class:"__title-label"},r$r={class:"__menu"},i$r={class:"__outputs"},s$r={class:"__inputs"},o$r=Zn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(t,{emit:e}){const n=t,r=e,{viewModel:i}=Lo(),{graph:s,switchGraph:o}=da(),a=We(null),l=We(!1),c=We(""),u=We(null),d=We(!1),f=We(!1),h=Je(()=>{const L=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return n.node.type.startsWith(Zf)&&L.push({value:"editSubgraph",label:"Edit Subgraph"}),L}),p=Je(()=>({"--selected":n.selected,"--dragging":n.dragging,"--two-column":!!n.node.twoColumn})),T=Je(()=>({"--reverse-y":n.node.reverseY??i.value.settings.nodes.reverseY})),m=Je(()=>{var L,P;return{top:`${((L=n.node.position)==null?void 0:L.y)??0}px`,left:`${((P=n.node.position)==null?void 0:P.x)??0}px`,"--width":`${n.node.width??i.value.settings.nodes.defaultWidth}px`}}),O=Je(()=>Object.values(n.node.inputs).filter(L=>!L.hidden)),g=Je(()=>Object.values(n.node.outputs).filter(L=>!L.hidden)),Q=()=>{r("select")},v=L=>{n.selected||Q(),r("start-drag",L)},_=()=>{f.value=!0},y=async L=>{var P;switch(L){case"delete":s.value.removeNode(n.node);break;case"rename":c.value=n.node.title,l.value=!0,await Fe(),(P=u.value)==null||P.focus();break;case"editSubgraph":o(n.node.template);break}},S=()=>{n.node.title=c.value,l.value=!1},x=()=>{a.value&&i.value.hooks.renderNode.execute({node:n.node,el:a.value})},E=L=>{d.value=!0,L.preventDefault()},C=L=>{if(!d.value)return;const P=n.node.width+L.movementX/s.value.scaling,A=i.value.settings.nodes.minWidth,q=i.value.settings.nodes.maxWidth;n.node.width=Math.max(A,Math.min(q,P))},w=()=>{d.value=!1};return Ii(()=>{x(),window.addEventListener("mousemove",C),window.addEventListener("mouseup",w)}),Au(x),$c(()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",w)}),(L,P)=>(k(),R("div",{id:L.node.id,ref_key:"el",ref:a,class:ye(["baklava-node",p.value]),style:qn(m.value),"data-node-type":L.node.type,onPointerdown:Q},[pn(i).settings.nodes.resizable?(k(),R("div",{key:0,class:"__resize-handle",onMousedown:E},null,32)):ne("",!0),er(L.$slots,"title",{},()=>[b("div",{class:"__title",onPointerdown:oe(v,["self","stop"])},[l.value?He((k(),R("input",{key:1,ref_key:"renameInputEl",ref:u,"onUpdate:modelValue":P[1]||(P[1]=A=>c.value=A),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:S,onKeydown:gr(S,["enter"])},null,544)),[[vt,c.value]]):(k(),R(Ve,{key:0},[b("div",n$r,ae(L.node.title),1),b("div",r$r,[te(_ae,{class:"--clickable",onClick:_}),te(pn(hL),{modelValue:f.value,"onUpdate:modelValue":P[0]||(P[0]=A=>f.value=A),x:0,y:0,items:h.value,onClick:y},null,8,["modelValue","items"])])],64))],32)]),er(L.$slots,"content",{},()=>[b("div",{class:ye(["__content",T.value]),onKeydown:P[2]||(P[2]=gr(oe(()=>{},["stop"]),["delete"]))},[b("div",i$r,[(k(!0),R(Ve,null,dt(g.value,A=>er(L.$slots,"nodeInterface",{key:A.id,type:"output",node:L.node,intf:A},()=>[te(EY,{node:L.node,intf:A},null,8,["node","intf"])])),128))]),b("div",s$r,[(k(!0),R(Ve,null,dt(O.value,A=>er(L.$slots,"nodeInterface",{key:A.id,type:"input",node:L.node,intf:A},()=>[te(EY,{node:L.node,intf:A},null,8,["node","intf"])])),128))])],34)])],46,t$r))}}),a$r=Zn({props:{x1:{type:Number,required:!0},y1:{type:Number,required:!0},x2:{type:Number,required:!0},y2:{type:Number,required:!0},state:{type:Number,default:qo.NONE},isTemporary:{type:Boolean,default:!1}},setup(t){const{viewModel:e}=Lo(),{graph:n}=da(),r=(o,a)=>{const l=(o+n.value.panning.x)*n.value.scaling,c=(a+n.value.panning.y)*n.value.scaling;return[l,c]},i=Je(()=>{const[o,a]=r(t.x1,t.y1),[l,c]=r(t.x2,t.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${c}`;{const u=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+u} ${a}, ${l-u} ${c}, ${l} ${c}`}}),s=Je(()=>({"--temporary":t.isTemporary,"--allowed":t.state===qo.ALLOWED,"--forbidden":t.state===qo.FORBIDDEN}));return{d:i,classes:s}}}),l$r=["d"];function c$r(t,e,n,r,i,s){return k(),R("path",{class:ye(["baklava-connection",t.classes]),d:t.d},null,10,l$r)}const vae=xr(a$r,[["render",c$r]]);function u$r(t){return document.getElementById(t.id)}function Cu(t){const e=document.getElementById(t.id),n=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:n&&n.length>0?n[0]:null}}const d$r=Zn({components:{"connection-view":vae},props:{connection:{type:Object,required:!0}},setup(t){const{graph:e}=da();let n;const r=We({x1:0,y1:0,x2:0,y2:0}),i=Je(()=>t.connection.isInDanger?qo.FORBIDDEN:qo.NONE),s=Je(()=>{var c;return(c=e.value.findNodeById(t.connection.from.nodeId))==null?void 0:c.position}),o=Je(()=>{var c;return(c=e.value.findNodeById(t.connection.to.nodeId))==null?void 0:c.position}),a=c=>c.node&&c.interface&&c.port?[c.node.offsetLeft+c.interface.offsetLeft+c.port.offsetLeft+c.port.clientWidth/2,c.node.offsetTop+c.interface.offsetTop+c.port.offsetTop+c.port.clientHeight/2]:[0,0],l=()=>{const c=Cu(t.connection.from),u=Cu(t.connection.to);c.node&&u.node&&(n||(n=new ResizeObserver(()=>{l()}),n.observe(c.node),n.observe(u.node)));const[d,f]=a(c),[h,p]=a(u);r.value={x1:d,y1:f,x2:h,y2:p}};return Ii(async()=>{await Fe(),l()}),$c(()=>{n&&n.disconnect()}),br([s,o],()=>l(),{deep:!0}),{d:r,state:i}}});function f$r(t,e,n,r,i,s){const o=Xe("connection-view");return k(),Qt(o,{x1:t.d.x1,y1:t.d.y1,x2:t.d.x2,y2:t.d.y2,state:t.state},null,8,["x1","y1","x2","y2","state"])}const h$r=xr(d$r,[["render",f$r]]);function G9(t){return t.node&&t.interface&&t.port?[t.node.offsetLeft+t.interface.offsetLeft+t.port.offsetLeft+t.port.clientWidth/2,t.node.offsetTop+t.interface.offsetTop+t.port.offsetTop+t.port.clientHeight/2]:[0,0]}const p$r=Zn({components:{"connection-view":vae},props:{connection:{type:Object,required:!0}},setup(t){const e=Je(()=>t.connection?t.connection.status:qo.NONE);return{d:Je(()=>{if(!t.connection)return{input:[0,0],output:[0,0]};const r=G9(Cu(t.connection.from)),i=t.connection.to?G9(Cu(t.connection.to)):[t.connection.mx||r[0],t.connection.my||r[1]];return t.connection.from.isInput?{input:i,output:r}:{input:r,output:i}}),status:e}}});function T$r(t,e,n,r,i,s){const o=Xe("connection-view");return k(),Qt(o,{x1:t.d.input[0],y1:t.d.input[1],x2:t.d.output[0],y2:t.d.output[1],state:t.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const O$r=xr(p$r,[["render",T$r]]),m$r=Zn({setup(){const{viewModel:t}=Lo(),{graph:e}=da(),n=We(null),r=Bh(t.value.settings.sidebar,"width"),i=Je(()=>t.value.settings.sidebar.resizable),s=Je(()=>{const d=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===d)}),o=Je(()=>({width:`${r.value}px`})),a=Je(()=>s.value?[...Object.values(s.value.inputs),...Object.values(s.value.outputs)].filter(f=>f.displayInSidebar&&f.component):[]),l=()=>{e.value.sidebar.visible=!1},c=()=>{window.addEventListener("mousemove",u),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",u)},{once:!0})},u=d=>{var f,h;const p=((h=(f=n.value)==null?void 0:f.parentElement)==null?void 0:h.getBoundingClientRect().width)??500;let T=r.value-d.movementX;T<300?T=300:T>.9*p&&(T=.9*p),r.value=T};return{el:n,graph:e,resizable:i,node:s,styles:o,displayedInterfaces:a,startResize:c,close:l}}}),g$r={class:"__header"},Q$r={class:"__node-name"};function _$r(t,e,n,r,i,s){return k(),R("div",{ref:"el",class:ye(["baklava-sidebar",{"--open":t.graph.sidebar.visible}]),style:qn(t.styles)},[t.resizable?(k(),R("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>t.startResize&&t.startResize(...o))},null,32)):ne("",!0),b("div",g$r,[b("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>t.close&&t.close(...o))},"×"),b("div",Q$r,[b("b",null,ae(t.node?t.node.title:""),1)])]),(k(!0),R(Ve,null,dt(t.displayedInterfaces,o=>(k(),R("div",{key:o.id,class:"__interface"},[(k(),Qt(t7(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:t.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const v$r=xr(m$r,[["render",_$r]]),y$r=Zn({__name:"Minimap",setup(t){const{viewModel:e}=Lo(),{graph:n}=da(),r=We(null),i=We(!1);let s,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const c=()=>{var y,S;if(!s)return;s.canvas.width=r.value.offsetWidth,s.canvas.height=r.value.offsetHeight;const x=new Map,E=new Map;for(const A of n.value.nodes){const q=u$r(A),X=(q==null?void 0:q.offsetWidth)??0,F=(q==null?void 0:q.offsetHeight)??0,H=((y=A.position)==null?void 0:y.x)??0,z=((S=A.position)==null?void 0:S.y)??0;x.set(A,{x1:H,y1:z,x2:H+X,y2:z+F}),E.set(A,q)}const C={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const A of x.values())A.x1C.x2&&(C.x2=A.x2),A.y2>C.y2&&(C.y2=A.y2);const w=50;C.x1-=w,C.y1-=w,C.x2+=w,C.y2+=w,a=C;const L=s.canvas.width/s.canvas.height,P=(a.x2-a.x1)/(a.y2-a.y1);if(L>P){const A=(L-P)*(a.y2-a.y1)*.5;a.x1-=A,a.x2+=A}else{const A=a.x2-a.x1,q=a.y2-a.y1,X=(A-L*q)/L*.5;a.y1-=X,a.y2+=X}s.clearRect(0,0,s.canvas.width,s.canvas.height),s.strokeStyle="white";for(const A of n.value.connections){const[q,X]=G9(Cu(A.from)),[F,H]=G9(Cu(A.to)),[z,U]=u(q,X),[j,re]=u(F,H);if(s.beginPath(),s.moveTo(z,U),e.value.settings.useStraightConnections)s.lineTo(j,re);else{const K=.3*Math.abs(z-j);s.bezierCurveTo(z+K,U,j-K,re,j,re)}s.stroke()}s.strokeStyle="lightgray";for(const[A,q]of x.entries()){const[X,F]=u(q.x1,q.y1),[H,z]=u(q.x2,q.y2);s.fillStyle=f(E.get(A)),s.beginPath(),s.rect(X,F,H-X,z-F),s.fill(),s.stroke()}if(i.value){const A=p(),[q,X]=u(A.x1,A.y1),[F,H]=u(A.x2,A.y2);s.fillStyle="rgba(255, 255, 255, 0.2)",s.fillRect(q,X,F-q,H-X)}},u=(y,S)=>[(y-a.x1)/(a.x2-a.x1)*s.canvas.width,(S-a.y1)/(a.y2-a.y1)*s.canvas.height],d=(y,S)=>[y*(a.x2-a.x1)/s.canvas.width+a.x1,S*(a.y2-a.y1)/s.canvas.height+a.y1],f=y=>{if(y){const S=y.querySelector(".__content");if(S){const E=h(S);if(E)return E}const x=h(y);if(x)return x}return"gray"},h=y=>{const S=getComputedStyle(y).backgroundColor;if(S&&S!=="rgba(0, 0, 0, 0)")return S},p=()=>{const y=r.value.parentElement.offsetWidth,S=r.value.parentElement.offsetHeight,x=y/n.value.scaling-n.value.panning.x,E=S/n.value.scaling-n.value.panning.y;return{x1:-n.value.panning.x,y1:-n.value.panning.y,x2:x,y2:E}},T=y=>{y.button===0&&(o=!0,m(y))},m=y=>{if(o){const[S,x]=d(y.offsetX,y.offsetY),E=p(),C=(E.x2-E.x1)/2,w=(E.y2-E.y1)/2;n.value.panning.x=-(S-C),n.value.panning.y=-(x-w)}},O=()=>{o=!1},g=()=>{i.value=!0},Q=()=>{i.value=!1,O()};br([i,n.value.panning,()=>n.value.scaling,()=>n.value.connections.length],()=>{c()});const v=Je(()=>n.value.nodes.map(y=>y.position)),_=Je(()=>n.value.nodes.map(y=>y.width));return br([v,_],()=>{c()},{deep:!0}),Ii(()=>{s=r.value.getContext("2d"),s.imageSmoothingQuality="high",c(),l=setInterval(c,500)}),$c(()=>{clearInterval(l)}),(y,S)=>(k(),R("canvas",{ref_key:"canvas",ref:r,class:"baklava-minimap",onMouseenter:g,onMouseleave:Q,onMousedown:oe(T,["self"]),onMousemove:oe(m,["self"]),onMouseup:O,onContextmenu:S[0]||(S[0]=oe(()=>{},["stop","prevent"]))},null,544))}}),b$r=Zn({components:{ContextMenu:hL,VerticalDots:_ae},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(t){const{viewModel:e}=Lo(),{switchGraph:n}=da(),r=We(!1),i=Je(()=>t.type.startsWith(Zf));return{showContextMenu:r,hasContextMenu:i,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{r.value=!0},onContextMenuClick:l=>{const c=t.type.substring(Zf.length),u=e.value.editor.graphTemplates.find(d=>d.id===c);if(u)switch(l){case"editSubgraph":n(u);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(u);break}}}}}),S$r=["data-node-type"],x$r={class:"__title"},E$r={class:"__title-label"},w$r={key:0,class:"__menu"};function C$r(t,e,n,r,i,s){const o=Xe("vertical-dots"),a=Xe("context-menu");return k(),R("div",{class:"baklava-node --palette","data-node-type":t.type},[b("div",x$r,[b("div",E$r,ae(t.title),1),t.hasContextMenu?(k(),R("div",w$r,[te(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=oe(()=>{},["stop","prevent"])),onClick:oe(t.openContextMenu,["stop","prevent"])},null,8,["onClick"]),te(a,{modelValue:t.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>t.showContextMenu=l),x:-100,y:0,items:t.contextMenuItems,onClick:t.onContextMenuClick,onPointerdown:e[2]||(e[2]=oe(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):ne("",!0)])],8,S$r)}const wY=xr(b$r,[["render",C$r]]),L$r={key:0},$$r=Zn({__name:"NodePalette",setup(t){const{viewModel:e}=Lo(),{x:n,y:r}=ILr(),{transform:i}=Tae(),s=pae(e),o=_i("editorEl"),a=We(null),l=Je(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:u,top:d}=o.value.getBoundingClientRect();return{top:`${r.value-d}px`,left:`${n.value-u}px`}}),c=(u,d)=>{a.value={type:u,nodeInformation:d};const f=()=>{const h=vi(new d.type);e.value.displayedGraph.addNode(h);const p=o.value.getBoundingClientRect(),[T,m]=i(n.value-p.left,r.value-p.top);h.position.x=T,h.position.y=m,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(u,d)=>(k(),R(Ve,null,[b("div",{class:"baklava-node-palette",onContextmenu:d[0]||(d[0]=oe(()=>{},["stop","prevent"]))},[(k(!0),R(Ve,null,dt(pn(s),f=>(k(),R("section",{key:f.name},[f.name!=="default"?(k(),R("h1",L$r,ae(f.name),1)):ne("",!0),(k(!0),R(Ve,null,dt(f.nodeTypes,(h,p)=>(k(),Qt(wY,{key:p,type:p,title:h.title,onPointerdown:T=>c(p,h)},null,8,["type","title","onPointerdown"]))),128))]))),128))],32),te(cr,{name:"fade"},{default:Ie(()=>[a.value?(k(),R("div",{key:0,class:"baklava-dragged-node",style:qn(l.value)},[te(wY,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):ne("",!0)]),_:1})],64))}});let K8;const A$r=new Uint8Array(16);function k$r(){if(!K8&&(K8=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!K8))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K8(A$r)}const pi=[];for(let t=0;t<256;++t)pi.push((t+256).toString(16).slice(1));function P$r(t,e=0){return pi[t[e+0]]+pi[t[e+1]]+pi[t[e+2]]+pi[t[e+3]]+"-"+pi[t[e+4]]+pi[t[e+5]]+"-"+pi[t[e+6]]+pi[t[e+7]]+"-"+pi[t[e+8]]+pi[t[e+9]]+"-"+pi[t[e+10]]+pi[t[e+11]]+pi[t[e+12]]+pi[t[e+13]]+pi[t[e+14]]+pi[t[e+15]]}const R$r=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),CY={randomUUID:R$r};function W9(t,e,n){if(CY.randomUUID&&!t)return CY.randomUUID();t=t||{};const r=t.random||(t.rng||k$r)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,P$r(r)}const Kf="SAVE_SUBGRAPH";function M$r(t,e){const n=()=>{const r=t.value;if(!r.template)throw new Error("Graph template property not set");r.template.update(r.save()),r.template.panning=r.panning,r.template.scaling=r.scaling};e.registerCommand(Kf,{canExecute:()=>{var r;return t.value!==((r=t.value.editor)==null?void 0:r.graph)},execute:n})}const D$r={},N$r={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},I$r=b("polyline",{points:"6 9 12 15 18 9"},null,-1),H$r=[I$r];function V$r(t,e){return k(),R("svg",N$r,H$r)}const q$r=xr(D$r,[["render",V$r]]),U$r=Zn({components:{"i-arrow":q$r},props:{intf:{type:Object,required:!0}},setup(t){const e=We(null),n=We(!1),r=Je(()=>t.intf.items.find(o=>typeof o=="string"?o===t.intf.value:o.value===t.intf.value)),i=Je(()=>r.value?typeof r.value=="string"?r.value:r.value.text:""),s=o=>{t.intf.value=typeof o=="string"?o:o.value};return gae(e,()=>{n.value=!1}),{el:e,open:n,selectedItem:r,selectedText:i,setSelected:s}}}),B$r=["title"],z$r={class:"__selected"},X$r={class:"__text"},F$r={class:"__icon"},j$r={class:"__dropdown"},Y$r={class:"item --header"},G$r=["onClick"];function W$r(t,e,n,r,i,s){const o=Xe("i-arrow");return k(),R("div",{ref:"el",class:ye(["baklava-select",{"--open":t.open}]),title:t.intf.name,onClick:e[0]||(e[0]=a=>t.open=!t.open)},[b("div",z$r,[b("div",X$r,ae(t.selectedText),1),b("div",F$r,[te(o)])]),te(cr,{name:"slide-fade"},{default:Ie(()=>[He(b("div",j$r,[b("div",Y$r,ae(t.intf.name),1),(k(!0),R(Ve,null,dt(t.intf.items,(a,l)=>(k(),R("div",{key:l,class:ye(["item",{"--active":a===t.selectedItem}]),onClick:c=>t.setSelected(a)},ae(typeof a=="string"?a:a.text),11,G$r))),128))],512),[[mr,t.open]])]),_:1})],10,B$r)}const Z$r=xr(U$r,[["render",W$r]]);class K$r extends _r{constructor(e,n,r){super(e,n),this.component=rs(Z$r),this.items=r}}const J$r=Zn({props:{intf:{type:Object,required:!0}}});function eAr(t,e,n,r,i,s){return k(),R("div",null,ae(t.intf.value),1)}const tAr=xr(J$r,[["render",eAr]]);class nAr extends _r{constructor(e,n){super(e,n),this.component=rs(tAr),this.setPort(!1)}}const rAr=Zn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){return{v:Je({get:()=>t.modelValue,set:r=>{e("update:modelValue",r)}})}}}),iAr=["placeholder","title"];function sAr(t,e,n,r,i,s){return k(),R("div",null,[He(b("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.v=o),type:"text",class:"baklava-input",placeholder:t.intf.name,title:t.intf.name},null,8,iAr),[[vt,t.v]])])}const oAr=xr(rAr,[["render",sAr]]);class M7 extends _r{constructor(){super(...arguments),this.component=rs(oAr)}}class yae extends cL{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new M7("Name","Input").setPort(!1)},this.outputs={placeholder:new _r("Connection",void 0)}}}class bae extends uL{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new M7("Name","Output").setPort(!1),placeholder:new _r("Connection",void 0)},this.outputs={output:new _r("Output",void 0).setHidden(!0)}}}const Sae="CREATE_SUBGRAPH",LY=[xu,Eu];function aAr(t,e,n){const r=()=>t.value.selectedNodes.filter(s=>!LY.includes(s.type)).length>0,i=()=>{const{viewModel:s}=Lo(),o=t.value,a=t.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(E=>!LY.includes(E.type)),c=l.flatMap(E=>Object.values(E.inputs)),u=l.flatMap(E=>Object.values(E.outputs)),d=o.connections.filter(E=>!u.includes(E.from)&&c.includes(E.to)),f=o.connections.filter(E=>u.includes(E.from)&&!c.includes(E.to)),h=o.connections.filter(E=>u.includes(E.from)&&c.includes(E.to)),p=l.map(E=>E.save()),T=h.map(E=>({id:E.id,from:E.from.id,to:E.to.id})),m=new Map,{xLeft:O,xRight:g,yTop:Q}=lAr(l);for(const[E,C]of d.entries()){const w=new yae;w.inputs.name.value=C.to.name,p.push({...w.save(),position:{x:g-s.value.settings.nodes.defaultWidth-100,y:Q+E*200}}),T.push({id:W9(),from:w.outputs.placeholder.id,to:C.to.id}),m.set(C.to.id,w.graphInterfaceId)}for(const[E,C]of f.entries()){const w=new bae;w.inputs.name.value=C.from.name,p.push({...w.save(),position:{x:O+100,y:Q+E*200}}),T.push({id:W9(),from:C.from.id,to:w.inputs.placeholder.id}),m.set(C.from.id,w.graphInterfaceId)}const v=vi(new uT({connections:T,nodes:p,inputs:[],outputs:[]},a));a.addGraphTemplate(v);const _=a.nodeTypes.get(wu(v));if(!_)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");o.activeTransactions++;const y=vi(new _.type);o.addNode(y);const S=Math.round(l.map(E=>E.position.x).reduce((E,C)=>E+C,0)/l.length),x=Math.round(l.map(E=>E.position.y).reduce((E,C)=>E+C,0)/l.length);y.position.x=S,y.position.y=x,d.forEach(E=>{o.removeConnection(E),o.addConnection(E.from,y.inputs[m.get(E.to.id)])}),f.forEach(E=>{o.removeConnection(E),o.addConnection(y.outputs[m.get(E.from.id)],E.to)}),l.forEach(E=>o.removeNode(E)),o.activeTransactions--,e.canExecuteCommand(Kf)&&e.executeCommand(Kf),n(v),t.value.panning={...o.panning},t.value.scaling=o.scaling};e.registerCommand(Sae,{canExecute:r,execute:i})}function lAr(t){const e=t.reduce((i,s)=>{const o=s.position.x;return o{const o=s.position.y;return o{const o=s.position.x+s.width;return o>i?o:i},-1/0),xRight:e,yTop:n}}class $Y{constructor(e,n){this.type=e,e==="addNode"?this.nodeId=n:this.nodeState=n}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const n=e.editor.nodeTypes.get(this.nodeState.type);if(!n)return;const r=new n.type;e.addNode(r),r.load(this.nodeState),this.nodeId=r.id}removeNode(e){const n=e.nodes.find(r=>r.id===this.nodeId);n&&(this.nodeState=n.save(),e.removeNode(n))}}class AY{constructor(e,n){if(this.type=e,e==="addConnection")this.connectionId=n;else{const r=n;this.connectionState={id:r.id,from:r.from.id,to:r.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const n=e.findNodeInterface(this.connectionState.from),r=e.findNodeInterface(this.connectionState.to);if(!n||!r)return;const i=e.addConnection(n,r);i&&(i.id=this.connectionState.id),this.connectionId=i==null?void 0:i.id}removeConnection(e){const n=e.connections.find(r=>r.id===this.connectionId);n&&(this.connectionState={id:n.id,from:n.from.id,to:n.to.id},e.removeConnection(n))}}class cAr{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let n=this.steps.length-1;n>=0;n--)this.steps[n].undo(e)}redo(e){for(let n=0;n{if(!s.value)if(a.value)l.value.push(m);else for(o.value!==i.value.length-1&&(i.value=i.value.slice(0,o.value+1)),i.value.push(m),o.value++;i.value.length>r.value;)i.value.shift()},u=()=>{a.value=!0},d=()=>{a.value=!1,l.value.length>0&&(c(new cAr(l.value)),l.value=[])},f=()=>i.value.length!==0&&o.value!==-1,h=()=>{f()&&(s.value=!0,i.value[o.value--].undo(t.value),s.value=!1)},p=()=>i.value.length!==0&&o.value{p()&&(s.value=!0,i.value[++o.value].redo(t.value),s.value=!1)};return br(t,(m,O)=>{O&&(O.events.addNode.unsubscribe(n),O.events.removeNode.unsubscribe(n),O.events.addConnection.unsubscribe(n),O.events.removeConnection.unsubscribe(n)),m&&(m.events.addNode.subscribe(n,g=>{c(new $Y("addNode",g.id))}),m.events.removeNode.subscribe(n,g=>{c(new $Y("removeNode",g.save()))}),m.events.addConnection.subscribe(n,g=>{c(new AY("addConnection",g.id))}),m.events.removeConnection.subscribe(n,g=>{c(new AY("removeConnection",g))}))},{immediate:!0}),e.registerCommand($x,{canExecute:f,execute:h}),e.registerCommand(Ax,{canExecute:p,execute:T}),e.registerCommand(pL,{canExecute:()=>!a.value,execute:u}),e.registerCommand(TL,{canExecute:()=>a.value,execute:d}),e.registerHotkey(["Control","z"],$x),e.registerHotkey(["Control","y"],Ax),vi({maxSteps:r})}const kx="DELETE_NODES";function dAr(t,e){e.registerCommand(kx,{canExecute:()=>t.value.selectedNodes.length>0,execute(){e.executeCommand(pL);for(let n=t.value.selectedNodes.length-1;n>=0;n--){const r=t.value.selectedNodes[n];t.value.removeNode(r)}e.executeCommand(TL)}}),e.registerHotkey(["Delete"],kx)}const xae="SWITCH_TO_MAIN_GRAPH";function fAr(t,e,n){e.registerCommand(xae,{canExecute:()=>t.value!==t.value.editor.graph,execute:()=>{e.executeCommand(Kf),n(t.value.editor.graph)}})}function hAr(t,e,n){dAr(t,e),aAr(t,e,n),M$r(t,e),fAr(t,e,n)}const Px="COPY",Rx="PASTE",pAr="CLEAR_CLIPBOARD";function TAr(t,e,n){const r=Symbol("ClipboardToken"),i=We(""),s=We(""),o=Je(()=>!i.value),a=()=>{i.value="",s.value=""},l=()=>{const d=t.value.selectedNodes.flatMap(h=>[...Object.values(h.inputs),...Object.values(h.outputs)]),f=t.value.connections.filter(h=>d.includes(h.from)||d.includes(h.to)).map(h=>({from:h.from.id,to:h.to.id}));s.value=JSON.stringify(f),i.value=JSON.stringify(t.value.selectedNodes.map(h=>h.save()))},c=(d,f,h)=>{for(const p of d){let T;if((!h||h==="input")&&(T=Object.values(p.inputs).find(m=>m.id===f)),!T&&(!h||h==="output")&&(T=Object.values(p.outputs).find(m=>m.id===f)),T)return T}},u=()=>{if(o.value)return;const d=new Map,f=JSON.parse(i.value),h=JSON.parse(s.value),p=[],T=[],m=t.value;n.executeCommand(pL);for(const O of f){const g=e.value.nodeTypes.get(O.type);if(!g){console.warn(`Node type ${O.type} not registered`);return}const Q=new g.type,v=Q.id;p.push(Q),Q.hooks.beforeLoad.subscribe(r,_=>{const y=_;return y.position&&(y.position.x+=100,y.position.y+=100),Q.hooks.beforeLoad.unsubscribe(r),y}),m.addNode(Q),Q.load({...O,id:v}),Q.id=v,d.set(O.id,v);for(const _ of Object.values(Q.inputs)){const y=W9();d.set(_.id,y),_.id=y}for(const _ of Object.values(Q.outputs)){const y=W9();d.set(_.id,y),_.id=y}}for(const O of h){const g=c(p,d.get(O.from),"output"),Q=c(p,d.get(O.to),"input");if(!g||!Q)continue;const v=m.addConnection(g,Q);v&&T.push(v)}return t.value.selectedNodes=p,n.executeCommand(TL),{newNodes:p,newConnections:T}};return n.registerCommand(Px,{canExecute:()=>t.value.selectedNodes.length>0,execute:l}),n.registerHotkey(["Control","c"],Px),n.registerCommand(Rx,{canExecute:()=>!o.value,execute:u}),n.registerHotkey(["Control","v"],Rx),n.registerCommand(pAr,{canExecute:()=>!0,execute:a}),vi({isEmpty:o})}const OAr="OPEN_SIDEBAR";function mAr(t,e){e.registerCommand(OAr,{execute:n=>{t.value.sidebar.nodeId=n,t.value.sidebar.visible=!0},canExecute:()=>!0})}function gAr(t,e){mAr(t,e)}const QAr={},_Ar={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},vAr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),yAr=b("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),bAr=[vAr,yAr];function SAr(t,e){return k(),R("svg",_Ar,bAr)}const xAr=xr(QAr,[["render",SAr]]),EAr={},wAr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},CAr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),LAr=b("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),$Ar=[CAr,LAr];function AAr(t,e){return k(),R("svg",wAr,$Ar)}const kAr=xr(EAr,[["render",AAr]]),PAr={},RAr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},MAr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),DAr=b("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),NAr=b("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),IAr=b("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),HAr=[MAr,DAr,NAr,IAr];function VAr(t,e){return k(),R("svg",RAr,HAr)}const qAr=xr(PAr,[["render",VAr]]),UAr={},BAr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},zAr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),XAr=b("path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},null,-1),FAr=b("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),jAr=[zAr,XAr,FAr];function YAr(t,e){return k(),R("svg",BAr,jAr)}const GAr=xr(UAr,[["render",YAr]]),WAr={},ZAr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},KAr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),JAr=b("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),ekr=b("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"},null,-1),tkr=[KAr,JAr,ekr];function nkr(t,e){return k(),R("svg",ZAr,tkr)}const rkr=xr(WAr,[["render",nkr]]),ikr={},skr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},okr=b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),akr=b("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"},null,-1),lkr=b("circle",{cx:"12",cy:"14",r:"2"},null,-1),ckr=b("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),ukr=[okr,akr,lkr,ckr];function dkr(t,e){return k(),R("svg",skr,ukr)}const fkr=xr(ikr,[["render",dkr]]),hkr={},pkr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Tkr=To(' ',6),Okr=[Tkr];function mkr(t,e){return k(),R("svg",pkr,Okr)}const gkr=xr(hkr,[["render",mkr]]),Qkr={},_kr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},vkr=To(' ',18),ykr=[vkr];function bkr(t,e){return k(),R("svg",_kr,ykr)}const Skr=xr(Qkr,[["render",bkr]]),xkr={},Ekr={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},wkr=To(' ',6),Ckr=[wkr];function Lkr(t,e){return k(),R("svg",Ekr,Ckr)}const $kr=xr(xkr,[["render",Lkr]]),Akr=Zn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:t}=Lo();return{viewModel:t}}}),kkr=["disabled","title"];function Pkr(t,e,n,r,i,s){return k(),R("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!t.viewModel.commandHandler.canExecuteCommand(t.command),title:t.title,onClick:e[0]||(e[0]=o=>t.viewModel.commandHandler.executeCommand(t.command))},[t.icon?(k(),Qt(t7(t.icon),{key:0})):(k(),R(Ve,{key:1},[Se(ae(t.title),1)],64))],8,kkr)}const Rkr=xr(Akr,[["render",Pkr]]),Mkr=Zn({components:{ToolbarButton:Rkr},setup(){const{viewModel:t}=Lo();return{isSubgraph:Je(()=>t.value.displayedGraph!==t.value.editor.graph),commands:[{command:Px,title:"Copy",icon:rkr},{command:Rx,title:"Paste",icon:GAr},{command:kx,title:"Delete selected nodes",icon:$kr},{command:$x,title:"Undo",icon:xAr},{command:Ax,title:"Redo",icon:kAr},{command:Ih,title:"Box Select",icon:Skr},{command:Sae,title:"Create Subgraph",icon:gkr}],subgraphCommands:[{command:Kf,title:"Save Subgraph",icon:fkr},{command:xae,title:"Back to Main Graph",icon:qAr}]}}});function Dkr(t,e,n,r,i,s){const o=Xe("toolbar-button");return k(),R("div",{class:"baklava-toolbar",onContextmenu:e[0]||(e[0]=oe(()=>{},["stop","prevent"]))},[(k(!0),R(Ve,null,dt(t.commands,a=>(k(),Qt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),t.isSubgraph?(k(!0),R(Ve,{key:0},dt(t.subgraphCommands,a=>(k(),Qt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):ne("",!0)],32)}const Nkr=xr(Mkr,[["render",Dkr]]),Ikr={class:"connections-container"},Hkr=Zn({__name:"Editor",props:{viewModel:{}},setup(t){const e=t,n=Symbol("EditorToken"),r=Bh(e,"viewModel");yLr(r);const i=We(null);Q4("editorEl",i);const s=Je(()=>e.viewModel.displayedGraph.nodes),o=Je(()=>e.viewModel.displayedGraph.nodes.map(x=>fae(Bh(x,"position")))),a=Je(()=>e.viewModel.displayedGraph.connections),l=Je(()=>e.viewModel.displayedGraph.selectedNodes),c=bLr(),u=SLr(),d=xLr(r),f=ELr(i),h=Je(()=>({...c.styles.value})),p=We(0);e.viewModel.editor.hooks.load.subscribe(n,x=>(p.value++,x));const T=x=>{c.onPointerMove(x),u.onMouseMove(x)},m=x=>{if(x.button===0){if(f.onPointerDown(x))return;x.target===i.value&&(_(),c.onPointerDown(x)),u.onMouseDown()}},O=x=>{c.onPointerUp(x),u.onMouseUp()},g=x=>{x.key==="Tab"&&x.preventDefault(),e.viewModel.commandHandler.handleKeyDown(x)},Q=x=>{e.viewModel.commandHandler.handleKeyUp(x)},v=x=>{["Control","Shift"].some(E=>e.viewModel.commandHandler.pressedKeys.includes(E))||_(),e.viewModel.displayedGraph.selectedNodes.push(x)},_=()=>{e.viewModel.displayedGraph.selectedNodes=[]},y=x=>{for(const E of e.viewModel.displayedGraph.selectedNodes){const C=s.value.indexOf(E),w=o.value[C];w.onPointerDown(x),document.addEventListener("pointermove",w.onPointerMove)}document.addEventListener("pointerup",S)},S=()=>{for(const x of e.viewModel.displayedGraph.selectedNodes){const E=s.value.indexOf(x),C=o.value[E];C.onPointerUp(),document.removeEventListener("pointermove",C.onPointerMove)}document.removeEventListener("pointerup",S)};return(x,E)=>(k(),R("div",{ref_key:"el",ref:i,tabindex:"-1",class:ye(["baklava-editor",{"baklava-ignore-mouse":!!pn(u).temporaryConnection.value||pn(c).dragging.value,"--temporary-connection":!!pn(u).temporaryConnection.value,"--start-selection-box":pn(f).startSelection}]),onPointermove:oe(T,["self"]),onPointerdown:m,onPointerup:O,onWheel:E[1]||(E[1]=oe((...C)=>pn(c).onMouseWheel&&pn(c).onMouseWheel(...C),["self"])),onKeydown:g,onKeyup:Q,onContextmenu:E[2]||(E[2]=(...C)=>pn(d).open&&pn(d).open(...C))},[er(x.$slots,"background",{},()=>[te(LLr)]),er(x.$slots,"toolbar",{},()=>[x.viewModel.settings.toolbar.enabled?(k(),Qt(Nkr,{key:0})):ne("",!0)]),er(x.$slots,"palette",{},()=>[x.viewModel.settings.palette.enabled?(k(),Qt($$r,{key:0})):ne("",!0)]),(k(),R("svg",Ikr,[(k(!0),R(Ve,null,dt(a.value,C=>(k(),R("g",{key:C.id+p.value.toString()},[er(x.$slots,"connection",{connection:C},()=>[te(h$r,{connection:C},null,8,["connection"])])]))),128)),er(x.$slots,"temporaryConnection",{temporaryConnection:pn(u).temporaryConnection.value},()=>[pn(u).temporaryConnection.value?(k(),Qt(O$r,{key:0,connection:pn(u).temporaryConnection.value},null,8,["connection"])):ne("",!0)])])),b("div",{class:"node-container",style:qn(h.value)},[te(V4,{name:"fade"},{default:Ie(()=>[(k(!0),R(Ve,null,dt(s.value,(C,w)=>er(x.$slots,"node",{key:C.id+p.value.toString(),node:C,selected:l.value.includes(C),dragging:o.value[w].dragging.value,onSelect:L=>v(C),onStartDrag:y},()=>[te(o$r,{node:C,selected:l.value.includes(C),dragging:o.value[w].dragging.value,onSelect:L=>v(C),onStartDrag:y},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),er(x.$slots,"sidebar",{},()=>[x.viewModel.settings.sidebar.enabled?(k(),Qt(v$r,{key:0})):ne("",!0)]),er(x.$slots,"minimap",{},()=>[x.viewModel.settings.enableMinimap?(k(),Qt(y$r,{key:0})):ne("",!0)]),er(x.$slots,"contextMenu",{contextMenu:pn(d)},()=>[x.viewModel.settings.contextMenu.enabled?(k(),Qt(hL,{key:0,modelValue:pn(d).show.value,"onUpdate:modelValue":E[0]||(E[0]=C=>pn(d).show.value=C),items:pn(d).items.value,x:pn(d).x.value,y:pn(d).y.value,onClick:pn(d).onClick},null,8,["modelValue","items","x","y","onClick"])):ne("",!0)]),pn(f).isSelecting?(k(),R("div",{key:0,class:"selection-box",style:qn(pn(f).getStyles())},null,4)):ne("",!0)],34))}});function Vkr(t){const e=We([]),n=We([]);return{pressedKeys:e,handleKeyDown:o=>{e.value.includes(o.key)||e.value.push(o.key),!(document.activeElement&&dae(document.activeElement))&&n.value.forEach(a=>{var l,c;a.keys.every(u=>e.value.includes(u))&&((l=a.options)!=null&&l.preventDefault&&o.preventDefault(),(c=a.options)!=null&&c.stopPropagation&&o.stopPropagation(),t(a.commandName))})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a,l)=>{n.value.push({keys:o,commandName:a,options:l})}}}const qkr=()=>{const t=We(new Map),e=o=>t.value.has(o),n=(o,a)=>{if(t.value.has(o))throw new Error(`Command "${o}" already exists`);t.value.set(o,a)},r=(o,a=!1,...l)=>{if(!t.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return}return t.value.get(o).execute(...l)},i=(o,a=!1,...l)=>{if(!t.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return!1}return t.value.get(o).canExecute(l)},s=Vkr(r);return vi({hasCommand:e,registerCommand:n,executeCommand:r,canExecuteCommand:i,...s})},Ukr=t=>!(t instanceof R7);function Bkr(t,e){return{switchGraph:r=>{let i;if(Ukr(r))i=new R7(t.value),r.createGraph(i);else{if(r!==t.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");i=r}e.value&&e.value!==t.value.graph&&e.value.destroy(),i.panning=i.panning??r.panning??{x:0,y:0},i.scaling=i.scaling??r.scaling??1,i.selectedNodes=i.selectedNodes??[],i.sidebar=i.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=i}}}function zkr(t,e){t.position=t.position??{x:0,y:0},t.disablePointerEvents=!1,t.twoColumn=t.twoColumn??!1,t.width=t.width??e.defaultWidth}const Xkr=()=>({useStraightConnections:!1,enableMinimap:!1,toolbar:{enabled:!0},palette:{enabled:!0},background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{enabled:!0,width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1,reverseY:!1},contextMenu:{enabled:!0,additionalItems:[]}});function Fkr(t){const e=We(new TLr),n=Symbol("ViewModelToken"),r=We(null),i=M1e(r),{switchGraph:s}=Bkr(e,r),o=Je(()=>i.value&&i.value!==e.value.graph),a=vi(Xkr()),l=qkr(),c=uAr(i,l),u=TAr(i,e,l),d={renderNode:new wo(null),renderInterface:new wo(null)};return hAr(i,l,s),gAr(i,l),br(e,(f,h)=>{h&&(h.events.registerGraph.unsubscribe(n),h.graphEvents.beforeAddNode.unsubscribe(n),f.nodeHooks.beforeLoad.unsubscribe(n),f.nodeHooks.afterSave.unsubscribe(n),f.graphTemplateHooks.beforeLoad.unsubscribe(n),f.graphTemplateHooks.afterSave.unsubscribe(n),f.graph.hooks.load.unsubscribe(n),f.graph.hooks.save.unsubscribe(n)),f&&(f.nodeHooks.beforeLoad.subscribe(n,(p,T)=>(T.position=p.position??{x:0,y:0},T.width=p.width??a.nodes.defaultWidth,T.twoColumn=p.twoColumn??!1,p)),f.nodeHooks.afterSave.subscribe(n,(p,T)=>(p.position=T.position,p.width=T.width,p.twoColumn=T.twoColumn,p)),f.graphTemplateHooks.beforeLoad.subscribe(n,(p,T)=>(T.panning=p.panning,T.scaling=p.scaling,p)),f.graphTemplateHooks.afterSave.subscribe(n,(p,T)=>(p.panning=T.panning,p.scaling=T.scaling,p)),f.graph.hooks.load.subscribe(n,(p,T)=>(T.panning=p.panning,T.scaling=p.scaling,p)),f.graph.hooks.save.subscribe(n,(p,T)=>(p.panning=T.panning,p.scaling=T.scaling,p)),f.graphEvents.beforeAddNode.subscribe(n,p=>zkr(p,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(yae,{category:"Subgraphs"}),e.value.registerNodeType(bae,{category:"Subgraphs"}),s(f.graph))},{immediate:!0}),vi({editor:e,displayedGraph:i,isSubgraph:o,settings:a,commandHandler:l,history:c,clipboard:u,hooks:d,switchGraph:s})}const jkr=Yu({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new _r("Request",""),agent_name:()=>new K$r("Personality","",Qo.state.config.personalities).setPort(!1)},outputs:{response:()=>new _r("Response","")},async calculate({request:t}){console.log(Qo.state.config.personalities);let e="";try{e=(await Ae.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),Ykr=Yu({type:"RAGNode",title:"RAG",inputs:{request:()=>new _r("Prompt",""),document_path:()=>new M7("Document path","").setPort(!1)},outputs:{prompt:()=>new _r("Prompt with Data","")},async calculate({request:t,document_path:e}){let n="";try{n=(await Ae.get("/rag",{params:{text:t,doc_path:e}})).data}catch(r){console.error(r)}return{response:n}}}),kY=Yu({type:"Task",title:"Task",inputs:{description:()=>new M7("Task description","").setPort(!1)},outputs:{prompt:()=>new _r("Prompt")},calculate({description:t}){return{prompt:t}}}),PY=Yu({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new _r("Input","")},outputs:{response:()=>new nAr("Text","")},async calculate({request:t}){}}),RY=Yu({type:"LLMNode",title:"LLM",inputs:{request:()=>new _r("Request","")},outputs:{response:()=>new _r("Response","")},async calculate({request:t}){console.log(Qo.state.config.personalities);let e="";try{e=(await Ae.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),Gkr=Yu({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new _r("Question",""),outputs:()=>new M7("choices, one per line","","").setPort(!1)},outputs:{response:()=>new _r("Response","")}}),Wkr=Zn({components:{"baklava-editor":Hkr},setup(){const t=Fkr(),e=new _Lr(t.editor);t.editor.registerNodeType(jkr),t.editor.registerNodeType(kY),t.editor.registerNodeType(Ykr),t.editor.registerNodeType(PY),t.editor.registerNodeType(RY),t.editor.registerNodeType(Gkr);const n=Symbol();e.events.afterRun.subscribe(n,a=>{e.pause(),OLr(a,t.editor),e.resume()}),e.start();function r(a,l,c){const u=new a;return t.displayedGraph.addNode(u),u.position.x=l,u.position.y=c,u}const i=r(kY,300,140),s=r(RY,550,140),o=r(PY,850,140);return t.displayedGraph.addConnection(i.outputs.prompt,s.inputs.request),t.displayedGraph.addConnection(s.outputs.response,o.inputs.text2display),{baklava:t,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),Zkr={style:{width:"100vw",height:"100vh"}};function Kkr(t,e,n,r,i,s){const o=Xe("baklava-editor");return k(),R("div",Zkr,[te(o,{"view-model":t.baklava},null,8,["view-model"]),b("button",{onClick:e[0]||(e[0]=(...a)=>t.saveGraph&&t.saveGraph(...a))},"Save Graph"),b("button",{onClick:e[1]||(e[1]=(...a)=>t.loadGraph&&t.loadGraph(...a))},"Load Graph")])}const Jkr=st(Wkr,[["render",Kkr]]),ePr={},tPr={style:{width:"100vw",height:"100vh"}},nPr=["src"];function rPr(t,e,n,r,i,s){return k(),R("div",tPr,[b("iframe",{src:t.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,nPr)])}const iPr=st(ePr,[["render",rPr]]),sPr={},oPr={style:{width:"100vw",height:"100vh"}},aPr=["src"];function lPr(t,e,n,r,i,s){return k(),R("div",oPr,[b("iframe",{src:t.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,aPr)])}const cPr=st(sPr,[["render",lPr]]),uPr={name:"AppCard",props:{app:{type:Object,required:!0},isFavorite:{type:Boolean,default:!1}},methods:{formatDate(t){const e={year:"numeric",month:"short",day:"numeric"};return new Date(t).toLocaleDateString(void 0,e)}}},dPr={class:"app-card flex flex-col h-full"},fPr={class:"flex-grow"},hPr={class:"flex items-center mb-4"},pPr=["src"],TPr={class:"font-bold text-xl text-gray-800"},OPr={class:"text-sm text-gray-600"},mPr={class:"text-sm text-gray-600"},gPr={class:"text-sm text-gray-600"},QPr={class:"text-sm text-gray-600"},_Pr={class:"text-sm text-gray-600"},vPr={class:"mb-4"},yPr={class:"text-sm text-gray-600 h-20 overflow-y-auto"},bPr={class:"text-sm text-gray-600 mb-2"},SPr={key:0,class:"mb-4"},xPr={class:"text-xs text-gray-500 italic h-16 overflow-y-auto"},EPr={class:"mt-auto pt-4 border-t"},wPr={class:"flex justify-between items-center flex-wrap"},CPr=["title"],LPr=["fill"];function $Pr(t,e,n,r,i,s){return k(),R("div",dPr,[b("div",fPr,[b("div",hPr,[b("img",{src:n.app.icon,alt:"App Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4"},null,8,pPr),b("div",null,[b("h3",TPr,ae(n.app.name),1),b("p",OPr,"Author: "+ae(n.app.author),1),b("p",mPr,"Version: "+ae(n.app.version),1),b("p",gPr,"Category: "+ae(n.app.category),1),b("p",QPr,"Creation date: "+ae(s.formatDate(n.app.creation_date)),1),b("p",_Pr,"Last update: "+ae(s.formatDate(n.app.last_update_date)),1),b("p",{class:ye(["text-sm",n.app.is_public?"text-green-600":"text-orange-600"])},ae(n.app.is_public?"Public App":"Local App"),3)])]),b("div",vPr,[e[10]||(e[10]=b("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),b("p",yPr,ae(n.app.description),1)]),b("p",bPr,"AI Model: "+ae(n.app.model_name),1),n.app.disclaimer&&n.app.disclaimer.trim()!==""?(k(),R("div",SPr,[e[11]||(e[11]=b("h4",{class:"font-semibold mb-1 text-gray-700"},"Disclaimer:",-1)),b("p",xPr,ae(n.app.disclaimer),1)])):ne("",!0)]),b("div",EPr,[b("div",wPr,[b("button",{onClick:e[0]||(e[0]=oe(o=>t.$emit("toggle-favorite",n.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:n.isFavorite?"Remove from favorites":"Add to favorites"},[(k(),R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:n.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[12]||(e[12]=[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,LPr))],8,CPr),n.app.installed?(k(),R("button",{key:0,onClick:e[1]||(e[1]=oe(o=>t.$emit("uninstall",n.app.folder_name),["stop"])),class:"text-red-500 hover:text-red-600 transition duration-300 ease-in-out",title:"Uninstall"},e[13]||(e[13]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):n.app.existsInFolder?(k(),R("button",{key:1,onClick:e[2]||(e[2]=oe(o=>t.$emit("delete",n.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:"Delete"},e[14]||(e[14]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):(k(),R("button",{key:2,onClick:e[3]||(e[3]=oe(o=>t.$emit("install",n.app.folder_name),["stop"])),class:"text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Install"},e[15]||(e[15]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)]))),n.app.installed?(k(),R("button",{key:3,onClick:e[4]||(e[4]=oe(o=>t.$emit("edit",n.app),["stop"])),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Edit"},e[16]||(e[16]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)]))):ne("",!0),b("button",{onClick:e[5]||(e[5]=oe(o=>t.$emit("download",n.app.folder_name),["stop"])),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Download"},e[17]||(e[17]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])),n.app.has_readme?(k(),R("button",{key:4,onClick:e[6]||(e[6]=oe(o=>t.$emit("help",n.app),["stop"])),class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out",title:"Help"},e[18]||(e[18]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M12 21a9 9 0 100-18 9 9 0 000 18z"})],-1)]))):ne("",!0),n.app.installed?(k(),R("button",{key:5,onClick:e[7]||(e[7]=oe(o=>t.$emit("open",n.app),["stop"])),class:"text-indigo-500 hover:text-indigo-600 transition duration-300 ease-in-out",title:"Open"},e[19]||(e[19]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)]))):ne("",!0),n.app.has_server&&n.app.installed?(k(),R("button",{key:6,onClick:e[8]||(e[8]=oe(o=>t.$emit("start-server",n.app.folder_name),["stop"])),class:"text-teal-500 hover:text-teal-600 transition duration-300 ease-in-out",title:"Start Server"},e[20]||(e[20]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M12 5l7 7-7 7"})],-1)]))):ne("",!0),n.app.has_update?(k(),R("button",{key:7,onClick:e[9]||(e[9]=oe(o=>t.$emit("install",n.app.folder_name),["stop"])),class:"relative text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out animate-pulse",title:"Update Available"},e[21]||(e[21]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[b("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),b("span",{class:"absolute top-0 right-0 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-100 transform translate-x-1/2 -translate-y-1/2 bg-red-600 rounded-full"},"!",-1)]))):ne("",!0)])])])}const APr=st(uPr,[["render",$Pr],["__scopeId","data-v-ae134649"]]),kPr={components:{AppCard:APr},data(){return{apps:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"update",sortOrder:"desc",showOnlyInstalled:!1,showOnlyUnInstalled:!1}},computed:{currentCategoryName(){return this.selectedCategory==="all"?"All Apps":this.selectedCategory},combinedApps(){this.apps.map(e=>e.name);const t=new Map(this.apps.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{t.has(e.name)||t.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(t.values())},categories(){return[...new Set(this.combinedApps.map(t=>t.category))]},filteredApps(){return this.combinedApps.filter(t=>{const e=t.name.toLowerCase().includes(this.searchQuery.toLowerCase())||t.description.toLowerCase().includes(this.searchQuery.toLowerCase())||t.author.toLowerCase().includes(this.searchQuery.toLowerCase()),n=this.selectedCategory==="all"||t.category===this.selectedCategory,r=this.showOnlyInstalled&&t.installed||this.showOnlyUnInstalled&&!t.installed||!this.showOnlyInstalled&&!this.showOnlyUnInstalled;return e&&n&&r})},sortedAndFilteredApps(){return[...this.filteredApps].sort((t,e)=>{let n=0;switch(this.sortBy){case"name":n=t.name.localeCompare(e.name);break;case"author":n=t.author.localeCompare(e.author);break;case"date":n=this.getDateValue(t.creation_date)-this.getDateValue(e.creation_date);break;case"update":n=this.getDateValue(t.last_update_date)-this.getDateValue(e.last_update_date);break}return this.sortOrder==="asc"?n:-n})},favoriteApps(){return this.combinedApps.filter(t=>this.favorites.includes(t.appName))}},methods:{getDateValue(t){if(!t)return 0;const e=new Date(t);return isNaN(e.getTime())?0:e.getTime()},toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(t){console.log("Toggling favorite"),console.log(t);const e=this.favorites.indexOf(t);e===-1?this.favorites.push(t):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const t=localStorage.getItem("appZooFavorites");console.log("savedFavorites",t),t&&(this.favorites=JSON.parse(t))},startServer(t){const e={client_id:this.$store.state.client_id,app_name:t};this.$store.state.messageBox.showBlockingMessage(`Loading server.
-This may take some time the first time as some libraries need to be installed.`),Ae.post("/apps/start_server",e).then(n=>{this.$store.state.messageBox.hideMessage(),console.log("Server start initiated:",n.data.message),this.$notify({type:"success",title:"Server Starting",text:n.data.message})}).catch(n=>{var r,i;this.$store.state.messageBox.hideMessage(),console.error("Error starting server:",n),this.$notify({type:"error",title:"Server Start Failed",text:((i=(r=n.response)==null?void 0:r.data)==null?void 0:i.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this.$refs.fileInput.click()},onFileSelected(t){this.selectedFile=t.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,n;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const t=new FormData;t.append("file",this.selectedFile),t.append("client_id",this.$store.state.client_id);try{const r=await Ae.post("/upload_app",t,{headers:{"Content-Type":"multipart/form-data"}});this.message=r.data.message,this.$refs.fileInput.value="",this.selectedFile=null}catch(r){console.error("Error uploading app:",r),this.error=((n=(e=r.response)==null?void 0:e.data)==null?void 0:n.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const t=await Ae.get("/apps");this.apps=t.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const t=await Ae.post("/show_apps_folder",{client_id:this.$store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const t=await Ae.get("/github/apps");this.githubApps=t.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(t){if(t.installed){this.selectedApp=t;const e=await Ae.get(`/apps/${t.folder_name}/README.md`);this.appCode=Kt(e.data)}else this.showMessage(`Please install ${t.folder_name} to view its code.`,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(t){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Installing app ${t}`);try{await Ae.post(`/install/${t}`,{client_id:this.$store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this.$store.state.messageBox.hideMessage()}},async uninstallApp(t){this.loading=!0;try{await Ae.post(`/uninstall/${t}`,{client_id:this.$store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(t){this.loading=!0;try{await Ae.post(`/delete/${t}`,{client_id:this.$store.state.client_id}),this.showMessage("Deletion succeeded!",!0)}catch{this.showMessage("Deletion failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async editApp(t){this.loading=!0;try{const e=await Ae.post("/open_app_in_vscode",{client_id:this.$store.state.client_id,app_name:t.folder_name});this.showMessage(e.data.message,!0)}catch{this.showMessage("Failed to open folder in VSCode.",!1)}finally{this.loading=!1}},async downloadApp(t){this.isLoading=!0,this.error=null;try{const e=await Ae.post("/download_app",{client_id:this.$store.state.client_id,app_name:t},{responseType:"arraybuffer"}),n=e.headers["content-disposition"],r=n&&n.match(/filename="?(.+)"?/i),i=r?r[1]:"app.zip",s=new Blob([e.data],{type:"application/zip"}),o=window.URL.createObjectURL(s),a=document.createElement("a");a.style.display="none",a.href=o,a.download=i,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}catch(e){console.error("Error downloading app:",e),this.error="Failed to download the app. Please try again."}finally{this.isLoading=!1}},openApp(t){t.installed?window.open(`/apps/${t.folder_name}/index.html?client_id=${this.$store.state.client_id}`,"_blank"):this.showMessage(`Please install ${t.name} before opening.`,!1)},showMessage(t,e){this.message=t,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)}},mounted(){this.fetchGithubApps(),this.loadFavoritesFromLocalStorage()}},PPr={class:"app-zoo background-color w-full p-6 pt-12 min-h-screen overflow-y-auto text-blue-900 dark:text-blue-100"},RPr={class:"panels-color shadow-lg rounded-lg p-4 max-w-6xl mx-auto mb-8"},MPr={class:"flex flex-wrap items-center justify-between gap-4"},DPr={class:"flex items-center space-x-2 flex-wrap gap-2"},NPr=["disabled"],IPr={key:0,"data-feather":"upload",class:"w-4 h-4 mr-1"},HPr={key:1,class:"animate-spin inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full mr-1",role:"status","aria-hidden":"true"},VPr={class:"relative flex-grow max-w-xs sm:max-w-sm md:max-w-md"},qPr={class:"flex items-center space-x-4 flex-wrap gap-x-4 gap-y-2"},UPr={class:"flex items-center space-x-2"},BPr=["value"],zPr={class:"flex items-center space-x-3"},XPr={for:"installed-only",class:"label !mb-0 flex items-center cursor-pointer"},FPr={for:"uninstalled-only",class:"label !mb-0 flex items-center cursor-pointer"},jPr={class:"flex items-center space-x-2"},YPr={key:0,"data-feather":"arrow-up",class:"w-4 h-4"},GPr={key:1,"data-feather":"arrow-down",class:"w-4 h-4"},WPr={key:0,class:"flex justify-center items-center space-x-2 my-12","aria-live":"polite"},ZPr={key:1,class:"pb-20"},KPr={key:0,class:"mb-10"},JPr={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"},eRr={class:"h2 text-2xl font-bold mb-4"},tRr={key:1,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"},nRr={key:2,class:"text-center text-blue-500 dark:text-blue-400 py-10"},rRr={key:2,class:"fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-4"},iRr={class:"card w-11/12 max-w-4xl h-5/6 flex flex-col text-blue-900 dark:text-blue-100"},sRr={class:"flex justify-between items-center mb-4 pb-2 border-b border-blue-300 dark:border-blue-600"},oRr={class:"h3 !mb-0"},aRr=["srcdoc"],lRr={key:1,class:"text-center text-red-600 dark:text-red-400 py-10"};function cRr(t,e,n,r,i,s){const o=Xe("app-card");return k(),R("div",PPr,[b("nav",RPr,[b("div",MPr,[b("div",DPr,[b("button",{onClick:e[0]||(e[0]=(...a)=>s.fetchGithubApps&&s.fetchGithubApps(...a)),class:"btn btn-primary btn-sm","aria-label":"Refresh apps from GitHub"},e[11]||(e[11]=[b("i",{"data-feather":"refresh-cw",class:"w-4 h-4 mr-1"},null,-1),Se(" Refresh ")])),b("button",{onClick:e[1]||(e[1]=(...a)=>s.openAppsFolder&&s.openAppsFolder(...a)),class:"btn btn-secondary btn-sm","aria-label":"Open apps folder"},e[12]||(e[12]=[b("i",{"data-feather":"folder",class:"w-4 h-4 mr-1"},null,-1),Se(" Open Folder ")])),b("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>s.onFileSelected&&s.onFileSelected(...a)),accept:".zip",ref:"fileInput",class:"display-none"},null,544),b("button",{onClick:e[3]||(e[3]=(...a)=>s.triggerFileInput&&s.triggerFileInput(...a)),disabled:i.isUploading,class:"btn btn-success btn-sm",title:"Upload App"},[i.isUploading?ne("",!0):(k(),R("i",IPr)),i.isUploading?(k(),R("span",HPr)):ne("",!0),Se(" "+ae(i.isUploading?"Uploading...":"Upload App"),1)],8,NPr)]),b("div",VPr,[e[13]||(e[13]=b("label",{for:"app-search",class:"sr-only"},"Search Apps",-1)),e[14]||(e[14]=b("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[b("i",{"data-feather":"search",class:"w-5 h-5 text-blue-400 dark:text-blue-500"})],-1)),He(b("input",{id:"app-search","onUpdate:modelValue":e[4]||(e[4]=a=>i.searchQuery=a),placeholder:"Search apps...",class:"search-input w-full py-2 px-4 pl-10 text-sm","
+
+
+
+
+ DEBUG [{{ instanceId }}]:
+ showAlbumViewer: {{ showAlbumViewer }}
+ albumImages Count: {{ albumImages.length }}
+ albumImages: {{ JSON.stringify(albumImages) }}
+
+
@@ -19,7 +30,7 @@ import ImageAlbumViewer from './ImageAlbumViewer.vue'; // Adjust path if needed
export default {
name: 'DynamicUIRenderer',
components: {
- ImageAlbumViewer, // Register the child component
+ ImageAlbumViewer,
},
props: {
ui: {
@@ -33,194 +44,309 @@ export default {
},
data() {
return {
- // containerId is computed, moved to computed section
- albumImages: [], // Reactive state for album images
- showAlbumViewer: false, // Reactive state to control v-if
- injectedStyleElements: [], // Keep track of injected styles
+ albumImages: [],
+ showAlbumViewer: false,
+ injectedStyleElements: [],
+ // Added a simple counter to help distinguish render calls
+ renderCount: 0,
};
},
computed: {
- ...mapState(['clientId']), // Map client_id from Vuex store
-
- // Compute containerId based on instanceId prop
+ ...mapState(['clientId']),
containerId() {
+ // Added log
+ console.log(`[${this.instanceId}] Computed containerId: dynamic-ui-${this.instanceId}`);
return `dynamic-ui-${this.instanceId}`;
},
},
watch: {
ui: {
- immediate: true, // Run on component mount
+ immediate: true,
handler(newValue, oldValue) {
- // Only re-render if the UI actually changed or if the container is empty
- // Use $refs here as they are available after the initial render (due to immediate: true)
+ this.renderCount++;
+ const currentRender = this.renderCount;
+ console.log(`[${this.instanceId}] Watcher triggered (Render #${currentRender}). UI changed: ${newValue !== oldValue}. New length: ${newValue?.length}, Old length: ${oldValue?.length}`);
+
const htmlContainer = this.$refs.htmlContentContainer;
- if (newValue !== oldValue || !htmlContainer || htmlContainer.innerHTML === '') {
- console.log(`UI prop changed for instance ${this.instanceId}`);
+ const needsRender = newValue !== oldValue || !htmlContainer || htmlContainer.innerHTML === '';
+ console.log(`[${this.instanceId}] Needs render evaluation (Render #${currentRender}): ${needsRender}`);
+
+ if (needsRender) {
+ console.log(`[${this.instanceId}] --- Starting Update Cycle (Render #${currentRender}) ---`);
// Cleanup must happen *before* rendering new content
- this.cleanupDynamicContent();
+ this.cleanupDynamicContent(currentRender); // Pass render count for context
+
// Use $nextTick to ensure DOM is updated after cleanup before rendering
this.$nextTick(() => {
- this.renderContent();
+ console.log(`[${this.instanceId}] $nextTick after cleanup (Render #${currentRender}): Starting renderContent.`);
+ this.renderContent(currentRender); // Pass render count for context
});
+ } else {
+ console.log(`[${this.instanceId}] Watcher triggered but skipping render (Render #${currentRender}). UI likely unchanged or container still populated.`);
}
}
}
},
beforeUnmount() {
- this.cleanupDynamicContent(); // Ensure cleanup when component is destroyed
- // No need to remove listener manually, Vue handles it on the root element
+ console.log(`[${this.instanceId}] Component beforeUnmount hook.`);
+ this.cleanupDynamicContent('beforeUnmount'); // Ensure cleanup when component is destroyed
},
methods: {
- renderContent() {
- console.log(`Rendering content for instance ${this.instanceId}...`);
- const targetContainer = this.$refs.htmlContentContainer; // Access ref via this.$refs
+ logAlbumViewerMounted() {
+ console.log(`[${this.instanceId}] ImageAlbumViewer successfully MOUNTED.`);
+ },
+
+ renderContent(renderContext) {
+ console.log(`[${this.instanceId}] renderContent CALLED (Context: ${renderContext})`);
+ const targetContainer = this.$refs.htmlContentContainer;
if (!targetContainer) {
- // This check might be less likely to fail here compared to setup,
- // as refs are generally available in methods called after mount.
- console.error(`HTML content container ref not found for instance ${this.instanceId}`);
+ console.error(`[${this.instanceId}] ERROR: htmlContentContainer ref NOT FOUND during renderContent (Context: ${renderContext})!`);
return;
}
- // Clear previous content (already done in cleanup, but good practice)
+ // Ensure container is clean (belt-and-suspenders with cleanup)
targetContainer.innerHTML = '';
- let imagesForAlbum = []; // Local variable for processing
- this.showAlbumViewer = false; // Reset viewer flag
+ console.log(`[${this.instanceId}] Cleared targetContainer innerHTML (Context: ${renderContext})`);
+ let imagesForAlbum = []; // Local variable for processing
+ let localShowAlbumViewer = false; // Use a local flag during processing
+ const incomingUi = this.ui || ''; // Use local variable for safety
+
+ if (!incomingUi.trim()) {
+ console.warn(`[${this.instanceId}] No UI content provided (Context: ${renderContext}). Skipping parsing.`);
+ // Ensure state is reset if UI becomes empty
+ this.albumImages = [];
+ this.showAlbumViewer = false;
+ console.log(`[${this.instanceId}] Reset album state due to empty UI (Context: ${renderContext}). showAlbumViewer=${this.showAlbumViewer}`);
+ return;
+ }
+
+ console.log(`[${this.instanceId}] Parsing UI content (length: ${incomingUi.length}) (Context: ${renderContext})`);
const parser = new DOMParser();
- // Use this.ui to access the prop
- const doc = parser.parseFromString(this.ui || '', 'text/html');
+ const doc = parser.parseFromString(incomingUi, 'text/html');
// --- 1. Inject Scoped CSS ---
const styles = doc.head.getElementsByTagName('style');
- Array.from(styles).forEach(style => this.injectScopedCss(style.textContent));
+ console.log(`[${this.instanceId}] Found ${styles.length} style tags in .`);
+ Array.from(styles).forEach((style, index) => {
+ console.log(`[${this.instanceId}] Injecting head style #${index + 1}.`);
+ this.injectScopedCss(style.textContent, renderContext);
+ });
const bodyStyles = doc.body.getElementsByTagName('style');
- Array.from(bodyStyles).forEach(style => this.injectScopedCss(style.textContent));
+ console.log(`[${this.instanceId}] Found ${bodyStyles.length} style tags in .`);
+ Array.from(bodyStyles).forEach((style, index) => {
+ console.log(`[${this.instanceId}] Injecting body style #${index + 1}.`);
+ this.injectScopedCss(style.textContent, renderContext);
+ });
// --- 2. Process HTML Body ---
+ console.log(`[${this.instanceId}] Processing body childNodes (Context: ${renderContext})`);
const processedNodes = [];
let albumPlaceholderNeeded = false;
const nodesToProcess = Array.from(doc.body.childNodes);
+ console.log(`[${this.instanceId}] Found ${nodesToProcess.length} nodes in parsed body.`);
- nodesToProcess.forEach(node => {
+ nodesToProcess.forEach((node, index) => {
if (node.nodeType === Node.ELEMENT_NODE) {
+ console.log(`[${this.instanceId}] Processing Node #${index + 1}: <${node.tagName}>, Classes: ${node.classList}`);
// --- Special Handling: Image Album ---
if (node.tagName === 'IMG' && node.classList.contains('album')) {
const src = node.getAttribute('src');
if (src) {
+ console.log(`[${this.instanceId}] -> Found 'img.album' with src: ${src}`);
imagesForAlbum.push(src); // Add to local list
albumPlaceholderNeeded = true;
+ } else {
+ console.warn(`[${this.instanceId}] -> Found 'img.album' but it has NO src attribute.`);
}
- return; // Skip appending this node
+ return; // Skip appending this specific node
}
// --- Special Handling: Clickable Image POST ---
if (node.tagName === 'IMG' && node.classList.contains('clickable-post')) {
+ console.log(`[${this.instanceId}] -> Found 'img.clickable-post'. Ensuring data attributes.`);
if (!node.dataset.endpoint) node.dataset.endpoint = '/post_to_personality';
if (!node.dataset.payloadKey) node.dataset.payloadKey = 'img_path';
}
// --- Special Handling: Open Folder Link ---
if (node.tagName === 'A' && node.classList.contains('open-folder')) {
+ console.log(`[${this.instanceId}] -> Found 'a.open-folder'. Setting href='#'`);
node.setAttribute('href', '#'); // Prevent navigation
}
+ processedNodes.push(node); // Add node for standard appending
+ } else if (node.nodeType === Node.TEXT_NODE && node.textContent.trim()) {
+ console.log(`[${this.instanceId}] Processing Node #${index + 1}: TextNode (non-empty)`);
+ processedNodes.push(node); // Add node for standard appending
+ } else {
+ console.log(`[${this.instanceId}] Skipping Node #${index + 1} (Type: ${node.nodeType})`);
}
- processedNodes.push(node);
});
// --- 3. Append Processed Standard HTML Nodes ---
+ console.log(`[${this.instanceId}] Appending ${processedNodes.length} processed nodes to targetContainer (Context: ${renderContext})`);
processedNodes.forEach(node => {
+ // Use importNode to ensure the node can be appended to the current document
targetContainer.appendChild(document.importNode(node, true));
});
+ console.log(`[${this.instanceId}] Finished appending nodes. Current targetContainer innerHTML length: ${targetContainer.innerHTML.length}`);
+
// --- 4. Update State for Album Viewer ---
+ console.log(`[${this.instanceId}] Evaluating album state (Context: ${renderContext}). albumPlaceholderNeeded=${albumPlaceholderNeeded}, images found=${imagesForAlbum.length}`);
if (albumPlaceholderNeeded && imagesForAlbum.length > 0) {
- this.albumImages = imagesForAlbum; // Update reactive data property
- this.showAlbumViewer = true; // Update reactive data property
- console.log(`Scheduled ImageAlbumViewer rendering for instance ${this.instanceId} with ${imagesForAlbum.length} images.`);
+ // Set the local flag first
+ localShowAlbumViewer = true;
+ console.log(`[${this.instanceId}] SETTING album state: images=`, JSON.stringify(imagesForAlbum));
+ // Update reactive data properties
+ this.albumImages = [...imagesForAlbum]; // Use spread to ensure reactivity change detection
+ this.showAlbumViewer = true;
+ console.log(`[${this.instanceId}] State AFTER update: showAlbumViewer=${this.showAlbumViewer}, albumImages count=${this.albumImages.length}`);
} else {
+ console.log(`[${this.instanceId}] RESETTING album state.`);
+ localShowAlbumViewer = false;
+ // Update reactive data properties
this.albumImages = [];
this.showAlbumViewer = false;
+ console.log(`[${this.instanceId}] State AFTER reset: showAlbumViewer=${this.showAlbumViewer}`);
}
// --- 5. Handle Original Scripts (Still use with caution!) ---
// const scripts = doc.body.getElementsByTagName('script');
// Array.from(scripts).forEach(script => { /* ... */ });
- console.log(`Finished rendering for instance ${this.instanceId}.`);
+ console.log(`[${this.instanceId}] --- Finished renderContent (Context: ${renderContext}) ---`);
},
- injectScopedCss(css) {
+ injectScopedCss(css, renderContext) {
+ console.log(`[${this.instanceId}] Injecting scoped CSS (Context: ${renderContext})`);
+ if (!css || !css.trim()) {
+ console.warn(`[${this.instanceId}] CSS content is empty, skipping injection.`);
+ return;
+ }
const scopedCss = this.scopeCSS(css); // Call helper method
const styleElement = document.createElement('style');
styleElement.textContent = scopedCss;
+ // Append to head for better standard compliance
document.head.appendChild(styleElement);
this.injectedStyleElements.push(styleElement); // Store ref in data property
+ console.log(`[${this.instanceId}] Injected style element. Total injected: ${this.injectedStyleElements.length}`);
},
scopeCSS(css) {
// Use computed containerId
- return css.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g, (match, selector, suffix) => {
+ const id = this.containerId; // Get it once
+ if (!id) {
+ console.error(`[${this.instanceId}] Cannot scope CSS: containerId is missing!`);
+ return css; // Return original CSS
+ }
+ const idSelector = `#${id}`;
+ // Improved regex to handle more cases, including direct descendant (>), adjacent sibling (+), general sibling (~), pseudo-classes/elements
+ return css.replace(/([^\r\n,{}\s][^{}]*)(?=\s*\{)/g, (match, selector) => {
selector = selector.trim();
- if (selector.startsWith('@') || selector.startsWith(':') || selector.includes('#') || selector.includes('[')) {
- return match;
+ // Avoid scoping @ rules, keyframes, font-faces, etc.
+ if (selector.startsWith('@') || selector.startsWith('%') || /^\d+%$/.test(selector)) {
+ return selector;
}
+ // Avoid scoping selectors that already seem specific (like IDs, maybe attribute selectors if needed)
+ // Simple check for now: don't re-scope if it already contains the ID prefix
+ if (selector.includes(idSelector)) {
+ return selector;
+ }
+
+ // Scope each part of a comma-separated list
const scopedSelector = selector.split(',')
- .map(part => `#${this.containerId} ${part.trim()}`) // Scope relative to the main container ID
+ .map(part => {
+ part = part.trim();
+ // Handle cases like `html body .class` -> `#id .class` (avoiding `#id html body .class`)
+ // This is tricky, a simple prefix is often safer for dynamically injected content
+ // Option 1: Simple Prefix (Safest)
+ return `${idSelector} ${part}`;
+ // Option 2: More complex replacements (can break easily)
+ // e.g., if part starts with 'body' or 'html', replace it? -> Complex
+ })
.join(', ');
- return `${scopedSelector}${suffix}`;
+ return scopedSelector;
});
},
handleContainerClick(event) {
const target = event.target;
+ console.log(`[${this.instanceId}] Container clicked. Target: <${target.tagName}>, Classes: ${target.classList}`);
// --- Handle Clickable Image Post ---
+ // Use closest to handle clicks on elements inside the intended target (e.g., if image is wrapped)
const clickablePost = target.closest('img.clickable-post');
if (clickablePost && clickablePost.dataset.endpoint) {
- event.preventDefault();
+ event.preventDefault(); // Prevent default image drag behavior etc.
const endpoint = clickablePost.dataset.endpoint;
const payloadKey = clickablePost.dataset.payloadKey || 'img_path';
const src = clickablePost.getAttribute('src');
const payload = { [payloadKey]: src };
- console.log(`Posting to ${endpoint} with payload:`, payload);
+ console.log(`[${this.instanceId}] Clickable POST triggered. Endpoint: ${endpoint}, Payload:`, payload);
axios.post(endpoint, payload)
- .then(response => console.log('Post successful:', response.data))
- .catch(error => console.error(`Error posting to ${endpoint}:`, error));
- return;
+ .then(response => console.log(`[${this.instanceId}] Post to ${endpoint} successful:`, response.data))
+ .catch(error => console.error(`[${this.instanceId}] Error posting to ${endpoint}:`, error));
+ return; // Handled
}
// --- Handle Open Folder Link ---
const openFolderLink = target.closest('a.open-folder');
- if (openFolderLink && openFolderLink.dataset.discussionId) {
- event.preventDefault();
+ if (openFolderLink) { // Check dataset.discussionId inside
+ event.preventDefault(); // Prevent default link behavior (# navigation)
const discussionId = openFolderLink.dataset.discussionId;
+ if (!discussionId) {
+ console.warn(`[${this.instanceId}] 'a.open-folder' clicked, but missing 'data-discussion-id' attribute.`);
+ return;
+ }
+ console.log(`[${this.instanceId}] Open folder link clicked. Discussion ID: ${discussionId}`);
// Access clientId from computed properties (mapped from Vuex)
if (!this.clientId) {
- console.error("Client ID not found in Vuex store.");
+ console.error(`[${this.instanceId}] ERROR: Client ID not found in Vuex store for open_discussion_folder!`);
alert("Error: Client information is missing.");
return;
}
- console.log(`Posting to /open_discussion_folder with client_id: ${this.clientId}, discussion_id: ${discussionId}`);
+ console.log(`[${this.instanceId}] Posting to /open_discussion_folder with client_id: ${this.clientId}, discussion_id: ${discussionId}`);
axios.post('/open_discussion_folder', { client_id: this.clientId, discussion_id: discussionId })
- .then(response => console.log('Open folder request successful:', response.data))
- .catch(error => console.error('Error opening folder:', error));
- return;
+ .then(response => console.log(`[${this.instanceId}] Open folder request successful:`, response.data))
+ .catch(error => console.error(`[${this.instanceId}] Error opening folder:`, error));
+ return; // Handled
}
+
+ console.log(`[${this.instanceId}] Click was not handled by specific handlers.`);
},
- cleanupDynamicContent() {
- console.log(`Cleaning up dynamic content for instance ${this.instanceId}`);
+ cleanupDynamicContent(cleanupContext) {
+ console.log(`[${this.instanceId}] cleanupDynamicContent CALLED (Context: ${cleanupContext})`);
// Reset reactive data - this hides the ImageAlbumViewer via v-if
- this.showAlbumViewer = false;
- this.albumImages = [];
+ // Important: Only reset if they are currently set, to avoid unnecessary reactive churn
+ let stateChanged = false;
+ if (this.showAlbumViewer) {
+ this.showAlbumViewer = false;
+ stateChanged = true;
+ }
+ if (this.albumImages.length > 0) {
+ this.albumImages = [];
+ stateChanged = true;
+ }
+ if (stateChanged) {
+ console.log(`[${this.instanceId}] Album state reset during cleanup. showAlbumViewer=${this.showAlbumViewer}`);
+ } else {
+ console.log(`[${this.instanceId}] Album state was already reset.`);
+ }
+
// Remove injected stylesheets
- this.injectedStyleElements.forEach(styleElement => {
+ console.log(`[${this.instanceId}] Removing ${this.injectedStyleElements.length} injected style elements.`);
+ this.injectedStyleElements.forEach((styleElement, index) => {
if (styleElement && styleElement.parentNode) {
+ console.log(`[${this.instanceId}] Removing style element #${index + 1}`);
styleElement.parentNode.removeChild(styleElement);
+ } else {
+ console.warn(`[${this.instanceId}] Could not remove style element #${index + 1} (already removed or no parent).`);
}
});
this.injectedStyleElements = []; // Clear the tracking array
@@ -228,9 +354,12 @@ export default {
// Clear dynamically injected HTML content
const htmlContainer = this.$refs.htmlContentContainer;
if (htmlContainer) {
+ console.log(`[${this.instanceId}] Clearing innerHTML of htmlContentContainer.`);
htmlContainer.innerHTML = '';
+ } else {
+ console.warn(`[${this.instanceId}] htmlContentContainer ref not found during cleanup (Context: ${cleanupContext}). Might be called before mount or after unmount.`);
}
- console.log(`Finished cleanup for instance ${this.instanceId}.`);
+ console.log(`[${this.instanceId}] --- Finished cleanupDynamicContent (Context: ${cleanupContext}) ---`);
}
}
};
@@ -238,4 +367,8 @@ export default {
\ No newline at end of file