@cghbcf/xp-ui 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  - 🎨 现代化设计风格,支持主题定制(浅色 / 暗黑双主题)
10
10
  - 🎛️ 可视化主题定制面板 —— 实时修改颜色、一键导出 JSON/CSS
11
11
  - 🌈 主色自动派生(-light / -dark / -bg / -border),无需手动配置
12
- - 🔧 丰富的组件库,覆盖常用场景(Button / Input / Dialog / Card / Tabs 等 14+ 组件)
12
+ - 🔧 丰富的组件库,覆盖常用场景(Button / Input / Dialog / Card / Icon / Tabs / Empty / Toast / ContextMenu 20+ 组件)
13
13
  - 💎 完整的 CSS 变量(Design Tokens)系统,便于深度定制
14
14
  - 💾 主题配置自动持久化到 localStorage,刷新页面不丢失
15
15
 
@@ -70,6 +70,79 @@ initTheme()
70
70
 
71
71
  ## 组件
72
72
 
73
+ ### Icon 图标
74
+
75
+ 基于内联 SVG 的图标组件,支持预设/自定义尺寸、颜色、旋转与加载动画。
76
+
77
+ 图标文件统一存放在 `src/components/icon/icons/` 目录下,组件在构建时通过 `import.meta.glob` 自动扫描该目录,**新增图标只需放入 `.svg` 文件**,即可用同名 `name` 直接引用(例如 `jiantou.svg` 对应 `name="jiantou"`)。
78
+
79
+ 图标内部硬编码的 `fill` / `stroke` 颜色(除 `none` 外)会被自动替换为 `currentColor`,因此 `color` 属性始终生效。**未指定 `color` 时图标默认继承当前文字颜色,便于通过父元素着色(如按钮 hover 高亮)。** 当 `name` 不存在时,会展示占位符(`?`)便于排查。
80
+
81
+ #### 内置图标
82
+
83
+ 下表为当前内置的 18 个图标(不含占位符):
84
+
85
+ | name | 视觉 | name | 视觉 |
86
+ |------|------|------|------|
87
+ | `back` 返回 | ← | `forward` 前进 | → |
88
+ | `up` 上一级 | ↑ | `arrow-right` 右箭头 | →▸ |
89
+ | `refresh` 刷新 | ⟳ | `chevron-up` 上箭头 | ∧ |
90
+ | `chevron-down` 下箭头 | ∨ | `close` 关闭 | ✕ |
91
+ | `folder` 文件夹 | 📁 | `folder-add` 新建文件夹 | 📁+ |
92
+ | `list` 列表视图 | ☰ | `grid` 网格视图 | ▦ |
93
+ | `settings` 设置 | ⚙ | `star` 星标 | ☆ |
94
+ | `star-fill` 星标实心 | ★ | `upload` 上传 | ⇧ |
95
+ | `home` 首页 | ⌂ | `jiantou` 箭头 | ◀ |
96
+
97
+ > 图标总览见演示站 `Icon 图标` 页,点击图标可复制 `XpIcon` 代码。新增图标只需放入 `icons/` 目录即可自动出现。
98
+
99
+ #### 基础用法
100
+
101
+ ```vue
102
+ <template>
103
+ <!-- 内置图标 -->
104
+ <XpIcon name="jiantou" />
105
+
106
+ <!-- 方向:通过 rotate 或内联样式旋转 -->
107
+ <XpIcon name="jiantou" :rotate="180" />
108
+
109
+ <!-- 预设尺寸 -->
110
+ <XpIcon name="jiantou" size="small" />
111
+ <XpIcon name="jiantou" size="medium" />
112
+ <XpIcon name="jiantou" size="large" />
113
+
114
+ <!-- 自定义尺寸(数字按 px 处理) -->
115
+ <XpIcon name="jiantou" :size="32" />
116
+
117
+ <!-- 自定义颜色 -->
118
+ <XpIcon name="jiantou" color="#67c23a" />
119
+
120
+ <!-- 加载动画 -->
121
+ <XpIcon name="jiantou" spin color="var(--xp-color-primary)" />
122
+
123
+ <!-- name 不存在时显示占位符 -->
124
+ <XpIcon name="not-exist" />
125
+ </template>
126
+ ```
127
+
128
+ ##### Props
129
+
130
+ | 属性 | 类型 | 默认值 | 说明 |
131
+ |------|------|--------|------|
132
+ | name | string | '' | 图标名称,对应 `icons/` 目录下 `.svg` 文件名(不含后缀) |
133
+ | size | string / number | medium | 尺寸:预设值 `small`(14) / `medium`(18) / `large`(24),或自定义数字(px) / 带单位字符串(如 `48px`) |
134
+ | color | string | '' | 图标颜色,值为任意合法 CSS 颜色 |
135
+ | spin | boolean | false | 是否持续旋转(加载动画) |
136
+ | rotate | number | 0 | 旋转角度(单位:度) |
137
+
138
+ ##### Slots
139
+
140
+ | 插槽名 | 说明 |
141
+ |--------|------|
142
+ | default | 自定义图标内容(传入则优先渲染插槽内容,而非 SVG) |
143
+
144
+ ---
145
+
73
146
  ### Button 按钮
74
147
 
75
148
  按钮用于触发一个操作,如提交表单、打开对话框等。
@@ -105,7 +178,7 @@ const handleClick = () => {}
105
178
 
106
179
  | 属性 | 类型 | 默认值 | 说明 |
107
180
  |------|------|--------|------|
108
- | type | string | default | 按钮类型,可选值:primary / default / success / warning / danger / info |
181
+ | type | string | default | 按钮类型,可选值:primary / default / success / warning / danger / info / ghost |
109
182
  | size | string | medium | 按钮尺寸,可选值:small / medium / large |
110
183
  | plain | boolean | false | 是否朴素按钮 |
111
184
  | text | boolean | false | 是否文字按钮 |
@@ -156,6 +229,7 @@ const inputValue = ref('')
156
229
  | 属性 | 类型 | 默认值 | 说明 |
157
230
  |------|------|--------|------|
158
231
  | modelValue | string / number | '' | 输入框的值,支持 v-model |
232
+ | id | string | '' | 原生 input 的 id,配合 label[for] 使用 |
159
233
  | type | string | text | 输入框类型,可选值:text / password / number / email / tel / url |
160
234
  | placeholder | string | '' | 占位符文本 |
161
235
  | disabled | boolean | false | 是否禁用 |
@@ -179,6 +253,31 @@ const inputValue = ref('')
179
253
  | prefix | 前缀内容 |
180
254
  | suffix | 后缀内容 |
181
255
 
256
+ ##### 实例方法
257
+
258
+ 通过模板 ref 可调用内部原生 input 的方法(如自动聚焦 / 全选):
259
+
260
+ ```vue
261
+ <template>
262
+ <XpInput ref="inputRef" v-model="value" placeholder="请输入" />
263
+ </template>
264
+
265
+ <script setup>
266
+ import { ref, nextTick } from 'vue'
267
+ const inputRef = ref(null)
268
+ nextTick(() => {
269
+ inputRef.value.focus()
270
+ inputRef.value.select()
271
+ })
272
+ </script>
273
+ ```
274
+
275
+ | 方法 | 说明 |
276
+ |------|------|
277
+ | focus | 聚焦输入框 |
278
+ | select | 全选输入框内容 |
279
+ | blur | 失焦 |
280
+
182
281
  ---
183
282
 
184
283
  ### Switch 开关
@@ -446,6 +545,7 @@ const rate = ref(3)
446
545
  | showText | boolean | true | 是否显示百分比文字 |
447
546
  | type | string | line | 类型:line / circle |
448
547
  | status | string | '' | 状态:success / warning / exception |
548
+ | strokeWidth | number | 8 | line 模式下进度条高度(px),紧凑场景可设小值 |
449
549
 
450
550
  ##### Rate Props
451
551
 
@@ -720,6 +820,163 @@ const handleCancel = () => { visible.value = false }
720
820
  | default | 弹窗主体内容 |
721
821
  | footer | 自定义底部按钮区域 |
722
822
 
823
+ > 按 Esc 键同样可以关闭弹窗。
824
+
825
+ ---
826
+
827
+ ### Empty 空状态
828
+
829
+ 用于列表、目录等数据为空时的占位展示。
830
+
831
+ #### 基础用法
832
+
833
+ ```vue
834
+ <template>
835
+ <XpEmpty title="目录为空" hint="拖入文件或点击工具栏上传" />
836
+ </template>
837
+ ```
838
+
839
+ #### 自定义图标与操作
840
+
841
+ ```vue
842
+ <template>
843
+ <XpEmpty title="连接失败" hint="无法连接到服务器,请检查网络后重试">
844
+ <template #icon>
845
+ <div class="my-icon" />
846
+ </template>
847
+ <XpButton type="primary" size="small">重新加载</XpButton>
848
+ </XpEmpty>
849
+ </template>
850
+ ```
851
+
852
+ ##### Props
853
+
854
+ | 属性 | 类型 | 默认值 | 说明 |
855
+ |------|------|--------|------|
856
+ | title | string | 暂无内容 | 主文案 |
857
+ | hint | string | '' | 辅助说明文案 |
858
+
859
+ ##### Slots
860
+
861
+ | 插槽名 | 说明 |
862
+ |--------|------|
863
+ | icon | 自定义图标(默认是一个文件占位图形) |
864
+ | default | 底部操作区(如重试按钮) |
865
+
866
+ ---
867
+
868
+ ### FileIcon 文件图标
869
+
870
+ 按文件类型展示对应的矢量图标,内置文件夹与常见文件类型,适用于文件管理器等场景。
871
+
872
+ #### 基础用法
873
+
874
+ ```vue
875
+ <template>
876
+ <XpFileIcon type="folder" :size="34" />
877
+ <XpFileIcon type="pdf" :size="34" />
878
+ <XpFileIcon type="code" :size="20" />
879
+ </template>
880
+ ```
881
+
882
+ ##### Props
883
+
884
+ | 属性 | 类型 | 默认值 | 说明 |
885
+ |------|------|--------|------|
886
+ | type | string | file | 类型:folder / image / video / audio / pdf / doc / sheet / slide / archive / code / text / file |
887
+ | size | number | 20 | 图标边长(px) |
888
+
889
+ ---
890
+
891
+ ### ContextMenu 右键菜单
892
+
893
+ 在指定屏幕坐标位置弹出的菜单,常用于右键 / 长按等交互场景。
894
+
895
+ #### 基础用法
896
+
897
+ ```vue
898
+ <template>
899
+ <div @contextmenu.prevent="openMenu($event, items)">右键点击此区域</div>
900
+ <XpContextMenu :visible="menu.visible" :x="menu.x" :y="menu.y" :items="menu.items" @close="menu.visible = false" />
901
+ </template>
902
+
903
+ <script setup>
904
+ import { reactive } from 'vue'
905
+ const menu = reactive({ visible: false, x: 0, y: 0, items: [] })
906
+ const openMenu = (e, items) => {
907
+ menu.x = e.clientX
908
+ menu.y = e.clientY
909
+ menu.items = items
910
+ menu.visible = true
911
+ }
912
+ const items = [
913
+ { label: '打开', command: 'open' },
914
+ { label: '禁用项', disabled: true },
915
+ { divider: true },
916
+ { label: '删除', command: 'delete', danger: true }
917
+ ]
918
+ </script>
919
+ ```
920
+
921
+ > 菜单会自动进行视口边界校正;点击菜单项、遮罩或按 Esc 均会关闭菜单。
922
+
923
+ ##### Props
924
+
925
+ | 属性 | 类型 | 默认值 | 说明 |
926
+ |------|------|--------|------|
927
+ | visible | boolean | false | 是否显示 |
928
+ | x | number | 0 | 菜单左上角 x 坐标(px) |
929
+ | y | number | 0 | 菜单左上角 y 坐标(px) |
930
+ | items | Array | [] | 菜单项:{ label, icon?, command?, danger?, disabled?, divider?, onClick? } |
931
+
932
+ ##### Events
933
+
934
+ | 事件名 | 说明 | 回调参数 |
935
+ |--------|------|----------|
936
+ | select | 点击菜单项时触发 | item |
937
+ | command | 点击菜单项时触发(传 command) | command, item |
938
+ | close | 菜单关闭时触发 | - |
939
+
940
+ > 兼容用法:菜单项里直接传 `onClick` 函数也会在点击时被调用。
941
+
942
+ ---
943
+
944
+ ### Toast 轻提示
945
+
946
+ 轻量级的全局消息提示,需要配合 `useToast()` 组合式函数使用。
947
+
948
+ #### 基础用法
949
+
950
+ ```vue
951
+ <template>
952
+ <!-- 在应用根节点挂载一次即可 -->
953
+ <XpToast />
954
+ </template>
955
+
956
+ <script setup>
957
+ import { useToast } from '@cghbcf/xp-ui'
958
+ const { toast, success, error, warn, info } = useToast()
959
+
960
+ success('操作成功')
961
+ error('操作失败')
962
+ warn('请注意该操作的后果')
963
+ info('这是一条普通提示')
964
+ </script>
965
+ ```
966
+
967
+ ##### useToast API
968
+
969
+ | 方法 | 说明 | 参数 |
970
+ |------|------|------|
971
+ | toast | 触发提示,可自定义类型与时长 | (message, type?, duration?) |
972
+ | success | 成功提示(2200ms) | message |
973
+ | error | 错误提示(3600ms) | message |
974
+ | warn | 警告提示(2800ms) | message |
975
+ | info | 信息提示(2600ms) | message |
976
+ | toasts | 响应式提示列表(ref) | - |
977
+
978
+ toast 的 `type` 可选值:`info` / `success` / `error` / `warn`。
979
+
723
980
  ---
724
981
 
725
982
  ## 主题定制
@@ -1,4 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=(t,a)=>{const l=t.__vccOpts||t;for(const[o,n]of a)l[o]=n;return l},re={class:"xp-alert__icon"},se={class:"xp-alert__content"},ce={class:"xp-alert__title"},de={key:0,class:"xp-alert__description"},ie={__name:"Alert",props:{title:{type:String,default:""},type:{type:String,default:"info",validator:t=>["success","warning","danger","info"].includes(t)},effect:{type:String,default:"light",validator:t=>["light","dark","plain"].includes(t)},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:a}){const l=a,o=e.ref(!0),n={success:"✓",warning:"!",danger:"×",info:"i"},s=()=>{o.value=!1,l("close")};return(r,d)=>(e.openBlock(),e.createBlock(e.Transition,{name:"xp-alert-fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-alert",[`xp-alert--${t.type}`,`xp-alert--${t.effect}`,{"xp-alert--plain":t.effect==="plain"}]]),role:"alert"},[e.createElementVNode("span",re,e.toDisplayString(n[t.type]),1),e.createElementVNode("div",se,[e.createElementVNode("span",ce,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)]),r.$slots.default?(e.openBlock(),e.createElementBlock("p",de,[e.renderSlot(r.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),t.closable?(e.openBlock(),e.createElementBlock("i",{key:0,class:"xp-alert__close-btn",onClick:s},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},z=h(ie,[["__scopeId","data-v-91d792bd"]]),ue=["src","alt"],pe={key:1,class:"xp-avatar__slot"},fe={key:2,class:"xp-avatar__text"},me={__name:"Avatar",props:{src:{type:String,default:""},alt:{type:String,default:""},shape:{type:String,default:"circle",validator:t=>["circle","square"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},icon:{type:String,default:""}},emits:["error"],setup(t,{emit:a}){const l=t,o=a,n=e.ref(!1),s=e.computed(()=>({backgroundColor:l.src?"transparent":"var(--xp-color-primary-bg)",color:l.src?void 0:"var(--xp-color-primary)"})),r=()=>{n.value=!0,o("error")};return(d,u)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-avatar",[`xp-avatar--${t.shape}`,`xp-avatar--${t.size}`,{"xp-avatar--fit":t.src}]]),style:e.normalizeStyle(s.value)},[t.src&&!n.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,onError:r},null,40,ue)):d.$slots.default?(e.openBlock(),e.createElementBlock("span",pe,[e.renderSlot(d.$slots,"default",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString(t.alt||"A"),1))],6))}},M=h(me,[["__scopeId","data-v-a9a54bc5"]]),he={key:0},ge={__name:"Badge",props:{value:{type:[String,Number],default:0},max:{type:Number,default:99},type:{type:String,default:"danger",validator:t=>["primary","success","warning","danger","info"].includes(t)},isDot:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(t){const a=t,l=e.computed(()=>typeof a.value=="number"&&a.value>a.max?`${a.max}+`:a.value),o=e.computed(()=>a.value!==0&&a.value!==""&&a.value!==null&&a.value!==void 0);return(n,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-badge",{"xp-badge--dot":t.isDot,"xp-badge--hidden":t.hidden}])},[e.renderSlot(n.$slots,"default",{},void 0,!0),!t.hidden&&(t.isDot||o.value)?(e.openBlock(),e.createElementBlock("sup",{key:0,class:e.normalizeClass(["xp-badge__content",[`xp-badge__content--${t.type}`,{"xp-badge__content--dot":t.isDot}]])},[t.isDot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",he,e.toDisplayString(l.value),1))],2)):e.createCommentVNode("",!0)],2))}},R=h(ge,[["__scopeId","data-v-207db6dd"]]),xe=["disabled"],be={key:0,class:"xp-button__loading"},ke={class:"xp-button__text"},ye={__name:"Button",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},text:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:a}){const l=t,o=a,n=s=>{!l.disabled&&!l.loading&&o("click",s)};return(s,r)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["xp-button",[`xp-button--${t.type}`,`xp-button--${t.size}`,{"xp-button--disabled":t.disabled,"xp-button--loading":t.loading,"xp-button--plain":t.plain,"xp-button--text":t.text}]]),disabled:t.disabled||t.loading,onClick:n},[t.loading?(e.openBlock(),e.createElementBlock("span",be)):e.createCommentVNode("",!0),e.createElementVNode("span",ke,[e.renderSlot(s.$slots,"default",{},void 0,!0)])],10,xe))}},S=h(ye,[["__scopeId","data-v-a768661d"]]),ve={key:0,class:"xp-card__header"},_e={class:"xp-card__title"},Be={key:0,class:"xp-card__extra"},$e={class:"xp-card__body"},Ce={key:1,class:"xp-card__footer"},Ve={__name:"Card",props:{title:{type:String,default:""},shadow:{type:String,default:"always",validator:t=>["always","hover","never"].includes(t)},bordered:{type:Boolean,default:!0},hover:{type:Boolean,default:!1}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-card",[`xp-card--${t.shadow}`,{"xp-card--bordered":t.bordered,"xp-card--hover":t.hover}]])},[t.title||a.$slots.header?(e.openBlock(),e.createElementBlock("div",ve,[e.renderSlot(a.$slots,"header",{},()=>[e.createElementVNode("h3",_e,e.toDisplayString(t.title),1)],!0),a.$slots.extra?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(a.$slots,"extra",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",$e,[e.renderSlot(a.$slots,"default",{},void 0,!0)]),a.$slots.footer?(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(a.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},A=h(Ve,[["__scopeId","data-v-e65cbe05"]]),Se={class:"xp-checkbox__input"},we=["checked","disabled",".indeterminate"],Ee={class:"xp-checkbox__label"},Ne={__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:a}){const l=t,o=a,n=s=>{if(l.disabled)return;const r=s.target.checked;o("update:modelValue",r),o("change",r)};return(s,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-checkbox",[{"xp-checkbox--checked":t.modelValue,"xp-checkbox--disabled":t.disabled,"xp-checkbox--indeterminate":t.indeterminate}]])},[e.createElementVNode("span",Se,[r[0]||(r[0]=e.createElementVNode("span",{class:"xp-checkbox__inner"},null,-1)),e.createElementVNode("input",{type:"checkbox",class:"xp-checkbox__original",checked:t.modelValue,disabled:t.disabled,onChange:n,".indeterminate":t.indeterminate},null,40,we)]),e.createElementVNode("span",Ee,[e.renderSlot(s.$slots,"default",{},void 0,!0)])],2))}},O=h(Ne,[["__scopeId","data-v-7c078f46"]]),Te={class:"xp-dialog__header"},Ie={class:"xp-dialog__title"},Xe={class:"xp-dialog__body"},De={key:0,class:"xp-dialog__footer"},ze={__name:"Dialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},confirmButtonText:{type:String,default:"确定"},cancelButtonText:{type:String,default:"取消"},closeOnClickModal:{type:Boolean,default:!0},showDefaultFooter:{type:Boolean,default:!0}},emits:["confirm","cancel","update:visible","close"],setup(t,{emit:a}){const l=t,o=a,n=()=>{o("update:visible",!1),o("close")},s=()=>{l.closeOnClickModal&&n()},r=()=>{o("confirm"),n()},d=()=>{o("cancel"),n()};return(u,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dialog-fade"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog__wrapper",onClick:e.withModifiers(s,["self"])},[i[0]||(i[0]=e.createElementVNode("div",{class:"xp-dialog__mask"},null,-1)),e.createVNode(e.Transition,{name:"xp-dialog-slide",appear:""},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",Te,[e.createElementVNode("h3",Ie,e.toDisplayString(t.title),1),e.createElementVNode("button",{class:"xp-dialog__close",onClick:n},"×")]),e.createElementVNode("div",Xe,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer||t.showDefaultFooter?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(u.$slots,"footer",{},()=>[e.createVNode(S,{onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(S,{type:"primary",onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText),1)]),_:1})],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}},j=h(ze,[["__scopeId","data-v-ef43d114"]]),Me=["onClick"],Re={key:0},Ae={key:1,class:"xp-dropdown__divider"},Oe={__name:"Dropdown",props:{items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["select","command","open","close"],setup(t,{emit:a}){const l=t,o=a,n=e.ref(!1),s=e.ref({}),r=e.ref(null),d=e.ref(null),u=()=>{e.nextTick(()=>{if(!r.value||!d.value)return;const c=r.value.getBoundingClientRect(),g=d.value.getBoundingClientRect();let m=c.bottom+6,_=c.left;_+g.width>window.innerWidth-10&&(_=window.innerWidth-g.width-10),m+g.height>window.innerHeight-10&&(m=c.top-g.height-6),s.value={top:`${m+window.scrollY}px`,left:`${_+window.scrollX}px`}})},i=()=>{l.disabled||(n.value=!n.value,n.value?(u(),o("open")):o("close"))},f=c=>{c.disabled||c.divider||(o("select",c),c.command!==void 0&&o("command",c.command,c),n.value=!1,o("close"))},p=c=>{var g;n.value&&r.value&&!r.value.contains(c.target)&&!((g=d.value)!=null&&g.contains(c.target))&&(n.value=!1,o("close"))};return e.onMounted(()=>{document.addEventListener("click",p)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",p)}),(c,g)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-dropdown",ref_key:"dropdownRef",ref:r},[e.createElementVNode("div",{class:"xp-dropdown__trigger",onClick:i},[e.renderSlot(c.$slots,"default",{},void 0,!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dropdown-fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dropdown__menu",style:e.normalizeStyle(s.value),ref_key:"menuRef",ref:d},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(m,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["xp-dropdown__item",{"xp-dropdown__item--disabled":m.disabled,"xp-dropdown__item--divider":m.divider}]),onClick:Vt=>f(m)},[m.divider?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Re,e.toDisplayString(m.label),1)),m.divider?(e.openBlock(),e.createElementBlock("span",Ae)):e.createCommentVNode("",!0)],10,Me))),128))],4)):e.createCommentVNode("",!0)]),_:1})]))],512))}},F=h(Oe,[["__scopeId","data-v-ad741cd8"]]),je={key:0,class:"xp-input__prefix"},Fe=["type","value","placeholder","disabled","maxlength"],Pe={key:2,class:"xp-input__suffix"},Le={__name:"Input",props:{modelValue:{type:[String,Number],default:""},type:{type:String,default:"text",validator:t=>["text","password","number","email","tel","url"].includes(t)},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},maxlength:{type:[String,Number],default:null},showClear:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","clear"],setup(t,{emit:a}){const l=a,o=e.ref(null),n=e.ref(!1),s=i=>{l("update:modelValue",i.target.value)},r=i=>{n.value=!0,l("focus",i)},d=i=>{n.value=!1,l("blur",i)},u=()=>{l("update:modelValue",""),l("clear"),o.value&&o.value.focus()};return(i,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":i.$slots.prefix,"xp-input--suffix":i.$slots.suffix||t.showClear,"xp-input--focus":n.value}]])},[i.$slots.prefix?(e.openBlock(),e.createElementBlock("span",je,[e.renderSlot(i.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:o,class:"xp-input__inner",type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,maxlength:t.maxlength,onInput:s,onFocus:r,onBlur:d},null,40,Fe),t.showClear&&t.modelValue&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"xp-input__clear",onClick:u},"×")):e.createCommentVNode("",!0),i.$slots.suffix&&!t.showClear?(e.openBlock(),e.createElementBlock("span",Pe,[e.renderSlot(i.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},P=h(Le,[["__scopeId","data-v-f671ef9a"]]),Ue={class:"xp-progress__bar"},qe={key:0,class:"xp-progress__text"},He={__name:"Progress",props:{percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:String,default:""},showText:{type:Boolean,default:!0},type:{type:String,default:"line",validator:t=>["line","circle"].includes(t)},status:{type:String,default:"",validator:t=>["","success","warning","exception"].includes(t)}},setup(t){const a=t,l=e.computed(()=>a.color?a.color:a.status==="success"?"var(--xp-color-success)":a.status==="warning"?"var(--xp-color-warning)":a.status==="exception"?"var(--xp-color-danger)":"var(--xp-color-primary)");return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-progress",[`xp-progress--${t.type}`]])},[e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:"xp-progress__inner",style:e.normalizeStyle({width:`${t.percentage}%`,backgroundColor:l.value})},null,4)]),t.showText?(e.openBlock(),e.createElementBlock("span",qe,[e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)],!0)])):e.createCommentVNode("",!0)],2))}},L=h(He,[["__scopeId","data-v-a95933c8"]]),Je={class:"xp-radio__input"},We=["checked","disabled"],Ye={class:"xp-radio__label"},Ke={__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:""},value:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:a}){const l=t,o=a,n=()=>{l.disabled||(o("update:modelValue",l.value),o("change",l.value))};return(s,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-radio",[{"xp-radio--checked":t.modelValue===t.value,"xp-radio--disabled":t.disabled}]])},[e.createElementVNode("span",Je,[r[0]||(r[0]=e.createElementVNode("span",{class:"xp-radio__inner"},null,-1)),e.createElementVNode("input",{type:"radio",class:"xp-radio__original",checked:t.modelValue===t.value,disabled:t.disabled,onChange:n},null,40,We)]),e.createElementVNode("span",Ye,[e.renderSlot(s.$slots,"default",{},void 0,!0)])],2))}},U=h(Ke,[["__scopeId","data-v-02a0d80d"]]),Ge={class:"xp-rate"},Qe=["onClick","onMouseenter"],Ze={class:"xp-rate__star"},et={key:0,class:"xp-rate__text"},tt={__name:"Rate",props:{modelValue:{type:Number,default:0},max:{type:Number,default:5},color:{type:String,default:"#f7ba2a"},disabled:{type:Boolean,default:!1},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:a}){const l=t,o=a,n=e.ref(0),s=e.computed(()=>n.value||l.modelValue),r=u=>{const i=s.value-u+1;return i>=1?100:i>0?i*100:0},d=u=>{l.disabled||(o("update:modelValue",u),o("change",u))};return(u,i)=>(e.openBlock(),e.createElementBlock("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max,f=>(e.openBlock(),e.createElementBlock("span",{key:f,class:e.normalizeClass(["xp-rate__item",{"xp-rate__item--disabled":t.disabled}]),style:e.normalizeStyle({cursor:t.disabled?"default":"pointer"}),onClick:p=>d(f),onMouseenter:p=>n.value=f,onMouseleave:i[0]||(i[0]=p=>n.value=0)},[e.createElementVNode("span",Ze,[e.createElementVNode("span",{class:"xp-rate__star-inner",style:e.normalizeStyle({width:r(f)+"%",color:t.color})}," ★ ",4),i[1]||(i[1]=e.createElementVNode("span",{class:"xp-rate__star-outer"},"★",-1))])],46,Qe))),128)),t.showText&&!t.disabled?(e.openBlock(),e.createElementBlock("span",et,e.toDisplayString(t.modelValue)+" / "+e.toDisplayString(t.max),1)):e.createCommentVNode("",!0)]))}},q=h(tt,[["__scopeId","data-v-17bb0933"]]),at=["aria-checked"],lt={key:0,class:"xp-switch__label"},ot={__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:a}){const l=t,o=a,n=()=>{if(l.disabled)return;const s=!l.modelValue;o("update:modelValue",s),o("change",s)};return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-switch",[`xp-switch--${t.size}`,{"xp-switch--checked":t.modelValue,"xp-switch--disabled":t.disabled}]]),role:"switch","aria-checked":t.modelValue,onClick:n},[r[0]||(r[0]=e.createElementVNode("span",{class:"xp-switch__core"},[e.createElementVNode("span",{class:"xp-switch__action"})],-1)),s.$slots.default?(e.openBlock(),e.createElementBlock("span",lt,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,at))}},H=h(ot,[["__scopeId","data-v-5a5e33c5"]]),nt={key:0,class:"xp-tab-pane"},rt={__name:"TabPane",props:{name:{type:[String,Number],required:!0},title:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(t){const a=t,l=e.inject("xpTabs",null),o=e.computed(()=>l?l.currentValue.value===a.name:!0);return e.onMounted(()=>{l&&l.addTab&&l.addTab({name:a.name,title:a.title,disabled:a.disabled})}),e.onBeforeUnmount(()=>{l&&l.removeTab&&l.removeTab(a.name)}),(n,s)=>o.value?(e.openBlock(),e.createElementBlock("div",nt,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)}},J=h(rt,[["__scopeId","data-v-6fe7943a"]]),st={class:"xp-tabs"},ct={class:"xp-tabs__nav",role:"tablist"},dt=["onClick"],it={class:"xp-tabs__content"},ut={__name:"Tabs",props:{modelValue:{type:[String,Number],default:null}},emits:["update:modelValue","change"],setup(t,{emit:a}){const l=t,o=a,n=e.ref([]),s=e.computed(()=>{var f;return l.modelValue!==null&&l.modelValue!==void 0&&l.modelValue!==""?l.modelValue:((f=n.value[0])==null?void 0:f.name)??null}),r=e.computed(()=>{const f=n.value.findIndex(c=>c.name===s.value);return{transform:`translateX(${(f>=0?f:0)*100}%)`,width:`${n.value.length?100/n.value.length:0}%`}}),d=f=>{f.disabled||(o("update:modelValue",f.name),o("change",f.name))},u=f=>{n.value.find(p=>p.name===f.name)||n.value.push(f)},i=f=>{const p=n.value.findIndex(c=>c.name===f);p>=0&&n.value.splice(p,1)};return e.provide("xpTabs",{addTab:u,removeTab:i,currentValue:s}),(f,p)=>(e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(c,g)=>(e.openBlock(),e.createElementBlock("div",{key:c.name||g,class:e.normalizeClass(["xp-tabs__item",[{"xp-tabs__item--active":s.value===c.name,"xp-tabs__item--disabled":c.disabled}]]),role:"tab",onClick:m=>d(c)},e.toDisplayString(c.title),11,dt))),128)),e.createElementVNode("div",{class:"xp-tabs__active-bar",style:e.normalizeStyle(r.value)},null,4)]),e.createElementVNode("div",it,[e.renderSlot(f.$slots,"default",{},void 0,!0)])]))}},W=h(ut,[["__scopeId","data-v-3e658dba"]]),pt={__name:"Tag",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},color:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:["click","close"],setup(t,{emit:a}){const l=t,o=a,n=e.computed(()=>l.color?l.color.startsWith("#")||l.color.startsWith("rgb")?{backgroundColor:l.color,borderColor:l.color,color:"#fff"}:{}:{}),s=d=>{o("click",d)},r=d=>{o("close",d)};return(d,u)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-tag",[`xp-tag--${t.type}`,`xp-tag--${t.size}`,{"xp-tag--plain":t.plain,"xp-tag--round":t.round,"xp-tag--closable":t.closable}]]),style:e.normalizeStyle(n.value),onClick:s},[e.renderSlot(d.$slots,"default",{},void 0,!0),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-tag__close",onClick:e.withModifiers(r,["stop"])},"×")):e.createCommentVNode("",!0)],6))}},Y=h(pt,[["__scopeId","data-v-903813de"]]),ft={class:"xp-tooltip__content"},mt={__name:"Tooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},trigger:{type:String,default:"hover",validator:t=>["hover","click","manual"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const a=t,l=e.ref(!1),o=e.ref({}),n=e.ref(null),s=e.ref(null);let r=null;const d=()=>{e.nextTick(()=>{if(!n.value||!s.value)return;const p=n.value.getBoundingClientRect(),c=s.value.getBoundingClientRect();let g=0,m=0;switch(a.placement){case"top":g=p.top-c.height-8,m=p.left+p.width/2-c.width/2;break;case"bottom":g=p.bottom+8,m=p.left+p.width/2-c.width/2;break;case"left":g=p.top+p.height/2-c.height/2,m=p.left-c.width-8;break;case"right":g=p.top+p.height/2-c.height/2,m=p.right+8;break}o.value={top:`${g+window.scrollY}px`,left:`${m+window.scrollX}px`}})},u=()=>{a.disabled||(clearTimeout(r),r=setTimeout(()=>{l.value=!0,d()},100))},i=()=>{clearTimeout(r),r=setTimeout(()=>{l.value=!1},150)},f=()=>{a.trigger!=="click"||a.disabled||(l.value=!l.value,l.value&&d())};return e.onBeforeUnmount(()=>{clearTimeout(r)}),(p,c)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-tooltip",ref_key:"tooltipRef",ref:n},[e.createElementVNode("div",{class:"xp-tooltip__trigger",onMouseenter:u,onMouseleave:i,onClick:f},[e.renderSlot(p.$slots,"default",{},void 0,!0)],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-tooltip-fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-tooltip__popper",[`xp-tooltip__popper--${t.placement}`]]),style:e.normalizeStyle(o.value),ref_key:"popperRef",ref:s},[e.createElementVNode("div",ft,[e.renderSlot(p.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)],!0)]),c[0]||(c[0]=e.createElementVNode("div",{class:"xp-tooltip__arrow"},null,-1))],6)):e.createCommentVNode("",!0)]),_:3})]))],512))}},K=h(mt,[["__scopeId","data-v-6d9af40b"]]),ht=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,gt=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;function C(t){if(typeof t!="string")return null;const a=t.trim(),l=a.match(ht);if(l){let n=l[1];n.length===3&&(n=n.split("").map(u=>u+u).join(""));const s=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),d=parseInt(n.slice(4,6),16);return{r:s,g:r,b:d,a:1}}const o=a.match(gt);return o?{r:parseInt(o[1],10),g:parseInt(o[2],10),b:parseInt(o[3],10),a:o[4]?parseFloat(o[4]):1}:null}function xt(t){return Math.max(0,Math.min(255,Math.round(t)))}function G(t,a,l){const o=n=>xt(n).toString(16).padStart(2,"0");return"#"+o(t)+o(a)+o(l)}function E(t,a,l=.5){const o=C(t),n=C(a);if(!o||!n)return"#000000";const s=Math.max(0,Math.min(1,l)),r=o.r*(1-s)+n.r*s,d=o.g*(1-s)+n.g*s,u=o.b*(1-s)+n.b*s;return G(r,d,u)}function B(t,a){return E(t,"#ffffff",a)}function $(t,a){return E(t,"#000000",a)}function bt(t){return B(t,.3)}function kt(t){return $(t,.2)}function yt(t,a){const l=C(t);if(!l)return t;const o=Math.max(0,Math.min(1,a));return`rgba(${l.r}, ${l.g}, ${l.b}, ${o})`}function vt(t){const a=C(t);return a?(a.r*299+a.g*587+a.b*114)/1e3<128:!1}function Q(t,a){const l=B(t,.3),o=$(t,.2),n=a==="dark"?$(t,.85):B(t,.9),s=a==="dark"?$(t,.7):B(t,.7);return{base:t,light:l,dark:o,bg:n,border:s}}const x={primary:"#409eff",success:"#67c23a",warning:"#e6a23c",danger:"#f56c6c",info:"#909399"},v={light:{text:{primary:"#303133",regular:"#606266",secondary:"#909399",placeholder:"#c0c4cc"},border:{base:"#dcdfe6",light:"#ebeef5",lighter:"#f2f6fc"},bg:{base:"#ffffff",page:"#f2f3f5",soft:"#f5f7fa",overlay:"rgba(0, 0, 0, 0.5)"},fill:{base:"#f0f2f5",light:"#f5f7fa",lighter:"#fafafa"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.1)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.15)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.2)"}},dark:{text:{primary:"#e5eaf3",regular:"#cfd3dc",secondary:"#a3a6ad",placeholder:"#8d9095"},border:{base:"#4c4d4f",light:"#414243",lighter:"#363637"},bg:{base:"#1d1e1f",page:"#141414",soft:"#2a2b2c",overlay:"rgba(0, 0, 0, 0.7)"},fill:{base:"#303030",light:"#262727",lighter:"#1d1d1d"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.4)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.45)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.5)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.6)"}}};function b(){return{primary:{...x},light:I(v.light),dark:I(v.dark)}}function I(t){return JSON.parse(JSON.stringify(t))}function X(t,a){const l=["primary","success","warning","danger","info"],o=[];for(const n of l){const s=t[n]||x[n],r=Q(s,a);o.push(` --xp-color-${n}: ${s};`),o.push(` --xp-color-${n}-light: ${r.light};`),o.push(` --xp-color-${n}-dark: ${r.dark};`),o.push(` --xp-color-${n}-bg: ${r.bg};`),o.push(` --xp-color-${n}-border: ${r.border};`)}return o.join(`
2
- `)}function D(t){const a=[];for(const l of Object.keys(t.text))a.push(` --xp-text-color-${l}: ${t.text[l]};`);a.push(` --xp-border-color: ${t.border.base};`),a.push(` --xp-border-color-light: ${t.border.light};`),a.push(` --xp-border-color-lighter: ${t.border.lighter};`);for(const l of Object.keys(t.bg)){const o=l==="base"?"":`-${l}`;a.push(` --xp-bg-color${o}: ${t.bg[l]};`)}for(const l of Object.keys(t.fill)){const o=l==="base"?"":`-${l}`;a.push(` --xp-fill-color${o}: ${t.fill[l]};`)}for(const l of Object.keys(t.shadow))a.push(` --xp-shadow-${l}: ${t.shadow[l]};`);return a.join(`
3
- `)}function Z(t,a){const l={},o=t.primary||x,n=["primary","success","warning","danger","info"];for(const r of n){const d=o[r]||x[r],u=Q(d,a);l[`--xp-color-${r}`]=d,l[`--xp-color-${r}-light`]=u.light,l[`--xp-color-${r}-dark`]=u.dark,l[`--xp-color-${r}-bg`]=u.bg,l[`--xp-color-${r}-border`]=u.border}const s=t[a]||v[a];for(const r of Object.keys(s.text))l[`--xp-text-color-${r}`]=s.text[r];l["--xp-border-color"]=s.border.base,l["--xp-border-color-light"]=s.border.light,l["--xp-border-color-lighter"]=s.border.lighter;for(const r of Object.keys(s.bg))l[`--xp-bg-color${r==="base"?"":"-"+r}`]=s.bg[r];for(const r of Object.keys(s.fill))l[`--xp-fill-color${r==="base"?"":"-"+r}`]=s.fill[r];for(const r of Object.keys(s.shadow))l[`--xp-shadow-${r}`]=s.shadow[r];return l}function N(t){return[':root, [data-theme="light"] {',X(t.primary||x,"light"),D(t.light||v.light),"}","",'[data-theme="dark"] {',X(t.primary||x,"dark"),D(t.dark||v.dark),"}"].join(`
4
- `)}let V=null;function _t(){if(typeof document>"u")return null;if(V&&document.contains(V))return V;let t=document.querySelector("style[data-xp-ui-theme]");return t||(t=document.createElement("style"),t.setAttribute("data-xp-ui-theme","true"),document.head.appendChild(t)),V=t,t}function Bt(t){const a=_t();a&&(a.textContent=N(t))}const T=e.ref("light"),ee=e.ref(b());function k(t){if(["light","dark"].includes(t)&&(T.value=t,typeof document<"u")){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("xp-ui-theme",t)}catch{}}}function te(){k(T.value==="light"?"dark":"light")}function y(t){if(!t)return;const a=b();t.primary&&(a.primary={...a.primary,...t.primary}),t.light&&(a.light=w(a.light,t.light)),t.dark&&(a.dark=w(a.dark,t.dark)),ee.value=a,Bt(a);try{localStorage.setItem("xp-ui-theme-config",JSON.stringify(a))}catch{}}function ae(){y(b())}function le(){if(typeof document>"u")return;let t=null;try{t=localStorage.getItem("xp-ui-theme")}catch{}t==="light"||t==="dark"?k(t):typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light");let a=null;try{a=localStorage.getItem("xp-ui-theme-config")}catch{}if(a)try{y(JSON.parse(a))}catch{y(b())}else y(b())}function w(t,a){if(!a||typeof a!="object")return t;const l=Array.isArray(t)?[...t]:{...t};for(const o of Object.keys(a))a[o]&&typeof a[o]=="object"&&!Array.isArray(a[o])?l[o]=w(t[o]||{},a[o]):l[o]=a[o];return l}function $t(){return{theme:T,themeConfig:ee,setTheme:k,toggleTheme:te,initTheme:le,applyThemeConfig:y,resetThemeConfig:ae,getDefaultThemeConfig:b,buildCssString:N,buildCssVars:Z}}const oe={XpAlert:z,XpAvatar:M,XpBadge:R,XpButton:S,XpCard:A,XpCheckbox:O,XpDialog:j,XpDropdown:F,XpInput:P,XpProgress:L,XpRadio:U,XpRate:q,XpSwitch:H,XpTabPane:J,XpTabs:W,XpTag:Y,XpTooltip:K},ne=t=>{Object.entries(oe).forEach(([a,l])=>{t.component(a,l)})},Ct={install:ne,...oe};exports.DEFAULT_PRIMARY=x;exports.DEFAULT_TOKENS=v;exports.XpAlert=z;exports.XpAvatar=M;exports.XpBadge=R;exports.XpButton=S;exports.XpCard=A;exports.XpCheckbox=O;exports.XpDialog=j;exports.XpDropdown=F;exports.XpInput=P;exports.XpProgress=L;exports.XpRadio=U;exports.XpRate=q;exports.XpSwitch=H;exports.XpTabPane=J;exports.XpTabs=W;exports.XpTag=Y;exports.XpTooltip=K;exports.applyThemeConfig=y;exports.buildCssString=N;exports.buildCssVars=Z;exports.darken=$;exports.default=Ct;exports.deriveDark=kt;exports.deriveLight=bt;exports.getDefaultThemeConfig=b;exports.initTheme=le;exports.install=ne;exports.isDark=vt;exports.lighten=B;exports.mix=E;exports.parseColor=C;exports.resetThemeConfig=ae;exports.setTheme=k;exports.toHex=G;exports.toggleTheme=te;exports.useTheme=$t;exports.withAlpha=yt;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=(t,n)=>{const o=t.__vccOpts||t;for(const[l,r]of n)o[l]=r;return o},Ce={class:"xp-alert__icon"},Ve={class:"xp-alert__content"},Ne={class:"xp-alert__title"},$e={key:0,class:"xp-alert__description"},Se={__name:"Alert",props:{title:{type:String,default:""},type:{type:String,default:"info",validator:t=>["success","warning","danger","info"].includes(t)},effect:{type:String,default:"light",validator:t=>["light","dark","plain"].includes(t)},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:n}){const o=n,l=e.ref(!0),r={success:"✓",warning:"!",danger:"×",info:"i"},i=()=>{l.value=!1,o("close")};return(s,f)=>(e.openBlock(),e.createBlock(e.Transition,{name:"xp-alert-fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-alert",[`xp-alert--${t.type}`,`xp-alert--${t.effect}`,{"xp-alert--plain":t.effect==="plain"}]]),role:"alert"},[e.createElementVNode("span",Ce,e.toDisplayString(r[t.type]),1),e.createElementVNode("div",Ve,[e.createElementVNode("span",Ne,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)]),s.$slots.default?(e.openBlock(),e.createElementBlock("p",$e,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),t.closable?(e.openBlock(),e.createElementBlock("i",{key:0,class:"xp-alert__close-btn",onClick:i},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},H=x(Se,[["__scopeId","data-v-91d792bd"]]),ze=["src","alt"],Me={key:1,class:"xp-avatar__slot"},Te={key:2,class:"xp-avatar__text"},De={__name:"Avatar",props:{src:{type:String,default:""},alt:{type:String,default:""},shape:{type:String,default:"circle",validator:t=>["circle","square"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},icon:{type:String,default:""}},emits:["error"],setup(t,{emit:n}){const o=t,l=n,r=e.ref(!1),i=e.computed(()=>({backgroundColor:o.src?"transparent":"var(--xp-color-primary-bg)",color:o.src?void 0:"var(--xp-color-primary)"})),s=()=>{r.value=!0,l("error")};return(f,p)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-avatar",[`xp-avatar--${t.shape}`,`xp-avatar--${t.size}`,{"xp-avatar--fit":t.src}]]),style:e.normalizeStyle(i.value)},[t.src&&!r.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,onError:s},null,40,ze)):f.$slots.default?(e.openBlock(),e.createElementBlock("span",Me,[e.renderSlot(f.$slots,"default",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(t.alt||"A"),1))],6))}},U=x(De,[["__scopeId","data-v-a9a54bc5"]]),Ie={key:0},Fe={__name:"Badge",props:{value:{type:[String,Number],default:0},max:{type:Number,default:99},type:{type:String,default:"danger",validator:t=>["primary","success","warning","danger","info"].includes(t)},isDot:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(t){const n=t,o=e.computed(()=>typeof n.value=="number"&&n.value>n.max?`${n.max}+`:n.value),l=e.computed(()=>n.value!==0&&n.value!==""&&n.value!==null&&n.value!==void 0);return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-badge",{"xp-badge--dot":t.isDot,"xp-badge--hidden":t.hidden}])},[e.renderSlot(r.$slots,"default",{},void 0,!0),!t.hidden&&(t.isDot||l.value)?(e.openBlock(),e.createElementBlock("sup",{key:0,class:e.normalizeClass(["xp-badge__content",[`xp-badge__content--${t.type}`,{"xp-badge__content--dot":t.isDot}]])},[t.isDot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(o.value),1))],2)):e.createCommentVNode("",!0)],2))}},W=x(Fe,[["__scopeId","data-v-207db6dd"]]),je=["disabled"],Xe={key:0,class:"xp-button__loading"},Ae={class:"xp-button__text"},Le={__name:"Button",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info","ghost"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},text:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=n,r=i=>{!o.disabled&&!o.loading&&l("click",i)};return(i,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["xp-button",[`xp-button--${t.type}`,`xp-button--${t.size}`,{"xp-button--disabled":t.disabled,"xp-button--loading":t.loading,"xp-button--plain":t.plain,"xp-button--text":t.text}]]),disabled:t.disabled||t.loading,onClick:r},[t.loading?(e.openBlock(),e.createElementBlock("span",Xe)):e.createCommentVNode("",!0),e.createElementVNode("span",Ae,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],10,je))}},T=x(Le,[["__scopeId","data-v-9c6bc634"]]),Re={key:0,class:"xp-card__header"},Oe={class:"xp-card__title"},Pe={key:0,class:"xp-card__extra"},He={class:"xp-card__body"},Ue={key:1,class:"xp-card__footer"},We={__name:"Card",props:{title:{type:String,default:""},shadow:{type:String,default:"always",validator:t=>["always","hover","never"].includes(t)},bordered:{type:Boolean,default:!0},hover:{type:Boolean,default:!1}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-card",[`xp-card--${t.shadow}`,{"xp-card--bordered":t.bordered,"xp-card--hover":t.hover}]])},[t.title||n.$slots.header?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(n.$slots,"header",{},()=>[e.createElementVNode("h3",Oe,e.toDisplayString(t.title),1)],!0),n.$slots.extra?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(n.$slots,"extra",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.renderSlot(n.$slots,"default",{},void 0,!0)]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},J=x(We,[["__scopeId","data-v-e65cbe05"]]),Je={class:"xp-checkbox__input"},qe=["checked","disabled",".indeterminate"],Ge={class:"xp-checkbox__label"},Ye={__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=i=>{if(o.disabled)return;const s=i.target.checked;l("update:modelValue",s),l("change",s)};return(i,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-checkbox",[{"xp-checkbox--checked":t.modelValue,"xp-checkbox--disabled":t.disabled,"xp-checkbox--indeterminate":t.indeterminate}]])},[e.createElementVNode("span",Je,[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-checkbox__inner"},null,-1)),e.createElementVNode("input",{type:"checkbox",class:"xp-checkbox__original",checked:t.modelValue,disabled:t.disabled,onChange:r,".indeterminate":t.indeterminate},null,40,qe)]),e.createElementVNode("span",Ge,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},q=x(Ye,[["__scopeId","data-v-7c078f46"]]),Ke={key:0,class:"xp-menu__divider"},Ze=["disabled","onClick"],Qe={key:0,class:"xp-menu__icon","aria-hidden":"true"},et={class:"xp-menu__label"},tt={__name:"ContextMenu",props:{visible:{type:Boolean,default:!1},x:{type:Number,default:0},y:{type:Number,default:0},items:{type:Array,default:()=>[]}},emits:["close","select","command"],setup(t,{emit:n}){const o=t,l=n;e.ref(null);const r=e.computed(()=>{const u=Math.min(o.items.filter(m=>!m.divider).length,12)*32+12;let a=o.x,c=o.y;return a+220>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-220-8)),c+u>window.innerHeight-8&&(c=Math.max(8,window.innerHeight-u-8)),{left:`${a}px`,top:`${c}px`}});function i(){l("close")}function s(p){p.disabled||(l("close"),l("select",p),l("command",p.command),p.onClick&&p.onClick())}function f(p){p.key==="Escape"&&o.visible&&l("close")}return e.onUnmounted(()=>window.removeEventListener("keydown",f)),(p,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-menu"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-menu-mask",onMousedown:i,onContextmenu:u[2]||(u[2]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"xp-menu",style:e.normalizeStyle(r.value),role:"menu",onMousedown:u[0]||(u[0]=e.withModifiers(()=>{},["stop"])),onMouseup:u[1]||(u[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[a.divider?(e.openBlock(),e.createElementBlock("div",Ke)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["xp-menu__item",{"xp-menu__item--danger":a.danger,"xp-menu__item--disabled":a.disabled}]),role:"menuitem",disabled:a.disabled,onClick:m=>s(a)},[a.icon?(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(a.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",et,e.toDisplayString(a.label),1)],10,Ze))],64))),128))],36)],32)):e.createCommentVNode("",!0)]),_:1})]))}},G=x(tt,[["__scopeId","data-v-7477a575"]]),ot={class:"xp-dialog__header"},nt={class:"xp-dialog__title"},lt={class:"xp-dialog__body"},rt={key:0,class:"xp-dialog__footer"},at={__name:"Dialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},confirmButtonText:{type:String,default:"确定"},cancelButtonText:{type:String,default:"取消"},closeOnClickModal:{type:Boolean,default:!0},showDefaultFooter:{type:Boolean,default:!0}},emits:["confirm","cancel","update:visible","close"],setup(t,{emit:n}){const o=t,l=n,r=()=>{l("update:visible",!1),l("close")},i=()=>{o.closeOnClickModal&&r()},s=()=>{l("confirm"),r()},f=()=>{l("cancel"),r()};function p(u){u.key==="Escape"&&o.visible&&r()}return e.watch(()=>o.visible,u=>{u?window.addEventListener("keydown",p):window.removeEventListener("keydown",p)}),e.onUnmounted(()=>window.removeEventListener("keydown",p)),(u,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dialog-fade"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog__wrapper",onClick:e.withModifiers(i,["self"])},[a[0]||(a[0]=e.createElementVNode("div",{class:"xp-dialog__mask"},null,-1)),e.createVNode(e.Transition,{name:"xp-dialog-slide",appear:""},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",ot,[e.createElementVNode("h3",nt,e.toDisplayString(t.title),1),e.createElementVNode("button",{class:"xp-dialog__close",onClick:r},"×")]),e.createElementVNode("div",lt,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer||t.showDefaultFooter?(e.openBlock(),e.createElementBlock("div",rt,[e.renderSlot(u.$slots,"footer",{},()=>[e.createVNode(T,{onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(T,{type:"primary",onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText),1)]),_:1})],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}},Y=x(at,[["__scopeId","data-v-f85c5a46"]]),st=["onClick"],it={key:0},ct={key:1,class:"xp-dropdown__divider"},dt={__name:"Dropdown",props:{items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["select","command","open","close"],setup(t,{emit:n}){const o=t,l=n,r=e.ref(!1),i=e.ref({}),s=e.ref(null),f=e.ref(null),p=()=>{e.nextTick(()=>{if(!s.value||!f.value)return;const m=s.value.getBoundingClientRect(),k=f.value.getBoundingClientRect();let v=m.bottom+6,_=m.left;_+k.width>window.innerWidth-10&&(_=window.innerWidth-k.width-10),v+k.height>window.innerHeight-10&&(v=m.top-k.height-6),i.value={top:`${v+window.scrollY}px`,left:`${_+window.scrollX}px`}})},u=()=>{o.disabled||(r.value=!r.value,r.value?(p(),l("open")):l("close"))},a=m=>{m.disabled||m.divider||(l("select",m),m.command!==void 0&&l("command",m.command,m),r.value=!1,l("close"))},c=m=>{var k;r.value&&s.value&&!s.value.contains(m.target)&&!((k=f.value)!=null&&k.contains(m.target))&&(r.value=!1,l("close"))};return e.onMounted(()=>{document.addEventListener("click",c)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",c)}),(m,k)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-dropdown",ref_key:"dropdownRef",ref:s},[e.createElementVNode("div",{class:"xp-dropdown__trigger",onClick:u},[e.renderSlot(m.$slots,"default",{},void 0,!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dropdown-fade"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dropdown__menu",style:e.normalizeStyle(i.value),ref_key:"menuRef",ref:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(v,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["xp-dropdown__item",{"xp-dropdown__item--disabled":v.disabled,"xp-dropdown__item--divider":v.divider}]),onClick:X=>a(v)},[v.divider?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(v.label),1)),v.divider?(e.openBlock(),e.createElementBlock("span",ct)):e.createCommentVNode("",!0)],10,st))),128))],4)):e.createCommentVNode("",!0)]),_:1})]))],512))}},K=x(dt,[["__scopeId","data-v-ad741cd8"]]),ut={class:"xp-empty"},pt={class:"xp-empty__title"},mt={key:0,class:"xp-empty__hint"},ft={key:1,class:"xp-empty__action"},ht={__name:"Empty",props:{title:{type:String,default:"暂无内容"},hint:{type:String,default:""}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(n.$slots,"icon",{},()=>[o[0]||(o[0]=e.createElementVNode("div",{class:"xp-empty__icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"46",height:"46",viewBox:"0 0 24 24",fill:"none"},[e.createElementVNode("path",{d:"M4 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z",stroke:"var(--xp-border-color)","stroke-width":"1.5","stroke-linejoin":"round"})])],-1))],!0),e.createElementVNode("p",pt,e.toDisplayString(t.title),1),t.hint?(e.openBlock(),e.createElementBlock("p",mt,e.toDisplayString(t.hint),1)):e.createCommentVNode("",!0),n.$slots.default?(e.openBlock(),e.createElementBlock("div",ft,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]))}},Z=x(ht,[["__scopeId","data-v-93d5e1e9"]]),gt=["width","height"],kt={__name:"FileIcon",props:{type:{type:String,default:"file"},size:{type:Number,default:20}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("span",{class:"xp-file-icon",style:e.normalizeStyle({width:t.size+"px",height:t.size+"px"}),"aria-hidden":"true"},[(e.openBlock(),e.createElementBlock("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none"},[t.type==="folder"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o[0]||(o[0]=e.createElementVNode("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4h4l2 2h7A2.5 2.5 0 0 1 21 8.5v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#E8B64E","fill-opacity":"0.9"},null,-1)),o[1]||(o[1]=e.createElementVNode("path",{d:"M3 8.5h18v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#F3CE78"},null,-1))],64)):t.type==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o[2]||(o[2]=e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.4",fill:"#4FA8C9","fill-opacity":"0.16",stroke:"#3D8EAD","stroke-width":"1.4"},null,-1)),o[3]||(o[3]=e.createElementVNode("circle",{cx:"9",cy:"10",r:"1.8",fill:"#3D8EAD"},null,-1)),o[4]||(o[4]=e.createElementVNode("path",{d:"M4.4 17.4l4.6-4.4 3 2.8 3.2-3.2 4.4 4.2",stroke:"#3D8EAD","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="video"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[o[5]||(o[5]=e.createElementVNode("rect",{x:"3",y:"5",width:"13",height:"14",rx:"2.4",fill:"#9B5FD1","fill-opacity":"0.14",stroke:"#8A48C4","stroke-width":"1.4"},null,-1)),o[6]||(o[6]=e.createElementVNode("path",{d:"M16 10.5l5-3v9l-5-3z",fill:"#8A48C4"},null,-1))],64)):t.type==="audio"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o[7]||(o[7]=e.createElementVNode("path",{d:"M9 18V6l10-2v11",stroke:"#C2569B","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),o[8]||(o[8]=e.createElementVNode("circle",{cx:"6.6",cy:"18",r:"2.4",fill:"#C2569B"},null,-1)),o[9]||(o[9]=e.createElementVNode("circle",{cx:"16.6",cy:"15",r:"2.4",fill:"#C2569B"},null,-1))],64)):t.type==="pdf"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[o[10]||(o[10]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2.4",fill:"#D9504A","fill-opacity":"0.14",stroke:"#C24842","stroke-width":"1.4"},null,-1)),o[11]||(o[11]=e.createElementVNode("text",{x:"12",y:"16.2","text-anchor":"middle","font-size":"9.5","font-weight":"700",fill:"#C24842","font-family":"Arial, sans-serif"},"PDF",-1))],64)):t.type==="doc"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[o[12]||(o[12]=e.createElementVNode("path",{d:"M5 3.5h9l5 5v12h-14z",fill:"#3B7FD6","fill-opacity":"0.14",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[13]||(o[13]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[14]||(o[14]=e.createElementVNode("path",{d:"M7.5 12v5M7.5 14.5h3",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),o[15]||(o[15]=e.createElementVNode("path",{d:"M13.5 12h3M13.5 14.5h3M13.5 17h2",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1))],64)):t.type==="sheet"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[o[16]||(o[16]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#3E9C5E","fill-opacity":"0.14",stroke:"#33854F","stroke-width":"1.4"},null,-1)),o[17]||(o[17]=e.createElementVNode("path",{d:"M4 9h16M4 14h16M10 9v11.5M14.5 9v11.5",stroke:"#33854F","stroke-width":"1.2","stroke-linecap":"round"},null,-1))],64)):t.type==="slide"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[o[18]||(o[18]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"12",rx:"2.4",fill:"#E09A2F","fill-opacity":"0.16",stroke:"#CC8420","stroke-width":"1.4"},null,-1)),o[19]||(o[19]=e.createElementVNode("path",{d:"M12 17v3M9.5 20h5",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),o[20]||(o[20]=e.createElementVNode("circle",{cx:"9",cy:"10.4",r:"1.3",fill:"#CC8420"},null,-1)),o[21]||(o[21]=e.createElementVNode("path",{d:"M6 14.4l2.8-2.8 2 1.8L14 9.6l4 4.4",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="archive"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[o[22]||(o[22]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#A97D4E","fill-opacity":"0.16",stroke:"#8F6539","stroke-width":"1.4"},null,-1)),o[23]||(o[23]=e.createElementVNode("path",{d:"M9.5 4v16M14.5 4v16M4 12h16",stroke:"#8F6539","stroke-width":"1.3"},null,-1))],64)):t.type==="code"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[o[24]||(o[24]=e.createElementVNode("path",{d:"M8.5 8l-4.5 4 4.5 4M15.5 8l4.5 4-4.5 4",stroke:"#6B62E0","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),o[25]||(o[25]=e.createElementVNode("path",{d:"M13.6 5.8l-3.2 12.4",stroke:"#6B62E0","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):t.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[o[26]||(o[26]=e.createElementVNode("path",{d:"M4 6.2C4 5 4.9 4 6.5 4h11C19 4 20 5 20 6.2v11.6C20 19 19 20 17.5 20h-11C4.9 20 4 19 4 17.8z",fill:"#7D8894","fill-opacity":"0.12",stroke:"#5F6B78","stroke-width":"1.4"},null,-1)),o[27]||(o[27]=e.createElementVNode("path",{d:"M7.5 8.5h9M7.5 12h6.5",stroke:"#5F6B78","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[o[28]||(o[28]=e.createElementVNode("path",{d:"M6 3.5h8l5 5v12h-13z",fill:"#A2AAB4","fill-opacity":"0.16",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[29]||(o[29]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[30]||(o[30]=e.createElementVNode("path",{d:"M8 12.5h8M8 15.5h8M8 18.5h5",stroke:"#7C8590","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))],8,gt))],4))}},Q=x(kt,[["__scopeId","data-v-c598c294"]]),vt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 12h10M10 8l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',xt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M15 5l-7 7 7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',yt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',_t='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 14l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',bt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',wt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M12 11v5M9.5 13.5h5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',Bt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',Et='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M9 5l7 7-7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Ct='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><rect x="4" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="4" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/></svg>',Vt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 11l8-7 8 7v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><path d="M10 21v-6h4v6" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>',Nt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M330.666667 512c0-14.933333 4.266667-29.866667 14.933333-40.533333l234.666667-277.33333399c23.466667-27.733333 64-29.866667 89.6-8.53333301 27.733333 23.466667 29.866667 64 8.53333299 89.6L477.866667 512l200.53333299 236.8c23.466667 27.733333 19.19999999 68.266667-8.53333299 89.6-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333301l-234.666667-277.33333399c-10.666667-10.666667-14.933333-25.6-14.933333-40.533333z" /></svg>',$t='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 6h16M4 12h16M4 18h16" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',St='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',zt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><circle cx="12" cy="12" r="3.2" stroke="currentColor" stroke-width="1.8"/><path d="M12 2.8v2.6M12 18.6v2.6M2.8 12h2.6M18.6 12h2.6M5.5 5.5l1.8 1.8M16.7 16.7l1.8 1.8M18.5 5.5l-1.8 1.8M7.3 16.7l-1.8 1.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',Mt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" fill="currentColor" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>',Tt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>',Dt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 19V6M6 12l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',It='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 16V5M7.5 9.5L12 5l4.5 4.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',Ft=["viewBox","innerHTML"],jt={key:2,class:"xp-icon__fallback"},Xt={__name:"Icon",props:{name:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""},spin:{type:Boolean,default:!1},rotate:{type:Number,default:0}},setup(t){const n=["small","medium","large"],o=t,l=Object.assign({"./icons/arrow-right.svg":vt,"./icons/back.svg":xt,"./icons/chevron-down.svg":yt,"./icons/chevron-up.svg":_t,"./icons/close.svg":bt,"./icons/folder-add.svg":wt,"./icons/folder.svg":Bt,"./icons/forward.svg":Et,"./icons/grid.svg":Ct,"./icons/home.svg":Vt,"./icons/jiantou.svg":Nt,"./icons/list.svg":$t,"./icons/refresh.svg":St,"./icons/settings.svg":zt,"./icons/star-fill.svg":Mt,"./icons/star.svg":Tt,"./icons/up.svg":Dt,"./icons/upload.svg":It}),r=a=>a&&a.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi,'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi,'stroke="currentColor"'),i=e.computed(()=>{if(!o.name)return null;const a=`./icons/${o.name}.svg`,c=l[a];if(!c)return null;const m=c.match(/<svg[^>]*>([\s\S]*)<\/svg>/i),k=r(m?m[1]:c),v=c.match(/viewBox\s*=\s*["']([^"']+)["']/i);return{inner:k,viewBox:v?v[1]:"0 0 24 24"}}),s=e.computed(()=>n.includes(String(o.size))),f=e.computed(()=>{if(s.value)return null;const a=o.size;return typeof a=="number"?`${a}px`:typeof a=="string"&&a.trim()?/^\d+(\.\d+)?$/.test(a.trim())?`${a}px`:a.trim():null}),p=e.computed(()=>{const a=[];return s.value&&a.push(`xp-icon--${o.size}`),o.spin&&a.push("xp-icon--spin"),a}),u=e.computed(()=>{const a={};return o.color&&(a.color=o.color),o.rotate&&(a.transform=`rotate(${o.rotate}deg)`),f.value&&(a.width=f.value,a.height=f.value,a.fontSize=f.value),a});return(a,c)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["xp-icon",p.value]),style:e.normalizeStyle(u.value)},[a.$slots.default?e.renderSlot(a.$slots,"default",{key:0},void 0,!0):i.value?(e.openBlock(),e.createElementBlock("svg",{key:1,viewBox:i.value.viewBox,innerHTML:i.value.inner},null,8,Ft)):(e.openBlock(),e.createElementBlock("span",jt,"?"))],6))}},ee=x(Xt,[["__scopeId","data-v-9ed9f36d"]]),At={key:0,class:"xp-input__prefix"},Lt=["id","type","value","placeholder","disabled","maxlength"],Rt={key:2,class:"xp-input__suffix"},Ot={__name:"Input",props:{modelValue:{type:[String,Number],default:""},id:{type:String,default:""},type:{type:String,default:"text",validator:t=>["text","password","number","email","tel","url"].includes(t)},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},maxlength:{type:[String,Number],default:null},showClear:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","clear"],setup(t,{expose:n,emit:o}){const l=o,r=e.ref(null),i=e.ref(!1),s=a=>{l("update:modelValue",a.target.value)},f=a=>{i.value=!0,l("focus",a)},p=a=>{i.value=!1,l("blur",a)},u=()=>{l("update:modelValue",""),l("clear"),r.value&&r.value.focus()};return n({focus:()=>r.value&&r.value.focus(),select:()=>r.value&&r.value.select(),blur:()=>r.value&&r.value.blur()}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":a.$slots.prefix,"xp-input--suffix":a.$slots.suffix||t.showClear,"xp-input--focus":i.value}]])},[a.$slots.prefix?(e.openBlock(),e.createElementBlock("span",At,[e.renderSlot(a.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:r,class:"xp-input__inner",id:t.id||void 0,type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,maxlength:t.maxlength,onInput:s,onFocus:f,onBlur:p},null,40,Lt),t.showClear&&t.modelValue&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"xp-input__clear",onClick:u},"×")):e.createCommentVNode("",!0),a.$slots.suffix&&!t.showClear?(e.openBlock(),e.createElementBlock("span",Rt,[e.renderSlot(a.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},te=x(Ot,[["__scopeId","data-v-46247483"]]),Pt={key:0,class:"xp-progress__text"},Ht={__name:"Progress",props:{percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:String,default:""},showText:{type:Boolean,default:!0},type:{type:String,default:"line",validator:t=>["line","circle"].includes(t)},status:{type:String,default:"",validator:t=>["","success","warning","exception"].includes(t)},strokeWidth:{type:Number,default:8}},setup(t){const n=t,o=e.computed(()=>n.type==="line"?{height:`${n.strokeWidth}px`}:{}),l=e.computed(()=>n.color?n.color:n.status==="success"?"var(--xp-color-success)":n.status==="warning"?"var(--xp-color-warning)":n.status==="exception"?"var(--xp-color-danger)":"var(--xp-color-primary)");return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-progress",[`xp-progress--${t.type}`]])},[e.createElementVNode("div",{class:"xp-progress__bar",style:e.normalizeStyle(o.value)},[e.createElementVNode("div",{class:"xp-progress__inner",style:e.normalizeStyle({width:`${t.percentage}%`,backgroundColor:l.value})},null,4)],4),t.showText?(e.openBlock(),e.createElementBlock("span",Pt,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)],!0)])):e.createCommentVNode("",!0)],2))}},oe=x(Ht,[["__scopeId","data-v-244dca2c"]]),Ut={class:"xp-radio__input"},Wt=["checked","disabled"],Jt={class:"xp-radio__label"},qt={__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:""},value:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=()=>{o.disabled||(l("update:modelValue",o.value),l("change",o.value))};return(i,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-radio",[{"xp-radio--checked":t.modelValue===t.value,"xp-radio--disabled":t.disabled}]])},[e.createElementVNode("span",Ut,[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-radio__inner"},null,-1)),e.createElementVNode("input",{type:"radio",class:"xp-radio__original",checked:t.modelValue===t.value,disabled:t.disabled,onChange:r},null,40,Wt)]),e.createElementVNode("span",Jt,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},ne=x(qt,[["__scopeId","data-v-02a0d80d"]]),Gt={class:"xp-rate"},Yt=["onClick","onMouseenter"],Kt={class:"xp-rate__star"},Zt={key:0,class:"xp-rate__text"},Qt={__name:"Rate",props:{modelValue:{type:Number,default:0},max:{type:Number,default:5},color:{type:String,default:"#f7ba2a"},disabled:{type:Boolean,default:!1},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=e.ref(0),i=e.computed(()=>r.value||o.modelValue),s=p=>{const u=i.value-p+1;return u>=1?100:u>0?u*100:0},f=p=>{o.disabled||(l("update:modelValue",p),l("change",p))};return(p,u)=>(e.openBlock(),e.createElementBlock("div",Gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max,a=>(e.openBlock(),e.createElementBlock("span",{key:a,class:e.normalizeClass(["xp-rate__item",{"xp-rate__item--disabled":t.disabled}]),style:e.normalizeStyle({cursor:t.disabled?"default":"pointer"}),onClick:c=>f(a),onMouseenter:c=>r.value=a,onMouseleave:u[0]||(u[0]=c=>r.value=0)},[e.createElementVNode("span",Kt,[u[1]||(u[1]=e.createElementVNode("span",{class:"xp-rate__star-outer"},"★",-1)),e.createElementVNode("span",{class:"xp-rate__star-inner",style:e.normalizeStyle({width:s(a)+"%",color:t.color})}," ★ ",4)])],46,Yt))),128)),t.showText&&!t.disabled?(e.openBlock(),e.createElementBlock("span",Zt,e.toDisplayString(t.modelValue)+" / "+e.toDisplayString(t.max),1)):e.createCommentVNode("",!0)]))}},le=x(Qt,[["__scopeId","data-v-214323a3"]]),eo=["aria-checked"],to={key:0,class:"xp-switch__label"},oo={__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=()=>{if(o.disabled)return;const i=!o.modelValue;l("update:modelValue",i),l("change",i)};return(i,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-switch",[`xp-switch--${t.size}`,{"xp-switch--checked":t.modelValue,"xp-switch--disabled":t.disabled}]]),role:"switch","aria-checked":t.modelValue,onClick:r},[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-switch__core"},[e.createElementVNode("span",{class:"xp-switch__action"})],-1)),i.$slots.default?(e.openBlock(),e.createElementBlock("span",to,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,eo))}},re=x(oo,[["__scopeId","data-v-5a5e33c5"]]),no={key:0,class:"xp-tab-pane"},lo={__name:"TabPane",props:{name:{type:[String,Number],required:!0},title:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(t){const n=t,o=e.inject("xpTabs",null),l=e.computed(()=>o?o.currentValue.value===n.name:!0);return e.onMounted(()=>{o&&o.addTab&&o.addTab({name:n.name,title:n.title,disabled:n.disabled})}),e.onBeforeUnmount(()=>{o&&o.removeTab&&o.removeTab(n.name)}),(r,i)=>l.value?(e.openBlock(),e.createElementBlock("div",no,[e.renderSlot(r.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)}},ae=x(lo,[["__scopeId","data-v-6fe7943a"]]),ro={class:"xp-tabs"},ao={class:"xp-tabs__nav",role:"tablist"},so=["onClick"],io={class:"xp-tabs__content"},co={__name:"Tabs",props:{modelValue:{type:[String,Number],default:null}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=e.ref([]),i=e.computed(()=>{var a;return o.modelValue!==null&&o.modelValue!==void 0&&o.modelValue!==""?o.modelValue:((a=r.value[0])==null?void 0:a.name)??null}),s=e.computed(()=>{const a=r.value.findIndex(m=>m.name===i.value);return{transform:`translateX(${(a>=0?a:0)*100}%)`,width:`${r.value.length?100/r.value.length:0}%`}}),f=a=>{a.disabled||(l("update:modelValue",a.name),l("change",a.name))},p=a=>{r.value.find(c=>c.name===a.name)||r.value.push(a)},u=a=>{const c=r.value.findIndex(m=>m.name===a);c>=0&&r.value.splice(c,1)};return e.provide("xpTabs",{addTab:p,removeTab:u,currentValue:i}),(a,c)=>(e.openBlock(),e.createElementBlock("div",ro,[e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(m,k)=>(e.openBlock(),e.createElementBlock("div",{key:m.name||k,class:e.normalizeClass(["xp-tabs__item",[{"xp-tabs__item--active":i.value===m.name,"xp-tabs__item--disabled":m.disabled}]]),role:"tab",onClick:v=>f(m)},e.toDisplayString(m.title),11,so))),128)),e.createElementVNode("div",{class:"xp-tabs__active-bar",style:e.normalizeStyle(s.value)},null,4)]),e.createElementVNode("div",io,[e.renderSlot(a.$slots,"default",{},void 0,!0)])]))}},se=x(co,[["__scopeId","data-v-3e658dba"]]),uo={__name:"Tag",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},color:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:["click","close"],setup(t,{emit:n}){const o=t,l=n,r=e.computed(()=>o.color?o.color.startsWith("#")||o.color.startsWith("rgb")?{backgroundColor:o.color,borderColor:o.color,color:"#fff"}:{}:{}),i=f=>{l("click",f)},s=f=>{l("close",f)};return(f,p)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-tag",[`xp-tag--${t.type}`,`xp-tag--${t.size}`,{"xp-tag--plain":t.plain,"xp-tag--round":t.round,"xp-tag--closable":t.closable}]]),style:e.normalizeStyle(r.value),onClick:i},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-tag__close",onClick:e.withModifiers(s,["stop"])},"×")):e.createCommentVNode("",!0)],6))}},ie=x(uo,[["__scopeId","data-v-903813de"]]),po=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,mo=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;function z(t){if(typeof t!="string")return null;const n=t.trim(),o=n.match(po);if(o){let r=o[1];r.length===3&&(r=r.split("").map(p=>p+p).join(""));const i=parseInt(r.slice(0,2),16),s=parseInt(r.slice(2,4),16),f=parseInt(r.slice(4,6),16);return{r:i,g:s,b:f,a:1}}const l=n.match(mo);return l?{r:parseInt(l[1],10),g:parseInt(l[2],10),b:parseInt(l[3],10),a:l[4]?parseFloat(l[4]):1}:null}function fo(t){return Math.max(0,Math.min(255,Math.round(t)))}function ce(t,n,o){const l=r=>fo(r).toString(16).padStart(2,"0");return"#"+l(t)+l(n)+l(o)}function I(t,n,o=.5){const l=z(t),r=z(n);if(!l||!r)return"#000000";const i=Math.max(0,Math.min(1,o)),s=l.r*(1-i)+r.r*i,f=l.g*(1-i)+r.g*i,p=l.b*(1-i)+r.b*i;return ce(s,f,p)}function $(t,n){return I(t,"#ffffff",n)}function S(t,n){return I(t,"#000000",n)}function ho(t){return $(t,.3)}function go(t){return S(t,.2)}function ko(t,n){const o=z(t);if(!o)return t;const l=Math.max(0,Math.min(1,n));return`rgba(${o.r}, ${o.g}, ${o.b}, ${l})`}function vo(t){const n=z(t);return n?(n.r*299+n.g*587+n.b*114)/1e3<128:!1}function de(t,n){const o=$(t,.3),l=S(t,.2),r=n==="dark"?S(t,.85):$(t,.9),i=n==="dark"?S(t,.7):$(t,.7);return{base:t,light:o,dark:l,bg:r,border:i}}const b={primary:"#409eff",success:"#67c23a",warning:"#e6a23c",danger:"#f56c6c",info:"#909399"},V={light:{text:{primary:"#303133",regular:"#606266",secondary:"#909399",placeholder:"#c0c4cc"},border:{base:"#dcdfe6",light:"#ebeef5",lighter:"#f2f6fc"},bg:{base:"#ffffff",page:"#f2f3f5",soft:"#f5f7fa",overlay:"rgba(0, 0, 0, 0.5)"},fill:{base:"#f0f2f5",light:"#f5f7fa",lighter:"#fafafa"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.1)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.15)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.2)"}},dark:{text:{primary:"#e5eaf3",regular:"#cfd3dc",secondary:"#a3a6ad",placeholder:"#8d9095"},border:{base:"#4c4d4f",light:"#414243",lighter:"#363637"},bg:{base:"#1d1e1f",page:"#141414",soft:"#2a2b2c",overlay:"rgba(0, 0, 0, 0.7)"},fill:{base:"#303030",light:"#262727",lighter:"#1d1d1d"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.4)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.45)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.5)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.6)"}}};function w(){return{primary:{...b},light:R(V.light),dark:R(V.dark)}}function R(t){return JSON.parse(JSON.stringify(t))}function O(t,n){const o=["primary","success","warning","danger","info"],l=[];for(const r of o){const i=t[r]||b[r],s=de(i,n);l.push(` --xp-color-${r}: ${i};`),l.push(` --xp-color-${r}-light: ${s.light};`),l.push(` --xp-color-${r}-dark: ${s.dark};`),l.push(` --xp-color-${r}-bg: ${s.bg};`),l.push(` --xp-color-${r}-border: ${s.border};`)}return l.join(`
2
+ `)}function P(t){const n=[];for(const o of Object.keys(t.text))n.push(` --xp-text-color-${o}: ${t.text[o]};`);n.push(` --xp-border-color: ${t.border.base};`),n.push(` --xp-border-color-light: ${t.border.light};`),n.push(` --xp-border-color-lighter: ${t.border.lighter};`);for(const o of Object.keys(t.bg)){const l=o==="base"?"":`-${o}`;n.push(` --xp-bg-color${l}: ${t.bg[o]};`)}for(const o of Object.keys(t.fill)){const l=o==="base"?"":`-${o}`;n.push(` --xp-fill-color${l}: ${t.fill[o]};`)}for(const o of Object.keys(t.shadow))n.push(` --xp-shadow-${o}: ${t.shadow[o]};`);return n.join(`
3
+ `)}function ue(t,n){const o={},l=t.primary||b,r=["primary","success","warning","danger","info"];for(const s of r){const f=l[s]||b[s],p=de(f,n);o[`--xp-color-${s}`]=f,o[`--xp-color-${s}-light`]=p.light,o[`--xp-color-${s}-dark`]=p.dark,o[`--xp-color-${s}-bg`]=p.bg,o[`--xp-color-${s}-border`]=p.border}const i=t[n]||V[n];for(const s of Object.keys(i.text))o[`--xp-text-color-${s}`]=i.text[s];o["--xp-border-color"]=i.border.base,o["--xp-border-color-light"]=i.border.light,o["--xp-border-color-lighter"]=i.border.lighter;for(const s of Object.keys(i.bg))o[`--xp-bg-color${s==="base"?"":"-"+s}`]=i.bg[s];for(const s of Object.keys(i.fill))o[`--xp-fill-color${s==="base"?"":"-"+s}`]=i.fill[s];for(const s of Object.keys(i.shadow))o[`--xp-shadow-${s}`]=i.shadow[s];return o}function F(t){return[':root, [data-theme="light"] {',O(t.primary||b,"light"),P(t.light||V.light),"}","",'[data-theme="dark"] {',O(t.primary||b,"dark"),P(t.dark||V.dark),"}"].join(`
4
+ `)}let M=null;function xo(){if(typeof document>"u")return null;if(M&&document.contains(M))return M;let t=document.querySelector("style[data-xp-ui-theme]");return t||(t=document.createElement("style"),t.setAttribute("data-xp-ui-theme","true"),document.head.appendChild(t)),M=t,t}function yo(t){const n=xo();n&&(n.textContent=F(t))}const j=e.ref("light"),pe=e.ref(w());function E(t){if(["light","dark"].includes(t)&&(j.value=t,typeof document<"u")){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("xp-ui-theme",t)}catch{}}}function me(){E(j.value==="light"?"dark":"light")}function C(t){if(!t)return;const n=w();t.primary&&(n.primary={...n.primary,...t.primary}),t.light&&(n.light=D(n.light,t.light)),t.dark&&(n.dark=D(n.dark,t.dark)),pe.value=n,yo(n);try{localStorage.setItem("xp-ui-theme-config",JSON.stringify(n))}catch{}}function fe(){C(w())}function he(){if(typeof document>"u")return;let t=null;try{t=localStorage.getItem("xp-ui-theme")}catch{}t==="light"||t==="dark"?E(t):typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light");let n=null;try{n=localStorage.getItem("xp-ui-theme-config")}catch{}if(n)try{C(JSON.parse(n))}catch{C(w())}else C(w())}function D(t,n){if(!n||typeof n!="object")return t;const o=Array.isArray(t)?[...t]:{...t};for(const l of Object.keys(n))n[l]&&typeof n[l]=="object"&&!Array.isArray(n[l])?o[l]=D(t[l]||{},n[l]):o[l]=n[l];return o}function ge(){return{theme:j,themeConfig:pe,setTheme:E,toggleTheme:me,initTheme:he,applyThemeConfig:C,resetThemeConfig:fe,getDefaultThemeConfig:w,buildCssString:F,buildCssVars:ue}}const _o=["data-theme"],bo={class:"xp-theme-customizer__header"},wo={class:"xp-theme-customizer__body"},Bo={class:"xp-theme-customizer__section"},Eo={class:"xp-theme-customizer__modes"},Co=["onClick"],Vo={class:"xp-theme-customizer__section"},No={class:"xp-theme-customizer__grid"},$o={class:"xp-theme-customizer__label"},So={class:"xp-theme-customizer__input"},zo=["value","onInput"],Mo=["value","onChange"],To={class:"xp-theme-customizer__section"},Do={class:"xp-theme-customizer__grid"},Io={class:"xp-theme-customizer__label"},Fo={class:"xp-theme-customizer__input"},jo=["value","onInput"],Xo=["value","onChange"],Ao={class:"xp-theme-customizer__section"},Lo={class:"xp-theme-customizer__grid"},Ro={class:"xp-theme-customizer__label"},Oo={class:"xp-theme-customizer__input"},Po=["value","onInput"],Ho=["value","onChange"],Uo={class:"xp-theme-customizer__section"},Wo={class:"xp-theme-customizer__grid"},Jo={class:"xp-theme-customizer__label"},qo={class:"xp-theme-customizer__input"},Go=["value","onInput"],Yo=["value","onChange"],Ko={class:"xp-theme-customizer__label"},Zo={class:"xp-theme-customizer__input"},Qo=["value","onInput"],en=["value","onChange"],ke={__name:"ThemeCustomizer",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const{theme:o,applyThemeConfig:l,resetThemeConfig:r,getDefaultThemeConfig:i,buildCssString:s,themeConfig:f}=ge(),p={primary:"主色",success:"成功",warning:"警告",danger:"危险",info:"信息",regular:"常规",secondary:"次要",placeholder:"占位",base:"基础",page:"页面",soft:"柔和",light:"亮",lighter:"更亮"},u=e.ref("light"),a=e.ref(null),c=e.reactive(m(f.value));e.watch(f,y=>Object.assign(c,m(y)),{deep:!0});function m(y){return JSON.parse(JSON.stringify(y))}function k(y){if(!y)return"#ffffff";if(/^#([0-9a-f]{6})$/i.test(y))return y.toLowerCase();const h=y.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);return h?"#"+[h[1],h[2],h[3]].map(d=>Number(d).toString(16).padStart(2,"0")).join(""):"#ffffff"}function v(y,h){c.primary[y]=h,l(c)}function _(y,h,d){c[u.value][y][h]=d,l(c)}function X(){r()}function be(){A("xp-ui-theme.json",JSON.stringify(c,null,2),"application/json")}function we(){A("xp-ui-theme.css",s(c),"text/css")}function Be(){a.value&&a.value.click()}function Ee(y){const h=y.target.files&&y.target.files[0];if(!h)return;const d=new FileReader;d.onload=()=>{try{const g=JSON.parse(d.result);l(g)}catch(g){alert(`主题配置解析失败:
5
+ `+g.message)}finally{y.target.value=""}},d.readAsText(h)}function A(y,h,d){const g=new Blob([h],{type:d+";charset=utf-8"}),L=URL.createObjectURL(g),N=document.createElement("a");N.href=L,N.download=y,document.body.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(L),0)}return(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"xp-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-theme-customizer-backdrop",onClick:h[0]||(h[0]=e.withModifiers(d=>y.$emit("update:modelValue",!1),["self"]))})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"xp-slide"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("aside",{key:0,class:"xp-theme-customizer","data-theme":e.unref(o)},[e.createElementVNode("header",bo,[h[2]||(h[2]=e.createElementVNode("div",{class:"xp-theme-customizer__title"},"🎨 主题定制",-1)),e.createElementVNode("button",{class:"xp-theme-customizer__close",onClick:h[1]||(h[1]=d=>y.$emit("update:modelValue",!1)),"aria-label":"关闭"},"✕")]),e.createElementVNode("div",wo,[e.createElementVNode("section",Bo,[h[3]||(h[3]=e.createElementVNode("p",{class:"xp-theme-customizer__desc"}," 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ",-1)),e.createElementVNode("div",Eo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["light","dark"],d=>e.createElementVNode("button",{key:d,class:e.normalizeClass(["xp-theme-customizer__mode-btn",{"is-active":u.value===d}]),onClick:g=>u.value=d},e.toDisplayString(d==="light"?"浅色":"暗黑"),11,Co)),64))])]),e.createElementVNode("section",Vo,[h[4]||(h[4]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"主色",-1)),e.createElementVNode("div",No,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","success","warning","danger","info"],d=>e.createElementVNode("div",{key:d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",$o,e.toDisplayString(p[d]),1),e.createElementVNode("div",So,[e.createElementVNode("input",{type:"color",value:c.primary[d],onInput:g=>v(d,g.target.value)},null,40,zo),e.createElementVNode("input",{type:"text",value:c.primary[d],onChange:g=>v(d,g.target.value)},null,40,Mo)])])),64))])]),e.createElementVNode("section",To,[h[5]||(h[5]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"文本",-1)),e.createElementVNode("div",Do,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","regular","secondary","placeholder"],d=>e.createElementVNode("div",{key:"t-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Io,e.toDisplayString(p[d]),1),e.createElementVNode("div",Fo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].text[d]),onInput:g=>_("text",d,g.target.value)},null,40,jo),e.createElementVNode("input",{type:"text",value:c[u.value].text[d],onChange:g=>_("text",d,g.target.value)},null,40,Xo)])])),64))])]),e.createElementVNode("section",Ao,[h[6]||(h[6]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"背景",-1)),e.createElementVNode("div",Lo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","page","soft"],d=>e.createElementVNode("div",{key:"bg-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Ro,e.toDisplayString(p[d]),1),e.createElementVNode("div",Oo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].bg[d]),onInput:g=>_("bg",d,g.target.value)},null,40,Po),e.createElementVNode("input",{type:"text",value:c[u.value].bg[d],onChange:g=>_("bg",d,g.target.value)},null,40,Ho)])])),64))])]),e.createElementVNode("section",Uo,[h[7]||(h[7]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"边框 / 填充",-1)),e.createElementVNode("div",Wo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],d=>e.createElementVNode("div",{key:"bd-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Jo,"边框 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",qo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].border[d]),onInput:g=>_("border",d,g.target.value)},null,40,Go),e.createElementVNode("input",{type:"text",value:c[u.value].border[d],onChange:g=>_("border",d,g.target.value)},null,40,Yo)])])),64)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],d=>e.createElementVNode("div",{key:"fl-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Ko,"填充 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",Zo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].fill[d]),onInput:g=>_("fill",d,g.target.value)},null,40,Qo),e.createElementVNode("input",{type:"text",value:c[u.value].fill[d],onChange:g=>_("fill",d,g.target.value)},null,40,en)])])),64))])]),h[8]||(h[8]=e.createElementVNode("section",{class:"xp-theme-customizer__section"},[e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"实时预览"),e.createElementVNode("div",{class:"xp-theme-customizer__preview"},[e.createElementVNode("div",{class:"xp-preview-row"},[e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--primary"},"Primary"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--success"},"Success"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--warning"},"Warning"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--danger"},"Danger")]),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--primary"},"主标题文本"),e.createElementVNode("div",{class:"xp-preview-text"},"正文内容样例 Regular text"),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--secondary"},"次要提示")])],-1))]),e.createElementVNode("footer",{class:"xp-theme-customizer__footer"},[e.createElementVNode("button",{class:"xp-theme-customizer__action",onClick:X},"恢复默认"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--secondary",onClick:Be},"导入 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:be},"导出 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:we},"导出 CSS")]),e.createElementVNode("input",{ref_key:"importFileInput",ref:a,type:"file",accept:"application/json,.json,.txt",class:"xp-theme-customizer__hidden",onChange:Ee},null,544)],8,_o)):e.createCommentVNode("",!0)]),_:1})],64))}},B=e.ref([]);let tn=0;function on(){function t(n,o="info",l=2600){const r=++tn;B.value.push({id:r,message:n,type:o}),setTimeout(()=>{const i=B.value.findIndex(s=>s.id===r);i>=0&&B.value.splice(i,1)},l)}return{toasts:B,toast:t,success:n=>t(n,"success",2200),error:n=>t(n,"error",3600),info:n=>t(n,"info"),warn:n=>t(n,"warn",2800)}}const nn={class:"xp-toast-wrap","aria-live":"polite"},ln={class:"xp-toast__msg"},rn={__name:"Toast",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",nn,[e.createVNode(e.TransitionGroup,{name:"xp-toast"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:e.normalizeClass(["xp-toast",`xp-toast--${l.type}`])},[o[0]||(o[0]=e.createElementVNode("span",{class:"xp-toast__dot","aria-hidden":"true"},null,-1)),e.createElementVNode("span",ln,e.toDisplayString(l.message),1)],2))),128))]),_:1})])]))}},ve=x(rn,[["__scopeId","data-v-b564201c"]]),an={class:"xp-tooltip__content"},sn={__name:"Tooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},trigger:{type:String,default:"hover",validator:t=>["hover","click","manual"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const n=t,o=e.ref(!1),l=e.ref({}),r=e.ref(null),i=e.ref(null);let s=null;const f=()=>{e.nextTick(()=>{if(!r.value||!i.value)return;const c=r.value.getBoundingClientRect(),m=i.value.getBoundingClientRect();let k=0,v=0;switch(n.placement){case"top":k=c.top-m.height-8,v=c.left+c.width/2-m.width/2;break;case"bottom":k=c.bottom+8,v=c.left+c.width/2-m.width/2;break;case"left":k=c.top+c.height/2-m.height/2,v=c.left-m.width-8;break;case"right":k=c.top+c.height/2-m.height/2,v=c.right+8;break}l.value={top:`${k+window.scrollY}px`,left:`${v+window.scrollX}px`}})},p=()=>{n.disabled||(clearTimeout(s),s=setTimeout(()=>{o.value=!0,f()},100))},u=()=>{clearTimeout(s),s=setTimeout(()=>{o.value=!1},150)},a=()=>{n.trigger!=="click"||n.disabled||(o.value=!o.value,o.value&&f())};return e.onBeforeUnmount(()=>{clearTimeout(s)}),(c,m)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-tooltip",ref_key:"tooltipRef",ref:r},[e.createElementVNode("div",{class:"xp-tooltip__trigger",onMouseenter:p,onMouseleave:u,onClick:a},[e.renderSlot(c.$slots,"default",{},void 0,!0)],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-tooltip-fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-tooltip__popper",[`xp-tooltip__popper--${t.placement}`]]),style:e.normalizeStyle(l.value),ref_key:"popperRef",ref:i},[e.createElementVNode("div",an,[e.renderSlot(c.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)],!0)]),m[0]||(m[0]=e.createElementVNode("div",{class:"xp-tooltip__arrow"},null,-1))],6)):e.createCommentVNode("",!0)]),_:3})]))],512))}},xe=x(sn,[["__scopeId","data-v-6d9af40b"]]),ye={XpAlert:H,XpAvatar:U,XpBadge:W,XpButton:T,XpCard:J,XpCheckbox:q,XpContextMenu:G,XpDialog:Y,XpDropdown:K,XpEmpty:Z,XpFileIcon:Q,XpIcon:ee,XpInput:te,XpProgress:oe,XpRadio:ne,XpRate:le,XpSwitch:re,XpTabPane:ae,XpTabs:se,XpTag:ie,XpThemeCustomizer:ke,XpToast:ve,XpTooltip:xe},_e=t=>{Object.entries(ye).forEach(([n,o])=>{t.component(n,o)})},cn={install:_e,...ye};exports.DEFAULT_PRIMARY=b;exports.DEFAULT_TOKENS=V;exports.XpAlert=H;exports.XpAvatar=U;exports.XpBadge=W;exports.XpButton=T;exports.XpCard=J;exports.XpCheckbox=q;exports.XpContextMenu=G;exports.XpDialog=Y;exports.XpDropdown=K;exports.XpEmpty=Z;exports.XpFileIcon=Q;exports.XpIcon=ee;exports.XpInput=te;exports.XpProgress=oe;exports.XpRadio=ne;exports.XpRate=le;exports.XpSwitch=re;exports.XpTabPane=ae;exports.XpTabs=se;exports.XpTag=ie;exports.XpThemeCustomizer=ke;exports.XpToast=ve;exports.XpTooltip=xe;exports.applyThemeConfig=C;exports.buildCssString=F;exports.buildCssVars=ue;exports.darken=S;exports.default=cn;exports.deriveDark=go;exports.deriveLight=ho;exports.getDefaultThemeConfig=w;exports.initTheme=he;exports.install=_e;exports.isDark=vo;exports.lighten=$;exports.mix=I;exports.parseColor=z;exports.resetThemeConfig=fe;exports.setTheme=E;exports.toHex=ce;exports.toasts=B;exports.toggleTheme=me;exports.useTheme=ge;exports.useToast=on;exports.withAlpha=ko;