mira-app-server
Version:
Mira Server - standalone server application using mira-app-core
30 lines • 137 kB
JavaScript
import{aJ as Se,cM as Kn,bZ as q,at as he,dq as H,cc as ut,bM as Js,b7 as er,cB as Lt,k as Jn,bf as tr,bV as Vt,bB as kt,c6 as es,aa as ts,ak as ns,a1 as Be,d3 as Ht,cR as ft,c8 as ae,al as it,D as rn,db as ss,B as rs,W as nr,ax as ee,as as y,cr as U,aH as B,x as we,cb as Ne,aG as pe,bL as je,bN as ln,av as Ye,c_ as sr,i as an,d as rr,c as ir,f as lr,e as ar,b as or,a as cr,ds as dr,b8 as on,bQ as ur}from"./index-OOzZz4T6.js";import{c as is,b as ls,e as as,d as os,S as cs}from"./SelectValue-BTic8Ggd.js";import{S as qt}from"./Switch-QckDRkQW.js";import{S as fr}from"./Slider-IdZsXzZo.js";import{c as Er}from"./createLucideIcon-DGRAKu_b.js";import{I as pr}from"./Input-CZG1tOaA.js";var _r=Se({__name:"AlertDialogAction",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e;return Kn(),(s,n)=>(q(),he(Lt(Jn),Js(er(t)),{default:H(()=>[ut(s.$slots,"default")]),_:3},16))}}),mr=_r,gr=Se({__name:"AlertDialogCancel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,s=tr(),{forwardRef:n,currentElement:r}=Kn();return Vt(()=>{s.onCancelElementChange(r.value)}),(l,i)=>(q(),he(Lt(Jn),kt(t,{ref:Lt(n)}),{default:H(()=>[ut(l.$slots,"default")]),_:3},16))}}),Ir=gr;const Tr=Se({__name:"AlertDialogAction",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(e,{expose:t}){t();const s=e,n=es(s,"class"),r={props:s,delegatedProps:n,get AlertDialogAction(){return mr},get cn(){return ns},get buttonVariants(){return ts}};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}});function hr(e,t,s,n,r,l){return q(),he(n.AlertDialogAction,kt(n.delegatedProps,{class:n.cn(n.buttonVariants(),n.props.class)}),{default:H(()=>[ut(e.$slots,"default")]),_:3},16,["class"])}const Rr=Be(Tr,[["render",hr],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/alert-dialog/AlertDialogAction.vue"]]),Sr=Se({__name:"AlertDialogCancel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(e,{expose:t}){t();const s=e,n=es(s,"class"),r={props:s,delegatedProps:n,get AlertDialogCancel(){return Ir},get cn(){return ns},get buttonVariants(){return ts}};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}});function Or(e,t,s,n,r,l){return q(),he(n.AlertDialogCancel,kt(n.delegatedProps,{class:n.cn(n.buttonVariants({variant:"outline"}),"mt-2 sm:mt-0",n.props.class)}),{default:H(()=>[ut(e.$slots,"default")]),_:3},16,["class"])}const Dr=Be(Sr,[["render",Or],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/alert-dialog/AlertDialogCancel.vue"]]);/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yr=Er("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),ld=[{id:"general",name:"settings.sections.general",icon:"settings"},{id:"notifications",name:"settings.sections.notifications",icon:"notifications"},{id:"import",name:"settings.sections.import",icon:"upload_file"},{id:"floating-ball",name:"settings.sections.floatingBall",icon:"bubble_chart"},{id:"plugins",name:"settings.sections.plugins",icon:"extension"},{id:"network",name:"settings.sections.network",icon:"lan"},{id:"data",name:"settings.sections.data",icon:"storage"}],vr=[{label:"简体中文",value:"zh-CN"},{label:"English",value:"en-US"}],Ar=Se({__name:"GeneralPanel",setup(e,{expose:t}){t();const s=Ht(),n=ss(),{t:r}=ft(),l=ae(!1),i=ae(!1),o=it(()=>!!window.electronAPI?.serverAutoStart);Vt(async()=>{if(o.value){i.value=!0;try{const h=await window.electronAPI.serverAutoStart.get();h.success&&(l.value=h.enabled,s.settings.autoStartServer=h.enabled)}catch(h){console.error("Failed to read server auto-start setting:",h)}finally{i.value=!1}}});const a=async h=>{if(!o.value)return;const g=l.value;i.value=!0;try{const R=await window.electronAPI.serverAutoStart.set(h);if(!R.success)throw new Error(R.message||r("settings.autoStartFailed"));l.value=R.enabled,await s.updateSetting("autoStartServer",R.enabled),n.add({severity:"success",summary:r("settings.settingSaved"),detail:R.enabled?r("settings.autoStartEnabledToast"):r("settings.autoStartDisabledToast"),life:2e3})}catch(R){l.value=g,n.add({severity:"error",summary:r("settings.saveFailed"),detail:R instanceof Error?R.message:r("settings.saveError"),life:5e3})}finally{i.value=!1}},d=ae(null),c=it(()=>{const h=s.settings.primaryColor;return!!h&&!rn.includes(h)}),f=[{label:r("settings.themeLight"),value:"light",preview:`
<path fill="#e5e5e5" d="M0 0h88v70H0z" />
<path fill="#ffffff" d="M10 12a4 4 0 0 1 4-4h74v62H10V12Z" />
<circle fill="#d4d4d4" cx="28" cy="26" r="8" />
<rect fill="#e5e5e5" height="4" rx="2" width="58" x="20" y="42" />
<rect fill="#e5e5e5" height="4" rx="2" width="58" x="20" y="49" />
<rect fill="#e5e5e5" height="4" rx="2" width="29" x="20" y="56" />`},{label:r("settings.themeDark"),value:"dark",preview:`
<path fill="#171717" d="M0 0h88v70H0z" />
<path fill="#262626" d="M10 12a4 4 0 0 1 4-4h74v62H10V12Z" />
<circle fill="#525252" cx="28" cy="26" r="8" />
<rect fill="#404040" height="4" rx="2" width="58" x="20" y="42" />
<rect fill="#404040" height="4" rx="2" width="58" x="20" y="49" />
<rect fill="#404040" height="4" rx="2" width="29" x="20" y="56" />`},{label:r("settings.themeAuto"),value:"auto",preview:`
<path fill="#e5e5e5" d="M0 0h44v70H0z" />
<path fill="#171717" d="M44 0h44v70H44z" />
<path fill="#ffffff" d="M10 12a4 4 0 0 1 4-4h30v62H10V12Z" />
<circle fill="#d4d4d4" cx="28" cy="26" r="8" />
<path fill="#e5e5e5" d="M20 44a2 2 0 0 1 2-2h22v4H22a2 2 0 0 1-2-2ZM20 51a2 2 0 0 1 2-2h22v4H22a2 2 0 0 1-2-2ZM20 58a2 2 0 0 1 2-2h22v4H22a2 2 0 0 1-2-2Z" />
<path fill="#262626" d="M54 12a4 4 0 0 1 4-4h30v62H54V12Z" />
<circle fill="#525252" cx="72" cy="26" r="8" />
<path fill="#404040" d="M64 44a2 2 0 0 1 2-2h22v4H66a2 2 0 0 1-2-2ZM64 51a2 2 0 0 1 2-2h22v4H66a2 2 0 0 1-2-2ZM64 58a2 2 0 0 1 2-2h22v4H66a2 2 0 0 1-2-2Z" />`}],p={settingsStore:s,toast:n,t:r,autoStartServer:l,autoStartServerLoading:i,hasServerAutoStart:o,handleAutoStartChange:a,customColorInput:d,isCustomPrimaryColor:c,themeOptions:f,styleOptions:[{label:"Default",value:""},{label:"Mira",value:"mira"},{label:"Lyra",value:"lyra"},{label:"Luma",value:"luma"},{label:"Rhea",value:"rhea"},{label:"Custom",value:"custom"}],openTweakcn:()=>{window.open("https://tweakcn.com/","_blank")},handleSettingChange:async(h,g)=>{try{await s.updateSetting(h,g),n.add({severity:"success",summary:r("settings.settingSaved"),detail:r("settings.settingUpdated",{key:h}),life:2e3})}catch(R){console.error("Setting change error:",R,"Value:",g),n.add({severity:"error",summary:r("settings.saveFailed"),detail:R instanceof Error?R.message:r("settings.saveError"),life:5e3})}},get Select(){return cs},get SelectTrigger(){return os},get SelectValue(){return as},get SelectContent(){return ls},get SelectItem(){return is},get Textarea(){return nr},get Button(){return rs},get Switch(){return qt},get Slider(){return fr},get ExternalLink(){return yr},get DEFAULT_PRIMARY_COLORS(){return rn},get languageOptions(){return vr}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),Pr={class:"p-4 space-y-6"},Lr={class:"flex items-center justify-between gap-4 py-3"},br={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},Cr={class:"text-muted-foreground dark:text-muted-foreground text-sm"},Mr={class:"flex items-center justify-between gap-4 py-3"},wr={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},Nr={class:"text-muted-foreground dark:text-muted-foreground text-sm"},Gr={class:"flex flex-wrap items-end gap-4 py-3"},Fr={class:"flex flex-col min-w-40 flex-1"},Ur={class:"text-foreground dark:text-muted-foreground text-base font-medium leading-normal pb-2"},xr={class:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block"},Br={class:"flex gap-3"},Vr=["onClick"],kr=["innerHTML"],Hr={class:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block"},qr={class:"flex items-center gap-2"},Yr=["onClick"],zr={key:0,class:"text-[10px] text-muted-foreground leading-none"},Wr=["value"],Xr={class:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block"},$r={class:"flex items-center justify-between gap-4 mb-2.5"},jr={class:"text-xs font-medium text-muted-foreground uppercase tracking-wider block"},Zr={class:"text-muted-foreground text-sm mt-0.5"},Qr={class:"text-xs font-medium text-foreground shrink-0 w-10 text-right tabular-nums"},Kr={class:"flex items-center gap-3"},Jr={class:"text-xs text-muted-foreground shrink-0 w-6"},ei={class:"text-xs text-muted-foreground shrink-0 w-6"},ti={class:"flex items-center justify-between gap-4 mb-2.5"},ni={class:"text-xs font-medium text-muted-foreground uppercase tracking-wider block"},si={class:"text-muted-foreground text-sm mt-0.5"},ri={class:"text-xs font-medium text-foreground shrink-0 w-10 text-right tabular-nums"},ii={class:"flex items-center gap-3"},li={class:"text-xs text-muted-foreground shrink-0 w-6"},ai={class:"text-xs text-muted-foreground shrink-0 w-6"};function oi(e,t,s,n,r,l){return q(),ee("div",Pr,[y("div",null,[y("div",Lr,[y("div",null,[y("p",br,U(n.t("settings.autoStartServer")),1),y("p",Cr,U(n.t("settings.autoStartServerDesc")),1)]),B(n.Switch,{checked:n.autoStartServer,disabled:n.autoStartServerLoading||!n.hasServerAutoStart,"onUpdate:checked":n.handleAutoStartChange},null,8,["checked","disabled"])]),y("div",Mr,[y("div",null,[y("p",wr,U(n.t("settings.closeToTray")),1),y("p",Nr,U(n.t("settings.closeToTrayDesc")),1)]),B(n.Switch,{checked:n.settingsStore.settings.closeToTray,"onUpdate:checked":t[0]||(t[0]=i=>n.handleSettingChange("closeToTray",i))},null,8,["checked"])])]),y("div",null,[y("div",Gr,[y("div",Fr,[y("label",Ur,U(n.t("settings.language")),1),B(n.Select,{"model-value":n.settingsStore.settings.language,"onUpdate:modelValue":t[1]||(t[1]=i=>n.handleSettingChange("language",i))},{default:H(()=>[B(n.SelectTrigger,{class:"w-full"},{default:H(()=>[B(n.SelectValue,{placeholder:n.t("settings.selectLanguage")},null,8,["placeholder"])]),_:1}),B(n.SelectContent,null,{default:H(()=>[(q(!0),ee(we,null,Ne(n.languageOptions,i=>(q(),he(n.SelectItem,{key:i.value,value:i.value},{default:H(()=>[pe(U(i.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])])])]),y("div",null,[y("label",xr,U(n.t("settings.theme")),1),y("div",Br,[(q(),ee(we,null,Ne(n.themeOptions,i=>y("button",{key:i.value,type:"button",class:"flex flex-col items-center gap-1.5 cursor-pointer group",onClick:o=>n.handleSettingChange("theme",i.value)},[y("span",{class:je(["relative block h-[70px] w-[88px] overflow-hidden rounded-lg shadow-xs transition-shadow","ring-2 ring-offset-1 ring-offset-background",n.settingsStore.settings.theme===i.value?"ring-primary opacity-100":"ring-transparent opacity-80 hover:opacity-100"])},[(q(),ee("svg",{"aria-hidden":"true",class:"size-full",fill:"none",viewBox:"0 0 88 70",xmlns:"http://www.w3.org/2000/svg",innerHTML:i.preview},null,8,kr))],2),y("span",{class:je(["text-xs font-medium transition-colors",n.settingsStore.settings.theme===i.value?"text-foreground":"text-muted-foreground/70 group-hover:text-muted-foreground"])},U(i.label),3)],8,Vr)),64))])]),y("div",null,[y("label",Hr,U(n.t("settings.primaryColor")),1),y("div",qr,[(q(!0),ee(we,null,Ne(n.DEFAULT_PRIMARY_COLORS,i=>(q(),ee("button",{key:i,type:"button",style:ln({backgroundColor:i}),class:je(["size-6 rounded-full border-2 transition-all shrink-0",n.settingsStore.settings.primaryColor===i?"border-foreground scale-110 ring-2 ring-foreground/20":"border-transparent hover:scale-105"]),onClick:o=>n.handleSettingChange("primaryColor",n.settingsStore.settings.primaryColor===i?"":i)},null,14,Yr))),128)),y("button",{type:"button",style:ln(n.isCustomPrimaryColor?{backgroundColor:n.settingsStore.settings.primaryColor}:void 0),class:je(["size-6 rounded-full border-2 border-dashed border-muted-foreground/40 shrink-0 relative flex items-center justify-center transition-all hover:scale-105",n.isCustomPrimaryColor&&"border-solid border-foreground scale-110 ring-2 ring-foreground/20"]),onClick:t[3]||(t[3]=i=>n.customColorInput?.click())},[n.isCustomPrimaryColor?Ye("",!0):(q(),ee("span",zr,"+")),y("input",{ref:"customColorInput",type:"color",value:n.settingsStore.settings.primaryColor||"#1456f0",class:"sr-only",tabindex:"-1",onInput:t[2]||(t[2]=i=>n.handleSettingChange("primaryColor",i.target.value))},null,40,Wr)],6)])]),y("div",null,[y("label",Xr,U(n.t("settings.style")),1),B(n.Select,{"model-value":n.settingsStore.settings.themeStyle,"onUpdate:modelValue":t[4]||(t[4]=i=>n.handleSettingChange("themeStyle",i))},{default:H(()=>[B(n.SelectTrigger,{class:"w-full"},{default:H(()=>[B(n.SelectValue,{placeholder:n.t("settings.selectStyle")},null,8,["placeholder"])]),_:1}),B(n.SelectContent,null,{default:H(()=>[(q(),ee(we,null,Ne(n.styleOptions,i=>B(n.SelectItem,{key:i.value,value:i.value},{default:H(()=>[pe(U(i.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),n.settingsStore.settings.themeStyle==="custom"?(q(),he(n.Textarea,{key:0,"model-value":n.settingsStore.settings.themeStyleCustomCss,"onUpdate:modelValue":t[5]||(t[5]=i=>n.handleSettingChange("themeStyleCustomCss",String(i))),class:"mt-2 font-mono text-xs min-h-40",placeholder:n.t("settings.customCssPlaceholder")},null,8,["model-value","placeholder"])):Ye("",!0),n.settingsStore.settings.themeStyle==="custom"?(q(),he(n.Button,{key:1,variant:"link",size:"sm",class:"mt-1.5 h-auto p-0 text-xs",onClick:n.openTweakcn},{default:H(()=>[B(n.ExternalLink,{class:"size-3 mr-1"}),t[8]||(t[8]=pe(" tweakcn.com "))]),_:1})):Ye("",!0)]),y("div",null,[y("div",$r,[y("div",null,[y("label",jr,U(n.t("settings.fontSize")),1),y("p",Zr,U(n.t("settings.fontSizeDesc")),1)]),y("span",Qr,U(Math.round(n.settingsStore.settings.fontSizeScale*100))+"% ",1)]),y("div",Kr,[y("span",Jr,U(n.t("settings.fontSizeSmall")),1),B(n.Slider,{"model-value":[n.settingsStore.settings.fontSizeScale],min:.85,max:1.3,step:.05,class:"flex-1","onUpdate:modelValue":t[6]||(t[6]=i=>i&&n.handleSettingChange("fontSizeScale",i[0]))},null,8,["model-value"]),y("span",ei,U(n.t("settings.fontSizeLarge")),1)])]),y("div",null,[y("div",ti,[y("div",null,[y("label",ni,U(n.t("settings.uiZoom")),1),y("p",si,U(n.t("settings.uiZoomDesc")),1)]),y("span",ri,U(Math.round(n.settingsStore.settings.uiZoom*100))+"% ",1)]),y("div",ii,[y("span",li,U(n.t("settings.uiZoomSmall")),1),B(n.Slider,{"model-value":[n.settingsStore.settings.uiZoom],min:.7,max:1.5,step:.05,class:"flex-1","onUpdate:modelValue":t[7]||(t[7]=i=>i&&n.handleSettingChange("uiZoom",i[0]))},null,8,["model-value"]),y("span",ai,U(n.t("settings.uiZoomLarge")),1)])])])}const ad=Be(Ar,[["render",oi],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/settings/GeneralPanel.vue"]]),ci=Se({__name:"NotificationsPanel",setup(e,{expose:t}){t();const s=Ht(),n=ss(),{t:r}=ft(),i={settingsStore:s,toast:n,t:r,handleSettingChange:async(o,a)=>{try{s.settings[o]=a,await s.saveSettings(),n.add({severity:"success",summary:r("views.common.settingSaved"),detail:r("views.common.settingUpdated",{key:o}),life:2e3})}catch(d){console.error("Setting change error:",d,"Value:",a),n.add({severity:"error",summary:r("views.common.saveFailed"),detail:d instanceof Error?d.message:r("views.common.saveError"),life:5e3})}},get Switch(){return qt}};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),di={class:"p-4 space-y-6"},ui={class:"space-y-4"},fi={class:"flex items-center justify-between py-2"},Ei={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},pi={class:"text-muted-foreground dark:text-muted-foreground text-sm"},_i={class:"flex items-center justify-between py-2"},mi={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},gi={class:"text-muted-foreground dark:text-muted-foreground text-sm"};function Ii(e,t,s,n,r,l){return q(),ee("div",di,[y("div",null,[y("div",ui,[y("div",fi,[y("div",null,[y("p",Ei,U(e.$t("views.notificationsPanel.enableTitle")),1),y("p",pi,U(e.$t("views.notificationsPanel.enableDesc")),1)]),B(n.Switch,{checked:n.settingsStore.settings.enableNotifications,"onUpdate:checked":t[0]||(t[0]=i=>n.handleSettingChange("enableNotifications",i))},null,8,["checked"])]),y("div",_i,[y("div",null,[y("p",mi,U(e.$t("views.notificationsPanel.importTitle")),1),y("p",gi,U(e.$t("views.notificationsPanel.importDesc")),1)]),B(n.Switch,{checked:n.settingsStore.settings.enableImportNotifications,"onUpdate:checked":t[1]||(t[1]=i=>n.handleSettingChange("enableImportNotifications",i))},null,8,["checked"])])])])])}const od=Be(ci,[["render",Ii],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/settings/NotificationsPanel.vue"]]),Ti=Se({__name:"pluginPlan",setup(e,{expose:t}){t();const s=sr(),n=Ht(),{t:r}=ft(),l=ae(""),i=ae(!0),o=ae(3e4),a=ae([]),d=ae(""),c=ae(!1),f=ae(!1),_=it(()=>[{label:r("views.pluginsPanel.interval15s"),value:15e3},{label:r("views.pluginsPanel.interval30s"),value:3e4},{label:r("views.pluginsPanel.interval1m"),value:6e4},{label:r("views.pluginsPanel.interval5m"),value:3e5},{label:r("views.pluginsPanel.interval10m"),value:6e5},{label:r("views.pluginsPanel.intervalDisabled"),value:0}]),E=(T,w,D)=>{console.log(`[${T.toUpperCase()}] ${w}: ${D}`)},u=async()=>{try{const T=await s.selectPluginDirectory(r("views.pluginsPanel.selectDirectory"));if(console.log("selectPluginDirectory result:",T),T.success&&T.data){let w;typeof T.data=="string"?w=T.data:typeof T.data=="object"&&T.data&&(w=T.data.path||T.data.filePath||T.data.data),w?(l.value=w,E("success",r("views.common.settingSaved"),r("views.pluginsPanel.selectSuccess",{path:w}))):(console.warn("选择目录结果格式异常:",T.data),E("warn",r("views.common.saveFailed"),r("views.pluginsPanel.selectInvalid")))}else!T.success&&T.message&&(console.error("选择目录失败:",T.message),E("error",r("views.common.saveFailed"),T.message||r("views.pluginsPanel.selectFailed")))}catch(T){console.error("选择目录失败:",T),E("error",r("views.common.saveFailed"),r("views.pluginsPanel.selectFailed"))}},p=async()=>{c.value=!0;try{l.value="",i.value=!0,o.value=3e4,a.value=[],d.value="",await n.updateSettings({pluginsDirectory:"",autoLoadPlugins:!0,trustedPlugins:[],clientPluginMarketUrl:"",clientPluginMarketUrls:[]}),an.removeItem("mira-plugin-extended-settings"),f.value=!1,E("success",r("views.common.settingSaved"),r("views.pluginsPanel.resetSuccess"))}catch(T){console.error("重置设置失败:",T),E("error",r("views.common.saveFailed"),r("views.pluginsPanel.resetFailed"))}finally{c.value=!1}},h=async()=>{try{const T=a.value.map(L=>(L||"").trim()).filter(L=>!!L).filter((L,N,b)=>b.indexOf(L)===N);a.value=T;const w=(n.settings.clientPluginMarketUrl||"").trim(),D=w&&T.includes(w)?w:T[0]||"";await n.updateSettings({clientPluginMarketUrl:D,clientPluginMarketUrls:T})}catch(T){console.error("保存市场源失败:",T),E("error",r("views.common.saveFailed"),r("views.pluginsPanel.saveMarketFailed"))}},g=(T,w)=>{a.value[T]=String(w??"")},R=async()=>{const T=(d.value||"").trim();if(!T){E("warn",r("views.common.saveFailed"),r("views.pluginsPanel.marketEmptyWarn"));return}if(a.value.includes(T)){E("warn",r("views.common.saveFailed"),r("views.pluginsPanel.marketDuplicateWarn"));return}a.value.push(T),d.value="",await h(),E("success",r("views.common.settingSaved"),r("views.pluginsPanel.marketAddedSuccess"))},v=async T=>{a.value.splice(T,1),await h()},A=async()=>{try{const T=n.settings;l.value=T.pluginsDirectory||"",i.value=T.autoLoadPlugins??!0;const w=Array.isArray(T.clientPluginMarketUrls)?T.clientPluginMarketUrls:[],D=(T.clientPluginMarketUrl||"").trim(),L=w.length>0?w:D?[D]:[];a.value=L.map(N=>(N||"").trim()).filter(N=>!!N).filter((N,b,F)=>F.indexOf(N)===b);try{const N=await an.getItem("mira-plugin-extended-settings");N?o.value=JSON.parse(N).scanInterval??3e4:o.value=3e4}catch(N){console.warn("加载扩展插件设置失败,使用默认值:",N),o.value=3e4}}catch(T){console.error("加载设置失败:",T),E("error",r("views.common.saveFailed"),r("views.pluginsPanel.loadFailed")),l.value="",i.value=!0,o.value=3e4,a.value=[],d.value=""}};Vt(async()=>{await A(),s.localPlugins.length===0&&await s.loadLocalPlugins()});const P={pluginStore:s,settingsStore:n,t:r,pluginDirectory:l,autoScanEnabled:i,scanInterval:o,clientPluginMarketUrls:a,newMarketUrl:d,resetting:c,showResetDialog:f,scanIntervalOptions:_,showToast:E,selectPluginDirectory:u,confirmReset:p,saveMarketUrls:h,updateMarketUrl:g,addMarketUrl:R,removeMarketUrl:v,loadCurrentSettings:A,get Button(){return rs},get Input(){return pr},get Switch(){return qt},get Select(){return cs},get SelectTrigger(){return os},get SelectValue(){return as},get SelectContent(){return ls},get SelectItem(){return is},get AlertDialog(){return cr},get AlertDialogContent(){return or},get AlertDialogHeader(){return ar},get AlertDialogTitle(){return lr},get AlertDialogDescription(){return ir},get AlertDialogFooter(){return rr},get AlertDialogCancel(){return Dr},get AlertDialogAction(){return Rr}};return Object.defineProperty(P,"__isScriptSetup",{enumerable:!1,value:!0}),P}}),hi={class:"p-4 space-y-6"},Ri={class:"space-y-4"},Si={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},Oi={class:"flex gap-2 mt-1"},Di={class:"text-muted-foreground dark:text-muted-foreground text-sm"},yi={class:"flex items-center justify-between py-2"},vi={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},Ai={class:"text-muted-foreground dark:text-muted-foreground text-sm"},Pi={key:0},Li={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},bi={class:"text-muted-foreground dark:text-muted-foreground text-sm"},Ci={class:"space-y-4"},Mi={class:"text-foreground dark:text-muted-foreground text-base font-normal leading-normal"},wi={class:"text-muted-foreground dark:text-muted-foreground text-sm mt-1"},Ni={key:0,class:"mt-3 space-y-2"},Gi={class:"flex gap-2 mt-3"};function Fi(e,t,s,n,r,l){return q(),ee("div",hi,[y("div",null,[y("div",Ri,[y("div",null,[y("p",Si,U(e.$t("views.pluginsPanel.directoryTitle")),1),y("div",Oi,[B(n.Input,{modelValue:n.pluginDirectory,"onUpdate:modelValue":t[0]||(t[0]=i=>n.pluginDirectory=i),placeholder:e.$t("views.pluginsPanel.directoryPlaceholder"),class:"flex-1",readonly:""},null,8,["modelValue","placeholder"]),B(n.Button,{variant:"secondary",onClick:n.selectPluginDirectory},{default:H(()=>[t[6]||(t[6]=y("span",{class:"material-icons mr-2"},"folder_open",-1)),pe(U(e.$t("views.pluginsPanel.browse")),1)]),_:1})]),y("p",Di,U(e.$t("views.pluginsPanel.directoryDesc")),1)]),y("div",yi,[y("div",null,[y("p",vi,U(e.$t("views.pluginsPanel.autoScanTitle")),1),y("p",Ai,U(e.$t("views.pluginsPanel.autoScanDesc")),1)]),B(n.Switch,{checked:n.autoScanEnabled,"onUpdate:checked":t[1]||(t[1]=i=>n.autoScanEnabled=i)},null,8,["checked"])]),n.autoScanEnabled?(q(),ee("div",Pi,[y("p",Li,U(e.$t("views.pluginsPanel.scanIntervalTitle")),1),B(n.Select,{modelValue:n.scanInterval,"onUpdate:modelValue":t[2]||(t[2]=i=>n.scanInterval=i),class:"mt-1"},{default:H(()=>[B(n.SelectTrigger,{class:"w-full"},{default:H(()=>[B(n.SelectValue,{placeholder:e.$t("views.pluginsPanel.selectScanInterval")},null,8,["placeholder"])]),_:1}),B(n.SelectContent,null,{default:H(()=>[(q(!0),ee(we,null,Ne(n.scanIntervalOptions,i=>(q(),he(n.SelectItem,{key:i.value,value:i.value},{default:H(()=>[pe(U(i.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]),y("p",bi,U(e.$t("views.pluginsPanel.scanIntervalDesc")),1)])):Ye("",!0)])]),y("div",null,[y("div",Ci,[y("div",null,[y("p",Mi,U(e.$t("views.pluginsPanel.marketListTitle")),1),y("p",wi,U(e.$t("views.pluginsPanel.marketListDesc")),1),n.clientPluginMarketUrls.length>0?(q(),ee("div",Ni,[(q(!0),ee(we,null,Ne(n.clientPluginMarketUrls,(i,o)=>(q(),ee("div",{key:o,class:"flex gap-2 items-center"},[B(n.Input,{"model-value":i,placeholder:e.$t("views.pluginsPanel.marketUrlPlaceholder"),class:"flex-1","onUpdate:modelValue":a=>n.updateMarketUrl(o,a),onBlur:n.saveMarketUrls},null,8,["model-value","placeholder","onUpdate:modelValue"]),B(n.Button,{variant:"ghost",size:"icon-sm",onClick:a=>n.removeMarketUrl(o),title:e.$t("views.pluginsPanel.delete")},{default:H(()=>[...t[7]||(t[7]=[y("span",{class:"material-icons"},"delete",-1)])]),_:2},1032,["onClick","title"])]))),128))])):Ye("",!0),y("div",Gi,[B(n.Input,{modelValue:n.newMarketUrl,"onUpdate:modelValue":t[3]||(t[3]=i=>n.newMarketUrl=i),placeholder:e.$t("views.pluginsPanel.newMarketPlaceholder"),class:"flex-1",onKeydown:dr(n.addMarketUrl,["enter"])},null,8,["modelValue","placeholder"]),B(n.Button,{variant:"secondary",onClick:n.addMarketUrl},{default:H(()=>[t[8]||(t[8]=y("span",{class:"material-icons mr-1"},"add",-1)),pe(U(e.$t("views.pluginsPanel.add")),1)]),_:1})])])])]),B(n.AlertDialog,{open:n.showResetDialog,"onUpdate:open":t[5]||(t[5]=i=>n.showResetDialog=i)},{default:H(()=>[B(n.AlertDialogContent,null,{default:H(()=>[B(n.AlertDialogHeader,null,{default:H(()=>[B(n.AlertDialogTitle,null,{default:H(()=>[pe(U(e.$t("views.pluginsPanel.resetTitle")),1)]),_:1}),B(n.AlertDialogDescription,null,{default:H(()=>[pe(U(e.$t("views.pluginsPanel.resetDesc")),1)]),_:1})]),_:1}),B(n.AlertDialogFooter,null,{default:H(()=>[B(n.AlertDialogCancel,{onClick:t[4]||(t[4]=i=>n.showResetDialog=!1)},{default:H(()=>[pe(U(e.$t("views.pluginsPanel.cancel")),1)]),_:1}),B(n.AlertDialogAction,{onClick:n.confirmReset},{default:H(()=>[pe(U(e.$t("views.pluginsPanel.confirmReset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])])}const cd=Be(Ti,[["render",Fi],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/settings/pluginPlan.vue"]]);/*!
* FilePond 4.32.12
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/const Ui=e=>e instanceof HTMLElement,xi=(e,t=[],s=[])=>{const n={...e},r=[],l=[],i=()=>({...n}),o=()=>{const u=[...r];return r.length=0,u},a=()=>{const u=[...l];l.length=0,u.forEach(({type:p,data:h})=>{d(p,h)})},d=(u,p,h)=>{if(h&&!document.hidden){l.push({type:u,data:p});return}E[u]&&E[u](p),r.push({type:u,data:p})},c=(u,...p)=>_[u]?_[u](...p):null,f={getState:i,processActionQueue:o,processDispatchQueue:a,dispatch:d,query:c};let _={};t.forEach(u=>{_={...u(n),..._}});let E={};return s.forEach(u=>{E={...u(d,c,n),...E}}),f},Bi=(e,t,s)=>{if(typeof s=="function"){e[t]=s;return}Object.defineProperty(e,t,{...s})},Y=(e,t)=>{for(const s in e)e.hasOwnProperty(s)&&t(s,e[s])},Re=e=>{const t={};return Y(e,s=>{Bi(t,s,e[s])}),t},j=(e,t,s=null)=>{if(s===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,s)},Vi="http://www.w3.org/2000/svg",ki=["svg","path"],cn=e=>ki.includes(e),lt=(e,t,s={})=>{typeof t=="object"&&(s=t,t=null);const n=cn(e)?document.createElementNS(Vi,e):document.createElement(e);return t&&(cn(e)?j(n,"class",t):n.className=t),Y(s,(r,l)=>{j(n,r,l)}),n},Hi=e=>(t,s)=>{typeof s<"u"&&e.children[s]?e.insertBefore(t,e.children[s]):e.appendChild(t)},qi=(e,t)=>(s,n)=>(typeof n<"u"?t.splice(n,0,s):t.push(s),s),Yi=(e,t)=>s=>(t.splice(t.indexOf(s),1),s.element.parentNode&&e.removeChild(s.element),s),zi=typeof window<"u"&&typeof window.document<"u",ds=()=>zi,Wi=ds()?lt("svg"):{},Xi="children"in Wi?e=>e.children.length:e=>e.childNodes.length,us=(e,t,s,n)=>{const r=s[0]||e.left,l=s[1]||e.top,i=r+e.width,o=l+e.height*(n[1]||1),a={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:r,top:l,right:i,bottom:o}};return t.filter(d=>!d.isRectIgnored()).map(d=>d.rect).forEach(d=>{dn(a.inner,{...d.inner}),dn(a.outer,{...d.outer})}),un(a.inner),a.outer.bottom+=a.element.marginBottom,a.outer.right+=a.element.marginRight,un(a.outer),a},dn=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},un=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},Oe=e=>typeof e=="number",$i=(e,t,s,n=.001)=>Math.abs(e-t)<n&&Math.abs(s)<n,ji=({stiffness:e=.5,damping:t=.75,mass:s=10}={})=>{let n=null,r=null,l=0,i=!1;const d=Re({interpolate:(c,f)=>{if(i)return;if(!(Oe(n)&&Oe(r))){i=!0,l=0;return}const _=-(r-n)*e;l+=_/s,r+=l,l*=t,$i(r,n,l)||f?(r=n,l=0,i=!0,d.onupdate(r),d.oncomplete(r)):d.onupdate(r)},target:{set:c=>{if(Oe(c)&&!Oe(r)&&(r=c),n===null&&(n=c,r=c),n=c,r===n||typeof n>"u"){i=!0,l=0,d.onupdate(r),d.oncomplete(r);return}i=!1},get:()=>n},resting:{get:()=>i},onupdate:c=>{},oncomplete:c=>{}});return d},Zi=e=>e<.5?2*e*e:-1+(4-2*e)*e,Qi=({duration:e=500,easing:t=Zi,delay:s=0}={})=>{let n=null,r,l,i=!0,o=!1,a=null;const c=Re({interpolate:(f,_)=>{i||a===null||(n===null&&(n=f),!(f-n<s)&&(r=f-n-s,r>=e||_?(r=1,l=o?0:1,c.onupdate(l*a),c.oncomplete(l*a),i=!0):(l=r/e,c.onupdate((r>=0?t(o?1-l:l):0)*a))))},target:{get:()=>o?0:a,set:f=>{if(a===null){a=f,c.onupdate(f),c.oncomplete(f);return}f<a?(a=1,o=!0):(o=!1,a=f),i=!1,n=null}},resting:{get:()=>i},onupdate:f=>{},oncomplete:f=>{}});return c},fn={spring:ji,tween:Qi},Ki=(e,t,s)=>{const n=e[t]&&typeof e[t][s]=="object"?e[t][s]:e[t]||e,r=typeof n=="string"?n:n.type,l=typeof n=="object"?{...n}:{};return fn[r]?fn[r](l):null},Yt=(e,t,s,n=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(r=>{e.forEach(l=>{let i=l,o=()=>s[l],a=d=>s[l]=d;typeof l=="object"&&(i=l.key,o=l.getter||o,a=l.setter||a),!(r[i]&&!n)&&(r[i]={get:o,set:a})})})},Ji=({mixinConfig:e,viewProps:t,viewInternalAPI:s,viewExternalAPI:n})=>{const r={...t},l=[];return Y(e,(i,o)=>{const a=Ki(o);if(!a)return;a.onupdate=c=>{t[i]=c},a.target=r[i],Yt([{key:i,setter:c=>{a.target!==c&&(a.target=c)},getter:()=>t[i]}],[s,n],t,!0),l.push(a)}),{write:i=>{let o=document.hidden,a=!0;return l.forEach(d=>{d.resting||(a=!1),d.interpolate(i,o)}),a},destroy:()=>{}}},el=e=>(t,s)=>{e.addEventListener(t,s)},tl=e=>(t,s)=>{e.removeEventListener(t,s)},nl=({mixinConfig:e,viewProps:t,viewInternalAPI:s,viewExternalAPI:n,viewState:r,view:l})=>{const i=[],o=el(l.element),a=tl(l.element);return n.on=(d,c)=>{i.push({type:d,fn:c}),o(d,c)},n.off=(d,c)=>{i.splice(i.findIndex(f=>f.type===d&&f.fn===c),1),a(d,c)},{write:()=>!0,destroy:()=>{i.forEach(d=>{a(d.type,d.fn)})}}},sl=({mixinConfig:e,viewProps:t,viewExternalAPI:s})=>{Yt(e,s,t)},te=e=>e!=null,rl={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},il=({mixinConfig:e,viewProps:t,viewInternalAPI:s,viewExternalAPI:n,view:r})=>{const l={...t},i={};Yt(e,[s,n],t);const o=()=>[t.translateX||0,t.translateY||0],a=()=>[t.scaleX||0,t.scaleY||0],d=()=>r.rect?us(r.rect,r.childViews,o(),a()):null;return s.rect={get:d},n.rect={get:d},e.forEach(c=>{t[c]=typeof l[c]>"u"?rl[c]:l[c]}),{write:()=>{if(ll(i,t))return al(r.element,t),Object.assign(i,{...t}),!0},destroy:()=>{}}},ll=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const s in t)if(t[s]!==e[s])return!0;return!1},al=(e,{opacity:t,perspective:s,translateX:n,translateY:r,scaleX:l,scaleY:i,rotateX:o,rotateY:a,rotateZ:d,originX:c,originY:f,width:_,height:E})=>{let u="",p="";(te(c)||te(f))&&(p+=`transform-origin: ${c||0}px ${f||0}px;`),te(s)&&(u+=`perspective(${s}px) `),(te(n)||te(r))&&(u+=`translate3d(${n||0}px, ${r||0}px, 0) `),(te(l)||te(i))&&(u+=`scale3d(${te(l)?l:1}, ${te(i)?i:1}, 1) `),te(d)&&(u+=`rotateZ(${d}rad) `),te(o)&&(u+=`rotateX(${o}rad) `),te(a)&&(u+=`rotateY(${a}rad) `),u.length&&(p+=`transform:${u};`),te(t)&&(p+=`opacity:${t};`,t===0&&(p+="visibility:hidden;"),t<1&&(p+="pointer-events:none;")),te(E)&&(p+=`height:${E}px;`),te(_)&&(p+=`width:${_}px;`);const h=e.elementCurrentStyle||"";(p.length!==h.length||p!==h)&&(e.style.cssText=p,e.elementCurrentStyle=p)},ol={styles:il,listeners:nl,animations:Ji,apis:sl},En=(e={},t={},s={})=>(t.layoutCalculated||(e.paddingTop=parseInt(s.paddingTop,10)||0,e.marginTop=parseInt(s.marginTop,10)||0,e.marginRight=parseInt(s.marginRight,10)||0,e.marginBottom=parseInt(s.marginBottom,10)||0,e.marginLeft=parseInt(s.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=t.offsetParent===null,e),X=({tag:e="div",name:t=null,attributes:s={},read:n=()=>{},write:r=()=>{},create:l=()=>{},destroy:i=()=>{},filterFrameActionsForChild:o=(E,u)=>u,didCreateView:a=()=>{},didWriteView:d=()=>{},ignoreRect:c=!1,ignoreRectUpdate:f=!1,mixins:_=[]}={})=>(E,u={})=>{const p=lt(e,`filepond--${t}`,s),h=window.getComputedStyle(p,null),g=En();let R=null,v=!1;const A=[],P=[],T={},w={},D=[r],L=[n],N=[i],b=()=>p,F=()=>A.concat(),K=()=>T,S=V=>(J,_e)=>J(V,_e),k=()=>R||(R=us(g,A,[0,0],[1,1]),R),I=()=>h,O=()=>{R=null,A.forEach(_e=>_e._read()),!(f&&g.width&&g.height)&&En(g,p,h);const J={root:Ie,props:u,rect:g};L.forEach(_e=>_e(J))},C=(V,J,_e)=>{let Me=J.length===0;return D.forEach(re=>{re({props:u,root:Ie,actions:J,timestamp:V,shouldOptimize:_e})===!1&&(Me=!1)}),P.forEach(re=>{re.write(V)===!1&&(Me=!1)}),A.filter(re=>!!re.element.parentNode).forEach(re=>{re._write(V,o(re,J),_e)||(Me=!1)}),A.forEach((re,$e)=>{re.element.parentNode||(Ie.appendChild(re.element,$e),re._read(),re._write(V,o(re,J),_e),Me=!1)}),v=Me,d({props:u,root:Ie,actions:J,timestamp:V}),Me},M=()=>{P.forEach(V=>V.destroy()),N.forEach(V=>{V({root:Ie,props:u})}),A.forEach(V=>V._destroy())},$={element:{get:b},style:{get:I},childViews:{get:F}},x={...$,rect:{get:k},ref:{get:K},is:V=>t===V,appendChild:Hi(p),createChildView:S(E),linkView:V=>(A.push(V),V),unlinkView:V=>{A.splice(A.indexOf(V),1)},appendChildView:qi(p,A),removeChildView:Yi(p,A),registerWriter:V=>D.push(V),registerReader:V=>L.push(V),registerDestroyer:V=>N.push(V),invalidateLayout:()=>p.layoutCalculated=!1,dispatch:E.dispatch,query:E.query},Xe={element:{get:b},childViews:{get:F},rect:{get:k},resting:{get:()=>v},isRectIgnored:()=>c,_read:O,_write:C,_destroy:M},sn={...$,rect:{get:()=>g}};Object.keys(_).sort((V,J)=>V==="styles"?1:J==="styles"?-1:0).forEach(V=>{const J=ol[V]({mixinConfig:_[V],viewProps:u,viewState:w,viewInternalAPI:x,viewExternalAPI:Xe,view:Re(sn)});J&&P.push(J)});const Ie=Re(x);l({root:Ie,props:u});const Ks=Xi(p);return A.forEach((V,J)=>{Ie.appendChild(V.element,Ks+J)}),a(Ie),Re(Xe)},cl=(e,t,s=60)=>{const n="__framePainter";if(window[n]){window[n].readers.push(e),window[n].writers.push(t);return}window[n]={readers:[e],writers:[t]};const r=window[n],l=1e3/s;let i=null,o=null,a=null,d=null;const c=()=>{document.hidden?(a=()=>window.setTimeout(()=>f(performance.now()),l),d=()=>window.clearTimeout(o)):(a=()=>window.requestAnimationFrame(f),d=()=>window.cancelAnimationFrame(o))};document.addEventListener("visibilitychange",()=>{d&&d(),c(),f(performance.now())});const f=_=>{o=a(f),i||(i=_);const E=_-i;E<=l||(i=_-E%l,r.readers.forEach(u=>u()),r.writers.forEach(u=>u(_)))};return c(),f(performance.now()),{pause:()=>{d(o)}}},se=(e,t)=>({root:s,props:n,actions:r=[],timestamp:l,shouldOptimize:i})=>{r.filter(o=>e[o.type]).forEach(o=>e[o.type]({root:s,props:n,action:o.data,timestamp:l,shouldOptimize:i})),t&&t({root:s,props:n,actions:r,timestamp:l,shouldOptimize:i})},pn=(e,t)=>t.parentNode.insertBefore(e,t),_n=(e,t)=>t.parentNode.insertBefore(e,t.nextSibling),Et=e=>Array.isArray(e),me=e=>e==null,dl=e=>e.trim(),pt=e=>""+e,ul=(e,t=",")=>me(e)?[]:Et(e)?e:pt(e).split(t).map(dl).filter(s=>s.length),fs=e=>typeof e=="boolean",Es=e=>fs(e)?e:e==="true",ne=e=>typeof e=="string",ps=e=>Oe(e)?e:ne(e)?pt(e).replace(/[a-z]+/gi,""):0,st=e=>parseInt(ps(e),10),mn=e=>parseFloat(ps(e)),Ve=e=>Oe(e)&&isFinite(e)&&Math.floor(e)===e,gn=(e,t=1e3)=>{if(Ve(e))return e;let s=pt(e).trim();return/MB$/i.test(s)?(s=s.replace(/MB$i/,"").trim(),st(s)*t*t):/KB/i.test(s)?(s=s.replace(/KB$i/,"").trim(),st(s)*t):st(s)},De=e=>typeof e=="function",fl=e=>{let t=self,s=e.split("."),n=null;for(;n=s.shift();)if(t=t[n],!t)return null;return t},In={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},El=e=>{const t={};return t.url=ne(e)?e:e.url||"",t.timeout=e.timeout?parseInt(e.timeout,10):0,t.headers=e.headers?e.headers:{},Y(In,s=>{t[s]=pl(s,e[s],In[s],t.timeout,t.headers)}),t.process=e.process||ne(e)||e.url?t.process:null,t.remove=e.remove||null,delete t.headers,t},pl=(e,t,s,n,r)=>{if(t===null)return null;if(typeof t=="function")return t;const l={url:s==="GET"||s==="PATCH"?`?${e}=`:"",method:s,headers:r,withCredentials:!1,timeout:n,onload:null,ondata:null,onerror:null};if(ne(t))return l.url=t,l;if(Object.assign(l,t),ne(l.headers)){const i=l.headers.split(/:(.+)/);l.headers={header:i[0],value:i[1]}}return l.withCredentials=Es(l.withCredentials),l},_l=e=>El(e),ml=e=>e===null,Q=e=>typeof e=="object"&&e!==null,gl=e=>Q(e)&&ne(e.url)&&Q(e.process)&&Q(e.revert)&&Q(e.restore)&&Q(e.fetch),bt=e=>Et(e)?"array":ml(e)?"null":Ve(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":gl(e)?"api":typeof e,Il=e=>e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'),Tl={array:ul,boolean:Es,int:e=>bt(e)==="bytes"?gn(e):st(e),number:mn,float:mn,bytes:gn,string:e=>De(e)?e:pt(e),function:e=>fl(e),serverapi:_l,object:e=>{try{return JSON.parse(Il(e))}catch{return null}}},hl=(e,t)=>Tl[t](e),_s=(e,t,s)=>{if(e===t)return e;let n=bt(e);if(n!==s){const r=hl(e,s);if(n=bt(r),r===null)throw`Trying to assign value with incorrect type to "${option}", allowed type: "${s}"`;e=r}return e},Rl=(e,t)=>{let s=e;return{enumerable:!0,get:()=>s,set:n=>{s=_s(n,e,t)}}},Sl=e=>{const t={};return Y(e,s=>{const n=e[s];t[s]=Rl(n[0],n[1])}),Re(t)},Ol=e=>({items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:Sl(e)}),_t=(e,t="-")=>e.split(/(?=[A-Z])/).map(s=>s.toLowerCase()).join(t),Dl=(e,t)=>{const s={};return Y(t,n=>{s[n]={get:()=>e.getState().options[n],set:r=>{e.dispatch(`SET_${_t(n,"_").toUpperCase()}`,{value:r})}}}),s},yl=e=>(t,s,n)=>{const r={};return Y(e,l=>{const i=_t(l,"_").toUpperCase();r[`SET_${i}`]=o=>{try{n.options[l]=o.value}catch{}t(`DID_SET_${i}`,{value:n.options[l]})}}),r},vl=e=>t=>{const s={};return Y(e,n=>{s[`GET_${_t(n,"_").toUpperCase()}`]=r=>t.options[n]}),s},de={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5},zt=()=>Math.random().toString(36).substring(2,11),Wt=(e,t)=>e.splice(t,1),Al=(e,t)=>{t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)},mt=()=>{const e=[],t=(n,r)=>{Wt(e,e.findIndex(l=>l.event===n&&(l.cb===r||!r)))},s=(n,r,l)=>{e.filter(i=>i.event===n).map(i=>i.cb).forEach(i=>Al(()=>i(...r),l))};return{fireSync:(n,...r)=>{s(n,r,!0)},fire:(n,...r)=>{s(n,r,!1)},on:(n,r)=>{e.push({event:n,cb:r})},onOnce:(n,r)=>{e.push({event:n,cb:(...l)=>{t(n,r),r(...l)}})},off:t}},ms=(e,t,s)=>{Object.getOwnPropertyNames(e).filter(n=>!s.includes(n)).forEach(n=>Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n)))},Pl=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],ie=e=>{const t={};return ms(e,t,Pl),t},Ll=e=>{e.forEach((t,s)=>{t.released&&Wt(e,s)})},G={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},Z={INPUT:1,LIMBO:2,LOCAL:3},gs=e=>/[^0-9]+/.exec(e),Is=()=>gs(1.1.toLocaleString())[0],bl=()=>{const e=Is(),t=1e3.toLocaleString();return t!=="1000"?gs(t)[0]:e==="."?",":"."},m={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},Xt=[],ue=(e,t,s)=>new Promise((n,r)=>{const l=Xt.filter(o=>o.key===e).map(o=>o.cb);if(l.length===0){n(t);return}const i=l.shift();l.reduce((o,a)=>o.then(d=>a(d,s)),i(t,s)).then(o=>n(o)).catch(o=>r(o))}),be=(e,t,s)=>Xt.filter(n=>n.key===e).map(n=>n.cb(t,s)),Cl=(e,t)=>Xt.push({key:e,cb:t}),Ml=e=>Object.assign(Ge,e),at=()=>({...Ge}),wl=e=>{Y(e,(t,s)=>{Ge[t]&&(Ge[t][0]=_s(s,Ge[t][0],Ge[t][1]))})},Ge={id:[null,m.STRING],name:["filepond",m.STRING],disabled:[!1,m.BOOLEAN],className:[null,m.STRING],required:[!1,m.BOOLEAN],captureMethod:[null,m.STRING],allowSyncAcceptAttribute:[!0,m.BOOLEAN],allowDrop:[!0,m.BOOLEAN],allowBrowse:[!0,m.BOOLEAN],allowPaste:[!0,m.BOOLEAN],allowMultiple:[!1,m.BOOLEAN],allowReplace:[!0,m.BOOLEAN],allowRevert:[!0,m.BOOLEAN],allowRemove:[!0,m.BOOLEAN],allowProcess:[!0,m.BOOLEAN],allowReorder:[!1,m.BOOLEAN],allowDirectoriesOnly:[!1,m.BOOLEAN],storeAsFile:[!1,m.BOOLEAN],forceRevert:[!1,m.BOOLEAN],maxFiles:[null,m.INT],checkValidity:[!1,m.BOOLEAN],itemInsertLocationFreedom:[!0,m.BOOLEAN],itemInsertLocation:["before",m.STRING],itemInsertInterval:[75,m.INT],dropOnPage:[!1,m.BOOLEAN],dropOnElement:[!0,m.BOOLEAN],dropValidation:[!1,m.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],m.ARRAY],instantUpload:[!0,m.BOOLEAN],maxParallelUploads:[2,m.INT],allowMinimumUploadDuration:[!0,m.BOOLEAN],chunkUploads:[!1,m.BOOLEAN],chunkForce:[!1,m.BOOLEAN],chunkSize:[5e6,m.INT],chunkRetryDelays:[[500,1e3,3e3],m.ARRAY],server:[null,m.SERVER_API],fileSizeBase:[1e3,m.INT],labelFileSizeBytes:["bytes",m.STRING],labelFileSizeKilobytes:["KB",m.STRING],labelFileSizeMegabytes:["MB",m.STRING],labelFileSizeGigabytes:["GB",m.STRING],labelDecimalSeparator:[Is(),m.STRING],labelThousandsSeparator:[bl(),m.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',m.STRING],labelInvalidField:["Field contains invalid files",m.STRING],labelFileWaitingForSize:["Waiting for size",m.STRING],labelFileSizeNotAvailable:["Size not available",m.STRING],labelFileCountSingular:["file in list",m.STRING],labelFileCountPlural:["files in list",m.STRING],labelFileLoading:["Loading",m.STRING],labelFileAdded:["Added",m.STRING],labelFileLoadError:["Error during load",m.STRING],labelFileRemoved:["Removed",m.STRING],labelFileRemoveError:["Error during remove",m.STRING],labelFileProcessing:["Uploading",m.STRING],labelFileProcessingComplete:["Upload complete",m.STRING],labelFileProcessingAborted:["Upload cancelled",m.STRING],labelFileProcessingError:["Error during upload",m.STRING],labelFileProcessingRevertError:["Error during revert",m.STRING],labelTapToCancel:["tap to cancel",m.STRING],labelTapToRetry:["tap to retry",m.STRING],labelTapToUndo:["tap to undo",m.STRING],labelButtonRemoveItem:["Remove",m.STRING],labelButtonAbortItemLoad:["Abort",m.STRING],labelButtonRetryItemLoad:["Retry",m.STRING],labelButtonAbortItemProcessing:["Cancel",m.STRING],labelButtonUndoItemProcessing:["Undo",m.STRING],labelButtonRetryItemProcessing:["Retry",m.STRING],labelButtonProcessItem:["Upload",m.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',m.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',m.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',m.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',m.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',m.STRING],oninit:[null,m.FUNCTION],onwarning:[null,m.FUNCTION],onerror:[null,m.FUNCTION],onactivatefile:[null,m.FUNCTION],oninitfile:[null,m.FUNCTION],onaddfilestart:[null,m.FUNCTION],onaddfileprogress:[null,m.FUNCTION],onaddfile:[null,m.FUNCTION],onprocessfilestart:[null,m.FUNCTION],onprocessfileprogress:[null,m.FUNCTION],onprocessfileabort:[null,m.FUNCTION],onprocessfilerevert:[null,m.FUNCTION],onprocessfile:[null,m.FUNCTION],onprocessfiles:[null,m.FUNCTION],onremovefile:[null,m.FUNCTION],onpreparefile:[null,m.FUNCTION],onupdatefiles:[null,m.FUNCTION],onreorderfiles:[null,m.FUNCTION],beforeDropFile:[null,m.FUNCTION],beforeAddFile:[null,m.FUNCTION],beforeRemoveFile:[null,m.FUNCTION],beforePrepareFile:[null,m.FUNCTION],stylePanelLayout:[null,m.STRING],stylePanelAspectRatio:[null,m.STRING],styleItemPanelAspectRatio:[null,m.STRING],styleButtonRemoveItemPosition:["left",m.STRING],styleButtonProcessItemPosition:["right",m.STRING],styleLoadIndicatorPosition:["right",m.STRING],styleProgressIndicatorPosition:["right",m.STRING],styleButtonRemoveItemAlign:[!1,m.BOOLEAN],files:[[],m.ARRAY],credits:[["https://filepond.com","Powered by FilePond"],m.ARRAY]},ye=(e,t)=>me(t)?e[0]||null:Ve(t)?e[t]||null:(typeof t=="object"&&(t=t.id),e.find(s=>s.id===t)||null),Ts=e=>{if(me(e))return e;if(/:/.test(e)){const t=e.split(":");return t[1]/t[0]}return parseFloat(e)},fe=e=>e.filter(t=>!t.archived),Nl={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};let Ze=null;const Gl=()=>{if(Ze===null)try{const e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));const t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,Ze=t.files.length===1}catch{Ze=!1}return Ze},Fl=[G.LOAD_ERROR,G.PROCESSING_ERROR,G.PROCESSING_REVERT_ERROR],Ul=[G.LOADING,G.PROCESSING,G.PROCESSING_QUEUED,G.INIT],xl=[G.PROCESSING_COMPLETE],Bl=e=>Fl.includes(e.status),Vl=e=>Ul.includes(e.status),kl=e=>xl.includes(e.status),Tn=e=>Q(e.options.server)&&(Q(e.options.server.process)||De(e.options.server.process)),Hl=e=>({GET_STATUS:()=>{const t=fe(e.items),{EMPTY:s,ERROR:n,BUSY:r,IDLE:l,READY:i}=Nl;return t.length===0?s:t.some(Bl)?n:t.some(Vl)?r:t.some(kl)?i:l},GET_ITEM:t=>ye(e.items,t),GET_ACTIVE_ITEM:t=>ye(fe(e.items),t),GET_ACTIVE_ITEMS:()=>fe(e.items),GET_ITEMS:()=>e.items,GET_ITEM_NAME:t=>{const s=ye(e.items,t);return s?s.filename:null},GET_ITEM_SIZE:t=>{const s=ye(e.items,t);return s?s.fileSize:null},GET_STYLES:()=>Object.keys(e.options).filter(t=>/^style/.test(t)).map(t=>({name:t,value:e.options[t]})),GET_PANEL_ASPECT_RATIO:()=>/circle/.test(e.options.stylePanelLayout)?1:Ts(e.options.stylePanelAspectRatio),GET_ITEM_PANEL_ASPECT_RATIO:()=>e.options.styleItemPanelAspectRatio,GET_ITEMS_BY_STATUS:t=>fe(e.items).filter(s=>s.status===t),GET_TOTAL_ITEMS:()=>fe(e.items).length,SHOULD_UPDATE_FILE_INPUT:()=>e.options.storeAsFile&&Gl()&&!Tn(e),IS_ASYNC:()=>Tn(e),GET_FILE_SIZE_LABELS:t=>({labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0})}),ql=e=>{const t=fe(e.items).length;if(!e.options.allowMultiple)return t===0;const s=e.options.maxFiles;return s===null||t<s},hs=(e,t,s)=>Math.max(Math.min(s,e),t),Yl=(e,t,s)=>e.splice(t,0,s),zl=(e,t,s)=>me(t)?null:typeof s>"u"?(e.push(t),t):(s=hs(s,0,e.length),Yl(e,s,t),t),Ct=e=>/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e),We=e=>`${e}`.split("/").pop().split("?").shift(),gt=e=>e.split(".").pop(),Wl=e=>{if(typeof e!="string")return"";const t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?t==="jpeg"?"jpg":t:""},ke=(e,t="")=>(t+e).slice(-t.length),Rs=(e=new Date)=>`${e.getFullYear()}-${ke(e.getMonth()+1,"00")}-${ke(e.getDate(),"00")}_${ke(e.getHours(),"00")}-${ke(e.getMinutes(),"00")}-${ke(e.getSeconds(),"00")}`,xe=(e,t,s=null,n=null)=>{const r=typeof s=="string"?e.slice(0,e.size,s):e.slice(0,e.size,e.type);return r.lastModifiedDate=new Date,e._relativePath&&(r._relativePath=e._relativePath),ne(t)||(t=Rs()),t&&n===null&>(t)?r.name=t:(n=n||Wl(r.type),r.name=t+(n?"."+n:"")),r},Xl=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Ss=(e,t)=>{const s=Xl();if(s){const n=new s;return n.append(e),n.getBlob(t)}return new Blob([e],{type:t})},$l=(e,t)=>{const s=new ArrayBuffer(e.length),n=new Uint8Array(s);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return Ss(s,t)},Os=e=>(/^data:(.+);/.exec(e)||[])[1]||null,jl=e=>e.split(",")[1].replace(/\s/g,""),Zl=e=>atob(jl(e)),Ql=e=>{const t=Os(e),s=Zl(e);return $l(s,t)},Kl=(e,t,s)=>xe(Ql(e),t,null,s),Jl=e=>{if(!/^content-disposition:/i.test(e))return null;const t=e.split(/filename=|filename\*=.+''/).splice(1).map(s=>s.trim().replace(/^["']|[;"']{0,2}$/g,"")).filter(s=>s.length);return t.length?decodeURI(t[t.length-1]):null},ea=e=>{if(/content-length:/i.test(e)){const t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},ta=e=>/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null,$t=e=>{const t={so