comp-hub 0.27.19 → 0.28.1

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.
Files changed (125) hide show
  1. package/README.md +71 -86
  2. package/bin/cli.js +42 -76
  3. package/bin/lib/commands.js +147 -0
  4. package/bin/lib/constants.js +22 -0
  5. package/bin/lib/http.js +62 -0
  6. package/bin/lib/startup.js +183 -0
  7. package/bin/lib/utils.js +80 -0
  8. package/dist/index.js +16 -16
  9. package/dist/master.js +403 -0
  10. package/dist/website/container/assets/{index-CdaB9oWd.js → index-BTW7AmWY.js} +9 -9
  11. package/dist/website/container/assets/index-DqV5-Zk-.css +1 -0
  12. package/dist/website/container/index.html +31 -34
  13. package/dist/website/container/js/vue2-sfc-loader.js +1 -1
  14. package/dist/website/container/js/vue3-sfc-loader.js +1 -1
  15. package/dist/website/item/assets/index-DNn8L2ik.css +1 -0
  16. package/dist/website/item/assets/index-eJgZiYQR.js +40 -0
  17. package/dist/website/item/index.html +28 -30
  18. package/dist/website/main/assets/{AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CfufrKbA.js → AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-C2LcEFL4.js} +1 -1
  19. package/dist/website/main/assets/{BaseDialog.vue_vue_type_script_setup_true_lang-B6WkXWm7.js → BaseDialog.vue_vue_type_script_setup_true_lang-CgV6_zzd.js} +1 -1
  20. package/dist/website/main/assets/BaseSegmented.vue_vue_type_script_setup_true_lang-CW16Y3Jx.js +1 -0
  21. package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-BwtYEYU5.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-BVY2XxV8.js} +1 -1
  22. package/dist/website/main/assets/{EmptyStatusContainer.vue_vue_type_script_setup_true_lang-DIgE9MGd.js → EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js} +1 -1
  23. package/dist/website/main/assets/{LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js → LoadingWrapper.vue_vue_type_script_setup_true_lang-bBtkKtmz.js} +1 -1
  24. package/dist/website/main/assets/{PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js → PanelBackground.vue_vue_type_script_setup_true_lang-DBIlZFl0.js} +1 -1
  25. package/dist/website/main/assets/{cloud-upload-CyIQfnxU.js → cloud-upload-BRjLuSi4.js} +1 -1
  26. package/dist/website/main/assets/{core-DE5-zGKf.js → core-B1GcTOER.js} +1 -1
  27. package/dist/website/main/assets/{el-table-column-BiqynxkD.js → el-table-column-8qfe8CVK.js} +1 -1
  28. package/dist/website/main/assets/{home-rounded-Dq-TBvLG.js → home-rounded-8qNxvN2I.js} +1 -1
  29. package/dist/website/main/assets/{index-CMvx8gm3.js → index-0Y9kW7YJ.js} +1 -1
  30. package/dist/website/main/assets/index-2LGHX46G.js +1 -0
  31. package/dist/website/main/assets/index-B2xvPCaB.js +1 -0
  32. package/dist/website/main/assets/{index-CGgS1tZ0.js → index-B3dAdOL_.js} +1 -1
  33. package/dist/website/main/assets/{index-Cf69_nzt.js → index-B5qe6yln.js} +15 -15
  34. package/dist/website/main/assets/index-BANn4H7f.css +1 -0
  35. package/dist/website/main/assets/{index-DvyE3TrH.js → index-ByKMTPW3.js} +2 -2
  36. package/dist/website/main/assets/index-CDnNjG3p.css +1 -0
  37. package/dist/website/main/assets/index-CEQStqDa.js +1 -0
  38. package/dist/website/main/assets/index-CP6sOfKF.css +1 -0
  39. package/dist/website/main/assets/index-Cf5sOeOs.js +1 -0
  40. package/dist/website/main/assets/index-CmSN0r9I.css +1 -0
  41. package/dist/website/main/assets/index-Cn8OtDDR.js +1 -0
  42. package/dist/website/main/assets/{index-BQWeT5qu.js → index-CoWWi7z-.js} +2 -2
  43. package/dist/website/main/assets/index-Cqi9_pkc.js +1 -0
  44. package/dist/website/main/assets/{index-vnzmxexj.js → index-CrzWpCC3.js} +1 -1
  45. package/dist/website/main/assets/index-CtzG8xUz.js +1 -0
  46. package/dist/website/main/assets/index-DANPdG90.js +1 -0
  47. package/dist/website/main/assets/index-DI0kvKsV.js +1 -0
  48. package/dist/website/main/assets/index-DJ4AvgpT.css +1 -0
  49. package/dist/website/main/assets/index-DSED2-Jv.js +1 -0
  50. package/dist/website/main/assets/index-DUr8uU-d.js +1 -0
  51. package/dist/website/main/assets/index-DW-M9dmc.js +1 -0
  52. package/dist/website/main/assets/{index-BGLjC3BV.js → index-D_jNsofk.js} +1 -1
  53. package/dist/website/main/assets/index-DffjEud2.js +1 -0
  54. package/dist/website/main/assets/{index-ctwb4cB7.js → index-DkTzdi1V.js} +1 -1
  55. package/dist/website/main/assets/index-DoTR7Juh.css +1 -0
  56. package/dist/website/main/assets/index-DxG4_1zN.js +1 -0
  57. package/dist/website/main/assets/{index-CTLlcQoM.js → index-DyEkv8OS.js} +1 -1
  58. package/dist/website/main/assets/{index-CCFHORqg.js → index-RlxCYKYM.js} +1 -1
  59. package/dist/website/main/assets/index-ZwJcoRf3.js +2 -0
  60. package/dist/website/main/assets/index-bJb3z37F.js +1 -0
  61. package/dist/website/main/assets/{index-gOTpUrNM.js → index-dC2trX5C.js} +1 -1
  62. package/dist/website/main/assets/{index-Cu1YAWdz.js → index-dhG9Kj5W.js} +1 -1
  63. package/dist/website/main/assets/{index-q4Z3Q7p4.js → index-feqY_hvF.js} +1 -1
  64. package/dist/website/main/assets/{index-cFhtMyBi.js → index-op0bdgFk.js} +2 -2
  65. package/dist/website/main/assets/index-xqKWYiCC.js +1 -0
  66. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BDhf8t5D.js → index.vue_vue_type_script_setup_true_lang-B_VrULUy.js} +1 -1
  67. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-D3xHCy9f.js +2 -0
  68. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-B4echric.js → index.vue_vue_type_script_setup_true_lang-DCQMqfel.js} +1 -1
  69. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DM_Wm4GD.js +1 -0
  70. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-qhJpeu7a.js → index.vue_vue_type_script_setup_true_lang-DX9EV5b8.js} +1 -1
  71. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-aO0L9Tak.js → index.vue_vue_type_script_setup_true_lang-RJnk970E.js} +1 -1
  72. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-rk3Yu4M8.js +1 -0
  73. package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-C3U7f9Ma.js → index.vue_vue_type_style_index_0_lang-BQWxY2F1.js} +5 -5
  74. package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-C4fELX8m.js → index.vue_vue_type_style_index_0_lang-DQhqVyhA.js} +1 -1
  75. package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-D_eT-tA_.js → index.vue_vue_type_style_index_0_lang-xD-wMtaK.js} +1 -1
  76. package/dist/website/main/assets/{kid-star-CFLIpXDC.js → kid-star-Cr1NlTdT.js} +1 -1
  77. package/dist/website/main/assets/{md5-BZr8xhBN.js → md5-DzJRYP5-.js} +1 -1
  78. package/dist/website/main/assets/{settings-B3XnnICj.js → settings-BFJXTJ9K.js} +1 -1
  79. package/dist/website/main/assets/{supervised-user-circle-CEgKC7n7.js → supervised-user-circle-Bnx5icEm.js} +1 -1
  80. package/dist/website/main/assets/{sync-saved-locally-rounded-CmlRPNS9.js → sync-saved-locally-rounded-DtyOT0dw.js} +1 -1
  81. package/dist/website/main/assets/{terminal-DykiTSV6.js → terminal-D72IJB2N.js} +1 -1
  82. package/dist/website/main/assets/{useCacheOssStore-CU4a8b24.js → useCacheOssStore-DApHt9lQ.js} +1 -1
  83. package/dist/website/main/assets/{useCompEditStore-Du_-rNtX.css → useCompEditStore-B9HAj9va.css} +1 -1
  84. package/dist/website/main/assets/{useCompEditStore-B7KaUbOi.js → useCompEditStore-KBTFiinR.js} +94 -94
  85. package/dist/website/main/assets/{useCompMetaLocalStore-pb1Ikkq3.js → useCompMetaLocalStore-eE-CBcE9.js} +1 -1
  86. package/dist/website/main/assets/{useKeyword-D1qu8Tz-.js → useKeyword-CoagiMo1.js} +1 -1
  87. package/dist/website/main/assets/useMessage-CYVXvlqq.js +1 -0
  88. package/dist/website/main/assets/{useTeamHeaders-DELMIzHt.js → useTeamHeaders-Cc060CP0.js} +1 -1
  89. package/dist/website/main/assets/useVscodeOpen-Dx3IRL0P.js +1 -0
  90. package/dist/website/main/assets/{vendor-core-B-Si3WEf.js → vendor-core-CzvSW5ae.js} +3 -3
  91. package/dist/website/main/assets/{vendor-ui-D6wVBlls.js → vendor-ui-DXwyveTF.js} +12 -12
  92. package/dist/website/main/index.html +92 -92
  93. package/package.json +5 -3
  94. package/dist/website/container/assets/index-BnbvpvZL.css +0 -1
  95. package/dist/website/item/assets/index-B0s1uwsa.js +0 -39
  96. package/dist/website/item/assets/index-BIcNxYiU.css +0 -1
  97. package/dist/website/main/assets/BaseSegmented.vue_vue_type_script_setup_true_lang-D5yw_wF0.js +0 -1
  98. package/dist/website/main/assets/index-B6f_06zP.js +0 -1
  99. package/dist/website/main/assets/index-BIGvC1SM.js +0 -1
  100. package/dist/website/main/assets/index-BfPdLll-.js +0 -1
  101. package/dist/website/main/assets/index-BkUBwon5.css +0 -1
  102. package/dist/website/main/assets/index-C9t3Yhe9.js +0 -1
  103. package/dist/website/main/assets/index-CFH_ugiT.js +0 -1
  104. package/dist/website/main/assets/index-CWW1M_cy.js +0 -1
  105. package/dist/website/main/assets/index-CuHNNhtE.js +0 -1
  106. package/dist/website/main/assets/index-D6Fz5rH9.css +0 -1
  107. package/dist/website/main/assets/index-D7eOWAPr.js +0 -1
  108. package/dist/website/main/assets/index-D8WDrGkh.js +0 -1
  109. package/dist/website/main/assets/index-DBM1x91X.js +0 -1
  110. package/dist/website/main/assets/index-DC94GyXj.js +0 -1
  111. package/dist/website/main/assets/index-Dl-mwEbG.js +0 -1
  112. package/dist/website/main/assets/index-DmO0JQ56.css +0 -1
  113. package/dist/website/main/assets/index-DrUAgWBX.js +0 -1
  114. package/dist/website/main/assets/index-Oo11MKfd.js +0 -1
  115. package/dist/website/main/assets/index-YUZjR2Eq.js +0 -2
  116. package/dist/website/main/assets/index-tEU6GnSH.js +0 -1
  117. package/dist/website/main/assets/index-tWc_GbBW.css +0 -1
  118. package/dist/website/main/assets/index-uu5oSUvx.js +0 -1
  119. package/dist/website/main/assets/index-wgeiSlf-.css +0 -1
  120. package/dist/website/main/assets/index-y8GEzH-z.css +0 -1
  121. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-COryHg9c.js +0 -1
  122. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-D_7jZ1zo.js +0 -2
  123. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-Dtuk2wrA.js +0 -1
  124. package/dist/website/main/assets/useMessage-D7WAp245.js +0 -1
  125. package/dist/website/main/assets/useVscodeOpen-DIYbcP1e.js +0 -1
@@ -1,23 +1,23 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cu1YAWdz.js","assets/vendor-ui-D6wVBlls.js","assets/vendor-core-B-Si3WEf.js","assets/LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js","assets/EmptyStatusContainer.vue_vue_type_script_setup_true_lang-DIgE9MGd.js","assets/BaseDialog.vue_vue_type_script_setup_true_lang-B6WkXWm7.js","assets/el-dropdown-item-BeIfAqTO.css","assets/el-card-BAyktVMS.css","assets/index-B6f_06zP.js","assets/index.vue_vue_type_script_setup_true_lang-aO0L9Tak.js","assets/useCacheOssStore-CU4a8b24.js","assets/index-DOlF0Z_P.css","assets/index.vue_vue_type_script_setup_true_lang-qhJpeu7a.js","assets/index-C9t3Yhe9.js","assets/index-B78Rw6nE.css","assets/useVscodeOpen-DIYbcP1e.js","assets/index-CMvx8gm3.js","assets/index-8dCw6Y2Z.css","assets/el-link-CPQZ-olG.css","assets/index-CTLlcQoM.js","assets/md5-BZr8xhBN.js","assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CfufrKbA.js","assets/CanvasAnimation.vue_vue_type_script_setup_true_lang-BwtYEYU5.js","assets/index-wgeiSlf-.css","assets/index-DvyE3TrH.js","assets/core-DE5-zGKf.js","assets/index-Dt73qBZB.css","assets/el-empty-S7fQQ3B8.css","assets/index-tEU6GnSH.js","assets/index.vue_vue_type_style_index_0_lang-C3U7f9Ma.js","assets/index-Dj51p5I8.css","assets/index-CFH_ugiT.js","assets/index-D8WDrGkh.js","assets/index.vue_vue_type_script_setup_true_lang-Dtuk2wrA.js","assets/useMessage-D7WAp245.js","assets/PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js","assets/index-y8GEzH-z.css","assets/index-uu5oSUvx.js","assets/useCompMetaLocalStore-pb1Ikkq3.js","assets/index.vue_vue_type_script_setup_true_lang-COryHg9c.js","assets/index-D7eOWAPr.js","assets/el-table-column-BiqynxkD.js","assets/el-table-column-B3ZEEuPD.css","assets/index.vue_vue_type_style_index_0_lang-D_eT-tA_.js","assets/vendor-xterm-DbWxaMay.js","assets/index-Bn5vi5XZ.css","assets/index.vue_vue_type_script_setup_true_lang-BDhf8t5D.js","assets/index.vue_vue_type_script_setup_true_lang-D_7jZ1zo.js","assets/useTeamHeaders-DELMIzHt.js","assets/index.vue_vue_type_script_setup_true_lang-B4echric.js","assets/index-BkUBwon5.css","assets/BaseSegmented.vue_vue_type_script_setup_true_lang-D5yw_wF0.js","assets/home-rounded-Dq-TBvLG.js","assets/home-rounded-B4KVwSYb.css","assets/index-CuHNNhtE.js","assets/useKeyword-D1qu8Tz-.js","assets/supervised-user-circle-CEgKC7n7.js","assets/supervised-user-circle-CZYpyCV4.css","assets/index-DC94GyXj.js","assets/index.vue_vue_type_style_index_0_lang-C4fELX8m.js","assets/useCompEditStore-B7KaUbOi.js","assets/v4-EwEgHOG0.js","assets/useCompEditStore-Du_-rNtX.css","assets/index-CdWXO9ks.css","assets/kid-star-CFLIpXDC.js","assets/kid-star-D1M-aC1C.css","assets/index-q4Z3Q7p4.js","assets/sync-saved-locally-rounded-CmlRPNS9.js","assets/sync-saved-locally-rounded-wbwASI26.css","assets/index-BIGvC1SM.js","assets/cloud-upload-CyIQfnxU.js","assets/cloud-upload-j3Y0taC9.css","assets/index-YUZjR2Eq.js","assets/index-BQWeT5qu.js","assets/moment-B-YVwB4U.js","assets/index-tWc_GbBW.css","assets/index-Oo11MKfd.js","assets/terminal-DykiTSV6.js","assets/terminal-DFt3N_TH.css","assets/index-DrUAgWBX.js","assets/settings-B3XnnICj.js","assets/settings-BhagQj3w.css","assets/index-ctwb4cB7.js","assets/index-D6Fz5rH9.css","assets/index-cFhtMyBi.js","assets/index-Cl0SK7oa.css","assets/index-Dl-mwEbG.js"])))=>i.map(i=>d[i]);
2
- import{aA as Go,g as te,v as Ce,aj as Ue,ab as y,j as ne,aO as we,r as j,ax as m,w as vi,au as il,ad as It,av as Iu,B as Ao,ao as Qo,aF as Mn,aM as $e,l as T,ai as Ve,i as g,F as Me,ah as He,q as Ke,ap as L,af as H,a7 as et,a9 as Ct,Y as Ge,b as Kf,k as ue,aB as oc,ay as rc,aN as zt,al as $t,X as We,ar as bn,aQ as ho,aR as Ye,W as Yf,aE as w_,aP as it,$ as At,p as S_,_ as wn,A as Jn,K as C_,aD as ws,m as E_,n as x_,aC as sc,c as T_,Z as Ae,Q as Ss,S as $_,u as qn,o as k_,s as O_,h as ac,at as kt,U as Vi,V as Gn,y as ol,a1 as A_,a4 as Cs,aa as Gf,H as Po,ak as P_,ac as Qf,z as R_,a8 as M_,aK as Sn,aJ as Xo,T as Es,aG as xs,aI as rl,aH as ra,t as I_}from"./vendor-core-B-Si3WEf.js";import{ag as F_,aA as D_,m as L_,aE as Ji,aB as lc,ae as j_,ax as z_,af as Fu,al as N_,ao as U_,at as V_,ar as B_,an as H_,am as q_,ap as W_,au as K_,aq as Y_,av as G_,as as Q_,y as Du,e as Qi,x as sl,aG as Xf,a2 as X_,a1 as J_,M as Z_,aH as ey,ak as ty,aj as Li,z as Ro,I as ny,K as iy,$ as oy,H as ry,N as al,B as ll,a3 as sy,_ as ay,Z as ly,r as cy,T as Lu,k as ju,A as zu,g as Nu,a5 as Uu,b as Vu,j as Bu,i as Hu,R as qu,Q as Wu,P as Ku,q as Yu,h as Gu,W as Qu,a7 as Xu,a9 as Ju,Y as Zu,S as ed,l as td,a0 as nd,n as id,a4 as od,O as rd,C as sd,a6 as ad,a8 as ld,G as cd,ac as gr,ad as Zi,aa as cc,aw as Mo,ah as Io,ay as Fo,J as rs,ab as uy}from"./vendor-ui-D6wVBlls.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const dy="local://",hy="main",fy="container",py="item",my="/__global_config__",vy="/node_modules/.prebuild_module",gy="_metadata.json",_y="/_module_load_prefix_",yy="/_node_modules_load_prefix_",by="/_comp_preview_prefix_local_",wy="/__proxy__",Sy="__remote__",Cy="__local__",Ey="https://api.comphub.cn:5696",xy="http://localhost:7002",Ty="http://localhost:5000",$y="http://localhost:5001",ky="Comp Hub",Oy="csrfToken",Ay="authorization",Py="x-refresh-token",Ry="x-csrf-token",My="accept-language",Iy="isGuestLogin",Fy="comp-hub-db",Dy="file-compiled",Ly="https://oss.comphub.cn",jy="oss:sts:token",zy="oss:sts:expire",Ny="comp.json",Uy="README.md",Vy="/.comp_hub_temp",By="main.js",Hy="index.vue",Jf="list_local",Zf="list_remote",qy={COMP_LIST_TYPE_LOCAL:Jf,COMP_LIST_TYPE_REMOTE:Zf},ep="config",tp="error",np="dir",ip="preview",op="extra",rp="deps",sp="upgradeLog",ap="readme",Wy={TAB_TYPE_CONFIG:ep,TAB_TYPE_ERROR:tp,TAB_TYPE_DIR:np,TAB_TYPE_PREVIEW:ip,TAB_TYPE_EXTRA:op,TAB_TYPE_DEPS:rp,TAB_TYPE_UPGRADE_LOG:sp,TAB_TYPE_README:ap},lp="mini",cp="full",Ky={COMP_EDIT_TAB_TYPE_MINI:lp,COMP_EDIT_TAB_TYPE_FULL:cp},up="EDIT",dp="ADD",Yy={DIALOG_TYPE_EDIT:up,DIALOG_TYPE_ADD:dp},hp="ONLY_INSTALL",fp="MAJOR_VERSION",pp="MINOR_VERSION",mp="EXACT_VERSION",Gy={COMP_MATCH_TYPE_ONLY_INSTALL:hp,COMP_MATCH_TYPE_MAJOR_VERSION:fp,COMP_MATCH_TYPE_MINOR_VERSION:pp,COMP_MATCH_TYPE_EXACT_VERSION:mp},vp="online",gp="offline",Qy={COMP_UPDATE_TYPE_ONLINE:vp,COMP_UPDATE_TYPE_OFFLINE:gp},Xy=0,Jy=1,Zy=-1,_p="checkPreviewListForm",yp="checkExtraInfoForm",bp="checkCompConfig",wp="afterCompDel",Sp="openCompTerminal",Cp="afterCompCancelCollect",Ep="afterCompRenderRetry",xp="getCompError",Tp="checkUpgradeLogForm",eb={COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:_p,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:yp,COMP_METHOD_KEY_CHECK_COMP_CONFIG:bp,COMP_METHOD_KEY_AFTER_COMP_DEL:wp,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:Sp,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:Cp,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:Ep,COMP_METHOD_KEY_GET_COMP_ERROR:xp,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:Tp},tb={CONTAINER:{SHARE:"share",COLLECT:"collect",LOCAL:"local",MINE:"mine",SIMILAR:"similar",TEAM_ALL:"teamAll",TEAM_MINE:"teamMine",TEAM_GROUP:"teamGroup",TEAM_ADD:"teamAdd"},ITEM:{PREVIEW_REMOTE:"previewRemote",CAROUSEL_REMOTE:"carouselRemote",CAROUSEL_LOCAL:"carouselLocal",EDIT_PANEL:"editPanel"}},nb="http://127.0.0.1",ib="http://localhost:8095",ob="http://localhost:8096",rb="http://localhost:5198",sb="/item",ab="/container",lb="CREATE",cb="JOIN",ub="EXIT",db="teamAddMyComp",hb="teamCompList",fb="teamCompGroupList",pb="teamMyCompList",mb="teamMyCompUpdate",vb="vue/dist/vue.esm-bundler.js",gb="__v__",_b="compListStore",yb="compEditStore",bb="callbacks",wb="comphubConfig",Sb="local",Cb="prod",Eb="local",xb="prod",Tb="http://localhost:5173/en/",$b="https://docs.comphub.cn/en/",kb=20,Ob=20,vt=Object.freeze(Object.defineProperty({__proto__:null,ACCEPT_LANGUAGE_HEADER_NAME:My,AUTHORIZATION_HEADER_NAME:Ay,CACHE_KEY_STS_EXPIRE_TIME:zy,CACHE_KEY_STS_TOKEN:jy,COMPHUB_CONFIG_KEY:wb,COMP_ACTION_ICON_HEIGHT:Ob,COMP_ACTION_ICON_WIDTH:kb,COMP_CONFIG_FILENAME:Ny,COMP_EDIT_TAB_TYPES:Ky,COMP_EDIT_TAB_TYPE_FULL:cp,COMP_EDIT_TAB_TYPE_MINI:lp,COMP_ENTRY_FILE:By,COMP_HUB_DEV_DOCS_URL:Tb,COMP_HUB_PROD_DOCS_URL:$b,COMP_LIST_TYPES:qy,COMP_LIST_TYPE_LOCAL:Jf,COMP_LIST_TYPE_REMOTE:Zf,COMP_MATCH_TYPES:Gy,COMP_MATCH_TYPE_EXACT_VERSION:mp,COMP_MATCH_TYPE_MAJOR_VERSION:fp,COMP_MATCH_TYPE_MINOR_VERSION:pp,COMP_MATCH_TYPE_ONLY_INSTALL:hp,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:Cp,COMP_METHOD_KEY_AFTER_COMP_DEL:wp,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:Ep,COMP_METHOD_KEY_CHECK_COMP_CONFIG:bp,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:yp,COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:_p,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:Tp,COMP_METHOD_KEY_GET_COMP_ERROR:xp,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:Sp,COMP_PREVIEW_PREFIX_LOCAL:by,COMP_README_FILENAME:Uy,COMP_SUBMIT_MAX_FILE_COUNT:30,COMP_SUBMIT_MAX_TOTAL_SIZE:10485760,COMP_TEMP_DIR:Vy,COMP_UPDATE_TYPES:Qy,COMP_UPDATE_TYPE_OFFLINE:gp,COMP_UPDATE_TYPE_ONLINE:vp,COMP_USE_ENTRY_FILE:Hy,CSRF_KEY:Oy,CSRF_TOKEN_HEADER_NAME:Ry,DIALOG_TYPES:Yy,DIALOG_TYPE_ADD:dp,DIALOG_TYPE_EDIT:up,FILE_MANAGER_DIRNAME:dy,GLOBAL_CONFIG_PATH:my,IFRAME_CONTAINER_WEBSITE_PATH:ab,IFRAME_HOST:nb,IFRAME_ITEM_WEBSITE_PATH:sb,IFRAME_ROUTES:tb,INDEX_DB_NAME:Fy,INDEX_DB_TABLE_NAME:Dy,IS_GUEST_LOGIN:Iy,LOCAL_CHILD_IFRAME_URL:ib,LOCAL_LEAF_IFRAME_URL:ob,LOCAL_MIDWAY_ENV_LOCAL:Sb,LOCAL_MIDWAY_ENV_PROD:Cb,LOCAL_SERVICE_PREFIX:Cy,LOCAL_SERVICE_URL_DEV:Ty,LOCAL_SERVICE_URL_DEV_SUB:$y,LOCAL_TOP_IFRAME_URL:rb,META_FILE_NAME:gy,MODULE_LOAD_PREFIX:_y,NODE_MODULES_LOAD_PREFIX:yy,OSS_CUSTOM_DOMAIN:Ly,PREBUILD_MODULE_DIR:vy,PROVIDE_KEYS:eb,PROVIDE_KEY_CALLBACKS:bb,PROVIDE_KEY_COMP_EDIT_STORE:yb,PROVIDE_KEY_COMP_LIST_STORE:_b,PROXY_PATH_PREFIX:wy,REFRESH_TOKEN_HEADER_NAME:Py,REMOTE_MIDWAY_ENV_LOCAL:Eb,REMOTE_MIDWAY_ENV_PROD:xb,REMOTE_SERVICE_PREFIX:Sy,REMOTE_SERVICE_URL_DEV:xy,REMOTE_SERVICE_URL_PROD:Ey,ROUTE_STATE_KEY_VERSION:gb,SCOPE_ID_TEAM_ADD_MY_COMP:db,SCOPE_ID_TEAM_COMP_GROUP_LIST:fb,SCOPE_ID_TEAM_COMP_LIST:hb,SCOPE_ID_TEAM_MY_COMP_LIST:pb,SCOPE_ID_TEAM_MY_COMP_UPDATE:mb,SITE_TITLE:ky,TAB_TYPES:Wy,TAB_TYPE_CONFIG:ep,TAB_TYPE_DEPS:rp,TAB_TYPE_DIR:np,TAB_TYPE_ERROR:tp,TAB_TYPE_EXTRA:op,TAB_TYPE_PREVIEW:ip,TAB_TYPE_README:ap,TAB_TYPE_UPGRADE_LOG:sp,TEAM_OPERATE_TYPE_CREATE:lb,TEAM_OPERATE_TYPE_EXIT:ub,TEAM_OPERATE_TYPE_JOIN:cb,VERSION_COMPARE_GREATER:Jy,VERSION_COMPARE_LESS:Zy,VERSION_COMPARE_SAME:Xy,VUE_ESM_BUNDLER:vb,WEBSITE_PATH_CONTAINER:fy,WEBSITE_PATH_ITEM:py,WEBSITE_PATH_MAIN:hy},Symbol.toStringTag,{value:"Module"})),Ab=[{label:"tag.systemRecommended",value:"XTTJ"},{label:"tag.all",value:"QB"},{label:"tag.latest",value:"ZX"},{label:"tag.hottest",value:"ZR"}],Pb=[".css"],Rb=[{name:"__id__",label:"comp.fieldId",required:!0,default:""},{name:"name",label:"comp.fieldName",required:!0,default:""},{name:"version",label:"comp.fieldVersion",required:!0,default:"1.0.0"}],Hz=Object.freeze(Object.defineProperty({__proto__:null,COMP_DEFAULT_FIELD:Rb,DEFAULT_TAG_GROUP:Ab,PREBUILD_MODULE_SKIP_EXT:Pb},Symbol.toStringTag,{value:"Module"})),Mb="comp-hub-locale",Ib=Object.freeze(Object.defineProperty({__proto__:null,LOCALE_KEY:Mb},Symbol.toStringTag,{value:"Module"})),qz=t=>vt.COMP_HUB_PROD_DOCS_URL,Fb=t=>"";var Db={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值",alphaDescription:"透明度 {alpha}, 当前颜色 {color}",hueLabel:"选择色相值",hueDescription:"色相 {hue}, 当前颜色 {color}",svLabel:"选择饱和度与明度的值",svDescription:"饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",predefineDescription:"选择 {value} 作为颜色"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},mention:{loading:"加载中"},dropdown:{toggleDropdown:"切换下拉选项"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计",selectAllLabel:"选择所有行",selectRowLabel:"选择当前行",expandRowLabel:"展开当前行",collapseRowLabel:"收起当前行",sortLabel:"按 {column} 排序",filterLabel:"按 {column} 过滤"},tag:{close:"关闭此标签"},tour:{next:"下一步",previous:"上一步",finish:"结束导览",close:"关闭此对话框"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"},inputOTP:{groupLabel:"一次性密码输入框",defaultLabel:"请输入第 {index} 位 OTP 字符"}}};const Lb=()=>{const{locale:t}=Go(),e={zh:Db,en:F_};return{locale:te(()=>e[t.value])}},jb=Ce({__name:"App",setup(t){const{locale:e}=Lb();return D_(),(n,i)=>{const o=Ue("router-view");return y(),ne(m(L_),{locale:m(e)},{default:we(()=>[j(o)]),_:1},8,["locale"])}}}),zb="modulepreload",Nb=function(t){return"/main/"+t},ud={},nt=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");o=l(n.map(c=>{if(c=Nb(c),c in ud)return;ud[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":zb,u||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((v,p)=>{h.addEventListener("load",v),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},li="authorization",ss=()=>localStorage.getItem(li),Ub=t=>localStorage.setItem(li,t),Vb=()=>localStorage.removeItem(li),ki="x-refresh-token",Bb=()=>localStorage.getItem(ki),Hb=t=>localStorage.setItem(ki,t),qb=()=>localStorage.removeItem(ki),uc="isGuest",sa=()=>localStorage.getItem(uc),Wz=t=>localStorage.setItem(uc,t),Wb=()=>localStorage.removeItem(uc),Kb="aside_is_collapse",Kz="loginType",Yz="compUploadFullscreen",Gz="terminalCommandHistory",Qz="compUploadSidePanelSize",Xz="tagSelected",Yb="asideSize",Gb="headerSize",$p="tagsViewMaxCache",Jz="readUploadAgreement",Qb="dependencyMatchRule",Zz="teamTabActiveName",eN="settingTabActiveName",tN="compPreviewTabActiveName",kp="paginationPageSize",Xb=()=>localStorage.getItem(kp),Jb=t=>localStorage.setItem(kp,t),nN="selectedFolderPath",Jo=vi("tagsView",{state:()=>({visitedViews:[],maxCache:Ji($p,10),payloadMap:new Map}),actions:{setMaxCache(t){this.$patch(e=>{e.maxCache=t})},addView(t){this.$patch(e=>{const n={...t},i=e.visitedViews.findIndex(r=>r.path===t.path);if(i!==-1){e.visitedViews[i]=n;return}e.visitedViews.unshift(n);const o=e.visitedViews.length-e.maxCache;o>0&&this.spliceVisitedViews(-o,o)})},spliceVisitedViews(t,e){this.$patch(n=>{n.visitedViews.splice(t,e)})},delViewByPath(t){this.$patch(e=>{for(const[n,i]of e.visitedViews.entries())if(i.path===t){e.visitedViews.splice(n,1);break}})},delViewAndJumpToPrev(t,e=!1,n){if(e){const i=this.visitedViews.filter(o=>o.path!==t)?.[0];i?n.push(i.path).then(o=>{o||setTimeout(()=>{this.delViewByPath(t)},250)}):n.push("/").then(o=>{o||this.delViewByPath(t)})}else this.delViewByPath(t)},addPayLoad(t,e){this.$patch(n=>{n.payloadMap.set(t,e)})},getPayLoad(t){return this.payloadMap.get(t)}}}),Zb=Ce((t,{slots:e})=>{var n,i;const o=Qo(),{width:r,height:s}=il(t),a=It(lc(o,{width:(n=Iu(r))!==null&&n!==void 0?n:0,height:(i=Iu(s))!==null&&i!==void 0?i:0},{box:t.box,window:t.window}));return()=>{if(e.default)return Ao(t.as||"div",{ref:o},e.default(a))}},{name:"UseElementSize",props:["as","box","height","width","window"]}),e0={ref:"el",class:"relative"},t0={class:"absolute opacity-0 pointer-events-none flex"},n0=["itemKey"],i0=Ce({__name:"AutoWrapRow",props:{list:{},moreWidth:{default:70},gap:{default:5},getKey:{}},setup(t){const e=t,n=H(new Map),i=Mn("el"),o=Mn("items"),{width:r}=lc(i),s=H([]),a=H(!1),l=te(()=>r.value-e.moreWidth),c=te(()=>{const f=s.value.map(_=>_.key);return e.list.filter(_=>f.includes(e.getKey(_)))}),u=te(()=>a.value?e.list.length-s.value.length:0),d=te(()=>{let f=0;for(const _ of n.value.values())f+=_;return f});function h(f,_){n.value.set(f,_)}function v(){const f=new Map;for(const _ of e.list){const C=e.getKey(_);f.set(C,n.value.get(C)??0)}n.value=f}const p=j_(()=>{let f=0;const _=[];if(!(!o.value||e.list.length===0)){for(const C of e.list){const w=e.getKey(C),S=o.value.find(b=>b.getAttribute("itemKey")===w);if(S){if(f+=S.offsetWidth+e.gap,f>l.value)break;_.push({key:w,value:S.offsetWidth})}}s.value=_,a.value=!0}},100);return $e([()=>r.value,()=>e.list,()=>d.value],([,,f],[,,_])=>{f!==_&&(a.value=!1),p()},{flush:"post",deep:!0}),$e(()=>e.list.length,()=>{v()}),(f,_)=>(y(),T("div",e0,[Ve(f.$slots,"display",{visibleList:c.value,overflow:u.value}),g("div",t0,[(y(!0),T(Me,null,He(t.list,(C,w)=>(y(),ne(m(Zb),{key:t.getKey(C)},{default:we(({width:S})=>[Ke(L(h(t.getKey(C),Number(S)))+" ",1),g("div",{ref_for:!0,ref:"items",itemKey:t.getKey(C),class:"invisible whitespace-nowrap"},[Ve(f.$slots,"measure",{item:C,index:w})],8,n0)]),_:2},1024))),128))])],512))}}),dc=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Op=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ts=(t,e,n,i="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:a};return e&&!Ur(c)?null:c}const r=o[0],s=r.split("-");if(s.length>1){const a={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!Ur(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Ur(a,n)?null:a}return null},Ur=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function o0(t,e){const n=t.icons,i=t.aliases||Object.create(null),o=Object.create(null);function r(s){if(n[s])return o[s]=[];if(!(s in o)){o[s]=null;const a=i[s]&&i[s].parent,l=a&&r(a);l&&(o[s]=[a].concat(l))}return o[s]}return Object.keys(n).concat(Object.keys(i)).forEach(r),o}const Ap=Object.freeze({left:0,top:0,width:16,height:16}),as=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),$s=Object.freeze({...Ap,...as}),cl=Object.freeze({...$s,body:"",hidden:!1});function r0(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function dd(t,e){const n=r0(t,e);for(const i in cl)i in as?i in t&&!(i in n)&&(n[i]=as[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function s0(t,e,n){const i=t.icons,o=t.aliases||Object.create(null);let r={};function s(a){r=dd(i[a]||o[a],r)}return s(e),n.forEach(s),dd(t,r)}function Pp(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const i=o0(t);for(const o in i){const r=i[o];r&&(e(o,s0(t,o,r)),n.push(o))}return n}const a0={provider:"",aliases:{},not_found:{},...Ap};function aa(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Rp(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!aa(t,a0))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o||typeof r.body!="string"||!aa(r,cl))return null}const i=e.aliases||Object.create(null);for(const o in i){const r=i[o],s=r.parent;if(!o||typeof s!="string"||!n[s]&&!i[s]||!aa(r,cl))return null}return e}const hd=Object.create(null);function l0(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function eo(t,e){const n=hd[t]||(hd[t]=Object.create(null));return n[e]||(n[e]=l0(t,e))}function Mp(t,e){return Rp(e)?Pp(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function c0(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let Do=!1;function Ip(t){return typeof t=="boolean"&&(Do=t),Do}function u0(t){const e=typeof t=="string"?Ts(t,!0,Do):t;if(e){const n=eo(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function d0(t,e){const n=Ts(t,!0,Do);if(!n)return!1;const i=eo(n.provider,n.prefix);return e?c0(i,n.name,e):(i.missing.add(n.name),!0)}function h0(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Do&&!e&&!t.prefix){let i=!1;return Rp(t)&&(t.prefix="",Pp(t,(o,r)=>{d0(o,r)&&(i=!0)})),i}const n=t.prefix;return Ur({prefix:n,name:"a"})?!!Mp(eo(e,n),t):!1}const Fp=Object.freeze({width:null,height:null}),Dp=Object.freeze({...Fp,...as}),f0=/(-?[0-9.]*[0-9]+[0-9.]*)/g,p0=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function fd(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(f0);if(i===null||!i.length)return t;const o=[];let r=i.shift(),s=p0.test(r);for(;;){if(s){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=i.shift(),r===void 0)return o.join("");s=!s}}function m0(t,e="defs"){let n="";const i=t.indexOf("<"+e);for(;i>=0;){const o=t.indexOf(">",i),r=t.indexOf("</"+e);if(o===-1||r===-1)break;const s=t.indexOf(">",r);if(s===-1)break;n+=t.slice(o+1,r).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:n,content:t}}function v0(t,e){return t?"<defs>"+t+"</defs>"+e:e}function g0(t,e,n){const i=m0(t);return v0(i.defs,e+i.content+n)}const _0=t=>t==="unset"||t==="undefined"||t==="none";function y0(t,e){const n={...$s,...t},i={...Dp,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,i].forEach(f=>{const _=[],C=f.hFlip,w=f.vFlip;let S=f.rotate;C?w?S+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):w&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let b;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:b=o.height/2+o.top,_.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:b=o.width/2+o.left,_.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}S%2===1&&(o.left!==o.top&&(b=o.left,o.left=o.top,o.top=b),o.width!==o.height&&(b=o.width,o.width=o.height,o.height=b)),_.length&&(r=g0(r,'<g transform="'+_.join(" ")+'">',"</g>"))});const s=i.width,a=i.height,l=o.width,c=o.height;let u,d;s===null?(d=a===null?"1em":a==="auto"?c:a,u=fd(d,l/c)):(u=s==="auto"?l:s,d=a===null?fd(u,c/l):a==="auto"?c:a);const h={},v=(f,_)=>{_0(_)||(h[f]=_.toString())};v("width",u),v("height",d);const p=[o.left,o.top,l,c];return h.viewBox=p.join(" "),{attributes:h,viewBox:p,body:r}}const b0=/\sid="(\S+)"/g,pd=new Map;function w0(t){t=t.replace(/[0-9]+$/,"")||"a";const e=pd.get(t)||0;return pd.set(t,e+1),e?`${t}${e}`:t}function S0(t){const e=[];let n;for(;n=b0.exec(t);)e.push(n[1]);if(!e.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(o=>{const r=w0(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const ul=Object.create(null);function C0(t,e){ul[t]=e}function dl(t){return ul[t]||ul[""]}function hc(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const fc=Object.create(null),_o=["https://api.simplesvg.com","https://api.unisvg.com"],Vr=[];for(;_o.length>0;)_o.length===1||Math.random()>.5?Vr.push(_o.shift()):Vr.push(_o.pop());fc[""]=hc({resources:["https://api.iconify.design"].concat(Vr)});function E0(t,e){const n=hc(e);return n===null?!1:(fc[t]=n,!0)}function pc(t){return fc[t]}const x0=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let md=x0();function T0(t,e){const n=pc(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const r=e+".json?icons=";i=n.maxURL-o-n.path.length-r.length}return i}function $0(t){return t===404}const k0=(t,e,n)=>{const i=[],o=T0(t,e),r="icons";let s={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,c)=>{a+=l.length+1,a>=o&&c>0&&(i.push(s),s={type:r,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),i.push(s),i};function O0(t){if(typeof t=="string"){const e=pc(t);if(e)return e.path}return"/"}const A0=(t,e,n)=>{if(!md){n("abort",424);return}let i=O0(e.provider);switch(e.type){case"icons":{const r=e.prefix,s=e.icons.join(","),a=new URLSearchParams({icons:s});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;md(t+i).then(r=>{const s=r.status;if(s!==200){setTimeout(()=>{n($0(s)?"abort":"next",s)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},P0={prepare:k0,send:A0};function Lp(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(o=>o.id!==e))})}function R0(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,o=t.prefix;e.forEach(r=>{const s=r.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==o)return!0;const c=l.name;if(t.icons[c])s.loaded.push({provider:i,prefix:o,name:c});else if(t.missing.has(c))s.missing.push({provider:i,prefix:o,name:c});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||Lp([t],r.id),r.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),r.abort))})}))}let M0=0;function I0(t,e,n){const i=M0++,o=Lp.bind(null,n,i);if(!e.pending.length)return o;const r={id:i,icons:e,callback:t,abort:o};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(r)}),o}function F0(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return t.forEach(o=>{if(i.name===o.name&&i.prefix===o.prefix&&i.provider===o.provider)return;i=o;const r=o.provider,s=o.prefix,a=o.name,l=n[r]||(n[r]=Object.create(null)),c=l[s]||(l[s]=eo(r,s));let u;a in c.icons?u=e.loaded:s===""||c.missing.has(a)?u=e.missing:u=e.pending;const d={provider:r,prefix:s,name:a};u.push(d)}),e}function D0(t,e=!0,n=!1){const i=[];return t.forEach(o=>{const r=typeof o=="string"?Ts(o,e,n):o;r&&i.push(r)}),i}const L0={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function j0(t,e,n,i){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let x=t.resources.slice(0);for(s=[];x.length>1;){const O=Math.floor(Math.random()*x.length);s.push(x[O]),x=x.slice(0,O).concat(x.slice(O+1))}s=s.concat(x)}else s=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let l="pending",c=0,u,d=null,h=[],v=[];typeof i=="function"&&v.push(i);function p(){d&&(clearTimeout(d),d=null)}function f(){l==="pending"&&(l="aborted"),p(),h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function _(x,O){O&&(v=[]),typeof x=="function"&&v.push(x)}function C(){return{startTime:a,payload:e,status:l,queriesSent:c,queriesPending:h.length,subscribe:_,abort:f}}function w(){l="failed",v.forEach(x=>{x(void 0,u)})}function S(){h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function b(x,O,$){const K=O!=="success";switch(h=h.filter(F=>F!==x),l){case"pending":break;case"failed":if(K||!t.dataAfterTimeout)return;break;default:return}if(O==="abort"){u=$,w();return}if(K){u=$,h.length||(s.length?E():w());return}if(p(),S(),!t.random){const F=t.resources.indexOf(x.resource);F!==-1&&F!==t.index&&(t.index=F)}l="completed",v.forEach(F=>{F($)})}function E(){if(l!=="pending")return;p();const x=s.shift();if(x===void 0){if(h.length){d=setTimeout(()=>{p(),l==="pending"&&(S(),w())},t.timeout);return}w();return}const O={status:"pending",resource:x,callback:($,K)=>{b(O,$,K)}};h.push(O),c++,d=setTimeout(E,t.rotate),n(x,e,O.callback)}return setTimeout(E),C}function jp(t){const e={...L0,...t};let n=[];function i(){n=n.filter(s=>s().status==="pending")}function o(s,a,l){const c=j0(e,s,a,(u,d)=>{i(),l&&l(u,d)});return n.push(c),c}function r(s){return n.find(a=>s(a))||null}return{query:o,find:r,setIndex:s=>{e.index=s},getIndex:()=>e.index,cleanup:i}}function vd(){}const la=Object.create(null);function z0(t){if(!la[t]){const e=pc(t);if(!e)return;la[t]={config:e,redundancy:jp(e)}}return la[t]}function N0(t,e,n){let i,o;if(typeof t=="string"){const r=dl(t);if(!r)return n(void 0,424),vd;o=r.send;const s=z0(t);s&&(i=s.redundancy)}else{const r=hc(t);if(r){i=jp(r);const s=dl(t.resources?t.resources[0]:"");s&&(o=s.send)}}return!i||!o?(n(void 0,424),vd):i.query(e,o,n)().abort}function gd(){}function U0(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,R0(t)}))}function V0(t){const e=[],n=[];return t.forEach(i=>{(i.match(Op)?e:n).push(i)}),{valid:e,invalid:n}}function yo(t,e,n){function i(){const o=t.pendingIcons;e.forEach(r=>{o&&o.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!Mp(t,n).length){i();return}}catch(o){console.error(o)}i(),U0(t)}function _d(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function B0(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const r=t.loadIcon;if(t.loadIcons&&(o.length>1||!r)){_d(t.loadIcons(o,i,n),c=>{yo(t,o,c)});return}if(r){o.forEach(c=>{_d(r(c,i,n),u=>{yo(t,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:s,invalid:a}=V0(o);if(a.length&&yo(t,a,null),!s.length)return;const l=i.match(Op)?dl(n):null;if(!l){yo(t,s,null);return}l.prepare(n,i,s).forEach(c=>{N0(n,c,u=>{yo(t,c.icons,u)})})}))}const H0=(t,e)=>{const n=F0(D0(t,!0,Ip()));if(!n.pending.length){let a=!0;return e&&setTimeout(()=>{a&&e(n.loaded,n.missing,n.pending,gd)}),()=>{a=!1}}const i=Object.create(null),o=[];let r,s;return n.pending.forEach(a=>{const{provider:l,prefix:c}=a;if(c===s&&l===r)return;r=l,s=c,o.push(eo(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(a=>{const{provider:l,prefix:c,name:u}=a,d=eo(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(u)||(h.add(u),i[l][c].push(u))}),o.forEach(a=>{const l=i[a.provider][a.prefix];l.length&&B0(a,l)}),e?I0(e,n,o):gd};function q0(t,e){const n={...t};for(const i in e){const o=e[i],r=typeof o;i in Fp?(o===null||o&&(r==="string"||r==="number"))&&(n[i]=o):r===typeof n[i]&&(n[i]=i==="rotate"?o%4:o)}return n}const W0=/[\s,]+/;function K0(t,e){e.split(W0).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function Y0(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:i(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?i(r):0)}}return e}function G0(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function Q0(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function X0(t){return"data:image/svg+xml,"+Q0(t)}function J0(t){return'url("'+X0(t)+'")'}const yd={...Dp,inline:!1},Z0={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ew={display:"inline-block"},hl={backgroundColor:"currentColor"},zp={backgroundColor:"transparent"},bd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},wd={webkitMask:hl,mask:hl,background:zp};for(const t in wd){const e=wd[t];for(const n in bd)e[t+n]=bd[n]}const Br={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Br[t+"-flip"]=e,Br[t.slice(0,1)+"-flip"]=e,Br[t+"Flip"]=e});function Sd(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const Cd=(t,e)=>{const n=q0(yd,e),i={...Z0},o=e.mode||"svg",r={},s=e.style,a=typeof s=="object"&&!(s instanceof Array)?s:{};for(let f in e){const _=e[f];if(_!==void 0)switch(f){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":n[f]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&K0(n,_);break;case"color":r.color=_;break;case"rotate":typeof _=="string"?n[f]=Y0(_):typeof _=="number"&&(n[f]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete i["aria-hidden"];break;default:{const C=Br[f];C?(_===!0||_==="true"||_===1)&&(n[C]=!0):yd[f]===void 0&&(i[f]=_)}}}const l=y0(t,n),c=l.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),o==="svg")return i.style={...r,...a},Object.assign(i,c),i.innerHTML=S0(l.body),Ao("svg",i);const{body:u,width:d,height:h}=t,v=o==="mask"||(o==="bg"?!1:u.indexOf("currentColor")!==-1),p=G0(u,{...c,width:d+"",height:h+""});return i.style={...r,"--svg":J0(p),width:Sd(c.width),height:Sd(c.height),...ew,...v?hl:zp,...a},Ao("span",i)};Ip(!0);C0("",P0);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!h0(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;E0(n,o)||console.error(i)}catch{console.error(i)}}}}const tw={...$s,body:""},nw=Ce((t,{emit:e})=>{const n=H(null);function i(){n.value&&(n.value.abort?.(),n.value=null)}const o=H(!!t.ssr),r=H(""),s=Qo(null);function a(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=Ts(c,!1,!0))===null)return null;let d=u0(u);if(!d){const p=n.value;return(!p||p.name!==c)&&(d===null?n.value={name:c}:n.value={name:c,abort:H0([u],l)}),null}i(),r.value!==c&&(r.value=c,Ge(()=>{e("load",c)}));const h=t.customise;if(h){d=Object.assign({},d);const p=h(d.body,u.name,u.prefix,u.provider);typeof p=="string"&&(d.body=p)}const v=["iconify"];return u.prefix!==""&&v.push("iconify--"+u.prefix),u.provider!==""&&v.push("iconify--"+u.provider),{data:d,classes:v}}function l(){const c=a();c?c.data!==s.value?.data&&(s.value=c):s.value=null}return o.value?l():et(()=>{o.value=!0,l()}),$e(()=>t.icon,l),Ct(i),()=>{const c=s.value;if(!c)return Cd(tw,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),Cd({...$s,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]});function iw(t,e,n="_id"){const i=Fu(t,e,n).filter(Boolean),o=Fu(e,t,n).filter(Boolean),r=N_(t,e,(s,a)=>s[n]===a[n]&&!U_(s,a));return{addedItems:i,deletedItems:o,modifiedItems:r}}const iN=Object.freeze(Object.defineProperty({__proto__:null,findChangedArrayItems:iw},Symbol.toStringTag,{value:"Module"}));function mc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ow(t,e){if(!e?.trim())return[{text:t,isMatch:!1}];const n=new RegExp(`(${mc(e)})`,"gi");return t.split(n).map(i=>({text:i,isMatch:n.test(i)&&i.toLowerCase()===e.toLowerCase()}))}function rw(t,e,n="hl"){if(!e?.trim())return t;const i=mc(e.trim());return t.replace(new RegExp(`(${i})`,"gi"),`<mark class="${n}">$1</mark>`)}function sw(t,e){const n=e?.trim().toLowerCase();return n?t.findIndex(i=>i.toLowerCase().includes(n)):-1}const Np=t=>t.replace(/[/\\]/g,"/"),aw=(t,e="/")=>t.replace(/[\\/]+/g,e);function lw(){return"#"+z_(0,16777215).toString(16).padStart(6,"0")}const cw=t=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t),Up=t=>t.replace(/[-_]([a-z])/g,(e,n)=>n.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()),fl=t=>{if(Array.isArray(t))return t.map(n=>fl(n));if(t===null||typeof t!="object")return t;const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=Up(n);e[i]=fl(t[n])}return e};function uw(t){return/(^[A-Z][a-z][a-zA-Z0-9]*$)|(^[a-z]+(-[a-z0-9]+)+$)/.test(t.trim())}function dw(t){if(t<=0)throw new Error("长度必须大于0");let e="";for(;e.length<t;){const n=Math.floor(Math.random()*10);e.length===0&&n===0||(e+=n)}return e}function Vp(t){if(t==null)return{valid:!1,reason:"validateHash.empty"};if(typeof t!="string")return{valid:!1,reason:"validateHash.notString",reasonParams:{type:typeof t}};const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return{valid:!1,reason:"validateHash.contentEmpty"};if(/^\d/.test(e))return{valid:!1,reason:"validateHash.startsWithNumber",reasonParams:{char:e[0]}};const n=e.match(/[^\p{L}\p{N}_\-() ]/u);if(n){const i=n[0],o=i.charCodeAt(0);return i==="`"?{valid:!1,reason:"validateHash.invalidCharBacktick"}:i===`
3
- `?{valid:!1,reason:"validateHash.invalidCharNewline"}:i==="\r"?{valid:!1,reason:"validateHash.invalidCharCarriageReturn"}:i===" "?{valid:!1,reason:"validateHash.invalidCharTab"}:i==="\f"?{valid:!1,reason:"validateHash.invalidCharFormFeed"}:i==="\v"?{valid:!1,reason:"validateHash.invalidCharVerticalTab"}:i==="#"?{valid:!1,reason:"validateHash.invalidCharHash"}:/[<>\\"'&]/.test(i)?{valid:!1,reason:"validateHash.invalidCharHtmlSpecial",reasonParams:{char:i}}:{valid:!1,reason:"validateHash.invalidCharUnknown",reasonParams:{char:i,code:o.toString(16).toUpperCase().padStart(4,"0")}}}return{valid:!0,normalized:e}}function hw(t){return Vp(t).valid}const oN=Object.freeze(Object.defineProperty({__proto__:null,convertKeysToCamelCase:fl,escapeRegExp:mc,findKeywordLineIndex:sw,generateNumberString:dw,highlightText:rw,isEmail:cw,isValidHash:hw,randomColor:lw,replaceBackslashWithSlash:Np,replaceSlashWithSpecifiedSeparator:aw,splitTextByKeyword:ow,toCamelCase:Up,validateCompName:uw,validateHash:Vp},Symbol.toStringTag,{value:"Module"}));function fw(t,e){if(!t||!e.length)throw new Error("组件路径或入口路径为空");const[n]=e.slice(-1);if(!n)throw new Error("入口路径最后一项无效");const i=Np(n);return`${t.replace(vt.FILE_MANAGER_DIRNAME,"")}${i}`}function pw(t){const e={};return t.forEach(n=>{n?.parent?e[n?.parent?.name]=n?.parent?.version:e[n.name]=n.version}),Object.entries(e).map(([n,i])=>({name:n,version:i}))}const rN=Object.freeze(Object.defineProperty({__proto__:null,getPreviewUrl:fw,handleDepData:pw},Symbol.toStringTag,{value:"Module"}));function mw(t){const e={children:[]},n=[e];return t.forEach(({depth:i,tokens:o})=>{if(o[0]){const r=o[0].text,s=o.map(u=>u.text),a=s.join(""),l={title:r,titles:s,href:`#${a}`,children:[]};for(;n.length>i;)n.pop();const c=n[n.length-1];c&&c.children.push(l),n.push(l)}}),e.children}const sN=Object.freeze(Object.defineProperty({__proto__:null,flatHeadingsToTree:mw},Symbol.toStringTag,{value:"Module"})),vw=t=>`Bearer ${t}`,gw=t=>t.replace("Bearer ",""),xi=Object.freeze(Object.defineProperty({__proto__:null,extractBearerToken:gw,generateBearerToken:vw},Symbol.toStringTag,{value:"Module"}));function _w(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=[];let a=!1;const l=u=>{const d=u[o];Array.isArray(d)&&(s.push(...d),d.forEach(h=>l(h)))},c=u=>{if(a)return!0;for(const d of u){if(d?.[i]===e)return a=!0,l(d),!0;const h=d?.[o];if(Array.isArray(h)&&h.length>0&&c(h))return!0}return!1};return c(r),s}function Bp(t,e){const n=JSON.parse(JSON.stringify(t));return n.children?.length&&(n.children=n.children.map(i=>Bp(i,e))),e(n)}function yw(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=l=>{const{[o]:c,...u}=l;return u},a=(l,c)=>{for(const u of l){if(u[i]===e)return[s(u),...c];const d=u[o];if(Array.isArray(d)&&d.length>0){const h=a(d,[s(u),...c]);if(h)return h}}return null};return a(r,[])??[]}function bw(t,e){const{createNode:n,pathSeparator:i="/",skipInvalid:o=!0}=e,r=new Map,s=i,a=n("directory","",s);a.children=[],r.set(s,a);const l=u=>{let d=u.replace(/\\/g,"/");return d=d.replace(/^\.\//,""),d=d.replace(/^\/+|\/+$/g,""),d.replace(/\//g,i)};for(const u of t){const d=l(u.path);if(!d)continue;const h=d.split(i).filter(Boolean);if(h.length===0)continue;let v=s,p="";for(let w=0;w<h.length-1;w++){const S=h[w];if(p=p?`${p}${i}${S}`:S,!r.has(p)){const b=n("directory",S,p);b.children=[],r.set(p,b),r.get(v)?.children?.push(b)}v=p}const f=h[h.length-1];if(!f){if(!o)throw new Error(`无效路径: ${u.path}`);continue}const _=p?`${p}${i}${f}`:f,C=n("file",f,_);r.get(v)?.children?.push(C)}const c=u=>{u.sort((d,h)=>d.type!==h.type?d.type==="directory"?-1:1:d.name.localeCompare(h.name)),u.forEach(d=>d.children?.length&&c(d.children))};return a.children?.length&&c(a.children),a}const aN=Object.freeze(Object.defineProperty({__proto__:null,convertFlatToTree:bw,findTreeNodePathToRoot:yw,getTreeAllChildren:_w,mapTree:Bp},Symbol.toStringTag,{value:"Module"}));var Hp=(t=>(t.Added="added",t.Deleted="deleted",t.Unchanged="unchanged",t.Changed="modified",t))(Hp||{}),qp=(t=>(t.Directory="directory",t.File="file",t))(qp||{});function Wp(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function ls(t,e){for(const n of t)e.set(n.path,n),n.type==="directory"&&n.children?.length&&ls(n.children,e)}function Ed(t){const e=new Map;return ls(t,e),e}function vc(t,e){const n=[];for(const i of t)if(!e.has(i.path)){const o=Wp(i);o.status="deleted",i.type==="directory"&&i.children?.length&&(o.children=vc(i.children,e)),n.push(o)}return n}function ww(t,e,n){return n?n(t,e):t.hash&&e.hash?t.hash===e.hash:!0}function Hr(t,e,n,i){return t.map(o=>{const r=Wp(o),s=e.get(o.path);if(s){if(o.type==="file"){const a=ww(s,o,i?.contentCompare);r.status=a?"unchanged":"modified"}else r.status="unchanged";if(o.type==="directory"&&o.children&&s.children){const a=Ed(s.children),l=Hr(o.children,a,n,i),c=Ed(l),u=vc(s.children,c);r.children=[...l,...u]}else o.type==="directory"&&o.children&&(r.children=Hr(o.children,new Map,"added",i))}else r.status=n,o.type==="directory"&&o.children?.length&&(r.children=Hr(o.children,new Map,n,i));return r.type==="directory"&&gc(r),r})}function gc(t){if(t.type!=="directory"||!t.children?.length)return;for(const n of t.children)n.type==="directory"&&gc(n);if(t.status==="added"||t.status==="deleted")return;const e=t.children.some(n=>n.status==="added"||n.status==="deleted"||n.status==="modified");t.status=e?"modified":"unchanged"}function Kp(t){const e=[...t].sort((n,i)=>n.type!==i.type?n.type==="directory"?-1:1:n.name.localeCompare(i.name));for(const n of e)n.type==="directory"&&n.children?.length&&(n.children=Kp(n.children));return e}function Sw(t,e,n){const i=new Map,o=new Map;ls(e,i),ls(t,o);const r=Hr(t,i,"added",n),s=vc(e,o),a=[...r,...s],l=n?.skipSort?a:Kp(a);for(const c of l)c.type==="directory"&&gc(c);return l}const lN=Object.freeze(Object.defineProperty({__proto__:null,NodeStatus:Hp,NodeType:qp,mergeAndMarkTree:Sw},Symbol.toStringTag,{value:"Module"})),Cw=(t,e)=>{const n=Array.isArray(e)?e:[e];let i;return V_(t)?i="string":B_(t)?i="number":H_(t)?i="boolean":q_(t)?i="array":W_(t)?i="function":K_(t)?i="symbol":Y_(t)?i="null":G_(t)?i="undefined":Q_(t)?i="object":i="undefined",n.includes(i)},cN=Object.freeze(Object.defineProperty({__proto__:null,isType:Cw},Symbol.toStringTag,{value:"Module"})),xd=/^[\^~>=<]+/,Yp=/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.]+))?(?:\+([a-zA-Z0-9.]+))?$/;function Ew(t){return Yp.test(t)}function Fn(t){if(!t||typeof t!="string")throw new Error(`Invalid version string: ${t}`);const e=t.match(xd),n=e?e[0]:"",i=t.replace(xd,"").match(Yp);if(!i)throw new Error(`Invalid semver format: ${t}`);const[,o="0",r="0",s="0",a]=i,l=parseInt(o,10),c=parseInt(r,10),u=parseInt(s,10);return{raw:t,prefix:n,major:l,minor:c,patch:u,prerelease:a||null,majorVersion:o,version:`${l}.${c}.${u}`}}function xw(t,e){const n=Fn(t),i=Fn(e);return n.major===i.major&&n.minor===i.minor&&n.patch===i.patch}function Tw(t){return Fn(t).majorVersion}function $w(t){const e={};for(const[n,i]of Object.entries(t))try{e[n]=Fn(i)}catch(o){console.warn(`Failed to parse version for ${n}: ${i}`,o)}return e}function Bi(t,e){const n=Fn(t),i=Fn(e),{VERSION_COMPARE_SAME:o,VERSION_COMPARE_LESS:r,VERSION_COMPARE_GREATER:s}=vt;return n.major!==i.major?n.major>i.major?s:r:n.minor!==i.minor?n.minor>i.minor?s:r:n.patch!==i.patch?n.patch>i.patch?s:r:o}function kw(t,e){const n=Fn(t),i=Fn(e);switch(i.prefix){case"^":return n.major===i.major;case"~":return n.major===i.major&&n.minor===i.minor;case">=":return Bi(t,e.replace(">=",""))>=0;case">":return Bi(t,e.replace(">",""))>0;case"<=":return Bi(t,e.replace("<=",""))<=0;case"<":return Bi(t,e.replace("<",""))<0;case"=":case"":return Bi(t,e.replace("=",""))===0;default:return!1}}function Ow(t){if(!t||typeof t!="string")throw new Error("版本号必须是非空字符串");const e=Fn(t),n=(a,l)=>{if(a<0||a>999)throw new Error(`版本号${l}位必须在 0-999 之间,当前值:${a}(原始输入:${t})`);return a},i=n(e.major,"主版本"),o=n(e.minor,"次版本"),r=n(e.patch,"补丁版本"),s=i*1e6+o*1e3+r;if(!Number.isSafeInteger(s))throw new Error(`版本号转换后超出 JavaScript 安全整数范围,结果:${s}(原始输入:${t})`);return s}const uN=Object.freeze(Object.defineProperty({__proto__:null,compareVersions:Bi,getMajorVersion:Tw,isVersionEqual:xw,parseDependencies:$w,parseVersion:Fn,satisfiesRange:kw,validateVersion:Ew,versionToNumber:Ow},Symbol.toStringTag,{value:"Module"})),Aw={};function Pw(t,e){return y(),ne(Kf,{name:"transition-fade",mode:"out-in",appear:""},{default:we(()=>[Ve(t.$slots,"default")]),_:3})}const Rw=dc(Aw,[["render",Pw]]),Mw={key:0,class:"fixed top-0 left-0 w-screen bg-[rgb(94,9,11)] text-white font-sans z-[99999] break-all overflow-auto max-h-[50vh] p-[10px] box-border"},Iw={class:"clear-both"},Fw={class:"whitespace-pre-wrap m-0"},Dw={key:0},Lw={class:"whitespace-pre-wrap m-0"},jw=Ce({__name:"ErrorOverlay",props:{errors:{}},setup(t){const e=H(!1),n=t,i=()=>{e.value=!1};return $e(()=>n.errors,o=>{e.value=o.length>0},{immediate:!0,deep:!0}),(o,r)=>e.value?(y(),T("div",Mw,[g("button",{class:"sticky top-[10px] right-[10px] float-right bg-white/20 border-none text-white text-lg cursor-pointer w-[30px] h-[30px] rounded-full flex items-center justify-center p-0 ml-[10px] transition-colors duration-200 hover:bg-white/30",onClick:i},"×"),g("div",Iw,[(y(!0),T(Me,null,He(t.errors,(s,a)=>(y(),T("div",{key:a,class:"mb-5"},[g("pre",Fw,L(s?.message||s),1),s?.stack?(y(),T("div",Dw,[g("pre",Lw,L(s.stack),1)])):ue("",!0)]))),128))])])):ue("",!0)}}),zw=Ce({__name:"index",props:Yf({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const{t:e}=Go(),n=t,i=te(()=>{const u={};return n.config?.column?.forEach(d=>{u[d.prop]=d.value}),u}),o=oc(t,"modelValue"),r=rc();async function s(){r?.onRefresh?.()}async function a(){n.config?.column?.forEach(u=>{u.value=""}),await Ge(),r?.onReset?.()}function l(u){return u??!0}function c(){r?.onSearch?.()}return zt(()=>{o.value=i.value}),(u,d)=>{const h=Ue("Icon");return y(),ne(m(sl),{inline:!0,onSubmit:d[3]||(d[3]=Ye(()=>{},["prevent"])),onKeyup:d[4]||(d[4]=ho(v=>c(),["enter"]))},{default:we(()=>[(y(!0),T(Me,null,He(t.config?.column||[],(v,p)=>(y(),ne(m(Du),{key:p,label:m(v.label)??""},{default:we(()=>[l(v.useVModel)?(y(),ne($t(v.component),We({key:1,modelValue:v.value,"onUpdate:modelValue":f=>v.value=f},{ref_for:!0},v?.attributes||{},bn(v?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(y(),ne($t(v.component),We({key:0,"model-value":v.value},{ref_for:!0},v?.attributes||{},bn(v?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),t.config?.column?.length?(y(),ne(m(Du),{key:0},{default:we(()=>[j(m(Qi),{type:"success",onClick:d[0]||(d[0]=v=>c())},{default:we(()=>[Ke(L(m(e)("common.search")),1)]),_:1}),j(m(Qi),{type:"primary",onClick:d[1]||(d[1]=v=>a())},{default:we(()=>[Ke(L(m(e)("common.reset")),1)]),_:1}),j(m(Qi),{onClick:d[2]||(d[2]=v=>s())},{default:we(()=>[j(h,{icon:"material-symbols:refresh-rounded"})]),_:1})]),_:1})):ue("",!0)]),_:1})}}}),Nw={key:0},Uw={ref:"tableContainer",class:"flex-1 overflow-hidden"},Vw={key:1,class:"mt-2"},Bw=Ce({__name:"index",props:{tableConfig:{}},setup(t,{expose:e}){const n=rc(),i=t,o=Mn("tableContainer"),r=Mn("table"),{height:s}=lc(o),a=w_(),l=te(()=>{if(i.tableConfig?.pagination?.getPageSize||i.tableConfig?.pagination?.setPageSize)return{get:i.tableConfig.pagination.getPageSize,set:i.tableConfig.pagination.setPageSize};const M=Hw().paginationStorage;return M?{get:()=>{const A=M.get();return A?Number(A):10},set:A=>M.set(String(A))}:null}),c=H(l.value?.get?.()??10),u=H(!1),d=H(1),h=H(F()),v=H("UNKNOWN"),p=te(()=>Object.keys(a)),f=te(()=>i.tableConfig.size??"default"),_=te(()=>i.tableConfig?.fixedHeight??!0),C=te(()=>_.value?Math.max(s.value,100):"auto"),w=te(()=>i.tableConfig?.autoLoading??!0),S=te(()=>({"--pagination-location":i.tableConfig?.pagination?.location||"center"})),b=te(()=>i.tableConfig?.isPagination??!0),E=te(()=>i.tableConfig?.paginationMap?i.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),x=te(()=>({[E.value.page]:d.value,[E.value.pageSize]:c.value})),O=te(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...i.tableConfig?.pagination?.attributes,total:i.tableConfig?.pagination?.total||0,pageSize:c.value,currentPage:d.value})),$=te(()=>({...x.value,...h.value})),K=te(()=>i.tableConfig?.search?.column.filter(M=>M.autoQuery??!0).map(M=>M.prop));function F(){const M={};return i.tableConfig?.search?.column?.forEach(A=>{M[A.prop]=A.value}),M}async function P(){v.value!=="NOT_CHANGE"&&(w.value&&(u.value=!0),i.tableConfig?.fetchData?.($.value)?.finally(()=>{v.value="NOT_CHANGE",u.value=!1}))}async function N(){await P()}async function I(){v.value="UNKNOWN",await P()}async function q(){d.value=1,v.value!=="AUTO_QUERY"&&await P()}async function le(M){d.value=1,c.value=M}async function de(M){d.value=M}function Y(){v.value="UNKNOWN",P()}return $e(()=>JSON.stringify(h.value),(M,A)=>{v.value="UNKNOWN";const Q=JSON.parse(M??"{}"),U=JSON.parse(A??"{}"),ie=Object.keys(Q),ve=Object.keys(U);let re=[];ie.length===ve.length?re=Object.keys(Q).filter(ge=>Q[ge]!==U[ge]):re=ey(ie,ve),K.value?.length&&ty(re,[...K.value]).length&&(v.value="AUTO_QUERY",P())}),$e(()=>JSON.stringify(x.value),()=>{v.value="UNKNOWN",P()}),zt(()=>{l.value?.set?.(c.value)}),et(()=>{P()}),e({getTableRef:()=>r.value,forceRefreshData:Y}),(M,A)=>{const Q=Xf;return it((y(),T("div",{class:"w-full h-full flex flex-col overflow-hidden",style:At(S.value)},[t.tableConfig.search?(y(),T("div",Nw,[Ve(M.$slots,"search",{},()=>[j(zw,{modelValue:h.value,"onUpdate:modelValue":A[0]||(A[0]=U=>h.value=U),config:t.tableConfig.search,size:f.value,onSearch:N,onRefresh:I,onReset:q},null,8,["modelValue","config","size"])],!0)])):ue("",!0),Ve(M.$slots,"tableBefore",{},void 0,!0),g("div",Uw,[Ve(M.$slots,"table",{},()=>[j(m(J_),We({ref:"table",size:f.value,data:t.tableConfig.data,height:C.value},m(n)),S_({default:we(()=>[(y(!0),T(Me,null,He(t.tableConfig.column,(U,ie)=>(y(),T(Me,null,[U.slot?Ve(M.$slots,U.slot,{key:0,col:U,index:ie},void 0,!0):(y(),ne(m(X_),We({key:`default-${ie}`},{ref_for:!0},U),null,16))],64))),256))]),_:2},[He(p.value,U=>({name:U,fn:we(ie=>[Ve(M.$slots,U,wn(Jn(ie)),void 0,!0)])}))]),1040,["size","data","height"])],!0)],512),b.value?(y(),T("div",Vw,[Ve(M.$slots,"pagination",{},()=>[j(m(Z_),We({size:f.value},O.value,{onSizeChange:le,onCurrentChange:de},bn(t.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):ue("",!0)],4)),[[Q,u.value]])}}}),Td=dc(Bw,[["__scopeId","data-v-f1bc3c2f"]]);let pl={};const Hw=()=>pl,qw={...Td,install(t,e){e&&(pl={...pl,...e}),t.component("BaseTable",Td)}},Ww={class:"overflow-hidden size-full"},Kw=Ce({__name:"Main",setup(t){const e=Jo(),n=new Map,i=te(()=>e.visitedViews.map(s=>o(s)));function o(s){const{path:a}=s,{[vt.ROUTE_STATE_KEY_VERSION]:l}=s.query;return l?`${a}?${vt.ROUTE_STATE_KEY_VERSION}=${l}`:a}function r(s,a){const l=o(a);if(!n.has(l)){const c=Ce({name:l,setup(){return()=>Ao(s)}});n.set(l,c)}return n.get(l)}return $e(()=>i.value,(s,a)=>{const l=a.filter(c=>!s.includes(c));l.length&&n.delete(l[0])},{deep:!0}),(s,a)=>{const l=Ue("router-view");return y(),T("div",Ww,[j(l,null,{default:we(({Component:c,route:u})=>[j(m(Rw),null,{default:we(()=>[(y(),ne(C_,{include:i.value},[(y(),ne($t(r(c,u))))],1032,["include"]))]),_:2},1024)]),_:1})])}}});var ca,$d;function Yw(){if($d)return ca;$d=1;function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function e(o,r){for(var s="",a=0,l=-1,c=0,u,d=0;d<=o.length;++d){if(d<o.length)u=o.charCodeAt(d);else{if(u===47)break;u=47}if(u===47){if(!(l===d-1||c===1))if(l!==d-1&&c===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",a=0):(s=s.slice(0,h),a=s.length-1-s.lastIndexOf("/")),l=d,c=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,c=0;continue}}r&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(l+1,d):s=o.slice(l+1,d),a=d-l-1;l=d,c=0}else u===46&&c!==-1?++c:c=-1}return s}function n(o,r){var s=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+a:s+o+a:a}var i={resolve:function(){for(var r="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=process.cwd()),c=a),t(c),c.length!==0&&(r=c+"/"+r,s=c.charCodeAt(0)===47)}return r=e(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(t(r),r.length===0)return".";var s=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=e(r,!s),r.length===0&&!s&&(r="."),r.length>0&&a&&(r+="/"),s?"/"+r:r},isAbsolute:function(r){return t(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,s=0;s<arguments.length;++s){var a=arguments[s];t(a),a.length>0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":i.normalize(r)},relative:function(r,s){if(t(r),t(s),r===s||(r=i.resolve(r),s=i.resolve(s),r===s))return"";for(var a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var l=r.length,c=l-a,u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,h=d-u,v=c<h?c:h,p=-1,f=0;f<=v;++f){if(f===v){if(h>v){if(s.charCodeAt(u+f)===47)return s.slice(u+f+1);if(f===0)return s.slice(u+f)}else c>v&&(r.charCodeAt(a+f)===47?p=f:f===0&&(p=0));break}var _=r.charCodeAt(a+f),C=s.charCodeAt(u+f);if(_!==C)break;_===47&&(p=f)}var w="";for(f=a+p+1;f<=l;++f)(f===l||r.charCodeAt(f)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+s.slice(u+p):(u+=p,s.charCodeAt(u)===47&&++u,s.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(t(r),r.length===0)return".";for(var s=r.charCodeAt(0),a=s===47,l=-1,c=!0,u=r.length-1;u>=1;--u)if(s=r.charCodeAt(u),s===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":r.slice(0,l)},basename:function(r,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(r);var a=0,l=-1,c=!0,u;if(s!==void 0&&s.length>0&&s.length<=r.length){if(s.length===r.length&&s===r)return"";var d=s.length-1,h=-1;for(u=r.length-1;u>=0;--u){var v=r.charCodeAt(u);if(v===47){if(!c){a=u+1;break}}else h===-1&&(c=!1,h=u+1),d>=0&&(v===s.charCodeAt(d)?--d===-1&&(l=u):(d=-1,l=h))}return a===l?l=h:l===-1&&(l=r.length),r.slice(a,l)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":r.slice(a,l)}},extname:function(r){t(r);for(var s=-1,a=0,l=-1,c=!0,u=0,d=r.length-1;d>=0;--d){var h=r.charCodeAt(d);if(h===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),h===46?s===-1?s=d:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===a+1?"":r.slice(s,l)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return n("/",r)},parse:function(r){t(r);var s={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return s;var a=r.charCodeAt(0),l=a===47,c;l?(s.root="/",c=1):c=0;for(var u=-1,d=0,h=-1,v=!0,p=r.length-1,f=0;p>=c;--p){if(a=r.charCodeAt(p),a===47){if(!v){d=p+1;break}continue}h===-1&&(v=!1,h=p+1),a===46?u===-1?u=p:f!==1&&(f=1):u!==-1&&(f=-1)}return u===-1||h===-1||f===0||f===1&&u===h-1&&u===d+1?h!==-1&&(d===0&&l?s.base=s.name=r.slice(1,h):s.base=s.name=r.slice(d,h)):(d===0&&l?(s.name=r.slice(1,u),s.base=r.slice(1,h)):(s.name=r.slice(d,u),s.base=r.slice(d,h)),s.ext=r.slice(u,h)),d>0?s.dir=r.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,ca=i,ca}var Gw=Yw();const Qw=Li(Gw);function _c(){const{t}=Go();return{getTitle:n=>n?n.includes(".")&&!n.startsWith("http")?t(n):n:""}}const Xw={class:"truncate"},Jw=Ce({__name:"MenuItem",props:{route:{},fullPath:{}},setup(t){const{getTitle:e}=_c(),n=ws(),i=t;function o(){n.push({path:i.fullPath})}return(r,s)=>{const a=Ro,l=ny;return y(),T("span",{onClick:o},[j(l,{index:t.fullPath},{title:we(()=>[g("span",Xw,L(m(e)(t.route.meta?.title)),1)]),default:we(()=>[j(a,null,{default:we(()=>[(y(),ne($t(t.route.meta?.icon)))]),_:1})]),_:1},8,["index"])])}}});function Gp(t,e){return function(){return t.apply(e,arguments)}}const{toString:Zw}=Object.prototype,{getPrototypeOf:ks}=Object,{iterator:Os,toStringTag:Qp}=Symbol,As=(t=>e=>{const n=Zw.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cn=t=>(t=t.toLowerCase(),e=>As(e)===t),Ps=t=>e=>typeof e===t,{isArray:fo}=Array,to=Ps("undefined");function Zo(t){return t!==null&&!to(t)&&t.constructor!==null&&!to(t.constructor)&&Ht(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Xp=Cn("ArrayBuffer");function e1(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Xp(t.buffer),e}const t1=Ps("string"),Ht=Ps("function"),Jp=Ps("number"),er=t=>t!==null&&typeof t=="object",n1=t=>t===!0||t===!1,qr=t=>{if(As(t)!=="object")return!1;const e=ks(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Qp in t)&&!(Os in t)},i1=t=>{if(!er(t)||Zo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},o1=Cn("Date"),r1=Cn("File"),s1=t=>!!(t&&typeof t.uri<"u"),a1=t=>t&&typeof t.getParts<"u",l1=Cn("Blob"),c1=Cn("FileList"),u1=t=>er(t)&&Ht(t.pipe);function d1(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const kd=d1(),Od=typeof kd.FormData<"u"?kd.FormData:void 0,h1=t=>{if(!t)return!1;if(Od&&t instanceof Od)return!0;const e=ks(t);if(!e||e===Object.prototype||!Ht(t.append))return!1;const n=As(t);return n==="formdata"||n==="object"&&Ht(t.toString)&&t.toString()==="[object FormData]"},f1=Cn("URLSearchParams"),[p1,m1,v1,g1]=["ReadableStream","Request","Response","Headers"].map(Cn),_1=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tr(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,o;if(typeof t!="object"&&(t=[t]),fo(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(Zo(t))return;const r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length;let a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function Zp(t,e){if(Zo(t))return null;e=e.toLowerCase();const n=Object.keys(t);let i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}const Ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,em=t=>!to(t)&&t!==Ti;function ml(){const{caseless:t,skipUndefined:e}=em(this)&&this||{},n={},i=(o,r)=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;const s=t&&Zp(n,r)||r;qr(n[s])&&qr(o)?n[s]=ml(n[s],o):qr(o)?n[s]=ml({},o):fo(o)?n[s]=o.slice():(!e||!to(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&tr(arguments[o],i);return n}const y1=(t,e,n,{allOwnKeys:i}={})=>(tr(e,(o,r)=>{n&&Ht(o)?Object.defineProperty(t,r,{value:Gp(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),t),b1=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),w1=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},S1=(t,e,n,i)=>{let o,r,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&ks(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},C1=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},E1=t=>{if(!t)return null;if(fo(t))return t;let e=t.length;if(!Jp(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},x1=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ks(Uint8Array)),T1=(t,e)=>{const i=(t&&t[Os]).call(t);let o;for(;(o=i.next())&&!o.done;){const r=o.value;e.call(t,r[0],r[1])}},$1=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},k1=Cn("HTMLFormElement"),O1=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),Ad=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),A1=Cn("RegExp"),tm=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};tr(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},P1=t=>{tm(t,(e,n)=>{if(Ht(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Ht(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},R1=(t,e)=>{const n={},i=o=>{o.forEach(r=>{n[r]=!0})};return fo(t)?i(t):i(String(t).split(e)),n},M1=()=>{},I1=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function F1(t){return!!(t&&Ht(t.append)&&t[Qp]==="FormData"&&t[Os])}const D1=t=>{const e=new Array(10),n=(i,o)=>{if(er(i)){if(e.indexOf(i)>=0)return;if(Zo(i))return i;if(!("toJSON"in i)){e[o]=i;const r=fo(i)?[]:{};return tr(i,(s,a)=>{const l=n(s,o+1);!to(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},L1=Cn("AsyncFunction"),j1=t=>t&&(er(t)||Ht(t))&&Ht(t.then)&&Ht(t.catch),nm=((t,e)=>t?setImmediate:e?((n,i)=>(Ti.addEventListener("message",({source:o,data:r})=>{o===Ti&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),Ti.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ht(Ti.postMessage)),z1=typeof queueMicrotask<"u"?queueMicrotask.bind(Ti):typeof process<"u"&&process.nextTick||nm,N1=t=>t!=null&&Ht(t[Os]),W={isArray:fo,isArrayBuffer:Xp,isBuffer:Zo,isFormData:h1,isArrayBufferView:e1,isString:t1,isNumber:Jp,isBoolean:n1,isObject:er,isPlainObject:qr,isEmptyObject:i1,isReadableStream:p1,isRequest:m1,isResponse:v1,isHeaders:g1,isUndefined:to,isDate:o1,isFile:r1,isReactNativeBlob:s1,isReactNative:a1,isBlob:l1,isRegExp:A1,isFunction:Ht,isStream:u1,isURLSearchParams:f1,isTypedArray:x1,isFileList:c1,forEach:tr,merge:ml,extend:y1,trim:_1,stripBOM:b1,inherits:w1,toFlatObject:S1,kindOf:As,kindOfTest:Cn,endsWith:C1,toArray:E1,forEachEntry:T1,matchAll:$1,isHTMLForm:k1,hasOwnProperty:Ad,hasOwnProp:Ad,reduceDescriptors:tm,freezeMethods:P1,toObjectSet:R1,toCamelCase:O1,noop:M1,toFiniteNumber:I1,findKey:Zp,global:Ti,isContextDefined:em,isSpecCompliantForm:F1,toJSONObject:D1,isAsyncFn:L1,isThenable:j1,setImmediate:nm,asap:z1,isIterable:N1};let De=class im extends Error{static from(e,n,i,o,r,s){const a=new im(e.message,n||e.code,i,o,r);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),s&&Object.assign(a,s),a}constructor(e,n,i,o,r){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.status}}};De.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";De.ERR_BAD_OPTION="ERR_BAD_OPTION";De.ECONNABORTED="ECONNABORTED";De.ETIMEDOUT="ETIMEDOUT";De.ERR_NETWORK="ERR_NETWORK";De.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";De.ERR_DEPRECATED="ERR_DEPRECATED";De.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";De.ERR_BAD_REQUEST="ERR_BAD_REQUEST";De.ERR_CANCELED="ERR_CANCELED";De.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";De.ERR_INVALID_URL="ERR_INVALID_URL";De.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const U1=null;function vl(t){return W.isPlainObject(t)||W.isArray(t)}function om(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function ua(t,e,n){return t?t.concat(e).map(function(o,r){return o=om(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function V1(t){return W.isArray(t)&&!t.some(vl)}const B1=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});function Rs(t,e,n){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,C){return!W.isUndefined(C[_])});const i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,l=n.maxDepth===void 0?100:n.maxDepth,c=a&&W.isSpecCompliantForm(e);if(!W.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(W.isDate(f))return f.toISOString();if(W.isBoolean(f))return f.toString();if(!c&&W.isBlob(f))throw new De("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(f)||W.isTypedArray(f)?c&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,_,C){let w=f;if(W.isReactNative(e)&&W.isReactNativeBlob(f))return e.append(ua(C,_,r),u(f)),!1;if(f&&!C&&typeof f=="object"){if(W.endsWith(_,"{}"))_=i?_:_.slice(0,-2),f=JSON.stringify(f);else if(W.isArray(f)&&V1(f)||(W.isFileList(f)||W.endsWith(_,"[]"))&&(w=W.toArray(f)))return _=om(_),w.forEach(function(b,E){!(W.isUndefined(b)||b===null)&&e.append(s===!0?ua([_],E,r):s===null?_:_+"[]",u(b))}),!1}return vl(f)?!0:(e.append(ua(C,_,r),u(f)),!1)}const h=[],v=Object.assign(B1,{defaultVisitor:d,convertValue:u,isVisitable:vl});function p(f,_,C=0){if(!W.isUndefined(f)){if(C>l)throw new De("Object is too deeply nested ("+C+" levels). Max depth: "+l,De.ERR_FORM_DATA_DEPTH_EXCEEDED);if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(f),W.forEach(f,function(S,b){(!(W.isUndefined(S)||S===null)&&o.call(e,S,W.isString(b)?b.trim():b,_,v))===!0&&p(S,_?_.concat(b):[b],C+1)}),h.pop()}}if(!W.isObject(t))throw new TypeError("data must be an object");return p(t),e}function Pd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(i){return e[i]})}function yc(t,e){this._pairs=[],t&&Rs(t,this,e)}const rm=yc.prototype;rm.append=function(e,n){this._pairs.push([e,n])};rm.toString=function(e){const n=e?function(i){return e.call(this,i,Pd)}:Pd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function H1(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sm(t,e,n){if(!e)return t;const i=n&&n.encode||H1,o=W.isFunction(n)?{serialize:n}:n,r=o&&o.serialize;let s;if(r?s=r(e,o):s=W.isURLSearchParams(e)?e.toString():new yc(e,o).toString(i),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Rd{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(i){i!==null&&e(i)})}}const bc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},q1=typeof URLSearchParams<"u"?URLSearchParams:yc,W1=typeof FormData<"u"?FormData:null,K1=typeof Blob<"u"?Blob:null,Y1={isBrowser:!0,classes:{URLSearchParams:q1,FormData:W1,Blob:K1},protocols:["http","https","file","blob","url","data"]},wc=typeof window<"u"&&typeof document<"u",gl=typeof navigator=="object"&&navigator||void 0,G1=wc&&(!gl||["ReactNative","NativeScript","NS"].indexOf(gl.product)<0),Q1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",X1=wc&&window.location.href||"http://localhost",J1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:wc,hasStandardBrowserEnv:G1,hasStandardBrowserWebWorkerEnv:Q1,navigator:gl,origin:X1},Symbol.toStringTag,{value:"Module"})),Ot={...J1,...Y1};function Z1(t,e){return Rs(t,new Ot.classes.URLSearchParams,{visitor:function(n,i,o,r){return Ot.isNode&&W.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}function eS(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function tS(t){const e={},n=Object.keys(t);let i;const o=n.length;let r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function am(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=r>=n.length;return s=!s&&W.isArray(o)?o.length:s,l?(W.hasOwnProp(o,s)?o[s]=W.isArray(o[s])?o[s].concat(i):[o[s],i]:o[s]=i,!a):((!o[s]||!W.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&W.isArray(o[s])&&(o[s]=tS(o[s])),!a)}if(W.isFormData(t)&&W.isFunction(t.entries)){const n={};return W.forEachEntry(t,(i,o)=>{e(eS(i),o,n,0)}),n}return null}const zi=(t,e)=>t!=null&&W.hasOwnProp(t,e)?t[e]:void 0;function nS(t,e,n){if(W.isString(t))try{return(e||JSON.parse)(t),W.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const nr={transitional:bc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=W.isObject(e);if(r&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return o?JSON.stringify(am(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){const l=zi(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return Z1(e,l).toString();if((a=W.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=zi(this,"env"),u=c&&c.FormData;return Rs(a?{"files[]":e}:e,u&&new u,l)}}return r||o?(n.setContentType("application/json",!1),nS(e)):e}],transformResponse:[function(e){const n=zi(this,"transitional")||nr.transitional,i=n&&n.forcedJSONParsing,o=zi(this,"responseType"),r=o==="json";if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(i&&!o||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,zi(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?De.from(l,De.ERR_BAD_RESPONSE,this,null,zi(this,"response")):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{nr.headers[t]={}});const iS=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oS=t=>{const e={};let n,i,o;return t&&t.split(`
4
- `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&iS[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},Md=Symbol("internals"),rS=/[^\x09\x20-\x7E\x80-\xFF]/g;function sS(t){let e=0,n=t.length;for(;e<n;){const i=t.charCodeAt(e);if(i!==9&&i!==32)break;e+=1}for(;n>e;){const i=t.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return e===0&&n===t.length?t:t.slice(e,n)}function bo(t){return t&&String(t).trim().toLowerCase()}function aS(t){return sS(t.replace(rS,""))}function Wr(t){return t===!1||t==null?t:W.isArray(t)?t.map(Wr):aS(String(t))}function lS(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const cS=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function da(t,e,n,i,o){if(W.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!W.isString(e)){if(W.isString(i))return e.indexOf(i)!==-1;if(W.isRegExp(i))return i.test(e)}}function uS(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function dS(t,e){const n=W.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}let qt=class{constructor(e){e&&this.set(e)}set(e,n,i){const o=this;function r(a,l,c){const u=bo(l);if(!u)throw new Error("header name must be a non-empty string");const d=W.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=Wr(a))}const s=(a,l)=>W.forEach(a,(c,u)=>r(c,u,l));if(W.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(W.isString(e)&&(e=e.trim())&&!cS(e))s(oS(e),n);else if(W.isObject(e)&&W.isIterable(e)){let a={},l,c;for(const u of e){if(!W.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?W.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=bo(e),e){const i=W.findKey(this,e);if(i){const o=this[i];if(!n)return o;if(n===!0)return lS(o);if(W.isFunction(n))return n.call(this,o,i);if(W.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=bo(e),e){const i=W.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||da(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let o=!1;function r(s){if(s=bo(s),s){const a=W.findKey(i,s);a&&(!n||da(i,i[a],a,n))&&(delete i[a],o=!0)}}return W.isArray(e)?e.forEach(r):r(e),o}clear(e){const n=Object.keys(this);let i=n.length,o=!1;for(;i--;){const r=n[i];(!e||da(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){const n=this,i={};return W.forEach(this,(o,r)=>{const s=W.findKey(i,r);if(s){n[s]=Wr(o),delete n[r];return}const a=e?uS(r):String(r).trim();a!==r&&delete n[r],n[a]=Wr(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return W.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&W.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
5
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){const i=(this[Md]=this[Md]={accessors:{}}).accessors,o=this.prototype;function r(s){const a=bo(s);i[a]||(dS(o,s),i[a]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}};qt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(qt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});W.freezeMethods(qt);function ha(t,e){const n=this||nr,i=e||n,o=qt.from(i.headers);let r=i.data;return W.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function lm(t){return!!(t&&t.__CANCEL__)}let ir=class extends De{constructor(e,n,i){super(e??"canceled",De.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function cm(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new De("Request failed with status code "+n.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function hS(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function fS(t,e){t=t||10;const n=new Array(t),i=new Array(t);let o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[r];s||(s=c),n[o]=l,i[o]=c;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-s<e)return;const v=u&&c-u;return v?Math.round(h*1e3/v):void 0}}function pS(t,e){let n=0,i=1e3/e,o,r;const s=(c,u=Date.now())=>{n=u,o=null,r&&(clearTimeout(r),r=null),t(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=i?s(c,u):(o=c,r||(r=setTimeout(()=>{r=null,s(o)},i-d)))},()=>o&&s(o)]}const cs=(t,e,n=3)=>{let i=0;const o=fS(50,250);return pS(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,l=a!=null?Math.min(s,a):s,c=Math.max(0,l-i),u=o(c);i=Math.max(i,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},Id=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Fd=t=>(...e)=>W.asap(()=>t(...e)),mS=Ot.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ot.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ot.origin),Ot.navigator&&/(msie|trident)/i.test(Ot.navigator.userAgent)):()=>!0,vS=Ot.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];W.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),W.isString(i)&&a.push(`path=${i}`),W.isString(o)&&a.push(`domain=${o}`),r===!0&&a.push("secure"),W.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function gS(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function _S(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function um(t,e,n){let i=!gS(e);return t&&(i||n===!1)?_S(t,e):e}const Dd=t=>t instanceof qt?{...t}:t;function Ii(t,e){e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,u,d,h){return W.isPlainObject(c)&&W.isPlainObject(u)?W.merge.call({caseless:h},c,u):W.isPlainObject(u)?W.merge({},u):W.isArray(u)?u.slice():u}function o(c,u,d,h){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function r(c,u){if(!W.isUndefined(u))return i(void 0,u)}function s(c,u){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(W.hasOwnProp(e,d))return i(c,u);if(W.hasOwnProp(t,d))return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:a,headers:(c,u,d)=>o(Dd(c),Dd(u),d,!0)};return W.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=W.hasOwnProp(l,u)?l[u]:o,h=W.hasOwnProp(t,u)?t[u]:void 0,v=W.hasOwnProp(e,u)?e[u]:void 0,p=d(h,v,u);W.isUndefined(p)&&d!==a||(n[u]=p)}),n}const dm=t=>{const e=Ii({},t),n=h=>W.hasOwnProp(e,h)?e[h]:void 0,i=n("data");let o=n("withXSRFToken");const r=n("xsrfHeaderName"),s=n("xsrfCookieName");let a=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(e.headers=a=qt.from(a),e.url=sm(um(c,d,u),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),W.isFormData(i)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(W.isFunction(i.getHeaders)){const h=i.getHeaders(),v=["content-type","content-length"];Object.entries(h).forEach(([p,f])=>{v.includes(p.toLowerCase())&&a.set(p,f)})}}if(Ot.hasStandardBrowserEnv&&(W.isFunction(o)&&(o=o(e)),o===!0||o==null&&mS(e.url))){const v=r&&s&&vS.read(s);v&&a.set(r,v)}return e},yS=typeof XMLHttpRequest<"u",bS=yS&&function(t){return new Promise(function(n,i){const o=dm(t);let r=o.data;const s=qt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,v,p;function f(){v&&v(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function C(){if(!_)return;const S=qt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:S,config:t,request:_};cm(function(O){n(O),f()},function(O){i(O),f()},E),_=null}"onloadend"in _?_.onloadend=C:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(C)},_.onabort=function(){_&&(i(new De("Request aborted",De.ECONNABORTED,t,_)),_=null)},_.onerror=function(b){const E=b&&b.message?b.message:"Network Error",x=new De(E,De.ERR_NETWORK,t,_);x.event=b||null,i(x),_=null},_.ontimeout=function(){let b=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||bc;o.timeoutErrorMessage&&(b=o.timeoutErrorMessage),i(new De(b,E.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,_)),_=null},r===void 0&&s.setContentType(null),"setRequestHeader"in _&&W.forEach(s.toJSON(),function(b,E){_.setRequestHeader(E,b)}),W.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([h,p]=cs(c,!0),_.addEventListener("progress",h)),l&&_.upload&&([d,v]=cs(l),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",v)),(o.cancelToken||o.signal)&&(u=S=>{_&&(i(!S||S.type?new ir(null,t,_):S),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const w=hS(o.url);if(w&&Ot.protocols.indexOf(w)===-1){i(new De("Unsupported protocol "+w+":",De.ERR_BAD_REQUEST,t));return}_.send(r||null)})},wS=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o;const r=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof De?u:new ir(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,r(new De(`timeout of ${e}ms exceeded`,De.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),t=null)};t.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>W.asap(a),l}},SS=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},CS=async function*(t,e){for await(const n of ES(t))yield*SS(n,e)},ES=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Ld=(t,e,n,i)=>{const o=CS(t,e);let r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},jd=64*1024,{isFunction:_r}=W,xS=(({Request:t,Response:e})=>({Request:t,Response:e}))(W.global),{ReadableStream:zd,TextEncoder:Nd}=W.global,Ud=(t,...e)=>{try{return!!t(...e)}catch{return!1}},TS=t=>{t=W.merge.call({skipUndefined:!0},xS,t);const{fetch:e,Request:n,Response:i}=t,o=e?_r(e):typeof fetch=="function",r=_r(n),s=_r(i);if(!o)return!1;const a=o&&_r(zd),l=o&&(typeof Nd=="function"?(p=>f=>p.encode(f))(new Nd):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=r&&a&&Ud(()=>{let p=!1;const f=new n(Ot.origin,{body:new zd,method:"POST",get duplex(){return p=!0,"half"}}),_=f.headers.has("Content-Type");return f.body!=null&&f.body.cancel(),p&&!_}),u=s&&a&&Ud(()=>W.isReadableStream(new i("").body)),d={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(f,_)=>{let C=f&&f[p];if(C)return C.call(f);throw new De(`Response type '${p}' is not supported`,De.ERR_NOT_SUPPORT,_)})});const h=async p=>{if(p==null)return 0;if(W.isBlob(p))return p.size;if(W.isSpecCompliantForm(p))return(await new n(Ot.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(W.isArrayBufferView(p)||W.isArrayBuffer(p))return p.byteLength;if(W.isURLSearchParams(p)&&(p=p+""),W.isString(p))return(await l(p)).byteLength},v=async(p,f)=>{const _=W.toFiniteNumber(p.getContentLength());return _??h(f)};return async p=>{let{url:f,method:_,data:C,signal:w,cancelToken:S,timeout:b,onDownloadProgress:E,onUploadProgress:x,responseType:O,headers:$,withCredentials:K="same-origin",fetchOptions:F}=dm(p),P=e||fetch;O=O?(O+"").toLowerCase():"text";let N=wS([w,S&&S.toAbortSignal()],b),I=null;const q=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let le;try{if(x&&c&&_!=="get"&&_!=="head"&&(le=await v($,C))!==0){let U=new n(f,{method:"POST",body:C,duplex:"half"}),ie;if(W.isFormData(C)&&(ie=U.headers.get("content-type"))&&$.setContentType(ie),U.body){const[ve,re]=Id(le,cs(Fd(x)));C=Ld(U.body,jd,ve,re)}}W.isString(K)||(K=K?"include":"omit");const de=r&&"credentials"in n.prototype;if(W.isFormData(C)){const U=$.getContentType();U&&/^multipart\/form-data/i.test(U)&&!/boundary=/i.test(U)&&$.delete("content-type")}const Y={...F,signal:N,method:_.toUpperCase(),headers:$.normalize().toJSON(),body:C,duplex:"half",credentials:de?K:void 0};I=r&&new n(f,Y);let M=await(r?P(I,F):P(f,Y));const A=u&&(O==="stream"||O==="response");if(u&&(E||A&&q)){const U={};["status","statusText","headers"].forEach(ge=>{U[ge]=M[ge]});const ie=W.toFiniteNumber(M.headers.get("content-length")),[ve,re]=E&&Id(ie,cs(Fd(E),!0))||[];M=new i(Ld(M.body,jd,ve,()=>{re&&re(),q&&q()}),U)}O=O||"text";let Q=await d[W.findKey(d,O)||"text"](M,p);return!A&&q&&q(),await new Promise((U,ie)=>{cm(U,ie,{data:Q,headers:qt.from(M.headers),status:M.status,statusText:M.statusText,config:p,request:I})})}catch(de){throw q&&q(),de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)?Object.assign(new De("Network Error",De.ERR_NETWORK,p,I,de&&de.response),{cause:de.cause||de}):De.from(de,de&&de.code,p,I,de&&de.response)}}},$S=new Map,hm=t=>{let e=t&&t.env||{};const{fetch:n,Request:i,Response:o}=e,r=[i,o,n];let s=r.length,a=s,l,c,u=$S;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:TS(e)),u=c;return c};hm();const Sc={http:U1,xhr:bS,fetch:{get:hm}};W.forEach(Sc,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Vd=t=>`- ${t}`,kS=t=>W.isFunction(t)||t===null||t===!1;function OS(t,e){t=W.isArray(t)?t:[t];const{length:n}=t;let i,o;const r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!kS(i)&&(o=Sc[(a=String(i)).toLowerCase()],o===void 0))throw new De(`Unknown adapter '${a}'`);if(o&&(W.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){const s=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
6
- `+s.map(Vd).join(`
7
- `):" "+Vd(s[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const fm={getAdapter:OS,adapters:Sc};function fa(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ir(null,t)}function Bd(t){return fa(t),t.headers=qt.from(t.headers),t.data=ha.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),fm.getAdapter(t.adapter||nr.adapter,t)(t).then(function(i){return fa(t),i.data=ha.call(t,t.transformResponse,i),i.headers=qt.from(i.headers),i},function(i){return lm(i)||(fa(t),i&&i.response&&(i.response.data=ha.call(t,t.transformResponse,i.response),i.response.headers=qt.from(i.response.headers))),Promise.reject(i)})}const pm="1.15.2",Ms={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ms[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const Hd={};Ms.transitional=function(e,n,i){function o(r,s){return"[Axios v"+pm+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new De(o(s," has been removed"+(n?" in "+n:"")),De.ERR_DEPRECATED);return n&&!Hd[s]&&(Hd[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};Ms.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function AS(t,e,n){if(typeof t!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let o=i.length;for(;o-- >0;){const r=i[o],s=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0;if(s){const a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new De("option "+r+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new De("Unknown option "+r,De.ERR_BAD_OPTION)}}const Kr={assertOptions:AS,validators:Ms},rn=Kr.validators;let Oi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Rd,response:new Rd}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const r=(()=>{if(!o.stack)return"";const s=o.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-dhG9Kj5W.js","./vendor-ui-DXwyveTF.js","./vendor-core-CzvSW5ae.js","./LoadingWrapper.vue_vue_type_script_setup_true_lang-bBtkKtmz.js","./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js","./BaseDialog.vue_vue_type_script_setup_true_lang-CgV6_zzd.js","./el-dropdown-item-BeIfAqTO.css","./el-card-BAyktVMS.css","./index-DxG4_1zN.js","./index.vue_vue_type_script_setup_true_lang-RJnk970E.js","./useCacheOssStore-DApHt9lQ.js","./index-DOlF0Z_P.css","./index.vue_vue_type_script_setup_true_lang-DX9EV5b8.js","./index-Cqi9_pkc.js","./index-B78Rw6nE.css","./useVscodeOpen-Dx3IRL0P.js","./index-0Y9kW7YJ.js","./index-8dCw6Y2Z.css","./el-link-CPQZ-olG.css","./index-DyEkv8OS.js","./md5-DzJRYP5-.js","./AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-C2LcEFL4.js","./CanvasAnimation.vue_vue_type_script_setup_true_lang-BVY2XxV8.js","./index-DoTR7Juh.css","./index-ByKMTPW3.js","./core-B1GcTOER.js","./index-Dt73qBZB.css","./el-empty-S7fQQ3B8.css","./index-DI0kvKsV.js","./index.vue_vue_type_style_index_0_lang-BQWxY2F1.js","./index-Dj51p5I8.css","./index-DW-M9dmc.js","./index-CEQStqDa.js","./index.vue_vue_type_script_setup_true_lang-rk3Yu4M8.js","./useMessage-CYVXvlqq.js","./index-DANPdG90.js","./useCompMetaLocalStore-eE-CBcE9.js","./index.vue_vue_type_script_setup_true_lang-DM_Wm4GD.js","./index-DUr8uU-d.js","./el-table-column-8qfe8CVK.js","./el-table-column-B3ZEEuPD.css","./index.vue_vue_type_style_index_0_lang-xD-wMtaK.js","./vendor-xterm-DbWxaMay.js","./index-Bn5vi5XZ.css","./index.vue_vue_type_script_setup_true_lang-B_VrULUy.js","./index.vue_vue_type_script_setup_true_lang-D3xHCy9f.js","./useTeamHeaders-Cc060CP0.js","./index.vue_vue_type_script_setup_true_lang-DCQMqfel.js","./index-DJ4AvgpT.css","./PanelBackground.vue_vue_type_script_setup_true_lang-DBIlZFl0.js","./BaseSegmented.vue_vue_type_script_setup_true_lang-CW16Y3Jx.js","./index-CP6sOfKF.css","./home-rounded-8qNxvN2I.js","./home-rounded-B4KVwSYb.css","./index-DSED2-Jv.js","./useKeyword-CoagiMo1.js","./supervised-user-circle-Bnx5icEm.js","./supervised-user-circle-CZYpyCV4.css","./index-xqKWYiCC.js","./index.vue_vue_type_style_index_0_lang-DQhqVyhA.js","./useCompEditStore-KBTFiinR.js","./v4-EwEgHOG0.js","./useCompEditStore-B9HAj9va.css","./index-CdWXO9ks.css","./kid-star-Cr1NlTdT.js","./kid-star-D1M-aC1C.css","./index-feqY_hvF.js","./sync-saved-locally-rounded-DtyOT0dw.js","./sync-saved-locally-rounded-wbwASI26.css","./index-bJb3z37F.js","./cloud-upload-BRjLuSi4.js","./cloud-upload-j3Y0taC9.css","./index-ZwJcoRf3.js","./index-CoWWi7z-.js","./moment-B-YVwB4U.js","./index-CDnNjG3p.css","./index-B2xvPCaB.js","./terminal-D72IJB2N.js","./terminal-DFt3N_TH.css","./index-CtzG8xUz.js","./settings-BFJXTJ9K.js","./settings-BhagQj3w.css","./index-DkTzdi1V.js","./index-CmSN0r9I.css","./index-op0bdgFk.js","./index-Cl0SK7oa.css","./index-Cn8OtDDR.js"])))=>i.map(i=>d[i]);
2
+ import{aA as Yo,g as te,v as Ce,aj as Ue,ab as y,j as ne,aO as we,r as j,ax as v,w as vi,au as Ja,ad as Mt,av as ku,B as Oo,ao as Go,aF as In,aM as $e,l as T,ai as Ve,i as g,F as Ie,ah as He,q as Ke,ap as L,af as H,a7 as et,a9 as Ct,Y as Ge,b as Up,k as ue,aB as ec,ay as tc,aN as zt,al as $t,X as We,ar as bn,aQ as ho,aR as Ye,W as Vp,aE as h_,aP as it,$ as At,p as p_,_ as wn,A as Jn,K as f_,aD as _s,m as m_,n as v_,aC as nc,c as g_,Z as Ae,Q as ys,S as __,u as qn,o as y_,s as b_,h as ic,at as kt,U as Ui,V as Gn,y as Za,a1 as w_,a4 as bs,aa as Bp,H as Ao,ak as S_,ac as Hp,z as C_,a8 as E_,aK as Sn,T as ws,aJ as Qo,aG as Ss,aI as el,aH as ea,t as x_}from"./vendor-core-CzvSW5ae.js";import{ai as T_,aD as $_,m as k_,aH as Ji,aE as oc,ag as O_,ah as Ou,ao as A_,ar as P_,aA as R_,aw as I_,au as M_,aq as F_,ap as D_,as as L_,ax as j_,at as z_,ay as N_,av as U_,y as Au,e as Gi,x as tl,aJ as qp,a2 as V_,a1 as B_,M as H_,aK as q_,an as W_,am as Di,I as K_,z as Po,K as Y_,$ as G_,H as Q_,N as nl,B as il,a3 as X_,_ as J_,Z as Z_,r as ey,T as Pu,k as Ru,A as Iu,g as Mu,a5 as Fu,b as Du,j as Lu,i as ju,R as zu,Q as Nu,P as Uu,q as Vu,h as Bu,W as Hu,a7 as qu,a9 as Wu,Y as Ku,S as Yu,l as Gu,a0 as Qu,n as Xu,a4 as Ju,O as Zu,C as ed,a6 as td,a8 as nd,G as id,ae as vr,af as Zi,ab as rc,az as Ro,aj as Io,aB as Mo,J as gr,ac as ty}from"./vendor-ui-DXwyveTF.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const ny="local://",iy="main",oy="container",ry="item",sy="/__global_config__",ay="/node_modules/.prebuild_module",ly="_metadata.json",cy="/_module_load_prefix_",uy="/_node_modules_load_prefix_",dy="/_comp_preview_prefix_local_",hy="/__proxy__",py="/__master__",fy="__remote__",my="__local__",vy="https://api.comphub.cn:5696",gy="http://localhost:7002",_y="http://localhost:5000",yy="http://localhost:5001",by="Comp Hub",wy="csrfToken",Sy="authorization",Cy="x-refresh-token",Ey="x-csrf-token",xy="accept-language",Ty="isGuestLogin",$y="comp-hub-db",ky="file-compiled",Oy="https://oss.comphub.cn",Ay="oss:sts:token",Py="oss:sts:expire",Ry="comp.json",Iy="README.md",My="/.comp_hub_temp",Fy="main.js",Dy="index.vue",Wp="list_local",Kp="list_remote",Ly={COMP_LIST_TYPE_LOCAL:Wp,COMP_LIST_TYPE_REMOTE:Kp},Yp="config",Gp="error",Qp="dir",Xp="preview",Jp="extra",Zp="deps",ef="upgradeLog",tf="readme",jy={TAB_TYPE_CONFIG:Yp,TAB_TYPE_ERROR:Gp,TAB_TYPE_DIR:Qp,TAB_TYPE_PREVIEW:Xp,TAB_TYPE_EXTRA:Jp,TAB_TYPE_DEPS:Zp,TAB_TYPE_UPGRADE_LOG:ef,TAB_TYPE_README:tf},nf="mini",of="full",zy={COMP_EDIT_TAB_TYPE_MINI:nf,COMP_EDIT_TAB_TYPE_FULL:of},rf="EDIT",sf="ADD",Ny={DIALOG_TYPE_EDIT:rf,DIALOG_TYPE_ADD:sf},af="ONLY_INSTALL",lf="MAJOR_VERSION",cf="MINOR_VERSION",uf="EXACT_VERSION",Uy={COMP_MATCH_TYPE_ONLY_INSTALL:af,COMP_MATCH_TYPE_MAJOR_VERSION:lf,COMP_MATCH_TYPE_MINOR_VERSION:cf,COMP_MATCH_TYPE_EXACT_VERSION:uf},df="online",hf="offline",Vy={COMP_UPDATE_TYPE_ONLINE:df,COMP_UPDATE_TYPE_OFFLINE:hf},By=0,Hy=1,qy=-1,pf="checkPreviewListForm",ff="checkExtraInfoForm",mf="checkCompConfig",vf="afterCompDel",gf="openCompTerminal",_f="afterCompCancelCollect",yf="afterCompRenderRetry",bf="getCompError",wf="checkUpgradeLogForm",Wy={COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:pf,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:ff,COMP_METHOD_KEY_CHECK_COMP_CONFIG:mf,COMP_METHOD_KEY_AFTER_COMP_DEL:vf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:gf,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:_f,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:yf,COMP_METHOD_KEY_GET_COMP_ERROR:bf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:wf},Ky={CONTAINER:{SHARE:"share",COLLECT:"collect",LOCAL:"local",MINE:"mine",SIMILAR:"similar",TEAM_ALL:"teamAll",TEAM_MINE:"teamMine",TEAM_GROUP:"teamGroup",TEAM_ADD:"teamAdd"},ITEM:{PREVIEW_REMOTE:"previewRemote",PREVIEW_LOCAL:"previewLocal",CAROUSEL_REMOTE:"carouselRemote",CAROUSEL_LOCAL:"carouselLocal",EDIT_PANEL:"editPanel"}},Yy="http://127.0.0.1",Gy="http://localhost:8095",Qy="http://localhost:8096",Xy="http://localhost:5198",Jy="/item",Zy="/container",eb="CREATE",tb="JOIN",nb="EXIT",ib="teamAddMyComp",ob="teamCompList",rb="teamCompGroupList",sb="teamMyCompList",ab="teamMyCompUpdate",lb="vue/dist/vue.esm-bundler.js",cb="__v__",ub="compListStore",db="compEditStore",hb="callbacks",pb="comphubConfig",fb="local",mb="prod",vb="local",gb="prod",_b="http://localhost:5173/en/",yb="https://docs.comphub.cn/en/",bb=20,wb=20,vt=Object.freeze(Object.defineProperty({__proto__:null,ACCEPT_LANGUAGE_HEADER_NAME:xy,AUTHORIZATION_HEADER_NAME:Sy,CACHE_KEY_STS_EXPIRE_TIME:Py,CACHE_KEY_STS_TOKEN:Ay,COMPHUB_CONFIG_KEY:pb,COMP_ACTION_ICON_HEIGHT:wb,COMP_ACTION_ICON_WIDTH:bb,COMP_CONFIG_FILENAME:Ry,COMP_EDIT_TAB_TYPES:zy,COMP_EDIT_TAB_TYPE_FULL:of,COMP_EDIT_TAB_TYPE_MINI:nf,COMP_ENTRY_FILE:Fy,COMP_HUB_DEV_DOCS_URL:_b,COMP_HUB_PROD_DOCS_URL:yb,COMP_LIST_TYPES:Ly,COMP_LIST_TYPE_LOCAL:Wp,COMP_LIST_TYPE_REMOTE:Kp,COMP_MATCH_TYPES:Uy,COMP_MATCH_TYPE_EXACT_VERSION:uf,COMP_MATCH_TYPE_MAJOR_VERSION:lf,COMP_MATCH_TYPE_MINOR_VERSION:cf,COMP_MATCH_TYPE_ONLY_INSTALL:af,COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT:_f,COMP_METHOD_KEY_AFTER_COMP_DEL:vf,COMP_METHOD_KEY_AFTER_COMP_RENDER_RETRY:yf,COMP_METHOD_KEY_CHECK_COMP_CONFIG:mf,COMP_METHOD_KEY_CHECK_EXTRA_INFO_FORM:ff,COMP_METHOD_KEY_CHECK_PREVIEW_LIST_FORM:pf,COMP_METHOD_KEY_CHECK_UPGRADE_LOG_FORM:wf,COMP_METHOD_KEY_GET_COMP_ERROR:bf,COMP_METHOD_KEY_OPEN_COMP_TERMINAL:gf,COMP_PREVIEW_PREFIX_LOCAL:dy,COMP_README_FILENAME:Iy,COMP_SUBMIT_MAX_FILE_COUNT:30,COMP_SUBMIT_MAX_TOTAL_SIZE:10485760,COMP_TEMP_DIR:My,COMP_UPDATE_TYPES:Vy,COMP_UPDATE_TYPE_OFFLINE:hf,COMP_UPDATE_TYPE_ONLINE:df,COMP_USE_ENTRY_FILE:Dy,CSRF_KEY:wy,CSRF_TOKEN_HEADER_NAME:Ey,DIALOG_TYPES:Ny,DIALOG_TYPE_ADD:sf,DIALOG_TYPE_EDIT:rf,FILE_MANAGER_DIRNAME:ny,GLOBAL_CONFIG_PATH:sy,IFRAME_CONTAINER_WEBSITE_PATH:Zy,IFRAME_HOST:Yy,IFRAME_ITEM_WEBSITE_PATH:Jy,IFRAME_ROUTES:Ky,INDEX_DB_NAME:$y,INDEX_DB_TABLE_NAME:ky,IS_GUEST_LOGIN:Ty,LOCAL_CHILD_IFRAME_URL:Gy,LOCAL_LEAF_IFRAME_URL:Qy,LOCAL_MIDWAY_ENV_LOCAL:fb,LOCAL_MIDWAY_ENV_PROD:mb,LOCAL_SERVICE_PREFIX:my,LOCAL_SERVICE_URL_DEV:_y,LOCAL_SERVICE_URL_DEV_SUB:yy,LOCAL_TOP_IFRAME_URL:Xy,MASTER_API_PREFIX:py,META_FILE_NAME:ly,MODULE_LOAD_PREFIX:cy,NODE_MODULES_LOAD_PREFIX:uy,OSS_CUSTOM_DOMAIN:Oy,PREBUILD_MODULE_DIR:ay,PROVIDE_KEYS:Wy,PROVIDE_KEY_CALLBACKS:hb,PROVIDE_KEY_COMP_EDIT_STORE:db,PROVIDE_KEY_COMP_LIST_STORE:ub,PROXY_PATH_PREFIX:hy,REFRESH_TOKEN_HEADER_NAME:Cy,REMOTE_MIDWAY_ENV_LOCAL:vb,REMOTE_MIDWAY_ENV_PROD:gb,REMOTE_SERVICE_PREFIX:fy,REMOTE_SERVICE_URL_DEV:gy,REMOTE_SERVICE_URL_PROD:vy,ROUTE_STATE_KEY_VERSION:cb,SCOPE_ID_TEAM_ADD_MY_COMP:ib,SCOPE_ID_TEAM_COMP_GROUP_LIST:rb,SCOPE_ID_TEAM_COMP_LIST:ob,SCOPE_ID_TEAM_MY_COMP_LIST:sb,SCOPE_ID_TEAM_MY_COMP_UPDATE:ab,SITE_TITLE:by,TAB_TYPES:jy,TAB_TYPE_CONFIG:Yp,TAB_TYPE_DEPS:Zp,TAB_TYPE_DIR:Qp,TAB_TYPE_ERROR:Gp,TAB_TYPE_EXTRA:Jp,TAB_TYPE_PREVIEW:Xp,TAB_TYPE_README:tf,TAB_TYPE_UPGRADE_LOG:ef,TEAM_OPERATE_TYPE_CREATE:eb,TEAM_OPERATE_TYPE_EXIT:nb,TEAM_OPERATE_TYPE_JOIN:tb,VERSION_COMPARE_GREATER:Hy,VERSION_COMPARE_LESS:qy,VERSION_COMPARE_SAME:By,VUE_ESM_BUNDLER:lb,WEBSITE_PATH_CONTAINER:oy,WEBSITE_PATH_ITEM:ry,WEBSITE_PATH_MAIN:iy},Symbol.toStringTag,{value:"Module"})),Sb=[{label:"tag.systemRecommended",value:"XTTJ"},{label:"tag.all",value:"QB"},{label:"tag.latest",value:"ZX"},{label:"tag.hottest",value:"ZR"}],Cb=[".css"],Eb=[{name:"__id__",label:"comp.fieldId",required:!0,default:""},{name:"name",label:"comp.fieldName",required:!0,default:""},{name:"version",label:"comp.fieldVersion",required:!0,default:"1.0.0"}],Dz=Object.freeze(Object.defineProperty({__proto__:null,COMP_DEFAULT_FIELD:Eb,DEFAULT_TAG_GROUP:Sb,PREBUILD_MODULE_SKIP_EXT:Cb},Symbol.toStringTag,{value:"Module"})),xb="comp-hub-locale",Tb=Object.freeze(Object.defineProperty({__proto__:null,LOCALE_KEY:xb},Symbol.toStringTag,{value:"Module"})),Lz=t=>vt.COMP_HUB_PROD_DOCS_URL,$b=t=>"";var kb={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值",alphaDescription:"透明度 {alpha}, 当前颜色 {color}",hueLabel:"选择色相值",hueDescription:"色相 {hue}, 当前颜色 {color}",svLabel:"选择饱和度与明度的值",svDescription:"饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",predefineDescription:"选择 {value} 作为颜色"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},mention:{loading:"加载中"},dropdown:{toggleDropdown:"切换下拉选项"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计",selectAllLabel:"选择所有行",selectRowLabel:"选择当前行",expandRowLabel:"展开当前行",collapseRowLabel:"收起当前行",sortLabel:"按 {column} 排序",filterLabel:"按 {column} 过滤"},tag:{close:"关闭此标签"},tour:{next:"下一步",previous:"上一步",finish:"结束导览",close:"关闭此对话框"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"},inputOTP:{groupLabel:"一次性密码输入框",defaultLabel:"请输入第 {index} 位 OTP 字符"}}};const Ob=()=>{const{locale:t}=Yo(),e={zh:kb,en:T_};return{locale:te(()=>e[t.value])}},Ab=Ce({__name:"App",setup(t){const{locale:e}=Ob();return $_(),(n,i)=>{const o=Ue("router-view");return y(),ne(v(k_),{locale:v(e)},{default:we(()=>[j(o)]),_:1},8,["locale"])}}}),Pb="modulepreload",Rb=function(t,e){return new URL(t,e).href},od={},nt=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=c(n.map(u=>{if(u=Rb(u,i),u in od)return;od[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(i)for(let f=s.length-1;f>=0;f--){const p=s[f];if(p.href===u&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Pb,d||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((f,p)=>{m.addEventListener("load",f),m.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})},si="authorization",is=()=>localStorage.getItem(si),Ib=t=>localStorage.setItem(si,t),Mb=()=>localStorage.removeItem(si),Ti="x-refresh-token",Fb=()=>localStorage.getItem(Ti),Db=t=>localStorage.setItem(Ti,t),Lb=()=>localStorage.removeItem(Ti),sc="isGuest",ta=()=>localStorage.getItem(sc),jz=t=>localStorage.setItem(sc,t),jb=()=>localStorage.removeItem(sc),zb="aside_is_collapse",zz="loginType",Nz="compUploadFullscreen",Uz="terminalCommandHistory",Vz="compUploadSidePanelSize",Bz="tagSelected",Nb="asideSize",Ub="headerSize",Sf="tagsViewMaxCache",Hz="readUploadAgreement",Vb="dependencyMatchRule",qz="teamTabActiveName",Wz="settingTabActiveName",Kz="compPreviewTabActiveName",Cf="paginationPageSize",Bb=()=>localStorage.getItem(Cf),Hb=t=>localStorage.setItem(Cf,t),Yz="selectedFolderPath",Xo=vi("tagsView",{state:()=>({visitedViews:[],maxCache:Ji(Sf,10),payloadMap:new Map}),actions:{setMaxCache(t){this.$patch(e=>{e.maxCache=t})},addView(t){this.$patch(e=>{const n={...t},i=e.visitedViews.findIndex(r=>r.path===t.path);if(i!==-1){e.visitedViews[i]=n;return}e.visitedViews.unshift(n);const o=e.visitedViews.length-e.maxCache;o>0&&this.spliceVisitedViews(-o,o)})},spliceVisitedViews(t,e){this.$patch(n=>{n.visitedViews.splice(t,e)})},delViewByPath(t){this.$patch(e=>{for(const[n,i]of e.visitedViews.entries())if(i.path===t){e.visitedViews.splice(n,1);break}})},delViewAndJumpToPrev(t,e=!1,n){if(e){const i=this.visitedViews.filter(o=>o.path!==t)?.[0];i?n.push(i.path).then(o=>{o||setTimeout(()=>{this.delViewByPath(t)},250)}):n.push("/").then(o=>{o||this.delViewByPath(t)})}else this.delViewByPath(t)},addPayLoad(t,e){this.$patch(n=>{n.payloadMap.set(t,e)})},getPayLoad(t){return this.payloadMap.get(t)}}}),qb=Ce((t,{slots:e})=>{var n,i;const o=Go(),{width:r,height:s}=Ja(t),a=Mt(oc(o,{width:(n=ku(r))!==null&&n!==void 0?n:0,height:(i=ku(s))!==null&&i!==void 0?i:0},{box:t.box,window:t.window}));return()=>{if(e.default)return Oo(t.as||"div",{ref:o},e.default(a))}},{name:"UseElementSize",props:["as","box","height","width","window"]}),Wb={ref:"el",class:"relative"},Kb={class:"absolute opacity-0 pointer-events-none flex"},Yb=["itemKey"],Gb=Ce({__name:"AutoWrapRow",props:{list:{},moreWidth:{default:70},gap:{default:5},getKey:{}},setup(t){const e=t,n=H(new Map),i=In("el"),o=In("items"),{width:r}=oc(i),s=H([]),a=H(!1),l=te(()=>r.value-e.moreWidth),c=te(()=>{const p=s.value.map(_=>_.key);return e.list.filter(_=>p.includes(e.getKey(_)))}),u=te(()=>a.value?e.list.length-s.value.length:0),d=te(()=>{let p=0;for(const _ of n.value.values())p+=_;return p});function h(p,_){n.value.set(p,_)}function m(){const p=new Map;for(const _ of e.list){const C=e.getKey(_);p.set(C,n.value.get(C)??0)}n.value=p}const f=O_(()=>{let p=0;const _=[];if(!(!o.value||e.list.length===0)){for(const C of e.list){const w=e.getKey(C),S=o.value.find(b=>b.getAttribute("itemKey")===w);if(S){if(p+=S.offsetWidth+e.gap,p>l.value)break;_.push({key:w,value:S.offsetWidth})}}s.value=_,a.value=!0}},100);return $e([()=>r.value,()=>e.list,()=>d.value],([,,p],[,,_])=>{p!==_&&(a.value=!1),f()},{flush:"post",deep:!0}),$e(()=>e.list.length,()=>{m()}),(p,_)=>(y(),T("div",Wb,[Ve(p.$slots,"display",{visibleList:c.value,overflow:u.value}),g("div",Kb,[(y(!0),T(Ie,null,He(t.list,(C,w)=>(y(),ne(v(qb),{key:t.getKey(C)},{default:we(({width:S})=>[Ke(L(h(t.getKey(C),Number(S)))+" ",1),g("div",{ref_for:!0,ref:"items",itemKey:t.getKey(C),class:"invisible whitespace-nowrap"},[Ve(p.$slots,"measure",{item:C,index:w})],8,Yb)]),_:2},1024))),128))])],512))}}),ac=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Ef=/^[a-z0-9]+(-[a-z0-9]+)*$/,Cs=(t,e,n,i="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:a};return e&&!Nr(c)?null:c}const r=o[0],s=r.split("-");if(s.length>1){const a={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!Nr(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:r};return e&&!Nr(a,n)?null:a}return null},Nr=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Qb(t,e){const n=t.icons,i=t.aliases||Object.create(null),o=Object.create(null);function r(s){if(n[s])return o[s]=[];if(!(s in o)){o[s]=null;const a=i[s]&&i[s].parent,l=a&&r(a);l&&(o[s]=[a].concat(l))}return o[s]}return Object.keys(n).concat(Object.keys(i)).forEach(r),o}const xf=Object.freeze({left:0,top:0,width:16,height:16}),os=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Es=Object.freeze({...xf,...os}),ol=Object.freeze({...Es,body:"",hidden:!1});function Xb(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function rd(t,e){const n=Xb(t,e);for(const i in ol)i in os?i in t&&!(i in n)&&(n[i]=os[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function Jb(t,e,n){const i=t.icons,o=t.aliases||Object.create(null);let r={};function s(a){r=rd(i[a]||o[a],r)}return s(e),n.forEach(s),rd(t,r)}function Tf(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const i=Qb(t);for(const o in i){const r=i[o];r&&(e(o,Jb(t,o,r)),n.push(o))}return n}const Zb={provider:"",aliases:{},not_found:{},...xf};function na(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function $f(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!na(t,Zb))return null;const n=e.icons;for(const o in n){const r=n[o];if(!o||typeof r.body!="string"||!na(r,ol))return null}const i=e.aliases||Object.create(null);for(const o in i){const r=i[o],s=r.parent;if(!o||typeof s!="string"||!n[s]&&!i[s]||!na(r,ol))return null}return e}const sd=Object.create(null);function e0(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function eo(t,e){const n=sd[t]||(sd[t]=Object.create(null));return n[e]||(n[e]=e0(t,e))}function kf(t,e){return $f(e)?Tf(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function t0(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let Fo=!1;function Of(t){return typeof t=="boolean"&&(Fo=t),Fo}function n0(t){const e=typeof t=="string"?Cs(t,!0,Fo):t;if(e){const n=eo(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function i0(t,e){const n=Cs(t,!0,Fo);if(!n)return!1;const i=eo(n.provider,n.prefix);return e?t0(i,n.name,e):(i.missing.add(n.name),!0)}function o0(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Fo&&!e&&!t.prefix){let i=!1;return $f(t)&&(t.prefix="",Tf(t,(o,r)=>{i0(o,r)&&(i=!0)})),i}const n=t.prefix;return Nr({prefix:n,name:"a"})?!!kf(eo(e,n),t):!1}const Af=Object.freeze({width:null,height:null}),Pf=Object.freeze({...Af,...os}),r0=/(-?[0-9.]*[0-9]+[0-9.]*)/g,s0=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ad(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(r0);if(i===null||!i.length)return t;const o=[];let r=i.shift(),s=s0.test(r);for(;;){if(s){const a=parseFloat(r);isNaN(a)?o.push(r):o.push(Math.ceil(a*e*n)/n)}else o.push(r);if(r=i.shift(),r===void 0)return o.join("");s=!s}}function a0(t,e="defs"){let n="";const i=t.indexOf("<"+e);for(;i>=0;){const o=t.indexOf(">",i),r=t.indexOf("</"+e);if(o===-1||r===-1)break;const s=t.indexOf(">",r);if(s===-1)break;n+=t.slice(o+1,r).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:n,content:t}}function l0(t,e){return t?"<defs>"+t+"</defs>"+e:e}function c0(t,e,n){const i=a0(t);return l0(i.defs,e+i.content+n)}const u0=t=>t==="unset"||t==="undefined"||t==="none";function d0(t,e){const n={...Es,...t},i={...Pf,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,i].forEach(p=>{const _=[],C=p.hFlip,w=p.vFlip;let S=p.rotate;C?w?S+=2:(_.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),_.push("scale(-1 1)"),o.top=o.left=0):w&&(_.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),_.push("scale(1 -1)"),o.top=o.left=0);let b;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:b=o.height/2+o.top,_.unshift("rotate(90 "+b.toString()+" "+b.toString()+")");break;case 2:_.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:b=o.width/2+o.left,_.unshift("rotate(-90 "+b.toString()+" "+b.toString()+")");break}S%2===1&&(o.left!==o.top&&(b=o.left,o.left=o.top,o.top=b),o.width!==o.height&&(b=o.width,o.width=o.height,o.height=b)),_.length&&(r=c0(r,'<g transform="'+_.join(" ")+'">',"</g>"))});const s=i.width,a=i.height,l=o.width,c=o.height;let u,d;s===null?(d=a===null?"1em":a==="auto"?c:a,u=ad(d,l/c)):(u=s==="auto"?l:s,d=a===null?ad(u,c/l):a==="auto"?c:a);const h={},m=(p,_)=>{u0(_)||(h[p]=_.toString())};m("width",u),m("height",d);const f=[o.left,o.top,l,c];return h.viewBox=f.join(" "),{attributes:h,viewBox:f,body:r}}const h0=/\sid="(\S+)"/g,ld=new Map;function p0(t){t=t.replace(/[0-9]+$/,"")||"a";const e=ld.get(t)||0;return ld.set(t,e+1),e?`${t}${e}`:t}function f0(t){const e=[];let n;for(;n=h0.exec(t);)e.push(n[1]);if(!e.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(o=>{const r=p0(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const rl=Object.create(null);function m0(t,e){rl[t]=e}function sl(t){return rl[t]||rl[""]}function lc(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const cc=Object.create(null),_o=["https://api.simplesvg.com","https://api.unisvg.com"],Ur=[];for(;_o.length>0;)_o.length===1||Math.random()>.5?Ur.push(_o.shift()):Ur.push(_o.pop());cc[""]=lc({resources:["https://api.iconify.design"].concat(Ur)});function v0(t,e){const n=lc(e);return n===null?!1:(cc[t]=n,!0)}function uc(t){return cc[t]}const g0=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let cd=g0();function _0(t,e){const n=uc(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const r=e+".json?icons=";i=n.maxURL-o-n.path.length-r.length}return i}function y0(t){return t===404}const b0=(t,e,n)=>{const i=[],o=_0(t,e),r="icons";let s={type:r,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,c)=>{a+=l.length+1,a>=o&&c>0&&(i.push(s),s={type:r,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),i.push(s),i};function w0(t){if(typeof t=="string"){const e=uc(t);if(e)return e.path}return"/"}const S0=(t,e,n)=>{if(!cd){n("abort",424);return}let i=w0(e.provider);switch(e.type){case"icons":{const r=e.prefix,s=e.icons.join(","),a=new URLSearchParams({icons:s});i+=r+".json?"+a.toString();break}case"custom":{const r=e.uri;i+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let o=503;cd(t+i).then(r=>{const s=r.status;if(s!==200){setTimeout(()=>{n(y0(s)?"abort":"next",s)});return}return o=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",o)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",o)})},C0={prepare:b0,send:S0};function Rf(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(o=>o.id!==e))})}function E0(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,o=t.prefix;e.forEach(r=>{const s=r.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==o)return!0;const c=l.name;if(t.icons[c])s.loaded.push({provider:i,prefix:o,name:c});else if(t.missing.has(c))s.missing.push({provider:i,prefix:o,name:c});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||Rf([t],r.id),r.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),r.abort))})}))}let x0=0;function T0(t,e,n){const i=x0++,o=Rf.bind(null,n,i);if(!e.pending.length)return o;const r={id:i,icons:e,callback:t,abort:o};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(r)}),o}function $0(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((o,r)=>o.provider!==r.provider?o.provider.localeCompare(r.provider):o.prefix!==r.prefix?o.prefix.localeCompare(r.prefix):o.name.localeCompare(r.name));let i={provider:"",prefix:"",name:""};return t.forEach(o=>{if(i.name===o.name&&i.prefix===o.prefix&&i.provider===o.provider)return;i=o;const r=o.provider,s=o.prefix,a=o.name,l=n[r]||(n[r]=Object.create(null)),c=l[s]||(l[s]=eo(r,s));let u;a in c.icons?u=e.loaded:s===""||c.missing.has(a)?u=e.missing:u=e.pending;const d={provider:r,prefix:s,name:a};u.push(d)}),e}function k0(t,e=!0,n=!1){const i=[];return t.forEach(o=>{const r=typeof o=="string"?Cs(o,e,n):o;r&&i.push(r)}),i}const O0={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function A0(t,e,n,i){const o=t.resources.length,r=t.random?Math.floor(Math.random()*o):t.index;let s;if(t.random){let x=t.resources.slice(0);for(s=[];x.length>1;){const O=Math.floor(Math.random()*x.length);s.push(x[O]),x=x.slice(0,O).concat(x.slice(O+1))}s=s.concat(x)}else s=t.resources.slice(r).concat(t.resources.slice(0,r));const a=Date.now();let l="pending",c=0,u,d=null,h=[],m=[];typeof i=="function"&&m.push(i);function f(){d&&(clearTimeout(d),d=null)}function p(){l==="pending"&&(l="aborted"),f(),h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function _(x,O){O&&(m=[]),typeof x=="function"&&m.push(x)}function C(){return{startTime:a,payload:e,status:l,queriesSent:c,queriesPending:h.length,subscribe:_,abort:p}}function w(){l="failed",m.forEach(x=>{x(void 0,u)})}function S(){h.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),h=[]}function b(x,O,$){const K=O!=="success";switch(h=h.filter(F=>F!==x),l){case"pending":break;case"failed":if(K||!t.dataAfterTimeout)return;break;default:return}if(O==="abort"){u=$,w();return}if(K){u=$,h.length||(s.length?E():w());return}if(f(),S(),!t.random){const F=t.resources.indexOf(x.resource);F!==-1&&F!==t.index&&(t.index=F)}l="completed",m.forEach(F=>{F($)})}function E(){if(l!=="pending")return;f();const x=s.shift();if(x===void 0){if(h.length){d=setTimeout(()=>{f(),l==="pending"&&(S(),w())},t.timeout);return}w();return}const O={status:"pending",resource:x,callback:($,K)=>{b(O,$,K)}};h.push(O),c++,d=setTimeout(E,t.rotate),n(x,e,O.callback)}return setTimeout(E),C}function If(t){const e={...O0,...t};let n=[];function i(){n=n.filter(s=>s().status==="pending")}function o(s,a,l){const c=A0(e,s,a,(u,d)=>{i(),l&&l(u,d)});return n.push(c),c}function r(s){return n.find(a=>s(a))||null}return{query:o,find:r,setIndex:s=>{e.index=s},getIndex:()=>e.index,cleanup:i}}function ud(){}const ia=Object.create(null);function P0(t){if(!ia[t]){const e=uc(t);if(!e)return;ia[t]={config:e,redundancy:If(e)}}return ia[t]}function R0(t,e,n){let i,o;if(typeof t=="string"){const r=sl(t);if(!r)return n(void 0,424),ud;o=r.send;const s=P0(t);s&&(i=s.redundancy)}else{const r=lc(t);if(r){i=If(r);const s=sl(t.resources?t.resources[0]:"");s&&(o=s.send)}}return!i||!o?(n(void 0,424),ud):i.query(e,o,n)().abort}function dd(){}function I0(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,E0(t)}))}function M0(t){const e=[],n=[];return t.forEach(i=>{(i.match(Ef)?e:n).push(i)}),{valid:e,invalid:n}}function yo(t,e,n){function i(){const o=t.pendingIcons;e.forEach(r=>{o&&o.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!kf(t,n).length){i();return}}catch(o){console.error(o)}i(),I0(t)}function hd(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function F0(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const r=t.loadIcon;if(t.loadIcons&&(o.length>1||!r)){hd(t.loadIcons(o,i,n),c=>{yo(t,o,c)});return}if(r){o.forEach(c=>{hd(r(c,i,n),u=>{yo(t,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:s,invalid:a}=M0(o);if(a.length&&yo(t,a,null),!s.length)return;const l=i.match(Ef)?sl(n):null;if(!l){yo(t,s,null);return}l.prepare(n,i,s).forEach(c=>{R0(n,c,u=>{yo(t,c.icons,u)})})}))}const D0=(t,e)=>{const n=$0(k0(t,!0,Of()));if(!n.pending.length){let a=!0;return e&&setTimeout(()=>{a&&e(n.loaded,n.missing,n.pending,dd)}),()=>{a=!1}}const i=Object.create(null),o=[];let r,s;return n.pending.forEach(a=>{const{provider:l,prefix:c}=a;if(c===s&&l===r)return;r=l,s=c,o.push(eo(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(a=>{const{provider:l,prefix:c,name:u}=a,d=eo(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(u)||(h.add(u),i[l][c].push(u))}),o.forEach(a=>{const l=i[a.provider][a.prefix];l.length&&F0(a,l)}),e?T0(e,n,o):dd};function L0(t,e){const n={...t};for(const i in e){const o=e[i],r=typeof o;i in Af?(o===null||o&&(r==="string"||r==="number"))&&(n[i]=o):r===typeof n[i]&&(n[i]=i==="rotate"?o%4:o)}return n}const j0=/[\s,]+/;function z0(t,e){e.split(j0).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function N0(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(t);return isNaN(o)?0:i(o)}else if(n!==t){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/o,r%1===0?i(r):0)}}return e}function U0(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function V0(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function B0(t){return"data:image/svg+xml,"+V0(t)}function H0(t){return'url("'+B0(t)+'")'}const pd={...Pf,inline:!1},q0={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},W0={display:"inline-block"},al={backgroundColor:"currentColor"},Mf={backgroundColor:"transparent"},fd={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},md={webkitMask:al,mask:al,background:Mf};for(const t in md){const e=md[t];for(const n in fd)e[t+n]=fd[n]}const Vr={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Vr[t+"-flip"]=e,Vr[t.slice(0,1)+"-flip"]=e,Vr[t+"Flip"]=e});function vd(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const gd=(t,e)=>{const n=L0(pd,e),i={...q0},o=e.mode||"svg",r={},s=e.style,a=typeof s=="object"&&!(s instanceof Array)?s:{};for(let p in e){const _=e[p];if(_!==void 0)switch(p){case"icon":case"style":case"onLoad":case"mode":case"ssr":case"customise":break;case"inline":case"hFlip":case"vFlip":n[p]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&z0(n,_);break;case"color":r.color=_;break;case"rotate":typeof _=="string"?n[p]=N0(_):typeof _=="number"&&(n[p]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete i["aria-hidden"];break;default:{const C=Vr[p];C?(_===!0||_==="true"||_===1)&&(n[C]=!0):pd[p]===void 0&&(i[p]=_)}}}const l=d0(t,n),c=l.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),o==="svg")return i.style={...r,...a},Object.assign(i,c),i.innerHTML=f0(l.body),Oo("svg",i);const{body:u,width:d,height:h}=t,m=o==="mask"||(o==="bg"?!1:u.indexOf("currentColor")!==-1),f=U0(u,{...c,width:d+"",height:h+""});return i.style={...r,"--svg":H0(f),width:vd(c.width),height:vd(c.height),...W0,...m?al:Mf,...a},Oo("span",i)};Of(!0);m0("",C0);if(typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!o0(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;v0(n,o)||console.error(i)}catch{console.error(i)}}}}const K0={...Es,body:""},Y0=Ce((t,{emit:e})=>{const n=H(null);function i(){n.value&&(n.value.abort?.(),n.value=null)}const o=H(!!t.ssr),r=H(""),s=Go(null);function a(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=Cs(c,!1,!0))===null)return null;let d=n0(u);if(!d){const f=n.value;return(!f||f.name!==c)&&(d===null?n.value={name:c}:n.value={name:c,abort:D0([u],l)}),null}i(),r.value!==c&&(r.value=c,Ge(()=>{e("load",c)}));const h=t.customise;if(h){d=Object.assign({},d);const f=h(d.body,u.name,u.prefix,u.provider);typeof f=="string"&&(d.body=f)}const m=["iconify"];return u.prefix!==""&&m.push("iconify--"+u.prefix),u.provider!==""&&m.push("iconify--"+u.provider),{data:d,classes:m}}function l(){const c=a();c?c.data!==s.value?.data&&(s.value=c):s.value=null}return o.value?l():et(()=>{o.value=!0,l()}),$e(()=>t.icon,l),Ct(i),()=>{const c=s.value;if(!c)return gd(K0,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),gd({...Es,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]});function G0(t,e,n="_id"){const i=Ou(t,e,n).filter(Boolean),o=Ou(e,t,n).filter(Boolean),r=A_(t,e,(s,a)=>s[n]===a[n]&&!P_(s,a));return{addedItems:i,deletedItems:o,modifiedItems:r}}const Gz=Object.freeze(Object.defineProperty({__proto__:null,findChangedArrayItems:G0},Symbol.toStringTag,{value:"Module"}));function dc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q0(t,e){if(!e?.trim())return[{text:t,isMatch:!1}];const n=new RegExp(`(${dc(e)})`,"gi");return t.split(n).map(i=>({text:i,isMatch:n.test(i)&&i.toLowerCase()===e.toLowerCase()}))}function X0(t,e,n="hl"){if(!e?.trim())return t;const i=dc(e.trim());return t.replace(new RegExp(`(${i})`,"gi"),`<mark class="${n}">$1</mark>`)}function J0(t,e){const n=e?.trim().toLowerCase();return n?t.findIndex(i=>i.toLowerCase().includes(n)):-1}const Ff=t=>t.replace(/[/\\]/g,"/"),Z0=(t,e="/")=>t.replace(/[\\/]+/g,e);function ew(){return"#"+R_(0,16777215).toString(16).padStart(6,"0")}const tw=t=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t),Df=t=>t.replace(/[-_]([a-z])/g,(e,n)=>n.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()),ll=t=>{if(Array.isArray(t))return t.map(n=>ll(n));if(t===null||typeof t!="object")return t;const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=Df(n);e[i]=ll(t[n])}return e};function nw(t){return/(^[A-Z][a-z][a-zA-Z0-9]*$)|(^[a-z]+(-[a-z0-9]+)+$)/.test(t.trim())}function iw(t){if(t<=0)throw new Error("长度必须大于0");let e="";for(;e.length<t;){const n=Math.floor(Math.random()*10);e.length===0&&n===0||(e+=n)}return e}function Lf(t){if(t==null)return{valid:!1,reason:"validateHash.empty"};if(typeof t!="string")return{valid:!1,reason:"validateHash.notString",reasonParams:{type:typeof t}};const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return{valid:!1,reason:"validateHash.contentEmpty"};if(/^\d/.test(e))return{valid:!1,reason:"validateHash.startsWithNumber",reasonParams:{char:e[0]}};const n=e.match(/[^\p{L}\p{N}_\-() ]/u);if(n){const i=n[0],o=i.charCodeAt(0);return i==="`"?{valid:!1,reason:"validateHash.invalidCharBacktick"}:i===`
3
+ `?{valid:!1,reason:"validateHash.invalidCharNewline"}:i==="\r"?{valid:!1,reason:"validateHash.invalidCharCarriageReturn"}:i===" "?{valid:!1,reason:"validateHash.invalidCharTab"}:i==="\f"?{valid:!1,reason:"validateHash.invalidCharFormFeed"}:i==="\v"?{valid:!1,reason:"validateHash.invalidCharVerticalTab"}:i==="#"?{valid:!1,reason:"validateHash.invalidCharHash"}:/[<>\\"'&]/.test(i)?{valid:!1,reason:"validateHash.invalidCharHtmlSpecial",reasonParams:{char:i}}:{valid:!1,reason:"validateHash.invalidCharUnknown",reasonParams:{char:i,code:o.toString(16).toUpperCase().padStart(4,"0")}}}return{valid:!0,normalized:e}}function ow(t){return Lf(t).valid}const Qz=Object.freeze(Object.defineProperty({__proto__:null,convertKeysToCamelCase:ll,escapeRegExp:dc,findKeywordLineIndex:J0,generateNumberString:iw,highlightText:X0,isEmail:tw,isValidHash:ow,randomColor:ew,replaceBackslashWithSlash:Ff,replaceSlashWithSpecifiedSeparator:Z0,splitTextByKeyword:Q0,toCamelCase:Df,validateCompName:nw,validateHash:Lf},Symbol.toStringTag,{value:"Module"}));function rw(t,e){if(!t||!e.length)throw new Error("组件路径或入口路径为空");const[n]=e.slice(-1);if(!n)throw new Error("入口路径最后一项无效");const i=Ff(n);return`${t.replace(vt.FILE_MANAGER_DIRNAME,"")}${i}`}function sw(t){const e={};return t.forEach(n=>{n?.parent?e[n?.parent?.name]=n?.parent?.version:e[n.name]=n.version}),Object.entries(e).map(([n,i])=>({name:n,version:i}))}const Xz=Object.freeze(Object.defineProperty({__proto__:null,getPreviewUrl:rw,handleDepData:sw},Symbol.toStringTag,{value:"Module"}));function aw(t){const e={children:[]},n=[e];return t.forEach(({depth:i,tokens:o})=>{if(o[0]){const r=o[0].text,s=o.map(u=>u.text),a=s.join(""),l={title:r,titles:s,href:`#${a}`,children:[]};for(;n.length>i;)n.pop();const c=n[n.length-1];c&&c.children.push(l),n.push(l)}}),e.children}const Jz=Object.freeze(Object.defineProperty({__proto__:null,flatHeadingsToTree:aw},Symbol.toStringTag,{value:"Module"})),lw=t=>`Bearer ${t}`,cw=t=>t.replace("Bearer ",""),wi=Object.freeze(Object.defineProperty({__proto__:null,extractBearerToken:cw,generateBearerToken:lw},Symbol.toStringTag,{value:"Module"}));function uw(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=[];let a=!1;const l=u=>{const d=u[o];Array.isArray(d)&&(s.push(...d),d.forEach(h=>l(h)))},c=u=>{if(a)return!0;for(const d of u){if(d?.[i]===e)return a=!0,l(d),!0;const h=d?.[o];if(Array.isArray(h)&&h.length>0&&c(h))return!0}return!1};return c(r),s}function jf(t,e){const n=JSON.parse(JSON.stringify(t));return n.children?.length&&(n.children=n.children.map(i=>jf(i,e))),e(n)}function dw(t,e,n={}){const{idKey:i="id",childrenKey:o="children"}=n,r=Array.isArray(t)?t:[t],s=l=>{const{[o]:c,...u}=l;return u},a=(l,c)=>{for(const u of l){if(u[i]===e)return[s(u),...c];const d=u[o];if(Array.isArray(d)&&d.length>0){const h=a(d,[s(u),...c]);if(h)return h}}return null};return a(r,[])??[]}function hw(t,e){const{createNode:n,pathSeparator:i="/",skipInvalid:o=!0}=e,r=new Map,s=i,a=n("directory","",s);a.children=[],r.set(s,a);const l=u=>{let d=u.replace(/\\/g,"/");return d=d.replace(/^\.\//,""),d=d.replace(/^\/+|\/+$/g,""),d.replace(/\//g,i)};for(const u of t){const d=l(u.path);if(!d)continue;const h=d.split(i).filter(Boolean);if(h.length===0)continue;let m=s,f="";for(let w=0;w<h.length-1;w++){const S=h[w];if(f=f?`${f}${i}${S}`:S,!r.has(f)){const b=n("directory",S,f);b.children=[],r.set(f,b),r.get(m)?.children?.push(b)}m=f}const p=h[h.length-1];if(!p){if(!o)throw new Error(`无效路径: ${u.path}`);continue}const _=f?`${f}${i}${p}`:p,C=n("file",p,_);r.get(m)?.children?.push(C)}const c=u=>{u.sort((d,h)=>d.type!==h.type?d.type==="directory"?-1:1:d.name.localeCompare(h.name)),u.forEach(d=>d.children?.length&&c(d.children))};return a.children?.length&&c(a.children),a}const Zz=Object.freeze(Object.defineProperty({__proto__:null,convertFlatToTree:hw,findTreeNodePathToRoot:dw,getTreeAllChildren:uw,mapTree:jf},Symbol.toStringTag,{value:"Module"}));var zf=(t=>(t.Added="added",t.Deleted="deleted",t.Unchanged="unchanged",t.Changed="modified",t))(zf||{}),Nf=(t=>(t.Directory="directory",t.File="file",t))(Nf||{});function Uf(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function rs(t,e){for(const n of t)e.set(n.path,n),n.type==="directory"&&n.children?.length&&rs(n.children,e)}function _d(t){const e=new Map;return rs(t,e),e}function hc(t,e){const n=[];for(const i of t)if(!e.has(i.path)){const o=Uf(i);o.status="deleted",i.type==="directory"&&i.children?.length&&(o.children=hc(i.children,e)),n.push(o)}return n}function pw(t,e,n){return n?n(t,e):t.hash&&e.hash?t.hash===e.hash:!0}function Br(t,e,n,i){return t.map(o=>{const r=Uf(o),s=e.get(o.path);if(s){if(o.type==="file"){const a=pw(s,o,i?.contentCompare);r.status=a?"unchanged":"modified"}else r.status="unchanged";if(o.type==="directory"&&o.children&&s.children){const a=_d(s.children),l=Br(o.children,a,n,i),c=_d(l),u=hc(s.children,c);r.children=[...l,...u]}else o.type==="directory"&&o.children&&(r.children=Br(o.children,new Map,"added",i))}else r.status=n,o.type==="directory"&&o.children?.length&&(r.children=Br(o.children,new Map,n,i));return r.type==="directory"&&pc(r),r})}function pc(t){if(t.type!=="directory"||!t.children?.length)return;for(const n of t.children)n.type==="directory"&&pc(n);if(t.status==="added"||t.status==="deleted")return;const e=t.children.some(n=>n.status==="added"||n.status==="deleted"||n.status==="modified");t.status=e?"modified":"unchanged"}function Vf(t){const e=[...t].sort((n,i)=>n.type!==i.type?n.type==="directory"?-1:1:n.name.localeCompare(i.name));for(const n of e)n.type==="directory"&&n.children?.length&&(n.children=Vf(n.children));return e}function fw(t,e,n){const i=new Map,o=new Map;rs(e,i),rs(t,o);const r=Br(t,i,"added",n),s=hc(e,o),a=[...r,...s],l=n?.skipSort?a:Vf(a);for(const c of l)c.type==="directory"&&pc(c);return l}const eN=Object.freeze(Object.defineProperty({__proto__:null,NodeStatus:zf,NodeType:Nf,mergeAndMarkTree:fw},Symbol.toStringTag,{value:"Module"})),mw=(t,e)=>{const n=Array.isArray(e)?e:[e];let i;return I_(t)?i="string":M_(t)?i="number":F_(t)?i="boolean":D_(t)?i="array":L_(t)?i="function":j_(t)?i="symbol":z_(t)?i="null":N_(t)?i="undefined":U_(t)?i="object":i="undefined",n.includes(i)},tN=Object.freeze(Object.defineProperty({__proto__:null,isType:mw},Symbol.toStringTag,{value:"Module"})),yd=/^[\^~>=<]+/,Bf=/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.]+))?(?:\+([a-zA-Z0-9.]+))?$/;function vw(t){return Bf.test(t)}function Fn(t){if(!t||typeof t!="string")throw new Error(`Invalid version string: ${t}`);const e=t.match(yd),n=e?e[0]:"",i=t.replace(yd,"").match(Bf);if(!i)throw new Error(`Invalid semver format: ${t}`);const[,o="0",r="0",s="0",a]=i,l=parseInt(o,10),c=parseInt(r,10),u=parseInt(s,10);return{raw:t,prefix:n,major:l,minor:c,patch:u,prerelease:a||null,majorVersion:o,version:`${l}.${c}.${u}`}}function gw(t,e){const n=Fn(t),i=Fn(e);return n.major===i.major&&n.minor===i.minor&&n.patch===i.patch}function _w(t){return Fn(t).majorVersion}function yw(t){const e={};for(const[n,i]of Object.entries(t))try{e[n]=Fn(i)}catch(o){console.warn(`Failed to parse version for ${n}: ${i}`,o)}return e}function Vi(t,e){const n=Fn(t),i=Fn(e),{VERSION_COMPARE_SAME:o,VERSION_COMPARE_LESS:r,VERSION_COMPARE_GREATER:s}=vt;return n.major!==i.major?n.major>i.major?s:r:n.minor!==i.minor?n.minor>i.minor?s:r:n.patch!==i.patch?n.patch>i.patch?s:r:o}function bw(t,e){const n=Fn(t),i=Fn(e);switch(i.prefix){case"^":return n.major===i.major;case"~":return n.major===i.major&&n.minor===i.minor;case">=":return Vi(t,e.replace(">=",""))>=0;case">":return Vi(t,e.replace(">",""))>0;case"<=":return Vi(t,e.replace("<=",""))<=0;case"<":return Vi(t,e.replace("<",""))<0;case"=":case"":return Vi(t,e.replace("=",""))===0;default:return!1}}function ww(t){if(!t||typeof t!="string")throw new Error("版本号必须是非空字符串");const e=Fn(t),n=(a,l)=>{if(a<0||a>999)throw new Error(`版本号${l}位必须在 0-999 之间,当前值:${a}(原始输入:${t})`);return a},i=n(e.major,"主版本"),o=n(e.minor,"次版本"),r=n(e.patch,"补丁版本"),s=i*1e6+o*1e3+r;if(!Number.isSafeInteger(s))throw new Error(`版本号转换后超出 JavaScript 安全整数范围,结果:${s}(原始输入:${t})`);return s}const nN=Object.freeze(Object.defineProperty({__proto__:null,compareVersions:Vi,getMajorVersion:_w,isVersionEqual:gw,parseDependencies:yw,parseVersion:Fn,satisfiesRange:bw,validateVersion:vw,versionToNumber:ww},Symbol.toStringTag,{value:"Module"})),Sw={};function Cw(t,e){return y(),ne(Up,{name:"transition-fade",mode:"out-in",appear:""},{default:we(()=>[Ve(t.$slots,"default")]),_:3})}const Ew=ac(Sw,[["render",Cw]]),xw={key:0,class:"fixed top-0 left-0 w-screen bg-[rgb(94,9,11)] text-white font-sans z-[99999] break-all overflow-auto max-h-[50vh] p-[10px] box-border"},Tw={class:"clear-both"},$w={class:"whitespace-pre-wrap m-0"},kw={key:0},Ow={class:"whitespace-pre-wrap m-0"},Aw=Ce({__name:"ErrorOverlay",props:{errors:{}},setup(t){const e=H(!1),n=t,i=()=>{e.value=!1};return $e(()=>n.errors,o=>{e.value=o.length>0},{immediate:!0,deep:!0}),(o,r)=>e.value?(y(),T("div",xw,[g("button",{class:"sticky top-[10px] right-[10px] float-right bg-white/20 border-none text-white text-lg cursor-pointer w-[30px] h-[30px] rounded-full flex items-center justify-center p-0 ml-[10px] transition-colors duration-200 hover:bg-white/30",onClick:i}," × "),g("div",Tw,[(y(!0),T(Ie,null,He(t.errors,(s,a)=>(y(),T("div",{key:a,class:"mb-5"},[g("pre",$w,L(s?.message||s),1),s?.stack?(y(),T("div",kw,[g("pre",Ow,L(s.stack),1)])):ue("",!0)]))),128))])])):ue("",!0)}}),Pw=Ce({__name:"index",props:Vp({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const{t:e}=Yo(),n=t,i=te(()=>{const u={};return n.config?.column?.forEach(d=>{u[d.prop]=d.value}),u}),o=ec(t,"modelValue"),r=tc();async function s(){r?.onRefresh?.()}async function a(){n.config?.column?.forEach(u=>{u.value=""}),await Ge(),r?.onReset?.()}function l(u){return u??!0}function c(){r?.onSearch?.()}return zt(()=>{o.value=i.value}),(u,d)=>{const h=Ue("Icon");return y(),ne(v(tl),{inline:!0,onSubmit:d[3]||(d[3]=Ye(()=>{},["prevent"])),onKeyup:d[4]||(d[4]=ho(m=>c(),["enter"]))},{default:we(()=>[(y(!0),T(Ie,null,He(t.config?.column||[],(m,f)=>(y(),ne(v(Au),{key:f,label:v(m.label)??""},{default:we(()=>[l(m.useVModel)?(y(),ne($t(m.component),We({key:1,modelValue:m.value,"onUpdate:modelValue":p=>m.value=p},{ref_for:!0},m?.attributes||{},bn(m?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(y(),ne($t(m.component),We({key:0,"model-value":m.value},{ref_for:!0},m?.attributes||{},bn(m?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),t.config?.column?.length?(y(),ne(v(Au),{key:0},{default:we(()=>[j(v(Gi),{type:"success",onClick:d[0]||(d[0]=m=>c())},{default:we(()=>[Ke(L(v(e)("common.search")),1)]),_:1}),j(v(Gi),{type:"primary",onClick:d[1]||(d[1]=m=>a())},{default:we(()=>[Ke(L(v(e)("common.reset")),1)]),_:1}),j(v(Gi),{onClick:d[2]||(d[2]=m=>s())},{default:we(()=>[j(h,{icon:"material-symbols:refresh-rounded"})]),_:1})]),_:1})):ue("",!0)]),_:1})}}}),Rw={key:0},Iw={ref:"tableContainer",class:"flex-1 overflow-hidden"},Mw={key:1,class:"mt-2"},Fw=Ce({__name:"index",props:{tableConfig:{}},setup(t,{expose:e}){const n=tc(),i=t,o=In("tableContainer"),r=In("table"),{height:s}=oc(o),a=h_(),l=te(()=>{if(i.tableConfig?.pagination?.getPageSize||i.tableConfig?.pagination?.setPageSize)return{get:i.tableConfig.pagination.getPageSize,set:i.tableConfig.pagination.setPageSize};const I=Dw().paginationStorage;return I?{get:()=>{const A=I.get();return A?Number(A):10},set:A=>I.set(String(A))}:null}),c=H(l.value?.get?.()??10),u=H(!1),d=H(1),h=H(F()),m=H("UNKNOWN"),f=te(()=>Object.keys(a)),p=te(()=>i.tableConfig.size??"default"),_=te(()=>i.tableConfig?.fixedHeight??!0),C=te(()=>_.value?Math.max(s.value,100):"auto"),w=te(()=>i.tableConfig?.autoLoading??!0),S=te(()=>({"--pagination-location":i.tableConfig?.pagination?.location||"center"})),b=te(()=>i.tableConfig?.isPagination??!0),E=te(()=>i.tableConfig?.paginationMap?i.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),x=te(()=>({[E.value.page]:d.value,[E.value.pageSize]:c.value})),O=te(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...i.tableConfig?.pagination?.attributes,total:i.tableConfig?.pagination?.total||0,pageSize:c.value,currentPage:d.value})),$=te(()=>({...x.value,...h.value})),K=te(()=>i.tableConfig?.search?.column.filter(I=>I.autoQuery??!0).map(I=>I.prop));function F(){const I={};return i.tableConfig?.search?.column?.forEach(A=>{I[A.prop]=A.value}),I}async function P(){m.value!=="NOT_CHANGE"&&(w.value&&(u.value=!0),i.tableConfig?.fetchData?.($.value)?.finally(()=>{m.value="NOT_CHANGE",u.value=!1}))}async function N(){await P()}async function M(){m.value="UNKNOWN",await P()}async function q(){d.value=1,m.value!=="AUTO_QUERY"&&await P()}async function le(I){d.value=1,c.value=I}async function de(I){d.value=I}function Y(){m.value="UNKNOWN",P()}return $e(()=>JSON.stringify(h.value),(I,A)=>{m.value="UNKNOWN";const Q=JSON.parse(I??"{}"),U=JSON.parse(A??"{}"),ie=Object.keys(Q),ve=Object.keys(U);let re=[];ie.length===ve.length?re=Object.keys(Q).filter(ge=>Q[ge]!==U[ge]):re=q_(ie,ve),K.value?.length&&W_(re,[...K.value]).length&&(m.value="AUTO_QUERY",P())}),$e(()=>JSON.stringify(x.value),()=>{m.value="UNKNOWN",P()}),zt(()=>{l.value?.set?.(c.value)}),et(()=>{P()}),e({getTableRef:()=>r.value,forceRefreshData:Y}),(I,A)=>{const Q=qp;return it((y(),T("div",{class:"w-full h-full flex flex-col overflow-hidden",style:At(S.value)},[t.tableConfig.search?(y(),T("div",Rw,[Ve(I.$slots,"search",{},()=>[j(Pw,{modelValue:h.value,"onUpdate:modelValue":A[0]||(A[0]=U=>h.value=U),config:t.tableConfig.search,size:p.value,onSearch:N,onRefresh:M,onReset:q},null,8,["modelValue","config","size"])],!0)])):ue("",!0),Ve(I.$slots,"tableBefore",{},void 0,!0),g("div",Iw,[Ve(I.$slots,"table",{},()=>[j(v(B_),We({ref:"table",size:p.value,data:t.tableConfig.data,height:C.value},v(n)),p_({default:we(()=>[(y(!0),T(Ie,null,He(t.tableConfig.column,(U,ie)=>(y(),T(Ie,null,[U.slot?Ve(I.$slots,U.slot,{key:0,col:U,index:ie},void 0,!0):(y(),ne(v(V_),We({key:`default-${ie}`},{ref_for:!0},U),null,16))],64))),256))]),_:2},[He(f.value,U=>({name:U,fn:we(ie=>[Ve(I.$slots,U,wn(Jn(ie)),void 0,!0)])}))]),1040,["size","data","height"])],!0)],512),b.value?(y(),T("div",Mw,[Ve(I.$slots,"pagination",{},()=>[j(v(H_),We({size:p.value},O.value,{onSizeChange:le,onCurrentChange:de},bn(t.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):ue("",!0)],4)),[[Q,u.value]])}}}),bd=ac(Fw,[["__scopeId","data-v-f1bc3c2f"]]);let cl={};const Dw=()=>cl,Lw={...bd,install(t,e){e&&(cl={...cl,...e}),t.component("BaseTable",bd)}},jw={class:"overflow-hidden size-full"},zw=Ce({__name:"Main",setup(t){const e=Xo(),n=new Map,i=te(()=>e.visitedViews.map(s=>o(s)));function o(s){const{path:a}=s,{[vt.ROUTE_STATE_KEY_VERSION]:l}=s.query;return l?`${a}?${vt.ROUTE_STATE_KEY_VERSION}=${l}`:a}function r(s,a){const l=o(a);if(!n.has(l)){const c=Ce({name:l,setup(){return()=>Oo(s)}});n.set(l,c)}return n.get(l)}return $e(()=>i.value,(s,a)=>{const l=a.filter(c=>!s.includes(c));l.length&&n.delete(l[0])},{deep:!0}),(s,a)=>{const l=Ue("router-view");return y(),T("div",jw,[j(l,null,{default:we(({Component:c,route:u})=>[j(v(Ew),null,{default:we(()=>[(y(),ne(f_,{include:i.value},[(y(),ne($t(r(c,u))))],1032,["include"]))]),_:2},1024)]),_:1})])}}});var oa,wd;function Nw(){if(wd)return oa;wd=1;function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function e(o,r){for(var s="",a=0,l=-1,c=0,u,d=0;d<=o.length;++d){if(d<o.length)u=o.charCodeAt(d);else{if(u===47)break;u=47}if(u===47){if(!(l===d-1||c===1))if(l!==d-1&&c===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",a=0):(s=s.slice(0,h),a=s.length-1-s.lastIndexOf("/")),l=d,c=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,c=0;continue}}r&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(l+1,d):s=o.slice(l+1,d),a=d-l-1;l=d,c=0}else u===46&&c!==-1?++c:c=-1}return s}function n(o,r){var s=r.dir||r.root,a=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+a:s+o+a:a}var i={resolve:function(){for(var r="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=process.cwd()),c=a),t(c),c.length!==0&&(r=c+"/"+r,s=c.charCodeAt(0)===47)}return r=e(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(t(r),r.length===0)return".";var s=r.charCodeAt(0)===47,a=r.charCodeAt(r.length-1)===47;return r=e(r,!s),r.length===0&&!s&&(r="."),r.length>0&&a&&(r+="/"),s?"/"+r:r},isAbsolute:function(r){return t(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,s=0;s<arguments.length;++s){var a=arguments[s];t(a),a.length>0&&(r===void 0?r=a:r+="/"+a)}return r===void 0?".":i.normalize(r)},relative:function(r,s){if(t(r),t(s),r===s||(r=i.resolve(r),s=i.resolve(s),r===s))return"";for(var a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var l=r.length,c=l-a,u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var d=s.length,h=d-u,m=c<h?c:h,f=-1,p=0;p<=m;++p){if(p===m){if(h>m){if(s.charCodeAt(u+p)===47)return s.slice(u+p+1);if(p===0)return s.slice(u+p)}else c>m&&(r.charCodeAt(a+p)===47?f=p:p===0&&(f=0));break}var _=r.charCodeAt(a+p),C=s.charCodeAt(u+p);if(_!==C)break;_===47&&(f=p)}var w="";for(p=a+f+1;p<=l;++p)(p===l||r.charCodeAt(p)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+s.slice(u+f):(u+=f,s.charCodeAt(u)===47&&++u,s.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(t(r),r.length===0)return".";for(var s=r.charCodeAt(0),a=s===47,l=-1,c=!0,u=r.length-1;u>=1;--u)if(s=r.charCodeAt(u),s===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":r.slice(0,l)},basename:function(r,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');t(r);var a=0,l=-1,c=!0,u;if(s!==void 0&&s.length>0&&s.length<=r.length){if(s.length===r.length&&s===r)return"";var d=s.length-1,h=-1;for(u=r.length-1;u>=0;--u){var m=r.charCodeAt(u);if(m===47){if(!c){a=u+1;break}}else h===-1&&(c=!1,h=u+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(l=u):(d=-1,l=h))}return a===l?l=h:l===-1&&(l=r.length),r.slice(a,l)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":r.slice(a,l)}},extname:function(r){t(r);for(var s=-1,a=0,l=-1,c=!0,u=0,d=r.length-1;d>=0;--d){var h=r.charCodeAt(d);if(h===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),h===46?s===-1?s=d:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===a+1?"":r.slice(s,l)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return n("/",r)},parse:function(r){t(r);var s={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return s;var a=r.charCodeAt(0),l=a===47,c;l?(s.root="/",c=1):c=0;for(var u=-1,d=0,h=-1,m=!0,f=r.length-1,p=0;f>=c;--f){if(a=r.charCodeAt(f),a===47){if(!m){d=f+1;break}continue}h===-1&&(m=!1,h=f+1),a===46?u===-1?u=f:p!==1&&(p=1):u!==-1&&(p=-1)}return u===-1||h===-1||p===0||p===1&&u===h-1&&u===d+1?h!==-1&&(d===0&&l?s.base=s.name=r.slice(1,h):s.base=s.name=r.slice(d,h)):(d===0&&l?(s.name=r.slice(1,u),s.base=r.slice(1,h)):(s.name=r.slice(d,u),s.base=r.slice(d,h)),s.ext=r.slice(u,h)),d>0?s.dir=r.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,oa=i,oa}var Uw=Nw();const Vw=Di(Uw);function fc(){const{t}=Yo();return{getTitle:n=>n?n.includes(".")&&!n.startsWith("http")?t(n):n:""}}const Bw={class:"truncate"},Hw=Ce({__name:"MenuItem",props:{route:{},fullPath:{}},setup(t){const{getTitle:e}=fc(),n=_s(),i=t;function o(){n.push({path:i.fullPath})}return(r,s)=>{const a=Po,l=K_;return y(),T("span",{onClick:o},[j(l,{index:t.fullPath},{title:we(()=>[g("span",Bw,L(v(e)(t.route.meta?.title)),1)]),default:we(()=>[j(a,null,{default:we(()=>[(y(),ne($t(t.route.meta?.icon)))]),_:1})]),_:1},8,["index"])])}}});function Hf(t,e){return function(){return t.apply(e,arguments)}}const{toString:qw}=Object.prototype,{getPrototypeOf:xs}=Object,{iterator:Ts,toStringTag:qf}=Symbol,$s=(t=>e=>{const n=qw.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cn=t=>(t=t.toLowerCase(),e=>$s(e)===t),ks=t=>e=>typeof e===t,{isArray:po}=Array,to=ks("undefined");function Jo(t){return t!==null&&!to(t)&&t.constructor!==null&&!to(t.constructor)&&Ht(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Wf=Cn("ArrayBuffer");function Ww(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Wf(t.buffer),e}const Kw=ks("string"),Ht=ks("function"),Kf=ks("number"),Zo=t=>t!==null&&typeof t=="object",Yw=t=>t===!0||t===!1,Hr=t=>{if($s(t)!=="object")return!1;const e=xs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(qf in t)&&!(Ts in t)},Gw=t=>{if(!Zo(t)||Jo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Qw=Cn("Date"),Xw=Cn("File"),Jw=t=>!!(t&&typeof t.uri<"u"),Zw=t=>t&&typeof t.getParts<"u",e1=Cn("Blob"),t1=Cn("FileList"),n1=t=>Zo(t)&&Ht(t.pipe);function i1(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Sd=i1(),Cd=typeof Sd.FormData<"u"?Sd.FormData:void 0,o1=t=>{if(!t)return!1;if(Cd&&t instanceof Cd)return!0;const e=xs(t);if(!e||e===Object.prototype||!Ht(t.append))return!1;const n=$s(t);return n==="formdata"||n==="object"&&Ht(t.toString)&&t.toString()==="[object FormData]"},r1=Cn("URLSearchParams"),[s1,a1,l1,c1]=["ReadableStream","Request","Response","Headers"].map(Cn),u1=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,o;if(typeof t!="object"&&(t=[t]),po(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(Jo(t))return;const r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length;let a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function Yf(t,e){if(Jo(t))return null;e=e.toLowerCase();const n=Object.keys(t);let i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}const $i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gf=t=>!to(t)&&t!==$i;function ul(){const{caseless:t,skipUndefined:e}=Gf(this)&&this||{},n={},i=(o,r)=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;const s=t&&Yf(n,r)||r;Hr(n[s])&&Hr(o)?n[s]=ul(n[s],o):Hr(o)?n[s]=ul({},o):po(o)?n[s]=o.slice():(!e||!to(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&er(arguments[o],i);return n}const d1=(t,e,n,{allOwnKeys:i}={})=>(er(e,(o,r)=>{n&&Ht(o)?Object.defineProperty(t,r,{value:Hf(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),t),h1=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),p1=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},f1=(t,e,n,i)=>{let o,r,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&xs(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},m1=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},v1=t=>{if(!t)return null;if(po(t))return t;let e=t.length;if(!Kf(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},g1=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xs(Uint8Array)),_1=(t,e)=>{const i=(t&&t[Ts]).call(t);let o;for(;(o=i.next())&&!o.done;){const r=o.value;e.call(t,r[0],r[1])}},y1=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},b1=Cn("HTMLFormElement"),w1=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),Ed=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),S1=Cn("RegExp"),Qf=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};er(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},C1=t=>{Qf(t,(e,n)=>{if(Ht(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Ht(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},E1=(t,e)=>{const n={},i=o=>{o.forEach(r=>{n[r]=!0})};return po(t)?i(t):i(String(t).split(e)),n},x1=()=>{},T1=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function $1(t){return!!(t&&Ht(t.append)&&t[qf]==="FormData"&&t[Ts])}const k1=t=>{const e=new Array(10),n=(i,o)=>{if(Zo(i)){if(e.indexOf(i)>=0)return;if(Jo(i))return i;if(!("toJSON"in i)){e[o]=i;const r=po(i)?[]:{};return er(i,(s,a)=>{const l=n(s,o+1);!to(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},O1=Cn("AsyncFunction"),A1=t=>t&&(Zo(t)||Ht(t))&&Ht(t.then)&&Ht(t.catch),Xf=((t,e)=>t?setImmediate:e?((n,i)=>($i.addEventListener("message",({source:o,data:r})=>{o===$i&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),$i.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ht($i.postMessage)),P1=typeof queueMicrotask<"u"?queueMicrotask.bind($i):typeof process<"u"&&process.nextTick||Xf,R1=t=>t!=null&&Ht(t[Ts]),W={isArray:po,isArrayBuffer:Wf,isBuffer:Jo,isFormData:o1,isArrayBufferView:Ww,isString:Kw,isNumber:Kf,isBoolean:Yw,isObject:Zo,isPlainObject:Hr,isEmptyObject:Gw,isReadableStream:s1,isRequest:a1,isResponse:l1,isHeaders:c1,isUndefined:to,isDate:Qw,isFile:Xw,isReactNativeBlob:Jw,isReactNative:Zw,isBlob:e1,isRegExp:S1,isFunction:Ht,isStream:n1,isURLSearchParams:r1,isTypedArray:g1,isFileList:t1,forEach:er,merge:ul,extend:d1,trim:u1,stripBOM:h1,inherits:p1,toFlatObject:f1,kindOf:$s,kindOfTest:Cn,endsWith:m1,toArray:v1,forEachEntry:_1,matchAll:y1,isHTMLForm:b1,hasOwnProperty:Ed,hasOwnProp:Ed,reduceDescriptors:Qf,freezeMethods:C1,toObjectSet:E1,toCamelCase:w1,noop:x1,toFiniteNumber:T1,findKey:Yf,global:$i,isContextDefined:Gf,isSpecCompliantForm:$1,toJSONObject:k1,isAsyncFn:O1,isThenable:A1,setImmediate:Xf,asap:P1,isIterable:R1};let De=class Jf extends Error{static from(e,n,i,o,r,s){const a=new Jf(e.message,n||e.code,i,o,r);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),s&&Object.assign(a,s),a}constructor(e,n,i,o,r){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.status}}};De.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";De.ERR_BAD_OPTION="ERR_BAD_OPTION";De.ECONNABORTED="ECONNABORTED";De.ETIMEDOUT="ETIMEDOUT";De.ERR_NETWORK="ERR_NETWORK";De.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";De.ERR_DEPRECATED="ERR_DEPRECATED";De.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";De.ERR_BAD_REQUEST="ERR_BAD_REQUEST";De.ERR_CANCELED="ERR_CANCELED";De.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";De.ERR_INVALID_URL="ERR_INVALID_URL";De.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const I1=null;function dl(t){return W.isPlainObject(t)||W.isArray(t)}function Zf(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function ra(t,e,n){return t?t.concat(e).map(function(o,r){return o=Zf(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function M1(t){return W.isArray(t)&&!t.some(dl)}const F1=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});function Os(t,e,n){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,C){return!W.isUndefined(C[_])});const i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,l=n.maxDepth===void 0?100:n.maxDepth,c=a&&W.isSpecCompliantForm(e);if(!W.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(W.isDate(p))return p.toISOString();if(W.isBoolean(p))return p.toString();if(!c&&W.isBlob(p))throw new De("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(p)||W.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,_,C){let w=p;if(W.isReactNative(e)&&W.isReactNativeBlob(p))return e.append(ra(C,_,r),u(p)),!1;if(p&&!C&&typeof p=="object"){if(W.endsWith(_,"{}"))_=i?_:_.slice(0,-2),p=JSON.stringify(p);else if(W.isArray(p)&&M1(p)||(W.isFileList(p)||W.endsWith(_,"[]"))&&(w=W.toArray(p)))return _=Zf(_),w.forEach(function(b,E){!(W.isUndefined(b)||b===null)&&e.append(s===!0?ra([_],E,r):s===null?_:_+"[]",u(b))}),!1}return dl(p)?!0:(e.append(ra(C,_,r),u(p)),!1)}const h=[],m=Object.assign(F1,{defaultVisitor:d,convertValue:u,isVisitable:dl});function f(p,_,C=0){if(!W.isUndefined(p)){if(C>l)throw new De("Object is too deeply nested ("+C+" levels). Max depth: "+l,De.ERR_FORM_DATA_DEPTH_EXCEEDED);if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(p),W.forEach(p,function(S,b){(!(W.isUndefined(S)||S===null)&&o.call(e,S,W.isString(b)?b.trim():b,_,m))===!0&&f(S,_?_.concat(b):[b],C+1)}),h.pop()}}if(!W.isObject(t))throw new TypeError("data must be an object");return f(t),e}function xd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(i){return e[i]})}function mc(t,e){this._pairs=[],t&&Os(t,this,e)}const em=mc.prototype;em.append=function(e,n){this._pairs.push([e,n])};em.toString=function(e){const n=e?function(i){return e.call(this,i,xd)}:xd;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function D1(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tm(t,e,n){if(!e)return t;const i=n&&n.encode||D1,o=W.isFunction(n)?{serialize:n}:n,r=o&&o.serialize;let s;if(r?s=r(e,o):s=W.isURLSearchParams(e)?e.toString():new mc(e,o).toString(i),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Td{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(i){i!==null&&e(i)})}}const vc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},L1=typeof URLSearchParams<"u"?URLSearchParams:mc,j1=typeof FormData<"u"?FormData:null,z1=typeof Blob<"u"?Blob:null,N1={isBrowser:!0,classes:{URLSearchParams:L1,FormData:j1,Blob:z1},protocols:["http","https","file","blob","url","data"]},gc=typeof window<"u"&&typeof document<"u",hl=typeof navigator=="object"&&navigator||void 0,U1=gc&&(!hl||["ReactNative","NativeScript","NS"].indexOf(hl.product)<0),V1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",B1=gc&&window.location.href||"http://localhost",H1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gc,hasStandardBrowserEnv:U1,hasStandardBrowserWebWorkerEnv:V1,navigator:hl,origin:B1},Symbol.toStringTag,{value:"Module"})),Ot={...H1,...N1};function q1(t,e){return Os(t,new Ot.classes.URLSearchParams,{visitor:function(n,i,o,r){return Ot.isNode&&W.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}function W1(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function K1(t){const e={},n=Object.keys(t);let i;const o=n.length;let r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function nm(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=r>=n.length;return s=!s&&W.isArray(o)?o.length:s,l?(W.hasOwnProp(o,s)?o[s]=W.isArray(o[s])?o[s].concat(i):[o[s],i]:o[s]=i,!a):((!o[s]||!W.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&W.isArray(o[s])&&(o[s]=K1(o[s])),!a)}if(W.isFormData(t)&&W.isFunction(t.entries)){const n={};return W.forEachEntry(t,(i,o)=>{e(W1(i),o,n,0)}),n}return null}const ji=(t,e)=>t!=null&&W.hasOwnProp(t,e)?t[e]:void 0;function Y1(t,e,n){if(W.isString(t))try{return(e||JSON.parse)(t),W.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const tr={transitional:vc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=W.isObject(e);if(r&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return o?JSON.stringify(nm(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){const l=ji(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return q1(e,l).toString();if((a=W.isFileList(e))||i.indexOf("multipart/form-data")>-1){const c=ji(this,"env"),u=c&&c.FormData;return Os(a?{"files[]":e}:e,u&&new u,l)}}return r||o?(n.setContentType("application/json",!1),Y1(e)):e}],transformResponse:[function(e){const n=ji(this,"transitional")||tr.transitional,i=n&&n.forcedJSONParsing,o=ji(this,"responseType"),r=o==="json";if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(i&&!o||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,ji(this,"parseReviver"))}catch(l){if(a)throw l.name==="SyntaxError"?De.from(l,De.ERR_BAD_RESPONSE,this,null,ji(this,"response")):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{tr.headers[t]={}});const G1=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Q1=t=>{const e={};let n,i,o;return t&&t.split(`
4
+ `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&G1[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},$d=Symbol("internals"),X1=/[^\x09\x20-\x7E\x80-\xFF]/g;function J1(t){let e=0,n=t.length;for(;e<n;){const i=t.charCodeAt(e);if(i!==9&&i!==32)break;e+=1}for(;n>e;){const i=t.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return e===0&&n===t.length?t:t.slice(e,n)}function bo(t){return t&&String(t).trim().toLowerCase()}function Z1(t){return J1(t.replace(X1,""))}function qr(t){return t===!1||t==null?t:W.isArray(t)?t.map(qr):Z1(String(t))}function eS(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const tS=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function sa(t,e,n,i,o){if(W.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!W.isString(e)){if(W.isString(i))return e.indexOf(i)!==-1;if(W.isRegExp(i))return i.test(e)}}function nS(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function iS(t,e){const n=W.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}let qt=class{constructor(e){e&&this.set(e)}set(e,n,i){const o=this;function r(a,l,c){const u=bo(l);if(!u)throw new Error("header name must be a non-empty string");const d=W.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=qr(a))}const s=(a,l)=>W.forEach(a,(c,u)=>r(c,u,l));if(W.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(W.isString(e)&&(e=e.trim())&&!tS(e))s(Q1(e),n);else if(W.isObject(e)&&W.isIterable(e)){let a={},l,c;for(const u of e){if(!W.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?W.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=bo(e),e){const i=W.findKey(this,e);if(i){const o=this[i];if(!n)return o;if(n===!0)return eS(o);if(W.isFunction(n))return n.call(this,o,i);if(W.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=bo(e),e){const i=W.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||sa(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let o=!1;function r(s){if(s=bo(s),s){const a=W.findKey(i,s);a&&(!n||sa(i,i[a],a,n))&&(delete i[a],o=!0)}}return W.isArray(e)?e.forEach(r):r(e),o}clear(e){const n=Object.keys(this);let i=n.length,o=!1;for(;i--;){const r=n[i];(!e||sa(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){const n=this,i={};return W.forEach(this,(o,r)=>{const s=W.findKey(i,r);if(s){n[s]=qr(o),delete n[r];return}const a=e?nS(r):String(r).trim();a!==r&&delete n[r],n[a]=qr(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return W.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&W.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
5
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){const i=(this[$d]=this[$d]={accessors:{}}).accessors,o=this.prototype;function r(s){const a=bo(s);i[a]||(iS(o,s),i[a]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}};qt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(qt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});W.freezeMethods(qt);function aa(t,e){const n=this||tr,i=e||n,o=qt.from(i.headers);let r=i.data;return W.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function im(t){return!!(t&&t.__CANCEL__)}let nr=class extends De{constructor(e,n,i){super(e??"canceled",De.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function om(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new De("Request failed with status code "+n.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oS(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function rS(t,e){t=t||10;const n=new Array(t),i=new Array(t);let o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[r];s||(s=c),n[o]=l,i[o]=c;let d=r,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(h*1e3/m):void 0}}function sS(t,e){let n=0,i=1e3/e,o,r;const s=(c,u=Date.now())=>{n=u,o=null,r&&(clearTimeout(r),r=null),t(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=i?s(c,u):(o=c,r||(r=setTimeout(()=>{r=null,s(o)},i-d)))},()=>o&&s(o)]}const ss=(t,e,n=3)=>{let i=0;const o=rS(50,250);return sS(r=>{const s=r.loaded,a=r.lengthComputable?r.total:void 0,l=a!=null?Math.min(s,a):s,c=Math.max(0,l-i),u=o(c);i=Math.max(i,l);const d={loaded:l,total:a,progress:a?l/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},kd=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Od=t=>(...e)=>W.asap(()=>t(...e)),aS=Ot.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ot.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ot.origin),Ot.navigator&&/(msie|trident)/i.test(Ot.navigator.userAgent)):()=>!0,lS=Ot.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];W.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),W.isString(i)&&a.push(`path=${i}`),W.isString(o)&&a.push(`domain=${o}`),r===!0&&a.push("secure"),W.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cS(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function uS(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function rm(t,e,n){let i=!cS(e);return t&&(i||n===!1)?uS(t,e):e}const Ad=t=>t instanceof qt?{...t}:t;function Ii(t,e){e=e||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,u,d,h){return W.isPlainObject(c)&&W.isPlainObject(u)?W.merge.call({caseless:h},c,u):W.isPlainObject(u)?W.merge({},u):W.isArray(u)?u.slice():u}function o(c,u,d,h){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function r(c,u){if(!W.isUndefined(u))return i(void 0,u)}function s(c,u){if(W.isUndefined(u)){if(!W.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(W.hasOwnProp(e,d))return i(c,u);if(W.hasOwnProp(t,d))return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:a,headers:(c,u,d)=>o(Ad(c),Ad(u),d,!0)};return W.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=W.hasOwnProp(l,u)?l[u]:o,h=W.hasOwnProp(t,u)?t[u]:void 0,m=W.hasOwnProp(e,u)?e[u]:void 0,f=d(h,m,u);W.isUndefined(f)&&d!==a||(n[u]=f)}),n}const sm=t=>{const e=Ii({},t),n=h=>W.hasOwnProp(e,h)?e[h]:void 0,i=n("data");let o=n("withXSRFToken");const r=n("xsrfHeaderName"),s=n("xsrfCookieName");let a=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(e.headers=a=qt.from(a),e.url=tm(rm(c,d,u),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),W.isFormData(i)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(W.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([f,p])=>{m.includes(f.toLowerCase())&&a.set(f,p)})}}if(Ot.hasStandardBrowserEnv&&(W.isFunction(o)&&(o=o(e)),o===!0||o==null&&aS(e.url))){const m=r&&s&&lS.read(s);m&&a.set(r,m)}return e},dS=typeof XMLHttpRequest<"u",hS=dS&&function(t){return new Promise(function(n,i){const o=sm(t);let r=o.data;const s=qt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,h,m,f;function p(){m&&m(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function C(){if(!_)return;const S=qt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:S,config:t,request:_};om(function(O){n(O),p()},function(O){i(O),p()},E),_=null}"onloadend"in _?_.onloadend=C:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(C)},_.onabort=function(){_&&(i(new De("Request aborted",De.ECONNABORTED,t,_)),_=null)},_.onerror=function(b){const E=b&&b.message?b.message:"Network Error",x=new De(E,De.ERR_NETWORK,t,_);x.event=b||null,i(x),_=null},_.ontimeout=function(){let b=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||vc;o.timeoutErrorMessage&&(b=o.timeoutErrorMessage),i(new De(b,E.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,_)),_=null},r===void 0&&s.setContentType(null),"setRequestHeader"in _&&W.forEach(s.toJSON(),function(b,E){_.setRequestHeader(E,b)}),W.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([h,f]=ss(c,!0),_.addEventListener("progress",h)),l&&_.upload&&([d,m]=ss(l),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(u=S=>{_&&(i(!S||S.type?new nr(null,t,_):S),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const w=oS(o.url);if(w&&Ot.protocols.indexOf(w)===-1){i(new De("Unsupported protocol "+w+":",De.ERR_BAD_REQUEST,t));return}_.send(r||null)})},pS=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o;const r=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof De?u:new nr(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,r(new De(`timeout of ${e}ms exceeded`,De.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),t=null)};t.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>W.asap(a),l}},fS=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},mS=async function*(t,e){for await(const n of vS(t))yield*fS(n,e)},vS=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Pd=(t,e,n,i)=>{const o=mS(t,e);let r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=r+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},Rd=64*1024,{isFunction:_r}=W,gS=(({Request:t,Response:e})=>({Request:t,Response:e}))(W.global),{ReadableStream:Id,TextEncoder:Md}=W.global,Fd=(t,...e)=>{try{return!!t(...e)}catch{return!1}},_S=t=>{t=W.merge.call({skipUndefined:!0},gS,t);const{fetch:e,Request:n,Response:i}=t,o=e?_r(e):typeof fetch=="function",r=_r(n),s=_r(i);if(!o)return!1;const a=o&&_r(Id),l=o&&(typeof Md=="function"?(f=>p=>f.encode(p))(new Md):async f=>new Uint8Array(await new n(f).arrayBuffer())),c=r&&a&&Fd(()=>{let f=!1;const p=new n(Ot.origin,{body:new Id,method:"POST",get duplex(){return f=!0,"half"}}),_=p.headers.has("Content-Type");return p.body!=null&&p.body.cancel(),f&&!_}),u=s&&a&&Fd(()=>W.isReadableStream(new i("").body)),d={stream:u&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!d[f]&&(d[f]=(p,_)=>{let C=p&&p[f];if(C)return C.call(p);throw new De(`Response type '${f}' is not supported`,De.ERR_NOT_SUPPORT,_)})});const h=async f=>{if(f==null)return 0;if(W.isBlob(f))return f.size;if(W.isSpecCompliantForm(f))return(await new n(Ot.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(W.isArrayBufferView(f)||W.isArrayBuffer(f))return f.byteLength;if(W.isURLSearchParams(f)&&(f=f+""),W.isString(f))return(await l(f)).byteLength},m=async(f,p)=>{const _=W.toFiniteNumber(f.getContentLength());return _??h(p)};return async f=>{let{url:p,method:_,data:C,signal:w,cancelToken:S,timeout:b,onDownloadProgress:E,onUploadProgress:x,responseType:O,headers:$,withCredentials:K="same-origin",fetchOptions:F}=sm(f),P=e||fetch;O=O?(O+"").toLowerCase():"text";let N=pS([w,S&&S.toAbortSignal()],b),M=null;const q=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let le;try{if(x&&c&&_!=="get"&&_!=="head"&&(le=await m($,C))!==0){let U=new n(p,{method:"POST",body:C,duplex:"half"}),ie;if(W.isFormData(C)&&(ie=U.headers.get("content-type"))&&$.setContentType(ie),U.body){const[ve,re]=kd(le,ss(Od(x)));C=Pd(U.body,Rd,ve,re)}}W.isString(K)||(K=K?"include":"omit");const de=r&&"credentials"in n.prototype;if(W.isFormData(C)){const U=$.getContentType();U&&/^multipart\/form-data/i.test(U)&&!/boundary=/i.test(U)&&$.delete("content-type")}const Y={...F,signal:N,method:_.toUpperCase(),headers:$.normalize().toJSON(),body:C,duplex:"half",credentials:de?K:void 0};M=r&&new n(p,Y);let I=await(r?P(M,F):P(p,Y));const A=u&&(O==="stream"||O==="response");if(u&&(E||A&&q)){const U={};["status","statusText","headers"].forEach(ge=>{U[ge]=I[ge]});const ie=W.toFiniteNumber(I.headers.get("content-length")),[ve,re]=E&&kd(ie,ss(Od(E),!0))||[];I=new i(Pd(I.body,Rd,ve,()=>{re&&re(),q&&q()}),U)}O=O||"text";let Q=await d[W.findKey(d,O)||"text"](I,f);return!A&&q&&q(),await new Promise((U,ie)=>{om(U,ie,{data:Q,headers:qt.from(I.headers),status:I.status,statusText:I.statusText,config:f,request:M})})}catch(de){throw q&&q(),de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)?Object.assign(new De("Network Error",De.ERR_NETWORK,f,M,de&&de.response),{cause:de.cause||de}):De.from(de,de&&de.code,f,M,de&&de.response)}}},yS=new Map,am=t=>{let e=t&&t.env||{};const{fetch:n,Request:i,Response:o}=e,r=[i,o,n];let s=r.length,a=s,l,c,u=yS;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:_S(e)),u=c;return c};am();const _c={http:I1,xhr:hS,fetch:{get:am}};W.forEach(_c,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Dd=t=>`- ${t}`,bS=t=>W.isFunction(t)||t===null||t===!1;function wS(t,e){t=W.isArray(t)?t:[t];const{length:n}=t;let i,o;const r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!bS(i)&&(o=_c[(a=String(i)).toLowerCase()],o===void 0))throw new De(`Unknown adapter '${a}'`);if(o&&(W.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){const s=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
6
+ `+s.map(Dd).join(`
7
+ `):" "+Dd(s[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const lm={getAdapter:wS,adapters:_c};function la(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new nr(null,t)}function Ld(t){return la(t),t.headers=qt.from(t.headers),t.data=aa.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),lm.getAdapter(t.adapter||tr.adapter,t)(t).then(function(i){return la(t),i.data=aa.call(t,t.transformResponse,i),i.headers=qt.from(i.headers),i},function(i){return im(i)||(la(t),i&&i.response&&(i.response.data=aa.call(t,t.transformResponse,i.response),i.response.headers=qt.from(i.response.headers))),Promise.reject(i)})}const cm="1.15.2",As={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{As[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const jd={};As.transitional=function(e,n,i){function o(r,s){return"[Axios v"+cm+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new De(o(s," has been removed"+(n?" in "+n:"")),De.ERR_DEPRECATED);return n&&!jd[s]&&(jd[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};As.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function SS(t,e,n){if(typeof t!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let o=i.length;for(;o-- >0;){const r=i[o],s=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0;if(s){const a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new De("option "+r+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new De("Unknown option "+r,De.ERR_BAD_OPTION)}}const Wr={assertOptions:SS,validators:As},rn=Wr.validators;let ki=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Td,response:new Td}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const r=(()=>{if(!o.stack)return"";const s=o.stack.indexOf(`
8
8
  `);return s===-1?"":o.stack.slice(s+1)})();try{if(!i.stack)i.stack=r;else if(r){const s=r.indexOf(`
9
9
  `),a=s===-1?-1:r.indexOf(`
10
10
  `,s+1),l=a===-1?"":r.slice(a+1);String(i.stack).endsWith(l)||(i.stack+=`
11
- `+r)}}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ii(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Kr.assertOptions(i,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean),legacyInterceptorReqResOrdering:rn.transitional(rn.boolean)},!1),o!=null&&(W.isFunction(o)?n.paramsSerializer={serialize:o}:Kr.assertOptions(o,{encode:rn.function,serialize:rn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kr.assertOptions(n,{baseUrl:rn.spelling("baseURL"),withXsrfToken:rn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&W.merge(r.common,r[n.method]);r&&W.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),n.headers=qt.concat(s,r);const a=[];let l=!0;this.interceptors.request.forEach(function(f){if(typeof f.runWhen=="function"&&f.runWhen(n)===!1)return;l=l&&f.synchronous;const _=n.transitional||bc;_&&_.legacyInterceptorReqResOrdering?a.unshift(f.fulfilled,f.rejected):a.push(f.fulfilled,f.rejected)});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!l){const p=[Bd.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let v=n;for(;d<h;){const p=a[d++],f=a[d++];try{v=p(v)}catch(_){f.call(this,_);break}}try{u=Bd.call(this,v)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Ii(this.defaults,e);const n=um(e.baseURL,e.url,e.allowAbsoluteUrls);return sm(n,e.params,e.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(e){Oi.prototype[e]=function(n,i){return this.request(Ii(i||{},{method:e,url:n,data:(i||{}).data}))}});W.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(Ii(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}Oi.prototype[e]=n(),Oi.prototype[e+"Form"]=n(!0)});let PS=class mm{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r;const s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new ir(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new mm(function(o){e=o}),cancel:e}}};function RS(t){return function(n){return t.apply(null,n)}}function MS(t){return W.isObject(t)&&t.isAxiosError===!0}const _l={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(_l).forEach(([t,e])=>{_l[e]=t});function vm(t){const e=new Oi(t),n=Gp(Oi.prototype.request,e);return W.extend(n,Oi.prototype,e,{allOwnKeys:!0}),W.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return vm(Ii(t,o))},n}const ht=vm(nr);ht.Axios=Oi;ht.CanceledError=ir;ht.CancelToken=PS;ht.isCancel=lm;ht.VERSION=pm;ht.toFormData=Rs;ht.AxiosError=De;ht.Cancel=ht.CanceledError;ht.all=function(e){return Promise.all(e)};ht.spread=RS;ht.isAxiosError=MS;ht.mergeConfig=Ii;ht.AxiosHeaders=qt;ht.formToJSON=t=>am(W.isHTMLForm(t)?new FormData(t):t);ht.getAdapter=fm.getAdapter;ht.HttpStatusCode=_l;ht.default=ht;const{Axios:pN,AxiosError:mN,CanceledError:vN,isCancel:gN,CancelToken:_N,VERSION:yN,all:bN,Cancel:wN,isAxiosError:SN,spread:CN,toFormData:EN,AxiosHeaders:xN,HttpStatusCode:qd,formToJSON:TN,getAdapter:$N,mergeConfig:kN}=ht,gm=new Map,IS={baseURL:"",timeout:1e4};function _m(t,e){const n=ht.create({...IS,...e});return gm.set(t,n),n}function FS(t="default"){const e=gm.get(t);if(!e)throw new Error(`Instance "${t}" not initialized. Call initInstance() first.`);return e}async function Se(t,e){const n=t.split("/")[0],i=FS(n);return t=t.replace(n,""),i.request({url:t,...e})}async function DS(t,e){return Se("__local__/api/v1/comp/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LS(t,e){return Se("__local__/api/v1/comp/checkCompRepeat",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function jS(t,e){return Se("__local__/api/v1/comp/compFileHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zS(t,e){return Se("__local__/api/v1/comp/compFilesOssSignedUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NS(t,e){return Se("__local__/api/v1/comp/dep",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function US(t,e){return Se("__local__/api/v1/comp/dir",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function VS(t,e){return Se("__local__/api/v1/comp/download",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function BS(t,e){return Se("__local__/api/v1/comp/file",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HS(t,e){return Se("__local__/api/v1/comp/generateCompJson",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function qS(t,e){return Se("__local__/api/v1/comp/localCompDetailByPathHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function WS(t,e){return Se("__local__/api/v1/comp/localComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function KS(t,e){return Se("__local__/api/v1/comp/localCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YS(t,e){return Se("__local__/api/v1/comp/openCompPathInVscode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function GS(t){return Se("__local__/api/v1/comp/packageJson",{method:"POST",...t||{}})}async function QS(t,e){return Se("__local__/api/v1/comp/submit",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function XS(t,e){return Se("__local__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function JS(t,e){return Se("__local__/api/v1/comp/updateVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheck:DS,compcontrollerCheckcomprepeat:LS,compcontrollerCompfilehash:jS,compcontrollerCompfilesosssignedurl:zS,compcontrollerDep:NS,compcontrollerDir:US,compcontrollerDownload:VS,compcontrollerFile:BS,compcontrollerGeneratecompjson:HS,compcontrollerLocalcompdetailbypathhash:qS,compcontrollerLocalcomps:WS,compcontrollerLocalcompsbyids:KS,compcontrollerOpencomppathinvscode:YS,compcontrollerPackagejson:GS,compcontrollerSubmit:QS,compcontrollerUpdate:XS,compcontrollerUpdateversion:JS},Symbol.toStringTag,{value:"Module"}));async function eC(t){return Se("__local__/api/v1/module/clearPreBuild",{method:"POST",...t||{}})}async function tC(t,e){return Se("__local__/api/v1/module/preBuild",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function nC(t){return Se("__local__/api/v1/module/preBuildSize",{method:"POST",...t||{}})}const iC=Object.freeze(Object.defineProperty({__proto__:null,modulecontrollerClearprebuild:eC,modulecontrollerPrebuild:tC,modulecontrollerPrebuildsize:nC},Symbol.toStringTag,{value:"Module"}));async function oC(t,e){return Se("__local__/api/v1/oss/fileSignUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const rC=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerFilesignurl:oC},Symbol.toStringTag,{value:"Module"}));async function sC(t,e){return Se("__local__/api/v1/preprocessing/preprocess",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const aC=Object.freeze(Object.defineProperty({__proto__:null,preprocessingcontrollerPreprocess:sC},Symbol.toStringTag,{value:"Module"}));async function lC(t,e){return Se("__local__/api/v1/vuefinder/list",{method:"GET",params:{...t},...e||{}})}const cC=Object.freeze(Object.defineProperty({__proto__:null,vuefindercontrollerList:lC},Symbol.toStringTag,{value:"Module"})),uC={v1Comp:ZS,v1Module:iC,v1Oss:rC,v1Preprocessing:aC,v1Vuefinder:cC};async function dC(t,e){return Se("__remote__/api/v1/comp/checkCompExistByHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function hC(t,e){return Se("__remote__/api/v1/comp/checkCompExistById",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function fC(t,e){return Se("__remote__/api/v1/comp/checkVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function pC(t,e){return Se("__remote__/api/v1/comp/collect",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mC(t,e){return Se("__remote__/api/v1/comp/collectedComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vC(t,e){return Se("__remote__/api/v1/comp/compDetail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gC(t,e){return Se("__remote__/api/v1/comp/compHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function _C(t,e){return Se("__remote__/api/v1/comp/comps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yC(t,e){return Se("__remote__/api/v1/comp/compsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bC(t,e){return Se("__remote__/api/v1/comp/deleteFailedComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wC(t,e){return Se("__remote__/api/v1/comp/deleteMyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function SC(t,e){return Se("__remote__/api/v1/comp/existCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function CC(t,e){return Se("__remote__/api/v1/comp/myComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function EC(t,e){return Se("__remote__/api/v1/comp/similarComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function xC(t,e){return Se("__remote__/api/v1/comp/softDelete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function TC(t,e){return Se("__remote__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function $C(t,e){return Se("__remote__/api/v1/comp/updateBasicInfo",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function kC(t,e){return Se("__remote__/api/v1/comp/updateCompDownloadCount",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function OC(t,e){return Se("__remote__/api/v1/comp/updateObjectId",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function AC(t,e){return Se("__remote__/api/v1/comp/upgradeRecords",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function PC(t,e){return Se("__remote__/api/v1/comp/upload",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function RC(t,e){return Se("__remote__/api/v1/comp/versions",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const MC=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheckcompexistbyhash:dC,compcontrollerCheckcompexistbyid:hC,compcontrollerCheckversion:fC,compcontrollerCollect:pC,compcontrollerCollectedcomps:mC,compcontrollerCompdetail:vC,compcontrollerComphash:gC,compcontrollerComps:_C,compcontrollerCompsbyids:yC,compcontrollerDeletefailedcomp:bC,compcontrollerDeletemycomp:wC,compcontrollerExistcompsbyids:SC,compcontrollerMycomps:CC,compcontrollerSimilarcomps:EC,compcontrollerSoftdelete:xC,compcontrollerUpdate:TC,compcontrollerUpdatebasicinfo:$C,compcontrollerUpdatecompdownloadcount:kC,compcontrollerUpdateobjectid:OC,compcontrollerUpgraderecords:AC,compcontrollerUpload:PC,compcontrollerVersions:RC},Symbol.toStringTag,{value:"Module"}));async function IC(t){return Se("__remote__/api/v1/csrf/csrf",{method:"GET",...t||{}})}const FC=Object.freeze(Object.defineProperty({__proto__:null,csrfcontrollerGetcsrftoken:IC},Symbol.toStringTag,{value:"Module"}));async function DC(t,e){return Se("__remote__/api/v1/email/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const LC=Object.freeze(Object.defineProperty({__proto__:null,emailcontrollerSendcode:DC},Symbol.toStringTag,{value:"Module"}));async function jC(t,e){return Se("__remote__/api/v1/keyword/queryKeywordsComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const zC=Object.freeze(Object.defineProperty({__proto__:null,keywordcontrollerQuerykeywordscomp:jC},Symbol.toStringTag,{value:"Module"}));async function NC(t){return Se("__remote__/api/v1/oss/compOssDir",{method:"POST",...t||{}})}async function UC(t){return Se("__remote__/api/v1/oss/getSts",{method:"POST",...t||{}})}async function VC(t,e){return Se("__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const BC=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerCompossdir:NC,osscontrollerGetsts:UC,osscontrollerPutpolicy:VC},Symbol.toStringTag,{value:"Module"}));async function HC(t,e){return Se("__remote__/api/v1/team/addToTeamMyComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function qC(t){return Se("__remote__/api/v1/team/allMember",{method:"POST",...t||{}})}async function WC(t,e){return Se("__remote__/api/v1/team/applyList",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function KC(t,e){return Se("__remote__/api/v1/team/checkCompUpdatePermission",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YC(t,e){return Se("__remote__/api/v1/team/copyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function GC(t,e){return Se("__remote__/api/v1/team/create",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function QC(t){return Se("__remote__/api/v1/team/created",{method:"POST",...t||{}})}async function XC(t,e){return Se("__remote__/api/v1/team/delete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function JC(t){return Se("__remote__/api/v1/team/detail",{method:"POST",...t||{}})}async function ZC(t){return Se("__remote__/api/v1/team/exit",{method:"POST",...t||{}})}async function eE(t,e){return Se("__remote__/api/v1/team/findByCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function tE(t,e){return Se("__remote__/api/v1/team/handleApply",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function nE(t,e){return Se("__remote__/api/v1/team/join",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function iE(t){return Se("__remote__/api/v1/team/joined",{method:"POST",...t||{}})}async function oE(t,e){return Se("__remote__/api/v1/team/kickOut",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rE(t,e){return Se("__remote__/api/v1/team/member",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function sE(t,e){return Se("__remote__/api/v1/team/myTeamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function aE(t,e){return Se("__remote__/api/v1/team/removeComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function lE(t,e){return Se("__remote__/api/v1/team/removeMyTeamComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function cE(t,e){return Se("__remote__/api/v1/team/teamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function uE(t,e){return Se("__remote__/api/v1/team/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dE(t,e){return Se("__remote__/api/v1/team/updateCompCanUpdateUsers",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function hE(t,e){return Se("__remote__/api/v1/team/updateMenu",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function fE(t,e){return Se("__remote__/api/v1/team/updateTeamUserNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const pE=Object.freeze(Object.defineProperty({__proto__:null,teamcontrollerAddtoteammycomps:HC,teamcontrollerAllmember:qC,teamcontrollerApplylist:WC,teamcontrollerCheckcompupdatepermission:KC,teamcontrollerCopycomp:YC,teamcontrollerCreate:GC,teamcontrollerCreated:QC,teamcontrollerDelete:XC,teamcontrollerDetail:JC,teamcontrollerExit:ZC,teamcontrollerFindbycode:eE,teamcontrollerHandleapply:tE,teamcontrollerJoin:nE,teamcontrollerJoined:iE,teamcontrollerKickout:oE,teamcontrollerMember:rE,teamcontrollerMyteamcomps:sE,teamcontrollerRemovecompfromteam:aE,teamcontrollerRemovemyteamcomp:lE,teamcontrollerTeamcomps:cE,teamcontrollerUpdate:uE,teamcontrollerUpdatecompcanupdateusers:dE,teamcontrollerUpdatemenu:hE,teamcontrollerUpdateteamusernickname:fE},Symbol.toStringTag,{value:"Module"}));async function mE(t){return Se("__remote__/api/v1/token/approachExpire",{method:"POST",...t||{}})}async function vE(t){return Se("__remote__/api/v1/token/refresh",{method:"POST",...t||{}})}const gE=Object.freeze(Object.defineProperty({__proto__:null,tokencontrollerApproachexpire:mE,tokencontrollerRefresh:vE},Symbol.toStringTag,{value:"Module"}));async function _E(t,e){return Se("__remote__/api/v1/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yE(t){return Se("__remote__/api/v1/upgrade/logs",{method:"POST",...t||{}})}async function bE(t,e){return Se("__remote__/api/v1/upgrade/publish",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const wE=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerCheck:_E,upgradecontrollerLogs:yE,upgradecontrollerPublish:bE},Symbol.toStringTag,{value:"Module"}));async function SE(t,e){return Se("__remote__/api/v1/user/changeAvatar",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function CE(t,e){return Se("__remote__/api/v1/user/changeNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function EE(t,e){return Se("__remote__/api/v1/user/changePassword",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function xE(t){return Se("__remote__/api/v1/user/checkPassword",{method:"POST",...t||{}})}async function TE(t,e){return Se("__remote__/api/v1/user/login",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function $E(t,e){return Se("__remote__/api/v1/user/setAllowEmailLogin",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function kE(t,e){return Se("__remote__/api/v1/user/updateEmail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function OE(t){return Se("__remote__/api/v1/user/userInfo",{method:"POST",...t||{}})}async function AE(t){return Se("__remote__/api/v1/user/whoAmI",{method:"POST",...t||{}})}const PE=Object.freeze(Object.defineProperty({__proto__:null,usercontrollerChangeavatar:SE,usercontrollerChangenickname:CE,usercontrollerChangepassword:EE,usercontrollerCheckpassword:xE,usercontrollerLogin:TE,usercontrollerSetallowemaillogin:$E,usercontrollerUpdateemail:kE,usercontrollerUserinfo:OE,usercontrollerWhoami:AE},Symbol.toStringTag,{value:"Module"}));async function RE(t,e){return Se("__remote__/api/v2/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const ME=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerv2Check:RE},Symbol.toStringTag,{value:"Module"})),Ai={v1Comp:MC,v1Csrf:FC,v1Email:LC,v1Keyword:zC,v1Oss:BC,v1Team:pE,v1Token:gE,v1Upgrade:wE,v1User:PE,v2Upgrade:ME},IE=vi("personalStore",{state:()=>({userInfo:{},isPasswordSet:!1}),getters:{isAllowEmailLogin(t){return t.userInfo?.isAllowEmailLogin??!1}},actions:{setUserInfo(t){this.$patch(e=>{e.userInfo=t})},setIsPasswordSet(t){this.$patch(e=>{e.isPasswordSet=t})},async initUserInfo(){const t=await Ai.v1User.usercontrollerUserinfo();t.code===0&&this.setUserInfo(t.data)},async setEmail(t){this.$patch(e=>{e.userInfo.email=t})},async setNickname(t){this.$patch(e=>{e.userInfo.nickname=t})},async setAllowEmailLogin(t){await Ai.v1User.usercontrollerSetallowemaillogin({allow:t}).then(()=>{this.$patch(e=>{e.userInfo.isAllowEmailLogin=t})})}}}),FE=vi("moduleStore",{state:()=>({modules:{}}),actions:{setModules(t,e){this.$patch(n=>{n.modules[t]=e})},async loadModule(t){if(this.modules[t])return this.modules[t];const e=await import(t);return this.setModules(t,e),e}}}),yr=Ji(Kb,!0),Cc=vi("appStore",{state:()=>({}),getters:{collapse(){return yr.value}},actions:{toggleSideBar(){yr.value=!yr.value},setSideBarCollapse(t){t!==this.collapse&&(yr.value=t)}}}),DE=vi("team",{state:()=>({joinedTeams:[],createdTeams:[]}),actions:{setJoinedTeams(t){this.$patch(e=>{e.joinedTeams=t})},setCreatedTeams(t){this.$patch(e=>{e.createdTeams=t})},removeCreatedTeam(t){this.$patch(e=>{e.createdTeams=e.createdTeams.filter(n=>n._id!==t)})},addCreatedTeam(t){this.$patch(e=>{e.createdTeams.some(i=>i._id===t._id)||e.createdTeams.push(t)})},addJoinedTeam(t){this.$patch(e=>{e.joinedTeams.some(i=>i._id===t._id)||e.joinedTeams.push(t)})},removeJoinedTeam(t){this.$patch(e=>{e.joinedTeams=e.joinedTeams.filter(n=>n._id!==t)})},updateCreatedTeamItemById(t,e){this.$patch(n=>{const i=n.createdTeams.findIndex(o=>o._id===t);i!==-1&&(n.createdTeams[i]=e)})},getTeamDetail(t){return this.joinedTeams.find(n=>n._id===t)||this.createdTeams.find(n=>n._id===t)}}});function br(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)i!=="__proto__"&&(t[i]=n[i])}return t}var LE={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function yl(t,e){function n(o,r,s){if(!(typeof document>"u")){s=br({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(r,o)+a}}function i(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],s={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(u in s||(s[u]=t.read(c,u)),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:i,remove:function(o,r){n(o,"",br({},r,{expires:-1}))},withAttributes:function(o){return yl(this.converter,br({},this.attributes,o))},withConverter:function(o){return yl(br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var ym=yl(LE,{path:"/"});const jE={keyword:"关键词",confirm:"确定",cancel:"取消",close:"关闭",save:"保存",submit:"提交",delete:"删除",edit:"编辑",add:"添加",update:"更新",upload:"上传",download:"下载",refresh:"刷新",loading:"加载中",success:"成功",error:"错误",warning:"警告",info:"提示",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",open:"打开",search:"搜索",reset:"重置",clear:"清空",back:"返回",next:"下一步",prev:"上一步",finish:"完成",operation:"操作",status:"状态",yes:"是",no:"否",name:"名称",description:"描述",version:"版本",time:"时间",date:"日期",author:"作者",type:"类型",category:"分类",tag:"标签",content:"内容",setting:"设置",cache:"缓存",cacheSize:"已使用",clearCache:"清空缓存",clearCacheConfirm:"将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?",cacheCleared:"缓存已清空",newPage:"新页面打开",terminal:"终端",preview:"预览",doc:"文档",readme:"README.md",upgradeRecord:"更新记录",openInNewPage:"新页面打开",depInstall:"依赖安装",fullscreen:"全屏",exitFullscreen:"退出全屏",maximizeRestore:"最大化/还原",siteSlogan:"原子化组件社区,让组件流通更简单。",siteSubtitle:"Vue 组件共享平台",docsTutorial:"文档教程",empty:"暂无数据",noReadme:"组件没有配置README.md文件",dragSort:"拖拽排序",filter:"筛选",apply:"应用",person:"人",unit:"个",pleaseSelect:"请选择",pleaseInput:"请输入",me:"我",generate:"生成",regenerate:"重新生成",generateSuccess:"生成成功",moreOperations:"更多操作",more:"更多",maxTagCount:"最大标签数量"},zE={keywordPlaceholder:"请输入组件名称/描述",title:"组件",name:"组件名称",fieldId:"组件ID",fieldName:"组件名称",fieldVersion:"版本号",desc:"组件描述",remarksDesc:"备注说明",remarksDescRequired:"请输入备注说明",pleaseInputCompName:"请输入组件名称",pleaseInputRemarks:"请输入备注,有助于组件市场检索",compNameRequired:"组件名称不能为空",compNameNamingRule:"组件名只能是「大驼峰(PascalCase)」或「短横线(kebab-case)」命名法",lengthBetween:"长度在 {min} 到 {max} 个字符",version:"组件版本",detail:"组件详情",preview:"组件预览",previewConfig:"预览配置",previewList:"预览列表",uploadPreview:"组件上传预览",updatePreview:"组件更新预览",download:"下载组件",update:"更新组件",upload:"上传组件",submit:"提交组件",edit:"编辑组件",add:"添加组件",delete:"删除组件",local:"本地组件",remote:"远程组件",online:"在线组件",similar:"相似组件",similarTeam:"团队内相似组件",dir:"组件目录",file:"组件文件",entry:"入口文件",previewEntry:"预览入口地址",previewEntryFull:"预览入口地址(全屏窗口)",addPreviewEntry:"添加预览入口",maxPreviewEntry:"最多添加{n}个预览入口",pleaseAddPreviewEntry:"请添加预览入口",miniPreviewFile:"小窗预览文件",fullPreviewFile:"全屏预览文件",pleaseSelectPreviewFile:"请选择预览文件",remarkDesc:"备注说明",dep:"组件依赖",localDep:"组件依赖(本地)",onlineDep:"组件依赖(线上)",finalDep:"最终依赖",localVersion:"本地:",onlineVersion:"线上:",onlineDepEmpty:"线上依赖暂无数据!",versionConsistent:"版本一致",versionChange:"版本变化,请手动选择最终版本",versionChangeConfirmed:"已确认",newDep:"新增依赖",miniPanel:"小窗面板",fullPanel:"全屏面板",reload:"重新加载",uploadProtocol:"组件发布协议",bgPanel:"背景板",compLocation:"组件位置",pleaseSelectFolderFirst:"请先选择文件夹",compAlreadyUploaded:"组件已经上传,更新操作请前往我的组件或团队组件",affirmDep:"组件依赖(确认的版本)",checkConfig:"配置检查",checkError:"报错信息",extraInfo:"附加信息",baseInfo:"基础信息",upgradeLog:"更新说明",pleaseInputUpgradeLog:"请填写更新说明",config:"组件配置",configStatus:"组件配置检查状态",configError:"配置异常",configCheckError:"配置检查报错",needUpgrade:"需要升级",fileChanged:"组件文件有变化",versionChanged:"版本号变化",fileNoChange:"文件没有变化",markdownValid:"Markdown预览校验通过",noMarkdown:"没有md文件",hash:"文件哈希",localHash:"本地组件文件hash",remoteHash:"线上组件文件hash",remoteVersion:"线上组件版本号",remoteVersionPrefix:"线上:",localVersionPrefix:"本地:",versionCompare:"版本号比较结果",carouselIndex:"组件预览走马灯index",bgColor:"组件背景颜色",dialogType:"组件弹窗类型",repeat:"组件重复检查",existLocal:"组件在本地存在",scopeId:"作用域id",tempDir:"组件临时目录",submitLimit:"组件提交限制",maxSize:"总大小限制",maxCount:"文件数量限制",matchType:"匹配类型",updateType:"更新类型",updateOnline:"在线更新",updateOffline:"离线更新",compOfflineUpdate:"组件离线更新",compOnlineUpdate:"组件在线更新",folder:"文件夹",compNotInLocal:"组件不在本地,继续更新只能更新组件描述,预览配置等基础信息,是否继续?",selectUpdateFolder:"请选择要更新的文件夹",openInVscode:"在 VS Code 中打开",openingInEditor:"在编辑器中打开...",updateSuccess:"更新成功",downloadVersionConfirm:"当前选择的版本为:{version},确认下载吗?",downloading:"组件下载中...",downloadPathConfirm:"是否下载组件到【{path}】路径下",downloadCoverConfirm:"组件【{name}】已经下载或者有同名组件,是否覆盖?",uncollectConfirm:"是否取消收藏组件【{name}】,取消收藏后组件将不再显示在收藏列表中,是否继续?",deleteConfirm:"是否删除组件【{name}】,删除组件后会释放占用的组件名称,是否继续?",collect:"收藏",uncollect:"取消收藏",collected:"已收藏",uncollected:"未收藏",entryFile:"入口文件",configFile:"配置文件",fileChangedNeedVersion:"文件内容改变,请增加版本号",viewFileChanges:"查看文件变化",versionChangedButFileSame:"版本号改变,但文件内容未改变,请还原版本号",errorMsg:"错误信息",versionCannotBeLessThanLatest:"版本号不能小于最新版本{version}",uploadAnyway:"仍然上传",compileError:"组件编译失败",formatCode:"格式化代码:",formatCodeTooltip:"仅格式化对比时的文件,不会格式化原始文件",noChanges:"暂无变更",diff:{changed:"M 改变",unchanged:"U 未改变",added:"A 新增",deleted:"D 删除"}},NE={title:"团队",name:"团队名称",code:"团队码",desc:"团队描述",create:"创建团队",join:"加入团队",exit:"退出团队",exitConfirm:"退出确认",manage:"团队管理",setting:"团队设置",member:"团队成员",memberCount:"成员数",maxMember:"最大成员数",compCount:"组件数量",maxCompCount:"最大组件数量",creator:"创建者",downloadCount:"下载量",collectCount:"收藏量",createTime:"创建时间",myTeam:"我的团队",joinedTeam:"已加入团队",space:"团队空间",noJoined:"暂无加入的团队",noCreated:"暂无创建的团队",createCountLimit:"最大允许创建的团队数量",joinCountLimit:"允许最多加入的团队数量",compList:"团队组件列表",myCompList:"我的组件",compGroup:"团队组件分组",compGroupList:"团队组件分组列表",addMyComp:"团队添加我的组件",compUpdate:"团队我的组件更新",addFromMine:"去我的组件添加",applyList:"申请列表",nickname:"团队昵称",noTeamInfo:"暂无团队信息",compLib:"组件库",groupConfig:"分组配置",compManage:"组件管理",unsavedDataLeave:"分组配置数据未保存,确定要离开吗?",leave:"离开",disbandTeam:"解散团队",applyAudit:"申请审核",teamName:"团队名称",fillTeamCode:"填写团队码",pleaseInputTeamCode:"请输入团队码",teamIdNotExist:"团队ID不存在",joinSuccess:"加入团队成功",applyJoinTeam:"申请加入团队",showRepeatComp:"展示重复组件",allowAuthorDelete:"作者删除组件权限",teamIntro:"团队介绍",fillTeamName:"填写团队名称",pleaseInputTeamName:"请输入团队名称",pleaseInputTeamDesc:"请输入团队介绍",createSuccess:"创建团队成功",charLength:"长度在 {min} 到 {max} 个字符",disbandConfirm:"确定解散团队吗,解散后所有成员和组件将被移除,并且无法恢复?",deleteConfirm:"删除确认",inputAuthCode:"请输入验证码",disbandSuccess:"解散团队成功",reject:"拒绝",agree:"同意",approved:"已同意",rejected:"已拒绝",kickOut:"踢出",teamUserNickname:"团队内昵称",pleaseInputTeamNickname:"请输入你在团队的昵称",normalUser:"普通用户",kickOutConfirm:"确定踢出用户【{name}】吗?",kickOutSuccess:"踢出成功",selectCanUpdateUser:"选择可更新用户",authorAutoAuth:"作者自带授权",updateAuth:"更新授权",updateTime:"更新时间",expandAll:"展开全部",createGroup:"创建分组",unsaved:"未保存",pleaseInputGroupName:"请输入分组名称",addComp:"添加组件",added:"已添加",notAdded:"未添加",defaultGroup:"默认分组",deleteGroupConfirm:"确认删除该分组吗?删除后该分组下的所有组件将被移除分组",addSuccess:"添加成功",isGrouped:"是否分组",grouped:"已分组",ungrouped:"未分组",group:"分组",prevVersion:"升级前版本",newVersion:"升级后版本",upgradeDesc:"升级描述",similarCompInTeam:"团队内相似组件",similarComp:"相似组件",deleteCompConfirm:"是否删除团队组件【{name}】,删除组件后团队成员将无法使用该组件,是否继续?",descTitle:"为业务团队打造专属组件空间",descItem1:"创建私密团队,组件仅对成员可见,保护核心资产",descItem2:"每个账号最多可创建 {count} 个团队",descItem3:"每个账号最多可加入 {count} 个团队",descItem4:"基础版团队支持最多 {count} 名成员",descItem5:"基础版团队可管理最多 {count} 个组件",descItem6:"支持创建分组菜单,灵活组织团队组件"},UE={title:"用户",username:"用户名",account:"账号",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",confirmNewPassword:"确认新密码",pleaseInputNewPassword:"请输入新密码",pleaseConfirmNewPassword:"请确认新密码",passwordModified:"密码修改成功",email:"邮箱",oldEmail:"旧邮箱",newEmail:"新邮箱",phone:"手机号",avatar:"头像",nickname:"昵称",login:"登录",logout:"退出登录",register:"注册",forgotPassword:"忘记密码",resetPassword:"重置密码",changePassword:"修改密码",changeNickname:"修改昵称",pleaseInputNickname:"请输入昵称",changeAvatar:"修改头像",avatarModified:"头像修改成功",changeEmail:"修改邮箱",basicInfo:"基本信息",securitySettings:"安全设置",loginPassword:"登录密码",passwordTip:"建议定期更换密码,确保账号安全",setPassword:"设置密码",emailLogin:"邮箱登录",emailLoginTip:"允许使用邮箱作为登录账号",pleaseSetPasswordFirst:"请先设置登录密码",emailLoginEnabled:"邮箱登录已开启",emailLoginDisabled:"邮箱登录已关闭",registerTime:"注册时间",notBound:"未绑定",change:"更换",bind:"绑定",authCode:"验证码",oldAuthCode:"旧验证码",newAuthCode:"新验证码",sendAuthCode:"发送验证码",resendAuthCode:"重新发送",getAuthCode:"获取验证码",pleaseInputAuthCode:"请输入验证码",pleaseInputNewAuthCode:"请输入新验证码",resendAfterSeconds:"{n}秒后重新获取",accountLogin:"账号登录",pleaseInputAccount:"请输入账号",pleaseInputUsername:"请输入用户名",pleaseInputPassword:"请输入密码",pleaseInputEmail:"请输入邮箱",pleaseInputOldEmail:"请输入旧邮箱",pleaseInputNewEmail:"请输入新邮箱",pleaseInputCorrectEmail:"请输入正确的邮箱",emailModified:"邮箱修改成功",newAuthCodeSent:"新验证码已发送",authCodeSent:"验证码已发送",guestLogin:"游客访问",loginSuccess:"登录成功",userInfo:"用户信息",personalCenter:"个人中心",myComp:"我的组件",guest:"游客",notLoggedIn:"未登录",goLogin:"去登录"},VE={title:"文件",name:"文件名",path:"文件路径",size:"文件大小",type:"文件类型",dir:"文件夹",selectDir:"选择文件夹",upload:"文件上传",download:"文件下载",select:"选择",multiSelect:"不支持多选",onlyDir:"只能选择文件夹",rootDir:"根目录",projectPath:"项目路径",currentDir:"当前目录",parentDir:"上级目录",refreshDir:"刷新文件夹列表"},BE={success:{download:"下载成功",update:"更新成功",delete:"删除成功",collect:"收藏成功",uncollect:"取消收藏成功",save:"保存成功",submit:"提交成功",upload:"上传成功",copy:"复制成功",operation:"操作成功",sendAuthCode:"验证码已发送",exitTeam:"退出成功"},error:{download:"下载失败",update:"更新失败",delete:"删除失败",collect:"收藏失败",uncollect:"取消收藏失败",save:"保存失败",submit:"提交失败",upload:"上传失败",copy:"复制失败",operation:"操作失败",load:"加载失败",network:"网络错误",timeout:"请求超时",unknown:"未知错误",pleaseFixCompileError:"请先处理编译错误",loginExpired:"登录已过期,请重新登录",refreshFailed:"刷新失败",requestFailed:"请求失败,请联系管理员",storageNotSupported:"浏览器不支持 storage.estimate API"},noUpdatePermission:"当前组件您没有更新权限,请联系管理员获取权限",confirm:{delete:"确定删除吗?",submit:"确定提交吗?",update:"确定更新吗?",exit:"确定退出吗?",cancel:"确定取消吗?"},loginRequired:"请先登录",fileExceed:"最多只能选择 {limit} 个文件,本次已选择 {selected} 个,共将上传 {total} 个文件",validate:{required:"必填项",format:"格式不正确",min:"不能小于最小值",max:"不能超过最大值",length:"长度不正确",email:"邮箱格式不正确",phone:"手机号格式不正确",imageFormat:"上传文件只能是图片格式",pleaseSelectFile:"请先选择文件",fileMaxSize:"上传文件大小不能超过 {size}MB!"}},HE={404:"页面不存在",share:"组件市场",collect:"收藏组件",collectSimple:"收藏",mine:"我的组件",mineSimple:"我的",local:"本地组件",localSimple:"本地",team:"团队",upload:"上传组件",uploadSimple:"上传",uploadTeam:"上传团队组件",setting:"设置",userInfo:"用户信息",upgrade:"更新",terminal:"终端",preview:"组件预览",previewLocal:"本地组件预览",previewTeam:"团队组件预览",previewBlank:"预览",similarPreview:"相似组件预览",login:"登录",mdPreview:"文档预览",unknownTag:"未知标签"},qE={parse:"解析 Markdown",loading:"加载 Markdown",error:"加载失败",toc:"目录",anchor:"锚点"},WE={title:"终端",open:"打开终端",close:"关闭终端",execute:"执行命令",shutdown:"关闭进程",timeout:"超时时间",disconnected:"终端已断开连接"},KE={title:"依赖",name:"依赖名称",version:"依赖版本",install:"安装依赖",installing:"安装中",installed:"已安装",prebuild:"预构建",prebuildSize:"预构建大小",clearPrebuild:"清空预构建",batchSetting:"批量设置",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"仅安装",majorVersion:"主版本",minorVersion:"主次版本",exactVersion:"完全一致"}},YE={title:"设置",previewRule:"预览规则",other:"其他设置",theme:"主题",language:"语言",darkMode:"暗黑模式",lightMode:"明亮模式"},GE={title:"版本更新",current:"当前版本",latest:"最新版本",check:"检查更新",upgrading:"更新中",upgraded:"已更新",publish:"发布更新",record:"更新记录",log:"更新日志",hasUpdate:"有更新",betaVersion:"内测版",noUpdate:"暂无更新",updateMethod:"更新方式",openTerminalAndRun:"打开终端,执行以下命令:",cannotIgnoreUpdate:"不可忽略此次更新"},QE={systemRecommended:"系统推荐",all:"全部",latest:"最新",hottest:"最热"},XE={submit:"提交"},JE={empty:"不能为空",notString:"必须是字符串类型,当前类型为: {type}",contentEmpty:"内容不能为空",startsWithNumber:'内容不能以数字开头,当前以 "{char}" 开头',invalidCharBacktick:"内容包含反引号(Markdown 语法标记),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharNewline:"内容包含换行符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharCarriageReturn:"内容包含回车符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharTab:"内容包含制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharFormFeed:"内容包含换页符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharVerticalTab:"内容包含垂直制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHash:"内容包含 # 字符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHtmlSpecial:'内容包含 HTML 特殊字符 "{char}",特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格',invalidCharUnknown:'内容包含非法字符 "{char}"(Unicode: U+{code}),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格'},ZE={common:jE,comp:zE,team:NE,user:UE,file:VE,message:BE,route:HE,markdown:qE,terminal:WE,deps:KE,setting:YE,upgrade:GE,tag:QE,formCreate:XE,validateHash:JE},e2={keyword:"Keyword",confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",submit:"Submit",delete:"Delete",edit:"Edit",add:"Add",update:"Update",upload:"Upload",download:"Download",refresh:"Refresh",loading:"Loading",success:"Success",error:"Error",warning:"Warning",info:"Info",copy:"Copy",copied:"Copied",copySuccess:"Copy successful",copyFailed:"Copy failed",open:"Open",search:"Search",reset:"Reset",clear:"Clear",back:"Back",next:"Next",prev:"Previous",finish:"Finish",operation:"Operation",status:"Status",yes:"Yes",no:"No",name:"Name",description:"Description",version:"Version",time:"Time",date:"Date",author:"Author",type:"Type",category:"Category",tag:"Tag",content:"Content",setting:"Setting",cache:"Cache",cacheSize:"Used",clearCache:"Clear Cache",clearCacheConfirm:"This will clear browser single-file compilation results and module pre-compilation files. Confirm to clear cache?",cacheCleared:"Cache cleared",newPage:"Open in new page",terminal:"Terminal",preview:"Preview",doc:"Documentation",readme:"README.md",upgradeRecord:"Update Record",openInNewPage:"Open in new page",depInstall:"Dependency Installation",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",maximizeRestore:"Maximize/Restore",siteSlogan:"Atomic Component Community, Making Component Sharing Easier.",siteSubtitle:"Vue Component Sharing Platform",docsTutorial:"Documentation",empty:"No data",noReadme:"Component has no README.md file configured",dragSort:"Drag to sort",filter:"Filter",apply:"Apply",person:"people",unit:"items",pleaseSelect:"Please select",pleaseInput:"Please input",me:"Me",generate:"Generate",regenerate:"Regenerate",generateSuccess:"Generated successfully",moreOperations:"More Operations",more:"More",maxTagCount:"Max Tag Count"},t2={keywordPlaceholder:"Please input component name or description",title:"Component",name:"Component Name",fieldId:"Component ID",fieldName:"Component Name",fieldVersion:"Version",desc:"Component Description",remarksDesc:"Remarks",remarksDescRequired:"Please enter remarks",pleaseInputCompName:"Please enter component name",pleaseInputRemarks:"Please enter remarks to help with component market search",compNameRequired:"Component name is required",compNameNamingRule:"Component name must be in PascalCase or kebab-case",lengthBetween:"Length must be between {min} and {max} characters",version:"Component Version",detail:"Component Detail",preview:"Component Preview",previewConfig:"Preview Config",previewList:"Preview List",uploadPreview:"Component Upload Preview",updatePreview:"Component Update Preview",download:"Download Component",update:"Update Component",upload:"Upload Component",submit:"Submit Component",edit:"Edit Component",add:"Add Component",delete:"Delete Component",local:"Local Component",remote:"Remote Component",online:"Online Component",similar:"Similar Components",similarTeam:"Similar Components in Team",dir:"Component Directory",file:"Component File",entry:"Entry File",previewEntry:"Preview Entry Address",previewEntryFull:"Preview Entry Address (Fullscreen)",addPreviewEntry:"Add Preview Entry",maxPreviewEntry:"Maximum {n} preview entries allowed",pleaseAddPreviewEntry:"Please add a preview entry",miniPreviewFile:"Mini Preview File",fullPreviewFile:"Full Preview File",pleaseSelectPreviewFile:"Please select preview file",remarkDesc:"Remarks",dep:"Component Dependencies",localDep:"Component Dependencies (Local)",onlineDep:"Component Dependencies (Online)",finalDep:"Final Dependencies",localVersion:"Local: ",onlineVersion:"Online: ",onlineDepEmpty:"No online dependency data!",versionConsistent:"Version Consistent",versionChange:"Version changed, please select final version",versionChangeConfirmed:"Confirmed",newDep:"New Dependency",miniPanel:"Mini Panel",fullPanel:"Full Panel",reload:"Reload",uploadProtocol:"Upload Protocol",bgPanel:"Background",compLocation:"Component Location",pleaseSelectFolderFirst:"Please select a folder first",compAlreadyUploaded:"Component already uploaded, please go to My Components or Team Components to update",affirmDep:"Component Dependencies (Confirmed Version)",checkConfig:"Config Check",checkError:"Error Info",extraInfo:"Extra Info",baseInfo:"Basic Info",upgradeLog:"Upgrade Log",pleaseInputUpgradeLog:"Please enter upgrade description",config:"Component Config",configStatus:"Component Config Check Status",configError:"Config Error",configCheckError:"Config Check Error",needUpgrade:"Needs Upgrade",fileChanged:"Component files changed",versionChanged:"Version changed",fileNoChange:"Files unchanged",markdownValid:"Markdown preview validation passed",noMarkdown:"No markdown file",hash:"File Hash",localHash:"Local Component File Hash",remoteHash:"Remote Component File Hash",remoteVersion:"Remote Component Version",remoteVersionPrefix:"Online: ",localVersionPrefix:"Local: ",versionCompare:"Version Comparison Result",carouselIndex:"Component Preview Carousel Index",bgColor:"Component Background Color",dialogType:"Component Dialog Type",repeat:"Component Repeat Check",existLocal:"Component exists locally",scopeId:"Scope ID",tempDir:"Component Temp Directory",submitLimit:"Component Submit Limit",maxSize:"Total Size Limit",maxCount:"File Count Limit",matchType:"Match Type",updateType:"Update Type",updateOnline:"Online Update",updateOffline:"Offline Update",compOfflineUpdate:"Component Offline Update",compOnlineUpdate:"Component Online Update",folder:"Folder",compNotInLocal:"Component is not local. Continuing will only update basic information like description and preview config. Continue?",selectUpdateFolder:"Please select folder to update",openInVscode:"Open in VS Code",openingInEditor:"Opening in editor...",updateSuccess:"Update successful",downloadVersionConfirm:"The currently selected version is: {version}, confirm download?",downloading:"Downloading component...",downloadPathConfirm:"Download component to path [{path}]?",downloadCoverConfirm:"Component [{name}] already exists or has a duplicate name, overwrite?",uncollectConfirm:"Are you sure you want to uncollect component [{name}]? It will no longer appear in your collection list.",deleteConfirm:"Are you sure you want to delete component [{name}]? This will free up the component name and cannot be undone.",collect:"Collect",uncollect:"Uncollect",collected:"Collected",uncollected:"Not Collected",entryFile:"Entry File",configFile:"Config File",fileChangedNeedVersion:"File content changed, please increment version",viewFileChanges:"View File Changes",versionChangedButFileSame:"Version changed but file content unchanged, please revert version",errorMsg:"Error Message",versionCannotBeLessThanLatest:"Version cannot be less than latest version {version}",uploadAnyway:"Upload Anyway",compileError:"Component compilation failed",formatCode:"Format Code:",formatCodeTooltip:"Only formats files during comparison, original files remain unchanged",noChanges:"No changes",diff:{changed:"M Changed",unchanged:"U Unchanged",added:"A Added",deleted:"D Deleted"}},n2={title:"Team",name:"Team Name",code:"Team Code",desc:"Team Description",create:"Create Team",join:"Join Team",exit:"Exit Team",exitConfirm:"Exit Confirmation",manage:"Team Management",setting:"Team Settings",member:"Team Members",memberCount:"Member Count",maxMember:"Max Members",compCount:"Component Count",maxCompCount:"Max Components",creator:"Creator",downloadCount:"Downloads",collectCount:"Collections",createTime:"Create Time",myTeam:"My Teams",joinedTeam:"Joined Teams",space:"Team Space",noJoined:"No joined teams",noCreated:"No created teams",createCountLimit:"Max teams allowed to create",joinCountLimit:"Max teams allowed to join",compList:"Team Component List",myCompList:"My Component List",compGroup:"Team Component Group",compGroupList:"Team Component Group List",addMyComp:"Team Add My Component",compUpdate:"Team My Component Update",addFromMine:"Add from My Components",applyList:"Apply List",nickname:"Team Nickname",noTeamInfo:"No team information",compLib:"Component Library",groupConfig:"Group Config",compManage:"Component Management",unsavedDataLeave:"Group configuration data is not saved, are you sure you want to leave?",leave:"Leave",disbandTeam:"Disband Team",applyAudit:"Apply Audit",teamName:"Team Name",fillTeamCode:"Fill in Team Code",pleaseInputTeamCode:"Please enter team code",teamIdNotExist:"Team ID does not exist",joinSuccess:"Joined team successfully",applyJoinTeam:"Apply to Join Team",showRepeatComp:"Show Duplicate Components",allowAuthorDelete:"Allow Author Delete",teamIntro:"Team Introduction",fillTeamName:"Fill in Team Name",pleaseInputTeamName:"Please enter team name",pleaseInputTeamDesc:"Please enter team description",createSuccess:"Team created successfully",charLength:"Length must be between {min} and {max} characters",disbandConfirm:"Are you sure you want to disband the team? All members and components will be removed and cannot be recovered.",deleteConfirm:"Delete Confirmation",inputAuthCode:"Please enter verification code",disbandSuccess:"Team disbanded successfully",reject:"Reject",agree:"Agree",approved:"Approved",rejected:"Rejected",kickOut:"Kick Out",teamUserNickname:"Team Nickname",pleaseInputTeamNickname:"Please enter your team nickname",normalUser:"Normal User",kickOutConfirm:"Are you sure you want to kick out user [{name}]?",kickOutSuccess:"Kicked out successfully",selectCanUpdateUser:"Select users who can update",authorAutoAuth:"Author has default authorization",updateAuth:"Update Authorization",updateTime:"Update Time",expandAll:"Expand All",createGroup:"Create Group",unsaved:"Unsaved",pleaseInputGroupName:"Please enter group name",addComp:"Add Component",added:"Added",notAdded:"Not Added",defaultGroup:"Default Group",deleteGroupConfirm:"Are you sure you want to delete this group? All components in this group will be removed from the group.",addSuccess:"Added successfully",isGrouped:"Is Grouped",grouped:"Grouped",ungrouped:"Ungrouped",group:"Group",prevVersion:"Previous Version",newVersion:"New Version",upgradeDesc:"Upgrade Description",similarCompInTeam:"Similar Components in Team",similarComp:"Similar Components",deleteCompConfirm:"Are you sure you want to delete team component [{name}]? Team members will no longer be able to use this component.",descTitle:"Create an Exclusive Component Space for Your Team",descItem1:"Create a private team where components are only visible to members, protecting core assets",descItem2:"Each account can create up to {count} teams",descItem3:"Each account can join up to {count} teams",descItem4:"Basic team supports up to {count} members",descItem5:"Basic team can manage up to {count} components",descItem6:"Support creating group menus to organize team components flexibly"},i2={title:"User",username:"Username",account:"Account",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",confirmNewPassword:"Confirm New Password",pleaseInputNewPassword:"Please enter new password",pleaseConfirmNewPassword:"Please confirm new password",passwordModified:"Password modified successfully",email:"Email",oldEmail:"Old Email",newEmail:"New Email",phone:"Phone",avatar:"Avatar",nickname:"Nickname",login:"Login",logout:"Logout",register:"Register",forgotPassword:"Forgot Password",resetPassword:"Reset Password",changePassword:"Change Password",changeNickname:"Change Nickname",pleaseInputNickname:"Please enter nickname",changeAvatar:"Change Avatar",avatarModified:"Avatar updated successfully",changeEmail:"Change Email",basicInfo:"Basic Information",securitySettings:"Security Settings",loginPassword:"Login Password",passwordTip:"Regularly change your password to ensure account security",setPassword:"Set Password",emailLogin:"Email Login",emailLoginTip:"Allow using email as login account",pleaseSetPasswordFirst:"Please set login password first",emailLoginEnabled:"Email login enabled",emailLoginDisabled:"Email login disabled",registerTime:"Registration Time",notBound:"Not Bound",change:"Change",bind:"Bind",authCode:"Verification Code",oldAuthCode:"Old Verification Code",newAuthCode:"New Verification Code",sendAuthCode:"Send Auth Code",resendAuthCode:"Resend",getAuthCode:"Get Code",pleaseInputAuthCode:"Please enter code",pleaseInputNewAuthCode:"Please enter new code",resendAfterSeconds:"Resend in {n}s",accountLogin:"Account Login",pleaseInputAccount:"Please enter account",pleaseInputUsername:"Please enter username",pleaseInputPassword:"Please enter password",pleaseInputEmail:"Please enter email",pleaseInputOldEmail:"Please enter old email",pleaseInputNewEmail:"Please enter new email",pleaseInputCorrectEmail:"Please enter correct email",emailModified:"Email modified successfully",newAuthCodeSent:"New verification code sent",authCodeSent:"Verification code sent",guestLogin:"Guest Access",loginSuccess:"Login successful",userInfo:"User Info",personalCenter:"Personal Center",myComp:"My Components",guest:"Guest",notLoggedIn:"Not logged in",goLogin:"Go to Login"},o2={title:"File",name:"Filename",path:"File Path",size:"File Size",type:"File Type",dir:"Directory",selectDir:"Select Directory",upload:"File Upload",download:"File Download",select:"Select",multiSelect:"Multiple selection not supported",onlyDir:"Only directories can be selected",rootDir:"Root Directory",projectPath:"Project Path",currentDir:"Current Directory",parentDir:"Parent Directory",refreshDir:"Refresh Directory List"},r2={success:{download:"Download successful",update:"Update successful",delete:"Delete successful",collect:"Collect successful",uncollect:"Uncollect successful",save:"Save successful",submit:"Submit successful",upload:"Upload successful",copy:"Copy successful",operation:"Operation successful",sendAuthCode:"Verification code sent",exitTeam:"Exit successful"},error:{download:"Download failed",update:"Update failed",delete:"Delete failed",collect:"Collect failed",uncollect:"Uncollect failed",save:"Save failed",submit:"Submit failed",upload:"Upload failed",copy:"Copy failed",operation:"Operation failed",load:"Load failed",network:"Network error",timeout:"Request timeout",unknown:"Unknown error",pleaseFixCompileError:"Please fix compilation errors first",loginExpired:"Login expired, please log in again",refreshFailed:"Refresh failed",requestFailed:"Request failed, please contact administrator",storageNotSupported:"Browser does not support storage.estimate API"},noUpdatePermission:"You do not have permission to update this component. Please contact the administrator for access.",confirm:{delete:"Are you sure to delete?",submit:"Are you sure to submit?",update:"Are you sure to update?",exit:"Are you sure to exit?",cancel:"Are you sure to cancel?"},loginRequired:"Please login first",fileExceed:"You can select at most {limit} files, {selected} selected this time, {total} total to be uploaded",validate:{required:"Required field",format:"Invalid format",min:"Cannot be less than minimum value",max:"Cannot exceed maximum value",length:"Invalid length",email:"Invalid email format",phone:"Invalid phone format",imageFormat:"Only image files are allowed",pleaseSelectFile:"Please select a file first",fileMaxSize:"File size cannot exceed {size}MB!"}},s2={404:"Page Not Found",share:"Component Market",collect:"Collected Components",collectSimple:"Collection",mine:"My Components",mineSimple:"Mine",local:"Local Components",localSimple:"Local",team:"Team",upload:"Upload Component",uploadSimple:"Upload",uploadTeam:"Upload Team Component",setting:"Settings",userInfo:"User Info",upgrade:"Upgrade",terminal:"Terminal",preview:"Component Preview",previewLocal:"Local Component Preview",previewTeam:"Team Component Preview",previewBlank:"Preview",similarPreview:"Similar Component Preview",login:"Login",mdPreview:"Document Preview",unknownTag:"Unknown Tag"},a2={parse:"Parse Markdown",loading:"Loading Markdown",error:"Load failed",toc:"Table of Contents",anchor:"Anchor"},l2={title:"Terminal",open:"Open Terminal",close:"Close Terminal",execute:"Execute Command",shutdown:"Shutdown Process",timeout:"Timeout",disconnected:"Terminal disconnected"},c2={title:"Dependencies",name:"Dependency Name",version:"Dependency Version",install:"Install Dependencies",installing:"Installing",installed:"Installed",prebuild:"Prebuild",prebuildSize:"Prebuild Size",clearPrebuild:"Clear Prebuild",batchSetting:"Batch Setting",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"Install Only",majorVersion:"Major Version",minorVersion:"Major + Minor",exactVersion:"Exact Match"}},u2={title:"Settings",previewRule:"Preview Rule",other:"Other Settings",theme:"Theme",language:"Language",darkMode:"Dark Mode",lightMode:"Light Mode"},d2={title:"Version Update",current:"Current Version",latest:"Latest Version",check:"Check for Updates",upgrading:"Updating",upgraded:"Updated",publish:"Publish Update",record:"Update Record",log:"Changelog",hasUpdate:"Update Available",betaVersion:"Beta",noUpdate:"No updates available",updateMethod:"Update Method",openTerminalAndRun:"Open terminal and run:",cannotIgnoreUpdate:"This update cannot be ignored"},h2={systemRecommended:"System Recommended",all:"All",latest:"Latest",hottest:"Hottest"},f2={submit:"Submit"},p2={empty:"Cannot be empty",notString:"Must be a string type, current type: {type}",contentEmpty:"Content cannot be empty",startsWithNumber:'Content cannot start with a number, currently starts with "{char}"',invalidCharBacktick:"Content contains backtick (Markdown syntax marker), only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharNewline:"Content contains newline character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharCarriageReturn:"Content contains carriage return, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharTab:"Content contains tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharFormFeed:"Content contains form feed character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharVerticalTab:"Content contains vertical tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHash:"Content contains # character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHtmlSpecial:'Content contains HTML special character "{char}", only hyphen(-), underscore(_), parentheses(), and spaces are allowed',invalidCharUnknown:'Content contains invalid character "{char}" (Unicode: U+{code}), only hyphen(-), underscore(_), parentheses(), and spaces are allowed'},m2={common:e2,comp:t2,team:n2,user:i2,file:o2,message:r2,route:s2,markdown:a2,terminal:l2,deps:c2,setting:u2,upgrade:d2,tag:h2,formCreate:f2,validateHash:p2},v2={zh:ZE,en:m2},g2=localStorage.getItem(Ib.LOCALE_KEY)||"zh",bm=E_({locale:g2,messages:v2,legacy:!1});function wm(t){t.use(bm)}const Ec=Object.freeze(Object.defineProperty({__proto__:null,i18n:bm,setup:wm},Symbol.toStringTag,{value:"Module"}));function _2({store:t}){t.$subscribe((...e)=>{const[n]=e;if(n.type==="direct")throw new Error("不允许直接修改store,建议使用action修改")})}const bl=x_();function Sm(t){bl.use(_2),t.use(bl)}const y2=Object.freeze(Object.defineProperty({__proto__:null,pinia:bl,setup:Sm},Symbol.toStringTag,{value:"Module"}));function b2(t){t.component("Icon",nw)}const{i18n:wo}=Ec,{pinia:pa}=y2,no=vi("userStore",{state:()=>({userInfo:{},guestUserInfo:{avatar:"",nickname:wo.global.t("user.guest"),account:""},logoutDialogOpen:!1}),getters:{userId:t=>t.userInfo._id,displayName(t){return sa()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname:t.userInfo.nickname||t.userInfo.account||wo.global.t("user.notLoggedIn")},avatar:t=>t.userInfo.avatar,avatarStr(t){return sa()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname[0]:t.userInfo.nickname?.[0]||t.userInfo.account?.[0]||""}},actions:{async fetchCsrfToken(){ym.get(vt.CSRF_KEY)||await Ai.v1Csrf.csrfcontrollerGetcsrftoken()},updateAvatar(t){this.$patch(e=>{e.userInfo&&(e.userInfo.avatar=t)})},updateNickname(t){this.$patch(e=>{e.userInfo&&(e.userInfo.nickname=t)})},setLogoutDialogOpen(t){this.$patch(e=>{e.logoutDialogOpen=t})},setUserInfo(t){this.$patch(e=>{e.userInfo=t})},login(t){return Ai.v1User.usercontrollerLogin({...t})},async fetchWhoAmI(){const t=await Ai.v1User.usercontrollerWhoami();t.data&&this.setUserInfo(t.data)},logout(){Is.push("/login?type=logout").then(t=>{t||(this.clearLocalStorage(),this.resetAll(),this.$reset())})},resetAll(){const t=Jo(),e=IE(),n=FE(),i=Cc(),o=DE();t?.$reset(),e?.$reset(),n?.$reset(),i?.$reset(),o?.$reset(),this.clearTeamHomeStores(),this.clearCompListStores(),this.clearCompEditStore()},clearLocalStorage(){Vb(),qb(),Wb()},clearTeamHomeStores(){for(const[t,e]of pa._s.entries())t.startsWith("teamHome")&&e.$reset()},clearCompListStores(){for(const[t,e]of pa._s.entries())t.startsWith("compList")&&e.$reset()},clearCompEditStore(){for(const[t,e]of pa._s.entries())t.startsWith("compEdit")&&e.$reset()},isRealUserLogin(){const t=Object.keys(this.userInfo),e=ss();return t.length>0&&e!==null},isAccessTokenExist(){return ss()!==null},isGuestLogin(){return sa()===vt.IS_GUEST_LOGIN},isLogin(){const t=this.isRealUserLogin(),e=this.isGuestLogin();return t||e},logoutDialog(){if(this.logoutDialogOpen)return;this.setLogoutDialogOpen(!0);const t={confirmButtonText:wo.global.t("user.goLogin"),showClose:!0,callback:e=>{this.setLogoutDialogOpen(!1),e==="confirm"&&this.logout()}};iy.alert(wo.global.t("message.loginRequired"),wo.global.t("common.info"),t)}}}),w2=Ce({__name:"SubMenu",props:{route:{},basePath:{}},setup(t){const{getTitle:e}=_c(),n=t,i=no(),o=(c,u="")=>Qw.resolve(c,u),r=te(()=>o(n.basePath||"",n.route.path)),s=te(()=>(n.route.children||[]).some(c=>!c.meta?.hidden)),a=te(()=>{const{children:c=[]}=n.route;return c.length===0||c.length===1&&!c[0]?.children?.length}),l=te(()=>{const{children:c=[],meta:u={}}=n.route;return u?.hidden?!1:i.isRealUserLogin()||c.length>0?!0:(i.isGuestLogin()||!i.isAccessTokenExist())&&n.route.meta?.noAuth});return(c,u)=>{const d=Ue("SubMenu",!0),h=Ro,v=oy;return l.value?(y(),T(Me,{key:0},[t.route.meta?.hideParent&&s.value?(y(!0),T(Me,{key:0},He(t.route.children,p=>(y(),ne(d,{key:o(r.value,p.path),route:p,"base-path":o(r.value,p.path)},null,8,["route","base-path"]))),128)):(y(),T(Me,{key:1},[a.value?(y(),ne(Jw,{key:0,route:t.route,"full-path":r.value},null,8,["route","full-path"])):(y(),ne(v,{key:1,index:r.value},{title:we(()=>[j(h,null,{default:we(()=>[(y(),ne($t(t.route?.meta?.icon)))]),_:1}),g("span",null,L(m(e)(t.route?.meta?.title)),1)]),default:we(()=>[(y(!0),T(Me,null,He(t.route.children,p=>(y(),ne(d,{key:o(r.value,p.path),route:p,"base-path":o(r.value,p.path)},null,8,["route","base-path"]))),128))]),_:1},8,["index"]))],64))],64)):ue("",!0)}}}),S2=Ce({__name:"index",setup(t){const e=Cc(),n=ws(),i=sc(),o=te(()=>n.options.routes),r=te(()=>i.path);return(s,a)=>{const l=ry;return y(),ne(l,{class:"dark:!bg-gray-800 border-t border-gray-200 dark:border-gray-700",collapse:m(e).collapse,"default-active":r.value},{default:we(()=>[(y(!0),T(Me,null,He(o.value,c=>(y(),T(Me,null,[c?.meta?.hidden?ue("",!0):(y(),ne(w2,{key:c.path,basePath:c.path,route:c},null,8,["basePath","route"]))],64))),256))]),_:1},8,["collapse","default-active"])}}}),C2={class:"flex gap-[20px] items-center pl-[10px] pr-[10px]"},E2=["title"],x2=["title"],T2=["title"],$2={class:"flex items-center gap-[10px]"},k2=Ce({__name:"index",setup(t){const{t:e}=Go(),n=Jo(),i=ws(),o=sc(),r=Ji($p,10),s=H(n.maxCache),a=()=>{i.back()},l=()=>{i.replace({path:o.path,query:{...o.query,[vt.ROUTE_STATE_KEY_VERSION]:Date.now()}})};function c(u){u&&n.setMaxCache(u)}return zt(()=>{r.value=n.maxCache}),(u,d)=>{const h=Ue("Icon"),v=ll,p=al;return y(),T("div",C2,[g("span",{title:m(e)("common.back")},[j(h,{icon:"material-symbols:arrow-back-rounded",class:"cursor-pointer",onClick:a})],8,E2),g("span",{title:m(e)("common.refresh")},[j(h,{icon:"material-symbols:refresh-rounded",class:"cursor-pointer",onClick:l})],8,x2),j(p,{placement:"bottom",trigger:"hover",width:"auto"},{reference:we(()=>[g("span",{title:m(e)("common.moreOperations")},[j(h,{icon:"material-symbols:article-outline",class:"cursor-pointer"})],8,T2)]),default:we(()=>[g("div",$2,[g("div",null,L(m(e)("common.maxTagCount"))+":",1),g("div",null,[j(v,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),min:1,style:{width:"90px"},"controls-position":"right",onChange:c},null,8,["modelValue"])])])]),_:1})])}}}),O2={class:"flex dark:bg-gray-800 py-[2px] h-[40px] border border-gray-200 dark:border-gray-700"},A2=Ce({__name:"index",setup(t){const{t:e}=Go(),n=ws(),i=sc(),o=Jo(),{getTitle:r}=_c();$e(()=>i,()=>{o.addView(i)},{immediate:!0,deep:!0});const s=te(()=>o.visitedViews),a=te(()=>s.value.length===1);function l(h){const v=c(h);o.delViewAndJumpToPrev(h.path,v,n)}function c(h){return h.path===i.path}function u(h){n.push(h)}function d(h){const v=h?.meta?.title||e("route.unknownTag"),p=o.getPayLoad(h.path);return r(p?.name||v)}return(h,v)=>{const p=Ue("Icon"),f=Ro,_=Qi,C=sy;return y(),T("div",O2,[j(k2),j(m(i0),{class:"flex-1 overflow-hidden",list:s.value,getKey:w=>w.path},{display:we(({visibleList:w,overflow:S})=>[j(T_,{tag:"ul",name:"fade",class:"flex gap-[5px] p-[2px] items-center"},{default:we(()=>[(y(!0),T(Me,null,He(w,b=>(y(),T("div",{key:b.path},[j(_,{type:c(b)?"primary":"default",onClick:E=>u(b)},{default:we(()=>[Ke(L(d(b))+" ",1),a.value?ue("",!0):(y(),ne(f,{key:0,style:{"font-size":"16px"},class:"ml-[5px]",onClick:Ye(E=>l(b),["stop"])},{default:we(()=>[j(p,{icon:"material-symbols:close"})]),_:1},8,["onClick"]))]),_:2},1032,["type","onClick"])]))),128)),S>0?(y(),ne(C,{key:0,type:"info"},{default:we(()=>[Ke("+"+L(S)+" "+L(m(e)("common.more")),1)]),_:2},1024)):ue("",!0)]),_:2},1024)]),measure:we(({item:w})=>[j(_,{type:"primary"},{default:we(()=>[Ke(L(d(w))+" ",1),a.value?ue("",!0):(y(),ne(f,{key:0,style:{"font-size":"16px"},class:"ml-[5px]"},{default:we(()=>[j(p,{icon:"material-symbols:close"})]),_:1}))]),_:2},1024)]),_:1},8,["list","getKey"])])}}}),P2=dc(A2,[["__scopeId","data-v-8b93a5e3"]]),R2={class:"size-full overflow-hidden"},M2={class:"h-[60px] dark:bg-gray-800"},I2={class:"size-full overflow-hidden flex flex-col dark:bg-gray-800"},F2={class:"dark:bg-gray-800"},D2={class:"size-full flex flex-col"},L2={class:""},j2={class:"flex-1 overflow-auto"},z2=Ce({__name:"index",setup(t){const e=qn(()=>nt(()=>import("./index-Cu1YAWdz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),n=qn(()=>nt(()=>import("./index-B6f_06zP.js"),__vite__mapDeps([8,1,2,9,10,11,12,13,14,15,16,17,18,6]))),i=H(68),o=H(200),r=H(60),s=H(""),a=H(""),l=te(()=>s.value?"transition-width duration-400":""),c=te(()=>a.value?"transition-height duration-300":""),u=te(()=>({class:c.value,size:v.value,collapsible:!0,resizable:!1})),d=te(()=>({class:l.value,min:i.value,max:300,collapsible:!0})),h=Ji(Yb,i.value),v=Ji(Gb,r.value),p=Cc(),f=no(),_=async(S,b)=>{s.value=b,b==="end"&&h.value===0&&(h.value=o.value)},C=(S,b)=>{a.value=b,b==="start"?v.value=0:b==="end"&&(v.value=r.value)},w=S=>{S==="header"?a.value="":S==="side"&&(s.value="")};return zt(()=>{p.setSideBarCollapse(h.value===i.value)}),(S,b)=>{const E=ay,x=cy,O=ly;return y(),T("div",R2,[j(O,{layout:"vertical",onCollapse:C},{default:we(()=>[j(E,We({class:"!overflow-hidden transform-gpu isolate will-change-height"},u.value,{onTransitionend:b[0]||(b[0]=$=>w("header")),onWebkitTransitionEnd:b[1]||(b[1]=$=>w("header"))}),{default:we(()=>[g("div",M2,[j(m(n))])]),_:1},16),j(E,{class:Ae(["transform-gpu isolate",c.value])},{default:we(()=>[j(O,{onCollapse:_},{default:we(()=>[j(E,We(d.value,{size:m(h),"onUpdate:size":b[2]||(b[2]=$=>Ss(h)?h.value=$:null),class:"transform-gpu isolate will-change-width",onTransitionend:b[3]||(b[3]=$=>w("side")),onWebkitTransitionEnd:b[4]||(b[4]=$=>w("side"))}),{default:we(()=>[g("div",I2,[j(S2),m(f).isRealUserLogin()?(y(),T(Me,{key:0},[g("div",F2,[j(x)]),j(m(e))],64)):ue("",!0)])]),_:1},16,["size"]),j(E,{class:Ae(["transform-gpu isolate !overflow-hidden",l.value])},{default:we(()=>[g("div",D2,[g("div",L2,[j(P2)]),g("div",j2,[(y(),ne($_,null,{default:we(()=>[j(Kw)]),_:1}))])])]),_:1},8,["class"])]),_:1})]),_:1},8,["class"])]),_:1})])}}}),Is=k_({history:O_(`/${vt.WEBSITE_PATH_MAIN}/`),routes:[{path:"/login",name:"login",component:()=>nt(()=>import("./index-CTLlcQoM.js"),__vite__mapDeps([19,1,2,12,13,14,20,21,3,22,23,18])),meta:{hidden:!0,noAuth:!0,title:"route.login"}},{path:"/upgrade",name:"upgrade",component:()=>nt(()=>import("./index-DvyE3TrH.js"),__vite__mapDeps([24,1,2,12,22,25,26,7,27])),meta:{hidden:!0,noAuth:!0,title:"route.upgrade"}},{path:"/mdPreview",name:"mdPreview",component:()=>nt(()=>import("./index-tEU6GnSH.js"),__vite__mapDeps([28,1,2,29,25,30])),meta:{hidden:!0,noAuth:!0,title:"route.mdPreview"}},{path:"/previewBlank/:compId/:version?",name:"previewBlank",component:()=>nt(()=>import("./index-CFH_ugiT.js"),__vite__mapDeps([31,2,32,33,1,34,35,36,7,4])),meta:{hidden:!0,noAuth:!0,title:"route.preview"}},{path:"/previewLocalBlank/:compId",name:"previewLocalBlank",component:()=>nt(()=>import("./index-uu5oSUvx.js"),__vite__mapDeps([37,2,38,39,1,15,34,35,18,7,4])),meta:{hidden:!0,noAuth:!0,title:"route.previewLocal"}},{path:"/similarPreview/:compId",name:"similarPreview",component:()=>nt(()=>import("./index-D7eOWAPr.js"),__vite__mapDeps([40,1,2,41,42,43,44,45,46,47,32,38,15,5,10,48,4,34,18,49,29,25,30,50,7,33,35,36,51])),meta:{hidden:!0,noAuth:!0,title:"route.similarPreview"}},{path:"/",component:z2,redirect:"/share",meta:{hideParent:!0},children:[{path:"/share",name:"share",meta:{title:"route.share",icon:qn(()=>nt(()=>import("./home-rounded-Dq-TBvLG.js"),__vite__mapDeps([52,16,2,53]))),noAuth:!0},component:()=>nt(()=>import("./index-CuHNNhtE.js"),__vite__mapDeps([54,1,2,47,32,38,15,5,10,48,4,34,18,55]))},{path:"/mine",name:"mine",meta:{title:"route.mine",icon:qn(()=>nt(()=>import("./supervised-user-circle-CEgKC7n7.js"),__vite__mapDeps([56,16,2,57])))},component:()=>nt(()=>import("./index-DC94GyXj.js"),__vite__mapDeps([58,1,2,47,32,38,15,5,10,48,4,34,18,59,60,61,29,25,30,35,51,3,62,7,63,55]))},{path:"/collect",name:"collect",meta:{title:"route.collect",icon:qn(()=>nt(()=>import("./kid-star-CFLIpXDC.js"),__vite__mapDeps([64,16,2,65])))},component:()=>nt(()=>import("./index-q4Z3Q7p4.js"),__vite__mapDeps([66,1,2,47,32,38,15,5,10,48,4,34,18,55]))},{path:"/local",name:"local",meta:{title:"route.local",icon:qn(()=>nt(()=>import("./sync-saved-locally-rounded-CmlRPNS9.js"),__vite__mapDeps([67,16,2,68]))),noAuth:!0},component:()=>nt(()=>import("./index-BIGvC1SM.js"),__vite__mapDeps([69,1,2,47,32,38,15,5,10,48,4,34,18]))},{path:"/upload",name:"upload",meta:{title:"route.upload",icon:qn(()=>nt(()=>import("./cloud-upload-CyIQfnxU.js"),__vite__mapDeps([70,16,2,71]))),noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-YUZjR2Eq.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,35,51,3,62,7,18,46,48,27]))},{path:"/uploadTeam/:teamId",name:"uploadTeam",meta:{title:"route.uploadTeam",hidden:!0},component:()=>nt(()=>import("./index-YUZjR2Eq.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,35,51,3,62,7,18,46,48,27]))},{path:"/userInfo",name:"userInfo",meta:{title:"route.userInfo",hidden:!0},component:()=>nt(()=>import("./index-BQWeT5qu.js"),__vite__mapDeps([73,1,2,21,3,5,20,74,9,10,11,75,7]))},{path:"/preview/:compId",meta:{title:"route.preview",noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-D7eOWAPr.js"),__vite__mapDeps([40,1,2,41,42,43,44,45,46,47,32,38,15,5,10,48,4,34,18,49,29,25,30,50,7,33,35,36,51]))},{path:"/previewLocal/:compId",meta:{title:"route.previewLocal",hidden:!0,noAuth:!0},component:()=>nt(()=>import("./index-Oo11MKfd.js"),__vite__mapDeps([76,1,2,38,49,29,25,30,48,47,32,15,5,10,4,34,18,50,7,39,35]))},{path:"/previewTeam/:teamId/:compId",meta:{title:"route.previewTeam",noAuth:!0,hidden:!0},props:{isTeamPreview:!0},component:()=>nt(()=>import("./index-D7eOWAPr.js"),__vite__mapDeps([40,1,2,41,42,43,44,45,46,47,32,38,15,5,10,48,4,34,18,49,29,25,30,50,7,33,35,36,51]))},{path:"/terminal",name:"terminal",meta:{title:"route.terminal",icon:qn(()=>nt(()=>import("./terminal-DykiTSV6.js"),__vite__mapDeps([77,16,2,78]))),noAuth:!0},component:()=>nt(()=>import("./index-DrUAgWBX.js"),__vite__mapDeps([79,43,2,44,1,45]))},{path:"/setting",name:"setting",meta:{title:"route.setting",icon:qn(()=>nt(()=>import("./settings-B3XnnICj.js"),__vite__mapDeps([80,16,2,81]))),noAuth:!0},component:()=>nt(()=>import("./index-ctwb4cB7.js"),__vite__mapDeps([82,1,2,51,83,7]))},{path:"/team/:teamId",name:"team",meta:{title:"route.team",hidden:!0},component:()=>nt(()=>import("./index-cFhtMyBi.js"),__vite__mapDeps([84,1,2,41,42,9,10,11,47,32,38,15,5,48,4,34,18,3,55,16,51,85,7]))}]},{path:"/:pathMatch(.*)*",name:"404",meta:{hidden:!0,noAuth:!0,title:"route.404"},component:()=>nt(()=>import("./index-Dl-mwEbG.js"),__vite__mapDeps([86,2,1]))}]});function N2(t){t.use(Is)}const U2=H([]);function V2(t){const e=ac(jw,{errors:U2.value}),n=document.createElement("div");n.id="error-container",e.mount(n),document.body.appendChild(n)}var Yr={exports:{}},B2=Yr.exports,Wd;function H2(){return Wd||(Wd=1,(function(t,e){(function(n,i){t.exports=i()})(B2,function(){function n(X){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V})(X)}function i(X,V){if(!(X instanceof V))throw new TypeError("Cannot call a class as a function")}function o(X,V){for(var J=0;J<V.length;J++){var ye=V[J];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(X,ye.key,ye)}}function r(X,V,J){V&&o(X.prototype,V),J&&o(X,J),Object.defineProperty(X,"prototype",{writable:!1})}function s(X,V,J){V in X?Object.defineProperty(X,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):X[V]=J}function a(X,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(V&&V.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),V&&c(X,V)}function l(X){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(V){return V.__proto__||Object.getPrototypeOf(V)})(X)}function c(X,V){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,ye){return J.__proto__=ye,J})(X,V)}function u(X,V){if(V&&(typeof V=="object"||typeof V=="function"))return V;if(V!==void 0)throw new TypeError("Derived constructors may only return object or undefined");if(V=X,V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function d(X){var V=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}})();return function(){var J,ye=l(X);return u(this,V?(J=l(this).constructor,Reflect.construct(ye,arguments,J)):ye.apply(this,arguments))}}function h(X,V){(V==null||V>X.length)&&(V=X.length);for(var J=0,ye=new Array(V);J<V;J++)ye[J]=X[J];return ye}function v(X,V){var J,ye=typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(!ye){if(Array.isArray(X)||(ye=(function(Z,ae){if(Z){if(typeof Z=="string")return h(Z,ae);var pe=Object.prototype.toString.call(Z).slice(8,-1);return(pe=pe==="Object"&&Z.constructor?Z.constructor.name:pe)==="Map"||pe==="Set"?Array.from(Z):pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe)?h(Z,ae):void 0}})(X))||V&&X&&typeof X.length=="number")return ye&&(X=ye),J=0,{s:V=function(){},n:function(){return J>=X.length?{done:!0}:{done:!1,value:X[J++]}},e:function(Z){throw Z},f:V};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var xe,se=!0,Ie=!1;return{s:function(){ye=ye.call(X)},n:function(){var Z=ye.next();return se=Z.done,Z},e:function(Z){Ie=!0,xe=Z},f:function(){try{se||ye.return==null||ye.return()}finally{if(Ie)throw xe}}}}function p(){if(f.url)window.location.href=f.url;else if(f.rewriteHTML)try{document.documentElement.innerHTML=f.rewriteHTML}catch{document.documentElement.innerText=f.rewriteHTML}else{try{window.opener=null,window.open("","_self"),window.close(),window.history.back()}catch(X){console.log(X)}setTimeout(function(){window.location.href=f.timeOutUrl||"https://theajack.github.io/disable-devtool/404.html?h=".concat(encodeURIComponent(location.host))},500)}}var f={md5:"",ondevtoolopen:p,ondevtoolclose:null,url:"",timeOutUrl:"",tkName:"ddtk",interval:500,disableMenu:!0,stopIntervalTime:5e3,clearIntervalWhenDevOpenTrigger:!1,detectors:[1,3,4,5,6,7],clearLog:!0,disableSelect:!1,disableInputSelect:!1,disableCopy:!1,disableCut:!1,disablePaste:!1,ignore:null,disableIframeParents:!0,seo:!0,rewriteHTML:""},_=["detectors","ondevtoolclose","ignore"];function C(X){var V,J=0<arguments.length&&X!==void 0?X:{};for(V in J.onDevtoolOpen&&(J.ondevtoolopen=J.onDevtoolOpen),J.onDevtoolClose&&(J.ondevtoolclose=J.onDevtoolClose),f){var ye=V;J[ye]===void 0||n(f[ye])!==n(J[ye])&&_.indexOf(ye)===-1||(f[ye]=J[ye])}typeof f.ondevtoolclose=="function"&&f.clearIntervalWhenDevOpenTrigger===!0&&(f.clearIntervalWhenDevOpenTrigger=!1,console.warn("【DISABLE-DEVTOOL】clearIntervalWhenDevOpenTrigger 在使用 ondevtoolclose 时无效"))}function w(){return new Date().getTime()}function S(X){var V=w();return X(),w()-V}function b(X,V){function J(Ie){return function(){X&&X();var Z=Ie.apply(void 0,arguments);return V&&V(),Z}}var ye=window.alert,xe=window.confirm,se=window.prompt;try{window.alert=J(ye),window.confirm=J(xe),window.prompt=J(se)}catch{}}var E,x,O,$={iframe:!1,pc:!1,qqBrowser:!1,firefox:!1,macos:!1,edge:!1,oldEdge:!1,ie:!1,iosChrome:!1,iosEdge:!1,chrome:!1,seoBot:!1,mobile:!1};function K(){function X(Dt){return V.indexOf(Dt)!==-1}var V=navigator.userAgent.toLowerCase(),J=(function(){var bt=navigator,Dt=bt.platform,bt=bt.maxTouchPoints;if(typeof bt=="number")return 1<bt;if(typeof Dt=="string"){if(bt=Dt.toLowerCase(),/(mac|win)/i.test(bt))return!1;if(/(android|iphone|ipad|ipod|arch)/i.test(bt))return!0}return/(iphone|ipad|ipod|ios|android)/i.test(navigator.userAgent.toLowerCase())})(),ye=!!window.top&&window!==window.top,xe=!J,se=X("qqbrowser"),Ie=X("firefox"),Z=X("macintosh"),ae=X("edge"),pe=ae&&!X("chrome"),ce=pe||X("trident")||X("msie"),be=X("crios"),$n=X("edgios"),Qt=X("chrome")||be,on=!J&&/(googlebot|baiduspider|bingbot|applebot|petalbot|yandexbot|bytespider|chrome\-lighthouse|moto g power)/i.test(V);Object.assign($,{iframe:ye,pc:xe,qqBrowser:se,firefox:Ie,macos:Z,edge:ae,oldEdge:pe,ie:ce,iosChrome:be,iosEdge:$n,chrome:Qt,seoBot:on,mobile:J})}function F(){for(var X=(function(){for(var ye={},xe=0;xe<500;xe++)ye["".concat(xe)]="".concat(xe);return ye})(),V=[],J=0;J<50;J++)V.push(X);return V}function P(){f.clearLog&&O()}var N="",I=!1;function q(){var X=f.ignore;if(X){if(typeof X=="function")return X();if(X.length!==0){var V=location.href;if(N===V)return I;N=V;var J,ye=!1,xe=v(X);try{for(xe.s();!(J=xe.n()).done;){var se=J.value;if(typeof se=="string"){if(V.indexOf(se)!==-1){ye=!0;break}}else if(se.test(V)){ye=!0;break}}}catch(Ie){xe.e(Ie)}finally{xe.f()}return I=ye}}}var le=function(){return!1};function de(X){var V,J,ye=74,xe=73,se=85,Ie=83,Z=123,ae=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&(be===xe||be===ye)}:function(ce,be){return ce.ctrlKey&&ce.shiftKey&&(be===xe||be===ye)},pe=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&be===se||ce.metaKey&&be===Ie}:function(ce,be){return ce.ctrlKey&&(be===Ie||be===se)};X.addEventListener("keydown",function(ce){var be=(ce=ce||X.event).keyCode||ce.which;if(be===Z||ae(ce,be)||pe(ce,be))return M(X,ce)},!0),V=X,f.disableMenu&&V.addEventListener("contextmenu",function(ce){if(ce.pointerType!=="touch")return M(V,ce)}),J=X,(f.disableSelect||f.disableInputSelect)&&Y(J,"selectstart"),J=X,f.disableCopy&&Y(J,"copy"),J=X,f.disableCut&&Y(J,"cut"),J=X,f.disablePaste&&Y(J,"paste")}function Y(X,V){X.addEventListener(V,function(J){if(!(ye=J.target)||ye.tagName!=="INPUT"&&ye.tagName!=="TEXTAREA"&&((xe=ye.getAttribute)==null?void 0:xe.call(ye,"contenteditable"))!=="true"){if(f.disableSelect)return M(X,J)}else if(f.disableInputSelect)return M(X,J);var ye,xe})}function M(X,V){if(!q()&&!le())return(V=V||X.event).returnValue=!1,V.preventDefault(),!1}var A,Q=!1,U={};function ie(X){U[X]=!1}function ve(){for(var X in U)if(U[X])return Q=!0;return Q=!1}(Pe=A=A||{})[Pe.Unknown=-1]="Unknown",Pe[Pe.RegToString=0]="RegToString",Pe[Pe.DefineId=1]="DefineId",Pe[Pe.Size=2]="Size",Pe[Pe.DateToString=3]="DateToString",Pe[Pe.FuncToString=4]="FuncToString",Pe[Pe.Debugger=5]="Debugger",Pe[Pe.Performance=6]="Performance",Pe[Pe.DebugLib=7]="DebugLib";var re=(function(){function X(ye){var J=ye.type,ye=ye.enabled,ye=ye===void 0||ye;i(this,X),this.type=A.Unknown,this.enabled=!0,this.type=J,this.enabled=ye,this.enabled&&(J=this,k.push(J),this.init())}return r(X,[{key:"onDevToolOpen",value:function(){var V;console.warn("You don't have permission to use DEVTOOL!【type = ".concat(this.type,"】")),f.clearIntervalWhenDevOpenTrigger&&B(),window.clearTimeout(R),f.ondevtoolopen(this.type,p),V=this.type,U[V]=!0}},{key:"init",value:function(){}}]),X})(),ge=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DebugLib})}return r(V,[{key:"init",value:function(){}},{key:"detect",value:function(){var J;(((J=(J=window.eruda)==null?void 0:J._devTools)==null?void 0:J._isShow)===!0||window._vcOrigConsole&&window.document.querySelector("#__vconsole.vc-toggle"))&&this.onDevToolOpen()}}],[{key:"isUsing",value:function(){return!!window.eruda||!!window._vcOrigConsole}}]),V})(),_e=0,R=0,k=[],z=0;function D(X){function V(){pe=!0}function J(){pe=!1}var ye,xe,se,Ie,Z,ae,pe=!1;function ce(){(ae[Ie]===se?xe:ye)()}b(V,J),ye=J,xe=V,(ae=document).hidden!==void 0?(se="hidden",Z="visibilitychange",Ie="visibilityState"):ae.mozHidden!==void 0?(se="mozHidden",Z="mozvisibilitychange",Ie="mozVisibilityState"):ae.msHidden!==void 0?(se="msHidden",Z="msvisibilitychange",Ie="msVisibilityState"):ae.webkitHidden!==void 0&&(se="webkitHidden",Z="webkitvisibilitychange",Ie="webkitVisibilityState"),ae.removeEventListener(Z,ce,!1),ae.addEventListener(Z,ce,!1),_e=window.setInterval(function(){if(!(X.isSuspend||pe||q())){var be,$n,Qt=v(k);try{for(Qt.s();!(be=Qt.n()).done;){var on=be.value;ie(on.type),on.detect(z++)}}catch(Dt){Qt.e(Dt)}finally{Qt.f()}P(),typeof f.ondevtoolclose=="function"&&($n=Q,!ve()&&$n&&f.ondevtoolclose())}},f.interval),R=setTimeout(function(){$.pc||ge.isUsing()||B()},f.stopIntervalTime)}function B(){window.clearInterval(_e)}var oe=8;function ee(X){for(var V=(function(se,Ie){se[Ie>>5]|=128<<Ie%32,se[14+(Ie+64>>>9<<4)]=Ie;for(var Z=1732584193,ae=-271733879,pe=-1732584194,ce=271733878,be=0;be<se.length;be+=16){var $n=Z,Qt=ae,on=pe,Dt=ce;Z=he(Z,ae,pe,ce,se[be+0],7,-680876936),ce=he(ce,Z,ae,pe,se[be+1],12,-389564586),pe=he(pe,ce,Z,ae,se[be+2],17,606105819),ae=he(ae,pe,ce,Z,se[be+3],22,-1044525330),Z=he(Z,ae,pe,ce,se[be+4],7,-176418897),ce=he(ce,Z,ae,pe,se[be+5],12,1200080426),pe=he(pe,ce,Z,ae,se[be+6],17,-1473231341),ae=he(ae,pe,ce,Z,se[be+7],22,-45705983),Z=he(Z,ae,pe,ce,se[be+8],7,1770035416),ce=he(ce,Z,ae,pe,se[be+9],12,-1958414417),pe=he(pe,ce,Z,ae,se[be+10],17,-42063),ae=he(ae,pe,ce,Z,se[be+11],22,-1990404162),Z=he(Z,ae,pe,ce,se[be+12],7,1804603682),ce=he(ce,Z,ae,pe,se[be+13],12,-40341101),pe=he(pe,ce,Z,ae,se[be+14],17,-1502002290),ae=he(ae,pe,ce,Z,se[be+15],22,1236535329),Z=me(Z,ae,pe,ce,se[be+1],5,-165796510),ce=me(ce,Z,ae,pe,se[be+6],9,-1069501632),pe=me(pe,ce,Z,ae,se[be+11],14,643717713),ae=me(ae,pe,ce,Z,se[be+0],20,-373897302),Z=me(Z,ae,pe,ce,se[be+5],5,-701558691),ce=me(ce,Z,ae,pe,se[be+10],9,38016083),pe=me(pe,ce,Z,ae,se[be+15],14,-660478335),ae=me(ae,pe,ce,Z,se[be+4],20,-405537848),Z=me(Z,ae,pe,ce,se[be+9],5,568446438),ce=me(ce,Z,ae,pe,se[be+14],9,-1019803690),pe=me(pe,ce,Z,ae,se[be+3],14,-187363961),ae=me(ae,pe,ce,Z,se[be+8],20,1163531501),Z=me(Z,ae,pe,ce,se[be+13],5,-1444681467),ce=me(ce,Z,ae,pe,se[be+2],9,-51403784),pe=me(pe,ce,Z,ae,se[be+7],14,1735328473),ae=me(ae,pe,ce,Z,se[be+12],20,-1926607734),Z=ke(Z,ae,pe,ce,se[be+5],4,-378558),ce=ke(ce,Z,ae,pe,se[be+8],11,-2022574463),pe=ke(pe,ce,Z,ae,se[be+11],16,1839030562),ae=ke(ae,pe,ce,Z,se[be+14],23,-35309556),Z=ke(Z,ae,pe,ce,se[be+1],4,-1530992060),ce=ke(ce,Z,ae,pe,se[be+4],11,1272893353),pe=ke(pe,ce,Z,ae,se[be+7],16,-155497632),ae=ke(ae,pe,ce,Z,se[be+10],23,-1094730640),Z=ke(Z,ae,pe,ce,se[be+13],4,681279174),ce=ke(ce,Z,ae,pe,se[be+0],11,-358537222),pe=ke(pe,ce,Z,ae,se[be+3],16,-722521979),ae=ke(ae,pe,ce,Z,se[be+6],23,76029189),Z=ke(Z,ae,pe,ce,se[be+9],4,-640364487),ce=ke(ce,Z,ae,pe,se[be+12],11,-421815835),pe=ke(pe,ce,Z,ae,se[be+15],16,530742520),ae=ke(ae,pe,ce,Z,se[be+2],23,-995338651),Z=Ee(Z,ae,pe,ce,se[be+0],6,-198630844),ce=Ee(ce,Z,ae,pe,se[be+7],10,1126891415),pe=Ee(pe,ce,Z,ae,se[be+14],15,-1416354905),ae=Ee(ae,pe,ce,Z,se[be+5],21,-57434055),Z=Ee(Z,ae,pe,ce,se[be+12],6,1700485571),ce=Ee(ce,Z,ae,pe,se[be+3],10,-1894986606),pe=Ee(pe,ce,Z,ae,se[be+10],15,-1051523),ae=Ee(ae,pe,ce,Z,se[be+1],21,-2054922799),Z=Ee(Z,ae,pe,ce,se[be+8],6,1873313359),ce=Ee(ce,Z,ae,pe,se[be+15],10,-30611744),pe=Ee(pe,ce,Z,ae,se[be+6],15,-1560198380),ae=Ee(ae,pe,ce,Z,se[be+13],21,1309151649),Z=Ee(Z,ae,pe,ce,se[be+4],6,-145523070),ce=Ee(ce,Z,ae,pe,se[be+11],10,-1120210379),pe=Ee(pe,ce,Z,ae,se[be+2],15,718787259),ae=Ee(ae,pe,ce,Z,se[be+9],21,-343485551),Z=ze(Z,$n),ae=ze(ae,Qt),pe=ze(pe,on),ce=ze(ce,Dt)}return Array(Z,ae,pe,ce)})((function(se){for(var Ie=Array(),Z=(1<<oe)-1,ae=0;ae<se.length*oe;ae+=oe)Ie[ae>>5]|=(se.charCodeAt(ae/oe)&Z)<<ae%32;return Ie})(X),X.length*oe),J="0123456789abcdef",ye="",xe=0;xe<4*V.length;xe++)ye+=J.charAt(V[xe>>2]>>xe%4*8+4&15)+J.charAt(V[xe>>2]>>xe%4*8&15);return ye}function G(X,V,J,ye,xe,se){return ze((V=ze(ze(V,X),ze(ye,se)))<<xe|V>>>32-xe,J)}function he(X,V,J,ye,xe,se,Ie){return G(V&J|~V&ye,X,V,xe,se,Ie)}function me(X,V,J,ye,xe,se,Ie){return G(V&ye|J&~ye,X,V,xe,se,Ie)}function ke(X,V,J,ye,xe,se,Ie){return G(V^J^ye,X,V,xe,se,Ie)}function Ee(X,V,J,ye,xe,se,Ie){return G(J^(V|~ye),X,V,xe,se,Ie)}function ze(X,V){var J=(65535&X)+(65535&V);return(X>>16)+(V>>16)+(J>>16)<<16|65535&J}var Pe=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.RegToString,enabled:$.qqBrowser||$.firefox})}return r(V,[{key:"init",value:function(){var J=this;this.lastTime=0,this.reg=/./,E(this.reg),this.reg.toString=function(){var ye;return $.qqBrowser?(ye=new Date().getTime(),J.lastTime&&ye-J.lastTime<100?J.onDevToolOpen():J.lastTime=ye):$.firefox&&J.onDevToolOpen(),""}}},{key:"detect",value:function(){E(this.reg)}}]),V})(),Ne=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DefineId})}return r(V,[{key:"init",value:function(){var J=this;this.div=document.createElement("div"),this.div.__defineGetter__("id",function(){J.onDevToolOpen()}),Object.defineProperty(this.div,"id",{get:function(){J.onDevToolOpen()}})}},{key:"detect",value:function(){E(this.div)}}]),V})(),ut=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Size,enabled:!$.iframe&&!$.edge})}return r(V,[{key:"init",value:function(){var J=this;this.checkWindowSizeUneven(),window.addEventListener("resize",function(){setTimeout(function(){J.checkWindowSizeUneven()},100)},!0)}},{key:"detect",value:function(){}},{key:"checkWindowSizeUneven",value:function(){var J=(function(){if(Qe(window.devicePixelRatio))return window.devicePixelRatio;var xe=window.screen;return!!(Qe(xe)&&xe.deviceXDPI&&xe.logicalXDPI)&&xe.deviceXDPI/xe.logicalXDPI})();if(J!==!1){var ye=200<window.outerWidth-window.innerWidth*J,J=300<window.outerHeight-window.innerHeight*J;if(ye||J)return this.onDevToolOpen(),!1;ie(this.type)}return!0}}]),V})();function Qe(X){return X!=null}var at,tt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DateToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.date=new Date,this.date.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.date),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),ft=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.FuncToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.func=function(){},this.func.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.func),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),dt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Debugger,enabled:$.iosChrome||$.iosEdge})}return r(V,[{key:"detect",value:function(){var J=w();100<w()-J&&this.onDevToolOpen()}}]),V})(),pt=(function(){a(V,re);var X=d(V);function V(){var J;return i(this,V),(J=X.call(this,{type:A.Performance,enabled:$.chrome||!$.mobile})).count=0,J}return r(V,[{key:"init",value:function(){this.maxPrintTime=0,this.largeObjectArray=F()}},{key:"detect",value:function(){var J=this,ye=S(function(){x(J.largeObjectArray)}),xe=S(function(){E(J.largeObjectArray)});if(this.maxPrintTime=Math.max(this.maxPrintTime,xe),P(),ye===0||this.maxPrintTime===0)return!1;ye>10*this.maxPrintTime&&(2<=this.count?this.onDevToolOpen():(this.count++,this.detect()))}}]),V})(),Ft=(s(at={},A.RegToString,Pe),s(at,A.DefineId,Ne),s(at,A.Size,ut),s(at,A.DateToString,tt),s(at,A.FuncToString,ft),s(at,A.Debugger,dt),s(at,A.Performance,pt),s(at,A.DebugLib,ge),at),pn=Object.assign(function(X){function V(){var Ie=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return{success:!Ie,reason:Ie}}var J;if(pn.isRunning)return V("already running");if(K(),J=window.console||{log:function(){},table:function(){},clear:function(){}},O=$.ie?(E=function(){return J.log.apply(J,arguments)},x=function(){return J.table.apply(J,arguments)},function(){return J.clear()}):(E=J.log,x=J.table,J.clear),C(X),f.md5&&ee((function(Ie){var Z=window.location.search,ae=window.location.hash;return(Z=Z===""&&ae!==""?"?".concat(ae.split("?")[1]):Z)!==""&&Z!==void 0&&(ae=new RegExp("(^|&)"+Ie+"=([^&]*)(&|$)","i"),Ie=Z.substr(1).match(ae),Ie!=null)?unescape(Ie[2]):""})(f.tkName))===f.md5)return V("token passed");if(f.seo&&$.seoBot)return V("seobot");pn.isRunning=!0,D(pn);var ye=pn,xe=(le=function(){return ye.isSuspend},window.top),se=window.parent;if(de(window),f.disableIframeParents&&xe&&se&&xe!==window){for(;se!==xe;)de(se),se=se.parent;de(xe)}return(f.detectors==="all"?Object.keys(Ft):f.detectors).forEach(function(Ie){new Ft[Ie]}),V()},{isRunning:!1,isSuspend:!1,md5:ee,version:"0.3.9",DetectorType:A,isDevToolOpened:ve});return Pe=(function(){if(typeof window>"u"||!window.document)return null;var X=document.querySelector("[disable-devtool-auto]");if(!X)return null;var V=["disable-menu","disable-select","disable-copy","disable-cut","disable-paste","clear-log"],J=["interval"],ye={};return["md5","url","tk-name","detectors"].concat(V,J).forEach(function(xe){var se=X.getAttribute(xe);se!==null&&(J.indexOf(xe)!==-1?se=parseInt(se):V.indexOf(xe)!==-1?se=se!=="false":xe==="detector"&&se!=="all"&&(se=se.split(" ")),ye[(function(Ie){if(Ie.indexOf("-")===-1)return Ie;var Z=!1;return Ie.split("").map(function(ae){return ae==="-"?(Z=!0,""):Z?(Z=!1,ae.toUpperCase()):ae}).join("")})(xe)]=se)}),ye})(),Pe&&pn(Pe),pn})})(Yr)),Yr.exports}var q2=H2();const W2=Li(q2);function K2(){window.__GLOBAL_CONFIG__.allowDebug||W2({disableMenu:!1})}(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{cursor:not-allowed!important;color:#999}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%,-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:24px}._fc-group._fc-group-card ._fc-group-sort:before,._fc-group._fc-group-card ._fc-group-sort:after{content:"";position:absolute;left:50%;width:4px;height:4px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%)}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translate(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translate(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-up,._fc-group._fc-group-card ._fc-group-sort-down{position:absolute;left:0;right:0;height:12px;cursor:pointer;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-up:hover,._fc-group._fc-group-card ._fc-group-sort-down:hover{background:#1890ff1a}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left;float:unset}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var Y2=Object.defineProperty,G2=Object.defineProperties,Q2=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertySymbols,X2=Object.prototype.hasOwnProperty,J2=Object.prototype.propertyIsEnumerable,Yd=(t,e,n)=>e in t?Y2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Te=(t,e)=>{for(var n in e||(e={}))X2.call(e,n)&&Yd(t,n,e[n]);if(Kd)for(var n of Kd(e))J2.call(e,n)&&Yd(t,n,e[n]);return t},en=(t,e)=>G2(t,Q2(e));function xc(t,e){return Object.keys(t).reduce((n,i)=>((!e||e.indexOf(i)===-1)&&(n[i]=t[i]),n),{})}function Ut(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const Z2="fcCheckbox",ex=Ce({name:Z2,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1),l=d=>{const h=[...Ut(o.value)],v=h.indexOf(s.value);s.value=d,v>-1&&(h.splice(v,1),h.push(d),u(h))};$e(r,d=>{if(!a.value){s.value=d;return}l(d)});const c=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=null;if(!r.value&&d!=null&&Array.isArray(d)&&d.length>0&&a.value){const v=c.value.map(p=>p.value);d.forEach(p=>{v.indexOf(p)===-1&&(h=p)})}h!=null&&(s.value=h)},{immediate:!0});const u=d=>{e.emit("update:modelValue",d)};return{options:c,value:o,onInput:u,updateCustomValue:l,makeInput(d){if(a.value)return j(d,{value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":l},null)]})}}},render(){const t=this.type==="button"?"ElCheckboxButton":"ElCheckbox",e=Ue(t);return j(Ue("ElCheckboxGroup"),We(this.$attrs,{modelValue:this.value===null?void 0:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},xc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}});function Cm(t){t=t||new Map;const e={$on(n,i){const o=t.get(n);o&&o.push(i)||t.set(n,[i])},$once(n,i){i._once=!0,e.$on(n,i)},$off(n,i){const o=t.get(n);o&&o.splice(o.indexOf(i)>>>0,1)},$emit(n,...i){(t.get(n)||[]).slice().map(o=>{o._once&&(e.$off(n,o),delete o._once),o(...i)}),(t.get("*")||[]).slice().map(o=>{o(n,i)})}};return e}const gi=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},tx={name:"IconCircleClose"},nx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function ix(t,e,n,i,o,r){return y(),T("svg",nx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),g("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)])])}const ox=gi(tx,[["render",ix]]),rx={name:"IconDocument"},sx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function ax(t,e,n,i,o,r){return y(),T("svg",sx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)])])}const lx=gi(rx,[["render",ax]]),cx={name:"IconDelete"},ux={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function dx(t,e,n,i,o,r){return y(),T("svg",ux,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)])])}const hx=gi(cx,[["render",dx]]),fx={name:"IconView"},px={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function mx(t,e,n,i,o,r){return y(),T("svg",px,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)])])}const vx=gi(fx,[["render",mx]]),gx={name:"IconFolderOpened"},_x={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function yx(t,e,n,i,o,r){return y(),T("svg",_x,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)])])}const bx=gi(gx,[["render",yx]]),wx="fcFrame",Sx=Ce({name:wx,props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:Function,modal:{type:Object,default:()=>({})},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:bx,IconView:vx},data(){return{fileList:Ut(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new Cm}},watch:{modelValue(t){this.fileList=Ut(t)}},methods:{close(){this.closeModel(!0)},closeModel(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel(){this.previewVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input(){const t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput(){return j(Ue("ElInput"),We({type:"text",modelValue:this.fileList.map(t=>this.getSrc(t)).toString(),readonly:!0},{key:1}),{append:()=>j(Ue("ElButton"),{icon:Ue(this.icon),onClick:()=>this.showModel()},null),suffix:()=>this.fileList.length&&!this.disabled?j(Ue("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:()=>{this.fileList=[],this.input()}},{default:()=>[j(ox,null,null)]}):null})},makeGroup(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),j("div",{key:2},[t])},makeItem(t,e){return j("div",{class:"_fc-files",key:"3"+t},[e])},valid(t){const e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]无效的字段值")},makeIcons(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){const n=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&n.push(this.makeHandleIcon(t,e)),this.allowRemove&&n.push(this.makeRemoveIcon(t,e)),j("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon(t,e){const n=Ue(this.handleIcon===!0||this.handleIcon===void 0?"icon-view":this.handleIcon);return j(Ue("ElIcon"),{onClick:()=>this.handleClick(t),key:"5"+e},{default:()=>[j(n,null,null)]})},makeRemoveIcon(t,e){return j(Ue("ElIcon"),{onClick:()=>this.handleRemove(t),key:"6"+e},{default:()=>[j(hx,null,null)]})},makeFiles(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j(Ue("ElIcon"),{onClick:()=>this.handleClick(t)},{default:()=>[j(lx,null,null)]}),this.makeIcons(t,e)])))},makeImages(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j("img",{src:this.getSrc(t)},null),this.makeIcons(t,e)])))},makeBtn(){const t=Ue(this.icon);return j("div",{class:"_fc-upload-btn",onClick:()=>this.showModel(),key:7},[j(Ue("ElIcon"),null,{default:()=>[j(t,null,null)]})])},handleClick(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc(t){return this.srcKey?t[this.srcKey]:t},frameLoad(t){this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:e=>{this.valid(e),this.closeModel()},set:(e,n)=>{this.valid(e),!this.disabled&&this.$emit("update:modelValue",n)},get:e=>(this.valid(e),this.modelValue),onOk:e=>this.bus.$on("$ok",e),onClose:e=>this.bus.$on("$close",e)})}catch(e){console.error(e)}},makeFooter(){const{okBtnText:t,closeBtnText:e,closeBtn:n,okBtn:i,footer:o}=this.$props;if(o)return j("div",null,[n?j(Ue("ElButton"),{onClick:()=>this.onCancel()!==!1&&(this.frameVisible=!1)},{default:()=>[e||this.formCreateInject.t("close")||"关闭"]}):null,i?j(Ue("ElButton"),{type:"primary",onClick:()=>this.onOk()!==!1&&this.closeModel()},{default:()=>[t||this.formCreateInject.t("ok")||"确定"]}):null])}},render(){const t=this.type;let e;t==="input"?e=this.makeInput():t==="image"?e=this.makeImages():e=this.makeFiles();const{width:n="30%",height:i,src:o,title:r,modalTitle:s}=this.$props;return Ge(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),j("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:s,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]}),j(Ue("ElDialog"),We({appendToBody:!0},Te({width:n,title:r},this.modal),{modelValue:this.frameVisible,onClose:()=>this.closeModel(!0)}),{default:()=>[this.frameVisible||!this.reload?j("iframe",{ref:"frame",src:o,frameBorder:"0",style:{height:i,border:"0 none",width:"100%"}},null):null],footer:()=>this.makeFooter()})])},beforeMount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.on("fc:closeModal:"+t,this.close),e&&n.on("fc:closeModal:"+e,this.close)},beforeUnmount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.off("fc:closeModal:"+t,this.close),e&&n.off("fc:closeModal:"+e,this.close)}}),Cx="fcRadio",Ex=Ce({name:Cx,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1);$e(r,d=>{if(!a.value){s.value=d;return}u(d)});const l=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=!1;!r.value&&d!=null&&a.value&&(h=l.value.map(v=>v.value).indexOf(d)===-1),h&&(s.value=d)},{immediate:!0});const c=d=>{e.emit("update:modelValue",d)},u=d=>{const h=s.value;s.value=d,o.value===h&&c(d)};return{options:l,value:o,onInput:c,updateCustomValue:u,customValue:s,makeInput(d){if(a.value)return j(d,{checked:!1,value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":u},null)]})}}},render(){const t=this.type==="button"?"ElRadioButton":"ElRadio",e=Ue(t);return j(Ue("ElRadioGroup"),We(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},xc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}}),fe={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!fe.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{fe[t]=function(e){return fe.type(e,t)}});function lt(t,e){return{}.hasOwnProperty.call(t,e)}const xx="fcSelect",Tx=Ce({name:xx,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup(t,{emit:e}){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"modelValue");return{options:te(()=>Array.isArray(n.value)?n.value:[]),value:i,handleUpdate:o=>{e("update:modelValue",o)},hasProperty:lt,is:fe}},mounted(){this.$emit("fc.el",this.$refs.el)}});function $x(t,e,n,i,o,r){const s=Ue("el-option"),a=Ue("el-option-group"),l=Ue("el-select");return y(),ne(l,We(t.$attrs,{"model-value":t.value,"onUpdate:modelValue":t.handleUpdate,ref:"el"}),{default:we(()=>[(y(!0),T(Me,null,He(t.options,(c,u)=>(y(),T(Me,null,[t.hasProperty(c,"options")?(y(),ne(a,{label:c.label,key:`${u}-${c.label}`},{default:we(()=>[(y(!0),T(Me,null,He(t.is.trueArray(c.options)?c.options:[],(d,h)=>(y(),ne(s,We({key:`${h}-${d.value}`},{ref_for:!0},d),null,16))),128))]),_:2},1032,["label"])):(y(),ne(s,We({key:`${u}-${c.value}`},{ref_for:!0},c),null,16))],64))),256)),Ve(t.$slots,"default")]),_:3},16,["model-value","onUpdate:modelValue"])}const kx=gi(Tx,[["render",$x]]),Ox="fcTree",Ax=Ce({name:Ox,inheritAttrs:!1,formCreateParser:{mergeProp(t){const e=t.prop.props;e.nodeKey||(e.nodeKey="id"),e.props||(e.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:()=>[]}},emits:["update:modelValue","fc.el"],watch:{modelValue(){this.setValue()}},methods:{updateValue(){if(!this.$refs.tree)return;let t;this.type==="selected"?t=this.$refs.tree.getCurrentKey():t=this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",t)},setValue(){this.$refs.tree&&(this.type==="selected"?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(Ut(this.modelValue)))}},render(){return j(Ue("ElTree"),We(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}}),Px={name:"IconUpload"},Rx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function Mx(t,e,n,i,o,r){return y(),T("svg",Rx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)])])}const Ix=gi(Px,[["render",Mx]]);function Gd(t,e){return typeof t=="object"?t:{url:t,is_string:!0,name:Fx(t),uid:e}}function Qd(t){return en(Te({},t),{file:t,value:t})}function Fx(t){return(""+t).split("/").pop()}const Dx="fcUpload",Lx=Ce({name:Dx,inheritAttrs:!1,formCreateParser:{toFormValue(t){return Ut(t)},toValue(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data(){return{previewVisible:!1,previewImage:"",fileList:[]}},created(){this.fileList=Ut(this.modelValue).map(Gd).map(Qd)},watch:{modelValue(t){this.fileList=Ut(t).map(Gd).map(Qd)}},methods:{handlePreview(t){this.onPreview?this.onPreview(...arguments):this.listType==="text"?window.open(t.url):(this.previewImage=t.url,this.previewVisible=!0)},update(t){let e=t.map(n=>n.is_string?n.url:n.value||n.url).filter(n=>n!==void 0);this.$emit("update:modelValue",e)},handleCancel(){this.previewVisible=!1},handleChange(t,e){this.$emit("change",...arguments),t.status==="success"&&this.update(e)},handleRemove(t,e){this.$emit("remove",...arguments),this.update(e)},doHttpRequest(t){if(this.httpRequest)return this.httpRequest(t);t.source="upload",this.formCreateInject.api.fetch(t)}},render(){const t=Ut(this.modelValue).length;return j("div",{class:"_fc-upload"},[j(Ue("ElUpload"),We({key:t},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":this.$attrs.limit?this.$attrs.limit<=t:!1},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),Te({default:()=>{var e,n;return[((n=(e=this.$slots).default)==null?void 0:n.call(e))||(["text","picture"].indexOf(this.listType)===-1?j(Ue("ElIcon"),null,{default:()=>[j(Ix,null,null)]}):j(Ue("ElButton"),{type:"primary"},{default:()=>[this.formCreateInject.t("clickToUpload")||this.uploadText||"点击上传"]}))]}},xc(this.$slots,["default"]))),j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]})])},mounted(){this.$emit("fc.el",this.$refs.upload)}});function an(t,e,n){t[e]=n}function wi(t,e){delete t[e]}function or(t,e={},n){let i=!1;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let r=e[o];if((i=Array.isArray(r))||fe.Object(r)){let s=t[o]===void 0;if(i)i=!1,s&&an(t,o,[]);else if(r._clone&&n!==void 0)if(n)r=r.getRule(),s&&an(t,o,{});else{an(t,o,r._clone());continue}else s&&an(t,o,{});t[o]=or(t[o],r,n)}else an(t,o,r),fe.Undef(r)||(fe.Undef(r.__json)||(t[o].__json=r.__json),fe.Undef(r.__origin)||(t[o].__origin=r.__origin))}return n!==void 0&&Array.isArray(t)?t.filter(o=>!o||!o.__ctrl):t}function In(t){return or({},{value:t}).value}const jx=Object.assign||function(t){for(let e,n=1;n<arguments.length;n++)for(let i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&an(t,i,e[i]);return t};function Fe(){return jx.apply(this,arguments)}function wl(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:Te({},t)}function ci(t,e){var n=null;return function(...i){n!==null&&clearTimeout(n),n=setTimeout(()=>t.call(this,...i),e)}}function Em(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function zx(t){return t&&typeof t=="object"&&typeof t.then=="function"}function us(t){return zx(t)?t:Promise.resolve(t)}function Lo(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}function xm(t){return t.replace(t[0],t[0].toLocaleUpperCase())}function Tm(t,e,n){return`[form-create ${t}]: ${e}`}function Tc(t,e){console.error(Tm("err",t))}function Nx(t){Tc(t.toString()),console.error(t)}const Sl="[[FORM-CREATE-PREFIX-",Cl="-FORM-CREATE-SUFFIX]]";function jo(t,e){return JSON.stringify(or(Array.isArray(t)?[]:{},t,!0),function(n,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return Sl+i+Cl}},e)}function ma(t){return new Function("return "+t)()}function Dn(t,e){if(t&&fe.String(t)&&t.length>4){let n=t.trim(),i=!1;try{if(n.indexOf(Cl)>0&&n.indexOf(Sl)===0)n=n.replace(Cl,"").replace(Sl,""),i=!0;else if(n.indexOf("$FN:")===0)n=n.substring(4),i=!0;else if(n.indexOf("$EXEC:")===0)n=n.substring(6),i=!0;else if(n.indexOf("$GLOBAL:")===0){const r=n.substring(8);return n=function(...s){const a=s[0].api.getGlobalEvent(r);if(a)return a.call(this,...s)},n.__json=t,n.__inject=!0,n}else{if(n.indexOf("$FNX:")===0)return n=ma(`function($inject){
11
+ `+r)}}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ii(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Wr.assertOptions(i,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean),legacyInterceptorReqResOrdering:rn.transitional(rn.boolean)},!1),o!=null&&(W.isFunction(o)?n.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:rn.function,serialize:rn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wr.assertOptions(n,{baseUrl:rn.spelling("baseURL"),withXsrfToken:rn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&W.merge(r.common,r[n.method]);r&&W.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=qt.concat(s,r);const a=[];let l=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(n)===!1)return;l=l&&p.synchronous;const _=n.transitional||vc;_&&_.legacyInterceptorReqResOrdering?a.unshift(p.fulfilled,p.rejected):a.push(p.fulfilled,p.rejected)});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let u,d=0,h;if(!l){const f=[Ld.bind(this),void 0];for(f.unshift(...a),f.push(...c),h=f.length,u=Promise.resolve(n);d<h;)u=u.then(f[d++],f[d++]);return u}h=a.length;let m=n;for(;d<h;){const f=a[d++],p=a[d++];try{m=f(m)}catch(_){p.call(this,_);break}}try{u=Ld.call(this,m)}catch(f){return Promise.reject(f)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Ii(this.defaults,e);const n=rm(e.baseURL,e.url,e.allowAbsoluteUrls);return tm(n,e.params,e.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(e){ki.prototype[e]=function(n,i){return this.request(Ii(i||{},{method:e,url:n,data:(i||{}).data}))}});W.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(Ii(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}ki.prototype[e]=n(),ki.prototype[e+"Form"]=n(!0)});let CS=class um{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r;const s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new nr(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new um(function(o){e=o}),cancel:e}}};function ES(t){return function(n){return t.apply(null,n)}}function xS(t){return W.isObject(t)&&t.isAxiosError===!0}const pl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pl).forEach(([t,e])=>{pl[e]=t});function dm(t){const e=new ki(t),n=Hf(ki.prototype.request,e);return W.extend(n,ki.prototype,e,{allOwnKeys:!0}),W.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return dm(Ii(t,o))},n}const ht=dm(tr);ht.Axios=ki;ht.CanceledError=nr;ht.CancelToken=CS;ht.isCancel=im;ht.VERSION=cm;ht.toFormData=Os;ht.AxiosError=De;ht.Cancel=ht.CanceledError;ht.all=function(e){return Promise.all(e)};ht.spread=ES;ht.isAxiosError=xS;ht.mergeConfig=Ii;ht.AxiosHeaders=qt;ht.formToJSON=t=>nm(W.isHTMLForm(t)?new FormData(t):t);ht.getAdapter=lm.getAdapter;ht.HttpStatusCode=pl;ht.default=ht;const{Axios:sN,AxiosError:aN,CanceledError:lN,isCancel:cN,CancelToken:uN,VERSION:dN,all:hN,Cancel:pN,isAxiosError:fN,spread:mN,toFormData:vN,AxiosHeaders:gN,HttpStatusCode:zd,formToJSON:_N,getAdapter:yN,mergeConfig:bN}=ht,hm=new Map,TS={baseURL:"",timeout:1e4};function Nd(t,e){const n=ht.create({...TS,...e});return hm.set(t,n),n}function $S(t="default"){const e=hm.get(t);if(!e)throw new Error(`Instance "${t}" not initialized. Call initInstance() first.`);return e}async function Se(t,e){const n=t.split("/")[0],i=$S(n);return t=t.replace(n,""),i.request({url:t,...e})}async function kS(t,e){return Se("__local__/api/v1/comp/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function OS(t,e){return Se("__local__/api/v1/comp/checkCompRepeat",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function AS(t,e){return Se("__local__/api/v1/comp/compFileHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function PS(t,e){return Se("__local__/api/v1/comp/compFilesOssSignedUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function RS(t,e){return Se("__local__/api/v1/comp/dep",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function IS(t,e){return Se("__local__/api/v1/comp/dir",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function MS(t,e){return Se("__local__/api/v1/comp/download",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function FS(t,e){return Se("__local__/api/v1/comp/file",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function DS(t,e){return Se("__local__/api/v1/comp/generateCompJson",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LS(t,e){return Se("__local__/api/v1/comp/localCompDetailByPathHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function jS(t,e){return Se("__local__/api/v1/comp/localComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zS(t,e){return Se("__local__/api/v1/comp/localCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NS(t,e){return Se("__local__/api/v1/comp/openCompPathInVscode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function US(t){return Se("__local__/api/v1/comp/packageJson",{method:"POST",...t||{}})}async function VS(t,e){return Se("__local__/api/v1/comp/submit",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function BS(t,e){return Se("__local__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HS(t,e){return Se("__local__/api/v1/comp/updateVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const qS=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheck:kS,compcontrollerCheckcomprepeat:OS,compcontrollerCompfilehash:AS,compcontrollerCompfilesosssignedurl:PS,compcontrollerDep:RS,compcontrollerDir:IS,compcontrollerDownload:MS,compcontrollerFile:FS,compcontrollerGeneratecompjson:DS,compcontrollerLocalcompdetailbypathhash:LS,compcontrollerLocalcomps:jS,compcontrollerLocalcompsbyids:zS,compcontrollerOpencomppathinvscode:NS,compcontrollerPackagejson:US,compcontrollerSubmit:VS,compcontrollerUpdate:BS,compcontrollerUpdateversion:HS},Symbol.toStringTag,{value:"Module"}));async function WS(t){return Se("__local__/api/v1/module/clearPreBuild",{method:"POST",...t||{}})}async function KS(t,e){return Se("__local__/api/v1/module/preBuild",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YS(t){return Se("__local__/api/v1/module/preBuildSize",{method:"POST",...t||{}})}const GS=Object.freeze(Object.defineProperty({__proto__:null,modulecontrollerClearprebuild:WS,modulecontrollerPrebuild:KS,modulecontrollerPrebuildsize:YS},Symbol.toStringTag,{value:"Module"}));async function QS(t,e){return Se("__local__/api/v1/oss/fileSignUrl",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const XS=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerFilesignurl:QS},Symbol.toStringTag,{value:"Module"}));async function JS(t,e){return Se("__local__/api/v1/preprocessing/preprocess",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const ZS=Object.freeze(Object.defineProperty({__proto__:null,preprocessingcontrollerPreprocess:JS},Symbol.toStringTag,{value:"Module"}));async function eC(t,e){return Se("__local__/api/v1/vuefinder/list",{method:"GET",params:{...t},...e||{}})}const tC=Object.freeze(Object.defineProperty({__proto__:null,vuefindercontrollerList:eC},Symbol.toStringTag,{value:"Module"})),nC={v1Comp:qS,v1Module:GS,v1Oss:XS,v1Preprocessing:ZS,v1Vuefinder:tC};async function iC(t,e){return Se("__remote__/api/v1/comp/checkCompExistByHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function oC(t,e){return Se("__remote__/api/v1/comp/checkCompExistById",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rC(t,e){return Se("__remote__/api/v1/comp/checkVersion",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function sC(t,e){return Se("__remote__/api/v1/comp/collect",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function aC(t,e){return Se("__remote__/api/v1/comp/collectedComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function lC(t,e){return Se("__remote__/api/v1/comp/compDetail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function cC(t,e){return Se("__remote__/api/v1/comp/compHash",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function uC(t,e){return Se("__remote__/api/v1/comp/comps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dC(t,e){return Se("__remote__/api/v1/comp/compsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function hC(t,e){return Se("__remote__/api/v1/comp/deleteFailedComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function pC(t,e){return Se("__remote__/api/v1/comp/deleteMyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function fC(t,e){return Se("__remote__/api/v1/comp/existCompsByIds",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mC(t,e){return Se("__remote__/api/v1/comp/myComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vC(t,e){return Se("__remote__/api/v1/comp/similarComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gC(t,e){return Se("__remote__/api/v1/comp/softDelete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function _C(t,e){return Se("__remote__/api/v1/comp/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yC(t,e){return Se("__remote__/api/v1/comp/updateBasicInfo",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bC(t,e){return Se("__remote__/api/v1/comp/updateCompDownloadCount",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wC(t,e){return Se("__remote__/api/v1/comp/updateObjectId",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function SC(t,e){return Se("__remote__/api/v1/comp/upgradeRecords",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function CC(t,e){return Se("__remote__/api/v1/comp/upload",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function EC(t,e){return Se("__remote__/api/v1/comp/versions",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const xC=Object.freeze(Object.defineProperty({__proto__:null,compcontrollerCheckcompexistbyhash:iC,compcontrollerCheckcompexistbyid:oC,compcontrollerCheckversion:rC,compcontrollerCollect:sC,compcontrollerCollectedcomps:aC,compcontrollerCompdetail:lC,compcontrollerComphash:cC,compcontrollerComps:uC,compcontrollerCompsbyids:dC,compcontrollerDeletefailedcomp:hC,compcontrollerDeletemycomp:pC,compcontrollerExistcompsbyids:fC,compcontrollerMycomps:mC,compcontrollerSimilarcomps:vC,compcontrollerSoftdelete:gC,compcontrollerUpdate:_C,compcontrollerUpdatebasicinfo:yC,compcontrollerUpdatecompdownloadcount:bC,compcontrollerUpdateobjectid:wC,compcontrollerUpgraderecords:SC,compcontrollerUpload:CC,compcontrollerVersions:EC},Symbol.toStringTag,{value:"Module"}));async function TC(t){return Se("__remote__/api/v1/csrf/csrf",{method:"GET",...t||{}})}const $C=Object.freeze(Object.defineProperty({__proto__:null,csrfcontrollerGetcsrftoken:TC},Symbol.toStringTag,{value:"Module"}));async function kC(t,e){return Se("__remote__/api/v1/email/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const OC=Object.freeze(Object.defineProperty({__proto__:null,emailcontrollerSendcode:kC},Symbol.toStringTag,{value:"Module"}));async function AC(t,e){return Se("__remote__/api/v1/keyword/queryKeywordsComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const PC=Object.freeze(Object.defineProperty({__proto__:null,keywordcontrollerQuerykeywordscomp:AC},Symbol.toStringTag,{value:"Module"}));async function RC(t){return Se("__remote__/api/v1/oss/compOssDir",{method:"POST",...t||{}})}async function IC(t){return Se("__remote__/api/v1/oss/getSts",{method:"POST",...t||{}})}async function MC(t,e){return Se("__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const FC=Object.freeze(Object.defineProperty({__proto__:null,osscontrollerCompossdir:RC,osscontrollerGetsts:IC,osscontrollerPutpolicy:MC},Symbol.toStringTag,{value:"Module"}));async function DC(t,e){return Se("__remote__/api/v1/team/addToTeamMyComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function LC(t){return Se("__remote__/api/v1/team/allMember",{method:"POST",...t||{}})}async function jC(t,e){return Se("__remote__/api/v1/team/applyList",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function zC(t,e){return Se("__remote__/api/v1/team/checkCompUpdatePermission",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function NC(t,e){return Se("__remote__/api/v1/team/copyComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function UC(t,e){return Se("__remote__/api/v1/team/create",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function VC(t){return Se("__remote__/api/v1/team/created",{method:"POST",...t||{}})}async function BC(t,e){return Se("__remote__/api/v1/team/delete",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function HC(t){return Se("__remote__/api/v1/team/detail",{method:"POST",...t||{}})}async function qC(t){return Se("__remote__/api/v1/team/exit",{method:"POST",...t||{}})}async function WC(t,e){return Se("__remote__/api/v1/team/findByCode",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function KC(t,e){return Se("__remote__/api/v1/team/handleApply",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function YC(t,e){return Se("__remote__/api/v1/team/join",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function GC(t){return Se("__remote__/api/v1/team/joined",{method:"POST",...t||{}})}async function QC(t,e){return Se("__remote__/api/v1/team/kickOut",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function XC(t,e){return Se("__remote__/api/v1/team/member",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function JC(t,e){return Se("__remote__/api/v1/team/myTeamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function ZC(t,e){return Se("__remote__/api/v1/team/removeComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function eE(t,e){return Se("__remote__/api/v1/team/removeMyTeamComp",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function tE(t,e){return Se("__remote__/api/v1/team/teamComps",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function nE(t,e){return Se("__remote__/api/v1/team/update",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function iE(t,e){return Se("__remote__/api/v1/team/updateCompCanUpdateUsers",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function oE(t,e){return Se("__remote__/api/v1/team/updateMenu",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function rE(t,e){return Se("__remote__/api/v1/team/updateTeamUserNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const sE=Object.freeze(Object.defineProperty({__proto__:null,teamcontrollerAddtoteammycomps:DC,teamcontrollerAllmember:LC,teamcontrollerApplylist:jC,teamcontrollerCheckcompupdatepermission:zC,teamcontrollerCopycomp:NC,teamcontrollerCreate:UC,teamcontrollerCreated:VC,teamcontrollerDelete:BC,teamcontrollerDetail:HC,teamcontrollerExit:qC,teamcontrollerFindbycode:WC,teamcontrollerHandleapply:KC,teamcontrollerJoin:YC,teamcontrollerJoined:GC,teamcontrollerKickout:QC,teamcontrollerMember:XC,teamcontrollerMyteamcomps:JC,teamcontrollerRemovecompfromteam:ZC,teamcontrollerRemovemyteamcomp:eE,teamcontrollerTeamcomps:tE,teamcontrollerUpdate:nE,teamcontrollerUpdatecompcanupdateusers:iE,teamcontrollerUpdatemenu:oE,teamcontrollerUpdateteamusernickname:rE},Symbol.toStringTag,{value:"Module"}));async function aE(t){return Se("__remote__/api/v1/token/approachExpire",{method:"POST",...t||{}})}async function lE(t){return Se("__remote__/api/v1/token/refresh",{method:"POST",...t||{}})}const cE=Object.freeze(Object.defineProperty({__proto__:null,tokencontrollerApproachexpire:aE,tokencontrollerRefresh:lE},Symbol.toStringTag,{value:"Module"}));async function uE(t,e){return Se("__remote__/api/v1/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function dE(t){return Se("__remote__/api/v1/upgrade/logs",{method:"POST",...t||{}})}async function hE(t,e){return Se("__remote__/api/v1/upgrade/publish",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const pE=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerCheck:uE,upgradecontrollerLogs:dE,upgradecontrollerPublish:hE},Symbol.toStringTag,{value:"Module"}));async function fE(t,e){return Se("__remote__/api/v1/user/changeAvatar",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function mE(t,e){return Se("__remote__/api/v1/user/changeNickname",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function vE(t,e){return Se("__remote__/api/v1/user/changePassword",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function gE(t){return Se("__remote__/api/v1/user/checkPassword",{method:"POST",...t||{}})}async function _E(t,e){return Se("__remote__/api/v1/user/login",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function yE(t,e){return Se("__remote__/api/v1/user/setAllowEmailLogin",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function bE(t,e){return Se("__remote__/api/v1/user/updateEmail",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}async function wE(t){return Se("__remote__/api/v1/user/userInfo",{method:"POST",...t||{}})}async function SE(t){return Se("__remote__/api/v1/user/whoAmI",{method:"POST",...t||{}})}const CE=Object.freeze(Object.defineProperty({__proto__:null,usercontrollerChangeavatar:fE,usercontrollerChangenickname:mE,usercontrollerChangepassword:vE,usercontrollerCheckpassword:gE,usercontrollerLogin:_E,usercontrollerSetallowemaillogin:yE,usercontrollerUpdateemail:bE,usercontrollerUserinfo:wE,usercontrollerWhoami:SE},Symbol.toStringTag,{value:"Module"}));async function EE(t,e){return Se("__remote__/api/v2/upgrade/check",{method:"POST",headers:{"Content-Type":"application/json"},data:t,...e||{}})}const xE=Object.freeze(Object.defineProperty({__proto__:null,upgradecontrollerv2Check:EE},Symbol.toStringTag,{value:"Module"})),Oi={v1Comp:xC,v1Csrf:$C,v1Email:OC,v1Keyword:PC,v1Oss:FC,v1Team:sE,v1Token:cE,v1Upgrade:pE,v1User:CE,v2Upgrade:xE},TE=vi("personalStore",{state:()=>({userInfo:{},isPasswordSet:!1}),getters:{isAllowEmailLogin(t){return t.userInfo?.isAllowEmailLogin??!1}},actions:{setUserInfo(t){this.$patch(e=>{e.userInfo=t})},setIsPasswordSet(t){this.$patch(e=>{e.isPasswordSet=t})},async initUserInfo(){const t=await Oi.v1User.usercontrollerUserinfo();t.code===0&&this.setUserInfo(t.data)},async setEmail(t){this.$patch(e=>{e.userInfo.email=t})},async setNickname(t){this.$patch(e=>{e.userInfo.nickname=t})},async setAllowEmailLogin(t){await Oi.v1User.usercontrollerSetallowemaillogin({allow:t}).then(()=>{this.$patch(e=>{e.userInfo.isAllowEmailLogin=t})})}}}),$E=vi("moduleStore",{state:()=>({modules:{}}),actions:{setModules(t,e){this.$patch(n=>{n.modules[t]=e})},async loadModule(t){if(this.modules[t])return this.modules[t];const e=await import(t);return this.setModules(t,e),e}}}),yr=Ji(zb,!0),yc=vi("appStore",{state:()=>({}),getters:{collapse(){return yr.value}},actions:{toggleSideBar(){yr.value=!yr.value},setSideBarCollapse(t){t!==this.collapse&&(yr.value=t)}}}),kE=vi("team",{state:()=>({joinedTeams:[],createdTeams:[]}),actions:{setJoinedTeams(t){this.$patch(e=>{e.joinedTeams=t})},setCreatedTeams(t){this.$patch(e=>{e.createdTeams=t})},removeCreatedTeam(t){this.$patch(e=>{e.createdTeams=e.createdTeams.filter(n=>n._id!==t)})},addCreatedTeam(t){this.$patch(e=>{e.createdTeams.some(i=>i._id===t._id)||e.createdTeams.push(t)})},addJoinedTeam(t){this.$patch(e=>{e.joinedTeams.some(i=>i._id===t._id)||e.joinedTeams.push(t)})},removeJoinedTeam(t){this.$patch(e=>{e.joinedTeams=e.joinedTeams.filter(n=>n._id!==t)})},updateCreatedTeamItemById(t,e){this.$patch(n=>{const i=n.createdTeams.findIndex(o=>o._id===t);i!==-1&&(n.createdTeams[i]=e)})},getTeamDetail(t){return this.joinedTeams.find(n=>n._id===t)||this.createdTeams.find(n=>n._id===t)}}});function br(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)i!=="__proto__"&&(t[i]=n[i])}return t}var OE={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function fl(t,e){function n(o,r,s){if(!(typeof document>"u")){s=br({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=o+"="+t.write(r,o)+a}}function i(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],s={},a=0;a<r.length;a++){var l=r[a].split("="),c=l.slice(1).join("=");try{var u=decodeURIComponent(l[0]);if(u in s||(s[u]=t.read(c,u)),o===u)break}catch{}}return o?s[o]:s}}return Object.create({set:n,get:i,remove:function(o,r){n(o,"",br({},r,{expires:-1}))},withAttributes:function(o){return fl(this.converter,br({},this.attributes,o))},withConverter:function(o){return fl(br({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var pm=fl(OE,{path:"/"});const AE={keyword:"关键词",confirm:"确定",cancel:"取消",close:"关闭",save:"保存",submit:"提交",delete:"删除",edit:"编辑",add:"添加",update:"更新",upload:"上传",download:"下载",refresh:"刷新",loading:"加载中",success:"成功",error:"错误",warning:"警告",info:"提示",copy:"复制",copied:"已复制",copySuccess:"复制成功",copyFailed:"复制失败",open:"打开",search:"搜索",reset:"重置",clear:"清空",back:"返回",next:"下一步",prev:"上一步",finish:"完成",operation:"操作",status:"状态",yes:"是",no:"否",name:"名称",description:"描述",version:"版本",time:"时间",date:"日期",author:"作者",type:"类型",category:"分类",tag:"标签",content:"内容",setting:"设置",cache:"缓存",cacheSize:"已使用",clearCache:"清空缓存",clearCacheConfirm:"将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?",cacheCleared:"缓存已清空",newPage:"新页面打开",terminal:"终端",preview:"预览",doc:"文档",readme:"README.md",upgradeRecord:"更新记录",openInNewPage:"新页面打开",depInstall:"依赖安装",fullscreen:"全屏",exitFullscreen:"退出全屏",maximizeRestore:"最大化/还原",siteSlogan:"原子化组件社区,让组件流通更简单。",siteSubtitle:"Vue 组件共享平台",docsTutorial:"文档教程",empty:"暂无数据",noReadme:"组件没有配置README.md文件",dragSort:"拖拽排序",filter:"筛选",apply:"应用",person:"人",unit:"个",pleaseSelect:"请选择",pleaseInput:"请输入",me:"我",generate:"生成",regenerate:"重新生成",generateSuccess:"生成成功",moreOperations:"更多操作",more:"更多",maxTagCount:"最大标签数量"},PE={keywordPlaceholder:"请输入组件名称/描述",title:"组件",name:"组件名称",fieldId:"组件ID",fieldName:"组件名称",fieldVersion:"版本号",desc:"组件描述",remarksDesc:"备注说明",remarksDescRequired:"请输入备注说明",pleaseInputCompName:"请输入组件名称",pleaseInputRemarks:"请输入备注,有助于组件市场检索",compNameRequired:"组件名称不能为空",compNameNamingRule:"组件名只能是「大驼峰(PascalCase)」或「短横线(kebab-case)」命名法",lengthBetween:"长度在 {min} 到 {max} 个字符",version:"组件版本",detail:"组件详情",preview:"组件预览",previewConfig:"预览配置",previewList:"预览列表",uploadPreview:"组件上传预览",updatePreview:"组件更新预览",download:"下载组件",update:"更新组件",upload:"上传组件",submit:"提交组件",edit:"编辑组件",add:"添加组件",delete:"删除组件",local:"本地组件",remote:"远程组件",online:"在线组件",similar:"相似组件",similarTeam:"团队内相似组件",dir:"组件目录",file:"组件文件",entry:"入口文件",previewEntry:"预览入口地址",previewEntryFull:"预览入口地址(全屏窗口)",addPreviewEntry:"添加预览入口",maxPreviewEntry:"最多添加{n}个预览入口",pleaseAddPreviewEntry:"请添加预览入口",miniPreviewFile:"小窗预览文件",fullPreviewFile:"全屏预览文件",pleaseSelectPreviewFile:"请选择预览文件",remarkDesc:"备注说明",dep:"组件依赖",localDep:"组件依赖(本地)",onlineDep:"组件依赖(线上)",finalDep:"最终依赖",localVersion:"本地:",onlineVersion:"线上:",onlineDepEmpty:"线上依赖暂无数据!",versionConsistent:"版本一致",versionChange:"版本变化,请手动选择最终版本",versionChangeConfirmed:"已确认",newDep:"新增依赖",miniPanel:"小窗面板",fullPanel:"全屏面板",reload:"重新加载",uploadProtocol:"组件发布协议",bgPanel:"背景板",compLocation:"组件位置",pleaseSelectFolderFirst:"请先选择文件夹",compAlreadyUploaded:"组件已经上传,更新操作请前往我的组件或团队组件",affirmDep:"组件依赖(确认的版本)",checkConfig:"配置检查",checkError:"报错信息",extraInfo:"附加信息",baseInfo:"基础信息",upgradeLog:"更新说明",pleaseInputUpgradeLog:"请填写更新说明",config:"组件配置",configStatus:"组件配置检查状态",configError:"配置异常",configCheckError:"配置检查报错",needUpgrade:"需要升级",fileChanged:"组件文件有变化",versionChanged:"版本号变化",fileNoChange:"文件没有变化",markdownValid:"Markdown预览校验通过",noMarkdown:"没有md文件",hash:"文件哈希",localHash:"本地组件文件hash",remoteHash:"线上组件文件hash",remoteVersion:"线上组件版本号",remoteVersionPrefix:"线上:",localVersionPrefix:"本地:",versionCompare:"版本号比较结果",carouselIndex:"组件预览走马灯index",bgColor:"组件背景颜色",dialogType:"组件弹窗类型",repeat:"组件重复检查",existLocal:"组件在本地存在",scopeId:"作用域id",tempDir:"组件临时目录",submitLimit:"组件提交限制",maxSize:"总大小限制",maxCount:"文件数量限制",matchType:"匹配类型",updateType:"更新类型",updateOnline:"在线更新",updateOffline:"离线更新",compOfflineUpdate:"组件离线更新",compOnlineUpdate:"组件在线更新",folder:"文件夹",compNotInLocal:"组件不在本地,继续更新只能更新组件描述,预览配置等基础信息,是否继续?",selectUpdateFolder:"请选择要更新的文件夹",openInVscode:"在 VS Code 中打开",openingInEditor:"在编辑器中打开...",updateSuccess:"更新成功",downloadVersionConfirm:"当前选择的版本为:{version},确认下载吗?",downloading:"组件下载中...",downloadPathConfirm:"是否下载组件到【{path}】路径下",downloadCoverConfirm:"组件【{name}】已经下载或者有同名组件,是否覆盖?",uncollectConfirm:"是否取消收藏组件【{name}】,取消收藏后组件将不再显示在收藏列表中,是否继续?",deleteConfirm:"是否删除组件【{name}】,删除组件后会释放占用的组件名称,是否继续?",collect:"收藏",uncollect:"取消收藏",collected:"已收藏",uncollected:"未收藏",entryFile:"入口文件",configFile:"配置文件",fileChangedNeedVersion:"文件内容改变,请增加版本号",viewFileChanges:"查看文件变化",versionChangedButFileSame:"版本号改变,但文件内容未改变,请还原版本号",errorMsg:"错误信息",versionCannotBeLessThanLatest:"版本号不能小于最新版本{version}",uploadAnyway:"仍然上传",compileError:"组件编译失败",compileWarn:"组件编译警告",formatCode:"格式化代码:",formatCodeTooltip:"仅格式化对比时的文件,不会格式化原始文件",noChanges:"暂无变更",diff:{changed:"M 改变",unchanged:"U 未改变",added:"A 新增",deleted:"D 删除"}},RE={title:"团队",name:"团队名称",code:"团队码",desc:"团队描述",create:"创建团队",join:"加入团队",exit:"退出团队",exitConfirm:"退出确认",manage:"团队管理",setting:"团队设置",member:"团队成员",memberCount:"成员数",maxMember:"最大成员数",compCount:"组件数量",maxCompCount:"最大组件数量",creator:"创建者",downloadCount:"下载量",collectCount:"收藏量",createTime:"创建时间",myTeam:"我的团队",joinedTeam:"已加入团队",space:"团队空间",noJoined:"暂无加入的团队",noCreated:"暂无创建的团队",createCountLimit:"最大允许创建的团队数量",joinCountLimit:"允许最多加入的团队数量",compList:"团队组件列表",myCompList:"我的组件",compGroup:"团队组件分组",compGroupList:"团队组件分组列表",addMyComp:"团队添加我的组件",compUpdate:"团队我的组件更新",addFromMine:"去我的组件添加",applyList:"申请列表",nickname:"团队昵称",noTeamInfo:"暂无团队信息",compLib:"组件库",groupConfig:"分组配置",compManage:"组件管理",unsavedDataLeave:"分组配置数据未保存,确定要离开吗?",leave:"离开",disbandTeam:"解散团队",applyAudit:"申请审核",teamName:"团队名称",fillTeamCode:"填写团队码",pleaseInputTeamCode:"请输入团队码",teamIdNotExist:"团队ID不存在",joinSuccess:"加入团队成功",applyJoinTeam:"申请加入团队",showRepeatComp:"展示重复组件",allowAuthorDelete:"作者删除组件权限",teamIntro:"团队介绍",fillTeamName:"填写团队名称",pleaseInputTeamName:"请输入团队名称",pleaseInputTeamDesc:"请输入团队介绍",createSuccess:"创建团队成功",charLength:"长度在 {min} 到 {max} 个字符",disbandConfirm:"确定解散团队吗,解散后所有成员和组件将被移除,并且无法恢复?",deleteConfirm:"删除确认",inputAuthCode:"请输入验证码",disbandSuccess:"解散团队成功",reject:"拒绝",agree:"同意",approved:"已同意",rejected:"已拒绝",kickOut:"踢出",teamUserNickname:"团队内昵称",pleaseInputTeamNickname:"请输入你在团队的昵称",normalUser:"普通用户",kickOutConfirm:"确定踢出用户【{name}】吗?",kickOutSuccess:"踢出成功",selectCanUpdateUser:"选择可更新用户",authorAutoAuth:"作者自带授权",updateAuth:"更新授权",updateTime:"更新时间",expandAll:"展开全部",createGroup:"创建分组",unsaved:"未保存",pleaseInputGroupName:"请输入分组名称",addComp:"添加组件",added:"已添加",notAdded:"未添加",defaultGroup:"默认分组",deleteGroupConfirm:"确认删除该分组吗?删除后该分组下的所有组件将被移除分组",addSuccess:"添加成功",isGrouped:"是否分组",grouped:"已分组",ungrouped:"未分组",group:"分组",prevVersion:"升级前版本",newVersion:"升级后版本",upgradeDesc:"升级描述",similarCompInTeam:"团队内相似组件",similarComp:"相似组件",deleteCompConfirm:"是否删除团队组件【{name}】,删除组件后团队成员将无法使用该组件,是否继续?",descTitle:"为业务团队打造专属组件空间",descItem1:"创建私密团队,组件仅对成员可见,保护核心资产",descItem2:"每个账号最多可创建 {count} 个团队",descItem3:"每个账号最多可加入 {count} 个团队",descItem4:"基础版团队支持最多 {count} 名成员",descItem5:"基础版团队可管理最多 {count} 个组件",descItem6:"支持创建分组菜单,灵活组织团队组件"},IE={title:"用户",username:"用户名",account:"账号",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",confirmNewPassword:"确认新密码",pleaseInputNewPassword:"请输入新密码",pleaseConfirmNewPassword:"请确认新密码",passwordModified:"密码修改成功",email:"邮箱",oldEmail:"旧邮箱",newEmail:"新邮箱",phone:"手机号",avatar:"头像",nickname:"昵称",login:"登录",logout:"退出登录",register:"注册",forgotPassword:"忘记密码",resetPassword:"重置密码",changePassword:"修改密码",changeNickname:"修改昵称",pleaseInputNickname:"请输入昵称",changeAvatar:"修改头像",avatarModified:"头像修改成功",changeEmail:"修改邮箱",basicInfo:"基本信息",securitySettings:"安全设置",loginPassword:"登录密码",passwordTip:"建议定期更换密码,确保账号安全",setPassword:"设置密码",emailLogin:"邮箱登录",emailLoginTip:"允许使用邮箱作为登录账号",pleaseSetPasswordFirst:"请先设置登录密码",emailLoginEnabled:"邮箱登录已开启",emailLoginDisabled:"邮箱登录已关闭",registerTime:"注册时间",notBound:"未绑定",change:"更换",bind:"绑定",authCode:"验证码",oldAuthCode:"旧验证码",newAuthCode:"新验证码",sendAuthCode:"发送验证码",resendAuthCode:"重新发送",getAuthCode:"获取验证码",pleaseInputAuthCode:"请输入验证码",pleaseInputNewAuthCode:"请输入新验证码",resendAfterSeconds:"{n}秒后重新获取",accountLogin:"账号登录",pleaseInputAccount:"请输入账号",pleaseInputUsername:"请输入用户名",pleaseInputPassword:"请输入密码",pleaseInputEmail:"请输入邮箱",pleaseInputOldEmail:"请输入旧邮箱",pleaseInputNewEmail:"请输入新邮箱",pleaseInputCorrectEmail:"请输入正确的邮箱",emailModified:"邮箱修改成功",newAuthCodeSent:"新验证码已发送",authCodeSent:"验证码已发送",guestLogin:"游客访问",loginSuccess:"登录成功",userInfo:"用户信息",personalCenter:"个人中心",myComp:"我的组件",guest:"游客",notLoggedIn:"未登录",goLogin:"去登录"},ME={title:"文件",name:"文件名",path:"文件路径",size:"文件大小",type:"文件类型",dir:"文件夹",selectDir:"选择文件夹",upload:"文件上传",download:"文件下载",select:"选择",multiSelect:"不支持多选",onlyDir:"只能选择文件夹",rootDir:"根目录",projectPath:"项目路径",currentDir:"当前目录",parentDir:"上级目录",refreshDir:"刷新文件夹列表"},FE={success:{download:"下载成功",update:"更新成功",delete:"删除成功",collect:"收藏成功",uncollect:"取消收藏成功",save:"保存成功",submit:"提交成功",upload:"上传成功",copy:"复制成功",operation:"操作成功",sendAuthCode:"验证码已发送",exitTeam:"退出成功"},error:{download:"下载失败",update:"更新失败",delete:"删除失败",collect:"收藏失败",uncollect:"取消收藏失败",save:"保存失败",submit:"提交失败",upload:"上传失败",copy:"复制失败",operation:"操作失败",load:"加载失败",network:"网络错误",timeout:"请求超时",unknown:"未知错误",pleaseFixCompileError:"请先处理编译错误",loginExpired:"登录已过期,请重新登录",refreshFailed:"刷新失败",requestFailed:"请求失败,请联系管理员",storageNotSupported:"浏览器不支持 storage.estimate API"},noUpdatePermission:"当前组件您没有更新权限,请联系管理员获取权限",confirm:{delete:"确定删除吗?",submit:"确定提交吗?",update:"确定更新吗?",exit:"确定退出吗?",cancel:"确定取消吗?"},loginRequired:"请先登录",fileExceed:"最多只能选择 {limit} 个文件,本次已选择 {selected} 个,共将上传 {total} 个文件",validate:{required:"必填项",format:"格式不正确",min:"不能小于最小值",max:"不能超过最大值",length:"长度不正确",email:"邮箱格式不正确",phone:"手机号格式不正确",imageFormat:"上传文件只能是图片格式",pleaseSelectFile:"请先选择文件",fileMaxSize:"上传文件大小不能超过 {size}MB!"}},DE={404:"页面不存在",share:"组件市场",collect:"收藏组件",collectSimple:"收藏",mine:"我的组件",mineSimple:"我的",local:"本地组件",localSimple:"本地",team:"团队",upload:"上传组件",uploadSimple:"上传",uploadTeam:"上传团队组件",setting:"设置",userInfo:"用户信息",upgrade:"更新",terminal:"终端",preview:"组件预览",previewLocal:"本地组件预览",previewTeam:"团队组件预览",previewBlank:"预览",similarPreview:"相似组件预览",login:"登录",mdPreview:"文档预览",unknownTag:"未知标签"},LE={parse:"解析 Markdown",loading:"加载 Markdown",error:"加载失败",toc:"目录",anchor:"锚点"},jE={title:"终端",open:"打开终端",close:"关闭终端",execute:"执行命令",shutdown:"关闭进程",timeout:"超时时间",disconnected:"终端已断开连接"},zE={title:"依赖",name:"依赖名称",version:"依赖版本",install:"安装依赖",installing:"安装中",installed:"已安装",prebuild:"预构建",prebuildSize:"预构建大小",clearPrebuild:"清空预构建",batchSetting:"批量设置",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"仅安装",majorVersion:"主版本",minorVersion:"主次版本",exactVersion:"完全一致"}},NE={title:"设置",previewRule:"预览规则",other:"其他设置",theme:"主题",language:"语言",darkMode:"暗黑模式",lightMode:"明亮模式"},UE={title:"版本更新",current:"当前版本",latest:"最新版本",check:"检查更新",upgrading:"更新中",upgraded:"已更新",publish:"发布更新",record:"更新记录",log:"更新日志",hasUpdate:"有更新",betaVersion:"内测版",noUpdate:"暂无更新",updateMethod:"更新方式",openTerminalAndRun:"打开终端,执行以下命令:",cannotIgnoreUpdate:"不可忽略此次更新"},VE={systemRecommended:"系统推荐",all:"全部",latest:"最新",hottest:"最热"},BE={submit:"提交"},HE={empty:"不能为空",notString:"必须是字符串类型,当前类型为: {type}",contentEmpty:"内容不能为空",startsWithNumber:'内容不能以数字开头,当前以 "{char}" 开头',invalidCharBacktick:"内容包含反引号(Markdown 语法标记),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharNewline:"内容包含换行符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharCarriageReturn:"内容包含回车符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharTab:"内容包含制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharFormFeed:"内容包含换页符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharVerticalTab:"内容包含垂直制表符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHash:"内容包含 # 字符,特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格",invalidCharHtmlSpecial:'内容包含 HTML 特殊字符 "{char}",特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格',invalidCharUnknown:'内容包含非法字符 "{char}"(Unicode: U+{code}),特殊字符只允许连字符(-)、下划线(_)、中文括号()、空格'},qE={openInEditor:"在编辑器中打开",current:"当前",noRegistered:"暂无已注册项目",deregisterTitle:"注销项目",deregisterConfirm:"确定要注销项目 {hash} ({cwd}) 吗?",deregisterSuccess:"已注销项目 {hash}",deregisterFailed:"注销失败"},WE={common:AE,comp:PE,team:RE,user:IE,file:ME,message:FE,route:DE,markdown:LE,terminal:jE,deps:zE,setting:NE,upgrade:UE,tag:VE,formCreate:BE,validateHash:HE,project:qE},KE={keyword:"Keyword",confirm:"Confirm",cancel:"Cancel",close:"Close",save:"Save",submit:"Submit",delete:"Delete",edit:"Edit",add:"Add",update:"Update",upload:"Upload",download:"Download",refresh:"Refresh",loading:"Loading",success:"Success",error:"Error",warning:"Warning",info:"Info",copy:"Copy",copied:"Copied",copySuccess:"Copy successful",copyFailed:"Copy failed",open:"Open",search:"Search",reset:"Reset",clear:"Clear",back:"Back",next:"Next",prev:"Previous",finish:"Finish",operation:"Operation",status:"Status",yes:"Yes",no:"No",name:"Name",description:"Description",version:"Version",time:"Time",date:"Date",author:"Author",type:"Type",category:"Category",tag:"Tag",content:"Content",setting:"Setting",cache:"Cache",cacheSize:"Used",clearCache:"Clear Cache",clearCacheConfirm:"This will clear browser single-file compilation results and module pre-compilation files. Confirm to clear cache?",cacheCleared:"Cache cleared",newPage:"Open in new page",terminal:"Terminal",preview:"Preview",doc:"Documentation",readme:"README.md",upgradeRecord:"Update Record",openInNewPage:"Open in new page",depInstall:"Dependency Installation",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",maximizeRestore:"Maximize/Restore",siteSlogan:"Atomic Component Community, Making Component Sharing Easier.",siteSubtitle:"Vue Component Sharing Platform",docsTutorial:"Documentation",empty:"No data",noReadme:"Component has no README.md file configured",dragSort:"Drag to sort",filter:"Filter",apply:"Apply",person:"people",unit:"items",pleaseSelect:"Please select",pleaseInput:"Please input",me:"Me",generate:"Generate",regenerate:"Regenerate",generateSuccess:"Generated successfully",moreOperations:"More Operations",more:"More",maxTagCount:"Max Tag Count"},YE={keywordPlaceholder:"Please input component name or description",title:"Component",name:"Component Name",fieldId:"Component ID",fieldName:"Component Name",fieldVersion:"Version",desc:"Component Description",remarksDesc:"Remarks",remarksDescRequired:"Please enter remarks",pleaseInputCompName:"Please enter component name",pleaseInputRemarks:"Please enter remarks to help with component market search",compNameRequired:"Component name is required",compNameNamingRule:"Component name must be in PascalCase or kebab-case",lengthBetween:"Length must be between {min} and {max} characters",version:"Component Version",detail:"Component Detail",preview:"Component Preview",previewConfig:"Preview Config",previewList:"Preview List",uploadPreview:"Component Upload Preview",updatePreview:"Component Update Preview",download:"Download Component",update:"Update Component",upload:"Upload Component",submit:"Submit Component",edit:"Edit Component",add:"Add Component",delete:"Delete Component",local:"Local Component",remote:"Remote Component",online:"Online Component",similar:"Similar Components",similarTeam:"Similar Components in Team",dir:"Component Directory",file:"Component File",entry:"Entry File",previewEntry:"Preview Entry Address",previewEntryFull:"Preview Entry Address (Fullscreen)",addPreviewEntry:"Add Preview Entry",maxPreviewEntry:"Maximum {n} preview entries allowed",pleaseAddPreviewEntry:"Please add a preview entry",miniPreviewFile:"Mini Preview File",fullPreviewFile:"Full Preview File",pleaseSelectPreviewFile:"Please select preview file",remarkDesc:"Remarks",dep:"Component Dependencies",localDep:"Component Dependencies (Local)",onlineDep:"Component Dependencies (Online)",finalDep:"Final Dependencies",localVersion:"Local: ",onlineVersion:"Online: ",onlineDepEmpty:"No online dependency data!",versionConsistent:"Version Consistent",versionChange:"Version changed, please select final version",versionChangeConfirmed:"Confirmed",newDep:"New Dependency",miniPanel:"Mini Panel",fullPanel:"Full Panel",reload:"Reload",uploadProtocol:"Upload Protocol",bgPanel:"Background",compLocation:"Component Location",pleaseSelectFolderFirst:"Please select a folder first",compAlreadyUploaded:"Component already uploaded, please go to My Components or Team Components to update",affirmDep:"Component Dependencies (Confirmed Version)",checkConfig:"Config Check",checkError:"Error Info",extraInfo:"Extra Info",baseInfo:"Basic Info",upgradeLog:"Upgrade Log",pleaseInputUpgradeLog:"Please enter upgrade description",config:"Component Config",configStatus:"Component Config Check Status",configError:"Config Error",configCheckError:"Config Check Error",needUpgrade:"Needs Upgrade",fileChanged:"Component files changed",versionChanged:"Version changed",fileNoChange:"Files unchanged",markdownValid:"Markdown preview validation passed",noMarkdown:"No markdown file",hash:"File Hash",localHash:"Local Component File Hash",remoteHash:"Remote Component File Hash",remoteVersion:"Remote Component Version",remoteVersionPrefix:"Online: ",localVersionPrefix:"Local: ",versionCompare:"Version Comparison Result",carouselIndex:"Component Preview Carousel Index",bgColor:"Component Background Color",dialogType:"Component Dialog Type",repeat:"Component Repeat Check",existLocal:"Component exists locally",scopeId:"Scope ID",tempDir:"Component Temp Directory",submitLimit:"Component Submit Limit",maxSize:"Total Size Limit",maxCount:"File Count Limit",matchType:"Match Type",updateType:"Update Type",updateOnline:"Online Update",updateOffline:"Offline Update",compOfflineUpdate:"Component Offline Update",compOnlineUpdate:"Component Online Update",folder:"Folder",compNotInLocal:"Component is not local. Continuing will only update basic information like description and preview config. Continue?",selectUpdateFolder:"Please select folder to update",openInVscode:"Open in VS Code",openingInEditor:"Opening in editor...",updateSuccess:"Update successful",downloadVersionConfirm:"The currently selected version is: {version}, confirm download?",downloading:"Downloading component...",downloadPathConfirm:"Download component to path [{path}]?",downloadCoverConfirm:"Component [{name}] already exists or has a duplicate name, overwrite?",uncollectConfirm:"Are you sure you want to uncollect component [{name}]? It will no longer appear in your collection list.",deleteConfirm:"Are you sure you want to delete component [{name}]? This will free up the component name and cannot be undone.",collect:"Collect",uncollect:"Uncollect",collected:"Collected",uncollected:"Not Collected",entryFile:"Entry File",configFile:"Config File",fileChangedNeedVersion:"File content changed, please increment version",viewFileChanges:"View File Changes",versionChangedButFileSame:"Version changed but file content unchanged, please revert version",errorMsg:"Error Message",versionCannotBeLessThanLatest:"Version cannot be less than latest version {version}",uploadAnyway:"Upload Anyway",compileError:"Component compilation failed",compileWarn:"Component compilation warning",formatCode:"Format Code:",formatCodeTooltip:"Only formats files during comparison, original files remain unchanged",noChanges:"No changes",diff:{changed:"M Changed",unchanged:"U Unchanged",added:"A Added",deleted:"D Deleted"}},GE={title:"Team",name:"Team Name",code:"Team Code",desc:"Team Description",create:"Create Team",join:"Join Team",exit:"Exit Team",exitConfirm:"Exit Confirmation",manage:"Team Management",setting:"Team Settings",member:"Team Members",memberCount:"Member Count",maxMember:"Max Members",compCount:"Component Count",maxCompCount:"Max Components",creator:"Creator",downloadCount:"Downloads",collectCount:"Collections",createTime:"Create Time",myTeam:"My Teams",joinedTeam:"Joined Teams",space:"Team Space",noJoined:"No joined teams",noCreated:"No created teams",createCountLimit:"Max teams allowed to create",joinCountLimit:"Max teams allowed to join",compList:"Team Component List",myCompList:"My Component List",compGroup:"Team Component Group",compGroupList:"Team Component Group List",addMyComp:"Team Add My Component",compUpdate:"Team My Component Update",addFromMine:"Add from My Components",applyList:"Apply List",nickname:"Team Nickname",noTeamInfo:"No team information",compLib:"Component Library",groupConfig:"Group Config",compManage:"Component Management",unsavedDataLeave:"Group configuration data is not saved, are you sure you want to leave?",leave:"Leave",disbandTeam:"Disband Team",applyAudit:"Apply Audit",teamName:"Team Name",fillTeamCode:"Fill in Team Code",pleaseInputTeamCode:"Please enter team code",teamIdNotExist:"Team ID does not exist",joinSuccess:"Joined team successfully",applyJoinTeam:"Apply to Join Team",showRepeatComp:"Show Duplicate Components",allowAuthorDelete:"Allow Author Delete",teamIntro:"Team Introduction",fillTeamName:"Fill in Team Name",pleaseInputTeamName:"Please enter team name",pleaseInputTeamDesc:"Please enter team description",createSuccess:"Team created successfully",charLength:"Length must be between {min} and {max} characters",disbandConfirm:"Are you sure you want to disband the team? All members and components will be removed and cannot be recovered.",deleteConfirm:"Delete Confirmation",inputAuthCode:"Please enter verification code",disbandSuccess:"Team disbanded successfully",reject:"Reject",agree:"Agree",approved:"Approved",rejected:"Rejected",kickOut:"Kick Out",teamUserNickname:"Team Nickname",pleaseInputTeamNickname:"Please enter your team nickname",normalUser:"Normal User",kickOutConfirm:"Are you sure you want to kick out user [{name}]?",kickOutSuccess:"Kicked out successfully",selectCanUpdateUser:"Select users who can update",authorAutoAuth:"Author has default authorization",updateAuth:"Update Authorization",updateTime:"Update Time",expandAll:"Expand All",createGroup:"Create Group",unsaved:"Unsaved",pleaseInputGroupName:"Please enter group name",addComp:"Add Component",added:"Added",notAdded:"Not Added",defaultGroup:"Default Group",deleteGroupConfirm:"Are you sure you want to delete this group? All components in this group will be removed from the group.",addSuccess:"Added successfully",isGrouped:"Is Grouped",grouped:"Grouped",ungrouped:"Ungrouped",group:"Group",prevVersion:"Previous Version",newVersion:"New Version",upgradeDesc:"Upgrade Description",similarCompInTeam:"Similar Components in Team",similarComp:"Similar Components",deleteCompConfirm:"Are you sure you want to delete team component [{name}]? Team members will no longer be able to use this component.",descTitle:"Create an Exclusive Component Space for Your Team",descItem1:"Create a private team where components are only visible to members, protecting core assets",descItem2:"Each account can create up to {count} teams",descItem3:"Each account can join up to {count} teams",descItem4:"Basic team supports up to {count} members",descItem5:"Basic team can manage up to {count} components",descItem6:"Support creating group menus to organize team components flexibly"},QE={title:"User",username:"Username",account:"Account",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",confirmNewPassword:"Confirm New Password",pleaseInputNewPassword:"Please enter new password",pleaseConfirmNewPassword:"Please confirm new password",passwordModified:"Password modified successfully",email:"Email",oldEmail:"Old Email",newEmail:"New Email",phone:"Phone",avatar:"Avatar",nickname:"Nickname",login:"Login",logout:"Logout",register:"Register",forgotPassword:"Forgot Password",resetPassword:"Reset Password",changePassword:"Change Password",changeNickname:"Change Nickname",pleaseInputNickname:"Please enter nickname",changeAvatar:"Change Avatar",avatarModified:"Avatar updated successfully",changeEmail:"Change Email",basicInfo:"Basic Information",securitySettings:"Security Settings",loginPassword:"Login Password",passwordTip:"Regularly change your password to ensure account security",setPassword:"Set Password",emailLogin:"Email Login",emailLoginTip:"Allow using email as login account",pleaseSetPasswordFirst:"Please set login password first",emailLoginEnabled:"Email login enabled",emailLoginDisabled:"Email login disabled",registerTime:"Registration Time",notBound:"Not Bound",change:"Change",bind:"Bind",authCode:"Verification Code",oldAuthCode:"Old Verification Code",newAuthCode:"New Verification Code",sendAuthCode:"Send Auth Code",resendAuthCode:"Resend",getAuthCode:"Get Code",pleaseInputAuthCode:"Please enter code",pleaseInputNewAuthCode:"Please enter new code",resendAfterSeconds:"Resend in {n}s",accountLogin:"Account Login",pleaseInputAccount:"Please enter account",pleaseInputUsername:"Please enter username",pleaseInputPassword:"Please enter password",pleaseInputEmail:"Please enter email",pleaseInputOldEmail:"Please enter old email",pleaseInputNewEmail:"Please enter new email",pleaseInputCorrectEmail:"Please enter correct email",emailModified:"Email modified successfully",newAuthCodeSent:"New verification code sent",authCodeSent:"Verification code sent",guestLogin:"Guest Access",loginSuccess:"Login successful",userInfo:"User Info",personalCenter:"Personal Center",myComp:"My Components",guest:"Guest",notLoggedIn:"Not logged in",goLogin:"Go to Login"},XE={title:"File",name:"Filename",path:"File Path",size:"File Size",type:"File Type",dir:"Directory",selectDir:"Select Directory",upload:"File Upload",download:"File Download",select:"Select",multiSelect:"Multiple selection not supported",onlyDir:"Only directories can be selected",rootDir:"Root Directory",projectPath:"Project Path",currentDir:"Current Directory",parentDir:"Parent Directory",refreshDir:"Refresh Directory List"},JE={success:{download:"Download successful",update:"Update successful",delete:"Delete successful",collect:"Collect successful",uncollect:"Uncollect successful",save:"Save successful",submit:"Submit successful",upload:"Upload successful",copy:"Copy successful",operation:"Operation successful",sendAuthCode:"Verification code sent",exitTeam:"Exit successful"},error:{download:"Download failed",update:"Update failed",delete:"Delete failed",collect:"Collect failed",uncollect:"Uncollect failed",save:"Save failed",submit:"Submit failed",upload:"Upload failed",copy:"Copy failed",operation:"Operation failed",load:"Load failed",network:"Network error",timeout:"Request timeout",unknown:"Unknown error",pleaseFixCompileError:"Please fix compilation errors first",loginExpired:"Login expired, please log in again",refreshFailed:"Refresh failed",requestFailed:"Request failed, please contact administrator",storageNotSupported:"Browser does not support storage.estimate API"},noUpdatePermission:"You do not have permission to update this component. Please contact the administrator for access.",confirm:{delete:"Are you sure to delete?",submit:"Are you sure to submit?",update:"Are you sure to update?",exit:"Are you sure to exit?",cancel:"Are you sure to cancel?"},loginRequired:"Please login first",fileExceed:"You can select at most {limit} files, {selected} selected this time, {total} total to be uploaded",validate:{required:"Required field",format:"Invalid format",min:"Cannot be less than minimum value",max:"Cannot exceed maximum value",length:"Invalid length",email:"Invalid email format",phone:"Invalid phone format",imageFormat:"Only image files are allowed",pleaseSelectFile:"Please select a file first",fileMaxSize:"File size cannot exceed {size}MB!"}},ZE={404:"Page Not Found",share:"Component Market",collect:"Collected Components",collectSimple:"Collection",mine:"My Components",mineSimple:"Mine",local:"Local Components",localSimple:"Local",team:"Team",upload:"Upload Component",uploadSimple:"Upload",uploadTeam:"Upload Team Component",setting:"Settings",userInfo:"User Info",upgrade:"Upgrade",terminal:"Terminal",preview:"Component Preview",previewLocal:"Local Component Preview",previewTeam:"Team Component Preview",previewBlank:"Preview",similarPreview:"Similar Component Preview",login:"Login",mdPreview:"Document Preview",unknownTag:"Unknown Tag"},e2={parse:"Parse Markdown",loading:"Loading Markdown",error:"Load failed",toc:"Table of Contents",anchor:"Anchor"},t2={title:"Terminal",open:"Open Terminal",close:"Close Terminal",execute:"Execute Command",shutdown:"Shutdown Process",timeout:"Timeout",disconnected:"Terminal disconnected"},n2={title:"Dependencies",name:"Dependency Name",version:"Dependency Version",install:"Install Dependencies",installing:"Installing",installed:"Installed",prebuild:"Prebuild",prebuildSize:"Prebuild Size",clearPrebuild:"Clear Prebuild",batchSetting:"Batch Setting",dependencies:"dependencies",devDependencies:"devDependencies",match:{onlyInstall:"Install Only",majorVersion:"Major Version",minorVersion:"Major + Minor",exactVersion:"Exact Match"}},i2={title:"Settings",previewRule:"Preview Rule",other:"Other Settings",theme:"Theme",language:"Language",darkMode:"Dark Mode",lightMode:"Light Mode"},o2={title:"Version Update",current:"Current Version",latest:"Latest Version",check:"Check for Updates",upgrading:"Updating",upgraded:"Updated",publish:"Publish Update",record:"Update Record",log:"Changelog",hasUpdate:"Update Available",betaVersion:"Beta",noUpdate:"No updates available",updateMethod:"Update Method",openTerminalAndRun:"Open terminal and run:",cannotIgnoreUpdate:"This update cannot be ignored"},r2={systemRecommended:"System Recommended",all:"All",latest:"Latest",hottest:"Hottest"},s2={submit:"Submit"},a2={empty:"Cannot be empty",notString:"Must be a string type, current type: {type}",contentEmpty:"Content cannot be empty",startsWithNumber:'Content cannot start with a number, currently starts with "{char}"',invalidCharBacktick:"Content contains backtick (Markdown syntax marker), only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharNewline:"Content contains newline character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharCarriageReturn:"Content contains carriage return, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharTab:"Content contains tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharFormFeed:"Content contains form feed character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharVerticalTab:"Content contains vertical tab character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHash:"Content contains # character, only hyphen(-), underscore(_), parentheses(), and spaces are allowed",invalidCharHtmlSpecial:'Content contains HTML special character "{char}", only hyphen(-), underscore(_), parentheses(), and spaces are allowed',invalidCharUnknown:'Content contains invalid character "{char}" (Unicode: U+{code}), only hyphen(-), underscore(_), parentheses(), and spaces are allowed'},l2={openInEditor:"Open in Editor",current:"Current",noRegistered:"No registered projects",deregisterTitle:"Deregister Project",deregisterConfirm:"Are you sure you want to deregister project {hash} ({cwd})?",deregisterSuccess:"Deregistered project {hash}",deregisterFailed:"Deregister failed"},c2={common:KE,comp:YE,team:GE,user:QE,file:XE,message:JE,route:ZE,markdown:e2,terminal:t2,deps:n2,setting:i2,upgrade:o2,tag:r2,formCreate:s2,validateHash:a2,project:l2},u2={zh:WE,en:c2},d2=localStorage.getItem(Tb.LOCALE_KEY)||"zh",fm=m_({locale:d2,messages:u2,legacy:!1});function mm(t){t.use(fm)}const bc=Object.freeze(Object.defineProperty({__proto__:null,i18n:fm,setup:mm},Symbol.toStringTag,{value:"Module"}));function h2({store:t}){t.$subscribe((...e)=>{const[n]=e;if(n.type==="direct")throw new Error("不允许直接修改store,建议使用action修改")})}const ml=v_();function vm(t){ml.use(h2),t.use(ml)}const p2=Object.freeze(Object.defineProperty({__proto__:null,pinia:ml,setup:vm},Symbol.toStringTag,{value:"Module"}));function f2(t){t.component("Icon",Y0)}const{i18n:wo}=bc,{pinia:ca}=p2,Qi=vi("userStore",{state:()=>({userInfo:{},guestUserInfo:{avatar:"",nickname:wo.global.t("user.guest"),account:""},logoutDialogOpen:!1}),getters:{userId:t=>t.userInfo._id,displayName(t){return ta()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname:t.userInfo.nickname||t.userInfo.account||wo.global.t("user.notLoggedIn")},avatar:t=>t.userInfo.avatar,avatarStr(t){return ta()===vt.IS_GUEST_LOGIN?t.guestUserInfo.nickname[0]:t.userInfo.nickname?.[0]||t.userInfo.account?.[0]||""}},actions:{async fetchCsrfToken(){pm.get(vt.CSRF_KEY)||await Oi.v1Csrf.csrfcontrollerGetcsrftoken()},updateAvatar(t){this.$patch(e=>{e.userInfo&&(e.userInfo.avatar=t)})},updateNickname(t){this.$patch(e=>{e.userInfo&&(e.userInfo.nickname=t)})},setLogoutDialogOpen(t){this.$patch(e=>{e.logoutDialogOpen=t})},setUserInfo(t){this.$patch(e=>{e.userInfo=t})},login(t){return Oi.v1User.usercontrollerLogin({...t})},async fetchWhoAmI(){const t=await Oi.v1User.usercontrollerWhoami();t.data&&this.setUserInfo(t.data)},logout(){no.push("/login?type=logout").then(t=>{t||(this.clearLocalStorage(),this.resetAll(),this.$reset())})},resetAll(){const t=Xo(),e=TE(),n=$E(),i=yc(),o=kE();t?.$reset(),e?.$reset(),n?.$reset(),i?.$reset(),o?.$reset(),this.clearTeamHomeStores(),this.clearCompListStores(),this.clearCompEditStore()},clearLocalStorage(){Mb(),Lb(),jb()},clearTeamHomeStores(){for(const[t,e]of ca._s.entries())t.startsWith("teamHome")&&e.$reset()},clearCompListStores(){for(const[t,e]of ca._s.entries())t.startsWith("compList")&&e.$reset()},clearCompEditStore(){for(const[t,e]of ca._s.entries())t.startsWith("compEdit")&&e.$reset()},isRealUserLogin(){const t=Object.keys(this.userInfo),e=is();return t.length>0&&e!==null},isAccessTokenExist(){return is()!==null},isGuestLogin(){return ta()===vt.IS_GUEST_LOGIN},isLogin(){const t=this.isRealUserLogin(),e=this.isGuestLogin();return t||e},logoutDialog(){if(this.logoutDialogOpen)return;this.setLogoutDialogOpen(!0);const t={confirmButtonText:wo.global.t("user.goLogin"),showClose:!0,callback:e=>{this.setLogoutDialogOpen(!1),e==="confirm"&&this.logout()}};Y_.alert(wo.global.t("message.loginRequired"),wo.global.t("common.info"),t)}}}),m2=Ce({__name:"SubMenu",props:{route:{},basePath:{}},setup(t){const{getTitle:e}=fc(),n=t,i=Qi(),o=(c,u="")=>Vw.resolve(c,u),r=te(()=>o(n.basePath||"",n.route.path)),s=te(()=>(n.route.children||[]).some(c=>!c.meta?.hidden)),a=te(()=>{const{children:c=[]}=n.route;return c.length===0||c.length===1&&!c[0]?.children?.length}),l=te(()=>{const{children:c=[],meta:u={}}=n.route;return u?.hidden?!1:i.isRealUserLogin()||c.length>0?!0:(i.isGuestLogin()||!i.isAccessTokenExist())&&n.route.meta?.noAuth});return(c,u)=>{const d=Ue("SubMenu",!0),h=Po,m=G_;return l.value?(y(),T(Ie,{key:0},[t.route.meta?.hideParent&&s.value?(y(!0),T(Ie,{key:0},He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128)):(y(),T(Ie,{key:1},[a.value?(y(),ne(Hw,{key:0,route:t.route,"full-path":r.value},null,8,["route","full-path"])):(y(),ne(m,{key:1,index:r.value},{title:we(()=>[j(h,null,{default:we(()=>[(y(),ne($t(t.route?.meta?.icon)))]),_:1}),g("span",null,L(v(e)(t.route?.meta?.title)),1)]),default:we(()=>[(y(!0),T(Ie,null,He(t.route.children,f=>(y(),ne(d,{key:o(r.value,f.path),route:f,"base-path":o(r.value,f.path)},null,8,["route","base-path"]))),128))]),_:1},8,["index"]))],64))],64)):ue("",!0)}}}),v2=Ce({__name:"index",setup(t){const e=yc(),n=_s(),i=nc(),o=te(()=>n.options.routes),r=te(()=>i.path);return(s,a)=>{const l=Q_;return y(),ne(l,{class:"dark:!bg-gray-800 border-t border-gray-200 dark:border-gray-700",collapse:v(e).collapse,"default-active":r.value},{default:we(()=>[(y(!0),T(Ie,null,He(o.value,c=>(y(),T(Ie,null,[c?.meta?.hidden?ue("",!0):(y(),ne(m2,{key:c.path,basePath:c.path,route:c},null,8,["basePath","route"]))],64))),256))]),_:1},8,["collapse","default-active"])}}}),g2={class:"flex gap-[20px] items-center pl-[10px] pr-[10px]"},_2=["title"],y2=["title"],b2=["title"],w2={class:"flex items-center gap-[10px]"},S2=Ce({__name:"index",setup(t){const{t:e}=Yo(),n=Xo(),i=_s(),o=nc(),r=Ji(Sf,10),s=H(n.maxCache),a=()=>{i.back()},l=()=>{i.replace({path:o.path,query:{...o.query,[vt.ROUTE_STATE_KEY_VERSION]:Date.now()}})};function c(u){u&&n.setMaxCache(u)}return zt(()=>{r.value=n.maxCache}),(u,d)=>{const h=Ue("Icon"),m=il,f=nl;return y(),T("div",g2,[g("span",{title:v(e)("common.back")},[j(h,{icon:"material-symbols:arrow-back-rounded",class:"cursor-pointer",onClick:a})],8,_2),g("span",{title:v(e)("common.refresh")},[j(h,{icon:"material-symbols:refresh-rounded",class:"cursor-pointer",onClick:l})],8,y2),j(f,{placement:"bottom",trigger:"hover",width:"auto"},{reference:we(()=>[g("span",{title:v(e)("common.moreOperations")},[j(h,{icon:"material-symbols:article-outline",class:"cursor-pointer"})],8,b2)]),default:we(()=>[g("div",w2,[g("div",null,L(v(e)("common.maxTagCount"))+":",1),g("div",null,[j(m,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=p=>s.value=p),min:1,style:{width:"90px"},"controls-position":"right",onChange:c},null,8,["modelValue"])])])]),_:1})])}}}),C2={class:"flex dark:bg-gray-800 py-[2px] h-[40px] border border-gray-200 dark:border-gray-700"},E2=Ce({__name:"index",setup(t){const{t:e}=Yo(),n=_s(),i=nc(),o=Xo(),{getTitle:r}=fc();$e(()=>i,()=>{o.addView(i)},{immediate:!0,deep:!0});const s=te(()=>o.visitedViews),a=te(()=>s.value.length===1);function l(h){const m=c(h);o.delViewAndJumpToPrev(h.path,m,n)}function c(h){return h.path===i.path}function u(h){n.push(h)}function d(h){const m=h?.meta?.title||e("route.unknownTag"),f=o.getPayLoad(h.path);return r(f?.name||m)}return(h,m)=>{const f=Ue("Icon"),p=Po,_=Gi,C=X_;return y(),T("div",C2,[j(S2),j(v(Gb),{class:"flex-1 overflow-hidden",list:s.value,getKey:w=>w.path},{display:we(({visibleList:w,overflow:S})=>[j(g_,{tag:"ul",name:"fade",class:"flex gap-[5px] p-[2px] items-center"},{default:we(()=>[(y(!0),T(Ie,null,He(w,b=>(y(),T("div",{key:b.path},[j(_,{type:c(b)?"primary":"default",onClick:E=>u(b)},{default:we(()=>[Ke(L(d(b))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]",onClick:Ye(E=>l(b),["stop"])},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1},8,["onClick"]))]),_:2},1032,["type","onClick"])]))),128)),S>0?(y(),ne(C,{key:0,type:"info"},{default:we(()=>[Ke("+"+L(S)+" "+L(v(e)("common.more")),1)]),_:2},1024)):ue("",!0)]),_:2},1024)]),measure:we(({item:w})=>[j(_,{type:"primary"},{default:we(()=>[Ke(L(d(w))+" ",1),a.value?ue("",!0):(y(),ne(p,{key:0,style:{"font-size":"16px"},class:"ml-[5px]"},{default:we(()=>[j(f,{icon:"material-symbols:close"})]),_:1}))]),_:2},1024)]),_:1},8,["list","getKey"])])}}}),x2=ac(E2,[["__scopeId","data-v-8b93a5e3"]]),T2={class:"size-full overflow-hidden"},$2={class:"h-[60px] dark:bg-gray-800"},k2={class:"size-full overflow-hidden flex flex-col dark:bg-gray-800"},O2={class:"dark:bg-gray-800"},A2={class:"size-full flex flex-col"},P2={class:""},R2={class:"flex-1 overflow-auto"},I2=Ce({__name:"index",setup(t){const e=qn(()=>nt(()=>import("./index-dhG9Kj5W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),n=qn(()=>nt(()=>import("./index-DxG4_1zN.js"),__vite__mapDeps([8,1,2,9,10,11,12,13,14,15,16,17,18,6]),import.meta.url)),i=H(68),o=H(200),r=H(60),s=H(""),a=H(""),l=te(()=>s.value?"transition-width duration-400":""),c=te(()=>a.value?"transition-height duration-300":""),u=te(()=>({class:c.value,size:m.value,collapsible:!0,resizable:!1})),d=te(()=>({class:l.value,min:i.value,max:300,collapsible:!0})),h=Ji(Nb,i.value),m=Ji(Ub,r.value),f=yc(),p=Qi(),_=async(S,b)=>{s.value=b,b==="end"&&h.value===0&&(h.value=o.value)},C=(S,b)=>{a.value=b,b==="start"?m.value=0:b==="end"&&(m.value=r.value)},w=S=>{S==="header"?a.value="":S==="side"&&(s.value="")};return zt(()=>{f.setSideBarCollapse(h.value===i.value)}),(S,b)=>{const E=J_,x=ey,O=Z_;return y(),T("div",T2,[j(O,{layout:"vertical",onCollapse:C},{default:we(()=>[j(E,We({class:"!overflow-hidden transform-gpu isolate will-change-height"},u.value,{onTransitionend:b[0]||(b[0]=$=>w("header")),onWebkitTransitionEnd:b[1]||(b[1]=$=>w("header"))}),{default:we(()=>[g("div",$2,[j(v(n))])]),_:1},16),j(E,{class:Ae(["transform-gpu isolate",c.value])},{default:we(()=>[j(O,{onCollapse:_},{default:we(()=>[j(E,We(d.value,{size:v(h),"onUpdate:size":b[2]||(b[2]=$=>ys(h)?h.value=$:null),class:"transform-gpu isolate will-change-width",onTransitionend:b[3]||(b[3]=$=>w("side")),onWebkitTransitionEnd:b[4]||(b[4]=$=>w("side"))}),{default:we(()=>[g("div",k2,[j(v2),v(p).isRealUserLogin()?(y(),T(Ie,{key:0},[g("div",O2,[j(x)]),j(v(e))],64)):ue("",!0)])]),_:1},16,["size"]),j(E,{class:Ae(["transform-gpu isolate !overflow-hidden",l.value])},{default:we(()=>[g("div",A2,[g("div",P2,[j(x2)]),g("div",R2,[(y(),ne(__,null,{default:we(()=>[j(zw)]),_:1}))])])]),_:1},8,["class"])]),_:1})]),_:1},8,["class"])]),_:1})])}}});let no;function M2(){const t=window.__GLOBAL_CONFIG__?.projectHash,e=t?`/${t}/main/`:`/${vt.WEBSITE_PATH_MAIN}/`;return no=y_({history:b_(e),routes:[{path:"/login",name:"login",component:()=>nt(()=>import("./index-DyEkv8OS.js"),__vite__mapDeps([19,1,2,12,13,14,20,21,3,22,23,18]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.login"}},{path:"/upgrade",name:"upgrade",component:()=>nt(()=>import("./index-ByKMTPW3.js"),__vite__mapDeps([24,1,2,12,22,25,26,7,27]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.upgrade"}},{path:"/mdPreview",name:"mdPreview",component:()=>nt(()=>import("./index-DI0kvKsV.js"),__vite__mapDeps([28,1,2,29,25,30]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.mdPreview"}},{path:"/previewBlank/:compId/:version?",name:"previewBlank",component:()=>nt(()=>import("./index-DW-M9dmc.js"),__vite__mapDeps([31,2,32,33,1,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.preview"}},{path:"/previewLocalBlank/:compId",name:"previewLocalBlank",component:()=>nt(()=>import("./index-DANPdG90.js"),__vite__mapDeps([35,2,36,37,1,15,34,4]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.previewLocal"}},{path:"/similarPreview/:compId",name:"similarPreview",component:()=>nt(()=>import("./index-DUr8uU-d.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url),meta:{hidden:!0,noAuth:!0,title:"route.similarPreview"}},{path:"/",component:I2,redirect:"/share",meta:{hideParent:!0},children:[{path:"/share",name:"share",meta:{title:"route.share",icon:qn(()=>nt(()=>import("./home-rounded-8qNxvN2I.js"),__vite__mapDeps([52,16,2,53]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-DSED2-Jv.js"),__vite__mapDeps([54,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/mine",name:"mine",meta:{title:"route.mine",icon:qn(()=>nt(()=>import("./supervised-user-circle-Bnx5icEm.js"),__vite__mapDeps([56,16,2,57]),import.meta.url))},component:()=>nt(()=>import("./index-xqKWYiCC.js"),__vite__mapDeps([58,1,2,45,32,36,15,5,10,46,4,34,18,59,60,61,29,25,30,49,50,3,62,7,63,55]),import.meta.url)},{path:"/collect",name:"collect",meta:{title:"route.collect",icon:qn(()=>nt(()=>import("./kid-star-Cr1NlTdT.js"),__vite__mapDeps([64,16,2,65]),import.meta.url))},component:()=>nt(()=>import("./index-feqY_hvF.js"),__vite__mapDeps([66,1,2,45,32,36,15,5,10,46,4,34,18,55]),import.meta.url)},{path:"/local",name:"local",meta:{title:"route.local",icon:qn(()=>nt(()=>import("./sync-saved-locally-rounded-DtyOT0dw.js"),__vite__mapDeps([67,16,2,68]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-bJb3z37F.js"),__vite__mapDeps([69,1,2,45,32,36,15,5,10,46,4,34,18]),import.meta.url)},{path:"/upload",name:"upload",meta:{title:"route.upload",icon:qn(()=>nt(()=>import("./cloud-upload-BRjLuSi4.js"),__vite__mapDeps([70,16,2,71]),import.meta.url)),noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-ZwJcoRf3.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/uploadTeam/:teamId",name:"uploadTeam",meta:{title:"route.uploadTeam",hidden:!0},component:()=>nt(()=>import("./index-ZwJcoRf3.js"),__vite__mapDeps([72,1,2,60,32,4,61,34,29,25,30,5,49,50,3,62,7,18,44,46,27]),import.meta.url)},{path:"/userInfo",name:"userInfo",meta:{title:"route.userInfo",hidden:!0},component:()=>nt(()=>import("./index-CoWWi7z-.js"),__vite__mapDeps([73,1,2,21,3,5,20,74,9,10,11,75,7]),import.meta.url)},{path:"/preview/:compId",meta:{title:"route.preview",noAuth:!0,hidden:!0},component:()=>nt(()=>import("./index-DUr8uU-d.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/previewLocal/:compId",meta:{title:"route.previewLocal",hidden:!0,noAuth:!0},component:()=>nt(()=>import("./index-B2xvPCaB.js"),__vite__mapDeps([76,1,2,36,47,29,25,30,46,45,32,15,5,10,4,34,18,48,7,37,49]),import.meta.url)},{path:"/previewTeam/:teamId/:compId",meta:{title:"route.previewTeam",noAuth:!0,hidden:!0},props:{isTeamPreview:!0},component:()=>nt(()=>import("./index-DUr8uU-d.js"),__vite__mapDeps([38,1,2,39,40,41,42,43,44,45,32,36,15,5,10,46,4,34,18,47,29,25,30,48,7,33,49,50,51]),import.meta.url)},{path:"/terminal",name:"terminal",meta:{title:"route.terminal",icon:qn(()=>nt(()=>import("./terminal-D72IJB2N.js"),__vite__mapDeps([77,16,2,78]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-CtzG8xUz.js"),__vite__mapDeps([79,41,2,42,1,43]),import.meta.url)},{path:"/setting",name:"setting",meta:{title:"route.setting",icon:qn(()=>nt(()=>import("./settings-BFJXTJ9K.js"),__vite__mapDeps([80,16,2,81]),import.meta.url)),noAuth:!0},component:()=>nt(()=>import("./index-DkTzdi1V.js"),__vite__mapDeps([82,1,2,50,83,7]),import.meta.url)},{path:"/team/:teamId",name:"team",meta:{title:"route.team",hidden:!0},component:()=>nt(()=>import("./index-op0bdgFk.js"),__vite__mapDeps([84,1,2,39,40,9,10,11,45,32,36,15,5,46,4,34,18,3,55,16,50,85,7]),import.meta.url)}]},{path:"/:pathMatch(.*)*",name:"404",meta:{hidden:!0,noAuth:!0,title:"route.404"},component:()=>nt(()=>import("./index-Cn8OtDDR.js"),__vite__mapDeps([86,2,1]),import.meta.url)}]}),no}function F2(t){M2(),t.use(no)}const D2=H([]);function L2(t){const e=ic(Aw,{errors:D2.value}),n=document.createElement("div");n.id="error-container",e.mount(n),document.body.appendChild(n)}var Kr={exports:{}},j2=Kr.exports,Ud;function z2(){return Ud||(Ud=1,(function(t,e){(function(n,i){t.exports=i()})(j2,function(){function n(X){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V})(X)}function i(X,V){if(!(X instanceof V))throw new TypeError("Cannot call a class as a function")}function o(X,V){for(var J=0;J<V.length;J++){var ye=V[J];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(X,ye.key,ye)}}function r(X,V,J){V&&o(X.prototype,V),J&&o(X,J),Object.defineProperty(X,"prototype",{writable:!1})}function s(X,V,J){V in X?Object.defineProperty(X,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):X[V]=J}function a(X,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");X.prototype=Object.create(V&&V.prototype,{constructor:{value:X,writable:!0,configurable:!0}}),Object.defineProperty(X,"prototype",{writable:!1}),V&&c(X,V)}function l(X){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(V){return V.__proto__||Object.getPrototypeOf(V)})(X)}function c(X,V){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,ye){return J.__proto__=ye,J})(X,V)}function u(X,V){if(V&&(typeof V=="object"||typeof V=="function"))return V;if(V!==void 0)throw new TypeError("Derived constructors may only return object or undefined");if(V=X,V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function d(X){var V=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}})();return function(){var J,ye=l(X);return u(this,V?(J=l(this).constructor,Reflect.construct(ye,arguments,J)):ye.apply(this,arguments))}}function h(X,V){(V==null||V>X.length)&&(V=X.length);for(var J=0,ye=new Array(V);J<V;J++)ye[J]=X[J];return ye}function m(X,V){var J,ye=typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(!ye){if(Array.isArray(X)||(ye=(function(Z,ae){if(Z){if(typeof Z=="string")return h(Z,ae);var fe=Object.prototype.toString.call(Z).slice(8,-1);return(fe=fe==="Object"&&Z.constructor?Z.constructor.name:fe)==="Map"||fe==="Set"?Array.from(Z):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?h(Z,ae):void 0}})(X))||V&&X&&typeof X.length=="number")return ye&&(X=ye),J=0,{s:V=function(){},n:function(){return J>=X.length?{done:!0}:{done:!1,value:X[J++]}},e:function(Z){throw Z},f:V};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var xe,se=!0,Me=!1;return{s:function(){ye=ye.call(X)},n:function(){var Z=ye.next();return se=Z.done,Z},e:function(Z){Me=!0,xe=Z},f:function(){try{se||ye.return==null||ye.return()}finally{if(Me)throw xe}}}}function f(){if(p.url)window.location.href=p.url;else if(p.rewriteHTML)try{document.documentElement.innerHTML=p.rewriteHTML}catch{document.documentElement.innerText=p.rewriteHTML}else{try{window.opener=null,window.open("","_self"),window.close(),window.history.back()}catch(X){console.log(X)}setTimeout(function(){window.location.href=p.timeOutUrl||"https://theajack.github.io/disable-devtool/404.html?h=".concat(encodeURIComponent(location.host))},500)}}var p={md5:"",ondevtoolopen:f,ondevtoolclose:null,url:"",timeOutUrl:"",tkName:"ddtk",interval:500,disableMenu:!0,stopIntervalTime:5e3,clearIntervalWhenDevOpenTrigger:!1,detectors:[1,3,4,5,6,7],clearLog:!0,disableSelect:!1,disableInputSelect:!1,disableCopy:!1,disableCut:!1,disablePaste:!1,ignore:null,disableIframeParents:!0,seo:!0,rewriteHTML:""},_=["detectors","ondevtoolclose","ignore"];function C(X){var V,J=0<arguments.length&&X!==void 0?X:{};for(V in J.onDevtoolOpen&&(J.ondevtoolopen=J.onDevtoolOpen),J.onDevtoolClose&&(J.ondevtoolclose=J.onDevtoolClose),p){var ye=V;J[ye]===void 0||n(p[ye])!==n(J[ye])&&_.indexOf(ye)===-1||(p[ye]=J[ye])}typeof p.ondevtoolclose=="function"&&p.clearIntervalWhenDevOpenTrigger===!0&&(p.clearIntervalWhenDevOpenTrigger=!1,console.warn("【DISABLE-DEVTOOL】clearIntervalWhenDevOpenTrigger 在使用 ondevtoolclose 时无效"))}function w(){return new Date().getTime()}function S(X){var V=w();return X(),w()-V}function b(X,V){function J(Me){return function(){X&&X();var Z=Me.apply(void 0,arguments);return V&&V(),Z}}var ye=window.alert,xe=window.confirm,se=window.prompt;try{window.alert=J(ye),window.confirm=J(xe),window.prompt=J(se)}catch{}}var E,x,O,$={iframe:!1,pc:!1,qqBrowser:!1,firefox:!1,macos:!1,edge:!1,oldEdge:!1,ie:!1,iosChrome:!1,iosEdge:!1,chrome:!1,seoBot:!1,mobile:!1};function K(){function X(Dt){return V.indexOf(Dt)!==-1}var V=navigator.userAgent.toLowerCase(),J=(function(){var bt=navigator,Dt=bt.platform,bt=bt.maxTouchPoints;if(typeof bt=="number")return 1<bt;if(typeof Dt=="string"){if(bt=Dt.toLowerCase(),/(mac|win)/i.test(bt))return!1;if(/(android|iphone|ipad|ipod|arch)/i.test(bt))return!0}return/(iphone|ipad|ipod|ios|android)/i.test(navigator.userAgent.toLowerCase())})(),ye=!!window.top&&window!==window.top,xe=!J,se=X("qqbrowser"),Me=X("firefox"),Z=X("macintosh"),ae=X("edge"),fe=ae&&!X("chrome"),ce=fe||X("trident")||X("msie"),be=X("crios"),$n=X("edgios"),Qt=X("chrome")||be,on=!J&&/(googlebot|baiduspider|bingbot|applebot|petalbot|yandexbot|bytespider|chrome\-lighthouse|moto g power)/i.test(V);Object.assign($,{iframe:ye,pc:xe,qqBrowser:se,firefox:Me,macos:Z,edge:ae,oldEdge:fe,ie:ce,iosChrome:be,iosEdge:$n,chrome:Qt,seoBot:on,mobile:J})}function F(){for(var X=(function(){for(var ye={},xe=0;xe<500;xe++)ye["".concat(xe)]="".concat(xe);return ye})(),V=[],J=0;J<50;J++)V.push(X);return V}function P(){p.clearLog&&O()}var N="",M=!1;function q(){var X=p.ignore;if(X){if(typeof X=="function")return X();if(X.length!==0){var V=location.href;if(N===V)return M;N=V;var J,ye=!1,xe=m(X);try{for(xe.s();!(J=xe.n()).done;){var se=J.value;if(typeof se=="string"){if(V.indexOf(se)!==-1){ye=!0;break}}else if(se.test(V)){ye=!0;break}}}catch(Me){xe.e(Me)}finally{xe.f()}return M=ye}}}var le=function(){return!1};function de(X){var V,J,ye=74,xe=73,se=85,Me=83,Z=123,ae=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&(be===xe||be===ye)}:function(ce,be){return ce.ctrlKey&&ce.shiftKey&&(be===xe||be===ye)},fe=$.macos?function(ce,be){return ce.metaKey&&ce.altKey&&be===se||ce.metaKey&&be===Me}:function(ce,be){return ce.ctrlKey&&(be===Me||be===se)};X.addEventListener("keydown",function(ce){var be=(ce=ce||X.event).keyCode||ce.which;if(be===Z||ae(ce,be)||fe(ce,be))return I(X,ce)},!0),V=X,p.disableMenu&&V.addEventListener("contextmenu",function(ce){if(ce.pointerType!=="touch")return I(V,ce)}),J=X,(p.disableSelect||p.disableInputSelect)&&Y(J,"selectstart"),J=X,p.disableCopy&&Y(J,"copy"),J=X,p.disableCut&&Y(J,"cut"),J=X,p.disablePaste&&Y(J,"paste")}function Y(X,V){X.addEventListener(V,function(J){if(!(ye=J.target)||ye.tagName!=="INPUT"&&ye.tagName!=="TEXTAREA"&&((xe=ye.getAttribute)==null?void 0:xe.call(ye,"contenteditable"))!=="true"){if(p.disableSelect)return I(X,J)}else if(p.disableInputSelect)return I(X,J);var ye,xe})}function I(X,V){if(!q()&&!le())return(V=V||X.event).returnValue=!1,V.preventDefault(),!1}var A,Q=!1,U={};function ie(X){U[X]=!1}function ve(){for(var X in U)if(U[X])return Q=!0;return Q=!1}(Pe=A=A||{})[Pe.Unknown=-1]="Unknown",Pe[Pe.RegToString=0]="RegToString",Pe[Pe.DefineId=1]="DefineId",Pe[Pe.Size=2]="Size",Pe[Pe.DateToString=3]="DateToString",Pe[Pe.FuncToString=4]="FuncToString",Pe[Pe.Debugger=5]="Debugger",Pe[Pe.Performance=6]="Performance",Pe[Pe.DebugLib=7]="DebugLib";var re=(function(){function X(ye){var J=ye.type,ye=ye.enabled,ye=ye===void 0||ye;i(this,X),this.type=A.Unknown,this.enabled=!0,this.type=J,this.enabled=ye,this.enabled&&(J=this,k.push(J),this.init())}return r(X,[{key:"onDevToolOpen",value:function(){var V;console.warn("You don't have permission to use DEVTOOL!【type = ".concat(this.type,"】")),p.clearIntervalWhenDevOpenTrigger&&B(),window.clearTimeout(R),p.ondevtoolopen(this.type,f),V=this.type,U[V]=!0}},{key:"init",value:function(){}}]),X})(),ge=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DebugLib})}return r(V,[{key:"init",value:function(){}},{key:"detect",value:function(){var J;(((J=(J=window.eruda)==null?void 0:J._devTools)==null?void 0:J._isShow)===!0||window._vcOrigConsole&&window.document.querySelector("#__vconsole.vc-toggle"))&&this.onDevToolOpen()}}],[{key:"isUsing",value:function(){return!!window.eruda||!!window._vcOrigConsole}}]),V})(),_e=0,R=0,k=[],z=0;function D(X){function V(){fe=!0}function J(){fe=!1}var ye,xe,se,Me,Z,ae,fe=!1;function ce(){(ae[Me]===se?xe:ye)()}b(V,J),ye=J,xe=V,(ae=document).hidden!==void 0?(se="hidden",Z="visibilitychange",Me="visibilityState"):ae.mozHidden!==void 0?(se="mozHidden",Z="mozvisibilitychange",Me="mozVisibilityState"):ae.msHidden!==void 0?(se="msHidden",Z="msvisibilitychange",Me="msVisibilityState"):ae.webkitHidden!==void 0&&(se="webkitHidden",Z="webkitvisibilitychange",Me="webkitVisibilityState"),ae.removeEventListener(Z,ce,!1),ae.addEventListener(Z,ce,!1),_e=window.setInterval(function(){if(!(X.isSuspend||fe||q())){var be,$n,Qt=m(k);try{for(Qt.s();!(be=Qt.n()).done;){var on=be.value;ie(on.type),on.detect(z++)}}catch(Dt){Qt.e(Dt)}finally{Qt.f()}P(),typeof p.ondevtoolclose=="function"&&($n=Q,!ve()&&$n&&p.ondevtoolclose())}},p.interval),R=setTimeout(function(){$.pc||ge.isUsing()||B()},p.stopIntervalTime)}function B(){window.clearInterval(_e)}var oe=8;function ee(X){for(var V=(function(se,Me){se[Me>>5]|=128<<Me%32,se[14+(Me+64>>>9<<4)]=Me;for(var Z=1732584193,ae=-271733879,fe=-1732584194,ce=271733878,be=0;be<se.length;be+=16){var $n=Z,Qt=ae,on=fe,Dt=ce;Z=he(Z,ae,fe,ce,se[be+0],7,-680876936),ce=he(ce,Z,ae,fe,se[be+1],12,-389564586),fe=he(fe,ce,Z,ae,se[be+2],17,606105819),ae=he(ae,fe,ce,Z,se[be+3],22,-1044525330),Z=he(Z,ae,fe,ce,se[be+4],7,-176418897),ce=he(ce,Z,ae,fe,se[be+5],12,1200080426),fe=he(fe,ce,Z,ae,se[be+6],17,-1473231341),ae=he(ae,fe,ce,Z,se[be+7],22,-45705983),Z=he(Z,ae,fe,ce,se[be+8],7,1770035416),ce=he(ce,Z,ae,fe,se[be+9],12,-1958414417),fe=he(fe,ce,Z,ae,se[be+10],17,-42063),ae=he(ae,fe,ce,Z,se[be+11],22,-1990404162),Z=he(Z,ae,fe,ce,se[be+12],7,1804603682),ce=he(ce,Z,ae,fe,se[be+13],12,-40341101),fe=he(fe,ce,Z,ae,se[be+14],17,-1502002290),ae=he(ae,fe,ce,Z,se[be+15],22,1236535329),Z=me(Z,ae,fe,ce,se[be+1],5,-165796510),ce=me(ce,Z,ae,fe,se[be+6],9,-1069501632),fe=me(fe,ce,Z,ae,se[be+11],14,643717713),ae=me(ae,fe,ce,Z,se[be+0],20,-373897302),Z=me(Z,ae,fe,ce,se[be+5],5,-701558691),ce=me(ce,Z,ae,fe,se[be+10],9,38016083),fe=me(fe,ce,Z,ae,se[be+15],14,-660478335),ae=me(ae,fe,ce,Z,se[be+4],20,-405537848),Z=me(Z,ae,fe,ce,se[be+9],5,568446438),ce=me(ce,Z,ae,fe,se[be+14],9,-1019803690),fe=me(fe,ce,Z,ae,se[be+3],14,-187363961),ae=me(ae,fe,ce,Z,se[be+8],20,1163531501),Z=me(Z,ae,fe,ce,se[be+13],5,-1444681467),ce=me(ce,Z,ae,fe,se[be+2],9,-51403784),fe=me(fe,ce,Z,ae,se[be+7],14,1735328473),ae=me(ae,fe,ce,Z,se[be+12],20,-1926607734),Z=ke(Z,ae,fe,ce,se[be+5],4,-378558),ce=ke(ce,Z,ae,fe,se[be+8],11,-2022574463),fe=ke(fe,ce,Z,ae,se[be+11],16,1839030562),ae=ke(ae,fe,ce,Z,se[be+14],23,-35309556),Z=ke(Z,ae,fe,ce,se[be+1],4,-1530992060),ce=ke(ce,Z,ae,fe,se[be+4],11,1272893353),fe=ke(fe,ce,Z,ae,se[be+7],16,-155497632),ae=ke(ae,fe,ce,Z,se[be+10],23,-1094730640),Z=ke(Z,ae,fe,ce,se[be+13],4,681279174),ce=ke(ce,Z,ae,fe,se[be+0],11,-358537222),fe=ke(fe,ce,Z,ae,se[be+3],16,-722521979),ae=ke(ae,fe,ce,Z,se[be+6],23,76029189),Z=ke(Z,ae,fe,ce,se[be+9],4,-640364487),ce=ke(ce,Z,ae,fe,se[be+12],11,-421815835),fe=ke(fe,ce,Z,ae,se[be+15],16,530742520),ae=ke(ae,fe,ce,Z,se[be+2],23,-995338651),Z=Ee(Z,ae,fe,ce,se[be+0],6,-198630844),ce=Ee(ce,Z,ae,fe,se[be+7],10,1126891415),fe=Ee(fe,ce,Z,ae,se[be+14],15,-1416354905),ae=Ee(ae,fe,ce,Z,se[be+5],21,-57434055),Z=Ee(Z,ae,fe,ce,se[be+12],6,1700485571),ce=Ee(ce,Z,ae,fe,se[be+3],10,-1894986606),fe=Ee(fe,ce,Z,ae,se[be+10],15,-1051523),ae=Ee(ae,fe,ce,Z,se[be+1],21,-2054922799),Z=Ee(Z,ae,fe,ce,se[be+8],6,1873313359),ce=Ee(ce,Z,ae,fe,se[be+15],10,-30611744),fe=Ee(fe,ce,Z,ae,se[be+6],15,-1560198380),ae=Ee(ae,fe,ce,Z,se[be+13],21,1309151649),Z=Ee(Z,ae,fe,ce,se[be+4],6,-145523070),ce=Ee(ce,Z,ae,fe,se[be+11],10,-1120210379),fe=Ee(fe,ce,Z,ae,se[be+2],15,718787259),ae=Ee(ae,fe,ce,Z,se[be+9],21,-343485551),Z=ze(Z,$n),ae=ze(ae,Qt),fe=ze(fe,on),ce=ze(ce,Dt)}return Array(Z,ae,fe,ce)})((function(se){for(var Me=Array(),Z=(1<<oe)-1,ae=0;ae<se.length*oe;ae+=oe)Me[ae>>5]|=(se.charCodeAt(ae/oe)&Z)<<ae%32;return Me})(X),X.length*oe),J="0123456789abcdef",ye="",xe=0;xe<4*V.length;xe++)ye+=J.charAt(V[xe>>2]>>xe%4*8+4&15)+J.charAt(V[xe>>2]>>xe%4*8&15);return ye}function G(X,V,J,ye,xe,se){return ze((V=ze(ze(V,X),ze(ye,se)))<<xe|V>>>32-xe,J)}function he(X,V,J,ye,xe,se,Me){return G(V&J|~V&ye,X,V,xe,se,Me)}function me(X,V,J,ye,xe,se,Me){return G(V&ye|J&~ye,X,V,xe,se,Me)}function ke(X,V,J,ye,xe,se,Me){return G(V^J^ye,X,V,xe,se,Me)}function Ee(X,V,J,ye,xe,se,Me){return G(J^(V|~ye),X,V,xe,se,Me)}function ze(X,V){var J=(65535&X)+(65535&V);return(X>>16)+(V>>16)+(J>>16)<<16|65535&J}var Pe=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.RegToString,enabled:$.qqBrowser||$.firefox})}return r(V,[{key:"init",value:function(){var J=this;this.lastTime=0,this.reg=/./,E(this.reg),this.reg.toString=function(){var ye;return $.qqBrowser?(ye=new Date().getTime(),J.lastTime&&ye-J.lastTime<100?J.onDevToolOpen():J.lastTime=ye):$.firefox&&J.onDevToolOpen(),""}}},{key:"detect",value:function(){E(this.reg)}}]),V})(),Ne=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DefineId})}return r(V,[{key:"init",value:function(){var J=this;this.div=document.createElement("div"),this.div.__defineGetter__("id",function(){J.onDevToolOpen()}),Object.defineProperty(this.div,"id",{get:function(){J.onDevToolOpen()}})}},{key:"detect",value:function(){E(this.div)}}]),V})(),ut=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Size,enabled:!$.iframe&&!$.edge})}return r(V,[{key:"init",value:function(){var J=this;this.checkWindowSizeUneven(),window.addEventListener("resize",function(){setTimeout(function(){J.checkWindowSizeUneven()},100)},!0)}},{key:"detect",value:function(){}},{key:"checkWindowSizeUneven",value:function(){var J=(function(){if(Qe(window.devicePixelRatio))return window.devicePixelRatio;var xe=window.screen;return!!(Qe(xe)&&xe.deviceXDPI&&xe.logicalXDPI)&&xe.deviceXDPI/xe.logicalXDPI})();if(J!==!1){var ye=200<window.outerWidth-window.innerWidth*J,J=300<window.outerHeight-window.innerHeight*J;if(ye||J)return this.onDevToolOpen(),!1;ie(this.type)}return!0}}]),V})();function Qe(X){return X!=null}var at,tt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.DateToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.date=new Date,this.date.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.date),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),pt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.FuncToString,enabled:!$.iosChrome&&!$.iosEdge})}return r(V,[{key:"init",value:function(){var J=this;this.count=0,this.func=function(){},this.func.toString=function(){return J.count++,""}}},{key:"detect",value:function(){this.count=0,E(this.func),P(),2<=this.count&&this.onDevToolOpen()}}]),V})(),dt=(function(){a(V,re);var X=d(V);function V(){return i(this,V),X.call(this,{type:A.Debugger,enabled:$.iosChrome||$.iosEdge})}return r(V,[{key:"detect",value:function(){var J=w();100<w()-J&&this.onDevToolOpen()}}]),V})(),ft=(function(){a(V,re);var X=d(V);function V(){var J;return i(this,V),(J=X.call(this,{type:A.Performance,enabled:$.chrome||!$.mobile})).count=0,J}return r(V,[{key:"init",value:function(){this.maxPrintTime=0,this.largeObjectArray=F()}},{key:"detect",value:function(){var J=this,ye=S(function(){x(J.largeObjectArray)}),xe=S(function(){E(J.largeObjectArray)});if(this.maxPrintTime=Math.max(this.maxPrintTime,xe),P(),ye===0||this.maxPrintTime===0)return!1;ye>10*this.maxPrintTime&&(2<=this.count?this.onDevToolOpen():(this.count++,this.detect()))}}]),V})(),Ft=(s(at={},A.RegToString,Pe),s(at,A.DefineId,Ne),s(at,A.Size,ut),s(at,A.DateToString,tt),s(at,A.FuncToString,pt),s(at,A.Debugger,dt),s(at,A.Performance,ft),s(at,A.DebugLib,ge),at),fn=Object.assign(function(X){function V(){var Me=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";return{success:!Me,reason:Me}}var J;if(fn.isRunning)return V("already running");if(K(),J=window.console||{log:function(){},table:function(){},clear:function(){}},O=$.ie?(E=function(){return J.log.apply(J,arguments)},x=function(){return J.table.apply(J,arguments)},function(){return J.clear()}):(E=J.log,x=J.table,J.clear),C(X),p.md5&&ee((function(Me){var Z=window.location.search,ae=window.location.hash;return(Z=Z===""&&ae!==""?"?".concat(ae.split("?")[1]):Z)!==""&&Z!==void 0&&(ae=new RegExp("(^|&)"+Me+"=([^&]*)(&|$)","i"),Me=Z.substr(1).match(ae),Me!=null)?unescape(Me[2]):""})(p.tkName))===p.md5)return V("token passed");if(p.seo&&$.seoBot)return V("seobot");fn.isRunning=!0,D(fn);var ye=fn,xe=(le=function(){return ye.isSuspend},window.top),se=window.parent;if(de(window),p.disableIframeParents&&xe&&se&&xe!==window){for(;se!==xe;)de(se),se=se.parent;de(xe)}return(p.detectors==="all"?Object.keys(Ft):p.detectors).forEach(function(Me){new Ft[Me]}),V()},{isRunning:!1,isSuspend:!1,md5:ee,version:"0.3.9",DetectorType:A,isDevToolOpened:ve});return Pe=(function(){if(typeof window>"u"||!window.document)return null;var X=document.querySelector("[disable-devtool-auto]");if(!X)return null;var V=["disable-menu","disable-select","disable-copy","disable-cut","disable-paste","clear-log"],J=["interval"],ye={};return["md5","url","tk-name","detectors"].concat(V,J).forEach(function(xe){var se=X.getAttribute(xe);se!==null&&(J.indexOf(xe)!==-1?se=parseInt(se):V.indexOf(xe)!==-1?se=se!=="false":xe==="detector"&&se!=="all"&&(se=se.split(" ")),ye[(function(Me){if(Me.indexOf("-")===-1)return Me;var Z=!1;return Me.split("").map(function(ae){return ae==="-"?(Z=!0,""):Z?(Z=!1,ae.toUpperCase()):ae}).join("")})(xe)]=se)}),ye})(),Pe&&fn(Pe),fn})})(Kr)),Kr.exports}var N2=z2();const U2=Di(N2);function V2(){window.__GLOBAL_CONFIG__.allowDebug||U2({disableMenu:!1})}(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{cursor:not-allowed!important;color:#999}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%,-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:24px}._fc-group._fc-group-card ._fc-group-sort:before,._fc-group._fc-group-card ._fc-group-sort:after{content:"";position:absolute;left:50%;width:4px;height:4px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%)}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translate(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translate(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-up,._fc-group._fc-group-card ._fc-group-sort-down{position:absolute;left:0;right:0;height:12px;cursor:pointer;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-up:hover,._fc-group._fc-group-card ._fc-group-sort-down:hover{background:#1890ff1a}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left;float:unset}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var B2=Object.defineProperty,H2=Object.defineProperties,q2=Object.getOwnPropertyDescriptors,Vd=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,K2=Object.prototype.propertyIsEnumerable,Bd=(t,e,n)=>e in t?B2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Te=(t,e)=>{for(var n in e||(e={}))W2.call(e,n)&&Bd(t,n,e[n]);if(Vd)for(var n of Vd(e))K2.call(e,n)&&Bd(t,n,e[n]);return t},en=(t,e)=>H2(t,q2(e));function wc(t,e){return Object.keys(t).reduce((n,i)=>((!e||e.indexOf(i)===-1)&&(n[i]=t[i]),n),{})}function Ut(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}const Y2="fcCheckbox",G2=Ce({name:Y2,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1),l=d=>{const h=[...Ut(o.value)],m=h.indexOf(s.value);s.value=d,m>-1&&(h.splice(m,1),h.push(d),u(h))};$e(r,d=>{if(!a.value){s.value=d;return}l(d)});const c=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=null;if(!r.value&&d!=null&&Array.isArray(d)&&d.length>0&&a.value){const m=c.value.map(f=>f.value);d.forEach(f=>{m.indexOf(f)===-1&&(h=f)})}h!=null&&(s.value=h)},{immediate:!0});const u=d=>{e.emit("update:modelValue",d)};return{options:c,value:o,onInput:u,updateCustomValue:l,makeInput(d){if(a.value)return j(d,{value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":l},null)]})}}},render(){const t=this.type==="button"?"ElCheckboxButton":"ElCheckbox",e=Ue(t);return j(Ue("ElCheckboxGroup"),We(this.$attrs,{modelValue:this.value===null?void 0:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},wc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}});function gm(t){t=t||new Map;const e={$on(n,i){const o=t.get(n);o&&o.push(i)||t.set(n,[i])},$once(n,i){i._once=!0,e.$on(n,i)},$off(n,i){const o=t.get(n);o&&o.splice(o.indexOf(i)>>>0,1)},$emit(n,...i){(t.get(n)||[]).slice().map(o=>{o._once&&(e.$off(n,o),delete o._once),o(...i)}),(t.get("*")||[]).slice().map(o=>{o(n,i)})}};return e}const gi=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},Q2={name:"IconCircleClose"},X2={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function J2(t,e,n,i,o,r){return y(),T("svg",X2,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),g("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)])])}const Z2=gi(Q2,[["render",J2]]),ex={name:"IconDocument"},tx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function nx(t,e,n,i,o,r){return y(),T("svg",tx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)])])}const ix=gi(ex,[["render",nx]]),ox={name:"IconDelete"},rx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function sx(t,e,n,i,o,r){return y(),T("svg",rx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)])])}const ax=gi(ox,[["render",sx]]),lx={name:"IconView"},cx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function ux(t,e,n,i,o,r){return y(),T("svg",cx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)])])}const dx=gi(lx,[["render",ux]]),hx={name:"IconFolderOpened"},px={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function fx(t,e,n,i,o,r){return y(),T("svg",px,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)])])}const mx=gi(hx,[["render",fx]]),vx="fcFrame",gx=Ce({name:vx,props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:Function,modal:{type:Object,default:()=>({})},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:mx,IconView:dx},data(){return{fileList:Ut(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new gm}},watch:{modelValue(t){this.fileList=Ut(t)}},methods:{close(){this.closeModel(!0)},closeModel(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel(){this.previewVisible=!1},showModel(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input(){const t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput(){return j(Ue("ElInput"),We({type:"text",modelValue:this.fileList.map(t=>this.getSrc(t)).toString(),readonly:!0},{key:1}),{append:()=>j(Ue("ElButton"),{icon:Ue(this.icon),onClick:()=>this.showModel()},null),suffix:()=>this.fileList.length&&!this.disabled?j(Ue("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:()=>{this.fileList=[],this.input()}},{default:()=>[j(Z2,null,null)]}):null})},makeGroup(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),j("div",{key:2},[t])},makeItem(t,e){return j("div",{class:"_fc-files",key:"3"+t},[e])},valid(t){const e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]无效的字段值")},makeIcons(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){const n=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&n.push(this.makeHandleIcon(t,e)),this.allowRemove&&n.push(this.makeRemoveIcon(t,e)),j("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon(t,e){const n=Ue(this.handleIcon===!0||this.handleIcon===void 0?"icon-view":this.handleIcon);return j(Ue("ElIcon"),{onClick:()=>this.handleClick(t),key:"5"+e},{default:()=>[j(n,null,null)]})},makeRemoveIcon(t,e){return j(Ue("ElIcon"),{onClick:()=>this.handleRemove(t),key:"6"+e},{default:()=>[j(ax,null,null)]})},makeFiles(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j(Ue("ElIcon"),{onClick:()=>this.handleClick(t)},{default:()=>[j(ix,null,null)]}),this.makeIcons(t,e)])))},makeImages(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[j("img",{src:this.getSrc(t)},null),this.makeIcons(t,e)])))},makeBtn(){const t=Ue(this.icon);return j("div",{class:"_fc-upload-btn",onClick:()=>this.showModel(),key:7},[j(Ue("ElIcon"),null,{default:()=>[j(t,null,null)]})])},handleClick(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc(t){return this.srcKey?t[this.srcKey]:t},frameLoad(t){this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:e=>{this.valid(e),this.closeModel()},set:(e,n)=>{this.valid(e),!this.disabled&&this.$emit("update:modelValue",n)},get:e=>(this.valid(e),this.modelValue),onOk:e=>this.bus.$on("$ok",e),onClose:e=>this.bus.$on("$close",e)})}catch(e){console.error(e)}},makeFooter(){const{okBtnText:t,closeBtnText:e,closeBtn:n,okBtn:i,footer:o}=this.$props;if(o)return j("div",null,[n?j(Ue("ElButton"),{onClick:()=>this.onCancel()!==!1&&(this.frameVisible=!1)},{default:()=>[e||this.formCreateInject.t("close")||"关闭"]}):null,i?j(Ue("ElButton"),{type:"primary",onClick:()=>this.onOk()!==!1&&this.closeModel()},{default:()=>[t||this.formCreateInject.t("ok")||"确定"]}):null])}},render(){const t=this.type;let e;t==="input"?e=this.makeInput():t==="image"?e=this.makeImages():e=this.makeFiles();const{width:n="30%",height:i,src:o,title:r,modalTitle:s}=this.$props;return Ge(()=>{this.$refs.frame&&this.frameLoad(this.$refs.frame.contentWindow||{})}),j("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:s,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]}),j(Ue("ElDialog"),We({appendToBody:!0},Te({width:n,title:r},this.modal),{modelValue:this.frameVisible,onClose:()=>this.closeModel(!0)}),{default:()=>[this.frameVisible||!this.reload?j("iframe",{ref:"frame",src:o,frameBorder:"0",style:{height:i,border:"0 none",width:"100%"}},null):null],footer:()=>this.makeFooter()})])},beforeMount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.on("fc:closeModal:"+t,this.close),e&&n.on("fc:closeModal:"+e,this.close)},beforeUnmount(){const{name:t,field:e,api:n}=this.formCreateInject;t&&n.off("fc:closeModal:"+t,this.close),e&&n.off("fc:closeModal:"+e,this.close)}}),_x="fcRadio",yx=Ce({name:_x,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup(t,e){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"options"),o=kt(t,"modelValue"),r=kt(t,"inputValue",""),s=H(r.value),a=kt(t,"input",!1);$e(r,d=>{if(!a.value){s.value=d;return}u(d)});const l=te(()=>{let d=n.value||[];return i.value&&(d=i.value||[]),Array.isArray(d)?d:[]});$e(o,d=>{let h=!1;!r.value&&d!=null&&a.value&&(h=l.value.map(m=>m.value).indexOf(d)===-1),h&&(s.value=d)},{immediate:!0});const c=d=>{e.emit("update:modelValue",d)},u=d=>{const h=s.value;s.value=d,o.value===h&&c(d)};return{options:l,value:o,onInput:c,updateCustomValue:u,customValue:s,makeInput(d){if(a.value)return j(d,{checked:!1,value:s.value||void 0,label:s.value||void 0},{default:()=>[j(Ue("ElInput"),{size:"small",modelValue:s.value,"onUpdate:modelValue":u},null)]})}}},render(){const t=this.type==="button"?"ElRadioButton":"ElRadio",e=Ue(t);return j(Ue("ElRadioGroup"),We(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),Te({default:()=>{var n,i;return[this.options.map((o,r)=>{const s=Te({},o),a=s.value,l=s.label;return delete s.value,delete s.label,j(e,We(s,{label:a,value:a,key:t+r+"-"+a}),{default:()=>[l||a||""]})}),(i=(n=this.$slots).default)==null?void 0:i.call(n),this.makeInput(e)]}},wc(this.$slots,["default"])))},mounted(){this.$emit("fc.el",this.$refs.el)}}),pe={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!pe.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{pe[t]=function(e){return pe.type(e,t)}});function lt(t,e){return{}.hasOwnProperty.call(t,e)}const bx="fcSelect",wx=Ce({name:bx,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup(t,{emit:e}){const n=kt(t.formCreateInject,"options",[]),i=kt(t,"modelValue");return{options:te(()=>Array.isArray(n.value)?n.value:[]),value:i,handleUpdate:o=>{e("update:modelValue",o)},hasProperty:lt,is:pe}},mounted(){this.$emit("fc.el",this.$refs.el)}});function Sx(t,e,n,i,o,r){const s=Ue("el-option"),a=Ue("el-option-group"),l=Ue("el-select");return y(),ne(l,We(t.$attrs,{"model-value":t.value,"onUpdate:modelValue":t.handleUpdate,ref:"el"}),{default:we(()=>[(y(!0),T(Ie,null,He(t.options,(c,u)=>(y(),T(Ie,null,[t.hasProperty(c,"options")?(y(),ne(a,{label:c.label,key:`${u}-${c.label}`},{default:we(()=>[(y(!0),T(Ie,null,He(t.is.trueArray(c.options)?c.options:[],(d,h)=>(y(),ne(s,We({key:`${h}-${d.value}`},{ref_for:!0},d),null,16))),128))]),_:2},1032,["label"])):(y(),ne(s,We({key:`${u}-${c.value}`},{ref_for:!0},c),null,16))],64))),256)),Ve(t.$slots,"default")]),_:3},16,["model-value","onUpdate:modelValue"])}const Cx=gi(wx,[["render",Sx]]),Ex="fcTree",xx=Ce({name:Ex,inheritAttrs:!1,formCreateParser:{mergeProp(t){const e=t.prop.props;e.nodeKey||(e.nodeKey="id"),e.props||(e.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:()=>[]}},emits:["update:modelValue","fc.el"],watch:{modelValue(){this.setValue()}},methods:{updateValue(){if(!this.$refs.tree)return;let t;this.type==="selected"?t=this.$refs.tree.getCurrentKey():t=this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",t)},setValue(){this.$refs.tree&&(this.type==="selected"?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(Ut(this.modelValue)))}},render(){return j(Ue("ElTree"),We(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}}),Tx={name:"IconUpload"},$x={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function kx(t,e,n,i,o,r){return y(),T("svg",$x,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)])])}const Ox=gi(Tx,[["render",kx]]);function Hd(t,e){return typeof t=="object"?t:{url:t,is_string:!0,name:Ax(t),uid:e}}function qd(t){return en(Te({},t),{file:t,value:t})}function Ax(t){return(""+t).split("/").pop()}const Px="fcUpload",Rx=Ce({name:Px,inheritAttrs:!1,formCreateParser:{toFormValue(t){return Ut(t)},toValue(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data(){return{previewVisible:!1,previewImage:"",fileList:[]}},created(){this.fileList=Ut(this.modelValue).map(Hd).map(qd)},watch:{modelValue(t){this.fileList=Ut(t).map(Hd).map(qd)}},methods:{handlePreview(t){this.onPreview?this.onPreview(...arguments):this.listType==="text"?window.open(t.url):(this.previewImage=t.url,this.previewVisible=!0)},update(t){let e=t.map(n=>n.is_string?n.url:n.value||n.url).filter(n=>n!==void 0);this.$emit("update:modelValue",e)},handleCancel(){this.previewVisible=!1},handleChange(t,e){this.$emit("change",...arguments),t.status==="success"&&this.update(e)},handleRemove(t,e){this.$emit("remove",...arguments),this.update(e)},doHttpRequest(t){if(this.httpRequest)return this.httpRequest(t);t.source="upload",this.formCreateInject.api.fetch(t)}},render(){const t=Ut(this.modelValue).length;return j("div",{class:"_fc-upload"},[j(Ue("ElUpload"),We({key:t},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":this.$attrs.limit?this.$attrs.limit<=t:!1},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),Te({default:()=>{var e,n;return[((n=(e=this.$slots).default)==null?void 0:n.call(e))||(["text","picture"].indexOf(this.listType)===-1?j(Ue("ElIcon"),null,{default:()=>[j(Ox,null,null)]}):j(Ue("ElButton"),{type:"primary"},{default:()=>[this.formCreateInject.t("clickToUpload")||this.uploadText||"点击上传"]}))]}},wc(this.$slots,["default"]))),j(Ue("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:()=>[j("img",{style:"width: 100%",src:this.previewImage},null)]})])},mounted(){this.$emit("fc.el",this.$refs.upload)}});function an(t,e,n){t[e]=n}function Si(t,e){delete t[e]}function ir(t,e={},n){let i=!1;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let r=e[o];if((i=Array.isArray(r))||pe.Object(r)){let s=t[o]===void 0;if(i)i=!1,s&&an(t,o,[]);else if(r._clone&&n!==void 0)if(n)r=r.getRule(),s&&an(t,o,{});else{an(t,o,r._clone());continue}else s&&an(t,o,{});t[o]=ir(t[o],r,n)}else an(t,o,r),pe.Undef(r)||(pe.Undef(r.__json)||(t[o].__json=r.__json),pe.Undef(r.__origin)||(t[o].__origin=r.__origin))}return n!==void 0&&Array.isArray(t)?t.filter(o=>!o||!o.__ctrl):t}function Mn(t){return ir({},{value:t}).value}const Ix=Object.assign||function(t){for(let e,n=1;n<arguments.length;n++)for(let i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&an(t,i,e[i]);return t};function Fe(){return Ix.apply(this,arguments)}function vl(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:Te({},t)}function ci(t,e){var n=null;return function(...i){n!==null&&clearTimeout(n),n=setTimeout(()=>t.call(this,...i),e)}}function _m(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Mx(t){return t&&typeof t=="object"&&typeof t.then=="function"}function as(t){return Mx(t)?t:Promise.resolve(t)}function Do(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}function ym(t){return t.replace(t[0],t[0].toLocaleUpperCase())}function bm(t,e,n){return`[form-create ${t}]: ${e}`}function Sc(t,e){console.error(bm("err",t))}function Fx(t){Sc(t.toString()),console.error(t)}const gl="[[FORM-CREATE-PREFIX-",_l="-FORM-CREATE-SUFFIX]]";function Lo(t,e){return JSON.stringify(ir(Array.isArray(t)?[]:{},t,!0),function(n,i){if(!(i&&i._isVue===!0)){if(typeof i!="function")return i;if(i.__json)return i.__json;if(i.__origin&&(i=i.__origin),!i.__emit)return gl+i+_l}},e)}function ua(t){return new Function("return "+t)()}function Dn(t,e){if(t&&pe.String(t)&&t.length>4){let n=t.trim(),i=!1;try{if(n.indexOf(_l)>0&&n.indexOf(gl)===0)n=n.replace(_l,"").replace(gl,""),i=!0;else if(n.indexOf("$FN:")===0)n=n.substring(4),i=!0;else if(n.indexOf("$EXEC:")===0)n=n.substring(6),i=!0;else if(n.indexOf("$GLOBAL:")===0){const r=n.substring(8);return n=function(...s){const a=s[0].api.getGlobalEvent(r);if(a)return a.call(this,...s)},n.__json=t,n.__inject=!0,n}else{if(n.indexOf("$FNX:")===0)return n=ua(`function($inject){
13
13
  `+n.substring(5)+`
14
- }`),n.__json=t,n.__inject=!0,n;(!e&&n.indexOf("function ")===0&&n!=="function "||!e&&n.indexOf("function(")===0&&n!=="function(")&&(i=!0)}if(!i)return t;let o;try{o=ma(n)}catch{o=ma("function "+n)}return o.__json=t,o}catch(o){Tc(`解析失败:${n}
14
+ }`),n.__json=t,n.__inject=!0,n;(!e&&n.indexOf("function ")===0&&n!=="function "||!e&&n.indexOf("function(")===0&&n!=="function(")&&(i=!0)}if(!i)return t;let o;try{o=ua(n)}catch{o=ua("function "+n)}return o.__json=t,o}catch(o){Sc(`解析失败:${n}
15
15
 
16
- err: ${o}`);return}}return t}function $m(t,e){return JSON.parse(t,function(n,i){return fe.Undef(i)||!i.indexOf?i:Dn(i,e)})}let Ux=0;function Fs(){const t=370+ ++Ux;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function pi(t,e,n){let i=t,o;return(e||"").split(".").forEach(r=>{o&&((!i[o]||typeof i[o]!="object")&&(i[o]={}),i=i[o]),o=r}),i[o]=n,i}const Vx="fcGroup",Bx=Ce({name:Vx,props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:()=>[]},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},formCreateInject:Object,parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:Gn(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler(t,e){Object.keys(this.cacheRule).forEach(n=>{const i=this.cacheRule[n];if(i.$f){const o=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{or(i.rule,t),i.$f.setValue(o)},!0);else{const r=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(r)}),i.rule=In(t)}}})},deep:!0},expand(t){let e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler(t){t=t||[];let e=this.sort,n=e.length,i=n-t.length;if(i<0){for(let o=i;o<0;o++)this.addRule(t.length+o,!0);for(let o=0;o<n;o++)this.setValue(e[o],t[o])}else{if(i>0)for(let o=0;o<i;o++)this.removeRule(e[n-o-1]);t.forEach((o,r)=>{this.setValue(e[r],t[r])})}},deep:!0}},methods:{_value(t){return t&&lt(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData(t,e){const n=this.cacheRule,i=this.sort;if(i.filter(r=>n[r]&&n[r].$f).length!==i.length)return;const o=i.map(r=>{const s=t===r?e:Te({},this.cacheRule[r].$f.form),a=this.field?fe.Undef(s[this.field])?null:s[this.field]:s;return this.cache(r,a),a});this.input(o)},setValue(t,e){const n=this.field;n&&(e={[n]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(n?e[n]:e)&&(this.cacheRule[t].$f&&this.cacheRule[t].$f.coverValue(e),this.cache(t,e))},addRule(t,e){const n=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?Te({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const o=In(this.defaultValue);Fe(i.formData,this.field?{[this.field]:o}:o)}this.parse&&this.parse({rule:n,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:n,options:i},this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("add",n,Object.keys(this.cacheRule).length-1))},add$f(t,e,n){this.cacheRule[e].$f=n,Ge(()=>{this.$emit("itemMounted",n,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const n=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("remove",n))},add(t){if(this.disabled||this.onBeforeAdd(this.modelValue)===!1)return;const e=[...this.modelValue];e.push(this.defaultValue?In(this.defaultValue):this.field?null:{}),this.input(e)},del(t,e){if(this.disabled)return;const n=()=>{this.removeRule(e,!0);const i=[...this.modelValue];i.splice(t,1),this.input(i)};us(this.onBeforeRemove(this.modelValue,t)).then(i=>{i!==!1&&n()})},addIcon(t){return j("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon(t,e){return j("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:()=>this.del(t,e)},null)},sortUpIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:()=>this.changeSort(t,-1)},null)},sortDownIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:()=>this.changeSort(t,1)},null)},changeSort(t,e){const n=this.sort[t];this.sort[t]=this.sort[t+e],this.sort[t+e]=n,this.formCreateInject.subForm(this.sort.map(i=>this.cacheRule[i].$f)),this.formData(0)},sortIcon(t,e){const n=t>0,i=t<e-1,o=[];return!n&&!i?o:this.type==="card"&&n&&i?(o.push(j("div",{class:"_fc-group-btn _fc-group-sort"},[j("div",{class:" _fc-group-sort-up",onClick:()=>this.changeSort(t,-1)},null),j("div",{class:" _fc-group-sort-down",onClick:()=>this.changeSort(t,1)},null)])),o):(n&&o.push(this.sortUpIcon(t)),i&&o.push(this.sortDownIcon(t)),o)},makeIcon(t,e,n){if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:n,del:()=>this.del(e,n),add:this.add});const i=[];if((!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(n)),t>this.min&&i.push(this.delIcon(e,n)),this.sortBtn){const o=this.sortIcon(e,t);o&&i.push(...o)}return i},expandRule(t){for(let e=0;e<t;e++)this.modelValue.push(this.field?null:{});this.input([...this.modelValue])},getTitle(t,e){return typeof this.title=="function"?this.title(t,this.modelValue[t],e):typeof this.title=="string"?this.title.replace("{index}",t+1):!1}},created(){const t=(this.expand||0)-this.modelValue.length;for(let e=0;e<this.modelValue.length;e++)this.addRule(e);t>0&&this.expandRule(t)},render(){const t=this.sort,e=this.button,n=this.form,i=this.disabled,o=this.type==="card",r=t.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):j("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((s,a)=>{const{rule:l,options:c}=this.cacheRule[s],u=e&&!i?this.makeIcon(t.length,a,s):[],d=this.getTitle(a,s);return o?j("div",{class:"_fc-group-container",key:s},[j("div",{class:"_fc-group-header"},[d===!1?j("div",{class:"_fc-group-idx"},[a+1]):null,d!==!1?j("div",{class:"_fc-group-title"},[d]):null,j("div",{class:"_fc-group-handle fc-clock"},[u.length?u:null])]),j("div",{class:"_fc-group-content"},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null)])]):j("div",{class:"_fc-group-container",key:s},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null),j("div",{class:"_fc-group-idx"},[a+1]),u.length?j("div",{class:"_fc-group-handle fc-clock"},[u]):null])});return j("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")+(o?" _fc-group-card":"")},[r])}}),Hx="fcSubForm",qx=Ce({name:Hx,props:{rule:Array,options:{type:Object,default:()=>It({submitBtn:!1,resetBtn:!1})},modelValue:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data(){return{cacheValue:{},subApi:{},form:Gn(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f(t){this.subApi=t,Ge(()=>{this.$emit("itemMounted",t)})}},render(){const t=this.form;return j(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),Wx={name:"IconWarning"},Kx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function Yx(t,e,n,i,o,r){return y(),T("svg",Kx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)])])}const Gx=gi(Wx,[["render",Yx]]),Qx=[ex,Sx,Ex,kx,Ax,Lx,Bx,qx,Gx],km=["props"],Om=["class","style","directives"],Am=["on","hook"],Qn=(t,e={},n={})=>{const i=[...km,...n.normal||[]],o=[...Om,...n.array||[]],r=[...Am,...n.functional||[]],s=n.props||[];return t.reduce((a,l)=>{for(const c in l)if(a[c])if(s.indexOf(c)>-1)a[c]=Qn([l[c]],a[c]);else if(i.indexOf(c)>-1)a[c]=Te(Te({},a[c]),l[c]);else if(o.indexOf(c)>-1){const u=a[c]instanceof Array?a[c]:[a[c]],d=l[c]instanceof Array?l[c]:[l[c]];a[c]=[...u,...d]}else if(r.indexOf(c)>-1)for(const u in l[c])if(a[c][u]){const d=a[c][u]instanceof Array?a[c][u]:[a[c][u]],h=l[c][u]instanceof Array?l[c][u]:[l[c][u]];a[c][u]=[...d,...h]}else a[c][u]=l[c][u];else if(c==="hook")for(let u in l[c])a[c][u]?a[c][u]=Xx(a[c][u],l[c][u]):a[c][u]=l[c][u];else a[c]=l[c];else i.indexOf(c)>-1||r.indexOf(c)>-1||s.indexOf(c)>-1?a[c]=Te({},l[c]):o.indexOf(c)>-1?a[c]=l[c]instanceof Array?[...l[c]]:typeof l[c]=="object"?Te({},l[c]):l[c]:a[c]=l[c];return a},e)},Xx=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},Pm=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],$c=["validate","children","control"],kc=["effect","deep","renderSlots"];function Rm(){return[...Pm,...km,...Om,...Am,...$c,...kc]}function Vt(t){const e=t.replace(/(-[a-z])/g,function(n){return n.replace("-","").toLocaleUpperCase()});return Mm(e)}function Mm(t){return t.replace(t[0],t[0].toLowerCase())}function El(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!0}}function Im(t,e){return Fm([t],e||!1)[0]}function Fm(t,e){return or([],[...t],e||!1)}function Zn(t,e){return Qn(Array.isArray(e)?e:[e],t,{array:$c,normal:kc}),t}function Xd(t){const e=fe.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function Jx(t,e){return t?(Object.keys(e||{}).forEach(n=>{e[n]&&(t[n]=Zn(t[n]||{},e[n]))}),t):e}function Dm(t,e){Object.defineProperties(t,Object.keys(e).reduce((n,i)=>(n[i]={get(){return e[i]()}},n),{}))}function On(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function Be(t,e){try{e=t()}catch(n){Nx(n)}return e}function wr(){const t={},e=n=>n||"default";return{setSlot(n,i){n=e(n),!(!i||Array.isArray(i)&&i.length)&&(t[n]||(t[n]=[]),t[n].push(i))},getSlot(n,i){n=e(n);const o=[];return(t[n]||[]).forEach(r=>{if(Array.isArray(r))o.push(...r);else if(fe.Function(r)){const s=r(...i||[]);Array.isArray(s)?o.push(...s):o.push(s)}else fe.Undef(r)||o.push(r)}),o},getSlots(){const n={};return Object.keys(t).forEach(i=>{n[i]=(...o)=>this.getSlot(i,o)}),n},slotLen(n){return n=e(n),t[n]?t[n].length:0},mergeBag(n){if(!n)return this;const i=fe.Function(n.getSlots)?n.getSlots():n;return Array.isArray(n)||Vi(n)?this.setSlot(void 0,()=>n):Object.keys(i).forEach(o=>{this.setSlot(o,i[o])}),this}}}function Jd(t){const e=Te({},t.props||{});return Object.keys(t.on||{}).forEach(n=>{n.indexOf("-")>0&&(n=Vt(n));const i=`on${xm(n)}`;Array.isArray(e[i])?e[i]=[...e[i],t.on[n]]:e[i]?e[i]=[e[i],t.on[n]]:e[i]=t.on[n]}),e.key=t.key,e.ref=t.ref,e.class=t.class,e.id=t.id,e.style=t.style,e.slot&&delete e.slot,e}function Sr(t,e){return Object.setPrototypeOf(t,e),t}const Zd=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,Pi={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Zd(t,e)),"!=":(t,e)=>!Pi["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Zd(t[0],e))>-1},notOn(t,e){return!Pi.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!Pi.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return fe.empty(t)},notEmpty(t){return!fe.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function Pt(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(n=>{t!=null&&(t=t[n])}),t}function Zx(t){const e=/{{\s*(.*?)\s*}}/g;let n;const i={};for(;(n=e.exec(t))!==null;)n[1]&&(i[n[1]]=!0);return Object.keys(i)}function eh(t){let e=t.split("."),n=[],i="";return e.forEach((o,r)=>{r===0?i=o:i+="."+o,n.push(i)}),n.join(" && ")}function Lm(t){const e=[];let n="",i=0;for(let o=0;o<t.length;o++){const r=t[o];r==="["?(i===0&&n&&(e.push({type:"key",value:n}),n=""),i++,n+=r):r==="]"?(i--,n+=r,i===0&&(e.push({type:"bracket",value:Lm(n.slice(1,-1))}),n="")):r==="."&&i===0?n&&(e.push({type:"key",value:n}),n=""):n+=r}return n&&e.push({type:"key",value:n}),e.map(o=>o.type==="key"?{key:o.value}:{children:o.value})}const Gr=(t,e)=>{if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return Gr(t.parent,e)}};function eT(t,e,n){return Ce({name:"FormCreate"+(t.isMobile?"Mobile":""),components:e,directives:n,props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","beforeUnmount","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render(){return this.fc.render()},setup(i){const o=ol();Qf("parentFC",o);const r=Po("parentFC",null);let s=r;if(r)for(;s.setupState.parent;)s=s.setupState.parent;else s=o;const{rule:a,modelValue:l,subForm:c,inFor:u}=il(i),d=It({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...a.value||[]],updateValue:JSON.stringify(l.value||{})}),h=new t(o),v=h.api(),p=u.value,f=()=>{if(r){const x=Gr(o,r);if(x){let O;p?(O=Ut(x.getSubForm()),O.push(v)):O=v,x.subForm(O)}}},_=()=>{const x=Gr(o,r);if(x)if(p){const O=Ut(x.getSubForm()),$=O.indexOf(v);$>-1&&O.splice($,1)}else x.subForm()};let C=null;A_(()=>{zt(()=>{let x="";const O=i.option&&i.option.globalClass||{};Object.keys(O).forEach($=>{let K="";O[$].style&&Object.keys(O[$].style).forEach(F=>{K+=Lo(F)+":"+O[$].style[F]+";"}),O[$].content&&(K+=O[$].content+";"),K&&(x+=`.${$}{${K}}`)}),i.option&&i.option.style&&(x+=i.option.style),C||(C=document.createElement("style"),C.type="text/css",document.head.appendChild(C)),C.innerHTML=x||""})});const w=ci(()=>{h.bus.$emit("$loadData.$topForm")},100),S=ci(function(){h.bus.$emit("$loadData.$scopeForm")},100),b=ci(()=>{h.bus.$emit("$loadData.$form")},100),E=x=>{h.bus.$emit("change-$form."+x)};return et(()=>{r&&(v.top.bus.$on("$loadData.$form",w),v.top.bus.$on("change",E)),v!==v.scope&&v.scope.bus.$on("$loadData.$scopeForm",S),h.mounted()}),Cs(()=>{r&&(v.top.bus.$off("$loadData.$form",w),v.top.bus.$off("change",E)),v!==v.scope&&v.scope.bus.$off("$loadData.$scopeForm",S),_(),d.destroyed=!0,h.unmount(),C&&(C.parentNode||C.parentElement)&&document.head.removeChild(C)}),Gf(()=>{h.updated()}),f(),$e(()=>i.option,()=>{h.initOptions(),v.refresh()},{deep:!0,flush:"sync"}),$e(()=>[...a.value],x=>{h.$handle.isBreakWatch()||x.length===d.renderRule.length&&x.every(O=>d.renderRule.indexOf(O)>-1)||(h.$handle.updateAppendData(),h.$handle.reloadRule(a.value),o.setupState.renderRule())}),$e(()=>[i.disabled,i.preview],()=>{v.refresh()}),$e(l,x=>{jo(x||{})!==d.updateValue&&(v.config.forceCoverValue?v.coverValue(x||{}):v.setValue(x||{}))},{deep:!0,flush:"post"}),$e(()=>i.index,()=>{v.coverValue({}),h.$handle.updateAppendData(),Ge(()=>{Ge(()=>{v.clearValidateState()})})},{flush:"sync"}),en(Te({fc:Gn(h),parent:r&&Gn(r),top:Gn(s),fapi:Gn(v)},il(d)),{getGroupInject:()=>Gr(o,r),refresh(){++d.unique},renderRule(){d.renderRule=[...a.value||[]]},updateValue(x){if(d.destroyed)return;const O=jo(x);d.updateValue!==O&&(d.updateValue=O,o.emit("update:modelValue",x),Ge(()=>{b(),r?c.value||S():(w(),S())}))}})},created(){const i=ol();i.emit("update:api",i.setupState.fapi),i.setupState.fc.init()}})}function jm(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function Et(t,e){return(n,i,o,r={})=>{const s=new Oc(t,n,i,o,r);return e&&(fe.Function(e)?e(s):s.props(e)),s}}function Oc(t,e,n,i,o){this._data=Fe(jm(),{type:t,title:e,field:n,value:i,props:o||{}}),this.event=this.on}Fe(Oc.prototype,{getRule(){return this._data},setProp(t,e){return an(this._data,t,e),this},modelField(t){return this._data.modelField=t,this},_clone(){const t=new this.constructor;return t._data=Im(this._data),t}});function zm(t){t.forEach(e=>{Oc.prototype[e]=function(n){return Zn(this._data,{[e]:arguments.length<2?n:{[n]:arguments[1]}}),this}})}zm(Rm());const tT=Et("");function nT(t,e,n){let i=tT("",e);return i._data.type=t,i._data.title=n,i}function iT(){return{create:nT,factory:Et}}function oT(t,e,n){const i=`fail to ${t} ${n.status}'`,o=new Error(i);return o.status=n.status,o.url=t,o}function th(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}function Nm(t){if(typeof XMLHttpRequest>"u")return;const e=new XMLHttpRequest;let n=t.action||"";if(e.upload&&t.onProgress&&e.upload.addEventListener("progress",r=>{r.percent=r.total>0?r.loaded/r.total*100:0,t.onProgress(r)}),t.query){const r=fe.String(t.query)?t.query:Object.keys(t.query).reduce((a,l)=>(a[l]=t.query[l]===null||t.query[l]===void 0?"":t.query[l],a),{}),s=new URLSearchParams(r).toString();s&&(n.includes("?")?n+=`&${s}`:n+=`?${s}`)}e.onerror=function(r){t.onError(r)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(oT(n,t,e),th(e));t.onSuccess(th(e))},e.open(t.method||"get",n,!0);let i;(t.data||t.file)&&(t.file||(t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data||{}).map(r=>{i.append(r,t.data[r])})):(i=JSON.stringify(t.data||{}),e.setRequestHeader("content-type","application/json"))),t.file&&i.append(t.filename,t.file,t.file.name),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};Object.keys(o).forEach(r=>{o[r]!=null&&e.setRequestHeader(r,o[r])}),e.send(i)}function nh(t,e,n){return new Promise((i,o)=>{(e||Nm)(en(Te({},t),{onSuccess(r){let s=l=>l;const a=Dn(t.parse);fe.Function(a)?s=a:a&&fe.String(a)&&(s=l=>Pt(l,a)),us(s(r,t.targetRule,n)).then(l=>{i(l)})},onError(r){o(r)}}))})}function So(t){return In(t)}function rT(t){function e(r){return fe.Undef(r)?r=t.fields():Array.isArray(r)||(r=[r]),r}function n(r,s,a){fe.Undef(r)?r=Object.keys(Te(Te({},t.fieldCtx),t.nameCtx)):Array.isArray(r)||(r=[r]),r.forEach(l=>{const c=t.fieldCtx[l]||t.nameCtx[l];c&&c.forEach(u=>{an(u.rule,s,a),t.$render.clearCache(u)})})}function i(){const r=t.subForm;return Object.keys(r).reduce((s,a)=>{const l=r[a];return l&&(Array.isArray(l)?s.push(...l):s.push(l)),s},[])}const o={get isScope(){return t.vm.props.subForm===!1},get isPreview(){return t.preview},get config(){return t.options},set config(r){t.fc.options.value=r},get options(){return t.options},set options(r){t.fc.options.value=r},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.setupState.parent&&t.vm.setupState.parent.setupState.fapi},get top(){return o.parent?o.parent.top:o},get scope(){let r=t.vm;for(;r&&r.setupState.fapi;)if(r.props.subForm)r=r.setupState.parent;else return r.setupState.fapi;return o.top},get children(){return i()},get siblings(){const r=t.vm.setupState.getGroupInject();if(r){const s=r.getSubForm();if(Array.isArray(s))return[...s]}},get index(){const r=o.siblings;if(r){const s=r.indexOf(o);return s>-1?s:void 0}},get formulas(){return Te({},t.fc.formulas)},formData(r){if(r==null||typeof r=="boolean"){const s={};return Object.keys(t.form).forEach(a=>{(r===!0||t.ignoreFields.indexOf(a)===-1)&&(s[a]=So(t.form[a]))}),s}else return e(r).reduce((s,a)=>(s[a]=o.getValue(a),s),{})},getValue(r){const s=t.getFieldCtx(r);return s?So(s.rule.value):t.options.appendValue!==!1&&lt(t.appendData,r)?So(t.appendData[r]):void 0},coverValue(r){const s=Te({},r||{});t.deferSyncValue(()=>{t.appendData={},o.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const c=lt(r,a);l.forEach(u=>{u.rule.value=c?r[a]:void 0}),delete s[a]}}),Fe(t.appendData,s)},!0)},setValue(r){let s=r;arguments.length>=2&&(s={[r]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(s).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=s[a];l.forEach(c=>{c.rule.value=s[a]})})},!0)},removeField(r){const s=t.getCtx(r);return t.deferSyncValue(()=>{t.getCtxs(r).forEach(a=>{a.rm()})},!0),s?s.origin:void 0},removeRule(r){const s=r&&On(r);if(s)return s.rm(),s.origin},fields:()=>t.fields(),append:(r,s,a)=>{let l=t.sort.length-1,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return;l=u.rule.children.length-1}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l+1,0,r)},prepend:(r,s,a)=>{let l=0,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l,0,r)},hidden(r,s){n(s,"hidden",!!r),t.refresh()},hiddenStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.hidden},display(r,s){n(s,"display",!!r),t.refresh()},displayStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.display},disabled(r,s){e(s).forEach(a=>{t.getCtxs(a).forEach(l=>{an(l.rule.props,"disabled",!!r)})}),t.refresh()},all(r){return Object.keys(t.ctxs).map(s=>{const a=t.ctxs[s];return r?a.origin:a.rule})},model(r){return t.fields().reduce((s,a)=>{const l=t.fieldCtx[a][0];return s[a]=r?l.origin:l.rule,s},{})},component(r){return Object.keys(t.nameCtx).reduce((s,a)=>{const l=t.nameCtx[a].map(c=>r?c.origin:c.rule);return s[a]=l.length===1?l[0]:l,s},{})},bind(){return o.form},reload:r=>{t.reloadRule(r)},updateOptions(r){t.fc.updateOptions(r),o.refresh()},onSubmit(r){o.updateOptions({onSubmit:r})},sync:r=>{if(Array.isArray(r)){r.forEach(a=>o.sync(a));return}let s=fe.Object(r)?On(r):t.getCtxs(r);s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(c=>{c.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(r=>{r.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),o.refresh()},hideForm:r=>{t.vm.setupState.isShow=!r},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(r,s){t.getCtxs(r).forEach(a=>{Fe(a.rule,s)})},updateRules(r){Object.keys(r).forEach(s=>{o.updateRule(s,r[s])})},mergeRule:(r,s)=>{t.getCtxs(r).forEach(a=>{Zn(a.rule,s)})},mergeRules(r){Object.keys(r).forEach(s=>{o.mergeRule(s,r[s])})},getRule:(r,s)=>{const a=t.getCtx(r);if(a)return s?a.origin:a.rule},findType(r,s){let a;return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&(a=s?c.origin:c.rule)}),a},findTypes(r,s){let a=[];return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&a.push(s?c.origin:c.rule)}),a},getRenderRule:r=>{const s=t.getCtx(r);if(s)return s.prop},getRefRule:r=>{const s=t.getCtxs(r);if(s){const a=s.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(r,s,a){const l=t.getCtx(r);l&&s&&(s[0]==="$"&&(s=s.substr(1)),lt(l.rule,"$"+s)&&an(l.rule,"$"+s,a),lt(l.rule,"effect")||(l.rule.effect={}),an(l.rule.effect,s,a))},clearEffectData(r,s){const a=t.getCtx(r);a&&(s&&s[0]==="$"&&(s=s.substr(1)),a.clearEffectData(s),o.sync(r))},updateValidate(r,s,a){a?o.mergeRule(r,{validate:s}):n(r,"validate",s)},updateValidates(r,s){Object.keys(r).forEach(a=>{o.updateValidate(a,r[a],s)})},refreshValidate(){o.refresh()},resetFields(r){e(r).forEach(s=>{t.getCtxs(s).forEach(a=>{t.$render.clearCache(a),a.rule.value=So(a.defaultValue)})}),Ge(()=>{Ge(()=>{Ge(()=>{o.clearValidateState(r)})})}),r==null&&(fe.Function(t.options.onReset)&&Be(()=>t.options.onReset(o)),t.vm.emit("reset",o))},method(r,s){const a=o.el(r);if(!a||!a[s])throw new Error(Tm("err",`${s} 方法不存在`));return(...l)=>a[s](...l)},exec(r,s,...a){return Be(()=>o.method(r,s)(...a))},toJson(r){return jo(o.rule,r)},trigger(r,s,...a){const l=o.el(r);l&&l.$emit(s,...a)},el(r){const s=t.getCtx(r);if(s)return s.el||t.vm.refs[s.ref]},scrollTo(r,s={block:"center",inline:"nearest",behavior:"smooth"}){const a=o.el(r);if(!a)return;const l=a.$el!==void 0?a.$el:a;if(!l)return;const c=l.nodeType===1?l:l.firstElementChild;c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView(s)},focus(r){const s=o.el(r);if(!s)return;const a=d=>!d||typeof d.focus!="function"?!1:(Be(()=>d.focus()),!0);if(a(s))return;const l=s.$el!==void 0?s.$el:s;if(a(l))return;const c=l&&(l.nodeType===1?l:l.firstElementChild);if(a(c)||!c||!c.querySelector)return;const u=c.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');a(u)},closeModal:r=>{t.bus.$emit("fc:closeModal:"+r)},getSubForm(r){const s=t.getCtx(r);return s?t.subForm[s.id]:void 0},getChildrenRuleList(r){const s=typeof r=="object",a=s?On(r):t.getCtx(r),l=a?a.rule:s?r:o.getRule(r);if(!l)return[];const c=[];return(u=>{u&&u.forEach(d=>{typeof d=="object"&&(d.field&&c.push(d),c.push(...o.getChildrenRuleList(d)))})})(a?a.loadChildrenPending():l.children),c},getParentRule(r){return(typeof r=="object"?On(r):t.getCtx(r)).parent.rule},getParentSubRule(r){const s=typeof r=="object"?On(r):t.getCtx(r);if(s){const a=s.getParentGroup();if(a)return a.rule}},getChildrenFormData(r,s){return o.getChildrenRuleList(r).reduce((a,l)=>((l.ignore!==!0||s===!0)&&(a[l.field]=So(l.value)),a),{})},setChildrenFormData(r,s,a){const l=o.getChildrenRuleList(r);t.deferSyncValue(()=>{l.forEach(c=>{lt(s,c.field)?c.value=s[c.field]:a&&(c.value=void 0)})})},getGlobalEvent(r){let s=o.options.globalEvent[r];if(s)return typeof s=="object"&&(s=s.handle),Dn(s)},getGlobalData(r){return new Promise((s,a)=>{let l=o.options.globalData[r];l?l.type==="fetch"?o.fetch(l).then(c=>{s(c)}).catch(a):s(l.data):s(t.fc.loadData[r])})},emitGlobalEvent(r,...s){const a=o.getGlobalEvent(r);if(a){const l=t.getInjectData({},void 0);return l.args=[...s],s.unshift(l),a.apply(null,s)}},setGlobalData(r,s){o.setData("$globalData."+r,s)},setGlobalVar(r,s){o.setData("$var."+r,s)},renderRule(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createRuleVnode(l,s,a):void 0},renderChildren(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createChildrenVnodes(l,s,a):void 0},nextTick(r){t.bus.$once("next-tick",r),t.refresh()},nextRefresh(r){t.nextRefresh(),r&&Be(r)},deferSyncValue(r,s){t.deferSyncValue(r,s)},emit(r,...s){t.vm.emitsOptions&&!t.vm.emitsOptions[r]&&(t.vm.emitsOptions[r]=null),t.vm.emit(r,...s)},bus:t.bus,getCurrentFormRule(){var r;return(r=t.vm.setupState.getGroupInject())==null?void 0:r.rule},fetch(r){return new Promise((s,a)=>{let l=Te({},r);l=t.loadFetchVar(l);const c=u=>{Be(()=>l.onError&&l.onError(u)),a(u)};t.beforeFetch(l).then(()=>nh(l,t.fc.create.fetch,o).then(u=>{Be(()=>l.onSuccess&&l.onSuccess(u)),s(u)}).catch(u=>{c(u)})).catch(u=>{c(u)})})},watchFetch(r,s,a,l){return t.fc.watchLoadData((c,u)=>{let d=Te({},r);if(d=t.loadFetchVar(d,c),l&&l(d,u)===!1)return;const h=v=>{Be(()=>d.onError&&d.onError(v)),a&&a(v)};t.beforeFetch(d).then(()=>nh(d,t.fc.create.fetch,o).then(v=>{Be(()=>d.onSuccess&&d.onSuccess(v)),s&&s(v,u)}).catch(v=>{h(v)})).catch(v=>{h(v)})},r.wait==null?1e3:r.wait)},getData(r,s){return t.fc.get?t.fc.get(r,s):t.fc.getLoadData(r,s)},watchData(r){return t.fc.watchLoadData((s,a)=>{Be(()=>r(s,a))})},setData(r,s,a){return t.fc.setData(r,s,a)},refreshData(r){return t.fc.refreshData(r)},t(r,s){return t.fc.t(r,s)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:n}};return["on","once","off"].forEach(r=>{o[r]=function(...s){t.bus[`$${r}`](...s)}}),o.changeValue=o.changeField=o.setValue,o}function sT(t){Fe(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll(){this.cache={}},setCache(e,n,i){this.cache[e.id]={vnode:n,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const n=this.cache[e.id];if(n)return n.use=!0,n.vnode}})}function aT(t){Fe(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const n=i=>{if(i){let o;return e.rule.field&&(o=i.slots["field-"+Lo(e.rule.field)]||i.slots["field-"+e.rule.field]),o||(o=i.slots["type-"+Lo(e.type)]||i.slots["type-"+e.type]),o||n(i.setupState.parent)}};return n(this.vm)},render(){if(!this.vm.setupState.isShow)return;this.$manager.beforeRender();const e=wr();return this.sort.forEach(n=>{this.renderSlot(e,this.$handle.ctxs[n])}),this.$manager.render(e)},renderSlot(e,n,i){if(this.isFragment(n)){n.initProp(),this.mergeGlobal(n),n.initNone();const o=this.renderChildren(n.loadChildrenPending(),n),r=o.default;r&&e.setSlot(n.rule.slot,()=>r()),delete o.default,e.mergeBag(o)}else e.setSlot(n.rule.slot,this.renderCtx(n,i))},mergeGlobal(e){this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=te(()=>{const n=this.$handle.options.global;return Zn({},[n["*"]||n.default||{},n[e.originType]||n[e.type]||n[e.type]||{}])})),e.prop=Zn({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions(e){const n=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=n,e.prop.optionsTo&&n&&pi(e.prop,e.prop.optionsTo,n)},deepSet(e){const n=e.prop.deep;n&&Object.keys(n).sort((i,o)=>i.length<o.length?-1:1).forEach(i=>{pi(e.prop,i,n[i])})},parseSide(e,n){return fe.Object(e)?Zn({props:{formCreateInject:n.prop.props.formCreateInject}},e):e},renderSides(e,n,i){const o=n[i?"rule":"prop"];return[this.renderRule(this.parseSide(o.prefix,n)),e,this.renderRule(this.parseSide(o.suffix,n))]},renderId(e,n){const i=this.$handle[n==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(o=>this.renderCtx(o,o.parent)):void 0},renderCtx(e,n){try{if(e.type==="hidden")return;const i=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let r=e.prop;r.preview=!!(r.preview!=null?r.preview:this.$handle.preview),r.props.formCreateInject=this.injectProp(e);let s=r.cache!==!1;const a=r.preview;if(r.hidden){this.setCache(e,void 0,n);return}o=(...l)=>{var c,u;const d={rule:i,prop:r,preview:a,api:this.$handle.api,model:r.model||{},slotValue:l};l.length&&i.slotUpdate&&Be(()=>i.slotUpdate(d));let h={};const v=e.loadChildrenPending();e.parser.renderChildren?h=e.parser.renderChildren(v,e):e.parser.loadChildren!==!1&&(h=this.renderChildren(v,e)),Object.keys(r.renderSlots||{}).forEach(_=>{h[_]=(...C)=>{if(fe.Function(r.renderSlots[_]))return Be(()=>r.renderSlots[_](...C));const w=this.parseSide(r.renderSlots[_],e);return this.renderRule(w)}});const p=this.getTypeSlot(e);let f;return p?(d.children=h,f=p(d)):f=a?e.parser.preview(wl(h),e):e.parser.render(wl(h),e),f=this.renderSides(f,e),(c=r.title)!=null&&c.show&&(r.wrap=en(Te({},r.wrap||{}),{show:!0}),r.native||(r.native=!1)),(!(!e.input&&fe.Undef(r.native))||((u=r.col)==null?void 0:u.show)===!0)&&r.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),f=this.$manager.makeWrap(e,f)),e.none&&(Array.isArray(f)?f=f.map(_=>!_||!_.__v_isVNode?_:this.none(_)):f=this.none(f)),s&&this.setCache(e,()=>this.stable(f),n),f},this.setCache(e,o,n)}return(...o)=>{const r=this.getCache(e);if(r)return r(...o);if(this.cache[e.id])return;const s=this.renderCtx(e,e.parent);if(s)return s()}}catch(i){console.error(i);return}},none(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass(e,n){if(Array.isArray(e))e.push(n);else return e?[e,n]:n;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(n=>{n&&n.__v_isVNode&&n.children&&typeof n.children=="object"&&(n.children.$stable=!0,this.stable(n.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:o=>{this.$handle.addSubForm(e,o)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.setupState.top.slots,getWrap:()=>this.vm.refs[e.wrapRef],options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:(...o)=>this.$handle.api.t(...o),updateValue:o=>{this.$handle.onUpdateValue(e,o)}});const i=n.ctxInject[e.id];return Fe(i,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),i},ctxProp(e){const{ref:n,key:i,rule:o}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const r=[{ref:n,key:o.key||`${i}fc`,slot:void 0,on:{vnodeMounted:s=>{s.el.__rule__=e.rule,this.onMounted(e,s.el)},vnodeBeforeUnmount:()=>{this.$handle.effect(e,"beforeUnmount"),this.$handle.targetHook(e,"beforeUnmount")},"fc.updateValue":s=>{this.$handle.onUpdateValue(e,s)},"fc.el":s=>{e.exportEl=s,s&&((s.$el||s).__rule__=e.rule)}}}];if(e.input){const s=this.tmpInput;this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);const a=this.getModelField(e),l={callback:c=>{s&&s(e.field,c,e.rule),this.onInput(e,c)},modelField:a,value:this.$handle.getFormData(e)};r.push({on:Te({[`update:${a}`]:l.callback},e.prop.modelEmit?{[e.prop.modelEmit]:()=>this.onEmitInput(e)}:{}),props:{[a]:l.value}}),e.prop.model=l}return Qn(r,e.prop),e.prop},onMounted(e,n){e.el=this.vm.refs[e.ref]||n,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,n){if(e.prop.modelEmit){this.$handle.onBaseInput(e,n);return}this.$handle.onInput(e,n)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,n){if(!fe.trueArray(e))return{};const i=wr();return e.map(o=>{if(o){if(fe.String(o)||fe.Number(o))return i.setSlot(null,`${o}`);if(o.__fc__)return this.renderSlot(i,o.__fc__,n);o.type&&Ge(()=>{this.$handle.loadChildren(e,n),this.$handle.refresh()})}}),i.getSlots()},defaultRender(e,n){const i=e.prop;return i.component?typeof i.component=="string"?this.vNode.make(i.component,i,n):this.vNode.makeComponent(i.component,i,n):this.vNode[e.type]?this.vNode[e.type](i,n):this.vNode[e.originType]?this.vNode[e.originType](i,n):this.vNode.make(Mm(i.type),i,n)},createChildrenVnodes(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,o},createRuleVnode(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=wr();return this.renderSlot(o,e,e.parent),this.force=!1,this.tmpInput=null,o.getSlots()},renderRule(e,n,i){if(!e)return;if(fe.String(e)||fe.Number(e))return`${e}`;let o;if(i)o=e.type;else if(o=e.is,e.type){o=Vt(e.type);const a=this.vNode.aliasMap[o];a&&(o=Vt(a))}if(!o)return;const r=wr();fe.trueArray(e.children)&&e.children.forEach(a=>{a&&r.setSlot(a?.slot,()=>this.renderRule(a))});const s=Te({},e);return delete s.type,delete s.is,this.vNode.make(o,s,r.mergeBag(n).getSlots())}})}let lT=1;function Ac(t){Fe(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t),force:!1,tmpInput:null,id:lT++}),Dm(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}sT(Ac);aT(Ac);function cT(t){Fe(t.prototype,{parseInjectEvent(e,n){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,n,i)},parseEventLst(e,n,i,o){return Object.keys(n).forEach(r=>{const s=this.parseEvent(e,n[r],i,o);s&&(n[r]=s)}),n},parseEvent(e,n,i,o){if(fe.Function(n)&&(i!==!1&&!fe.Undef(i)||n.__inject))return this.inject(e,n,i);if(!o&&Array.isArray(n)&&n[0]&&(fe.String(n[0])||fe.Function(n[0])))return this.parseEventLst(e,n,i,!0);if(fe.String(n)){const r=Dn(n);if(r&&n!==r)return r.__inject?this.parseEvent(e,r,i,!0):r}},parseEmit(e){let n={},i=e.rule,{emitPrefix:o,field:r,name:s,inject:a}=i,l=i.emit||[];return fe.trueArray(l)&&l.forEach(c=>{if(!c)return;let u,d=o||r||s;if(fe.Object(c)&&(u=c.inject,c=c.name,d=c.prefix||d),d){const h=Lo(`${d}-${c}`),v=(...p)=>{this.vm.emitsOptions&&!this.vm.emitsOptions[h]&&(this.vm.emitsOptions[h]=null),this.vm.emit(h,...p),this.vm.emit("emit-event",h,...p),this.bus.$emit(h,...p)};if(v.__emit=!0,!u&&a===!1)n[Vt(c)]=v;else{let p=u||a||this.options.injectEvent;n[Vt(c)]=fe.Undef(p)?v:this.inject(i,v,p)}}}),e.computed.on=n,n},getInjectData(e,n){const i=e.__fc__&&e.__fc__.$api,o=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:r,rule:s}=o.props;return{$f:i||this.api,api:i||this.api,rule:s,self:e.__origin__,option:r,inject:n}},inject(e,n,i){if(n.__origin){if(this.watching&&!this.loading)return n;n=n.__origin}const o=this,r=function(...s){const a=o.getInjectData(e,i);return a.args=[...s],s.unshift(a),n.apply(this,s)};return r.__origin=n,r.__json=n.__json,r},loadStrVar(e,n,i){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const o=e,r=Zx(e),s=c=>{let u=!1,d;if(i&&c.indexOf("$form.")===0){const h=c.split(".");h.shift(),lt(i.value,h[0])&&(u=!0,d=n?n({id:"$form."+h[0]+"_"+i.rule.__fc__.id,getValue:()=>Pt(i.value,h)}):Pt(i.value,h))}return u||(d=n?n(c):this.fc.getLoadData(c)),d},a=c=>{const u=[];c.forEach(h=>{h.key?u.push(h.key):h.children&&u.push(a(h.children))});let d=!1;return u.forEach((h,v)=>{h!=null&&(h.indexOf("'")===0||h.indexOf('"')===0)&&(u[v]=h.slice(1,-1),d=!0)}),u.length===1&&(d||!isNaN(Number(u[0])))?u[0]:s(u.join("."))};let l;if(r.forEach(c=>{const u=c.split("||"),d=u[0].trim();if(d){const h=(u[1]||"").trim(),v=Lm(d);let p=Be(()=>a(v));(p==null||p==="")&&u.length>1&&(p=h),l=p,e=e.replaceAll(`{{${c}}}`,p??"")}}),r.length===1&&o===`{{${r[0]}}}`)return l}return e},loadFetchVar(e,n,i){let o;i&&i.__fc__&&(o=i.__fc__.getParentGroup()),!o&&e.targetRule&&e.targetRule.__fc__&&(o=e.targetRule.__fc__.getParentGroup());const r=s=>this.loadStrVar(s,n,o?{rule:i,value:this.subRuleData[o.id]||{}}:null);return e.action=r(e.action||""),["headers","data","query"].forEach(s=>{if(e[s]){const a=Array.isArray(e[s])?[]:{};Object.keys(e[s]).forEach(l=>{a[r(l)]=r(e[s][l])}),e[s]=a}}),e}})}const ih=["hook:updated","hook:mounted"];function uT(t){Fe(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let n=25,i=dT(this.rules);fe.Object(e)&&(e.first&&(n=parseInt(e.first,10)||n),e.limit&&(i=parseInt(e.limit,10)||i)),Fe(this,{first:n,limit:i,pageEnd:this.rules.length<=n}),this.bus.$on("page-end",()=>this.vm.emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.bus.$off(ih,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.bus.$on(ih,e)}})}function dT(t){return t.length<31?31:Math.ceil(t.length/3)}function hT(t){Fe(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function fT(t){Object.defineProperties(t.origin,{__fc__:El(Gn(t))}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:El(Gn(t))})}function Um(t,e,n){const i=Fs(),o=!!e.field;Fe(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:Te({},e),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?In(n):void 0,field:e.field||void 0}),this.updateKey(),fT(this),this.update(t,!0)}Fe(Um.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,n)=>{this.$handle&&(e===n?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,n))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:n,def:i,onLoad:o,onReload:r,onUpdate:s}=t;if(this.pending[e]&&this.pending[e].origin===n)return this.getPending(e,i);delete this.pending[e];let a=n;if(fe.Function(n)){let l=Be(()=>n({rule:this.rule,api:this.$api,update:c=>{const u=c||i,d=this.getPending(e,i);this.setPending(e,n,u),s&&s(u,d)},reload:()=>{const c=this.getPending(e,i);delete this.pending[e],r&&r(c),this.$api&&this.$api.sync(this.rule)}}));l&&fe.Function(l.then)?(l.then(c=>{const u=c||i;this.setPending(e,n,u),o&&o(u),this.$api&&this.$api.sync(this.rule)}).catch(c=>{console.error(c)}),a=i,this.setPending(e,n,a)):(a=l||i,this.setPending(e,n,a),o&&o(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,n){this.pending[t]={origin:e,value:It(n)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Fs(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=Vt(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){var t,e,n;const i=Te({},this.rule);delete i.children,delete i.validate,this.prop=Zn({},[i,...Object.keys(this.payload).map(o=>this.payload[o]),this.computed]),i.col&&((t=i.col)==null?void 0:t.show)!==!1&&(this.prop.col.show=!0),this.prop.validate=[...((n=(e=this.refRule)==null?void 0:e.__$validate)==null?void 0:n.value)||[],...this.prop.validate||[]]},initNone(){this.none=!(fe.Undef(this.prop.display)||this.prop.display)},hasHidden(){return!!this.rule.hidden||(this.parent?this.parent.hasHidden():!1)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],Object.keys(this.refRule).forEach(t=>{t.indexOf("__$")!==0&&delete this.refRule[t]})},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),Fe(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),Fe(this,{root:[]})},this.input)})},update(t,e){Fe(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function pT(t){Fe(t.prototype,{nextRefresh(e){const n=this.loadedId;Ge(()=>{n===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const n=Xd(e);return Object.defineProperties(n,{__origin__:El(e)}),mT(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach(i=>{i&&this.loadFn(i,n)}),this.loadCtrl(n),n.update&&(n.update=Dn(n.update)),n},loadFn(e,n){["on","props","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(n,e[i])})},loadCtrl(e){e.control&&e.control.forEach(n=>{n.handle&&(n.handle=Dn(n.handle))})},syncProp(e){const n=e.rule;fe.trueArray(n.sync)&&Qn([{on:n.sync.reduce((i,o)=>(i[typeof o=="object"&&o.event||`update:${o}`]=r=>{n.props[typeof o=="object"&&o.prop||o]=r,this.vm.emit("sync",o,r,n,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.setupState.renderRule()})},loadChildren(e,n){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,n),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(n)},_loadRule(e,n){const i=s=>{let a=e[s-1];if(!a||!a.__fc__)return s>0?i(s-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:i(s-1)},o=(s,a)=>{fe.trueArray(s)&&this._loadRule(s,a)},r=e.map((s,a)=>{if(n&&!fe.Object(s)||!this.pageEnd&&!n&&a>=this.first)return;if(s.__fc__&&s.__fc__.root===e&&this.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;let l=Xd(s);const c=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==s.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:c()}),c()&&this.vm.emit("repeat-field",s,this.api);let u,d=!1,h=!!s.__fc__,v=l.value;if(h){if(u=s.__fc__,v=u.defaultValue,u.deleted){if(oh(u))return;u.update(this)}else if(!u.check(this)){if(oh(u))return;e[a]=s=s._clone?s._clone():$m(jo(s)),u=null,d=!0}}if(u)u.originType!==u.rule.type&&u.updateType(),this.bindParser(u),this.appendValue(u.rule),u.parent&&u.parent!==n&&this.rmSubRuleData(u);else{const _=this.parseRule(s);u=new Um(this,_,v),this.bindParser(u)}this.parseEmit(u),this.syncProp(u),u.parent=n||null,u.root=e,this.setCtx(u),!d&&!h&&(this.effect(u,"load"),this.targetHook(u,"load")),this.effect(u,"created");const p=u.loadChildrenPending();if(u.parser.loadChildren===!1||o(p,u),!n){const _=i(a);_>-1||!a?this.sort.splice(_+1,0,u.id):this.sort.push(u.id)}const f=u.rule;return u.updated||(u.updated=!0,fe.Function(f.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(u,f.value,"init")}),this.effect(u,"loaded")),this.refreshControl(u)&&(this.cycleLoad=!0),u}).filter(s=>!!s);n&&(n.children=r)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const n=vT(e),i=[],o=this.api;if(!n.length)return!1;for(let a=0;a<n.length;a++){const l=n[a],c=l.handle||function(d){return(Pi[l.condition||"=="]||Pi["=="])(d,l.value)};if(!fe.trueArray(l.rule))continue;const u=en(Te({},l),{valid:Be(()=>c(e.rule.value,o)),ctrl:gT(e,l.rule),isHidden:fe.String(l.rule[0])});u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden||i.push(u)}if(!i.length)return!1;const r=[];let s=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:l,rule:c,prepend:u,append:d,child:h,ctrl:v,method:p})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:c,valid:l}):v&&e.ctrlRule.splice(e.ctrlRule.indexOf(v)>>>0,1),r[l?"push":"unshift"](()=>{p==="disabled"||p==="enabled"?this.api.disabled(!l,c):p==="display"||p==="show"?this.api.display(l,c):p==="required"?(c.forEach(f=>{this.api.setEffect(f,"required",l)}),l||this.api.clearValidateState(c)):p==="if"?this.api.hidden(!l,c):this.api.hidden(!l,c)});return}if(l){s=!0;const f={type:"fragment",native:!0,__ctrl:!0,children:c};e.ctrlRule.push(f),this.bus.$once("load-start",()=>{u?o.prepend(f,u,h):d||h?o.append(f,d||e.id,h):e.root.splice(e.root.indexOf(e.origin)+1,0,f)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(v),1);const f=On(v);f&&f.rm()}})}),r.length&&(this.loading?r.length&&this.bus.$once("load-end",()=>{r.forEach(a=>a())}):r.length&&Ge(()=>{r.forEach(a=>a())})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const n=Te({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(n).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(n[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.bus.$emit("reloading",this.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh(){this.vm.setupState.refresh()}})}function mT(t){const e=jm();return Object.keys(e).forEach(n=>{lt(t,n)||(t[n]=e[n])}),t}function vT(t){const e=t.rule.control||[];return fe.Object(e)?[e]:e}function gT(t,e){for(let n=0;n<t.ctrlRule.length;n++){const i=t.ctrlRule[n];if(i.children===e)return i}}function oh(t){return!!t.rule.__ctrl}function _T(t){Fe(t.prototype,{setValue(e,n,i,o){e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,o||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:o||!1}),o&&Ge(()=>{Ge(()=>{Ge(()=>{this.api.clearValidateState(e.id)})})}),this.$manager.fieldChange(e,n,i,o))},onInput(e,n){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(n,e))||this.isChange(e,n))&&this.setValue(e,i,n)},onUpdateValue(e,n){this.deferSyncValue(()=>{const i=e.getParentGroup(),o=i?this.subRuleData[i.id]:null,r={};Object.keys(n||{}).forEach(s=>{o&&lt(o,s)?r[s]=n[s]:lt(this.api.form,s)?this.api.form[s]=n[s]:this.api.top!==this.api&&lt(this.api.top.form,s)&&(this.api.top.form[s]=n[s])}),Object.keys(r).length&&this.api.setChildrenFormData(i.rule,r)})},onBaseInput(e,n){this.setFormData(e,n),e.modelValue=n,this.nextRefresh(),this.$render.clearCache(e)},setFormData(e,n){e.modelValue=n;const i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),an(this.formData,e.id,n)},rmSubRuleData(e){const n=e.getParentGroup();n&&this.subRuleData[n.id]&&delete this.subRuleData[n.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e=It({}),n=this.fields(),i=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((o,r)=>(n.indexOf(r)===-1&&(o[r]=kt(this.appendData,r)),o),e),n.reduce((o,r)=>{let s=(this.fieldCtx[r]||[]).filter(a=>!this.isIgnore(a))[0];return s||(s=this.fieldCtx[r][0],i.push(r)),o[r]=kt(s.rule,"value"),o},e),this.form=e,this.ignoreFields=i,this.syncValue()},isIgnore(e){return e.rule.ignore===!0||(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue(e){(!e.field||!lt(this.appendData,e.field))&&(!fe.Undef(e.value)||!this.options.forceCoverValue)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,n){this.subForm[e.id]=n},deferSyncValue(e,n){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=n),Be(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(n=>{this.ignoreFields.indexOf(n)===-1&&(e[n]=this.form[n])}),this.vm.setupState.updateValue(e)},isChange(e,n){return JSON.stringify(this.getFormData(e),rh)!==JSON.stringify(n,rh)},isQuote(e,n){return(n instanceof Function||fe.Object(n)||Array.isArray(n))&&n===e.rule.value},refreshUpdate(e,n,i,o){if(fe.Function(e.rule.update)){const r=Be(()=>e.rule.update(n,e.origin,this.api,{origin:i||"change",linkField:o}));if(r===void 0)return;e.rule.hidden=r===!0}},valueChange(e,n){this.refreshRule(e,n),this.bus.$emit("change-"+e.field,n)},refreshRule(e,n,i,o){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,n,i,o)},appendLink(e){const n=e.rule.link;fe.trueArray(n)&&n.forEach(i=>{const o=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,o),e.linkOn.push(()=>this.bus.$off("change-"+i,o))})},fields(){return Object.keys(this.fieldCtx)}})}function rh(t,e){return typeof e=="function"?""+e:e}const $o={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},yT=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],Co=Symbol("oldValue");function bT(t){Fe(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,n,i){const o=`${i}Ctx`;this[o][n]?this[o][n].push(e):this[o][n]=[e]},rmIdCtx(e,n,i){const o=`${i}Ctx`,r=this[o][n];if(!r)return!1;const s=r.splice(r.indexOf(e)>>>0,1).length>0;return r.length||delete this[o][n],s},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:n,field:i,name:o,rule:r}=e;this.ctxs[n]=e,o&&this.setIdCtx(e,o,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(r.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,r.value,e.origin,this.api,!1,!0))},getParser(e){const n=this.fc.parsers,i=this.fc.renderDriver;if(i){const o=i.parsers||{},r=o[e.originType]||o[Vt(e.type)]||o[e.trueType];if(r)return r}return n[e.originType]||n[Vt(e.type)]||n[e.trueType]||$o},bindParser(e){e.setParser(this.getParser(e))},getType(e){const n=this.fc.CreateNode.aliasMap,i=n[e]||n[Vt(e)]||e;return Vt(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),Be(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){if(Rm().filter(n=>n[0]!=="_"&&n[0]!=="$"&&yT.indexOf(n)===-1).forEach(n=>{const i=kt(e.rule,n),o=n==="children";e.refRule[n]=i,e.watch.push($e(o?()=>fe.Function(i.value)?i.value:[...i.value||[]]:()=>i.value,(r,s)=>{let a=i.value;if(!this.isBreakWatch()){if(o&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,Ge(()=>{this.targetHook(e,"watch",{key:n,oldValue:s,newValue:a})}),n==="hidden"&&!!a!=!!s&&(this.$render.clearCacheAll(),Ge(()=>{this.targetHook(e,"hidden",{value:a})})),n==="ignore"&&e.input||n==="hidden"&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(n==="link"){e.link();return}else["props","on","deep"].indexOf(n)>-1?(this.parseInjectEvent(e.rule,a||{}),n==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):n==="emit"?this.parseEmit(e):["prefix","suffix"].indexOf(n)>-1?a&&this.loadFn(a,e.rule):n==="type"?(e.updateType(),this.bindParser(e)):o&&(fe.Function(s)&&(s=e.getPending("children",[])),fe.Function(a)&&(a=e.loadChildrenPending()),this.updateChildren(e,a,s));this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!o,sync:o}))}),e.refRule.__$title=te(()=>{let n=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$info=te(()=>{let n=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$validate=te(()=>{const n=i=>{var o,r;const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return s?this.api.t(s[1],{title:(r=(o=e.refRule)==null?void 0:o.__$title)==null?void 0:r.value}):i};return Ut(e.rule.validate).map(i=>{const o=Te({},i);if(o.message&&(o.message=n(o.message)),fe.Function(o.validator)){const r=e;o.validator=function(...s){return i.validator.call({that:this,id:r.id,field:r.field,rule:r.rule,api:r.$handle.api},...s)}}if(o.adapter){if(typeof o.error=="object"){const r=Te({},o.error);Object.keys(r).forEach(s=>{r[s]=n(r[s])}),o.error=r}return this.adapterValidate(o,e)}return o})}),e.input){const n=kt(e.rule,"value");e.watch.push($e(()=>n.value,()=>{let i=e.parser.toFormValue(n.value,e);this.isChange(e,i)&&this.setValue(e,n.value,i,!0)}))}this.bus.$once("load-end",()=>{let n=e.rule.computed;n&&(typeof n!="object"&&(n={value:n}),Object.keys(n).forEach(i=>{const o=te(()=>{const s=n[i];if(!s)return;const a=this.compute(e,s);return(s.linkage||s.linkageVariable)&&a===Co?Co:a}),r=s=>{i==="value"?this.onInput(e,s):i[0]==="$"?this.api.setEffect(e.id,i,s):pi(e.rule,i,s)};(i==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Pt(e.rule,i))&&r(o.value),e.watch.push($e(o,s=>{s!==Co&&setTimeout(()=>{r(s)})},{deep:!0}))}))}),this.watchEffect(e)},adapterValidate(e,n){const i=(o,r)=>{if((e.beforeValidate&&Be(()=>e.beforeValidate({value:o,api:this.api,validate:e,rule:n.rule})))===!1)r();else{const s=this.validator(n,o,e);if(s){let a="";typeof e.error=="object"&&(a=e.error[s]||e.error.default),!a&&typeof e.message=="string"&&(a=e.message),a||(a=this.getValidateMessage(n,{key:s,rule:e[s]})),r(a)}else if(e.validator){const a=e.validator&&Be(()=>e.validator(o,r));a&&fe.Function(a.then)&&a.then(()=>r()).catch(l=>r(l))}else r()}};return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},i)},getValidateMessage(e,n){var i,o;const r=Array.isArray(n.rule)?n.rule.join(","):""+n.rule;return this.api.t(n.key==="required"?n.key:"validate."+n.key,{[n.key]:r,title:(o=(i=e.refRule)==null?void 0:i.__$title)==null?void 0:o.value})},validator(e,n,i){if(fe.empty(n))return i.required?"required":void 0;for(const[o,r]of Object.entries(i))switch(o){case"len":case"maxLen":case"minLen":const s=l=>o==="len"?l===r:o==="maxLen"?l<=r:l>=r;if(Array.isArray(n)){if(!s(n.length))return o}else if(typeof n=="object"||!s((""+n).length))return o;break;case"pattern":if(!(typeof r=="string"?new RegExp(r):r).test(""+n))return o;break;case"uppercase":if(r&&(typeof n!="string"||!/^[A-Z]*$/.test(n)))return o;break;case"lowercase":if(r&&(typeof n!="string"||!/^[a-z]*$/.test(n)))return o;break;case"min":case"max":case"positive":case"negative":case"integer":case"number":const a=Number(n);if(Number.isNaN(a)||o==="min"&&a<r||o==="max"&&a>r||o==="positive"&&a<=0||o==="negative"&&a>=0||o==="integer"&&!Number.isInteger(a))return o;break;case"equal":if(n!==r)return o;break;case"enum":if(Array.isArray(r)&&!r.includes(n))return o;break;case"hasKeys":if(typeof n!="object"||Array.isArray(r)&&r.some(l=>!(l in n)))return o;break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+n))return o;break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+n))return o;break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+n))return o;break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+n))return o;break;case"computed":if(!this.compute(e,r))return o;break}},compute(e,n){let i;if(typeof n=="object"){const o=e.getParentGroup(),r=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!fe.trueArray(a.group))return!0;const l=a.mode==="OR";let c=!0;for(let u=0;u<a.group.length;u++){const d=a.group[u];let h,v=null,p=null;if(d.variable)p=this.fc.getLoadData(d.variable);else if(d.field)v=eh(d.field||"");else if(!d.mode)return!0;let f=d.compare;if(f&&(f=eh(f||"")),d.mode?h=r(d):Pi[d.condition]?fe.Function(d.handler)?h=Be(()=>d.handler(this.api,e.rule)):h=Be(()=>new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule",`with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${d.variable?"$variableVal":v}, ${f||"$val"}); }}}}`).call(this.api.form,Pi,p,d.value,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,o?this.subRuleData[o.id]||{}:{},e.rule)):h=!1,l&&h)return!0;l||(c=c&&h)}return l?!1:c};let s=r(n);return s=n.invert===!0?!s:s,n.linkage?s?Be(()=>this.computeValue(n.linkage,e,o),void 0):Co:n.linkageVariable?s?Be(()=>this.fc.getLoadData(n.linkageVariable),void 0):Co:s}else if(fe.Function(n))i=()=>n(this.api.form,this.api,e.rule);else{const o=e.getParentGroup();i=()=>this.computeValue(n,e,o)}return Be(i,void 0)},computeValue(e,n,i){const o=this,r=Object.keys(this.fc.formulas).reduce((s,a)=>(s[a]=function(...l){return o.fc.formulas[a].call({that:this,rule:n.rule,api:o.api,fc:o.fc},...l)},s),{});return Be(()=>new Function("$formulas","$form","$scope","$group","$rule","$api",`with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form,r,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,i?this.subRuleData[i.id]||{}:{},n.rule,this.api),void 0)},updateChildren(e,n,i){this.deferSyncValue(()=>{i&&i.forEach(o=>{(n||[]).indexOf(o)===-1&&o&&!fe.String(o)&&o.__fc__&&o.__fc__.parent===e&&this.rmCtx(o.__fc__)}),fe.trueArray(n)&&(this.loadChildren(n,e),this.bus.$emit("update",this.api))})},rmSub(e){fe.trueArray(e)&&e.forEach(n=>{n&&n.__fc__&&this.rmCtx(n.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:n,field:i,input:o,name:r}=e;wi(this.ctxs,n),wi(this.formData,n),wi(this.subForm,n),wi(this.vm.setupState.ctxInject,n);const s=e.getParentGroup();s&&this.subRuleData[s.id]&&wi(this.subRuleData[s.id],i),e.group&&wi(this.subRuleData,n),o&&this.rmIdCtx(e,i,"field"),r&&this.rmIdCtx(e,r,"name"),o&&!lt(this.fieldCtx,i)&&wi(this.form,i),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);fe.trueArray(l)&&l.forEach(c=>c&&c.__fc__&&this.rmCtx(c.__fc__))}e.root===this.rules&&this.vm.setupState.renderRule()}},o);const a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),o&&!this.fieldCtx[i]&&this.vm.emit("remove-field",i,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}})}function wT(t){Fe(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...n){const i=this.options[e]||this.options[Vt("on-"+e)];if(i){const o=Dn(i);fe.Function(o)&&Be(()=>o(...n))}this.bus.$emit(e,...n)},targetHook(e,n,i){var o,r,s,a;let l=(r=(o=e.prop)==null?void 0:o.hook)==null?void 0:r[n],c=(h,v)=>{h&&(h=Array.isArray(h)?h:[h],h.forEach(p=>{Be(()=>p(en(Te({args:Object.values(i||{})},i||{}),{self:e.rule,rule:e.rule,parent:v?.rule,$f:this.api,api:this.api,option:this.vm.props.option})))}))};c(l);let u="deep"+xm(n),d=e.parent;for(;d;){let h=(a=(s=d.prop)==null?void 0:s.hook)==null?void 0:a[u];c(h,d),d=d.parent}}})}function ST(t){Fe(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(n=>{let i=e[n];fe.Function(i)&&(i=i(this.fc)),i._c=ET(i),this.onEffect(i,n),this.providers[n]=i})},onEffect(e,n){const i=[];(e._c||["*"]).forEach(o=>{const r=o==="*"?"*":this.getType(o);i.indexOf(r)>-1||(i.push(r),this.bus.$on(`p:${n||e.name}:${r}:${e.input?1:0}`,(s,a)=>{e[s]&&e[s](...a)}))}),e._used=i},watchEffect(e){let n={required:()=>{var i,o;return(lt(e.rule,"$required")?e.rule.$required:(o=(i=e.rule)==null?void 0:i.effect)==null?void 0:o.required)||!1}};Object.keys(e.rule.effect||{}).forEach(i=>{n[i]=()=>e.rule.effect[i]}),Object.keys(e.rule).forEach(i=>{i[0]==="$"&&(n[i.substr(1)]=()=>e.rule[i])}),Object.keys(n).forEach(i=>{e.watch.push($e(n[i],o=>{this.effect(e,"watch",{[i]:o})},{deep:!0}))})},ruleEffect(e,n,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},n,i)},effect(e,n,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},n)},getEffect(e,n){if(lt(e,"$"+n))return e["$"+n];if(lt(e,"effect")&&lt(e.effect,n))return e.effect[n]},emitEffect({ctx:e,rule:n,input:i,type:o,custom:r},s,a){if(!o||["fcFragment","fragment"].indexOf(o)>-1)return;const l=r||Object.keys(n).reduce((c,u)=>(u[0]==="$"&&(c[u.substr(1)]=n[u]),c),Te({},n.effect||{}));Object.keys(l).forEach(c=>{const u=this.providers[c];if(!u||u.input&&!i)return;let d;if(!u._c)d="*";else if(u._used.indexOf(o)>-1)d=o;else return;const h=Te({value:l[c],getValue:()=>this.getEffect(n,c)},a||{});e&&(h.getProp=()=>e.effectData(c),h.clearProp=()=>e.clearEffectData(c),h.mergeProp=v=>Zn(h.getProp(),[v]),h.id=e.id),this.bus.$emit(`p:${c}:${d}:${u.input?1:0}`,s,[h,n,this.api])})}})}function CT(t){return t.filter(function(e,n,i){return i.indexOf(e,0)===n})}function ET(t){const e=t.components;if(Array.isArray(e)){const n=CT(e.filter(i=>i!=="*"));return n.length?n:!1}else return fe.String(e)?[e]:!1}function Nn(t){Dm(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.props.preview!=null?t.vm.props.preview:t.vm.setupState.parent&&t.vm.setupState.parent.props.preview!=null?t.vm.setupState.parent.props.preview:t.options.value.preview||!1}}),Fe(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:It({}),subRuleData:It({}),subForm:{},form:It({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new Ac(this),this.api=t.extendApiFn.reduce((e,n)=>{const i=Be(()=>n(e,this));return i&&i!==e&&Fe(e,i),e},rT(this))}Fe(Nn.prototype,{initData(t){Fe(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=Te(Te(Te({},In(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch(t){return new Promise((e,n)=>{const i=this.options.beforeFetch&&Be(()=>this.options.beforeFetch(t,{api:this.api}));i&&fe.Function(i.then)?i.then(e).catch(n):e()})},beforeFetch(t){return new Promise((e,n)=>{const i=t&&t.beforeFetch&&Be(()=>t.beforeFetch(t,{api:this.api}));i&&fe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()}).then(()=>this.globalBeforeFetch(t))},beforeSubmit(t){return new Promise((e,n)=>{const i=this.options.beforeSubmit&&Be(()=>this.options.beforeSubmit(t,{api:this.api}));i&&fe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()})}});cT(Nn);uT(Nn);hT(Nn);pT(Nn);_T(Nn);bT(Nn);wT(Nn);ST(Nn);const xT="fcFragment",va=Ce({name:xT,inheritAttrs:!1,props:["vnode"],render(){return this.vnode}});function TT(t){return Object.keys(t).map(e=>{const n=t[e],i=P_(e);if(i)return[i,n.value,n.arg,n.modifiers]}).filter(e=>!!e)}function sh(t,e){let n=t.directives;return n?(Array.isArray(n)||(n=[n]),it(e,n.reduce((i,o)=>i.concat(TT(o)),[]))):e}function $T(){const t={};function e(n){this.vm=n.vm,this.handle=n}return Fe(e.prototype,{make(n,i,o){return sh(i,this.h(n,Jd(i),o))},makeComponent(n,i,o){try{return sh(i,j(n,Jd(i),o))}catch(r){return console.error(r),j("")}},h(n,i,o){const r=(this.vm||ol()).appContext.config.isNativeTag(n),s=this.handle.fc.prop.components[n];!s&&r&&delete i.formCreateInject;try{return j(s||(r?n:Ue(n)),i,o)}catch(a){return console.error(a),j("")}},aliasMap:t}),Fe(e,{aliasMap:t,alias(n,i){t[n]=i},use(n){Object.keys(n).forEach(i=>{const o=Lo(i),r=Em(i).toLocaleLowerCase(),s=n[i];e.alias(i,s),[i,o,r].forEach(a=>{e.prototype[a]=function(l,c){return this.make(t[i]||a,l,c)}})})}}),e}function kT(t){class e extends Vm{}return Object.assign(e.prototype,t),e}function Vm(t){Fe(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}Fe(Vm.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Fs()},init(){},update(){},beforeRender(){},form(){return this.vm.refs[this.ref]},adapterValidate(t,e){return t.validator=(n,i,o)=>e(i,o),t},getSlot(t){const e=n=>{if(n)return n.slots[t]||e(n.setupState.parent)};return e(this.vm)},mergeOptions(t,e){return Qn(t.map(n=>this.tidyOptions(n)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},fieldChange(t,e,n,i){},render(t){}});const OT=function(t){const e={name:"loadData",_fn:[],loaded(n,i,o){this.deleted(n),Ge(()=>{let r=Ut(n.getValue());const s=[];r.forEach(a=>{if(a&&(a.attr||a.template)){let l=d=>{let h;i&&i.__fc__&&(h=i.__fc__.getParentGroup());let v;a.template?v=t.$handle.loadStrVar(a.template,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null):a.handler&&fe.Function(a.handler)?v=a.handler(d,i,o):v=t.$handle.loadStrVar(`{{${a.attr}}}`,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null),(v==null||v==="")&&a.default!=null&&(v=a.default),a.copy!==!1&&(v=In(v));const p=a.modify?i:n.getProp();a.to==="child"?p.children?p.children[0]=v:p.children=[v]:pi(p,a.to||"options",v),o.sync(i)},c=d=>l(d);const u=t.watchLoadData(c);l=ci(l,a.wait||300),a.watch!==!1?s.push(u):u()}}),this._fn[n.id]=s})},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},AT=function(t){const e={name:"t",_fn:[],loaded(n,i,o){this.deleted(n);let r=n.getValue()||{};const s=[];Object.keys(r).forEach(a=>{const l=r[a];if(l){const c=typeof l=="object";let u=v=>{let p=t.t(c?l.attr:l,c?l.params:null,v);const f=c&&l.modify?i:n.getProp();a==="child"?f.children?f.children[0]=p:f.children=[p]:pi(f,a,p),o.sync(i)},d=v=>u(v);const h=t.watchLoadData(d);u=ci(u,l.wait||300),l.watch!==!1?s.push(h):h()}}),this._fn[n.id]=s},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},Bm={name:"componentValidate",load(t,e,n){let i=t.getValue();if(!i||i.method===!1)t.clearProp(),n.clearValidateState([e.field]);else{fe.Object(i)||(i={method:i});const o=i.method,r=en(Te({},i),{validator(...s){const a=On(e);if(a)return n.exec(a.id,fe.String(o)?o:"formCreateValidate",...s,{attr:t,rule:e,api:n})}});delete r.method,t.getProp().validate=[r]}},watch(...t){Bm.load(...t)}},PT=function(t){function e(o){return fe.String(o)&&(o={action:o,to:"options"}),o}function n(o,r,s){let a=o.value;i.deleted(o),fe.Function(a)&&(a=a(r,s)),a=e(a);const l=d=>{d===void 0?o.clearProp():pi(o.getProp(),a.to||"options",d),d!=null&&a&&a.key&&t.$handle.options.globalData[a.key]&&t.fetchCache.set(t.$handle.options.globalData[a.key],{status:!0,data:d}),s.sync(r)};if(!a||!a.action&&!a.key){l(void 0);return}a=In(a),a.to||(a.to="options");const c=a.onError,u=()=>{if(!o.getValue())return o.clearProp(),s.sync(r),!0};i._fn[o.id]=t.watchLoadData(ci((d,h)=>{if(h&&a.watch===!1)return i._fn[o.id]();if(a.key){t.targetRule=r;const f=d("$globalData."+a.key);if(delete t.targetRule,f){if(u())return;l(f)}return}const v=t.$handle.loadFetchVar(In(a),d,r),p=en(Te({headers:{}},v),{onSuccess(f,_){if(u())return;let C=S=>_?S:lt(S,"data")?S.data:S;const w=Dn(v.parse);fe.Function(w)?C=w:w&&fe.String(w)&&(C=S=>Pt(S,w)),us(C(f,r,s)).then(S=>{l(S)})},onError(f){l(void 0),!u()&&(c||(_=>Tc(_.message||"fetch fail "+v.action)))(f,r,s)}});t.$handle.beforeFetch(p,{rule:r,api:s}).then(()=>{if(fe.Function(v.action)){us(v.action(r,s)).then(f=>{p.onSuccess(f,!0)}).catch(f=>{p.onError(f)});return}Be(()=>t.create.fetch(p,{inject:o,rule:r,api:s}))}).catch(f=>{})},a.wait||600))}const i={name:"fetch",_fn:[],loaded(...o){n(...o)},watch(...o){n(...o)},deleted(o){this._fn[o.id]&&(this._fn[o.id](),delete this._fn[o.id]),o.clearProp()}};return i},RT={fetch:PT,loadData:OT,t:AT,componentValidate:Bm},MT="html",IT={name:MT,loadChildren:!1,render(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return{default:()=>t.filter(e=>fe.String(e)).join("")}}};function FT(t){t=t+"=";const e=decodeURIComponent(document.cookie).split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0){i=i.substring(t.length,i.length);try{return JSON.parse(i)}catch{return i}}}return null}function DT(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function LT(t){const e=sessionStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function Pc(t,e){if(!e)return null;const n=e.split(".");let i=t(n.shift());return n.length?i==null?null:Pt(i,n):i}function jT(t){return Pc(FT,t)}function zT(t){return Pc(DT,t)}function NT(t){return Pc(LT,t)}const UT={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function VT(t,e){let n;return arguments.length===2?(n=arguments[1],e=n[t]):n=arguments[2],{id:e,prop:n}}function ga(){return VT("name",...arguments)}function BT(t){const e=t.key||[],n=t.array||[],i=t.normal||[];Pm.push(...e),$c.push(...n),kc.push(...i),zm([...e,...n,...i])}let HT=1;const sn={},ah=Symbol("defValue");function Hm(t){const e={[va.name]:va},n={},i={},o={},r={},s=[],a=[],l=[t.extendApi],c=Te({},RT),u=iT();let d={global:{}};const h=t.isMobile===!0,v=It({$mobile:h}),p=$T(),f={},_={};BT(t.attrs||{});function C(k){const z=sn[k];if(Array.isArray(z))return z.map(D=>D.api());if(z)return z.api()}function w(k){s.push(k)}function S(){const k=ga(...arguments);k.id&&k.prop&&(i[k.id]=k.prop)}function b(){const k=ga(...arguments);k.id&&k.prop&&(c[k.id]=fe.Function(k.prop)?k.prop:en(Te({},k.prop),{name:k.id}))}function E(k){p.use(k)}function x(k){if(arguments.length===0)return $o;if(typeof k=="string"&&arguments.length===1)return n[Vt(k)];const z=ga(...arguments);if(!z.id||!z.prop)return $o;const D=Vt(z.id),B=z.prop,oe=B.merge===!0?n[D]:void 0;n[D]=Sr(B,oe||$o),u[D]=Et(D),B.maker&&Fe(u,B.maker)}function O(k,z){let D;if(fe.String(k)){if(D=k,z===void 0)return e[D]}else D=k.displayName||k.name,z=k;if(!D||!z)return;const B=Vt(D);e[D]=z,e[B]=z,delete p.aliasMap[D],delete p.aliasMap[B],delete n[D],delete n[B],z.formCreateParser&&x(D,z.formCreateParser)}function $(){return eT(re,e,i)}function K(k,z){const D=$();return ac({data(){return It({rule:k,option:z})},render(){return Ao(D,Te({ref:"fc"},this.$data))}})}function F(){return va}function P(k,z){return fe.Function(k.install)?k.install(N,z):fe.Function(k)&&k(N,z),this}function N(k,z){let D=K(k,z||{});s.forEach(oe=>{Be(()=>oe(N,D))});const B=document.createElement("div");return(z?.el||document.body).appendChild(B),D.mount(B).$refs.fc.fapi}Sr(N,_);function I(k){let z=Te({},t);return k?z.inherit={components:e,parsers:n,directives:i,modelFields:o,providers:c,useApps:s,maker:u,formulas:f,loadData:v}:delete z.inherit,Hm(z)}function q(k,z){o[k]=z}function le(k,z){f[k]=z}function de(k,z){const D=r[k]||{},B=D.parsers||{};z.parsers&&Object.keys(z.parsers).forEach(oe=>{B[oe]=Sr(z.parsers[oe],$o)}),z.name=k,r[k]=en(Te(Te({},D),z),{parsers:B})}function Y(k){k&&Object.keys(sn).forEach(z=>{(Array.isArray(sn[z])?sn[z]:[sn[z]]).forEach(D=>{D.bus.$emit("$loadData."+k)})})}function M(k,z){pi(v,k,z),Y(k)}function A(k,z){const D=(...B)=>Be(()=>z(...B));D._driver=!0,M(k,D)}function Q(k,z){const D=(k||"").split(".");k=D.shift();const B=D.join(".");if(lt(v,k)||(v[k]=ah),v[k]!==ah){let oe=v[k];return oe&&oe._driver?oe=oe(B):D.length&&(oe=Pt(oe,D)),oe==null||oe===""?z:oe}else return z}function U(k){l.push(k)}function ie(k){delete v[k],Y(k)}function ve(k,z){a.push({name:k,callback:z})}function re(k){Fe(this,{id:HT++,create:N,vm:k,manager:kT(t.manager),parsers:n,providers:c,modelFields:o,formulas:f,isMobile:h,rules:k.props.rule,name:k.props.name||Fs(),inFor:k.props.inFor,prop:{components:e,directives:i},get:null,drivers:r,renderDriver:null,refreshData:Y,loadData:v,CreateNode:p,bus:new Cm,unwatch:[],options:H({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:It({})}),a.forEach(z=>{this.bus.$on(z.name,z.callback)}),Ge(()=>{$e(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),Fe(k.appContext.components,e),Fe(k.appContext.directives,i),this.$handle=new Nn(this),this.name&&(this.inFor?(sn[this.name]||(sn[this.name]=[]),sn[this.name].push(this)):sn[this.name]=this)}re.isMobile=h,Fe(re.prototype,{init(){this.isSub()&&this.unwatch.push($e(()=>this.vm.setupState.parent.setupState.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver=typeof this.vm.props.driver=="object"?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver(k,...z){if(this.bus.$emit(k,...z),this.renderDriver&&this.renderDriver[k])return Be(()=>this.renderDriver[k](...z))},t(k,z,D){let B=D?D("$t."+k):this.globalLanguageDriver(k);return B==null&&(B=""),B&&z&&Object.keys(z).forEach(oe=>{const ee=new RegExp(`{${oe}}`,"g");B=B.replace(ee,z[oe])}),B},globalDataDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalData&&this.options.value.globalData[D];if(B){if(B.type==="static")return Pt(B.data,z);{let oe;const ee=this.fetchCache.get(B);if(ee){if(ee.status&&(oe=Pt(ee.data,z)),!ee.loading)return oe;ee.loading=!1,this.fetchCache.set(B,ee)}else this.fetchCache.set(B,{status:!1});const G=ci(()=>{ke();const Ee=this.fetchCache.get(B);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf(B)!==-1?(Ee&&(Ee.loading=!0,this.fetchCache.set(B,Ee)),this.bus.$emit("$loadData.$globalData."+D)):this.fetchCache.delete(B)},B.wait||600),he=Ee=>{this.fetchCache.set(B,{status:!0,data:Ee}),this.bus.$emit("$loadData.$globalData."+D)},me=(Ee,ze)=>{if(ze&&B.watch===!1)return ke();if(ze){G();return}const Pe=this.$handle.loadFetchVar(wl(B),Ee);Pe.targetRule=this.targetRule,this.$handle.api.fetch(Pe).then(Ne=>{he(Ne)}).catch(Ne=>{he(null)})},ke=this.watchLoadData(me);return B.watch===!1&&ke(),this.unwatch.push(ke),oe}}},getLocale(){let k=this.vm.setupState.top.props.locale;return k&&typeof k=="object"?k.name:typeof k=="string"?k:"zh-cn"},globalLanguageDriver(k){let z=this.vm.setupState.top.props.t,D=this.vm.setupState.top.props.locale,B;if(z&&(B=Be(()=>z(k))),B==null&&D&&typeof D=="object"&&(B=Pt(D,k)),B==null){const oe=this.options.value.language||{},ee=this.getLocale();B=Pt(oe[ee]||{},k),B==null&&(B=Pt(UT[ee]||{},k))}return B},globalVarDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalVariable&&this.options.value.globalVariable[D];if(B){const oe=fe.Function(B)?B:Dn(B.handle);if(oe){let ee=oe((...G)=>this.$handle.api.getData(...G),this.$handle.api);return Pt(ee,z)}}},setData(k,z,D){D?M(k,z):(pi(this.vm.setupState.top.setupState.fc.tmpData,k,z),this.bus.$emit("$loadData."+k))},getLoadData(k,z){let D=null;if(k!=null){let B=k.split(".");const oe=B.shift();if(D=Pt(this.vm.setupState.top.setupState.fc.tmpData,k),D!=null)return D;if(oe==="$topForm")D=this.$handle.api.top.formData(!0);else if(oe==="$scopeForm")D=this.$handle.api.scope.formData(!0);else if(oe==="$form")D=this.$handle.api.formData(!0);else if(oe==="$options")D=this.options.value;else if(oe==="$globalData")D=this.globalDataDriver(B.join(".")),B=[];else if(oe==="$var")D=this.globalVarDriver(B.join(".")),B=[];else if(oe==="$locale")D=this.getLocale(),B=[];else if(oe==="$t")D=this.globalLanguageDriver(B.join(".")),B=[];else{if(oe==="$preview")return this.$handle.preview;D=Q(k),B=[]}D&&B.length&&(D=Pt(D,B))}return D==null||D===""?z:D},watchLoadData(k,z){let D={};const B=G=>{this.get||(this.get=oe),Be(()=>{k(oe,G)}),this.get===oe&&(this.get=void 0)},oe=(G,he)=>{let me;if(typeof G=="object"&&(me=G.getValue,G=G.id),D[G])return D[G].val;const ke=te(()=>me?me():this.getLoadData(G,he)),Ee=G.split("."),ze=Ee.shift(),Pe=Ee.shift()||"",Ne=ci(()=>{const Qe=me?me():this.getLoadData(G,he);if(D[G])((Qe instanceof Function||fe.Object(Qe)||Array.isArray(Qe))&&Qe===D[G].val||JSON.stringify(Qe)!==JSON.stringify(D[G].val))&&(D[G].val=Qe,B(!0));else return},z||0),ut=$e(ke,Qe=>{Ne()});return this.bus.$on("$loadData."+ze,Ne),Pe&&this.bus.$on("$loadData."+ze+"."+Pe,Ne),D[G]={fn:()=>{this.bus.$off("$loadData."+ze,Ne),Pe&&this.bus.$off("$loadData."+ze+"."+Pe,Ne),ut()},val:ke.value},ke.value};B(!1);const ee=()=>{Object.keys(D).forEach(G=>D[G].fn()),D={}};return this.unwatch.push(ee),ee},isSub(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions(){this.options.value={};let k=Te({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},In(d));const z=this.isSub();z&&(k=this.mergeOptions(k,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),k=this.mergeOptions(k,this.vm.props.option);const D=this.api();this.targetFormDriver("initOptions",k,{api:D,isSubForm:z}),this.updateOptions(k)},mergeOptions(k,z,D){return z=Te({},z||{}),D&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","beforeUnmount","beforeSubmit","onBeforeUnmount","onReload","reload","formData","el","globalClass","style"].forEach(B=>{delete z[B]}),z.global&&(k.global=Jx(k.global,z.global),delete z.global),this.$handle.$manager.mergeOptions([z],k),k},updateOptions(k){this.options.value=this.mergeOptions(this.options.value,k),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(Be(()=>this.$handle.lifecycle("beforeUnmount")),this.name)if(this.inFor){const k=sn[this.name].indexOf(this);sn[this.name].splice(k,1)}else delete sn[this.name];a.forEach(k=>{this.bus.$off(k.name,k.callback)}),this.tmpData={},this.unwatch.forEach(k=>k()),this.unwatch=[],this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function ge(k){Fe(k,{version:t.version,ui:t.ui,isMobile:h,extendApi:U,getData:Q,setDataDriver:A,setData:M,removeData:ie,refreshData:Y,maker:u,component:O,directive:S,setModelField:q,setFormula:le,setDriver:de,register:b,$vnode:F,parser:x,use:P,factory:I,componentAlias:E,copyRule:Im,copyRules:Fm,mergeRule:Zn,fetch:Nm,$form:$,parseFn:Dn,parseJson:$m,toJson:jo,useApp:w,getApi:C,on:ve})}function _e(k){Fe(k,{create:N,install(z,D){d=Te(Te({},d),D||{});const B=`_installedFormCreate${h?"Mobile":""}_${t.ui}`;if(z[B]===!0)return;z[B]=!0;const oe=function(G,he={}){return N(G,he)};ge(oe),z.config.globalProperties.$formCreate=oe;const ee=$();z.component(ee.name,ee),s.forEach(G=>{Be(()=>G(k,z))})}})}if(ge(_),_e(_),A("$cookie",jT),A("$localStorage",zT),A("$sessionStorage",NT),p.use({fragment:"fcFragment"}),t.install&&N.use(t),w((k,z)=>{z.mixin({props:["formCreateInject"]})}),x(IT),t.inherit){const k=t.inherit;k.components&&Fe(e,k.components),k.parsers&&Fe(n,k.parsers),k.directives&&Fe(i,k.directives),k.modelFields&&Fe(o,k.modelFields),k.providers&&Fe(c,k.providers),k.useApps&&Fe(s,k.useApps),k.maker&&Fe(u,k.maker),k.loadData&&Fe(v,k.loadData),k.formulas&&Fe(f,k.formulas)}const R=$();return Sr(R,_),Object.defineProperties(R,{fetch:{get(){return _.fetch},set(k){_.fetch=k}}}),R.util=_,R}const lh={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},ch="datePicker",qT={name:ch,maker:(function(){return["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((t,e)=>(t[e]=Et(ch,{type:e.toLowerCase()}),t),{})})(),mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat=lh[e.type]||lh.date)}},_a="hidden",WT={name:_a,maker:{[_a]:(t,e)=>Et(_a)("",t,e)},render(){return[]}},ya="input",KT={name:ya,maker:(function(){const t=["password","url","email","text","textarea"].reduce((e,n)=>(e[n]=Et(ya,{type:n}),e),{});return t.idate=Et(ya,{type:"date"}),t})(),mergeProp(t){let{props:e}=t.prop;e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},YT="textarea",GT={name:YT,mergeProp(t){let{props:e}=t.prop;e.type="textarea",e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},uh="slider",QT={name:uh,maker:{sliderRange:Et(uh,{range:!0})},toFormValue(t,e){let n=Array.isArray(t),i=e.prop.props,o=i.min||0,r;return i.range===!0?r=n?t:[o,parseFloat(t)||o]:r=n?parseFloat(t[0])||o:parseFloat(t),r}},ba="timePicker",XT={name:ba,maker:{time:Et(ba,t=>t.props.isRange=!1),timeRange:Et(ba,t=>t.props.isRange=!0)},mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")}},JT={name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},{default:()=>[e.vNode.row(e.prop,t)]})}},ZT="select",e$={name:ZT,toFormValue(t,e){return e.prop.props.multiple&&!Array.isArray(t)?Ut(t):t}},t$=[qT,WT,KT,GT,QT,XT,JT,e$],rt="el",n$={button:rt+"-button",icon:rt+"-icon",slider:rt+"-slider",rate:rt+"-rate",upload:"fc-upload",cascader:rt+"-cascader",popover:rt+"-popover",tooltip:rt+"-tooltip",colorPicker:rt+"-colorPicker",timePicker:rt+"-time-picker",timeSelect:rt+"-time-select",datePicker:rt+"-date-picker",switch:rt+"-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:rt+"-input-number",number:rt+"-input-number",input:rt+"-input",textarea:rt+"-input",formItem:rt+"-form-item",form:rt+"-form",frame:"fc-frame",col:rt+"-col",row:rt+"-row",tree:"fc-tree",inputTag:rt+"-input-tag",inputOtp:rt+"-input-otp",mention:rt+"-mention",transfer:rt+"-transfer",treeSelect:rt+"-tree-select",autoComplete:rt+"-autocomplete",auto:rt+"-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function i$(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}}function o$(t){return t.type==="tooltip"}function dh(t,e){lt(t,e)&&fe.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function Vn(t){return t===!1}function r$(t,e){lt(t,e)&&!fe.Object(t[e])&&(t[e]={show:!!t[e]})}function wa(t){const e=Te({},t);return delete e.children,e}const s$={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){return new Promise((e,n)=>{const i=this.form();i?i.validateField(t,(o,r)=>{r?n(r):e(o)}):e()})},clearValidateState(t){const e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},fieldChange(t,e,n,i){var o,r;i||(r=(o=this.vm.refs[t.wrapRef])==null?void 0:o.validate("change"))==null||r.catch(()=>{})},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{r$(t,e)}),t},tidyRule({prop:t}){return dh(t,"title"),dh(t,"info"),t},mergeProp(t){const e={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(n=>{t.prop[n]=Qn([this.options[n]||{},t.prop[n]||{}],e[n])})},getDefaultOptions(){return i$()},update(){const t=this.options.form;this.rule={props:Te({},t),on:{submit:e=>{e.preventDefault()}},style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:n}=this,i=this.options.form;Fe(this.rule,{key:t,ref:e,class:[i.className,i.class,"form-create",this.$handle.preview?"is-preview":""]}),Fe(this.rule.props,{model:n.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Vn(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const n=t.prop,i=`${this.key}${t.key}`,o=n.col,r=this.isTitle(n)&&n.wrap.title!==!1,s=!o.labelWidth&&!r?0:o.labelWidth,{inline:a,col:l}=this.rule.props,c=n.wrap.class;delete n.wrap.class,delete n.wrap.title;const u=(fe.Undef(n.wrap.show)?!t.input:Vn(n.wrap.show))?e:this.$r(Qn([n.wrap,{props:en(Te({labelWidth:s===void 0?s:Em(s),label:r?n.title.title:void 0},wa(n.wrap||{})),{prop:t.id,rules:t.injectValidate()}),class:this.$render.mergeClass(c||n.className,"fc-form-item"),key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),Te({default:()=>e},r?{label:()=>this.makeInfo(n,i,t)}:{}));return a===!0||Vn(l)||Vn(o.show)?u:this.makeCol(n,i,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||Vn(e.show))},makeInfo(t,e,n){var i,o,r,s,a,l;const c=Te({},t.title),u=Te({},t.info),d=o$(u),h=this.options.form,v=this.getSlot("title"),p=[v?v({title:(o=(i=n.refRule)==null?void 0:i.__$title)==null?void 0:o.value,rule:n.rule,options:this.options}):((s=(r=n.refRule)==null?void 0:r.__$title)==null?void 0:s.value)+(h.labelSuffix||h["label-suffix"]||"")];if(!Vn(u.show)&&(u.info||u.native)&&!Vn(u.icon)){const _={type:u.type||"popover",props:wa(u),key:`${e}pop`};delete _.props.icon,delete _.props.show,delete _.props.info,delete _.props.align,delete _.props.native;const C="content";u.info&&!lt(_.props,C)&&(_.props[C]=(l=(a=n.refRule)==null?void 0:a.__$info)==null?void 0:l.value),p[u.align!=="left"?"unshift":"push"](this.$r(Qn([u,_]),{[c.slot||(d?"default":"reference")]:()=>this.$r({type:"ElIcon",style:"top:2px",key:`${e}i`},{default:()=>this.$r({type:u.icon===!0?"icon-warning":u.icon})},!0)}))}const f=Qn([c,{props:wa(c),key:`${e}tit`,class:"fc-form-title",type:c.type||"span",on:{click:(..._)=>{this.$handle.targetHook(n,"titleClick",{args:_})}}}]);return delete f.props.show,delete f.props.title,delete f.props.native,this.$r(f,p)},makeCol(t,e,n){const i=Te({},t.col);return delete i.show,this.$r({class:this.$render.mergeClass(i.class,"fc-form-col"),type:"col",props:i||{span:24},key:`${e}col`},n)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(Vn(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),Vn(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",class:"fc-form-item",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=Te({},this.options.resetBtn),e=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(n):n.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=Te({},this.options.submitBtn),e=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(n):n.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},mi={};a$(mi);l$(mi);c$(mi);u$(mi);d$(mi);h$(mi);function a$(t){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","inputTag","inputOtp","mention","transfer","treeSelect","radio","rate"].forEach(e=>{t[e]=Et(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker,t.tag=t.inputTag}function l$(t){t.treeSelectMultiple=Et("treeSelect",{multiple:!0})}function c$(t){const e="select",n="multiple";t.selectMultiple=Et(e,{[n]:!0}),t.selectOne=Et(e,{[n]:!1})}function u$(t){const e="tree",n={treeSelected:"selected",treeChecked:"checked"};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,{type:n[o]}),i),t)}function d$(t){const e="upload",n={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,r=>r.props({uploadType:n[o][0],maxLength:n[o][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function h$(t){const e={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};return Object.keys(e).reduce((n,i)=>(n[i]=Et("frame",o=>o.props({type:e[i][0],maxLength:e[i][1]})),n),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages,t}function hh(t,e){return fe.Boolean(t)?t={show:t}:!fe.Undef(t)&&!fe.Object(t)&&(t={show:e}),t}function f$(t,e){return{formEl(){return e.$manager.form()},wrapEl(n){const i=e.getFieldCtx(n);if(i)return e.vm.refs[i.wrapRef]},validate(n){return new Promise((i,o)=>{const r=t.children,s=[e.$manager.validate()];r.filter(a=>!a.isScope).forEach(a=>{s.push(a.validate())}),Promise.all(s).then(()=>{i(!0),n&&n(!0)}).catch(a=>{o(a),n&&n(a),e.vm.emit("validate-fail",a,{api:t}),e.emitEvent("validate-fail",a,{api:t})})})},validateField(n,i){return new Promise((o,r)=>{const s=typeof n=="object"?On(n):e.getCtx(n);if(!s){o(null),i&&i(null);return}const a=e.subForm[s.id],l=[e.$manager.validateField(s.id)];Ut(a).filter(c=>!c.isScope).forEach(c=>{l.push(c.validate())}),Promise.all(l).then(()=>{o(null),i&&i(null)}).catch(c=>{r(c),i&&i(c),e.vm.emit("validate-field-fail",c,{field:n,api:t})})})},validateFields(n,i){return new Promise((o,r)=>{Array.isArray(n)||(n=[n]);const s=n.map(a=>t.validateField(a));Promise.all(s).then(()=>{o(null),i&&i(null)}).catch(a=>{r(a),i&&i(a)})})},clearValidateState(n,i=!0){t.helper.tidyFields(n).forEach(o=>{i&&this.clearSubValidateState(o),e.getCtxs(o).forEach(r=>{e.$manager.clearValidateState(r)})})},clearSubValidateState(n){t.helper.tidyFields(n).forEach(i=>{e.getCtxs(i).forEach(o=>{const r=e.subForm[o.id];r&&(Array.isArray(r)?r.forEach(s=>{s.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(n=!0)=>{t.submitBtnProps({loading:!!n})},disabled:(n=!0)=>{t.submitBtnProps({disabled:!!n})},show:(n=!0)=>{t.submitBtnProps({show:!!n})}},resetBtn:{loading:(n=!0)=>{t.resetBtnProps({loading:!!n})},disabled:(n=!0)=>{t.resetBtnProps({disabled:!!n})},show:(n=!0)=>{t.resetBtnProps({show:!!n})}},submitBtnProps:(n={})=>{let i=hh(e.options.submitBtn,!0);Fe(i,n),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(n={})=>{let i=hh(e.options.resetBtn,!1);Fe(i,n),e.options.resetBtn=i,t.refreshOptions()},submit(n,i){return new Promise((o,r)=>{(e.options.validateOnSubmit===!1?Promise.resolve():t.validate()).then(()=>{let s=t.formData();e.beforeSubmit(s).then(()=>{fe.Function(n)&&Be(()=>n(s,t)),fe.Function(e.options.onSubmit)&&Be(()=>e.options.onSubmit(s,t)),e.vm.emit("submit",s,t),o(s)}).catch(a=>{})}).catch((...s)=>{fe.Function(i)&&Be(()=>i(t,...s)),r(...s)})})}}}const qm={name:"required",load(t,e,n){const i=p$(t.getValue());let o;if(i.required===!1)t.clearProp(),n.clearValidateState([e.field]);else{const r=Te({required:!0,validator(a,l,c){s(),fe.empty(l)?c(r.message):c()}},i),s=()=>{var a;const l=(a=e.__fc__.refRule.__$title)==null?void 0:a.value;if(o!==l)if(o=l,!i.message)r.message=n.t("required",{title:l})||l+(n.getLocale()==="en"?" is required":"不能为空");else{const c=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);c&&(r.message=n.t(c[1],{title:l}))}};s(),t.getProp().validate=[r]}n.sync(e)},watch(...t){qm.load(...t)}};function p$(t){return fe.Boolean(t)?{required:t}:fe.String(t)?{message:t}:fe.Undef(t)?{required:!1}:fe.Function(t)?{validator:t}:fe.Object(t)?t:{}}function m$(t){t.componentAlias(n$),Qx.forEach(e=>{t.component(e.name,e)}),t.register(qm),t$.forEach(e=>{t.parser(e)}),Object.keys(mi).forEach(e=>{t.maker[e]=mi[e]}),typeof window<"u"&&window.ElementPlus&&t.useApp((e,n)=>{n.use(window.ElementPlus)})}function v$(){return Hm({ui:"element-ui",version:"3.3.0",manager:s$,extendApi:f$,install:m$,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const Ds=v$();typeof window<"u"&&(window.formCreate=Ds);Ds.maker;function g$(t){t.useApp((e,n)=>{n.component(sl.name)||n.use(sl),n.component(Qi.name)||n.use(Qi),n.component(Lu.name)||n.use(Lu),n.component(ju.name)||n.use(ju),n.component(zu.name)||n.use(zu),n.component(ll.name)||n.use(ll),n.component(Nu.name)||n.use(Nu),n.component(al.name)||n.use(al),n.component(Uu.name)||n.use(Uu),n.component(Vu.name)||n.use(Vu),n.component(Bu.name)||n.use(Bu),n.component(Hu.name)||n.use(Hu),n.component(qu.name)||n.use(qu),n.component(Wu.name)||n.use(Wu),n.component(Ku.name)||n.use(Ku),n.component(Yu.name)||n.use(Yu),n.component(Gu.name)||n.use(Gu),n.component(Qu.name)||n.use(Qu),n.component(Xu.name)||n.use(Xu),n.component(Ju.name)||n.use(Ju),n.component(Zu.name)||n.use(Zu),n.component(ed.name)||n.use(ed),n.component(td.name)||n.use(td),n.component(nd.name)||n.use(nd),n.component(id.name)||n.use(id),n.component(Ro.name)||n.use(Ro),n.component(od.name)||n.use(od),n.component(rd.name)||n.use(rd),n.component(sd.name)||n.use(sd),n.component(ad.name)||n.use(ad),n.component(ld.name)||n.use(ld),n.component(cd.name)||n.use(cd)})}Ds.use(g$);function _$(t){t.use(Ds)}async function y$(){}function b$(t){t.use(qw,{paginationStorage:{get:()=>Xb(),set:e=>Jb(e)}})}function w$(t){t.directive("loading",Xf)}function S$(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(o){o(n)}),(i=t.get("*"))&&i.slice().map(function(o){o(e,n)})}}}function Oe(t){let e=Qo();if(typeof window<"u"){let n=t.subscribe(i=>{e.value=i});R_()&&M_(n)}else e.value=t.get();return e}let mn=[],ti=0;const Cr=4,Qr=globalThis.nanostoresGlobal||={epoch:0},Tt=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(i){return n.lc=e.push(i),()=>{for(let r=ti+Cr;r<mn.length;)mn[r]===i?mn.splice(r,Cr):r+=Cr;let o=e.indexOf(i);~o&&(e.splice(o,1),--n.lc||n.off())}},notify(i,o){Qr.epoch++;let r=!mn.length;for(let s of e)mn.push(s,n.value,i,o);if(r){for(ti=0;ti<mn.length;ti+=Cr)mn[ti](mn[ti+1],mn[ti+2],mn[ti+3]);mn.length=0}},off(){},set(i){let o=n.value;o!==i&&(n.value=i,n.notify(o))},subscribe(i){let o=n.listen(i);return i(n.value),o},value:t};return n},C$=5,Er=6,xr=10;let E$=(t,e,n,i)=>(t.events=t.events||{},t.events[n+xr]||(t.events[n+xr]=i(o=>{t.events[n].reduceRight((r,s)=>(s(r),r),{shared:{},...o})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let o=t.events[n],r=o.indexOf(e);o.splice(r,1),o.length||(delete t.events[n],t.events[n+xr](),delete t.events[n+xr])});const x$=1e3;let Wm=(t,e)=>E$(t,i=>{let o=e(i);o&&t.events[Er].push(o)},C$,i=>{let o=t.listen;t.listen=(...s)=>(!t.lc&&!t.active&&(t.active=!0,i()),o(...s));let r=t.off;return t.events[Er]=[],t.off=()=>{r(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let s of t.events[Er])s();t.events[Er]=[]}},x$)},()=>{t.listen=o,t.off=r}}),T$=(t,e,n)=>{Array.isArray(t)||(t=[t]);let i,o,r=()=>{if(o===Qr.epoch)return;o=Qr.epoch;let c=t.map(u=>u.get());if(!i||c.some((u,d)=>u!==i[d])){i=c;let u=e(...c);u&&u.then&&u.t?u.then(d=>{i===c&&s.set(d)}):(s.set(u),o=Qr.epoch)}},s=Tt(void 0),a=s.get;s.get=()=>(r(),a());let l=r;return Wm(s,()=>{let c=t.map(u=>u.listen(l));return r(),()=>{for(let u of c)u()}}),s};const ri=(t,e)=>T$(t,e);let fh=t=>t,Hn={},xl={addEventListener(){},removeEventListener(){}};function $$(){try{return typeof localStorage<"u"}catch{return!1}}$$()&&(Hn=localStorage);let k$={addEventListener(t,e,n){window.addEventListener("storage",e),window.addEventListener("pageshow",n)},removeEventListener(t,e,n){window.removeEventListener("storage",e),window.removeEventListener("pageshow",n)}};typeof window<"u"&&(xl=k$);function Km(t,e,n={}){let i=n.encode||fh,o=n.decode||fh,r=Hn[t],s=Tt(t in Hn?o(r):e),a=s.set;s.set=u=>{r=i(u),typeof r>"u"?delete Hn[t]:Hn[t]=r,a(u)};function l(u){u.key===t?u.newValue===null?a(e):a(o(u.newValue)):t in Hn||a(e)}function c(){r!==Hn[t]&&s.set(t in Hn?o(Hn[t]):e)}return Wm(s,()=>{if(c(),n.listen!==!1)return xl.addEventListener(t,l,c),()=>{xl.removeEventListener(t,l,c)}}),s}let Tl=1;var O$=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)});publish=t=>{this.subscribers.forEach(e=>e(t))};addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]};create=t=>{const{message:e,...n}=t,i=typeof t.id=="number"||t.id&&t.id?.length>0?t.id:Tl++,o=this.toasts.find(s=>s.id===i),r=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:e}),{...s,...t,id:i,dismissible:r,title:e}):s):this.addToast({title:e,...n,dismissible:r,id:i}),i};dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),t);message=(t,e)=>this.create({...e,message:t,type:"default"});error=(t,e)=>this.create({...e,type:"error",message:t});success=(t,e)=>this.create({...e,type:"success",message:t});info=(t,e)=>this.create({...e,type:"info",message:t});warning=(t,e)=>this.create({...e,type:"warning",message:t});loading=(t,e)=>this.create({...e,type:"loading",message:t});promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,r;const s=i.then(async l=>{if(r=["resolve",l],Vi(l))o=!1,this.create({id:n,type:"default",message:l});else if(P$(l)&&!l.ok){o=!1;const u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description,v=typeof u=="object"&&!Vi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...v})}else if(l instanceof Error){o=!1;const u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description,v=typeof u=="object"&&!Vi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...v})}else if(e.success!==void 0){o=!1;const u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description,v=typeof u=="object"&&!Vi(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:d,...v})}}).catch(async l=>{if(r=["reject",l],e.error!==void 0){o=!1;const c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description,h=typeof c=="object"&&!Vi(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...h})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),e.finally?.()}),a=()=>new Promise((l,c)=>s.then(()=>r[0]==="reject"?c(r[1]):l(r[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})};custom=(t,e)=>{const n=e?.id||Tl++,i=this.toasts.find(r=>r.id===n),o=e?.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),i?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:t,dismissible:o,id:n,...e}),{...r,component:t,dismissible:o,id:n,...e}):r):this.addToast({component:t,dismissible:o,id:n,...e}),n};getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id))};const jt=new O$;function A$(t,e){const n=e?.id||Tl++;return jt.create({message:t,id:n,type:"default",...e}),n}const P$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",R$=A$,M$=()=>jt.toasts,I$=()=>jt.getActiveToasts(),Tr=Object.assign(R$,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:M$,getToasts:I$});function $r(t){return t.label!==void 0}const F$=3,Ym="24px",Gm="16px",ph=4e3,D$=356,L$=14,j$=45,Qm=200;function z$(){const t=H(!1);return zt(()=>{const e=()=>{t.value=document.hidden};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)}),{isDocumentHidden:t}}function ni(...t){return t.filter(Boolean).join(" ")}function N$(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}function U$(t,e){const n={};return[t,e].forEach((i,o)=>{const r=o===1,s=r?"--mobile-offset":"--offset",a=r?Gm:Ym;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof i=="number"||typeof i=="string"?l(i):typeof i=="object"?["top","right","bottom","left"].forEach(c=>{i[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof i[c]=="number"?`${i[c]}px`:i[c]}):l(a)}),n}const V$=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],B$=["aria-label","data-disabled","data-close-button-position"];var H$=Ce({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(t,{emit:e}){const n=t,i=e,o=H(null),r=H(null),s=H(!1),a=H(!1),l=H(!1),c=H(!1),u=H(!1),d=H(0),h=H(0),v=H(n.toast.duration||n.duration||ph),p=H(null),f=H(null),_=te(()=>n.index===0),C=te(()=>n.index+1<=n.visibleToasts),w=te(()=>n.toast.type),S=te(()=>n.toast.dismissible!==!1),b=te(()=>n.toast.class||""),E=te(()=>n.descriptionClass||""),x=te(()=>{const R=n.toast.position||n.position,z=n.heights.filter(D=>D.position===R).findIndex(D=>D.toastId===n.toast.id);return z>=0?z:0}),O=te(()=>{const R=n.toast.position||n.position;return n.heights.filter(z=>z.position===R).reduce((z,D,B)=>B>=x.value?z:z+D.height,0)}),$=te(()=>x.value*n.gap+O.value||0),K=te(()=>n.toast.closeButton??n.closeButton),F=te(()=>n.toast.duration||n.duration||ph),P=H(0),N=H(0),I=H(null),q=te(()=>n.position.split("-")),le=te(()=>q.value[0]),de=te(()=>q.value[1]),Y=te(()=>typeof n.toast.title!="string"),M=te(()=>typeof n.toast.description!="string"),{isDocumentHidden:A}=z$(),Q=te(()=>w.value&&w.value==="loading");et(()=>{s.value=!0,v.value=F.value}),zt(async()=>{if(!s.value||!f.value)return;await Ge();const R=f.value,k=R.style.height;R.style.height="auto";const z=R.getBoundingClientRect().height;R.style.height=k,h.value=z,i("update:height",{toastId:n.toast.id,height:z,position:n.toast.position||n.position})});function U(){a.value=!0,d.value=$.value,setTimeout(()=>{i("removeToast",n.toast)},Qm)}function ie(){if(Q.value||!S.value)return{};U(),n.toast.onDismiss?.(n.toast)}function ve(R){R.button!==2&&(Q.value||!S.value||(p.value=new Date,d.value=$.value,R.target.setPointerCapture(R.pointerId),R.target.tagName!=="BUTTON"&&(l.value=!0,I.value={x:R.clientX,y:R.clientY})))}function re(){if(c.value||!S.value)return;I.value=null;const R=Number(f.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),k=Number(f.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),z=new Date().getTime()-(p.value?.getTime()||0),D=o.value==="x"?R:k,B=Math.abs(D)/z;if(Math.abs(D)>=j$||B>.11){d.value=$.value,n.toast.onDismiss?.(n.toast),o.value==="x"?r.value=R>0?"right":"left":r.value=k>0?"down":"up",U(),c.value=!0;return}else f.value?.style.setProperty("--swipe-amount-x","0px"),f.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,o.value=null}function ge(R){if(!I.value||!S.value||(window?.getSelection()?.toString()?.length??!1))return;const z=R.clientY-I.value.y,D=R.clientX-I.value.x,B=n.swipeDirections??N$(n.position);!o.value&&(Math.abs(D)>1||Math.abs(z)>1)&&(o.value=Math.abs(D)>Math.abs(z)?"x":"y");let oe={x:0,y:0};const ee=G=>1/(1.5+Math.abs(G)/20);if(o.value==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&z<0||B.includes("bottom")&&z>0)oe.y=z;else{const G=z*ee(z);oe.y=Math.abs(G)<Math.abs(z)?G:z}}else if(o.value==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&D<0||B.includes("right")&&D>0)oe.x=D;else{const G=D*ee(D);oe.x=Math.abs(G)<Math.abs(D)?G:D}(Math.abs(oe.x)>0||Math.abs(oe.y)>0)&&(u.value=!0),f.value?.style.setProperty("--swipe-amount-x",`${oe.x}px`),f.value?.style.setProperty("--swipe-amount-y",`${oe.y}px`)}et(()=>{if(s.value=!0,!f.value)return;const R=f.value.getBoundingClientRect().height;h.value=R;const k=[{toastId:n.toast.id,height:R,position:n.toast.position},...n.heights];i("update:heights",k)}),Cs(()=>{f.value&&i("removeToast",n.toast)}),zt(R=>{if(n.toast.promise&&w.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let k;const z=()=>{if(N.value<P.value){const B=new Date().getTime()-P.value;v.value=v.value-B}N.value=new Date().getTime()},D=()=>{v.value!==1/0&&(P.value=new Date().getTime(),k=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),U()},v.value))};n.expanded||n.interacting||A.value?z():D(),R(()=>{clearTimeout(k)})}),$e(()=>n.toast.delete,R=>{R!==void 0&&R&&(U(),n.toast.onDismiss?.(n.toast))},{deep:!0});function _e(){l.value=!1,o.value=null,I.value=null}return(R,k)=>(y(),T("li",{tabindex:"0",ref_key:"toastRef",ref:f,class:Ae(m(ni)(n.class,b.value,R.classes?.toast,R.toast.classes?.toast,R.classes?.[w.value],R.toast?.classes?.[w.value])),"data-sonner-toast":"","data-rich-colors":R.toast.richColors??R.defaultRichColors,"data-styled":!(R.toast.component||R.toast?.unstyled||R.unstyled),"data-mounted":s.value,"data-promise":!!R.toast.promise,"data-swiped":u.value,"data-removed":a.value,"data-visible":C.value,"data-y-position":le.value,"data-x-position":de.value,"data-index":R.index,"data-front":_.value,"data-swiping":l.value,"data-dismissible":S.value,"data-type":w.value,"data-invert":R.toast.invert||R.invert,"data-swipe-out":c.value,"data-swipe-direction":r.value,"data-expanded":!!(R.expanded||R.expandByDefault&&s.value),"data-testid":R.toast.testId,style:At({"--index":R.index,"--toasts-before":R.index,"--z-index":R.toasts.length-R.index,"--offset":`${a.value?d.value:$.value}px`,"--initial-height":R.expandByDefault?"auto":`${h.value}px`,...R.style,...n.toast.style}),onDragend:_e,onPointerdown:ve,onPointerup:re,onPointermove:ge},[K.value&&!R.toast.component&&w.value!=="loading"?(y(),T("button",{key:0,"aria-label":R.closeButtonAriaLabel||"Close toast","data-disabled":Q.value,"data-close-button":"true","data-close-button-position":R.closeButtonPosition,class:Ae(m(ni)(R.classes?.closeButton,R.toast?.classes?.closeButton)),onClick:ie},[R.icons?.close?(y(),ne($t(R.icons?.close),{key:0})):Ve(R.$slots,"close-icon",{key:1})],10,B$)):ue("v-if",!0),R.toast.component?(y(),ne($t(R.toast.component),We({key:1},R.toast.componentProps,{onCloseToast:ie,isPaused:R.$props.expanded||R.$props.interacting||m(A)}),null,16,["isPaused"])):(y(),T(Me,{key:2},[w.value!=="default"||R.toast.icon||R.toast.promise?(y(),T("div",{key:0,"data-icon":"",class:Ae(m(ni)(R.classes?.icon,R.toast?.classes?.icon))},[R.toast.icon?(y(),ne($t(R.toast.icon),{key:0})):(y(),T(Me,{key:1},[w.value==="loading"?Ve(R.$slots,"loading-icon",{key:0}):w.value==="success"?Ve(R.$slots,"success-icon",{key:1}):w.value==="error"?Ve(R.$slots,"error-icon",{key:2}):w.value==="warning"?Ve(R.$slots,"warning-icon",{key:3}):w.value==="info"?Ve(R.$slots,"info-icon",{key:4}):ue("v-if",!0)],64))],2)):ue("v-if",!0),g("div",{"data-content":"",class:Ae(m(ni)(R.classes?.content,R.toast?.classes?.content))},[g("div",{"data-title":"",class:Ae(m(ni)(R.classes?.title,R.toast.classes?.title))},[Y.value?(y(),ne($t(R.toast.title),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Me,{key:1},[Ke(L(R.toast.title),1)],64))],2),R.toast.description?(y(),T("div",{key:0,"data-description":"",class:Ae(m(ni)(R.descriptionClass,E.value,R.classes?.description,R.toast.classes?.description))},[M.value?(y(),ne($t(R.toast.description),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Me,{key:1},[Ke(L(R.toast.description),1)],64))],2)):ue("v-if",!0)],2),R.toast.cancel?(y(),T("button",{key:1,style:At(R.toast.cancelButtonStyle||R.cancelButtonStyle),class:Ae(m(ni)(R.classes?.cancelButton,R.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:k[0]||(k[0]=z=>{m($r)(R.toast.cancel)&&S.value&&(R.toast.cancel.onClick?.(z),U())})},L(m($r)(R.toast.cancel)?R.toast.cancel?.label:R.toast.cancel),7)):ue("v-if",!0),R.toast.action?(y(),T("button",{key:2,style:At(R.toast.actionButtonStyle||R.actionButtonStyle),class:Ae(m(ni)(R.classes?.actionButton,R.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:k[1]||(k[1]=z=>{m($r)(R.toast.action)&&(R.toast.action.onClick?.(z),!z.defaultPrevented&&U())})},L(m($r)(R.toast.action)?R.toast.action?.label:R.toast.action),7)):ue("v-if",!0)],64))],46,V$))}}),q$=H$,rr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n};const W$={},K$={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function Y$(t,e){return y(),T("svg",K$,e[0]||(e[0]=[g("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),g("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var G$=rr(W$,[["render",Y$]]);const Q$=["data-visible"],X$={class:"sonner-spinner"};var J$=Ce({__name:"Loader",props:{visible:{type:Boolean}},setup(t){const e=Array(12).fill(0);return(n,i)=>(y(),T("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[g("div",X$,[(y(!0),T(Me,null,He(m(e),o=>(y(),T("div",{key:`spinner-bar-${o}`,class:"sonner-loading-bar"}))),128))])],8,Q$))}}),Z$=J$;const ek={},tk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function nk(t,e){return y(),T("svg",tk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var ik=rr(ek,[["render",nk]]);const ok={},rk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function sk(t,e){return y(),T("svg",rk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var ak=rr(ok,[["render",sk]]);const lk={},ck={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function uk(t,e){return y(),T("svg",ck,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var dk=rr(lk,[["render",uk]]);const hk={},fk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function pk(t,e){return y(),T("svg",fk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var mk=rr(hk,[["render",pk]]);const vk=["aria-label"],gk=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],_k=typeof window<"u"&&typeof document<"u";function yk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var bk=Ce({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:L$},visibleToasts:{default:F$},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Ym},mobileOffset:{default:Gm},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(t){const e=t,n=rc(),i=H([]),o=te(()=>e.id?i.value.filter(F=>F.toasterId===e.id):i.value.filter(F=>!F.toasterId));function r(F,P){return o.value.filter(N=>!N.position&&P===0||N.position===F)}const s=te(()=>{const F=o.value.filter(P=>P.position).map(P=>P.position);return F.length>0?Array.from(new Set([e.position].concat(F))):[e.position]}),a=te(()=>{const F={};return s.value.forEach(P=>{F[P]=i.value.filter(N=>N.position===P)}),F}),l=H([]),c=H({}),u=H(!1);zt(()=>{s.value.forEach(F=>{F in c.value||(c.value[F]=!1)})});const d=H(e.theme!=="system"?e.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),h=H(null),v=H(null),p=H(!1),f=e.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function _(F){i.value.find(P=>P.id===F.id)?.delete||jt.dismiss(F.id),i.value=i.value.filter(({id:P})=>P!==F.id),setTimeout(()=>{i.value.find(P=>P.id===F.id)||(l.value=l.value.filter(P=>P.toastId!==F.id))},Qm+50)}function C(F){p.value&&!F.currentTarget?.contains?.(F.relatedTarget)&&(p.value=!1,v.value&&(v.value.focus({preventScroll:!0}),v.value=null))}function w(F){F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||p.value||(p.value=!0,v.value=F.relatedTarget)}function S(F){F.target&&F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||(u.value=!0)}zt(F=>{const P=jt.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{i.value=i.value.map(I=>I.id===N.id?{...I,delete:!0}:I)});return}Ge(()=>{const I=i.value.findIndex(q=>q.id===N.id);I!==-1?i.value=[...i.value.slice(0,I),{...i.value[I],...N},...i.value.slice(I+1)]:i.value=[N,...i.value]})});F(P)}),zt(F=>{if(typeof window>"u")return;if(e.theme!=="system"){d.value=e.theme;return}const P=window.matchMedia("(prefers-color-scheme: dark)"),N=q=>{d.value=q?"dark":"light"};N(P.matches);const I=q=>{N(q.matches)};try{P.addEventListener("change",I)}catch{P.addListener(I)}F(()=>{try{P.removeEventListener("change",I)}catch{P.removeListener(I)}})}),zt(()=>{h.value&&v.value&&(v.value.focus({preventScroll:!0}),v.value=null,p.value=!1)}),zt(()=>{i.value.length<=1&&Object.keys(c.value).forEach(F=>{c.value[F]=!1})}),zt(F=>{function P(N){const I=e.hotkey.every(de=>N[de]||N.code===de),q=Array.isArray(h.value)?h.value[0]:h.value;I&&(s.value.forEach(de=>{c.value[de]=!0}),q?.focus());const le=document.activeElement===h.value||q?.contains(document.activeElement);N.code==="Escape"&&le&&s.value.forEach(de=>{c.value[de]=!1})}_k&&(document.addEventListener("keydown",P),F(()=>{document.removeEventListener("keydown",P)}))});function b(F){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!0}function E(F){if(!u.value){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!1}}function x(){Object.keys(c.value).forEach(F=>{c.value[F]=!1})}function O(){u.value=!1}function $(F){l.value=F}function K(F){const P=l.value.findIndex(N=>N.toastId===F.toastId);if(P!==-1)l.value[P]=F;else{const N=l.value.findIndex(I=>I.position===F.position);N!==-1?l.value.splice(N,0,F):l.value.unshift(F)}}return(F,P)=>(y(),T(Me,null,[ue(" Remove item from normal navigation flow, only available via hotkey "),g("section",{"aria-label":`${F.containerAriaLabel} ${m(f)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(y(!0),T(Me,null,He(s.value,(N,I)=>(y(),T("ol",We({key:N,ref_for:!0,ref_key:"listRef",ref:h,"data-sonner-toaster":"","data-sonner-theme":d.value,class:e.class,dir:F.dir==="auto"?yk():F.dir,tabIndex:-1,"data-theme":F.theme,"data-rich-colors":F.richColors,"data-y-position":N.split("-")[0],"data-x-position":N.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${m(D$)}px`,"--gap":`${F.gap}px`,...F.style,...m(n).style,...m(U$)(F.offset,F.mobileOffset)}},{ref_for:!0},F.$attrs,{onBlur:C,onFocus:w,onMouseenter:b,onMousemove:b,onMouseleave:E,onDragend:x,onPointerdown:S,onPointerup:O}),[(y(!0),T(Me,null,He(r(N,I),(q,le)=>(y(),ne(q$,{key:q.id,heights:l.value,icons:F.icons,index:le,toast:q,defaultRichColors:F.richColors,duration:F.toastOptions?.duration??F.duration,class:Ae(F.toastOptions?.class??""),descriptionClass:F.toastOptions?.descriptionClass,invert:F.invert,visibleToasts:F.visibleToasts,closeButton:F.toastOptions?.closeButton??F.closeButton,interacting:u.value,position:N,closeButtonPosition:F.toastOptions?.closeButtonPosition??F.closeButtonPosition,style:At(F.toastOptions?.style),unstyled:F.toastOptions?.unstyled,classes:F.toastOptions?.classes,cancelButtonStyle:F.toastOptions?.cancelButtonStyle,actionButtonStyle:F.toastOptions?.actionButtonStyle,"close-button-aria-label":F.toastOptions?.closeButtonAriaLabel,toasts:a.value[N],expandByDefault:F.expand,gap:F.gap,expanded:c.value[N]||!1,swipeDirections:e.swipeDirections,"onUpdate:heights":$,"onUpdate:height":K,onRemoveToast:_},{"close-icon":we(()=>[Ve(F.$slots,"close-icon",{},()=>[j(G$)])]),"loading-icon":we(()=>[Ve(F.$slots,"loading-icon",{},()=>[j(Z$,{visible:q.type==="loading"},null,8,["visible"])])]),"success-icon":we(()=>[Ve(F.$slots,"success-icon",{},()=>[j(ik)])]),"error-icon":we(()=>[Ve(F.$slots,"error-icon",{},()=>[j(mk)])]),"warning-icon":we(()=>[Ve(F.$slots,"warning-icon",{},()=>[j(dk)])]),"info-icon":we(()=>[Ve(F.$slots,"info-icon",{},()=>[j(ak)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,gk))),128))],8,vk)],2112))}}),wk=bk,Ls=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sk=class extends Ls{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xm=new Sk,Ck={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ek=class{#e=Ck;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},$l=new Ek;function xk(t){setTimeout(t,0)}var Tk=typeof window>"u"||"Deno"in globalThis;function gn(){}function $k(t,e){return typeof t=="function"?t(e):t}function kk(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ok(t,e){return Math.max(t+(e||0)-Date.now(),0)}function kl(t,e){return typeof t=="function"?t(e):t}function Ak(t,e){return typeof t=="function"?t(e):t}function mh(t,e){const{type:n="all",exact:i,fetchStatus:o,predicate:r,queryKey:s,stale:a}=t;if(s){if(i){if(e.queryHash!==Rc(s,e.options))return!1}else if(!No(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||o&&o!==e.state.fetchStatus||r&&!r(e))}function vh(t,e){const{exact:n,status:i,predicate:o,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(n){if(zo(e.options.mutationKey)!==zo(r))return!1}else if(!No(e.options.mutationKey,r))return!1}return!(i&&e.state.status!==i||o&&!o(e))}function Rc(t,e){return(e?.queryKeyHashFn||zo)(t)}function zo(t){return JSON.stringify(t,(e,n)=>Ol(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function No(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>No(t[n],e[n])):!1}var Pk=Object.prototype.hasOwnProperty;function Jm(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=gh(t)&&gh(e);if(!i&&!(Ol(t)&&Ol(e)))return e;const r=(i?t:Object.keys(t)).length,s=i?e:Object.keys(e),a=s.length,l=i?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=i?u:s[u],h=t[d],v=e[d];if(h===v){l[d]=h,(i?u<r:Pk.call(t,d))&&c++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){l[d]=v;continue}const p=Jm(h,v,n+1);l[d]=p,p===h&&c++}return r===a&&c===r?t:l}function gh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ol(t){if(!_h(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!_h(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function _h(t){return Object.prototype.toString.call(t)==="[object Object]"}function Rk(t){return new Promise(e=>{$l.setTimeout(e,t)})}function Mk(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Jm(t,e):e}function Ik(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Fk(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Mc=Symbol();function Zm(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Mc?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Dk(t,e,n){let i=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??=e(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var ev=(()=>{let t=()=>Tk;return{isServer(){return t()},setIsServer(e){t=e}}})();function Lk(){let t,e;const n=new Promise((o,r)=>{t=o,e=r});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),t(o)},n.reject=o=>{i({status:"rejected",reason:o}),e(o)},n}var jk=xk;function zk(){let t=[],e=0,n=a=>{a()},i=a=>{a()},o=jk;const r=a=>{e?t.push(a):o(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&o(()=>{i(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{o=a}}}var Rt=zk(),Nk=class extends Ls{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},ds=new Nk;function Uk(t){return Math.min(1e3*2**t,3e4)}function tv(t){return(t??"online")==="online"?ds.isOnline():!0}var Al=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function nv(t){let e=!1,n=0,i;const o=Lk(),r=()=>o.status!=="pending",s=f=>{if(!r()){const _=new Al(f);h(_),t.onCancel?.(_)}},a=()=>{e=!0},l=()=>{e=!1},c=()=>Xm.isFocused()&&(t.networkMode==="always"||ds.isOnline())&&t.canRun(),u=()=>tv(t.networkMode)&&t.canRun(),d=f=>{r()||(i?.(),o.resolve(f))},h=f=>{r()||(i?.(),o.reject(f))},v=()=>new Promise(f=>{i=_=>{(r()||c())&&f(_)},t.onPause?.()}).then(()=>{i=void 0,r()||t.onContinue?.()}),p=()=>{if(r())return;let f;const _=n===0?t.initialPromise:void 0;try{f=_??t.fn()}catch(C){f=Promise.reject(C)}Promise.resolve(f).then(d).catch(C=>{if(r())return;const w=t.retry??(ev.isServer()?0:3),S=t.retryDelay??Uk,b=typeof S=="function"?S(n,C):S,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,C);if(e||!E){h(C);return}n++,t.onFail?.(n,C),Rk(b).then(()=>c()?void 0:v()).then(()=>{e?h(C):p()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(i?.(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():v().then(p),o)}}var iv=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kk(this.gcTime)&&(this.#e=$l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ev.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&($l.clearTimeout(this.#e),this.#e=void 0)}};function Vk(t){return{onFetch:(e,n)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=p=>{Dk(p,()=>e.signal,()=>u=!0)},h=Zm(e.options,e.fetchOptions),v=async(p,f,_)=>{if(u)return Promise.reject(e.signal.reason);if(f==null&&p.pages.length)return Promise.resolve(p);const w=(()=>{const x={client:e.client,queryKey:e.queryKey,pageParam:f,direction:_?"backward":"forward",meta:e.options.meta};return d(x),x})(),S=await h(w),{maxPages:b}=e.options,E=_?Fk:Ik;return{pages:E(p.pages,S,b),pageParams:E(p.pageParams,f,b)}};if(o&&r.length){const p=o==="backward",f=p?Bk:yh,_={pages:r,pageParams:s},C=f(i,_);a=await v(_,C,p)}else{const p=t??r.length;do{const f=l===0?s[0]??i.initialPageParam:yh(i,a);if(l>0&&f==null)break;a=await v(a,f),l++}while(l<p)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function yh(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function Bk(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Hk=class extends iv{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t){super(),this.#s=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#i=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=wh(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=wh(this.options);e.data!==void 0&&(this.setState(bh(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const n=Mk(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#o?.promise;return this.#o?.cancel(t),e?e.then(gn).catch(gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ak(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ok(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#o&&(this.#s||this.#u()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,i=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},o=()=>{const l=Zm(this.options,e),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#s=!1,this.options.persister?this.options.persister(l,u,this):l(u)},s=(()=>{const l={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return i(l),l})();(this.#e==="infinite"?Vk(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#o=nv({initialPromise:e?.initialPromise,fn:s.fetchFn,onCancel:l=>{l instanceof Al&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const l=await this.#o.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#i.config.onSuccess?.(l,this),this.#i.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Al){if(l.silent)return this.#o.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#i.config.onError?.(l,this),this.#i.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...bh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function qk(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tv(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bh(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wh(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Wk=class extends iv{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Kk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=nv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,s)=>{this.#r({type:"failed",failureCount:r,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const s=await this.options.onMutate?.(t,n);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:o})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,t,this.state.context,this,n),await this.options.onSuccess?.(r,t,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,t,this.state.context,n),this.#r({type:"success",data:r}),r}catch(r){try{await this.#n.config.onError?.(r,t,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(r,t,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,r,t,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#r({type:"error",error:r}),r}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Rt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Kk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ov=class extends Ls{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const o=new Wk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(o),o}add(e){this.#e.add(e);const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=kr(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=kr(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>vh(n,i))}findAll(e={}){return this.getAll().filter(n=>vh(e,n))}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(e.map(n=>n.continue().catch(gn))))}};function kr(t){return t.options.scope?.id}var rv=class extends Ls{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const o=n.queryKey,r=n.queryHash??Rc(o,n);let s=this.get(r);return s||(s=new Hk({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>mh(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>mh(e,i)):n}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Yk=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new rv,this.#t=e.mutationCache||new ov,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Xm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ds.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(kl(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const o=i.data;return[n,o]})}setQueryData(e,n,i){const o=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(o.queryHash)?.state.data,a=$k(n,s);if(a!==void 0)return this.#e.build(this,o).setData(a,{...i,manual:!0})}setQueriesData(e,n,i){return Rt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Rt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Rt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},o=Rt.batch(()=>this.#e.findAll(e).map(r=>r.cancel(i)));return Promise.all(o).then(gn).catch(gn)}invalidateQueries(e,n={}){return Rt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},o=Rt.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,i);return i.throwOnError||(s=s.catch(gn)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(gn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(kl(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gn).catch(gn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gn).catch(gn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ds.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set(zo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(o=>{No(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set(zo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(o=>{No(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Rc(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Mc&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Pl(t,e,n="",i=0){if(e){const o=e(t,n,i);if(o===void 0&&Ss(t)||o!==void 0)return o}if(Array.isArray(t))return t.map((o,r)=>Pl(o,e,String(r),i+1));if(typeof t=="object"&&Qk(t)){const o=Object.entries(t).map(([r,s])=>[r,Pl(s,e,r,i+1)]);return Object.fromEntries(o)}return t}function Gk(t,e){return Pl(t,e)}function qe(t,e=!1){return Gk(t,(n,i,o)=>{if(o===1&&i==="queryKey")return qe(n,!0);if(e&&Xk(n))return qe(n(),e);if(Ss(n))return qe(m(n),e)})}function Qk(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Xk(t){return typeof t=="function"}var Jk=class extends rv{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Zk=class extends ov{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},eO=class extends Yk{constructor(t={}){const e={defaultOptions:t.defaultOptions,queryCache:t.queryCache||new Jk,mutationCache:t.mutationCache||new Zk};super(e),this.isRestoring=H(!1)}isFetching(t={}){return super.isFetching(qe(t))}isMutating(t={}){return super.isMutating(qe(t))}getQueryData(t){return super.getQueryData(qe(t))}ensureQueryData(t){return super.ensureQueryData(qe(t))}getQueriesData(t){return super.getQueriesData(qe(t))}setQueryData(t,e,n={}){return super.setQueryData(qe(t),e,qe(n))}setQueriesData(t,e,n={}){return super.setQueriesData(qe(t),e,qe(n))}getQueryState(t){return super.getQueryState(qe(t))}removeQueries(t={}){return super.removeQueries(qe(t))}resetQueries(t={},e={}){return super.resetQueries(qe(t),qe(e))}cancelQueries(t={},e={}){return super.cancelQueries(qe(t),qe(e))}invalidateQueries(t={},e={}){const n=qe(t),i=qe(e);if(super.invalidateQueries({...n,refetchType:"none"},i),n.refetchType==="none")return Promise.resolve();const o={...n,type:n.refetchType??n.type??"active"};return Ge().then(()=>super.refetchQueries(o,i))}refetchQueries(t={},e={}){return super.refetchQueries(qe(t),qe(e))}fetchQuery(t){return super.fetchQuery(qe(t))}prefetchQuery(t){return super.prefetchQuery(qe(t))}fetchInfiniteQuery(t){return super.fetchInfiniteQuery(qe(t))}prefetchInfiniteQuery(t){return super.prefetchInfiniteQuery(qe(t))}setDefaultOptions(t){super.setDefaultOptions(qe(t))}setQueryDefaults(t,e){super.setQueryDefaults(qe(t),qe(e))}getQueryDefaults(t){return super.getQueryDefaults(qe(t))}setMutationDefaults(t,e){super.setMutationDefaults(qe(t),qe(e))}getMutationDefaults(t){return super.getMutationDefaults(qe(t))}};class Rl extends Error{cause;isNetworkError;request;constructor(e,n=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=n}}class tO{#e;#t=!1;#n;#i;constructor(e,n){this.#i=e,this.#n=()=>n(e)}progress(){this.#t||this.#i>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#n,this.#i))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const Or=()=>{};function nO(t,e={}){const{body:n=null,headers:i={},method:o="GET",onBeforeRequest:r=Or,onUploadProgress:s=Or,shouldRetry:a=()=>!0,onAfterResponse:l=Or,onTimeout:c=Or,responseType:u,retries:d=3,signal:h=null,timeout:v=3e4,withCredentials:p=!1}=e,f=w=>.3*2**(w-1)*1e3,_=new tO(v,c);function C(w=0){return new Promise(async(S,b)=>{const E=new XMLHttpRequest,x=$=>{a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},f(w)):(_.done(),b($))};E.open(o,t,!0),E.withCredentials=p,u&&(E.responseType=u),E.onload=async()=>{try{await l(E,w)}catch($){$.request=E,x($);return}E.status>=200&&E.status<300?(_.done(),S(E)):a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},f(w)):(_.done(),b(new Rl(E.statusText,E)))},E.onerror=()=>x(new Rl(E.statusText,E)),E.upload.onprogress=$=>{_.progress(),s($)},i&&Object.keys(i).forEach($=>{E.setRequestHeader($,i[$])});function O(){E.abort(),b(new DOMException("Aborted","AbortError"))}if(h?.addEventListener("abort",O),h?.aborted){O();return}await r(E,w),E.send(n)})}return C()}const iO=t=>"error"in t&&!!t.error,oO=t=>t.progress.uploadComplete;function rO(t){return t.filter(e=>!iO(e)&&!oO(e))}function sO(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function sv(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const Sh={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function av(t){if(t.type)return t.type;const e=t.name?sv(t.name).extension?.toLowerCase():null;return e&&e in Sh?Sh[e]:"application/octet-stream"}function aO(t){return t.charCodeAt(0).toString(32)}function Ch(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${aO(n)}`,"/"))+e}function lO(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${Ch(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${Ch(t.meta.relativePath.toLowerCase())}`),t.data?.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function cO(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function uO(t,e){if(cO(t))return t.id;const n=av(t);return lO({...t,type:n},e)}function Eh(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function Sa(t){return t<10?`0${t}`:t.toString()}function Xr(){const t=new Date,e=Sa(t.getHours()),n=Sa(t.getMinutes()),i=Sa(t.getSeconds());return`${e}:${n}:${i}`}function dO(t){return t?t.readyState===4&&t.status===0:!1}class hO{#e=[];#t=0;#n;#i=!1;constructor(e){const n=e?.concurrency;this.#n=typeof n!="number"||n===0?1/0:n}add(e){const n=new AbortController;let i,o;const r=new Promise((a,l)=>{i=a,o=l}),s={run:()=>e(n.signal),resolve:i,reject:o,controller:n};return n.signal.addEventListener("abort",()=>{const a=this.#e.indexOf(s);a!==-1&&(this.#e.splice(a,1),o(n.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),r.abort=a=>{n.abort(a??new DOMException("Aborted","AbortError"))},r.abortOn=a=>{if(a){const l=()=>r.abort(a.reason);a.addEventListener("abort",l,{once:!0}),r.then(()=>a.removeEventListener("abort",l),()=>a.removeEventListener("abort",l))}return r},!this.#i&&this.#t<this.#n?this.#r(s):this.#e.push(s),r}#r(e){if(this.#t++,e.controller.signal.aborted){this.#t--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),this.#o();return}let n;try{n=e.run()}catch(i){n=Promise.reject(i)}n.then(i=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(i)},i=>{e.reject(i)}).finally(()=>{this.#t--,this.#o()})}#o(){queueMicrotask(()=>{if(!(this.#i||this.#t>=this.#n))for(;this.#e.length>0;){const e=this.#e.shift();if(!e.controller.signal.aborted){this.#r(e);return}}})}pause(){this.#i=!0}resume(){this.#i=!1;const e=this.#n-this.#t;for(let n=0;n<e;n++)this.#o()}clear(e){const n=this.#e.splice(0),i=e??new DOMException("Cleared","AbortError");for(const o of n)o.controller.abort(i),o.reject(i)}get concurrency(){return this.#n}set concurrency(e){if(this.#n=typeof e!="number"||e===0?1/0:e,!this.#i){const n=this.#n-this.#t;for(let i=0;i<n;i++)this.#o()}}get pending(){return this.#e.length}get running(){return this.#t}get isPaused(){return this.#i}wrapPromiseFunction(e){return(...n)=>this.add(i=>e(...n))}}function fO(t,e,n){const i=[];return t.forEach(o=>typeof o!="string"?i.push(o):e[Symbol.split](o).forEach((r,s,a)=>{r!==""&&i.push(r),s<a.length-1&&i.push(n)})),i}function xh(t,e){const n=/\$/g,i="$$$$";let o=[t];if(e==null)return o;for(const r of Object.keys(e))if(r!=="_"){let s=e[r];typeof s=="string"&&(s=n[Symbol.replace](s,i)),o=fO(o,new RegExp(`%\\{${r}\\}`,"g"),s)}return o}const pO=t=>{throw new Error(`missing string: ${t}`)};class lv{locale;constructor(e,{onMissingKey:n=pO}={}){this.locale={strings:{},pluralize(i){return i===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=n}#e;#t(e){if(!e?.strings)return;const n=this.locale;Object.assign(this.locale,{strings:{...n.strings,...e.strings},pluralize:e.pluralize||n.pluralize})}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(this.#e(e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){const r=this.locale.pluralize(n.smart_count);return xh(i[r],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return xh(i,n)}}class mO{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new lv([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}class vO{#e;#t=[];constructor(e){this.#e=e}on(e,n){return this.#t.push([e,n]),this.#e.on(e,n)}remove(){for(const[e,n]of this.#t.splice(0))this.#e.off(e,n)}onFilePause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onFileRemove(e,n){this.on("file-removed",i=>{e===i.id&&n(i.id)})}onPause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onRetry(e,n){this.on("upload-retry",i=>{e===i?.id&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{this.#e.getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{this.#e.getFile(e)&&n()})}onCancelAll(e,n){this.on("cancel-all",(...i)=>{this.#e.getFile(e)&&n(...i)})}onResumeAll(e,n){this.on("resume-all",()=>{this.#e.getFile(e)&&n()})}}const gO={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${Xr()}]`,...t)},_O={debug:(...t)=>console.debug(`[Uppy] [${Xr()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${Xr()}]`,...t),error:(...t)=>console.error(`[Uppy] [${Xr()}]`,...t)};var Ca,Th;function yO(){return Th||(Th=1,Ca=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const n=e<0;let i=Math.abs(e);if(n&&(i=-i),i===0)return"0 B";const o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(i)/Math.log(1024)),o.length-1),s=Number(i/1024**r),a=o[r];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}),Ca}var bO=yO();const Ar=Li(bO);var Ea,$h;function wO(){if($h)return Ea;$h=1;function t(e,n){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=n,this.parts=e.split(n)}return t.prototype.match=function(e){var n=!0,i=this.parts,o,r=i.length,s;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)n=!1;else{for(s=(e||"").split(this.separator),o=0;n&&o<r;o++)i[o]!=="*"&&(o<s.length?n=i[o]===s[o]:n=!1);n=n&&s}else if(typeof e.splice=="function")for(n=[],o=e.length;o--;)this.match(e[o])&&(n[n.length]=e[o]);else if(typeof e=="object"){n={};for(var a in e)this.match(a)&&(n[a]=e[a])}return n},Ea=function(e,n,i){var o=new t(e,i||/[\/\.]/);return typeof n<"u"?o.match(n):o},Ea}var xa,kh;function SO(){if(kh)return xa;kh=1;var t=wO(),e=/[\/\+\.]/;return xa=function(n,i){function o(r){var s=t(r,n,e);return s&&s.length>=2}return i?o(i.split(";")[0]):o},xa}var CO=SO();const EO=Li(CO),xO={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class _n extends Error{isUserFacing;file;constructor(e,n){super(e),this.isUserFacing=n?.isUserFacing??!0,n?.file&&(this.file=n.file)}isRestriction=!0}class TO{getI18n;getOpts;constructor(e,n){this.getI18n=n,this.getOpts=()=>{const i=e();if(i.restrictions?.allowedFileTypes!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:i,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(s=>!s.isGhost).length+n.length>o)throw new _n(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(i){const r=[...e,...n].reduce((s,a)=>s+(a.size??0),0);if(r>i)throw new _n(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Ar(i),size:Ar(r)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:i,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?e.type?EO(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){const s=o.join(", ");throw new _n(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(n&&e.size!=null&&e.size>n)throw new _n(this.getI18n()("exceedsSize",{size:Ar(n),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&e.size!=null&&e.size<i)throw new _n(this.getI18n()("inferiorSize",{size:Ar(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new _n(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){const n=new _n(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,o=[];for(const r of i)(!Object.hasOwn(e.meta,r)||e.meta[r]==="")&&o.push(r);return{missingFields:o,error:n}}}const $O="5.0.0",kO={version:$O};class OO{static VERSION=kO.version;state={};#e=new Set;getState(){return this.state}setState(e){const n={...this.state},i={...this.state,...e};this.state=i,this.#t(n,i,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(n=>{n(...e)})}}var Ta,Oh;function Ic(){if(Oh)return Ta;Oh=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Ta=t,Ta}var $a,Ah;function AO(){if(Ah)return $a;Ah=1;var t=typeof gr=="object"&&gr&&gr.Object===Object&&gr;return $a=t,$a}var ka,Ph;function cv(){if(Ph)return ka;Ph=1;var t=AO(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return ka=n,ka}var Oa,Rh;function PO(){if(Rh)return Oa;Rh=1;var t=cv(),e=function(){return t.Date.now()};return Oa=e,Oa}var Aa,Mh;function RO(){if(Mh)return Aa;Mh=1;var t=/\s/;function e(n){for(var i=n.length;i--&&t.test(n.charAt(i)););return i}return Aa=e,Aa}var Pa,Ih;function MO(){if(Ih)return Pa;Ih=1;var t=RO(),e=/^\s+/;function n(i){return i&&i.slice(0,t(i)+1).replace(e,"")}return Pa=n,Pa}var Ra,Fh;function uv(){if(Fh)return Ra;Fh=1;var t=cv(),e=t.Symbol;return Ra=e,Ra}var Ma,Dh;function IO(){if(Dh)return Ma;Dh=1;var t=uv(),e=Object.prototype,n=e.hasOwnProperty,i=e.toString,o=t?t.toStringTag:void 0;function r(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=i.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Ma=r,Ma}var Ia,Lh;function FO(){if(Lh)return Ia;Lh=1;var t=Object.prototype,e=t.toString;function n(i){return e.call(i)}return Ia=n,Ia}var Fa,jh;function DO(){if(jh)return Fa;jh=1;var t=uv(),e=IO(),n=FO(),i="[object Null]",o="[object Undefined]",r=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:i:r&&r in Object(a)?e(a):n(a)}return Fa=s,Fa}var Da,zh;function LO(){if(zh)return Da;zh=1;function t(e){return e!=null&&typeof e=="object"}return Da=t,Da}var La,Nh;function jO(){if(Nh)return La;Nh=1;var t=DO(),e=LO(),n="[object Symbol]";function i(o){return typeof o=="symbol"||e(o)&&t(o)==n}return La=i,La}var ja,Uh;function zO(){if(Uh)return ja;Uh=1;var t=MO(),e=Ic(),n=jO(),i=NaN,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return i;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var d=r.test(c);return d||s.test(c)?a(c.slice(2),d?2:8):o.test(c)?i:+c}return ja=l,ja}var za,Vh;function NO(){if(Vh)return za;Vh=1;var t=Ic(),e=PO(),n=zO(),i="Expected a function",o=Math.max,r=Math.min;function s(a,l,c){var u,d,h,v,p,f,_=0,C=!1,w=!1,S=!0;if(typeof a!="function")throw new TypeError(i);l=n(l)||0,t(c)&&(C=!!c.leading,w="maxWait"in c,h=w?o(n(c.maxWait)||0,l):h,S="trailing"in c?!!c.trailing:S);function b(I){var q=u,le=d;return u=d=void 0,_=I,v=a.apply(le,q),v}function E(I){return _=I,p=setTimeout($,l),C?b(I):v}function x(I){var q=I-f,le=I-_,de=l-q;return w?r(de,h-le):de}function O(I){var q=I-f,le=I-_;return f===void 0||q>=l||q<0||w&&le>=h}function $(){var I=e();if(O(I))return K(I);p=setTimeout($,x(I))}function K(I){return p=void 0,S&&u?b(I):(u=d=void 0,v)}function F(){p!==void 0&&clearTimeout(p),_=0,u=f=d=p=void 0}function P(){return p===void 0?v:K(e())}function N(){var I=e(),q=O(I);if(u=arguments,d=this,f=I,q){if(p===void 0)return E(f);if(w)return clearTimeout(p),p=setTimeout($,l),b(f)}return p===void 0&&(p=setTimeout($,l)),v}return N.cancel=F,N.flush=P,N}return za=s,za}var Na,Bh;function UO(){if(Bh)return Na;Bh=1;var t=NO(),e=Ic(),n="Expected a function";function i(o,r,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,r,{leading:a,maxWait:r,trailing:l})}return Na=i,Na}var VO=UO();const BO=Li(VO);var Ua,Hh;function HO(){return Hh||(Hh=1,Ua=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,u,d,h){var v=i(s);v.length&&o(s,v,[a,l,c,u,d,h])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==a&&l.push(c[u])}l.length?this._fns[s]=l:delete this._fns[s]};function i(r){var s=n[r]?n[r]:[],a=r.indexOf(":"),l=a===-1?[r]:[r.substring(0,a),r.substring(a+1)],c=Object.keys(n),u=0,d=c.length;for(u;u<d;u++){var h=c[u];if(h==="*"&&(s=s.concat(n[h])),l.length===2&&l[0]===h){s=s.concat(n[h]);break}}return s}function o(r,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=r,s[l].apply(s[l],a)}return e}),Ua}var qO=HO();const WO=Li(qO);let KO="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",YO=(t=21)=>{let e="",n=t|0;for(;n--;)e+=KO[Math.random()*64|0];return e};const GO="5.2.0",QO={version:GO};function XO(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const JO={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function ZO(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const i=e[1].split(".",2),o=parseInt(i[0],10),r=parseInt(i[1],10);return o<15||o===15&&r<15063||o>18||o===18&&r>=18218}const Pr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class Fc{static VERSION=QO.version;#e=Object.create(null);#t;#n;#i=WO();#r=new Set;#o=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=JO;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:xO,meta:{},onBeforeFileAdded:(o,r)=>!Object.hasOwn(r,o.id),onBeforeUpload:o=>o,store:new OO,logger:gO,infoTimeout:5e3},i={...n,...e};this.opts={...i,restrictions:{...n.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=_O),this.log(`Using Core v${Fc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:ZO(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new TO(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((o,r,s)=>{this.emit("state-update",o,r,s),this.updateAll(r)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#x()}emit(e,...n){this.#i.emit(e,...n)}on(e,n){return this.#i.on(e,n),this}once(e,n){return this.#i.once(e,n),this}off(e,n){return this.#i.off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(([i,o])=>[i,{...n[i],...o}]))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new lv([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},i=Object.create(null);Object.keys(n).forEach(o=>{i[o]={...n[o],progress:{...n[o].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...Pr})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pr,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#o.add(e)}removeUploader(e){return this.#o.delete(e)}setMeta(e){const n={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(o=>{i[o]={...i[o],meta:{...i[o].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){const i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const o={...i[e].meta,...n};i[e]={...i[e],meta:o},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:i}=this.getState(),o=Object.values(e),r=[],s=[],a=[],l=[],c=[],u=[],d=[],h=[],v=[];for(const p of o){const{progress:f}=p;!f.uploadComplete&&f.uploadStarted&&(r.push(p),p.isPaused||h.push(p)),f.uploadStarted||s.push(p),(f.uploadStarted||f.preprocess||f.postprocess)&&a.push(p),f.uploadStarted&&l.push(p),p.isPaused&&c.push(p),f.uploadComplete&&u.push(p),p.error&&d.push(p),(f.preprocess||f.postprocess)&&v.push(p)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:n===100&&u.length===o.length&&v.length===0,isAllErrored:!!i&&d.length===o.length,isAllPaused:r.length!==0&&c.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:o.some(p=>p.isGhost)}}#s(e){for(const s of e)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const n=e.filter(s=>s.isUserFacing),i=4,o=n.slice(0,i),r=n.slice(i);o.forEach(({message:s,details:a=""})=>{this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,n=this.getFiles()){try{this.#t.validate(n,[e])}catch(i){return i}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{this.#t.validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}#u(e){const{missingFields:n,error:i}=this.#t.getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#l(e){let n=!0;for(const i of Object.values(e))this.#u(i)||(n=!1);return n}#w(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new _n(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([i]),i}}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}#S(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=av(n),o=XO(i,n),r=sv(o).extension,s=uO(n,this.getID()),a={...n.meta,name:o,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:s,name:o,extension:r||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}}#p(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#m(e){let{files:n}=this.getState(),i={...n};const o=[],r=[];for(const s of e)try{let a=this.#S(s);this.#w(a);const l=n[a.id],c=l?.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const u=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!u&&this.checkIfFileAlreadyExists(a.id))throw new _n(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(u===!1&&!c)throw new _n("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof u=="object"&&u!==null&&(a=u),this.#t.validateSingleFile(a),i[a.id]=a,o.push(a)}catch(a){r.push(a)}try{this.#t.validateAggregateRestrictions(Object.values(n),o)}catch(s){return r.push(s),{nextFilesState:n,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:o,errors:r}}addFile(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m([e]),r=o.filter(a=>a.isRestriction);if(this.#s(r),o.length>0)throw o[0];this.setState({files:n});const[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#p(),s.id}addFiles(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m(e),r=o.filter(a=>a.isRestriction);this.#s(r);const s=o.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
16
+ err: ${o}`);return}}return t}function wm(t,e){return JSON.parse(t,function(n,i){return pe.Undef(i)||!i.indexOf?i:Dn(i,e)})}let Dx=0;function Ps(){const t=370+ ++Dx;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function fi(t,e,n){let i=t,o;return(e||"").split(".").forEach(r=>{o&&((!i[o]||typeof i[o]!="object")&&(i[o]={}),i=i[o]),o=r}),i[o]=n,i}const Lx="fcGroup",jx=Ce({name:Lx,props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:()=>[]},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},formCreateInject:Object,parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:Gn(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler(t,e){Object.keys(this.cacheRule).forEach(n=>{const i=this.cacheRule[n];if(i.$f){const o=i.$f.formData();if(t===e)i.$f.deferSyncValue(()=>{ir(i.rule,t),i.$f.setValue(o)},!0);else{const r=i.$f.formData();i.$f.once("reloading",()=>{i.$f.setValue(r)}),i.rule=Mn(t)}}})},deep:!0},expand(t){let e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler(t){t=t||[];let e=this.sort,n=e.length,i=n-t.length;if(i<0){for(let o=i;o<0;o++)this.addRule(t.length+o,!0);for(let o=0;o<n;o++)this.setValue(e[o],t[o])}else{if(i>0)for(let o=0;o<i;o++)this.removeRule(e[n-o-1]);t.forEach((o,r)=>{this.setValue(e[r],t[r])})}},deep:!0}},methods:{_value(t){return t&&lt(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData(t,e){const n=this.cacheRule,i=this.sort;if(i.filter(r=>n[r]&&n[r].$f).length!==i.length)return;const o=i.map(r=>{const s=t===r?e:Te({},this.cacheRule[r].$f.form),a=this.field?pe.Undef(s[this.field])?null:s[this.field]:s;return this.cache(r,a),a});this.input(o)},setValue(t,e){const n=this.field;n&&(e={[n]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(n?e[n]:e)&&(this.cacheRule[t].$f&&this.cacheRule[t].$f.coverValue(e),this.cache(t,e))},addRule(t,e){const n=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?Te({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});const o=Mn(this.defaultValue);Fe(i.formData,this.field?{[this.field]:o}:o)}this.parse&&this.parse({rule:n,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:n,options:i},this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("add",n,Object.keys(this.cacheRule).length-1))},add$f(t,e,n){this.cacheRule[e].$f=n,Ge(()=>{this.$emit("itemMounted",n,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const n=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],this.sort=Object.keys(this.cacheRule),e&&Ge(()=>this.$emit("remove",n))},add(t){if(this.disabled||this.onBeforeAdd(this.modelValue)===!1)return;const e=[...this.modelValue];e.push(this.defaultValue?Mn(this.defaultValue):this.field?null:{}),this.input(e)},del(t,e){if(this.disabled)return;const n=()=>{this.removeRule(e,!0);const i=[...this.modelValue];i.splice(t,1),this.input(i)};as(this.onBeforeRemove(this.modelValue,t)).then(i=>{i!==!1&&n()})},addIcon(t){return j("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon(t,e){return j("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:()=>this.del(t,e)},null)},sortUpIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:()=>this.changeSort(t,-1)},null)},sortDownIcon(t){return j("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:()=>this.changeSort(t,1)},null)},changeSort(t,e){const n=this.sort[t];this.sort[t]=this.sort[t+e],this.sort[t+e]=n,this.formCreateInject.subForm(this.sort.map(i=>this.cacheRule[i].$f)),this.formData(0)},sortIcon(t,e){const n=t>0,i=t<e-1,o=[];return!n&&!i?o:this.type==="card"&&n&&i?(o.push(j("div",{class:"_fc-group-btn _fc-group-sort"},[j("div",{class:" _fc-group-sort-up",onClick:()=>this.changeSort(t,-1)},null),j("div",{class:" _fc-group-sort-down",onClick:()=>this.changeSort(t,1)},null)])),o):(n&&o.push(this.sortUpIcon(t)),i&&o.push(this.sortDownIcon(t)),o)},makeIcon(t,e,n){if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:n,del:()=>this.del(e,n),add:this.add});const i=[];if((!this.max||t<this.max)&&t===e+1&&i.push(this.addIcon(n)),t>this.min&&i.push(this.delIcon(e,n)),this.sortBtn){const o=this.sortIcon(e,t);o&&i.push(...o)}return i},expandRule(t){for(let e=0;e<t;e++)this.modelValue.push(this.field?null:{});this.input([...this.modelValue])},getTitle(t,e){return typeof this.title=="function"?this.title(t,this.modelValue[t],e):typeof this.title=="string"?this.title.replace("{index}",t+1):!1}},created(){const t=(this.expand||0)-this.modelValue.length;for(let e=0;e<this.modelValue.length;e++)this.addRule(e);t>0&&this.expandRule(t)},render(){const t=this.sort,e=this.button,n=this.form,i=this.disabled,o=this.type==="card",r=t.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):j("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((s,a)=>{const{rule:l,options:c}=this.cacheRule[s],u=e&&!i?this.makeIcon(t.length,a,s):[],d=this.getTitle(a,s);return o?j("div",{class:"_fc-group-container",key:s},[j("div",{class:"_fc-group-header"},[d===!1?j("div",{class:"_fc-group-idx"},[a+1]):null,d!==!1?j("div",{class:"_fc-group-title"},[d]):null,j("div",{class:"_fc-group-handle fc-clock"},[u.length?u:null])]),j("div",{class:"_fc-group-content"},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null)])]):j("div",{class:"_fc-group-container",key:s},[j(n,We({key:s},en(Te({},this.$attrs),{disabled:i,"onUpdate:modelValue":h=>this.formData(s,h),"onUpdate:api":h=>this.add$f(a,s,h),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:c,extendOption:!0})),null),j("div",{class:"_fc-group-idx"},[a+1]),u.length?j("div",{class:"_fc-group-handle fc-clock"},[u]):null])});return j("div",{key:"con",class:"_fc-group "+(i?"_fc-group-disabled":"")+(o?" _fc-group-card":"")},[r])}}),zx="fcSubForm",Nx=Ce({name:zx,props:{rule:Array,options:{type:Object,default:()=>Mt({submitBtn:!1,resetBtn:!1})},modelValue:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data(){return{cacheValue:{},subApi:{},form:Gn(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f(t){this.subApi=t,Ge(()=>{this.$emit("itemMounted",t)})}},render(){const t=this.form;return j(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),Ux={name:"IconWarning"},Vx={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function Bx(t,e,n,i,o,r){return y(),T("svg",Vx,[...e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)])])}const Hx=gi(Ux,[["render",Bx]]),qx=[G2,gx,yx,Cx,xx,Rx,jx,Nx,Hx],Sm=["props"],Cm=["class","style","directives"],Em=["on","hook"],Qn=(t,e={},n={})=>{const i=[...Sm,...n.normal||[]],o=[...Cm,...n.array||[]],r=[...Em,...n.functional||[]],s=n.props||[];return t.reduce((a,l)=>{for(const c in l)if(a[c])if(s.indexOf(c)>-1)a[c]=Qn([l[c]],a[c]);else if(i.indexOf(c)>-1)a[c]=Te(Te({},a[c]),l[c]);else if(o.indexOf(c)>-1){const u=a[c]instanceof Array?a[c]:[a[c]],d=l[c]instanceof Array?l[c]:[l[c]];a[c]=[...u,...d]}else if(r.indexOf(c)>-1)for(const u in l[c])if(a[c][u]){const d=a[c][u]instanceof Array?a[c][u]:[a[c][u]],h=l[c][u]instanceof Array?l[c][u]:[l[c][u]];a[c][u]=[...d,...h]}else a[c][u]=l[c][u];else if(c==="hook")for(let u in l[c])a[c][u]?a[c][u]=Wx(a[c][u],l[c][u]):a[c][u]=l[c][u];else a[c]=l[c];else i.indexOf(c)>-1||r.indexOf(c)>-1||s.indexOf(c)>-1?a[c]=Te({},l[c]):o.indexOf(c)>-1?a[c]=l[c]instanceof Array?[...l[c]]:typeof l[c]=="object"?Te({},l[c]):l[c]:a[c]=l[c];return a},e)},Wx=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},xm=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],Cc=["validate","children","control"],Ec=["effect","deep","renderSlots"];function Tm(){return[...xm,...Sm,...Cm,...Em,...Cc,...Ec]}function Vt(t){const e=t.replace(/(-[a-z])/g,function(n){return n.replace("-","").toLocaleUpperCase()});return $m(e)}function $m(t){return t.replace(t[0],t[0].toLowerCase())}function yl(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!0}}function km(t,e){return Om([t],e||!1)[0]}function Om(t,e){return ir([],[...t],e||!1)}function Zn(t,e){return Qn(Array.isArray(e)?e:[e],t,{array:Cc,normal:Ec}),t}function Wd(t){const e=pe.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function Kx(t,e){return t?(Object.keys(e||{}).forEach(n=>{e[n]&&(t[n]=Zn(t[n]||{},e[n]))}),t):e}function Am(t,e){Object.defineProperties(t,Object.keys(e).reduce((n,i)=>(n[i]={get(){return e[i]()}},n),{}))}function On(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function Be(t,e){try{e=t()}catch(n){Fx(n)}return e}function wr(){const t={},e=n=>n||"default";return{setSlot(n,i){n=e(n),!(!i||Array.isArray(i)&&i.length)&&(t[n]||(t[n]=[]),t[n].push(i))},getSlot(n,i){n=e(n);const o=[];return(t[n]||[]).forEach(r=>{if(Array.isArray(r))o.push(...r);else if(pe.Function(r)){const s=r(...i||[]);Array.isArray(s)?o.push(...s):o.push(s)}else pe.Undef(r)||o.push(r)}),o},getSlots(){const n={};return Object.keys(t).forEach(i=>{n[i]=(...o)=>this.getSlot(i,o)}),n},slotLen(n){return n=e(n),t[n]?t[n].length:0},mergeBag(n){if(!n)return this;const i=pe.Function(n.getSlots)?n.getSlots():n;return Array.isArray(n)||Ui(n)?this.setSlot(void 0,()=>n):Object.keys(i).forEach(o=>{this.setSlot(o,i[o])}),this}}}function Kd(t){const e=Te({},t.props||{});return Object.keys(t.on||{}).forEach(n=>{n.indexOf("-")>0&&(n=Vt(n));const i=`on${ym(n)}`;Array.isArray(e[i])?e[i]=[...e[i],t.on[n]]:e[i]?e[i]=[e[i],t.on[n]]:e[i]=t.on[n]}),e.key=t.key,e.ref=t.ref,e.class=t.class,e.id=t.id,e.style=t.style,e.slot&&delete e.slot,e}function Sr(t,e){return Object.setPrototypeOf(t,e),t}const Yd=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e,Ai={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Yd(t,e)),"!=":(t,e)=>!Ai["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Yd(t[0],e))>-1},notOn(t,e){return!Ai.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!Ai.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return pe.empty(t)},notEmpty(t){return!pe.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)}};function Pt(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(n=>{t!=null&&(t=t[n])}),t}function Yx(t){const e=/{{\s*(.*?)\s*}}/g;let n;const i={};for(;(n=e.exec(t))!==null;)n[1]&&(i[n[1]]=!0);return Object.keys(i)}function Gd(t){let e=t.split("."),n=[],i="";return e.forEach((o,r)=>{r===0?i=o:i+="."+o,n.push(i)}),n.join(" && ")}function Pm(t){const e=[];let n="",i=0;for(let o=0;o<t.length;o++){const r=t[o];r==="["?(i===0&&n&&(e.push({type:"key",value:n}),n=""),i++,n+=r):r==="]"?(i--,n+=r,i===0&&(e.push({type:"bracket",value:Pm(n.slice(1,-1))}),n="")):r==="."&&i===0?n&&(e.push({type:"key",value:n}),n=""):n+=r}return n&&e.push({type:"key",value:n}),e.map(o=>o.type==="key"?{key:o.value}:{children:o.value})}const Yr=(t,e)=>{if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return Yr(t.parent,e)}};function Gx(t,e,n){return Ce({name:"FormCreate"+(t.isMobile?"Mobile":""),components:e,directives:n,props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","beforeUnmount","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render(){return this.fc.render()},setup(i){const o=Za();Hp("parentFC",o);const r=Ao("parentFC",null);let s=r;if(r)for(;s.setupState.parent;)s=s.setupState.parent;else s=o;const{rule:a,modelValue:l,subForm:c,inFor:u}=Ja(i),d=Mt({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...a.value||[]],updateValue:JSON.stringify(l.value||{})}),h=new t(o),m=h.api(),f=u.value,p=()=>{if(r){const x=Yr(o,r);if(x){let O;f?(O=Ut(x.getSubForm()),O.push(m)):O=m,x.subForm(O)}}},_=()=>{const x=Yr(o,r);if(x)if(f){const O=Ut(x.getSubForm()),$=O.indexOf(m);$>-1&&O.splice($,1)}else x.subForm()};let C=null;w_(()=>{zt(()=>{let x="";const O=i.option&&i.option.globalClass||{};Object.keys(O).forEach($=>{let K="";O[$].style&&Object.keys(O[$].style).forEach(F=>{K+=Do(F)+":"+O[$].style[F]+";"}),O[$].content&&(K+=O[$].content+";"),K&&(x+=`.${$}{${K}}`)}),i.option&&i.option.style&&(x+=i.option.style),C||(C=document.createElement("style"),C.type="text/css",document.head.appendChild(C)),C.innerHTML=x||""})});const w=ci(()=>{h.bus.$emit("$loadData.$topForm")},100),S=ci(function(){h.bus.$emit("$loadData.$scopeForm")},100),b=ci(()=>{h.bus.$emit("$loadData.$form")},100),E=x=>{h.bus.$emit("change-$form."+x)};return et(()=>{r&&(m.top.bus.$on("$loadData.$form",w),m.top.bus.$on("change",E)),m!==m.scope&&m.scope.bus.$on("$loadData.$scopeForm",S),h.mounted()}),bs(()=>{r&&(m.top.bus.$off("$loadData.$form",w),m.top.bus.$off("change",E)),m!==m.scope&&m.scope.bus.$off("$loadData.$scopeForm",S),_(),d.destroyed=!0,h.unmount(),C&&(C.parentNode||C.parentElement)&&document.head.removeChild(C)}),Bp(()=>{h.updated()}),p(),$e(()=>i.option,()=>{h.initOptions(),m.refresh()},{deep:!0,flush:"sync"}),$e(()=>[...a.value],x=>{h.$handle.isBreakWatch()||x.length===d.renderRule.length&&x.every(O=>d.renderRule.indexOf(O)>-1)||(h.$handle.updateAppendData(),h.$handle.reloadRule(a.value),o.setupState.renderRule())}),$e(()=>[i.disabled,i.preview],()=>{m.refresh()}),$e(l,x=>{Lo(x||{})!==d.updateValue&&(m.config.forceCoverValue?m.coverValue(x||{}):m.setValue(x||{}))},{deep:!0,flush:"post"}),$e(()=>i.index,()=>{m.coverValue({}),h.$handle.updateAppendData(),Ge(()=>{Ge(()=>{m.clearValidateState()})})},{flush:"sync"}),en(Te({fc:Gn(h),parent:r&&Gn(r),top:Gn(s),fapi:Gn(m)},Ja(d)),{getGroupInject:()=>Yr(o,r),refresh(){++d.unique},renderRule(){d.renderRule=[...a.value||[]]},updateValue(x){if(d.destroyed)return;const O=Lo(x);d.updateValue!==O&&(d.updateValue=O,o.emit("update:modelValue",x),Ge(()=>{b(),r?c.value||S():(w(),S())}))}})},created(){const i=Za();i.emit("update:api",i.setupState.fapi),i.setupState.fc.init()}})}function Rm(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function Et(t,e){return(n,i,o,r={})=>{const s=new xc(t,n,i,o,r);return e&&(pe.Function(e)?e(s):s.props(e)),s}}function xc(t,e,n,i,o){this._data=Fe(Rm(),{type:t,title:e,field:n,value:i,props:o||{}}),this.event=this.on}Fe(xc.prototype,{getRule(){return this._data},setProp(t,e){return an(this._data,t,e),this},modelField(t){return this._data.modelField=t,this},_clone(){const t=new this.constructor;return t._data=km(this._data),t}});function Im(t){t.forEach(e=>{xc.prototype[e]=function(n){return Zn(this._data,{[e]:arguments.length<2?n:{[n]:arguments[1]}}),this}})}Im(Tm());const Qx=Et("");function Xx(t,e,n){let i=Qx("",e);return i._data.type=t,i._data.title=n,i}function Jx(){return{create:Xx,factory:Et}}function Zx(t,e,n){const i=`fail to ${t} ${n.status}'`,o=new Error(i);return o.status=n.status,o.url=t,o}function Qd(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}function Mm(t){if(typeof XMLHttpRequest>"u")return;const e=new XMLHttpRequest;let n=t.action||"";if(e.upload&&t.onProgress&&e.upload.addEventListener("progress",r=>{r.percent=r.total>0?r.loaded/r.total*100:0,t.onProgress(r)}),t.query){const r=pe.String(t.query)?t.query:Object.keys(t.query).reduce((a,l)=>(a[l]=t.query[l]===null||t.query[l]===void 0?"":t.query[l],a),{}),s=new URLSearchParams(r).toString();s&&(n.includes("?")?n+=`&${s}`:n+=`?${s}`)}e.onerror=function(r){t.onError(r)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(Zx(n,t,e),Qd(e));t.onSuccess(Qd(e))},e.open(t.method||"get",n,!0);let i;(t.data||t.file)&&(t.file||(t.dataType||"").toLowerCase()!=="json"?(i=new FormData,Object.keys(t.data||{}).map(r=>{i.append(r,t.data[r])})):(i=JSON.stringify(t.data||{}),e.setRequestHeader("content-type","application/json"))),t.file&&i.append(t.filename,t.file,t.file.name),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};Object.keys(o).forEach(r=>{o[r]!=null&&e.setRequestHeader(r,o[r])}),e.send(i)}function Xd(t,e,n){return new Promise((i,o)=>{(e||Mm)(en(Te({},t),{onSuccess(r){let s=l=>l;const a=Dn(t.parse);pe.Function(a)?s=a:a&&pe.String(a)&&(s=l=>Pt(l,a)),as(s(r,t.targetRule,n)).then(l=>{i(l)})},onError(r){o(r)}}))})}function So(t){return Mn(t)}function eT(t){function e(r){return pe.Undef(r)?r=t.fields():Array.isArray(r)||(r=[r]),r}function n(r,s,a){pe.Undef(r)?r=Object.keys(Te(Te({},t.fieldCtx),t.nameCtx)):Array.isArray(r)||(r=[r]),r.forEach(l=>{const c=t.fieldCtx[l]||t.nameCtx[l];c&&c.forEach(u=>{an(u.rule,s,a),t.$render.clearCache(u)})})}function i(){const r=t.subForm;return Object.keys(r).reduce((s,a)=>{const l=r[a];return l&&(Array.isArray(l)?s.push(...l):s.push(l)),s},[])}const o={get isScope(){return t.vm.props.subForm===!1},get isPreview(){return t.preview},get config(){return t.options},set config(r){t.fc.options.value=r},get options(){return t.options},set options(r){t.fc.options.value=r},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.setupState.parent&&t.vm.setupState.parent.setupState.fapi},get top(){return o.parent?o.parent.top:o},get scope(){let r=t.vm;for(;r&&r.setupState.fapi;)if(r.props.subForm)r=r.setupState.parent;else return r.setupState.fapi;return o.top},get children(){return i()},get siblings(){const r=t.vm.setupState.getGroupInject();if(r){const s=r.getSubForm();if(Array.isArray(s))return[...s]}},get index(){const r=o.siblings;if(r){const s=r.indexOf(o);return s>-1?s:void 0}},get formulas(){return Te({},t.fc.formulas)},formData(r){if(r==null||typeof r=="boolean"){const s={};return Object.keys(t.form).forEach(a=>{(r===!0||t.ignoreFields.indexOf(a)===-1)&&(s[a]=So(t.form[a]))}),s}else return e(r).reduce((s,a)=>(s[a]=o.getValue(a),s),{})},getValue(r){const s=t.getFieldCtx(r);return s?So(s.rule.value):t.options.appendValue!==!1&&lt(t.appendData,r)?So(t.appendData[r]):void 0},coverValue(r){const s=Te({},r||{});t.deferSyncValue(()=>{t.appendData={},o.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const c=lt(r,a);l.forEach(u=>{u.rule.value=c?r[a]:void 0}),delete s[a]}}),Fe(t.appendData,s)},!0)},setValue(r){let s=r;arguments.length>=2&&(s={[r]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(s).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=s[a];l.forEach(c=>{c.rule.value=s[a]})})},!0)},removeField(r){const s=t.getCtx(r);return t.deferSyncValue(()=>{t.getCtxs(r).forEach(a=>{a.rm()})},!0),s?s.origin:void 0},removeRule(r){const s=r&&On(r);if(s)return s.rm(),s.origin},fields:()=>t.fields(),append:(r,s,a)=>{let l=t.sort.length-1,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return;l=u.rule.children.length-1}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l+1,0,r)},prepend:(r,s,a)=>{let l=0,c;const u=t.getCtx(s);if(u)if(a){if(c=u.getPending("children",u.rule.children),!Array.isArray(c))return}else l=u.root.indexOf(u.origin),c=u.root;else c=t.rules;c.splice(l,0,r)},hidden(r,s){n(s,"hidden",!!r),t.refresh()},hiddenStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.hidden},display(r,s){n(s,"display",!!r),t.refresh()},displayStatus(r){const s=t.getCtx(r);if(s)return!!s.rule.display},disabled(r,s){e(s).forEach(a=>{t.getCtxs(a).forEach(l=>{an(l.rule.props,"disabled",!!r)})}),t.refresh()},all(r){return Object.keys(t.ctxs).map(s=>{const a=t.ctxs[s];return r?a.origin:a.rule})},model(r){return t.fields().reduce((s,a)=>{const l=t.fieldCtx[a][0];return s[a]=r?l.origin:l.rule,s},{})},component(r){return Object.keys(t.nameCtx).reduce((s,a)=>{const l=t.nameCtx[a].map(c=>r?c.origin:c.rule);return s[a]=l.length===1?l[0]:l,s},{})},bind(){return o.form},reload:r=>{t.reloadRule(r)},updateOptions(r){t.fc.updateOptions(r),o.refresh()},onSubmit(r){o.updateOptions({onSubmit:r})},sync:r=>{if(Array.isArray(r)){r.forEach(a=>o.sync(a));return}let s=pe.Object(r)?On(r):t.getCtxs(r);s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(c=>{c.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{i().forEach(r=>{r.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),o.refresh()},hideForm:r=>{t.vm.setupState.isShow=!r},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(r,s){t.getCtxs(r).forEach(a=>{Fe(a.rule,s)})},updateRules(r){Object.keys(r).forEach(s=>{o.updateRule(s,r[s])})},mergeRule:(r,s)=>{t.getCtxs(r).forEach(a=>{Zn(a.rule,s)})},mergeRules(r){Object.keys(r).forEach(s=>{o.mergeRule(s,r[s])})},getRule:(r,s)=>{const a=t.getCtx(r);if(a)return s?a.origin:a.rule},findType(r,s){let a;return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&(a=s?c.origin:c.rule)}),a},findTypes(r,s){let a=[];return Object.keys(t.ctxs).forEach(l=>{const c=t.ctxs[l];c.rule.type===r&&a.push(s?c.origin:c.rule)}),a},getRenderRule:r=>{const s=t.getCtx(r);if(s)return s.prop},getRefRule:r=>{const s=t.getCtxs(r);if(s){const a=s.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(r,s,a){const l=t.getCtx(r);l&&s&&(s[0]==="$"&&(s=s.substr(1)),lt(l.rule,"$"+s)&&an(l.rule,"$"+s,a),lt(l.rule,"effect")||(l.rule.effect={}),an(l.rule.effect,s,a))},clearEffectData(r,s){const a=t.getCtx(r);a&&(s&&s[0]==="$"&&(s=s.substr(1)),a.clearEffectData(s),o.sync(r))},updateValidate(r,s,a){a?o.mergeRule(r,{validate:s}):n(r,"validate",s)},updateValidates(r,s){Object.keys(r).forEach(a=>{o.updateValidate(a,r[a],s)})},refreshValidate(){o.refresh()},resetFields(r){e(r).forEach(s=>{t.getCtxs(s).forEach(a=>{t.$render.clearCache(a),a.rule.value=So(a.defaultValue)})}),Ge(()=>{Ge(()=>{Ge(()=>{o.clearValidateState(r)})})}),r==null&&(pe.Function(t.options.onReset)&&Be(()=>t.options.onReset(o)),t.vm.emit("reset",o))},method(r,s){const a=o.el(r);if(!a||!a[s])throw new Error(bm("err",`${s} 方法不存在`));return(...l)=>a[s](...l)},exec(r,s,...a){return Be(()=>o.method(r,s)(...a))},toJson(r){return Lo(o.rule,r)},trigger(r,s,...a){const l=o.el(r);l&&l.$emit(s,...a)},el(r){const s=t.getCtx(r);if(s)return s.el||t.vm.refs[s.ref]},scrollTo(r,s={block:"center",inline:"nearest",behavior:"smooth"}){const a=o.el(r);if(!a)return;const l=a.$el!==void 0?a.$el:a;if(!l)return;const c=l.nodeType===1?l:l.firstElementChild;c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView(s)},focus(r){const s=o.el(r);if(!s)return;const a=d=>!d||typeof d.focus!="function"?!1:(Be(()=>d.focus()),!0);if(a(s))return;const l=s.$el!==void 0?s.$el:s;if(a(l))return;const c=l&&(l.nodeType===1?l:l.firstElementChild);if(a(c)||!c||!c.querySelector)return;const u=c.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');a(u)},closeModal:r=>{t.bus.$emit("fc:closeModal:"+r)},getSubForm(r){const s=t.getCtx(r);return s?t.subForm[s.id]:void 0},getChildrenRuleList(r){const s=typeof r=="object",a=s?On(r):t.getCtx(r),l=a?a.rule:s?r:o.getRule(r);if(!l)return[];const c=[];return(u=>{u&&u.forEach(d=>{typeof d=="object"&&(d.field&&c.push(d),c.push(...o.getChildrenRuleList(d)))})})(a?a.loadChildrenPending():l.children),c},getParentRule(r){return(typeof r=="object"?On(r):t.getCtx(r)).parent.rule},getParentSubRule(r){const s=typeof r=="object"?On(r):t.getCtx(r);if(s){const a=s.getParentGroup();if(a)return a.rule}},getChildrenFormData(r,s){return o.getChildrenRuleList(r).reduce((a,l)=>((l.ignore!==!0||s===!0)&&(a[l.field]=So(l.value)),a),{})},setChildrenFormData(r,s,a){const l=o.getChildrenRuleList(r);t.deferSyncValue(()=>{l.forEach(c=>{lt(s,c.field)?c.value=s[c.field]:a&&(c.value=void 0)})})},getGlobalEvent(r){let s=o.options.globalEvent[r];if(s)return typeof s=="object"&&(s=s.handle),Dn(s)},getGlobalData(r){return new Promise((s,a)=>{let l=o.options.globalData[r];l?l.type==="fetch"?o.fetch(l).then(c=>{s(c)}).catch(a):s(l.data):s(t.fc.loadData[r])})},emitGlobalEvent(r,...s){const a=o.getGlobalEvent(r);if(a){const l=t.getInjectData({},void 0);return l.args=[...s],s.unshift(l),a.apply(null,s)}},setGlobalData(r,s){o.setData("$globalData."+r,s)},setGlobalVar(r,s){o.setData("$var."+r,s)},renderRule(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createRuleVnode(l,s,a):void 0},renderChildren(r,s,a){const l=typeof r=="object"?On(r):t.getCtx(r);return l?t.$render.createChildrenVnodes(l,s,a):void 0},nextTick(r){t.bus.$once("next-tick",r),t.refresh()},nextRefresh(r){t.nextRefresh(),r&&Be(r)},deferSyncValue(r,s){t.deferSyncValue(r,s)},emit(r,...s){t.vm.emitsOptions&&!t.vm.emitsOptions[r]&&(t.vm.emitsOptions[r]=null),t.vm.emit(r,...s)},bus:t.bus,getCurrentFormRule(){var r;return(r=t.vm.setupState.getGroupInject())==null?void 0:r.rule},fetch(r){return new Promise((s,a)=>{let l=Te({},r);l=t.loadFetchVar(l);const c=u=>{Be(()=>l.onError&&l.onError(u)),a(u)};t.beforeFetch(l).then(()=>Xd(l,t.fc.create.fetch,o).then(u=>{Be(()=>l.onSuccess&&l.onSuccess(u)),s(u)}).catch(u=>{c(u)})).catch(u=>{c(u)})})},watchFetch(r,s,a,l){return t.fc.watchLoadData((c,u)=>{let d=Te({},r);if(d=t.loadFetchVar(d,c),l&&l(d,u)===!1)return;const h=m=>{Be(()=>d.onError&&d.onError(m)),a&&a(m)};t.beforeFetch(d).then(()=>Xd(d,t.fc.create.fetch,o).then(m=>{Be(()=>d.onSuccess&&d.onSuccess(m)),s&&s(m,u)}).catch(m=>{h(m)})).catch(m=>{h(m)})},r.wait==null?1e3:r.wait)},getData(r,s){return t.fc.get?t.fc.get(r,s):t.fc.getLoadData(r,s)},watchData(r){return t.fc.watchLoadData((s,a)=>{Be(()=>r(s,a))})},setData(r,s,a){return t.fc.setData(r,s,a)},refreshData(r){return t.fc.refreshData(r)},t(r,s){return t.fc.t(r,s)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:n}};return["on","once","off"].forEach(r=>{o[r]=function(...s){t.bus[`$${r}`](...s)}}),o.changeValue=o.changeField=o.setValue,o}function tT(t){Fe(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll(){this.cache={}},setCache(e,n,i){this.cache[e.id]={vnode:n,use:!1,parent:i,slot:e.rule.slot}},getCache(e){const n=this.cache[e.id];if(n)return n.use=!0,n.vnode}})}function nT(t){Fe(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const n=i=>{if(i){let o;return e.rule.field&&(o=i.slots["field-"+Do(e.rule.field)]||i.slots["field-"+e.rule.field]),o||(o=i.slots["type-"+Do(e.type)]||i.slots["type-"+e.type]),o||n(i.setupState.parent)}};return n(this.vm)},render(){if(!this.vm.setupState.isShow)return;this.$manager.beforeRender();const e=wr();return this.sort.forEach(n=>{this.renderSlot(e,this.$handle.ctxs[n])}),this.$manager.render(e)},renderSlot(e,n,i){if(this.isFragment(n)){n.initProp(),this.mergeGlobal(n),n.initNone();const o=this.renderChildren(n.loadChildrenPending(),n),r=o.default;r&&e.setSlot(n.rule.slot,()=>r()),delete o.default,e.mergeBag(o)}else e.setSlot(n.rule.slot,this.renderCtx(n,i))},mergeGlobal(e){this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=te(()=>{const n=this.$handle.options.global;return Zn({},[n["*"]||n.default||{},n[e.originType]||n[e.type]||n[e.type]||{}])})),e.prop=Zn({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions(e){const n=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=n,e.prop.optionsTo&&n&&fi(e.prop,e.prop.optionsTo,n)},deepSet(e){const n=e.prop.deep;n&&Object.keys(n).sort((i,o)=>i.length<o.length?-1:1).forEach(i=>{fi(e.prop,i,n[i])})},parseSide(e,n){return pe.Object(e)?Zn({props:{formCreateInject:n.prop.props.formCreateInject}},e):e},renderSides(e,n,i){const o=n[i?"rule":"prop"];return[this.renderRule(this.parseSide(o.prefix,n)),e,this.renderRule(this.parseSide(o.suffix,n))]},renderId(e,n){const i=this.$handle[n==="field"?"fieldCtx":"nameCtx"][e];return i?i.map(o=>this.renderCtx(o,o.parent)):void 0},renderCtx(e,n){try{if(e.type==="hidden")return;const i=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==i.slot){let o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let r=e.prop;r.preview=!!(r.preview!=null?r.preview:this.$handle.preview),r.props.formCreateInject=this.injectProp(e);let s=r.cache!==!1;const a=r.preview;if(r.hidden){this.setCache(e,void 0,n);return}o=(...l)=>{var c,u;const d={rule:i,prop:r,preview:a,api:this.$handle.api,model:r.model||{},slotValue:l};l.length&&i.slotUpdate&&Be(()=>i.slotUpdate(d));let h={};const m=e.loadChildrenPending();e.parser.renderChildren?h=e.parser.renderChildren(m,e):e.parser.loadChildren!==!1&&(h=this.renderChildren(m,e)),Object.keys(r.renderSlots||{}).forEach(_=>{h[_]=(...C)=>{if(pe.Function(r.renderSlots[_]))return Be(()=>r.renderSlots[_](...C));const w=this.parseSide(r.renderSlots[_],e);return this.renderRule(w)}});const f=this.getTypeSlot(e);let p;return f?(d.children=h,p=f(d)):p=a?e.parser.preview(vl(h),e):e.parser.render(vl(h),e),p=this.renderSides(p,e),(c=r.title)!=null&&c.show&&(r.wrap=en(Te({},r.wrap||{}),{show:!0}),r.native||(r.native=!1)),(!(!e.input&&pe.Undef(r.native))||((u=r.col)==null?void 0:u.show)===!0)&&r.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),p=this.$manager.makeWrap(e,p)),e.none&&(Array.isArray(p)?p=p.map(_=>!_||!_.__v_isVNode?_:this.none(_)):p=this.none(p)),s&&this.setCache(e,()=>this.stable(p),n),p},this.setCache(e,o,n)}return(...o)=>{const r=this.getCache(e);if(r)return r(...o);if(this.cache[e.id])return;const s=this.renderCtx(e,e.parent);if(s)return s()}}catch(i){console.error(i);return}},none(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass(e,n){if(Array.isArray(e))e.push(n);else return e?[e,n]:n;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(n=>{n&&n.__v_isVNode&&n.children&&typeof n.children=="object"&&(n.children.$stable=!0,this.stable(n.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:o=>{this.$handle.addSubForm(e,o)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.setupState.top.slots,getWrap:()=>this.vm.refs[e.wrapRef],options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:(...o)=>this.$handle.api.t(...o),updateValue:o=>{this.$handle.onUpdateValue(e,o)}});const i=n.ctxInject[e.id];return Fe(i,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),i},ctxProp(e){const{ref:n,key:i,rule:o}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const r=[{ref:n,key:o.key||`${i}fc`,slot:void 0,on:{vnodeMounted:s=>{s.el.__rule__=e.rule,this.onMounted(e,s.el)},vnodeBeforeUnmount:()=>{this.$handle.effect(e,"beforeUnmount"),this.$handle.targetHook(e,"beforeUnmount")},"fc.updateValue":s=>{this.$handle.onUpdateValue(e,s)},"fc.el":s=>{e.exportEl=s,s&&((s.$el||s).__rule__=e.rule)}}}];if(e.input){const s=this.tmpInput;this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);const a=this.getModelField(e),l={callback:c=>{s&&s(e.field,c,e.rule),this.onInput(e,c)},modelField:a,value:this.$handle.getFormData(e)};r.push({on:Te({[`update:${a}`]:l.callback},e.prop.modelEmit?{[e.prop.modelEmit]:()=>this.onEmitInput(e)}:{}),props:{[a]:l.value}}),e.prop.model=l}return Qn(r,e.prop),e.prop},onMounted(e,n){e.el=this.vm.refs[e.ref]||n,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,n){if(e.prop.modelEmit){this.$handle.onBaseInput(e,n);return}this.$handle.onInput(e,n)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,n){if(!pe.trueArray(e))return{};const i=wr();return e.map(o=>{if(o){if(pe.String(o)||pe.Number(o))return i.setSlot(null,`${o}`);if(o.__fc__)return this.renderSlot(i,o.__fc__,n);o.type&&Ge(()=>{this.$handle.loadChildren(e,n),this.$handle.refresh()})}}),i.getSlots()},defaultRender(e,n){const i=e.prop;return i.component?typeof i.component=="string"?this.vNode.make(i.component,i,n):this.vNode.makeComponent(i.component,i,n):this.vNode[e.type]?this.vNode[e.type](i,n):this.vNode[e.originType]?this.vNode[e.originType](i,n):this.vNode.make($m(i.type),i,n)},createChildrenVnodes(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,o},createRuleVnode(e,n,i){this.force=i!==!1,this.tmpInput=n;const o=wr();return this.renderSlot(o,e,e.parent),this.force=!1,this.tmpInput=null,o.getSlots()},renderRule(e,n,i){if(!e)return;if(pe.String(e)||pe.Number(e))return`${e}`;let o;if(i)o=e.type;else if(o=e.is,e.type){o=Vt(e.type);const a=this.vNode.aliasMap[o];a&&(o=Vt(a))}if(!o)return;const r=wr();pe.trueArray(e.children)&&e.children.forEach(a=>{a&&r.setSlot(a?.slot,()=>this.renderRule(a))});const s=Te({},e);return delete s.type,delete s.is,this.vNode.make(o,s,r.mergeBag(n).getSlots())}})}let iT=1;function Tc(t){Fe(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t),force:!1,tmpInput:null,id:iT++}),Am(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}tT(Tc);nT(Tc);function oT(t){Fe(t.prototype,{parseInjectEvent(e,n){const i=e.inject||this.options.injectEvent;return this.parseEventLst(e,n,i)},parseEventLst(e,n,i,o){return Object.keys(n).forEach(r=>{const s=this.parseEvent(e,n[r],i,o);s&&(n[r]=s)}),n},parseEvent(e,n,i,o){if(pe.Function(n)&&(i!==!1&&!pe.Undef(i)||n.__inject))return this.inject(e,n,i);if(!o&&Array.isArray(n)&&n[0]&&(pe.String(n[0])||pe.Function(n[0])))return this.parseEventLst(e,n,i,!0);if(pe.String(n)){const r=Dn(n);if(r&&n!==r)return r.__inject?this.parseEvent(e,r,i,!0):r}},parseEmit(e){let n={},i=e.rule,{emitPrefix:o,field:r,name:s,inject:a}=i,l=i.emit||[];return pe.trueArray(l)&&l.forEach(c=>{if(!c)return;let u,d=o||r||s;if(pe.Object(c)&&(u=c.inject,c=c.name,d=c.prefix||d),d){const h=Do(`${d}-${c}`),m=(...f)=>{this.vm.emitsOptions&&!this.vm.emitsOptions[h]&&(this.vm.emitsOptions[h]=null),this.vm.emit(h,...f),this.vm.emit("emit-event",h,...f),this.bus.$emit(h,...f)};if(m.__emit=!0,!u&&a===!1)n[Vt(c)]=m;else{let f=u||a||this.options.injectEvent;n[Vt(c)]=pe.Undef(f)?m:this.inject(i,m,f)}}}),e.computed.on=n,n},getInjectData(e,n){const i=e.__fc__&&e.__fc__.$api,o=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:r,rule:s}=o.props;return{$f:i||this.api,api:i||this.api,rule:s,self:e.__origin__,option:r,inject:n}},inject(e,n,i){if(n.__origin){if(this.watching&&!this.loading)return n;n=n.__origin}const o=this,r=function(...s){const a=o.getInjectData(e,i);return a.args=[...s],s.unshift(a),n.apply(this,s)};return r.__origin=n,r.__json=n.__json,r},loadStrVar(e,n,i){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const o=e,r=Yx(e),s=c=>{let u=!1,d;if(i&&c.indexOf("$form.")===0){const h=c.split(".");h.shift(),lt(i.value,h[0])&&(u=!0,d=n?n({id:"$form."+h[0]+"_"+i.rule.__fc__.id,getValue:()=>Pt(i.value,h)}):Pt(i.value,h))}return u||(d=n?n(c):this.fc.getLoadData(c)),d},a=c=>{const u=[];c.forEach(h=>{h.key?u.push(h.key):h.children&&u.push(a(h.children))});let d=!1;return u.forEach((h,m)=>{h!=null&&(h.indexOf("'")===0||h.indexOf('"')===0)&&(u[m]=h.slice(1,-1),d=!0)}),u.length===1&&(d||!isNaN(Number(u[0])))?u[0]:s(u.join("."))};let l;if(r.forEach(c=>{const u=c.split("||"),d=u[0].trim();if(d){const h=(u[1]||"").trim(),m=Pm(d);let f=Be(()=>a(m));(f==null||f==="")&&u.length>1&&(f=h),l=f,e=e.replaceAll(`{{${c}}}`,f??"")}}),r.length===1&&o===`{{${r[0]}}}`)return l}return e},loadFetchVar(e,n,i){let o;i&&i.__fc__&&(o=i.__fc__.getParentGroup()),!o&&e.targetRule&&e.targetRule.__fc__&&(o=e.targetRule.__fc__.getParentGroup());const r=s=>this.loadStrVar(s,n,o?{rule:i,value:this.subRuleData[o.id]||{}}:null);return e.action=r(e.action||""),["headers","data","query"].forEach(s=>{if(e[s]){const a=Array.isArray(e[s])?[]:{};Object.keys(e[s]).forEach(l=>{a[r(l)]=r(e[s][l])}),e[s]=a}}),e}})}const Jd=["hook:updated","hook:mounted"];function rT(t){Fe(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let n=25,i=sT(this.rules);pe.Object(e)&&(e.first&&(n=parseInt(e.first,10)||n),e.limit&&(i=parseInt(e.limit,10)||i)),Fe(this,{first:n,limit:i,pageEnd:this.rules.length<=n}),this.bus.$on("page-end",()=>this.vm.emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.bus.$off(Jd,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.bus.$on(Jd,e)}})}function sT(t){return t.length<31?31:Math.ceil(t.length/3)}function aT(t){Fe(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function lT(t){Object.defineProperties(t.origin,{__fc__:yl(Gn(t))}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:yl(Gn(t))})}function Fm(t,e,n){const i=Ps(),o=!!e.field;Fe(this,{id:i,ref:i,wrapRef:i+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:Te({},e),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?Mn(n):void 0,field:e.field||void 0}),this.updateKey(),lT(this),this.update(t,!0)}Fe(Fm.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,n)=>{this.$handle&&(e===n?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,n))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:n,def:i,onLoad:o,onReload:r,onUpdate:s}=t;if(this.pending[e]&&this.pending[e].origin===n)return this.getPending(e,i);delete this.pending[e];let a=n;if(pe.Function(n)){let l=Be(()=>n({rule:this.rule,api:this.$api,update:c=>{const u=c||i,d=this.getPending(e,i);this.setPending(e,n,u),s&&s(u,d)},reload:()=>{const c=this.getPending(e,i);delete this.pending[e],r&&r(c),this.$api&&this.$api.sync(this.rule)}}));l&&pe.Function(l.then)?(l.then(c=>{const u=c||i;this.setPending(e,n,u),o&&o(u),this.$api&&this.$api.sync(this.rule)}).catch(c=>{console.error(c)}),a=i,this.setPending(e,n,a)):(a=l||i,this.setPending(e,n,a),o&&o(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,n){this.pending[t]={origin:e,value:Mt(n)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Ps(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=Vt(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){var t,e,n;const i=Te({},this.rule);delete i.children,delete i.validate,this.prop=Zn({},[i,...Object.keys(this.payload).map(o=>this.payload[o]),this.computed]),i.col&&((t=i.col)==null?void 0:t.show)!==!1&&(this.prop.col.show=!0),this.prop.validate=[...((n=(e=this.refRule)==null?void 0:e.__$validate)==null?void 0:n.value)||[],...this.prop.validate||[]]},initNone(){this.none=!(pe.Undef(this.prop.display)||this.prop.display)},hasHidden(){return!!this.rule.hidden||(this.parent?this.parent.hasHidden():!1)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],Object.keys(this.refRule).forEach(t=>{t.indexOf("__$")!==0&&delete this.refRule[t]})},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),Fe(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),Fe(this,{root:[]})},this.input)})},update(t,e){Fe(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function cT(t){Fe(t.prototype,{nextRefresh(e){const n=this.loadedId;Ge(()=>{n===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const n=Wd(e);return Object.defineProperties(n,{__origin__:yl(e)}),uT(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach(i=>{i&&this.loadFn(i,n)}),this.loadCtrl(n),n.update&&(n.update=Dn(n.update)),n},loadFn(e,n){["on","props","deep"].forEach(i=>{e[i]&&this.parseInjectEvent(n,e[i])})},loadCtrl(e){e.control&&e.control.forEach(n=>{n.handle&&(n.handle=Dn(n.handle))})},syncProp(e){const n=e.rule;pe.trueArray(n.sync)&&Qn([{on:n.sync.reduce((i,o)=>(i[typeof o=="object"&&o.event||`update:${o}`]=r=>{n.props[typeof o=="object"&&o.prop||o]=r,this.vm.emit("sync",o,r,n,this.fapi)},i),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.setupState.renderRule()})},loadChildren(e,n){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,n),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(n)},_loadRule(e,n){const i=s=>{let a=e[s-1];if(!a||!a.__fc__)return s>0?i(s-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:i(s-1)},o=(s,a)=>{pe.trueArray(s)&&this._loadRule(s,a)},r=e.map((s,a)=>{if(n&&!pe.Object(s)||!this.pageEnd&&!n&&a>=this.first)return;if(s.__fc__&&s.__fc__.root===e&&this.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;let l=Wd(s);const c=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==s.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:c()}),c()&&this.vm.emit("repeat-field",s,this.api);let u,d=!1,h=!!s.__fc__,m=l.value;if(h){if(u=s.__fc__,m=u.defaultValue,u.deleted){if(Zd(u))return;u.update(this)}else if(!u.check(this)){if(Zd(u))return;e[a]=s=s._clone?s._clone():wm(Lo(s)),u=null,d=!0}}if(u)u.originType!==u.rule.type&&u.updateType(),this.bindParser(u),this.appendValue(u.rule),u.parent&&u.parent!==n&&this.rmSubRuleData(u);else{const _=this.parseRule(s);u=new Fm(this,_,m),this.bindParser(u)}this.parseEmit(u),this.syncProp(u),u.parent=n||null,u.root=e,this.setCtx(u),!d&&!h&&(this.effect(u,"load"),this.targetHook(u,"load")),this.effect(u,"created");const f=u.loadChildrenPending();if(u.parser.loadChildren===!1||o(f,u),!n){const _=i(a);_>-1||!a?this.sort.splice(_+1,0,u.id):this.sort.push(u.id)}const p=u.rule;return u.updated||(u.updated=!0,pe.Function(p.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(u,p.value,"init")}),this.effect(u,"loaded")),this.refreshControl(u)&&(this.cycleLoad=!0),u}).filter(s=>!!s);n&&(n.children=r)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const n=dT(e),i=[],o=this.api;if(!n.length)return!1;for(let a=0;a<n.length;a++){const l=n[a],c=l.handle||function(d){return(Ai[l.condition||"=="]||Ai["=="])(d,l.value)};if(!pe.trueArray(l.rule))continue;const u=en(Te({},l),{valid:Be(()=>c(e.rule.value,o)),ctrl:hT(e,l.rule),isHidden:pe.String(l.rule[0])});u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden||i.push(u)}if(!i.length)return!1;const r=[];let s=!1;return this.deferSyncValue(()=>{i.reverse().forEach(({isHidden:a,valid:l,rule:c,prepend:u,append:d,child:h,ctrl:m,method:f})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:c,valid:l}):m&&e.ctrlRule.splice(e.ctrlRule.indexOf(m)>>>0,1),r[l?"push":"unshift"](()=>{f==="disabled"||f==="enabled"?this.api.disabled(!l,c):f==="display"||f==="show"?this.api.display(l,c):f==="required"?(c.forEach(p=>{this.api.setEffect(p,"required",l)}),l||this.api.clearValidateState(c)):f==="if"?this.api.hidden(!l,c):this.api.hidden(!l,c)});return}if(l){s=!0;const p={type:"fragment",native:!0,__ctrl:!0,children:c};e.ctrlRule.push(p),this.bus.$once("load-start",()=>{u?o.prepend(p,u,h):d||h?o.append(p,d||e.id,h):e.root.splice(e.root.indexOf(e.origin)+1,0,p)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(m),1);const p=On(m);p&&p.rm()}})}),r.length&&(this.loading?r.length&&this.bus.$once("load-end",()=>{r.forEach(a=>a())}):r.length&&Ge(()=>{r.forEach(a=>a())})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const n=Te({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(n).filter(i=>this.ctxs[i]===void 0).forEach(i=>this.rmCtx(n[i])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.bus.$emit("reloading",this.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh(){this.vm.setupState.refresh()}})}function uT(t){const e=Rm();return Object.keys(e).forEach(n=>{lt(t,n)||(t[n]=e[n])}),t}function dT(t){const e=t.rule.control||[];return pe.Object(e)?[e]:e}function hT(t,e){for(let n=0;n<t.ctrlRule.length;n++){const i=t.ctrlRule[n];if(i.children===e)return i}}function Zd(t){return!!t.rule.__ctrl}function pT(t){Fe(t.prototype,{setValue(e,n,i,o){e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,o||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:o||!1}),o&&Ge(()=>{Ge(()=>{Ge(()=>{this.api.clearValidateState(e.id)})})}),this.$manager.fieldChange(e,n,i,o))},onInput(e,n){let i;e.input&&(this.isQuote(e,i=e.parser.toValue(n,e))||this.isChange(e,n))&&this.setValue(e,i,n)},onUpdateValue(e,n){this.deferSyncValue(()=>{const i=e.getParentGroup(),o=i?this.subRuleData[i.id]:null,r={};Object.keys(n||{}).forEach(s=>{o&&lt(o,s)?r[s]=n[s]:lt(this.api.form,s)?this.api.form[s]=n[s]:this.api.top!==this.api&&lt(this.api.top.form,s)&&(this.api.top.form[s]=n[s])}),Object.keys(r).length&&this.api.setChildrenFormData(i.rule,r)})},onBaseInput(e,n){this.setFormData(e,n),e.modelValue=n,this.nextRefresh(),this.$render.clearCache(e)},setFormData(e,n){e.modelValue=n;const i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),an(this.formData,e.id,n)},rmSubRuleData(e){const n=e.getParentGroup();n&&this.subRuleData[n.id]&&delete this.subRuleData[n.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e=Mt({}),n=this.fields(),i=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((o,r)=>(n.indexOf(r)===-1&&(o[r]=kt(this.appendData,r)),o),e),n.reduce((o,r)=>{let s=(this.fieldCtx[r]||[]).filter(a=>!this.isIgnore(a))[0];return s||(s=this.fieldCtx[r][0],i.push(r)),o[r]=kt(s.rule,"value"),o},e),this.form=e,this.ignoreFields=i,this.syncValue()},isIgnore(e){return e.rule.ignore===!0||(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue(e){(!e.field||!lt(this.appendData,e.field))&&(!pe.Undef(e.value)||!this.options.forceCoverValue)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,n){this.subForm[e.id]=n},deferSyncValue(e,n){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=n),Be(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(n=>{this.ignoreFields.indexOf(n)===-1&&(e[n]=this.form[n])}),this.vm.setupState.updateValue(e)},isChange(e,n){return JSON.stringify(this.getFormData(e),eh)!==JSON.stringify(n,eh)},isQuote(e,n){return(n instanceof Function||pe.Object(n)||Array.isArray(n))&&n===e.rule.value},refreshUpdate(e,n,i,o){if(pe.Function(e.rule.update)){const r=Be(()=>e.rule.update(n,e.origin,this.api,{origin:i||"change",linkField:o}));if(r===void 0)return;e.rule.hidden=r===!0}},valueChange(e,n){this.refreshRule(e,n),this.bus.$emit("change-"+e.field,n)},refreshRule(e,n,i,o){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,n,i,o)},appendLink(e){const n=e.rule.link;pe.trueArray(n)&&n.forEach(i=>{const o=()=>this.refreshRule(e,e.rule.value,"link",i);this.bus.$on("change-"+i,o),e.linkOn.push(()=>this.bus.$off("change-"+i,o))})},fields(){return Object.keys(this.fieldCtx)}})}function eh(t,e){return typeof e=="function"?""+e:e}const To={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},fT=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],Co=Symbol("oldValue");function mT(t){Fe(t.prototype,{getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,n,i){const o=`${i}Ctx`;this[o][n]?this[o][n].push(e):this[o][n]=[e]},rmIdCtx(e,n,i){const o=`${i}Ctx`,r=this[o][n];if(!r)return!1;const s=r.splice(r.indexOf(e)>>>0,1).length>0;return r.length||delete this[o][n],s},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:n,field:i,name:o,rule:r}=e;this.ctxs[n]=e,o&&this.setIdCtx(e,o,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(r.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,r.value,e.origin,this.api,!1,!0))},getParser(e){const n=this.fc.parsers,i=this.fc.renderDriver;if(i){const o=i.parsers||{},r=o[e.originType]||o[Vt(e.type)]||o[e.trueType];if(r)return r}return n[e.originType]||n[Vt(e.type)]||n[e.trueType]||To},bindParser(e){e.setParser(this.getParser(e))},getType(e){const n=this.fc.CreateNode.aliasMap,i=n[e]||n[Vt(e)]||e;return Vt(i)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),Be(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){if(Tm().filter(n=>n[0]!=="_"&&n[0]!=="$"&&fT.indexOf(n)===-1).forEach(n=>{const i=kt(e.rule,n),o=n==="children";e.refRule[n]=i,e.watch.push($e(o?()=>pe.Function(i.value)?i.value:[...i.value||[]]:()=>i.value,(r,s)=>{let a=i.value;if(!this.isBreakWatch()){if(o&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,Ge(()=>{this.targetHook(e,"watch",{key:n,oldValue:s,newValue:a})}),n==="hidden"&&!!a!=!!s&&(this.$render.clearCacheAll(),Ge(()=>{this.targetHook(e,"hidden",{value:a})})),n==="ignore"&&e.input||n==="hidden"&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(n==="link"){e.link();return}else["props","on","deep"].indexOf(n)>-1?(this.parseInjectEvent(e.rule,a||{}),n==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):n==="emit"?this.parseEmit(e):["prefix","suffix"].indexOf(n)>-1?a&&this.loadFn(a,e.rule):n==="type"?(e.updateType(),this.bindParser(e)):o&&(pe.Function(s)&&(s=e.getPending("children",[])),pe.Function(a)&&(a=e.loadChildrenPending()),this.updateChildren(e,a,s));this.$render.clearCache(e),this.refresh(),this.watching=!1}},{deep:!o,sync:o}))}),e.refRule.__$title=te(()=>{let n=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$info=te(()=>{let n=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(n){const i=n.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);i&&(n=this.api.t(i[1]))}return n}),e.refRule.__$validate=te(()=>{const n=i=>{var o,r;const s=i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return s?this.api.t(s[1],{title:(r=(o=e.refRule)==null?void 0:o.__$title)==null?void 0:r.value}):i};return Ut(e.rule.validate).map(i=>{const o=Te({},i);if(o.message&&(o.message=n(o.message)),pe.Function(o.validator)){const r=e;o.validator=function(...s){return i.validator.call({that:this,id:r.id,field:r.field,rule:r.rule,api:r.$handle.api},...s)}}if(o.adapter){if(typeof o.error=="object"){const r=Te({},o.error);Object.keys(r).forEach(s=>{r[s]=n(r[s])}),o.error=r}return this.adapterValidate(o,e)}return o})}),e.input){const n=kt(e.rule,"value");e.watch.push($e(()=>n.value,()=>{let i=e.parser.toFormValue(n.value,e);this.isChange(e,i)&&this.setValue(e,n.value,i,!0)}))}this.bus.$once("load-end",()=>{let n=e.rule.computed;n&&(typeof n!="object"&&(n={value:n}),Object.keys(n).forEach(i=>{const o=te(()=>{const s=n[i];if(!s)return;const a=this.compute(e,s);return(s.linkage||s.linkageVariable)&&a===Co?Co:a}),r=s=>{i==="value"?this.onInput(e,s):i[0]==="$"?this.api.setEffect(e.id,i,s):fi(e.rule,i,s)};(i==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Pt(e.rule,i))&&r(o.value),e.watch.push($e(o,s=>{s!==Co&&setTimeout(()=>{r(s)})},{deep:!0}))}))}),this.watchEffect(e)},adapterValidate(e,n){const i=(o,r)=>{if((e.beforeValidate&&Be(()=>e.beforeValidate({value:o,api:this.api,validate:e,rule:n.rule})))===!1)r();else{const s=this.validator(n,o,e);if(s){let a="";typeof e.error=="object"&&(a=e.error[s]||e.error.default),!a&&typeof e.message=="string"&&(a=e.message),a||(a=this.getValidateMessage(n,{key:s,rule:e[s]})),r(a)}else if(e.validator){const a=e.validator&&Be(()=>e.validator(o,r));a&&pe.Function(a.then)&&a.then(()=>r()).catch(l=>r(l))}else r()}};return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},i)},getValidateMessage(e,n){var i,o;const r=Array.isArray(n.rule)?n.rule.join(","):""+n.rule;return this.api.t(n.key==="required"?n.key:"validate."+n.key,{[n.key]:r,title:(o=(i=e.refRule)==null?void 0:i.__$title)==null?void 0:o.value})},validator(e,n,i){if(pe.empty(n))return i.required?"required":void 0;for(const[o,r]of Object.entries(i))switch(o){case"len":case"maxLen":case"minLen":const s=l=>o==="len"?l===r:o==="maxLen"?l<=r:l>=r;if(Array.isArray(n)){if(!s(n.length))return o}else if(typeof n=="object"||!s((""+n).length))return o;break;case"pattern":if(!(typeof r=="string"?new RegExp(r):r).test(""+n))return o;break;case"uppercase":if(r&&(typeof n!="string"||!/^[A-Z]*$/.test(n)))return o;break;case"lowercase":if(r&&(typeof n!="string"||!/^[a-z]*$/.test(n)))return o;break;case"min":case"max":case"positive":case"negative":case"integer":case"number":const a=Number(n);if(Number.isNaN(a)||o==="min"&&a<r||o==="max"&&a>r||o==="positive"&&a<=0||o==="negative"&&a>=0||o==="integer"&&!Number.isInteger(a))return o;break;case"equal":if(n!==r)return o;break;case"enum":if(Array.isArray(r)&&!r.includes(n))return o;break;case"hasKeys":if(typeof n!="object"||Array.isArray(r)&&r.some(l=>!(l in n)))return o;break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+n))return o;break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+n))return o;break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+n))return o;break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+n))return o;break;case"computed":if(!this.compute(e,r))return o;break}},compute(e,n){let i;if(typeof n=="object"){const o=e.getParentGroup(),r=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!pe.trueArray(a.group))return!0;const l=a.mode==="OR";let c=!0;for(let u=0;u<a.group.length;u++){const d=a.group[u];let h,m=null,f=null;if(d.variable)f=this.fc.getLoadData(d.variable);else if(d.field)m=Gd(d.field||"");else if(!d.mode)return!0;let p=d.compare;if(p&&(p=Gd(p||"")),d.mode?h=r(d):Ai[d.condition]?pe.Function(d.handler)?h=Be(()=>d.handler(this.api,e.rule)):h=Be(()=>new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule",`with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${d.variable?"$variableVal":m}, ${p||"$val"}); }}}}`).call(this.api.form,Ai,f,d.value,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,o?this.subRuleData[o.id]||{}:{},e.rule)):h=!1,l&&h)return!0;l||(c=c&&h)}return l?!1:c};let s=r(n);return s=n.invert===!0?!s:s,n.linkage?s?Be(()=>this.computeValue(n.linkage,e,o),void 0):Co:n.linkageVariable?s?Be(()=>this.fc.getLoadData(n.linkageVariable),void 0):Co:s}else if(pe.Function(n))i=()=>n(this.api.form,this.api,e.rule);else{const o=e.getParentGroup();i=()=>this.computeValue(n,e,o)}return Be(i,void 0)},computeValue(e,n,i){const o=this,r=Object.keys(this.fc.formulas).reduce((s,a)=>(s[a]=function(...l){return o.fc.formulas[a].call({that:this,rule:n.rule,api:o.api,fc:o.fc},...l)},s),{});return Be(()=>new Function("$formulas","$form","$scope","$group","$rule","$api",`with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form,r,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,i?this.subRuleData[i.id]||{}:{},n.rule,this.api),void 0)},updateChildren(e,n,i){this.deferSyncValue(()=>{i&&i.forEach(o=>{(n||[]).indexOf(o)===-1&&o&&!pe.String(o)&&o.__fc__&&o.__fc__.parent===e&&this.rmCtx(o.__fc__)}),pe.trueArray(n)&&(this.loadChildren(n,e),this.bus.$emit("update",this.api))})},rmSub(e){pe.trueArray(e)&&e.forEach(n=>{n&&n.__fc__&&this.rmCtx(n.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:n,field:i,input:o,name:r}=e;Si(this.ctxs,n),Si(this.formData,n),Si(this.subForm,n),Si(this.vm.setupState.ctxInject,n);const s=e.getParentGroup();s&&this.subRuleData[s.id]&&Si(this.subRuleData[s.id],i),e.group&&Si(this.subRuleData,n),o&&this.rmIdCtx(e,i,"field"),r&&this.rmIdCtx(e,r,"name"),o&&!lt(this.fieldCtx,i)&&Si(this.form,i),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);pe.trueArray(l)&&l.forEach(c=>c&&c.__fc__&&this.rmCtx(c.__fc__))}e.root===this.rules&&this.vm.setupState.renderRule()}},o);const a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),o&&!this.fieldCtx[i]&&this.vm.emit("remove-field",i,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}})}function vT(t){Fe(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...n){const i=this.options[e]||this.options[Vt("on-"+e)];if(i){const o=Dn(i);pe.Function(o)&&Be(()=>o(...n))}this.bus.$emit(e,...n)},targetHook(e,n,i){var o,r,s,a;let l=(r=(o=e.prop)==null?void 0:o.hook)==null?void 0:r[n],c=(h,m)=>{h&&(h=Array.isArray(h)?h:[h],h.forEach(f=>{Be(()=>f(en(Te({args:Object.values(i||{})},i||{}),{self:e.rule,rule:e.rule,parent:m?.rule,$f:this.api,api:this.api,option:this.vm.props.option})))}))};c(l);let u="deep"+ym(n),d=e.parent;for(;d;){let h=(a=(s=d.prop)==null?void 0:s.hook)==null?void 0:a[u];c(h,d),d=d.parent}}})}function gT(t){Fe(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(n=>{let i=e[n];pe.Function(i)&&(i=i(this.fc)),i._c=yT(i),this.onEffect(i,n),this.providers[n]=i})},onEffect(e,n){const i=[];(e._c||["*"]).forEach(o=>{const r=o==="*"?"*":this.getType(o);i.indexOf(r)>-1||(i.push(r),this.bus.$on(`p:${n||e.name}:${r}:${e.input?1:0}`,(s,a)=>{e[s]&&e[s](...a)}))}),e._used=i},watchEffect(e){let n={required:()=>{var i,o;return(lt(e.rule,"$required")?e.rule.$required:(o=(i=e.rule)==null?void 0:i.effect)==null?void 0:o.required)||!1}};Object.keys(e.rule.effect||{}).forEach(i=>{n[i]=()=>e.rule.effect[i]}),Object.keys(e.rule).forEach(i=>{i[0]==="$"&&(n[i.substr(1)]=()=>e.rule[i])}),Object.keys(n).forEach(i=>{e.watch.push($e(n[i],o=>{this.effect(e,"watch",{[i]:o})},{deep:!0}))})},ruleEffect(e,n,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},n,i)},effect(e,n,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},n)},getEffect(e,n){if(lt(e,"$"+n))return e["$"+n];if(lt(e,"effect")&&lt(e.effect,n))return e.effect[n]},emitEffect({ctx:e,rule:n,input:i,type:o,custom:r},s,a){if(!o||["fcFragment","fragment"].indexOf(o)>-1)return;const l=r||Object.keys(n).reduce((c,u)=>(u[0]==="$"&&(c[u.substr(1)]=n[u]),c),Te({},n.effect||{}));Object.keys(l).forEach(c=>{const u=this.providers[c];if(!u||u.input&&!i)return;let d;if(!u._c)d="*";else if(u._used.indexOf(o)>-1)d=o;else return;const h=Te({value:l[c],getValue:()=>this.getEffect(n,c)},a||{});e&&(h.getProp=()=>e.effectData(c),h.clearProp=()=>e.clearEffectData(c),h.mergeProp=m=>Zn(h.getProp(),[m]),h.id=e.id),this.bus.$emit(`p:${c}:${d}:${u.input?1:0}`,s,[h,n,this.api])})}})}function _T(t){return t.filter(function(e,n,i){return i.indexOf(e,0)===n})}function yT(t){const e=t.components;if(Array.isArray(e)){const n=_T(e.filter(i=>i!=="*"));return n.length?n:!1}else return pe.String(e)?[e]:!1}function Nn(t){Am(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.props.preview!=null?t.vm.props.preview:t.vm.setupState.parent&&t.vm.setupState.parent.props.preview!=null?t.vm.setupState.parent.props.preview:t.options.value.preview||!1}}),Fe(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:Mt({}),subRuleData:Mt({}),subForm:{},form:Mt({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new Tc(this),this.api=t.extendApiFn.reduce((e,n)=>{const i=Be(()=>n(e,this));return i&&i!==e&&Fe(e,i),e},eT(this))}Fe(Nn.prototype,{initData(t){Fe(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=Te(Te(Te({},Mn(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch(t){return new Promise((e,n)=>{const i=this.options.beforeFetch&&Be(()=>this.options.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):e()})},beforeFetch(t){return new Promise((e,n)=>{const i=t&&t.beforeFetch&&Be(()=>t.beforeFetch(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()}).then(()=>this.globalBeforeFetch(t))},beforeSubmit(t){return new Promise((e,n)=>{const i=this.options.beforeSubmit&&Be(()=>this.options.beforeSubmit(t,{api:this.api}));i&&pe.Function(i.then)?i.then(e).catch(n):i===!1?n():e()})}});oT(Nn);rT(Nn);aT(Nn);cT(Nn);pT(Nn);mT(Nn);vT(Nn);gT(Nn);const bT="fcFragment",da=Ce({name:bT,inheritAttrs:!1,props:["vnode"],render(){return this.vnode}});function wT(t){return Object.keys(t).map(e=>{const n=t[e],i=S_(e);if(i)return[i,n.value,n.arg,n.modifiers]}).filter(e=>!!e)}function th(t,e){let n=t.directives;return n?(Array.isArray(n)||(n=[n]),it(e,n.reduce((i,o)=>i.concat(wT(o)),[]))):e}function ST(){const t={};function e(n){this.vm=n.vm,this.handle=n}return Fe(e.prototype,{make(n,i,o){return th(i,this.h(n,Kd(i),o))},makeComponent(n,i,o){try{return th(i,j(n,Kd(i),o))}catch(r){return console.error(r),j("")}},h(n,i,o){const r=(this.vm||Za()).appContext.config.isNativeTag(n),s=this.handle.fc.prop.components[n];!s&&r&&delete i.formCreateInject;try{return j(s||(r?n:Ue(n)),i,o)}catch(a){return console.error(a),j("")}},aliasMap:t}),Fe(e,{aliasMap:t,alias(n,i){t[n]=i},use(n){Object.keys(n).forEach(i=>{const o=Do(i),r=_m(i).toLocaleLowerCase(),s=n[i];e.alias(i,s),[i,o,r].forEach(a=>{e.prototype[a]=function(l,c){return this.make(t[i]||a,l,c)}})})}}),e}function CT(t){class e extends Dm{}return Object.assign(e.prototype,t),e}function Dm(t){Fe(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}Fe(Dm.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Ps()},init(){},update(){},beforeRender(){},form(){return this.vm.refs[this.ref]},adapterValidate(t,e){return t.validator=(n,i,o)=>e(i,o),t},getSlot(t){const e=n=>{if(n)return n.slots[t]||e(n.setupState.parent)};return e(this.vm)},mergeOptions(t,e){return Qn(t.map(n=>this.tidyOptions(n)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},fieldChange(t,e,n,i){},render(t){}});const ET=function(t){const e={name:"loadData",_fn:[],loaded(n,i,o){this.deleted(n),Ge(()=>{let r=Ut(n.getValue());const s=[];r.forEach(a=>{if(a&&(a.attr||a.template)){let l=d=>{let h;i&&i.__fc__&&(h=i.__fc__.getParentGroup());let m;a.template?m=t.$handle.loadStrVar(a.template,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null):a.handler&&pe.Function(a.handler)?m=a.handler(d,i,o):m=t.$handle.loadStrVar(`{{${a.attr}}}`,d,h?{rule:i,value:t.$handle.subRuleData[h.id]||{}}:null),(m==null||m==="")&&a.default!=null&&(m=a.default),a.copy!==!1&&(m=Mn(m));const f=a.modify?i:n.getProp();a.to==="child"?f.children?f.children[0]=m:f.children=[m]:fi(f,a.to||"options",m),o.sync(i)},c=d=>l(d);const u=t.watchLoadData(c);l=ci(l,a.wait||300),a.watch!==!1?s.push(u):u()}}),this._fn[n.id]=s})},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},xT=function(t){const e={name:"t",_fn:[],loaded(n,i,o){this.deleted(n);let r=n.getValue()||{};const s=[];Object.keys(r).forEach(a=>{const l=r[a];if(l){const c=typeof l=="object";let u=m=>{let f=t.t(c?l.attr:l,c?l.params:null,m);const p=c&&l.modify?i:n.getProp();a==="child"?p.children?p.children[0]=f:p.children=[f]:fi(p,a,f),o.sync(i)},d=m=>u(m);const h=t.watchLoadData(d);u=ci(u,l.wait||300),l.watch!==!1?s.push(h):h()}}),this._fn[n.id]=s},deleted(n){this._fn[n.id]&&(this._fn[n.id].forEach(i=>{i()}),delete this._fn[n.id]),n.clearProp()}};return e.watch=e.loaded,e},Lm={name:"componentValidate",load(t,e,n){let i=t.getValue();if(!i||i.method===!1)t.clearProp(),n.clearValidateState([e.field]);else{pe.Object(i)||(i={method:i});const o=i.method,r=en(Te({},i),{validator(...s){const a=On(e);if(a)return n.exec(a.id,pe.String(o)?o:"formCreateValidate",...s,{attr:t,rule:e,api:n})}});delete r.method,t.getProp().validate=[r]}},watch(...t){Lm.load(...t)}},TT=function(t){function e(o){return pe.String(o)&&(o={action:o,to:"options"}),o}function n(o,r,s){let a=o.value;i.deleted(o),pe.Function(a)&&(a=a(r,s)),a=e(a);const l=d=>{d===void 0?o.clearProp():fi(o.getProp(),a.to||"options",d),d!=null&&a&&a.key&&t.$handle.options.globalData[a.key]&&t.fetchCache.set(t.$handle.options.globalData[a.key],{status:!0,data:d}),s.sync(r)};if(!a||!a.action&&!a.key){l(void 0);return}a=Mn(a),a.to||(a.to="options");const c=a.onError,u=()=>{if(!o.getValue())return o.clearProp(),s.sync(r),!0};i._fn[o.id]=t.watchLoadData(ci((d,h)=>{if(h&&a.watch===!1)return i._fn[o.id]();if(a.key){t.targetRule=r;const p=d("$globalData."+a.key);if(delete t.targetRule,p){if(u())return;l(p)}return}const m=t.$handle.loadFetchVar(Mn(a),d,r),f=en(Te({headers:{}},m),{onSuccess(p,_){if(u())return;let C=S=>_?S:lt(S,"data")?S.data:S;const w=Dn(m.parse);pe.Function(w)?C=w:w&&pe.String(w)&&(C=S=>Pt(S,w)),as(C(p,r,s)).then(S=>{l(S)})},onError(p){l(void 0),!u()&&(c||(_=>Sc(_.message||"fetch fail "+m.action)))(p,r,s)}});t.$handle.beforeFetch(f,{rule:r,api:s}).then(()=>{if(pe.Function(m.action)){as(m.action(r,s)).then(p=>{f.onSuccess(p,!0)}).catch(p=>{f.onError(p)});return}Be(()=>t.create.fetch(f,{inject:o,rule:r,api:s}))}).catch(p=>{})},a.wait||600))}const i={name:"fetch",_fn:[],loaded(...o){n(...o)},watch(...o){n(...o)},deleted(o){this._fn[o.id]&&(this._fn[o.id](),delete this._fn[o.id]),o.clearProp()}};return i},$T={fetch:TT,loadData:ET,t:xT,componentValidate:Lm},kT="html",OT={name:kT,loadChildren:!1,render(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return{default:()=>t.filter(e=>pe.String(e)).join("")}}};function AT(t){t=t+"=";const e=decodeURIComponent(document.cookie).split(";");for(let n=0;n<e.length;n++){let i=e[n];for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0){i=i.substring(t.length,i.length);try{return JSON.parse(i)}catch{return i}}}return null}function PT(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function RT(t){const e=sessionStorage.getItem(t);if(e)try{return JSON.parse(e)}catch{return e}return null}function $c(t,e){if(!e)return null;const n=e.split(".");let i=t(n.shift());return n.length?i==null?null:Pt(i,n):i}function IT(t){return $c(AT,t)}function MT(t){return $c(PT,t)}function FT(t){return $c(RT,t)}const DT={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function LT(t,e){let n;return arguments.length===2?(n=arguments[1],e=n[t]):n=arguments[2],{id:e,prop:n}}function ha(){return LT("name",...arguments)}function jT(t){const e=t.key||[],n=t.array||[],i=t.normal||[];xm.push(...e),Cc.push(...n),Ec.push(...i),Im([...e,...n,...i])}let zT=1;const sn={},nh=Symbol("defValue");function jm(t){const e={[da.name]:da},n={},i={},o={},r={},s=[],a=[],l=[t.extendApi],c=Te({},$T),u=Jx();let d={global:{}};const h=t.isMobile===!0,m=Mt({$mobile:h}),f=ST(),p={},_={};jT(t.attrs||{});function C(k){const z=sn[k];if(Array.isArray(z))return z.map(D=>D.api());if(z)return z.api()}function w(k){s.push(k)}function S(){const k=ha(...arguments);k.id&&k.prop&&(i[k.id]=k.prop)}function b(){const k=ha(...arguments);k.id&&k.prop&&(c[k.id]=pe.Function(k.prop)?k.prop:en(Te({},k.prop),{name:k.id}))}function E(k){f.use(k)}function x(k){if(arguments.length===0)return To;if(typeof k=="string"&&arguments.length===1)return n[Vt(k)];const z=ha(...arguments);if(!z.id||!z.prop)return To;const D=Vt(z.id),B=z.prop,oe=B.merge===!0?n[D]:void 0;n[D]=Sr(B,oe||To),u[D]=Et(D),B.maker&&Fe(u,B.maker)}function O(k,z){let D;if(pe.String(k)){if(D=k,z===void 0)return e[D]}else D=k.displayName||k.name,z=k;if(!D||!z)return;const B=Vt(D);e[D]=z,e[B]=z,delete f.aliasMap[D],delete f.aliasMap[B],delete n[D],delete n[B],z.formCreateParser&&x(D,z.formCreateParser)}function $(){return Gx(re,e,i)}function K(k,z){const D=$();return ic({data(){return Mt({rule:k,option:z})},render(){return Oo(D,Te({ref:"fc"},this.$data))}})}function F(){return da}function P(k,z){return pe.Function(k.install)?k.install(N,z):pe.Function(k)&&k(N,z),this}function N(k,z){let D=K(k,z||{});s.forEach(oe=>{Be(()=>oe(N,D))});const B=document.createElement("div");return(z?.el||document.body).appendChild(B),D.mount(B).$refs.fc.fapi}Sr(N,_);function M(k){let z=Te({},t);return k?z.inherit={components:e,parsers:n,directives:i,modelFields:o,providers:c,useApps:s,maker:u,formulas:p,loadData:m}:delete z.inherit,jm(z)}function q(k,z){o[k]=z}function le(k,z){p[k]=z}function de(k,z){const D=r[k]||{},B=D.parsers||{};z.parsers&&Object.keys(z.parsers).forEach(oe=>{B[oe]=Sr(z.parsers[oe],To)}),z.name=k,r[k]=en(Te(Te({},D),z),{parsers:B})}function Y(k){k&&Object.keys(sn).forEach(z=>{(Array.isArray(sn[z])?sn[z]:[sn[z]]).forEach(D=>{D.bus.$emit("$loadData."+k)})})}function I(k,z){fi(m,k,z),Y(k)}function A(k,z){const D=(...B)=>Be(()=>z(...B));D._driver=!0,I(k,D)}function Q(k,z){const D=(k||"").split(".");k=D.shift();const B=D.join(".");if(lt(m,k)||(m[k]=nh),m[k]!==nh){let oe=m[k];return oe&&oe._driver?oe=oe(B):D.length&&(oe=Pt(oe,D)),oe==null||oe===""?z:oe}else return z}function U(k){l.push(k)}function ie(k){delete m[k],Y(k)}function ve(k,z){a.push({name:k,callback:z})}function re(k){Fe(this,{id:zT++,create:N,vm:k,manager:CT(t.manager),parsers:n,providers:c,modelFields:o,formulas:p,isMobile:h,rules:k.props.rule,name:k.props.name||Ps(),inFor:k.props.inFor,prop:{components:e,directives:i},get:null,drivers:r,renderDriver:null,refreshData:Y,loadData:m,CreateNode:f,bus:new gm,unwatch:[],options:H({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:Mt({})}),a.forEach(z=>{this.bus.$on(z.name,z.callback)}),Ge(()=>{$e(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),Fe(k.appContext.components,e),Fe(k.appContext.directives,i),this.$handle=new Nn(this),this.name&&(this.inFor?(sn[this.name]||(sn[this.name]=[]),sn[this.name].push(this)):sn[this.name]=this)}re.isMobile=h,Fe(re.prototype,{init(){this.isSub()&&this.unwatch.push($e(()=>this.vm.setupState.parent.setupState.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver=typeof this.vm.props.driver=="object"?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver(k,...z){if(this.bus.$emit(k,...z),this.renderDriver&&this.renderDriver[k])return Be(()=>this.renderDriver[k](...z))},t(k,z,D){let B=D?D("$t."+k):this.globalLanguageDriver(k);return B==null&&(B=""),B&&z&&Object.keys(z).forEach(oe=>{const ee=new RegExp(`{${oe}}`,"g");B=B.replace(ee,z[oe])}),B},globalDataDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalData&&this.options.value.globalData[D];if(B){if(B.type==="static")return Pt(B.data,z);{let oe;const ee=this.fetchCache.get(B);if(ee){if(ee.status&&(oe=Pt(ee.data,z)),!ee.loading)return oe;ee.loading=!1,this.fetchCache.set(B,ee)}else this.fetchCache.set(B,{status:!1});const G=ci(()=>{ke();const Ee=this.fetchCache.get(B);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf(B)!==-1?(Ee&&(Ee.loading=!0,this.fetchCache.set(B,Ee)),this.bus.$emit("$loadData.$globalData."+D)):this.fetchCache.delete(B)},B.wait||600),he=Ee=>{this.fetchCache.set(B,{status:!0,data:Ee}),this.bus.$emit("$loadData.$globalData."+D)},me=(Ee,ze)=>{if(ze&&B.watch===!1)return ke();if(ze){G();return}const Pe=this.$handle.loadFetchVar(vl(B),Ee);Pe.targetRule=this.targetRule,this.$handle.api.fetch(Pe).then(Ne=>{he(Ne)}).catch(Ne=>{he(null)})},ke=this.watchLoadData(me);return B.watch===!1&&ke(),this.unwatch.push(ke),oe}}},getLocale(){let k=this.vm.setupState.top.props.locale;return k&&typeof k=="object"?k.name:typeof k=="string"?k:"zh-cn"},globalLanguageDriver(k){let z=this.vm.setupState.top.props.t,D=this.vm.setupState.top.props.locale,B;if(z&&(B=Be(()=>z(k))),B==null&&D&&typeof D=="object"&&(B=Pt(D,k)),B==null){const oe=this.options.value.language||{},ee=this.getLocale();B=Pt(oe[ee]||{},k),B==null&&(B=Pt(DT[ee]||{},k))}return B},globalVarDriver(k){let z=k.split(".");const D=z.shift(),B=this.options.value.globalVariable&&this.options.value.globalVariable[D];if(B){const oe=pe.Function(B)?B:Dn(B.handle);if(oe){let ee=oe((...G)=>this.$handle.api.getData(...G),this.$handle.api);return Pt(ee,z)}}},setData(k,z,D){D?I(k,z):(fi(this.vm.setupState.top.setupState.fc.tmpData,k,z),this.bus.$emit("$loadData."+k))},getLoadData(k,z){let D=null;if(k!=null){let B=k.split(".");const oe=B.shift();if(D=Pt(this.vm.setupState.top.setupState.fc.tmpData,k),D!=null)return D;if(oe==="$topForm")D=this.$handle.api.top.formData(!0);else if(oe==="$scopeForm")D=this.$handle.api.scope.formData(!0);else if(oe==="$form")D=this.$handle.api.formData(!0);else if(oe==="$options")D=this.options.value;else if(oe==="$globalData")D=this.globalDataDriver(B.join(".")),B=[];else if(oe==="$var")D=this.globalVarDriver(B.join(".")),B=[];else if(oe==="$locale")D=this.getLocale(),B=[];else if(oe==="$t")D=this.globalLanguageDriver(B.join(".")),B=[];else{if(oe==="$preview")return this.$handle.preview;D=Q(k),B=[]}D&&B.length&&(D=Pt(D,B))}return D==null||D===""?z:D},watchLoadData(k,z){let D={};const B=G=>{this.get||(this.get=oe),Be(()=>{k(oe,G)}),this.get===oe&&(this.get=void 0)},oe=(G,he)=>{let me;if(typeof G=="object"&&(me=G.getValue,G=G.id),D[G])return D[G].val;const ke=te(()=>me?me():this.getLoadData(G,he)),Ee=G.split("."),ze=Ee.shift(),Pe=Ee.shift()||"",Ne=ci(()=>{const Qe=me?me():this.getLoadData(G,he);if(D[G])((Qe instanceof Function||pe.Object(Qe)||Array.isArray(Qe))&&Qe===D[G].val||JSON.stringify(Qe)!==JSON.stringify(D[G].val))&&(D[G].val=Qe,B(!0));else return},z||0),ut=$e(ke,Qe=>{Ne()});return this.bus.$on("$loadData."+ze,Ne),Pe&&this.bus.$on("$loadData."+ze+"."+Pe,Ne),D[G]={fn:()=>{this.bus.$off("$loadData."+ze,Ne),Pe&&this.bus.$off("$loadData."+ze+"."+Pe,Ne),ut()},val:ke.value},ke.value};B(!1);const ee=()=>{Object.keys(D).forEach(G=>D[G].fn()),D={}};return this.unwatch.push(ee),ee},isSub(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions(){this.options.value={};let k=Te({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},Mn(d));const z=this.isSub();z&&(k=this.mergeOptions(k,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),k=this.mergeOptions(k,this.vm.props.option);const D=this.api();this.targetFormDriver("initOptions",k,{api:D,isSubForm:z}),this.updateOptions(k)},mergeOptions(k,z,D){return z=Te({},z||{}),D&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","beforeUnmount","beforeSubmit","onBeforeUnmount","onReload","reload","formData","el","globalClass","style"].forEach(B=>{delete z[B]}),z.global&&(k.global=Kx(k.global,z.global),delete z.global),this.$handle.$manager.mergeOptions([z],k),k},updateOptions(k){this.options.value=this.mergeOptions(this.options.value,k),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(Be(()=>this.$handle.lifecycle("beforeUnmount")),this.name)if(this.inFor){const k=sn[this.name].indexOf(this);sn[this.name].splice(k,1)}else delete sn[this.name];a.forEach(k=>{this.bus.$off(k.name,k.callback)}),this.tmpData={},this.unwatch.forEach(k=>k()),this.unwatch=[],this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function ge(k){Fe(k,{version:t.version,ui:t.ui,isMobile:h,extendApi:U,getData:Q,setDataDriver:A,setData:I,removeData:ie,refreshData:Y,maker:u,component:O,directive:S,setModelField:q,setFormula:le,setDriver:de,register:b,$vnode:F,parser:x,use:P,factory:M,componentAlias:E,copyRule:km,copyRules:Om,mergeRule:Zn,fetch:Mm,$form:$,parseFn:Dn,parseJson:wm,toJson:Lo,useApp:w,getApi:C,on:ve})}function _e(k){Fe(k,{create:N,install(z,D){d=Te(Te({},d),D||{});const B=`_installedFormCreate${h?"Mobile":""}_${t.ui}`;if(z[B]===!0)return;z[B]=!0;const oe=function(G,he={}){return N(G,he)};ge(oe),z.config.globalProperties.$formCreate=oe;const ee=$();z.component(ee.name,ee),s.forEach(G=>{Be(()=>G(k,z))})}})}if(ge(_),_e(_),A("$cookie",IT),A("$localStorage",MT),A("$sessionStorage",FT),f.use({fragment:"fcFragment"}),t.install&&N.use(t),w((k,z)=>{z.mixin({props:["formCreateInject"]})}),x(OT),t.inherit){const k=t.inherit;k.components&&Fe(e,k.components),k.parsers&&Fe(n,k.parsers),k.directives&&Fe(i,k.directives),k.modelFields&&Fe(o,k.modelFields),k.providers&&Fe(c,k.providers),k.useApps&&Fe(s,k.useApps),k.maker&&Fe(u,k.maker),k.loadData&&Fe(m,k.loadData),k.formulas&&Fe(p,k.formulas)}const R=$();return Sr(R,_),Object.defineProperties(R,{fetch:{get(){return _.fetch},set(k){_.fetch=k}}}),R.util=_,R}const ih={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},oh="datePicker",NT={name:oh,maker:(function(){return["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((t,e)=>(t[e]=Et(oh,{type:e.toLowerCase()}),t),{})})(),mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat=ih[e.type]||ih.date)}},pa="hidden",UT={name:pa,maker:{[pa]:(t,e)=>Et(pa)("",t,e)},render(){return[]}},fa="input",VT={name:fa,maker:(function(){const t=["password","url","email","text","textarea"].reduce((e,n)=>(e[n]=Et(fa,{type:n}),e),{});return t.idate=Et(fa,{type:"date"}),t})(),mergeProp(t){let{props:e}=t.prop;e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},BT="textarea",HT={name:BT,mergeProp(t){let{props:e}=t.prop;e.type="textarea",e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},rh="slider",qT={name:rh,maker:{sliderRange:Et(rh,{range:!0})},toFormValue(t,e){let n=Array.isArray(t),i=e.prop.props,o=i.min||0,r;return i.range===!0?r=n?t:[o,parseFloat(t)||o]:r=n?parseFloat(t[0])||o:parseFloat(t),r}},ma="timePicker",WT={name:ma,maker:{time:Et(ma,t=>t.props.isRange=!1),timeRange:Et(ma,t=>t.props.isRange=!0)},mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")}},KT={name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},{default:()=>[e.vNode.row(e.prop,t)]})}},YT="select",GT={name:YT,toFormValue(t,e){return e.prop.props.multiple&&!Array.isArray(t)?Ut(t):t}},QT=[NT,UT,VT,HT,qT,WT,KT,GT],rt="el",XT={button:rt+"-button",icon:rt+"-icon",slider:rt+"-slider",rate:rt+"-rate",upload:"fc-upload",cascader:rt+"-cascader",popover:rt+"-popover",tooltip:rt+"-tooltip",colorPicker:rt+"-colorPicker",timePicker:rt+"-time-picker",timeSelect:rt+"-time-select",datePicker:rt+"-date-picker",switch:rt+"-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:rt+"-input-number",number:rt+"-input-number",input:rt+"-input",textarea:rt+"-input",formItem:rt+"-form-item",form:rt+"-form",frame:"fc-frame",col:rt+"-col",row:rt+"-row",tree:"fc-tree",inputTag:rt+"-input-tag",inputOtp:rt+"-input-otp",mention:rt+"-mention",transfer:rt+"-transfer",treeSelect:rt+"-tree-select",autoComplete:rt+"-autocomplete",auto:rt+"-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function JT(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}}function ZT(t){return t.type==="tooltip"}function sh(t,e){lt(t,e)&&pe.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function Vn(t){return t===!1}function e$(t,e){lt(t,e)&&!pe.Object(t[e])&&(t[e]={show:!!t[e]})}function va(t){const e=Te({},t);return delete e.children,e}const t$={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){return new Promise((e,n)=>{const i=this.form();i?i.validateField(t,(o,r)=>{r?n(r):e(o)}):e()})},clearValidateState(t){const e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},fieldChange(t,e,n,i){var o,r;i||(r=(o=this.vm.refs[t.wrapRef])==null?void 0:o.validate("change"))==null||r.catch(()=>{})},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{e$(t,e)}),t},tidyRule({prop:t}){return sh(t,"title"),sh(t,"info"),t},mergeProp(t){const e={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(n=>{t.prop[n]=Qn([this.options[n]||{},t.prop[n]||{}],e[n])})},getDefaultOptions(){return JT()},update(){const t=this.options.form;this.rule={props:Te({},t),on:{submit:e=>{e.preventDefault()}},style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:n}=this,i=this.options.form;Fe(this.rule,{key:t,ref:e,class:[i.className,i.class,"form-create",this.$handle.preview?"is-preview":""]}),Fe(this.rule.props,{model:n.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Vn(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const n=t.prop,i=`${this.key}${t.key}`,o=n.col,r=this.isTitle(n)&&n.wrap.title!==!1,s=!o.labelWidth&&!r?0:o.labelWidth,{inline:a,col:l}=this.rule.props,c=n.wrap.class;delete n.wrap.class,delete n.wrap.title;const u=(pe.Undef(n.wrap.show)?!t.input:Vn(n.wrap.show))?e:this.$r(Qn([n.wrap,{props:en(Te({labelWidth:s===void 0?s:_m(s),label:r?n.title.title:void 0},va(n.wrap||{})),{prop:t.id,rules:t.injectValidate()}),class:this.$render.mergeClass(c||n.className,"fc-form-item"),key:`${i}fi`,ref:t.wrapRef,type:"formItem"}]),Te({default:()=>e},r?{label:()=>this.makeInfo(n,i,t)}:{}));return a===!0||Vn(l)||Vn(o.show)?u:this.makeCol(n,i,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||Vn(e.show))},makeInfo(t,e,n){var i,o,r,s,a,l;const c=Te({},t.title),u=Te({},t.info),d=ZT(u),h=this.options.form,m=this.getSlot("title"),f=[m?m({title:(o=(i=n.refRule)==null?void 0:i.__$title)==null?void 0:o.value,rule:n.rule,options:this.options}):((s=(r=n.refRule)==null?void 0:r.__$title)==null?void 0:s.value)+(h.labelSuffix||h["label-suffix"]||"")];if(!Vn(u.show)&&(u.info||u.native)&&!Vn(u.icon)){const _={type:u.type||"popover",props:va(u),key:`${e}pop`};delete _.props.icon,delete _.props.show,delete _.props.info,delete _.props.align,delete _.props.native;const C="content";u.info&&!lt(_.props,C)&&(_.props[C]=(l=(a=n.refRule)==null?void 0:a.__$info)==null?void 0:l.value),f[u.align!=="left"?"unshift":"push"](this.$r(Qn([u,_]),{[c.slot||(d?"default":"reference")]:()=>this.$r({type:"ElIcon",style:"top:2px",key:`${e}i`},{default:()=>this.$r({type:u.icon===!0?"icon-warning":u.icon})},!0)}))}const p=Qn([c,{props:va(c),key:`${e}tit`,class:"fc-form-title",type:c.type||"span",on:{click:(..._)=>{this.$handle.targetHook(n,"titleClick",{args:_})}}}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,f)},makeCol(t,e,n){const i=Te({},t.col);return delete i.show,this.$r({class:this.$render.mergeClass(i.class,"fc-form-col"),type:"col",props:i||{span:24},key:`${e}col`},n)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(Vn(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),Vn(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;const e=this.$r({type:"formItem",class:"fc-form-item",key:`${this.key}fb`},t);return this.rule.props.inline===!0?e:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:`${this.key}fc`},[e])},makeResetBtn(){const t=Te({},this.options.resetBtn),e=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(n):n.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=Te({},this.options.submitBtn),e=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const n=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(n):n.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},mi={};n$(mi);i$(mi);o$(mi);r$(mi);s$(mi);a$(mi);function n$(t){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","inputTag","inputOtp","mention","transfer","treeSelect","radio","rate"].forEach(e=>{t[e]=Et(e)}),t.auto=t.autoComplete,t.number=t.inputNumber,t.color=t.colorPicker,t.tag=t.inputTag}function i$(t){t.treeSelectMultiple=Et("treeSelect",{multiple:!0})}function o$(t){const e="select",n="multiple";t.selectMultiple=Et(e,{[n]:!0}),t.selectOne=Et(e,{[n]:!1})}function r$(t){const e="tree",n={treeSelected:"selected",treeChecked:"checked"};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,{type:n[o]}),i),t)}function s$(t){const e="upload",n={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(n).reduce((i,o)=>(i[o]=Et(e,r=>r.props({uploadType:n[o][0],maxLength:n[o][1]})),i),t),t.uploadImage=t.image,t.uploadFile=t.file}function a$(t){const e={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};return Object.keys(e).reduce((n,i)=>(n[i]=Et("frame",o=>o.props({type:e[i][0],maxLength:e[i][1]})),n),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages,t}function ah(t,e){return pe.Boolean(t)?t={show:t}:!pe.Undef(t)&&!pe.Object(t)&&(t={show:e}),t}function l$(t,e){return{formEl(){return e.$manager.form()},wrapEl(n){const i=e.getFieldCtx(n);if(i)return e.vm.refs[i.wrapRef]},validate(n){return new Promise((i,o)=>{const r=t.children,s=[e.$manager.validate()];r.filter(a=>!a.isScope).forEach(a=>{s.push(a.validate())}),Promise.all(s).then(()=>{i(!0),n&&n(!0)}).catch(a=>{o(a),n&&n(a),e.vm.emit("validate-fail",a,{api:t}),e.emitEvent("validate-fail",a,{api:t})})})},validateField(n,i){return new Promise((o,r)=>{const s=typeof n=="object"?On(n):e.getCtx(n);if(!s){o(null),i&&i(null);return}const a=e.subForm[s.id],l=[e.$manager.validateField(s.id)];Ut(a).filter(c=>!c.isScope).forEach(c=>{l.push(c.validate())}),Promise.all(l).then(()=>{o(null),i&&i(null)}).catch(c=>{r(c),i&&i(c),e.vm.emit("validate-field-fail",c,{field:n,api:t})})})},validateFields(n,i){return new Promise((o,r)=>{Array.isArray(n)||(n=[n]);const s=n.map(a=>t.validateField(a));Promise.all(s).then(()=>{o(null),i&&i(null)}).catch(a=>{r(a),i&&i(a)})})},clearValidateState(n,i=!0){t.helper.tidyFields(n).forEach(o=>{i&&this.clearSubValidateState(o),e.getCtxs(o).forEach(r=>{e.$manager.clearValidateState(r)})})},clearSubValidateState(n){t.helper.tidyFields(n).forEach(i=>{e.getCtxs(i).forEach(o=>{const r=e.subForm[o.id];r&&(Array.isArray(r)?r.forEach(s=>{s.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(n=!0)=>{t.submitBtnProps({loading:!!n})},disabled:(n=!0)=>{t.submitBtnProps({disabled:!!n})},show:(n=!0)=>{t.submitBtnProps({show:!!n})}},resetBtn:{loading:(n=!0)=>{t.resetBtnProps({loading:!!n})},disabled:(n=!0)=>{t.resetBtnProps({disabled:!!n})},show:(n=!0)=>{t.resetBtnProps({show:!!n})}},submitBtnProps:(n={})=>{let i=ah(e.options.submitBtn,!0);Fe(i,n),e.options.submitBtn=i,t.refreshOptions()},resetBtnProps:(n={})=>{let i=ah(e.options.resetBtn,!1);Fe(i,n),e.options.resetBtn=i,t.refreshOptions()},submit(n,i){return new Promise((o,r)=>{(e.options.validateOnSubmit===!1?Promise.resolve():t.validate()).then(()=>{let s=t.formData();e.beforeSubmit(s).then(()=>{pe.Function(n)&&Be(()=>n(s,t)),pe.Function(e.options.onSubmit)&&Be(()=>e.options.onSubmit(s,t)),e.vm.emit("submit",s,t),o(s)}).catch(a=>{})}).catch((...s)=>{pe.Function(i)&&Be(()=>i(t,...s)),r(...s)})})}}}const zm={name:"required",load(t,e,n){const i=c$(t.getValue());let o;if(i.required===!1)t.clearProp(),n.clearValidateState([e.field]);else{const r=Te({required:!0,validator(a,l,c){s(),pe.empty(l)?c(r.message):c()}},i),s=()=>{var a;const l=(a=e.__fc__.refRule.__$title)==null?void 0:a.value;if(o!==l)if(o=l,!i.message)r.message=n.t("required",{title:l})||l+(n.getLocale()==="en"?" is required":"不能为空");else{const c=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);c&&(r.message=n.t(c[1],{title:l}))}};s(),t.getProp().validate=[r]}n.sync(e)},watch(...t){zm.load(...t)}};function c$(t){return pe.Boolean(t)?{required:t}:pe.String(t)?{message:t}:pe.Undef(t)?{required:!1}:pe.Function(t)?{validator:t}:pe.Object(t)?t:{}}function u$(t){t.componentAlias(XT),qx.forEach(e=>{t.component(e.name,e)}),t.register(zm),QT.forEach(e=>{t.parser(e)}),Object.keys(mi).forEach(e=>{t.maker[e]=mi[e]}),typeof window<"u"&&window.ElementPlus&&t.useApp((e,n)=>{n.use(window.ElementPlus)})}function d$(){return jm({ui:"element-ui",version:"3.3.0",manager:t$,extendApi:l$,install:u$,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const Rs=d$();typeof window<"u"&&(window.formCreate=Rs);Rs.maker;function h$(t){t.useApp((e,n)=>{n.component(tl.name)||n.use(tl),n.component(Gi.name)||n.use(Gi),n.component(Pu.name)||n.use(Pu),n.component(Ru.name)||n.use(Ru),n.component(Iu.name)||n.use(Iu),n.component(il.name)||n.use(il),n.component(Mu.name)||n.use(Mu),n.component(nl.name)||n.use(nl),n.component(Fu.name)||n.use(Fu),n.component(Du.name)||n.use(Du),n.component(Lu.name)||n.use(Lu),n.component(ju.name)||n.use(ju),n.component(zu.name)||n.use(zu),n.component(Nu.name)||n.use(Nu),n.component(Uu.name)||n.use(Uu),n.component(Vu.name)||n.use(Vu),n.component(Bu.name)||n.use(Bu),n.component(Hu.name)||n.use(Hu),n.component(qu.name)||n.use(qu),n.component(Wu.name)||n.use(Wu),n.component(Ku.name)||n.use(Ku),n.component(Yu.name)||n.use(Yu),n.component(Gu.name)||n.use(Gu),n.component(Qu.name)||n.use(Qu),n.component(Xu.name)||n.use(Xu),n.component(Po.name)||n.use(Po),n.component(Ju.name)||n.use(Ju),n.component(Zu.name)||n.use(Zu),n.component(ed.name)||n.use(ed),n.component(td.name)||n.use(td),n.component(nd.name)||n.use(nd),n.component(id.name)||n.use(id)})}Rs.use(h$);function p$(t){t.use(Rs)}async function f$(){}function m$(t){t.use(Lw,{paginationStorage:{get:()=>Bb(),set:e=>Hb(e)}})}function v$(t){t.directive("loading",qp)}function g$(t){return{all:t=t||new Map,on:function(e,n){var i=t.get(e);i?i.push(n):t.set(e,[n])},off:function(e,n){var i=t.get(e);i&&(n?i.splice(i.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var i=t.get(e);i&&i.slice().map(function(o){o(n)}),(i=t.get("*"))&&i.slice().map(function(o){o(e,n)})}}}function Oe(t){let e=Go();if(typeof window<"u"){let n=t.subscribe(i=>{e.value=i});C_()&&E_(n)}else e.value=t.get();return e}let mn=[],ti=0;const Cr=4,Gr=globalThis.nanostoresGlobal||={epoch:0},Tt=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(i){return n.lc=e.push(i),()=>{for(let r=ti+Cr;r<mn.length;)mn[r]===i?mn.splice(r,Cr):r+=Cr;let o=e.indexOf(i);~o&&(e.splice(o,1),--n.lc||n.off())}},notify(i,o){Gr.epoch++;let r=!mn.length;for(let s of e)mn.push(s,n.value,i,o);if(r){for(ti=0;ti<mn.length;ti+=Cr)mn[ti](mn[ti+1],mn[ti+2],mn[ti+3]);mn.length=0}},off(){},set(i){let o=n.value;o!==i&&(n.value=i,n.notify(o))},subscribe(i){let o=n.listen(i);return i(n.value),o},value:t};return n},_$=5,Er=6,xr=10;let y$=(t,e,n,i)=>(t.events=t.events||{},t.events[n+xr]||(t.events[n+xr]=i(o=>{t.events[n].reduceRight((r,s)=>(s(r),r),{shared:{},...o})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let o=t.events[n],r=o.indexOf(e);o.splice(r,1),o.length||(delete t.events[n],t.events[n+xr](),delete t.events[n+xr])});const b$=1e3;let Nm=(t,e)=>y$(t,i=>{let o=e(i);o&&t.events[Er].push(o)},_$,i=>{let o=t.listen;t.listen=(...s)=>(!t.lc&&!t.active&&(t.active=!0,i()),o(...s));let r=t.off;return t.events[Er]=[],t.off=()=>{r(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let s of t.events[Er])s();t.events[Er]=[]}},b$)},()=>{t.listen=o,t.off=r}}),w$=(t,e,n)=>{Array.isArray(t)||(t=[t]);let i,o,r=()=>{if(o===Gr.epoch)return;o=Gr.epoch;let c=t.map(u=>u.get());if(!i||c.some((u,d)=>u!==i[d])){i=c;let u=e(...c);u&&u.then&&u.t?u.then(d=>{i===c&&s.set(d)}):(s.set(u),o=Gr.epoch)}},s=Tt(void 0),a=s.get;s.get=()=>(r(),a());let l=r;return Nm(s,()=>{let c=t.map(u=>u.listen(l));return r(),()=>{for(let u of c)u()}}),s};const ri=(t,e)=>w$(t,e);let lh=t=>t,Hn={},bl={addEventListener(){},removeEventListener(){}};function S$(){try{return typeof localStorage<"u"}catch{return!1}}S$()&&(Hn=localStorage);let C$={addEventListener(t,e,n){window.addEventListener("storage",e),window.addEventListener("pageshow",n)},removeEventListener(t,e,n){window.removeEventListener("storage",e),window.removeEventListener("pageshow",n)}};typeof window<"u"&&(bl=C$);function Um(t,e,n={}){let i=n.encode||lh,o=n.decode||lh,r=Hn[t],s=Tt(t in Hn?o(r):e),a=s.set;s.set=u=>{r=i(u),typeof r>"u"?delete Hn[t]:Hn[t]=r,a(u)};function l(u){u.key===t?u.newValue===null?a(e):a(o(u.newValue)):t in Hn||a(e)}function c(){r!==Hn[t]&&s.set(t in Hn?o(Hn[t]):e)}return Nm(s,()=>{if(c(),n.listen!==!1)return bl.addEventListener(t,l,c),()=>{bl.removeEventListener(t,l,c)}}),s}let wl=1;var E$=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)});publish=t=>{this.subscribers.forEach(e=>e(t))};addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]};create=t=>{const{message:e,...n}=t,i=typeof t.id=="number"||t.id&&t.id?.length>0?t.id:wl++,o=this.toasts.find(s=>s.id===i),r=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:e}),{...s,...t,id:i,dismissible:r,title:e}):s):this.addToast({title:e,...n,dismissible:r,id:i}),i};dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),t);message=(t,e)=>this.create({...e,message:t,type:"default"});error=(t,e)=>this.create({...e,type:"error",message:t});success=(t,e)=>this.create({...e,type:"success",message:t});info=(t,e)=>this.create({...e,type:"info",message:t});warning=(t,e)=>this.create({...e,type:"warning",message:t});loading=(t,e)=>this.create({...e,type:"loading",message:t});promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,r;const s=i.then(async l=>{if(r=["resolve",l],Ui(l))o=!1,this.create({id:n,type:"default",message:l});else if(T$(l)&&!l.ok){o=!1;const u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...m})}else if(l instanceof Error){o=!1;const u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:d,...m})}else if(e.success!==void 0){o=!1;const u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description,m=typeof u=="object"&&!Ui(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"success",description:d,...m})}}).catch(async l=>{if(r=["reject",l],e.error!==void 0){o=!1;const c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description,h=typeof c=="object"&&!Ui(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:u,...h})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),e.finally?.()}),a=()=>new Promise((l,c)=>s.then(()=>r[0]==="reject"?c(r[1]):l(r[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})};custom=(t,e)=>{const n=e?.id||wl++,i=this.toasts.find(r=>r.id===n),o=e?.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),i?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:t,dismissible:o,id:n,...e}),{...r,component:t,dismissible:o,id:n,...e}):r):this.addToast({component:t,dismissible:o,id:n,...e}),n};getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id))};const jt=new E$;function x$(t,e){const n=e?.id||wl++;return jt.create({message:t,id:n,type:"default",...e}),n}const T$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",$$=x$,k$=()=>jt.toasts,O$=()=>jt.getActiveToasts(),Tr=Object.assign($$,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:k$,getToasts:O$});function $r(t){return t.label!==void 0}const A$=3,Vm="24px",Bm="16px",ch=4e3,P$=356,R$=14,I$=45,Hm=200;function M$(){const t=H(!1);return zt(()=>{const e=()=>{t.value=document.hidden};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)}),{isDocumentHidden:t}}function ni(...t){return t.filter(Boolean).join(" ")}function F$(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}function D$(t,e){const n={};return[t,e].forEach((i,o)=>{const r=o===1,s=r?"--mobile-offset":"--offset",a=r?Bm:Vm;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof i=="number"||typeof i=="string"?l(i):typeof i=="object"?["top","right","bottom","left"].forEach(c=>{i[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof i[c]=="number"?`${i[c]}px`:i[c]}):l(a)}),n}const L$=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],j$=["aria-label","data-disabled","data-close-button-position"];var z$=Ce({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(t,{emit:e}){const n=t,i=e,o=H(null),r=H(null),s=H(!1),a=H(!1),l=H(!1),c=H(!1),u=H(!1),d=H(0),h=H(0),m=H(n.toast.duration||n.duration||ch),f=H(null),p=H(null),_=te(()=>n.index===0),C=te(()=>n.index+1<=n.visibleToasts),w=te(()=>n.toast.type),S=te(()=>n.toast.dismissible!==!1),b=te(()=>n.toast.class||""),E=te(()=>n.descriptionClass||""),x=te(()=>{const R=n.toast.position||n.position,z=n.heights.filter(D=>D.position===R).findIndex(D=>D.toastId===n.toast.id);return z>=0?z:0}),O=te(()=>{const R=n.toast.position||n.position;return n.heights.filter(z=>z.position===R).reduce((z,D,B)=>B>=x.value?z:z+D.height,0)}),$=te(()=>x.value*n.gap+O.value||0),K=te(()=>n.toast.closeButton??n.closeButton),F=te(()=>n.toast.duration||n.duration||ch),P=H(0),N=H(0),M=H(null),q=te(()=>n.position.split("-")),le=te(()=>q.value[0]),de=te(()=>q.value[1]),Y=te(()=>typeof n.toast.title!="string"),I=te(()=>typeof n.toast.description!="string"),{isDocumentHidden:A}=M$(),Q=te(()=>w.value&&w.value==="loading");et(()=>{s.value=!0,m.value=F.value}),zt(async()=>{if(!s.value||!p.value)return;await Ge();const R=p.value,k=R.style.height;R.style.height="auto";const z=R.getBoundingClientRect().height;R.style.height=k,h.value=z,i("update:height",{toastId:n.toast.id,height:z,position:n.toast.position||n.position})});function U(){a.value=!0,d.value=$.value,setTimeout(()=>{i("removeToast",n.toast)},Hm)}function ie(){if(Q.value||!S.value)return{};U(),n.toast.onDismiss?.(n.toast)}function ve(R){R.button!==2&&(Q.value||!S.value||(f.value=new Date,d.value=$.value,R.target.setPointerCapture(R.pointerId),R.target.tagName!=="BUTTON"&&(l.value=!0,M.value={x:R.clientX,y:R.clientY})))}function re(){if(c.value||!S.value)return;M.value=null;const R=Number(p.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),k=Number(p.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),z=new Date().getTime()-(f.value?.getTime()||0),D=o.value==="x"?R:k,B=Math.abs(D)/z;if(Math.abs(D)>=I$||B>.11){d.value=$.value,n.toast.onDismiss?.(n.toast),o.value==="x"?r.value=R>0?"right":"left":r.value=k>0?"down":"up",U(),c.value=!0;return}else p.value?.style.setProperty("--swipe-amount-x","0px"),p.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,l.value=!1,o.value=null}function ge(R){if(!M.value||!S.value||(window?.getSelection()?.toString()?.length??!1))return;const z=R.clientY-M.value.y,D=R.clientX-M.value.x,B=n.swipeDirections??F$(n.position);!o.value&&(Math.abs(D)>1||Math.abs(z)>1)&&(o.value=Math.abs(D)>Math.abs(z)?"x":"y");let oe={x:0,y:0};const ee=G=>1/(1.5+Math.abs(G)/20);if(o.value==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&z<0||B.includes("bottom")&&z>0)oe.y=z;else{const G=z*ee(z);oe.y=Math.abs(G)<Math.abs(z)?G:z}}else if(o.value==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&D<0||B.includes("right")&&D>0)oe.x=D;else{const G=D*ee(D);oe.x=Math.abs(G)<Math.abs(D)?G:D}(Math.abs(oe.x)>0||Math.abs(oe.y)>0)&&(u.value=!0),p.value?.style.setProperty("--swipe-amount-x",`${oe.x}px`),p.value?.style.setProperty("--swipe-amount-y",`${oe.y}px`)}et(()=>{if(s.value=!0,!p.value)return;const R=p.value.getBoundingClientRect().height;h.value=R;const k=[{toastId:n.toast.id,height:R,position:n.toast.position},...n.heights];i("update:heights",k)}),bs(()=>{p.value&&i("removeToast",n.toast)}),zt(R=>{if(n.toast.promise&&w.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let k;const z=()=>{if(N.value<P.value){const B=new Date().getTime()-P.value;m.value=m.value-B}N.value=new Date().getTime()},D=()=>{m.value!==1/0&&(P.value=new Date().getTime(),k=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),U()},m.value))};n.expanded||n.interacting||A.value?z():D(),R(()=>{clearTimeout(k)})}),$e(()=>n.toast.delete,R=>{R!==void 0&&R&&(U(),n.toast.onDismiss?.(n.toast))},{deep:!0});function _e(){l.value=!1,o.value=null,M.value=null}return(R,k)=>(y(),T("li",{tabindex:"0",ref_key:"toastRef",ref:p,class:Ae(v(ni)(n.class,b.value,R.classes?.toast,R.toast.classes?.toast,R.classes?.[w.value],R.toast?.classes?.[w.value])),"data-sonner-toast":"","data-rich-colors":R.toast.richColors??R.defaultRichColors,"data-styled":!(R.toast.component||R.toast?.unstyled||R.unstyled),"data-mounted":s.value,"data-promise":!!R.toast.promise,"data-swiped":u.value,"data-removed":a.value,"data-visible":C.value,"data-y-position":le.value,"data-x-position":de.value,"data-index":R.index,"data-front":_.value,"data-swiping":l.value,"data-dismissible":S.value,"data-type":w.value,"data-invert":R.toast.invert||R.invert,"data-swipe-out":c.value,"data-swipe-direction":r.value,"data-expanded":!!(R.expanded||R.expandByDefault&&s.value),"data-testid":R.toast.testId,style:At({"--index":R.index,"--toasts-before":R.index,"--z-index":R.toasts.length-R.index,"--offset":`${a.value?d.value:$.value}px`,"--initial-height":R.expandByDefault?"auto":`${h.value}px`,...R.style,...n.toast.style}),onDragend:_e,onPointerdown:ve,onPointerup:re,onPointermove:ge},[K.value&&!R.toast.component&&w.value!=="loading"?(y(),T("button",{key:0,"aria-label":R.closeButtonAriaLabel||"Close toast","data-disabled":Q.value,"data-close-button":"true","data-close-button-position":R.closeButtonPosition,class:Ae(v(ni)(R.classes?.closeButton,R.toast?.classes?.closeButton)),onClick:ie},[R.icons?.close?(y(),ne($t(R.icons?.close),{key:0})):Ve(R.$slots,"close-icon",{key:1})],10,j$)):ue("v-if",!0),R.toast.component?(y(),ne($t(R.toast.component),We({key:1},R.toast.componentProps,{onCloseToast:ie,isPaused:R.$props.expanded||R.$props.interacting||v(A)}),null,16,["isPaused"])):(y(),T(Ie,{key:2},[w.value!=="default"||R.toast.icon||R.toast.promise?(y(),T("div",{key:0,"data-icon":"",class:Ae(v(ni)(R.classes?.icon,R.toast?.classes?.icon))},[R.toast.icon?(y(),ne($t(R.toast.icon),{key:0})):(y(),T(Ie,{key:1},[w.value==="loading"?Ve(R.$slots,"loading-icon",{key:0}):w.value==="success"?Ve(R.$slots,"success-icon",{key:1}):w.value==="error"?Ve(R.$slots,"error-icon",{key:2}):w.value==="warning"?Ve(R.$slots,"warning-icon",{key:3}):w.value==="info"?Ve(R.$slots,"info-icon",{key:4}):ue("v-if",!0)],64))],2)):ue("v-if",!0),g("div",{"data-content":"",class:Ae(v(ni)(R.classes?.content,R.toast?.classes?.content))},[g("div",{"data-title":"",class:Ae(v(ni)(R.classes?.title,R.toast.classes?.title))},[Y.value?(y(),ne($t(R.toast.title),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.title),1)],64))],2),R.toast.description?(y(),T("div",{key:0,"data-description":"",class:Ae(v(ni)(R.descriptionClass,E.value,R.classes?.description,R.toast.classes?.description))},[I.value?(y(),ne($t(R.toast.description),wn(We({key:0},R.toast.componentProps)),null,16)):(y(),T(Ie,{key:1},[Ke(L(R.toast.description),1)],64))],2)):ue("v-if",!0)],2),R.toast.cancel?(y(),T("button",{key:1,style:At(R.toast.cancelButtonStyle||R.cancelButtonStyle),class:Ae(v(ni)(R.classes?.cancelButton,R.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:k[0]||(k[0]=z=>{v($r)(R.toast.cancel)&&S.value&&(R.toast.cancel.onClick?.(z),U())})},L(v($r)(R.toast.cancel)?R.toast.cancel?.label:R.toast.cancel),7)):ue("v-if",!0),R.toast.action?(y(),T("button",{key:2,style:At(R.toast.actionButtonStyle||R.actionButtonStyle),class:Ae(v(ni)(R.classes?.actionButton,R.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:k[1]||(k[1]=z=>{v($r)(R.toast.action)&&(R.toast.action.onClick?.(z),!z.defaultPrevented&&U())})},L(v($r)(R.toast.action)?R.toast.action?.label:R.toast.action),7)):ue("v-if",!0)],64))],46,L$))}}),N$=z$,or=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n};const U$={},V$={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function B$(t,e){return y(),T("svg",V$,e[0]||(e[0]=[g("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),g("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var H$=or(U$,[["render",B$]]);const q$=["data-visible"],W$={class:"sonner-spinner"};var K$=Ce({__name:"Loader",props:{visible:{type:Boolean}},setup(t){const e=Array(12).fill(0);return(n,i)=>(y(),T("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[g("div",W$,[(y(!0),T(Ie,null,He(v(e),o=>(y(),T("div",{key:`spinner-bar-${o}`,class:"sonner-loading-bar"}))),128))])],8,q$))}}),Y$=K$;const G$={},Q$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function X$(t,e){return y(),T("svg",Q$,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var J$=or(G$,[["render",X$]]);const Z$={},ek={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function tk(t,e){return y(),T("svg",ek,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var nk=or(Z$,[["render",tk]]);const ik={},ok={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function rk(t,e){return y(),T("svg",ok,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var sk=or(ik,[["render",rk]]);const ak={},lk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function ck(t,e){return y(),T("svg",lk,e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var uk=or(ak,[["render",ck]]);const dk=["aria-label"],hk=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],pk=typeof window<"u"&&typeof document<"u";function fk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var mk=Ce({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:R$},visibleToasts:{default:A$},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:Vm},mobileOffset:{default:Bm},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(t){const e=t,n=tc(),i=H([]),o=te(()=>e.id?i.value.filter(F=>F.toasterId===e.id):i.value.filter(F=>!F.toasterId));function r(F,P){return o.value.filter(N=>!N.position&&P===0||N.position===F)}const s=te(()=>{const F=o.value.filter(P=>P.position).map(P=>P.position);return F.length>0?Array.from(new Set([e.position].concat(F))):[e.position]}),a=te(()=>{const F={};return s.value.forEach(P=>{F[P]=i.value.filter(N=>N.position===P)}),F}),l=H([]),c=H({}),u=H(!1);zt(()=>{s.value.forEach(F=>{F in c.value||(c.value[F]=!1)})});const d=H(e.theme!=="system"?e.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),h=H(null),m=H(null),f=H(!1),p=e.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function _(F){i.value.find(P=>P.id===F.id)?.delete||jt.dismiss(F.id),i.value=i.value.filter(({id:P})=>P!==F.id),setTimeout(()=>{i.value.find(P=>P.id===F.id)||(l.value=l.value.filter(P=>P.toastId!==F.id))},Hm+50)}function C(F){f.value&&!F.currentTarget?.contains?.(F.relatedTarget)&&(f.value=!1,m.value&&(m.value.focus({preventScroll:!0}),m.value=null))}function w(F){F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||f.value||(f.value=!0,m.value=F.relatedTarget)}function S(F){F.target&&F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||(u.value=!0)}zt(F=>{const P=jt.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{i.value=i.value.map(M=>M.id===N.id?{...M,delete:!0}:M)});return}Ge(()=>{const M=i.value.findIndex(q=>q.id===N.id);M!==-1?i.value=[...i.value.slice(0,M),{...i.value[M],...N},...i.value.slice(M+1)]:i.value=[N,...i.value]})});F(P)}),zt(F=>{if(typeof window>"u")return;if(e.theme!=="system"){d.value=e.theme;return}const P=window.matchMedia("(prefers-color-scheme: dark)"),N=q=>{d.value=q?"dark":"light"};N(P.matches);const M=q=>{N(q.matches)};try{P.addEventListener("change",M)}catch{P.addListener(M)}F(()=>{try{P.removeEventListener("change",M)}catch{P.removeListener(M)}})}),zt(()=>{h.value&&m.value&&(m.value.focus({preventScroll:!0}),m.value=null,f.value=!1)}),zt(()=>{i.value.length<=1&&Object.keys(c.value).forEach(F=>{c.value[F]=!1})}),zt(F=>{function P(N){const M=e.hotkey.every(de=>N[de]||N.code===de),q=Array.isArray(h.value)?h.value[0]:h.value;M&&(s.value.forEach(de=>{c.value[de]=!0}),q?.focus());const le=document.activeElement===h.value||q?.contains(document.activeElement);N.code==="Escape"&&le&&s.value.forEach(de=>{c.value[de]=!1})}pk&&(document.addEventListener("keydown",P),F(()=>{document.removeEventListener("keydown",P)}))});function b(F){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!0}function E(F){if(!u.value){const P=F.currentTarget,N=P.getAttribute("data-y-position")+"-"+P.getAttribute("data-x-position");c.value[N]=!1}}function x(){Object.keys(c.value).forEach(F=>{c.value[F]=!1})}function O(){u.value=!1}function $(F){l.value=F}function K(F){const P=l.value.findIndex(N=>N.toastId===F.toastId);if(P!==-1)l.value[P]=F;else{const N=l.value.findIndex(M=>M.position===F.position);N!==-1?l.value.splice(N,0,F):l.value.unshift(F)}}return(F,P)=>(y(),T(Ie,null,[ue(" Remove item from normal navigation flow, only available via hotkey "),g("section",{"aria-label":`${F.containerAriaLabel} ${v(p)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(y(!0),T(Ie,null,He(s.value,(N,M)=>(y(),T("ol",We({key:N,ref_for:!0,ref_key:"listRef",ref:h,"data-sonner-toaster":"","data-sonner-theme":d.value,class:e.class,dir:F.dir==="auto"?fk():F.dir,tabIndex:-1,"data-theme":F.theme,"data-rich-colors":F.richColors,"data-y-position":N.split("-")[0],"data-x-position":N.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${v(P$)}px`,"--gap":`${F.gap}px`,...F.style,...v(n).style,...v(D$)(F.offset,F.mobileOffset)}},{ref_for:!0},F.$attrs,{onBlur:C,onFocus:w,onMouseenter:b,onMousemove:b,onMouseleave:E,onDragend:x,onPointerdown:S,onPointerup:O}),[(y(!0),T(Ie,null,He(r(N,M),(q,le)=>(y(),ne(N$,{key:q.id,heights:l.value,icons:F.icons,index:le,toast:q,defaultRichColors:F.richColors,duration:F.toastOptions?.duration??F.duration,class:Ae(F.toastOptions?.class??""),descriptionClass:F.toastOptions?.descriptionClass,invert:F.invert,visibleToasts:F.visibleToasts,closeButton:F.toastOptions?.closeButton??F.closeButton,interacting:u.value,position:N,closeButtonPosition:F.toastOptions?.closeButtonPosition??F.closeButtonPosition,style:At(F.toastOptions?.style),unstyled:F.toastOptions?.unstyled,classes:F.toastOptions?.classes,cancelButtonStyle:F.toastOptions?.cancelButtonStyle,actionButtonStyle:F.toastOptions?.actionButtonStyle,"close-button-aria-label":F.toastOptions?.closeButtonAriaLabel,toasts:a.value[N],expandByDefault:F.expand,gap:F.gap,expanded:c.value[N]||!1,swipeDirections:e.swipeDirections,"onUpdate:heights":$,"onUpdate:height":K,onRemoveToast:_},{"close-icon":we(()=>[Ve(F.$slots,"close-icon",{},()=>[j(H$)])]),"loading-icon":we(()=>[Ve(F.$slots,"loading-icon",{},()=>[j(Y$,{visible:q.type==="loading"},null,8,["visible"])])]),"success-icon":we(()=>[Ve(F.$slots,"success-icon",{},()=>[j(J$)])]),"error-icon":we(()=>[Ve(F.$slots,"error-icon",{},()=>[j(uk)])]),"warning-icon":we(()=>[Ve(F.$slots,"warning-icon",{},()=>[j(sk)])]),"info-icon":we(()=>[Ve(F.$slots,"info-icon",{},()=>[j(nk)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,hk))),128))],8,dk)],2112))}}),vk=mk,Is=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gk=class extends Is{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},qm=new gk,_k={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},yk=class{#e=_k;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Sl=new yk;function bk(t){setTimeout(t,0)}var wk=typeof window>"u"||"Deno"in globalThis;function gn(){}function Sk(t,e){return typeof t=="function"?t(e):t}function Ck(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ek(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Cl(t,e){return typeof t=="function"?t(e):t}function xk(t,e){return typeof t=="function"?t(e):t}function uh(t,e){const{type:n="all",exact:i,fetchStatus:o,predicate:r,queryKey:s,stale:a}=t;if(s){if(i){if(e.queryHash!==kc(s,e.options))return!1}else if(!zo(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||o&&o!==e.state.fetchStatus||r&&!r(e))}function dh(t,e){const{exact:n,status:i,predicate:o,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(n){if(jo(e.options.mutationKey)!==jo(r))return!1}else if(!zo(e.options.mutationKey,r))return!1}return!(i&&e.state.status!==i||o&&!o(e))}function kc(t,e){return(e?.queryKeyHashFn||jo)(t)}function jo(t){return JSON.stringify(t,(e,n)=>El(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function zo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>zo(t[n],e[n])):!1}var Tk=Object.prototype.hasOwnProperty;function Wm(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=hh(t)&&hh(e);if(!i&&!(El(t)&&El(e)))return e;const r=(i?t:Object.keys(t)).length,s=i?e:Object.keys(e),a=s.length,l=i?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=i?u:s[u],h=t[d],m=e[d];if(h===m){l[d]=h,(i?u<r:Tk.call(t,d))&&c++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[d]=m;continue}const f=Wm(h,m,n+1);l[d]=f,f===h&&c++}return r===a&&c===r?t:l}function hh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function El(t){if(!ph(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!ph(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ph(t){return Object.prototype.toString.call(t)==="[object Object]"}function $k(t){return new Promise(e=>{Sl.setTimeout(e,t)})}function kk(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Wm(t,e):e}function Ok(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Ak(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Oc=Symbol();function Km(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Oc?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Pk(t,e,n){let i=!1,o;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(o??=e(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),t}var Ym=(()=>{let t=()=>wk;return{isServer(){return t()},setIsServer(e){t=e}}})();function Rk(){let t,e;const n=new Promise((o,r)=>{t=o,e=r});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),t(o)},n.reject=o=>{i({status:"rejected",reason:o}),e(o)},n}var Ik=bk;function Mk(){let t=[],e=0,n=a=>{a()},i=a=>{a()},o=Ik;const r=a=>{e?t.push(a):o(()=>{n(a)})},s=()=>{const a=t;t=[],a.length&&o(()=>{i(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||s()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{o=a}}}var Rt=Mk(),Fk=class extends Is{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},ls=new Fk;function Dk(t){return Math.min(1e3*2**t,3e4)}function Gm(t){return(t??"online")==="online"?ls.isOnline():!0}var xl=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Qm(t){let e=!1,n=0,i;const o=Rk(),r=()=>o.status!=="pending",s=p=>{if(!r()){const _=new xl(p);h(_),t.onCancel?.(_)}},a=()=>{e=!0},l=()=>{e=!1},c=()=>qm.isFocused()&&(t.networkMode==="always"||ls.isOnline())&&t.canRun(),u=()=>Gm(t.networkMode)&&t.canRun(),d=p=>{r()||(i?.(),o.resolve(p))},h=p=>{r()||(i?.(),o.reject(p))},m=()=>new Promise(p=>{i=_=>{(r()||c())&&p(_)},t.onPause?.()}).then(()=>{i=void 0,r()||t.onContinue?.()}),f=()=>{if(r())return;let p;const _=n===0?t.initialPromise:void 0;try{p=_??t.fn()}catch(C){p=Promise.reject(C)}Promise.resolve(p).then(d).catch(C=>{if(r())return;const w=t.retry??(Ym.isServer()?0:3),S=t.retryDelay??Dk,b=typeof S=="function"?S(n,C):S,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,C);if(e||!E){h(C);return}n++,t.onFail?.(n,C),$k(b).then(()=>c()?void 0:m()).then(()=>{e?h(C):f()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(i?.(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?f():m().then(f),o)}}var Xm=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ck(this.gcTime)&&(this.#e=Sl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ym.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Sl.clearTimeout(this.#e),this.#e=void 0)}};function Lk(t){return{onFetch:(e,n)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,r=e.state.data?.pages||[],s=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=f=>{Pk(f,()=>e.signal,()=>u=!0)},h=Km(e.options,e.fetchOptions),m=async(f,p,_)=>{if(u)return Promise.reject(e.signal.reason);if(p==null&&f.pages.length)return Promise.resolve(f);const w=(()=>{const x={client:e.client,queryKey:e.queryKey,pageParam:p,direction:_?"backward":"forward",meta:e.options.meta};return d(x),x})(),S=await h(w),{maxPages:b}=e.options,E=_?Ak:Ok;return{pages:E(f.pages,S,b),pageParams:E(f.pageParams,p,b)}};if(o&&r.length){const f=o==="backward",p=f?jk:fh,_={pages:r,pageParams:s},C=p(i,_);a=await m(_,C,f)}else{const f=t??r.length;do{const p=l===0?s[0]??i.initialPageParam:fh(i,a);if(l>0&&p==null)break;a=await m(a,p),l++}while(l<f)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function fh(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function jk(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var zk=class extends Xm{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t){super(),this.#s=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#i=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=vh(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=vh(this.options);e.data!==void 0&&(this.setState(mh(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const n=kk(this.state.data,t,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#o?.promise;return this.#o?.cancel(t),e?e.then(gn).catch(gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>xk(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Cl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ek(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#o&&(this.#s||this.#u()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,i=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},o=()=>{const l=Km(this.options,e),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#s=!1,this.options.persister?this.options.persister(l,u,this):l(u)},s=(()=>{const l={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return i(l),l})();(this.#e==="infinite"?Lk(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#o=Qm({initialPromise:e?.initialPromise,fn:s.fetchFn,onCancel:l=>{l instanceof xl&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const l=await this.#o.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#i.config.onSuccess?.(l,this),this.#i.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof xl){if(l.silent)return this.#o.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#i.config.onError?.(l,this),this.#i.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Nk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...mh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function Nk(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gm(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function mh(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vh(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Uk=class extends Xm{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Vk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Qm({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,s)=>{this.#r({type:"failed",failureCount:r,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const s=await this.options.onMutate?.(t,n);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:o})}const r=await this.#i.start();return await this.#n.config.onSuccess?.(r,t,this.state.context,this,n),await this.options.onSuccess?.(r,t,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,t,this.state.context,n),this.#r({type:"success",data:r}),r}catch(r){try{await this.#n.config.onError?.(r,t,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(r,t,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,r,t,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#r({type:"error",error:r}),r}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Rt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Vk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const o=new Uk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(o),o}add(e){this.#e.add(e);const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=kr(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=kr(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=kr(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>dh(n,i))}findAll(e={}){return this.getAll().filter(n=>dh(e,n))}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(e.map(n=>n.continue().catch(gn))))}};function kr(t){return t.options.scope?.id}var Zm=class extends Is{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const o=n.queryKey,r=n.queryHash??kc(o,n);let s=this.get(r);return s||(s=new zk({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>uh(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>uh(e,i)):n}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bk=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new Zm,this.#t=e.mutationCache||new Jm,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=qm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ls.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Cl(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const o=i.data;return[n,o]})}setQueryData(e,n,i){const o=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(o.queryHash)?.state.data,a=Sk(n,s);if(a!==void 0)return this.#e.build(this,o).setData(a,{...i,manual:!0})}setQueriesData(e,n,i){return Rt.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Rt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Rt.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},o=Rt.batch(()=>this.#e.findAll(e).map(r=>r.cancel(i)));return Promise.all(o).then(gn).catch(gn)}invalidateQueries(e,n={}){return Rt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},o=Rt.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,i);return i.throwOnError||(s=s.catch(gn)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(gn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(Cl(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gn).catch(gn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gn).catch(gn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ls.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set(jo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(o=>{zo(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set(jo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(o=>{zo(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=kc(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Oc&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Tl(t,e,n="",i=0){if(e){const o=e(t,n,i);if(o===void 0&&ys(t)||o!==void 0)return o}if(Array.isArray(t))return t.map((o,r)=>Tl(o,e,String(r),i+1));if(typeof t=="object"&&qk(t)){const o=Object.entries(t).map(([r,s])=>[r,Tl(s,e,r,i+1)]);return Object.fromEntries(o)}return t}function Hk(t,e){return Tl(t,e)}function qe(t,e=!1){return Hk(t,(n,i,o)=>{if(o===1&&i==="queryKey")return qe(n,!0);if(e&&Wk(n))return qe(n(),e);if(ys(n))return qe(v(n),e)})}function qk(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Wk(t){return typeof t=="function"}var Kk=class extends Zm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Yk=class extends Jm{find(t){return super.find(qe(t))}findAll(t={}){return super.findAll(qe(t))}},Gk=class extends Bk{constructor(t={}){const e={defaultOptions:t.defaultOptions,queryCache:t.queryCache||new Kk,mutationCache:t.mutationCache||new Yk};super(e),this.isRestoring=H(!1)}isFetching(t={}){return super.isFetching(qe(t))}isMutating(t={}){return super.isMutating(qe(t))}getQueryData(t){return super.getQueryData(qe(t))}ensureQueryData(t){return super.ensureQueryData(qe(t))}getQueriesData(t){return super.getQueriesData(qe(t))}setQueryData(t,e,n={}){return super.setQueryData(qe(t),e,qe(n))}setQueriesData(t,e,n={}){return super.setQueriesData(qe(t),e,qe(n))}getQueryState(t){return super.getQueryState(qe(t))}removeQueries(t={}){return super.removeQueries(qe(t))}resetQueries(t={},e={}){return super.resetQueries(qe(t),qe(e))}cancelQueries(t={},e={}){return super.cancelQueries(qe(t),qe(e))}invalidateQueries(t={},e={}){const n=qe(t),i=qe(e);if(super.invalidateQueries({...n,refetchType:"none"},i),n.refetchType==="none")return Promise.resolve();const o={...n,type:n.refetchType??n.type??"active"};return Ge().then(()=>super.refetchQueries(o,i))}refetchQueries(t={},e={}){return super.refetchQueries(qe(t),qe(e))}fetchQuery(t){return super.fetchQuery(qe(t))}prefetchQuery(t){return super.prefetchQuery(qe(t))}fetchInfiniteQuery(t){return super.fetchInfiniteQuery(qe(t))}prefetchInfiniteQuery(t){return super.prefetchInfiniteQuery(qe(t))}setDefaultOptions(t){super.setDefaultOptions(qe(t))}setQueryDefaults(t,e){super.setQueryDefaults(qe(t),qe(e))}getQueryDefaults(t){return super.getQueryDefaults(qe(t))}setMutationDefaults(t,e){super.setMutationDefaults(qe(t),qe(e))}getMutationDefaults(t){return super.getMutationDefaults(qe(t))}};class $l extends Error{cause;isNetworkError;request;constructor(e,n=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=n}}class Qk{#e;#t=!1;#n;#i;constructor(e,n){this.#i=e,this.#n=()=>n(e)}progress(){this.#t||this.#i>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#n,this.#i))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const Or=()=>{};function Xk(t,e={}){const{body:n=null,headers:i={},method:o="GET",onBeforeRequest:r=Or,onUploadProgress:s=Or,shouldRetry:a=()=>!0,onAfterResponse:l=Or,onTimeout:c=Or,responseType:u,retries:d=3,signal:h=null,timeout:m=3e4,withCredentials:f=!1}=e,p=w=>.3*2**(w-1)*1e3,_=new Qk(m,c);function C(w=0){return new Promise(async(S,b)=>{const E=new XMLHttpRequest,x=$=>{a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},p(w)):(_.done(),b($))};E.open(o,t,!0),E.withCredentials=f,u&&(E.responseType=u),E.onload=async()=>{try{await l(E,w)}catch($){$.request=E,x($);return}E.status>=200&&E.status<300?(_.done(),S(E)):a(E)&&w<d?setTimeout(()=>{C(w+1).then(S,b)},p(w)):(_.done(),b(new $l(E.statusText,E)))},E.onerror=()=>x(new $l(E.statusText,E)),E.upload.onprogress=$=>{_.progress(),s($)},i&&Object.keys(i).forEach($=>{E.setRequestHeader($,i[$])});function O(){E.abort(),b(new DOMException("Aborted","AbortError"))}if(h?.addEventListener("abort",O),h?.aborted){O();return}await r(E,w),E.send(n)})}return C()}const Jk=t=>"error"in t&&!!t.error,Zk=t=>t.progress.uploadComplete;function eO(t){return t.filter(e=>!Jk(e)&&!Zk(e))}function tO(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function ev(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const gh={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function tv(t){if(t.type)return t.type;const e=t.name?ev(t.name).extension?.toLowerCase():null;return e&&e in gh?gh[e]:"application/octet-stream"}function nO(t){return t.charCodeAt(0).toString(32)}function _h(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${nO(n)}`,"/"))+e}function iO(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${_h(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${_h(t.meta.relativePath.toLowerCase())}`),t.data?.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function oO(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function rO(t,e){if(oO(t))return t.id;const n=tv(t);return iO({...t,type:n},e)}function yh(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function ga(t){return t<10?`0${t}`:t.toString()}function Qr(){const t=new Date,e=ga(t.getHours()),n=ga(t.getMinutes()),i=ga(t.getSeconds());return`${e}:${n}:${i}`}function sO(t){return t?t.readyState===4&&t.status===0:!1}class aO{#e=[];#t=0;#n;#i=!1;constructor(e){const n=e?.concurrency;this.#n=typeof n!="number"||n===0?1/0:n}add(e){const n=new AbortController;let i,o;const r=new Promise((a,l)=>{i=a,o=l}),s={run:()=>e(n.signal),resolve:i,reject:o,controller:n};return n.signal.addEventListener("abort",()=>{const a=this.#e.indexOf(s);a!==-1&&(this.#e.splice(a,1),o(n.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),r.abort=a=>{n.abort(a??new DOMException("Aborted","AbortError"))},r.abortOn=a=>{if(a){const l=()=>r.abort(a.reason);a.addEventListener("abort",l,{once:!0}),r.then(()=>a.removeEventListener("abort",l),()=>a.removeEventListener("abort",l))}return r},!this.#i&&this.#t<this.#n?this.#r(s):this.#e.push(s),r}#r(e){if(this.#t++,e.controller.signal.aborted){this.#t--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),this.#o();return}let n;try{n=e.run()}catch(i){n=Promise.reject(i)}n.then(i=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(i)},i=>{e.reject(i)}).finally(()=>{this.#t--,this.#o()})}#o(){queueMicrotask(()=>{if(!(this.#i||this.#t>=this.#n))for(;this.#e.length>0;){const e=this.#e.shift();if(!e.controller.signal.aborted){this.#r(e);return}}})}pause(){this.#i=!0}resume(){this.#i=!1;const e=this.#n-this.#t;for(let n=0;n<e;n++)this.#o()}clear(e){const n=this.#e.splice(0),i=e??new DOMException("Cleared","AbortError");for(const o of n)o.controller.abort(i),o.reject(i)}get concurrency(){return this.#n}set concurrency(e){if(this.#n=typeof e!="number"||e===0?1/0:e,!this.#i){const n=this.#n-this.#t;for(let i=0;i<n;i++)this.#o()}}get pending(){return this.#e.length}get running(){return this.#t}get isPaused(){return this.#i}wrapPromiseFunction(e){return(...n)=>this.add(i=>e(...n))}}function lO(t,e,n){const i=[];return t.forEach(o=>typeof o!="string"?i.push(o):e[Symbol.split](o).forEach((r,s,a)=>{r!==""&&i.push(r),s<a.length-1&&i.push(n)})),i}function bh(t,e){const n=/\$/g,i="$$$$";let o=[t];if(e==null)return o;for(const r of Object.keys(e))if(r!=="_"){let s=e[r];typeof s=="string"&&(s=n[Symbol.replace](s,i)),o=lO(o,new RegExp(`%\\{${r}\\}`,"g"),s)}return o}const cO=t=>{throw new Error(`missing string: ${t}`)};class nv{locale;constructor(e,{onMissingKey:n=cO}={}){this.locale={strings:{},pluralize(i){return i===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=n}#e;#t(e){if(!e?.strings)return;const n=this.locale;Object.assign(this.locale,{strings:{...n.strings,...e.strings},pluralize:e.pluralize||n.pluralize})}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(this.#e(e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){const r=this.locale.pluralize(n.smart_count);return bh(i[r],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return bh(i,n)}}class uO{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new nv([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}class dO{#e;#t=[];constructor(e){this.#e=e}on(e,n){return this.#t.push([e,n]),this.#e.on(e,n)}remove(){for(const[e,n]of this.#t.splice(0))this.#e.off(e,n)}onFilePause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onFileRemove(e,n){this.on("file-removed",i=>{e===i.id&&n(i.id)})}onPause(e,n){this.on("upload-pause",(i,o)=>{e===i?.id&&n(o)})}onRetry(e,n){this.on("upload-retry",i=>{e===i?.id&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{this.#e.getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{this.#e.getFile(e)&&n()})}onCancelAll(e,n){this.on("cancel-all",(...i)=>{this.#e.getFile(e)&&n(...i)})}onResumeAll(e,n){this.on("resume-all",()=>{this.#e.getFile(e)&&n()})}}const hO={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)},pO={debug:(...t)=>console.debug(`[Uppy] [${Qr()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${Qr()}]`,...t),error:(...t)=>console.error(`[Uppy] [${Qr()}]`,...t)};var _a,wh;function fO(){return wh||(wh=1,_a=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const n=e<0;let i=Math.abs(e);if(n&&(i=-i),i===0)return"0 B";const o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(i)/Math.log(1024)),o.length-1),s=Number(i/1024**r),a=o[r];return`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${a}`}),_a}var mO=fO();const Ar=Di(mO);var ya,Sh;function vO(){if(Sh)return ya;Sh=1;function t(e,n){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=n,this.parts=e.split(n)}return t.prototype.match=function(e){var n=!0,i=this.parts,o,r=i.length,s;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)n=!1;else{for(s=(e||"").split(this.separator),o=0;n&&o<r;o++)i[o]!=="*"&&(o<s.length?n=i[o]===s[o]:n=!1);n=n&&s}else if(typeof e.splice=="function")for(n=[],o=e.length;o--;)this.match(e[o])&&(n[n.length]=e[o]);else if(typeof e=="object"){n={};for(var a in e)this.match(a)&&(n[a]=e[a])}return n},ya=function(e,n,i){var o=new t(e,i||/[\/\.]/);return typeof n<"u"?o.match(n):o},ya}var ba,Ch;function gO(){if(Ch)return ba;Ch=1;var t=vO(),e=/[\/\+\.]/;return ba=function(n,i){function o(r){var s=t(r,n,e);return s&&s.length>=2}return i?o(i.split(";")[0]):o},ba}var _O=gO();const yO=Di(_O),bO={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class _n extends Error{isUserFacing;file;constructor(e,n){super(e),this.isUserFacing=n?.isUserFacing??!0,n?.file&&(this.file=n.file)}isRestriction=!0}class wO{getI18n;getOpts;constructor(e,n){this.getI18n=n,this.getOpts=()=>{const i=e();if(i.restrictions?.allowedFileTypes!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:i,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(s=>!s.isGhost).length+n.length>o)throw new _n(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(i){const r=[...e,...n].reduce((s,a)=>s+(a.size??0),0);if(r>i)throw new _n(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Ar(i),size:Ar(r)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:i,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(s=>s.includes("/")?e.type?yO(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){const s=o.join(", ");throw new _n(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(n&&e.size!=null&&e.size>n)throw new _n(this.getI18n()("exceedsSize",{size:Ar(n),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&e.size!=null&&e.size<i)throw new _n(this.getI18n()("inferiorSize",{size:Ar(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new _n(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){const n=new _n(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,o=[];for(const r of i)(!Object.hasOwn(e.meta,r)||e.meta[r]==="")&&o.push(r);return{missingFields:o,error:n}}}const SO="5.0.0",CO={version:SO};class EO{static VERSION=CO.version;state={};#e=new Set;getState(){return this.state}setState(e){const n={...this.state},i={...this.state,...e};this.state=i,this.#t(n,i,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(n=>{n(...e)})}}var wa,Eh;function Ac(){if(Eh)return wa;Eh=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return wa=t,wa}var Sa,xh;function xO(){if(xh)return Sa;xh=1;var t=typeof vr=="object"&&vr&&vr.Object===Object&&vr;return Sa=t,Sa}var Ca,Th;function iv(){if(Th)return Ca;Th=1;var t=xO(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Ca=n,Ca}var Ea,$h;function TO(){if($h)return Ea;$h=1;var t=iv(),e=function(){return t.Date.now()};return Ea=e,Ea}var xa,kh;function $O(){if(kh)return xa;kh=1;var t=/\s/;function e(n){for(var i=n.length;i--&&t.test(n.charAt(i)););return i}return xa=e,xa}var Ta,Oh;function kO(){if(Oh)return Ta;Oh=1;var t=$O(),e=/^\s+/;function n(i){return i&&i.slice(0,t(i)+1).replace(e,"")}return Ta=n,Ta}var $a,Ah;function ov(){if(Ah)return $a;Ah=1;var t=iv(),e=t.Symbol;return $a=e,$a}var ka,Ph;function OO(){if(Ph)return ka;Ph=1;var t=ov(),e=Object.prototype,n=e.hasOwnProperty,i=e.toString,o=t?t.toStringTag:void 0;function r(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=i.call(s);return c&&(a?s[o]=l:delete s[o]),u}return ka=r,ka}var Oa,Rh;function AO(){if(Rh)return Oa;Rh=1;var t=Object.prototype,e=t.toString;function n(i){return e.call(i)}return Oa=n,Oa}var Aa,Ih;function PO(){if(Ih)return Aa;Ih=1;var t=ov(),e=OO(),n=AO(),i="[object Null]",o="[object Undefined]",r=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:i:r&&r in Object(a)?e(a):n(a)}return Aa=s,Aa}var Pa,Mh;function RO(){if(Mh)return Pa;Mh=1;function t(e){return e!=null&&typeof e=="object"}return Pa=t,Pa}var Ra,Fh;function IO(){if(Fh)return Ra;Fh=1;var t=PO(),e=RO(),n="[object Symbol]";function i(o){return typeof o=="symbol"||e(o)&&t(o)==n}return Ra=i,Ra}var Ia,Dh;function MO(){if(Dh)return Ia;Dh=1;var t=kO(),e=Ac(),n=IO(),i=NaN,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return i;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var d=r.test(c);return d||s.test(c)?a(c.slice(2),d?2:8):o.test(c)?i:+c}return Ia=l,Ia}var Ma,Lh;function FO(){if(Lh)return Ma;Lh=1;var t=Ac(),e=TO(),n=MO(),i="Expected a function",o=Math.max,r=Math.min;function s(a,l,c){var u,d,h,m,f,p,_=0,C=!1,w=!1,S=!0;if(typeof a!="function")throw new TypeError(i);l=n(l)||0,t(c)&&(C=!!c.leading,w="maxWait"in c,h=w?o(n(c.maxWait)||0,l):h,S="trailing"in c?!!c.trailing:S);function b(M){var q=u,le=d;return u=d=void 0,_=M,m=a.apply(le,q),m}function E(M){return _=M,f=setTimeout($,l),C?b(M):m}function x(M){var q=M-p,le=M-_,de=l-q;return w?r(de,h-le):de}function O(M){var q=M-p,le=M-_;return p===void 0||q>=l||q<0||w&&le>=h}function $(){var M=e();if(O(M))return K(M);f=setTimeout($,x(M))}function K(M){return f=void 0,S&&u?b(M):(u=d=void 0,m)}function F(){f!==void 0&&clearTimeout(f),_=0,u=p=d=f=void 0}function P(){return f===void 0?m:K(e())}function N(){var M=e(),q=O(M);if(u=arguments,d=this,p=M,q){if(f===void 0)return E(p);if(w)return clearTimeout(f),f=setTimeout($,l),b(p)}return f===void 0&&(f=setTimeout($,l)),m}return N.cancel=F,N.flush=P,N}return Ma=s,Ma}var Fa,jh;function DO(){if(jh)return Fa;jh=1;var t=FO(),e=Ac(),n="Expected a function";function i(o,r,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,r,{leading:a,maxWait:r,trailing:l})}return Fa=i,Fa}var LO=DO();const jO=Di(LO);var Da,zh;function zO(){return zh||(zh=1,Da=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,u,d,h){var m=i(s);m.length&&o(s,m,[a,l,c,u,d,h])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==a&&l.push(c[u])}l.length?this._fns[s]=l:delete this._fns[s]};function i(r){var s=n[r]?n[r]:[],a=r.indexOf(":"),l=a===-1?[r]:[r.substring(0,a),r.substring(a+1)],c=Object.keys(n),u=0,d=c.length;for(u;u<d;u++){var h=c[u];if(h==="*"&&(s=s.concat(n[h])),l.length===2&&l[0]===h){s=s.concat(n[h]);break}}return s}function o(r,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=r,s[l].apply(s[l],a)}return e}),Da}var NO=zO();const UO=Di(NO);let VO="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",BO=(t=21)=>{let e="",n=t|0;for(;n--;)e+=VO[Math.random()*64|0];return e};const HO="5.2.0",qO={version:HO};function WO(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const KO={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function YO(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const i=e[1].split(".",2),o=parseInt(i[0],10),r=parseInt(i[1],10);return o<15||o===15&&r<15063||o>18||o===18&&r>=18218}const Pr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class Pc{static VERSION=qO.version;#e=Object.create(null);#t;#n;#i=UO();#r=new Set;#o=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=KO;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:bO,meta:{},onBeforeFileAdded:(o,r)=>!Object.hasOwn(r,o.id),onBeforeUpload:o=>o,store:new EO,logger:hO,infoTimeout:5e3},i={...n,...e};this.opts={...i,restrictions:{...n.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=pO),this.log(`Using Core v${Pc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:YO(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new wO(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((o,r,s)=>{this.emit("state-update",o,r,s),this.updateAll(r)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#x()}emit(e,...n){this.#i.emit(e,...n)}on(e,n){return this.#i.on(e,n),this}once(e,n){return this.#i.once(e,n),this}off(e,n){return this.#i.off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(([i,o])=>[i,{...n[i],...o}]))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new nv([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},i=Object.create(null);Object.keys(n).forEach(o=>{i[o]={...n[o],progress:{...n[o].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...Pr})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pr,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#o.add(e)}removeUploader(e){return this.#o.delete(e)}setMeta(e){const n={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(o=>{i[o]={...i[o],meta:{...i[o].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){const i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const o={...i[e].meta,...n};i[e]={...i[e],meta:o},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:i}=this.getState(),o=Object.values(e),r=[],s=[],a=[],l=[],c=[],u=[],d=[],h=[],m=[];for(const f of o){const{progress:p}=f;!p.uploadComplete&&p.uploadStarted&&(r.push(f),f.isPaused||h.push(f)),p.uploadStarted||s.push(f),(p.uploadStarted||p.preprocess||p.postprocess)&&a.push(f),p.uploadStarted&&l.push(f),f.isPaused&&c.push(f),p.uploadComplete&&u.push(f),f.error&&d.push(f),(p.preprocess||p.postprocess)&&m.push(f)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:m,isUploadStarted:l.length>0,isAllComplete:n===100&&u.length===o.length&&m.length===0,isAllErrored:!!i&&d.length===o.length,isAllPaused:r.length!==0&&c.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:o.some(f=>f.isGhost)}}#s(e){for(const s of e)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const n=e.filter(s=>s.isUserFacing),i=4,o=n.slice(0,i),r=n.slice(i);o.forEach(({message:s,details:a=""})=>{this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,n=this.getFiles()){try{this.#t.validate(n,[e])}catch(i){return i}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{this.#t.validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}#u(e){const{missingFields:n,error:i}=this.#t.getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#l(e){let n=!0;for(const i of Object.values(e))this.#u(i)||(n=!1);return n}#w(e){const{allowNewUpload:n}=this.getState();if(n===!1){const i=new _n(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([i]),i}}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}#S(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=tv(n),o=WO(i,n),r=ev(o).extension,s=rO(n,this.getID()),a={...n.meta,name:o,type:i},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:s,name:o,extension:r||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}}#f(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#m(e){let{files:n}=this.getState(),i={...n};const o=[],r=[];for(const s of e)try{let a=this.#S(s);this.#w(a);const l=n[a.id],c=l?.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const u=this.opts.onBeforeFileAdded(a,i);if(n=this.getState().files,i={...n,...i},!u&&this.checkIfFileAlreadyExists(a.id))throw new _n(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(u===!1&&!c)throw new _n("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof u=="object"&&u!==null&&(a=u),this.#t.validateSingleFile(a),i[a.id]=a,o.push(a)}catch(a){r.push(a)}try{this.#t.validateAggregateRestrictions(Object.values(n),o)}catch(s){return r.push(s),{nextFilesState:n,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:o,errors:r}}addFile(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m([e]),r=o.filter(a=>a.isRestriction);if(this.#s(r),o.length>0)throw o[0];this.setState({files:n});const[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#f(),s.id}addFiles(e){const{nextFilesState:n,validFilesToAdd:i,errors:o}=this.#m(e),r=o.filter(a=>a.isRestriction);this.#s(r);const s=o.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
17
17
  `;if(s.forEach(l=>{a+=`
18
18
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(s,a);{const l=new Error(a);throw l.errors=s,l}}this.setState({files:n}),i.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(a=>{this.log(`Added file: ${a.name}
19
19
  id: ${a.id}
20
- type: ${a.type}`)}),i.length>0&&this.#p()}removeFiles(e){const{files:n,currentUploads:i}=this.getState(),o={...n},r={...i},s=Object.create(null);e.forEach(u=>{n[u]&&(s[u]=n[u],delete o[u])});function a(u){return s[u]===void 0}Object.keys(r).forEach(u=>{const d=i[u].fileIDs.filter(a);if(d.length===0){delete r[u];return}const{capabilities:h}=this.getState();if(d.length!==i[u].fileIDs.length&&!h.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[u]={...i[u],fileIDs:d}});const l={currentUploads:r,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#d();const c=Object.keys(s);c.forEach(u=>{this.emit("file-removed",s[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),o=!(n.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",n,o),o}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!0};e[i]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!1,error:null};e[i]=o}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})}async#g(){const e=this.#v(),n={...this.getState().files};if(e.forEach(o=>{n[o]={...n[o],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=this.#h(e,{forceAllowNewUpload:!0});return this.#f(i)}async retryAll(){const e=await this.#g();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Pr)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=this.#h([e],{forceAllowNewUpload:!0});return this.#f(n)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#C=(e,n)=>{const i=e?this.getFile(e.id):void 0;if(e==null||!i){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(i.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const o={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};i.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...i.progress,...o,bytesUploaded:n.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...o}}),this.#d()};#_(){const e=this.#E();let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})}#d=BO(()=>this.#_(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#_()}#E(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,o=n.filter(i),r=n.filter(l=>!i(l));if(o.every(l=>l.progress.uploadComplete)&&r.length>0&&!r.every(l=>l.progress.uploadComplete))return null;const s=o.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=o.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return s===0?0:a/s}#x(){const e=(o,r,s)=>{let a=o.message||"Unknown error";o.details&&(a+=` ${o.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:s})};this.on("error",e),this.on("upload-error",(o,r,s)=>{if(e(r,o,s),typeof r=="object"&&r.message){this.log(r.message,"error");const a=new Error(this.i18n("failedToUpload",{file:o?.name??""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),this.#s([a])}else this.#s([r])});let n=null;this.on("upload-stalled",(o,r)=>{const{message:s}=o,a=r.map(l=>l.meta.name).join(", ");n||(this.info({message:s,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${s} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=o=>{const r=o.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),s=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(s)};this.on("upload-start",i),this.on("upload-progress",this.#C),this.on("upload-success",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const s=this.getFile(o.id).progress,a=this.#a.size>0;this.setFileState(o.id,{progress:{...s,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:s.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),o.size==null&&this.setFileState(o.id,{size:r.bytesUploaded||s.bytesTotal}),this.#d()}),this.on("preprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getFile(o.id).progress,preprocess:r}})}),this.on("preprocess-complete",o=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const r={...this.getState().files};r[o.id]={...r[o.id],progress:{...r[o.id].progress}},delete r[o.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getState().files[o.id].progress,postprocess:r}})}),this.on("postprocess-complete",o=>{const r=o&&this.getFile(o.id);if(r==null){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const{postprocess:s,...a}=r.progress;this.patchFilesState({[r.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{this.#d()}),this.on("dashboard:file-edit-complete",o=>{o&&this.#u(o)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#c),window.addEventListener("offline",this.#c),setTimeout(this.#c,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#c=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...n){if(typeof e!="function"){const s=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(s)}const i=new e(this,...n),o=i.id;if(!o)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(o);if(r){const s=`Already found a plugin named '${r.id}'. Tried to use: '${o}'.
21
- Uppy plugins must have unique \`id\` options.`;throw new Error(s)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),i.type in this.#e?this.#e[i.type].push(i):this.#e[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(this.#e)){const i=n.find(o=>o.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=this.#e[e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#c),window.removeEventListener("offline",this.#c))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const o=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}#y=new Map;registerRequestClient(e,n){this.#y.set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=this.#y.get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await this.#f(e);return this.emit("complete",n),n}#h(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:o,currentUploads:r}=this.getState();if(!o&&!i)throw new Error("Cannot create a new upload: already uploading.");const s=YO();return this.emit("upload",s,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[s]:{fileIDs:e,step:0,result:{}}}}),s}[Symbol.for("uppy test: createUpload")](...e){return this.#h(...e)}#T(e){const{currentUploads:n}=this.getState();return n[e]}addResultData(e,n){if(!this.#T(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),o={...i[e],result:{...i[e].result,...n}};this.setState({currentUploads:{...i,[e]:o}})}#b(e){const{[e]:n,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async#f(e){const n=()=>{const{currentUploads:s}=this.getState();return s[e]};let i=n();if(!i)throw new Error("Nonexistent upload");const o=[...this.#r,...this.#o,...this.#a];try{for(let s=i.step||0;s<o.length;s++){const a=o[s];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:s}}});const{fileIDs:l}=i;if(await a(l,e),i=n(),!i)break}}catch(s){throw this.#b(e),s}if(i){i.fileIDs.forEach(c=>{const u=this.getFile(c);u?.progress.postprocess&&this.emit("postprocess-complete",u)});const s=i.fileIDs.map(c=>this.getFile(c)),a=s.filter(c=>!c.error),l=s.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),i=n()}let r;return i&&(r=i.result,this.#b(e)),r==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#v().length>0){const o=await this.#g();if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",o),o;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);if(i===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");i&&typeof i=="object"&&(e=i,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#l(e))throw new _n(this.i18n("missingRequiredMetaField"));const{currentUploads:o}=this.getState(),r=Object.values(o).flatMap(c=>c.fileIDs),s=Object.keys(e).filter(c=>{const u=this.getFile(c);return u&&!u.progress.uploadStarted&&!r.includes(c)}),a=this.#h(s),l=await this.#f(a);return this.emit("complete",l),l}catch(o){throw this.#s([o]),o}}}function qh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),n.push.apply(n,i)}return n}function Xe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qh(Object(n),!0).forEach((function(i){ln(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qh(Object(n)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))}))}return t}function ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eA(t,e){if(t==null)return{};var n,i,o=(function(s,a){if(s==null)return{};var l,c,u={},d=Object.keys(s);for(c=0;c<d.length;c++)l=d[c],a.indexOf(l)>=0||(u[l]=s[l]);return u})(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Fi(t){return(function(e){if(Array.isArray(e))return Va(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,n){if(e){if(typeof e=="string")return Va(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Va(e,n)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Va(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Wh,tA,Rr,_t=(Wh=function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var s=typeof r;if(s==="string"||s==="number")i.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&i.push(a)}}else if(s==="object")if(r.toString===Object.prototype.toString)for(var l in r)e.call(r,l)&&r[l]&&i.push(l);else i.push(r.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},Wh(Rr={path:tA,exports:{},require:function(t,e){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(e==null&&Rr.path)}},Rr.exports),Rr.exports),En=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var o=t;return i&&(o+="__"+i),o+(n?Object.keys(n).reduce((function(r,s){var a=n[s];return a&&(r+=" "+(typeof a=="boolean"?o+"--"+s:o+"--"+s+"_"+a)),r}),""):"")}};function Ml(t,e,n){var i,o,r,s,a;function l(){var u=Date.now()-s;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}e==null&&(e=100);var c=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(r,o),r=o=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},c}Ml.debounce=Ml;var Il=Ml,Re=function(){return Re=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Re.apply(this,arguments)};function dv(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function hv(t){return/^blob:/.test(t)}function Kh(t){return hv(t)||(function(e){return/^data:/.test(e)})(t)}function Ni(t){return!!(t&&t.constructor&&t.call&&t.apply)}function yt(t){return t===void 0}function Jr(t){return typeof t=="object"&&t!==null}function Fl(t,e,n){var i={};return Jr(t)?(Object.keys(e).forEach((function(o){yt(t[o])?i[o]=e[o]:Jr(e[o])?Jr(t[o])?i[o]=Fl(t[o],e[o],n[o]):i[o]=t[o]?e[o]:n[o]:e[o]===!0||e[o]===!1?i[o]=!!t[o]:i[o]=t[o]})),i):t?e:n}function Mr(t){var e=Number(t);return Number.isNaN(e)?t:e}function Yh(t){return typeof(t=="number"||(function(e){return typeof e=="object"&&e!==null})(t)&&toString.call(t)=="[object Number]")&&!fv(t)}function fv(t){return t!=t}function pv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Oo=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},nA=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Dc=function(t){this.type="move",this.directions=t},iA=(function(){function t(e,n,i,o,r){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=o,this.element=n,this.anchor=r}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,o=e.position;if(n){var r=n.getBoundingClientRect(),s=r.left,a=r.top;return{left:o.left-s-i.left,top:o.top-a-i.top}}return{left:0,top:0}},t})(),Lc={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=Fi(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,o=e.bottom,r=e.top;this.anchor={left:t.clientX-n,top:t.clientY-r,bottom:o-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=Fi(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new iA(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};Lc.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:e[3]||(e[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:e[4]||(e[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Ve(t.$slots,"default")],34)};var Ba=En("vue-handler-wrapper"),mv={name:"HandlerWrapper",components:{DraggableElement:Lc},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=dv(this.horizontalPosition,this.verticalPosition);t=Ba((ln(e={},n.classname,!0),ln(e,"disabled",this.disabled),e))}else t=Ba({disabled:this.disabled});return{root:t,draggable:Ba("draggable")}}},emits:["leave","enter","drag","drag-end"]};mv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne("div",{class:r.classes.root},[j(s,{class:r.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])],2)};var oA=En("vue-line-wrapper"),vv={name:"LineWrapper",components:{DraggableElement:Lc},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return oA((ln(t={},this.position,!0),ln(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};vv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne(s,{class:r.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])};var Rn=["left","right","top","bottom"],rA=["left","right"],sA=["top","bottom"],aA=["left","top"],lA=["fill-area","fit-area","stencil","none"],Gh={left:0,top:0,width:0,height:0};function Qh(t,e,n){return!(n=n||["width","height","left","top"]).some((function(i){return t[i]!==e[i]}))}function Ln(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function io(t,e){return{left:t.left-e.left,top:t.top-e.top}}function wt(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function Uo(t,e){var n={left:0,top:0,right:0,bottom:0};return Rn.forEach((function(i){var o=e[i],r=Ln(t)[i];n[i]=o!==void 0&&r!==void 0?i==="left"||i==="top"?Math.max(0,o-r):Math.max(0,r-o):0})),n}function An(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function js(t){return{left:-t.left,top:-t.top}}function Wt(t,e){return Re(Re({},t),{left:t.left+e.left,top:t.top+e.top})}function un(t,e,n,i){if(e!==1){if(n){var o=wt(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-o.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-o.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Je(t){return t.width/t.height}function oo(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function ro(t,e){var n={left:0,top:0},i=Uo(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function Ha(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function gv(t,e){var n=Je(t),i=Je(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function _v(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function si(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function zs(t,e){var n=Uo(St(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,oo(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,oo(t,e)):1}function St(t,e,n){n===void 0&&(n=!1);var i=ro(t,e);return Wt(t,n?js(i):i)}function Dl(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function cA(t,e){return Re(Re({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function yv(t,e,n){n===void 0&&(n=!0);var i={};return Rn.forEach((function(o){var r=t[o],s=e[o];r!==void 0&&s!==void 0?i[o]=o==="left"||o==="top"?n?Math.max(r,s):Math.min(r,s):n?Math.min(r,s):Math.max(r,s):s!==void 0?i[o]=s:r!==void 0&&(i[o]=r)})),i}function Ns(t,e){return yv(t,e,!0)}function Xh(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,o=t.sizeRestrictions;return!!((e.correctRatio||Je(e)>=n.minimum&&Je(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(i||e.height>=o.minHeight&&e.width>=o.minWidth))}function Jh(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function Xn(t){var e=t.width,n=t.height,i=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},r={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(c,u){return u===void 0&&(u=!1),c.reduce((function(d,h){return Xh({size:h,aspectRatio:o,sizeRestrictions:i,ignoreMinimum:u})&&(!d||Jh(h,{width:e,height:n})<Jh(d,{width:e,height:n}))?h:d}),null)}var a=[];o&&[o.minimum,o.maximum].forEach((function(c){c&&a.push({width:r.width,height:r.width/c,correctRatio:!0},{width:r.height*c,height:r.height,correctRatio:!0})})),Xh({size:r,aspectRatio:o,sizeRestrictions:i})&&a.push(r);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Ll(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=Wt(n,e.directions);return Wt(r,ro(r,o))}function uA(t){var e=t.coordinates,n=t.transform,i=t.imageSize,o=t.sizeRestrictions,r=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(u,d){return Ll({coordinates:u,positionRestrictions:r,event:new Dc({left:d.left-u.left,top:d.top-u.top})})},c=Re({},e);return(Array.isArray(n)?n:[n]).forEach((function(u){var d={};yt((d=typeof u=="function"?u({coordinates:c,imageSize:i,visibleArea:a}):u).width)&&yt(d.height)||(c=(function(h,v){var p=Re(Re(Re({},h),Xn({width:v.width,height:v.height,sizeRestrictions:o,aspectRatio:s})),{left:0,top:0});return l(p,{left:h.left,top:h.top})})(c,Re(Re({},c),d))),yt(d.left)&&yt(d.top)||(c=l(c,Re(Re({},c),d)))})),c}function dA(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,o=t.visibleArea;t.aspectRatio;var r=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,c,u,d=Re({},i),h=Re({},o),v=Re({},r);l=Je(v),c=Je(d),u===void 0&&(u=.001),(l===0||c===0?Math.abs(c-l)<u:Math.abs(c/l)<1+u&&Math.abs(c/l)>1-u)||(d=Re(Re({},d),Xn({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Je(v),maximum:Je(v)}})));var p=zs(h=un(h,d.width*n.width/(h.width*v.width)),e({visibleArea:h,type:"resize"}));return p!==1&&(h=un(h,p),d=un(d,p)),h=St(h=Wt(h,io(wt(d),wt(h))),e({visibleArea:h,type:"move"})),{coordinates:d=St(d,Ns(Ln(h),a)),visibleArea:h}}function hA(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,o=t.coordinates,r=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=Re({},o),l=Re({},r);if(o&&r&&e.type!=="manipulateImage"){var c={width:0,height:0};l.width,i.width,Je(i)>Je(a)?(c.height=.8*i.height,c.width=c.height*Je(a)):(c.width=.8*i.width,c.height=c.width*Je(a));var u=zs(l=un(l,a.width*i.width/(l.width*c.width)),n({visibleArea:l,type:"resize"}));l=un(l,u),u!==1&&(c.height/=u,c.width/=u),l=St(l=Wt(l,io(wt(a),wt(l))),n({visibleArea:l,type:"move"})),a=St(a,Ns(Ln(l),s))}return{coordinates:a,visibleArea:l}}function fA(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.getAreaRestrictions,r=Re({},i),s=Re({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-r.width),l=Math.max(0,s.height-r.height);a>l?r=un(r,Math.min(s.width/r.width,oo(r,o({visibleArea:r,type:"resize"})))):l>a&&(r=un(r,Math.min(s.height/r.height,oo(r,o({visibleArea:r,type:"resize"}))))),r=St(r=Wt(r,js(ro(s,Ln(r)))),o({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:s}}function pA(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-i.width/2,top:(n?n.top:0)+o.height/2-i.height/2}}function mA(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,o=t.sizeRestrictions,r=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Je(r))),a=r.width<r.height?{width:.8*r.width,height:.8*r.width/s}:{height:.8*r.height,width:.8*r.height*s};return Xn(Re(Re({},a),{aspectRatio:i,sizeRestrictions:o}))}function vA(t){var e,n,i=t.imageSize,o=t.visibleArea,r=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,c=o||i;return Je(c)>Je(r)?n=(e=l.height*c.height/r.height)*Je(l):e=(n=l.width*c.width/r.width)/Je(l),Xn({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function gA(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,o=Je(t.boundaries);if(n){var r={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=gv({width:Je(r)>o?r.width:r.height*o,height:Je(r)>o?r.width/o:r.height},Dl(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=Uo(n,Ln(Re({left:0,top:0},i))),c={};return!l.left&&!l.right&&a.width<=i.width&&(c.left=0,c.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(c.top=0,c.bottom=i.height),St(a,c)}var u=Je(i);return s={height:u>o?i.height:i.width/o,width:u>o?i.height*o:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function Ir(t,e){return yv(t,Ln(e))}function _A(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.sizeRestrictions,r=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,c=e.move,u=Re({},i),d=Re({},n),h=1,v=1,p=l.factor&&Math.abs(l.factor-1)>.001;u=Wt(u,{left:c.left||0,top:c.top||0});var f={stencil:{minimum:Math.max(o.minWidth?o.minWidth/d.width:0,o.minHeight?o.minHeight/d.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/d.width:1/0,o.maxHeight?o.maxHeight/d.height:1/0,oo(d,s))},area:{maximum:oo(u,r({visibleArea:u,type:"resize"}))}};l.factor&&p&&(l.factor<1?(v=Math.max(l.factor,f.stencil.minimum))>1&&(v=1):l.factor>1&&(v=Math.min(l.factor,Math.min(f.area.maximum,f.stencil.maximum)))<1&&(v=1)),v&&(u=un(u,v,l.center));var _=n.left-i.left,C=i.width+i.left-(n.width+n.left),w=n.top-i.top,S=i.height+i.top-(n.height+n.top);return u=St(u=Wt(u,ro(u,{left:s.left!==void 0?s.left-_*v:void 0,top:s.top!==void 0?s.top-w*v:void 0,bottom:s.bottom!==void 0?s.bottom+S*v:void 0,right:s.right!==void 0?s.right+C*v:void 0})),r({visibleArea:u,type:"move"})),d.width=d.width*v,d.height=d.height*v,d.left=u.left+_*v,d.top=u.top+w*v,d=St(d,Ns(Ln(u),s)),l.factor&&p&&a&&(l.factor>1?h=Math.min(f.area.maximum,l.factor)/v:l.factor<1&&(h=Math.max(d.height/u.height,d.width/u.width,l.factor/v)),h!==1&&(u=Wt(u=St(u=un(u,h,l.factor>1?l.center:wt(d)),r({visibleArea:u,type:"move"})),js(ro(d,Ln(u)))))),{coordinates:d,visibleArea:u}}function yA(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,o=t.visibleArea,r=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,c=t.angle,u=Re({},i),d=Re({},o),h=si(wt(Re({left:0,top:0},l)),c);return(u=Re(Re({},Xn({sizeRestrictions:r,aspectRatio:e,width:u.width,height:u.height})),si(wt(u),c))).left-=h.left-a.width/2+u.width/2,u.top-=h.top-a.height/2+u.height/2,d=un(d,zs(d,n({visibleArea:d,type:"resize"}))),{coordinates:u=St(u,s),visibleArea:d=St(d=Wt(d,io(wt(u),wt(i))),n({visibleArea:d,type:"move"}))}}function bA(t){var e=t.flip,n=t.previousFlip,i=t.rotate,o=t.getAreaRestrictions,r=t.coordinates,s=t.visibleArea,a=t.imageSize,l=Re({},r),c=Re({},s),u=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(u||d){var h=si({left:a.width/2,top:a.height/2},-i),v=si(wt(l),-i),p=si({left:u?h.left-(v.left-h.left):v.left,top:d?h.top-(v.top-h.top):v.top},i);l=Wt(l,io(p,wt(l))),v=si(wt(c),-i),c=St(c=Wt(c,io(p=si({left:u?h.left-(v.left-h.left):v.left,top:d?h.top-(v.top-h.top):v.top},i),wt(c))),o({visibleArea:c,type:"move"}))}return{coordinates:l,visibleArea:c}}function Zh(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=Re({},e),c=An(n,l).width,u=An(n,l).height;c<0&&(l.left<0&&l.right<0?(l.left=-(n.width-r.minWidth)/(l.left/l.right),l.right=-(n.width-r.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-r.minWidth):l.right<0&&(l.right=-(n.width-r.minWidth))),u<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-r.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-r.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-r.minHeight):l.bottom<0&&(l.bottom=-(n.height-r.minHeight)));var d=Uo(An(n,l),o);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=Uo(An(n,l),o));var h={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Rn.forEach((function(f){var _=d[f];_&&l[f]&&(h[f]=Math.max(0,1-_/l[f]))})),s){var v=Math.min.apply(null,Rn.map((function(f){return h[f]})));v!==1/0&&Rn.forEach((function(f){l[f]*=v}))}else Rn.forEach((function(f){h[f]!==1/0&&(l[f]*=h[f])}));if(c=An(n,l).width,u=An(n,l).height,l.right+l.left&&(c>r.maxWidth?h.width=(r.maxWidth-n.width)/(l.right+l.left):c<r.minWidth&&(h.width=(r.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(u>r.maxHeight?h.height=(r.maxHeight-n.height)/(l.bottom+l.top):u<r.minHeight&&(h.height=(r.minHeight-n.height)/(l.bottom+l.top))),s){var p=Math.min(h.width,h.height);p!==1/0&&Rn.forEach((function(f){l[f]*=p}))}else h.width!==1/0&&rA.forEach((function(f){l[f]*=h.width})),h.height!==1/0&&sA.forEach((function(f){l[f]*=h.height}));return l}function Fr(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var wA=En("vue-simple-handler"),SA=En("vue-simple-handler-wrapper"),jc={name:"SimpleHandler",components:{HandlerWrapper:mv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(ln(t={},this.horizontalPosition,!!this.horizontalPosition),ln(t,this.verticalPosition,!!this.verticalPosition),ln(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),ln(t,"hover",this.hover),t);return{default:_t(wA(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(SA(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};jc.render=function(t,e,n,i,o,r){var s=Ue("HandlerWrapper");return y(),ne(s,{class:r.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var CA=En("vue-simple-line"),EA=En("vue-simple-line-wrapper"),zc={name:"SimpleLine",components:{LineWrapper:vv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:_t(CA(ln({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(EA(ln({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};zc.render=function(t,e,n,i,o,r){var s=Ue("LineWrapper");return y(),ne(s,{class:r.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var qa=En("vue-bounding-box"),xA=["east","west",null],TA=["south","north",null],bv={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return jc}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return zc}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return xA.forEach((function(e){TA.forEach((function(n){if(e!==n){var i=dv(e,n),o=i.name,r=i.classname;t.push({name:o,classname:r,verticalDirection:n,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:qa(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:_t(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:_t(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach((function(o){if(t.handlers[o.name]){var r={name:o.name,component:t.handlersComponent,class:_t(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:_t(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=o.horizontalDirection,a=o.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,c=a==="south"?i:a==="north"?0:i/2;r.wrapperClass=qa("handler"),r.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(c,"px)")},t.transitions&&t.transitions.enabled&&(r.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else r.wrapperClass=qa("handler",ln({},o.classname,!0));e.push(r)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,o=t.shift(),r=o.left,s=o.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=r:e==="east"&&(a.right+=r),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new nA(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};bv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"box",class:r.classes.root,style:r.style},[Ve(t.$slots,"default"),j("div",null,[(y(!0),ne(Me,null,He(r.lineNodes,(function(s){return y(),ne($t(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(y(!0),ne(Me,null,He(r.handlerNodes,(function(s){return y(),ne("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(y(),ne($t(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var $A=En("vue-draggable-area"),wv={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:$A()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=Fi(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):pv({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=Fi(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),o=i.left,r=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Dc({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};wv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};function Wa(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t?.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t?.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function kA(t){return new Promise((function(e,n){try{if(t)if(/^data:/i.test(t))e((function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var c=atob(l),u=c.length,d=new ArrayBuffer(u),h=new Uint8Array(d),v=0;v<u;v++)h[v]=c.charCodeAt(v);return d})(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},r=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===0?e(o.response):n("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){o.getResponseHeader("content-type")!=="image/jpeg"&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var r,s,a}))}function Sv(t){var e=t.rotate,n=t.flip,i=t.scaleX,o=t.scaleY,r="";return r+=" rotate("+e+"deg) ",r+=" scaleX("+i*(n.horizontal?-1:1)+") ",r+=" scaleY("+o*(n.vertical?-1:1)+") "}function OA(t){try{var e,n=new DataView(t),i=void 0,o=void 0,r=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){r=l;break}l++}if(r&&(i=r+10,(function(v,p,f){var _,C="";for(_=p,f+=p;_<f;_++)C+=String.fromCharCode(v.getUint8(_));return C})(n,r+4,4)==="Exif")){var c=n.getUint16(i);if(((o=c===18761)||c===19789)&&n.getUint16(i+2,o)===42){var u=n.getUint32(i+4,o);u>=8&&(s=i+u)}}if(s){for(var d=n.getUint16(s,o),h=0;h<d;h++)if(l=s+12*h+2,n.getUint16(l,o)===274){l+=8,e=n.getUint16(l,o),n.setUint16(l,1,o);break}}return e}catch{return null}}function ef(t,e){var n=e.getBoundingClientRect(),i=n.left,o=n.top,r={left:0,top:0},s=0;return t.forEach((function(a){r.left+=(a.clientX-i)/t.length,r.top+=(a.clientY-o)/t.length})),t.forEach((function(a){s+=pv({x:r.left,y:r.top},{x:a.clientX-i,y:a.clientY-o})})),{centerMass:r,spread:s,count:t.length}}var Cv={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Il(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new Oo({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=ef(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new Oo({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,o=n.top,r=n.bottom,s=n.right;this.touches=Fi(t.touches).filter((function(a){return a.clientX>i&&a.clientX<s&&a.clientY>o&&a.clientY<r})),this.oldGeometricProperties=ef(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=Fi(t.touches).filter((function(i){return!i.identifier||e.touches.find((function(o){return o.identifier===i.identifier}))}));this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,o=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||fv(a)?a:a>0?1:-1),r={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new Oo({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};Cv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};var jl={components:{TransformableImage:Cv},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};jl.render=function(t,e,n,i,o,r){var s=Ue("transformable-image");return y(),ne(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Dr=En("vue-preview"),Ev={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Dr({fill:this.fill}),wrapper:Dr("wrapper"),imageWrapper:Dr("image-wrapper"),image:_t(Dr("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Xe(Xe({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,o=_v({width:n,height:i},e.rotate),r={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-o.width)*e.scaleX/2,top:(i-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return r.transform=`translate(
23
- `.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+Sv(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};Ev.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"root",class:r.classes.root,style:r.style},[j("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[it(j("img",{ref:"image",src:n.image&&n.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[Sn,n.image&&n.image.src]])],6)],6)};var xv={components:{Preview:Ev},inheritAttrs:!1};xv.render=function(t,e,n,i,o,r){var s=Ue("preview");return y(),ne(s,We(t.$attrs,{fill:!0}),null,16)};var Ka=En("vue-rectangle-stencil"),Tv={name:"RectangleStencil",components:{StencilPreview:xv,BoundingBox:bv,DraggableArea:wv},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return jc}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return zc}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:_t(Ka({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:_t(Ka("preview"),this.previewClass),boundingBox:_t(Ka("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};Tv.render=function(t,e,n,i,o,r){var s=Ue("stencil-preview"),a=Ue("draggable-area"),l=Ue("bounding-box");return y(),ne("div",{class:r.classes.stencil,style:r.style},[j(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:r.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:we((function(){return[j(a,{movable:n.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:we((function(){return[j(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:r.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var AA=["transitions"],Bn=En("vue-advanced-cropper"),$v={name:"Cropper",components:{BackgroundWrapper:jl},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return Tv}},backgroundWrapperComponent:{type:[Object,String],default:function(){return jl}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return lA.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,o=t.positionRestrictions,r=t.sizeRestrictions,s=Re(Re({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=Re({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(l.left=0,l.right=0),r.heightFrozen&&(l.top=0,l.bottom=0),Rn.forEach((function(b){c[b]||(l[b]=0)}));var u=An(s,l=Zh({coordinates:s,directions:l,sizeRestrictions:r,positionRestrictions:o})).width,d=An(s,l).height,h=a.preserveRatio?Je(s):Ha(u/d,i);if(h){var v=a.respectDirection;if(v||(v=s.width>=s.height||h===1?"width":"height"),v==="width"){var p=u/h-s.height;if(c.top&&c.bottom){var f=l.top,_=l.bottom;l.bottom=Fr(p,_,f),l.top=Fr(p,f,_)}else c.bottom?l.bottom=p:c.top?l.top=p:c.right?l.right=0:c.left&&(l.left=0)}else if(v==="height"){var C=s.width-d*h;if(c.left&&c.right){var w=l.left,S=l.right;l.left=-Fr(C,w,S),l.right=-Fr(C,S,w)}else c.left?l.left=-C:c.right?l.right=-C:c.top?l.top=0:c.bottom&&(l.bottom=0)}l=Zh({directions:l,coordinates:s,sizeRestrictions:r,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return u=An(s,l).width,d=An(s,l).height,(h=a.preserveRatio?Je(s):Ha(u/d,i))&&Math.abs(h-u/d)>.001&&Rn.forEach((function(b){c[b]||(l[b]=0)})),Ll({event:new Dc({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Ll},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Je(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,o=t.sizeRestrictions,r=t.positionRestrictions,s=Re(Re({},n),Xn({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return s=St(s=Wt(s,io(wt(n),wt(s))),Ns(Ln(e),r))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,o=t.coordinates,r=Re({},e);r.height=r.width/Je(n),r.top+=(e.height-r.height)/2,(o.height-r.height>0||o.width-r.width>0)&&(r=un(r,Math.max(o.height/r.height,o.width/r.width)));var s=js(ro(o,Ln(r=un(r,zs(r,i({visibleArea:r,type:"resize"}))))));return r.width<o.width&&(s.left=0),r.height<o.height&&(s.top=0),r=St(r=Wt(r,s),i({visibleArea:r,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,o=t.imageRestriction,r=t.type,s={};return o==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:o==="fit-area"&&(Je(n)>Je(i)?(s={top:0,bottom:i.height},e&&r==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&r==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Xe({},Gh)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=(function(e){return e*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Fl(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Fl(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:yt(this.minWidth)?0:Mr(this.minWidth),minHeight:yt(this.minHeight)?0:Mr(this.minHeight),maxWidth:yt(this.maxWidth)?1/0:Mr(this.maxWidth),maxHeight:yt(this.maxHeight)?1/0:Mr(this.maxHeight)});if(t=(function(i){var o=i.areaRestrictions,r=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=Re(Re({},r),{minWidth:r.minWidth!==void 0?r.minWidth:0,minHeight:r.minHeight!==void 0?r.minHeight:0,maxWidth:r.maxWidth!==void 0?r.maxWidth:1/0,maxHeight:r.maxHeight!==void 0?r.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var c=Dl(o),u=gv(s,c);return c.width<1/0&&(!l.maxWidth||l.maxWidth>u.width)&&(l.maxWidth=Math.min(l.maxWidth,u.width)),c.height<1/0&&(!l.maxHeight||l.maxHeight>u.height)&&(l.maxHeight=Math.min(l.maxHeight,u.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l})({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Dl(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Bn(),image:_t(Bn("image"),this.imageClass),stencil:Bn("stencil"),boundaries:_t(Bn("boundaries"),this.boundariesClass),stretcher:_t(Bn("stretcher")),background:_t(Bn("background"),this.backgroundClass),foreground:_t(Bn("foreground"),this.foregroundClass),imageWrapper:_t(Bn("image-wrapper")),cropperWrapper:_t(Bn("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Xe(Xe({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+Sv(i)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(n){return t[n]!==e[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Il(this.update,this.debounce),this.debouncedDisableTransitions=Il(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Xe({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Xe({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new Oo({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new Oo({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,o=i===void 0||i,r=n.transitions,s=r===void 0||r;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?(function(e){var n=e.coordinates,i=e.sizeRestrictions,o=e.positionRestrictions,r={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return r.width>i.maxWidth?r.width=Math.floor(n.width):r.width<i.minWidth&&(r.width=Math.ceil(n.width)),r.height>i.maxHeight?r.height=Math.floor(n.height):r.height<i.minHeight&&(r.height=Math.ceil(n.height)),St(r,o)})(Xe(Xe({},this.getPublicProperties()),{},{positionRestrictions:Ir(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?dA:this.autoZoom?hA:fA);var r=o({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Xe(Xe({},r),{},{changed:!Qh(r.visibleArea,e)||!Qh(r.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,o=eA(e,AA),r=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),s=r.visibleArea,a=r.coordinates,l=r.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return(function(e){var n=e.event,i=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return Re(Re({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+i.left,top:n.scale.center.top*o+i.top}:null}});if(n.type==="resize"){var r=Re(Re({},n),{directions:Re({},n.directions)});return Rn.forEach((function(a){r.directions[a]*=o})),r}if(n.type==="move"){var s=Re(Re({},n),{directions:Re({},n.directions)});return aA.forEach((function(a){s.directions[a]*=o})),s}return n})(Xe(Xe({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(a,l,c){var u=c.rotate,d=c.flip,h={width:l.naturalWidth,height:l.naturalHeight},v=_v(h,u),p=a.getContext("2d");a.height=v.height,a.width=v.width,p.save();var f=si(wt(Re({left:0,top:0},h)),u);return p.translate(-(f.left-v.width/2),-(f.top-v.height/2)),p.rotate(u*Math.PI/180),p.translate(d.horizontal?h.width:0,d.vertical?h.height:0),p.scale(d.horizontal?-1:1,d.vertical?-1:1),p.drawImage(l,0,0,h.width,h.height),p.restore(),a})(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Xe({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(a){return a.find((function(l){return c=l,!Number.isNaN(parseFloat(c))&&isFinite(c);var c}))},r=Xn({sizeRestrictions:{minWidth:o([i.width,i.minWidth])||0,minHeight:o([i.height,i.minHeight])||0,maxWidth:o([i.width,i.maxWidth])||1/0,maxHeight:o([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&r.width*r.height>i.maxArea){var s=Math.sqrt(i.maxArea/(r.width*r.height));r={width:Math.round(s*r.width),height:Math.round(s*r.height)}}return(function(a,l,c,u,d){a.width=u?u.width:c.width,a.height=u?u.height:c.height;var h=a.getContext("2d");h.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(h.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(h.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(h.fillStyle=d.fillColor,h.fillRect(0,0,a.width,a.height),h.save()));var v=c.left<0?-c.left:0,p=c.top<0?-c.top:0;h.drawImage(l,c.left+v,c.top+p,c.width,c.height,v*(a.width/c.width),p*(a.height/c.height),a.width,a.height)})(t,n,this.coordinates,r,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?cA(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?Ir(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return uA({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?vA:mA);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=Ni(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||pA,r=[i,function(s){var a=s.coordinates;return Xe({},Ni(o)?o({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,Fi(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var i={cropper:n,imageSize:t.imageSize};if(Ni(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=(function(o){var r=o.cropper,s=o.imageSize,a=r.clientHeight,l=r.clientWidth,c=a,u=s.width*a/s.height;return u>l&&(u=l,c=s.height*l/s.width),{width:u,height:c}})(i):t.boundaries=(function(o){var r=o.cropper;return{width:r.clientWidth,height:r.clientHeight}})(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Xe(Xe({},this.defaultImageTransforms),{},{flip:Xe({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,o,r,s,a=t.defaultVisibleArea||gA;t.visibleArea=Ni(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,o=e.getAreaRestrictions,r=Re({},n),s=Je(i),r.width/r.height!==s&&(r.height=r.width/s),St(r,o({visibleArea:r,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(o){if(Kh(o))return!1;var r=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(c){return c.port||((c.protocol||r.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==r.protocol&&a.host&&a.host==r.host&&a.host&&l(a)==l(r))})(this.src)){var n=yt(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise((function(o){kA(t).then((function(r){var s=OA(r);o(r?{source:t,arrayBuffer:r,orientation:s}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(r){console.warn(r),o({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){i.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&o&&o>1?hv(n)||!Kh(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(r){for(var s=[],a=new Uint8Array(r);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))})(i):this.imageAttributes.src=n,Ni(this.defaultTransforms)?this.appliedImageTransforms=Wa(this.defaultTransforms()):Jr(this.defaultTransforms)?this.appliedImageTransforms=Wa(this.defaultTransforms):this.appliedImageTransforms=(function(r){var s=Wa({});if(r)switch(r){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s})(o),this.defaultImageTransforms=Xe(Xe({},this.appliedImageTransforms),{},{flip:Xe({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var r=e.$refs.image;r&&r.complete&&((function(s){return!!s.naturalWidth})(r)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Ir(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Ir(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,o=e.normalize,r=o===void 0||o;i&&this.enableTransitions();var s=_A(Xe(Xe({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,o=i.aspectRatio,r=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(yt(e)&&(e=yt(o)?r:o),yt(n)&&(n=yt(o)?s:o),!t&&(yt(e)||yt(n))){var l=this.getStencilSize(),c=l?Je(l):null;yt(e)&&(e=Yh(c)?c:void 0),yt(n)&&(n=Yh(c)?c:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,Ha(Je(o=Ni(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(o.width>e.width||o.height>e.height)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:Je(o),maximum:Je(o)}})),o;var t,e,n,i,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Xe({},Gh)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;if(!this.transitionsActive){o&&this.enableTransitions();var r=Xe({},this.imageTransforms.flip),s=bA({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var o=Xe({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=yA({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=r.visibleArea,a=r.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},PA={key:0,ref:"canvas",style:{display:"none"}},RA={key:1,ref:"sourceCanvas",style:{display:"none"}};$v.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"cropper",class:r.classes.cropper},[j("div",{ref:"stretcher",class:r.classes.stretcher},null,2),j("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(y(),ne($t(n.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:we((function(){return[j("div",{class:r.classes.background,style:r.boundariesStyle},null,6),j("div",{class:r.classes.imageWrapper},[j("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Ye((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),j("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),it((y(),ne($t(n.stencilComponent),We({ref:"stencil",image:r.image,coordinates:o.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},n.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Sn,o.imageLoaded]]),n.canvas?(y(),ne("canvas",PA,null,512)):ue("",!0),n.canvas?(y(),ne("canvas",RA,null,512)):ue("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const _i=typeof window<"u",kv=_i&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Ov=_i&&window.devicePixelRatio>1,MA={elements_selector:".lazy",container:kv||_i?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Av=t=>Object.assign({},MA,t),tf=function(t,e){let n;const i="LazyLoad::Initialized",o=new t(e);try{n=new CustomEvent(i,{detail:{instance:o}})}catch{n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(n)},IA=(t,e)=>{if(e)if(e.length)for(let n,i=0;n=e[i];i+=1)tf(t,n);else tf(t,e)},ei="src",Nc="srcset",Uc="sizes",Pv="poster",sr="llOriginalAttrs",Rv="data",Vc="loading",Mv="loaded",Iv="applied",FA="entered",Bc="error",Fv="native",Dv="data-",Lv="ll-status",Kt=(t,e)=>t.getAttribute(Dv+e),DA=(t,e,n)=>{const i=Dv+e;n!==null?t.setAttribute(i,n):t.removeAttribute(i)},ar=t=>Kt(t,Lv),ji=(t,e)=>DA(t,Lv,e),Us=t=>ji(t,null),Hc=t=>ar(t)===null,LA=t=>ar(t)===Vc,jA=t=>ar(t)===Bc,qc=t=>ar(t)===Fv,zA=[Vc,Mv,Iv,Bc],NA=t=>zA.indexOf(ar(t))>=0,yi=(t,e,n,i)=>{t&&typeof t=="function"&&(i===void 0?n===void 0?t(e):t(e,n):t(e,n,i))},po=(t,e)=>{_i&&e!==""&&t.classList.add(e)},Pn=(t,e)=>{_i&&e!==""&&t.classList.remove(e)},UA=t=>{t.llTempImage=document.createElement("IMG")},VA=t=>{delete t.llTempImage},jv=t=>t.llTempImage,Vs=(t,e)=>{if(!e)return;const n=e._observer;n&&n.unobserve(t)},BA=t=>{t.disconnect()},HA=(t,e,n)=>{e.unobserve_entered&&Vs(t,n)},Wc=(t,e)=>{t&&(t.loadingCount+=e)},qA=t=>{t&&(t.toLoadCount-=1)},zv=(t,e)=>{t&&(t.toLoadCount=e)},WA=t=>t.loadingCount>0,KA=t=>t.toLoadCount>0,Nv=t=>{let e=[];for(let n,i=0;n=t.children[i];i+=1)n.tagName==="SOURCE"&&e.push(n);return e},Kc=(t,e)=>{const n=t.parentNode;n&&n.tagName==="PICTURE"&&Nv(n).forEach(e)},Uv=(t,e)=>{Nv(t).forEach(e)},Bs=[ei],Vv=[ei,Pv],Vo=[ei,Nc,Uc],Bv=[Rv],Hs=t=>!!t[sr],Hv=t=>t[sr],qv=t=>delete t[sr],so=(t,e)=>{if(Hs(t))return;const n={};e.forEach((i=>{n[i]=t.getAttribute(i)})),t[sr]=n},YA=t=>{Hs(t)||(t[sr]={backgroundImage:t.style.backgroundImage})},Di=(t,e)=>{if(!Hs(t))return;const n=Hv(t);e.forEach((i=>{((o,r,s)=>{s?o.setAttribute(r,s):o.removeAttribute(r)})(t,i,n[i])}))},GA=t=>{if(!Hs(t))return;const e=Hv(t);t.style.backgroundImage=e.backgroundImage},Wv=(t,e,n)=>{po(t,e.class_applied),ji(t,Iv),n&&(e.unobserve_completed&&Vs(t,e),yi(e.callback_applied,t,n))},Kv=(t,e,n)=>{po(t,e.class_loading),ji(t,Vc),n&&(Wc(n,1),yi(e.callback_loading,t,n))},ui=(t,e,n)=>{n&&t.setAttribute(e,n)},nf=(t,e)=>{ui(t,Uc,Kt(t,e.data_sizes)),ui(t,Nc,Kt(t,e.data_srcset)),ui(t,ei,Kt(t,e.data_src))},QA=(t,e)=>{Kc(t,(n=>{so(n,Vo),nf(n,e)})),so(t,Vo),nf(t,e)},XA=(t,e)=>{so(t,Bs),ui(t,ei,Kt(t,e.data_src))},JA=(t,e)=>{Uv(t,(n=>{so(n,Bs),ui(n,ei,Kt(n,e.data_src))})),so(t,Vv),ui(t,Pv,Kt(t,e.data_poster)),ui(t,ei,Kt(t,e.data_src)),t.load()},ZA=(t,e)=>{so(t,Bv),ui(t,Rv,Kt(t,e.data_src))},eP=(t,e,n)=>{const i=Kt(t,e.data_bg),o=Kt(t,e.data_bg_hidpi),r=Ov&&o?o:i;r&&(t.style.backgroundImage=`url("${r}")`,jv(t).setAttribute(ei,r),Kv(t,e,n))},tP=(t,e,n)=>{const i=Kt(t,e.data_bg_multi),o=Kt(t,e.data_bg_multi_hidpi),r=Ov&&o?o:i;r&&(t.style.backgroundImage=r,Wv(t,e,n))},nP=(t,e,n)=>{const i=Kt(t,e.data_bg_set);if(!i)return;let o=i.split("|").map((r=>`image-set(${r})`));t.style.backgroundImage=o.join(),Wv(t,e,n)},Yv={IMG:QA,IFRAME:XA,VIDEO:JA,OBJECT:ZA},iP=(t,e)=>{const n=Yv[t.tagName];n&&n(t,e)},oP=(t,e,n)=>{const i=Yv[t.tagName];i&&(i(t,e),Kv(t,e,n))},rP=["IMG","IFRAME","VIDEO","OBJECT"],sP=t=>rP.indexOf(t.tagName)>-1,Gv=(t,e)=>{!e||WA(e)||KA(e)||yi(t.callback_finish,e)},of=(t,e,n)=>{t.addEventListener(e,n),t.llEvLisnrs[e]=n},aP=(t,e,n)=>{t.removeEventListener(e,n)},Yc=t=>!!t.llEvLisnrs,lP=(t,e,n)=>{Yc(t)||(t.llEvLisnrs={});const i=t.tagName==="VIDEO"?"loadeddata":"load";of(t,i,e),of(t,"error",n)},zl=t=>{if(!Yc(t))return;const e=t.llEvLisnrs;for(let n in e){const i=e[n];aP(t,n,i)}delete t.llEvLisnrs},Qv=(t,e,n)=>{VA(t),Wc(n,-1),qA(n),Pn(t,e.class_loading),e.unobserve_completed&&Vs(t,n)},cP=(t,e,n,i)=>{const o=qc(e);Qv(e,n,i),po(e,n.class_loaded),ji(e,Mv),yi(n.callback_loaded,e,i),o||Gv(n,i)},uP=(t,e,n,i)=>{const o=qc(e);Qv(e,n,i),po(e,n.class_error),ji(e,Bc),yi(n.callback_error,e,i),n.restore_on_error&&Di(e,Vo),o||Gv(n,i)},Nl=(t,e,n)=>{const i=jv(t)||t;Yc(i)||lP(i,(o=>{cP(0,t,e,n),zl(i)}),(o=>{uP(0,t,e,n),zl(i)}))},Ul=(t,e,n)=>{sP(t)?((i,o,r)=>{Nl(i,o,r),oP(i,o,r)})(t,e,n):((i,o,r)=>{UA(i),Nl(i,o,r),YA(i),eP(i,o,r),tP(i,o,r),nP(i,o,r)})(t,e,n)},dP=(t,e,n)=>{t.setAttribute("loading","lazy"),Nl(t,e,n),iP(t,e),ji(t,Fv)},rf=t=>{t.removeAttribute(ei),t.removeAttribute(Nc),t.removeAttribute(Uc)},hP=t=>{Kc(t,(e=>{rf(e)})),rf(t)},Xv=t=>{Kc(t,(e=>{Di(e,Vo)})),Di(t,Vo)},fP=t=>{Uv(t,(e=>{Di(e,Bs)})),Di(t,Vv),t.load()},pP=t=>{Di(t,Bs)},mP=t=>{Di(t,Bv)},vP={IMG:Xv,IFRAME:pP,VIDEO:fP,OBJECT:mP},gP=(t,e)=>{(n=>{const i=vP[n.tagName];i?i(n):GA(n)})(t),((n,i)=>{Hc(n)||qc(n)||(Pn(n,i.class_entered),Pn(n,i.class_exited),Pn(n,i.class_applied),Pn(n,i.class_loading),Pn(n,i.class_loaded),Pn(n,i.class_error))})(t,e),Us(t),qv(t)},_P=(t,e,n,i)=>{n.cancel_on_exit&&LA(t)&&t.tagName==="IMG"&&(zl(t),hP(t),Xv(t),Pn(t,n.class_loading),Wc(i,-1),Us(t),yi(n.callback_cancel,t,e,i))},yP=(t,e,n,i)=>{const o=NA(t);ji(t,FA),po(t,n.class_entered),Pn(t,n.class_exited),HA(t,n,i),yi(n.callback_enter,t,e,i),o||Ul(t,n,i)},bP=(t,e,n,i)=>{Hc(t)||(po(t,n.class_exited),_P(t,e,n,i),yi(n.callback_exit,t,e,i))},wP=["IMG","IFRAME","VIDEO"],Jv=t=>t.use_native&&"loading"in HTMLImageElement.prototype,SP=(t,e,n)=>{t.forEach((i=>{wP.indexOf(i.tagName)!==-1&&dP(i,e,n)})),zv(n,0)},CP=t=>t.isIntersecting||t.intersectionRatio>0,EP=(t,e)=>{e.forEach((n=>{t.observe(n)}))},xP=(t,e)=>{BA(t),EP(t,e)},TP=(t,e)=>{Jv(t)||(e._observer=new IntersectionObserver((n=>{((i,o,r)=>{i.forEach((s=>CP(s)?yP(s.target,s,o,r):bP(s.target,s,o,r)))})(n,t,e)}),(n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}))(t)))},Zv=t=>Array.prototype.slice.call(t),hs=t=>t.container.querySelectorAll(t.elements_selector),$P=t=>Zv(t).filter(Hc),kP=t=>jA(t),OP=t=>Zv(t).filter(kP),sf=(t,e)=>$P(t||hs(e)),AP=(t,e)=>{OP(hs(t)).forEach((n=>{Pn(n,t.class_error),Us(n)})),e.update()},PP=(t,e)=>{_i&&(e._onlineHandler=()=>{AP(t,e)},window.addEventListener("online",e._onlineHandler))},RP=t=>{_i&&window.removeEventListener("online",t._onlineHandler)},qi=function(t,e){const n=Av(t);this._settings=n,this.loadingCount=0,TP(n,this),PP(n,this),this.update(e)};qi.prototype={update:function(t){const e=this._settings,n=sf(t,e);zv(this,n.length),kv?this.loadAll(n):Jv(e)?SP(n,e,this):xP(this._observer,n)},destroy:function(){this._observer&&this._observer.disconnect(),RP(this),hs(this._settings).forEach((t=>{qv(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;sf(t,e).forEach((n=>{Vs(n,this),Ul(n,e,this)}))},restoreAll:function(){const t=this._settings;hs(t).forEach((e=>{gP(e,t)}))}},qi.load=(t,e)=>{const n=Av(e);Ul(t,n)},qi.resetStatus=t=>{Us(t)},_i&&IA(qi,window.lazyLoadOptions);const Xt=(t,e)=>{const{o:n,i,u:o}=t;let r=n,s;const a=(u,d)=>{const h=r,v=u,p=d||(i?!i(h,v):h!==v);return(p||o)&&(r=v,s=h),[r,p,s]};return[e?u=>a(e(r,s),u):a,u=>[r,!!u,s]]},MP=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,Bt=MP?window:{},eg=Math.max,IP=Math.min,Vl=Math.round,ai=Math.abs,af=Math.sign,Gc=Bt.cancelAnimationFrame,Bo=Bt.requestAnimationFrame,Qc=Bt.setTimeout,tg=Bt.clearTimeout,qs=t=>typeof Bt[t]<"u"?Bt[t]:void 0,FP=qs("MutationObserver"),lf=qs("IntersectionObserver"),Wi=qs("ResizeObserver"),ko=qs("ScrollTimeline"),Xc=t=>t===void 0,Ws=t=>t===null,di=t=>typeof t=="number",mo=t=>typeof t=="string",Ks=t=>typeof t=="boolean",xn=t=>typeof t=="function",dn=t=>Array.isArray(t),fs=t=>typeof t=="object"&&!dn(t)&&!Ws(t),Jc=t=>{const e=!!t&&t.length,n=di(e)&&e>-1&&e%1==0;return dn(t)||!xn(t)&&n?e>0&&fs(t)?e-1 in t:!0:!1},Ho=t=>!!t&&t.constructor===Object,ps=t=>t instanceof HTMLElement,Ys=t=>t instanceof Element;function ot(t,e){if(Jc(t))for(let n=0;n<t.length&&e(t[n],n,t)!==!1;n++);else t&&ot(Object.keys(t),(n=>e(t[n],n,t)));return t}const ng=(t,e)=>t.indexOf(e)>=0,ao=(t,e)=>t.concat(e),ct=(t,e,n)=>(!mo(e)&&Jc(e)?Array.prototype.push.apply(t,e):t.push(e),t),bi=t=>Array.from(t||[]),Zc=t=>dn(t)?t:!mo(t)&&Jc(t)?bi(t):[t],ms=t=>!!t&&!t.length,vs=t=>bi(new Set(t)),Zt=(t,e,n)=>{ot(t,o=>o?o.apply(void 0,e||[]):!0),n||(t.length=0)},ig="paddingTop",og="paddingRight",rg="paddingLeft",sg="paddingBottom",ag="marginLeft",lg="marginRight",cg="marginBottom",eu="overflowX",tu="overflowY",lr="width",cr="height",Yn="visible",yn="hidden",Ri="scroll",DP=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},Gs=(t,e,n,i)=>{if(t&&e){let o=!0;return ot(n,(r=>{const s=t[r],a=e[r];s!==a&&(o=!1)})),o}return!1},nu=(t,e)=>Gs(t,e,["w","h"]),Zr=(t,e)=>Gs(t,e,["x","y"]),LP=(t,e)=>Gs(t,e,["t","r","b","l"]),Le=(t,...e)=>t.bind(0,...e),Ki=t=>{let e;const n=t?Qc:Bo,i=t?tg:Gc;return[o=>{i(e),e=n((()=>o()),xn(t)?t():t)},()=>i(e)]},cf=t=>{const e=xn(t)?t():t;if(di(e)){const n=e?Qc:Bo,i=e?tg:Gc;return o=>{const r=n((()=>o()),e);return()=>{i(r)}}}return e&&e._},ug=(t,e)=>{const{p:n,v:i,S:o,m:r}=e||{};let s,a,l,c;const u=function(f){a&&a(),s&&s(),c=a=s=l=void 0,t.apply(this,f)},d=p=>r&&l?r(l,p):p,h=()=>{a&&l&&u(d(l)||l)},v=function(){const f=bi(arguments),_=cf(n);if(_){const C=typeof o=="function"?o():o,w=cf(i),b=d(f)||f,E=u.bind(0,b);a&&a(),C&&!c?(E(),c=!0,a=_((()=>c=void 0))):(a=_(E),w&&!s&&(s=w(h))),l=b}else u(f)};return v.O=h,v},dg=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Nt=t=>t?Object.keys(t):[],Ze=(t,e,n,i,o,r,s)=>{const a=[e,n,i,o,r,s];return(typeof t!="object"||Ws(t))&&!xn(t)&&(t={}),ot(a,(l=>{ot(l,((c,u)=>{const d=l[u];if(t===d)return!0;const h=dn(d);if(d&&Ho(d)){const v=t[u];let p=v;h&&!dn(v)?p=[]:!h&&!Ho(v)&&(p={}),t[u]=Ze(p,d)}else t[u]=h?d.slice():d}))})),t},hg=(t,e)=>ot(Ze({},t),((n,i,o)=>{n===void 0?delete o[i]:n&&Ho(n)&&(o[i]=hg(n))})),iu=t=>!Nt(t).length,qo=()=>{},fg=(t,e,n)=>eg(t,IP(e,n)),Mi=t=>vs((dn(t)?t:(t||"").split(" ")).filter((e=>e))),ou=(t,e)=>t&&t.getAttribute(e),uf=(t,e)=>t&&t.hasAttribute(e),Wn=(t,e,n)=>{ot(Mi(e),(i=>{t&&t.setAttribute(i,String(n||""))}))},kn=(t,e)=>{ot(Mi(e),(n=>t&&t.removeAttribute(n)))},Qs=(t,e)=>{const n=Mi(ou(t,e)),i=Le(Wn,t,e),o=(r,s)=>{const a=new Set(n);return ot(Mi(r),(l=>{a[s](l)})),bi(a).join(" ")};return{C:r=>i(o(r,"delete")),$:r=>i(o(r,"add")),H:r=>{const s=Mi(r);return s.reduce(((a,l)=>a&&n.includes(l)),s.length>0)}}},pg=(t,e,n)=>(Qs(t,e).C(n),Le(ru,t,e,n)),ru=(t,e,n)=>(Qs(t,e).$(n),Le(pg,t,e,n)),gs=(t,e,n,i)=>(i?ru:pg)(t,e,n),su=(t,e,n)=>Qs(t,e).H(n),mg=t=>Qs(t,"class"),vg=(t,e)=>{mg(t).C(e)},Xs=(t,e)=>(mg(t).$(e),Le(vg,t,e)),gg=(t,e)=>{const n=e?Ys(e)&&e:document;return n?bi(n.querySelectorAll(t)):[]},jP=(t,e)=>{const n=e?Ys(e)&&e:document;return n&&n.querySelector(t)},Bl=(t,e)=>Ys(t)&&t.matches(e),_g=t=>Bl(t,"body"),Hl=t=>t?bi(t.childNodes):[],Wo=t=>t&&t.parentElement,Yi=(t,e)=>Ys(t)&&t.closest(e),ql=t=>document.activeElement,zP=(t,e,n)=>{const i=Yi(t,e),o=t&&jP(n,i),r=Yi(o,e)===i;return i&&o?i===t||o===t||r&&Yi(Yi(t,n),e)!==i:!1},lo=t=>{ot(Zc(t),(e=>{const n=Wo(e);e&&n&&n.removeChild(e)}))},Mt=(t,e)=>Le(lo,t&&e&&ot(Zc(e),(n=>{n&&t.appendChild(n)})));let yg;const NP=()=>yg,UP=t=>{yg=t},Xi=t=>{const e=document.createElement("div");return Wn(e,"class",t),e},au=t=>{const e=Xi(),n=NP(),i=t.trim();return e.innerHTML=n?n.createHTML(i):i,ot(Hl(e),(o=>lo(o)))},df=(t,e)=>t.getPropertyValue(e)||t[e]||"",bg=t=>{const e=t||0;return isFinite(e)?e:0},Lr=t=>bg(parseFloat(t||"")),Wl=t=>Math.round(t*1e4)/1e4,wg=t=>`${Wl(bg(t))}px`;function co(t,e){t&&e&&ot(e,((n,i)=>{try{const o=t.style,r=Ws(n)||Ks(n)?"":di(n)?wg(n):n;i.indexOf("--")===0?o.setProperty(i,r):o[i]=r}catch{}}))}function jn(t,e,n){const i=mo(e);let o=i?"":{};if(t){const r=Bt.getComputedStyle(t,n)||t.style;o=i?df(r,e):bi(e).reduce(((s,a)=>(s[a]=df(r,a),s)),o)}return o}const hf=(t,e,n)=>{const i=e?`${e}-`:"",o=n?`-${n}`:"",r=`${i}top${o}`,s=`${i}right${o}`,a=`${i}bottom${o}`,l=`${i}left${o}`,c=jn(t,[r,s,a,l]);return{t:Lr(c[r]),r:Lr(c[s]),b:Lr(c[a]),l:Lr(c[l])}},Ya=(t,e)=>`translate${fs(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,VP=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),BP={w:0,h:0},Js=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:BP,HP=t=>Js("inner",t||Bt),hi=Le(Js,"offset"),Sg=Le(Js,"client"),_s=Le(Js,"scroll"),lu=t=>{const e=parseFloat(jn(t,lr))||0,n=parseFloat(jn(t,cr))||0;return{w:e-Vl(e),h:n-Vl(n)}},Ga=t=>t.getBoundingClientRect(),qP=t=>!!t&&VP(t),Kl=t=>!!(t&&(t[cr]||t[lr])),Cg=(t,e)=>{const n=Kl(t);return!Kl(e)&&n},ff=(t,e,n,i)=>{ot(Mi(e),(o=>{t&&t.removeEventListener(o,n,i)}))},st=(t,e,n,i)=>{var o;const r=(o=i&&i.D)!=null?o:!0,s=i&&i.I||!1,a=i&&i.A||!1,l={passive:r,capture:s};return Le(Zt,Mi(e).map((c=>{const u=a?d=>{ff(t,c,u,s),n&&n(d)}:n;return t&&t.addEventListener(c,u,l),Le(ff,t,c,u,s)})))},cu=t=>t.stopPropagation(),Yl=t=>t.preventDefault(),Eg=t=>cu(t)||Yl(t),cn=(t,e)=>{const{x:n,y:i}=di(e)?{x:e,y:e}:e||{};di(n)&&(t.scrollLeft=n),di(i)&&(t.scrollTop=i)},Jt=t=>({x:t.scrollLeft,y:t.scrollTop}),xg=()=>({T:{x:0,y:0},k:{x:0,y:0}}),WP=(t,e)=>{const{T:n,k:i}=t,{w:o,h:r}=e,s=(d,h,v)=>{let p=af(d)*v,f=af(h)*v;if(p===f){const _=ai(d),C=ai(h);f=_>C?0:f,p=_<C?0:p}return p=p===f?0:p,[p+0,f+0]},[a,l]=s(n.x,i.x,o),[c,u]=s(n.y,i.y,r);return{T:{x:a,y:c},k:{x:l,y:u}}},Qa=({T:t,k:e})=>{const n=(i,o)=>i===0&&i<=o;return{x:n(t.x,e.x),y:n(t.y,e.y)}},pf=({T:t,k:e},n)=>{const i=(o,r,s)=>fg(0,1,(o-s)/(o-r)||0);return{x:i(t.x,e.x,n.x),y:i(t.y,e.y,n.y)}},Gl=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},mf=(t,e)=>{ot(Zc(e),t)},Ql=t=>{const e=new Map,n=(r,s)=>{if(r){const a=e.get(r);mf((l=>{a&&a[l?"delete":"clear"](l)}),s)}else e.forEach((a=>{a.clear()})),e.clear()},i=(r,s)=>{if(mo(r)){const c=e.get(r)||new Set;return e.set(r,c),mf((u=>{xn(u)&&c.add(u)}),s),Le(n,r,s)}Ks(s)&&s&&n();const a=Nt(r),l=[];return ot(a,(c=>{const u=r[c];u&&ct(l,i(c,u))})),Le(Zt,l)},o=(r,s)=>{ot(bi(e.get(r)),(a=>{s&&!ms(s)?a.apply(0,s):a()}))};return i(t||{}),[i,n,o]},Tg={},$g={},KP=t=>{ot(t,(e=>ot(e,((n,i)=>{Tg[i]=e[i]}))))},kg=(t,e,n)=>Nt(t).map((i=>{const{static:o,instance:r}=t[i],[s,a,l]=n||[],c=n?r:o;if(c){const u=n?c(s,a,e):c(e);return(l||$g)[i]=u}})),YP=(t,e)=>t[e],vo=t=>YP($g,t),GP="__osOptionsValidationPlugin",go="data-overlayscrollbars",es="os-environment",jr=`${es}-scrollbar-hidden`,Xa=`${go}-initialize`,ts="noClipping",vf=`${go}-body`,fi=go,QP="host",Kn=`${go}-viewport`,XP=eu,JP=tu,ZP="arrange",Og="measuring",eR="scrolling",Ag="scrollbarHidden",tR="noContent",Xl=`${go}-padding`,gf=`${go}-content`,uu="os-size-observer",nR=`${uu}-appear`,du=`${uu}-listener`,iR=`${du}-scroll`,ns=`${du}-item`,_f=`${ns}-final`,oR="os-trinsic-observer",rR="os-theme-none",tn="os-scrollbar",sR=`${tn}-rtl`,aR=`${tn}-horizontal`,lR=`${tn}-vertical`,Pg=`${tn}-track`,hu=`${tn}-handle`,cR=`${tn}-visible`,uR=`${tn}-cornerless`,yf=`${tn}-interaction`,bf=`${tn}-unusable`,Jl=`${tn}-auto-hide`,dR=`${Jl}-hidden`,wf=`${tn}-wheel`,hR=`${Pg}-interactive`,fR=`${hu}-interactive`,Rg="__osSizeObserverPlugin",pR={[Rg]:{static:()=>(t,e,n)=>{const o="scroll",r=au(`<div class="${ns}" dir="ltr"><div class="${ns}"><div class="${_f}"></div></div><div class="${ns}"><div class="${_f}" style="width: 200%; height: 200%"></div></div></div>`),s=r[0],a=s.lastChild,l=s.firstChild,c=l?.firstChild;let u=hi(s),d=u,h=!1,v;const p=()=>{cn(l,3333333),cn(a,3333333)},f=w=>{v=0,h&&(u=d,e(w===!0))},_=w=>{d=hi(s),h=!w||!nu(d,u),w?(cu(w),h&&!v&&(Gc(v),v=Bo(f))):f(w===!1),p()},C=[Mt(t,r),st(l,o,_),st(a,o,_)];return Xs(t,iR),co(c,{[lr]:3333333,[cr]:3333333}),Bo(p),[n?Le(_,!1):p,C]}}},mR=(t,e)=>{const{M:n}=e,[i,o]=t("showNativeOverlaidScrollbars");return[i&&n.x&&n.y,o]},Gi=t=>t.indexOf(Yn)===0,vR=t=>t.replace(`${Yn}-`,""),Zl=(t,e)=>{if(t==="auto")return e?Ri:yn;const n=t||yn;return[yn,Ri,Yn].includes(n)?n:yn},gR=(t,e)=>{const{overflowX:n,overflowY:i}=jn(t,[eu,tu]);return{x:Zl(n,e.x),y:Zl(i,e.y)}},fu="__osScrollbarsHidingPlugin",_R="__osClickScrollPlugin",Sf=t=>JSON.stringify(t,((e,n)=>{if(xn(n))throw 0;return n})),Cf=(t,e)=>t?`${e}`.split(".").reduce(((n,i)=>n&&dg(n,i)?n[i]:void 0),t):void 0,yR=[0,33],Mg=[33,99],Ig=[222,666,!0],bR={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:yR,resize:null,event:Mg,env:Ig},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Fg=(t,e)=>{const n={},i=ao(Nt(e),Nt(t));return ot(i,(o=>{const r=t[o],s=e[o];if(fs(r)&&fs(s))Ze(n[o]={},Fg(r,s)),iu(n[o])&&delete n[o];else if(dg(e,o)&&s!==r){let a=!0;if(dn(r)||dn(s))try{Sf(r)===Sf(s)&&(a=!1)}catch{}a&&(n[o]=s)}})),n},Ja=(t,e,n)=>i=>[Cf(t,i),n||Cf(e,i)!==void 0];let Dg;const wR=()=>Dg,SR=t=>{Dg=t};let Za;const CR=()=>{const t=(b,E,x)=>{Mt(document.body,b),Mt(document.body,b);const O=Sg(b),$=hi(b),K=lu(E);return x&&lo(b),{x:$.h-O.h+K.h,y:$.w-O.w+K.w}},e=b=>{let E=!1;const x=Xs(b,jr);try{E=jn(b,"scrollbar-width")==="none"||jn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),E},n=`.${es}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${es} div{width:200%;height:200%;margin:10px 0}.${jr}{scrollbar-width:none!important}.${jr}::-webkit-scrollbar,.${jr}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,o=au(`<div class="${es}"><div></div><style>${n}</style></div>`)[0],r=o.firstChild,s=o.lastChild,a=wR();a&&(s.nonce=a);const[l,,c]=Ql(),[u,d]=Xt({o:t(o,r),i:Zr},Le(t,o,r,!0)),[h]=d(),v=e(o),p={x:h.x===0,y:h.y===0},f={elements:{host:null,padding:!v,viewport:b=>v&&_g(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},_=Ze({},bR),C=Le(Ze,{},_),w=Le(Ze,{},f),S={U:h,M:p,P:v,J:!!ko,G:Le(l,"r"),K:w,Z:b=>Ze(f,b)&&w(),tt:C,nt:b=>Ze(_,b)&&C(),ot:Ze({},f),st:Ze({},_)};if(kn(o,"style"),lo(o),st(Bt,"resize",(()=>{c("r",[])})),xn(Bt.matchMedia)&&!v&&(!p.x||!p.y)){const b=E=>{const x=Bt.matchMedia(`(resolution: ${Bt.devicePixelRatio}dppx)`);st(x,"change",(()=>{E(),b(E)}),{A:!0})};b((()=>{const[E,x]=u();Ze(S.U,E),c("r",[x])}))}return S},Un=()=>(Za||(Za=CR()),Za),ER=(t,e,n)=>{let i=!1;const o=n?new WeakMap:!1,r=()=>{i=!0},s=a=>{if(o&&n){const l=n.map((c=>{const[u,d]=c||[];return[d&&u?(a||gg)(u,t):[],d]}));ot(l,(c=>ot(c[0],(u=>{const d=c[1],h=o.get(u)||[];if(t.contains(u)&&d){const p=st(u,d,(f=>{i?(p(),o.delete(u)):e(f)}));o.set(u,ct(h,p))}else Zt(h),o.delete(u)}))))}};return s(),[r,s]},Ef=(t,e,n,i)=>{let o=!1;const{et:r,ct:s,rt:a,it:l,lt:c,ut:u}=i||{},[d,h]=ER(t,(()=>o&&n(!0)),a),v=r||[],p=s||[],f=ao(v,p),_=(w,S)=>{if(!ms(S)){const b=c||qo,E=u||qo,x=[],O=[];let $=!1,K=!1;if(ot(S,(F=>{const{attributeName:P,target:N,type:I,oldValue:q,addedNodes:le,removedNodes:de}=F,Y=I==="attributes",M=I==="childList",A=t===N,Q=Y&&P,U=Q&&ou(N,P||""),ie=mo(U)?U:null,ve=Q&&q!==ie,re=ng(p,P)&&ve;if(e&&(M||!A)){const ge=Y&&ve,_e=ge&&l&&Bl(N,l),k=(_e?!b(N,P,q,ie):!Y||ge)&&!E(F,!!_e,t,i);ot(le,(z=>ct(x,z))),ot(de,(z=>ct(x,z))),K=K||k}!e&&A&&ve&&!b(N,P,q,ie)&&(ct(O,P),$=$||re)})),h((F=>vs(x).reduce(((P,N)=>(ct(P,gg(F,N)),Bl(N,F)?ct(P,N):P)),[]))),e)return!w&&K&&n(!1),[!1];if(!ms(O)||$){const F=[vs(O),$];return w||n.apply(0,F),F}}},C=new FP(Le(_,!1));return[()=>(C.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:f,subtree:e,childList:e,characterData:e}),o=!0,()=>{o&&(d(),C.disconnect(),o=!1)}),()=>{if(o)return _(!0,C.takeRecords())}]};let Si=null;const Lg=(t,e,n)=>{const{ft:i}=n||{},o=vo(Rg),[r]=Xt({o:!1,u:!0});return()=>{const s=[],l=au(`<div class="${uu}"><div class="${du}"></div></div>`)[0],c=l.firstChild,u=d=>{const h=dn(d)&&!ms(d);let v=!1,p=!1;if(h){const f=d[0],[_,,C]=r(f.contentRect),w=Kl(_);p=Cg(_,C),v=!p&&!w}else p=d===!0;v||e({_t:!0,ft:p})};if(Wi){if(!Ks(Si)){const p=new Wi(qo);p.observe(t,{get box(){Si=!0}}),Si=Si||!1,p.disconnect()}const d=ug(u,{p:0,v:0}),h=p=>d(p),v=new Wi(h);if(v.observe(Si?t:c),ct(s,[()=>{v.disconnect()},!Si&&Mt(t,l)]),Si){const p=new Wi(h);p.observe(t,{box:"border-box"}),ct(s,(()=>p.disconnect()))}}else if(o){const[d,h]=o(c,u,i);ct(s,ao([Xs(l,nR),st(l,"animationstart",d),Mt(t,l)],h))}else return qo;return Le(Zt,s)}},xR=(t,e)=>{let n;const i=l=>l.h===0||l.isIntersecting||l.intersectionRatio>0,o=Xi(oR),[r]=Xt({o:!1}),s=(l,c)=>{if(l){const u=r(i(l)),[,d]=u;return d&&!c&&e(u)&&[u]}},a=(l,c)=>s(c.pop(),l);return[()=>{const l=[];if(lf)n=new lf(Le(a,!1),{root:t}),n.observe(o),ct(l,(()=>{n.disconnect()}));else{const c=()=>{const u=hi(o);s(u)};ct(l,Lg(o,c)()),c()}return Le(Zt,ct(l,Mt(t,o)))},()=>n&&a(!0,n.takeRecords())]},TR=(t,e,n,i)=>{let o,r,s,a,l,c,u,d;const h=`[${fi}]`,v=`[${Kn}]`,p=["id","class","style","open","wrap","cols","rows"],{dt:f,vt:_,L:C,gt:w,ht:S,V:b,bt:E,yt:x,wt:O,St:$}=t,K=R=>jn(R,"direction")==="rtl",F=()=>{let R,k,z;const D=ug(i,{p:()=>R,v:()=>k,S:()=>z,m(oe,ee){const[G]=oe,[he]=ee;return[ao(Nt(G),Nt(he)).reduce(((me,ke)=>(me[ke]=G[ke]||he[ke],me)),{})]}}),B=(oe,ee)=>{if(dn(ee)){const[G,he,me]=ee;R=G,k=he,z=me}else di(ee)?(R=ee,k=!1,z=!1):(R=!1,k=!1,z=!1);D(oe)};return B.O=D.O,B},P={Ot:!1,B:K(f)},N=Un(),I=vo(fu),[q]=Xt({i:nu,o:{w:0,h:0}},(()=>{const R=I&&I.R(t,e,P,N,n).Y,z=!(E&&b)&&su(_,fi,ts),D=!b&&x(ZP),B=D&&Jt(w),oe=B&&$(),ee=O(Og,z),G=D&&R&&R(),he=_s(C),me=lu(C);return G&&G(),cn(w,B),oe&&oe(),z&&ee(),{w:he.w+me.w,h:he.h+me.h}})),le=F(),de=R=>{const k=K(f);Ze(R,{Ct:d!==k}),Ze(P,{B:k}),d=k},Y=(R,k)=>{const[z,D]=R,B={$t:D};return Ze(P,{Ot:z}),k||i(B),B},M=({_t:R,ft:k})=>{const z=k?i:le,D={_t:R||k,ft:k};de(D),z(D,r)},A=(R,k)=>{const[,z]=q(),D={xt:z};return de(D),z&&!k&&le(D,R?s:o),D},Q=(R,k,z)=>{const D={Ht:k};return de(D),k&&!z&&le(D,o),D},[U,ie]=S?xR(_,Y):[],ve=!b&&Lg(_,M,{ft:!0}),[re,ge]=Ef(_,!1,Q,{ct:p,et:p}),_e=b&&Wi&&new Wi((R=>{const k=R[R.length-1].contentRect;M({_t:!0,ft:Cg(k,u)}),u=k}));return[()=>{_e&&_e.observe(_);const R=ve&&ve(),k=U&&U(),z=re(),D=N.G((B=>{const[,oe]=q();le({Et:B,xt:oe,_t:E},a)}));return()=>{_e&&_e.disconnect(),R&&R(),k&&k(),c&&c(),z(),D()}},({Dt:R,zt:k,It:z})=>{const D={},[B]=R("update.ignoreMutation"),[oe,ee]=R("update.attributes"),[G,he]=R("update.elementEvents"),[me,ke]=R("update.debounce"),Ee=he||ee,ze=k||z,Pe=Ne=>xn(B)&&!!B(Ne);if(Ee){l&&l(),c&&c();const[Ne,ut]=Ef(S||C,!0,A,{et:ao(p,oe||[]),rt:G,it:h,ut:(Qe,at)=>{const{target:tt,attributeName:ft}=Qe;return(!at&&ft&&!b?zP(tt,h,v):!1)||!!Yi(tt,`.${tn}`)||Pe(Qe)}});c=Ne(),l=ut}if(ke&&(le.O(),dn(me)||di(me)?(o=me,r=!1,s=Mg,a=Ig):Ho(me)?(o=me.mutation,r=me.resize,s=me.event,a=me.env):(o=!1,r=!1,s=!1,a=!1)),ze){const Ne=ge(),ut=ie&&ie(),Qe=l&&l();Ne&&Ze(D,Q(Ne[0],Ne[1],ze)),ut&&Ze(D,Y(ut[0],ze)),Qe&&Ze(D,A(Qe[0],ze))}return de(D),D},P]},jg=(t,e)=>xn(e)?e.apply(0,t):e,$R=(t,e,n,i)=>{const o=Xc(i)?n:i;return jg(t,o)||e.apply(0,t)},zg=(t,e,n,i)=>{const o=Xc(i)?n:i,r=jg(t,o);return!!r&&(ps(r)?r:e.apply(0,t))},kR=(t,e)=>{const{nativeScrollbarsOverlaid:n,body:i}=e||{},{M:o,P:r,K:s}=Un(),{nativeScrollbarsOverlaid:a,body:l}=s().cancel,c=n??a,u=Xc(i)?l:i,d=(o.x||o.y)&&c,h=t&&(Ws(u)?!r:u);return!!d||!!h},OR=(t,e,n,i)=>{const o="--os-viewport-percent",r="--os-scroll-percent",s="--os-scroll-direction",{K:a}=Un(),{scrollbars:l}=a(),{slot:c}=l,{dt:u,vt:d,L:h,At:v,gt:p,bt:f,V:_}=e,{scrollbars:C}=v?{}:t,{slot:w}=C||{},S=[],b=[],E=[],x=zg([u,d,h],(()=>_&&f?u:d),c,w),O=U=>{if(ko){let ie=null,ve=[];const re=new ko({source:p,axis:U}),ge=()=>{ie&&ie.cancel(),ie=null};return{Mt:R=>{const{Tt:k}=n,z=Qa(k)[U],D=U==="x",B=[Ya(0,D),Ya(`calc(-100% + 100cq${D?"w":"h"})`,D)],oe=z?B:B.reverse();return ve[0]===oe[0]&&ve[1]===oe[1]||(ve=oe,ge(),ie=R.kt.animate({clear:["left"],transform:oe},{timeline:re})),ge}}}},$={x:O("x"),y:O("y")},K=()=>{const{Rt:U,Vt:ie}=n,ve=(re,ge)=>fg(0,1,re/(re+ge)||0);return{x:ve(ie.x,U.x),y:ve(ie.y,U.y)}},F=(U,ie,ve)=>{const re=ve?Xs:vg;ot(U,(ge=>{re(ge.Lt,ie)}))},P=(U,ie)=>{ot(U,(ve=>{const[re,ge]=ie(ve);co(re,ge)}))},N=(U,ie,ve)=>{const re=Ks(ve),ge=re?ve:!0,_e=re?!ve:!0;ge&&F(b,U,ie),_e&&F(E,U,ie)},I=()=>{const U=K(),ie=ve=>re=>[re.Lt,{[o]:Wl(ve)+""}];P(b,ie(U.x)),P(E,ie(U.y))},q=()=>{if(!ko){const{Tt:U}=n,ie=pf(U,Jt(p)),ve=re=>ge=>[ge.Lt,{[r]:Wl(re)+""}];P(b,ve(ie.x)),P(E,ve(ie.y))}},le=()=>{const{Tt:U}=n,ie=Qa(U),ve=re=>ge=>[ge.Lt,{[s]:re?"0":"1"}];P(b,ve(ie.x)),P(E,ve(ie.y)),ko&&(b.forEach($.x.Mt),E.forEach($.y.Mt))},de=()=>{if(_&&!f){const{Rt:U,Tt:ie}=n,ve=Qa(ie),re=pf(ie,Jt(p)),ge=_e=>{const{Lt:R}=_e,k=Wo(R)===h&&R,z=(D,B,oe)=>{const ee=B*D;return wg(oe?ee:-ee)};return[k,k&&{transform:Ya({x:z(re.x,U.x,ve.x),y:z(re.y,U.y,ve.y)})}]};P(b,ge),P(E,ge)}},Y=U=>{const ie=U?"x":"y",re=Xi(`${tn} ${U?aR:lR}`),ge=Xi(Pg),_e=Xi(hu),R={Lt:re,Pt:ge,kt:_e},k=$[ie];return ct(U?b:E,R),ct(S,[Mt(re,ge),Mt(ge,_e),Le(lo,re),k&&k.Mt(R),i(R,N,U)]),R},M=Le(Y,!0),A=Le(Y,!1),Q=()=>(Mt(x,b[0].Lt),Mt(x,E[0].Lt),Le(Zt,S));return M(),A(),[{Ut:I,Nt:q,qt:le,Bt:de,Ft:N,jt:{Xt:b,Yt:M,Wt:Le(P,b)},Jt:{Xt:E,Yt:A,Wt:Le(P,E)}},Q]},AR=(t,e,n,i,o)=>(r,s,a)=>{const{vt:l,L:c,V:u,gt:d,Gt:h,St:v}=e,{Lt:p,Pt:f,kt:_}=r,[C,w]=Ki(333),[S,b]=Ki(444),E=$=>{xn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:$.x,top:$.y})},x=()=>{const $="pointerup pointercancel lostpointercapture",K=`client${a?"X":"Y"}`,F=a?lr:cr,P=a?"left":"top",N=a?"w":"h",I=a?"x":"y",q=[];return st(f,"pointerdown",i((le=>{const de=Yi(le.target,`.${hu}`)===_,Y=de?_:f,M=t.scrollbars,A=M[de?"dragScroll":"clickScroll"],{button:Q,isPrimary:U,pointerType:ie}=le,{pointers:ve}=M;if(Q===0&&U&&A&&(ve||[]).includes(ie)){Zt(q),b();const ge=!de&&(le.shiftKey||A==="instant"),_e=Le(Ga,_),R=Le(Ga,f),k=(tt,ft)=>(tt||_e())[P]-(ft||R())[P],z=Vl(Ga(d)[F])/hi(d)[N]||1,D=Jt(d)[I],B=tt=>{cn(d,{[I]:D+tt})},oe=tt=>{const{Rt:ft}=n,dt=hi(f)[N]-hi(_)[N],pt=1/z*tt/dt;B(pt*ft[I])},ee=le[K],G=_e(),he=R(),me=G[F],ke=k(G,he)+me/2,ze=ee-he[P]-ke,Pe=de?0:ze,Ne=tt=>{Zt(at),Y.releasePointerCapture(tt.pointerId)},ut=de||ge,Qe=v(),at=[st(h,$,Ne),st(h,"selectstart",(tt=>Yl(tt)),{D:!1}),st(f,$,Ne),ut&&st(f,"pointermove",(tt=>oe(Pe+tt[K]-ee))),ut&&(()=>{const tt=Jt(d);Qe();const ft=Jt(d),dt={x:ft.x-tt.x,y:ft.y-tt.y};(ai(dt.x)>3||ai(dt.y)>3)&&(v(),cn(d,tt),E(dt),S(Qe))})];if(Y.setPointerCapture(le.pointerId),ge)oe(ze);else if(!de){const tt=vo(_R);if(tt){const{Vt:ft}=n,dt=tt(B,oe,Le(k),ze,ft[I],A,!!a,(pt=>{pt?Qe():ct(at,Qe)}));ct(at,dt),ct(q,Le(dt,!0))}}}})))};let O=!0;return Le(Zt,[st(_,"pointermove pointerleave",i(o)),st(p,"pointerenter",i((()=>{s(yf,!0)}))),st(p,"pointerleave pointercancel",i((()=>{s(yf,!1)}))),st(p,"wheel",i(($=>{const{deltaX:K,deltaY:F,deltaMode:P}=$;O&&P===0&&Wo(p)===l&&E({x:K,y:F}),O=!1,s(wf,!0),C((()=>{O=!0,s(wf)})),Yl($)})),{D:!1,I:!0}),!u&&st(p,"mousedown",i((()=>{const $=ql();(uf($,Kn)||uf($,fi)||$===document.body)&&Qc(Le(Gl,c),25)}))),st(p,"pointerdown",(()=>{const $=st(h,"click",(F=>{K(),Eg(F)}),{A:!0,I:!0,D:!1}),K=st(h,"pointerup pointercancel",(()=>{K(),setTimeout($,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),x(),w,b])},PR=(t,e,n,i,o,r,s)=>{let a,l,c,u,d,h=qo,v=0;const p=["mouse","pen"],f=_e=>R=>{n.Kt||_e(R)},_=_e=>p.includes(_e.pointerType),[C,w]=Ki(),[S,b]=Ki(100),[E,x]=Ki(50),[O,$]=Ki((()=>v)),[K,F]=OR(t,r,o,AR(e,r,o,f,(_e=>_(_e)&&Q()))),{vt:P,Qt:N,bt:I}=r,{Ft:q,Ut:le,Nt:de,qt:Y,Bt:M}=K,A=(_e,R)=>{$();const k=z=>{n.Kt||q(dR,z)};if(_e)k();else{const z=c?!a:!0;v>0&&!R?O(Le(k,z)):k(z)}},Q=()=>{(c?!a:!u)&&(A(!0),S((()=>{A(!1)})))},U=_e=>{_(_e)&&(a=!0,!n.Kt&&c&&A(!0))},ie=_e=>{_(_e)&&(a=!1,!n.Kt&&c&&A(!1))},ve=_e=>{q(Jl,_e,!0),q(Jl,_e,!1)},re=[$,b,x,w,()=>h(),st(P,"pointerover",U,{A:!0}),st(P,"pointerenter",U),st(P,"pointerleave",ie),st(P,"pointermove",f((_e=>{_(_e)&&l&&Q()}))),st(N,"scroll",f((_e=>{C((()=>{de(),Q()})),s(_e),M()})))],ge=vo(fu);return[()=>Le(Zt,ct(re,F())),({Dt:_e,It:R,Zt:k,tn:z})=>{const{nn:D,sn:B,en:oe,cn:ee}=z||{},{Ct:G,ft:he}=k||{},{B:me}=i,{M:ke,P:Ee}=Un(),{rn:ze,j:Pe}=o,[Ne,ut]=_e("showNativeOverlaidScrollbars"),[Qe,at]=_e("scrollbars.theme"),[tt,ft]=_e("scrollbars.visibility"),[dt,pt]=_e("scrollbars.autoHide"),[Ft,pn]=_e("scrollbars.autoHideSuspend"),[X]=_e("scrollbars.autoHideDelay"),[V,J]=_e("scrollbars.dragScroll"),[ye,xe]=_e("scrollbars.clickScroll"),[se,Ie]=_e("overflow"),Z=he&&!R,ae=D||B||ee||G||R,pe=oe||ft||Ie,ce=Ne&&ke.x&&ke.y,be=!Ee&&!ge,$n=ce||be,Qt=(on,Dt,bt)=>{const hr=on.includes(Ri)&&(tt===Yn||tt==="auto"&&Dt===Ri);return q(cR,hr,bt),hr};if(v=X,(ut||be)&&q(rR,$n),at&&(q(d),q(Qe,!0),d=Qe),(pn||Z)&&(ve(!Ft),Z&&Ft&&(Pe.x||Pe.y?(h(),E((()=>{h=st(N,Ri,f(Le(ve,!0)),{A:!0})}))):ve(!0))),pt&&(l=dt==="move",c=dt==="leave",u=dt==="never",A(u,!0)),J&&q(fR,V),xe&&q(hR,!!ye),pe){const on=Qt(se.x,ze.x,!0),Dt=Qt(se.y,ze.y,!1);q(uR,!(on&&Dt))}ae&&(de(),le(),M(),ee&&Y(),q(bf,!Pe.x,!0),q(bf,!Pe.y,!1),q(sR,me&&!I))},{},K]},RR=t=>{const e=Un(),{K:n,P:i}=e,{elements:o}=n(),{padding:r,viewport:s,content:a}=o,l=ps(t),c=l?{}:t,{elements:u}=c,{padding:d,viewport:h,content:v}=u||{},p=l?t:c.target,f=_g(p),_=p.ownerDocument,C=_.documentElement,w=()=>_.defaultView||Bt,S=Le($R,[p]),b=Le(zg,[p]),E=Le(Xi,""),x=Le(S,E,s),O=Le(b,E,a),$=G=>{const he=hi(G),me=_s(G),ke=jn(G,eu),Ee=jn(G,tu);return me.w-he.w>0&&!Gi(ke)||me.h-he.h>0&&!Gi(Ee)},K=x(h),F=K===p,P=F&&f,N=!F&&O(v),I=!F&&K===N,q=P?C:K,le=P?q:p,de=!F&&b(E,r,d),Y=!I&&N,M=[Y,q,de,le].map((G=>ps(G)&&!Wo(G)&&G)),A=G=>G&&ng(M,G),Q=!A(q)&&$(q)?q:p,U=P?C:q,ve={dt:p,vt:le,L:q,ln:de,ht:Y,gt:U,Qt:P?_:q,an:f?C:Q,Gt:_,bt:f,At:l,V:F,un:w,yt:G=>su(q,Kn,G),wt:(G,he)=>gs(q,Kn,G,he),St:()=>gs(U,Kn,eR,!0)},{dt:re,vt:ge,ln:_e,L:R,ht:k}=ve,z=[()=>{kn(ge,[fi,Xa]),kn(re,Xa),f&&kn(C,[Xa,fi])}];let D=Hl([k,R,_e,ge,re].find((G=>G&&!A(G))));const B=P?re:k||R,oe=Le(Zt,z);return[ve,()=>{const G=w(),he=ql(),me=Ne=>{Mt(Wo(Ne),Hl(Ne)),lo(Ne)},ke=Ne=>st(Ne,"focusin focusout focus blur",Eg,{I:!0,D:!1}),Ee="tabindex",ze=ou(R,Ee),Pe=ke(he);return Wn(ge,fi,F?"":QP),Wn(_e,Xl,""),Wn(R,Kn,""),Wn(k,gf,""),F||(Wn(R,Ee,ze||"-1"),f&&Wn(C,vf,"")),Mt(B,D),Mt(ge,_e),Mt(_e||ge,!F&&R),Mt(R,k),ct(z,[Pe,()=>{const Ne=ql(),ut=A(R),Qe=ut&&Ne===R?re:Ne,at=ke(Qe);kn(_e,Xl),kn(k,gf),kn(R,Kn),f&&kn(C,vf),ze?Wn(R,Ee,ze):kn(R,Ee),A(k)&&me(k),ut&&me(R),A(_e)&&me(_e),Gl(Qe),at()}]),i&&!F&&(ru(R,Kn,Ag),ct(z,Le(kn,R,Kn))),Gl(!F&&f&&he===re&&G.top===G?R:he),Pe(),D=0,oe},oe]},MR=({ht:t})=>({Zt:e,fn:n,It:i})=>{const{$t:o}=e||{},{Ot:r}=n;t&&(o||i)&&co(t,{[cr]:r&&"100%"})},IR=({vt:t,ln:e,L:n,V:i},o)=>{const[r,s]=Xt({i:LP,o:hf()},Le(hf,t,"padding",""));return({Dt:a,Zt:l,fn:c,It:u})=>{let[d,h]=s(u);const{P:v}=Un(),{_t:p,xt:f,Ct:_}=l||{},{B:C}=c,[w,S]=a("paddingAbsolute");(p||h||(u||f))&&([d,h]=r(u));const E=!i&&(S||_||h);if(E){const x=!w||!e&&!v,O=d.r+d.l,$=d.t+d.b,K={[lg]:x&&!C?-O:0,[cg]:x?-$:0,[ag]:x&&C?-O:0,top:x?-d.t:0,right:x?C?-d.r:"auto":0,left:x?C?"auto":-d.l:0,[lr]:x&&`calc(100% + ${O}px)`},F={[ig]:x?d.t:0,[og]:x?d.r:0,[sg]:x?d.b:0,[rg]:x?d.l:0};co(e||n,K),co(n,F),Ze(o,{ln:d,_n:!x,F:e?F:Ze({},K,F)})}return{dn:E}}},FR=(t,e)=>{const n=Un(),{vt:i,ln:o,L:r,V:s,Qt:a,gt:l,bt:c,wt:u,un:d}=t,{P:h}=n,v=c&&s,p=Le(eg,0),f={display:()=>!1,direction:re=>re!=="ltr",flexDirection:re=>re.endsWith("-reverse"),writingMode:re=>re!=="horizontal-tb"},_=Nt(f),C={i:nu,o:{w:0,h:0}},w={i:Zr,o:{}},S=re=>{u(Og,!v&&re)},b=()=>jn(r,_),E=(re,ge)=>{const _e=!Nt(re).length,R=ge?!0:_.some((Ee=>{const ze=re[Ee];return mo(ze)&&f[Ee](ze)}));if(_e||!R||!qP(r))return{T:{x:0,y:0},k:{x:1,y:1}};S(!0);const k=Jt(l),z=st(a,Ri,(Ee=>{const ze=Jt(l);Ee.isTrusted&&ze.x===k.x&&ze.y===k.y&&cu(Ee)}),{I:!0,A:!0}),D=u(tR,!0);cn(l,{x:0,y:0}),D();const B=Jt(l),oe=_s(l);cn(l,{x:oe.w,y:oe.h});const ee=Jt(l),G={x:ee.x-B.x,y:ee.y-B.y};cn(l,{x:-oe.w,y:-oe.h});const he=Jt(l),me={x:he.x-B.x,y:he.y-B.y},ke={x:ai(G.x)>=ai(me.x)?ee.x:he.x,y:ai(G.y)>=ai(me.y)?ee.y:he.y};return cn(l,k),Bo((()=>z())),{T:B,k:ke}},x=(re,ge)=>{const _e=Bt.devicePixelRatio%1!==0?1:0,R={w:p(re.w-ge.w),h:p(re.h-ge.h)};return{w:R.w>_e?R.w:0,h:R.h>_e?R.h:0}},O=(re,ge)=>{const _e=(R,k,z,D)=>{const B=R===Yn?yn:vR(R),oe=Gi(R),ee=Gi(z);return!k&&!D?yn:oe&&ee?Yn:oe?k&&D?B:k?Yn:yn:k?B:ee&&D?Yn:yn};return{x:_e(ge.x,re.x,ge.y,re.y),y:_e(ge.y,re.y,ge.x,re.x)}},$=re=>{const ge=R=>[Yn,yn,Ri].map((k=>ve(Zl(k),R))),_e=ge(!0).concat(ge()).join(" ");u(_e),u(Nt(re).map((R=>ve(re[R],R==="x"))).join(" "),!0)},[K,F]=Xt(C,Le(lu,r)),[P,N]=Xt(C,Le(_s,r)),[I,q]=Xt(C),[le]=Xt(w),[de,Y]=Xt(C),[M]=Xt(w),[A]=Xt({i:(re,ge)=>Gs(re,ge,vs(ao(Nt(re),Nt(ge)))),o:{}}),[Q,U]=Xt({i:(re,ge)=>Zr(re.T,ge.T)&&Zr(re.k,ge.k),o:xg()}),ie=vo(fu),ve=(re,ge)=>`${ge?XP:JP}${DP(re)}`;return({Dt:re,Zt:ge,fn:_e,It:R},{dn:k})=>{const{_t:z,Ht:D,xt:B,Ct:oe,ft:ee,Et:G}=ge||{},he=ie&&ie.R(t,e,_e,n,re),{X:me,Y:ke,W:Ee}=he||{},[ze,Pe]=mR(re,n),[Ne,ut]=re("overflow"),Qe=Gi(Ne.x),at=Gi(Ne.y),tt=z||k||B||oe||G||Pe;let ft=F(R),dt=N(R),pt=q(R),Ft=Y(R);if(Pe&&h&&u(Ag,!ze),tt){su(i,fi,ts)&&S(!0);const Ru=ke&&ke(),[fr]=ft=K(R),[pr]=dt=P(R),mr=Sg(r),vr=v&&HP(d()),b_={w:p(pr.w+fr.w),h:p(pr.h+fr.h)},Mu={w:p((vr?vr.w:mr.w+p(mr.w-pr.w))+fr.w),h:p((vr?vr.h:mr.h+p(mr.h-pr.h))+fr.h)};Ru&&Ru(),Ft=de(Mu),pt=I(x(b_,Mu),R)}const[pn,X]=Ft,[V,J]=pt,[ye,xe]=dt,[se,Ie]=ft,[Z]=le({x:V.w>0,y:V.h>0}),ae=Qe&&at&&(Z.x||Z.y)||Qe&&Z.x&&!Z.y||at&&Z.y&&!Z.x,pe=k||oe||G||Ie||xe||X||J||ut||Pe||tt||D&&v,[ce]=re("update.flowDirectionStyles"),[be,$n]=A(ce?ce(r)||{}:b(),R),Qt=oe||ee||$n||R,[on,Dt]=Qt?Q(E(be,!!ce),R):U();let bt=O(Z,Ne);S(!1),pe&&($(bt),bt=gR(r,Z),Ee&&me&&(me(bt,ye,se),co(r,Ee(bt))));const[hr,y_]=M(bt);return gs(i,fi,ts,ae),gs(o,Xl,ts,ae),Ze(e,{rn:hr,Vt:{x:pn.w,y:pn.h},Rt:{x:V.w,y:V.h},j:Z,Tt:WP(on,V)}),{en:y_,nn:X,sn:J,cn:Dt||J}}},DR=t=>{const[e,n,i]=RR(t),o={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[lg]:0,[cg]:0,[ag]:0,[ig]:0,[og]:0,[sg]:0,[rg]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:yn,y:yn},j:{x:!1,y:!1},Tt:xg()},{dt:r,gt:s,V:a,St:l}=e,{P:c,M:u}=Un(),d=!c&&(u.x||u.y),h=[MR(e),IR(e,o),FR(e,o)];return[n,v=>{const p={},_=d&&Jt(s),C=_&&l();return ot(h,(w=>{Ze(p,w(v,p)||{})})),cn(s,_),C&&C(),a||cn(r,0),p},o,e,i]},LR=(t,e,n,i)=>{let o=!1;const r={Kt:!1,pn:!1},s=Ja(e,{}),[a,l,c,u,d]=DR(t),[h,v,p]=TR(u,c,s,(b=>{S({},b)})),[f,_,,C]=PR(t,e,r,p,c,u,i),w=b=>Nt(b).some((E=>!!b[E])),S=(b,E)=>{const{Kt:x,pn:O}=r;if(O||x&&o)return!1;const{vn:$,It:K,zt:F}=b,P=$||{},N=!!K||!o,I={Dt:Ja(e,P,N),vn:P,It:N},q=E||v(Ze({},I,{zt:F})),le=l(Ze({},I,{fn:p,Zt:q}));_(Ze({},I,{Zt:q,tn:le}));const de=w(q),Y=w(le),M=de||Y||!iu(P)||N;return o=!0,M&&n(b,{Zt:q,tn:le}),M};return[()=>{const{an:b,gt:E,St:x}=u,O=Jt(b),$=[h(),a(),f(),()=>{r.pn=!0}],K=x();return cn(E,O),K(),Le(Zt,$)},S,b=>{const E=r.Kt;r.Kt=b,!b&&E!==b&&S({It:!0,zt:!0})},()=>{_({Dt:Ja(e,{},!1),vn:{},It:!1})},()=>({gn:r,hn:p,bn:c}),{yn:u,wn:C},d]},pu=new WeakMap,jR=(t,e)=>{pu.set(t,e)},zR=t=>{pu.delete(t)},Ng=t=>pu.get(t),hn=(t,e,n)=>{const{tt:i}=Un(),o=ps(t),r=o?t:t.target,s=Ng(r);if(e&&!s){const a=[],l={},c=N=>{const I=hg(N),q=vo(GP);return q?q(I,!0):I},u=Ze({},i(),c(e)),[d,h,v]=Ql(),[p,f,_]=Ql(n),C=(N,I)=>{_(N,I),v(N,I)},[w,S,b,E,x,O,$]=LR(t,u,(({vn:N,It:I},{Zt:q,tn:le})=>{const{_t:de,Ct:Y,$t:M,xt:A,Ht:Q,ft:U}=q,{nn:ie,sn:ve,en:re,cn:ge}=le;C("updated",[P,{updateHints:{sizeChanged:!!de,directionChanged:!!Y,heightIntrinsicChanged:!!M,overflowEdgeChanged:!!ie,overflowAmountChanged:!!ve,overflowStyleChanged:!!re,scrollCoordinatesChanged:!!ge,contentMutation:!!A,hostMutation:!!Q,appear:!!U},changedOptions:N||{},force:!!I}])}),(N=>C("scroll",[P,N]))),K=N=>{const{gn:I}=x(),{pn:q}=I;q||(zR(r),Zt(a),C("destroyed",[P,N]),h(),f())},P={options(N,I){if(N){const q=I?i():{},le=Fg(u,Ze(q,c(N)));iu(le)||(Ze(u,le),S({vn:le}))}return Ze({},u)},on:p,off:(N,I)=>{N&&I&&f(N,I)},state(){const{gn:N,hn:I,bn:q}=x(),{pn:le,Kt:de}=N,{B:Y}=I,{Vt:M,Rt:A,rn:Q,j:U,ln:ie,_n:ve,Tt:re}=q;return Ze({},{overflowEdge:M,overflowAmount:A,overflowStyle:Q,hasOverflow:U,scrollCoordinates:{start:re.T,end:re.k},padding:ie,paddingAbsolute:ve,directionRTL:Y,sleeping:de,destroyed:le})},elements(){const{dt:N,vt:I,ln:q,L:le,ht:de,gt:Y,Qt:M}=O.yn,{jt:A,Jt:Q}=O.wn,U=ve=>{const{kt:re,Pt:ge,Lt:_e}=ve;return{scrollbar:_e,track:ge,handle:re}},ie=ve=>{const{Xt:re,Yt:ge}=ve,_e=U(re[0]);return Ze({},_e,{clone:()=>{const R=U(ge());return E(),R}})};return Ze({},{target:N,host:I,padding:q||le,viewport:le,content:de||le,scrollOffsetElement:Y,scrollEventElement:M,scrollbarHorizontal:ie(A),scrollbarVertical:ie(Q)})},update:N=>S({It:N,zt:!0}),destroy:Le(K,!1),sleep:b,plugin:N=>l[Nt(N)[0]]};return ct(a,[$]),jR(r,P),kg(Tg,hn,[P,d,l]),kR(O.yn.bt,!o&&t.cancel)?(K(!0),P):(ct(a,w()),C("initialized",[P]),P.update(),P)}return s};hn.plugin=t=>{const e=dn(t),n=e?t:[t],i=n.map((o=>kg(o,hn)[0]));return KP(n),e?i:i[0]};hn.valid=t=>{const e=t&&t.elements,n=xn(e)&&e();return Ho(n)&&!!Ng(n.target)};hn.env=()=>{const{U:t,M:e,P:n,J:i,ot:o,st:r,K:s,Z:a,tt:l,nt:c}=Un();return Ze({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:i,staticDefaultInitialization:o,staticDefaultOptions:r,getDefaultInitialization:s,setDefaultInitialization:a,getDefaultOptions:l,setDefaultOptions:c})};hn.nonce=SR;hn.trustedTypePolicy=UP;class NR{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,n){const i=this._listeners.get(e)??new Set;return this._listeners.set(e,i),i.add(n),this}removeEventListener(e,n){var i;return(i=this._listeners.get(e))==null||i.delete(n),this}dispatchEvent(e,...n){let i=!0;for(const o of this._listeners.get(e)??[])i=o(...n)!==!1&&i;return i}unbindAllListeners(){this._listeners.clear()}}const xf=(t,e="px")=>typeof t=="number"?t+e:t,ii=({style:t},e,n)=>{if(typeof e=="object")for(const[i,o]of Object.entries(e))o!==void 0&&(t[i]=xf(o));else n!==void 0&&(t[e]=xf(n))},Tf=(t=0,e=0,n=0,i=0)=>{const o={x:t,y:e,width:n,height:i,top:e,left:t,right:t+n,bottom:e+i};return{...o,toJSON:()=>JSON.stringify(o)}},UR=t=>{let e,n=-1,i=!1;return{next:(...o)=>{e=o,i||(i=!0,n=requestAnimationFrame(()=>{t(...e),i=!1}))},cancel:()=>{cancelAnimationFrame(n),i=!1}}},$f=(t,e,n="touch")=>{switch(n){case"center":{const i=e.left+e.width/2,o=e.top+e.height/2;return i>=t.left&&i<=t.right&&o>=t.top&&o<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},VR=()=>matchMedia("(hover: none), (pointer: coarse)").matches,BR=()=>"safari"in window,ec=t=>Array.isArray(t)?t:[t],Ug=t=>(e,n,i,o={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=ec(n),e=ec(e);for(const r of e)if(r)for(const s of n)r[t](s,i,{capture:!1,...o})},oi=Ug("addEventListener"),vn=Ug("removeEventListener"),zr=t=>{var e;const{clientX:n,clientY:i,target:o}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:i,target:o}},Ui=(t,e=document)=>ec(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),HR=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(i=>{switch(i){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Ci,max:kf,min:Of,ceil:Af}=Math,Pf=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Vg=class extends NR{constructor(e){var n,i,o,r,s;super(),this._selection=Pf(),this._targetBoundaryScrolled=!0,this._selectables=[],this._areaLocation={y1:0,x2:0,y2:0,x1:0},this._areaRect=Tf(),this._singleClick=!0,this._scrollAvailable=!0,this._scrollingActive=!1,this._scrollSpeed={x:0,y:0},this._scrollDelta={x:0,y:0},this._lastMousePosition={x:0,y:0},this.enable=this._toggleStartEvents,this.disable=this._toggleStartEvents.bind(this,!1),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...e,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...e.behaviour,startThreshold:(n=e.behaviour)!=null&&n.startThreshold?typeof e.behaviour.startThreshold=="number"?e.behaviour.startThreshold:{x:10,y:10,...e.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...(i=e.behaviour)==null?void 0:i.scrolling,startScrollMargins:{x:0,y:0,...(r=(o=e.behaviour)==null?void 0:o.scrolling)==null?void 0:r.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...e.features,singleTap:{allow:!0,intersect:"native",...(s=e.features)==null?void 0:s.singleTap}}};for(const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[u]=="function"&&(this[u]=this[u].bind(this));const{document:a,selectionAreaClass:l,selectionContainerClass:c}=this._options;this._area=a.createElement("div"),this._clippingElement=a.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(l),c&&this._clippingElement.classList.add(c),ii(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),ii(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=UR(u=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",u),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(e=!0){const{document:n,features:i}=this._options,o=e?oi:vn;o(n,"mousedown",this._onTapStart),i.touch&&o(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(e,n=!1){const{x:i,y:o,target:r}=zr(e),{document:s,startAreas:a,boundaries:l,features:c,behaviour:u}=this._options,d=r.getBoundingClientRect();if(e instanceof MouseEvent&&!HR(e,u.triggers))return;const h=Ui(a,s),v=Ui(l,s);this._targetElement=v.find(C=>$f(C.getBoundingClientRect(),d));const p=e.composedPath(),f=h.find(C=>p.includes(C));if(this._targetBoundary=v.find(C=>p.includes(C)),!this._targetElement||!f||!this._targetBoundary||!n&&this._emitEvent("beforestart",e)===!1)return;this._areaLocation={x1:i,y1:o,x2:0,y2:0};const _=s.scrollingElement??s.body;this._scrollDelta={x:_.scrollLeft,y:_.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),oi(s,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),oi(s,["mouseup","touchcancel","touchend"],this._onTapStop),oi(s,"scroll",this._onScroll),c.deselectOnBlur&&(this._targetBoundaryScrolled=!1,oi(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(e){const{singleTap:{intersect:n},range:i}=this._options.features,o=zr(e);let r;if(n==="native")r=o.target;else if(n==="touch"){this.resolveSelectables();const{x:a,y:l}=o;r=this._selectables.find(c=>{const{right:u,left:d,top:h,bottom:v}=c.getBoundingClientRect();return a<u&&a>d&&l<v&&l>h})}if(!r)return;for(this.resolveSelectables();!this._selectables.includes(r);)if(r.parentElement)r=r.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:s}=this._selection;if(this._emitEvent("start",e),e.shiftKey&&i&&this._latestElement){const a=this._latestElement,[l,c]=a.compareDocumentPosition(r)&4?[r,a]:[a,r],u=[...this._selectables.filter(d=>d.compareDocumentPosition(l)&4&&d.compareDocumentPosition(c)&2),l,c];this.select(u),this._latestElement=a}else s.includes(r)&&(s.length===1||e.ctrlKey||s.every(a=>this._selection.stored.includes(a)))?this.deselect(r):(this.select(r),this._latestElement=r)}_delayedTapMove(e){const{container:n,document:i,behaviour:{startThreshold:o}}=this._options,{x1:r,y1:s}=this._areaLocation,{x:a,y:l}=zr(e);if(typeof o=="number"&&Ci(a+l-(r+s))>=o||typeof o=="object"&&Ci(a-r)>=o.x||Ci(l-s)>=o.y){if(vn(i,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",e)===!1){vn(i,["mouseup","touchcancel","touchend"],this._onTapStop);return}oi(i,["mousemove","touchmove"],this._onTapMove,{passive:!1}),ii(this._area,"display","block"),Ui(n,i)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(oi(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),oi(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(c=>this._targetElement.contains(c))),this._setupSelectionArea(),this._emitEvent("start",e),this._onTapMove(e)}this._handleMoveEvent(e)}_setupSelectionArea(){const{_clippingElement:e,_targetElement:n,_area:i}=this,o=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(ii(e,{top:o.top,left:o.left,width:o.width,height:o.height}),ii(i,{marginTop:-o.top,marginLeft:-o.left})):(ii(e,{top:0,left:0,width:"100%",height:"100%"}),ii(i,{marginTop:0,marginLeft:0}))}_onTapMove(e){const{_scrollSpeed:n,_areaLocation:i,_options:o,_frame:r}=this,{speedDivider:s}=o.behaviour.scrolling,a=this._targetElement,{x:l,y:c}=zr(e);if(i.x2=l,i.y2=c,this._lastMousePosition.x=l,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const u=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const{scrollTop:d,scrollLeft:h}=a;n.y&&(a.scrollTop+=Af(n.y/s),i.y1-=a.scrollTop-d),n.x&&(a.scrollLeft+=Af(n.x/s),i.x1-=a.scrollLeft-h),r.next(e),requestAnimationFrame(u)};requestAnimationFrame(u)}else r.next(e);this._handleMoveEvent(e)}_handleMoveEvent(e){const{features:n}=this._options;(n.touch&&VR()||this._scrollAvailable&&BR())&&e.preventDefault()}_onScroll(){const{_scrollDelta:e,_options:{document:n}}=this,{scrollTop:i,scrollLeft:o}=n.scrollingElement??n.body;this._areaLocation.x1+=e.x-o,this._areaLocation.y1+=e.y-i,e.x=o,e.y=i,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,vn(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.deltaY?e.deltaY>0?1:-1:0,o=e.deltaX?e.deltaX>0?1:-1:0;this._scrollSpeed.y+=i*n,this._scrollSpeed.x+=o*n,this._onTapMove(e),e.preventDefault()}_keyboardScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.key==="ArrowLeft"?-1:e.key==="ArrowRight"?1:0,o=e.key==="ArrowUp"?-1:e.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(i)*n,this._scrollSpeed.y+=Math.sign(o)*n,e.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:e,_areaLocation:n,_targetElement:i,_options:o}=this,{scrollTop:r,scrollHeight:s,clientHeight:a,scrollLeft:l,scrollWidth:c,clientWidth:u}=i,d=this._targetRect,{x1:h,y1:v}=n;let{x2:p,y2:f}=n;const{behaviour:{scrolling:{startScrollMargins:_}}}=o;p<d.left+_.x?(e.x=l?-Ci(d.left-p+_.x):0,p=p<d.left?d.left:p):p>d.right-_.x?(e.x=c-l-u?Ci(d.left+d.width-p-_.x):0,p=p>d.right?d.right:p):e.x=0,f<d.top+_.y?(e.y=r?-Ci(d.top-f+_.y):0,f=f<d.top?d.top:f):f>d.bottom-_.y?(e.y=s-r-a?Ci(d.top+d.height-f-_.y):0,f=f>d.bottom?d.bottom:f):e.y=0;const C=Of(h,p),w=Of(v,f),S=kf(h,p),b=kf(v,f);this._areaRect=Tf(C,w,S-C,b-w)}_redrawSelectionArea(){const{x:e,y:n,width:i,height:o}=this._areaRect,{style:r}=this._area;r.left=`${e}px`,r.top=`${n}px`,r.width=`${i}px`,r.height=`${o}px`}_onTapStop(e,n){var i;const{document:o,features:r}=this._options,{_singleClick:s}=this;vn(this._targetElement,"scroll",this._onStartAreaScroll),vn(o,["mousemove","touchmove"],this._delayedTapMove),vn(o,["touchmove","mousemove"],this._onTapMove),vn(o,["mouseup","touchcancel","touchend"],this._onTapStop),vn(o,"scroll",this._onScroll),this._keepSelection(),e&&s&&r.singleTap.allow?this._onSingleTap(e):!s&&!n&&(this._updateElementSelection(),this._emitEvent("stop",e)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,vn(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),vn(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),(i=this._frame)==null||i.cancel(),ii(this._area,"display","none")}_updateElementSelection(){const{_selectables:e,_options:n,_selection:i,_areaRect:o}=this,{stored:r,selected:s,touched:a}=i,{intersect:l,overlap:c}=n.behaviour,u=c==="invert",d=[],h=[],v=[];for(let f=0;f<e.length;f++){const _=e[f];if($f(o,_.getBoundingClientRect(),l)){if(s.includes(_))r.includes(_)&&!a.includes(_)&&a.push(_);else if(u&&r.includes(_)){v.push(_);continue}else h.push(_);d.push(_)}}u&&h.push(...r.filter(f=>!s.includes(f)));const p=c==="keep";for(let f=0;f<s.length;f++){const _=s[f];!d.includes(_)&&!(p&&r.includes(_))&&v.push(_)}i.selected=d,i.changed={added:h,removed:v},this._latestElement=void 0}_emitEvent(e,n){return this.emit(e,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:e,_selection:n}=this,{selected:i,changed:o,touched:r,stored:s}=n,a=i.filter(l=>!s.includes(l));switch(e.behaviour.overlap){case"drop":{n.stored=[...a,...s.filter(l=>!r.includes(l))];break}case"invert":{n.stored=[...a,...s.filter(l=>!o.removed.includes(l))];break}case"keep":{n.stored=[...s,...i.filter(l=>!s.includes(l))];break}}}trigger(e,n=!0){this._onTapStart(e,n)}resolveSelectables(){this._selectables=Ui(this._options.selectables,this._options.document)}clearSelection(e=!0,n=!1){const{selected:i,stored:o,changed:r}=this._selection;r.added=[],r.removed.push(...i,...e?o:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=Pf(e?[]:o)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(e){Object.assign(this._areaLocation,e),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(e=!1){this._onTapStop(null,!e)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}select(e,n=!1){const{changed:i,selected:o,stored:r}=this._selection,s=Ui(e,this._options.document).filter(a=>!o.includes(a)&&!r.includes(a));return r.push(...s),o.push(...s),i.added.push(...s),i.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),s}deselect(e,n=!1){const{selected:i,stored:o,changed:r}=this._selection,s=Ui(e,this._options.document).filter(a=>i.includes(a)||o.includes(a));this._selection.stored=o.filter(a=>!s.includes(a)),this._selection.selected=i.filter(a=>!s.includes(a)),this._selection.changed.added=[],this._selection.changed.removed.push(...s.filter(a=>!r.removed.includes(a))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}};Vg.version="3.9.0";let qR=Vg;const WR="5.2.0",KR={version:WR},YR={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function GR(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),dO(t)?(n=new Rl(n,t),n):(n.request=t,n)}function Rf(t){return t.data.slice(0,t.data.size,t.meta.type)}const QR={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class XR extends mO{static VERSION=KR.version;#e;#t;uploaderEvents;constructor(e,n){if(super(e,{...QR,fieldName:n.bundle?"files[]":"file",...n}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=YR,this.i18nInit(),this.#t=new hO({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(n?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=i=>async(o,r)=>{try{const s=await nO(o,{...r,onBeforeRequest:(c,u)=>this.opts.onBeforeRequest?.(c,u,i),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:c=>{const u=Math.ceil(c/1e3),d=new Error(this.i18n("uploadStalled",{seconds:u}));this.uppy.emit("upload-stalled",d,i)},onUploadProgress:c=>{if(c.lengthComputable)for(const{id:u}of i){const d=this.uppy.getFile(u);d!=null&&this.uppy.emit("upload-progress",d,{uploadStarted:d.progress.uploadStarted??0,bytesUploaded:c.loaded/c.total*d.size,bytesTotal:d.size})}}});let a=await this.opts.getResponseData?.(s);if(s.responseType==="json")a??=s.response;else try{a??=JSON.parse(s.responseText)}catch(c){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:c})}const l=typeof a?.url=="string"?a.url:void 0;for(const{id:c}of i)this.uppy.emit("upload-success",this.uppy.getFile(c),{status:s.status,body:a,uploadURL:l});return s}catch(s){if(s.name==="AbortError")return;const a=s.request;for(const l of i)this.uppy.emit("upload-error",this.uppy.getFile(l.id),GR(a,s),a);throw s}}}getOptions(e){const n=this.uppy.getState().xhrUpload,{headers:i}=this.opts,o={...this.opts,...n||{},...e.xhrUpload||{},headers:{}};return typeof i=="function"?o.headers=i(e):Object.assign(o.headers,this.opts.headers),n&&Object.assign(o.headers,n.headers),e.xhrUpload&&Object.assign(o.headers,e.xhrUpload.headers),o}addMetadata(e,n,i){Eh(i.allowedMetaFields,n).forEach(r=>{const s=n[r];Array.isArray(s)?s.forEach(a=>e.append(r,a)):e.append(r,s)})}createFormDataUpload(e,n){const i=new FormData;this.addMetadata(i,e.meta,n);const o=Rf(e);return e.name?i.append(n.fieldName,o,e.meta.name):i.append(n.fieldName,o),i}createBundledUpload(e,n){const i=new FormData,{meta:o}=this.uppy.getState();return this.addMetadata(i,o,n),e.forEach(r=>{const s=this.getOptions(r),a=Rf(r);r.name?i.append(s.fieldName,a,r.name):i.append(s.fieldName,a)}),i}async#n(e){const n=new vO(this.uppy),i=new AbortController;n.onFileRemove(e.id,()=>i.abort()),n.onCancelAll(e.id,()=>i.abort());try{await this.#t.add(async o=>{const r=this.getOptions(e),s=this.#e([e]),a=r.formData?this.createFormDataUpload(e,r):e.data,l=typeof r.endpoint=="string"?r.endpoint:await r.endpoint(e);return s(l,{...r,body:a,signal:AbortSignal.any([o,i.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{n.remove()}}async#i(e){const n=new AbortController;function i(){n.abort()}this.uppy.once("cancel-all",i);try{await this.#t.add(async o=>{const r=this.uppy.getState().xhrUpload??{},s=this.#e(e),a=this.createBundledUpload(e,{...this.opts,...r}),l=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return s(l,{...this.opts,body:a,signal:AbortSignal.any([o,n.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{this.uppy.off("cancel-all",i)}}#r(e){const n=this.getOptions(e),i=Eh(n.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(i.map(o=>[o,e.meta[o]])),httpMethod:n.method,useFormData:n.formData,headers:n.headers}}async#o(e){await Promise.allSettled(e.map(n=>{if(n.isRemote){const i=()=>this.#t,o=new AbortController,r=s=>{s.id===n.id&&o.abort()};return this.uppy.on("file-removed",r),this.uppy.getRequestClientForFile(n).uploadRemoteFile(n,this.#r(n),{signal:o.signal,getQueue:i}).finally(()=>{this.uppy.off("file-removed",r)})}return this.#n(n)}))}#a=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const n=this.uppy.getFilesByIds(e),i=rO(n),o=sO(i);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(i.some(s=>s.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#i(i)}else await this.#o(i)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#a)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#a)}}const mu=new Map,tc=Symbol("ServiceContainerId");function JR(t,e){mu.set(t,e)}function ZR(t){mu.delete(t)}function je(t){const e=t??Po(tc);if(!e)throw new Error("No VueFinder app instance found. Make sure VueFinder component is mounted and provide the id explicitly or use within a VueFinder component tree.");const n=mu.get(e);if(!n)throw new Error(`VueFinder app instance with id "${e}" was not found. Make sure the VueFinder component with id="${e}" is mounted.`);return n}function eM(t){const e=localStorage.getItem(t+"_storage"),n=It(JSON.parse(e??"{}"));$e(n,i);function i(){Object.keys(n).length?localStorage.setItem(t+"_storage",JSON.stringify(n)):localStorage.removeItem(t+"_storage")}function o(a,l){n[a]=l}function r(a){delete n[a]}function s(){Object.keys(n).forEach(a=>r(a))}return{getStore:(a,l=null)=>a in n?n[a]:l,setStore:o,removeStore:r,clearStore:s}}function Yt(t,e="An error occurred"){if(!t)return e;if(typeof t=="string")return t||e;if(t instanceof Error)return t.message||e;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.message=="string"&&n.message)return n.message;if(typeof n.error=="string"&&n.error)return n.error}return e}function tM(t,e){return Km(t,e,{encode:JSON.stringify,decode:JSON.parse})}function nM(t){if(!t?.config?.get)return!0;try{return!!t.config.get("notificationsEnabled")}catch{return!0}}function Hi(t,e,n){const i={type:e,message:n};if(t?.emitter?.emit?.("vf-notify",i),!!nM(t))switch(e){case"success":Tr.success(n);break;case"error":Tr.error(n);break;case"warning":Tr.warning(n);break;default:Tr.info(n);break}}function Gt(t){return{success(e){Hi(t,"success",e)},error(e){Hi(t,"error",e)},info(e){Hi(t,"info",e)},warning(e){Hi(t,"warning",e)},emit(e,n){Hi(t,e,n)}}}const el=new Map;async function tl(t,e){const n=e[t];return typeof n=="function"?(await n()).default:n}function iM(t,e,n,i,o){const r=Gt({emitter:n,config:o}),s="vuefinder_locale",a="global";let l;if(el.has(a))l=el.get(a),e&&e!==l.get()&&l.set(e);else{const b=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):null;l=tM(s,e||b||"en"),el.set(a,l)}const c="vuefinder_translations",u=b=>{try{const E=localStorage.getItem(c);if(E)return JSON.parse(E)[b]||null}catch{}return null},d=(b,E)=>{try{const x=localStorage.getItem(c),O=x?JSON.parse(x):{};O[b]=E,localStorage.setItem(c,JSON.stringify(O))}catch{}},h=Oe(l),v=String(h.value),p=u(v),f=H(p||{});let _=!1;!p&&Object.keys(i).length>0&&tl(v,i).then(b=>{f.value=b,d(v,b)}).catch(()=>{}),$e(h,async(b,E)=>{if(E&&b===E)return;if(!_){_=!0;const O=u(String(b));if(O)f.value=O;else if(Object.keys(i).length>0)try{const $=await tl(String(b),i);f.value=$,d(String(b),$)}catch{}return}const x=u(String(b));if(x)f.value=x;else try{const O=await tl(String(b),i);f.value=O,d(String(b),O)}catch(O){const $=Yt(O,"Locale cannot be loaded!");r.error($);return}Object.values(i).length>1&&(r.success("The language is set to "+b),n.emit("vf-language-saved"))},{immediate:!1});const C=(b,...E)=>E.length?C(b=b.replace("%s",String(E.shift())),...E):b;function w(b,...E){return f.value&&Object.prototype.hasOwnProperty.call(f.value,b)?C(f.value[b]||b,...E):C(b,...E)}const S=te({get:()=>h.value,set:b=>{l.set(b)}});return It({t:w,locale:S,localeAtom:l})}const oM=["edit","newfile","newfolder","preview","archive","unarchive","search","rename","upload","delete","fullscreen","download","language","move","copy","history","theme","pinned"],Bg={simple:{search:!0,preview:!0,rename:!0,upload:!0,delete:!0,newfile:!0,newfolder:!0,download:!0},advanced:oM.reduce((t,e)=>(t[e]=!0,t),{})};function Mf(){return Bg.advanced}function Hg(t){return t?t==="simple"||t==="advanced"?{...Bg[t]}:{...Mf(),...t}:Mf()}const rM="4.1.2";function vu(t,e,n,i,o){return e=Math,n=e.log,i=1024,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"iB":"B")}function qg(t,e,n,i,o){return e=Math,n=e.log,i=1e3,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"B":"B")}function sM(t){if(typeof t=="number")return t;const e={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(t);if(!n)return 0;const i=parseFloat(n[1]||"0"),o=(n[2]||"").toLowerCase(),r=e[o]??0;return Math.round(i*Math.pow(1024,r))}function aM(t){const e=Qo(null),n=H(!1),i=H(),o=H(!1);return{visible:n,type:e,data:i,open:(r,s=null)=>{t.get("fullScreen")||(document.querySelector("body").style.overflow="hidden"),n.value=!0,e.value=r,i.value=s},close:()=>{t.get("fullScreen")||(document.querySelector("body").style.overflow=""),n.value=!1,e.value=null},setEditMode:r=>{o.value=r},editMode:o}}const ys={view:"grid",theme:"silver",fullScreen:!1,showTreeView:!1,showHiddenFiles:!0,metricUnits:!1,showThumbnails:!0,persist:!1,path:"",pinnedFolders:[],notificationsEnabled:!0,expandTreeByDefault:!1,expandedTreePaths:[]},bs={initialPath:null,maxFileSize:null,loadingIndicator:"circular",showMenuBar:!0,showToolbar:!0,gridItemWidth:96,gridItemHeight:80,gridItemGap:8,gridIconSize:48,listItemHeight:32,listItemGap:2,listIconSize:16,notificationPosition:"bottom-center",notificationDuration:3e3,notificationVisibleToasts:4,notificationRichColors:!0},lM=new Set(Object.keys(bs));function cM(t){return t||"silver"}function Wg(t){return lM.has(t)}function If(t){const e={},n={},i=t;for(const o in i)if(Wg(o))n[o]=i[o];else if(o in ys){const r=o;e[r]=i[o]}return{persistenceConfig:e,nonPersistenceConfig:n}}function Ff(t,e){const n={...ys,...e,...t};return n.theme=cM(n.theme),n}function Df(t,e){return{...bs,...e,...t}}const uM=(t,e={})=>{const n=`vuefinder_config_${t}`,{persistenceConfig:i,nonPersistenceConfig:o}=If(e),r=Ff(i,ys),s=Df(o,bs),a=Km(n,r,{encode:JSON.stringify,decode:JSON.parse}),l=Tt(s),c=ri([a,l],(p,f)=>({...p,...f})),u=(p={})=>{const f=a.get(),_=l.get(),{persistenceConfig:C,nonPersistenceConfig:w}=If(p),S=Ff(C,f),b=Df(w,_);a.set(S),l.set(b)},d=p=>Wg(p)?l.get()[p]:a.get()[p],h=()=>({...a.get(),...l.get()}),v=(p,f)=>{const _=a.get();typeof p=="object"&&p!==null?a.set({..._,...p}):a.set({..._,[p]:f})};return{state:c,init:u,get:d,set:v,toggle:p=>{const f=a.get();v(p,!f[p])},all:h,reset:()=>{a.set({...ys}),l.set({...bs})}}};function dM(t,e){if(typeof t=="string"&&typeof e=="string")return t.toLowerCase().localeCompare(e.toLowerCase());const n=Number(t)||0,i=Number(e)||0;return n===i?0:n<i?-1:1}const hM=()=>{const t=Tt(""),e=Tt([]),n=Tt(!1),i=Tt([]),o=Tt({active:!1,column:"",order:""}),r=Tt({kind:"all",showHidden:!1}),s=Tt(new Set),a=Tt({type:"copy",path:"",items:new Set}),l=Tt(null),c=Tt(0),u=Tt(!1),d=Tt([]),h=Tt(-1),v=ri([t],ee=>{const G=(ee??"").trim(),he=G.indexOf("://"),me=he>=0?G.slice(0,he):"",ke=(he>=0?G.slice(he+3):G).split("/").filter(Boolean);let Ee="";const ze=ke.map(Pe=>(Ee=Ee?`${Ee}/${Pe}`:Pe,{basename:Pe,name:Pe,path:me?`${me}://${Ee}`:Ee,type:"dir"}));return{storage:me,breadcrumb:ze,path:G}}),p=ri([i,o,r],(ee,G,he)=>{let me=ee;he.kind==="files"?me=me.filter(Ne=>Ne.type==="file"):he.kind==="folders"&&(me=me.filter(Ne=>Ne.type==="dir")),he.showHidden||(me=me.filter(Ne=>!Ne.basename.startsWith(".")));const{active:ke,column:Ee,order:ze}=G;if(!ke||!Ee)return me;const Pe=ze==="asc"?1:-1;return me.slice().sort((Ne,ut)=>dM(Ne[Ee],ut[Ee])*Pe)}),f=ri([i,s],(ee,G)=>G.size===0?[]:ee.filter(he=>G.has(he.path))),_=(ee,G)=>{const he=t.get();if((G??!0)&&he!==ee){const me=d.get(),ke=h.get();ke<me.length-1&&me.splice(ke+1),me.length===0&&he&&me.push(he),me.push(ee),d.set([...me]),h.set(me.length-1)}t.set(ee)},C=ee=>{i.set(ee??[])},w=ee=>{e.set(ee??[])},S=(ee,G)=>{o.set({active:!0,column:ee,order:G})},b=ee=>{const G=o.get();G.active&&G.column===ee?o.set({active:G.order==="asc",column:ee,order:"desc"}):o.set({active:!0,column:ee,order:"asc"})},E=()=>{o.set({active:!1,column:"",order:""})},x=(ee,G)=>{r.set({kind:ee,showHidden:G})},O=()=>{r.set({kind:"all",showHidden:!1})},$=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),he.add(ee),s.set(he)},K=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),ee.forEach(me=>he.add(me)),s.set(he)},F=ee=>{const G=new Set(s.get());G.delete(ee),s.set(G)},P=ee=>s.get().has(ee),N=(ee,G="multiple")=>{const he=new Set(s.get());he.has(ee)?he.delete(ee):(G==="single"&&he.clear(),he.add(ee)),s.set(he)},I=(ee="multiple",G)=>{if(ee==="single"){const he=i.get()[0];if(he){const me=he.path;s.set(new Set([me])),c.set(1)}}else{if(G?.selectionFilterType||G?.selectionFilterMimeIncludes&&G.selectionFilterMimeIncludes.length>0){const he=i.get().filter(me=>{const ke=G.selectionFilterType,Ee=G.selectionFilterMimeIncludes;return ke==="files"&&me.type==="dir"||ke==="dirs"&&me.type==="file"?!1:Ee&&Array.isArray(Ee)&&Ee.length>0&&me.type!=="dir"?me.mime_type?Ee.some(ze=>me.mime_type?.startsWith(ze)):!1:!0}).map(me=>me.path);s.set(new Set(he))}else{const he=new Set(i.get().map(me=>me.path));s.set(he)}de(s.get().size)}},q=()=>{s.set(new Set),c.set(0)},le=ee=>{const G=new Set(ee??[]);s.set(G),c.set(G.size)},de=ee=>{c.set(ee)},Y=ee=>{u.set(!!ee)},M=()=>u.get(),A=(ee,G)=>{const he=i.get().filter(me=>G.has(me.path));a.set({type:ee,path:v.get().path,items:new Set(he)})},Q=ee=>ri([a],G=>G.type==="cut"&&Array.from(G.items).some(he=>he.path===ee)),U=ee=>ri([a],G=>G.type==="copy"&&Array.from(G.items).some(he=>he.path===ee));return{files:i,storages:e,currentPath:t,sort:o,filter:r,selectedKeys:s,selectedCount:c,loading:u,draggedItem:l,clipboardItems:a,path:v,sortedFiles:p,selectedItems:f,setPath:_,setFiles:C,setStorages:w,setSort:S,toggleSort:b,clearSort:E,setFilter:x,clearFilter:O,select:$,selectMultiple:K,deselect:F,toggleSelect:N,selectAll:I,isSelected:P,clearSelection:q,setSelection:le,setSelectedCount:de,setLoading:Y,isLoading:M,setClipboard:A,createIsCut:Q,createIsCopied:U,isCut:ee=>{const G=Q(ee);return Oe(G).value??!1},isCopied:ee=>{const G=U(ee);return Oe(G).value??!1},clearClipboard:()=>{a.set({type:"copy",path:"",items:new Set})},getClipboard:()=>a.get(),setDraggedItem:ee=>{l.set(ee)},getDraggedItem:()=>l.get(),clearDraggedItem:()=>{l.set(null)},setReadOnly:ee=>{n.set(ee)},getReadOnly:()=>n.get(),isReadOnly:ee=>n.get()?!0:ee.read_only??!1,goBack:()=>{const ee=d.get(),G=h.get();if(G>0){const he=G-1,me=ee[he];me&&(h.set(he),_(me,!1))}},goForward:()=>{const ee=d.get(),G=h.get();if(G<ee.length-1){const he=G+1,me=ee[he];me&&(h.set(he),_(me,!1))}},canGoBack:ri([h],ee=>ee>0),canGoForward:ri([d,h],(ee,G)=>G<ee.length-1),navigationHistory:d,historyIndex:h}};class fM{validateParam(e,n){if(e==null)throw new Error(`${n} is required`)}validatePath(e){if(!e)throw new Error("Path must be a non-empty string")}parsePath(e){if(!e)return{};if(e.includes("://")){const[n,...i]=e.split("://");return{storage:n,path:i.join("://")}}return{path:e}}combinePath(e,n){return e&&n?`${e}://${n}`:n||""}}function Lf(t,e,n){const i=`HTTP ${e}: ${n}`;if(!t)return i;try{const o=JSON.parse(t);if(o.message)return o.message;if(o.error){if(typeof o.error=="string")return o.error;if(o.error.message)return o.error.message}if(o.errors&&Array.isArray(o.errors)&&o.errors.length>0){const r=o.errors.map(s=>s.message).filter(s=>!!s);if(r.length>0)return r.join(", ")}return o.detail?o.detail:o.title?o.title:t}catch{return t||i}}class Kg extends fM{config;static DEFAULT_URLS={list:"",upload:"/upload",delete:"/delete",rename:"/rename",copy:"/copy",move:"/move",archive:"/archive",unarchive:"/unarchive",createFile:"/create-file",createFolder:"/create-folder",preview:"/preview",download:"/download",search:"/search",save:"/save"};constructor(e){super();const n={...Kg.DEFAULT_URLS,...e.url||{}};this.config={...e,baseURL:e.baseURL||"",url:n}}setBaseURL(e){this.config.baseURL=e||""}setToken(e){this.config.token=e}configureUploader(e,n){const i=this.getHeaders();delete i["Content-Type"],e.use(XR,{endpoint:`${this.config.baseURL}${this.config.url.upload}`,fieldName:"file",bundle:!1,headers:i,formData:!0}),e.on("upload",()=>{const o=n.getTargetPath();e.getFiles().forEach(r=>{e.setFileMeta(r.id,{path:o})})})}getHeaders(){const e={"Content-Type":"application/json",...this.config.headers};return this.config.token&&(e.Authorization=`Bearer ${this.config.token}`),e}async request(e,n={}){const i=`${this.config.baseURL}${e}`,o=await fetch(i,{...n,headers:{...this.getHeaders(),...n.headers}});if(!o.ok){const r=await o.text(),s=Lf(r,o.status,o.statusText);throw new Error(s)}return(o.headers.get("content-type")||"").includes("application/json")?await o.json():await o.text()}async list(e){const n=new URLSearchParams;e?.path&&n.append("path",e.path);const i=n.toString()?`${this.config.url.list}?${n.toString()}`:this.config.url.list;return await this.request(i,{method:"GET"})}async delete(e){return this.validateParam(e.items,"items"),this.validateParam(e.path,"path"),await this.request(this.config.url.delete,{method:"POST",body:JSON.stringify({path:e.path,items:e.items})})}async rename(e){return this.validateParam(e.path,"path"),this.validateParam(e.item,"item"),this.validateParam(e.name,"name"),this.validatePath(e.path),await this.request(this.config.url.rename,{method:"POST",body:JSON.stringify({path:e.path,item:e.item,name:e.name})})}async copy(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.copy,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async move(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.move,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async archive(e){return this.validateParam(e.items,"items"),this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.archive,{method:"POST",body:JSON.stringify({items:e.items,path:e.path,name:e.name})})}async unarchive(e){return this.validateParam(e.item,"item"),this.validateParam(e.path,"path"),await this.request(this.config.url.unarchive,{method:"POST",body:JSON.stringify({item:e.item,path:e.path})})}async createFile(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFile,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}async createFolder(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFolder,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}getPreviewUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`}async getContent(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path}),i=`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`,o=await fetch(i,{headers:this.getHeaders()});if(!o.ok){const r=await o.text(),s=Lf(r,o.status,o.statusText);throw new Error(s)}return{content:await o.text(),mimeType:o.headers.get("Content-Type")||void 0}}getDownloadUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.download}?${n.toString()}`}async search(e){const n=this.config.url.search,i=new URLSearchParams;e.path&&i.set("path",e.path),e.filter&&i.set("filter",e.filter),e.deep&&i.set("deep","1"),e.size&&e.size!=="all"&&i.set("size",e.size);const o=i.toString()?`${n}?${i.toString()}`:n;return(await this.request(o,{method:"GET"})).files||[]}async save(e){return this.validateParam(e.path,"path"),await this.request(this.config.url.save,{method:"POST",body:JSON.stringify({path:e.path,content:e.content}),headers:this.getHeaders()})}}const jf={list:t=>["adapter","list",t],search:(t,e,n,i)=>["adapter","search",t,e,n,i],delete:t=>["adapter","delete",t],rename:()=>["adapter","rename"],copy:()=>["adapter","copy"],move:()=>["adapter","move"],archive:()=>["adapter","archive"],unarchive:()=>["adapter","unarchive"],createFile:()=>["adapter","createFile"],createFolder:()=>["adapter","createFolder"]};class pM{driver;queryClient;config;onBeforeOpen;onAfterOpen;constructor(e,n={}){this.driver=e,this.onBeforeOpen=n.onBeforeOpen,this.onAfterOpen=n.onAfterOpen,this.queryClient=n.queryClient||new eO({defaultOptions:{queries:{refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,retry:n.retry??2},mutations:{retry:n.retry??1}}}),this.config={queryClient:this.queryClient,refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,cacheTime:n.cacheTime??600*1e3,retry:n.retry??2,onBeforeOpen:this.onBeforeOpen??(()=>{}),onAfterOpen:this.onAfterOpen??(()=>{})}}getDriver(){return this.driver}getQueryClient(){return this.queryClient}async list(e){const n=jf.list(e);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.list({path:e}),staleTime:this.config.staleTime})}async open(e){this.onBeforeOpen&&this.onBeforeOpen();const n=await this.list(e);return this.onAfterOpen&&this.onAfterOpen(n),n}async delete(e){const n=await this.driver.delete(e);return this.invalidateListQueries(),n}async rename(e){const n=await this.driver.rename(e);return this.invalidateListQueries(),n}async copy(e){const n=await this.driver.copy(e);return this.invalidateListQueries(),n}async move(e){const n=await this.driver.move(e);return this.invalidateListQueries(),n}async archive(e){const n=await this.driver.archive(e);return this.invalidateListQueries(),n}async unarchive(e){const n=await this.driver.unarchive(e);return this.invalidateListQueries(),n}async createFile(e){const n=await this.driver.createFile(e);return this.invalidateListQueries(),n}async createFolder(e){const n=await this.driver.createFolder(e);return this.invalidateListQueries(),n}async getContent(e){const n=["adapter","content",e.path];return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.getContent(e),staleTime:this.config.staleTime})}getPreviewUrl(e){return this.driver.getPreviewUrl(e)}getDownloadUrl(e){return this.driver.getDownloadUrl(e)}async search(e){const n=jf.search(e.path,e.filter,e.deep,e.size);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.search(e),staleTime:this.config.staleTime})}async save(e){const n=await this.driver.save(e);return this.invalidateListQueries(),n}invalidateListQueries(){this.queryClient.invalidateQueries({queryKey:["adapter"],exact:!1})}invalidateListQuery(e){this.queryClient.invalidateQueries({queryKey:["adapter","list",e],exact:!0})}clearCache(){this.queryClient.clear()}}function mM(t){const e=Oe(t.state);return{current:te(()=>e.value.theme||"silver"),set:n=>{t.set("theme",n)}}}const vM=(t,e)=>{const n=eM(t.id??"vf"),i=S$(),o=e.i18n,r=t.locale??e.locale,s=uM(t.id??"vf",t.config??{}),a=hM();if(!t.driver)throw new Error("Driver is required for VueFinder");const l=new pM(t.driver);return It({version:rM,config:s,theme:(()=>{const c=mM(s);return{current:c.current,set:c.set}})(),fs:a,root:null,debug:t.debug??!1,emitter:i,storage:n,i18n:iM(n,r,i,o,s),modal:aM(s),adapter:Gn(l),features:Hg(t.features),selectionMode:t.selectionMode||"multiple",selectionFilterType:te(()=>t.selectionFilterType||"both"),selectionFilterMimeIncludes:te(()=>t.selectionFilterMimeIncludes||[]),treeViewData:[],filesize:s.get("metricUnits")?qg:vu,contextMenuItems:t.contextMenuItems,customUploader:t.customUploader})},gM=["data-theme"],_M={class:"vuefinder__modal-layout__container"},yM={class:"vuefinder__modal-layout__content"},bM={key:0,class:"vuefinder__modal-layout__footer"},wM={key:0,class:"vuefinder__modal-drag-overlay"},SM={class:"vuefinder__modal-drag-message"},nn=Ce({__name:"ModalLayout",props:{showDragOverlay:{type:Boolean},dragOverlayText:{}},setup(t){const e=H(null),n=je();n.config;const i=t;et(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus(),Ge(()=>{if(document.querySelector(".v-f-modal input")&&window.innerWidth<768&&e.value){const s=e.value.getBoundingClientRect().bottom+16;window.scrollTo({top:s,left:0,behavior:"smooth"})}})});const o=r=>{r.target.classList.contains("vuefinder__modal-layout__wrapper")&&(r.preventDefault(),r.stopPropagation())};return(r,s)=>(y(),T("div",{"data-theme":m(n).theme.current,class:"vuefinder__themer vuefinder__modal-layout","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",tabindex:"0",onKeyup:s[1]||(s[1]=ho(a=>m(n).modal.close(),["esc"]))},[s[2]||(s[2]=g("div",{class:"vuefinder__modal-layout__overlay"},null,-1)),g("div",_M,[g("div",{class:"vuefinder__modal-layout__wrapper",onContextmenu:o,onMousedown:s[0]||(s[0]=Ye(a=>m(n).modal.close(),["self"]))},[g("div",{ref_key:"modalBody",ref:e,class:"vuefinder__modal-layout__body"},[g("div",yM,[Ve(r.$slots,"default")]),r.$slots.buttons?(y(),T("div",bM,[Ve(r.$slots,"buttons")])):ue("",!0)],512)],32)]),i.showDragOverlay?(y(),T("div",wM,[g("div",SM,L(i.dragOverlayText||"Drag and drop the files/folders to here."),1)])):ue("",!0)],40,gM))}}),CM={class:"vuefinder__modal-header"},EM={class:"vuefinder__modal-header__icon-container"},xM={id:"modal-title",class:"vuefinder__modal-header__title"},fn=Ce({__name:"ModalHeader",props:{title:{},icon:{}},setup(t){return(e,n)=>(y(),T("div",CM,[g("div",EM,[(y(),ne($t(t.icon),{class:"vuefinder__modal-header__icon"}))]),g("div",xM,L(t.title),1)]))}}),TM={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24"};function $M(t,e){return y(),T("svg",TM,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"9"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8.2h.01M10.75 11.25H12v4.5m0 0h1.25m-1.25 0h-2"},null,-1)])])}const Yg={render:$M},kM={class:"vuefinder__about-modal__content"},OM={class:"vuefinder__about-modal__main"},AM={class:"vuefinder__about-modal__tab-content"},PM={class:"vuefinder__about-modal__lead"},RM={class:"vuefinder__about-modal__description"},MM={class:"vuefinder__about-modal__links"},IM={href:"https://vuefinder.ozdemir.be",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"},FM={class:"vuefinder__about-modal__meta"},DM={class:"vuefinder__about-modal__meta-item"},LM={class:"vuefinder__about-modal__meta-label"},jM={class:"vuefinder__about-modal__meta-value"},zM={class:"vuefinder__about-modal__meta-item"},NM={class:"vuefinder__about-modal__meta-label"},Gg=Ce({__name:"ModalAbout",setup(t){const e=je(),{t:n}=e.i18n;return(i,o)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:o[0]||(o[0]=r=>m(e).modal.close())},L(m(n)("Close")),1)]),default:we(()=>[g("div",kM,[j(fn,{icon:m(Yg),title:"Vuefinder "+m(e).version},null,8,["icon","title"]),g("div",OM,[g("div",AM,[g("div",PM,L(m(n)("A modern, customizable file manager component built for Vue.")),1),g("div",RM,L(m(n)("If you like it, please follow and ⭐ star on GitHub.")),1),g("div",MM,[g("a",IM,L(m(n)("Project Home")),1),o[1]||(o[1]=g("a",{href:"https://github.com/n1crack/vuefinder",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"}," GitHub ",-1))]),g("div",FM,[g("div",DM,[g("span",LM,L(m(n)("Version")),1),g("span",jM,L(m(e).version),1)]),g("div",zM,[g("span",NM,L(m(n)("License")),1),o[2]||(o[2]=g("span",{class:"vuefinder__about-modal__meta-value"},"MIT",-1))])])])])])]),_:1}))}}),UM={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function VM(t,e){return y(),T("svg",UM,[...e[0]||(e[0]=[g("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const Qg={render:VM},BM={class:"vuefinder__delete-modal__content"},HM={class:"vuefinder__delete-modal__form"},qM={class:"vuefinder__delete-modal__description"},WM={class:"vuefinder__delete-modal__files vf-scrollbar"},KM={key:0,class:"vuefinder__delete-modal__icon vuefinder__delete-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},YM={key:1,class:"vuefinder__delete-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},GM={class:"vuefinder__delete-modal__file-name"},QM={class:"vuefinder__delete-modal__confirmation"},XM={class:"vuefinder__delete-modal__confirmation-label"},JM={class:"vuefinder__delete-modal__confirmation-text"},ZM=["disabled"],Zs=Ce({__name:"ModalDelete",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items),a=H(!1),l=()=>{s.value.length&&a.value&&e.adapter.delete({path:r.value.path,items:s.value.map(({path:c,type:u})=>({path:c,type:u}))}).then(c=>{n.success(i("Files deleted.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to delete files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("div",QM,[g("label",XM,[it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),type:"checkbox",class:"vuefinder__delete-modal__checkbox"},null,512),[[xs,a.value]]),g("span",JM,L(m(i)("I'm sure delete it, This action cannot be undone.")),1)])]),g("button",{type:"button",class:"vf-btn vf-btn-danger",disabled:!a.value,onClick:l},L(m(i)("Yes, Delete!")),9,ZM),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(Qg),title:m(i)("Delete files")},null,8,["icon","title"]),g("div",BM,[g("div",HM,[g("p",qM,L(m(i)("Are you sure you want to delete these files?")),1),g("div",WM,[(y(!0),T(Me,null,He(s.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__delete-modal__file"},[d.type==="dir"?(y(),T("svg",KM,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",YM,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",GM,L(d.basename),1)]))),128))])])])])]),_:1}))}}),eI={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function tI(t,e){return y(),T("svg",eI,[...e[0]||(e[0]=[g("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1)])])}const Xg={render:tI},nI={class:"vuefinder__rename-modal__content"},iI={class:"vuefinder__rename-modal__item"},oI={class:"vuefinder__rename-modal__item-info"},rI={key:0,class:"vuefinder__rename-modal__icon vuefinder__rename-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},sI={key:1,class:"vuefinder__rename-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},aI={class:"vuefinder__rename-modal__item-name"},ea=Ce({__name:"ModalRename",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items[0]),a=H(s.value.basename),l=()=>{a.value!=s.value.basename&&e.adapter.rename({path:r.value.path,item:s.value.path,name:a.value}).then(c=>{n.success(i("%s is renamed.",a.value)),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to rename")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(i)("Rename")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(Xg),title:m(i)("Rename")},null,8,["icon","title"]),g("div",nI,[g("div",iI,[g("p",oI,[s.value.type==="dir"?(y(),T("svg",rI,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",sI,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",aI,L(s.value.basename),1)]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),class:"vuefinder__rename-modal__input",placeholder:"Name",type:"text",onKeyup:ho(l,["enter"])},null,544),[[Xo,a.value]])])])])]),_:1}))}});function Tn(){const t=je(),e=te(()=>t.features);return{enabled:n=>e.value[n]??!1}}const lI={class:"vuefinder__text-preview"},cI={class:"vuefinder__text-preview__header"},uI=["title"],dI={class:"vuefinder__text-preview__actions"},hI={key:0,class:"vuefinder__text-preview__content"},fI={key:1},pI=Ce({__name:"Text",emits:["success"],setup(t,{emit:e}){const n=e,i=H(""),o=H(""),r=H(null),s=H(!1),a=je(),l=Gt(a),{enabled:c}=Tn(),{t:u}=a.i18n;et(async()=>{try{const v=await a.adapter.getContent({path:a.modal.data.item.path});i.value=v.content,n("success")}catch(v){Yt(v,"Failed to load text content"),n("success")}});const d=()=>{s.value=!s.value,o.value=i.value,a.modal.setEditMode(s.value)},h=async()=>{try{const v=a.modal.data.item.path;await a.adapter.save({path:v,content:o.value}),i.value=o.value,l.success(u("Updated.")),n("success"),s.value=!s.value}catch(v){l.error(Yt(v,u("Failed to save file")))}};return(v,p)=>(y(),T("div",lI,[g("div",cI,[g("div",{id:"modal-title",class:"vuefinder__text-preview__title",title:m(a).modal.data.item.path},L(m(a).modal.data.item.basename),9,uI),g("div",dI,[s.value?(y(),T("button",{key:0,class:"vuefinder__text-preview__save-button",onClick:h},L(m(u)("Save")),1)):ue("",!0),m(c)("edit")?(y(),T("button",{key:1,class:"vuefinder__text-preview__edit-button",onClick:p[0]||(p[0]=f=>d())},L(s.value?m(u)("Cancel"):m(u)("Edit")),1)):ue("",!0)])]),g("div",null,[s.value?(y(),T("div",fI,[it(g("textarea",{ref_key:"editInput",ref:r,"onUpdate:modelValue":p[1]||(p[1]=f=>o.value=f),class:"vuefinder__text-preview__textarea",name:"text",cols:"30",rows:"10"},null,512),[[Xo,o.value]])])):(y(),T("pre",hI,L(i.value),1))])]))}}),gu=async(t,e)=>{if(e){if(e.isFile){const n=await new Promise(i=>{e.file(i)});t(e,n)}if(e.isDirectory){const n=e.createReader(),i=await new Promise(o=>{n.readEntries(o)});for(const o of i)await gu(t,o)}}},gt={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10};function Jg(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=e.config,s=H({QUEUE_ENTRY_STATUS:gt}),a=H(null),l=H(null),c=H(null),u=H(null),d=H(null),h=H([]),v=H(""),p=H(!1),f=H(!1),_=H(null);let C;const w=Y=>{Y.preventDefault(),Y.stopPropagation(),f.value=!0},S=Y=>{Y.preventDefault(),Y.stopPropagation(),f.value=!0},b=Y=>{Y.preventDefault(),Y.stopPropagation(),(!Y.relatedTarget||Y.relatedTarget===document.body)&&(f.value=!1)},E=Y=>{Y.preventDefault(),Y.stopPropagation(),f.value=!1;const M=/^[/\\](.+)/,A=Y.dataTransfer;A&&(A.items&&A.items.length?Array.from(A.items).forEach(Q=>{if(Q.kind==="file"){const U=Q.webkitGetAsEntry?.();if(U)gu((ie,ve)=>{const re=M.exec(ie?.fullPath||"");O(ve,re?re[1]:ve.name)},U);else{const ie=Q.getAsFile?.();ie&&O(ie)}}}):A.files&&A.files.length&&Array.from(A.files).forEach(Q=>O(Q)))},x=Y=>h.value.findIndex(M=>M.id===Y),O=(Y,M)=>C.addFile({name:M||Y.name,type:Y.type,data:Y,source:"Local"}),$=Y=>Y.status===gt.DONE?"text-green-600":Y.status===gt.ERROR||Y.status===gt.CANCELED?"text-red-600":"",K=Y=>Y.status===gt.DONE?"✓":Y.status===gt.ERROR||Y.status===gt.CANCELED?"!":"...",F=()=>u.value?.click(),P=()=>e.modal.close(),N=Y=>{if(p.value||!h.value.filter(M=>M.status!==gt.DONE).length){p.value||(v.value=n("Please select file to upload first."));return}v.value="",_.value=Y||o.value,C.upload()},I=()=>{C.cancelAll(),h.value.forEach(Y=>{Y.status!==gt.DONE&&(Y.status=gt.CANCELED,Y.statusName=n("Canceled"))}),p.value=!1},q=Y=>{p.value||(C.removeFile(Y.id),h.value.splice(x(Y.id),1))},le=Y=>{if(!p.value)if(C.cancelAll(),Y){const M=h.value.filter(A=>A.status!==gt.DONE);h.value=[],M.forEach(A=>O(A.originalFile,A.name))}else h.value=[]},de=Y=>{Y.forEach(M=>{O(M)})};return et(()=>{C=new Fc({debug:e.debug,restrictions:{maxFileSize:sM(r.get("maxFileSize")??"10mb")},locale:e.i18n.t("uppy"),onBeforeFileAdded:(Q,U)=>{if(U[Q.id]!=null){const ie=x(Q.id);h.value[ie]?.status===gt.PENDING&&(v.value=C.i18n("noDuplicates",{fileName:Q.name})),h.value=h.value.filter(ve=>ve.id!==Q.id)}return h.value.push({id:Q.id,name:Q.name,size:e.filesize(Q.size),status:gt.PENDING,statusName:n("Pending upload"),percent:null,originalFile:Q.data}),!0}});const Y={getTargetPath:()=>(_.value||o.value).path};if(t)t(C,Y);else if(e.adapter.getDriver().configureUploader)e.adapter.getDriver().configureUploader(C,Y);else throw new Error("No uploader configured");C.on("restriction-failed",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&q(ie),v.value=U.message}),C.on("upload-start",Q=>{Q.forEach(U=>{const ie=h.value[x(U.id)];ie&&(ie.status=gt.UPLOADING,ie.statusName=n("Uploading"),ie.percent="0%")})}),C.on("upload-progress",(Q,U)=>{const ie=U.bytesTotal??1,ve=Math.floor(U.bytesUploaded/ie*100),re=x(Q.id);re!==-1&&h.value[re]&&(h.value[re].percent=`${ve}%`)}),C.on("upload-success",Q=>{const U=h.value[x(Q.id)];U&&(U.status=gt.DONE,U.statusName=n("Done"))}),C.on("upload-error",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&(ie.percent=null,ie.status=gt.ERROR,ie.statusName=U?.isNetworkError?n("Network Error, Unable establish connection to the server or interrupted."):U?.message||n("Unknown Error"))}),C.on("error",Q=>{v.value=Q.message,p.value=!1}),C.on("complete",Q=>{p.value=!1;const U=_.value||o.value;e.adapter.invalidateListQuery(U.path),e.adapter.open(U.path);const ie=h.value.filter(ve=>ve.status===gt.DONE&&Q.successful.includes(ve.id)).map(ve=>ve.name);e.emitter.emit("vf-upload-complete",ie)}),u.value?.addEventListener("click",()=>l.value?.click()),d.value?.addEventListener("click",()=>c.value?.click());const M={capture:!0};document.addEventListener("dragover",w,M),document.addEventListener("dragenter",S,M),document.addEventListener("dragleave",b,M),document.addEventListener("drop",E,M);const A=Q=>{const U=Q.target,ie=U.files;if(ie){for(const ve of ie)O(ve);U.value=""}};l.value?.addEventListener("change",A),c.value?.addEventListener("change",A)}),Ct(()=>{const Y={capture:!0};document.removeEventListener("dragover",w,Y),document.removeEventListener("dragenter",S,Y),document.removeEventListener("dragleave",b,Y),document.removeEventListener("drop",E,Y)}),{container:a,internalFileInput:l,internalFolderInput:c,pickFiles:u,pickFolders:d,queue:h,message:v,uploading:p,hasFilesInDropArea:f,definitions:s,openFileSelector:F,upload:N,cancel:I,remove:q,clear:le,close:P,getClassNameForEntry:$,getIconForEntry:K,addExternalFiles:de}}const mI={class:"vuefinder__image-preview"},vI={class:"vuefinder__image-preview__header"},gI=["title"],_I={class:"vuefinder__image-preview__actions"},yI={class:"vuefinder__image-preview__image-container"},bI=["src"],wI=Ce({name:"ImagePreview",__name:"Image",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=Gt(i),{enabled:r}=Tn(),{t:s}=i.i18n,a=H(!1),l=H(i.modal.data.item.previewUrl??i.adapter.getPreviewUrl({path:i.modal.data.item.path})),c=H(l.value),{addExternalFiles:u,upload:d,queue:h}=Jg(i.customUploader),v=i.fs,p=Oe(v.path),f=Mn("cropperRef"),_=async()=>{a.value=!a.value,i.modal.setEditMode(a.value)},C=async()=>{const w=f.value?.getResult({size:{width:795,height:341},fillColor:"#ffffff"})?.canvas;if(!w)return;let S=w;if(w.width>1200||w.height>1200){const $=Math.min(1200/w.width,1200/w.height),K=document.createElement("canvas");K.width=Math.floor(w.width*$),K.height=Math.floor(w.height*$);const F=K.getContext("2d");F&&(F.drawImage(w,0,0,K.width,K.height),S=K)}const b=i.modal.data.item.basename,E=b.split(".").pop()?.toLowerCase()||"jpg",x=E==="png"?"image/png":E==="gif"?"image/gif":"image/jpeg",O=await new Promise($=>{S.toBlob(K=>$(K),x)});if(!O){o.error(s("Failed to save image"));return}try{const $=new File([O],b,{type:x}),K=i.modal.data.item.path.split("/");K.pop();const F={path:K.join("/")||(p.value?.path??"")};u([$]),await new Promise(q=>setTimeout(q,100));const P=h.value.find(q=>q.name===$.name);if(!P)throw new Error("File was not added to upload queue");d(F);let N=0;for(;N<150;){await new Promise(le=>setTimeout(le,200));const q=h.value.find(le=>le.id===P.id);if(q?.status===gt.DONE)break;if(q?.status===gt.ERROR)throw new Error(q.statusName||"Upload failed");N++}o.success(s("Updated.")),await fetch(l.value,{cache:"reload",mode:"no-cors"});const I=i.root?.querySelector?.('[data-src="'+l.value+'"]');I&&I instanceof HTMLElement&&qi.resetStatus(I),i.emitter.emit("vf-refresh-thumbnails"),await _(),n("success")}catch($){o.error(Yt($,s("Failed to save image")))}};return et(()=>{n("success")}),(w,S)=>(y(),T("div",mI,[g("div",vI,[g("h3",{id:"modal-title",class:"vuefinder__image-preview__title",title:m(i).modal.data.item.path},L(m(i).modal.data.item.basename),9,gI),g("div",_I,[a.value?(y(),T("button",{key:0,class:"vuefinder__image-preview__crop-button",onClick:C},L(m(s)("Crop")),1)):ue("",!0),m(r)("edit")?(y(),T("button",{key:1,class:"vuefinder__image-preview__edit-button",onClick:S[0]||(S[0]=b=>_())},L(a.value?m(s)("Cancel"):m(s)("Edit")),1)):ue("",!0)])]),g("div",yI,[a.value?(y(),ne(m($v),{key:1,ref_key:"cropperRef",ref:f,class:"h-full w-full",crossorigin:"anonymous",src:c.value,"auto-zoom":!0,priority:"image",transitions:!0},null,8,["src"])):(y(),T("img",{key:0,style:{},src:m(i).modal.data.item.previewUrl??m(i).adapter.getPreviewUrl({path:m(i).modal.data.item.path}),class:"vuefinder__image-preview__image h-full w-full"},null,8,bI))])]))}}),SI={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function CI(t,e){return y(),T("svg",SI,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Ko={render:CI},EI={class:"vuefinder__default-preview"},xI={class:"vuefinder__default-preview__content"},TI={class:"vuefinder__default-preview__header"},$I=["title"],kI={class:"vuefinder__default-preview__icon-container"},OI=["title"],AI=Ce({__name:"Default",emits:["success"],setup(t,{emit:e}){const n=je(),i=e;return et(()=>{i("success")}),(o,r)=>(y(),T("div",EI,[g("div",xI,[g("div",TI,[g("h3",{id:"modal-title",class:"vuefinder__default-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,$I)]),g("div",kI,[j(m(Ko),{class:"vuefinder__default-preview__file-icon"}),g("div",{id:"modal-title",class:"vuefinder__default-preview__file-name",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,OI)])])]))}}),PI={class:"vuefinder__video-preview"},RI=["title"],MI={class:"vuefinder__video-preview__video",preload:"metadata",controls:""},II=["src"],FI=Ce({__name:"Video",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>n.adapter.getPreviewUrl({path:n.modal.data.item.path});return et(()=>{i("success")}),(r,s)=>(y(),T("div",PI,[g("h3",{id:"modal-title",class:"vuefinder__video-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,RI),g("div",null,[g("video",MI,[g("source",{src:o(),type:"video/mp4"},null,8,II),s[0]||(s[0]=Ke(" Your browser does not support the video tag. ",-1))])])]))}}),DI={class:"vuefinder__audio-preview"},LI=["title"],jI={class:"vuefinder__audio-preview__audio",controls:""},zI=["src"],NI=Ce({__name:"Audio",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{n("success")}),(r,s)=>(y(),T("div",DI,[g("h3",{id:"modal-title",class:"vuefinder__audio-preview__title",title:m(i).modal.data.item.path},L(m(i).modal.data.item.basename),9,LI),g("div",null,[g("audio",jI,[g("source",{src:o(),type:"audio/mpeg"},null,8,zI),s[0]||(s[0]=Ke(" Your browser does not support the audio element. ",-1))])])]))}}),UI={class:"vuefinder__pdf-preview"},VI=["title"],BI=["data"],HI=["src"],qI=Ce({__name:"Pdf",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{i("success")}),(r,s)=>(y(),T("div",UI,[g("h3",{id:"modal-title",class:"vuefinder__pdf-preview__title",title:m(n).modal.data.item.path},L(m(n).modal.data.item.basename),9,VI),g("div",null,[g("object",{class:"vuefinder__pdf-preview__object",data:o(),type:"application/pdf",width:"100%",height:"100%"},[g("iframe",{class:"vuefinder__pdf-preview__iframe",src:o(),width:"100%",height:"100%"}," Your browser does not support PDFs ",8,HI)],8,BI)])]))}});function WI(t,e=null){return new Date(t*1e3).toLocaleString(e??navigator.language??"en-US")}const KI={key:0,class:"vuefinder__preview-modal__nav-overlay"},YI=["disabled","title"],GI=["disabled","title"],QI={class:"vuefinder__preview-modal__content"},XI={key:0},JI={class:"vuefinder__preview-modal__loading"},ZI={key:0,class:"vuefinder__preview-modal__loading-indicator"},eF={class:"vuefinder__preview-modal__details"},tF={class:"font-bold"},nF={class:"pl-2 font-bold"},iF={key:0,class:"vuefinder__preview-modal__note"},oF=["download","href"],ur=Ce({__name:"ModalPreview",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=H(!1),r=w=>{const S=(w||"").split("/").pop()||"",b=S.lastIndexOf(".");return b>=0?S.slice(b+1).toLowerCase():""},s=(w,S)=>S?w==="image"?new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]).has(S):w==="video"?new Set(["mp4","webm","ogg","ogv","mov","m4v"]).has(S):w==="audio"?new Set(["mp3","wav","ogg","oga","m4a","flac","aac"]).has(S):w==="text"?new Set(["txt","md","json","js","ts","css","scss","html","xml","csv","log","yml","yaml"]).has(S):w==="application/pdf"?S==="pdf":!1:!1,a=w=>{const S=e.modal.data.item.mime_type;if(S&&typeof S=="string")return S.startsWith(w);const b=r(e.modal.data.item.path);return s(w,b)},l=n("preview");l||(o.value=!0);const c=te(()=>e.modal.data.item),u=Oe(e.fs.sortedFiles),d=te(()=>u.value.filter(w=>w.type==="file")),h=te(()=>d.value.findIndex(w=>w.path===c.value.path)),v=te(()=>h.value>0),p=te(()=>h.value<d.value.length-1),f=()=>{if(e.modal.editMode||!v.value)return;const w=d.value[h.value-1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},_=()=>{if(e.modal.editMode||!p.value)return;const w=d.value[h.value+1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},C=w=>{if(w.key==="Escape"){w.preventDefault(),w.stopPropagation(),e.modal.close();return}(w.key==="ArrowLeft"||w.key==="ArrowRight")&&(w.preventDefault(),w.stopPropagation(),w.key==="ArrowLeft"?f():_())};return et(()=>{const w=document.querySelector(".vuefinder__preview-modal");w&&w.focus()}),(w,S)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:S[6]||(S[6]=b=>m(e).modal.close())},L(m(i)("Close")),1),m(n)("download")?(y(),T("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:m(e).adapter.getDownloadUrl(m(e).modal.data.item),href:m(e).adapter.getDownloadUrl(m(e).modal.data.item)},L(m(i)("Download")),9,oF)):ue("",!0)]),default:we(()=>[g("div",{class:"vuefinder__preview-modal",tabindex:"0",onKeydown:C},[m(e).modal.editMode?ue("",!0):(y(),T("div",KI,[g("button",{disabled:!v.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--left",title:m(i)("Previous file"),onClick:f},[...S[7]||(S[7]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"15,18 9,12 15,6"})],-1)])],8,YI),g("button",{disabled:!p.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--right",title:m(i)("Next file"),onClick:_},[...S[8]||(S[8]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"9,18 15,12 9,6"})],-1)])],8,GI)])),g("div",QI,[m(l)?(y(),T("div",XI,[a("text")?(y(),ne(pI,{key:`text-${c.value.path}`,onSuccess:S[0]||(S[0]=b=>o.value=!0)})):a("image")?(y(),ne(wI,{key:`image-${c.value.path}`,onSuccess:S[1]||(S[1]=b=>o.value=!0)})):a("video")?(y(),ne(FI,{key:`video-${c.value.path}`,onSuccess:S[2]||(S[2]=b=>o.value=!0)})):a("audio")?(y(),ne(NI,{key:`audio-${c.value.path}`,onSuccess:S[3]||(S[3]=b=>o.value=!0)})):a("application/pdf")?(y(),ne(qI,{key:`pdf-${c.value.path}`,onSuccess:S[4]||(S[4]=b=>o.value=!0)})):(y(),ne(AI,{key:`default-${c.value.path}`,onSuccess:S[5]||(S[5]=b=>o.value=!0)}))])):ue("",!0),g("div",JI,[o.value===!1?(y(),T("div",ZI,[S[9]||(S[9]=g("svg",{class:"vuefinder__preview-modal__spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g("circle",{class:"vuefinder__preview-modal__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),g("path",{class:"vuefinder__preview-modal__spinner-path",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),g("span",null,L(m(i)("Loading")),1)])):ue("",!0)])])],32),g("div",eF,[g("div",null,[g("span",tF,L(m(i)("File Size"))+": ",1),Ke(L(m(e).filesize(m(e).modal.data.item.file_size)),1)]),g("div",null,[g("span",nF,L(m(i)("Last Modified"))+": ",1),Ke(" "+L(m(WI)(m(e).modal.data.item.last_modified)),1)])]),m(n)("download")?(y(),T("div",iF,[g("span",null,L(m(i)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):ue("",!0)]),_:1}))}}),rF={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"};function sF(t,e){return y(),T("svg",rF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M13 19H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v4M16 22l5-5M21 21.5V17h-4.5"},null,-1)])])}const aF={render:sF},lF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function cF(t,e){return y(),T("svg",lF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"},null,-1)])])}const _u={render:cF},uF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function dF(t,e){return y(),T("svg",uF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1)])])}const zn={render:dF},hF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function fF(t,e){return y(),T("svg",hF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 5v14M5 12h14"},null,-1)])])}const ta={render:fF},pF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function mF(t,e){return y(),T("svg",pF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M5 12h14"},null,-1)])])}const na={render:mF},vF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"h-5 w-5",viewBox:"0 0 24 24"};function gF(t,e){return y(),T("svg",vF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"m15 4.5-4 4L7 10l-1.5 1.5 7 7L14 17l1.5-4 4-4M9 15l-4.5 4.5M14.5 4 20 9.5"},null,-1)])])}const yu={render:gF},_F={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function yF(t,e){return y(),T("svg",_F,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])}const bu={render:yF},bF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function wF(t,e){return y(),T("svg",bF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776q.168-.026.344-.026h15.812q.176 0 .344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},null,-1)])])}const wu={render:wF},SF={class:"vuefinder__modal-tree__folder-item"},CF={class:"vuefinder__modal-tree__folder-content"},EF={key:1,class:"vuefinder__modal-tree__folder-spacer"},xF={class:"vuefinder__modal-tree__folder-text"},TF={key:0,class:"vuefinder__modal-tree__subfolders"},$F={key:0,class:"vuefinder__modal-tree__more-note"},kF=300,OF=Ce({__name:"ModalTreeFolderItem",props:{folder:{},storage:{},modelValue:{},expandedFolders:{},modalTreeData:{},currentPath:{}},emits:["update:modelValue","selectAndClose","toggleFolder"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=H({}),s=t,a=e;Oe(o.path);const l=te(()=>{const O=`${s.storage}:${s.folder.path}`;return s.expandedFolders[O]||!1}),c=te(()=>s.modelValue?.path===s.folder.path),u=te(()=>s.currentPath?.path===s.folder.path),d=te(()=>s.modalTreeData[s.folder.path]||[]),h=te(()=>{const O=d.value,$=r.value[s.folder.path]||50;return O.length>$?O.slice(0,$):O}),v=te(()=>d.value.length),p=te(()=>r.value[s.folder.path]||50),f=te(()=>v.value>p.value),_=()=>{r.value[s.folder.path]=(p.value||50)+50},C=te(()=>d.value.length>0||s.folder.type==="dir"),w=()=>{a("toggleFolder",s.storage,s.folder.path)},S=()=>{a("update:modelValue",s.folder)},b=()=>{a("update:modelValue",s.folder),a("selectAndClose",s.folder)};let E=0;const x=()=>{const O=Date.now();O-E<kF?b():S(),E=O};return(O,$)=>{const K=Ue("ModalTreeFolderItem",!0);return y(),T("div",SF,[g("div",CF,[C.value?(y(),T("div",{key:0,class:"vuefinder__modal-tree__folder-toggle",onClick:w},[l.value?(y(),ne(m(na),{key:1,class:"vuefinder__modal-tree__folder-toggle-icon"})):(y(),ne(m(ta),{key:0,class:"vuefinder__modal-tree__folder-toggle-icon"}))])):(y(),T("div",EF)),g("div",{class:Ae(["vuefinder__modal-tree__folder-link",{"vuefinder__modal-tree__folder-link--selected":c.value,"vuefinder__modal-tree__folder-link--current":u.value}]),onClick:S,onDblclick:b,onTouchend:x},[l.value?(y(),ne(m(wu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__modal-tree__folder-icon"})):(y(),ne(m(zn),{key:0,class:"vuefinder__modal-tree__folder-icon vuefinder__item-icon__folder"})),g("span",xF,L(t.folder.basename),1)],34)]),l.value&&C.value?(y(),T("div",TF,[(y(!0),T(Me,null,He(h.value,F=>(y(),ne(K,{key:F.path,folder:F,storage:t.storage,"model-value":t.modelValue,"expanded-folders":t.expandedFolders,"modal-tree-data":t.modalTreeData,"current-path":t.currentPath,"onUpdate:modelValue":$[0]||($[0]=P=>O.$emit("update:modelValue",P)),onSelectAndClose:$[1]||($[1]=P=>O.$emit("selectAndClose",P)),onToggleFolder:$[2]||($[2]=(P,N)=>O.$emit("toggleFolder",P,N))},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),f.value?(y(),T("div",$F,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:_},L(m(i)("load more")),1)])):ue("",!0)])):ue("",!0)])}}}),AF={class:"vuefinder__modal-tree"},PF={class:"vuefinder__modal-tree__header"},RF={class:"vuefinder__modal-tree__title"},MF={key:0,class:"vuefinder__modal-tree__section"},IF={class:"vuefinder__modal-tree__section-title"},FF={class:"vuefinder__modal-tree__list"},DF=["onClick","onDblclick","onTouchend"],LF={class:"vuefinder__modal-tree__text"},jF={class:"vuefinder__modal-tree__text-storage"},zF={class:"vuefinder__modal-tree__section-title"},NF={class:"vuefinder__modal-tree__list"},UF={class:"vuefinder__modal-tree__storage-item"},VF={class:"vuefinder__modal-tree__storage-content"},BF=["onClick"],HF=["onClick","onDblclick","onTouchend"],qF={class:"vuefinder__modal-tree__storage-text"},WF={key:0,class:"vuefinder__modal-tree__subfolders"},KF={key:0,class:"vuefinder__modal-tree__more-note"},YF=["onClick"],zf=300,Su=Ce({__name:"ModalTreeSelector",props:{modelValue:{},showPinnedFolders:{type:Boolean},currentPath:{}},emits:["update:modelValue","selectAndClose"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=n.config,s=e,a=Oe(o.sortedFiles),l=Oe(o.storages),c=te(()=>l.value||[]),u=Oe(o.path),d=H(null),h=H({}),v=H({}),p=H({});$e(a,I=>{const q=I.filter(de=>de.type==="dir"),le=u.value?.path||"";le&&(v.value[le]=q.map(de=>({...de,type:"dir"})))});const f=(I,q)=>{const le=`${I}:${q}`;h.value={...h.value,[le]:!h.value[le]},h.value[le]&&!v.value[q]&&n.adapter.list(q).then(de=>{const Y=(de.files||[]).filter(M=>M.type==="dir");v.value[q]=Y.map(M=>({...M,type:"dir"}))})},_=I=>v.value[I]||[],C=I=>p.value[I]||50,w=I=>{const q=_(I),le=C(I);return q.length>le?q.slice(0,le):q},S=I=>_(I).length,b=I=>S(I)>C(I),E=I=>{p.value[I]=C(I)+50},x=I=>{I&&s("update:modelValue",I)},O=I=>{I&&(s("update:modelValue",I),s("selectAndClose",I))},$=I=>{const q={storage:I,path:I+"://",basename:I,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:I+"://"};s("update:modelValue",q)},K=I=>{const q={storage:I,path:I+"://",basename:I,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:I+"://"};s("update:modelValue",q),s("selectAndClose",q)};let F=0;const P=I=>{if(!I)return;const q=Date.now();q-F<zf?O(I):x(I),F=q},N=I=>{const q=Date.now();q-F<zf?K(I):$(I),F=q};return et(()=>{d.value&&hn(d.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),(I,q)=>(y(),T("div",AF,[g("div",PF,[g("div",RF,L(m(i)("Select Target Folder")),1)]),g("div",{ref_key:"modalContentElement",ref:d,class:"vuefinder__modal-tree__content"},[t.showPinnedFolders&&m(n).features.pinned&&m(r).get("pinnedFolders").length?(y(),T("div",MF,[g("div",IF,L(m(i)("Pinned Folders")),1),g("div",FF,[(y(!0),T(Me,null,He(m(r).get("pinnedFolders"),le=>(y(),T("div",{key:le.path,class:Ae(["vuefinder__modal-tree__item",{"vuefinder__modal-tree__item--selected":t.modelValue?.path===le.path}]),onClick:de=>x(le),onDblclick:de=>O(le),onTouchend:de=>P(le)},[j(m(zn),{class:"vuefinder__modal-tree__icon vuefinder__item-icon__folder"}),g("div",LF,L(le.basename),1),g("div",jF,L(le.storage),1),j(m(yu),{class:"vuefinder__modal-tree__icon vuefinder__modal-tree__icon--pin"})],42,DF))),128))])])):ue("",!0),g("div",zF,L(m(i)("Storages")),1),(y(!0),T(Me,null,He(c.value,le=>(y(),T("div",{key:le,class:"vuefinder__modal-tree__section"},[g("div",NF,[g("div",UF,[g("div",VF,[g("div",{class:"vuefinder__modal-tree__storage-toggle",onClick:Ye(de=>f(le,le+"://"),["stop"])},[h.value[`${le}:${le}://`]?(y(),ne(m(na),{key:1,class:"vuefinder__modal-tree__toggle-icon"})):(y(),ne(m(ta),{key:0,class:"vuefinder__modal-tree__toggle-icon"}))],8,BF),g("div",{class:Ae(["vuefinder__modal-tree__storage-link",{"vuefinder__modal-tree__storage-link--selected":t.modelValue?.path===le+"://"}]),onClick:de=>$(le),onDblclick:de=>K(le),onTouchend:de=>N(le)},[j(m(bu),{class:"vuefinder__modal-tree__storage-icon"}),g("span",qF,L(le),1)],42,HF)]),h.value[`${le}:${le}://`]?(y(),T("div",WF,[(y(!0),T(Me,null,He(w(le+"://"),de=>(y(),ne(OF,{key:de.path,folder:de,storage:le,"model-value":t.modelValue,"expanded-folders":h.value,"modal-tree-data":v.value,"current-path":t.currentPath,"onUpdate:modelValue":x,onSelectAndClose:O,onToggleFolder:f},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),b(le+"://")?(y(),T("div",KF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:de=>E(le+"://")},L(m(i)("load more")),9,YF)])):ue("",!0)])):ue("",!0)])])]))),128))],512)]))}}),GF=["title"],nc=Ce({__name:"Message",props:{error:{type:Boolean}},emits:["hidden"],setup(t,{emit:e}){const n=e,i=je(),{t:o}=i.i18n,r=H(!1),s=H(null),a=H(s.value?.innerHTML);$e(a,()=>r.value=!1);const l=()=>{n("hidden"),r.value=!0};return(c,u)=>(y(),T("div",null,[r.value?ue("",!0):(y(),T("div",{key:0,ref_key:"strMessage",ref:s,class:Ae(["vuefinder__message",t.error?"vuefinder__message--error":"vuefinder__message--success"])},[Ve(c.$slots,"default"),g("div",{class:"vuefinder__message__close",title:m(o)("Close"),onClick:l},[...u[0]||(u[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__message__icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,GF)],2))]))}}),QF={class:"vuefinder__move-modal__content"},XF={class:"vuefinder__move-modal__description"},JF={class:"vuefinder__move-modal__files vf-scrollbar"},ZF={class:"vuefinder__move-modal__file-name"},eD={class:"vuefinder__move-modal__target-title"},tD={class:"vuefinder__move-modal__target-container"},nD={class:"vuefinder__move-modal__target-path"},iD={class:"vuefinder__move-modal__target-storage"},oD={key:0,class:"vuefinder__move-modal__destination-folder"},rD={class:"vuefinder__move-modal__target-badge"},sD={key:0,class:"vuefinder__move-modal__options"},aD={class:"vuefinder__move-modal__checkbox-label"},lD={class:"vuefinder__move-modal__checkbox-text"},cD=["disabled"],uD={class:"vuefinder__move-modal__selected-items"},Zg=Ce({__name:"ModalTransfer",props:{copy:{type:Boolean}},setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e.i18n,r=t,s=H(e.modal.data.items.from),a=H(e.modal.data.items.to),l=H(""),c=H(r.copy||!i("move")),u=te(()=>c.value?"copy":"move"),d=H(!1),h=Oe(e.fs.path),v=te(()=>c.value?o("Copy files"):o("Move files")),p=te(()=>c.value?o("Are you sure you want to copy these files?"):o("Are you sure you want to move these files?")),f=te(()=>c.value?o("Yes, Copy!"):o("Yes, Move!")),_=x=>{x&&(a.value=x)},C=x=>{x&&(a.value=x,d.value=!1)},w=te(()=>{const x=a.value;return x?s.value.some(O=>!!(x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))):!0}),S=te(()=>{if(!w.value)return"";const x=a.value;return x?s.value.find(O=>x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))?o("Cannot move/copy item to itself or its parent/child directory"):o("Invalid destination directory"):o("Please select a destination directory")}),b=()=>{const x=a.value.path;if(!x)return{storage:"local",path:""};if(x.endsWith("://"))return{storage:x.replace("://",""),path:""};const O=x.split("://");return{storage:O[0]||"local",path:O[1]||""}},E=async()=>{if(s.value.length)try{const{files:x}=await e.adapter[u.value]({path:h.value.path,sources:s.value.map(({path:O})=>O),destination:a.value.path});e.fs.setFiles(x),e.modal.close()}catch(x){n.error(Yt(x,o("Failed to transfer files")))}};return(x,O)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:w.value,onClick:E},L(f.value),9,cD),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:O[4]||(O[4]=$=>m(e).modal.close())},L(m(o)("Cancel")),1),g("div",uD,L(m(o)("%s item(s) selected.",s.value.length)),1)]),default:we(()=>[g("div",null,[j(fn,{icon:c.value?m(_u):m(aF),title:v.value},null,8,["icon","title"]),g("div",QF,[g("p",XF,L(p.value),1),g("div",JF,[(y(!0),T(Me,null,He(s.value,$=>(y(),T("div",{key:$.path,class:"vuefinder__move-modal__file"},[g("div",null,[$.type==="dir"?(y(),ne(m(zn),{key:0,class:"vuefinder__move-modal__icon vuefinder__move-modal__icon--dir"})):(y(),ne(m(Ko),{key:1,class:"vuefinder__move-modal__icon"}))]),g("div",ZF,L($.path),1)]))),128))]),g("h4",eD,L(m(o)("Target Directory")),1),g("div",tD,[g("div",{class:"vuefinder__move-modal__target-display",onClick:O[0]||(O[0]=$=>d.value=!d.value)},[g("div",nD,[g("span",iD,L(b().storage)+"://",1),b().path?(y(),T("span",oD,L(b().path),1)):ue("",!0)]),g("span",rD,L(m(o)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__move-modal__tree-selector",d.value?"vuefinder__move-modal__tree-selector--expanded":"vuefinder__move-modal__tree-selector--collapsed"])},[j(Su,{modelValue:a.value,"onUpdate:modelValue":[O[1]||(O[1]=$=>a.value=$),_],"show-pinned-folders":!0,onSelectAndClose:C},null,8,["modelValue"])],2),m(i)("copy")&&m(i)("move")?(y(),T("div",sD,[g("label",aD,[it(g("input",{"onUpdate:modelValue":O[2]||(O[2]=$=>c.value=$),type:"checkbox",class:"vuefinder__move-modal__checkbox"},null,512),[[xs,c.value]]),g("span",lD,L(m(o)("Create a copy instead of moving")),1)])])):ue("",!0),S.value?(y(),ne(nc,{key:1,error:""},{default:we(()=>[Ke(L(S.value),1)]),_:1})):ue("",!0),l.value.length&&!S.value?(y(),ne(nc,{key:2,error:"",onHidden:O[3]||(O[3]=$=>l.value="")},{default:we(()=>[Ke(L(l.value),1)]),_:1})):ue("",!0)])])]),_:1}))}}),uo=Ce({__name:"ModalMove",setup(t){return(e,n)=>(y(),ne(Zg,{copy:!1}))}}),Cu=Ce({__name:"ModalCopy",setup(t){return(e,n)=>(y(),ne(Zg,{copy:!0}))}}),dD=(t,e=0,n=!1)=>{let i;return(...o)=>{n&&!i&&t(...o),clearTimeout(i),i=setTimeout(()=>{t(...o)},e)}},e_=(t,e,n)=>{const i=H(t);return I_((o,r)=>({get(){return o(),i.value},set:dD(s=>{i.value=s,r()},e,!1)}))},hD={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function fD(t,e){return y(),T("svg",hD,[...e[0]||(e[0]=[g("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1)])])}const Eu={render:fD},pD={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"};function mD(t,e){return y(),T("svg",pD,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900"},null,-1),g("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const ia={render:mD},vD={class:"vuefinder__search-modal__search-input"},gD=["value","placeholder","disabled"],_D={key:0,class:"vuefinder__search-modal__loading"},yD=Ce({name:"SearchInput",__name:"SearchInput",props:{modelValue:{},isSearching:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","keydown"],setup(t,{expose:e,emit:n}){const i=n,o=je(),{t:r}=o.i18n,s=H(null),a=c=>{const u=c.target;i("update:modelValue",u.value)},l=c=>{i("keydown",c)};return e({focus:()=>{s.value&&s.value.focus()}}),(c,u)=>(y(),T("div",vD,[j(m(Eu),{class:"vuefinder__search-modal__search-icon"}),g("input",{ref_key:"searchInput",ref:s,value:t.modelValue,type:"text",placeholder:m(r)("Search files"),disabled:t.disabled,class:"vuefinder__search-modal__input",onKeydown:l,onKeyup:u[0]||(u[0]=Ye(()=>{},["stop"])),onInput:a},null,40,gD),t.isSearching?(y(),T("div",_D,[j(m(ia),{class:"vuefinder__search-modal__loading-icon"})])):ue("",!0)]))}}),bD={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function wD(t,e){return y(),T("svg",bD,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87q.11.06.22.127c.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a8 8 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a7 7 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a7 7 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a7 7 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124q.108-.066.22-.128c.332-.183.582-.495.644-.869z"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1)])])}const t_={render:wD},SD=["disabled","title"],CD=["data-theme"],ED={class:"vuefinder__search-modal__dropdown-content"},xD={class:"vuefinder__search-modal__dropdown-section"},TD={class:"vuefinder__search-modal__dropdown-title"},$D={class:"vuefinder__search-modal__dropdown-options"},kD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},OD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},AD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},PD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},RD=Ce({name:"SearchOptionsDropdown",__name:"SearchOptionsDropdown",props:{visible:{type:Boolean},disabled:{type:Boolean,default:!1},sizeFilter:{},selectedOption:{}},emits:["update:visible","update:sizeFilter","update:selectedOption","keydown"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=H(null),l=H(null);let c=null;const u=f=>{if(o("update:selectedOption",f),f.startsWith("size-")){const _=f.split("-")[1];o("update:sizeFilter",_)}},d=async()=>{i.disabled||(i.visible?(o("update:visible",!1),c&&(c(),c=null)):(o("update:visible",!0),await Ge(),await h()))},h=async()=>{if(!(!a.value||!l.value)&&(await Ge(),!(!a.value||!l.value))){Object.assign(l.value.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:f,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Mo(8),Io({padding:16}),Fo({padding:16})]});Object.assign(l.value.style,{left:`${f}px`,top:`${_}px`}),requestAnimationFrame(()=>{l.value&&Object.assign(l.value.style,{opacity:"1",transform:"translateY(0)"})})}catch(f){console.warn("Floating UI initial positioning error:",f);return}try{c=cc(a.value,l.value,async()=>{if(!(!a.value||!l.value))try{const{x:f,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Mo(8),Io({padding:16}),Fo({padding:16})]});Object.assign(l.value.style,{left:`${f}px`,top:`${_}px`})}catch(f){console.warn("Floating UI positioning error:",f)}})}catch(f){console.warn("Floating UI autoUpdate setup error:",f),c=null}}},v=f=>{if(!i.visible)return;const _=["size-all","size-small","size-medium","size-large"],C=_.findIndex(w=>w===i.selectedOption);if(f.key==="ArrowDown"){f.preventDefault();const w=(C+1)%_.length;o("update:selectedOption",_[w]||null)}else if(f.key==="ArrowUp"){f.preventDefault();const w=C<=0?_.length-1:C-1;o("update:selectedOption",_[w]||null)}else f.key==="Enter"?(f.preventDefault(),i.selectedOption?.startsWith("size-")&&o("update:sizeFilter",i.selectedOption.split("-")[1])):f.key==="Escape"&&(f.preventDefault(),o("update:visible",!1),c&&(c(),c=null))},p=()=>{c&&(c(),c=null)};return $e(()=>i.visible,f=>{!f&&c&&(c(),c=null)}),Ct(()=>{p()}),e({cleanup:p}),(f,_)=>(y(),T(Me,null,[g("button",{ref_key:"dropdownBtn",ref:a,class:Ae(["vuefinder__search-modal__dropdown-btn",{"vuefinder__search-modal__dropdown-btn--active":t.visible}]),disabled:t.disabled,title:m(s)("Search Options"),onClick:Ye(d,["stop"])},[j(m(t_),{class:"vuefinder__search-modal__dropdown-icon"})],10,SD),(y(),ne(Es,{to:"body"},[t.visible?(y(),T("div",{key:0,ref_key:"dropdownContent",ref:l,class:"vuefinder__themer vuefinder__search-modal__dropdown vuefinder__search-modal__dropdown--visible","data-theme":m(r).theme.current,tabindex:"-1",onClick:_[4]||(_[4]=Ye(()=>{},["stop"])),onKeydown:v},[g("div",ED,[g("div",xD,[g("div",TD,L(m(s)("File Size")),1),g("div",$D,[g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="all"}]),onClick:_[0]||(_[0]=Ye(C=>u("size-all"),["stop"]))},[g("span",null,L(m(s)("All Files")),1),t.sizeFilter==="all"?(y(),T("div",kD,[..._[5]||(_[5]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="small"}]),onClick:_[1]||(_[1]=Ye(C=>u("size-small"),["stop"]))},[g("span",null,L(m(s)("Small (< 1MB)")),1),t.sizeFilter==="small"?(y(),T("div",OD,[..._[6]||(_[6]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="medium"}]),onClick:_[2]||(_[2]=Ye(C=>u("size-medium"),["stop"]))},[g("span",null,L(m(s)("Medium (1-10MB)")),1),t.sizeFilter==="medium"?(y(),T("div",AD,[..._[7]||(_[7]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="large"}]),onClick:_[3]||(_[3]=Ye(C=>u("size-large"),["stop"]))},[g("span",null,L(m(s)("Large (> 10MB)")),1),t.sizeFilter==="large"?(y(),T("div",PD,[..._[8]||(_[8]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2)])])])],40,CD)):ue("",!0)]))],64))}});function n_(t,e=40){const n=t.match(/^([^:]+:\/\/)(.*)$/);if(!n)return t;const i=n[1],o=n[2]??"",r=o.split("/").filter(Boolean),s=r.pop();if(!s)return i+o;let a=`${i}${r.join("/")}${r.length?"/":""}${s}`;if(a.length<=e)return a;const l=s.split(/\.(?=[^\.]+$)/),c=l[0]??"",u=l[1]??"",d=c.length>10?`${c.slice(0,6)}...${c.slice(-5)}`:c,h=u?`${d}.${u}`:d;return a=`${i}${r.join("/")}${r.length?"/":""}${h}`,a.length>e&&(a=`${i}.../${h}`),a}async function i_(t){try{await navigator.clipboard.writeText(t)}catch{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}async function Yo(t){await i_(t)}async function MD(t){await i_(t)}const ID={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 448 512"};function FD(t,e){return y(),T("svg",ID,[...e[0]||(e[0]=[g("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1)])])}const o_={render:FD},DD=["title"],LD={class:"vuefinder__search-modal__result-icon"},jD={class:"vuefinder__search-modal__result-content"},zD={class:"vuefinder__search-modal__result-name"},ND={key:0,class:"vuefinder__search-modal__result-size"},UD=["title"],VD=["title"],BD=["data-item-dropdown","data-theme"],HD={class:"vuefinder__search-modal__item-dropdown-content"},qD=Ce({name:"SearchResultItem",__name:"SearchResultItem",props:{item:{},index:{},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{}},emits:["select","selectWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{emit:e}){const n=t,i=e,o=je(),{t:r}=o.i18n,s=H(null);let a=null,l=null,c=[],u=null;$e(()=>n.activeDropdown,O=>{a&&(a(),a=null),l&&(c.forEach($=>{$===window?window.removeEventListener("scroll",l,!0):$.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null),O===n.item.path&&s.value&&Ge(()=>{C(n.item.path,s.value),h(),v()})});const d=O=>{const $=[];let K=O;for(;K&&K!==document.body&&K!==document.documentElement;){const F=window.getComputedStyle(K),P=F.overflow+F.overflowX+F.overflowY;(P.includes("scroll")||P.includes("auto"))&&$.push(K),K=K.parentElement}return $},h=()=>{if(n.activeDropdown!==n.item.path)return;const O=d(s.value);c=[window,...O],l=()=>{n.activeDropdown===n.item.path&&i("toggleItemDropdown",n.item.path,new MouseEvent("click"))};const $=l;$&&c.forEach(K=>{K===window?window.addEventListener("scroll",$,!0):K.addEventListener("scroll",$,!0)})},v=()=>{n.activeDropdown===n.item.path&&(u=O=>{if(n.activeDropdown!==n.item.path)return;const $=O.target;if(!$)return;const K=document.querySelector(`[data-item-dropdown="${n.item.path}"]`);if(K&&K.contains($)||s.value&&s.value.contains($))return;const F=o.root;if(F&&F.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}const P=document.querySelector(".vuefinder__modal-layout");if(P&&P.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}i("toggleItemDropdown",n.item.path,new MouseEvent("click"))},setTimeout(()=>{u&&(document.addEventListener("mousedown",u,!0),document.addEventListener("touchstart",u,!0))},100))};Ct(()=>{a&&(a(),a=null),l&&(c.forEach(O=>{O===window?window.removeEventListener("scroll",l,!0):O.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null)});const p=O=>n.expandedPaths.has(O),f=O=>O.type==="dir"||!O.file_size?"":vu(O.file_size),_=(O,$)=>{$.stopPropagation(),i("toggleItemDropdown",O,$)},C=async(O,$)=>{const K=document.querySelector(`[data-item-dropdown="${O}"]`);if(!(!K||!$)&&(await Ge(),!(!K||!$))){Object.assign(K.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Mo(8),Io({padding:16}),Fo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`}),requestAnimationFrame(()=>{K&&Object.assign(K.style,{opacity:"1",transform:"translateY(0)"})})}catch(F){console.warn("Floating UI initial positioning error:",F);return}try{a=cc($,K,async()=>{if(!(!$||!K))try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Mo(8),Io({padding:16}),Fo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`})}catch(F){console.warn("Floating UI positioning error:",F)}})}catch(F){console.warn("Floating UI autoUpdate setup error:",F),a=null}}},w=O=>{i("update:selectedItemDropdownOption",O)},S=async O=>{await Yo(O.path),i("copyPath",O)},b=O=>{i("openContainingFolder",O)},E=O=>{i("preview",O)},x=O=>{if(!n.activeDropdown)return;const $=["copy-path","open-folder","preview"],K=n.selectedItemDropdownOption,F=$.findIndex(P=>K?.includes(P));if(O.key==="ArrowDown"){O.preventDefault();const P=(F+1)%$.length;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else if(O.key==="ArrowUp"){O.preventDefault();const P=F<=0?$.length-1:F-1;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else O.key==="Enter"?(O.preventDefault(),K&&(K.includes("copy-path")?S(n.item):K.includes("open-folder")?b(n.item):K.includes("preview")&&E(n.item))):O.key==="Escape"&&(O.preventDefault(),i("update:selectedItemDropdownOption",null))};return(O,$)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__result-item",{"vuefinder__search-modal__result-item--selected":t.index===t.selectedIndex}]),title:t.item.basename,onClick:$[9]||($[9]=K=>i("select",t.index))},[g("div",LD,[t.item.type==="dir"?(y(),ne(m(zn),{key:0})):(y(),ne(m(Ko),{key:1}))]),g("div",jD,[g("div",zD,[Ke(L(t.item.basename)+" ",1),f(t.item)?(y(),T("span",ND,L(f(t.item)),1)):ue("",!0)]),g("div",{class:"vuefinder__search-modal__result-path",title:t.item.path,onClick:$[0]||($[0]=Ye(K=>{i("select",t.index),i("togglePathExpansion",t.item.path)},["stop"]))},L(p(t.item.path)?t.item.path:m(n_)(t.item.path)),9,UD)]),g("button",{ref_key:"buttonElementRef",ref:s,class:"vuefinder__search-modal__result-actions",title:m(r)("More actions"),onClick:$[1]||($[1]=K=>{i("selectWithDropdown",t.index),_(t.item.path,K)})},[j(m(o_),{class:"vuefinder__search-modal__result-actions-icon"})],8,VD),(y(),ne(Es,{to:"body"},[t.activeDropdown===t.item.path?(y(),T("div",{key:0,"data-item-dropdown":t.item.path,class:"vuefinder__themer vuefinder__search-modal__item-dropdown vuefinder__search-modal__item-dropdown--visible","data-theme":m(o).theme.current,tabindex:"-1",onClick:$[8]||($[8]=Ye(()=>{},["stop"])),onKeydown:x},[g("div",HD,[g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`copy-path-${t.item.path}`}]),onClick:$[2]||($[2]=K=>{w(`copy-path-${t.item.path}`),S(t.item)}),onFocus:$[3]||($[3]=K=>w(`copy-path-${t.item.path}`))},[j(m(_u),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Copy Path")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`open-folder-${t.item.path}`}]),onClick:$[4]||($[4]=K=>{w(`open-folder-${t.item.path}`),b(t.item)}),onFocus:$[5]||($[5]=K=>w(`open-folder-${t.item.path}`))},[j(m(zn),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Open Containing Folder")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`preview-${t.item.path}`}]),onClick:$[6]||($[6]=K=>{w(`preview-${t.item.path}`),E(t.item)}),onFocus:$[7]||($[7]=K=>w(`preview-${t.item.path}`))},[j(m(Ko),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(m(r)("Preview")),1)],34)])],40,BD)):ue("",!0)]))],10,DD))}}),WD={key:0,class:"vuefinder__search-modal__searching"},KD={class:"vuefinder__search-modal__loading-icon"},YD={key:1,class:"vuefinder__search-modal__no-results"},GD={key:2,class:"vuefinder__search-modal__results-list"},QD={class:"vuefinder__search-modal__results-header"},Ei=60,Nf=5,XD=Ce({name:"SearchResultsList",__name:"SearchResultsList",props:{searchResults:{},isSearching:{type:Boolean},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{},resultsEnter:{type:Boolean}},emits:["selectResultItem","selectResultItemWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=Mn("scrollableContainer"),l=te(()=>i.searchResults.length>0),c=te(()=>i.searchResults.length),u=H(0),d=H(600),h=te(()=>i.searchResults.length*Ei),v=te(()=>{const S=Math.max(0,Math.floor(u.value/Ei)-Nf),b=Math.min(i.searchResults.length,Math.ceil((u.value+d.value)/Ei)+Nf);return{start:S,end:b}}),p=te(()=>{const{start:S,end:b}=v.value;return i.searchResults.slice(S,b).map((E,x)=>({item:E,index:S+x,top:(S+x)*Ei}))}),f=S=>{const b=S.target;u.value=b.scrollTop},_=()=>{a.value&&(d.value=a.value.clientHeight)},C=()=>{if(i.selectedIndex>=0&&a.value){const S=i.selectedIndex*Ei,b=S+Ei,E=a.value.scrollTop,x=a.value.clientHeight,O=E+x;let $=E;S<E?$=S:b>O&&($=b-x),$!==E&&a.value.scrollTo({top:$,behavior:"smooth"})}},w=()=>{a.value&&(a.value.scrollTop=0,u.value=0)};return et(()=>{_(),window.addEventListener("resize",_)}),Ct(()=>{window.removeEventListener("resize",_)}),$e(()=>a.value,()=>{_()}),e({scrollSelectedIntoView:C,resetScroll:w,getContainerHeight:()=>d.value,scrollTop:()=>u.value}),(S,b)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__results",{"vuefinder__search-modal__results--enter":t.resultsEnter}])},[t.isSearching?(y(),T("div",WD,[g("div",KD,[j(m(ia),{class:"vuefinder__search-modal__loading-icon"})]),g("span",null,L(m(s)("Searching...")),1)])):l.value?(y(),T("div",GD,[g("div",QD,[g("span",null,L(m(s)("Found %s results",c.value)),1)]),g("div",{ref_key:"scrollableContainer",ref:a,class:"vuefinder__search-modal__results-scrollable",onScroll:f},[g("div",{class:"vuefinder__search-modal__results-items",style:At({height:`${h.value}px`,position:"relative"})},[(y(!0),T(Me,null,He(p.value,E=>(y(),T("div",{key:E.item.path,style:At({position:"absolute",top:`${E.top}px`,left:"0",width:"100%",height:`${Ei}px`})},[j(qD,{item:E.item,index:E.index,"selected-index":t.selectedIndex,"expanded-paths":t.expandedPaths,"active-dropdown":t.activeDropdown,"selected-item-dropdown-option":t.selectedItemDropdownOption,onSelect:b[0]||(b[0]=x=>o("selectResultItem",x)),onSelectWithDropdown:b[1]||(b[1]=x=>o("selectResultItemWithDropdown",x)),onTogglePathExpansion:b[2]||(b[2]=x=>o("togglePathExpansion",x)),onToggleItemDropdown:b[3]||(b[3]=(x,O)=>o("toggleItemDropdown",x,O)),"onUpdate:selectedItemDropdownOption":b[4]||(b[4]=x=>o("update:selectedItemDropdownOption",x)),onCopyPath:b[5]||(b[5]=x=>o("copyPath",x)),onOpenContainingFolder:b[6]||(b[6]=x=>o("openContainingFolder",x)),onPreview:b[7]||(b[7]=x=>o("preview",x))},null,8,["item","index","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])],4))),128))],4)],544)])):(y(),T("div",YD,[g("span",null,L(m(s)("No results found")),1)]))],2))}}),JD={class:"vuefinder__search-modal"},ZD={class:"vuefinder__search-modal__content"},e5={class:"vuefinder__search-modal__search-bar"},t5={class:"vuefinder__search-modal__search-location"},n5=["title"],i5=["disabled"],o5={key:0,class:"vuefinder__search-modal__folder-selector"},r5={class:"vuefinder__search-modal__folder-selector-content"},s5={key:1,class:"vuefinder__search-modal__instructions"},a5={class:"vuefinder__search-modal__instructions-text"},xu=Ce({name:"ModalSearch",__name:"ModalSearch",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=H(null),s=H(null),a=H(null),l=e_("",300),c=H([]),u=H(!1),d=H(-1),h=H(!1),v=H(!1),p=H(null),f=H("all"),_=H(!1),C=H(`size-${f.value}`),w=H(null),S=H(new Set),b=H(null),E=Oe(o.path),x=A=>{S.value.has(A)?S.value.delete(A):S.value.add(A)},O=(A,Q)=>{Q&&typeof Q.stopPropagation=="function"&&Q.stopPropagation(),b.value===A?b.value=null:b.value=A},$=()=>{b.value=null},K=A=>{try{const Q=A.dir||`${A.storage}://`;e.adapter.open(Q),e.modal.close(),$()}catch{n.error(i("Failed to open containing folder"))}},F=A=>{e.modal.open(ur,{storage:E?.value?.storage??"local",item:A}),$()},P=A=>{d.value=A,$()},N=A=>{d.value=A},I=async A=>{await Yo(A.path),$()};$e(l,async A=>{A.trim()?(await q(A.trim()),d.value=0):(c.value=[],u.value=!1,d.value=-1)}),$e(f,async A=>{C.value=`size-${A}`,l.value.trim()&&!v.value&&(await q(l.value.trim()),d.value=0)}),$e(_,async()=>{l.value.trim()&&!v.value&&(await q(l.value.trim()),d.value=0)});const q=async A=>{if(A){u.value=!0;try{const Q=p.value?.path||E?.value?.path,U=await e.adapter.search({path:Q,filter:A,deep:_.value,size:f.value});c.value=U||[],u.value=!1}catch(Q){n.error(Yt(Q,i("Search failed"))),c.value=[],u.value=!1}}};et(()=>{document.addEventListener("click",M),C.value=`size-${f.value}`});const le=()=>{v.value?(v.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0)):(h.value=!1,v.value=!0)},de=A=>{A&&(p.value=A)},Y=A=>{A&&(de(A),v.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0))};Ct(()=>{document.removeEventListener("click",M),s.value&&s.value.cleanup()});const M=A=>{const Q=A.target;if(h.value&&(Q.closest(".vuefinder__search-modal__dropdown")||(h.value=!1,Ge(()=>{r.value&&r.value.focus()}))),b.value){const U=Q.closest(".vuefinder__search-modal__item-dropdown"),ie=Q.closest(".vuefinder__search-modal__result-item");!U&&!ie&&$()}};return(A,Q)=>(y(),ne(nn,{class:"vuefinder__search-modal-layout"},{default:we(()=>[g("div",JD,[j(fn,{icon:m(Eu),title:m(i)("Search files")},null,8,["icon","title"]),g("div",ZD,[g("div",e5,[j(yD,{ref_key:"searchInputRef",ref:r,modelValue:m(l),"onUpdate:modelValue":Q[0]||(Q[0]=U=>Ss(l)?l.value=U:null),"is-searching":u.value,disabled:v.value},null,8,["modelValue","is-searching","disabled"]),j(RD,{ref_key:"searchOptionsDropdownRef",ref:s,visible:h.value,"onUpdate:visible":Q[1]||(Q[1]=U=>h.value=U),"size-filter":f.value,"onUpdate:sizeFilter":Q[2]||(Q[2]=U=>f.value=U),"selected-option":C.value,"onUpdate:selectedOption":Q[3]||(Q[3]=U=>C.value=U),disabled:v.value},null,8,["visible","size-filter","selected-option","disabled"])]),g("div",{class:"vuefinder__search-modal__options",onClick:Q[7]||(Q[7]=Ye(()=>{},["stop"]))},[g("div",t5,[g("button",{class:Ae(["vuefinder__search-modal__location-btn",{"vuefinder__search-modal__location-btn--open":v.value}]),onClick:Ye(le,["stop"])},[j(m(zn),{class:"vuefinder__search-modal__location-icon"}),g("span",{class:"vuefinder__search-modal__location-text",title:p.value?.path||m(E).path},L(m(n_)(p.value?.path||m(E).path)),9,n5),Q[10]||(Q[10]=g("svg",{class:"vuefinder__search-modal__location-arrow",viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})],-1))],2)]),g("label",{class:"vuefinder__search-modal__deep-search",onClick:Q[6]||(Q[6]=Ye(()=>{},["stop"]))},[it(g("input",{"onUpdate:modelValue":Q[4]||(Q[4]=U=>_.value=U),type:"checkbox",disabled:v.value,class:"vuefinder__search-modal__checkbox",onClick:Q[5]||(Q[5]=Ye(()=>{},["stop"]))},null,8,i5),[[xs,_.value]]),g("span",null,L(m(i)("Include subfolders")),1)])]),v.value?(y(),T("div",o5,[g("div",r5,[j(Su,{modelValue:p.value,"onUpdate:modelValue":[Q[8]||(Q[8]=U=>p.value=U),de],"show-pinned-folders":!0,"current-path":m(E),onSelectAndClose:Y},null,8,["modelValue","current-path"])])])):ue("",!0),!m(l).trim()&&!v.value?(y(),T("div",s5,[g("p",a5,L(m(i)("Start typing to search files. Use options to filter or include subfolders.")),1)])):ue("",!0),m(l).trim()&&!v.value?(y(),ne(XD,{key:2,ref_key:"searchResultsListRef",ref:a,"search-results":c.value,"is-searching":u.value,"selected-index":d.value,"expanded-paths":S.value,"active-dropdown":b.value,"selected-item-dropdown-option":w.value,"results-enter":!0,onSelectResultItem:P,onSelectResultItemWithDropdown:N,onTogglePathExpansion:x,onToggleItemDropdown:O,"onUpdate:selectedItemDropdownOption":Q[9]||(Q[9]=U=>w.value=U),onCopyPath:I,onOpenContainingFolder:K,onPreview:F},null,8,["search-results","is-searching","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])):ue("",!0)])])]),_:1}))}}),l5={props:{on:{type:String,required:!0}},setup(t,{emit:e,slots:n}){const i=je(),o=H(!1),{t:r}=i.i18n;let s=null;const a=()=>{s&&clearTimeout(s),o.value=!0,s=setTimeout(()=>{o.value=!1},2e3)};return et(()=>{i.emitter.on(t.on,a)}),Ct(()=>{s&&clearTimeout(s)}),{shown:o,t:r}}},c5=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},u5={key:1};function d5(t,e,n,i,o,r){return y(),T("div",{class:Ae(["vuefinder__action-message",{"vuefinder__action-message--hidden":!i.shown}])},[t.$slots.default?Ve(t.$slots,"default",{key:0}):(y(),T("span",u5,L(i.t("Saved.")),1))],2)}const Uf=c5(l5,[["render",d5]]),h5=[{name:"silver",displayName:"Silver"},{name:"valorite",displayName:"Valorite"},{name:"midnight",displayName:"Midnight"},{name:"latte",displayName:"Latte"},{name:"rose",displayName:"Rose"},{name:"mythril",displayName:"Mythril"},{name:"lime",displayName:"lime"},{name:"sky",displayName:"Sky"},{name:"ocean",displayName:"Oceanic"},{name:"palenight",displayName:"Palenight"},{name:"arctic",displayName:"Arctic"},{name:"code",displayName:"Code"}],f5={class:"vuefinder__settings-modal__content"},p5={class:"vuefinder__settings-modal__main"},m5={class:"vuefinder__settings-modal__sections"},v5={key:0,class:"vuefinder__settings-modal__section"},g5={for:"theme",class:"vuefinder__settings-modal__label"},_5={class:"vuefinder__settings-modal__input-group"},y5=["value"],b5=["value"],w5={key:1,class:"vuefinder__settings-modal__section"},S5={for:"language",class:"vuefinder__settings-modal__label"},C5={class:"vuefinder__settings-modal__input-group"},E5=["value"],x5={class:"vuefinder__settings-modal__reset-section"},T5={class:"vuefinder__settings-modal__reset-content"},$5={class:"vuefinder__settings-modal__reset-title"},k5={class:"vuefinder__settings-modal__reset-description"},r_=Ce({__name:"ModalSettings",setup(t){const e=je(),{enabled:n}=Tn(),i=e.config,{clearStore:o}=e.storage,{t:r,localeAtom:s}=e.i18n,a=Oe(s),l=te({get:()=>String(a.value||"en"),set:f=>s.set(f||"en")}),c=Oe(i.state),u=te(()=>c.value.theme||"silver"),d=async()=>{i.reset(),o(),localStorage.removeItem("vuefinder_locale"),localStorage.removeItem("vuefinder_translations"),location.reload()},h=f=>{i.set("theme",f),e.emitter.emit("vf-theme-saved")},{i18n:v}=Po("VueFinderOptions"),p=Object.fromEntries(Object.entries({ar:"Arabic (العربيّة)",zhCN:"Chinese-Simplified (简体中文)",zhTW:"Chinese-Traditional (繁體中文)",nl:"Dutch (Nederlands)",en:"English",fr:"French (Français)",de:"German (Deutsch)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",it:"Italian (Italiano)",ja:"Japanese (日本語)",fa:"Persian (فارسی)",pl:"Polish (Polski)",pt:"Portuguese (Português)",ru:"Russian (Pусский)",es:"Spanish (Español)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)"}).filter(([f])=>Object.keys(v).includes(f)));return(f,_)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:_[2]||(_[2]=C=>m(e).modal.close())},L(m(r)("Close")),1)]),default:we(()=>[g("div",f5,[j(fn,{icon:m(t_),title:m(r)("Settings")},null,8,["icon","title"]),g("div",p5,[g("div",m5,[m(n)("theme")?(y(),T("div",v5,[g("label",g5,[Ke(L(m(r)("Theme"))+" ",1),j(Uf,{class:"vuefinder__settings-modal__message",on:"vf-theme-saved"},{default:we(()=>[Ke(L(m(r)("Saved.")),1)]),_:1})]),g("div",_5,[g("select",{id:"theme",value:u.value,class:"vuefinder__settings-modal__select",onChange:_[0]||(_[0]=C=>h(C.target?.value))},[(y(!0),T(Me,null,He(m(h5),C=>(y(),T("option",{key:C.name,value:C.name},L(C.displayName),9,b5))),128))],40,y5)])])):ue("",!0),Object.keys(m(p)).length>1?(y(),T("div",w5,[g("label",S5,[Ke(L(m(r)("Language"))+" ",1),j(Uf,{class:"vuefinder__settings-modal__message",on:"vf-language-saved"},{default:we(()=>[Ke(L(m(r)("Saved.")),1)]),_:1})]),g("div",C5,[it(g("select",{id:"language","onUpdate:modelValue":_[1]||(_[1]=C=>l.value=C),class:"vuefinder__settings-modal__select"},[(y(!0),T(Me,null,He(m(p),(C,w)=>(y(),T("option",{key:w,value:w},L(C),9,E5))),128))],512),[[rl,l.value]])])])):ue("",!0)]),g("div",x5,[g("div",T5,[g("div",$5,L(m(r)("Reset")),1),g("div",k5,L(m(r)("Reset all settings to default")),1)]),g("button",{type:"button",class:"vuefinder__settings-modal__reset-button",onClick:d},L(m(r)("Reset Settings")),1)])])])]),_:1}))}}),Lt={ESCAPE:"Escape",DELETE:"Delete",ENTER:"Enter",BACKSLASH:"Backslash",KEY_A:"KeyA",KEY_E:"KeyE",KEY_F:"KeyF",SPACE:"Space",KEY_C:"KeyC",KEY_X:"KeyX",KEY_V:"KeyV",KEY_S:"KeyS",KEY_R:"KeyR"};function O5(){const t=je(),e=Gt(t),n=t.fs,i=t.config,{enabled:o}=Tn(),r=Oe(n.path),s=Oe(n.selectedItems),a=l=>{if(l.code===Lt.ESCAPE&&(t.modal.close(),t.root.focus()),!t.modal.visible){if(l.metaKey&&l.code===Lt.KEY_R&&!l.shiftKey&&(t.adapter.invalidateListQuery(r.value.path),t.adapter.open(r.value.path),l.preventDefault()),l.metaKey&&l.shiftKey&&l.code===Lt.KEY_R&&o("rename")&&s.value.length===1&&(t.modal.open(ea,{items:s.value}),l.preventDefault()),l.code===Lt.DELETE&&s.value.length!==0&&t.modal.open(Zs,{items:s.value}),l.metaKey&&l.code===Lt.BACKSLASH&&t.modal.open(Gg),l.metaKey&&l.code===Lt.KEY_F&&o("search")&&(t.modal.open(xu),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_E&&(i.toggle("showTreeView"),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_S&&(t.modal.open(r_),l.preventDefault()),l.metaKey&&l.code===Lt.ENTER&&(i.toggle("fullScreen"),t.root.focus()),l.metaKey&&l.code===Lt.KEY_A&&(n.selectAll(t.selectionMode||"multiple",t),l.preventDefault()),l.code===Lt.SPACE&&s.value.length===1&&s.value[0]?.type!=="dir"&&t.modal.open(ur,{storage:n.path.get().storage,item:s.value[0]}),l.metaKey&&l.code===Lt.KEY_C&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("copy",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item copied to clipboard"):t.i18n.t("%s items copied to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_X&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("cut",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item cut to clipboard"):t.i18n.t("%s items cut to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_V&&o("copy")){if(n.getClipboard().items.size===0){e.error(t.i18n.t("No items in clipboard"));return}if(n.getClipboard().path===n.path.get().path){e.error(t.i18n.t("Cannot paste items to the same directory"));return}if(n.getClipboard().type==="cut"){t.modal.open(uo,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}}),n.clearClipboard();return}if(n.getClipboard().type==="copy"){t.modal.open(Cu,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}});return}l.preventDefault()}}};et(async()=>{if(await Ge(),!t.root){console.warn("app.root is not available. Event listeners will not be attached.");return}t.root.addEventListener("keydown",a)}),Cs(()=>{t.root&&t.root.removeEventListener("keydown",a)})}function A5(){const t=H(!1),e=H([]);return{isDraggingExternal:t,externalFiles:e,handleDragEnter:n=>{n.preventDefault(),n.stopPropagation();const i=n.dataTransfer?.items;i&&Array.from(i).some(o=>o.kind==="file")&&(t.value=!0,n.isExternalDrag=!0)},handleDragOver:n=>{t.value&&n.dataTransfer&&(n.dataTransfer.dropEffect="copy",n.preventDefault(),n.stopPropagation())},handleDragLeave:n=>{n.preventDefault();const i=n.currentTarget.getBoundingClientRect(),o=n.clientX,r=n.clientY;(o<i.left||o>i.right||r<i.top||r>i.bottom)&&(t.value=!1)},handleDrop:async n=>{n.preventDefault(),n.stopPropagation(),t.value=!1;const i=n.dataTransfer?.items;if(i){const o=Array.from(i).filter(r=>r.kind==="file");if(o.length>0){e.value=[];for(const r of o){const s=r.webkitGetAsEntry?.();if(s)await gu((a,l)=>{e.value.push({name:l.name,size:l.size,type:l.type,lastModified:new Date(l.lastModified),file:l})},s);else{const a=r.getAsFile();a&&e.value.push({name:a.name,size:a.size,type:a.type,lastModified:new Date(a.lastModified),file:a})}}return e.value}}return[]},clearExternalFiles:()=>{e.value=[]}}}const P5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function R5(t,e){return y(),T("svg",P5,[...e[0]||(e[0]=[g("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1)])])}const s_={render:R5},M5={class:"vuefinder__new-folder-modal__content"},I5={class:"vuefinder__new-folder-modal__form"},F5={class:"vuefinder__new-folder-modal__description"},D5=["placeholder"],Tu=Ce({__name:"ModalNewFolder",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFolder({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create folder")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(m(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(s_),title:m(i)("New Folder")},null,8,["icon","title"]),g("div",M5,[g("div",I5,[g("p",F5,L(m(i)("Create a new folder")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-folder-modal__input",placeholder:m(i)("Folder Name"),type:"text",autofocus:"",onKeyup:ho(a,["enter"])},null,40,D5),[[Xo,s.value]])])])])]),_:1}))}}),L5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function j5(t,e){return y(),T("svg",L5,[...e[0]||(e[0]=[g("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1)])])}const a_={render:j5},z5={class:"vuefinder__new-file-modal__content"},N5={class:"vuefinder__new-file-modal__form"},U5={class:"vuefinder__new-file-modal__description"},V5=["placeholder"],l_=Ce({__name:"ModalNewFile",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFile({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create file")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(m(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(a_),title:m(i)("New File")},null,8,["icon","title"]),g("div",z5,[g("div",N5,[g("p",U5,L(m(i)("Create a new file")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-file-modal__input",placeholder:m(i)("File Name"),type:"text",onKeyup:ho(a,["enter"])},null,40,V5),[[Xo,s.value]])])])])]),_:1}))}}),B5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function H5(t,e){return y(),T("svg",B5,[...e[0]||(e[0]=[g("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1)])])}const c_={render:H5};function ic(t,e=14){const n=`((?=([\\w\\W]{0,${e}}))([\\w\\W]{${e+1},})([\\w\\W]{8,}))`;return t.replace(new RegExp(n),"$2..$4")}const q5={class:"vuefinder__upload-modal__content relative"},W5={class:"vuefinder__upload-modal__target-section"},K5={class:"vuefinder__upload-modal__target-label"},Y5={class:"vuefinder__upload-modal__target-container"},G5={class:"vuefinder__upload-modal__target-path"},Q5={class:"vuefinder__upload-modal__target-storage"},X5={key:0,class:"vuefinder__upload-modal__target-folder"},J5={class:"vuefinder__upload-modal__target-badge"},Z5={class:"vuefinder__upload-modal__drag-hint"},e4={class:"vuefinder__upload-modal__file-list vf-scrollbar"},t4=["textContent"],n4={class:"vuefinder__upload-modal__file-info"},i4={class:"vuefinder__upload-modal__file-name hidden md:block"},o4={class:"vuefinder__upload-modal__file-name md:hidden"},r4={key:0,class:"ml-auto"},s4=["title","disabled","onClick"],a4={key:0,class:"py-2"},l4=["aria-expanded"],c4={key:0,class:"vuefinder__upload-actions__menu absolute right-0 bottom-full left-0 mb-2"},u4=["disabled"],d4=["aria-expanded"],h4={key:0,class:"vuefinder__upload-actions__menu"},$u=Ce({__name:"ModalUpload",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=H(o.value),s=H(!1),a=()=>{const Y=r.value.path;if(!Y)return{storage:"local",path:""};if(Y.endsWith("://"))return{storage:Y.replace("://",""),path:""};const M=Y.split("://");return{storage:M[0]||"local",path:M[1]||""}},l=Y=>{Y&&(r.value=Y)},c=Y=>{Y&&(r.value=Y,s.value=!1)},{container:u,internalFileInput:d,internalFolderInput:h,pickFiles:v,queue:p,message:f,uploading:_,hasFilesInDropArea:C,definitions:w,openFileSelector:S,upload:b,cancel:E,remove:x,clear:O,close:$,getClassNameForEntry:K,getIconForEntry:F,addExternalFiles:P}=Jg(e.customUploader),N=()=>{b(r.value)};et(()=>{e.emitter.on("vf-external-files-dropped",Y=>{P(Y)})}),Ct(()=>{e.emitter.off("vf-external-files-dropped")});const I=H(!1),q=H(null),le=H(null),de=Y=>{if(!I.value)return;const M=Y.target,A=q.value?.contains(M)??!1,Q=le.value?.contains(M)??!1;!A&&!Q&&(I.value=!1)};return et(()=>document.addEventListener("click",de)),Ct(()=>document.removeEventListener("click",de)),(Y,M)=>(y(),ne(nn,{"show-drag-overlay":m(C),"drag-overlay-text":m(n)("Drag and drop the files/folders to here.")},{buttons:we(()=>[g("div",{ref_key:"actionsMenuMobileRef",ref:q,class:"relative mb-2 w-full sm:hidden"},[g("div",{class:Ae(["vuefinder__upload-actions","vuefinder__upload-actions--block",I.value?"vuefinder__upload-actions--ring":""])},[g("button",{type:"button",class:"vuefinder__upload-actions__main",onClick:M[3]||(M[3]=A=>m(S)())},L(m(n)("Select Files")),1),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":I.value?"true":"false",onClick:M[4]||(M[4]=Ye(A=>I.value=!I.value,["stop"]))},[...M[17]||(M[17]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,l4)],2),I.value?(y(),T("div",c4,[g("div",{class:"vuefinder__upload-actions__item",onClick:M[5]||(M[5]=A=>{m(S)(),I.value=!1})},L(m(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:M[6]||(M[6]=A=>{m(h)?.click(),I.value=!1})},L(m(n)("Select Folders")),1),M[18]||(M[18]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:M[7]||(M[7]=A=>m(_)?null:(m(O)(!1),I.value=!1))},L(m(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:M[8]||(M[8]=A=>m(_)?null:(m(O)(!0),I.value=!1))},L(m(n)("Clear only successful")),3)])):ue("",!0)],512),g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:m(_)||!m(p).length,onClick:Ye(N,["prevent"])},L(m(n)("Upload")),9,u4),m(_)?(y(),T("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:M[9]||(M[9]=Ye((...A)=>m(E)&&m(E)(...A),["prevent"]))},L(m(n)("Cancel")),1)):(y(),T("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:M[10]||(M[10]=Ye((...A)=>m($)&&m($)(...A),["prevent"]))},L(m(n)("Close")),1)),g("div",{ref_key:"actionsMenuDesktopRef",ref:le,class:"relative mr-auto hidden sm:block"},[g("div",{class:Ae(["vuefinder__upload-actions",I.value?"vuefinder__upload-actions--ring":""])},[g("button",{ref_key:"pickFiles",ref:v,type:"button",class:"vuefinder__upload-actions__main"},L(m(n)("Select Files")),513),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":I.value?"true":"false",onClick:M[11]||(M[11]=Ye(A=>I.value=!I.value,["stop"]))},[...M[19]||(M[19]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,d4)],2),I.value?(y(),T("div",h4,[g("div",{class:"vuefinder__upload-actions__item",onClick:M[12]||(M[12]=A=>{m(S)(),I.value=!1})},L(m(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:M[13]||(M[13]=A=>{m(h)?.click(),I.value=!1})},L(m(n)("Select Folders")),1),M[20]||(M[20]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:M[14]||(M[14]=A=>m(_)?null:(m(O)(!1),I.value=!1))},L(m(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",m(_)?"disabled":""]),onClick:M[15]||(M[15]=A=>m(_)?null:(m(O)(!0),I.value=!1))},L(m(n)("Clear only successful")),3)])):ue("",!0)],512)]),default:we(()=>[g("div",null,[j(fn,{icon:m(c_),title:m(n)("Upload Files")},null,8,["icon","title"]),g("div",q5,[g("div",W5,[g("div",K5,L(m(n)("Target Directory")),1),g("div",Y5,[g("div",{class:"vuefinder__upload-modal__target-display",onClick:M[0]||(M[0]=A=>s.value=!s.value)},[g("div",G5,[g("span",Q5,L(a().storage)+"://",1),a().path?(y(),T("span",X5,L(a().path),1)):ue("",!0)]),g("span",J5,L(m(n)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__upload-modal__tree-selector",s.value?"vuefinder__upload-modal__tree-selector--expanded":"vuefinder__upload-modal__tree-selector--collapsed"])},[j(Su,{modelValue:r.value,"onUpdate:modelValue":[M[1]||(M[1]=A=>r.value=A),l],"show-pinned-folders":!0,onSelectAndClose:c},null,8,["modelValue"])],2)]),g("div",Z5,L(m(n)("You can drag & drop files anywhere while this modal is open.")),1),g("div",{ref_key:"container",ref:u,class:"hidden"},null,512),g("div",e4,[(y(!0),T(Me,null,He(m(p),A=>(y(),T("div",{key:A.id,class:"vuefinder__upload-modal__file-entry"},[g("span",{class:Ae(["vuefinder__upload-modal__file-icon",m(K)(A)])},[g("span",{class:"vuefinder__upload-modal__file-icon-text",textContent:L(m(F)(A))},null,8,t4)],2),g("div",n4,[g("div",i4,L(m(ic)(A.name,40))+" ("+L(A.size)+") ",1),g("div",o4,L(m(ic)(A.name,16))+" ("+L(A.size)+") ",1),g("div",{class:Ae(["vuefinder__upload-modal__file-status",m(K)(A)])},[Ke(L(A.statusName)+" ",1),A.status===m(w).QUEUE_ENTRY_STATUS.UPLOADING?(y(),T("b",r4,L(A.percent),1)):ue("",!0)],2)]),g("button",{type:"button",class:Ae(["vuefinder__upload-modal__file-remove",m(_)?"disabled":""]),title:m(n)("Delete"),disabled:m(_),onClick:Q=>m(x)(A)},[...M[16]||(M[16]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__upload-modal__file-remove-icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,s4)]))),128)),m(p).length?ue("",!0):(y(),T("div",a4,L(m(n)("No files selected!")),1))]),m(f).length?(y(),ne(nc,{key:0,error:"",onHidden:M[2]||(M[2]=A=>f.value="")},{default:we(()=>[Ke(L(m(f)),1)]),_:1})):ue("",!0)])]),g("input",{ref_key:"internalFileInput",ref:d,type:"file",multiple:"",class:"hidden"},null,512),g("input",{ref_key:"internalFolderInput",ref:h,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1},8,["show-drag-overlay","drag-overlay-text"]))}}),f4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function p4(t,e){return y(),T("svg",f4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const u_={render:p4},m4={class:"vuefinder__unarchive-modal__content"},v4={class:"vuefinder__unarchive-modal__items"},g4={key:0,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_4={key:1,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--file",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},y4={class:"vuefinder__unarchive-modal__item-name"},b4={class:"vuefinder__unarchive-modal__info"},ku=Ce({__name:"ModalUnarchive",setup(t){const e=je(),n=Gt(e),i=e.fs,o=Oe(i.path),{t:r}=e.i18n,s=H(e.modal.data.items[0]),a=H([]),l=()=>{e.adapter.unarchive({item:s.value.path,path:o.value.path}).then(c=>{n.success(r("The file unarchived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,r("Failed to unarchive")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(r)("Unarchive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[0]||(u[0]=d=>m(e).modal.close())},L(m(r)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(u_),title:m(r)("Unarchive")},null,8,["icon","title"]),g("div",m4,[g("div",v4,[(y(!0),T(Me,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__unarchive-modal__item"},[d.type==="dir"?(y(),T("svg",g4,[...u[1]||(u[1]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",_4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",y4,L(d.basename),1)]))),128)),g("p",b4,L(m(r)("The archive will be unarchived at"))+" ("+L(m(o).path)+") ",1)])])])]),_:1}))}}),w4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function S4(t,e){return y(),T("svg",w4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const d_={render:S4},C4={class:"vuefinder__archive-modal__content"},E4={class:"vuefinder__archive-modal__form"},x4={class:"vuefinder__archive-modal__files vf-scrollbar"},T4={key:0,class:"vuefinder__archive-modal__icon vuefinder__archive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},$4={key:1,class:"vuefinder__archive-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},k4={class:"vuefinder__archive-modal__file-name"},O4=["placeholder"],Ou=Ce({__name:"ModalArchive",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=H(e.modal.data.items),l=()=>{a.value.length&&e.adapter.archive({path:r.value.path,items:a.value.map(({path:c,type:u})=>({path:c,type:u})),name:s.value}).then(c=>{n.success(i("The file(s) archived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to archive files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(m(i)("Archive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>m(e).modal.close())},L(m(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(fn,{icon:m(d_),title:m(i)("Archive the files")},null,8,["icon","title"]),g("div",C4,[g("div",E4,[g("div",x4,[(y(!0),T(Me,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__archive-modal__file"},[d.type==="dir"?(y(),T("svg",T4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",$4,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",k4,L(d.basename),1)]))),128))]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>s.value=d),class:"vuefinder__archive-modal__input",placeholder:m(i)("Archive name. (.zip file will be created)"),type:"text",onKeyup:ho(l,["enter"])},null,40,O4),[[Xo,s.value]])])])])]),_:1}))}}),A4={class:"vuefinder__about-modal__content"},P4={class:"vuefinder__about-modal__main"},R4={class:"vuefinder__about-modal__shortcuts"},M4={class:"vuefinder__about-modal__shortcut"},I4={key:0,class:"vuefinder__about-modal__shortcut"},F4={key:1,class:"vuefinder__about-modal__shortcut"},D4={class:"vuefinder__about-modal__shortcut"},L4={class:"vuefinder__about-modal__shortcut"},j4={key:2,class:"vuefinder__about-modal__shortcut"},z4={key:3,class:"vuefinder__about-modal__shortcut"},N4={key:4,class:"vuefinder__about-modal__shortcut"},U4={key:5,class:"vuefinder__about-modal__shortcut"},V4={class:"vuefinder__about-modal__shortcut"},B4={class:"vuefinder__about-modal__shortcut"},H4={key:6,class:"vuefinder__about-modal__shortcut"},q4={key:7,class:"vuefinder__about-modal__shortcut"},W4=Ce({__name:"ModalShortcuts",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n;return(o,r)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:r[0]||(r[0]=s=>m(e).modal.close())},L(m(i)("Close")),1)]),default:we(()=>[g("div",A4,[j(fn,{icon:m(Yg),title:m(i)("Shortcuts")},null,8,["icon","title"]),g("div",P4,[g("div",R4,[g("div",M4,[g("div",null,L(m(i)("Refresh")),1),r[1]||(r[1]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"R")],-1))]),m(n)("rename")?(y(),T("div",I4,[g("div",null,L(m(i)("Rename")),1),r[2]||(r[2]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Shift"),Ke(" + "),g("kbd",null,"R")],-1))])):ue("",!0),m(n)("delete")?(y(),T("div",F4,[g("div",null,L(m(i)("Delete")),1),r[3]||(r[3]=g("kbd",null,"Del",-1))])):ue("",!0),g("div",D4,[g("div",null,L(m(i)("Escape")),1),r[4]||(r[4]=g("kbd",null,"Esc",-1))]),g("div",L4,[g("div",null,L(m(i)("Select All")),1),r[5]||(r[5]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"A")],-1))]),m(n)("copy")?(y(),T("div",j4,[g("div",null,L(m(i)("Cut")),1),r[6]||(r[6]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"X")],-1))])):ue("",!0),m(n)("copy")?(y(),T("div",z4,[g("div",null,L(m(i)("Copy")),1),r[7]||(r[7]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"C")],-1))])):ue("",!0),m(n)("copy")?(y(),T("div",N4,[g("div",null,L(m(i)("Paste")),1),r[8]||(r[8]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"V")],-1))])):ue("",!0),m(n)("search")?(y(),T("div",U4,[g("div",null,L(m(i)("Search")),1),r[9]||(r[9]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"F")],-1))])):ue("",!0),g("div",V4,[g("div",null,L(m(i)("Toggle Sidebar")),1),r[10]||(r[10]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"E")],-1))]),g("div",B4,[g("div",null,L(m(i)("Open Settings")),1),r[11]||(r[11]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"S")],-1))]),m(n)("fullscreen")?(y(),T("div",H4,[g("div",null,L(m(i)("Toggle Full Screen")),1),r[12]||(r[12]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Enter")],-1))])):ue("",!0),m(n)("preview")?(y(),T("div",q4,[g("div",null,L(m(i)("Preview")),1),r[13]||(r[13]=g("kbd",null,"Space",-1))])):ue("",!0)])])])]),_:1}))}}),K4={class:"vuefinder__menubar__container"},Y4=["onClick","onMouseenter"],G4={class:"vuefinder__menubar__label"},Q4=["onMouseenter"],X4=["onClick"],J4={key:0,class:"vuefinder__menubar__dropdown__label"},Z4={key:1,class:"vuefinder__menubar__dropdown__checkmark"},eL=Ce({__name:"MenuBar",setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e?.i18n||{t:S=>S},r=e?.fs,s=e?.config,a=Oe(s.state),l=Oe(r.selectedItems),c=Oe(r?.storages||[]),u=H(null),d=H(!1),h=te(()=>window.opener!==null||window.name!==""||window.history.length<=1),v=te(()=>[{id:"file",label:o("File"),items:[{id:"new-folder",label:o("New Folder"),action:()=>e?.modal?.open(Tu,{items:l.value}),hidden:()=>!i("newfolder")},{id:"new-file",label:o("New File"),action:()=>e?.modal?.open(l_,{items:l.value}),hidden:()=>!i("newfile")},{type:"separator",hidden:()=>!i("newfolder")&&!i("newfile")||!i("upload")},{id:"upload",label:o("Upload"),action:()=>e?.modal?.open($u,{items:l.value}),hidden:()=>!i("upload")},{type:"separator",hidden:()=>!i("search")},{id:"search",label:o("Search"),action:()=>e.modal.open(xu),hidden:()=>!i("search")},{type:"separator",hidden:()=>!i("archive")&&!i("unarchive")},{id:"archive",label:o("Archive"),action:()=>{l.value.length>0&&e?.modal?.open(Ou,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("archive")},{id:"unarchive",label:o("Unarchive"),action:()=>{l.value.length===1&&l.value[0]?.mime_type==="application/zip"&&e?.modal?.open(ku,{items:l.value})},enabled:()=>l.value.length===1&&l.value[0]?.mime_type==="application/zip",hidden:()=>!i("unarchive")},{type:"separator",hidden:()=>!i("preview")},{id:"preview",label:o("Preview"),action:()=>{l.value.length===1&&l.value[0]?.type!=="dir"&&e?.modal?.open(ur,{storage:r?.path?.get()?.storage,item:l.value[0]})},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir",hidden:()=>!i("preview")},...h.value?[{type:"separator"},{id:"exit",label:o("Exit"),action:()=>{try{window.close()}catch{}},enabled:()=>!0}]:[]]},{id:"edit",label:o("Edit"),items:[...e?.selectionMode==="multiple"?[{id:"select-all",label:o("Select All"),action:()=>r?.selectAll(e?.selectionMode||"multiple",e),enabled:()=>!0},{id:"deselect",label:o("Deselect All"),action:()=>r?.clearSelection(),enabled:()=>l.value.length>0},{type:"separator"}]:[],...i("copy")?[{id:"cut",label:o("Cut"),action:()=>{l.value.length>0&&r?.setClipboard("cut",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"copy",label:o("Copy"),action:()=>{l.value.length>0&&r?.setClipboard("copy",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"paste",label:o("Paste"),action:()=>{const S=r?.getClipboard();S?.items?.size>0&&e?.modal?.open(S.type==="cut"?uo:Cu,{items:{from:Array.from(S.items),to:r?.path?.get()}})},enabled:()=>r?.getClipboard()?.items?.size>0}]:[],...i("move")?[{id:"move",label:o("Move files"),action:()=>{if(l.value.length>0){const S=e?.fs,b={storage:S?.path?.get()?.storage||"",path:S?.path?.get()?.path||"",type:"dir"};e?.modal?.open(uo,{items:{from:l.value,to:b}})}},enabled:()=>l.value.length>0},{type:"separator"}]:[],{id:"copy-path",label:o("Copy Path"),action:async()=>{if(l.value.length===1){const S=l.value[0];await Yo(S.path)}else{const S=r?.path?.get();S?.path&&await Yo(S.path)}},enabled:()=>!0},{id:"copy-download-url",label:o("Copy Download URL"),action:async()=>{if(l.value.length===1){const S=l.value[0];r?.path?.get()?.storage;const b=e?.adapter?.getDownloadUrl({path:S.path});b&&await MD(b)}},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir"},{type:"separator",hidden:()=>!i("rename")&&!i("delete")},{id:"rename",label:o("Rename"),action:()=>{l.value.length===1&&e?.modal?.open(ea,{items:l.value})},enabled:()=>l.value.length===1,hidden:()=>!i("rename")},{id:"delete",label:o("Delete"),action:()=>{l.value.length>0&&e?.modal?.open(Zs,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("delete")}]},{id:"view",label:o("View"),items:[{id:"refresh",label:o("Refresh"),action:()=>{e.adapter.invalidateListQuery(r.path.get().path),e.adapter.open(r.path.get().path)},enabled:()=>!0},{type:"separator"},{id:"grid-view",label:o("Grid View"),action:()=>s?.set("view","grid"),enabled:()=>!0,checked:()=>a.value?.view==="grid"},{id:"list-view",label:o("List View"),action:()=>s?.set("view","list"),enabled:()=>!0,checked:()=>a.value?.view==="list"},{type:"separator"},{id:"tree-view",label:o("Tree View"),action:()=>s?.toggle("showTreeView"),enabled:()=>!0,checked:()=>a.value?.showTreeView},{id:"thumbnails",label:o("Show Thumbnails"),action:()=>s?.toggle("showThumbnails"),enabled:()=>!0,checked:()=>a.value?.showThumbnails},{id:"show-hidden-files",label:o("Show Hidden Files"),action:()=>s?.toggle("showHiddenFiles"),enabled:()=>!0,checked:()=>a.value?.showHiddenFiles},{type:"separator",hidden:()=>!i("fullscreen")},{id:"fullscreen",label:o("Full Screen"),action:()=>s?.toggle("fullScreen"),enabled:()=>i("fullscreen"),checked:()=>a.value?.fullScreen,hidden:()=>!i("fullscreen")},{type:"separator"},{id:"persist-path",label:o("Persist Path"),action:()=>{s?.toggle("persist"),e.emitter.emit("vf-persist-path-saved")},enabled:()=>!0,checked:()=>a.value?.persist},{id:"metric-units",label:o("Metric Units"),action:()=>{s?.toggle("metricUnits"),e.filesize=s?.get("metricUnits")?qg:vu,e.emitter.emit("vf-metric-units-saved")},enabled:()=>!0,checked:()=>a.value?.metricUnits}]},{id:"go",label:o("Go"),items:[...i("history")?[{id:"forward",label:o("Forward"),action:()=>{r?.goForward();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoForward?.get()??!1},{id:"back",label:o("Back"),action:()=>{r?.goBack();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoBack?.get()??!1}]:[],{id:"open-containing-folder",label:o("Open containing folder"),action:()=>{const S=r?.path?.get();if(S?.breadcrumb&&S.breadcrumb.length>1){const b=S.breadcrumb[S.breadcrumb.length-2]?.path??`${S.storage}://`;e?.adapter.open(b)}},enabled:()=>{const S=r?.path?.get();return S?.breadcrumb&&S.breadcrumb.length>1}},{type:"separator"},...(c.value||[]).map(S=>({id:`storage-${S}`,label:S,action:()=>{const b=`${S}://`;e?.adapter.open(b)},enabled:()=>!0})),{type:"separator"},{id:"go-to-folder",label:o("Go to Folder"),action:async()=>{const S=prompt(o("Enter folder path:"));if(S){if(!S.includes("://")){alert(o("Invalid path format. Path must be in format: storage://path/to/folder"));return}const b=S.indexOf("://"),E=S.slice(0,b);if(!c.value||!c.value.includes(E)){alert(o('Invalid storage. Storage "%s" is not available.',E));return}try{await e?.adapter.open(S)}catch(x){const O=Yt(x,o("Failed to navigate to folder"));n.error(O),e.fs.setLoading(!1)}}},enabled:()=>!0}]},{id:"help",label:o("Help"),items:[{id:"settings",label:o("Settings"),action:()=>e?.modal?.open(r_),enabled:()=>!0},{id:"shortcuts",label:o("Shortcuts"),action:()=>e?.modal?.open(W4),enabled:()=>!0},{id:"about",label:o("About"),action:()=>e?.modal?.open(Gg),enabled:()=>!0}]}]),p=S=>{u.value===S?_():(u.value=S,d.value=!0)},f=S=>{d.value&&(u.value=S)},_=()=>{u.value=null,d.value=!1},C=S=>{_(),S()},w=S=>{S.target.closest(".vuefinder__menubar")||_()};return et(()=>{document.addEventListener("click",w)}),Ct(()=>{document.removeEventListener("click",w)}),(S,b)=>(y(),T("div",{class:"vuefinder__menubar",onClick:b[0]||(b[0]=Ye(()=>{},["stop"]))},[g("div",K4,[(y(!0),T(Me,null,He(v.value,E=>(y(),T("div",{key:E.id,class:Ae(["vuefinder__menubar__item",{"vuefinder__menubar__item--active":u.value===E.id}]),onClick:x=>p(E.id),onMouseenter:x=>f(E.id)},[g("span",G4,L(E.label),1),u.value===E.id?(y(),T("div",{key:0,class:"vuefinder__menubar__dropdown",onMouseenter:x=>f(E.id)},[(y(!0),T(Me,null,He(E.items,x=>(y(),T("div",{key:x.id||x.type,class:Ae(["vuefinder__menubar__dropdown__item",{"vuefinder__menubar__dropdown__item--separator":x.type==="separator","vuefinder__menubar__dropdown__item--disabled":x.enabled&&!x.enabled(),"vuefinder__menubar__dropdown__item--checked":x.checked&&x.checked(),"vuefinder__menubar__dropdown__item--hidden":x.hidden&&x.hidden()}]),onClick:Ye(O=>x.type!=="separator"&&x.enabled&&x.enabled()?C(x.action):null,["stop"])},[x.type!=="separator"?(y(),T("span",J4,L(x.label),1)):ue("",!0),x.checked&&x.checked()?(y(),T("span",Z4," ✓ ")):ue("",!0)],10,X4))),128))],40,Q4)):ue("",!0)],42,Y4))),128))])]))}}),tL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function nL(t,e){return y(),T("svg",tL,[...e[0]||(e[0]=[g("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1)])])}const iL={render:nL},oL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function rL(t,e){return y(),T("svg",oL,[...e[0]||(e[0]=[g("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1)])])}const sL={render:rL},aL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function lL(t,e){return y(),T("svg",aL,[...e[0]||(e[0]=[g("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1)])])}const cL={render:lL},uL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function dL(t,e){return y(),T("svg",uL,[...e[0]||(e[0]=[g("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1)])])}const hL={render:dL},fL={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function pL(t,e){return y(),T("svg",fL,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586z"},null,-1)])])}const mL={render:pL},vL={class:"vuefinder__toolbar"},gL={class:"vuefinder__toolbar__actions"},_L=["title"],yL=["title"],bL=["title"],wL=["title"],SL=["title"],CL=["title"],EL=["title"],xL={class:"vuefinder__toolbar__controls"},TL=["title"],$L={class:"vuefinder__toolbar__control vuefinder__toolbar__dropdown-container"},kL=["title"],OL={class:"relative"},AL={key:0,class:"vuefinder__toolbar__filter-indicator"},PL={key:0,class:"vuefinder__toolbar__dropdown"},RL={class:"vuefinder__toolbar__dropdown-content"},ML={class:"vuefinder__toolbar__dropdown-section"},IL={class:"vuefinder__toolbar__dropdown-label"},FL={class:"vuefinder__toolbar__dropdown-row"},DL={value:"name"},LL={value:"size"},jL={value:"modified"},zL={value:""},NL={value:"asc"},UL={value:"desc"},VL={class:"vuefinder__toolbar__dropdown-section"},BL={class:"vuefinder__toolbar__dropdown-label"},HL={class:"vuefinder__toolbar__dropdown-options"},qL={class:"vuefinder__toolbar__dropdown-option"},WL={class:"vuefinder__toolbar__option-text"},KL={class:"vuefinder__toolbar__dropdown-option"},YL={class:"vuefinder__toolbar__option-text"},GL={class:"vuefinder__toolbar__dropdown-option"},QL={class:"vuefinder__toolbar__option-text"},XL={class:"vuefinder__toolbar__dropdown-toggle"},JL={for:"showHidden",class:"vuefinder__toolbar__toggle-label"},ZL={class:"vuefinder__toolbar__dropdown-reset"},e3=["title"],t3=["title"],n3=Ce({name:"VfToolbar",__name:"Toolbar",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.selectedItems),l=Oe(o.sort),c=Oe(o.filter);$e(()=>s.value.fullScreen,()=>{const _=document.querySelector("body");_&&(_.style.overflow=s.value.fullScreen?"hidden":"")},{immediate:!0});const u=H(!1),d=_=>{_.target.closest(".vuefinder__toolbar__dropdown-container")||(u.value=!1)};et(()=>{const _=document.querySelector("body");_&&s.value.fullScreen&&setTimeout(()=>_.style.overflow="hidden"),document.addEventListener("click",d)}),Ct(()=>{document.removeEventListener("click",d)});const h=H({sortBy:"name",sortOrder:"",filterKind:"all",showHidden:s.value.showHiddenFiles});$e(()=>h.value.sortBy,_=>{if(!h.value.sortOrder){o.clearSort();return}_==="name"?o.setSort("basename",h.value.sortOrder):_==="size"?o.setSort("file_size",h.value.sortOrder):_==="modified"&&o.setSort("last_modified",h.value.sortOrder)}),$e(()=>h.value.sortOrder,_=>{if(!_){o.clearSort();return}h.value.sortBy==="name"?o.setSort("basename",_):h.value.sortBy==="size"?o.setSort("file_size",_):h.value.sortBy==="modified"&&o.setSort("last_modified",_)}),$e(l,_=>{_.active?(_.column==="basename"?h.value.sortBy="name":_.column==="file_size"?h.value.sortBy="size":_.column==="last_modified"&&(h.value.sortBy="modified"),h.value.sortOrder=_.order):h.value.sortOrder=""},{immediate:!0}),$e(()=>h.value.filterKind,_=>{o.setFilter(_,s.value.showHiddenFiles)}),$e(()=>h.value.showHidden,_=>{r.set("showHiddenFiles",_),o.setFilter(h.value.filterKind,_)}),$e(c,_=>{h.value.filterKind=_.kind},{immediate:!0}),$e(()=>s.value.showHiddenFiles,_=>{h.value.showHidden=_,o.setFilter(h.value.filterKind,_)},{immediate:!0});const v=()=>r.set("view",s.value.view==="grid"?"list":"grid"),p=te(()=>c.value.kind!=="all"||!s.value.showHiddenFiles||l.value.active),f=()=>{h.value={sortBy:"name",sortOrder:"",filterKind:"all",showHidden:!0},r.set("showHiddenFiles",!0),o.clearSort(),o.clearFilter()};return(_,C)=>(y(),T("div",vL,[g("div",gL,[m(n)("newfolder")?(y(),T("div",{key:0,class:"mx-1.5",title:m(i)("New Folder"),onClick:C[0]||(C[0]=w=>m(e).modal.open(Tu,{items:m(a)}))},[j(m(s_))],8,_L)):ue("",!0),m(n)("newfile")?(y(),T("div",{key:1,class:"mx-1.5",title:m(i)("New File"),onClick:C[1]||(C[1]=w=>m(e).modal.open(l_,{items:m(a)}))},[j(m(a_))],8,yL)):ue("",!0),m(n)("rename")?(y(),T("div",{key:2,class:"mx-1.5",title:m(i)("Rename"),onClick:C[2]||(C[2]=w=>m(a).length!==1||m(e).modal.open(ea,{items:m(a)}))},[j(m(Xg),{class:Ae(m(a).length===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,bL)):ue("",!0),m(n)("delete")?(y(),T("div",{key:3,class:"mx-1.5",title:m(i)("Delete"),onClick:C[3]||(C[3]=w=>!m(a).length||m(e).modal.open(Zs,{items:m(a)}))},[j(m(Qg),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,wL)):ue("",!0),m(n)("upload")?(y(),T("div",{key:4,class:"mx-1.5",title:m(i)("Upload"),onClick:C[4]||(C[4]=w=>m(e).modal.open($u,{items:m(a)}))},[j(m(c_))],8,SL)):ue("",!0),m(n)("unarchive")&&m(a).length===1&&m(a)[0].mime_type==="application/zip"?(y(),T("div",{key:5,class:"mx-1.5",title:m(i)("Unarchive"),onClick:C[5]||(C[5]=w=>!m(a).length||m(e).modal.open(ku,{items:m(a)}))},[j(m(u_),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,CL)):ue("",!0),m(n)("archive")?(y(),T("div",{key:6,class:"mx-1.5",title:m(i)("Archive"),onClick:C[6]||(C[6]=w=>!m(a).length||m(e).modal.open(Ou,{items:m(a)}))},[j(m(d_),{class:Ae(m(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,EL)):ue("",!0)]),g("div",xL,[m(n)("search")?(y(),T("div",{key:0,class:"mx-1.5",title:m(i)("Search Files"),onClick:C[7]||(C[7]=w=>m(e).modal.open(xu))},[j(m(Eu),{class:"vf-toolbar-icon text-(--vf-bg-primary)"})],8,TL)):ue("",!0),g("div",$L,[g("div",{title:m(i)("Filter"),class:"vuefinder__toolbar__dropdown-trigger",onClick:C[8]||(C[8]=w=>u.value=!u.value)},[g("div",OL,[j(m(mL),{class:"vf-toolbar-icon vuefinder__toolbar__icon h-6 w-6"}),p.value?(y(),T("div",AL)):ue("",!0)])],8,kL),u.value?(y(),T("div",PL,[g("div",RL,[g("div",ML,[g("div",IL,L(m(i)("Sorting")),1),g("div",FL,[it(g("select",{"onUpdate:modelValue":C[9]||(C[9]=w=>h.value.sortBy=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",DL,L(m(i)("Name")),1),g("option",LL,L(m(i)("Size")),1),g("option",jL,L(m(i)("Date")),1)],512),[[rl,h.value.sortBy]]),it(g("select",{"onUpdate:modelValue":C[10]||(C[10]=w=>h.value.sortOrder=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",zL,L(m(i)("None")),1),g("option",NL,L(m(i)("Asc")),1),g("option",UL,L(m(i)("Desc")),1)],512),[[rl,h.value.sortOrder]])])]),g("div",VL,[g("div",BL,L(m(i)("Show")),1),g("div",HL,[g("label",qL,[it(g("input",{"onUpdate:modelValue":C[11]||(C[11]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"all",class:"vuefinder__toolbar__radio"},null,512),[[ra,h.value.filterKind]]),g("span",WL,L(m(i)("All items")),1)]),g("label",KL,[it(g("input",{"onUpdate:modelValue":C[12]||(C[12]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"files",class:"vuefinder__toolbar__radio"},null,512),[[ra,h.value.filterKind]]),g("span",YL,L(m(i)("Files only")),1)]),g("label",GL,[it(g("input",{"onUpdate:modelValue":C[13]||(C[13]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"folders",class:"vuefinder__toolbar__radio"},null,512),[[ra,h.value.filterKind]]),g("span",QL,L(m(i)("Folders only")),1)])])]),g("div",XL,[g("label",JL,L(m(i)("Show hidden files")),1),it(g("input",{id:"showHidden","onUpdate:modelValue":C[14]||(C[14]=w=>h.value.showHidden=w),type:"checkbox",class:"vuefinder__toolbar__checkbox"},null,512),[[xs,h.value.showHidden]])]),g("div",ZL,[g("button",{class:"vuefinder__toolbar__reset-button",onClick:f},L(m(i)("Reset")),1)])])])):ue("",!0)]),m(n)("fullscreen")?(y(),T("div",{key:1,class:"mx-1.5",title:m(i)("Toggle Full Screen"),onClick:C[15]||(C[15]=w=>m(r).toggle("fullScreen"))},[m(s).fullScreen?(y(),ne(m(sL),{key:0,class:"vf-toolbar-icon"})):(y(),ne(m(iL),{key:1,class:"vf-toolbar-icon"}))],8,e3)):ue("",!0),g("div",{class:"mx-1.5",title:m(i)("Change View"),onClick:C[16]||(C[16]=w=>v())},[m(s).view==="grid"?(y(),ne(m(cL),{key:0,class:"vf-toolbar-icon"})):ue("",!0),m(s).view==="list"?(y(),ne(m(hL),{key:1,class:"vf-toolbar-icon"})):ue("",!0)],8,t3)])]))}}),i3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"vuefinder__breadcrumb__refresh-icon",viewBox:"-40 -40 580 580"};function o3(t,e){return y(),T("svg",i3,[...e[0]||(e[0]=[g("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1)])])}const r3={render:o3},s3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"};function a3(t,e){return y(),T("svg",s3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1)])])}const l3={render:a3},c3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"vuefinder__breadcrumb__close-icon",viewBox:"0 0 24 24"};function u3(t,e){return y(),T("svg",c3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const d3={render:u3},h3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function f3(t,e){return y(),T("svg",h3,[...e[0]||(e[0]=[g("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1)])])}const p3={render:f3},m3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"};function v3(t,e){return y(),T("svg",m3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const g3={render:v3},_3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function y3(t,e){return y(),T("svg",_3,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M9 6h11M12 12h8M15 18h5M5 6v.01M8 12v.01M11 18v.01"},null,-1)])])}const b3={render:y3},w3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function S3(t,e){return y(),T("svg",w3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0-4-4m4 4-4 4m0 6H4m0 0 4 4m-4-4 4-4"},null,-1)])])}const C3={render:S3};function dr(t,e=[]){const n="vfDragEnterCounter",i=t.fs,o=Oe(i.selectedItems);function r(d,h){return!!(!d||d.type!=="dir"||d.path.startsWith(h)||o.value.some(v=>v.path===h?!1:!!d.path.startsWith(v.path)))}function s(d,h){if(d.isExternalDrag)return;if(!(t.features?.move??!1)){d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none");return}d.preventDefault();const v=i.getDraggedItem();r(h,v)?d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):(d.dataTransfer&&(d.dataTransfer.dropEffect="copy",d.dataTransfer.effectAllowed="all"),d.currentTarget.classList.add(...e))}function a(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,v=Number(h.dataset[n]||0);h.dataset[n]=String(v+1)}function l(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,v=Number(h.dataset[n]||0)-1;v<=0?(delete h.dataset[n],h.classList.remove(...e)):h.dataset[n]=String(v)}function c(d,h){if(d.isExternalDrag||!(t.features?.move??!1)||!h)return;d.preventDefault();const v=d.currentTarget;delete v.dataset[n],v.classList.remove(...e);const p=d.dataTransfer?.getData("items")||"[]",f=JSON.parse(p).map(_=>i.sortedFiles.get().find(C=>C.path===_));i.clearDraggedItem(),t.modal.open(uo,{items:{from:f,to:h}})}function u(d){return{dragover:h=>s(h,d),dragenter:a,dragleave:l,drop:h=>c(h,d)}}return{events:u}}const E3={class:"vuefinder__breadcrumb__container"},x3=["title"],T3=["title"],$3=["title"],k3=["title"],O3={class:"vuefinder__breadcrumb__path-container"},A3={class:"vuefinder__breadcrumb__list"},P3={key:0,class:"vuefinder__breadcrumb__hidden-list"},R3={class:"relative"},M3=["title","onClick"],I3=["title"],F3={class:"vuefinder__breadcrumb__path-mode"},D3={class:"vuefinder__breadcrumb__path-mode-content"},L3=["title"],j3={class:"vuefinder__breadcrumb__path-text"},z3=["title"],N3=["data-theme"],U3=["onClick"],V3={class:"vuefinder__breadcrumb__hidden-item-content"},B3={class:"vuefinder__breadcrumb__hidden-item-text"},H3=Ce({__name:"Breadcrumb",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.path),l=Oe(o.loading),c=H(null),u=e_(0,100),d=H(5),h=H(!1),v=H(!1),p=te(()=>a.value?.breadcrumb??[]);function f(Y,M){return Y.length>M?[Y.slice(-M),Y.slice(0,-M)]:[Y,[]]}const _=te(()=>f(p.value,d.value)[0]),C=te(()=>f(p.value,d.value)[1]);$e(u,()=>{if(!c.value)return;const Y=c.value.children;let M=0,A=0;const Q=5,U=1;d.value=Q,Ge(()=>{for(let ie=Y.length-1;ie>=0;ie--){const ve=Y[ie];if(M+ve.offsetWidth>u.value-40)break;M+=parseInt(ve.offsetWidth.toString(),10),A++}A<U&&(A=U),A>Q&&(A=Q),d.value=A})});const w=()=>{c.value&&(u.value=c.value.offsetWidth)},S=H(null);et(()=>{S.value=new ResizeObserver(w),c.value&&S.value.observe(c.value)}),Ct(()=>{S.value&&S.value.disconnect()});const b=dr(e,["vuefinder__drag-over"]);function E(Y=null){Y??=p.value.length-2;const M={basename:a.value?.storage??"local",extension:"",path:(a.value?.storage??"local")+"://",storage:a.value?.storage??"local",type:"dir",file_size:null,last_modified:null,mime_type:null,visibility:""};return p.value[Y]??M}const x=()=>{e.adapter.invalidateListQuery(a.value.path),e.adapter.open(a.value.path)},O=()=>{_.value.length>0&&e.adapter.open(p.value[p.value.length-2]?.path??(a.value?.storage??"local")+"://")},$=Y=>{e.adapter.open(Y.path),h.value=!1},K=()=>{h.value&&(h.value=!1)},F={mounted(Y,M){Y.clickOutsideEvent=function(A){Y===A.target||Y.contains(A.target)||M.value()},document.body.addEventListener("click",Y.clickOutsideEvent)},beforeUnmount(Y){document.body.removeEventListener("click",Y.clickOutsideEvent)}},P=()=>{r.toggle("showTreeView")},N=H({x:0,y:0}),I=(Y,M=null)=>{if(Y.currentTarget instanceof HTMLElement){const{x:A,y:Q,height:U}=Y.currentTarget.getBoundingClientRect();N.value={x:A,y:Q+U}}h.value=M??!h.value},q=()=>{v.value=!v.value},le=async()=>{await Yo(a.value?.path||""),n.success(i("Path copied to clipboard"))},de=()=>{v.value=!1};return(Y,M)=>(y(),T("div",E3,[g("span",{title:m(i)("Toggle Tree View")},[j(m(b3),{class:Ae(["vuefinder__breadcrumb__toggle-tree",m(s).showTreeView?"vuefinder__breadcrumb__toggle-tree--active":""]),onClick:P},null,8,["class"])],8,x3),g("span",{title:m(i)("Go up a directory")},[j(m(l3),We({class:p.value.length?"vuefinder__breadcrumb__go-up--active":"vuefinder__breadcrumb__go-up--inactive"},bn(p.value.length?m(b).events(E()):{}),{onClick:O}),null,16,["class"])],8,T3),m(o).isLoading()?(y(),T("span",{key:1,title:m(i)("Cancel")},[j(m(d3),{onClick:M[0]||(M[0]=A=>m(e).emitter.emit("vf-fetch-abort"))})],8,k3)):(y(),T("span",{key:0,title:m(i)("Refresh")},[j(m(r3),{onClick:x})],8,$3)),it(g("div",O3,[g("div",null,[j(m(p3),We({class:"vuefinder__breadcrumb__home-icon"},bn(m(b).events(E(-1))),{onClick:M[1]||(M[1]=Ye(A=>m(e).adapter.open(m(a).storage+"://"),["stop"]))}),null,16)]),g("div",A3,[C.value.length?it((y(),T("div",P3,[M[3]||(M[3]=g("div",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("div",R3,[g("span",{class:"vuefinder__breadcrumb__hidden-toggle",onDragenter:M[2]||(M[2]=A=>I(A,!0)),onClick:Ye(I,["stop"])},[j(m(o_),{class:"vuefinder__breadcrumb__hidden-toggle-icon"})],32)])])),[[F,K]]):ue("",!0)]),g("div",{ref_key:"breadcrumbContainer",ref:c,class:"vuefinder__breadcrumb__visible-list pointer-events-none"},[(y(!0),T(Me,null,He(_.value,(A,Q)=>(y(),T("div",{key:Q},[M[4]||(M[4]=g("span",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("span",We({class:"vuefinder__breadcrumb__item pointer-events-auto",title:A.basename},bn(m(b).events(A),!0),{onClick:Ye(U=>m(e).adapter.open(A.path),["stop"])}),L(A.name),17,M3)]))),128))],512),m(r).get("loadingIndicator")==="circular"&&m(l)?(y(),ne(m(ia),{key:0})):ue("",!0),g("span",{title:m(i)("Toggle Path Copy Mode"),onClick:q},[j(m(C3),{class:"vuefinder__breadcrumb__toggle-icon"})],8,I3)],512),[[Sn,!v.value]]),it(g("div",F3,[g("div",D3,[g("div",{title:m(i)("Copy Path")},[j(m(_u),{class:"vuefinder__breadcrumb__copy-icon",onClick:le})],8,L3),g("div",j3,L(m(a).path),1),g("div",{title:m(i)("Exit")},[j(m(g3),{class:"vuefinder__breadcrumb__exit-icon",onClick:de})],8,z3)])],512),[[Sn,v.value]]),(y(),ne(Es,{to:"body"},[g("div",null,[it(g("div",{style:At({position:"absolute",top:N.value.y+"px",left:N.value.x+"px"}),class:"vuefinder__themer vuefinder__breadcrumb__hidden-dropdown","data-theme":m(e).theme.current},[(y(!0),T(Me,null,He(C.value,(A,Q)=>(y(),T("div",We({key:Q,class:"vuefinder__breadcrumb__hidden-item"},bn(m(b).events(A),!0),{onClick:U=>$(A)}),[g("div",V3,[g("span",null,[j(m(zn),{class:"vuefinder__breadcrumb__hidden-item-icon"})]),g("span",B3,L(A.name),1)])],16,U3))),128))],12,N3),[[Sn,h.value]])])]))]))}}),q3={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function W3(t,e){return y(),T("svg",q3,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Vf={render:W3},K3={class:"vuefinder__drag-item__container"},Y3={class:"vuefinder__drag-item__count"},G3=Ce({__name:"DragItem",props:{count:{}},setup(t){const e=t;return(n,i)=>(y(),T("div",K3,[e.count>1?(y(),ne(m(Vf),{key:0,class:"vuefinder__drag-item__icon translate-x-1 translate-y-1"})):ue("",!0),j(m(Vf),{class:"vuefinder__drag-item__icon"}),g("div",Y3,L(e.count),1)]))}}),Q3={key:2,class:"vuefinder__item-icon__extension"},Bf=Ce({__name:"ItemIcon",props:{item:{},ext:{type:Boolean},small:{type:Boolean},view:{}},setup(t){const e=t,n=je(),i=Oe(n.config.state),o=te(()=>e.small!==void 0?e.small?"small":"large":e.view==="list"?"small":"large"),r=te(()=>{const a=o.value,l=i.value?.listIconSize,c=i.value?.gridIconSize;return i.value?.gridItemWidth,i.value?.gridItemHeight,e.view==="list"||a==="small"?{"--vf-icon-size":`${l??16}px`}:{"--vf-icon-size":`${c??48}px`}}),s={app:n,config:i.value,item:e.item,view:e.view};return(a,l)=>(y(),T("div",{class:Ae(["vuefinder__item-icon",{"vuefinder__item-icon--small":o.value==="small","vuefinder__item-icon--large":o.value==="large","vuefinder__item-icon--grid":t.view==="grid","vuefinder__item-icon--list":t.view==="list"}]),style:At(r.value)},[Ve(a.$slots,"icon",wn(Jn(s)),()=>[t.item.type==="dir"?(y(),ne(m(zn),{key:0,class:"vuefinder__item-icon__folder"})):(y(),ne(m(Ko),{key:1,class:"vuefinder__item-icon__file"})),t.ext&&t.item.type!=="dir"&&t.item.extension?(y(),T("div",Q3,L(t.item.extension.substring(0,3)),1)):ue("",!0)])],6))}}),X3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function J3(t,e){return y(),T("svg",X3,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3V7a5 5 0 0 1 5-5m0 12a2 2 0 0 0-1.995 1.85L10 16a2 2 0 1 0 2-2m0-10a3 3 0 0 0-3 3v3h6V7a3 3 0 0 0-3-3"},null,-1)])])}const Hf={render:J3},Z3=["data-key","data-row","data-col","draggable"],ej={key:0},tj={class:"vuefinder__explorer__item-grid-content"},nj=["data-src","alt"],ij={class:"vuefinder__explorer__item-title"},oj={key:1,class:"vuefinder__explorer__item-list-content"},rj={class:"vuefinder__explorer__item-list-name"},sj={class:"vuefinder__explorer__item-list-icon"},aj={class:"vuefinder__explorer__item-name"},lj={key:0,class:"vuefinder__explorer__item-path"},cj={key:1,class:"vuefinder__explorer__item-size"},uj={key:0},dj={key:2,class:"vuefinder__explorer__item-date"},hj=Ce({__name:"FileItem",props:{item:{},view:{},showThumbnails:{type:Boolean},isSelected:{type:Boolean},isDragging:{type:Boolean},rowIndex:{},colIndex:{},showPath:{type:Boolean},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=je(),r=o.fs,s=o.config,a=te(()=>{const P=o.selectionFilterType;return!P||P==="both"?!0:P==="files"&&n.item.type==="file"||P==="dirs"&&n.item.type==="dir"}),l=te(()=>{const P=o.selectionFilterMimeIncludes;return!P||!P.length||n.item.type==="dir"?!0:n.item.mime_type?P.some(N=>n.item.mime_type?.startsWith(N)):!1}),c=te(()=>a.value&&l.value),u=te(()=>["file-item-"+n.explorerId,n.view==="grid"?"vf-explorer-item-grid":"vf-explorer-item-list",n.isSelected?"vf-explorer-selected":"",c.value?"":"vf-explorer-item--unselectable"]),d=te(()=>({opacity:n.isDragging||r.isCut(n.item.path)||!c.value?.5:""})),h=H(null);let v=!1,p=null,f=null,_=!1;const{enabled:C}=Tn(),w=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),S=te(()=>w?!1:C("move")),b=()=>{p&&(clearTimeout(p),p=null),f=null},E=P=>{b(),f=P,_=!1,P.stopPropagation(),p=setTimeout(()=>{!f||p===null||(_=!0,f.cancelable&&f.preventDefault(),f.stopPropagation(),i("contextmenu",f),b())},500)},x=P=>{if(_){P.preventDefault(),P.stopPropagation(),b();return}setTimeout(()=>{_||(b(),F(P))},100)},O=P=>{if(!f)return;const N=f.touches[0]||f.changedTouches[0],I=P.touches[0]||P.changedTouches[0];if(N&&I){const q=Math.abs(I.clientX-N.clientX),le=Math.abs(I.clientY-N.clientY);(q>15||le>15)&&b()}},$=P=>{w&&P.type!=="click"||i("click",P)},K=P=>{if(_)return P.preventDefault(),P.stopPropagation(),!1;i("dragstart",P)},F=P=>{if(!v)v=!0,i("click",P),h.value=setTimeout(()=>{v=!1},300);else return v=!1,i("dblclick",P),!1};return(P,N)=>(y(),T("div",{class:Ae(u.value),style:At(d.value),"data-key":t.item.path,"data-row":t.rowIndex,"data-col":t.colIndex,draggable:S.value,onTouchstartCapture:N[1]||(N[1]=I=>E(I)),onTouchendCapture:N[2]||(N[2]=I=>x(I)),onTouchmoveCapture:O,onTouchcancelCapture:N[3]||(N[3]=()=>b()),onClick:$,onDblclick:N[4]||(N[4]=I=>i("dblclick",I)),onContextmenu:N[5]||(N[5]=Ye(I=>i("contextmenu",I),["prevent","stop"])),onDragstart:K,onDragend:N[6]||(N[6]=I=>i("dragend",I))},[t.view==="grid"?(y(),T("div",ej,[m(r).isReadOnly(t.item)?(y(),ne(m(Hf),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--left",title:"Read Only"})):ue("",!0),g("div",tj,[(t.item.mime_type??"").startsWith("image")&&t.showThumbnails?(y(),T("img",{key:0,src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"vuefinder__explorer__item-thumbnail lazy","data-src":t.item.previewUrl??m(o).adapter.getPreviewUrl({path:t.item.path}),alt:t.item.basename,onTouchstart:N[0]||(N[0]=I=>I.preventDefault())},null,40,nj)):(y(),ne(Bf,{key:1,item:t.item,ext:!0,view:t.view},{icon:we(I=>[Ve(P.$slots,"icon",wn(Jn(I)))]),_:3},8,["item","view"]))]),g("span",ij,L(m(ic)(t.item.basename)),1)])):(y(),T("div",oj,[g("div",rj,[g("div",sj,[j(Bf,{item:t.item,view:t.view},{icon:we(I=>[Ve(P.$slots,"icon",wn(Jn(I)))]),_:3},8,["item","view"])]),g("span",aj,L(t.item.basename),1),g("div",null,[m(r).isReadOnly(t.item)?(y(),ne(m(Hf),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--list",title:"Read Only"})):ue("",!0)])]),t.showPath?(y(),T("div",lj,L(t.item.path),1)):ue("",!0),t.showPath?ue("",!0):(y(),T("div",cj,[t.item.file_size?(y(),T("div",uj,L(m(o).filesize(t.item.file_size)),1)):ue("",!0)])),!t.showPath&&t.item.last_modified?(y(),T("div",dj,L(new Date(t.item.last_modified*1e3).toLocaleString()),1)):ue("",!0)])),m(C)("pinned")&&m(s).get("pinnedFolders").find(I=>I.path===t.item.path)?(y(),ne(m(yu),{key:2,class:"vuefinder__item--pinned"})):ue("",!0)],46,Z3))}}),fj=["data-row"],qf=Ce({__name:"FileRow",props:{rowIndex:{},rowHeight:{},view:{},itemsPerRow:{},items:{},showThumbnails:{type:Boolean},showPath:{type:Boolean},isDraggingItem:{type:Function},isSelected:{type:Function},dragNDropEvents:{type:Function},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=te(()=>[n.view==="grid"?"vf-explorer-item-grid-row":"vf-explorer-item-list-row","pointer-events-none"]),r=te(()=>({position:"absolute",top:0,left:0,width:"100%",height:`${n.rowHeight}px`,transform:`translateY(${n.rowIndex*n.rowHeight}px)`})),s=te(()=>n.view==="grid"?{gridTemplateColumns:`repeat(${n.itemsPerRow||1}, 1fr)`}:{gridTemplateColumns:"1fr"});return(a,l)=>(y(),T("div",{class:Ae(o.value),"data-row":t.rowIndex,style:At(r.value)},[g("div",{class:Ae(["grid justify-self-start",{"w-full":t.view==="list"}]),style:At(s.value)},[(y(!0),T(Me,null,He(t.items,(c,u)=>(y(),ne(hj,We({key:c.path,item:c,view:t.view,"show-thumbnails":t.showThumbnails,"show-path":t.showPath,"is-selected":t.isSelected(c.path),"is-dragging":t.isDraggingItem(c.path),"row-index":t.rowIndex,"col-index":u,"explorer-id":t.explorerId},bn(t.dragNDropEvents(c)),{onClick:l[0]||(l[0]=d=>i("click",d)),onDblclick:l[1]||(l[1]=d=>i("dblclick",d)),onContextmenu:l[2]||(l[2]=d=>i("contextmenu",d)),onDragstart:l[3]||(l[3]=d=>i("dragstart",d)),onDragend:l[4]||(l[4]=d=>i("dragend",d))}),{icon:we(d=>[Ve(a.$slots,"icon",We({ref_for:!0},d))]),_:3},16,["item","view","show-thumbnails","show-path","is-selected","is-dragging","row-index","col-index","explorer-id"]))),128))],6)],14,fj))}}),pj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function mj(t,e){return y(),T("svg",pj,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1)])])}const vj={render:mj},gj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function _j(t,e){return y(),T("svg",gj,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1)])])}const yj={render:_j},nl=Ce({__name:"SortIcon",props:{direction:{}},setup(t){return(e,n)=>(y(),T("div",null,[t.direction==="asc"?(y(),ne(m(vj),{key:0,class:"vuefinder__explorer__sort-icon"})):ue("",!0),t.direction==="desc"?(y(),ne(m(yj),{key:1,class:"vuefinder__explorer__sort-icon"})):ue("",!0)]))}}),bj={class:"vuefinder__explorer__header"},wj=Ce({__name:"ExplorerHeader",setup(t){const e=je(),n=e.fs,{t:i}=e.i18n,o=Oe(n.sort);return(r,s)=>(y(),T("div",bj,[g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--name vf-sort-button",onClick:s[0]||(s[0]=a=>m(n).toggleSort("basename"))},[Ke(L(m(i)("Name"))+" ",1),it(j(nl,{direction:m(o).order},null,8,["direction"]),[[Sn,m(o).active&&m(o).column==="basename"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--size vf-sort-button",onClick:s[1]||(s[1]=a=>m(n).toggleSort("file_size"))},[Ke(L(m(i)("Size"))+" ",1),it(j(nl,{direction:m(o).order},null,8,["direction"]),[[Sn,m(o).active&&m(o).column==="file_size"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--date vf-sort-button",onClick:s[2]||(s[2]=a=>m(n).toggleSort("last_modified"))},[Ke(L(m(i)("Date"))+" ",1),it(j(nl,{direction:m(o).order},null,8,["direction"]),[[Sn,m(o).active&&m(o).column==="last_modified"]])])]))}});function Sj(t,e){const{scrollContainer:n,itemWidth:i=100,rowHeight:o,overscan:r=2,containerPadding:s=48,lockItemsPerRow:a}=e,l=t,c=()=>typeof o=="number"?o:o.value,u=()=>i?typeof i=="number"?i:i.value:100,d=()=>s?typeof s=="number"?s:s.value:0,h=H(0),v=H(6),p=H(600);let f=null;const _=te(()=>Math.ceil(l.value.length/v.value)),C=te(()=>_.value*c()),w=te(()=>{const P=c(),N=Math.max(0,Math.floor(h.value/P)-r),I=Math.min(_.value,Math.ceil((h.value+p.value)/P)+r);return{start:N,end:I}}),S=te(()=>{const{start:P,end:N}=w.value;return Array.from({length:N-P},(I,q)=>P+q)}),b=()=>p.value,E=()=>typeof a=="object"?a.value:!1,x=()=>{if(E()){v.value=1;return}if(n.value){const P=d(),N=n.value.clientWidth-P,I=u();I>0&&(v.value=Math.max(Math.floor(N/I),2))}},O=P=>{const N=P.target;h.value=N.scrollTop};$e(()=>l.value.length,()=>{x()}),i&&typeof i!="number"&&$e(i,()=>{x()}),s&&typeof s!="number"&&$e(s,()=>{x()}),o&&typeof o!="number"&&$e(o,()=>{});const $=(P,N)=>{if(!P||!Array.isArray(P))return[];const I=N*v.value;return P.slice(I,I+v.value)},K=(P,N,I,q,le)=>{if(!P||!Array.isArray(P))return[];const de=[];for(let Y=N;Y<=I;Y++)for(let M=q;M<=le;M++){const A=Y*v.value+M;A<P.length&&P[A]&&de.push(P[A])}return de},F=P=>({row:Math.floor(P/v.value),col:P%v.value});return et(async()=>{await Ge(),n.value&&(p.value=n.value.clientHeight||600),x(),window.addEventListener("resize",()=>{n.value&&(p.value=n.value.clientHeight||600),x()}),n.value&&"ResizeObserver"in window&&(f=new ResizeObserver(P=>{const N=P[0];N&&(p.value=Math.round(N.contentRect.height)),x()}),f.observe(n.value))}),Ct(()=>{window.removeEventListener("resize",x),f&&(f.disconnect(),f=null)}),{scrollTop:h,itemsPerRow:v,totalRows:_,totalHeight:C,visibleRange:w,visibleRows:S,updateItemsPerRow:x,handleScroll:O,getRowItems:$,getItemsInRange:K,getItemPosition:F,getContainerHeight:b}}function Cj(t){const{itemsPerRow:e,totalHeight:n,getItemsInRange:i,getKey:o,selectionObject:r,rowHeight:s,itemWidth:a,osInstance:l}=t,c=()=>typeof a=="number"?a:a.value,u=Math.floor(Math.random()*2**32).toString(),d=je(),h=d.fs,v=Oe(h.selectedKeys),p=Oe(h.sortedFiles),f=te(()=>{const M=new Map;return p.value&&p.value.forEach(A=>{M.set(o(A),A)}),M}),_=H(new Set),C=H(!1),w=H(!1),S=M=>M.map(A=>A.getAttribute("data-key")).filter(A=>!!A),b=M=>{M.selection.clearSelection(!0,!0)},E=M=>{if(v.value&&v.value.size>0){const A=document.querySelectorAll(`.file-item-${u}[data-key]`),Q=new Map;A.forEach(ie=>{const ve=ie.getAttribute("data-key");ve&&Q.set(ve,ie)});const U=[];v.value.forEach(ie=>{const ve=Q.get(ie);ve&&x(ie)&&U.push(ve)}),U.forEach(ie=>{M.selection.select(ie,!0)})}},x=M=>{const A=f.value.get(M);if(!A)return!1;const Q=d.selectionFilterType,U=d.selectionFilterMimeIncludes;return Q==="files"&&A.type==="dir"||Q==="dirs"&&A.type==="file"?!1:U&&Array.isArray(U)&&U.length>0?A.type==="dir"?!0:A.mime_type?U.some(ie=>A.mime_type?.startsWith(ie)):!1:!0},O=M=>{if(d.selectionMode==="single")return!1;C.value=!1,!M.event?.metaKey&&!M.event?.ctrlKey&&(w.value=!0),M.selection.resolveSelectables(),b(M),E(M)},$=H(0),K=({event:M,selection:A})=>{$.value=(r.value?.getAreaLocation().y1??0)-(d.root.getBoundingClientRect().top??0);const Q=document.querySelector(".selection-area-container");if(Q&&(Q.dataset.theme=d.theme.current),d.selectionMode==="single")return;const U=M;U&&"type"in U&&U.type==="touchend"&&U.preventDefault();const ie=M;!ie?.ctrlKey&&!ie?.metaKey&&(h.clearSelection(),A.clearSelection(!0,!0)),_.value.clear()},F=M=>{if(d.selectionMode==="single")return;const A=S(M.store.changed.added),Q=S(M.store.changed.removed);w.value=!1,C.value=!0,A.forEach(U=>{v.value&&!v.value.has(U)&&x(U)&&(_.value.add(U),h.select(U,d.selectionMode||"multiple"))}),Q.forEach(U=>{document.querySelector(`[data-key="${U}"]`)&&f.value.has(U)&&_.value.delete(U),h.deselect(U)}),M.selection.resolveSelectables(),E(M)},P=()=>{_.value.clear()},N=M=>{if(!M.event)return;const A=document.querySelector(".scroller-"+u);if(!A)return;const Q=A.getBoundingClientRect(),U=Q.left,ie=Q.top;let ve=A.scrollTop;if(l?.value){const{viewport:pt}=l.value.elements();pt&&(ve=pt.scrollTop)}const re=r.value?.getAreaLocation();if(!re)return;const ge=Math.min(re.x1,re.x2),_e=ve+Math.min(re.y1,re.y2),R=Math.max(re.x1,re.x2),k=ve+Math.max(re.y1,re.y2),z=4,D=c();let B=Math.floor((ge-U-z)/D),oe=Math.floor((R-U-z)/D);const ee=ge-U-z-B*D,G=R-U-z-oe*D;ee>D-z&&(B=B+1),G<z&&(oe=oe-1);const he=Math.max(0,B),me=Math.min(e.value-1,oe);let ke=Math.floor((_e-ie-z)/s.value),Ee=Math.floor((k-ie-z)/s.value);const ze=_e-ie-z-ke*s.value,Pe=k-ie-z-Ee*s.value,Ne=Math.floor((n.value-z)/s.value);ze>s.value-z&&(ke=ke+1),Pe<z&&(Ee=Ee-1);const ut=Math.max(0,ke),Qe=Math.min(Ee,Ne),at=i(p.value,ut,Qe,he,me),tt=document.querySelectorAll(`.file-item-${u}[data-key]`),ft=new Map;tt.forEach(pt=>{const Ft=pt.getAttribute("data-key");Ft&&ft.set(Ft,pt)});const dt=[];if(at.forEach(pt=>{const Ft=o(pt);ft.get(Ft)||dt.push(Ft)}),dt.length>0){const pt=d.selectionMode||"multiple";h.selectMultiple(dt,pt)}},I=M=>{N(M),b(M),E(M),h.setSelectedCount(v.value?.size||0),C.value=!1},q=()=>{let M=[".scroller-"+u];if(l?.value){const{viewport:A}=l.value.elements();A&&(M=A)}r.value=new qR({selectables:[".file-item-"+u+":not(.vf-explorer-item--unselectable)"],boundaries:M,selectionContainerClass:"selection-area-container",behaviour:{overlap:"invert",intersect:"touch",startThreshold:0,triggers:[0],scrolling:{speedDivider:10,manualSpeed:750,startScrollMargins:{x:0,y:10}}},features:{touch:!0,range:!0,deselectOnBlur:!0,singleTap:{allow:!1,intersect:"native"}}}),r.value.on("beforestart",O),r.value.on("start",K),r.value.on("move",F),r.value.on("stop",I)},le=()=>{r.value&&(r.value.destroy(),r.value=null)},de=()=>{r.value&&(Array.from(v.value??new Set).forEach(M=>{x(M)||h.deselect(M)}),le(),q())},Y=M=>{w.value&&(r.value?.clearSelection(),P(),w.value=!1);const A=M;!_.value.size&&!w.value&&!A?.ctrlKey&&!A?.metaKey&&(h.clearSelection(),r.value?.clearSelection())};return et(()=>{const M=A=>{!A.buttons&&C.value&&(C.value=!1)};document.addEventListener("dragleave",M),Ct(()=>{document.removeEventListener("dragleave",M)})}),{explorerId:u,isDragging:C,initializeSelectionArea:q,updateSelectionArea:de,handleContentClick:Y}}function Ej(t){const e=n=>{if(!n)return{typeAllowed:!1,mimeAllowed:!1};const i=t.selectionFilterType,o=t.selectionFilterMimeIncludes,r=!i||i==="both"||i==="files"&&n.type==="file"||i==="dirs"&&n.type==="dir";let s=!0;return o&&Array.isArray(o)&&o.length>0&&(n.type==="dir"?s=!0:n.mime_type?s=o.some(a=>n.mime_type.startsWith(a)):s=!1),{typeAllowed:r,mimeAllowed:s}};return{isItemSelectable:e,canSelectItem:n=>{const{typeAllowed:i,mimeAllowed:o}=e(n);return i&&o}}}function xj(t){const e=n=>({item:n,defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}});return{createCancelableEvent:e,openItem:(n,i,o)=>{const r=e(n);if(n.type==="file"&&i){if(t.emitter.emit("vf-file-dclick",r),r.defaultPrevented)return}else if(n.type==="dir"&&o&&(t.emitter.emit("vf-folder-dclick",r),r.defaultPrevented))return;const s=t.contextMenuItems?.find(a=>a.show(t,{items:[n],target:n,searchQuery:""}));s&&s.action(t,[n])}}}function Tj(t,e,n,i,o,r,s){const a=t.fs,{canSelectItem:l}=Ej(t),{openItem:c}=xj(t),u=h=>{const v=h.target?.closest(".file-item-"+e);if(!v)return null;const p=String(v.getAttribute("data-key")),f=n.value?.find(_=>_.path===p);return{key:p,item:f}},d=()=>{const h=i.value;return n.value?.filter(v=>h?.has(v.path))||[]};return{handleItemClick:h=>{const v=u(h);if(!v)return;const{key:p,item:f}=v,_=h;if(!l(f))return;const C=t.selectionMode||"multiple";!_?.ctrlKey&&!_?.metaKey&&(h.type!=="touchstart"||!a.isSelected(p))&&(a.clearSelection(),o.value?.clearSelection(!0,!0)),o.value?.resolveSelectables(),h.type==="touchstart"&&a.isSelected(p)?a.select(p,C):a.toggleSelect(p,C),a.setSelectedCount(i.value?.size||0)},handleItemDblClick:h=>{const v=u(h);if(!v)return;const{item:p}=v;l(p)&&p&&c(p,r,s)},handleItemContextMenu:h=>{h.preventDefault(),h.stopPropagation();const v=u(h);if(!v)return;const{key:p,item:f}=v;l(f)&&(i.value?.has(p)||(a.clearSelection(),a.select(p)),t.emitter.emit("vf-contextmenu-show",{event:h,items:d(),target:f}))},handleContentContextMenu:h=>{h.preventDefault(),t.emitter.emit("vf-contextmenu-show",{event:h,items:d()})},getSelectedItems:d}}function $j(t,e){const n=H(null);return et(()=>{if(hn.plugin([pR]),t.value){const i=hn(t.value,{scrollbars:{theme:"vf-scrollbars-theme"}},{initialized:o=>{n.value=o;const{viewport:r}=o.elements();r&&r.addEventListener("scroll",e)},updated:o=>{const{viewport:r}=o.elements()}});n.value=i}}),Ct(()=>{if(n.value){const{viewport:i}=n.value.elements();i&&i.removeEventListener("scroll",e),n.value.destroy(),n.value=null}}),{osInstance:n}}function kj(t,e){const n=H(null);return et(()=>{t.value&&(n.value=new qi({elements_selector:".lazy",container:t.value})),e?.emitter&&e.emitter.on("vf-refresh-thumbnails",()=>{n.value&&n.value.update()})}),Gf(()=>{n.value&&n.value.update()}),Ct(()=>{n.value&&(n.value.destroy(),n.value=null)}),{vfLazyLoad:n}}const Oj={class:"vuefinder__explorer__container"},Aj={key:0,class:"vuefinder__linear-loader"},Pj=Ce({__name:"Explorer",props:{onFileDclick:{type:Function},onFolderDclick:{type:Function}},setup(t){const e=t,n=je(),i=dr(n,["vuefinder__drag-over"]),o=Mn("dragImage"),r=Qo(null),s=Mn("scrollContainer"),a=Mn("scrollContent"),l=n.fs,c=n.config,u=Oe(c.state),d=Oe(l.sortedFiles),h=Oe(l.selectedKeys),v=Oe(l.loading),p=D=>h.value?.has(D)??!1,f=te(()=>{if(u.value?.view==="grid"){const oe=u.value?.gridItemHeight??80,ee=u.value?.gridItemGap??8;return oe+ee*2}const D=u.value?.listItemHeight??32,B=u.value?.listItemGap??2;return D+B*2}),_=te(()=>{if(u.value?.view==="grid"){const D=u.value?.gridItemWidth??96,B=u.value?.gridItemGap??8;return D+B*2}return 104}),C=te(()=>u.value?.view==="grid"?(u.value?.gridItemGap??8)*2:0),{t:w}=n.i18n,{itemsPerRow:S,totalHeight:b,visibleRows:E,handleScroll:x,getRowItems:O,getItemsInRange:$,updateItemsPerRow:K}=Sj(te(()=>d.value??[]),{scrollContainer:s,itemWidth:_,rowHeight:f,overscan:2,containerPadding:C,lockItemsPerRow:te(()=>u.value.view==="list")}),{osInstance:F}=$j(s,x),{explorerId:P,isDragging:N,initializeSelectionArea:I,updateSelectionArea:q,handleContentClick:le}=Cj({itemsPerRow:S,totalHeight:b,getItemsInRange:$,getKey:D=>D.path,selectionObject:r,rowHeight:f,itemWidth:_,osInstance:F}),de=H(null),Y=D=>{if(!D||!de.value)return!1;const B=h.value?.has(de.value)??!1;return N.value&&(B?h.value?.has(D)??!1:D===de.value)};$e(()=>c.get("view"),D=>{D==="list"?S.value=1:K()},{immediate:!0}),$e(S,D=>{c.get("view")==="list"&&D!==1&&(S.value=1)});const M=D=>d.value?.[D];kj(s,n);const{handleItemClick:A,handleItemDblClick:Q,handleItemContextMenu:U,handleContentContextMenu:ie}=Tj(n,P,d,h,r,e.onFileDclick,e.onFolderDclick);et(()=>{const D=()=>{r.value||I(),r.value&&r.value.on("beforestart",({event:B})=>{const oe=B?.target===a.value;if(!B?.metaKey&&!B?.ctrlKey&&!B?.altKey&&!oe)return!1})};if(F.value)D();else{const B=setInterval(()=>{F.value&&(clearInterval(B),D())},50);setTimeout(()=>{clearInterval(B),r.value||D()},500)}$e(()=>[n.selectionFilterType,n.selectionFilterMimeIncludes],q,{deep:!0})});const ve=D=>{if(!(n.features?.move??!1)||D.altKey||D.ctrlKey||D.metaKey)return D.preventDefault(),!1;N.value=!0;const B=D.target?.closest(".file-item-"+P);if(de.value=B?String(B.dataset.key):null,D.dataTransfer&&de.value){D.dataTransfer.setDragImage(o.value,0,15),D.dataTransfer.effectAllowed="all",D.dataTransfer.dropEffect="copy";const oe=h.value?.has(de.value)?Array.from(h.value):[de.value];D.dataTransfer.setData("items",JSON.stringify(oe)),l.setDraggedItem(de.value)}},re=()=>{de.value=null};let ge=null,_e=null;const R=D=>{D.target?.closest(".file-item-"+P)||(_e=D,ge&&clearTimeout(ge),ge=setTimeout(()=>{_e&&(_e.cancelable&&_e.preventDefault(),_e.stopPropagation(),ie(_e)),_e=null,ge=null},500))},k=D=>{ge&&(clearTimeout(ge),ge=null),_e=null},z=D=>{if(!_e)return;const B=_e.touches[0]||_e.changedTouches[0],oe=D.touches[0]||D.changedTouches[0];if(B&&oe){const ee=Math.abs(oe.clientX-B.clientX),G=Math.abs(oe.clientY-B.clientY);(ee>15||G>15)&&(ge&&(clearTimeout(ge),ge=null),_e=null)}};return(D,B)=>(y(),T("div",Oj,[m(u).view==="list"?(y(),ne(wj,{key:0})):ue("",!0),g("div",{ref_key:"scrollContainer",ref:s,class:Ae(["vuefinder__explorer__selector-area","scroller-"+m(P)])},[m(c).get("loadingIndicator")==="linear"&&m(v)?(y(),T("div",Aj)):ue("",!0),g("div",{ref_key:"scrollContent",ref:a,class:"scrollContent vuefinder__explorer__scroll-content",style:At({height:`${m(b)}px`,position:"relative",width:"100%"}),onContextmenu:B[0]||(B[0]=Ye((...oe)=>m(ie)&&m(ie)(...oe),["self","prevent"])),onClick:B[1]||(B[1]=Ye((...oe)=>m(le)&&m(le)(...oe),["self"])),onTouchstartCapture:Ye(R,["self"]),onTouchendCapture:Ye(k,["self"]),onTouchmoveCapture:Ye(z,["self"]),onTouchcancelCapture:Ye(k,["self"])},[g("div",{ref_key:"dragImage",ref:o,class:"vuefinder__explorer__drag-item"},[j(G3,{count:de.value&&m(h).has(de.value)?m(h).size:1},null,8,["count"])],512),m(u).view==="grid"?(y(!0),T(Me,{key:0},He(m(E),oe=>(y(),ne(qf,{key:oe,"row-index":oe,"row-height":f.value,view:"grid","items-per-row":m(S),items:m(O)(m(d),oe),"show-thumbnails":m(u).showThumbnails,"is-dragging-item":Y,"is-selected":p,"drag-n-drop-events":ee=>m(i).events(ee),"explorer-id":m(P),onClick:m(A),onDblclick:m(Q),onContextmenu:m(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items-per-row","items","show-thumbnails","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128)):(y(!0),T(Me,{key:1},He(m(E),oe=>(y(),ne(qf,{key:oe,"row-index":oe,"row-height":f.value,view:"list",items:M(oe)?[M(oe)]:[],"is-dragging-item":Y,"is-selected":p,"drag-n-drop-events":ee=>m(i).events(ee),"explorer-id":m(P),onClick:m(A),onDblclick:m(Q),onContextmenu:m(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128))],36)],2)]))}}),Rj=["href","download"],Mj=["onClick"],Ij=Ce({__name:"ContextMenu",setup(t){const e=je(),n=H(null),i=H([]);let o=null,r=null,s=null,a=[],l=null;const c=It({active:!1,items:[],positions:{}});e.emitter.on("vf-context-selected",v=>{i.value=v});const u=v=>v.link(e,i.value),d=v=>{e.emitter.emit("vf-contextmenu-hide"),v.action(e,i.value)};e.emitter.on("vf-contextmenu-show",v=>{const{event:p,items:f,target:_=null}=v||{};c.items=(e.contextMenuItems||[]).filter(C=>C.show(e,{items:f,target:_})).sort((C,w)=>{const S=C.order??1/0,b=w.order??1/0;return S-b}),_?f.length>1&&f.some(C=>C.path===_.path)?e.emitter.emit("vf-context-selected",f):e.emitter.emit("vf-context-selected",[_]):e.emitter.emit("vf-context-selected",[]),h(p)}),e.emitter.on("vf-contextmenu-hide",()=>{c.active=!1,o&&(o(),o=null),s&&(a.forEach(v=>{v===window?window.removeEventListener("scroll",s,!0):v.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null,c.positions={}});const h=async v=>{o&&(o(),o=null);const p=(b=>{if("clientX"in b&&"clientY"in b)return{x:b.clientX,y:b.clientY};const E="touches"in b&&b.touches[0]||"changedTouches"in b&&b.changedTouches[0];return E?{x:E.clientX,y:E.clientY}:{x:0,y:0}})(v);if(r={getBoundingClientRect:()=>({width:0,height:0,x:p.x,y:p.y,top:p.y,left:p.x,right:p.x,bottom:p.y})},c.positions={position:"fixed",zIndex:"10001",opacity:"0",visibility:"hidden",left:"-9999px",top:"-9999px"},c.active=!0,await Ge(),!n.value||!r)return;await new Promise(b=>{requestAnimationFrame(()=>{requestAnimationFrame(b)})});const f=[Mo(8),Io({padding:16,fallbackPlacements:["left-start","right-end","left-end","top-start","bottom-start"]}),Fo({padding:16})];let _=0,C=0;try{const b=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:f});_=b.x,C=b.y}catch(b){console.warn("[ContextMenu] Floating UI initial positioning error:",b);return}c.positions={position:"fixed",zIndex:"10001",left:`${_}px`,top:`${C}px`,opacity:"0",visibility:"visible",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},requestAnimationFrame(()=>{n.value&&(c.positions={...c.positions,opacity:"1",transform:"translateY(0)"})});const w=(b=>{const E=[];let x=b;for(;x&&x!==document.body&&x!==document.documentElement;){const O=window.getComputedStyle(x),$=O.overflow+O.overflowX+O.overflowY;($.includes("scroll")||$.includes("auto"))&&E.push(x),x=x.parentElement}return E})(n.value);a=[window,...w],s=()=>{c.active&&e.emitter.emit("vf-contextmenu-hide")};const S=s;S&&a.forEach(b=>{b===window?window.addEventListener("scroll",S,!0):b.addEventListener("scroll",S,!0)}),l=b=>{if(!c.active)return;const E=b.target;if(!E||n.value&&n.value.contains(E))return;const x=e.root;x&&x.contains(E)||e.emitter.emit("vf-contextmenu-hide")},setTimeout(()=>{l&&(document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0))},100),setTimeout(()=>{if(!(!n.value||!r))try{o=cc(r,n.value,async()=>{if(!(!r||!n.value))try{const{x:b,y:E}=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:f});c.positions={...c.positions,left:`${b}px`,top:`${E}px`}}catch(b){console.warn("Floating UI positioning error:",b)}})}catch(b){console.warn("Floating UI autoUpdate setup error:",b),o=null}},200)};return Ct(()=>{o&&(o(),o=null),s&&(a.forEach(v=>{v===window?window.removeEventListener("scroll",s,!0):v.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null}),(v,p)=>it((y(),T("ul",{ref_key:"contextmenu",ref:n,class:Ae([{"vuefinder__context-menu--active":c.active,"vuefinder__context-menu--inactive":!c.active},"vuefinder__context-menu"]),style:At(c.positions)},[(y(!0),T(Me,null,He(c.items,f=>(y(),T("li",{key:f.title,class:"vuefinder__context-menu__item"},[f.link?(y(),T("a",{key:0,class:"vuefinder__context-menu__link",target:"_blank",href:u(f),download:u(f),onClick:p[0]||(p[0]=_=>m(e).emitter.emit("vf-contextmenu-hide"))},[g("span",null,L(f.title(m(e).i18n)),1)],8,Rj)):(y(),T("div",{key:1,class:"vuefinder__context-menu__action",onClick:_=>d(f)},[g("span",null,L(f.title(m(e).i18n)),1)],8,Mj))]))),128))],6)),[[Sn,c.active]])}}),Fj={class:"vuefinder__status-bar__wrapper"},Dj={class:"vuefinder__status-bar__storage"},Lj=["title"],jj={class:"vuefinder__status-bar__storage-icon"},zj=["value"],Nj=["value"],Uj={class:"vuefinder__status-bar__info space-x-2"},Vj={key:0},Bj={key:1},Hj={key:0,class:"vuefinder__status-bar__size"},qj={class:"vuefinder__status-bar__actions"},Wj=Ce({__name:"Statusbar",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.sortedFiles),r=Oe(i.path),s=Oe(i.selectedCount),a=Oe(i.storages),l=Oe(i.selectedItems),c=Oe(i.path),u=_=>{const C=_.target.value;e.adapter.open(C+"://")},d=te(()=>!l.value||l.value.length===0?0:l.value.reduce((_,C)=>_+(C.file_size||0),0)),h=te(()=>a.value),v=te(()=>o.value),p=te(()=>s.value||0),f=te(()=>l.value||[]);return(_,C)=>(y(),T("div",Fj,[g("div",Dj,[g("div",{class:"vuefinder__status-bar__storage-container",title:m(n)("Storage")},[g("div",jj,[j(m(bu))]),g("select",{name:"vuefinder-media-selector",value:m(r).storage,class:"vuefinder__status-bar__storage-select",tabindex:"-1",onChange:u},[(y(!0),T(Me,null,He(h.value,w=>(y(),T("option",{key:w,value:w},L(w),9,Nj))),128))],40,zj),C[0]||(C[0]=g("span",{class:"vuefinder__status-bar__storage-caret","aria-hidden":"true"},null,-1))],8,Lj),g("div",Uj,[p.value===0?(y(),T("span",Vj,L(v.value.length)+" "+L(m(n)("items")),1)):(y(),T("span",Bj,[Ke(L(p.value)+" "+L(m(n)("selected"))+" ",1),d.value?(y(),T("span",Hj,L(m(e).filesize(d.value)),1)):ue("",!0)]))])]),g("div",qj,[Ve(_.$slots,"actions",{path:m(c).path,count:p.value||0,selected:f.value})])]))}}),Kj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"};function Yj(t,e){return y(),T("svg",Kj,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m3.6 5.2a1 1 0 0 0-1.4.2L12 10.333 9.8 7.4a1 1 0 1 0-1.6 1.2l2.55 3.4-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2-2.933 2.2 2.933a1 1 0 0 0 1.6-1.2L13.25 12l2.55-3.4a1 1 0 0 0-.2-1.4"},null,-1)])])}const Gj={render:Yj};function h_(t,e){const n=t.findIndex(i=>i.path===e.path);n>-1?t[n]=e:t.push(e)}const Qj={class:"vuefinder__folder-loader-indicator"},Xj={key:1,class:"vuefinder__folder-loader-indicator--icon"},f_=Ce({__name:"FolderLoaderIndicator",props:Yf({storage:{},path:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=je(),i=oc(t,"modelValue"),o=H(!1);$e(()=>i.value,()=>r());const r=async()=>{o.value=!0;try{const s=(await n.adapter.list(e.path)).files.filter(a=>a.type==="dir");h_(n.treeViewData,{path:e.path,type:"dir",folders:s})}catch(s){Yt(s,"Failed to fetch subfolders")}finally{o.value=!1}};return(s,a)=>(y(),T("div",Qj,[o.value?(y(),ne(m(ia),{key:0,class:"vuefinder__folder-loader-indicator--loading"})):(y(),T("div",Xj,[i.value?(y(),ne(m(na),{key:0,class:"vuefinder__folder-loader-indicator--minus"})):ue("",!0),i.value?ue("",!0):(y(),ne(m(ta),{key:1,class:"vuefinder__folder-loader-indicator--plus"}))]))]))}}),Jj={key:0},Zj={class:"vuefinder__treesubfolderlist__no-folders"},ez={class:"vuefinder__treesubfolderlist__item-content"},tz=["onClick"],nz=["title","onDblclick","onClick"],iz={class:"vuefinder__treesubfolderlist__item-icon"},oz={class:"vuefinder__treesubfolderlist__subfolder"},rz={key:1,class:"vuefinder__treesubfolderlist__more-note"},sz=Ce({__name:"TreeSubfolderList",props:{storage:{},path:{}},setup(t){const e=je(),n=e.fs,i=dr(e,["vuefinder__drag-over"]),o=H({}),r=e.config,s=Oe(r.state),{t:a}=e.i18n,l=Oe(n.path),c=t,u=H(null),d=H(50);et(()=>{c.path===c.storage+"://"&&u.value&&hn(u.value,{scrollbars:{theme:"vf-scrollbars-theme"}})});const h=te(()=>{const w=e.treeViewData.find(S=>S.path===c.path)?.folders||[];return w.length>d.value?w.slice(0,d.value):w}),v=te(()=>e.treeViewData.find(w=>w.path===c.path)?.folders?.length||0),p=te(()=>v.value>d.value),f=te(()=>`${c.storage}://`),_=(w,S)=>w===S||w.startsWith(`${S}/`);$e(h,w=>{const S=s.value.expandTreeByDefault&&c.path===f.value,b=s.value.expandedTreePaths||[];w.forEach(E=>{const x=b.some(O=>_(O,E.path));(S||x)&&o.value[E.path]===void 0&&(o.value[E.path]=!0)})},{immediate:!0});const C=()=>{d.value+=50};return(w,S)=>{const b=Ue("TreeSubfolderList",!0);return y(),T("ul",{ref_key:"parentSubfolderList",ref:u,class:"vuefinder__treesubfolderlist__container"},[h.value.length?ue("",!0):(y(),T("li",Jj,[g("div",Zj,L(m(a)("No folders")),1)])),(y(!0),T(Me,null,He(h.value,E=>(y(),T("li",{key:E.path,class:"vuefinder__treesubfolderlist__item"},[g("div",ez,[g("div",{class:"vuefinder__treesubfolderlist__item-toggle",onClick:x=>o.value[E.path]=!o.value[E.path]},[j(f_,{modelValue:o.value[E.path],"onUpdate:modelValue":x=>o.value[E.path]=x,storage:t.storage,path:E.path},null,8,["modelValue","onUpdate:modelValue","storage","path"])],8,tz),g("div",We({class:"vuefinder__treesubfolderlist__item-link",title:E.path},bn(m(i).events({...E,dir:E.path,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"}),!0),{onDblclick:x=>o.value[E.path]=!o.value[E.path],onClick:x=>m(e).adapter.open(E.path)}),[g("div",iz,[m(l)?.path===E.path?(y(),ne(m(wu),{key:0,class:"vuefinder__item-icon__folder--open"})):(y(),ne(m(zn),{key:1,class:"vuefinder__item-icon__folder"}))]),g("div",{class:Ae(["vuefinder__treesubfolderlist__item-text",{"vuefinder__treesubfolderlist__item-text--active":m(l).path===E.path}])},L(E.basename),3)],16,nz)]),g("div",oz,[it(j(b,{storage:c.storage,path:E.path},null,8,["storage","path"]),[[Sn,o.value[E.path]]])])]))),128)),p.value?(y(),T("li",rz,[g("div",{class:"vuefinder__treesubfolderlist__load-more",onClick:C},L(m(a)("load more")),1)])):ue("",!0)],512)}}}),az=Ce({__name:"TreeStorageItem",props:{storage:{}},setup(t){const e=je(),n=e.fs,i=e.config,o=t,r=Oe(i.state),s=te(()=>{const v=r.value.expandedTreePaths||[],p=`${o.storage}://`;return v.some(f=>f===p||f.startsWith(`${p}`))}),a=H(r.value.expandTreeByDefault||s.value),l=dr(e,["vuefinder__drag-over"]),c=Oe(n.path),u=te(()=>o.storage===c.value?.storage);$e(()=>({expandTreeByDefault:r.value.expandTreeByDefault,hasExpandedPathInStorage:s.value}),v=>{(v.expandTreeByDefault||v.hasExpandedPathInStorage)&&(a.value=!0)});const d={storage:o.storage,path:o.storage+"://",dir:o.storage+"://",type:"dir",basename:o.storage,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"};function h(v){v===c.value?.storage?a.value=!a.value:e.adapter.open(v+"://")}return(v,p)=>(y(),T(Me,null,[g("div",{class:"vuefinder__treestorageitem__header",onClick:p[2]||(p[2]=f=>h(t.storage))},[g("div",We({class:["vuefinder__treestorageitem__info",u.value?"vuefinder__treestorageitem__info--active":""]},bn(m(l).events(d),!0)),[g("div",{class:Ae(["vuefinder__treestorageitem__icon",u.value?"vuefinder__treestorageitem__icon--active":""])},[j(m(bu))],2),g("div",null,L(t.storage),1)],16),g("div",{class:"vuefinder__treestorageitem__loader",onClick:p[1]||(p[1]=Ye(f=>a.value=!a.value,["stop"]))},[j(f_,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=f=>a.value=f),storage:t.storage,path:t.storage+"://"},null,8,["modelValue","storage","path"])])]),it(j(sz,{storage:t.storage,path:t.storage+"://",class:"vuefinder__treestorageitem__subfolder"},null,8,["storage","path"]),[[Sn,a.value]])],64))}}),lz={class:"vuefinder__folder-indicator"},cz={class:"vuefinder__folder-indicator--icon"},uz=Ce({__name:"FolderIndicator",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=oc(t,"modelValue");return(n,i)=>(y(),T("div",lz,[g("div",cz,[e.value?(y(),ne(m(na),{key:0,class:"vuefinder__folder-indicator--minus"})):ue("",!0),e.value?ue("",!0):(y(),ne(m(ta),{key:1,class:"vuefinder__folder-indicator--plus"}))])]))}}),dz={key:0,class:"vuefinder__treeview__header"},hz={class:"vuefinder__treeview__pinned-label"},fz={class:"vuefinder__treeview__pin-text text-nowrap"},pz={key:0,class:"vuefinder__treeview__pinned-list"},mz=["onClick"],vz=["title"],gz=["onClick"],_z={key:0},yz={class:"vuefinder__treeview__no-pinned"},bz=Ce({__name:"TreeView",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,{getStore:o,setStore:r}=e.storage,s=e.fs,a=e.config,l=Oe(a.state),c=Oe(s.sortedFiles),u=Oe(s.storages),d=te(()=>u.value||[]),h=Oe(s.path),v=dr(e,["vuefinder__drag-over"]),p=H(190),f=H(o("pinned-folders-opened",!0));$e(f,S=>r("pinned-folders-opened",S));const _=S=>{const b=a.get("pinnedFolders");a.set("pinnedFolders",b.filter(E=>E.path!==S.path))},C=S=>{const b=S.clientX,E=S.target.parentElement;if(!E)return;const x=E.getBoundingClientRect().width;E.classList.remove("transition-[width]"),E.classList.add("transition-none");const O=K=>{p.value=x+K.clientX-b,p.value<50&&(p.value=0,a.set("showTreeView",!1)),p.value>50&&a.set("showTreeView",!0)},$=()=>{const K=E.getBoundingClientRect();p.value=K.width,E.classList.add("transition-[width]"),E.classList.remove("transition-none"),window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",$)};window.addEventListener("mousemove",O),window.addEventListener("mouseup",$)},w=H(null);return et(()=>{w.value&&hn(w.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),$e(c,S=>{const b=S.filter(E=>E.type==="dir");h_(e.treeViewData,{path:h.value.path||"",folders:b.map(E=>({storage:E.storage,path:E.path,basename:E.basename,type:"dir"}))})}),(S,b)=>(y(),T(Me,null,[g("div",{class:Ae(["vuefinder__treeview__overlay",m(l).showTreeView?"vuefinder__treeview__backdrop":"hidden"]),onClick:b[0]||(b[0]=E=>m(a).toggle("showTreeView"))},null,2),g("div",{style:At(m(l).showTreeView?"min-width:100px;max-width:75%; width: "+p.value+"px":"width: 0"),class:"vuefinder__treeview__container"},[g("div",{ref_key:"treeViewScrollElement",ref:w,class:"vuefinder__treeview__scroll"},[m(n)("pinned")?(y(),T("div",dz,[g("div",{class:"vuefinder__treeview__pinned-toggle",onClick:b[2]||(b[2]=E=>f.value=!f.value)},[g("div",hz,[j(m(yu),{class:"vuefinder__treeview__pin-icon"}),g("div",fz,L(m(i)("Pinned Folders")),1)]),j(uz,{modelValue:f.value,"onUpdate:modelValue":b[1]||(b[1]=E=>f.value=E)},null,8,["modelValue"])]),f.value?(y(),T("ul",pz,[(y(!0),T(Me,null,He(m(l).pinnedFolders,E=>(y(),T("li",{key:E.path,class:"vuefinder__treeview__pinned-item"},[g("div",We({class:"vuefinder__treeview__pinned-folder"},bn(m(v).events(E),!0),{onClick:x=>m(e).adapter.open(E.path)}),[m(h).path!==E.path?(y(),ne(m(zn),{key:0,class:"vuefinder__treeview__folder-icon vuefinder__item-icon__folder"})):ue("",!0),m(h).path===E.path?(y(),ne(m(wu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__treeview__open-folder-icon"})):ue("",!0),g("div",{title:E.path,class:Ae(["vuefinder__treeview__folder-name",{"vuefinder__treeview__folder-name--active":m(h).path===E.path}])},L(E.basename),11,vz)],16,mz),g("div",{class:"vuefinder__treeview__remove-folder",onClick:x=>_(E)},[j(m(Gj),{class:"vuefinder__treeview__remove-icon"})],8,gz)]))),128)),m(l).pinnedFolders.length?ue("",!0):(y(),T("li",_z,[g("div",yz,L(m(i)("No folders pinned")),1)]))])):ue("",!0)])):ue("",!0),(y(!0),T(Me,null,He(d.value,E=>(y(),T("div",{key:E,class:"vuefinder__treeview__storage"},[j(az,{storage:E},null,8,["storage"])]))),128))],512),g("div",{class:"vuefinder__treeview__resize-handle",onMousedown:C},null,32)],4)],64))}}),xt={new_folder:"new_folder",selectAll:"selectAll",pinFolder:"pinFolder",unpinFolder:"unpinFolder",delete:"delete",refresh:"refresh",preview:"preview",open:"open",openDir:"openDir",download:"download",archive:"archive",unarchive:"unarchive",rename:"rename",move:"move",copy:"copy",paste:"paste"};function wz(t){return t.items.length>1&&t.items.some(e=>e.path===t.target?.path)?"many":t.target?"one":"none"}function mt(t){const e=Object.assign({needsSearchQuery:!1},t);return(n,i)=>!(e.needsSearchQuery!==!!i.searchQuery||e.target!==void 0&&e.target!==wz(i)||e.targetType!==void 0&&e.targetType!==i.target?.type||e.mimeType!==void 0&&e.mimeType!==i.target?.mime_type||e.feature!==void 0&&!(n.features[e.feature]??!1))}function Eo(...t){return(e,n)=>t.some(i=>i(e,n))}function xo(...t){return(e,n)=>t.every(i=>i(e,n))}const p_=[{id:xt.openDir,title:({t})=>t("Open containing folder"),action:(t,e)=>{const n=e[0];n&&t.adapter.open(n.dir)},show:mt({target:"one",needsSearchQuery:!0}),order:10},{id:xt.refresh,title:({t})=>t("Refresh"),action:t=>{const e=t.fs;t.adapter.invalidateListQuery(e.path.get().path),t.adapter.open(e.path.get().path)},show:Eo(mt({target:"none"}),mt({target:"many"})),order:20},{id:xt.selectAll,title:({t})=>t("Select All"),action:t=>{t.fs.selectAll(t.selectionMode||"multiple")},show:(t,e)=>t.selectionMode==="multiple"&&mt({target:"none"})(t,e),order:30},{id:xt.new_folder,title:({t})=>t("New Folder"),action:t=>t.modal.open(Tu),show:mt({target:"none",feature:"newfolder"}),order:40},{id:xt.open,title:({t})=>t("Open"),action:(t,e)=>{e[0]&&t.adapter.open(e[0].path)},show:mt({target:"one",targetType:"dir"}),order:50},{id:xt.pinFolder,title:({t})=>t("Pin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders"),o=i.concat(e.filter(r=>i.findIndex(s=>s.path===r.path)===-1));n.set("pinnedFolders",o)},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)===-1),order:60},{id:xt.unpinFolder,title:({t})=>t("Unpin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders");n.set("pinnedFolders",i.filter(o=>!e.find(r=>r.path===o.path)))},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)!==-1),order:70},{id:xt.preview,title:({t})=>t("Preview"),action:(t,e)=>t.modal.open(ur,{storage:e[0]?.storage,item:e[0]}),show:xo(mt({target:"one",feature:"preview"}),(t,e)=>e.target?.type!=="dir"),order:80},{id:xt.download,link:(t,e)=>{if(e[0])return t.adapter.getDownloadUrl(e[0])},title:({t})=>t("Download"),action:()=>{},show:xo(mt({target:"one",feature:"download"}),(t,e)=>e.target?.type!=="dir"),order:90},{id:xt.rename,title:({t})=>t("Rename"),action:(t,e)=>t.modal.open(ea,{items:e}),show:mt({target:"one",feature:"rename"}),order:100},{id:xt.move,title:({t})=>t("Move files"),action:(t,e)=>{const n=t.fs,i={storage:n.path.get().storage||"",path:n.path.get().path||"",type:"dir"};t.modal.open(uo,{items:{from:e,to:i}})},show:Eo(mt({target:"one",feature:"move"}),mt({target:"many",feature:"move"})),order:110},{id:xt.copy,title:({t})=>t("Copy"),action:(t,e)=>{e.length>0&&t.fs.setClipboard("copy",new Set(e.map(n=>n.path)))},show:Eo(mt({target:"one",feature:"copy"}),mt({target:"many",feature:"copy"})),order:120},{id:xt.paste,title:({t})=>t("Paste"),action:(t,e)=>{const n=t.fs.getClipboard();if(n?.items?.size>0){const i=t.fs.path.get();let o=i.path,r=i.storage;e.length===1&&e[0]?.type==="dir"&&(o=e[0].path,r=e[0].storage);const s={storage:r||"",path:o||"",type:"dir"};t.modal.open(n.type==="cut"?uo:Cu,{items:{from:Array.from(n.items),to:s}})}},show:(t,e)=>t.features?.copy??!1?t.fs.getClipboard()?.items?.size>0:!1,order:130},{id:xt.archive,title:({t})=>t("Archive"),action:(t,e)=>t.modal.open(Ou,{items:e}),show:Eo(mt({target:"many",feature:"archive"}),xo(mt({target:"one",feature:"archive"}),(t,e)=>e.target?.mime_type!=="application/zip")),order:140},{id:xt.unarchive,title:({t})=>t("Unarchive"),action:(t,e)=>t.modal.open(ku,{items:e}),show:mt({target:"one",feature:"unarchive",mimeType:"application/zip"}),order:150},{id:xt.delete,title:({t})=>t("Delete"),action:(t,e)=>{t.modal.open(Zs,{items:e})},show:Eo(mt({feature:"delete",target:"one"}),mt({feature:"delete",target:"many"})),order:160}],Sz=["data-theme"],Cz={key:0,class:"vuefinder__external-drop-overlay vuefinder__external-drop-overlay--relative"},Ez={class:"vuefinder__external-drop-message"},xz={class:"vuefinder__main__content"},Tz=Ce({__name:"VueFinderView",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean},locale:{},contextMenuItems:{},selectionMode:{},selectionFilterType:{},selectionFilterMimeIncludes:{},onError:{type:Function},onSelect:{type:Function},onPathChange:{type:Function},onUploadComplete:{type:Function},onDeleteComplete:{type:Function},onNotify:{type:Function},onReady:{type:Function},onFileDclick:{type:Function},onFolderDclick:{type:Function},customUploader:{type:Function}},emits:["select","path-change","upload-complete","delete-complete","notify","error","ready","file-dclick","folder-dclick","update:locale"],setup(t,{emit:e}){const n=e,i=t,o=je(),r=Mn("root"),s=o.config;$e(()=>i.features,w=>{const S=Hg(w);Object.keys(o.features).forEach(b=>{delete o.features[b]}),Object.assign(o.features,S)},{deep:!0});const a=o.fs,l=Oe(o.i18n.localeAtom),c=Oe(s.state),u=te(()=>{const w=c.value;return{"--vf-grid-item-width":`${w.gridItemWidth}px`,"--vf-grid-item-height":`${w.gridItemHeight}px`,"--vf-grid-item-gap":`${w.gridItemGap}px`,"--vf-grid-icon-size":`${w.gridIconSize}px`,"--vf-list-item-height":`${w.listItemHeight}px`,"--vf-list-item-gap":`${w.listItemGap}px`,"--vf-list-icon-size":`${w.listIconSize}px`}});O5();const{isDraggingExternal:d,handleDragEnter:h,handleDragOver:v,handleDragLeave:p,handleDrop:f}=A5();function _(w){a.setPath(w.dirname),s.get("persist")&&s.set("path",w.dirname),a.setReadOnly(w.read_only??!1),o.modal.close(),a.setFiles(w.files),a.clearSelection(),a.setSelectedCount(0),a.setStorages(w.storages)}o.adapter.onBeforeOpen=()=>{a.setLoading(!0)},o.adapter.onAfterOpen=w=>{_(w),a.setLoading(!1)},o.emitter.on("vf-upload-complete",w=>{n("upload-complete",w)}),o.emitter.on("vf-delete-complete",w=>{n("delete-complete",w)}),o.emitter.on("vf-notify",w=>{n("notify",w)}),o.emitter.on("vf-file-dclick",w=>{n("file-dclick",w)}),o.emitter.on("vf-folder-dclick",w=>{n("folder-dclick",w)}),$e(()=>i.config?.theme,w=>{w&&s.set("theme",m(w))},{immediate:!0}),$e(l,(w,S)=>{w!==S&&n("update:locale",String(w))},{immediate:!1}),et(()=>{o.root=r.value,$e(()=>s.get("path"),S=>{o.adapter.open(S)});const w=s.get("persist")?s.get("path"):s.get("initialPath")??"";a.setPath(w),o.adapter.open(w),a.path.listen(S=>{n("path-change",S.path)}),a.selectedItems.listen(S=>{n("select",S)}),n("ready")});const C=async w=>{const S=await f(w);S.length>0&&(o.modal.open($u),setTimeout(()=>{o.emitter.emit("vf-external-files-dropped",S.map(b=>b.file))},100))};return(w,S)=>(y(),T("div",{ref_key:"root",ref:r,tabindex:"0",class:Ae(["vuefinder vuefinder__main vuefinder__themer",{"vuefinder--dragging-external":m(d)}]),"data-theme":m(o).theme.current,style:At(u.value),onDragenter:S[2]||(S[2]=(...b)=>m(h)&&m(h)(...b)),onDragover:S[3]||(S[3]=(...b)=>m(v)&&m(v)(...b)),onDragleave:S[4]||(S[4]=(...b)=>m(p)&&m(p)(...b)),onDrop:C},[g("div",{class:Ae(m(o).theme.current),style:{height:"100%",width:"100%"}},[g("div",{class:Ae([m(c)?.fullScreen?"vuefinder__main__fixed":"vuefinder__main__relative","vuefinder__main__container"]),onMousedown:S[0]||(S[0]=b=>m(o).emitter.emit("vf-contextmenu-hide")),onTouchstart:S[1]||(S[1]=b=>m(o).emitter.emit("vf-contextmenu-hide"))},[m(d)?(y(),T("div",Cz,[g("div",Ez,L(m(o).i18n.t("Drag and drop the files/folders to here.")),1)])):ue("",!0),m(c).showMenuBar?(y(),ne(eL,{key:1})):ue("",!0),m(c).showToolbar?(y(),ne(n3,{key:2})):ue("",!0),j(H3),g("div",xz,[j(bz),j(Pj,{"on-file-dclick":i.onFileDclick,"on-folder-dclick":i.onFolderDclick},{icon:we(b=>[Ve(w.$slots,"icon",wn(Jn(b)))]),_:3},8,["on-file-dclick","on-folder-dclick"])]),j(Wj,null,{actions:we(b=>[Ve(w.$slots,"status-bar",wn(Jn(b)))]),_:3})],34),(y(),ne(Es,{to:"body"},[j(Kf,{name:"fade"},{default:we(()=>[m(o).modal.visible?(y(),ne($t(m(o).modal.type),{key:0})):ue("",!0)]),_:1})])),j(Ij,{items:m(p_)},null,8,["items"]),m(c).notificationsEnabled?(y(),ne(m(wk),{key:0,position:m(c).notificationPosition,duration:m(c).notificationDuration,"visible-toasts":m(c).notificationVisibleToasts,"rich-colors":m(c).notificationRichColors},null,8,["position","duration","visible-toasts","rich-colors"])):ue("",!0)],2)],46,Sz))}}),$z=Ce({__name:"VueFinderProvider",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean,default:!1},locale:{},contextMenuItems:{default:()=>p_},selectionMode:{default:"multiple"},selectionFilterType:{default:"both"},selectionFilterMimeIncludes:{default:()=>[]},onError:{},onSelect:{},onPathChange:{},onUploadComplete:{},onDeleteComplete:{},onNotify:{},onReady:{},onFileDclick:{},onFolderDclick:{},customUploader:{}},setup(t){const e=t,n=e.id??Po(tc);if(!n)throw new Error('VueFinderProvider requires an "id" prop.');const i=vM(e,Po("VueFinderOptions")||{});return $e(()=>e.config,o=>{if(o){const r={};for(const s in o){const a=m(o[s]);a!==void 0&&(r[s]=a)}i.config.init(r)}},{deep:!0,immediate:!0}),$e(()=>e.locale,o=>{o&&i.i18n.localeAtom&&i.i18n.localeAtom.get()!==o&&i.i18n.localeAtom.set(o)},{immediate:!0}),JR(n,i),Qf(tc,n),Cs(()=>{ZR(n)}),(o,r)=>(y(),ne(Tz,wn(Jn(e)),{icon:we(s=>[Ve(o.$slots,"icon",wn(Jn(s)))]),"status-bar":we(s=>[Ve(o.$slots,"status-bar",wn(Jn(s)))]),_:3},16))}});function MN(t){const e=je(t),n=o=>o||e.fs.path.get().path||"",i=o=>{Array.isArray(o.files)&&e.fs.setFiles(o.files)};return{async refresh(){const o=e.fs.path.get().path||"";e.adapter.invalidateListQuery(o),await e.adapter.open(o)},async open(o){await e.adapter.open(o)},preview(o){const r=(e.fs.files.get()||[]).find(s=>s.path===o);!r||r.type!=="file"||e.modal.open(ur,{storage:r.storage,item:r})},notify(o,r){Hi(e,o,r)},getPath(){return e.fs.path.get().path||""},select(o){const r=new Set((e.fs.files.get()||[]).map(a=>a.path)),s=(o||[]).filter(a=>r.has(a));e.fs.setSelection(s)},selectOne(o){new Set((e.fs.files.get()||[]).map(r=>r.path)).has(o)&&e.fs.setSelection([o])},clearSelection(){e.fs.clearSelection()},getSelectedPaths(){return(e.fs.selectedItems.get()||[]).map(o=>o.path)},async createFolder(o,r){const s=await e.adapter.createFolder({path:n(r),name:o});i(s)},async createFile(o,r){const s=await e.adapter.createFile({path:n(r),name:o});i(s)},async delete(o,r){const s=n(r),a=new Map((e.fs.files.get()||[]).map(u=>[u.path,u])),l=(o||[]).map(u=>a.get(u)).filter(u=>!!u).map(u=>({path:u.path,type:u.type})),c=await e.adapter.delete({path:s,items:l});i(c)},async rename(o,r,s){const a=await e.adapter.rename({path:n(s),item:o,name:r});i(a)},async copy(o,r,s){const a=await e.adapter.copy({path:n(s),sources:o,destination:r});i(a)},async move(o,r,s){const a=await e.adapter.move({path:n(s),sources:o,destination:r});i(a)},getFiles(){return e.fs.files.get()||[]},getStorages(){return e.fs.storages.get()||[]},isLoading(){return e.fs.isLoading()},isReadOnly(){return e.fs.getReadOnly()}}}const kz={install(t,e={}){e.i18n=e.i18n??{};const[n]=Object.keys(e.i18n);e.locale=e.locale??n??"en",t.provide("VueFinderOptions",e),t.component("VueFinder",$z)}};function Oz(t){t.use(kz,{i18n:{zhCN:()=>nt(()=>import("./zhCN-0_iHo67e.js"),[]),en:()=>nt(()=>import("./en-C_Tot-hO.js"),[])}})}const{i18n:$i}=Ec;let is=!1,To=null,Nr=[];async function Az(){return is&&To||(is=!0,To=(async()=>{try{return(await Ai.v1Token.tokencontrollerRefresh({headers:{[ki]:xi.generateBearerToken(Bb())}})).code===0}catch(t){return console.error(t),!1}finally{is=!1,To=null}})()),To}async function Pz(t){return Mz(t)?(rs.error($i.global.t("message.error.loginExpired")),no().logoutDialog(),Promise.reject($i.global.t("message.error.loginExpired"))):new Promise((e,n)=>{Nr.push({resolve:e,reject:n,config:t}),is||Az().then(i=>{i?Nr.forEach(({resolve:o,reject:r,config:s})=>{s.headers[li]=xi.generateBearerToken(ss()),Rz(s),Au.request(s).then(o).catch(r)}):(Nr.forEach(({reject:o})=>o($i.global.t("message.error.refreshFailed"))),rs.error($i.global.t("message.error.loginExpired")),no().logoutDialog()),Nr=[]})})}function m_(t){return t.headers[vt.CSRF_TOKEN_HEADER_NAME]=ym.get(vt.CSRF_KEY),t.headers[li]=xi.generateBearerToken(ss()),t.headers[vt.ACCEPT_LANGUAGE_HEADER_NAME]=$i.global.locale.value,t}function Rz(t){t.headers["X-Token-Refreshed"]="true"}function Mz(t){return t.headers["X-Token-Refreshed"]==="true"}async function v_(t){if(t.headers[li]){const e=xi.extractBearerToken(t.headers[li]);Ub(e),t.config.headers[li]=xi.generateBearerToken(e)}if(t.headers[ki]){const e=xi.extractBearerToken(t.headers[ki]);Hb(e),t.config.headers[ki]=xi.generateBearerToken(e)}if(t.data.code===qd.Unauthorized&&!t.config.url?.includes("/api/v1/token/refresh"))return Pz(t.config);if(t.data.code===qd.Forbidden)return no().logoutDialog(),Promise.reject($i.global.t("user.notLoggedIn"));if(t.data.code!==0){const e=t.data.message||$i.global.t("message.error.requestFailed");return rs.error(e),Promise.reject(e)}return t.data}function oa(t){return console.error(t),rs.error(t.message),Promise.reject(t)}const Au=_m(vt.REMOTE_SERVICE_PREFIX,{baseURL:`/${vt.REMOTE_SERVICE_PREFIX}`});Au.interceptors.request.use(m_,oa);Au.interceptors.response.use(v_,oa);const Iz=Fb(),g_=_m(vt.LOCAL_SERVICE_PREFIX,{baseURL:Iz});g_.interceptors.request.use(m_,oa);g_.interceptors.response.use(v_,oa);var os={exports:{}};var Fz=os.exports,Wf;function Dz(){return Wf||(Wf=1,(function(t,e){(function(n,i){t.exports=i()})(Fz,function(){var n={};n.version="0.2.0";var i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(p){var f,_;for(f in p)_=p[f],_!==void 0&&p.hasOwnProperty(f)&&(i[f]=_);return this},n.status=null,n.set=function(p){var f=n.isStarted();p=o(p,i.minimum,1),n.status=p===1?null:p;var _=n.render(!f),C=_.querySelector(i.barSelector),w=i.speed,S=i.easing;return _.offsetWidth,a(function(b){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),l(C,s(p,w,S)),p===1?(l(_,{transition:"none",opacity:1}),_.offsetWidth,setTimeout(function(){l(_,{transition:"all "+w+"ms linear",opacity:0}),setTimeout(function(){n.remove(),b()},w)},w)):setTimeout(b,w)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var p=function(){setTimeout(function(){n.status&&(n.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},n.done=function(p){return!p&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(p){var f=n.status;return f?(typeof p!="number"&&(p=(1-f)*o(Math.random()*f,.1,.95)),f=o(f+p,0,.994),n.set(f)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},(function(){var p=0,f=0;n.promise=function(_){return!_||_.state()==="resolved"?this:(f===0&&n.start(),p++,f++,_.always(function(){f--,f===0?(p=0,n.done()):n.set((p-f)/p)}),this)}})(),n.render=function(p){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var f=document.createElement("div");f.id="nprogress",f.innerHTML=i.template;var _=f.querySelector(i.barSelector),C=p?"-100":r(n.status||0),w=document.querySelector(i.parent),S;return l(_,{transition:"all 0 linear",transform:"translate3d("+C+"%,0,0)"}),i.showSpinner||(S=f.querySelector(i.spinnerSelector),S&&v(S)),w!=document.body&&u(w,"nprogress-custom-parent"),w.appendChild(f),f},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&v(p)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var p=document.body.style,f="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return f+"Perspective"in p?"translate3d":f+"Transform"in p?"translate":"margin"};function o(p,f,_){return p<f?f:p>_?_:p}function r(p){return(-1+p)*100}function s(p,f,_){var C;return i.positionUsing==="translate3d"?C={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?C={transform:"translate("+r(p)+"%,0)"}:C={"margin-left":r(p)+"%"},C.transition="all "+f+"ms "+_,C}var a=(function(){var p=[];function f(){var _=p.shift();_&&_(f)}return function(_){p.push(_),p.length==1&&f()}})(),l=(function(){var p=["Webkit","O","Moz","ms"],f={};function _(b){return b.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,x){return x.toUpperCase()})}function C(b){var E=document.body.style;if(b in E)return b;for(var x=p.length,O=b.charAt(0).toUpperCase()+b.slice(1),$;x--;)if($=p[x]+O,$ in E)return $;return b}function w(b){return b=_(b),f[b]||(f[b]=C(b))}function S(b,E,x){E=w(E),b.style[E]=x}return function(b,E){var x=arguments,O,$;if(x.length==2)for(O in E)$=E[O],$!==void 0&&E.hasOwnProperty(O)&&S(b,O,$);else S(b,x[1],x[2])}})();function c(p,f){var _=typeof p=="string"?p:h(p);return _.indexOf(" "+f+" ")>=0}function u(p,f){var _=h(p),C=_+f;c(_,f)||(p.className=C.substring(1))}function d(p,f){var _=h(p),C;c(p,f)&&(C=_.replace(" "+f+" "," "),p.className=C.substring(1,C.length-1))}function h(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function v(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return n})})(os)),os.exports}var Lz=Dz();const Pu=Li(Lz);Pu.configure({easing:"ease",speed:500,showSpinner:!1,trickleSpeed:200,parent:"body"});async function jz(t){await y$(),wm(t),Sm(t),b2(t),N2(t),V2(),K2(),_$(t),b$(t),w$(t),Oz(t)}const __=vi("setting",{state:()=>({dependencies:[],devDependencies:[],packageJson:{}}),getters:{vueVersion:t=>t.dependencies.find(e=>e.name==="vue")?.version||"",deps:t=>[...t.dependencies,...t.devDependencies],compHubVersion:()=>window.__GLOBAL_CONFIG__.version||""},actions:{setDependencies(t){this.$patch(e=>{e.dependencies=t})},setDevDependencies(t){this.$patch(e=>{e.devDependencies=t})},setPackageJson(t){this.$patch(e=>{e.packageJson=t})},async initSetting(){await this.fetchPackageJson(),await this.initPreviewSetting()},async fetchPackageJson(){await uC.v1Comp.compcontrollerPackagejson().then(t=>{const e=t.data?.packageJson??{};this.setPackageJson(e)})},async initPreviewSetting(){const t=Ji(Qb,{dependencies:[],devDependencies:[]}),{dependencies:e=[],devDependencies:n=[]}=t.value,i=Object.entries(this.packageJson?.dependencies??{}).map(([r,s])=>{const a=e.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}}),o=Object.entries(this.packageJson?.devDependencies??{}).map(([r,s])=>{const a=n.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}});t.value={dependencies:i,devDependencies:o},this.setDependencies(i),this.setDevDependencies(o)}}}),zz=vi("upgrade",{state:()=>({upgradeInfo:{}}),getters:{isForceUpgrade:t=>t.upgradeInfo.hasUpgrade&&t.upgradeInfo.isForce,isUpgrade:t=>t.upgradeInfo.hasUpgrade,upgradeDesc:t=>t.upgradeInfo.desc,latestVersion:t=>t.upgradeInfo.latestVersion,hasUpgrade:t=>t.upgradeInfo.hasUpgrade},actions:{setUpgradeInfo(t){this.$patch(e=>{e.upgradeInfo=t})},async getUpgradeInfo(){if(Object.keys(this.upgradeInfo).length>0)return;const t=__(),e=await Ai.v2Upgrade.upgradecontrollerv2Check({compHubVersion:t.compHubVersion});this.setUpgradeInfo(e.data)}}}),{i18n:Nz}=Ec;Is.beforeEach(async(t,e)=>{Pu.start();const n=Jo(),i=no(),o=__(),r=zz();if(t.path!==e.path&&(await o.initSetting(),await i.fetchCsrfToken(),await r.getUpgradeInfo()),r.isForceUpgrade&&!t.path.startsWith("/upgrade"))return{path:"/upgrade"};if(t.path===e.path&&t.fullPath!==e.fullPath)return;const s=n.visitedViews.find(l=>l.path===t.path);if(s){if(t.fullPath===s.fullPath)return;const{hash:l="",query:c={}}=t,{query:u={},hash:d=""}=s,h=uy(u);if(!t.redirectedFrom){const v={query:{...h,...c},hash:l||d};return{path:t.path,...v}}}if(i.isGuestLogin()||!i.isAccessTokenExist()){if(!t.meta.noAuth)return i.logoutDialog(),!1}else{if(t.meta.noAuth){if(t.path.startsWith("/login")){const l=t.query.type==="logout";if(i.isAccessTokenExist()&&!l)return"/"}else i.isRealUserLogin()||await i.fetchWhoAmI();return}if(i.isRealUserLogin()||await i.fetchWhoAmI(),!i.isRealUserLogin())return i.logoutDialog(),!1}});Is.afterEach(t=>{const e=t.meta.title;document.title=Nz.global.t(e)||vt.SITE_TITLE,Pu.done()});async function Uz(){const t=ac(jb);await jz(t),t.mount("#app")}Uz();export{__ as A,qw as B,tN as C,Qb as D,Jo as E,DE as F,p_ as G,sN as H,Wb as I,zz as J,cN as K,Kz as L,no as M,iN as N,oN as O,Jz as R,nN as S,Xz as T,aN as V,vt as _,lN as a,Yz as b,Qz as c,Kg as d,Wz as e,nw as f,rN as g,eN as h,Zz as i,Gz as j,Rw as k,nt as l,dc as m,i0 as n,Ec as o,uN as p,MN as q,Hz as r,uC as s,Qw as t,Ib as u,Ai as v,Cc as w,qz as x,Fb as y,IE as z};
20
+ type: ${a.type}`)}),i.length>0&&this.#f()}removeFiles(e){const{files:n,currentUploads:i}=this.getState(),o={...n},r={...i},s=Object.create(null);e.forEach(u=>{n[u]&&(s[u]=n[u],delete o[u])});function a(u){return s[u]===void 0}Object.keys(r).forEach(u=>{const d=i[u].fileIDs.filter(a);if(d.length===0){delete r[u];return}const{capabilities:h}=this.getState();if(d.length!==i[u].fileIDs.length&&!h.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[u]={...i[u],fileIDs:d}});const l={currentUploads:r,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#d();const c=Object.keys(s);c.forEach(u=>{this.emit("file-removed",s[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),o=!(n.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",n,o),o}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!0};e[i]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{const o={...e[i],isPaused:!1,error:null};e[i]=o}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const i=e[n];return i.error&&(!i.missingRequiredMetaFields||i.missingRequiredMetaFields.length===0)})}async#g(){const e=this.#v(),n={...this.getState().files};if(e.forEach(o=>{n[o]={...n[o],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const i=this.#h(e,{forceAllowNewUpload:!0});return this.#p(i)}async retryAll(){const e=await this.#g();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Pr)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=this.#h([e],{forceAllowNewUpload:!0});return this.#p(n)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#C=(e,n)=>{const i=e?this.getFile(e.id):void 0;if(e==null||!i){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(i.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const o={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};i.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...i.progress,...o,bytesUploaded:n.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...o}}),this.#d()};#_(){const e=this.#E();let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})}#d=jO(()=>this.#_(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#_()}#E(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const i=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,o=n.filter(i),r=n.filter(l=>!i(l));if(o.every(l=>l.progress.uploadComplete)&&r.length>0&&!r.every(l=>l.progress.uploadComplete))return null;const s=o.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=o.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return s===0?0:a/s}#x(){const e=(o,r,s)=>{let a=o.message||"Unknown error";o.details&&(a+=` ${o.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:s})};this.on("error",e),this.on("upload-error",(o,r,s)=>{if(e(r,o,s),typeof r=="object"&&r.message){this.log(r.message,"error");const a=new Error(this.i18n("failedToUpload",{file:o?.name??""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),this.#s([a])}else this.#s([r])});let n=null;this.on("upload-stalled",(o,r)=>{const{message:s}=o,a=r.map(l=>l.meta.name).join(", ");n||(this.info({message:s,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${s} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const i=o=>{const r=o.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),s=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(s)};this.on("upload-start",i),this.on("upload-progress",this.#C),this.on("upload-success",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const s=this.getFile(o.id).progress,a=this.#a.size>0;this.setFileState(o.id,{progress:{...s,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:s.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),o.size==null&&this.setFileState(o.id,{size:r.bytesUploaded||s.bytesTotal}),this.#d()}),this.on("preprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getFile(o.id).progress,preprocess:r}})}),this.on("preprocess-complete",o=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const r={...this.getState().files};r[o.id]={...r[o.id],progress:{...r[o.id].progress}},delete r[o.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(o,r)=>{if(o==null||!this.getFile(o.id)){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}this.setFileState(o.id,{progress:{...this.getState().files[o.id].progress,postprocess:r}})}),this.on("postprocess-complete",o=>{const r=o&&this.getFile(o.id);if(r==null){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}const{postprocess:s,...a}=r.progress;this.patchFilesState({[r.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{this.#d()}),this.on("dashboard:file-edit-complete",o=>{o&&this.#u(o)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#c),window.addEventListener("offline",this.#c),setTimeout(this.#c,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#c=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...n){if(typeof e!="function"){const s=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(s)}const i=new e(this,...n),o=i.id;if(!o)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(o);if(r){const s=`Already found a plugin named '${r.id}'. Tried to use: '${o}'.
21
+ Uppy plugins must have unique \`id\` options.`;throw new Error(s)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),i.type in this.#e?this.#e[i.type].push(i):this.#e[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const n of Object.values(this.#e)){const i=n.find(o=>o.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=this.#e[e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#c),window.removeEventListener("offline",this.#c))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",i=3e3){const o=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){const{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}#y=new Map;registerRequestClient(e,n){this.#y.set(e,n)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=this.#y.get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await this.#p(e);return this.emit("complete",n),n}#h(e,n={}){const{forceAllowNewUpload:i=!1}=n,{allowNewUpload:o,currentUploads:r}=this.getState();if(!o&&!i)throw new Error("Cannot create a new upload: already uploading.");const s=BO();return this.emit("upload",s,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[s]:{fileIDs:e,step:0,result:{}}}}),s}[Symbol.for("uppy test: createUpload")](...e){return this.#h(...e)}#T(e){const{currentUploads:n}=this.getState();return n[e]}addResultData(e,n){if(!this.#T(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:i}=this.getState(),o={...i[e],result:{...i[e].result,...n}};this.setState({currentUploads:{...i,[e]:o}})}#b(e){const{[e]:n,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async#p(e){const n=()=>{const{currentUploads:s}=this.getState();return s[e]};let i=n();if(!i)throw new Error("Nonexistent upload");const o=[...this.#r,...this.#o,...this.#a];try{for(let s=i.step||0;s<o.length;s++){const a=o[s];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:s}}});const{fileIDs:l}=i;if(await a(l,e),i=n(),!i)break}}catch(s){throw this.#b(e),s}if(i){i.fileIDs.forEach(c=>{const u=this.getFile(c);u?.progress.postprocess&&this.emit("postprocess-complete",u)});const s=i.fileIDs.map(c=>this.getFile(c)),a=s.filter(c=>!c.error),l=s.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),i=n()}let r;return i&&(r=i.result,this.#b(e)),r==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#v().length>0){const o=await this.#g();if(!(this.getFiles().filter(s=>s.progress.uploadStarted==null).length>0))return this.emit("complete",o),o;({files:e}=this.getState())}const i=this.opts.onBeforeUpload(e);if(i===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");i&&typeof i=="object"&&(e=i,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#l(e))throw new _n(this.i18n("missingRequiredMetaField"));const{currentUploads:o}=this.getState(),r=Object.values(o).flatMap(c=>c.fileIDs),s=Object.keys(e).filter(c=>{const u=this.getFile(c);return u&&!u.progress.uploadStarted&&!r.includes(c)}),a=this.#h(s),l=await this.#p(a);return this.emit("complete",l),l}catch(o){throw this.#s([o]),o}}}function Nh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),n.push.apply(n,i)}return n}function Xe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nh(Object(n),!0).forEach((function(i){ln(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nh(Object(n)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))}))}return t}function ln(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GO(t,e){if(t==null)return{};var n,i,o=(function(s,a){if(s==null)return{};var l,c,u={},d=Object.keys(s);for(c=0;c<d.length;c++)l=d[c],a.indexOf(l)>=0||(u[l]=s[l]);return u})(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Mi(t){return(function(e){if(Array.isArray(e))return La(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,n){if(e){if(typeof e=="string")return La(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return La(e,n)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function La(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Uh,QO,Rr,_t=(Uh=function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var s=typeof r;if(s==="string"||s==="number")i.push(r);else if(Array.isArray(r)){if(r.length){var a=n.apply(null,r);a&&i.push(a)}}else if(s==="object")if(r.toString===Object.prototype.toString)for(var l in r)e.call(r,l)&&r[l]&&i.push(l);else i.push(r.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},Uh(Rr={path:QO,exports:{},require:function(t,e){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(e==null&&Rr.path)}},Rr.exports),Rr.exports),En=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var o=t;return i&&(o+="__"+i),o+(n?Object.keys(n).reduce((function(r,s){var a=n[s];return a&&(r+=" "+(typeof a=="boolean"?o+"--"+s:o+"--"+s+"_"+a)),r}),""):"")}};function kl(t,e,n){var i,o,r,s,a;function l(){var u=Date.now()-s;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}e==null&&(e=100);var c=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(r,o),r=o=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},c}kl.debounce=kl;var Ol=kl,Re=function(){return Re=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Re.apply(this,arguments)};function rv(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function sv(t){return/^blob:/.test(t)}function Vh(t){return sv(t)||(function(e){return/^data:/.test(e)})(t)}function zi(t){return!!(t&&t.constructor&&t.call&&t.apply)}function yt(t){return t===void 0}function Xr(t){return typeof t=="object"&&t!==null}function Al(t,e,n){var i={};return Xr(t)?(Object.keys(e).forEach((function(o){yt(t[o])?i[o]=e[o]:Xr(e[o])?Xr(t[o])?i[o]=Al(t[o],e[o],n[o]):i[o]=t[o]?e[o]:n[o]:e[o]===!0||e[o]===!1?i[o]=!!t[o]:i[o]=t[o]})),i):t?e:n}function Ir(t){var e=Number(t);return Number.isNaN(e)?t:e}function Bh(t){return typeof(t=="number"||(function(e){return typeof e=="object"&&e!==null})(t)&&toString.call(t)=="[object Number]")&&!av(t)}function av(t){return t!=t}function lv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var ko=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},XO=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Rc=function(t){this.type="move",this.directions=t},JO=(function(){function t(e,n,i,o,r){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=o,this.element=n,this.anchor=r}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,o=e.position;if(n){var r=n.getBoundingClientRect(),s=r.left,a=r.top;return{left:o.left-s-i.left,top:o.top-a-i.top}}return{left:0,top:0}},t})(),Ic={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=Mi(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,o=e.bottom,r=e.top;this.anchor={left:t.clientX-n,top:t.clientY-r,bottom:o-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new JO(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};Ic.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onMouseover:e[3]||(e[3]=function(){return r.onMouseOver&&r.onMouseOver.apply(r,arguments)}),onMouseleave:e[4]||(e[4]=function(){return r.onMouseLeave&&r.onMouseLeave.apply(r,arguments)})},[Ve(t.$slots,"default")],34)};var ja=En("vue-handler-wrapper"),cv={name:"HandlerWrapper",components:{DraggableElement:Ic},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=rv(this.horizontalPosition,this.verticalPosition);t=ja((ln(e={},n.classname,!0),ln(e,"disabled",this.disabled),e))}else t=ja({disabled:this.disabled});return{root:t,draggable:ja("draggable")}}},emits:["leave","enter","drag","drag-end"]};cv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne("div",{class:r.classes.root},[j(s,{class:r.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])],2)};var ZO=En("vue-line-wrapper"),uv={name:"LineWrapper",components:{DraggableElement:Ic},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return ZO((ln(t={},this.position,!0),ln(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};uv.render=function(t,e,n,i,o,r){var s=Ue("DraggableElement");return y(),ne(s,{class:r.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["class"])};var Rn=["left","right","top","bottom"],eA=["left","right"],tA=["top","bottom"],nA=["left","top"],iA=["fill-area","fit-area","stencil","none"],Hh={left:0,top:0,width:0,height:0};function qh(t,e,n){return!(n=n||["width","height","left","top"]).some((function(i){return t[i]!==e[i]}))}function Ln(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function io(t,e){return{left:t.left-e.left,top:t.top-e.top}}function wt(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function No(t,e){var n={left:0,top:0,right:0,bottom:0};return Rn.forEach((function(i){var o=e[i],r=Ln(t)[i];n[i]=o!==void 0&&r!==void 0?i==="left"||i==="top"?Math.max(0,o-r):Math.max(0,r-o):0})),n}function An(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Ms(t){return{left:-t.left,top:-t.top}}function Wt(t,e){return Re(Re({},t),{left:t.left+e.left,top:t.top+e.top})}function un(t,e,n,i){if(e!==1){if(n){var o=wt(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-o.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-o.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Je(t){return t.width/t.height}function oo(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function ro(t,e){var n={left:0,top:0},i=No(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function za(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function dv(t,e){var n=Je(t),i=Je(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function hv(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function ai(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function Fs(t,e){var n=No(St(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,oo(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,oo(t,e)):1}function St(t,e,n){n===void 0&&(n=!1);var i=ro(t,e);return Wt(t,n?Ms(i):i)}function Pl(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function oA(t,e){return Re(Re({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function pv(t,e,n){n===void 0&&(n=!0);var i={};return Rn.forEach((function(o){var r=t[o],s=e[o];r!==void 0&&s!==void 0?i[o]=o==="left"||o==="top"?n?Math.max(r,s):Math.min(r,s):n?Math.min(r,s):Math.max(r,s):s!==void 0?i[o]=s:r!==void 0&&(i[o]=r)})),i}function Ds(t,e){return pv(t,e,!0)}function Wh(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,o=t.sizeRestrictions;return!!((e.correctRatio||Je(e)>=n.minimum&&Je(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(i||e.height>=o.minHeight&&e.width>=o.minWidth))}function Kh(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function Xn(t){var e=t.width,n=t.height,i=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},r={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(c,u){return u===void 0&&(u=!1),c.reduce((function(d,h){return Wh({size:h,aspectRatio:o,sizeRestrictions:i,ignoreMinimum:u})&&(!d||Kh(h,{width:e,height:n})<Kh(d,{width:e,height:n}))?h:d}),null)}var a=[];o&&[o.minimum,o.maximum].forEach((function(c){c&&a.push({width:r.width,height:r.width/c,correctRatio:!0},{width:r.height*c,height:r.height,correctRatio:!0})})),Wh({size:r,aspectRatio:o,sizeRestrictions:i})&&a.push(r);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Rl(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=Wt(n,e.directions);return Wt(r,ro(r,o))}function rA(t){var e=t.coordinates,n=t.transform,i=t.imageSize,o=t.sizeRestrictions,r=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(u,d){return Rl({coordinates:u,positionRestrictions:r,event:new Rc({left:d.left-u.left,top:d.top-u.top})})},c=Re({},e);return(Array.isArray(n)?n:[n]).forEach((function(u){var d={};yt((d=typeof u=="function"?u({coordinates:c,imageSize:i,visibleArea:a}):u).width)&&yt(d.height)||(c=(function(h,m){var f=Re(Re(Re({},h),Xn({width:m.width,height:m.height,sizeRestrictions:o,aspectRatio:s})),{left:0,top:0});return l(f,{left:h.left,top:h.top})})(c,Re(Re({},c),d))),yt(d.left)&&yt(d.top)||(c=l(c,Re(Re({},c),d)))})),c}function sA(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,o=t.visibleArea;t.aspectRatio;var r=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,c,u,d=Re({},i),h=Re({},o),m=Re({},r);l=Je(m),c=Je(d),u===void 0&&(u=.001),(l===0||c===0?Math.abs(c-l)<u:Math.abs(c/l)<1+u&&Math.abs(c/l)>1-u)||(d=Re(Re({},d),Xn({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Je(m),maximum:Je(m)}})));var f=Fs(h=un(h,d.width*n.width/(h.width*m.width)),e({visibleArea:h,type:"resize"}));return f!==1&&(h=un(h,f),d=un(d,f)),h=St(h=Wt(h,io(wt(d),wt(h))),e({visibleArea:h,type:"move"})),{coordinates:d=St(d,Ds(Ln(h),a)),visibleArea:h}}function aA(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,o=t.coordinates,r=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=Re({},o),l=Re({},r);if(o&&r&&e.type!=="manipulateImage"){var c={width:0,height:0};l.width,i.width,Je(i)>Je(a)?(c.height=.8*i.height,c.width=c.height*Je(a)):(c.width=.8*i.width,c.height=c.width*Je(a));var u=Fs(l=un(l,a.width*i.width/(l.width*c.width)),n({visibleArea:l,type:"resize"}));l=un(l,u),u!==1&&(c.height/=u,c.width/=u),l=St(l=Wt(l,io(wt(a),wt(l))),n({visibleArea:l,type:"move"})),a=St(a,Ds(Ln(l),s))}return{coordinates:a,visibleArea:l}}function lA(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.getAreaRestrictions,r=Re({},i),s=Re({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-r.width),l=Math.max(0,s.height-r.height);a>l?r=un(r,Math.min(s.width/r.width,oo(r,o({visibleArea:r,type:"resize"})))):l>a&&(r=un(r,Math.min(s.height/r.height,oo(r,o({visibleArea:r,type:"resize"}))))),r=St(r=Wt(r,Ms(ro(s,Ln(r)))),o({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:s}}function cA(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-i.width/2,top:(n?n.top:0)+o.height/2-i.height/2}}function uA(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,o=t.sizeRestrictions,r=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Je(r))),a=r.width<r.height?{width:.8*r.width,height:.8*r.width/s}:{height:.8*r.height,width:.8*r.height*s};return Xn(Re(Re({},a),{aspectRatio:i,sizeRestrictions:o}))}function dA(t){var e,n,i=t.imageSize,o=t.visibleArea,r=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,c=o||i;return Je(c)>Je(r)?n=(e=l.height*c.height/r.height)*Je(l):e=(n=l.width*c.width/r.width)/Je(l),Xn({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function hA(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,o=Je(t.boundaries);if(n){var r={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=dv({width:Je(r)>o?r.width:r.height*o,height:Je(r)>o?r.width/o:r.height},Pl(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=No(n,Ln(Re({left:0,top:0},i))),c={};return!l.left&&!l.right&&a.width<=i.width&&(c.left=0,c.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(c.top=0,c.bottom=i.height),St(a,c)}var u=Je(i);return s={height:u>o?i.height:i.width/o,width:u>o?i.height*o:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function Mr(t,e){return pv(t,Ln(e))}function pA(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.sizeRestrictions,r=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,c=e.move,u=Re({},i),d=Re({},n),h=1,m=1,f=l.factor&&Math.abs(l.factor-1)>.001;u=Wt(u,{left:c.left||0,top:c.top||0});var p={stencil:{minimum:Math.max(o.minWidth?o.minWidth/d.width:0,o.minHeight?o.minHeight/d.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/d.width:1/0,o.maxHeight?o.maxHeight/d.height:1/0,oo(d,s))},area:{maximum:oo(u,r({visibleArea:u,type:"resize"}))}};l.factor&&f&&(l.factor<1?(m=Math.max(l.factor,p.stencil.minimum))>1&&(m=1):l.factor>1&&(m=Math.min(l.factor,Math.min(p.area.maximum,p.stencil.maximum)))<1&&(m=1)),m&&(u=un(u,m,l.center));var _=n.left-i.left,C=i.width+i.left-(n.width+n.left),w=n.top-i.top,S=i.height+i.top-(n.height+n.top);return u=St(u=Wt(u,ro(u,{left:s.left!==void 0?s.left-_*m:void 0,top:s.top!==void 0?s.top-w*m:void 0,bottom:s.bottom!==void 0?s.bottom+S*m:void 0,right:s.right!==void 0?s.right+C*m:void 0})),r({visibleArea:u,type:"move"})),d.width=d.width*m,d.height=d.height*m,d.left=u.left+_*m,d.top=u.top+w*m,d=St(d,Ds(Ln(u),s)),l.factor&&f&&a&&(l.factor>1?h=Math.min(p.area.maximum,l.factor)/m:l.factor<1&&(h=Math.max(d.height/u.height,d.width/u.width,l.factor/m)),h!==1&&(u=Wt(u=St(u=un(u,h,l.factor>1?l.center:wt(d)),r({visibleArea:u,type:"move"})),Ms(ro(d,Ln(u)))))),{coordinates:d,visibleArea:u}}function fA(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,o=t.visibleArea,r=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,c=t.angle,u=Re({},i),d=Re({},o),h=ai(wt(Re({left:0,top:0},l)),c);return(u=Re(Re({},Xn({sizeRestrictions:r,aspectRatio:e,width:u.width,height:u.height})),ai(wt(u),c))).left-=h.left-a.width/2+u.width/2,u.top-=h.top-a.height/2+u.height/2,d=un(d,Fs(d,n({visibleArea:d,type:"resize"}))),{coordinates:u=St(u,s),visibleArea:d=St(d=Wt(d,io(wt(u),wt(i))),n({visibleArea:d,type:"move"}))}}function mA(t){var e=t.flip,n=t.previousFlip,i=t.rotate,o=t.getAreaRestrictions,r=t.coordinates,s=t.visibleArea,a=t.imageSize,l=Re({},r),c=Re({},s),u=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(u||d){var h=ai({left:a.width/2,top:a.height/2},-i),m=ai(wt(l),-i),f=ai({left:u?h.left-(m.left-h.left):m.left,top:d?h.top-(m.top-h.top):m.top},i);l=Wt(l,io(f,wt(l))),m=ai(wt(c),-i),c=St(c=Wt(c,io(f=ai({left:u?h.left-(m.left-h.left):m.left,top:d?h.top-(m.top-h.top):m.top},i),wt(c))),o({visibleArea:c,type:"move"}))}return{coordinates:l,visibleArea:c}}function Yh(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,o=i===void 0?{}:i,r=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=Re({},e),c=An(n,l).width,u=An(n,l).height;c<0&&(l.left<0&&l.right<0?(l.left=-(n.width-r.minWidth)/(l.left/l.right),l.right=-(n.width-r.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-r.minWidth):l.right<0&&(l.right=-(n.width-r.minWidth))),u<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-r.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-r.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-r.minHeight):l.bottom<0&&(l.bottom=-(n.height-r.minHeight)));var d=No(An(n,l),o);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=No(An(n,l),o));var h={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Rn.forEach((function(p){var _=d[p];_&&l[p]&&(h[p]=Math.max(0,1-_/l[p]))})),s){var m=Math.min.apply(null,Rn.map((function(p){return h[p]})));m!==1/0&&Rn.forEach((function(p){l[p]*=m}))}else Rn.forEach((function(p){h[p]!==1/0&&(l[p]*=h[p])}));if(c=An(n,l).width,u=An(n,l).height,l.right+l.left&&(c>r.maxWidth?h.width=(r.maxWidth-n.width)/(l.right+l.left):c<r.minWidth&&(h.width=(r.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(u>r.maxHeight?h.height=(r.maxHeight-n.height)/(l.bottom+l.top):u<r.minHeight&&(h.height=(r.minHeight-n.height)/(l.bottom+l.top))),s){var f=Math.min(h.width,h.height);f!==1/0&&Rn.forEach((function(p){l[p]*=f}))}else h.width!==1/0&&eA.forEach((function(p){l[p]*=h.width})),h.height!==1/0&&tA.forEach((function(p){l[p]*=h.height}));return l}function Fr(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var vA=En("vue-simple-handler"),gA=En("vue-simple-handler-wrapper"),Mc={name:"SimpleHandler",components:{HandlerWrapper:cv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(ln(t={},this.horizontalPosition,!!this.horizontalPosition),ln(t,this.verticalPosition,!!this.verticalPosition),ln(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),ln(t,"hover",this.hover),t);return{default:_t(vA(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(gA(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Mc.render=function(t,e,n,i,o,r){var s=Ue("HandlerWrapper");return y(),ne(s,{class:r.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var _A=En("vue-simple-line"),yA=En("vue-simple-line-wrapper"),Fc={name:"SimpleLine",components:{LineWrapper:uv},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:_t(_A(ln({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:_t(yA(ln({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Fc.render=function(t,e,n,i,o,r){var s=Ue("LineWrapper");return y(),ne(s,{class:r.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:r.onDrag,onDragEnd:r.onDragEnd,onEnter:r.onEnter,onLeave:r.onLeave},{default:we((function(){return[j("div",{class:r.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Na=En("vue-bounding-box"),bA=["east","west",null],wA=["south","north",null],fv={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Mc}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Fc}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return bA.forEach((function(e){wA.forEach((function(n){if(e!==n){var i=rv(e,n),o=i.name,r=i.classname;t.push({name:o,classname:r,verticalDirection:n,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:Na(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:_t(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:_t(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach((function(o){if(t.handlers[o.name]){var r={name:o.name,component:t.handlersComponent,class:_t(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:_t(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=o.horizontalDirection,a=o.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,c=a==="south"?i:a==="north"?0:i/2;r.wrapperClass=Na("handler"),r.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(c,"px)")},t.transitions&&t.transitions.enabled&&(r.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else r.wrapperClass=Na("handler",ln({},o.classname,!0));e.push(r)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,o=t.shift(),r=o.left,s=o.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=r:e==="east"&&(a.right+=r),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new XO(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};fv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"box",class:r.classes.root,style:r.style},[Ve(t.$slots,"default"),j("div",null,[(y(!0),ne(Ie,null,He(r.lineNodes,(function(s){return y(),ne($t(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(y(!0),ne(Ie,null,He(r.handlerNodes,(function(s){return y(),ne("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(y(),ne($t(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return r.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return r.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var SA=En("vue-draggable-area"),mv={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:SA()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=Mi(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):lv({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=Mi(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),o=i.left,r=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Rc({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};mv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};function Ua(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t?.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t?.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function CA(t){return new Promise((function(e,n){try{if(t)if(/^data:/i.test(t))e((function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var c=atob(l),u=c.length,d=new ArrayBuffer(u),h=new Uint8Array(d),m=0;m<u;m++)h[m]=c.charCodeAt(m);return d})(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},r=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===0?e(o.response):n("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){o.getResponseHeader("content-type")!=="image/jpeg"&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var r,s,a}))}function vv(t){var e=t.rotate,n=t.flip,i=t.scaleX,o=t.scaleY,r="";return r+=" rotate("+e+"deg) ",r+=" scaleX("+i*(n.horizontal?-1:1)+") ",r+=" scaleY("+o*(n.vertical?-1:1)+") "}function EA(t){try{var e,n=new DataView(t),i=void 0,o=void 0,r=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){r=l;break}l++}if(r&&(i=r+10,(function(m,f,p){var _,C="";for(_=f,p+=f;_<p;_++)C+=String.fromCharCode(m.getUint8(_));return C})(n,r+4,4)==="Exif")){var c=n.getUint16(i);if(((o=c===18761)||c===19789)&&n.getUint16(i+2,o)===42){var u=n.getUint32(i+4,o);u>=8&&(s=i+u)}}if(s){for(var d=n.getUint16(s,o),h=0;h<d;h++)if(l=s+12*h+2,n.getUint16(l,o)===274){l+=8,e=n.getUint16(l,o),n.setUint16(l,1,o);break}}return e}catch{return null}}function Gh(t,e){var n=e.getBoundingClientRect(),i=n.left,o=n.top,r={left:0,top:0},s=0;return t.forEach((function(a){r.left+=(a.clientX-i)/t.length,r.top+=(a.clientY-o)/t.length})),t.forEach((function(a){s+=lv({x:r.left,y:r.top},{x:a.clientX-i,y:a.clientY-o})})),{centerMass:r,spread:s,count:t.length}}var gv={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Ol(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new ko({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=Gh(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new ko({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,o=n.top,r=n.bottom,s=n.right;this.touches=Mi(t.touches).filter((function(a){return a.clientX>i&&a.clientX<s&&a.clientY>o&&a.clientY<r})),this.oldGeometricProperties=Gh(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=Mi(t.touches).filter((function(i){return!i.identifier||e.touches.find((function(o){return o.identifier===i.identifier}))}));this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,o=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||av(a)?a:a>0?1:-1),r={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new ko({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};gv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return r.onTouchStart&&r.onTouchStart.apply(r,arguments)}),onMousedown:e[2]||(e[2]=function(){return r.onMouseDown&&r.onMouseDown.apply(r,arguments)}),onWheel:e[3]||(e[3]=function(){return r.onWheel&&r.onWheel.apply(r,arguments)})},[Ve(t.$slots,"default")],544)};var Il={components:{TransformableImage:gv},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Il.render=function(t,e,n,i,o,r){var s=Ue("transformable-image");return y(),ne(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:we((function(){return[Ve(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Dr=En("vue-preview"),_v={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Dr({fill:this.fill}),wrapper:Dr("wrapper"),imageWrapper:Dr("image-wrapper"),image:_t(Dr("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Xe(Xe({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,o=hv({width:n,height:i},e.rotate),r={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-o.width)*e.scaleX/2,top:(i-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return r.transform=`translate(
23
+ `.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+vv(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};_v.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"root",class:r.classes.root,style:r.style},[j("div",{ref:"wrapper",class:r.classes.wrapper,style:r.wrapperStyle},[it(j("img",{ref:"image",src:n.image&&n.image.src,class:r.classes.image,style:r.imageStyle},null,14,["src"]),[[Sn,n.image&&n.image.src]])],6)],6)};var yv={components:{Preview:_v},inheritAttrs:!1};yv.render=function(t,e,n,i,o,r){var s=Ue("preview");return y(),ne(s,We(t.$attrs,{fill:!0}),null,16)};var Va=En("vue-rectangle-stencil"),bv={name:"RectangleStencil",components:{StencilPreview:yv,BoundingBox:fv,DraggableArea:mv},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Mc}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Fc}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:_t(Va({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:_t(Va("preview"),this.previewClass),boundingBox:_t(Va("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};bv.render=function(t,e,n,i,o,r){var s=Ue("stencil-preview"),a=Ue("draggable-area"),l=Ue("bounding-box");return y(),ne("div",{class:r.classes.stencil,style:r.style},[j(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:r.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:r.onResize,onResizeEnd:r.onResizeEnd},{default:we((function(){return[j(a,{movable:n.movable,onMove:r.onMove,onMoveEnd:r.onMoveEnd},{default:we((function(){return[j(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:r.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var xA=["transitions"],Bn=En("vue-advanced-cropper"),wv={name:"Cropper",components:{BackgroundWrapper:Il},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return bv}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Il}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return iA.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,o=t.positionRestrictions,r=t.sizeRestrictions,s=Re(Re({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=Re({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(l.left=0,l.right=0),r.heightFrozen&&(l.top=0,l.bottom=0),Rn.forEach((function(b){c[b]||(l[b]=0)}));var u=An(s,l=Yh({coordinates:s,directions:l,sizeRestrictions:r,positionRestrictions:o})).width,d=An(s,l).height,h=a.preserveRatio?Je(s):za(u/d,i);if(h){var m=a.respectDirection;if(m||(m=s.width>=s.height||h===1?"width":"height"),m==="width"){var f=u/h-s.height;if(c.top&&c.bottom){var p=l.top,_=l.bottom;l.bottom=Fr(f,_,p),l.top=Fr(f,p,_)}else c.bottom?l.bottom=f:c.top?l.top=f:c.right?l.right=0:c.left&&(l.left=0)}else if(m==="height"){var C=s.width-d*h;if(c.left&&c.right){var w=l.left,S=l.right;l.left=-Fr(C,w,S),l.right=-Fr(C,S,w)}else c.left?l.left=-C:c.right?l.right=-C:c.top?l.top=0:c.bottom&&(l.bottom=0)}l=Yh({directions:l,coordinates:s,sizeRestrictions:r,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return u=An(s,l).width,d=An(s,l).height,(h=a.preserveRatio?Je(s):za(u/d,i))&&Math.abs(h-u/d)>.001&&Rn.forEach((function(b){c[b]||(l[b]=0)})),Rl({event:new Rc({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Rl},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Je(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,o=t.sizeRestrictions,r=t.positionRestrictions,s=Re(Re({},n),Xn({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return s=St(s=Wt(s,io(wt(n),wt(s))),Ds(Ln(e),r))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,o=t.coordinates,r=Re({},e);r.height=r.width/Je(n),r.top+=(e.height-r.height)/2,(o.height-r.height>0||o.width-r.width>0)&&(r=un(r,Math.max(o.height/r.height,o.width/r.width)));var s=Ms(ro(o,Ln(r=un(r,Fs(r,i({visibleArea:r,type:"resize"}))))));return r.width<o.width&&(s.left=0),r.height<o.height&&(s.top=0),r=St(r=Wt(r,s),i({visibleArea:r,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,o=t.imageRestriction,r=t.type,s={};return o==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:o==="fit-area"&&(Je(n)>Je(i)?(s={top:0,bottom:i.height},e&&r==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&r==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Xe({},Hh)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=(function(e){return e*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Al(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Al(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:yt(this.minWidth)?0:Ir(this.minWidth),minHeight:yt(this.minHeight)?0:Ir(this.minHeight),maxWidth:yt(this.maxWidth)?1/0:Ir(this.maxWidth),maxHeight:yt(this.maxHeight)?1/0:Ir(this.maxHeight)});if(t=(function(i){var o=i.areaRestrictions,r=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=Re(Re({},r),{minWidth:r.minWidth!==void 0?r.minWidth:0,minHeight:r.minHeight!==void 0?r.minHeight:0,maxWidth:r.maxWidth!==void 0?r.maxWidth:1/0,maxHeight:r.maxHeight!==void 0?r.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var c=Pl(o),u=dv(s,c);return c.width<1/0&&(!l.maxWidth||l.maxWidth>u.width)&&(l.maxWidth=Math.min(l.maxWidth,u.width)),c.height<1/0&&(!l.maxHeight||l.maxHeight>u.height)&&(l.maxHeight=Math.min(l.maxHeight,u.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l})({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Pl(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Bn(),image:_t(Bn("image"),this.imageClass),stencil:Bn("stencil"),boundaries:_t(Bn("boundaries"),this.boundariesClass),stretcher:_t(Bn("stretcher")),background:_t(Bn("background"),this.backgroundClass),foreground:_t(Bn("foreground"),this.foregroundClass),imageWrapper:_t(Bn("image-wrapper")),cropperWrapper:_t(Bn("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Xe(Xe({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+vv(i)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(n){return t[n]!==e[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Ol(this.update,this.debounce),this.debouncedDisableTransitions=Ol(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Xe({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Xe({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Xe({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new ko({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;this.onManipulateImage(new ko({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,o=i===void 0||i,r=n.transitions,s=r===void 0||r;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?(function(e){var n=e.coordinates,i=e.sizeRestrictions,o=e.positionRestrictions,r={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return r.width>i.maxWidth?r.width=Math.floor(n.width):r.width<i.minWidth&&(r.width=Math.ceil(n.width)),r.height>i.maxHeight?r.height=Math.floor(n.height):r.height<i.minHeight&&(r.height=Math.ceil(n.height)),St(r,o)})(Xe(Xe({},this.getPublicProperties()),{},{positionRestrictions:Mr(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?sA:this.autoZoom?aA:lA);var r=o({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Xe(Xe({},r),{},{changed:!qh(r.visibleArea,e)||!qh(r.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,o=GO(e,xA),r=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),s=r.visibleArea,a=r.coordinates,l=r.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return(function(e){var n=e.event,i=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return Re(Re({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+i.left,top:n.scale.center.top*o+i.top}:null}});if(n.type==="resize"){var r=Re(Re({},n),{directions:Re({},n.directions)});return Rn.forEach((function(a){r.directions[a]*=o})),r}if(n.type==="move"){var s=Re(Re({},n),{directions:Re({},n.directions)});return nA.forEach((function(a){s.directions[a]*=o})),s}return n})(Xe(Xe({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(a,l,c){var u=c.rotate,d=c.flip,h={width:l.naturalWidth,height:l.naturalHeight},m=hv(h,u),f=a.getContext("2d");a.height=m.height,a.width=m.width,f.save();var p=ai(wt(Re({left:0,top:0},h)),u);return f.translate(-(p.left-m.width/2),-(p.top-m.height/2)),f.rotate(u*Math.PI/180),f.translate(d.horizontal?h.width:0,d.vertical?h.height:0),f.scale(d.horizontal?-1:1,d.vertical?-1:1),f.drawImage(l,0,0,h.width,h.height),f.restore(),a})(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Xe({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(a){return a.find((function(l){return c=l,!Number.isNaN(parseFloat(c))&&isFinite(c);var c}))},r=Xn({sizeRestrictions:{minWidth:o([i.width,i.minWidth])||0,minHeight:o([i.height,i.minHeight])||0,maxWidth:o([i.width,i.maxWidth])||1/0,maxHeight:o([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&r.width*r.height>i.maxArea){var s=Math.sqrt(i.maxArea/(r.width*r.height));r={width:Math.round(s*r.width),height:Math.round(s*r.height)}}return(function(a,l,c,u,d){a.width=u?u.width:c.width,a.height=u?u.height:c.height;var h=a.getContext("2d");h.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(h.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(h.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(h.fillStyle=d.fillColor,h.fillRect(0,0,a.width,a.height),h.save()));var m=c.left<0?-c.left:0,f=c.top<0?-c.top:0;h.drawImage(l,c.left+m,c.top+f,c.width,c.height,m*(a.width/c.width),f*(a.height/c.height),a.width,a.height)})(t,n,this.coordinates,r,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?oA(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?Mr(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return rA({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?dA:uA);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=zi(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||cA,r=[i,function(s){var a=s.coordinates;return Xe({},zi(o)?o({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&r.push.apply(r,Mi(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(r,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var i={cropper:n,imageSize:t.imageSize};if(zi(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=(function(o){var r=o.cropper,s=o.imageSize,a=r.clientHeight,l=r.clientWidth,c=a,u=s.width*a/s.height;return u>l&&(u=l,c=s.height*l/s.width),{width:u,height:c}})(i):t.boundaries=(function(o){var r=o.cropper;return{width:r.clientWidth,height:r.clientHeight}})(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Xe(Xe({},this.defaultImageTransforms),{},{flip:Xe({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,o,r,s,a=t.defaultVisibleArea||hA;t.visibleArea=zi(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,o=e.getAreaRestrictions,r=Re({},n),s=Je(i),r.width/r.height!==s&&(r.height=r.width/s),St(r,o({visibleArea:r,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(o){if(Vh(o))return!1;var r=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(c){return c.port||((c.protocol||r.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==r.protocol&&a.host&&a.host==r.host&&a.host&&l(a)==l(r))})(this.src)){var n=yt(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise((function(o){CA(t).then((function(r){var s=EA(r);o(r?{source:t,arrayBuffer:r,orientation:s}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(r){console.warn(r),o({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){i.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&o&&o>1?sv(n)||!Vh(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(r){for(var s=[],a=new Uint8Array(r);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))})(i):this.imageAttributes.src=n,zi(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms()):Xr(this.defaultTransforms)?this.appliedImageTransforms=Ua(this.defaultTransforms):this.appliedImageTransforms=(function(r){var s=Ua({});if(r)switch(r){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s})(o),this.defaultImageTransforms=Xe(Xe({},this.appliedImageTransforms),{},{flip:Xe({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var r=e.$refs.image;r&&r.complete&&((function(s){return!!s.naturalWidth})(r)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Xe(Xe({},e.getPublicProperties()),{},{positionRestrictions:Mr(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,o=e.normalize,r=o===void 0||o;i&&this.enableTransitions();var s=pA(Xe(Xe({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,o=i.aspectRatio,r=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(yt(e)&&(e=yt(o)?r:o),yt(n)&&(n=yt(o)?s:o),!t&&(yt(e)||yt(n))){var l=this.getStencilSize(),c=l?Je(l):null;yt(e)&&(e=Bh(c)?c:void 0),yt(n)&&(n=Bh(c)?c:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,za(Je(o=zi(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(o.width>e.width||o.height>e.height)&&(o=Xn({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:Je(o),maximum:Je(o)}})),o;var t,e,n,i,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Xe({},Hh)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,o=i===void 0||i;if(!this.transitionsActive){o&&this.enableTransitions();var r=Xe({},this.imageTransforms.flip),s=mA({flip:{horizontal:t?!r.horizontal:r.horizontal,vertical:e?!r.vertical:r.vertical},previousFlip:r,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var o=Xe({},this.imageSize);this.appliedImageTransforms.rotate+=t;var r=fA({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=r.visibleArea,a=r.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},TA={key:0,ref:"canvas",style:{display:"none"}},$A={key:1,ref:"sourceCanvas",style:{display:"none"}};wv.render=function(t,e,n,i,o,r){return y(),ne("div",{ref:"cropper",class:r.classes.cropper},[j("div",{ref:"stretcher",class:r.classes.stretcher},null,2),j("div",{class:r.classes.boundaries,style:r.boundariesStyle},[(y(),ne($t(n.backgroundWrapperComponent),{class:r.classes.cropperWrapper,"wheel-resize":r.settings.resizeImage.wheel,"touch-resize":r.settings.resizeImage.touch,"touch-move":r.settings.moveImage.touch,"mouse-move":r.settings.moveImage.mouse,onMove:r.onManipulateImage,onResize:r.onManipulateImage},{default:we((function(){return[j("div",{class:r.classes.background,style:r.boundariesStyle},null,6),j("div",{class:r.classes.imageWrapper},[j("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:r.classes.image,style:r.imageStyle,onMousedown:e[1]||(e[1]=Ye((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),j("div",{class:r.classes.foreground,style:r.boundariesStyle},null,6),it((y(),ne($t(n.stencilComponent),We({ref:"stencil",image:r.image,coordinates:o.coordinates,"stencil-coordinates":r.stencilCoordinates,transitions:r.transitionsOptions},n.stencilProps,{onResize:r.onResize,onResizeEnd:r.onResizeEnd,onMove:r.onMove,onMoveEnd:r.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Sn,o.imageLoaded]]),n.canvas?(y(),ne("canvas",TA,null,512)):ue("",!0),n.canvas?(y(),ne("canvas",$A,null,512)):ue("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const _i=typeof window<"u",Sv=_i&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Cv=_i&&window.devicePixelRatio>1,kA={elements_selector:".lazy",container:Sv||_i?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ev=t=>Object.assign({},kA,t),Qh=function(t,e){let n;const i="LazyLoad::Initialized",o=new t(e);try{n=new CustomEvent(i,{detail:{instance:o}})}catch{n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:o})}window.dispatchEvent(n)},OA=(t,e)=>{if(e)if(e.length)for(let n,i=0;n=e[i];i+=1)Qh(t,n);else Qh(t,e)},ei="src",Dc="srcset",Lc="sizes",xv="poster",rr="llOriginalAttrs",Tv="data",jc="loading",$v="loaded",kv="applied",AA="entered",zc="error",Ov="native",Av="data-",Pv="ll-status",Kt=(t,e)=>t.getAttribute(Av+e),PA=(t,e,n)=>{const i=Av+e;n!==null?t.setAttribute(i,n):t.removeAttribute(i)},sr=t=>Kt(t,Pv),Li=(t,e)=>PA(t,Pv,e),Ls=t=>Li(t,null),Nc=t=>sr(t)===null,RA=t=>sr(t)===jc,IA=t=>sr(t)===zc,Uc=t=>sr(t)===Ov,MA=[jc,$v,kv,zc],FA=t=>MA.indexOf(sr(t))>=0,yi=(t,e,n,i)=>{t&&typeof t=="function"&&(i===void 0?n===void 0?t(e):t(e,n):t(e,n,i))},fo=(t,e)=>{_i&&e!==""&&t.classList.add(e)},Pn=(t,e)=>{_i&&e!==""&&t.classList.remove(e)},DA=t=>{t.llTempImage=document.createElement("IMG")},LA=t=>{delete t.llTempImage},Rv=t=>t.llTempImage,js=(t,e)=>{if(!e)return;const n=e._observer;n&&n.unobserve(t)},jA=t=>{t.disconnect()},zA=(t,e,n)=>{e.unobserve_entered&&js(t,n)},Vc=(t,e)=>{t&&(t.loadingCount+=e)},NA=t=>{t&&(t.toLoadCount-=1)},Iv=(t,e)=>{t&&(t.toLoadCount=e)},UA=t=>t.loadingCount>0,VA=t=>t.toLoadCount>0,Mv=t=>{let e=[];for(let n,i=0;n=t.children[i];i+=1)n.tagName==="SOURCE"&&e.push(n);return e},Bc=(t,e)=>{const n=t.parentNode;n&&n.tagName==="PICTURE"&&Mv(n).forEach(e)},Fv=(t,e)=>{Mv(t).forEach(e)},zs=[ei],Dv=[ei,xv],Uo=[ei,Dc,Lc],Lv=[Tv],Ns=t=>!!t[rr],jv=t=>t[rr],zv=t=>delete t[rr],so=(t,e)=>{if(Ns(t))return;const n={};e.forEach((i=>{n[i]=t.getAttribute(i)})),t[rr]=n},BA=t=>{Ns(t)||(t[rr]={backgroundImage:t.style.backgroundImage})},Fi=(t,e)=>{if(!Ns(t))return;const n=jv(t);e.forEach((i=>{((o,r,s)=>{s?o.setAttribute(r,s):o.removeAttribute(r)})(t,i,n[i])}))},HA=t=>{if(!Ns(t))return;const e=jv(t);t.style.backgroundImage=e.backgroundImage},Nv=(t,e,n)=>{fo(t,e.class_applied),Li(t,kv),n&&(e.unobserve_completed&&js(t,e),yi(e.callback_applied,t,n))},Uv=(t,e,n)=>{fo(t,e.class_loading),Li(t,jc),n&&(Vc(n,1),yi(e.callback_loading,t,n))},ui=(t,e,n)=>{n&&t.setAttribute(e,n)},Xh=(t,e)=>{ui(t,Lc,Kt(t,e.data_sizes)),ui(t,Dc,Kt(t,e.data_srcset)),ui(t,ei,Kt(t,e.data_src))},qA=(t,e)=>{Bc(t,(n=>{so(n,Uo),Xh(n,e)})),so(t,Uo),Xh(t,e)},WA=(t,e)=>{so(t,zs),ui(t,ei,Kt(t,e.data_src))},KA=(t,e)=>{Fv(t,(n=>{so(n,zs),ui(n,ei,Kt(n,e.data_src))})),so(t,Dv),ui(t,xv,Kt(t,e.data_poster)),ui(t,ei,Kt(t,e.data_src)),t.load()},YA=(t,e)=>{so(t,Lv),ui(t,Tv,Kt(t,e.data_src))},GA=(t,e,n)=>{const i=Kt(t,e.data_bg),o=Kt(t,e.data_bg_hidpi),r=Cv&&o?o:i;r&&(t.style.backgroundImage=`url("${r}")`,Rv(t).setAttribute(ei,r),Uv(t,e,n))},QA=(t,e,n)=>{const i=Kt(t,e.data_bg_multi),o=Kt(t,e.data_bg_multi_hidpi),r=Cv&&o?o:i;r&&(t.style.backgroundImage=r,Nv(t,e,n))},XA=(t,e,n)=>{const i=Kt(t,e.data_bg_set);if(!i)return;let o=i.split("|").map((r=>`image-set(${r})`));t.style.backgroundImage=o.join(),Nv(t,e,n)},Vv={IMG:qA,IFRAME:WA,VIDEO:KA,OBJECT:YA},JA=(t,e)=>{const n=Vv[t.tagName];n&&n(t,e)},ZA=(t,e,n)=>{const i=Vv[t.tagName];i&&(i(t,e),Uv(t,e,n))},eP=["IMG","IFRAME","VIDEO","OBJECT"],tP=t=>eP.indexOf(t.tagName)>-1,Bv=(t,e)=>{!e||UA(e)||VA(e)||yi(t.callback_finish,e)},Jh=(t,e,n)=>{t.addEventListener(e,n),t.llEvLisnrs[e]=n},nP=(t,e,n)=>{t.removeEventListener(e,n)},Hc=t=>!!t.llEvLisnrs,iP=(t,e,n)=>{Hc(t)||(t.llEvLisnrs={});const i=t.tagName==="VIDEO"?"loadeddata":"load";Jh(t,i,e),Jh(t,"error",n)},Ml=t=>{if(!Hc(t))return;const e=t.llEvLisnrs;for(let n in e){const i=e[n];nP(t,n,i)}delete t.llEvLisnrs},Hv=(t,e,n)=>{LA(t),Vc(n,-1),NA(n),Pn(t,e.class_loading),e.unobserve_completed&&js(t,n)},oP=(t,e,n,i)=>{const o=Uc(e);Hv(e,n,i),fo(e,n.class_loaded),Li(e,$v),yi(n.callback_loaded,e,i),o||Bv(n,i)},rP=(t,e,n,i)=>{const o=Uc(e);Hv(e,n,i),fo(e,n.class_error),Li(e,zc),yi(n.callback_error,e,i),n.restore_on_error&&Fi(e,Uo),o||Bv(n,i)},Fl=(t,e,n)=>{const i=Rv(t)||t;Hc(i)||iP(i,(o=>{oP(0,t,e,n),Ml(i)}),(o=>{rP(0,t,e,n),Ml(i)}))},Dl=(t,e,n)=>{tP(t)?((i,o,r)=>{Fl(i,o,r),ZA(i,o,r)})(t,e,n):((i,o,r)=>{DA(i),Fl(i,o,r),BA(i),GA(i,o,r),QA(i,o,r),XA(i,o,r)})(t,e,n)},sP=(t,e,n)=>{t.setAttribute("loading","lazy"),Fl(t,e,n),JA(t,e),Li(t,Ov)},Zh=t=>{t.removeAttribute(ei),t.removeAttribute(Dc),t.removeAttribute(Lc)},aP=t=>{Bc(t,(e=>{Zh(e)})),Zh(t)},qv=t=>{Bc(t,(e=>{Fi(e,Uo)})),Fi(t,Uo)},lP=t=>{Fv(t,(e=>{Fi(e,zs)})),Fi(t,Dv),t.load()},cP=t=>{Fi(t,zs)},uP=t=>{Fi(t,Lv)},dP={IMG:qv,IFRAME:cP,VIDEO:lP,OBJECT:uP},hP=(t,e)=>{(n=>{const i=dP[n.tagName];i?i(n):HA(n)})(t),((n,i)=>{Nc(n)||Uc(n)||(Pn(n,i.class_entered),Pn(n,i.class_exited),Pn(n,i.class_applied),Pn(n,i.class_loading),Pn(n,i.class_loaded),Pn(n,i.class_error))})(t,e),Ls(t),zv(t)},pP=(t,e,n,i)=>{n.cancel_on_exit&&RA(t)&&t.tagName==="IMG"&&(Ml(t),aP(t),qv(t),Pn(t,n.class_loading),Vc(i,-1),Ls(t),yi(n.callback_cancel,t,e,i))},fP=(t,e,n,i)=>{const o=FA(t);Li(t,AA),fo(t,n.class_entered),Pn(t,n.class_exited),zA(t,n,i),yi(n.callback_enter,t,e,i),o||Dl(t,n,i)},mP=(t,e,n,i)=>{Nc(t)||(fo(t,n.class_exited),pP(t,e,n,i),yi(n.callback_exit,t,e,i))},vP=["IMG","IFRAME","VIDEO"],Wv=t=>t.use_native&&"loading"in HTMLImageElement.prototype,gP=(t,e,n)=>{t.forEach((i=>{vP.indexOf(i.tagName)!==-1&&sP(i,e,n)})),Iv(n,0)},_P=t=>t.isIntersecting||t.intersectionRatio>0,yP=(t,e)=>{e.forEach((n=>{t.observe(n)}))},bP=(t,e)=>{jA(t),yP(t,e)},wP=(t,e)=>{Wv(t)||(e._observer=new IntersectionObserver((n=>{((i,o,r)=>{i.forEach((s=>_P(s)?fP(s.target,s,o,r):mP(s.target,s,o,r)))})(n,t,e)}),(n=>({root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}))(t)))},Kv=t=>Array.prototype.slice.call(t),cs=t=>t.container.querySelectorAll(t.elements_selector),SP=t=>Kv(t).filter(Nc),CP=t=>IA(t),EP=t=>Kv(t).filter(CP),ep=(t,e)=>SP(t||cs(e)),xP=(t,e)=>{EP(cs(t)).forEach((n=>{Pn(n,t.class_error),Ls(n)})),e.update()},TP=(t,e)=>{_i&&(e._onlineHandler=()=>{xP(t,e)},window.addEventListener("online",e._onlineHandler))},$P=t=>{_i&&window.removeEventListener("online",t._onlineHandler)},Hi=function(t,e){const n=Ev(t);this._settings=n,this.loadingCount=0,wP(n,this),TP(n,this),this.update(e)};Hi.prototype={update:function(t){const e=this._settings,n=ep(t,e);Iv(this,n.length),Sv?this.loadAll(n):Wv(e)?gP(n,e,this):bP(this._observer,n)},destroy:function(){this._observer&&this._observer.disconnect(),$P(this),cs(this._settings).forEach((t=>{zv(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;ep(t,e).forEach((n=>{js(n,this),Dl(n,e,this)}))},restoreAll:function(){const t=this._settings;cs(t).forEach((e=>{hP(e,t)}))}},Hi.load=(t,e)=>{const n=Ev(e);Dl(t,n)},Hi.resetStatus=t=>{Ls(t)},_i&&OA(Hi,window.lazyLoadOptions);const Xt=(t,e)=>{const{o:n,i,u:o}=t;let r=n,s;const a=(u,d)=>{const h=r,m=u,f=d||(i?!i(h,m):h!==m);return(f||o)&&(r=m,s=h),[r,f,s]};return[e?u=>a(e(r,s),u):a,u=>[r,!!u,s]]},kP=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,Bt=kP?window:{},Yv=Math.max,OP=Math.min,Ll=Math.round,li=Math.abs,tp=Math.sign,qc=Bt.cancelAnimationFrame,Vo=Bt.requestAnimationFrame,Wc=Bt.setTimeout,Gv=Bt.clearTimeout,Us=t=>typeof Bt[t]<"u"?Bt[t]:void 0,AP=Us("MutationObserver"),np=Us("IntersectionObserver"),qi=Us("ResizeObserver"),$o=Us("ScrollTimeline"),Kc=t=>t===void 0,Vs=t=>t===null,di=t=>typeof t=="number",mo=t=>typeof t=="string",Bs=t=>typeof t=="boolean",xn=t=>typeof t=="function",dn=t=>Array.isArray(t),us=t=>typeof t=="object"&&!dn(t)&&!Vs(t),Yc=t=>{const e=!!t&&t.length,n=di(e)&&e>-1&&e%1==0;return dn(t)||!xn(t)&&n?e>0&&us(t)?e-1 in t:!0:!1},Bo=t=>!!t&&t.constructor===Object,ds=t=>t instanceof HTMLElement,Hs=t=>t instanceof Element;function ot(t,e){if(Yc(t))for(let n=0;n<t.length&&e(t[n],n,t)!==!1;n++);else t&&ot(Object.keys(t),(n=>e(t[n],n,t)));return t}const Qv=(t,e)=>t.indexOf(e)>=0,ao=(t,e)=>t.concat(e),ct=(t,e,n)=>(!mo(e)&&Yc(e)?Array.prototype.push.apply(t,e):t.push(e),t),bi=t=>Array.from(t||[]),Gc=t=>dn(t)?t:!mo(t)&&Yc(t)?bi(t):[t],hs=t=>!!t&&!t.length,ps=t=>bi(new Set(t)),Zt=(t,e,n)=>{ot(t,o=>o?o.apply(void 0,e||[]):!0),n||(t.length=0)},Xv="paddingTop",Jv="paddingRight",Zv="paddingLeft",eg="paddingBottom",tg="marginLeft",ng="marginRight",ig="marginBottom",Qc="overflowX",Xc="overflowY",ar="width",lr="height",Yn="visible",yn="hidden",Pi="scroll",PP=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},qs=(t,e,n,i)=>{if(t&&e){let o=!0;return ot(n,(r=>{const s=t[r],a=e[r];s!==a&&(o=!1)})),o}return!1},Jc=(t,e)=>qs(t,e,["w","h"]),Jr=(t,e)=>qs(t,e,["x","y"]),RP=(t,e)=>qs(t,e,["t","r","b","l"]),Le=(t,...e)=>t.bind(0,...e),Wi=t=>{let e;const n=t?Wc:Vo,i=t?Gv:qc;return[o=>{i(e),e=n((()=>o()),xn(t)?t():t)},()=>i(e)]},ip=t=>{const e=xn(t)?t():t;if(di(e)){const n=e?Wc:Vo,i=e?Gv:qc;return o=>{const r=n((()=>o()),e);return()=>{i(r)}}}return e&&e._},og=(t,e)=>{const{p:n,v:i,S:o,m:r}=e||{};let s,a,l,c;const u=function(p){a&&a(),s&&s(),c=a=s=l=void 0,t.apply(this,p)},d=f=>r&&l?r(l,f):f,h=()=>{a&&l&&u(d(l)||l)},m=function(){const p=bi(arguments),_=ip(n);if(_){const C=typeof o=="function"?o():o,w=ip(i),b=d(p)||p,E=u.bind(0,b);a&&a(),C&&!c?(E(),c=!0,a=_((()=>c=void 0))):(a=_(E),w&&!s&&(s=w(h))),l=b}else u(p)};return m.O=h,m},rg=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Nt=t=>t?Object.keys(t):[],Ze=(t,e,n,i,o,r,s)=>{const a=[e,n,i,o,r,s];return(typeof t!="object"||Vs(t))&&!xn(t)&&(t={}),ot(a,(l=>{ot(l,((c,u)=>{const d=l[u];if(t===d)return!0;const h=dn(d);if(d&&Bo(d)){const m=t[u];let f=m;h&&!dn(m)?f=[]:!h&&!Bo(m)&&(f={}),t[u]=Ze(f,d)}else t[u]=h?d.slice():d}))})),t},sg=(t,e)=>ot(Ze({},t),((n,i,o)=>{n===void 0?delete o[i]:n&&Bo(n)&&(o[i]=sg(n))})),Zc=t=>!Nt(t).length,Ho=()=>{},ag=(t,e,n)=>Yv(t,OP(e,n)),Ri=t=>ps((dn(t)?t:(t||"").split(" ")).filter((e=>e))),eu=(t,e)=>t&&t.getAttribute(e),op=(t,e)=>t&&t.hasAttribute(e),Wn=(t,e,n)=>{ot(Ri(e),(i=>{t&&t.setAttribute(i,String(n||""))}))},kn=(t,e)=>{ot(Ri(e),(n=>t&&t.removeAttribute(n)))},Ws=(t,e)=>{const n=Ri(eu(t,e)),i=Le(Wn,t,e),o=(r,s)=>{const a=new Set(n);return ot(Ri(r),(l=>{a[s](l)})),bi(a).join(" ")};return{C:r=>i(o(r,"delete")),$:r=>i(o(r,"add")),H:r=>{const s=Ri(r);return s.reduce(((a,l)=>a&&n.includes(l)),s.length>0)}}},lg=(t,e,n)=>(Ws(t,e).C(n),Le(tu,t,e,n)),tu=(t,e,n)=>(Ws(t,e).$(n),Le(lg,t,e,n)),fs=(t,e,n,i)=>(i?tu:lg)(t,e,n),nu=(t,e,n)=>Ws(t,e).H(n),cg=t=>Ws(t,"class"),ug=(t,e)=>{cg(t).C(e)},Ks=(t,e)=>(cg(t).$(e),Le(ug,t,e)),dg=(t,e)=>{const n=e?Hs(e)&&e:document;return n?bi(n.querySelectorAll(t)):[]},IP=(t,e)=>{const n=e?Hs(e)&&e:document;return n&&n.querySelector(t)},jl=(t,e)=>Hs(t)&&t.matches(e),hg=t=>jl(t,"body"),zl=t=>t?bi(t.childNodes):[],qo=t=>t&&t.parentElement,Ki=(t,e)=>Hs(t)&&t.closest(e),Nl=t=>document.activeElement,MP=(t,e,n)=>{const i=Ki(t,e),o=t&&IP(n,i),r=Ki(o,e)===i;return i&&o?i===t||o===t||r&&Ki(Ki(t,n),e)!==i:!1},lo=t=>{ot(Gc(t),(e=>{const n=qo(e);e&&n&&n.removeChild(e)}))},It=(t,e)=>Le(lo,t&&e&&ot(Gc(e),(n=>{n&&t.appendChild(n)})));let pg;const FP=()=>pg,DP=t=>{pg=t},Xi=t=>{const e=document.createElement("div");return Wn(e,"class",t),e},iu=t=>{const e=Xi(),n=FP(),i=t.trim();return e.innerHTML=n?n.createHTML(i):i,ot(zl(e),(o=>lo(o)))},rp=(t,e)=>t.getPropertyValue(e)||t[e]||"",fg=t=>{const e=t||0;return isFinite(e)?e:0},Lr=t=>fg(parseFloat(t||"")),Ul=t=>Math.round(t*1e4)/1e4,mg=t=>`${Ul(fg(t))}px`;function co(t,e){t&&e&&ot(e,((n,i)=>{try{const o=t.style,r=Vs(n)||Bs(n)?"":di(n)?mg(n):n;i.indexOf("--")===0?o.setProperty(i,r):o[i]=r}catch{}}))}function jn(t,e,n){const i=mo(e);let o=i?"":{};if(t){const r=Bt.getComputedStyle(t,n)||t.style;o=i?rp(r,e):bi(e).reduce(((s,a)=>(s[a]=rp(r,a),s)),o)}return o}const sp=(t,e,n)=>{const i=e?`${e}-`:"",o=n?`-${n}`:"",r=`${i}top${o}`,s=`${i}right${o}`,a=`${i}bottom${o}`,l=`${i}left${o}`,c=jn(t,[r,s,a,l]);return{t:Lr(c[r]),r:Lr(c[s]),b:Lr(c[a]),l:Lr(c[l])}},Ba=(t,e)=>`translate${us(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,LP=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),jP={w:0,h:0},Ys=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:jP,zP=t=>Ys("inner",t||Bt),hi=Le(Ys,"offset"),vg=Le(Ys,"client"),ms=Le(Ys,"scroll"),ou=t=>{const e=parseFloat(jn(t,ar))||0,n=parseFloat(jn(t,lr))||0;return{w:e-Ll(e),h:n-Ll(n)}},Ha=t=>t.getBoundingClientRect(),NP=t=>!!t&&LP(t),Vl=t=>!!(t&&(t[lr]||t[ar])),gg=(t,e)=>{const n=Vl(t);return!Vl(e)&&n},ap=(t,e,n,i)=>{ot(Ri(e),(o=>{t&&t.removeEventListener(o,n,i)}))},st=(t,e,n,i)=>{var o;const r=(o=i&&i.D)!=null?o:!0,s=i&&i.I||!1,a=i&&i.A||!1,l={passive:r,capture:s};return Le(Zt,Ri(e).map((c=>{const u=a?d=>{ap(t,c,u,s),n&&n(d)}:n;return t&&t.addEventListener(c,u,l),Le(ap,t,c,u,s)})))},ru=t=>t.stopPropagation(),Bl=t=>t.preventDefault(),_g=t=>ru(t)||Bl(t),cn=(t,e)=>{const{x:n,y:i}=di(e)?{x:e,y:e}:e||{};di(n)&&(t.scrollLeft=n),di(i)&&(t.scrollTop=i)},Jt=t=>({x:t.scrollLeft,y:t.scrollTop}),yg=()=>({T:{x:0,y:0},k:{x:0,y:0}}),UP=(t,e)=>{const{T:n,k:i}=t,{w:o,h:r}=e,s=(d,h,m)=>{let f=tp(d)*m,p=tp(h)*m;if(f===p){const _=li(d),C=li(h);p=_>C?0:p,f=_<C?0:f}return f=f===p?0:f,[f+0,p+0]},[a,l]=s(n.x,i.x,o),[c,u]=s(n.y,i.y,r);return{T:{x:a,y:c},k:{x:l,y:u}}},qa=({T:t,k:e})=>{const n=(i,o)=>i===0&&i<=o;return{x:n(t.x,e.x),y:n(t.y,e.y)}},lp=({T:t,k:e},n)=>{const i=(o,r,s)=>ag(0,1,(o-s)/(o-r)||0);return{x:i(t.x,e.x,n.x),y:i(t.y,e.y,n.y)}},Hl=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},cp=(t,e)=>{ot(Gc(e),t)},ql=t=>{const e=new Map,n=(r,s)=>{if(r){const a=e.get(r);cp((l=>{a&&a[l?"delete":"clear"](l)}),s)}else e.forEach((a=>{a.clear()})),e.clear()},i=(r,s)=>{if(mo(r)){const c=e.get(r)||new Set;return e.set(r,c),cp((u=>{xn(u)&&c.add(u)}),s),Le(n,r,s)}Bs(s)&&s&&n();const a=Nt(r),l=[];return ot(a,(c=>{const u=r[c];u&&ct(l,i(c,u))})),Le(Zt,l)},o=(r,s)=>{ot(bi(e.get(r)),(a=>{s&&!hs(s)?a.apply(0,s):a()}))};return i(t||{}),[i,n,o]},bg={},wg={},VP=t=>{ot(t,(e=>ot(e,((n,i)=>{bg[i]=e[i]}))))},Sg=(t,e,n)=>Nt(t).map((i=>{const{static:o,instance:r}=t[i],[s,a,l]=n||[],c=n?r:o;if(c){const u=n?c(s,a,e):c(e);return(l||wg)[i]=u}})),BP=(t,e)=>t[e],vo=t=>BP(wg,t),HP="__osOptionsValidationPlugin",go="data-overlayscrollbars",Zr="os-environment",jr=`${Zr}-scrollbar-hidden`,Wa=`${go}-initialize`,es="noClipping",up=`${go}-body`,pi=go,qP="host",Kn=`${go}-viewport`,WP=Qc,KP=Xc,YP="arrange",Cg="measuring",GP="scrolling",Eg="scrollbarHidden",QP="noContent",Wl=`${go}-padding`,dp=`${go}-content`,su="os-size-observer",XP=`${su}-appear`,au=`${su}-listener`,JP=`${au}-scroll`,ts=`${au}-item`,hp=`${ts}-final`,ZP="os-trinsic-observer",eR="os-theme-none",tn="os-scrollbar",tR=`${tn}-rtl`,nR=`${tn}-horizontal`,iR=`${tn}-vertical`,xg=`${tn}-track`,lu=`${tn}-handle`,oR=`${tn}-visible`,rR=`${tn}-cornerless`,pp=`${tn}-interaction`,fp=`${tn}-unusable`,Kl=`${tn}-auto-hide`,sR=`${Kl}-hidden`,mp=`${tn}-wheel`,aR=`${xg}-interactive`,lR=`${lu}-interactive`,Tg="__osSizeObserverPlugin",cR={[Tg]:{static:()=>(t,e,n)=>{const o="scroll",r=iu(`<div class="${ts}" dir="ltr"><div class="${ts}"><div class="${hp}"></div></div><div class="${ts}"><div class="${hp}" style="width: 200%; height: 200%"></div></div></div>`),s=r[0],a=s.lastChild,l=s.firstChild,c=l?.firstChild;let u=hi(s),d=u,h=!1,m;const f=()=>{cn(l,3333333),cn(a,3333333)},p=w=>{m=0,h&&(u=d,e(w===!0))},_=w=>{d=hi(s),h=!w||!Jc(d,u),w?(ru(w),h&&!m&&(qc(m),m=Vo(p))):p(w===!1),f()},C=[It(t,r),st(l,o,_),st(a,o,_)];return Ks(t,JP),co(c,{[ar]:3333333,[lr]:3333333}),Vo(f),[n?Le(_,!1):f,C]}}},uR=(t,e)=>{const{M:n}=e,[i,o]=t("showNativeOverlaidScrollbars");return[i&&n.x&&n.y,o]},Yi=t=>t.indexOf(Yn)===0,dR=t=>t.replace(`${Yn}-`,""),Yl=(t,e)=>{if(t==="auto")return e?Pi:yn;const n=t||yn;return[yn,Pi,Yn].includes(n)?n:yn},hR=(t,e)=>{const{overflowX:n,overflowY:i}=jn(t,[Qc,Xc]);return{x:Yl(n,e.x),y:Yl(i,e.y)}},cu="__osScrollbarsHidingPlugin",pR="__osClickScrollPlugin",vp=t=>JSON.stringify(t,((e,n)=>{if(xn(n))throw 0;return n})),gp=(t,e)=>t?`${e}`.split(".").reduce(((n,i)=>n&&rg(n,i)?n[i]:void 0),t):void 0,fR=[0,33],$g=[33,99],kg=[222,666,!0],mR={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:fR,resize:null,event:$g,env:kg},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Og=(t,e)=>{const n={},i=ao(Nt(e),Nt(t));return ot(i,(o=>{const r=t[o],s=e[o];if(us(r)&&us(s))Ze(n[o]={},Og(r,s)),Zc(n[o])&&delete n[o];else if(rg(e,o)&&s!==r){let a=!0;if(dn(r)||dn(s))try{vp(r)===vp(s)&&(a=!1)}catch{}a&&(n[o]=s)}})),n},Ka=(t,e,n)=>i=>[gp(t,i),n||gp(e,i)!==void 0];let Ag;const vR=()=>Ag,gR=t=>{Ag=t};let Ya;const _R=()=>{const t=(b,E,x)=>{It(document.body,b),It(document.body,b);const O=vg(b),$=hi(b),K=ou(E);return x&&lo(b),{x:$.h-O.h+K.h,y:$.w-O.w+K.w}},e=b=>{let E=!1;const x=Ks(b,jr);try{E=jn(b,"scrollbar-width")==="none"||jn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),E},n=`.${Zr}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Zr} div{width:200%;height:200%;margin:10px 0}.${jr}{scrollbar-width:none!important}.${jr}::-webkit-scrollbar,.${jr}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,o=iu(`<div class="${Zr}"><div></div><style>${n}</style></div>`)[0],r=o.firstChild,s=o.lastChild,a=vR();a&&(s.nonce=a);const[l,,c]=ql(),[u,d]=Xt({o:t(o,r),i:Jr},Le(t,o,r,!0)),[h]=d(),m=e(o),f={x:h.x===0,y:h.y===0},p={elements:{host:null,padding:!m,viewport:b=>m&&hg(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},_=Ze({},mR),C=Le(Ze,{},_),w=Le(Ze,{},p),S={U:h,M:f,P:m,J:!!$o,G:Le(l,"r"),K:w,Z:b=>Ze(p,b)&&w(),tt:C,nt:b=>Ze(_,b)&&C(),ot:Ze({},p),st:Ze({},_)};if(kn(o,"style"),lo(o),st(Bt,"resize",(()=>{c("r",[])})),xn(Bt.matchMedia)&&!m&&(!f.x||!f.y)){const b=E=>{const x=Bt.matchMedia(`(resolution: ${Bt.devicePixelRatio}dppx)`);st(x,"change",(()=>{E(),b(E)}),{A:!0})};b((()=>{const[E,x]=u();Ze(S.U,E),c("r",[x])}))}return S},Un=()=>(Ya||(Ya=_R()),Ya),yR=(t,e,n)=>{let i=!1;const o=n?new WeakMap:!1,r=()=>{i=!0},s=a=>{if(o&&n){const l=n.map((c=>{const[u,d]=c||[];return[d&&u?(a||dg)(u,t):[],d]}));ot(l,(c=>ot(c[0],(u=>{const d=c[1],h=o.get(u)||[];if(t.contains(u)&&d){const f=st(u,d,(p=>{i?(f(),o.delete(u)):e(p)}));o.set(u,ct(h,f))}else Zt(h),o.delete(u)}))))}};return s(),[r,s]},_p=(t,e,n,i)=>{let o=!1;const{et:r,ct:s,rt:a,it:l,lt:c,ut:u}=i||{},[d,h]=yR(t,(()=>o&&n(!0)),a),m=r||[],f=s||[],p=ao(m,f),_=(w,S)=>{if(!hs(S)){const b=c||Ho,E=u||Ho,x=[],O=[];let $=!1,K=!1;if(ot(S,(F=>{const{attributeName:P,target:N,type:M,oldValue:q,addedNodes:le,removedNodes:de}=F,Y=M==="attributes",I=M==="childList",A=t===N,Q=Y&&P,U=Q&&eu(N,P||""),ie=mo(U)?U:null,ve=Q&&q!==ie,re=Qv(f,P)&&ve;if(e&&(I||!A)){const ge=Y&&ve,_e=ge&&l&&jl(N,l),k=(_e?!b(N,P,q,ie):!Y||ge)&&!E(F,!!_e,t,i);ot(le,(z=>ct(x,z))),ot(de,(z=>ct(x,z))),K=K||k}!e&&A&&ve&&!b(N,P,q,ie)&&(ct(O,P),$=$||re)})),h((F=>ps(x).reduce(((P,N)=>(ct(P,dg(F,N)),jl(N,F)?ct(P,N):P)),[]))),e)return!w&&K&&n(!1),[!1];if(!hs(O)||$){const F=[ps(O),$];return w||n.apply(0,F),F}}},C=new AP(Le(_,!1));return[()=>(C.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:p,subtree:e,childList:e,characterData:e}),o=!0,()=>{o&&(d(),C.disconnect(),o=!1)}),()=>{if(o)return _(!0,C.takeRecords())}]};let Ci=null;const Pg=(t,e,n)=>{const{ft:i}=n||{},o=vo(Tg),[r]=Xt({o:!1,u:!0});return()=>{const s=[],l=iu(`<div class="${su}"><div class="${au}"></div></div>`)[0],c=l.firstChild,u=d=>{const h=dn(d)&&!hs(d);let m=!1,f=!1;if(h){const p=d[0],[_,,C]=r(p.contentRect),w=Vl(_);f=gg(_,C),m=!f&&!w}else f=d===!0;m||e({_t:!0,ft:f})};if(qi){if(!Bs(Ci)){const f=new qi(Ho);f.observe(t,{get box(){Ci=!0}}),Ci=Ci||!1,f.disconnect()}const d=og(u,{p:0,v:0}),h=f=>d(f),m=new qi(h);if(m.observe(Ci?t:c),ct(s,[()=>{m.disconnect()},!Ci&&It(t,l)]),Ci){const f=new qi(h);f.observe(t,{box:"border-box"}),ct(s,(()=>f.disconnect()))}}else if(o){const[d,h]=o(c,u,i);ct(s,ao([Ks(l,XP),st(l,"animationstart",d),It(t,l)],h))}else return Ho;return Le(Zt,s)}},bR=(t,e)=>{let n;const i=l=>l.h===0||l.isIntersecting||l.intersectionRatio>0,o=Xi(ZP),[r]=Xt({o:!1}),s=(l,c)=>{if(l){const u=r(i(l)),[,d]=u;return d&&!c&&e(u)&&[u]}},a=(l,c)=>s(c.pop(),l);return[()=>{const l=[];if(np)n=new np(Le(a,!1),{root:t}),n.observe(o),ct(l,(()=>{n.disconnect()}));else{const c=()=>{const u=hi(o);s(u)};ct(l,Pg(o,c)()),c()}return Le(Zt,ct(l,It(t,o)))},()=>n&&a(!0,n.takeRecords())]},wR=(t,e,n,i)=>{let o,r,s,a,l,c,u,d;const h=`[${pi}]`,m=`[${Kn}]`,f=["id","class","style","open","wrap","cols","rows"],{dt:p,vt:_,L:C,gt:w,ht:S,V:b,bt:E,yt:x,wt:O,St:$}=t,K=R=>jn(R,"direction")==="rtl",F=()=>{let R,k,z;const D=og(i,{p:()=>R,v:()=>k,S:()=>z,m(oe,ee){const[G]=oe,[he]=ee;return[ao(Nt(G),Nt(he)).reduce(((me,ke)=>(me[ke]=G[ke]||he[ke],me)),{})]}}),B=(oe,ee)=>{if(dn(ee)){const[G,he,me]=ee;R=G,k=he,z=me}else di(ee)?(R=ee,k=!1,z=!1):(R=!1,k=!1,z=!1);D(oe)};return B.O=D.O,B},P={Ot:!1,B:K(p)},N=Un(),M=vo(cu),[q]=Xt({i:Jc,o:{w:0,h:0}},(()=>{const R=M&&M.R(t,e,P,N,n).Y,z=!(E&&b)&&nu(_,pi,es),D=!b&&x(YP),B=D&&Jt(w),oe=B&&$(),ee=O(Cg,z),G=D&&R&&R(),he=ms(C),me=ou(C);return G&&G(),cn(w,B),oe&&oe(),z&&ee(),{w:he.w+me.w,h:he.h+me.h}})),le=F(),de=R=>{const k=K(p);Ze(R,{Ct:d!==k}),Ze(P,{B:k}),d=k},Y=(R,k)=>{const[z,D]=R,B={$t:D};return Ze(P,{Ot:z}),k||i(B),B},I=({_t:R,ft:k})=>{const z=k?i:le,D={_t:R||k,ft:k};de(D),z(D,r)},A=(R,k)=>{const[,z]=q(),D={xt:z};return de(D),z&&!k&&le(D,R?s:o),D},Q=(R,k,z)=>{const D={Ht:k};return de(D),k&&!z&&le(D,o),D},[U,ie]=S?bR(_,Y):[],ve=!b&&Pg(_,I,{ft:!0}),[re,ge]=_p(_,!1,Q,{ct:f,et:f}),_e=b&&qi&&new qi((R=>{const k=R[R.length-1].contentRect;I({_t:!0,ft:gg(k,u)}),u=k}));return[()=>{_e&&_e.observe(_);const R=ve&&ve(),k=U&&U(),z=re(),D=N.G((B=>{const[,oe]=q();le({Et:B,xt:oe,_t:E},a)}));return()=>{_e&&_e.disconnect(),R&&R(),k&&k(),c&&c(),z(),D()}},({Dt:R,zt:k,It:z})=>{const D={},[B]=R("update.ignoreMutation"),[oe,ee]=R("update.attributes"),[G,he]=R("update.elementEvents"),[me,ke]=R("update.debounce"),Ee=he||ee,ze=k||z,Pe=Ne=>xn(B)&&!!B(Ne);if(Ee){l&&l(),c&&c();const[Ne,ut]=_p(S||C,!0,A,{et:ao(f,oe||[]),rt:G,it:h,ut:(Qe,at)=>{const{target:tt,attributeName:pt}=Qe;return(!at&&pt&&!b?MP(tt,h,m):!1)||!!Ki(tt,`.${tn}`)||Pe(Qe)}});c=Ne(),l=ut}if(ke&&(le.O(),dn(me)||di(me)?(o=me,r=!1,s=$g,a=kg):Bo(me)?(o=me.mutation,r=me.resize,s=me.event,a=me.env):(o=!1,r=!1,s=!1,a=!1)),ze){const Ne=ge(),ut=ie&&ie(),Qe=l&&l();Ne&&Ze(D,Q(Ne[0],Ne[1],ze)),ut&&Ze(D,Y(ut[0],ze)),Qe&&Ze(D,A(Qe[0],ze))}return de(D),D},P]},Rg=(t,e)=>xn(e)?e.apply(0,t):e,SR=(t,e,n,i)=>{const o=Kc(i)?n:i;return Rg(t,o)||e.apply(0,t)},Ig=(t,e,n,i)=>{const o=Kc(i)?n:i,r=Rg(t,o);return!!r&&(ds(r)?r:e.apply(0,t))},CR=(t,e)=>{const{nativeScrollbarsOverlaid:n,body:i}=e||{},{M:o,P:r,K:s}=Un(),{nativeScrollbarsOverlaid:a,body:l}=s().cancel,c=n??a,u=Kc(i)?l:i,d=(o.x||o.y)&&c,h=t&&(Vs(u)?!r:u);return!!d||!!h},ER=(t,e,n,i)=>{const o="--os-viewport-percent",r="--os-scroll-percent",s="--os-scroll-direction",{K:a}=Un(),{scrollbars:l}=a(),{slot:c}=l,{dt:u,vt:d,L:h,At:m,gt:f,bt:p,V:_}=e,{scrollbars:C}=m?{}:t,{slot:w}=C||{},S=[],b=[],E=[],x=Ig([u,d,h],(()=>_&&p?u:d),c,w),O=U=>{if($o){let ie=null,ve=[];const re=new $o({source:f,axis:U}),ge=()=>{ie&&ie.cancel(),ie=null};return{Mt:R=>{const{Tt:k}=n,z=qa(k)[U],D=U==="x",B=[Ba(0,D),Ba(`calc(-100% + 100cq${D?"w":"h"})`,D)],oe=z?B:B.reverse();return ve[0]===oe[0]&&ve[1]===oe[1]||(ve=oe,ge(),ie=R.kt.animate({clear:["left"],transform:oe},{timeline:re})),ge}}}},$={x:O("x"),y:O("y")},K=()=>{const{Rt:U,Vt:ie}=n,ve=(re,ge)=>ag(0,1,re/(re+ge)||0);return{x:ve(ie.x,U.x),y:ve(ie.y,U.y)}},F=(U,ie,ve)=>{const re=ve?Ks:ug;ot(U,(ge=>{re(ge.Lt,ie)}))},P=(U,ie)=>{ot(U,(ve=>{const[re,ge]=ie(ve);co(re,ge)}))},N=(U,ie,ve)=>{const re=Bs(ve),ge=re?ve:!0,_e=re?!ve:!0;ge&&F(b,U,ie),_e&&F(E,U,ie)},M=()=>{const U=K(),ie=ve=>re=>[re.Lt,{[o]:Ul(ve)+""}];P(b,ie(U.x)),P(E,ie(U.y))},q=()=>{if(!$o){const{Tt:U}=n,ie=lp(U,Jt(f)),ve=re=>ge=>[ge.Lt,{[r]:Ul(re)+""}];P(b,ve(ie.x)),P(E,ve(ie.y))}},le=()=>{const{Tt:U}=n,ie=qa(U),ve=re=>ge=>[ge.Lt,{[s]:re?"0":"1"}];P(b,ve(ie.x)),P(E,ve(ie.y)),$o&&(b.forEach($.x.Mt),E.forEach($.y.Mt))},de=()=>{if(_&&!p){const{Rt:U,Tt:ie}=n,ve=qa(ie),re=lp(ie,Jt(f)),ge=_e=>{const{Lt:R}=_e,k=qo(R)===h&&R,z=(D,B,oe)=>{const ee=B*D;return mg(oe?ee:-ee)};return[k,k&&{transform:Ba({x:z(re.x,U.x,ve.x),y:z(re.y,U.y,ve.y)})}]};P(b,ge),P(E,ge)}},Y=U=>{const ie=U?"x":"y",re=Xi(`${tn} ${U?nR:iR}`),ge=Xi(xg),_e=Xi(lu),R={Lt:re,Pt:ge,kt:_e},k=$[ie];return ct(U?b:E,R),ct(S,[It(re,ge),It(ge,_e),Le(lo,re),k&&k.Mt(R),i(R,N,U)]),R},I=Le(Y,!0),A=Le(Y,!1),Q=()=>(It(x,b[0].Lt),It(x,E[0].Lt),Le(Zt,S));return I(),A(),[{Ut:M,Nt:q,qt:le,Bt:de,Ft:N,jt:{Xt:b,Yt:I,Wt:Le(P,b)},Jt:{Xt:E,Yt:A,Wt:Le(P,E)}},Q]},xR=(t,e,n,i,o)=>(r,s,a)=>{const{vt:l,L:c,V:u,gt:d,Gt:h,St:m}=e,{Lt:f,Pt:p,kt:_}=r,[C,w]=Wi(333),[S,b]=Wi(444),E=$=>{xn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:$.x,top:$.y})},x=()=>{const $="pointerup pointercancel lostpointercapture",K=`client${a?"X":"Y"}`,F=a?ar:lr,P=a?"left":"top",N=a?"w":"h",M=a?"x":"y",q=[];return st(p,"pointerdown",i((le=>{const de=Ki(le.target,`.${lu}`)===_,Y=de?_:p,I=t.scrollbars,A=I[de?"dragScroll":"clickScroll"],{button:Q,isPrimary:U,pointerType:ie}=le,{pointers:ve}=I;if(Q===0&&U&&A&&(ve||[]).includes(ie)){Zt(q),b();const ge=!de&&(le.shiftKey||A==="instant"),_e=Le(Ha,_),R=Le(Ha,p),k=(tt,pt)=>(tt||_e())[P]-(pt||R())[P],z=Ll(Ha(d)[F])/hi(d)[N]||1,D=Jt(d)[M],B=tt=>{cn(d,{[M]:D+tt})},oe=tt=>{const{Rt:pt}=n,dt=hi(p)[N]-hi(_)[N],ft=1/z*tt/dt;B(ft*pt[M])},ee=le[K],G=_e(),he=R(),me=G[F],ke=k(G,he)+me/2,ze=ee-he[P]-ke,Pe=de?0:ze,Ne=tt=>{Zt(at),Y.releasePointerCapture(tt.pointerId)},ut=de||ge,Qe=m(),at=[st(h,$,Ne),st(h,"selectstart",(tt=>Bl(tt)),{D:!1}),st(p,$,Ne),ut&&st(p,"pointermove",(tt=>oe(Pe+tt[K]-ee))),ut&&(()=>{const tt=Jt(d);Qe();const pt=Jt(d),dt={x:pt.x-tt.x,y:pt.y-tt.y};(li(dt.x)>3||li(dt.y)>3)&&(m(),cn(d,tt),E(dt),S(Qe))})];if(Y.setPointerCapture(le.pointerId),ge)oe(ze);else if(!de){const tt=vo(pR);if(tt){const{Vt:pt}=n,dt=tt(B,oe,Le(k),ze,pt[M],A,!!a,(ft=>{ft?Qe():ct(at,Qe)}));ct(at,dt),ct(q,Le(dt,!0))}}}})))};let O=!0;return Le(Zt,[st(_,"pointermove pointerleave",i(o)),st(f,"pointerenter",i((()=>{s(pp,!0)}))),st(f,"pointerleave pointercancel",i((()=>{s(pp,!1)}))),st(f,"wheel",i(($=>{const{deltaX:K,deltaY:F,deltaMode:P}=$;O&&P===0&&qo(f)===l&&E({x:K,y:F}),O=!1,s(mp,!0),C((()=>{O=!0,s(mp)})),Bl($)})),{D:!1,I:!0}),!u&&st(f,"mousedown",i((()=>{const $=Nl();(op($,Kn)||op($,pi)||$===document.body)&&Wc(Le(Hl,c),25)}))),st(f,"pointerdown",(()=>{const $=st(h,"click",(F=>{K(),_g(F)}),{A:!0,I:!0,D:!1}),K=st(h,"pointerup pointercancel",(()=>{K(),setTimeout($,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),x(),w,b])},TR=(t,e,n,i,o,r,s)=>{let a,l,c,u,d,h=Ho,m=0;const f=["mouse","pen"],p=_e=>R=>{n.Kt||_e(R)},_=_e=>f.includes(_e.pointerType),[C,w]=Wi(),[S,b]=Wi(100),[E,x]=Wi(50),[O,$]=Wi((()=>m)),[K,F]=ER(t,r,o,xR(e,r,o,p,(_e=>_(_e)&&Q()))),{vt:P,Qt:N,bt:M}=r,{Ft:q,Ut:le,Nt:de,qt:Y,Bt:I}=K,A=(_e,R)=>{$();const k=z=>{n.Kt||q(sR,z)};if(_e)k();else{const z=c?!a:!0;m>0&&!R?O(Le(k,z)):k(z)}},Q=()=>{(c?!a:!u)&&(A(!0),S((()=>{A(!1)})))},U=_e=>{_(_e)&&(a=!0,!n.Kt&&c&&A(!0))},ie=_e=>{_(_e)&&(a=!1,!n.Kt&&c&&A(!1))},ve=_e=>{q(Kl,_e,!0),q(Kl,_e,!1)},re=[$,b,x,w,()=>h(),st(P,"pointerover",U,{A:!0}),st(P,"pointerenter",U),st(P,"pointerleave",ie),st(P,"pointermove",p((_e=>{_(_e)&&l&&Q()}))),st(N,"scroll",p((_e=>{C((()=>{de(),Q()})),s(_e),I()})))],ge=vo(cu);return[()=>Le(Zt,ct(re,F())),({Dt:_e,It:R,Zt:k,tn:z})=>{const{nn:D,sn:B,en:oe,cn:ee}=z||{},{Ct:G,ft:he}=k||{},{B:me}=i,{M:ke,P:Ee}=Un(),{rn:ze,j:Pe}=o,[Ne,ut]=_e("showNativeOverlaidScrollbars"),[Qe,at]=_e("scrollbars.theme"),[tt,pt]=_e("scrollbars.visibility"),[dt,ft]=_e("scrollbars.autoHide"),[Ft,fn]=_e("scrollbars.autoHideSuspend"),[X]=_e("scrollbars.autoHideDelay"),[V,J]=_e("scrollbars.dragScroll"),[ye,xe]=_e("scrollbars.clickScroll"),[se,Me]=_e("overflow"),Z=he&&!R,ae=D||B||ee||G||R,fe=oe||pt||Me,ce=Ne&&ke.x&&ke.y,be=!Ee&&!ge,$n=ce||be,Qt=(on,Dt,bt)=>{const dr=on.includes(Pi)&&(tt===Yn||tt==="auto"&&Dt===Pi);return q(oR,dr,bt),dr};if(m=X,(ut||be)&&q(eR,$n),at&&(q(d),q(Qe,!0),d=Qe),(fn||Z)&&(ve(!Ft),Z&&Ft&&(Pe.x||Pe.y?(h(),E((()=>{h=st(N,Pi,p(Le(ve,!0)),{A:!0})}))):ve(!0))),ft&&(l=dt==="move",c=dt==="leave",u=dt==="never",A(u,!0)),J&&q(lR,V),xe&&q(aR,!!ye),fe){const on=Qt(se.x,ze.x,!0),Dt=Qt(se.y,ze.y,!1);q(rR,!(on&&Dt))}ae&&(de(),le(),I(),ee&&Y(),q(fp,!Pe.x,!0),q(fp,!Pe.y,!1),q(tR,me&&!M))},{},K]},$R=t=>{const e=Un(),{K:n,P:i}=e,{elements:o}=n(),{padding:r,viewport:s,content:a}=o,l=ds(t),c=l?{}:t,{elements:u}=c,{padding:d,viewport:h,content:m}=u||{},f=l?t:c.target,p=hg(f),_=f.ownerDocument,C=_.documentElement,w=()=>_.defaultView||Bt,S=Le(SR,[f]),b=Le(Ig,[f]),E=Le(Xi,""),x=Le(S,E,s),O=Le(b,E,a),$=G=>{const he=hi(G),me=ms(G),ke=jn(G,Qc),Ee=jn(G,Xc);return me.w-he.w>0&&!Yi(ke)||me.h-he.h>0&&!Yi(Ee)},K=x(h),F=K===f,P=F&&p,N=!F&&O(m),M=!F&&K===N,q=P?C:K,le=P?q:f,de=!F&&b(E,r,d),Y=!M&&N,I=[Y,q,de,le].map((G=>ds(G)&&!qo(G)&&G)),A=G=>G&&Qv(I,G),Q=!A(q)&&$(q)?q:f,U=P?C:q,ve={dt:f,vt:le,L:q,ln:de,ht:Y,gt:U,Qt:P?_:q,an:p?C:Q,Gt:_,bt:p,At:l,V:F,un:w,yt:G=>nu(q,Kn,G),wt:(G,he)=>fs(q,Kn,G,he),St:()=>fs(U,Kn,GP,!0)},{dt:re,vt:ge,ln:_e,L:R,ht:k}=ve,z=[()=>{kn(ge,[pi,Wa]),kn(re,Wa),p&&kn(C,[Wa,pi])}];let D=zl([k,R,_e,ge,re].find((G=>G&&!A(G))));const B=P?re:k||R,oe=Le(Zt,z);return[ve,()=>{const G=w(),he=Nl(),me=Ne=>{It(qo(Ne),zl(Ne)),lo(Ne)},ke=Ne=>st(Ne,"focusin focusout focus blur",_g,{I:!0,D:!1}),Ee="tabindex",ze=eu(R,Ee),Pe=ke(he);return Wn(ge,pi,F?"":qP),Wn(_e,Wl,""),Wn(R,Kn,""),Wn(k,dp,""),F||(Wn(R,Ee,ze||"-1"),p&&Wn(C,up,"")),It(B,D),It(ge,_e),It(_e||ge,!F&&R),It(R,k),ct(z,[Pe,()=>{const Ne=Nl(),ut=A(R),Qe=ut&&Ne===R?re:Ne,at=ke(Qe);kn(_e,Wl),kn(k,dp),kn(R,Kn),p&&kn(C,up),ze?Wn(R,Ee,ze):kn(R,Ee),A(k)&&me(k),ut&&me(R),A(_e)&&me(_e),Hl(Qe),at()}]),i&&!F&&(tu(R,Kn,Eg),ct(z,Le(kn,R,Kn))),Hl(!F&&p&&he===re&&G.top===G?R:he),Pe(),D=0,oe},oe]},kR=({ht:t})=>({Zt:e,fn:n,It:i})=>{const{$t:o}=e||{},{Ot:r}=n;t&&(o||i)&&co(t,{[lr]:r&&"100%"})},OR=({vt:t,ln:e,L:n,V:i},o)=>{const[r,s]=Xt({i:RP,o:sp()},Le(sp,t,"padding",""));return({Dt:a,Zt:l,fn:c,It:u})=>{let[d,h]=s(u);const{P:m}=Un(),{_t:f,xt:p,Ct:_}=l||{},{B:C}=c,[w,S]=a("paddingAbsolute");(f||h||(u||p))&&([d,h]=r(u));const E=!i&&(S||_||h);if(E){const x=!w||!e&&!m,O=d.r+d.l,$=d.t+d.b,K={[ng]:x&&!C?-O:0,[ig]:x?-$:0,[tg]:x&&C?-O:0,top:x?-d.t:0,right:x?C?-d.r:"auto":0,left:x?C?"auto":-d.l:0,[ar]:x&&`calc(100% + ${O}px)`},F={[Xv]:x?d.t:0,[Jv]:x?d.r:0,[eg]:x?d.b:0,[Zv]:x?d.l:0};co(e||n,K),co(n,F),Ze(o,{ln:d,_n:!x,F:e?F:Ze({},K,F)})}return{dn:E}}},AR=(t,e)=>{const n=Un(),{vt:i,ln:o,L:r,V:s,Qt:a,gt:l,bt:c,wt:u,un:d}=t,{P:h}=n,m=c&&s,f=Le(Yv,0),p={display:()=>!1,direction:re=>re!=="ltr",flexDirection:re=>re.endsWith("-reverse"),writingMode:re=>re!=="horizontal-tb"},_=Nt(p),C={i:Jc,o:{w:0,h:0}},w={i:Jr,o:{}},S=re=>{u(Cg,!m&&re)},b=()=>jn(r,_),E=(re,ge)=>{const _e=!Nt(re).length,R=ge?!0:_.some((Ee=>{const ze=re[Ee];return mo(ze)&&p[Ee](ze)}));if(_e||!R||!NP(r))return{T:{x:0,y:0},k:{x:1,y:1}};S(!0);const k=Jt(l),z=st(a,Pi,(Ee=>{const ze=Jt(l);Ee.isTrusted&&ze.x===k.x&&ze.y===k.y&&ru(Ee)}),{I:!0,A:!0}),D=u(QP,!0);cn(l,{x:0,y:0}),D();const B=Jt(l),oe=ms(l);cn(l,{x:oe.w,y:oe.h});const ee=Jt(l),G={x:ee.x-B.x,y:ee.y-B.y};cn(l,{x:-oe.w,y:-oe.h});const he=Jt(l),me={x:he.x-B.x,y:he.y-B.y},ke={x:li(G.x)>=li(me.x)?ee.x:he.x,y:li(G.y)>=li(me.y)?ee.y:he.y};return cn(l,k),Vo((()=>z())),{T:B,k:ke}},x=(re,ge)=>{const _e=Bt.devicePixelRatio%1!==0?1:0,R={w:f(re.w-ge.w),h:f(re.h-ge.h)};return{w:R.w>_e?R.w:0,h:R.h>_e?R.h:0}},O=(re,ge)=>{const _e=(R,k,z,D)=>{const B=R===Yn?yn:dR(R),oe=Yi(R),ee=Yi(z);return!k&&!D?yn:oe&&ee?Yn:oe?k&&D?B:k?Yn:yn:k?B:ee&&D?Yn:yn};return{x:_e(ge.x,re.x,ge.y,re.y),y:_e(ge.y,re.y,ge.x,re.x)}},$=re=>{const ge=R=>[Yn,yn,Pi].map((k=>ve(Yl(k),R))),_e=ge(!0).concat(ge()).join(" ");u(_e),u(Nt(re).map((R=>ve(re[R],R==="x"))).join(" "),!0)},[K,F]=Xt(C,Le(ou,r)),[P,N]=Xt(C,Le(ms,r)),[M,q]=Xt(C),[le]=Xt(w),[de,Y]=Xt(C),[I]=Xt(w),[A]=Xt({i:(re,ge)=>qs(re,ge,ps(ao(Nt(re),Nt(ge)))),o:{}}),[Q,U]=Xt({i:(re,ge)=>Jr(re.T,ge.T)&&Jr(re.k,ge.k),o:yg()}),ie=vo(cu),ve=(re,ge)=>`${ge?WP:KP}${PP(re)}`;return({Dt:re,Zt:ge,fn:_e,It:R},{dn:k})=>{const{_t:z,Ht:D,xt:B,Ct:oe,ft:ee,Et:G}=ge||{},he=ie&&ie.R(t,e,_e,n,re),{X:me,Y:ke,W:Ee}=he||{},[ze,Pe]=uR(re,n),[Ne,ut]=re("overflow"),Qe=Yi(Ne.x),at=Yi(Ne.y),tt=z||k||B||oe||G||Pe;let pt=F(R),dt=N(R),ft=q(R),Ft=Y(R);if(Pe&&h&&u(Eg,!ze),tt){nu(i,pi,es)&&S(!0);const Tu=ke&&ke(),[hr]=pt=K(R),[pr]=dt=P(R),fr=vg(r),mr=m&&zP(d()),d_={w:f(pr.w+hr.w),h:f(pr.h+hr.h)},$u={w:f((mr?mr.w:fr.w+f(fr.w-pr.w))+hr.w),h:f((mr?mr.h:fr.h+f(fr.h-pr.h))+hr.h)};Tu&&Tu(),Ft=de($u),ft=M(x(d_,$u),R)}const[fn,X]=Ft,[V,J]=ft,[ye,xe]=dt,[se,Me]=pt,[Z]=le({x:V.w>0,y:V.h>0}),ae=Qe&&at&&(Z.x||Z.y)||Qe&&Z.x&&!Z.y||at&&Z.y&&!Z.x,fe=k||oe||G||Me||xe||X||J||ut||Pe||tt||D&&m,[ce]=re("update.flowDirectionStyles"),[be,$n]=A(ce?ce(r)||{}:b(),R),Qt=oe||ee||$n||R,[on,Dt]=Qt?Q(E(be,!!ce),R):U();let bt=O(Z,Ne);S(!1),fe&&($(bt),bt=hR(r,Z),Ee&&me&&(me(bt,ye,se),co(r,Ee(bt))));const[dr,u_]=I(bt);return fs(i,pi,es,ae),fs(o,Wl,es,ae),Ze(e,{rn:dr,Vt:{x:fn.w,y:fn.h},Rt:{x:V.w,y:V.h},j:Z,Tt:UP(on,V)}),{en:u_,nn:X,sn:J,cn:Dt||J}}},PR=t=>{const[e,n,i]=$R(t),o={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[ng]:0,[ig]:0,[tg]:0,[Xv]:0,[Jv]:0,[eg]:0,[Zv]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:yn,y:yn},j:{x:!1,y:!1},Tt:yg()},{dt:r,gt:s,V:a,St:l}=e,{P:c,M:u}=Un(),d=!c&&(u.x||u.y),h=[kR(e),OR(e,o),AR(e,o)];return[n,m=>{const f={},_=d&&Jt(s),C=_&&l();return ot(h,(w=>{Ze(f,w(m,f)||{})})),cn(s,_),C&&C(),a||cn(r,0),f},o,e,i]},RR=(t,e,n,i)=>{let o=!1;const r={Kt:!1,pn:!1},s=Ka(e,{}),[a,l,c,u,d]=PR(t),[h,m,f]=wR(u,c,s,(b=>{S({},b)})),[p,_,,C]=TR(t,e,r,f,c,u,i),w=b=>Nt(b).some((E=>!!b[E])),S=(b,E)=>{const{Kt:x,pn:O}=r;if(O||x&&o)return!1;const{vn:$,It:K,zt:F}=b,P=$||{},N=!!K||!o,M={Dt:Ka(e,P,N),vn:P,It:N},q=E||m(Ze({},M,{zt:F})),le=l(Ze({},M,{fn:f,Zt:q}));_(Ze({},M,{Zt:q,tn:le}));const de=w(q),Y=w(le),I=de||Y||!Zc(P)||N;return o=!0,I&&n(b,{Zt:q,tn:le}),I};return[()=>{const{an:b,gt:E,St:x}=u,O=Jt(b),$=[h(),a(),p(),()=>{r.pn=!0}],K=x();return cn(E,O),K(),Le(Zt,$)},S,b=>{const E=r.Kt;r.Kt=b,!b&&E!==b&&S({It:!0,zt:!0})},()=>{_({Dt:Ka(e,{},!1),vn:{},It:!1})},()=>({gn:r,hn:f,bn:c}),{yn:u,wn:C},d]},uu=new WeakMap,IR=(t,e)=>{uu.set(t,e)},MR=t=>{uu.delete(t)},Mg=t=>uu.get(t),hn=(t,e,n)=>{const{tt:i}=Un(),o=ds(t),r=o?t:t.target,s=Mg(r);if(e&&!s){const a=[],l={},c=N=>{const M=sg(N),q=vo(HP);return q?q(M,!0):M},u=Ze({},i(),c(e)),[d,h,m]=ql(),[f,p,_]=ql(n),C=(N,M)=>{_(N,M),m(N,M)},[w,S,b,E,x,O,$]=RR(t,u,(({vn:N,It:M},{Zt:q,tn:le})=>{const{_t:de,Ct:Y,$t:I,xt:A,Ht:Q,ft:U}=q,{nn:ie,sn:ve,en:re,cn:ge}=le;C("updated",[P,{updateHints:{sizeChanged:!!de,directionChanged:!!Y,heightIntrinsicChanged:!!I,overflowEdgeChanged:!!ie,overflowAmountChanged:!!ve,overflowStyleChanged:!!re,scrollCoordinatesChanged:!!ge,contentMutation:!!A,hostMutation:!!Q,appear:!!U},changedOptions:N||{},force:!!M}])}),(N=>C("scroll",[P,N]))),K=N=>{const{gn:M}=x(),{pn:q}=M;q||(MR(r),Zt(a),C("destroyed",[P,N]),h(),p())},P={options(N,M){if(N){const q=M?i():{},le=Og(u,Ze(q,c(N)));Zc(le)||(Ze(u,le),S({vn:le}))}return Ze({},u)},on:f,off:(N,M)=>{N&&M&&p(N,M)},state(){const{gn:N,hn:M,bn:q}=x(),{pn:le,Kt:de}=N,{B:Y}=M,{Vt:I,Rt:A,rn:Q,j:U,ln:ie,_n:ve,Tt:re}=q;return Ze({},{overflowEdge:I,overflowAmount:A,overflowStyle:Q,hasOverflow:U,scrollCoordinates:{start:re.T,end:re.k},padding:ie,paddingAbsolute:ve,directionRTL:Y,sleeping:de,destroyed:le})},elements(){const{dt:N,vt:M,ln:q,L:le,ht:de,gt:Y,Qt:I}=O.yn,{jt:A,Jt:Q}=O.wn,U=ve=>{const{kt:re,Pt:ge,Lt:_e}=ve;return{scrollbar:_e,track:ge,handle:re}},ie=ve=>{const{Xt:re,Yt:ge}=ve,_e=U(re[0]);return Ze({},_e,{clone:()=>{const R=U(ge());return E(),R}})};return Ze({},{target:N,host:M,padding:q||le,viewport:le,content:de||le,scrollOffsetElement:Y,scrollEventElement:I,scrollbarHorizontal:ie(A),scrollbarVertical:ie(Q)})},update:N=>S({It:N,zt:!0}),destroy:Le(K,!1),sleep:b,plugin:N=>l[Nt(N)[0]]};return ct(a,[$]),IR(r,P),Sg(bg,hn,[P,d,l]),CR(O.yn.bt,!o&&t.cancel)?(K(!0),P):(ct(a,w()),C("initialized",[P]),P.update(),P)}return s};hn.plugin=t=>{const e=dn(t),n=e?t:[t],i=n.map((o=>Sg(o,hn)[0]));return VP(n),e?i:i[0]};hn.valid=t=>{const e=t&&t.elements,n=xn(e)&&e();return Bo(n)&&!!Mg(n.target)};hn.env=()=>{const{U:t,M:e,P:n,J:i,ot:o,st:r,K:s,Z:a,tt:l,nt:c}=Un();return Ze({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:i,staticDefaultInitialization:o,staticDefaultOptions:r,getDefaultInitialization:s,setDefaultInitialization:a,getDefaultOptions:l,setDefaultOptions:c})};hn.nonce=gR;hn.trustedTypePolicy=DP;class FR{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,n){const i=this._listeners.get(e)??new Set;return this._listeners.set(e,i),i.add(n),this}removeEventListener(e,n){var i;return(i=this._listeners.get(e))==null||i.delete(n),this}dispatchEvent(e,...n){let i=!0;for(const o of this._listeners.get(e)??[])i=o(...n)!==!1&&i;return i}unbindAllListeners(){this._listeners.clear()}}const yp=(t,e="px")=>typeof t=="number"?t+e:t,ii=({style:t},e,n)=>{if(typeof e=="object")for(const[i,o]of Object.entries(e))o!==void 0&&(t[i]=yp(o));else n!==void 0&&(t[e]=yp(n))},bp=(t=0,e=0,n=0,i=0)=>{const o={x:t,y:e,width:n,height:i,top:e,left:t,right:t+n,bottom:e+i};return{...o,toJSON:()=>JSON.stringify(o)}},DR=t=>{let e,n=-1,i=!1;return{next:(...o)=>{e=o,i||(i=!0,n=requestAnimationFrame(()=>{t(...e),i=!1}))},cancel:()=>{cancelAnimationFrame(n),i=!1}}},wp=(t,e,n="touch")=>{switch(n){case"center":{const i=e.left+e.width/2,o=e.top+e.height/2;return i>=t.left&&i<=t.right&&o>=t.top&&o<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},LR=()=>matchMedia("(hover: none), (pointer: coarse)").matches,jR=()=>"safari"in window,Gl=t=>Array.isArray(t)?t:[t],Fg=t=>(e,n,i,o={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=Gl(n),e=Gl(e);for(const r of e)if(r)for(const s of n)r[t](s,i,{capture:!1,...o})},oi=Fg("addEventListener"),vn=Fg("removeEventListener"),zr=t=>{var e;const{clientX:n,clientY:i,target:o}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:i,target:o}},Ni=(t,e=document)=>Gl(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),zR=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(i=>{switch(i){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Ei,max:Sp,min:Cp,ceil:Ep}=Math,xp=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Dg=class extends FR{constructor(e){var n,i,o,r,s;super(),this._selection=xp(),this._targetBoundaryScrolled=!0,this._selectables=[],this._areaLocation={y1:0,x2:0,y2:0,x1:0},this._areaRect=bp(),this._singleClick=!0,this._scrollAvailable=!0,this._scrollingActive=!1,this._scrollSpeed={x:0,y:0},this._scrollDelta={x:0,y:0},this._lastMousePosition={x:0,y:0},this.enable=this._toggleStartEvents,this.disable=this._toggleStartEvents.bind(this,!1),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...e,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...e.behaviour,startThreshold:(n=e.behaviour)!=null&&n.startThreshold?typeof e.behaviour.startThreshold=="number"?e.behaviour.startThreshold:{x:10,y:10,...e.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...(i=e.behaviour)==null?void 0:i.scrolling,startScrollMargins:{x:0,y:0,...(r=(o=e.behaviour)==null?void 0:o.scrolling)==null?void 0:r.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...e.features,singleTap:{allow:!0,intersect:"native",...(s=e.features)==null?void 0:s.singleTap}}};for(const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[u]=="function"&&(this[u]=this[u].bind(this));const{document:a,selectionAreaClass:l,selectionContainerClass:c}=this._options;this._area=a.createElement("div"),this._clippingElement=a.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(l),c&&this._clippingElement.classList.add(c),ii(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),ii(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=DR(u=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",u),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(e=!0){const{document:n,features:i}=this._options,o=e?oi:vn;o(n,"mousedown",this._onTapStart),i.touch&&o(n,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(e,n=!1){const{x:i,y:o,target:r}=zr(e),{document:s,startAreas:a,boundaries:l,features:c,behaviour:u}=this._options,d=r.getBoundingClientRect();if(e instanceof MouseEvent&&!zR(e,u.triggers))return;const h=Ni(a,s),m=Ni(l,s);this._targetElement=m.find(C=>wp(C.getBoundingClientRect(),d));const f=e.composedPath(),p=h.find(C=>f.includes(C));if(this._targetBoundary=m.find(C=>f.includes(C)),!this._targetElement||!p||!this._targetBoundary||!n&&this._emitEvent("beforestart",e)===!1)return;this._areaLocation={x1:i,y1:o,x2:0,y2:0};const _=s.scrollingElement??s.body;this._scrollDelta={x:_.scrollLeft,y:_.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),oi(s,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),oi(s,["mouseup","touchcancel","touchend"],this._onTapStop),oi(s,"scroll",this._onScroll),c.deselectOnBlur&&(this._targetBoundaryScrolled=!1,oi(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(e){const{singleTap:{intersect:n},range:i}=this._options.features,o=zr(e);let r;if(n==="native")r=o.target;else if(n==="touch"){this.resolveSelectables();const{x:a,y:l}=o;r=this._selectables.find(c=>{const{right:u,left:d,top:h,bottom:m}=c.getBoundingClientRect();return a<u&&a>d&&l<m&&l>h})}if(!r)return;for(this.resolveSelectables();!this._selectables.includes(r);)if(r.parentElement)r=r.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:s}=this._selection;if(this._emitEvent("start",e),e.shiftKey&&i&&this._latestElement){const a=this._latestElement,[l,c]=a.compareDocumentPosition(r)&4?[r,a]:[a,r],u=[...this._selectables.filter(d=>d.compareDocumentPosition(l)&4&&d.compareDocumentPosition(c)&2),l,c];this.select(u),this._latestElement=a}else s.includes(r)&&(s.length===1||e.ctrlKey||s.every(a=>this._selection.stored.includes(a)))?this.deselect(r):(this.select(r),this._latestElement=r)}_delayedTapMove(e){const{container:n,document:i,behaviour:{startThreshold:o}}=this._options,{x1:r,y1:s}=this._areaLocation,{x:a,y:l}=zr(e);if(typeof o=="number"&&Ei(a+l-(r+s))>=o||typeof o=="object"&&Ei(a-r)>=o.x||Ei(l-s)>=o.y){if(vn(i,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",e)===!1){vn(i,["mouseup","touchcancel","touchend"],this._onTapStop);return}oi(i,["mousemove","touchmove"],this._onTapMove,{passive:!1}),ii(this._area,"display","block"),Ni(n,i)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(oi(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),oi(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(c=>this._targetElement.contains(c))),this._setupSelectionArea(),this._emitEvent("start",e),this._onTapMove(e)}this._handleMoveEvent(e)}_setupSelectionArea(){const{_clippingElement:e,_targetElement:n,_area:i}=this,o=this._targetRect=n.getBoundingClientRect();this._scrollAvailable?(ii(e,{top:o.top,left:o.left,width:o.width,height:o.height}),ii(i,{marginTop:-o.top,marginLeft:-o.left})):(ii(e,{top:0,left:0,width:"100%",height:"100%"}),ii(i,{marginTop:0,marginLeft:0}))}_onTapMove(e){const{_scrollSpeed:n,_areaLocation:i,_options:o,_frame:r}=this,{speedDivider:s}=o.behaviour.scrolling,a=this._targetElement,{x:l,y:c}=zr(e);if(i.x2=l,i.y2=c,this._lastMousePosition.x=l,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(n.y||n.x)){this._scrollingActive=!0;const u=()=>{if(!n.x&&!n.y){this._scrollingActive=!1;return}const{scrollTop:d,scrollLeft:h}=a;n.y&&(a.scrollTop+=Ep(n.y/s),i.y1-=a.scrollTop-d),n.x&&(a.scrollLeft+=Ep(n.x/s),i.x1-=a.scrollLeft-h),r.next(e),requestAnimationFrame(u)};requestAnimationFrame(u)}else r.next(e);this._handleMoveEvent(e)}_handleMoveEvent(e){const{features:n}=this._options;(n.touch&&LR()||this._scrollAvailable&&jR())&&e.preventDefault()}_onScroll(){const{_scrollDelta:e,_options:{document:n}}=this,{scrollTop:i,scrollLeft:o}=n.scrollingElement??n.body;this._areaLocation.x1+=e.x-o,this._areaLocation.y1+=e.y-i,e.x=o,e.y=i,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,vn(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.deltaY?e.deltaY>0?1:-1:0,o=e.deltaX?e.deltaX>0?1:-1:0;this._scrollSpeed.y+=i*n,this._scrollSpeed.x+=o*n,this._onTapMove(e),e.preventDefault()}_keyboardScroll(e){const{manualSpeed:n}=this._options.behaviour.scrolling,i=e.key==="ArrowLeft"?-1:e.key==="ArrowRight"?1:0,o=e.key==="ArrowUp"?-1:e.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(i)*n,this._scrollSpeed.y+=Math.sign(o)*n,e.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:e,_areaLocation:n,_targetElement:i,_options:o}=this,{scrollTop:r,scrollHeight:s,clientHeight:a,scrollLeft:l,scrollWidth:c,clientWidth:u}=i,d=this._targetRect,{x1:h,y1:m}=n;let{x2:f,y2:p}=n;const{behaviour:{scrolling:{startScrollMargins:_}}}=o;f<d.left+_.x?(e.x=l?-Ei(d.left-f+_.x):0,f=f<d.left?d.left:f):f>d.right-_.x?(e.x=c-l-u?Ei(d.left+d.width-f-_.x):0,f=f>d.right?d.right:f):e.x=0,p<d.top+_.y?(e.y=r?-Ei(d.top-p+_.y):0,p=p<d.top?d.top:p):p>d.bottom-_.y?(e.y=s-r-a?Ei(d.top+d.height-p-_.y):0,p=p>d.bottom?d.bottom:p):e.y=0;const C=Cp(h,f),w=Cp(m,p),S=Sp(h,f),b=Sp(m,p);this._areaRect=bp(C,w,S-C,b-w)}_redrawSelectionArea(){const{x:e,y:n,width:i,height:o}=this._areaRect,{style:r}=this._area;r.left=`${e}px`,r.top=`${n}px`,r.width=`${i}px`,r.height=`${o}px`}_onTapStop(e,n){var i;const{document:o,features:r}=this._options,{_singleClick:s}=this;vn(this._targetElement,"scroll",this._onStartAreaScroll),vn(o,["mousemove","touchmove"],this._delayedTapMove),vn(o,["touchmove","mousemove"],this._onTapMove),vn(o,["mouseup","touchcancel","touchend"],this._onTapStop),vn(o,"scroll",this._onScroll),this._keepSelection(),e&&s&&r.singleTap.allow?this._onSingleTap(e):!s&&!n&&(this._updateElementSelection(),this._emitEvent("stop",e)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,vn(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),vn(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),(i=this._frame)==null||i.cancel(),ii(this._area,"display","none")}_updateElementSelection(){const{_selectables:e,_options:n,_selection:i,_areaRect:o}=this,{stored:r,selected:s,touched:a}=i,{intersect:l,overlap:c}=n.behaviour,u=c==="invert",d=[],h=[],m=[];for(let p=0;p<e.length;p++){const _=e[p];if(wp(o,_.getBoundingClientRect(),l)){if(s.includes(_))r.includes(_)&&!a.includes(_)&&a.push(_);else if(u&&r.includes(_)){m.push(_);continue}else h.push(_);d.push(_)}}u&&h.push(...r.filter(p=>!s.includes(p)));const f=c==="keep";for(let p=0;p<s.length;p++){const _=s[p];!d.includes(_)&&!(f&&r.includes(_))&&m.push(_)}i.selected=d,i.changed={added:h,removed:m},this._latestElement=void 0}_emitEvent(e,n){return this.emit(e,{event:n,store:this._selection,selection:this})}_keepSelection(){const{_options:e,_selection:n}=this,{selected:i,changed:o,touched:r,stored:s}=n,a=i.filter(l=>!s.includes(l));switch(e.behaviour.overlap){case"drop":{n.stored=[...a,...s.filter(l=>!r.includes(l))];break}case"invert":{n.stored=[...a,...s.filter(l=>!o.removed.includes(l))];break}case"keep":{n.stored=[...s,...i.filter(l=>!s.includes(l))];break}}}trigger(e,n=!0){this._onTapStart(e,n)}resolveSelectables(){this._selectables=Ni(this._options.selectables,this._options.document)}clearSelection(e=!0,n=!1){const{selected:i,stored:o,changed:r}=this._selection;r.added=[],r.removed.push(...i,...e?o:[]),n||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=xp(e?[]:o)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(e){Object.assign(this._areaLocation,e),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(e=!1){this._onTapStop(null,!e)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}select(e,n=!1){const{changed:i,selected:o,stored:r}=this._selection,s=Ni(e,this._options.document).filter(a=>!o.includes(a)&&!r.includes(a));return r.push(...s),o.push(...s),i.added.push(...s),i.removed=[],this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null)),s}deselect(e,n=!1){const{selected:i,stored:o,changed:r}=this._selection,s=Ni(e,this._options.document).filter(a=>i.includes(a)||o.includes(a));this._selection.stored=o.filter(a=>!s.includes(a)),this._selection.selected=i.filter(a=>!s.includes(a)),this._selection.changed.added=[],this._selection.changed.removed.push(...s.filter(a=>!r.removed.includes(a))),this._latestElement=void 0,n||(this._emitEvent("move",null),this._emitEvent("stop",null))}};Dg.version="3.9.0";let NR=Dg;const UR="5.2.0",VR={version:UR},BR={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function HR(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),sO(t)?(n=new $l(n,t),n):(n.request=t,n)}function Tp(t){return t.data.slice(0,t.data.size,t.meta.type)}const qR={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class WR extends uO{static VERSION=VR.version;#e;#t;uploaderEvents;constructor(e,n){if(super(e,{...qR,fieldName:n.bundle?"files[]":"file",...n}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=BR,this.i18nInit(),this.#t=new aO({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(n?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=i=>async(o,r)=>{try{const s=await Xk(o,{...r,onBeforeRequest:(c,u)=>this.opts.onBeforeRequest?.(c,u,i),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:c=>{const u=Math.ceil(c/1e3),d=new Error(this.i18n("uploadStalled",{seconds:u}));this.uppy.emit("upload-stalled",d,i)},onUploadProgress:c=>{if(c.lengthComputable)for(const{id:u}of i){const d=this.uppy.getFile(u);d!=null&&this.uppy.emit("upload-progress",d,{uploadStarted:d.progress.uploadStarted??0,bytesUploaded:c.loaded/c.total*d.size,bytesTotal:d.size})}}});let a=await this.opts.getResponseData?.(s);if(s.responseType==="json")a??=s.response;else try{a??=JSON.parse(s.responseText)}catch(c){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:c})}const l=typeof a?.url=="string"?a.url:void 0;for(const{id:c}of i)this.uppy.emit("upload-success",this.uppy.getFile(c),{status:s.status,body:a,uploadURL:l});return s}catch(s){if(s.name==="AbortError")return;const a=s.request;for(const l of i)this.uppy.emit("upload-error",this.uppy.getFile(l.id),HR(a,s),a);throw s}}}getOptions(e){const n=this.uppy.getState().xhrUpload,{headers:i}=this.opts,o={...this.opts,...n||{},...e.xhrUpload||{},headers:{}};return typeof i=="function"?o.headers=i(e):Object.assign(o.headers,this.opts.headers),n&&Object.assign(o.headers,n.headers),e.xhrUpload&&Object.assign(o.headers,e.xhrUpload.headers),o}addMetadata(e,n,i){yh(i.allowedMetaFields,n).forEach(r=>{const s=n[r];Array.isArray(s)?s.forEach(a=>e.append(r,a)):e.append(r,s)})}createFormDataUpload(e,n){const i=new FormData;this.addMetadata(i,e.meta,n);const o=Tp(e);return e.name?i.append(n.fieldName,o,e.meta.name):i.append(n.fieldName,o),i}createBundledUpload(e,n){const i=new FormData,{meta:o}=this.uppy.getState();return this.addMetadata(i,o,n),e.forEach(r=>{const s=this.getOptions(r),a=Tp(r);r.name?i.append(s.fieldName,a,r.name):i.append(s.fieldName,a)}),i}async#n(e){const n=new dO(this.uppy),i=new AbortController;n.onFileRemove(e.id,()=>i.abort()),n.onCancelAll(e.id,()=>i.abort());try{await this.#t.add(async o=>{const r=this.getOptions(e),s=this.#e([e]),a=r.formData?this.createFormDataUpload(e,r):e.data,l=typeof r.endpoint=="string"?r.endpoint:await r.endpoint(e);return s(l,{...r,body:a,signal:AbortSignal.any([o,i.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{n.remove()}}async#i(e){const n=new AbortController;function i(){n.abort()}this.uppy.once("cancel-all",i);try{await this.#t.add(async o=>{const r=this.uppy.getState().xhrUpload??{},s=this.#e(e),a=this.createBundledUpload(e,{...this.opts,...r}),l=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return s(l,{...this.opts,body:a,signal:AbortSignal.any([o,n.signal])})})}catch(o){if(o.name==="AbortError")return;throw o}finally{this.uppy.off("cancel-all",i)}}#r(e){const n=this.getOptions(e),i=yh(n.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(i.map(o=>[o,e.meta[o]])),httpMethod:n.method,useFormData:n.formData,headers:n.headers}}async#o(e){await Promise.allSettled(e.map(n=>{if(n.isRemote){const i=()=>this.#t,o=new AbortController,r=s=>{s.id===n.id&&o.abort()};return this.uppy.on("file-removed",r),this.uppy.getRequestClientForFile(n).uploadRemoteFile(n,this.#r(n),{signal:o.signal,getQueue:i}).finally(()=>{this.uppy.off("file-removed",r)})}return this.#n(n)}))}#a=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const n=this.uppy.getFilesByIds(e),i=eO(n),o=tO(i);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(i.some(s=>s.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#i(i)}else await this.#o(i)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#a)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#a)}}const du=new Map,Ql=Symbol("ServiceContainerId");function KR(t,e){du.set(t,e)}function YR(t){du.delete(t)}function je(t){const e=t??Ao(Ql);if(!e)throw new Error("No VueFinder app instance found. Make sure VueFinder component is mounted and provide the id explicitly or use within a VueFinder component tree.");const n=du.get(e);if(!n)throw new Error(`VueFinder app instance with id "${e}" was not found. Make sure the VueFinder component with id="${e}" is mounted.`);return n}function GR(t){const e=localStorage.getItem(t+"_storage"),n=Mt(JSON.parse(e??"{}"));$e(n,i);function i(){Object.keys(n).length?localStorage.setItem(t+"_storage",JSON.stringify(n)):localStorage.removeItem(t+"_storage")}function o(a,l){n[a]=l}function r(a){delete n[a]}function s(){Object.keys(n).forEach(a=>r(a))}return{getStore:(a,l=null)=>a in n?n[a]:l,setStore:o,removeStore:r,clearStore:s}}function Yt(t,e="An error occurred"){if(!t)return e;if(typeof t=="string")return t||e;if(t instanceof Error)return t.message||e;if(typeof t=="object"&&t!==null){const n=t;if(typeof n.message=="string"&&n.message)return n.message;if(typeof n.error=="string"&&n.error)return n.error}return e}function QR(t,e){return Um(t,e,{encode:JSON.stringify,decode:JSON.parse})}function XR(t){if(!t?.config?.get)return!0;try{return!!t.config.get("notificationsEnabled")}catch{return!0}}function Bi(t,e,n){const i={type:e,message:n};if(t?.emitter?.emit?.("vf-notify",i),!!XR(t))switch(e){case"success":Tr.success(n);break;case"error":Tr.error(n);break;case"warning":Tr.warning(n);break;default:Tr.info(n);break}}function Gt(t){return{success(e){Bi(t,"success",e)},error(e){Bi(t,"error",e)},info(e){Bi(t,"info",e)},warning(e){Bi(t,"warning",e)},emit(e,n){Bi(t,e,n)}}}const Ga=new Map;async function Qa(t,e){const n=e[t];return typeof n=="function"?(await n()).default:n}function JR(t,e,n,i,o){const r=Gt({emitter:n,config:o}),s="vuefinder_locale",a="global";let l;if(Ga.has(a))l=Ga.get(a),e&&e!==l.get()&&l.set(e);else{const b=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):null;l=QR(s,e||b||"en"),Ga.set(a,l)}const c="vuefinder_translations",u=b=>{try{const E=localStorage.getItem(c);if(E)return JSON.parse(E)[b]||null}catch{}return null},d=(b,E)=>{try{const x=localStorage.getItem(c),O=x?JSON.parse(x):{};O[b]=E,localStorage.setItem(c,JSON.stringify(O))}catch{}},h=Oe(l),m=String(h.value),f=u(m),p=H(f||{});let _=!1;!f&&Object.keys(i).length>0&&Qa(m,i).then(b=>{p.value=b,d(m,b)}).catch(()=>{}),$e(h,async(b,E)=>{if(E&&b===E)return;if(!_){_=!0;const O=u(String(b));if(O)p.value=O;else if(Object.keys(i).length>0)try{const $=await Qa(String(b),i);p.value=$,d(String(b),$)}catch{}return}const x=u(String(b));if(x)p.value=x;else try{const O=await Qa(String(b),i);p.value=O,d(String(b),O)}catch(O){const $=Yt(O,"Locale cannot be loaded!");r.error($);return}Object.values(i).length>1&&(r.success("The language is set to "+b),n.emit("vf-language-saved"))},{immediate:!1});const C=(b,...E)=>E.length?C(b=b.replace("%s",String(E.shift())),...E):b;function w(b,...E){return p.value&&Object.prototype.hasOwnProperty.call(p.value,b)?C(p.value[b]||b,...E):C(b,...E)}const S=te({get:()=>h.value,set:b=>{l.set(b)}});return Mt({t:w,locale:S,localeAtom:l})}const ZR=["edit","newfile","newfolder","preview","archive","unarchive","search","rename","upload","delete","fullscreen","download","language","move","copy","history","theme","pinned"],Lg={simple:{search:!0,preview:!0,rename:!0,upload:!0,delete:!0,newfile:!0,newfolder:!0,download:!0},advanced:ZR.reduce((t,e)=>(t[e]=!0,t),{})};function $p(){return Lg.advanced}function jg(t){return t?t==="simple"||t==="advanced"?{...Lg[t]}:{...$p(),...t}:$p()}const eI="4.1.2";function hu(t,e,n,i,o){return e=Math,n=e.log,i=1024,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"iB":"B")}function zg(t,e,n,i,o){return e=Math,n=e.log,i=1e3,o=n(t)/n(i)|0,(t/e.pow(i,o)).toFixed(0)+" "+(o?"KMGTPEZY"[--o]+"B":"B")}function tI(t){if(typeof t=="number")return t;const e={k:1,m:2,g:3,t:4},n=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(t);if(!n)return 0;const i=parseFloat(n[1]||"0"),o=(n[2]||"").toLowerCase(),r=e[o]??0;return Math.round(i*Math.pow(1024,r))}function nI(t){const e=Go(null),n=H(!1),i=H(),o=H(!1);return{visible:n,type:e,data:i,open:(r,s=null)=>{t.get("fullScreen")||(document.querySelector("body").style.overflow="hidden"),n.value=!0,e.value=r,i.value=s},close:()=>{t.get("fullScreen")||(document.querySelector("body").style.overflow=""),n.value=!1,e.value=null},setEditMode:r=>{o.value=r},editMode:o}}const vs={view:"grid",theme:"silver",fullScreen:!1,showTreeView:!1,showHiddenFiles:!0,metricUnits:!1,showThumbnails:!0,persist:!1,path:"",pinnedFolders:[],notificationsEnabled:!0,expandTreeByDefault:!1,expandedTreePaths:[]},gs={initialPath:null,maxFileSize:null,loadingIndicator:"circular",showMenuBar:!0,showToolbar:!0,gridItemWidth:96,gridItemHeight:80,gridItemGap:8,gridIconSize:48,listItemHeight:32,listItemGap:2,listIconSize:16,notificationPosition:"bottom-center",notificationDuration:3e3,notificationVisibleToasts:4,notificationRichColors:!0},iI=new Set(Object.keys(gs));function oI(t){return t||"silver"}function Ng(t){return iI.has(t)}function kp(t){const e={},n={},i=t;for(const o in i)if(Ng(o))n[o]=i[o];else if(o in vs){const r=o;e[r]=i[o]}return{persistenceConfig:e,nonPersistenceConfig:n}}function Op(t,e){const n={...vs,...e,...t};return n.theme=oI(n.theme),n}function Ap(t,e){return{...gs,...e,...t}}const rI=(t,e={})=>{const n=`vuefinder_config_${t}`,{persistenceConfig:i,nonPersistenceConfig:o}=kp(e),r=Op(i,vs),s=Ap(o,gs),a=Um(n,r,{encode:JSON.stringify,decode:JSON.parse}),l=Tt(s),c=ri([a,l],(f,p)=>({...f,...p})),u=(f={})=>{const p=a.get(),_=l.get(),{persistenceConfig:C,nonPersistenceConfig:w}=kp(f),S=Op(C,p),b=Ap(w,_);a.set(S),l.set(b)},d=f=>Ng(f)?l.get()[f]:a.get()[f],h=()=>({...a.get(),...l.get()}),m=(f,p)=>{const _=a.get();typeof f=="object"&&f!==null?a.set({..._,...f}):a.set({..._,[f]:p})};return{state:c,init:u,get:d,set:m,toggle:f=>{const p=a.get();m(f,!p[f])},all:h,reset:()=>{a.set({...vs}),l.set({...gs})}}};function sI(t,e){if(typeof t=="string"&&typeof e=="string")return t.toLowerCase().localeCompare(e.toLowerCase());const n=Number(t)||0,i=Number(e)||0;return n===i?0:n<i?-1:1}const aI=()=>{const t=Tt(""),e=Tt([]),n=Tt(!1),i=Tt([]),o=Tt({active:!1,column:"",order:""}),r=Tt({kind:"all",showHidden:!1}),s=Tt(new Set),a=Tt({type:"copy",path:"",items:new Set}),l=Tt(null),c=Tt(0),u=Tt(!1),d=Tt([]),h=Tt(-1),m=ri([t],ee=>{const G=(ee??"").trim(),he=G.indexOf("://"),me=he>=0?G.slice(0,he):"",ke=(he>=0?G.slice(he+3):G).split("/").filter(Boolean);let Ee="";const ze=ke.map(Pe=>(Ee=Ee?`${Ee}/${Pe}`:Pe,{basename:Pe,name:Pe,path:me?`${me}://${Ee}`:Ee,type:"dir"}));return{storage:me,breadcrumb:ze,path:G}}),f=ri([i,o,r],(ee,G,he)=>{let me=ee;he.kind==="files"?me=me.filter(Ne=>Ne.type==="file"):he.kind==="folders"&&(me=me.filter(Ne=>Ne.type==="dir")),he.showHidden||(me=me.filter(Ne=>!Ne.basename.startsWith(".")));const{active:ke,column:Ee,order:ze}=G;if(!ke||!Ee)return me;const Pe=ze==="asc"?1:-1;return me.slice().sort((Ne,ut)=>sI(Ne[Ee],ut[Ee])*Pe)}),p=ri([i,s],(ee,G)=>G.size===0?[]:ee.filter(he=>G.has(he.path))),_=(ee,G)=>{const he=t.get();if((G??!0)&&he!==ee){const me=d.get(),ke=h.get();ke<me.length-1&&me.splice(ke+1),me.length===0&&he&&me.push(he),me.push(ee),d.set([...me]),h.set(me.length-1)}t.set(ee)},C=ee=>{i.set(ee??[])},w=ee=>{e.set(ee??[])},S=(ee,G)=>{o.set({active:!0,column:ee,order:G})},b=ee=>{const G=o.get();G.active&&G.column===ee?o.set({active:G.order==="asc",column:ee,order:"desc"}):o.set({active:!0,column:ee,order:"asc"})},E=()=>{o.set({active:!1,column:"",order:""})},x=(ee,G)=>{r.set({kind:ee,showHidden:G})},O=()=>{r.set({kind:"all",showHidden:!1})},$=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),he.add(ee),s.set(he)},K=(ee,G="multiple")=>{const he=new Set(s.get());G==="single"&&he.clear(),ee.forEach(me=>he.add(me)),s.set(he)},F=ee=>{const G=new Set(s.get());G.delete(ee),s.set(G)},P=ee=>s.get().has(ee),N=(ee,G="multiple")=>{const he=new Set(s.get());he.has(ee)?he.delete(ee):(G==="single"&&he.clear(),he.add(ee)),s.set(he)},M=(ee="multiple",G)=>{if(ee==="single"){const he=i.get()[0];if(he){const me=he.path;s.set(new Set([me])),c.set(1)}}else{if(G?.selectionFilterType||G?.selectionFilterMimeIncludes&&G.selectionFilterMimeIncludes.length>0){const he=i.get().filter(me=>{const ke=G.selectionFilterType,Ee=G.selectionFilterMimeIncludes;return ke==="files"&&me.type==="dir"||ke==="dirs"&&me.type==="file"?!1:Ee&&Array.isArray(Ee)&&Ee.length>0&&me.type!=="dir"?me.mime_type?Ee.some(ze=>me.mime_type?.startsWith(ze)):!1:!0}).map(me=>me.path);s.set(new Set(he))}else{const he=new Set(i.get().map(me=>me.path));s.set(he)}de(s.get().size)}},q=()=>{s.set(new Set),c.set(0)},le=ee=>{const G=new Set(ee??[]);s.set(G),c.set(G.size)},de=ee=>{c.set(ee)},Y=ee=>{u.set(!!ee)},I=()=>u.get(),A=(ee,G)=>{const he=i.get().filter(me=>G.has(me.path));a.set({type:ee,path:m.get().path,items:new Set(he)})},Q=ee=>ri([a],G=>G.type==="cut"&&Array.from(G.items).some(he=>he.path===ee)),U=ee=>ri([a],G=>G.type==="copy"&&Array.from(G.items).some(he=>he.path===ee));return{files:i,storages:e,currentPath:t,sort:o,filter:r,selectedKeys:s,selectedCount:c,loading:u,draggedItem:l,clipboardItems:a,path:m,sortedFiles:f,selectedItems:p,setPath:_,setFiles:C,setStorages:w,setSort:S,toggleSort:b,clearSort:E,setFilter:x,clearFilter:O,select:$,selectMultiple:K,deselect:F,toggleSelect:N,selectAll:M,isSelected:P,clearSelection:q,setSelection:le,setSelectedCount:de,setLoading:Y,isLoading:I,setClipboard:A,createIsCut:Q,createIsCopied:U,isCut:ee=>{const G=Q(ee);return Oe(G).value??!1},isCopied:ee=>{const G=U(ee);return Oe(G).value??!1},clearClipboard:()=>{a.set({type:"copy",path:"",items:new Set})},getClipboard:()=>a.get(),setDraggedItem:ee=>{l.set(ee)},getDraggedItem:()=>l.get(),clearDraggedItem:()=>{l.set(null)},setReadOnly:ee=>{n.set(ee)},getReadOnly:()=>n.get(),isReadOnly:ee=>n.get()?!0:ee.read_only??!1,goBack:()=>{const ee=d.get(),G=h.get();if(G>0){const he=G-1,me=ee[he];me&&(h.set(he),_(me,!1))}},goForward:()=>{const ee=d.get(),G=h.get();if(G<ee.length-1){const he=G+1,me=ee[he];me&&(h.set(he),_(me,!1))}},canGoBack:ri([h],ee=>ee>0),canGoForward:ri([d,h],(ee,G)=>G<ee.length-1),navigationHistory:d,historyIndex:h}};class lI{validateParam(e,n){if(e==null)throw new Error(`${n} is required`)}validatePath(e){if(!e)throw new Error("Path must be a non-empty string")}parsePath(e){if(!e)return{};if(e.includes("://")){const[n,...i]=e.split("://");return{storage:n,path:i.join("://")}}return{path:e}}combinePath(e,n){return e&&n?`${e}://${n}`:n||""}}function Pp(t,e,n){const i=`HTTP ${e}: ${n}`;if(!t)return i;try{const o=JSON.parse(t);if(o.message)return o.message;if(o.error){if(typeof o.error=="string")return o.error;if(o.error.message)return o.error.message}if(o.errors&&Array.isArray(o.errors)&&o.errors.length>0){const r=o.errors.map(s=>s.message).filter(s=>!!s);if(r.length>0)return r.join(", ")}return o.detail?o.detail:o.title?o.title:t}catch{return t||i}}class Ug extends lI{config;static DEFAULT_URLS={list:"",upload:"/upload",delete:"/delete",rename:"/rename",copy:"/copy",move:"/move",archive:"/archive",unarchive:"/unarchive",createFile:"/create-file",createFolder:"/create-folder",preview:"/preview",download:"/download",search:"/search",save:"/save"};constructor(e){super();const n={...Ug.DEFAULT_URLS,...e.url||{}};this.config={...e,baseURL:e.baseURL||"",url:n}}setBaseURL(e){this.config.baseURL=e||""}setToken(e){this.config.token=e}configureUploader(e,n){const i=this.getHeaders();delete i["Content-Type"],e.use(WR,{endpoint:`${this.config.baseURL}${this.config.url.upload}`,fieldName:"file",bundle:!1,headers:i,formData:!0}),e.on("upload",()=>{const o=n.getTargetPath();e.getFiles().forEach(r=>{e.setFileMeta(r.id,{path:o})})})}getHeaders(){const e={"Content-Type":"application/json",...this.config.headers};return this.config.token&&(e.Authorization=`Bearer ${this.config.token}`),e}async request(e,n={}){const i=`${this.config.baseURL}${e}`,o=await fetch(i,{...n,headers:{...this.getHeaders(),...n.headers}});if(!o.ok){const r=await o.text(),s=Pp(r,o.status,o.statusText);throw new Error(s)}return(o.headers.get("content-type")||"").includes("application/json")?await o.json():await o.text()}async list(e){const n=new URLSearchParams;e?.path&&n.append("path",e.path);const i=n.toString()?`${this.config.url.list}?${n.toString()}`:this.config.url.list;return await this.request(i,{method:"GET"})}async delete(e){return this.validateParam(e.items,"items"),this.validateParam(e.path,"path"),await this.request(this.config.url.delete,{method:"POST",body:JSON.stringify({path:e.path,items:e.items})})}async rename(e){return this.validateParam(e.path,"path"),this.validateParam(e.item,"item"),this.validateParam(e.name,"name"),this.validatePath(e.path),await this.request(this.config.url.rename,{method:"POST",body:JSON.stringify({path:e.path,item:e.item,name:e.name})})}async copy(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.copy,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async move(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.move,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async archive(e){return this.validateParam(e.items,"items"),this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.archive,{method:"POST",body:JSON.stringify({items:e.items,path:e.path,name:e.name})})}async unarchive(e){return this.validateParam(e.item,"item"),this.validateParam(e.path,"path"),await this.request(this.config.url.unarchive,{method:"POST",body:JSON.stringify({item:e.item,path:e.path})})}async createFile(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFile,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}async createFolder(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFolder,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}getPreviewUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`}async getContent(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path}),i=`${this.config.baseURL}${this.config.url.preview}?${n.toString()}`,o=await fetch(i,{headers:this.getHeaders()});if(!o.ok){const r=await o.text(),s=Pp(r,o.status,o.statusText);throw new Error(s)}return{content:await o.text(),mimeType:o.headers.get("Content-Type")||void 0}}getDownloadUrl(e){this.validatePath(e.path);const n=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.download}?${n.toString()}`}async search(e){const n=this.config.url.search,i=new URLSearchParams;e.path&&i.set("path",e.path),e.filter&&i.set("filter",e.filter),e.deep&&i.set("deep","1"),e.size&&e.size!=="all"&&i.set("size",e.size);const o=i.toString()?`${n}?${i.toString()}`:n;return(await this.request(o,{method:"GET"})).files||[]}async save(e){return this.validateParam(e.path,"path"),await this.request(this.config.url.save,{method:"POST",body:JSON.stringify({path:e.path,content:e.content}),headers:this.getHeaders()})}}const Rp={list:t=>["adapter","list",t],search:(t,e,n,i)=>["adapter","search",t,e,n,i],delete:t=>["adapter","delete",t],rename:()=>["adapter","rename"],copy:()=>["adapter","copy"],move:()=>["adapter","move"],archive:()=>["adapter","archive"],unarchive:()=>["adapter","unarchive"],createFile:()=>["adapter","createFile"],createFolder:()=>["adapter","createFolder"]};class cI{driver;queryClient;config;onBeforeOpen;onAfterOpen;constructor(e,n={}){this.driver=e,this.onBeforeOpen=n.onBeforeOpen,this.onAfterOpen=n.onAfterOpen,this.queryClient=n.queryClient||new Gk({defaultOptions:{queries:{refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,retry:n.retry??2},mutations:{retry:n.retry??1}}}),this.config={queryClient:this.queryClient,refetchOnWindowFocus:n.refetchOnWindowFocus??!1,staleTime:n.staleTime??300*1e3,cacheTime:n.cacheTime??600*1e3,retry:n.retry??2,onBeforeOpen:this.onBeforeOpen??(()=>{}),onAfterOpen:this.onAfterOpen??(()=>{})}}getDriver(){return this.driver}getQueryClient(){return this.queryClient}async list(e){const n=Rp.list(e);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.list({path:e}),staleTime:this.config.staleTime})}async open(e){this.onBeforeOpen&&this.onBeforeOpen();const n=await this.list(e);return this.onAfterOpen&&this.onAfterOpen(n),n}async delete(e){const n=await this.driver.delete(e);return this.invalidateListQueries(),n}async rename(e){const n=await this.driver.rename(e);return this.invalidateListQueries(),n}async copy(e){const n=await this.driver.copy(e);return this.invalidateListQueries(),n}async move(e){const n=await this.driver.move(e);return this.invalidateListQueries(),n}async archive(e){const n=await this.driver.archive(e);return this.invalidateListQueries(),n}async unarchive(e){const n=await this.driver.unarchive(e);return this.invalidateListQueries(),n}async createFile(e){const n=await this.driver.createFile(e);return this.invalidateListQueries(),n}async createFolder(e){const n=await this.driver.createFolder(e);return this.invalidateListQueries(),n}async getContent(e){const n=["adapter","content",e.path];return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.getContent(e),staleTime:this.config.staleTime})}getPreviewUrl(e){return this.driver.getPreviewUrl(e)}getDownloadUrl(e){return this.driver.getDownloadUrl(e)}async search(e){const n=Rp.search(e.path,e.filter,e.deep,e.size);return await this.queryClient.fetchQuery({queryKey:n,queryFn:()=>this.driver.search(e),staleTime:this.config.staleTime})}async save(e){const n=await this.driver.save(e);return this.invalidateListQueries(),n}invalidateListQueries(){this.queryClient.invalidateQueries({queryKey:["adapter"],exact:!1})}invalidateListQuery(e){this.queryClient.invalidateQueries({queryKey:["adapter","list",e],exact:!0})}clearCache(){this.queryClient.clear()}}function uI(t){const e=Oe(t.state);return{current:te(()=>e.value.theme||"silver"),set:n=>{t.set("theme",n)}}}const dI=(t,e)=>{const n=GR(t.id??"vf"),i=g$(),o=e.i18n,r=t.locale??e.locale,s=rI(t.id??"vf",t.config??{}),a=aI();if(!t.driver)throw new Error("Driver is required for VueFinder");const l=new cI(t.driver);return Mt({version:eI,config:s,theme:(()=>{const c=uI(s);return{current:c.current,set:c.set}})(),fs:a,root:null,debug:t.debug??!1,emitter:i,storage:n,i18n:JR(n,r,i,o,s),modal:nI(s),adapter:Gn(l),features:jg(t.features),selectionMode:t.selectionMode||"multiple",selectionFilterType:te(()=>t.selectionFilterType||"both"),selectionFilterMimeIncludes:te(()=>t.selectionFilterMimeIncludes||[]),treeViewData:[],filesize:s.get("metricUnits")?zg:hu,contextMenuItems:t.contextMenuItems,customUploader:t.customUploader})},hI=["data-theme"],pI={class:"vuefinder__modal-layout__container"},fI={class:"vuefinder__modal-layout__content"},mI={key:0,class:"vuefinder__modal-layout__footer"},vI={key:0,class:"vuefinder__modal-drag-overlay"},gI={class:"vuefinder__modal-drag-message"},nn=Ce({__name:"ModalLayout",props:{showDragOverlay:{type:Boolean},dragOverlayText:{}},setup(t){const e=H(null),n=je();n.config;const i=t;et(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus(),Ge(()=>{if(document.querySelector(".v-f-modal input")&&window.innerWidth<768&&e.value){const s=e.value.getBoundingClientRect().bottom+16;window.scrollTo({top:s,left:0,behavior:"smooth"})}})});const o=r=>{r.target.classList.contains("vuefinder__modal-layout__wrapper")&&(r.preventDefault(),r.stopPropagation())};return(r,s)=>(y(),T("div",{"data-theme":v(n).theme.current,class:"vuefinder__themer vuefinder__modal-layout","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",tabindex:"0",onKeyup:s[1]||(s[1]=ho(a=>v(n).modal.close(),["esc"]))},[s[2]||(s[2]=g("div",{class:"vuefinder__modal-layout__overlay"},null,-1)),g("div",pI,[g("div",{class:"vuefinder__modal-layout__wrapper",onContextmenu:o,onMousedown:s[0]||(s[0]=Ye(a=>v(n).modal.close(),["self"]))},[g("div",{ref_key:"modalBody",ref:e,class:"vuefinder__modal-layout__body"},[g("div",fI,[Ve(r.$slots,"default")]),r.$slots.buttons?(y(),T("div",mI,[Ve(r.$slots,"buttons")])):ue("",!0)],512)],32)]),i.showDragOverlay?(y(),T("div",vI,[g("div",gI,L(i.dragOverlayText||"Drag and drop the files/folders to here."),1)])):ue("",!0)],40,hI))}}),_I={class:"vuefinder__modal-header"},yI={class:"vuefinder__modal-header__icon-container"},bI={id:"modal-title",class:"vuefinder__modal-header__title"},pn=Ce({__name:"ModalHeader",props:{title:{},icon:{}},setup(t){return(e,n)=>(y(),T("div",_I,[g("div",yI,[(y(),ne($t(t.icon),{class:"vuefinder__modal-header__icon"}))]),g("div",bI,L(t.title),1)]))}}),wI={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24"};function SI(t,e){return y(),T("svg",wI,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"9"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8.2h.01M10.75 11.25H12v4.5m0 0h1.25m-1.25 0h-2"},null,-1)])])}const Vg={render:SI},CI={class:"vuefinder__about-modal__content"},EI={class:"vuefinder__about-modal__main"},xI={class:"vuefinder__about-modal__tab-content"},TI={class:"vuefinder__about-modal__lead"},$I={class:"vuefinder__about-modal__description"},kI={class:"vuefinder__about-modal__links"},OI={href:"https://vuefinder.ozdemir.be",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"},AI={class:"vuefinder__about-modal__meta"},PI={class:"vuefinder__about-modal__meta-item"},RI={class:"vuefinder__about-modal__meta-label"},II={class:"vuefinder__about-modal__meta-value"},MI={class:"vuefinder__about-modal__meta-item"},FI={class:"vuefinder__about-modal__meta-label"},Bg=Ce({__name:"ModalAbout",setup(t){const e=je(),{t:n}=e.i18n;return(i,o)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:o[0]||(o[0]=r=>v(e).modal.close())},L(v(n)("Close")),1)]),default:we(()=>[g("div",CI,[j(pn,{icon:v(Vg),title:"Vuefinder "+v(e).version},null,8,["icon","title"]),g("div",EI,[g("div",xI,[g("div",TI,L(v(n)("A modern, customizable file manager component built for Vue.")),1),g("div",$I,L(v(n)("If you like it, please follow and ⭐ star on GitHub.")),1),g("div",kI,[g("a",OI,L(v(n)("Project Home")),1),o[1]||(o[1]=g("a",{href:"https://github.com/n1crack/vuefinder",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"}," GitHub ",-1))]),g("div",AI,[g("div",PI,[g("span",RI,L(v(n)("Version")),1),g("span",II,L(v(e).version),1)]),g("div",MI,[g("span",FI,L(v(n)("License")),1),o[2]||(o[2]=g("span",{class:"vuefinder__about-modal__meta-value"},"MIT",-1))])])])])])]),_:1}))}}),DI={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function LI(t,e){return y(),T("svg",DI,[...e[0]||(e[0]=[g("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const Hg={render:LI},jI={class:"vuefinder__delete-modal__content"},zI={class:"vuefinder__delete-modal__form"},NI={class:"vuefinder__delete-modal__description"},UI={class:"vuefinder__delete-modal__files vf-scrollbar"},VI={key:0,class:"vuefinder__delete-modal__icon vuefinder__delete-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},BI={key:1,class:"vuefinder__delete-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},HI={class:"vuefinder__delete-modal__file-name"},qI={class:"vuefinder__delete-modal__confirmation"},WI={class:"vuefinder__delete-modal__confirmation-label"},KI={class:"vuefinder__delete-modal__confirmation-text"},YI=["disabled"],Gs=Ce({__name:"ModalDelete",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items),a=H(!1),l=()=>{s.value.length&&a.value&&e.adapter.delete({path:r.value.path,items:s.value.map(({path:c,type:u})=>({path:c,type:u}))}).then(c=>{n.success(i("Files deleted.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to delete files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("div",qI,[g("label",WI,[it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),type:"checkbox",class:"vuefinder__delete-modal__checkbox"},null,512),[[Ss,a.value]]),g("span",KI,L(v(i)("I'm sure delete it, This action cannot be undone.")),1)])]),g("button",{type:"button",class:"vf-btn vf-btn-danger",disabled:!a.value,onClick:l},L(v(i)("Yes, Delete!")),9,YI),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(Hg),title:v(i)("Delete files")},null,8,["icon","title"]),g("div",jI,[g("div",zI,[g("p",NI,L(v(i)("Are you sure you want to delete these files?")),1),g("div",UI,[(y(!0),T(Ie,null,He(s.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__delete-modal__file"},[d.type==="dir"?(y(),T("svg",VI,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",BI,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",HI,L(d.basename),1)]))),128))])])])])]),_:1}))}}),GI={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function QI(t,e){return y(),T("svg",GI,[...e[0]||(e[0]=[g("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1)])])}const qg={render:QI},XI={class:"vuefinder__rename-modal__content"},JI={class:"vuefinder__rename-modal__item"},ZI={class:"vuefinder__rename-modal__item-info"},eM={key:0,class:"vuefinder__rename-modal__icon vuefinder__rename-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},tM={key:1,class:"vuefinder__rename-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},nM={class:"vuefinder__rename-modal__item-name"},Qs=Ce({__name:"ModalRename",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(e.modal.data.items[0]),a=H(s.value.basename),l=()=>{a.value!=s.value.basename&&e.adapter.rename({path:r.value.path,item:s.value.path,name:a.value}).then(c=>{n.success(i("%s is renamed.",a.value)),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to rename")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(i)("Rename")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(qg),title:v(i)("Rename")},null,8,["icon","title"]),g("div",XI,[g("div",JI,[g("p",ZI,[s.value.type==="dir"?(y(),T("svg",eM,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",tM,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",nM,L(s.value.basename),1)]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),class:"vuefinder__rename-modal__input",placeholder:"Name",type:"text",onKeyup:ho(l,["enter"])},null,544),[[Qo,a.value]])])])])]),_:1}))}});function Tn(){const t=je(),e=te(()=>t.features);return{enabled:n=>e.value[n]??!1}}const iM={class:"vuefinder__text-preview"},oM={class:"vuefinder__text-preview__header"},rM=["title"],sM={class:"vuefinder__text-preview__actions"},aM={key:0,class:"vuefinder__text-preview__content"},lM={key:1},cM=Ce({__name:"Text",emits:["success"],setup(t,{emit:e}){const n=e,i=H(""),o=H(""),r=H(null),s=H(!1),a=je(),l=Gt(a),{enabled:c}=Tn(),{t:u}=a.i18n;et(async()=>{try{const m=await a.adapter.getContent({path:a.modal.data.item.path});i.value=m.content,n("success")}catch(m){Yt(m,"Failed to load text content"),n("success")}});const d=()=>{s.value=!s.value,o.value=i.value,a.modal.setEditMode(s.value)},h=async()=>{try{const m=a.modal.data.item.path;await a.adapter.save({path:m,content:o.value}),i.value=o.value,l.success(u("Updated.")),n("success"),s.value=!s.value}catch(m){l.error(Yt(m,u("Failed to save file")))}};return(m,f)=>(y(),T("div",iM,[g("div",oM,[g("div",{id:"modal-title",class:"vuefinder__text-preview__title",title:v(a).modal.data.item.path},L(v(a).modal.data.item.basename),9,rM),g("div",sM,[s.value?(y(),T("button",{key:0,class:"vuefinder__text-preview__save-button",onClick:h},L(v(u)("Save")),1)):ue("",!0),v(c)("edit")?(y(),T("button",{key:1,class:"vuefinder__text-preview__edit-button",onClick:f[0]||(f[0]=p=>d())},L(s.value?v(u)("Cancel"):v(u)("Edit")),1)):ue("",!0)])]),g("div",null,[s.value?(y(),T("div",lM,[it(g("textarea",{ref_key:"editInput",ref:r,"onUpdate:modelValue":f[1]||(f[1]=p=>o.value=p),class:"vuefinder__text-preview__textarea",name:"text",cols:"30",rows:"10"},null,512),[[Qo,o.value]])])):(y(),T("pre",aM,L(i.value),1))])]))}}),pu=async(t,e)=>{if(e){if(e.isFile){const n=await new Promise(i=>{e.file(i)});t(e,n)}if(e.isDirectory){const n=e.createReader(),i=await new Promise(o=>{n.readEntries(o)});for(const o of i)await pu(t,o)}}},gt={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10};function Wg(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=e.config,s=H({QUEUE_ENTRY_STATUS:gt}),a=H(null),l=H(null),c=H(null),u=H(null),d=H(null),h=H([]),m=H(""),f=H(!1),p=H(!1),_=H(null);let C;const w=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},S=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!0},b=Y=>{Y.preventDefault(),Y.stopPropagation(),(!Y.relatedTarget||Y.relatedTarget===document.body)&&(p.value=!1)},E=Y=>{Y.preventDefault(),Y.stopPropagation(),p.value=!1;const I=/^[/\\](.+)/,A=Y.dataTransfer;A&&(A.items&&A.items.length?Array.from(A.items).forEach(Q=>{if(Q.kind==="file"){const U=Q.webkitGetAsEntry?.();if(U)pu((ie,ve)=>{const re=I.exec(ie?.fullPath||"");O(ve,re?re[1]:ve.name)},U);else{const ie=Q.getAsFile?.();ie&&O(ie)}}}):A.files&&A.files.length&&Array.from(A.files).forEach(Q=>O(Q)))},x=Y=>h.value.findIndex(I=>I.id===Y),O=(Y,I)=>C.addFile({name:I||Y.name,type:Y.type,data:Y,source:"Local"}),$=Y=>Y.status===gt.DONE?"text-green-600":Y.status===gt.ERROR||Y.status===gt.CANCELED?"text-red-600":"",K=Y=>Y.status===gt.DONE?"✓":Y.status===gt.ERROR||Y.status===gt.CANCELED?"!":"...",F=()=>u.value?.click(),P=()=>e.modal.close(),N=Y=>{if(f.value||!h.value.filter(I=>I.status!==gt.DONE).length){f.value||(m.value=n("Please select file to upload first."));return}m.value="",_.value=Y||o.value,C.upload()},M=()=>{C.cancelAll(),h.value.forEach(Y=>{Y.status!==gt.DONE&&(Y.status=gt.CANCELED,Y.statusName=n("Canceled"))}),f.value=!1},q=Y=>{f.value||(C.removeFile(Y.id),h.value.splice(x(Y.id),1))},le=Y=>{if(!f.value)if(C.cancelAll(),Y){const I=h.value.filter(A=>A.status!==gt.DONE);h.value=[],I.forEach(A=>O(A.originalFile,A.name))}else h.value=[]},de=Y=>{Y.forEach(I=>{O(I)})};return et(()=>{C=new Pc({debug:e.debug,restrictions:{maxFileSize:tI(r.get("maxFileSize")??"10mb")},locale:e.i18n.t("uppy"),onBeforeFileAdded:(Q,U)=>{if(U[Q.id]!=null){const ie=x(Q.id);h.value[ie]?.status===gt.PENDING&&(m.value=C.i18n("noDuplicates",{fileName:Q.name})),h.value=h.value.filter(ve=>ve.id!==Q.id)}return h.value.push({id:Q.id,name:Q.name,size:e.filesize(Q.size),status:gt.PENDING,statusName:n("Pending upload"),percent:null,originalFile:Q.data}),!0}});const Y={getTargetPath:()=>(_.value||o.value).path};if(t)t(C,Y);else if(e.adapter.getDriver().configureUploader)e.adapter.getDriver().configureUploader(C,Y);else throw new Error("No uploader configured");C.on("restriction-failed",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&q(ie),m.value=U.message}),C.on("upload-start",Q=>{Q.forEach(U=>{const ie=h.value[x(U.id)];ie&&(ie.status=gt.UPLOADING,ie.statusName=n("Uploading"),ie.percent="0%")})}),C.on("upload-progress",(Q,U)=>{const ie=U.bytesTotal??1,ve=Math.floor(U.bytesUploaded/ie*100),re=x(Q.id);re!==-1&&h.value[re]&&(h.value[re].percent=`${ve}%`)}),C.on("upload-success",Q=>{const U=h.value[x(Q.id)];U&&(U.status=gt.DONE,U.statusName=n("Done"))}),C.on("upload-error",(Q,U)=>{const ie=h.value[x(Q.id)];ie&&(ie.percent=null,ie.status=gt.ERROR,ie.statusName=U?.isNetworkError?n("Network Error, Unable establish connection to the server or interrupted."):U?.message||n("Unknown Error"))}),C.on("error",Q=>{m.value=Q.message,f.value=!1}),C.on("complete",Q=>{f.value=!1;const U=_.value||o.value;e.adapter.invalidateListQuery(U.path),e.adapter.open(U.path);const ie=h.value.filter(ve=>ve.status===gt.DONE&&Q.successful.includes(ve.id)).map(ve=>ve.name);e.emitter.emit("vf-upload-complete",ie)}),u.value?.addEventListener("click",()=>l.value?.click()),d.value?.addEventListener("click",()=>c.value?.click());const I={capture:!0};document.addEventListener("dragover",w,I),document.addEventListener("dragenter",S,I),document.addEventListener("dragleave",b,I),document.addEventListener("drop",E,I);const A=Q=>{const U=Q.target,ie=U.files;if(ie){for(const ve of ie)O(ve);U.value=""}};l.value?.addEventListener("change",A),c.value?.addEventListener("change",A)}),Ct(()=>{const Y={capture:!0};document.removeEventListener("dragover",w,Y),document.removeEventListener("dragenter",S,Y),document.removeEventListener("dragleave",b,Y),document.removeEventListener("drop",E,Y)}),{container:a,internalFileInput:l,internalFolderInput:c,pickFiles:u,pickFolders:d,queue:h,message:m,uploading:f,hasFilesInDropArea:p,definitions:s,openFileSelector:F,upload:N,cancel:M,remove:q,clear:le,close:P,getClassNameForEntry:$,getIconForEntry:K,addExternalFiles:de}}const uM={class:"vuefinder__image-preview"},dM={class:"vuefinder__image-preview__header"},hM=["title"],pM={class:"vuefinder__image-preview__actions"},fM={class:"vuefinder__image-preview__image-container"},mM=["src"],vM=Ce({name:"ImagePreview",__name:"Image",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=Gt(i),{enabled:r}=Tn(),{t:s}=i.i18n,a=H(!1),l=H(i.modal.data.item.previewUrl??i.adapter.getPreviewUrl({path:i.modal.data.item.path})),c=H(l.value),{addExternalFiles:u,upload:d,queue:h}=Wg(i.customUploader),m=i.fs,f=Oe(m.path),p=In("cropperRef"),_=async()=>{a.value=!a.value,i.modal.setEditMode(a.value)},C=async()=>{const w=p.value?.getResult({size:{width:795,height:341},fillColor:"#ffffff"})?.canvas;if(!w)return;let S=w;if(w.width>1200||w.height>1200){const $=Math.min(1200/w.width,1200/w.height),K=document.createElement("canvas");K.width=Math.floor(w.width*$),K.height=Math.floor(w.height*$);const F=K.getContext("2d");F&&(F.drawImage(w,0,0,K.width,K.height),S=K)}const b=i.modal.data.item.basename,E=b.split(".").pop()?.toLowerCase()||"jpg",x=E==="png"?"image/png":E==="gif"?"image/gif":"image/jpeg",O=await new Promise($=>{S.toBlob(K=>$(K),x)});if(!O){o.error(s("Failed to save image"));return}try{const $=new File([O],b,{type:x}),K=i.modal.data.item.path.split("/");K.pop();const F={path:K.join("/")||(f.value?.path??"")};u([$]),await new Promise(q=>setTimeout(q,100));const P=h.value.find(q=>q.name===$.name);if(!P)throw new Error("File was not added to upload queue");d(F);let N=0;for(;N<150;){await new Promise(le=>setTimeout(le,200));const q=h.value.find(le=>le.id===P.id);if(q?.status===gt.DONE)break;if(q?.status===gt.ERROR)throw new Error(q.statusName||"Upload failed");N++}o.success(s("Updated.")),await fetch(l.value,{cache:"reload",mode:"no-cors"});const M=i.root?.querySelector?.('[data-src="'+l.value+'"]');M&&M instanceof HTMLElement&&Hi.resetStatus(M),i.emitter.emit("vf-refresh-thumbnails"),await _(),n("success")}catch($){o.error(Yt($,s("Failed to save image")))}};return et(()=>{n("success")}),(w,S)=>(y(),T("div",uM,[g("div",dM,[g("h3",{id:"modal-title",class:"vuefinder__image-preview__title",title:v(i).modal.data.item.path},L(v(i).modal.data.item.basename),9,hM),g("div",pM,[a.value?(y(),T("button",{key:0,class:"vuefinder__image-preview__crop-button",onClick:C},L(v(s)("Crop")),1)):ue("",!0),v(r)("edit")?(y(),T("button",{key:1,class:"vuefinder__image-preview__edit-button",onClick:S[0]||(S[0]=b=>_())},L(a.value?v(s)("Cancel"):v(s)("Edit")),1)):ue("",!0)])]),g("div",fM,[a.value?(y(),ne(v(wv),{key:1,ref_key:"cropperRef",ref:p,class:"h-full w-full",crossorigin:"anonymous",src:c.value,"auto-zoom":!0,priority:"image",transitions:!0},null,8,["src"])):(y(),T("img",{key:0,style:{},src:v(i).modal.data.item.previewUrl??v(i).adapter.getPreviewUrl({path:v(i).modal.data.item.path}),class:"vuefinder__image-preview__image h-full w-full"},null,8,mM))])]))}}),gM={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function _M(t,e){return y(),T("svg",gM,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Wo={render:_M},yM={class:"vuefinder__default-preview"},bM={class:"vuefinder__default-preview__content"},wM={class:"vuefinder__default-preview__header"},SM=["title"],CM={class:"vuefinder__default-preview__icon-container"},EM=["title"],xM=Ce({__name:"Default",emits:["success"],setup(t,{emit:e}){const n=je(),i=e;return et(()=>{i("success")}),(o,r)=>(y(),T("div",yM,[g("div",bM,[g("div",wM,[g("h3",{id:"modal-title",class:"vuefinder__default-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,SM)]),g("div",CM,[j(v(Wo),{class:"vuefinder__default-preview__file-icon"}),g("div",{id:"modal-title",class:"vuefinder__default-preview__file-name",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,EM)])])]))}}),TM={class:"vuefinder__video-preview"},$M=["title"],kM={class:"vuefinder__video-preview__video",preload:"metadata",controls:""},OM=["src"],AM=Ce({__name:"Video",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>n.adapter.getPreviewUrl({path:n.modal.data.item.path});return et(()=>{i("success")}),(r,s)=>(y(),T("div",TM,[g("h3",{id:"modal-title",class:"vuefinder__video-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,$M),g("div",null,[g("video",kM,[g("source",{src:o(),type:"video/mp4"},null,8,OM),s[0]||(s[0]=Ke(" Your browser does not support the video tag. ",-1))])])]))}}),PM={class:"vuefinder__audio-preview"},RM=["title"],IM={class:"vuefinder__audio-preview__audio",controls:""},MM=["src"],FM=Ce({__name:"Audio",emits:["success"],setup(t,{emit:e}){const n=e,i=je(),o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{n("success")}),(r,s)=>(y(),T("div",PM,[g("h3",{id:"modal-title",class:"vuefinder__audio-preview__title",title:v(i).modal.data.item.path},L(v(i).modal.data.item.basename),9,RM),g("div",null,[g("audio",IM,[g("source",{src:o(),type:"audio/mpeg"},null,8,MM),s[0]||(s[0]=Ke(" Your browser does not support the audio element. ",-1))])])]))}}),DM={class:"vuefinder__pdf-preview"},LM=["title"],jM=["data"],zM=["src"],NM=Ce({__name:"Pdf",emits:["success"],setup(t,{emit:e}){const n=je(),i=e,o=()=>{const r=je();return r.adapter.getPreviewUrl({path:r.modal.data.item.path})};return et(()=>{i("success")}),(r,s)=>(y(),T("div",DM,[g("h3",{id:"modal-title",class:"vuefinder__pdf-preview__title",title:v(n).modal.data.item.path},L(v(n).modal.data.item.basename),9,LM),g("div",null,[g("object",{class:"vuefinder__pdf-preview__object",data:o(),type:"application/pdf",width:"100%",height:"100%"},[g("iframe",{class:"vuefinder__pdf-preview__iframe",src:o(),width:"100%",height:"100%"}," Your browser does not support PDFs ",8,zM)],8,jM)])]))}});function UM(t,e=null){return new Date(t*1e3).toLocaleString(e??navigator.language??"en-US")}const VM={key:0,class:"vuefinder__preview-modal__nav-overlay"},BM=["disabled","title"],HM=["disabled","title"],qM={class:"vuefinder__preview-modal__content"},WM={key:0},KM={class:"vuefinder__preview-modal__loading"},YM={key:0,class:"vuefinder__preview-modal__loading-indicator"},GM={class:"vuefinder__preview-modal__details"},QM={class:"font-bold"},XM={class:"pl-2 font-bold"},JM={key:0,class:"vuefinder__preview-modal__note"},ZM=["download","href"],cr=Ce({__name:"ModalPreview",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=H(!1),r=w=>{const S=(w||"").split("/").pop()||"",b=S.lastIndexOf(".");return b>=0?S.slice(b+1).toLowerCase():""},s=(w,S)=>S?w==="image"?new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]).has(S):w==="video"?new Set(["mp4","webm","ogg","ogv","mov","m4v"]).has(S):w==="audio"?new Set(["mp3","wav","ogg","oga","m4a","flac","aac"]).has(S):w==="text"?new Set(["txt","md","json","js","ts","css","scss","html","xml","csv","log","yml","yaml"]).has(S):w==="application/pdf"?S==="pdf":!1:!1,a=w=>{const S=e.modal.data.item.mime_type;if(S&&typeof S=="string")return S.startsWith(w);const b=r(e.modal.data.item.path);return s(w,b)},l=n("preview");l||(o.value=!0);const c=te(()=>e.modal.data.item),u=Oe(e.fs.sortedFiles),d=te(()=>u.value.filter(w=>w.type==="file")),h=te(()=>d.value.findIndex(w=>w.path===c.value.path)),m=te(()=>h.value>0),f=te(()=>h.value<d.value.length-1),p=()=>{if(e.modal.editMode||!m.value)return;const w=d.value[h.value-1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},_=()=>{if(e.modal.editMode||!f.value)return;const w=d.value[h.value+1];w&&(e.fs.clearSelection(),e.fs.select(w.path),e.modal.data.item=w)},C=w=>{if(w.key==="Escape"){w.preventDefault(),w.stopPropagation(),e.modal.close();return}(w.key==="ArrowLeft"||w.key==="ArrowRight")&&(w.preventDefault(),w.stopPropagation(),w.key==="ArrowLeft"?p():_())};return et(()=>{const w=document.querySelector(".vuefinder__preview-modal");w&&w.focus()}),(w,S)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:S[6]||(S[6]=b=>v(e).modal.close())},L(v(i)("Close")),1),v(n)("download")?(y(),T("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:v(e).adapter.getDownloadUrl(v(e).modal.data.item),href:v(e).adapter.getDownloadUrl(v(e).modal.data.item)},L(v(i)("Download")),9,ZM)):ue("",!0)]),default:we(()=>[g("div",{class:"vuefinder__preview-modal",tabindex:"0",onKeydown:C},[v(e).modal.editMode?ue("",!0):(y(),T("div",VM,[g("button",{disabled:!m.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--left",title:v(i)("Previous file"),onClick:p},[...S[7]||(S[7]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"15,18 9,12 15,6"})],-1)])],8,BM),g("button",{disabled:!f.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--right",title:v(i)("Next file"),onClick:_},[...S[8]||(S[8]=[g("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[g("polyline",{points:"9,18 15,12 9,6"})],-1)])],8,HM)])),g("div",qM,[v(l)?(y(),T("div",WM,[a("text")?(y(),ne(cM,{key:`text-${c.value.path}`,onSuccess:S[0]||(S[0]=b=>o.value=!0)})):a("image")?(y(),ne(vM,{key:`image-${c.value.path}`,onSuccess:S[1]||(S[1]=b=>o.value=!0)})):a("video")?(y(),ne(AM,{key:`video-${c.value.path}`,onSuccess:S[2]||(S[2]=b=>o.value=!0)})):a("audio")?(y(),ne(FM,{key:`audio-${c.value.path}`,onSuccess:S[3]||(S[3]=b=>o.value=!0)})):a("application/pdf")?(y(),ne(NM,{key:`pdf-${c.value.path}`,onSuccess:S[4]||(S[4]=b=>o.value=!0)})):(y(),ne(xM,{key:`default-${c.value.path}`,onSuccess:S[5]||(S[5]=b=>o.value=!0)}))])):ue("",!0),g("div",KM,[o.value===!1?(y(),T("div",YM,[S[9]||(S[9]=g("svg",{class:"vuefinder__preview-modal__spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g("circle",{class:"vuefinder__preview-modal__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),g("path",{class:"vuefinder__preview-modal__spinner-path",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),g("span",null,L(v(i)("Loading")),1)])):ue("",!0)])])],32),g("div",GM,[g("div",null,[g("span",QM,L(v(i)("File Size"))+": ",1),Ke(L(v(e).filesize(v(e).modal.data.item.file_size)),1)]),g("div",null,[g("span",XM,L(v(i)("Last Modified"))+": ",1),Ke(" "+L(v(UM)(v(e).modal.data.item.last_modified)),1)])]),v(n)("download")?(y(),T("div",JM,[g("span",null,L(v(i)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):ue("",!0)]),_:1}))}}),eF={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"};function tF(t,e){return y(),T("svg",eF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M13 19H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v4M16 22l5-5M21 21.5V17h-4.5"},null,-1)])])}const nF={render:tF},iF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function oF(t,e){return y(),T("svg",iF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"},null,-1)])])}const fu={render:oF},rF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function sF(t,e){return y(),T("svg",rF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1)])])}const zn={render:sF},aF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function lF(t,e){return y(),T("svg",aF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 5v14M5 12h14"},null,-1)])])}const Xs={render:lF},cF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function uF(t,e){return y(),T("svg",cF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M5 12h14"},null,-1)])])}const Js={render:uF},dF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"h-5 w-5",viewBox:"0 0 24 24"};function hF(t,e){return y(),T("svg",dF,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"m15 4.5-4 4L7 10l-1.5 1.5 7 7L14 17l1.5-4 4-4M9 15l-4.5 4.5M14.5 4 20 9.5"},null,-1)])])}const mu={render:hF},pF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function fF(t,e){return y(),T("svg",pF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])}const vu={render:fF},mF={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function vF(t,e){return y(),T("svg",mF,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776q.168-.026.344-.026h15.812q.176 0 .344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},null,-1)])])}const gu={render:vF},gF={class:"vuefinder__modal-tree__folder-item"},_F={class:"vuefinder__modal-tree__folder-content"},yF={key:1,class:"vuefinder__modal-tree__folder-spacer"},bF={class:"vuefinder__modal-tree__folder-text"},wF={key:0,class:"vuefinder__modal-tree__subfolders"},SF={key:0,class:"vuefinder__modal-tree__more-note"},CF=300,EF=Ce({__name:"ModalTreeFolderItem",props:{folder:{},storage:{},modelValue:{},expandedFolders:{},modalTreeData:{},currentPath:{}},emits:["update:modelValue","selectAndClose","toggleFolder"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=H({}),s=t,a=e;Oe(o.path);const l=te(()=>{const O=`${s.storage}:${s.folder.path}`;return s.expandedFolders[O]||!1}),c=te(()=>s.modelValue?.path===s.folder.path),u=te(()=>s.currentPath?.path===s.folder.path),d=te(()=>s.modalTreeData[s.folder.path]||[]),h=te(()=>{const O=d.value,$=r.value[s.folder.path]||50;return O.length>$?O.slice(0,$):O}),m=te(()=>d.value.length),f=te(()=>r.value[s.folder.path]||50),p=te(()=>m.value>f.value),_=()=>{r.value[s.folder.path]=(f.value||50)+50},C=te(()=>d.value.length>0||s.folder.type==="dir"),w=()=>{a("toggleFolder",s.storage,s.folder.path)},S=()=>{a("update:modelValue",s.folder)},b=()=>{a("update:modelValue",s.folder),a("selectAndClose",s.folder)};let E=0;const x=()=>{const O=Date.now();O-E<CF?b():S(),E=O};return(O,$)=>{const K=Ue("ModalTreeFolderItem",!0);return y(),T("div",gF,[g("div",_F,[C.value?(y(),T("div",{key:0,class:"vuefinder__modal-tree__folder-toggle",onClick:w},[l.value?(y(),ne(v(Js),{key:1,class:"vuefinder__modal-tree__folder-toggle-icon"})):(y(),ne(v(Xs),{key:0,class:"vuefinder__modal-tree__folder-toggle-icon"}))])):(y(),T("div",yF)),g("div",{class:Ae(["vuefinder__modal-tree__folder-link",{"vuefinder__modal-tree__folder-link--selected":c.value,"vuefinder__modal-tree__folder-link--current":u.value}]),onClick:S,onDblclick:b,onTouchend:x},[l.value?(y(),ne(v(gu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__modal-tree__folder-icon"})):(y(),ne(v(zn),{key:0,class:"vuefinder__modal-tree__folder-icon vuefinder__item-icon__folder"})),g("span",bF,L(t.folder.basename),1)],34)]),l.value&&C.value?(y(),T("div",wF,[(y(!0),T(Ie,null,He(h.value,F=>(y(),ne(K,{key:F.path,folder:F,storage:t.storage,"model-value":t.modelValue,"expanded-folders":t.expandedFolders,"modal-tree-data":t.modalTreeData,"current-path":t.currentPath,"onUpdate:modelValue":$[0]||($[0]=P=>O.$emit("update:modelValue",P)),onSelectAndClose:$[1]||($[1]=P=>O.$emit("selectAndClose",P)),onToggleFolder:$[2]||($[2]=(P,N)=>O.$emit("toggleFolder",P,N))},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),p.value?(y(),T("div",SF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:_},L(v(i)("load more")),1)])):ue("",!0)])):ue("",!0)])}}}),xF={class:"vuefinder__modal-tree"},TF={class:"vuefinder__modal-tree__header"},$F={class:"vuefinder__modal-tree__title"},kF={key:0,class:"vuefinder__modal-tree__section"},OF={class:"vuefinder__modal-tree__section-title"},AF={class:"vuefinder__modal-tree__list"},PF=["onClick","onDblclick","onTouchend"],RF={class:"vuefinder__modal-tree__text"},IF={class:"vuefinder__modal-tree__text-storage"},MF={class:"vuefinder__modal-tree__section-title"},FF={class:"vuefinder__modal-tree__list"},DF={class:"vuefinder__modal-tree__storage-item"},LF={class:"vuefinder__modal-tree__storage-content"},jF=["onClick"],zF=["onClick","onDblclick","onTouchend"],NF={class:"vuefinder__modal-tree__storage-text"},UF={key:0,class:"vuefinder__modal-tree__subfolders"},VF={key:0,class:"vuefinder__modal-tree__more-note"},BF=["onClick"],Ip=300,_u=Ce({__name:"ModalTreeSelector",props:{modelValue:{},showPinnedFolders:{type:Boolean},currentPath:{}},emits:["update:modelValue","selectAndClose"],setup(t,{emit:e}){const n=je(),{t:i}=n.i18n,o=n.fs,r=n.config,s=e,a=Oe(o.sortedFiles),l=Oe(o.storages),c=te(()=>l.value||[]),u=Oe(o.path),d=H(null),h=H({}),m=H({}),f=H({});$e(a,M=>{const q=M.filter(de=>de.type==="dir"),le=u.value?.path||"";le&&(m.value[le]=q.map(de=>({...de,type:"dir"})))});const p=(M,q)=>{const le=`${M}:${q}`;h.value={...h.value,[le]:!h.value[le]},h.value[le]&&!m.value[q]&&n.adapter.list(q).then(de=>{const Y=(de.files||[]).filter(I=>I.type==="dir");m.value[q]=Y.map(I=>({...I,type:"dir"}))})},_=M=>m.value[M]||[],C=M=>f.value[M]||50,w=M=>{const q=_(M),le=C(M);return q.length>le?q.slice(0,le):q},S=M=>_(M).length,b=M=>S(M)>C(M),E=M=>{f.value[M]=C(M)+50},x=M=>{M&&s("update:modelValue",M)},O=M=>{M&&(s("update:modelValue",M),s("selectAndClose",M))},$=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q)},K=M=>{const q={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};s("update:modelValue",q),s("selectAndClose",q)};let F=0;const P=M=>{if(!M)return;const q=Date.now();q-F<Ip?O(M):x(M),F=q},N=M=>{const q=Date.now();q-F<Ip?K(M):$(M),F=q};return et(()=>{d.value&&hn(d.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),(M,q)=>(y(),T("div",xF,[g("div",TF,[g("div",$F,L(v(i)("Select Target Folder")),1)]),g("div",{ref_key:"modalContentElement",ref:d,class:"vuefinder__modal-tree__content"},[t.showPinnedFolders&&v(n).features.pinned&&v(r).get("pinnedFolders").length?(y(),T("div",kF,[g("div",OF,L(v(i)("Pinned Folders")),1),g("div",AF,[(y(!0),T(Ie,null,He(v(r).get("pinnedFolders"),le=>(y(),T("div",{key:le.path,class:Ae(["vuefinder__modal-tree__item",{"vuefinder__modal-tree__item--selected":t.modelValue?.path===le.path}]),onClick:de=>x(le),onDblclick:de=>O(le),onTouchend:de=>P(le)},[j(v(zn),{class:"vuefinder__modal-tree__icon vuefinder__item-icon__folder"}),g("div",RF,L(le.basename),1),g("div",IF,L(le.storage),1),j(v(mu),{class:"vuefinder__modal-tree__icon vuefinder__modal-tree__icon--pin"})],42,PF))),128))])])):ue("",!0),g("div",MF,L(v(i)("Storages")),1),(y(!0),T(Ie,null,He(c.value,le=>(y(),T("div",{key:le,class:"vuefinder__modal-tree__section"},[g("div",FF,[g("div",DF,[g("div",LF,[g("div",{class:"vuefinder__modal-tree__storage-toggle",onClick:Ye(de=>p(le,le+"://"),["stop"])},[h.value[`${le}:${le}://`]?(y(),ne(v(Js),{key:1,class:"vuefinder__modal-tree__toggle-icon"})):(y(),ne(v(Xs),{key:0,class:"vuefinder__modal-tree__toggle-icon"}))],8,jF),g("div",{class:Ae(["vuefinder__modal-tree__storage-link",{"vuefinder__modal-tree__storage-link--selected":t.modelValue?.path===le+"://"}]),onClick:de=>$(le),onDblclick:de=>K(le),onTouchend:de=>N(le)},[j(v(vu),{class:"vuefinder__modal-tree__storage-icon"}),g("span",NF,L(le),1)],42,zF)]),h.value[`${le}:${le}://`]?(y(),T("div",UF,[(y(!0),T(Ie,null,He(w(le+"://"),de=>(y(),ne(EF,{key:de.path,folder:de,storage:le,"model-value":t.modelValue,"expanded-folders":h.value,"modal-tree-data":m.value,"current-path":t.currentPath,"onUpdate:modelValue":x,onSelectAndClose:O,onToggleFolder:p},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),b(le+"://")?(y(),T("div",VF,[g("div",{class:"vuefinder__modal-tree__load-more",onClick:de=>E(le+"://")},L(v(i)("load more")),9,BF)])):ue("",!0)])):ue("",!0)])])]))),128))],512)]))}}),HF=["title"],Xl=Ce({__name:"Message",props:{error:{type:Boolean}},emits:["hidden"],setup(t,{emit:e}){const n=e,i=je(),{t:o}=i.i18n,r=H(!1),s=H(null),a=H(s.value?.innerHTML);$e(a,()=>r.value=!1);const l=()=>{n("hidden"),r.value=!0};return(c,u)=>(y(),T("div",null,[r.value?ue("",!0):(y(),T("div",{key:0,ref_key:"strMessage",ref:s,class:Ae(["vuefinder__message",t.error?"vuefinder__message--error":"vuefinder__message--success"])},[Ve(c.$slots,"default"),g("div",{class:"vuefinder__message__close",title:v(o)("Close"),onClick:l},[...u[0]||(u[0]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__message__icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,HF)],2))]))}}),qF={class:"vuefinder__move-modal__content"},WF={class:"vuefinder__move-modal__description"},KF={class:"vuefinder__move-modal__files vf-scrollbar"},YF={class:"vuefinder__move-modal__file-name"},GF={class:"vuefinder__move-modal__target-title"},QF={class:"vuefinder__move-modal__target-container"},XF={class:"vuefinder__move-modal__target-path"},JF={class:"vuefinder__move-modal__target-storage"},ZF={key:0,class:"vuefinder__move-modal__destination-folder"},eD={class:"vuefinder__move-modal__target-badge"},tD={key:0,class:"vuefinder__move-modal__options"},nD={class:"vuefinder__move-modal__checkbox-label"},iD={class:"vuefinder__move-modal__checkbox-text"},oD=["disabled"],rD={class:"vuefinder__move-modal__selected-items"},Kg=Ce({__name:"ModalTransfer",props:{copy:{type:Boolean}},setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e.i18n,r=t,s=H(e.modal.data.items.from),a=H(e.modal.data.items.to),l=H(""),c=H(r.copy||!i("move")),u=te(()=>c.value?"copy":"move"),d=H(!1),h=Oe(e.fs.path),m=te(()=>c.value?o("Copy files"):o("Move files")),f=te(()=>c.value?o("Are you sure you want to copy these files?"):o("Are you sure you want to move these files?")),p=te(()=>c.value?o("Yes, Copy!"):o("Yes, Move!")),_=x=>{x&&(a.value=x)},C=x=>{x&&(a.value=x,d.value=!1)},w=te(()=>{const x=a.value;return x?s.value.some(O=>!!(x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))):!0}),S=te(()=>{if(!w.value)return"";const x=a.value;return x?s.value.find(O=>x.path===O.path||O.path.startsWith(x.path+"/")||O.type==="dir"&&x.path.startsWith(O.path+"/"))?o("Cannot move/copy item to itself or its parent/child directory"):o("Invalid destination directory"):o("Please select a destination directory")}),b=()=>{const x=a.value.path;if(!x)return{storage:"local",path:""};if(x.endsWith("://"))return{storage:x.replace("://",""),path:""};const O=x.split("://");return{storage:O[0]||"local",path:O[1]||""}},E=async()=>{if(s.value.length)try{const{files:x}=await e.adapter[u.value]({path:h.value.path,sources:s.value.map(({path:O})=>O),destination:a.value.path});e.fs.setFiles(x),e.modal.close()}catch(x){n.error(Yt(x,o("Failed to transfer files")))}};return(x,O)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:w.value,onClick:E},L(p.value),9,oD),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:O[4]||(O[4]=$=>v(e).modal.close())},L(v(o)("Cancel")),1),g("div",rD,L(v(o)("%s item(s) selected.",s.value.length)),1)]),default:we(()=>[g("div",null,[j(pn,{icon:c.value?v(fu):v(nF),title:m.value},null,8,["icon","title"]),g("div",qF,[g("p",WF,L(f.value),1),g("div",KF,[(y(!0),T(Ie,null,He(s.value,$=>(y(),T("div",{key:$.path,class:"vuefinder__move-modal__file"},[g("div",null,[$.type==="dir"?(y(),ne(v(zn),{key:0,class:"vuefinder__move-modal__icon vuefinder__move-modal__icon--dir"})):(y(),ne(v(Wo),{key:1,class:"vuefinder__move-modal__icon"}))]),g("div",YF,L($.path),1)]))),128))]),g("h4",GF,L(v(o)("Target Directory")),1),g("div",QF,[g("div",{class:"vuefinder__move-modal__target-display",onClick:O[0]||(O[0]=$=>d.value=!d.value)},[g("div",XF,[g("span",JF,L(b().storage)+"://",1),b().path?(y(),T("span",ZF,L(b().path),1)):ue("",!0)]),g("span",eD,L(v(o)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__move-modal__tree-selector",d.value?"vuefinder__move-modal__tree-selector--expanded":"vuefinder__move-modal__tree-selector--collapsed"])},[j(_u,{modelValue:a.value,"onUpdate:modelValue":[O[1]||(O[1]=$=>a.value=$),_],"show-pinned-folders":!0,onSelectAndClose:C},null,8,["modelValue"])],2),v(i)("copy")&&v(i)("move")?(y(),T("div",tD,[g("label",nD,[it(g("input",{"onUpdate:modelValue":O[2]||(O[2]=$=>c.value=$),type:"checkbox",class:"vuefinder__move-modal__checkbox"},null,512),[[Ss,c.value]]),g("span",iD,L(v(o)("Create a copy instead of moving")),1)])])):ue("",!0),S.value?(y(),ne(Xl,{key:1,error:""},{default:we(()=>[Ke(L(S.value),1)]),_:1})):ue("",!0),l.value.length&&!S.value?(y(),ne(Xl,{key:2,error:"",onHidden:O[3]||(O[3]=$=>l.value="")},{default:we(()=>[Ke(L(l.value),1)]),_:1})):ue("",!0)])])]),_:1}))}}),uo=Ce({__name:"ModalMove",setup(t){return(e,n)=>(y(),ne(Kg,{copy:!1}))}}),yu=Ce({__name:"ModalCopy",setup(t){return(e,n)=>(y(),ne(Kg,{copy:!0}))}}),sD=(t,e=0,n=!1)=>{let i;return(...o)=>{n&&!i&&t(...o),clearTimeout(i),i=setTimeout(()=>{t(...o)},e)}},Yg=(t,e,n)=>{const i=H(t);return x_((o,r)=>({get(){return o(),i.value},set:sD(s=>{i.value=s,r()},e,!1)}))},aD={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function lD(t,e){return y(),T("svg",aD,[...e[0]||(e[0]=[g("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1)])])}const bu={render:lD},cD={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"};function uD(t,e){return y(),T("svg",cD,[...e[0]||(e[0]=[g("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900"},null,-1),g("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const Zs={render:uD},dD={class:"vuefinder__search-modal__search-input"},hD=["value","placeholder","disabled"],pD={key:0,class:"vuefinder__search-modal__loading"},fD=Ce({name:"SearchInput",__name:"SearchInput",props:{modelValue:{},isSearching:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","keydown"],setup(t,{expose:e,emit:n}){const i=n,o=je(),{t:r}=o.i18n,s=H(null),a=c=>{const u=c.target;i("update:modelValue",u.value)},l=c=>{i("keydown",c)};return e({focus:()=>{s.value&&s.value.focus()}}),(c,u)=>(y(),T("div",dD,[j(v(bu),{class:"vuefinder__search-modal__search-icon"}),g("input",{ref_key:"searchInput",ref:s,value:t.modelValue,type:"text",placeholder:v(r)("Search files"),disabled:t.disabled,class:"vuefinder__search-modal__input",onKeydown:l,onKeyup:u[0]||(u[0]=Ye(()=>{},["stop"])),onInput:a},null,40,hD),t.isSearching?(y(),T("div",pD,[j(v(Zs),{class:"vuefinder__search-modal__loading-icon"})])):ue("",!0)]))}}),mD={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function vD(t,e){return y(),T("svg",mD,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87q.11.06.22.127c.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a8 8 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a7 7 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a7 7 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a7 7 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124q.108-.066.22-.128c.332-.183.582-.495.644-.869z"},null,-1),g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1)])])}const Gg={render:vD},gD=["disabled","title"],_D=["data-theme"],yD={class:"vuefinder__search-modal__dropdown-content"},bD={class:"vuefinder__search-modal__dropdown-section"},wD={class:"vuefinder__search-modal__dropdown-title"},SD={class:"vuefinder__search-modal__dropdown-options"},CD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},ED={key:0,class:"vuefinder__search-modal__dropdown-option-check"},xD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},TD={key:0,class:"vuefinder__search-modal__dropdown-option-check"},$D=Ce({name:"SearchOptionsDropdown",__name:"SearchOptionsDropdown",props:{visible:{type:Boolean},disabled:{type:Boolean,default:!1},sizeFilter:{},selectedOption:{}},emits:["update:visible","update:sizeFilter","update:selectedOption","keydown"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=H(null),l=H(null);let c=null;const u=p=>{if(o("update:selectedOption",p),p.startsWith("size-")){const _=p.split("-")[1];o("update:sizeFilter",_)}},d=async()=>{i.disabled||(i.visible?(o("update:visible",!1),c&&(c(),c=null)):(o("update:visible",!0),await Ge(),await h()))},h=async()=>{if(!(!a.value||!l.value)&&(await Ge(),!(!a.value||!l.value))){Object.assign(l.value.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`}),requestAnimationFrame(()=>{l.value&&Object.assign(l.value.style,{opacity:"1",transform:"translateY(0)"})})}catch(p){console.warn("Floating UI initial positioning error:",p);return}try{c=rc(a.value,l.value,async()=>{if(!(!a.value||!l.value))try{const{x:p,y:_}=await Zi(a.value,l.value,{placement:"bottom-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(l.value.style,{left:`${p}px`,top:`${_}px`})}catch(p){console.warn("Floating UI positioning error:",p)}})}catch(p){console.warn("Floating UI autoUpdate setup error:",p),c=null}}},m=p=>{if(!i.visible)return;const _=["size-all","size-small","size-medium","size-large"],C=_.findIndex(w=>w===i.selectedOption);if(p.key==="ArrowDown"){p.preventDefault();const w=(C+1)%_.length;o("update:selectedOption",_[w]||null)}else if(p.key==="ArrowUp"){p.preventDefault();const w=C<=0?_.length-1:C-1;o("update:selectedOption",_[w]||null)}else p.key==="Enter"?(p.preventDefault(),i.selectedOption?.startsWith("size-")&&o("update:sizeFilter",i.selectedOption.split("-")[1])):p.key==="Escape"&&(p.preventDefault(),o("update:visible",!1),c&&(c(),c=null))},f=()=>{c&&(c(),c=null)};return $e(()=>i.visible,p=>{!p&&c&&(c(),c=null)}),Ct(()=>{f()}),e({cleanup:f}),(p,_)=>(y(),T(Ie,null,[g("button",{ref_key:"dropdownBtn",ref:a,class:Ae(["vuefinder__search-modal__dropdown-btn",{"vuefinder__search-modal__dropdown-btn--active":t.visible}]),disabled:t.disabled,title:v(s)("Search Options"),onClick:Ye(d,["stop"])},[j(v(Gg),{class:"vuefinder__search-modal__dropdown-icon"})],10,gD),(y(),ne(ws,{to:"body"},[t.visible?(y(),T("div",{key:0,ref_key:"dropdownContent",ref:l,class:"vuefinder__themer vuefinder__search-modal__dropdown vuefinder__search-modal__dropdown--visible","data-theme":v(r).theme.current,tabindex:"-1",onClick:_[4]||(_[4]=Ye(()=>{},["stop"])),onKeydown:m},[g("div",yD,[g("div",bD,[g("div",wD,L(v(s)("File Size")),1),g("div",SD,[g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="all"}]),onClick:_[0]||(_[0]=Ye(C=>u("size-all"),["stop"]))},[g("span",null,L(v(s)("All Files")),1),t.sizeFilter==="all"?(y(),T("div",CD,[..._[5]||(_[5]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="small"}]),onClick:_[1]||(_[1]=Ye(C=>u("size-small"),["stop"]))},[g("span",null,L(v(s)("Small (< 1MB)")),1),t.sizeFilter==="small"?(y(),T("div",ED,[..._[6]||(_[6]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="medium"}]),onClick:_[2]||(_[2]=Ye(C=>u("size-medium"),["stop"]))},[g("span",null,L(v(s)("Medium (1-10MB)")),1),t.sizeFilter==="medium"?(y(),T("div",xD,[..._[7]||(_[7]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2),g("div",{class:Ae(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="large"}]),onClick:_[3]||(_[3]=Ye(C=>u("size-large"),["stop"]))},[g("span",null,L(v(s)("Large (> 10MB)")),1),t.sizeFilter==="large"?(y(),T("div",TD,[..._[8]||(_[8]=[g("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):ue("",!0)],2)])])])],40,_D)):ue("",!0)]))],64))}});function Qg(t,e=40){const n=t.match(/^([^:]+:\/\/)(.*)$/);if(!n)return t;const i=n[1],o=n[2]??"",r=o.split("/").filter(Boolean),s=r.pop();if(!s)return i+o;let a=`${i}${r.join("/")}${r.length?"/":""}${s}`;if(a.length<=e)return a;const l=s.split(/\.(?=[^\.]+$)/),c=l[0]??"",u=l[1]??"",d=c.length>10?`${c.slice(0,6)}...${c.slice(-5)}`:c,h=u?`${d}.${u}`:d;return a=`${i}${r.join("/")}${r.length?"/":""}${h}`,a.length>e&&(a=`${i}.../${h}`),a}async function Xg(t){try{await navigator.clipboard.writeText(t)}catch{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}async function Ko(t){await Xg(t)}async function kD(t){await Xg(t)}const OD={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 448 512"};function AD(t,e){return y(),T("svg",OD,[...e[0]||(e[0]=[g("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1)])])}const Jg={render:AD},PD=["title"],RD={class:"vuefinder__search-modal__result-icon"},ID={class:"vuefinder__search-modal__result-content"},MD={class:"vuefinder__search-modal__result-name"},FD={key:0,class:"vuefinder__search-modal__result-size"},DD=["title"],LD=["title"],jD=["data-item-dropdown","data-theme"],zD={class:"vuefinder__search-modal__item-dropdown-content"},ND=Ce({name:"SearchResultItem",__name:"SearchResultItem",props:{item:{},index:{},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{}},emits:["select","selectWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{emit:e}){const n=t,i=e,o=je(),{t:r}=o.i18n,s=H(null);let a=null,l=null,c=[],u=null;$e(()=>n.activeDropdown,O=>{a&&(a(),a=null),l&&(c.forEach($=>{$===window?window.removeEventListener("scroll",l,!0):$.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null),O===n.item.path&&s.value&&Ge(()=>{C(n.item.path,s.value),h(),m()})});const d=O=>{const $=[];let K=O;for(;K&&K!==document.body&&K!==document.documentElement;){const F=window.getComputedStyle(K),P=F.overflow+F.overflowX+F.overflowY;(P.includes("scroll")||P.includes("auto"))&&$.push(K),K=K.parentElement}return $},h=()=>{if(n.activeDropdown!==n.item.path)return;const O=d(s.value);c=[window,...O],l=()=>{n.activeDropdown===n.item.path&&i("toggleItemDropdown",n.item.path,new MouseEvent("click"))};const $=l;$&&c.forEach(K=>{K===window?window.addEventListener("scroll",$,!0):K.addEventListener("scroll",$,!0)})},m=()=>{n.activeDropdown===n.item.path&&(u=O=>{if(n.activeDropdown!==n.item.path)return;const $=O.target;if(!$)return;const K=document.querySelector(`[data-item-dropdown="${n.item.path}"]`);if(K&&K.contains($)||s.value&&s.value.contains($))return;const F=o.root;if(F&&F.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}const P=document.querySelector(".vuefinder__modal-layout");if(P&&P.contains($)){i("toggleItemDropdown",n.item.path,new MouseEvent("click"));return}i("toggleItemDropdown",n.item.path,new MouseEvent("click"))},setTimeout(()=>{u&&(document.addEventListener("mousedown",u,!0),document.addEventListener("touchstart",u,!0))},100))};Ct(()=>{a&&(a(),a=null),l&&(c.forEach(O=>{O===window?window.removeEventListener("scroll",l,!0):O.removeEventListener("scroll",l,!0)}),l=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null)});const f=O=>n.expandedPaths.has(O),p=O=>O.type==="dir"||!O.file_size?"":hu(O.file_size),_=(O,$)=>{$.stopPropagation(),i("toggleItemDropdown",O,$)},C=async(O,$)=>{const K=document.querySelector(`[data-item-dropdown="${O}"]`);if(!(!K||!$)&&(await Ge(),!(!K||!$))){Object.assign(K.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`}),requestAnimationFrame(()=>{K&&Object.assign(K.style,{opacity:"1",transform:"translateY(0)"})})}catch(F){console.warn("Floating UI initial positioning error:",F);return}try{a=rc($,K,async()=>{if(!(!$||!K))try{const{x:F,y:P}=await Zi($,K,{placement:"left-start",strategy:"fixed",middleware:[Ro(8),Io({padding:16}),Mo({padding:16})]});Object.assign(K.style,{left:`${F}px`,top:`${P}px`})}catch(F){console.warn("Floating UI positioning error:",F)}})}catch(F){console.warn("Floating UI autoUpdate setup error:",F),a=null}}},w=O=>{i("update:selectedItemDropdownOption",O)},S=async O=>{await Ko(O.path),i("copyPath",O)},b=O=>{i("openContainingFolder",O)},E=O=>{i("preview",O)},x=O=>{if(!n.activeDropdown)return;const $=["copy-path","open-folder","preview"],K=n.selectedItemDropdownOption,F=$.findIndex(P=>K?.includes(P));if(O.key==="ArrowDown"){O.preventDefault();const P=(F+1)%$.length;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else if(O.key==="ArrowUp"){O.preventDefault();const P=F<=0?$.length-1:F-1;i("update:selectedItemDropdownOption",`${$[P]||""}-${n.activeDropdown}`)}else O.key==="Enter"?(O.preventDefault(),K&&(K.includes("copy-path")?S(n.item):K.includes("open-folder")?b(n.item):K.includes("preview")&&E(n.item))):O.key==="Escape"&&(O.preventDefault(),i("update:selectedItemDropdownOption",null))};return(O,$)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__result-item",{"vuefinder__search-modal__result-item--selected":t.index===t.selectedIndex}]),title:t.item.basename,onClick:$[9]||($[9]=K=>i("select",t.index))},[g("div",RD,[t.item.type==="dir"?(y(),ne(v(zn),{key:0})):(y(),ne(v(Wo),{key:1}))]),g("div",ID,[g("div",MD,[Ke(L(t.item.basename)+" ",1),p(t.item)?(y(),T("span",FD,L(p(t.item)),1)):ue("",!0)]),g("div",{class:"vuefinder__search-modal__result-path",title:t.item.path,onClick:$[0]||($[0]=Ye(K=>{i("select",t.index),i("togglePathExpansion",t.item.path)},["stop"]))},L(f(t.item.path)?t.item.path:v(Qg)(t.item.path)),9,DD)]),g("button",{ref_key:"buttonElementRef",ref:s,class:"vuefinder__search-modal__result-actions",title:v(r)("More actions"),onClick:$[1]||($[1]=K=>{i("selectWithDropdown",t.index),_(t.item.path,K)})},[j(v(Jg),{class:"vuefinder__search-modal__result-actions-icon"})],8,LD),(y(),ne(ws,{to:"body"},[t.activeDropdown===t.item.path?(y(),T("div",{key:0,"data-item-dropdown":t.item.path,class:"vuefinder__themer vuefinder__search-modal__item-dropdown vuefinder__search-modal__item-dropdown--visible","data-theme":v(o).theme.current,tabindex:"-1",onClick:$[8]||($[8]=Ye(()=>{},["stop"])),onKeydown:x},[g("div",zD,[g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`copy-path-${t.item.path}`}]),onClick:$[2]||($[2]=K=>{w(`copy-path-${t.item.path}`),S(t.item)}),onFocus:$[3]||($[3]=K=>w(`copy-path-${t.item.path}`))},[j(v(fu),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Copy Path")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`open-folder-${t.item.path}`}]),onClick:$[4]||($[4]=K=>{w(`open-folder-${t.item.path}`),b(t.item)}),onFocus:$[5]||($[5]=K=>w(`open-folder-${t.item.path}`))},[j(v(zn),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Open Containing Folder")),1)],34),g("div",{class:Ae(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`preview-${t.item.path}`}]),onClick:$[6]||($[6]=K=>{w(`preview-${t.item.path}`),E(t.item)}),onFocus:$[7]||($[7]=K=>w(`preview-${t.item.path}`))},[j(v(Wo),{class:"vuefinder__search-modal__item-dropdown-icon"}),g("span",null,L(v(r)("Preview")),1)],34)])],40,jD)):ue("",!0)]))],10,PD))}}),UD={key:0,class:"vuefinder__search-modal__searching"},VD={class:"vuefinder__search-modal__loading-icon"},BD={key:1,class:"vuefinder__search-modal__no-results"},HD={key:2,class:"vuefinder__search-modal__results-list"},qD={class:"vuefinder__search-modal__results-header"},xi=60,Mp=5,WD=Ce({name:"SearchResultsList",__name:"SearchResultsList",props:{searchResults:{},isSearching:{type:Boolean},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{},resultsEnter:{type:Boolean}},emits:["selectResultItem","selectResultItemWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{expose:e,emit:n}){const i=t,o=n,r=je(),{t:s}=r.i18n,a=In("scrollableContainer"),l=te(()=>i.searchResults.length>0),c=te(()=>i.searchResults.length),u=H(0),d=H(600),h=te(()=>i.searchResults.length*xi),m=te(()=>{const S=Math.max(0,Math.floor(u.value/xi)-Mp),b=Math.min(i.searchResults.length,Math.ceil((u.value+d.value)/xi)+Mp);return{start:S,end:b}}),f=te(()=>{const{start:S,end:b}=m.value;return i.searchResults.slice(S,b).map((E,x)=>({item:E,index:S+x,top:(S+x)*xi}))}),p=S=>{const b=S.target;u.value=b.scrollTop},_=()=>{a.value&&(d.value=a.value.clientHeight)},C=()=>{if(i.selectedIndex>=0&&a.value){const S=i.selectedIndex*xi,b=S+xi,E=a.value.scrollTop,x=a.value.clientHeight,O=E+x;let $=E;S<E?$=S:b>O&&($=b-x),$!==E&&a.value.scrollTo({top:$,behavior:"smooth"})}},w=()=>{a.value&&(a.value.scrollTop=0,u.value=0)};return et(()=>{_(),window.addEventListener("resize",_)}),Ct(()=>{window.removeEventListener("resize",_)}),$e(()=>a.value,()=>{_()}),e({scrollSelectedIntoView:C,resetScroll:w,getContainerHeight:()=>d.value,scrollTop:()=>u.value}),(S,b)=>(y(),T("div",{class:Ae(["vuefinder__search-modal__results",{"vuefinder__search-modal__results--enter":t.resultsEnter}])},[t.isSearching?(y(),T("div",UD,[g("div",VD,[j(v(Zs),{class:"vuefinder__search-modal__loading-icon"})]),g("span",null,L(v(s)("Searching...")),1)])):l.value?(y(),T("div",HD,[g("div",qD,[g("span",null,L(v(s)("Found %s results",c.value)),1)]),g("div",{ref_key:"scrollableContainer",ref:a,class:"vuefinder__search-modal__results-scrollable",onScroll:p},[g("div",{class:"vuefinder__search-modal__results-items",style:At({height:`${h.value}px`,position:"relative"})},[(y(!0),T(Ie,null,He(f.value,E=>(y(),T("div",{key:E.item.path,style:At({position:"absolute",top:`${E.top}px`,left:"0",width:"100%",height:`${xi}px`})},[j(ND,{item:E.item,index:E.index,"selected-index":t.selectedIndex,"expanded-paths":t.expandedPaths,"active-dropdown":t.activeDropdown,"selected-item-dropdown-option":t.selectedItemDropdownOption,onSelect:b[0]||(b[0]=x=>o("selectResultItem",x)),onSelectWithDropdown:b[1]||(b[1]=x=>o("selectResultItemWithDropdown",x)),onTogglePathExpansion:b[2]||(b[2]=x=>o("togglePathExpansion",x)),onToggleItemDropdown:b[3]||(b[3]=(x,O)=>o("toggleItemDropdown",x,O)),"onUpdate:selectedItemDropdownOption":b[4]||(b[4]=x=>o("update:selectedItemDropdownOption",x)),onCopyPath:b[5]||(b[5]=x=>o("copyPath",x)),onOpenContainingFolder:b[6]||(b[6]=x=>o("openContainingFolder",x)),onPreview:b[7]||(b[7]=x=>o("preview",x))},null,8,["item","index","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])],4))),128))],4)],544)])):(y(),T("div",BD,[g("span",null,L(v(s)("No results found")),1)]))],2))}}),KD={class:"vuefinder__search-modal"},YD={class:"vuefinder__search-modal__content"},GD={class:"vuefinder__search-modal__search-bar"},QD={class:"vuefinder__search-modal__search-location"},XD=["title"],JD=["disabled"],ZD={key:0,class:"vuefinder__search-modal__folder-selector"},e5={class:"vuefinder__search-modal__folder-selector-content"},t5={key:1,class:"vuefinder__search-modal__instructions"},n5={class:"vuefinder__search-modal__instructions-text"},wu=Ce({name:"ModalSearch",__name:"ModalSearch",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=H(null),s=H(null),a=H(null),l=Yg("",300),c=H([]),u=H(!1),d=H(-1),h=H(!1),m=H(!1),f=H(null),p=H("all"),_=H(!1),C=H(`size-${p.value}`),w=H(null),S=H(new Set),b=H(null),E=Oe(o.path),x=A=>{S.value.has(A)?S.value.delete(A):S.value.add(A)},O=(A,Q)=>{Q&&typeof Q.stopPropagation=="function"&&Q.stopPropagation(),b.value===A?b.value=null:b.value=A},$=()=>{b.value=null},K=A=>{try{const Q=A.dir||`${A.storage}://`;e.adapter.open(Q),e.modal.close(),$()}catch{n.error(i("Failed to open containing folder"))}},F=A=>{e.modal.open(cr,{storage:E?.value?.storage??"local",item:A}),$()},P=A=>{d.value=A,$()},N=A=>{d.value=A},M=async A=>{await Ko(A.path),$()};$e(l,async A=>{A.trim()?(await q(A.trim()),d.value=0):(c.value=[],u.value=!1,d.value=-1)}),$e(p,async A=>{C.value=`size-${A}`,l.value.trim()&&!m.value&&(await q(l.value.trim()),d.value=0)}),$e(_,async()=>{l.value.trim()&&!m.value&&(await q(l.value.trim()),d.value=0)});const q=async A=>{if(A){u.value=!0;try{const Q=f.value?.path||E?.value?.path,U=await e.adapter.search({path:Q,filter:A,deep:_.value,size:p.value});c.value=U||[],u.value=!1}catch(Q){n.error(Yt(Q,i("Search failed"))),c.value=[],u.value=!1}}};et(()=>{document.addEventListener("click",I),C.value=`size-${p.value}`});const le=()=>{m.value?(m.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0)):(h.value=!1,m.value=!0)},de=A=>{A&&(f.value=A)},Y=A=>{A&&(de(A),m.value=!1,l.value.trim()&&(q(l.value.trim()),d.value=0))};Ct(()=>{document.removeEventListener("click",I),s.value&&s.value.cleanup()});const I=A=>{const Q=A.target;if(h.value&&(Q.closest(".vuefinder__search-modal__dropdown")||(h.value=!1,Ge(()=>{r.value&&r.value.focus()}))),b.value){const U=Q.closest(".vuefinder__search-modal__item-dropdown"),ie=Q.closest(".vuefinder__search-modal__result-item");!U&&!ie&&$()}};return(A,Q)=>(y(),ne(nn,{class:"vuefinder__search-modal-layout"},{default:we(()=>[g("div",KD,[j(pn,{icon:v(bu),title:v(i)("Search files")},null,8,["icon","title"]),g("div",YD,[g("div",GD,[j(fD,{ref_key:"searchInputRef",ref:r,modelValue:v(l),"onUpdate:modelValue":Q[0]||(Q[0]=U=>ys(l)?l.value=U:null),"is-searching":u.value,disabled:m.value},null,8,["modelValue","is-searching","disabled"]),j($D,{ref_key:"searchOptionsDropdownRef",ref:s,visible:h.value,"onUpdate:visible":Q[1]||(Q[1]=U=>h.value=U),"size-filter":p.value,"onUpdate:sizeFilter":Q[2]||(Q[2]=U=>p.value=U),"selected-option":C.value,"onUpdate:selectedOption":Q[3]||(Q[3]=U=>C.value=U),disabled:m.value},null,8,["visible","size-filter","selected-option","disabled"])]),g("div",{class:"vuefinder__search-modal__options",onClick:Q[7]||(Q[7]=Ye(()=>{},["stop"]))},[g("div",QD,[g("button",{class:Ae(["vuefinder__search-modal__location-btn",{"vuefinder__search-modal__location-btn--open":m.value}]),onClick:Ye(le,["stop"])},[j(v(zn),{class:"vuefinder__search-modal__location-icon"}),g("span",{class:"vuefinder__search-modal__location-text",title:f.value?.path||v(E).path},L(v(Qg)(f.value?.path||v(E).path)),9,XD),Q[10]||(Q[10]=g("svg",{class:"vuefinder__search-modal__location-arrow",viewBox:"0 0 16 16",fill:"currentColor"},[g("path",{d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})],-1))],2)]),g("label",{class:"vuefinder__search-modal__deep-search",onClick:Q[6]||(Q[6]=Ye(()=>{},["stop"]))},[it(g("input",{"onUpdate:modelValue":Q[4]||(Q[4]=U=>_.value=U),type:"checkbox",disabled:m.value,class:"vuefinder__search-modal__checkbox",onClick:Q[5]||(Q[5]=Ye(()=>{},["stop"]))},null,8,JD),[[Ss,_.value]]),g("span",null,L(v(i)("Include subfolders")),1)])]),m.value?(y(),T("div",ZD,[g("div",e5,[j(_u,{modelValue:f.value,"onUpdate:modelValue":[Q[8]||(Q[8]=U=>f.value=U),de],"show-pinned-folders":!0,"current-path":v(E),onSelectAndClose:Y},null,8,["modelValue","current-path"])])])):ue("",!0),!v(l).trim()&&!m.value?(y(),T("div",t5,[g("p",n5,L(v(i)("Start typing to search files. Use options to filter or include subfolders.")),1)])):ue("",!0),v(l).trim()&&!m.value?(y(),ne(WD,{key:2,ref_key:"searchResultsListRef",ref:a,"search-results":c.value,"is-searching":u.value,"selected-index":d.value,"expanded-paths":S.value,"active-dropdown":b.value,"selected-item-dropdown-option":w.value,"results-enter":!0,onSelectResultItem:P,onSelectResultItemWithDropdown:N,onTogglePathExpansion:x,onToggleItemDropdown:O,"onUpdate:selectedItemDropdownOption":Q[9]||(Q[9]=U=>w.value=U),onCopyPath:M,onOpenContainingFolder:K,onPreview:F},null,8,["search-results","is-searching","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])):ue("",!0)])])]),_:1}))}}),i5={props:{on:{type:String,required:!0}},setup(t,{emit:e,slots:n}){const i=je(),o=H(!1),{t:r}=i.i18n;let s=null;const a=()=>{s&&clearTimeout(s),o.value=!0,s=setTimeout(()=>{o.value=!1},2e3)};return et(()=>{i.emitter.on(t.on,a)}),Ct(()=>{s&&clearTimeout(s)}),{shown:o,t:r}}},o5=(t,e)=>{const n=t.__vccOpts||t;for(const[i,o]of e)n[i]=o;return n},r5={key:1};function s5(t,e,n,i,o,r){return y(),T("div",{class:Ae(["vuefinder__action-message",{"vuefinder__action-message--hidden":!i.shown}])},[t.$slots.default?Ve(t.$slots,"default",{key:0}):(y(),T("span",r5,L(i.t("Saved.")),1))],2)}const Fp=o5(i5,[["render",s5]]),a5=[{name:"silver",displayName:"Silver"},{name:"valorite",displayName:"Valorite"},{name:"midnight",displayName:"Midnight"},{name:"latte",displayName:"Latte"},{name:"rose",displayName:"Rose"},{name:"mythril",displayName:"Mythril"},{name:"lime",displayName:"lime"},{name:"sky",displayName:"Sky"},{name:"ocean",displayName:"Oceanic"},{name:"palenight",displayName:"Palenight"},{name:"arctic",displayName:"Arctic"},{name:"code",displayName:"Code"}],l5={class:"vuefinder__settings-modal__content"},c5={class:"vuefinder__settings-modal__main"},u5={class:"vuefinder__settings-modal__sections"},d5={key:0,class:"vuefinder__settings-modal__section"},h5={for:"theme",class:"vuefinder__settings-modal__label"},p5={class:"vuefinder__settings-modal__input-group"},f5=["value"],m5=["value"],v5={key:1,class:"vuefinder__settings-modal__section"},g5={for:"language",class:"vuefinder__settings-modal__label"},_5={class:"vuefinder__settings-modal__input-group"},y5=["value"],b5={class:"vuefinder__settings-modal__reset-section"},w5={class:"vuefinder__settings-modal__reset-content"},S5={class:"vuefinder__settings-modal__reset-title"},C5={class:"vuefinder__settings-modal__reset-description"},Zg=Ce({__name:"ModalSettings",setup(t){const e=je(),{enabled:n}=Tn(),i=e.config,{clearStore:o}=e.storage,{t:r,localeAtom:s}=e.i18n,a=Oe(s),l=te({get:()=>String(a.value||"en"),set:p=>s.set(p||"en")}),c=Oe(i.state),u=te(()=>c.value.theme||"silver"),d=async()=>{i.reset(),o(),localStorage.removeItem("vuefinder_locale"),localStorage.removeItem("vuefinder_translations"),location.reload()},h=p=>{i.set("theme",p),e.emitter.emit("vf-theme-saved")},{i18n:m}=Ao("VueFinderOptions"),f=Object.fromEntries(Object.entries({ar:"Arabic (العربيّة)",zhCN:"Chinese-Simplified (简体中文)",zhTW:"Chinese-Traditional (繁體中文)",nl:"Dutch (Nederlands)",en:"English",fr:"French (Français)",de:"German (Deutsch)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",it:"Italian (Italiano)",ja:"Japanese (日本語)",fa:"Persian (فارسی)",pl:"Polish (Polski)",pt:"Portuguese (Português)",ru:"Russian (Pусский)",es:"Spanish (Español)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)"}).filter(([p])=>Object.keys(m).includes(p)));return(p,_)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:_[2]||(_[2]=C=>v(e).modal.close())},L(v(r)("Close")),1)]),default:we(()=>[g("div",l5,[j(pn,{icon:v(Gg),title:v(r)("Settings")},null,8,["icon","title"]),g("div",c5,[g("div",u5,[v(n)("theme")?(y(),T("div",d5,[g("label",h5,[Ke(L(v(r)("Theme"))+" ",1),j(Fp,{class:"vuefinder__settings-modal__message",on:"vf-theme-saved"},{default:we(()=>[Ke(L(v(r)("Saved.")),1)]),_:1})]),g("div",p5,[g("select",{id:"theme",value:u.value,class:"vuefinder__settings-modal__select",onChange:_[0]||(_[0]=C=>h(C.target?.value))},[(y(!0),T(Ie,null,He(v(a5),C=>(y(),T("option",{key:C.name,value:C.name},L(C.displayName),9,m5))),128))],40,f5)])])):ue("",!0),Object.keys(v(f)).length>1?(y(),T("div",v5,[g("label",g5,[Ke(L(v(r)("Language"))+" ",1),j(Fp,{class:"vuefinder__settings-modal__message",on:"vf-language-saved"},{default:we(()=>[Ke(L(v(r)("Saved.")),1)]),_:1})]),g("div",_5,[it(g("select",{id:"language","onUpdate:modelValue":_[1]||(_[1]=C=>l.value=C),class:"vuefinder__settings-modal__select"},[(y(!0),T(Ie,null,He(v(f),(C,w)=>(y(),T("option",{key:w,value:w},L(C),9,y5))),128))],512),[[el,l.value]])])])):ue("",!0)]),g("div",b5,[g("div",w5,[g("div",S5,L(v(r)("Reset")),1),g("div",C5,L(v(r)("Reset all settings to default")),1)]),g("button",{type:"button",class:"vuefinder__settings-modal__reset-button",onClick:d},L(v(r)("Reset Settings")),1)])])])]),_:1}))}}),Lt={ESCAPE:"Escape",DELETE:"Delete",ENTER:"Enter",BACKSLASH:"Backslash",KEY_A:"KeyA",KEY_E:"KeyE",KEY_F:"KeyF",SPACE:"Space",KEY_C:"KeyC",KEY_X:"KeyX",KEY_V:"KeyV",KEY_S:"KeyS",KEY_R:"KeyR"};function E5(){const t=je(),e=Gt(t),n=t.fs,i=t.config,{enabled:o}=Tn(),r=Oe(n.path),s=Oe(n.selectedItems),a=l=>{if(l.code===Lt.ESCAPE&&(t.modal.close(),t.root.focus()),!t.modal.visible){if(l.metaKey&&l.code===Lt.KEY_R&&!l.shiftKey&&(t.adapter.invalidateListQuery(r.value.path),t.adapter.open(r.value.path),l.preventDefault()),l.metaKey&&l.shiftKey&&l.code===Lt.KEY_R&&o("rename")&&s.value.length===1&&(t.modal.open(Qs,{items:s.value}),l.preventDefault()),l.code===Lt.DELETE&&s.value.length!==0&&t.modal.open(Gs,{items:s.value}),l.metaKey&&l.code===Lt.BACKSLASH&&t.modal.open(Bg),l.metaKey&&l.code===Lt.KEY_F&&o("search")&&(t.modal.open(wu),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_E&&(i.toggle("showTreeView"),l.preventDefault()),l.metaKey&&l.code===Lt.KEY_S&&(t.modal.open(Zg),l.preventDefault()),l.metaKey&&l.code===Lt.ENTER&&(i.toggle("fullScreen"),t.root.focus()),l.metaKey&&l.code===Lt.KEY_A&&(n.selectAll(t.selectionMode||"multiple",t),l.preventDefault()),l.code===Lt.SPACE&&s.value.length===1&&s.value[0]?.type!=="dir"&&t.modal.open(cr,{storage:n.path.get().storage,item:s.value[0]}),l.metaKey&&l.code===Lt.KEY_C&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("copy",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item copied to clipboard"):t.i18n.t("%s items copied to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_X&&o("copy")){if(s.value.length===0){e.error(t.i18n.t("No items selected"));return}n.setClipboard("cut",new Set(s.value.map(c=>c.path))),e.success(s.value.length===1?t.i18n.t("Item cut to clipboard"):t.i18n.t("%s items cut to clipboard",s.value.length)),l.preventDefault()}if(l.metaKey&&l.code===Lt.KEY_V&&o("copy")){if(n.getClipboard().items.size===0){e.error(t.i18n.t("No items in clipboard"));return}if(n.getClipboard().path===n.path.get().path){e.error(t.i18n.t("Cannot paste items to the same directory"));return}if(n.getClipboard().type==="cut"){t.modal.open(uo,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}}),n.clearClipboard();return}if(n.getClipboard().type==="copy"){t.modal.open(yu,{items:{from:Array.from(n.getClipboard().items),to:n.path.get()}});return}l.preventDefault()}}};et(async()=>{if(await Ge(),!t.root){console.warn("app.root is not available. Event listeners will not be attached.");return}t.root.addEventListener("keydown",a)}),bs(()=>{t.root&&t.root.removeEventListener("keydown",a)})}function x5(){const t=H(!1),e=H([]);return{isDraggingExternal:t,externalFiles:e,handleDragEnter:n=>{n.preventDefault(),n.stopPropagation();const i=n.dataTransfer?.items;i&&Array.from(i).some(o=>o.kind==="file")&&(t.value=!0,n.isExternalDrag=!0)},handleDragOver:n=>{t.value&&n.dataTransfer&&(n.dataTransfer.dropEffect="copy",n.preventDefault(),n.stopPropagation())},handleDragLeave:n=>{n.preventDefault();const i=n.currentTarget.getBoundingClientRect(),o=n.clientX,r=n.clientY;(o<i.left||o>i.right||r<i.top||r>i.bottom)&&(t.value=!1)},handleDrop:async n=>{n.preventDefault(),n.stopPropagation(),t.value=!1;const i=n.dataTransfer?.items;if(i){const o=Array.from(i).filter(r=>r.kind==="file");if(o.length>0){e.value=[];for(const r of o){const s=r.webkitGetAsEntry?.();if(s)await pu((a,l)=>{e.value.push({name:l.name,size:l.size,type:l.type,lastModified:new Date(l.lastModified),file:l})},s);else{const a=r.getAsFile();a&&e.value.push({name:a.name,size:a.size,type:a.type,lastModified:new Date(a.lastModified),file:a})}}return e.value}}return[]},clearExternalFiles:()=>{e.value=[]}}}const T5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function $5(t,e){return y(),T("svg",T5,[...e[0]||(e[0]=[g("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1)])])}const e_={render:$5},k5={class:"vuefinder__new-folder-modal__content"},O5={class:"vuefinder__new-folder-modal__form"},A5={class:"vuefinder__new-folder-modal__description"},P5=["placeholder"],Su=Ce({__name:"ModalNewFolder",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFolder({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create folder")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(v(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(e_),title:v(i)("New Folder")},null,8,["icon","title"]),g("div",k5,[g("div",O5,[g("p",A5,L(v(i)("Create a new folder")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-folder-modal__input",placeholder:v(i)("Folder Name"),type:"text",autofocus:"",onKeyup:ho(a,["enter"])},null,40,P5),[[Qo,s.value]])])])])]),_:1}))}}),R5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function I5(t,e){return y(),T("svg",R5,[...e[0]||(e[0]=[g("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1)])])}const t_={render:I5},M5={class:"vuefinder__new-file-modal__content"},F5={class:"vuefinder__new-file-modal__form"},D5={class:"vuefinder__new-file-modal__description"},L5=["placeholder"],n_=Ce({__name:"ModalNewFile",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=()=>{s.value!==""&&e.adapter.createFile({path:r.value.path,name:s.value}).then(l=>{n.success(i("%s is created.",s.value)),e.fs.setFiles(l.files),e.modal.close()}).catch(l=>{n.error(Yt(l,i("Failed to create file")))})};return(l,c)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},L(v(i)("Create")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(t_),title:v(i)("New File")},null,8,["icon","title"]),g("div",M5,[g("div",F5,[g("p",D5,L(v(i)("Create a new file")),1),it(g("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),class:"vuefinder__new-file-modal__input",placeholder:v(i)("File Name"),type:"text",onKeyup:ho(a,["enter"])},null,40,L5),[[Qo,s.value]])])])])]),_:1}))}}),j5={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function z5(t,e){return y(),T("svg",j5,[...e[0]||(e[0]=[g("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1)])])}const i_={render:z5};function Jl(t,e=14){const n=`((?=([\\w\\W]{0,${e}}))([\\w\\W]{${e+1},})([\\w\\W]{8,}))`;return t.replace(new RegExp(n),"$2..$4")}const N5={class:"vuefinder__upload-modal__content relative"},U5={class:"vuefinder__upload-modal__target-section"},V5={class:"vuefinder__upload-modal__target-label"},B5={class:"vuefinder__upload-modal__target-container"},H5={class:"vuefinder__upload-modal__target-path"},q5={class:"vuefinder__upload-modal__target-storage"},W5={key:0,class:"vuefinder__upload-modal__target-folder"},K5={class:"vuefinder__upload-modal__target-badge"},Y5={class:"vuefinder__upload-modal__drag-hint"},G5={class:"vuefinder__upload-modal__file-list vf-scrollbar"},Q5=["textContent"],X5={class:"vuefinder__upload-modal__file-info"},J5={class:"vuefinder__upload-modal__file-name hidden md:block"},Z5={class:"vuefinder__upload-modal__file-name md:hidden"},e4={key:0,class:"ml-auto"},t4=["title","disabled","onClick"],n4={key:0,class:"py-2"},i4=["aria-expanded"],o4={key:0,class:"vuefinder__upload-actions__menu absolute right-0 bottom-full left-0 mb-2"},r4=["disabled"],s4=["aria-expanded"],a4={key:0,class:"vuefinder__upload-actions__menu"},Cu=Ce({__name:"ModalUpload",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.path),r=H(o.value),s=H(!1),a=()=>{const Y=r.value.path;if(!Y)return{storage:"local",path:""};if(Y.endsWith("://"))return{storage:Y.replace("://",""),path:""};const I=Y.split("://");return{storage:I[0]||"local",path:I[1]||""}},l=Y=>{Y&&(r.value=Y)},c=Y=>{Y&&(r.value=Y,s.value=!1)},{container:u,internalFileInput:d,internalFolderInput:h,pickFiles:m,queue:f,message:p,uploading:_,hasFilesInDropArea:C,definitions:w,openFileSelector:S,upload:b,cancel:E,remove:x,clear:O,close:$,getClassNameForEntry:K,getIconForEntry:F,addExternalFiles:P}=Wg(e.customUploader),N=()=>{b(r.value)};et(()=>{e.emitter.on("vf-external-files-dropped",Y=>{P(Y)})}),Ct(()=>{e.emitter.off("vf-external-files-dropped")});const M=H(!1),q=H(null),le=H(null),de=Y=>{if(!M.value)return;const I=Y.target,A=q.value?.contains(I)??!1,Q=le.value?.contains(I)??!1;!A&&!Q&&(M.value=!1)};return et(()=>document.addEventListener("click",de)),Ct(()=>document.removeEventListener("click",de)),(Y,I)=>(y(),ne(nn,{"show-drag-overlay":v(C),"drag-overlay-text":v(n)("Drag and drop the files/folders to here.")},{buttons:we(()=>[g("div",{ref_key:"actionsMenuMobileRef",ref:q,class:"relative mb-2 w-full sm:hidden"},[g("div",{class:Ae(["vuefinder__upload-actions","vuefinder__upload-actions--block",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{type:"button",class:"vuefinder__upload-actions__main",onClick:I[3]||(I[3]=A=>v(S)())},L(v(n)("Select Files")),1),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[4]||(I[4]=Ye(A=>M.value=!M.value,["stop"]))},[...I[17]||(I[17]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,i4)],2),M.value?(y(),T("div",o4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[5]||(I[5]=A=>{v(S)(),M.value=!1})},L(v(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[6]||(I[6]=A=>{v(h)?.click(),M.value=!1})},L(v(n)("Select Folders")),1),I[18]||(I[18]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[7]||(I[7]=A=>v(_)?null:(v(O)(!1),M.value=!1))},L(v(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[8]||(I[8]=A=>v(_)?null:(v(O)(!0),M.value=!1))},L(v(n)("Clear only successful")),3)])):ue("",!0)],512),g("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:v(_)||!v(f).length,onClick:Ye(N,["prevent"])},L(v(n)("Upload")),9,r4),v(_)?(y(),T("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[9]||(I[9]=Ye((...A)=>v(E)&&v(E)(...A),["prevent"]))},L(v(n)("Cancel")),1)):(y(),T("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:I[10]||(I[10]=Ye((...A)=>v($)&&v($)(...A),["prevent"]))},L(v(n)("Close")),1)),g("div",{ref_key:"actionsMenuDesktopRef",ref:le,class:"relative mr-auto hidden sm:block"},[g("div",{class:Ae(["vuefinder__upload-actions",M.value?"vuefinder__upload-actions--ring":""])},[g("button",{ref_key:"pickFiles",ref:m,type:"button",class:"vuefinder__upload-actions__main"},L(v(n)("Select Files")),513),g("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:I[11]||(I[11]=Ye(A=>M.value=!M.value,["stop"]))},[...I[19]||(I[19]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[g("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,s4)],2),M.value?(y(),T("div",a4,[g("div",{class:"vuefinder__upload-actions__item",onClick:I[12]||(I[12]=A=>{v(S)(),M.value=!1})},L(v(n)("Select Files")),1),g("div",{class:"vuefinder__upload-actions__item",onClick:I[13]||(I[13]=A=>{v(h)?.click(),M.value=!1})},L(v(n)("Select Folders")),1),I[20]||(I[20]=g("div",{class:"vuefinder__upload-actions__separator"},null,-1)),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[14]||(I[14]=A=>v(_)?null:(v(O)(!1),M.value=!1))},L(v(n)("Clear all")),3),g("div",{class:Ae(["vuefinder__upload-actions__item",v(_)?"disabled":""]),onClick:I[15]||(I[15]=A=>v(_)?null:(v(O)(!0),M.value=!1))},L(v(n)("Clear only successful")),3)])):ue("",!0)],512)]),default:we(()=>[g("div",null,[j(pn,{icon:v(i_),title:v(n)("Upload Files")},null,8,["icon","title"]),g("div",N5,[g("div",U5,[g("div",V5,L(v(n)("Target Directory")),1),g("div",B5,[g("div",{class:"vuefinder__upload-modal__target-display",onClick:I[0]||(I[0]=A=>s.value=!s.value)},[g("div",H5,[g("span",q5,L(a().storage)+"://",1),a().path?(y(),T("span",W5,L(a().path),1)):ue("",!0)]),g("span",K5,L(v(n)("Browse")),1)])]),g("div",{class:Ae(["vuefinder__upload-modal__tree-selector",s.value?"vuefinder__upload-modal__tree-selector--expanded":"vuefinder__upload-modal__tree-selector--collapsed"])},[j(_u,{modelValue:r.value,"onUpdate:modelValue":[I[1]||(I[1]=A=>r.value=A),l],"show-pinned-folders":!0,onSelectAndClose:c},null,8,["modelValue"])],2)]),g("div",Y5,L(v(n)("You can drag & drop files anywhere while this modal is open.")),1),g("div",{ref_key:"container",ref:u,class:"hidden"},null,512),g("div",G5,[(y(!0),T(Ie,null,He(v(f),A=>(y(),T("div",{key:A.id,class:"vuefinder__upload-modal__file-entry"},[g("span",{class:Ae(["vuefinder__upload-modal__file-icon",v(K)(A)])},[g("span",{class:"vuefinder__upload-modal__file-icon-text",textContent:L(v(F)(A))},null,8,Q5)],2),g("div",X5,[g("div",J5,L(v(Jl)(A.name,40))+" ("+L(A.size)+") ",1),g("div",Z5,L(v(Jl)(A.name,16))+" ("+L(A.size)+") ",1),g("div",{class:Ae(["vuefinder__upload-modal__file-status",v(K)(A)])},[Ke(L(A.statusName)+" ",1),A.status===v(w).QUEUE_ENTRY_STATUS.UPLOADING?(y(),T("b",e4,L(A.percent),1)):ue("",!0)],2)]),g("button",{type:"button",class:Ae(["vuefinder__upload-modal__file-remove",v(_)?"disabled":""]),title:v(n)("Delete"),disabled:v(_),onClick:Q=>v(x)(A)},[...I[16]||(I[16]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__upload-modal__file-remove-icon"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,t4)]))),128)),v(f).length?ue("",!0):(y(),T("div",n4,L(v(n)("No files selected!")),1))]),v(p).length?(y(),ne(Xl,{key:0,error:"",onHidden:I[2]||(I[2]=A=>p.value="")},{default:we(()=>[Ke(L(v(p)),1)]),_:1})):ue("",!0)])]),g("input",{ref_key:"internalFileInput",ref:d,type:"file",multiple:"",class:"hidden"},null,512),g("input",{ref_key:"internalFolderInput",ref:h,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1},8,["show-drag-overlay","drag-overlay-text"]))}}),l4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function c4(t,e){return y(),T("svg",l4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const o_={render:c4},u4={class:"vuefinder__unarchive-modal__content"},d4={class:"vuefinder__unarchive-modal__items"},h4={key:0,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},p4={key:1,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--file",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},f4={class:"vuefinder__unarchive-modal__item-name"},m4={class:"vuefinder__unarchive-modal__info"},Eu=Ce({__name:"ModalUnarchive",setup(t){const e=je(),n=Gt(e),i=e.fs,o=Oe(i.path),{t:r}=e.i18n,s=H(e.modal.data.items[0]),a=H([]),l=()=>{e.adapter.unarchive({item:s.value.path,path:o.value.path}).then(c=>{n.success(r("The file unarchived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,r("Failed to unarchive")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(r)("Unarchive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[0]||(u[0]=d=>v(e).modal.close())},L(v(r)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(o_),title:v(r)("Unarchive")},null,8,["icon","title"]),g("div",u4,[g("div",d4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__unarchive-modal__item"},[d.type==="dir"?(y(),T("svg",h4,[...u[1]||(u[1]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",p4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",f4,L(d.basename),1)]))),128)),g("p",m4,L(v(r)("The archive will be unarchived at"))+" ("+L(v(o).path)+") ",1)])])])]),_:1}))}}),v4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function g4(t,e){return y(),T("svg",v4,[...e[0]||(e[0]=[g("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const r_={render:g4},_4={class:"vuefinder__archive-modal__content"},y4={class:"vuefinder__archive-modal__form"},b4={class:"vuefinder__archive-modal__files vf-scrollbar"},w4={key:0,class:"vuefinder__archive-modal__icon vuefinder__archive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},S4={key:1,class:"vuefinder__archive-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},C4={class:"vuefinder__archive-modal__file-name"},E4=["placeholder"],xu=Ce({__name:"ModalArchive",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=Oe(o.path),s=H(""),a=H(e.modal.data.items),l=()=>{a.value.length&&e.adapter.archive({path:r.value.path,items:a.value.map(({path:c,type:u})=>({path:c,type:u})),name:s.value}).then(c=>{n.success(i("The file(s) archived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{n.error(Yt(c,i("Failed to archive files")))})};return(c,u)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},L(v(i)("Archive")),1),g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>v(e).modal.close())},L(v(i)("Cancel")),1)]),default:we(()=>[g("div",null,[j(pn,{icon:v(r_),title:v(i)("Archive the files")},null,8,["icon","title"]),g("div",_4,[g("div",y4,[g("div",b4,[(y(!0),T(Ie,null,He(a.value,d=>(y(),T("p",{key:d.path,class:"vuefinder__archive-modal__file"},[d.type==="dir"?(y(),T("svg",w4,[...u[2]||(u[2]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(y(),T("svg",S4,[...u[3]||(u[3]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),g("span",C4,L(d.basename),1)]))),128))]),it(g("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>s.value=d),class:"vuefinder__archive-modal__input",placeholder:v(i)("Archive name. (.zip file will be created)"),type:"text",onKeyup:ho(l,["enter"])},null,40,E4),[[Qo,s.value]])])])])]),_:1}))}}),x4={class:"vuefinder__about-modal__content"},T4={class:"vuefinder__about-modal__main"},$4={class:"vuefinder__about-modal__shortcuts"},k4={class:"vuefinder__about-modal__shortcut"},O4={key:0,class:"vuefinder__about-modal__shortcut"},A4={key:1,class:"vuefinder__about-modal__shortcut"},P4={class:"vuefinder__about-modal__shortcut"},R4={class:"vuefinder__about-modal__shortcut"},I4={key:2,class:"vuefinder__about-modal__shortcut"},M4={key:3,class:"vuefinder__about-modal__shortcut"},F4={key:4,class:"vuefinder__about-modal__shortcut"},D4={key:5,class:"vuefinder__about-modal__shortcut"},L4={class:"vuefinder__about-modal__shortcut"},j4={class:"vuefinder__about-modal__shortcut"},z4={key:6,class:"vuefinder__about-modal__shortcut"},N4={key:7,class:"vuefinder__about-modal__shortcut"},U4=Ce({__name:"ModalShortcuts",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n;return(o,r)=>(y(),ne(nn,null,{buttons:we(()=>[g("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:r[0]||(r[0]=s=>v(e).modal.close())},L(v(i)("Close")),1)]),default:we(()=>[g("div",x4,[j(pn,{icon:v(Vg),title:v(i)("Shortcuts")},null,8,["icon","title"]),g("div",T4,[g("div",$4,[g("div",k4,[g("div",null,L(v(i)("Refresh")),1),r[1]||(r[1]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"R")],-1))]),v(n)("rename")?(y(),T("div",O4,[g("div",null,L(v(i)("Rename")),1),r[2]||(r[2]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Shift"),Ke(" + "),g("kbd",null,"R")],-1))])):ue("",!0),v(n)("delete")?(y(),T("div",A4,[g("div",null,L(v(i)("Delete")),1),r[3]||(r[3]=g("kbd",null,"Del",-1))])):ue("",!0),g("div",P4,[g("div",null,L(v(i)("Escape")),1),r[4]||(r[4]=g("kbd",null,"Esc",-1))]),g("div",R4,[g("div",null,L(v(i)("Select All")),1),r[5]||(r[5]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"A")],-1))]),v(n)("copy")?(y(),T("div",I4,[g("div",null,L(v(i)("Cut")),1),r[6]||(r[6]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"X")],-1))])):ue("",!0),v(n)("copy")?(y(),T("div",M4,[g("div",null,L(v(i)("Copy")),1),r[7]||(r[7]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"C")],-1))])):ue("",!0),v(n)("copy")?(y(),T("div",F4,[g("div",null,L(v(i)("Paste")),1),r[8]||(r[8]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"V")],-1))])):ue("",!0),v(n)("search")?(y(),T("div",D4,[g("div",null,L(v(i)("Search")),1),r[9]||(r[9]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"F")],-1))])):ue("",!0),g("div",L4,[g("div",null,L(v(i)("Toggle Sidebar")),1),r[10]||(r[10]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"E")],-1))]),g("div",j4,[g("div",null,L(v(i)("Open Settings")),1),r[11]||(r[11]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"S")],-1))]),v(n)("fullscreen")?(y(),T("div",z4,[g("div",null,L(v(i)("Toggle Full Screen")),1),r[12]||(r[12]=g("div",null,[g("kbd",null,"⌘"),Ke(" + "),g("kbd",null,"Enter")],-1))])):ue("",!0),v(n)("preview")?(y(),T("div",N4,[g("div",null,L(v(i)("Preview")),1),r[13]||(r[13]=g("kbd",null,"Space",-1))])):ue("",!0)])])])]),_:1}))}}),V4={class:"vuefinder__menubar__container"},B4=["onClick","onMouseenter"],H4={class:"vuefinder__menubar__label"},q4=["onMouseenter"],W4=["onClick"],K4={key:0,class:"vuefinder__menubar__dropdown__label"},Y4={key:1,class:"vuefinder__menubar__dropdown__checkmark"},G4=Ce({__name:"MenuBar",setup(t){const e=je(),n=Gt(e),{enabled:i}=Tn(),{t:o}=e?.i18n||{t:S=>S},r=e?.fs,s=e?.config,a=Oe(s.state),l=Oe(r.selectedItems),c=Oe(r?.storages||[]),u=H(null),d=H(!1),h=te(()=>window.opener!==null||window.name!==""||window.history.length<=1),m=te(()=>[{id:"file",label:o("File"),items:[{id:"new-folder",label:o("New Folder"),action:()=>e?.modal?.open(Su,{items:l.value}),hidden:()=>!i("newfolder")},{id:"new-file",label:o("New File"),action:()=>e?.modal?.open(n_,{items:l.value}),hidden:()=>!i("newfile")},{type:"separator",hidden:()=>!i("newfolder")&&!i("newfile")||!i("upload")},{id:"upload",label:o("Upload"),action:()=>e?.modal?.open(Cu,{items:l.value}),hidden:()=>!i("upload")},{type:"separator",hidden:()=>!i("search")},{id:"search",label:o("Search"),action:()=>e.modal.open(wu),hidden:()=>!i("search")},{type:"separator",hidden:()=>!i("archive")&&!i("unarchive")},{id:"archive",label:o("Archive"),action:()=>{l.value.length>0&&e?.modal?.open(xu,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("archive")},{id:"unarchive",label:o("Unarchive"),action:()=>{l.value.length===1&&l.value[0]?.mime_type==="application/zip"&&e?.modal?.open(Eu,{items:l.value})},enabled:()=>l.value.length===1&&l.value[0]?.mime_type==="application/zip",hidden:()=>!i("unarchive")},{type:"separator",hidden:()=>!i("preview")},{id:"preview",label:o("Preview"),action:()=>{l.value.length===1&&l.value[0]?.type!=="dir"&&e?.modal?.open(cr,{storage:r?.path?.get()?.storage,item:l.value[0]})},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir",hidden:()=>!i("preview")},...h.value?[{type:"separator"},{id:"exit",label:o("Exit"),action:()=>{try{window.close()}catch{}},enabled:()=>!0}]:[]]},{id:"edit",label:o("Edit"),items:[...e?.selectionMode==="multiple"?[{id:"select-all",label:o("Select All"),action:()=>r?.selectAll(e?.selectionMode||"multiple",e),enabled:()=>!0},{id:"deselect",label:o("Deselect All"),action:()=>r?.clearSelection(),enabled:()=>l.value.length>0},{type:"separator"}]:[],...i("copy")?[{id:"cut",label:o("Cut"),action:()=>{l.value.length>0&&r?.setClipboard("cut",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"copy",label:o("Copy"),action:()=>{l.value.length>0&&r?.setClipboard("copy",new Set(l.value.map(S=>S.path)))},enabled:()=>l.value.length>0},{id:"paste",label:o("Paste"),action:()=>{const S=r?.getClipboard();S?.items?.size>0&&e?.modal?.open(S.type==="cut"?uo:yu,{items:{from:Array.from(S.items),to:r?.path?.get()}})},enabled:()=>r?.getClipboard()?.items?.size>0}]:[],...i("move")?[{id:"move",label:o("Move files"),action:()=>{if(l.value.length>0){const S=e?.fs,b={storage:S?.path?.get()?.storage||"",path:S?.path?.get()?.path||"",type:"dir"};e?.modal?.open(uo,{items:{from:l.value,to:b}})}},enabled:()=>l.value.length>0},{type:"separator"}]:[],{id:"copy-path",label:o("Copy Path"),action:async()=>{if(l.value.length===1){const S=l.value[0];await Ko(S.path)}else{const S=r?.path?.get();S?.path&&await Ko(S.path)}},enabled:()=>!0},{id:"copy-download-url",label:o("Copy Download URL"),action:async()=>{if(l.value.length===1){const S=l.value[0];r?.path?.get()?.storage;const b=e?.adapter?.getDownloadUrl({path:S.path});b&&await kD(b)}},enabled:()=>l.value.length===1&&l.value[0]?.type!=="dir"},{type:"separator",hidden:()=>!i("rename")&&!i("delete")},{id:"rename",label:o("Rename"),action:()=>{l.value.length===1&&e?.modal?.open(Qs,{items:l.value})},enabled:()=>l.value.length===1,hidden:()=>!i("rename")},{id:"delete",label:o("Delete"),action:()=>{l.value.length>0&&e?.modal?.open(Gs,{items:l.value})},enabled:()=>l.value.length>0,hidden:()=>!i("delete")}]},{id:"view",label:o("View"),items:[{id:"refresh",label:o("Refresh"),action:()=>{e.adapter.invalidateListQuery(r.path.get().path),e.adapter.open(r.path.get().path)},enabled:()=>!0},{type:"separator"},{id:"grid-view",label:o("Grid View"),action:()=>s?.set("view","grid"),enabled:()=>!0,checked:()=>a.value?.view==="grid"},{id:"list-view",label:o("List View"),action:()=>s?.set("view","list"),enabled:()=>!0,checked:()=>a.value?.view==="list"},{type:"separator"},{id:"tree-view",label:o("Tree View"),action:()=>s?.toggle("showTreeView"),enabled:()=>!0,checked:()=>a.value?.showTreeView},{id:"thumbnails",label:o("Show Thumbnails"),action:()=>s?.toggle("showThumbnails"),enabled:()=>!0,checked:()=>a.value?.showThumbnails},{id:"show-hidden-files",label:o("Show Hidden Files"),action:()=>s?.toggle("showHiddenFiles"),enabled:()=>!0,checked:()=>a.value?.showHiddenFiles},{type:"separator",hidden:()=>!i("fullscreen")},{id:"fullscreen",label:o("Full Screen"),action:()=>s?.toggle("fullScreen"),enabled:()=>i("fullscreen"),checked:()=>a.value?.fullScreen,hidden:()=>!i("fullscreen")},{type:"separator"},{id:"persist-path",label:o("Persist Path"),action:()=>{s?.toggle("persist"),e.emitter.emit("vf-persist-path-saved")},enabled:()=>!0,checked:()=>a.value?.persist},{id:"metric-units",label:o("Metric Units"),action:()=>{s?.toggle("metricUnits"),e.filesize=s?.get("metricUnits")?zg:hu,e.emitter.emit("vf-metric-units-saved")},enabled:()=>!0,checked:()=>a.value?.metricUnits}]},{id:"go",label:o("Go"),items:[...i("history")?[{id:"forward",label:o("Forward"),action:()=>{r?.goForward();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoForward?.get()??!1},{id:"back",label:o("Back"),action:()=>{r?.goBack();const S=r?.path?.get();S?.path&&e?.adapter.open(S.path)},enabled:()=>r?.canGoBack?.get()??!1}]:[],{id:"open-containing-folder",label:o("Open containing folder"),action:()=>{const S=r?.path?.get();if(S?.breadcrumb&&S.breadcrumb.length>1){const b=S.breadcrumb[S.breadcrumb.length-2]?.path??`${S.storage}://`;e?.adapter.open(b)}},enabled:()=>{const S=r?.path?.get();return S?.breadcrumb&&S.breadcrumb.length>1}},{type:"separator"},...(c.value||[]).map(S=>({id:`storage-${S}`,label:S,action:()=>{const b=`${S}://`;e?.adapter.open(b)},enabled:()=>!0})),{type:"separator"},{id:"go-to-folder",label:o("Go to Folder"),action:async()=>{const S=prompt(o("Enter folder path:"));if(S){if(!S.includes("://")){alert(o("Invalid path format. Path must be in format: storage://path/to/folder"));return}const b=S.indexOf("://"),E=S.slice(0,b);if(!c.value||!c.value.includes(E)){alert(o('Invalid storage. Storage "%s" is not available.',E));return}try{await e?.adapter.open(S)}catch(x){const O=Yt(x,o("Failed to navigate to folder"));n.error(O),e.fs.setLoading(!1)}}},enabled:()=>!0}]},{id:"help",label:o("Help"),items:[{id:"settings",label:o("Settings"),action:()=>e?.modal?.open(Zg),enabled:()=>!0},{id:"shortcuts",label:o("Shortcuts"),action:()=>e?.modal?.open(U4),enabled:()=>!0},{id:"about",label:o("About"),action:()=>e?.modal?.open(Bg),enabled:()=>!0}]}]),f=S=>{u.value===S?_():(u.value=S,d.value=!0)},p=S=>{d.value&&(u.value=S)},_=()=>{u.value=null,d.value=!1},C=S=>{_(),S()},w=S=>{S.target.closest(".vuefinder__menubar")||_()};return et(()=>{document.addEventListener("click",w)}),Ct(()=>{document.removeEventListener("click",w)}),(S,b)=>(y(),T("div",{class:"vuefinder__menubar",onClick:b[0]||(b[0]=Ye(()=>{},["stop"]))},[g("div",V4,[(y(!0),T(Ie,null,He(m.value,E=>(y(),T("div",{key:E.id,class:Ae(["vuefinder__menubar__item",{"vuefinder__menubar__item--active":u.value===E.id}]),onClick:x=>f(E.id),onMouseenter:x=>p(E.id)},[g("span",H4,L(E.label),1),u.value===E.id?(y(),T("div",{key:0,class:"vuefinder__menubar__dropdown",onMouseenter:x=>p(E.id)},[(y(!0),T(Ie,null,He(E.items,x=>(y(),T("div",{key:x.id||x.type,class:Ae(["vuefinder__menubar__dropdown__item",{"vuefinder__menubar__dropdown__item--separator":x.type==="separator","vuefinder__menubar__dropdown__item--disabled":x.enabled&&!x.enabled(),"vuefinder__menubar__dropdown__item--checked":x.checked&&x.checked(),"vuefinder__menubar__dropdown__item--hidden":x.hidden&&x.hidden()}]),onClick:Ye(O=>x.type!=="separator"&&x.enabled&&x.enabled()?C(x.action):null,["stop"])},[x.type!=="separator"?(y(),T("span",K4,L(x.label),1)):ue("",!0),x.checked&&x.checked()?(y(),T("span",Y4," ✓ ")):ue("",!0)],10,W4))),128))],40,q4)):ue("",!0)],42,B4))),128))])]))}}),Q4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function X4(t,e){return y(),T("svg",Q4,[...e[0]||(e[0]=[g("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1)])])}const J4={render:X4},Z4={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function eL(t,e){return y(),T("svg",Z4,[...e[0]||(e[0]=[g("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1)])])}const tL={render:eL},nL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function iL(t,e){return y(),T("svg",nL,[...e[0]||(e[0]=[g("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1)])])}const oL={render:iL},rL={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function sL(t,e){return y(),T("svg",rL,[...e[0]||(e[0]=[g("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1)])])}const aL={render:sL},lL={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function cL(t,e){return y(),T("svg",lL,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586z"},null,-1)])])}const uL={render:cL},dL={class:"vuefinder__toolbar"},hL={class:"vuefinder__toolbar__actions"},pL=["title"],fL=["title"],mL=["title"],vL=["title"],gL=["title"],_L=["title"],yL=["title"],bL={class:"vuefinder__toolbar__controls"},wL=["title"],SL={class:"vuefinder__toolbar__control vuefinder__toolbar__dropdown-container"},CL=["title"],EL={class:"relative"},xL={key:0,class:"vuefinder__toolbar__filter-indicator"},TL={key:0,class:"vuefinder__toolbar__dropdown"},$L={class:"vuefinder__toolbar__dropdown-content"},kL={class:"vuefinder__toolbar__dropdown-section"},OL={class:"vuefinder__toolbar__dropdown-label"},AL={class:"vuefinder__toolbar__dropdown-row"},PL={value:"name"},RL={value:"size"},IL={value:"modified"},ML={value:""},FL={value:"asc"},DL={value:"desc"},LL={class:"vuefinder__toolbar__dropdown-section"},jL={class:"vuefinder__toolbar__dropdown-label"},zL={class:"vuefinder__toolbar__dropdown-options"},NL={class:"vuefinder__toolbar__dropdown-option"},UL={class:"vuefinder__toolbar__option-text"},VL={class:"vuefinder__toolbar__dropdown-option"},BL={class:"vuefinder__toolbar__option-text"},HL={class:"vuefinder__toolbar__dropdown-option"},qL={class:"vuefinder__toolbar__option-text"},WL={class:"vuefinder__toolbar__dropdown-toggle"},KL={for:"showHidden",class:"vuefinder__toolbar__toggle-label"},YL={class:"vuefinder__toolbar__dropdown-reset"},GL=["title"],QL=["title"],XL=Ce({name:"VfToolbar",__name:"Toolbar",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.selectedItems),l=Oe(o.sort),c=Oe(o.filter);$e(()=>s.value.fullScreen,()=>{const _=document.querySelector("body");_&&(_.style.overflow=s.value.fullScreen?"hidden":"")},{immediate:!0});const u=H(!1),d=_=>{_.target.closest(".vuefinder__toolbar__dropdown-container")||(u.value=!1)};et(()=>{const _=document.querySelector("body");_&&s.value.fullScreen&&setTimeout(()=>_.style.overflow="hidden"),document.addEventListener("click",d)}),Ct(()=>{document.removeEventListener("click",d)});const h=H({sortBy:"name",sortOrder:"",filterKind:"all",showHidden:s.value.showHiddenFiles});$e(()=>h.value.sortBy,_=>{if(!h.value.sortOrder){o.clearSort();return}_==="name"?o.setSort("basename",h.value.sortOrder):_==="size"?o.setSort("file_size",h.value.sortOrder):_==="modified"&&o.setSort("last_modified",h.value.sortOrder)}),$e(()=>h.value.sortOrder,_=>{if(!_){o.clearSort();return}h.value.sortBy==="name"?o.setSort("basename",_):h.value.sortBy==="size"?o.setSort("file_size",_):h.value.sortBy==="modified"&&o.setSort("last_modified",_)}),$e(l,_=>{_.active?(_.column==="basename"?h.value.sortBy="name":_.column==="file_size"?h.value.sortBy="size":_.column==="last_modified"&&(h.value.sortBy="modified"),h.value.sortOrder=_.order):h.value.sortOrder=""},{immediate:!0}),$e(()=>h.value.filterKind,_=>{o.setFilter(_,s.value.showHiddenFiles)}),$e(()=>h.value.showHidden,_=>{r.set("showHiddenFiles",_),o.setFilter(h.value.filterKind,_)}),$e(c,_=>{h.value.filterKind=_.kind},{immediate:!0}),$e(()=>s.value.showHiddenFiles,_=>{h.value.showHidden=_,o.setFilter(h.value.filterKind,_)},{immediate:!0});const m=()=>r.set("view",s.value.view==="grid"?"list":"grid"),f=te(()=>c.value.kind!=="all"||!s.value.showHiddenFiles||l.value.active),p=()=>{h.value={sortBy:"name",sortOrder:"",filterKind:"all",showHidden:!0},r.set("showHiddenFiles",!0),o.clearSort(),o.clearFilter()};return(_,C)=>(y(),T("div",dL,[g("div",hL,[v(n)("newfolder")?(y(),T("div",{key:0,class:"mx-1.5",title:v(i)("New Folder"),onClick:C[0]||(C[0]=w=>v(e).modal.open(Su,{items:v(a)}))},[j(v(e_))],8,pL)):ue("",!0),v(n)("newfile")?(y(),T("div",{key:1,class:"mx-1.5",title:v(i)("New File"),onClick:C[1]||(C[1]=w=>v(e).modal.open(n_,{items:v(a)}))},[j(v(t_))],8,fL)):ue("",!0),v(n)("rename")?(y(),T("div",{key:2,class:"mx-1.5",title:v(i)("Rename"),onClick:C[2]||(C[2]=w=>v(a).length!==1||v(e).modal.open(Qs,{items:v(a)}))},[j(v(qg),{class:Ae(v(a).length===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,mL)):ue("",!0),v(n)("delete")?(y(),T("div",{key:3,class:"mx-1.5",title:v(i)("Delete"),onClick:C[3]||(C[3]=w=>!v(a).length||v(e).modal.open(Gs,{items:v(a)}))},[j(v(Hg),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,vL)):ue("",!0),v(n)("upload")?(y(),T("div",{key:4,class:"mx-1.5",title:v(i)("Upload"),onClick:C[4]||(C[4]=w=>v(e).modal.open(Cu,{items:v(a)}))},[j(v(i_))],8,gL)):ue("",!0),v(n)("unarchive")&&v(a).length===1&&v(a)[0].mime_type==="application/zip"?(y(),T("div",{key:5,class:"mx-1.5",title:v(i)("Unarchive"),onClick:C[5]||(C[5]=w=>!v(a).length||v(e).modal.open(Eu,{items:v(a)}))},[j(v(o_),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,_L)):ue("",!0),v(n)("archive")?(y(),T("div",{key:6,class:"mx-1.5",title:v(i)("Archive"),onClick:C[6]||(C[6]=w=>!v(a).length||v(e).modal.open(xu,{items:v(a)}))},[j(v(r_),{class:Ae(v(a).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,yL)):ue("",!0)]),g("div",bL,[v(n)("search")?(y(),T("div",{key:0,class:"mx-1.5",title:v(i)("Search Files"),onClick:C[7]||(C[7]=w=>v(e).modal.open(wu))},[j(v(bu),{class:"vf-toolbar-icon text-(--vf-bg-primary)"})],8,wL)):ue("",!0),g("div",SL,[g("div",{title:v(i)("Filter"),class:"vuefinder__toolbar__dropdown-trigger",onClick:C[8]||(C[8]=w=>u.value=!u.value)},[g("div",EL,[j(v(uL),{class:"vf-toolbar-icon vuefinder__toolbar__icon h-6 w-6"}),f.value?(y(),T("div",xL)):ue("",!0)])],8,CL),u.value?(y(),T("div",TL,[g("div",$L,[g("div",kL,[g("div",OL,L(v(i)("Sorting")),1),g("div",AL,[it(g("select",{"onUpdate:modelValue":C[9]||(C[9]=w=>h.value.sortBy=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",PL,L(v(i)("Name")),1),g("option",RL,L(v(i)("Size")),1),g("option",IL,L(v(i)("Date")),1)],512),[[el,h.value.sortBy]]),it(g("select",{"onUpdate:modelValue":C[10]||(C[10]=w=>h.value.sortOrder=w),class:"vuefinder__toolbar__dropdown-select"},[g("option",ML,L(v(i)("None")),1),g("option",FL,L(v(i)("Asc")),1),g("option",DL,L(v(i)("Desc")),1)],512),[[el,h.value.sortOrder]])])]),g("div",LL,[g("div",jL,L(v(i)("Show")),1),g("div",zL,[g("label",NL,[it(g("input",{"onUpdate:modelValue":C[11]||(C[11]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"all",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",UL,L(v(i)("All items")),1)]),g("label",VL,[it(g("input",{"onUpdate:modelValue":C[12]||(C[12]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"files",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",BL,L(v(i)("Files only")),1)]),g("label",HL,[it(g("input",{"onUpdate:modelValue":C[13]||(C[13]=w=>h.value.filterKind=w),type:"radio",name:"filterKind",value:"folders",class:"vuefinder__toolbar__radio"},null,512),[[ea,h.value.filterKind]]),g("span",qL,L(v(i)("Folders only")),1)])])]),g("div",WL,[g("label",KL,L(v(i)("Show hidden files")),1),it(g("input",{id:"showHidden","onUpdate:modelValue":C[14]||(C[14]=w=>h.value.showHidden=w),type:"checkbox",class:"vuefinder__toolbar__checkbox"},null,512),[[Ss,h.value.showHidden]])]),g("div",YL,[g("button",{class:"vuefinder__toolbar__reset-button",onClick:p},L(v(i)("Reset")),1)])])])):ue("",!0)]),v(n)("fullscreen")?(y(),T("div",{key:1,class:"mx-1.5",title:v(i)("Toggle Full Screen"),onClick:C[15]||(C[15]=w=>v(r).toggle("fullScreen"))},[v(s).fullScreen?(y(),ne(v(tL),{key:0,class:"vf-toolbar-icon"})):(y(),ne(v(J4),{key:1,class:"vf-toolbar-icon"}))],8,GL)):ue("",!0),g("div",{class:"mx-1.5",title:v(i)("Change View"),onClick:C[16]||(C[16]=w=>m())},[v(s).view==="grid"?(y(),ne(v(oL),{key:0,class:"vf-toolbar-icon"})):ue("",!0),v(s).view==="list"?(y(),ne(v(aL),{key:1,class:"vf-toolbar-icon"})):ue("",!0)],8,QL)])]))}}),JL={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"vuefinder__breadcrumb__refresh-icon",viewBox:"-40 -40 580 580"};function ZL(t,e){return y(),T("svg",JL,[...e[0]||(e[0]=[g("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1)])])}const ej={render:ZL},tj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"};function nj(t,e){return y(),T("svg",tj,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1)])])}const ij={render:nj},oj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"vuefinder__breadcrumb__close-icon",viewBox:"0 0 24 24"};function rj(t,e){return y(),T("svg",oj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const sj={render:rj},aj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function lj(t,e){return y(),T("svg",aj,[...e[0]||(e[0]=[g("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1)])])}const cj={render:lj},uj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"};function dj(t,e){return y(),T("svg",uj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const hj={render:dj},pj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function fj(t,e){return y(),T("svg",pj,[...e[0]||(e[0]=[g("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M9 6h11M12 12h8M15 18h5M5 6v.01M8 12v.01M11 18v.01"},null,-1)])])}const mj={render:fj},vj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function gj(t,e){return y(),T("svg",vj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0-4-4m4 4-4 4m0 6H4m0 0 4 4m-4-4 4-4"},null,-1)])])}const _j={render:gj};function ur(t,e=[]){const n="vfDragEnterCounter",i=t.fs,o=Oe(i.selectedItems);function r(d,h){return!!(!d||d.type!=="dir"||d.path.startsWith(h)||o.value.some(m=>m.path===h?!1:!!d.path.startsWith(m.path)))}function s(d,h){if(d.isExternalDrag)return;if(!(t.features?.move??!1)){d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none");return}d.preventDefault();const m=i.getDraggedItem();r(h,m)?d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):(d.dataTransfer&&(d.dataTransfer.dropEffect="copy",d.dataTransfer.effectAllowed="all"),d.currentTarget.classList.add(...e))}function a(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,m=Number(h.dataset[n]||0);h.dataset[n]=String(m+1)}function l(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const h=d.currentTarget,m=Number(h.dataset[n]||0)-1;m<=0?(delete h.dataset[n],h.classList.remove(...e)):h.dataset[n]=String(m)}function c(d,h){if(d.isExternalDrag||!(t.features?.move??!1)||!h)return;d.preventDefault();const m=d.currentTarget;delete m.dataset[n],m.classList.remove(...e);const f=d.dataTransfer?.getData("items")||"[]",p=JSON.parse(f).map(_=>i.sortedFiles.get().find(C=>C.path===_));i.clearDraggedItem(),t.modal.open(uo,{items:{from:p,to:h}})}function u(d){return{dragover:h=>s(h,d),dragenter:a,dragleave:l,drop:h=>c(h,d)}}return{events:u}}const yj={class:"vuefinder__breadcrumb__container"},bj=["title"],wj=["title"],Sj=["title"],Cj=["title"],Ej={class:"vuefinder__breadcrumb__path-container"},xj={class:"vuefinder__breadcrumb__list"},Tj={key:0,class:"vuefinder__breadcrumb__hidden-list"},$j={class:"relative"},kj=["title","onClick"],Oj=["title"],Aj={class:"vuefinder__breadcrumb__path-mode"},Pj={class:"vuefinder__breadcrumb__path-mode-content"},Rj=["title"],Ij={class:"vuefinder__breadcrumb__path-text"},Mj=["title"],Fj=["data-theme"],Dj=["onClick"],Lj={class:"vuefinder__breadcrumb__hidden-item-content"},jj={class:"vuefinder__breadcrumb__hidden-item-text"},zj=Ce({__name:"Breadcrumb",setup(t){const e=je(),n=Gt(e),{t:i}=e.i18n,o=e.fs,r=e.config,s=Oe(r.state),a=Oe(o.path),l=Oe(o.loading),c=H(null),u=Yg(0,100),d=H(5),h=H(!1),m=H(!1),f=te(()=>a.value?.breadcrumb??[]);function p(Y,I){return Y.length>I?[Y.slice(-I),Y.slice(0,-I)]:[Y,[]]}const _=te(()=>p(f.value,d.value)[0]),C=te(()=>p(f.value,d.value)[1]);$e(u,()=>{if(!c.value)return;const Y=c.value.children;let I=0,A=0;const Q=5,U=1;d.value=Q,Ge(()=>{for(let ie=Y.length-1;ie>=0;ie--){const ve=Y[ie];if(I+ve.offsetWidth>u.value-40)break;I+=parseInt(ve.offsetWidth.toString(),10),A++}A<U&&(A=U),A>Q&&(A=Q),d.value=A})});const w=()=>{c.value&&(u.value=c.value.offsetWidth)},S=H(null);et(()=>{S.value=new ResizeObserver(w),c.value&&S.value.observe(c.value)}),Ct(()=>{S.value&&S.value.disconnect()});const b=ur(e,["vuefinder__drag-over"]);function E(Y=null){Y??=f.value.length-2;const I={basename:a.value?.storage??"local",extension:"",path:(a.value?.storage??"local")+"://",storage:a.value?.storage??"local",type:"dir",file_size:null,last_modified:null,mime_type:null,visibility:""};return f.value[Y]??I}const x=()=>{e.adapter.invalidateListQuery(a.value.path),e.adapter.open(a.value.path)},O=()=>{_.value.length>0&&e.adapter.open(f.value[f.value.length-2]?.path??(a.value?.storage??"local")+"://")},$=Y=>{e.adapter.open(Y.path),h.value=!1},K=()=>{h.value&&(h.value=!1)},F={mounted(Y,I){Y.clickOutsideEvent=function(A){Y===A.target||Y.contains(A.target)||I.value()},document.body.addEventListener("click",Y.clickOutsideEvent)},beforeUnmount(Y){document.body.removeEventListener("click",Y.clickOutsideEvent)}},P=()=>{r.toggle("showTreeView")},N=H({x:0,y:0}),M=(Y,I=null)=>{if(Y.currentTarget instanceof HTMLElement){const{x:A,y:Q,height:U}=Y.currentTarget.getBoundingClientRect();N.value={x:A,y:Q+U}}h.value=I??!h.value},q=()=>{m.value=!m.value},le=async()=>{await Ko(a.value?.path||""),n.success(i("Path copied to clipboard"))},de=()=>{m.value=!1};return(Y,I)=>(y(),T("div",yj,[g("span",{title:v(i)("Toggle Tree View")},[j(v(mj),{class:Ae(["vuefinder__breadcrumb__toggle-tree",v(s).showTreeView?"vuefinder__breadcrumb__toggle-tree--active":""]),onClick:P},null,8,["class"])],8,bj),g("span",{title:v(i)("Go up a directory")},[j(v(ij),We({class:f.value.length?"vuefinder__breadcrumb__go-up--active":"vuefinder__breadcrumb__go-up--inactive"},bn(f.value.length?v(b).events(E()):{}),{onClick:O}),null,16,["class"])],8,wj),v(o).isLoading()?(y(),T("span",{key:1,title:v(i)("Cancel")},[j(v(sj),{onClick:I[0]||(I[0]=A=>v(e).emitter.emit("vf-fetch-abort"))})],8,Cj)):(y(),T("span",{key:0,title:v(i)("Refresh")},[j(v(ej),{onClick:x})],8,Sj)),it(g("div",Ej,[g("div",null,[j(v(cj),We({class:"vuefinder__breadcrumb__home-icon"},bn(v(b).events(E(-1))),{onClick:I[1]||(I[1]=Ye(A=>v(e).adapter.open(v(a).storage+"://"),["stop"]))}),null,16)]),g("div",xj,[C.value.length?it((y(),T("div",Tj,[I[3]||(I[3]=g("div",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("div",$j,[g("span",{class:"vuefinder__breadcrumb__hidden-toggle",onDragenter:I[2]||(I[2]=A=>M(A,!0)),onClick:Ye(M,["stop"])},[j(v(Jg),{class:"vuefinder__breadcrumb__hidden-toggle-icon"})],32)])])),[[F,K]]):ue("",!0)]),g("div",{ref_key:"breadcrumbContainer",ref:c,class:"vuefinder__breadcrumb__visible-list pointer-events-none"},[(y(!0),T(Ie,null,He(_.value,(A,Q)=>(y(),T("div",{key:Q},[I[4]||(I[4]=g("span",{class:"vuefinder__breadcrumb__separator"},"/",-1)),g("span",We({class:"vuefinder__breadcrumb__item pointer-events-auto",title:A.basename},bn(v(b).events(A),!0),{onClick:Ye(U=>v(e).adapter.open(A.path),["stop"])}),L(A.name),17,kj)]))),128))],512),v(r).get("loadingIndicator")==="circular"&&v(l)?(y(),ne(v(Zs),{key:0})):ue("",!0),g("span",{title:v(i)("Toggle Path Copy Mode"),onClick:q},[j(v(_j),{class:"vuefinder__breadcrumb__toggle-icon"})],8,Oj)],512),[[Sn,!m.value]]),it(g("div",Aj,[g("div",Pj,[g("div",{title:v(i)("Copy Path")},[j(v(fu),{class:"vuefinder__breadcrumb__copy-icon",onClick:le})],8,Rj),g("div",Ij,L(v(a).path),1),g("div",{title:v(i)("Exit")},[j(v(hj),{class:"vuefinder__breadcrumb__exit-icon",onClick:de})],8,Mj)])],512),[[Sn,m.value]]),(y(),ne(ws,{to:"body"},[g("div",null,[it(g("div",{style:At({position:"absolute",top:N.value.y+"px",left:N.value.x+"px"}),class:"vuefinder__themer vuefinder__breadcrumb__hidden-dropdown","data-theme":v(e).theme.current},[(y(!0),T(Ie,null,He(C.value,(A,Q)=>(y(),T("div",We({key:Q,class:"vuefinder__breadcrumb__hidden-item"},bn(v(b).events(A),!0),{onClick:U=>$(A)}),[g("div",Lj,[g("span",null,[j(v(zn),{class:"vuefinder__breadcrumb__hidden-item-icon"})]),g("span",jj,L(A.name),1)])],16,Dj))),128))],12,Fj),[[Sn,h.value]])])]))]))}}),Nj={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function Uj(t,e){return y(),T("svg",Nj,[...e[0]||(e[0]=[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Dp={render:Uj},Vj={class:"vuefinder__drag-item__container"},Bj={class:"vuefinder__drag-item__count"},Hj=Ce({__name:"DragItem",props:{count:{}},setup(t){const e=t;return(n,i)=>(y(),T("div",Vj,[e.count>1?(y(),ne(v(Dp),{key:0,class:"vuefinder__drag-item__icon translate-x-1 translate-y-1"})):ue("",!0),j(v(Dp),{class:"vuefinder__drag-item__icon"}),g("div",Bj,L(e.count),1)]))}}),qj={key:2,class:"vuefinder__item-icon__extension"},Lp=Ce({__name:"ItemIcon",props:{item:{},ext:{type:Boolean},small:{type:Boolean},view:{}},setup(t){const e=t,n=je(),i=Oe(n.config.state),o=te(()=>e.small!==void 0?e.small?"small":"large":e.view==="list"?"small":"large"),r=te(()=>{const a=o.value,l=i.value?.listIconSize,c=i.value?.gridIconSize;return i.value?.gridItemWidth,i.value?.gridItemHeight,e.view==="list"||a==="small"?{"--vf-icon-size":`${l??16}px`}:{"--vf-icon-size":`${c??48}px`}}),s={app:n,config:i.value,item:e.item,view:e.view};return(a,l)=>(y(),T("div",{class:Ae(["vuefinder__item-icon",{"vuefinder__item-icon--small":o.value==="small","vuefinder__item-icon--large":o.value==="large","vuefinder__item-icon--grid":t.view==="grid","vuefinder__item-icon--list":t.view==="list"}]),style:At(r.value)},[Ve(a.$slots,"icon",wn(Jn(s)),()=>[t.item.type==="dir"?(y(),ne(v(zn),{key:0,class:"vuefinder__item-icon__folder"})):(y(),ne(v(Wo),{key:1,class:"vuefinder__item-icon__file"})),t.ext&&t.item.type!=="dir"&&t.item.extension?(y(),T("div",qj,L(t.item.extension.substring(0,3)),1)):ue("",!0)])],6))}}),Wj={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function Kj(t,e){return y(),T("svg",Wj,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3V7a5 5 0 0 1 5-5m0 12a2 2 0 0 0-1.995 1.85L10 16a2 2 0 1 0 2-2m0-10a3 3 0 0 0-3 3v3h6V7a3 3 0 0 0-3-3"},null,-1)])])}const jp={render:Kj},Yj=["data-key","data-row","data-col","draggable"],Gj={key:0},Qj={class:"vuefinder__explorer__item-grid-content"},Xj=["data-src","alt"],Jj={class:"vuefinder__explorer__item-title"},Zj={key:1,class:"vuefinder__explorer__item-list-content"},e3={class:"vuefinder__explorer__item-list-name"},t3={class:"vuefinder__explorer__item-list-icon"},n3={class:"vuefinder__explorer__item-name"},i3={key:0,class:"vuefinder__explorer__item-path"},o3={key:1,class:"vuefinder__explorer__item-size"},r3={key:0},s3={key:2,class:"vuefinder__explorer__item-date"},a3=Ce({__name:"FileItem",props:{item:{},view:{},showThumbnails:{type:Boolean},isSelected:{type:Boolean},isDragging:{type:Boolean},rowIndex:{},colIndex:{},showPath:{type:Boolean},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=je(),r=o.fs,s=o.config,a=te(()=>{const P=o.selectionFilterType;return!P||P==="both"?!0:P==="files"&&n.item.type==="file"||P==="dirs"&&n.item.type==="dir"}),l=te(()=>{const P=o.selectionFilterMimeIncludes;return!P||!P.length||n.item.type==="dir"?!0:n.item.mime_type?P.some(N=>n.item.mime_type?.startsWith(N)):!1}),c=te(()=>a.value&&l.value),u=te(()=>["file-item-"+n.explorerId,n.view==="grid"?"vf-explorer-item-grid":"vf-explorer-item-list",n.isSelected?"vf-explorer-selected":"",c.value?"":"vf-explorer-item--unselectable"]),d=te(()=>({opacity:n.isDragging||r.isCut(n.item.path)||!c.value?.5:""})),h=H(null);let m=!1,f=null,p=null,_=!1;const{enabled:C}=Tn(),w=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),S=te(()=>w?!1:C("move")),b=()=>{f&&(clearTimeout(f),f=null),p=null},E=P=>{b(),p=P,_=!1,P.stopPropagation(),f=setTimeout(()=>{!p||f===null||(_=!0,p.cancelable&&p.preventDefault(),p.stopPropagation(),i("contextmenu",p),b())},500)},x=P=>{if(_){P.preventDefault(),P.stopPropagation(),b();return}setTimeout(()=>{_||(b(),F(P))},100)},O=P=>{if(!p)return;const N=p.touches[0]||p.changedTouches[0],M=P.touches[0]||P.changedTouches[0];if(N&&M){const q=Math.abs(M.clientX-N.clientX),le=Math.abs(M.clientY-N.clientY);(q>15||le>15)&&b()}},$=P=>{w&&P.type!=="click"||i("click",P)},K=P=>{if(_)return P.preventDefault(),P.stopPropagation(),!1;i("dragstart",P)},F=P=>{if(!m)m=!0,i("click",P),h.value=setTimeout(()=>{m=!1},300);else return m=!1,i("dblclick",P),!1};return(P,N)=>(y(),T("div",{class:Ae(u.value),style:At(d.value),"data-key":t.item.path,"data-row":t.rowIndex,"data-col":t.colIndex,draggable:S.value,onTouchstartCapture:N[1]||(N[1]=M=>E(M)),onTouchendCapture:N[2]||(N[2]=M=>x(M)),onTouchmoveCapture:O,onTouchcancelCapture:N[3]||(N[3]=()=>b()),onClick:$,onDblclick:N[4]||(N[4]=M=>i("dblclick",M)),onContextmenu:N[5]||(N[5]=Ye(M=>i("contextmenu",M),["prevent","stop"])),onDragstart:K,onDragend:N[6]||(N[6]=M=>i("dragend",M))},[t.view==="grid"?(y(),T("div",Gj,[v(r).isReadOnly(t.item)?(y(),ne(v(jp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--left",title:"Read Only"})):ue("",!0),g("div",Qj,[(t.item.mime_type??"").startsWith("image")&&t.showThumbnails?(y(),T("img",{key:0,src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"vuefinder__explorer__item-thumbnail lazy","data-src":t.item.previewUrl??v(o).adapter.getPreviewUrl({path:t.item.path}),alt:t.item.basename,onTouchstart:N[0]||(N[0]=M=>M.preventDefault())},null,40,Xj)):(y(),ne(Lp,{key:1,item:t.item,ext:!0,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"]))]),g("span",Jj,L(v(Jl)(t.item.basename)),1)])):(y(),T("div",Zj,[g("div",e3,[g("div",t3,[j(Lp,{item:t.item,view:t.view},{icon:we(M=>[Ve(P.$slots,"icon",wn(Jn(M)))]),_:3},8,["item","view"])]),g("span",n3,L(t.item.basename),1),g("div",null,[v(r).isReadOnly(t.item)?(y(),ne(v(jp),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--list",title:"Read Only"})):ue("",!0)])]),t.showPath?(y(),T("div",i3,L(t.item.path),1)):ue("",!0),t.showPath?ue("",!0):(y(),T("div",o3,[t.item.file_size?(y(),T("div",r3,L(v(o).filesize(t.item.file_size)),1)):ue("",!0)])),!t.showPath&&t.item.last_modified?(y(),T("div",s3,L(new Date(t.item.last_modified*1e3).toLocaleString()),1)):ue("",!0)])),v(C)("pinned")&&v(s).get("pinnedFolders").find(M=>M.path===t.item.path)?(y(),ne(v(mu),{key:2,class:"vuefinder__item--pinned"})):ue("",!0)],46,Yj))}}),l3=["data-row"],zp=Ce({__name:"FileRow",props:{rowIndex:{},rowHeight:{},view:{},itemsPerRow:{},items:{},showThumbnails:{type:Boolean},showPath:{type:Boolean},isDraggingItem:{type:Function},isSelected:{type:Function},dragNDropEvents:{type:Function},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const n=t,i=e,o=te(()=>[n.view==="grid"?"vf-explorer-item-grid-row":"vf-explorer-item-list-row","pointer-events-none"]),r=te(()=>({position:"absolute",top:0,left:0,width:"100%",height:`${n.rowHeight}px`,transform:`translateY(${n.rowIndex*n.rowHeight}px)`})),s=te(()=>n.view==="grid"?{gridTemplateColumns:`repeat(${n.itemsPerRow||1}, 1fr)`}:{gridTemplateColumns:"1fr"});return(a,l)=>(y(),T("div",{class:Ae(o.value),"data-row":t.rowIndex,style:At(r.value)},[g("div",{class:Ae(["grid justify-self-start",{"w-full":t.view==="list"}]),style:At(s.value)},[(y(!0),T(Ie,null,He(t.items,(c,u)=>(y(),ne(a3,We({key:c.path,item:c,view:t.view,"show-thumbnails":t.showThumbnails,"show-path":t.showPath,"is-selected":t.isSelected(c.path),"is-dragging":t.isDraggingItem(c.path),"row-index":t.rowIndex,"col-index":u,"explorer-id":t.explorerId},bn(t.dragNDropEvents(c)),{onClick:l[0]||(l[0]=d=>i("click",d)),onDblclick:l[1]||(l[1]=d=>i("dblclick",d)),onContextmenu:l[2]||(l[2]=d=>i("contextmenu",d)),onDragstart:l[3]||(l[3]=d=>i("dragstart",d)),onDragend:l[4]||(l[4]=d=>i("dragend",d))}),{icon:we(d=>[Ve(a.$slots,"icon",We({ref_for:!0},d))]),_:3},16,["item","view","show-thumbnails","show-path","is-selected","is-dragging","row-index","col-index","explorer-id"]))),128))],6)],14,l3))}}),c3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function u3(t,e){return y(),T("svg",c3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1)])])}const d3={render:u3},h3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function p3(t,e){return y(),T("svg",h3,[...e[0]||(e[0]=[g("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1)])])}const f3={render:p3},Xa=Ce({__name:"SortIcon",props:{direction:{}},setup(t){return(e,n)=>(y(),T("div",null,[t.direction==="asc"?(y(),ne(v(d3),{key:0,class:"vuefinder__explorer__sort-icon"})):ue("",!0),t.direction==="desc"?(y(),ne(v(f3),{key:1,class:"vuefinder__explorer__sort-icon"})):ue("",!0)]))}}),m3={class:"vuefinder__explorer__header"},v3=Ce({__name:"ExplorerHeader",setup(t){const e=je(),n=e.fs,{t:i}=e.i18n,o=Oe(n.sort);return(r,s)=>(y(),T("div",m3,[g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--name vf-sort-button",onClick:s[0]||(s[0]=a=>v(n).toggleSort("basename"))},[Ke(L(v(i)("Name"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="basename"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--size vf-sort-button",onClick:s[1]||(s[1]=a=>v(n).toggleSort("file_size"))},[Ke(L(v(i)("Size"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="file_size"]])]),g("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--date vf-sort-button",onClick:s[2]||(s[2]=a=>v(n).toggleSort("last_modified"))},[Ke(L(v(i)("Date"))+" ",1),it(j(Xa,{direction:v(o).order},null,8,["direction"]),[[Sn,v(o).active&&v(o).column==="last_modified"]])])]))}});function g3(t,e){const{scrollContainer:n,itemWidth:i=100,rowHeight:o,overscan:r=2,containerPadding:s=48,lockItemsPerRow:a}=e,l=t,c=()=>typeof o=="number"?o:o.value,u=()=>i?typeof i=="number"?i:i.value:100,d=()=>s?typeof s=="number"?s:s.value:0,h=H(0),m=H(6),f=H(600);let p=null;const _=te(()=>Math.ceil(l.value.length/m.value)),C=te(()=>_.value*c()),w=te(()=>{const P=c(),N=Math.max(0,Math.floor(h.value/P)-r),M=Math.min(_.value,Math.ceil((h.value+f.value)/P)+r);return{start:N,end:M}}),S=te(()=>{const{start:P,end:N}=w.value;return Array.from({length:N-P},(M,q)=>P+q)}),b=()=>f.value,E=()=>typeof a=="object"?a.value:!1,x=()=>{if(E()){m.value=1;return}if(n.value){const P=d(),N=n.value.clientWidth-P,M=u();M>0&&(m.value=Math.max(Math.floor(N/M),2))}},O=P=>{const N=P.target;h.value=N.scrollTop};$e(()=>l.value.length,()=>{x()}),i&&typeof i!="number"&&$e(i,()=>{x()}),s&&typeof s!="number"&&$e(s,()=>{x()}),o&&typeof o!="number"&&$e(o,()=>{});const $=(P,N)=>{if(!P||!Array.isArray(P))return[];const M=N*m.value;return P.slice(M,M+m.value)},K=(P,N,M,q,le)=>{if(!P||!Array.isArray(P))return[];const de=[];for(let Y=N;Y<=M;Y++)for(let I=q;I<=le;I++){const A=Y*m.value+I;A<P.length&&P[A]&&de.push(P[A])}return de},F=P=>({row:Math.floor(P/m.value),col:P%m.value});return et(async()=>{await Ge(),n.value&&(f.value=n.value.clientHeight||600),x(),window.addEventListener("resize",()=>{n.value&&(f.value=n.value.clientHeight||600),x()}),n.value&&"ResizeObserver"in window&&(p=new ResizeObserver(P=>{const N=P[0];N&&(f.value=Math.round(N.contentRect.height)),x()}),p.observe(n.value))}),Ct(()=>{window.removeEventListener("resize",x),p&&(p.disconnect(),p=null)}),{scrollTop:h,itemsPerRow:m,totalRows:_,totalHeight:C,visibleRange:w,visibleRows:S,updateItemsPerRow:x,handleScroll:O,getRowItems:$,getItemsInRange:K,getItemPosition:F,getContainerHeight:b}}function _3(t){const{itemsPerRow:e,totalHeight:n,getItemsInRange:i,getKey:o,selectionObject:r,rowHeight:s,itemWidth:a,osInstance:l}=t,c=()=>typeof a=="number"?a:a.value,u=Math.floor(Math.random()*2**32).toString(),d=je(),h=d.fs,m=Oe(h.selectedKeys),f=Oe(h.sortedFiles),p=te(()=>{const I=new Map;return f.value&&f.value.forEach(A=>{I.set(o(A),A)}),I}),_=H(new Set),C=H(!1),w=H(!1),S=I=>I.map(A=>A.getAttribute("data-key")).filter(A=>!!A),b=I=>{I.selection.clearSelection(!0,!0)},E=I=>{if(m.value&&m.value.size>0){const A=document.querySelectorAll(`.file-item-${u}[data-key]`),Q=new Map;A.forEach(ie=>{const ve=ie.getAttribute("data-key");ve&&Q.set(ve,ie)});const U=[];m.value.forEach(ie=>{const ve=Q.get(ie);ve&&x(ie)&&U.push(ve)}),U.forEach(ie=>{I.selection.select(ie,!0)})}},x=I=>{const A=p.value.get(I);if(!A)return!1;const Q=d.selectionFilterType,U=d.selectionFilterMimeIncludes;return Q==="files"&&A.type==="dir"||Q==="dirs"&&A.type==="file"?!1:U&&Array.isArray(U)&&U.length>0?A.type==="dir"?!0:A.mime_type?U.some(ie=>A.mime_type?.startsWith(ie)):!1:!0},O=I=>{if(d.selectionMode==="single")return!1;C.value=!1,!I.event?.metaKey&&!I.event?.ctrlKey&&(w.value=!0),I.selection.resolveSelectables(),b(I),E(I)},$=H(0),K=({event:I,selection:A})=>{$.value=(r.value?.getAreaLocation().y1??0)-(d.root.getBoundingClientRect().top??0);const Q=document.querySelector(".selection-area-container");if(Q&&(Q.dataset.theme=d.theme.current),d.selectionMode==="single")return;const U=I;U&&"type"in U&&U.type==="touchend"&&U.preventDefault();const ie=I;!ie?.ctrlKey&&!ie?.metaKey&&(h.clearSelection(),A.clearSelection(!0,!0)),_.value.clear()},F=I=>{if(d.selectionMode==="single")return;const A=S(I.store.changed.added),Q=S(I.store.changed.removed);w.value=!1,C.value=!0,A.forEach(U=>{m.value&&!m.value.has(U)&&x(U)&&(_.value.add(U),h.select(U,d.selectionMode||"multiple"))}),Q.forEach(U=>{document.querySelector(`[data-key="${U}"]`)&&p.value.has(U)&&_.value.delete(U),h.deselect(U)}),I.selection.resolveSelectables(),E(I)},P=()=>{_.value.clear()},N=I=>{if(!I.event)return;const A=document.querySelector(".scroller-"+u);if(!A)return;const Q=A.getBoundingClientRect(),U=Q.left,ie=Q.top;let ve=A.scrollTop;if(l?.value){const{viewport:ft}=l.value.elements();ft&&(ve=ft.scrollTop)}const re=r.value?.getAreaLocation();if(!re)return;const ge=Math.min(re.x1,re.x2),_e=ve+Math.min(re.y1,re.y2),R=Math.max(re.x1,re.x2),k=ve+Math.max(re.y1,re.y2),z=4,D=c();let B=Math.floor((ge-U-z)/D),oe=Math.floor((R-U-z)/D);const ee=ge-U-z-B*D,G=R-U-z-oe*D;ee>D-z&&(B=B+1),G<z&&(oe=oe-1);const he=Math.max(0,B),me=Math.min(e.value-1,oe);let ke=Math.floor((_e-ie-z)/s.value),Ee=Math.floor((k-ie-z)/s.value);const ze=_e-ie-z-ke*s.value,Pe=k-ie-z-Ee*s.value,Ne=Math.floor((n.value-z)/s.value);ze>s.value-z&&(ke=ke+1),Pe<z&&(Ee=Ee-1);const ut=Math.max(0,ke),Qe=Math.min(Ee,Ne),at=i(f.value,ut,Qe,he,me),tt=document.querySelectorAll(`.file-item-${u}[data-key]`),pt=new Map;tt.forEach(ft=>{const Ft=ft.getAttribute("data-key");Ft&&pt.set(Ft,ft)});const dt=[];if(at.forEach(ft=>{const Ft=o(ft);pt.get(Ft)||dt.push(Ft)}),dt.length>0){const ft=d.selectionMode||"multiple";h.selectMultiple(dt,ft)}},M=I=>{N(I),b(I),E(I),h.setSelectedCount(m.value?.size||0),C.value=!1},q=()=>{let I=[".scroller-"+u];if(l?.value){const{viewport:A}=l.value.elements();A&&(I=A)}r.value=new NR({selectables:[".file-item-"+u+":not(.vf-explorer-item--unselectable)"],boundaries:I,selectionContainerClass:"selection-area-container",behaviour:{overlap:"invert",intersect:"touch",startThreshold:0,triggers:[0],scrolling:{speedDivider:10,manualSpeed:750,startScrollMargins:{x:0,y:10}}},features:{touch:!0,range:!0,deselectOnBlur:!0,singleTap:{allow:!1,intersect:"native"}}}),r.value.on("beforestart",O),r.value.on("start",K),r.value.on("move",F),r.value.on("stop",M)},le=()=>{r.value&&(r.value.destroy(),r.value=null)},de=()=>{r.value&&(Array.from(m.value??new Set).forEach(I=>{x(I)||h.deselect(I)}),le(),q())},Y=I=>{w.value&&(r.value?.clearSelection(),P(),w.value=!1);const A=I;!_.value.size&&!w.value&&!A?.ctrlKey&&!A?.metaKey&&(h.clearSelection(),r.value?.clearSelection())};return et(()=>{const I=A=>{!A.buttons&&C.value&&(C.value=!1)};document.addEventListener("dragleave",I),Ct(()=>{document.removeEventListener("dragleave",I)})}),{explorerId:u,isDragging:C,initializeSelectionArea:q,updateSelectionArea:de,handleContentClick:Y}}function y3(t){const e=n=>{if(!n)return{typeAllowed:!1,mimeAllowed:!1};const i=t.selectionFilterType,o=t.selectionFilterMimeIncludes,r=!i||i==="both"||i==="files"&&n.type==="file"||i==="dirs"&&n.type==="dir";let s=!0;return o&&Array.isArray(o)&&o.length>0&&(n.type==="dir"?s=!0:n.mime_type?s=o.some(a=>n.mime_type.startsWith(a)):s=!1),{typeAllowed:r,mimeAllowed:s}};return{isItemSelectable:e,canSelectItem:n=>{const{typeAllowed:i,mimeAllowed:o}=e(n);return i&&o}}}function b3(t){const e=n=>({item:n,defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}});return{createCancelableEvent:e,openItem:(n,i,o)=>{const r=e(n);if(n.type==="file"&&i){if(t.emitter.emit("vf-file-dclick",r),r.defaultPrevented)return}else if(n.type==="dir"&&o&&(t.emitter.emit("vf-folder-dclick",r),r.defaultPrevented))return;const s=t.contextMenuItems?.find(a=>a.show(t,{items:[n],target:n,searchQuery:""}));s&&s.action(t,[n])}}}function w3(t,e,n,i,o,r,s){const a=t.fs,{canSelectItem:l}=y3(t),{openItem:c}=b3(t),u=h=>{const m=h.target?.closest(".file-item-"+e);if(!m)return null;const f=String(m.getAttribute("data-key")),p=n.value?.find(_=>_.path===f);return{key:f,item:p}},d=()=>{const h=i.value;return n.value?.filter(m=>h?.has(m.path))||[]};return{handleItemClick:h=>{const m=u(h);if(!m)return;const{key:f,item:p}=m,_=h;if(!l(p))return;const C=t.selectionMode||"multiple";!_?.ctrlKey&&!_?.metaKey&&(h.type!=="touchstart"||!a.isSelected(f))&&(a.clearSelection(),o.value?.clearSelection(!0,!0)),o.value?.resolveSelectables(),h.type==="touchstart"&&a.isSelected(f)?a.select(f,C):a.toggleSelect(f,C),a.setSelectedCount(i.value?.size||0)},handleItemDblClick:h=>{const m=u(h);if(!m)return;const{item:f}=m;l(f)&&f&&c(f,r,s)},handleItemContextMenu:h=>{h.preventDefault(),h.stopPropagation();const m=u(h);if(!m)return;const{key:f,item:p}=m;l(p)&&(i.value?.has(f)||(a.clearSelection(),a.select(f)),t.emitter.emit("vf-contextmenu-show",{event:h,items:d(),target:p}))},handleContentContextMenu:h=>{h.preventDefault(),t.emitter.emit("vf-contextmenu-show",{event:h,items:d()})},getSelectedItems:d}}function S3(t,e){const n=H(null);return et(()=>{if(hn.plugin([cR]),t.value){const i=hn(t.value,{scrollbars:{theme:"vf-scrollbars-theme"}},{initialized:o=>{n.value=o;const{viewport:r}=o.elements();r&&r.addEventListener("scroll",e)},updated:o=>{const{viewport:r}=o.elements()}});n.value=i}}),Ct(()=>{if(n.value){const{viewport:i}=n.value.elements();i&&i.removeEventListener("scroll",e),n.value.destroy(),n.value=null}}),{osInstance:n}}function C3(t,e){const n=H(null);return et(()=>{t.value&&(n.value=new Hi({elements_selector:".lazy",container:t.value})),e?.emitter&&e.emitter.on("vf-refresh-thumbnails",()=>{n.value&&n.value.update()})}),Bp(()=>{n.value&&n.value.update()}),Ct(()=>{n.value&&(n.value.destroy(),n.value=null)}),{vfLazyLoad:n}}const E3={class:"vuefinder__explorer__container"},x3={key:0,class:"vuefinder__linear-loader"},T3=Ce({__name:"Explorer",props:{onFileDclick:{type:Function},onFolderDclick:{type:Function}},setup(t){const e=t,n=je(),i=ur(n,["vuefinder__drag-over"]),o=In("dragImage"),r=Go(null),s=In("scrollContainer"),a=In("scrollContent"),l=n.fs,c=n.config,u=Oe(c.state),d=Oe(l.sortedFiles),h=Oe(l.selectedKeys),m=Oe(l.loading),f=D=>h.value?.has(D)??!1,p=te(()=>{if(u.value?.view==="grid"){const oe=u.value?.gridItemHeight??80,ee=u.value?.gridItemGap??8;return oe+ee*2}const D=u.value?.listItemHeight??32,B=u.value?.listItemGap??2;return D+B*2}),_=te(()=>{if(u.value?.view==="grid"){const D=u.value?.gridItemWidth??96,B=u.value?.gridItemGap??8;return D+B*2}return 104}),C=te(()=>u.value?.view==="grid"?(u.value?.gridItemGap??8)*2:0),{t:w}=n.i18n,{itemsPerRow:S,totalHeight:b,visibleRows:E,handleScroll:x,getRowItems:O,getItemsInRange:$,updateItemsPerRow:K}=g3(te(()=>d.value??[]),{scrollContainer:s,itemWidth:_,rowHeight:p,overscan:2,containerPadding:C,lockItemsPerRow:te(()=>u.value.view==="list")}),{osInstance:F}=S3(s,x),{explorerId:P,isDragging:N,initializeSelectionArea:M,updateSelectionArea:q,handleContentClick:le}=_3({itemsPerRow:S,totalHeight:b,getItemsInRange:$,getKey:D=>D.path,selectionObject:r,rowHeight:p,itemWidth:_,osInstance:F}),de=H(null),Y=D=>{if(!D||!de.value)return!1;const B=h.value?.has(de.value)??!1;return N.value&&(B?h.value?.has(D)??!1:D===de.value)};$e(()=>c.get("view"),D=>{D==="list"?S.value=1:K()},{immediate:!0}),$e(S,D=>{c.get("view")==="list"&&D!==1&&(S.value=1)});const I=D=>d.value?.[D];C3(s,n);const{handleItemClick:A,handleItemDblClick:Q,handleItemContextMenu:U,handleContentContextMenu:ie}=w3(n,P,d,h,r,e.onFileDclick,e.onFolderDclick);et(()=>{const D=()=>{r.value||M(),r.value&&r.value.on("beforestart",({event:B})=>{const oe=B?.target===a.value;if(!B?.metaKey&&!B?.ctrlKey&&!B?.altKey&&!oe)return!1})};if(F.value)D();else{const B=setInterval(()=>{F.value&&(clearInterval(B),D())},50);setTimeout(()=>{clearInterval(B),r.value||D()},500)}$e(()=>[n.selectionFilterType,n.selectionFilterMimeIncludes],q,{deep:!0})});const ve=D=>{if(!(n.features?.move??!1)||D.altKey||D.ctrlKey||D.metaKey)return D.preventDefault(),!1;N.value=!0;const B=D.target?.closest(".file-item-"+P);if(de.value=B?String(B.dataset.key):null,D.dataTransfer&&de.value){D.dataTransfer.setDragImage(o.value,0,15),D.dataTransfer.effectAllowed="all",D.dataTransfer.dropEffect="copy";const oe=h.value?.has(de.value)?Array.from(h.value):[de.value];D.dataTransfer.setData("items",JSON.stringify(oe)),l.setDraggedItem(de.value)}},re=()=>{de.value=null};let ge=null,_e=null;const R=D=>{D.target?.closest(".file-item-"+P)||(_e=D,ge&&clearTimeout(ge),ge=setTimeout(()=>{_e&&(_e.cancelable&&_e.preventDefault(),_e.stopPropagation(),ie(_e)),_e=null,ge=null},500))},k=D=>{ge&&(clearTimeout(ge),ge=null),_e=null},z=D=>{if(!_e)return;const B=_e.touches[0]||_e.changedTouches[0],oe=D.touches[0]||D.changedTouches[0];if(B&&oe){const ee=Math.abs(oe.clientX-B.clientX),G=Math.abs(oe.clientY-B.clientY);(ee>15||G>15)&&(ge&&(clearTimeout(ge),ge=null),_e=null)}};return(D,B)=>(y(),T("div",E3,[v(u).view==="list"?(y(),ne(v3,{key:0})):ue("",!0),g("div",{ref_key:"scrollContainer",ref:s,class:Ae(["vuefinder__explorer__selector-area","scroller-"+v(P)])},[v(c).get("loadingIndicator")==="linear"&&v(m)?(y(),T("div",x3)):ue("",!0),g("div",{ref_key:"scrollContent",ref:a,class:"scrollContent vuefinder__explorer__scroll-content",style:At({height:`${v(b)}px`,position:"relative",width:"100%"}),onContextmenu:B[0]||(B[0]=Ye((...oe)=>v(ie)&&v(ie)(...oe),["self","prevent"])),onClick:B[1]||(B[1]=Ye((...oe)=>v(le)&&v(le)(...oe),["self"])),onTouchstartCapture:Ye(R,["self"]),onTouchendCapture:Ye(k,["self"]),onTouchmoveCapture:Ye(z,["self"]),onTouchcancelCapture:Ye(k,["self"])},[g("div",{ref_key:"dragImage",ref:o,class:"vuefinder__explorer__drag-item"},[j(Hj,{count:de.value&&v(h).has(de.value)?v(h).size:1},null,8,["count"])],512),v(u).view==="grid"?(y(!0),T(Ie,{key:0},He(v(E),oe=>(y(),ne(zp,{key:oe,"row-index":oe,"row-height":p.value,view:"grid","items-per-row":v(S),items:v(O)(v(d),oe),"show-thumbnails":v(u).showThumbnails,"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>v(i).events(ee),"explorer-id":v(P),onClick:v(A),onDblclick:v(Q),onContextmenu:v(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items-per-row","items","show-thumbnails","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128)):(y(!0),T(Ie,{key:1},He(v(E),oe=>(y(),ne(zp,{key:oe,"row-index":oe,"row-height":p.value,view:"list",items:I(oe)?[I(oe)]:[],"is-dragging-item":Y,"is-selected":f,"drag-n-drop-events":ee=>v(i).events(ee),"explorer-id":v(P),onClick:v(A),onDblclick:v(Q),onContextmenu:v(U),onDragstart:ve,onDragend:re},{icon:we(ee=>[Ve(D.$slots,"icon",We({ref_for:!0},ee))]),_:3},8,["row-index","row-height","items","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128))],36)],2)]))}}),$3=["href","download"],k3=["onClick"],O3=Ce({__name:"ContextMenu",setup(t){const e=je(),n=H(null),i=H([]);let o=null,r=null,s=null,a=[],l=null;const c=Mt({active:!1,items:[],positions:{}});e.emitter.on("vf-context-selected",m=>{i.value=m});const u=m=>m.link(e,i.value),d=m=>{e.emitter.emit("vf-contextmenu-hide"),m.action(e,i.value)};e.emitter.on("vf-contextmenu-show",m=>{const{event:f,items:p,target:_=null}=m||{};c.items=(e.contextMenuItems||[]).filter(C=>C.show(e,{items:p,target:_})).sort((C,w)=>{const S=C.order??1/0,b=w.order??1/0;return S-b}),_?p.length>1&&p.some(C=>C.path===_.path)?e.emitter.emit("vf-context-selected",p):e.emitter.emit("vf-context-selected",[_]):e.emitter.emit("vf-context-selected",[]),h(f)}),e.emitter.on("vf-contextmenu-hide",()=>{c.active=!1,o&&(o(),o=null),s&&(a.forEach(m=>{m===window?window.removeEventListener("scroll",s,!0):m.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null,c.positions={}});const h=async m=>{o&&(o(),o=null);const f=(b=>{if("clientX"in b&&"clientY"in b)return{x:b.clientX,y:b.clientY};const E="touches"in b&&b.touches[0]||"changedTouches"in b&&b.changedTouches[0];return E?{x:E.clientX,y:E.clientY}:{x:0,y:0}})(m);if(r={getBoundingClientRect:()=>({width:0,height:0,x:f.x,y:f.y,top:f.y,left:f.x,right:f.x,bottom:f.y})},c.positions={position:"fixed",zIndex:"10001",opacity:"0",visibility:"hidden",left:"-9999px",top:"-9999px"},c.active=!0,await Ge(),!n.value||!r)return;await new Promise(b=>{requestAnimationFrame(()=>{requestAnimationFrame(b)})});const p=[Ro(8),Io({padding:16,fallbackPlacements:["left-start","right-end","left-end","top-start","bottom-start"]}),Mo({padding:16})];let _=0,C=0;try{const b=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});_=b.x,C=b.y}catch(b){console.warn("[ContextMenu] Floating UI initial positioning error:",b);return}c.positions={position:"fixed",zIndex:"10001",left:`${_}px`,top:`${C}px`,opacity:"0",visibility:"visible",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},requestAnimationFrame(()=>{n.value&&(c.positions={...c.positions,opacity:"1",transform:"translateY(0)"})});const w=(b=>{const E=[];let x=b;for(;x&&x!==document.body&&x!==document.documentElement;){const O=window.getComputedStyle(x),$=O.overflow+O.overflowX+O.overflowY;($.includes("scroll")||$.includes("auto"))&&E.push(x),x=x.parentElement}return E})(n.value);a=[window,...w],s=()=>{c.active&&e.emitter.emit("vf-contextmenu-hide")};const S=s;S&&a.forEach(b=>{b===window?window.addEventListener("scroll",S,!0):b.addEventListener("scroll",S,!0)}),l=b=>{if(!c.active)return;const E=b.target;if(!E||n.value&&n.value.contains(E))return;const x=e.root;x&&x.contains(E)||e.emitter.emit("vf-contextmenu-hide")},setTimeout(()=>{l&&(document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0))},100),setTimeout(()=>{if(!(!n.value||!r))try{o=rc(r,n.value,async()=>{if(!(!r||!n.value))try{const{x:b,y:E}=await Zi(r,n.value,{placement:"right-start",strategy:"fixed",middleware:p});c.positions={...c.positions,left:`${b}px`,top:`${E}px`}}catch(b){console.warn("Floating UI positioning error:",b)}})}catch(b){console.warn("Floating UI autoUpdate setup error:",b),o=null}},200)};return Ct(()=>{o&&(o(),o=null),s&&(a.forEach(m=>{m===window?window.removeEventListener("scroll",s,!0):m.removeEventListener("scroll",s,!0)}),s=null,a=[]),l&&(document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),l=null),r=null}),(m,f)=>it((y(),T("ul",{ref_key:"contextmenu",ref:n,class:Ae([{"vuefinder__context-menu--active":c.active,"vuefinder__context-menu--inactive":!c.active},"vuefinder__context-menu"]),style:At(c.positions)},[(y(!0),T(Ie,null,He(c.items,p=>(y(),T("li",{key:p.title,class:"vuefinder__context-menu__item"},[p.link?(y(),T("a",{key:0,class:"vuefinder__context-menu__link",target:"_blank",href:u(p),download:u(p),onClick:f[0]||(f[0]=_=>v(e).emitter.emit("vf-contextmenu-hide"))},[g("span",null,L(p.title(v(e).i18n)),1)],8,$3)):(y(),T("div",{key:1,class:"vuefinder__context-menu__action",onClick:_=>d(p)},[g("span",null,L(p.title(v(e).i18n)),1)],8,k3))]))),128))],6)),[[Sn,c.active]])}}),A3={class:"vuefinder__status-bar__wrapper"},P3={class:"vuefinder__status-bar__storage"},R3=["title"],I3={class:"vuefinder__status-bar__storage-icon"},M3=["value"],F3=["value"],D3={class:"vuefinder__status-bar__info space-x-2"},L3={key:0},j3={key:1},z3={key:0,class:"vuefinder__status-bar__size"},N3={class:"vuefinder__status-bar__actions"},U3=Ce({__name:"Statusbar",setup(t){const e=je(),{t:n}=e.i18n,i=e.fs,o=Oe(i.sortedFiles),r=Oe(i.path),s=Oe(i.selectedCount),a=Oe(i.storages),l=Oe(i.selectedItems),c=Oe(i.path),u=_=>{const C=_.target.value;e.adapter.open(C+"://")},d=te(()=>!l.value||l.value.length===0?0:l.value.reduce((_,C)=>_+(C.file_size||0),0)),h=te(()=>a.value),m=te(()=>o.value),f=te(()=>s.value||0),p=te(()=>l.value||[]);return(_,C)=>(y(),T("div",A3,[g("div",P3,[g("div",{class:"vuefinder__status-bar__storage-container",title:v(n)("Storage")},[g("div",I3,[j(v(vu))]),g("select",{name:"vuefinder-media-selector",value:v(r).storage,class:"vuefinder__status-bar__storage-select",tabindex:"-1",onChange:u},[(y(!0),T(Ie,null,He(h.value,w=>(y(),T("option",{key:w,value:w},L(w),9,F3))),128))],40,M3),C[0]||(C[0]=g("span",{class:"vuefinder__status-bar__storage-caret","aria-hidden":"true"},null,-1))],8,R3),g("div",D3,[f.value===0?(y(),T("span",L3,L(m.value.length)+" "+L(v(n)("items")),1)):(y(),T("span",j3,[Ke(L(f.value)+" "+L(v(n)("selected"))+" ",1),d.value?(y(),T("span",z3,L(v(e).filesize(d.value)),1)):ue("",!0)]))])]),g("div",N3,[Ve(_.$slots,"actions",{path:v(c).path,count:f.value||0,selected:p.value})])]))}}),V3={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"};function B3(t,e){return y(),T("svg",V3,[...e[0]||(e[0]=[g("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),g("path",{d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m3.6 5.2a1 1 0 0 0-1.4.2L12 10.333 9.8 7.4a1 1 0 1 0-1.6 1.2l2.55 3.4-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2-2.933 2.2 2.933a1 1 0 0 0 1.6-1.2L13.25 12l2.55-3.4a1 1 0 0 0-.2-1.4"},null,-1)])])}const H3={render:B3};function s_(t,e){const n=t.findIndex(i=>i.path===e.path);n>-1?t[n]=e:t.push(e)}const q3={class:"vuefinder__folder-loader-indicator"},W3={key:1,class:"vuefinder__folder-loader-indicator--icon"},a_=Ce({__name:"FolderLoaderIndicator",props:Vp({storage:{},path:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=je(),i=ec(t,"modelValue"),o=H(!1);$e(()=>i.value,()=>r());const r=async()=>{o.value=!0;try{const s=(await n.adapter.list(e.path)).files.filter(a=>a.type==="dir");s_(n.treeViewData,{path:e.path,type:"dir",folders:s})}catch(s){Yt(s,"Failed to fetch subfolders")}finally{o.value=!1}};return(s,a)=>(y(),T("div",q3,[o.value?(y(),ne(v(Zs),{key:0,class:"vuefinder__folder-loader-indicator--loading"})):(y(),T("div",W3,[i.value?(y(),ne(v(Js),{key:0,class:"vuefinder__folder-loader-indicator--minus"})):ue("",!0),i.value?ue("",!0):(y(),ne(v(Xs),{key:1,class:"vuefinder__folder-loader-indicator--plus"}))]))]))}}),K3={key:0},Y3={class:"vuefinder__treesubfolderlist__no-folders"},G3={class:"vuefinder__treesubfolderlist__item-content"},Q3=["onClick"],X3=["title","onDblclick","onClick"],J3={class:"vuefinder__treesubfolderlist__item-icon"},Z3={class:"vuefinder__treesubfolderlist__subfolder"},ez={key:1,class:"vuefinder__treesubfolderlist__more-note"},tz=Ce({__name:"TreeSubfolderList",props:{storage:{},path:{}},setup(t){const e=je(),n=e.fs,i=ur(e,["vuefinder__drag-over"]),o=H({}),r=e.config,s=Oe(r.state),{t:a}=e.i18n,l=Oe(n.path),c=t,u=H(null),d=H(50);et(()=>{c.path===c.storage+"://"&&u.value&&hn(u.value,{scrollbars:{theme:"vf-scrollbars-theme"}})});const h=te(()=>{const w=e.treeViewData.find(S=>S.path===c.path)?.folders||[];return w.length>d.value?w.slice(0,d.value):w}),m=te(()=>e.treeViewData.find(w=>w.path===c.path)?.folders?.length||0),f=te(()=>m.value>d.value),p=te(()=>`${c.storage}://`),_=(w,S)=>w===S||w.startsWith(`${S}/`);$e(h,w=>{const S=s.value.expandTreeByDefault&&c.path===p.value,b=s.value.expandedTreePaths||[];w.forEach(E=>{const x=b.some(O=>_(O,E.path));(S||x)&&o.value[E.path]===void 0&&(o.value[E.path]=!0)})},{immediate:!0});const C=()=>{d.value+=50};return(w,S)=>{const b=Ue("TreeSubfolderList",!0);return y(),T("ul",{ref_key:"parentSubfolderList",ref:u,class:"vuefinder__treesubfolderlist__container"},[h.value.length?ue("",!0):(y(),T("li",K3,[g("div",Y3,L(v(a)("No folders")),1)])),(y(!0),T(Ie,null,He(h.value,E=>(y(),T("li",{key:E.path,class:"vuefinder__treesubfolderlist__item"},[g("div",G3,[g("div",{class:"vuefinder__treesubfolderlist__item-toggle",onClick:x=>o.value[E.path]=!o.value[E.path]},[j(a_,{modelValue:o.value[E.path],"onUpdate:modelValue":x=>o.value[E.path]=x,storage:t.storage,path:E.path},null,8,["modelValue","onUpdate:modelValue","storage","path"])],8,Q3),g("div",We({class:"vuefinder__treesubfolderlist__item-link",title:E.path},bn(v(i).events({...E,dir:E.path,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"}),!0),{onDblclick:x=>o.value[E.path]=!o.value[E.path],onClick:x=>v(e).adapter.open(E.path)}),[g("div",J3,[v(l)?.path===E.path?(y(),ne(v(gu),{key:0,class:"vuefinder__item-icon__folder--open"})):(y(),ne(v(zn),{key:1,class:"vuefinder__item-icon__folder"}))]),g("div",{class:Ae(["vuefinder__treesubfolderlist__item-text",{"vuefinder__treesubfolderlist__item-text--active":v(l).path===E.path}])},L(E.basename),3)],16,X3)]),g("div",Z3,[it(j(b,{storage:c.storage,path:E.path},null,8,["storage","path"]),[[Sn,o.value[E.path]]])])]))),128)),f.value?(y(),T("li",ez,[g("div",{class:"vuefinder__treesubfolderlist__load-more",onClick:C},L(v(a)("load more")),1)])):ue("",!0)],512)}}}),nz=Ce({__name:"TreeStorageItem",props:{storage:{}},setup(t){const e=je(),n=e.fs,i=e.config,o=t,r=Oe(i.state),s=te(()=>{const m=r.value.expandedTreePaths||[],f=`${o.storage}://`;return m.some(p=>p===f||p.startsWith(`${f}`))}),a=H(r.value.expandTreeByDefault||s.value),l=ur(e,["vuefinder__drag-over"]),c=Oe(n.path),u=te(()=>o.storage===c.value?.storage);$e(()=>({expandTreeByDefault:r.value.expandTreeByDefault,hasExpandedPathInStorage:s.value}),m=>{(m.expandTreeByDefault||m.hasExpandedPathInStorage)&&(a.value=!0)});const d={storage:o.storage,path:o.storage+"://",dir:o.storage+"://",type:"dir",basename:o.storage,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"};function h(m){m===c.value?.storage?a.value=!a.value:e.adapter.open(m+"://")}return(m,f)=>(y(),T(Ie,null,[g("div",{class:"vuefinder__treestorageitem__header",onClick:f[2]||(f[2]=p=>h(t.storage))},[g("div",We({class:["vuefinder__treestorageitem__info",u.value?"vuefinder__treestorageitem__info--active":""]},bn(v(l).events(d),!0)),[g("div",{class:Ae(["vuefinder__treestorageitem__icon",u.value?"vuefinder__treestorageitem__icon--active":""])},[j(v(vu))],2),g("div",null,L(t.storage),1)],16),g("div",{class:"vuefinder__treestorageitem__loader",onClick:f[1]||(f[1]=Ye(p=>a.value=!a.value,["stop"]))},[j(a_,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),storage:t.storage,path:t.storage+"://"},null,8,["modelValue","storage","path"])])]),it(j(tz,{storage:t.storage,path:t.storage+"://",class:"vuefinder__treestorageitem__subfolder"},null,8,["storage","path"]),[[Sn,a.value]])],64))}}),iz={class:"vuefinder__folder-indicator"},oz={class:"vuefinder__folder-indicator--icon"},rz=Ce({__name:"FolderIndicator",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=ec(t,"modelValue");return(n,i)=>(y(),T("div",iz,[g("div",oz,[e.value?(y(),ne(v(Js),{key:0,class:"vuefinder__folder-indicator--minus"})):ue("",!0),e.value?ue("",!0):(y(),ne(v(Xs),{key:1,class:"vuefinder__folder-indicator--plus"}))])]))}}),sz={key:0,class:"vuefinder__treeview__header"},az={class:"vuefinder__treeview__pinned-label"},lz={class:"vuefinder__treeview__pin-text text-nowrap"},cz={key:0,class:"vuefinder__treeview__pinned-list"},uz=["onClick"],dz=["title"],hz=["onClick"],pz={key:0},fz={class:"vuefinder__treeview__no-pinned"},mz=Ce({__name:"TreeView",setup(t){const e=je(),{enabled:n}=Tn(),{t:i}=e.i18n,{getStore:o,setStore:r}=e.storage,s=e.fs,a=e.config,l=Oe(a.state),c=Oe(s.sortedFiles),u=Oe(s.storages),d=te(()=>u.value||[]),h=Oe(s.path),m=ur(e,["vuefinder__drag-over"]),f=H(190),p=H(o("pinned-folders-opened",!0));$e(p,S=>r("pinned-folders-opened",S));const _=S=>{const b=a.get("pinnedFolders");a.set("pinnedFolders",b.filter(E=>E.path!==S.path))},C=S=>{const b=S.clientX,E=S.target.parentElement;if(!E)return;const x=E.getBoundingClientRect().width;E.classList.remove("transition-[width]"),E.classList.add("transition-none");const O=K=>{f.value=x+K.clientX-b,f.value<50&&(f.value=0,a.set("showTreeView",!1)),f.value>50&&a.set("showTreeView",!0)},$=()=>{const K=E.getBoundingClientRect();f.value=K.width,E.classList.add("transition-[width]"),E.classList.remove("transition-none"),window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",$)};window.addEventListener("mousemove",O),window.addEventListener("mouseup",$)},w=H(null);return et(()=>{w.value&&hn(w.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),$e(c,S=>{const b=S.filter(E=>E.type==="dir");s_(e.treeViewData,{path:h.value.path||"",folders:b.map(E=>({storage:E.storage,path:E.path,basename:E.basename,type:"dir"}))})}),(S,b)=>(y(),T(Ie,null,[g("div",{class:Ae(["vuefinder__treeview__overlay",v(l).showTreeView?"vuefinder__treeview__backdrop":"hidden"]),onClick:b[0]||(b[0]=E=>v(a).toggle("showTreeView"))},null,2),g("div",{style:At(v(l).showTreeView?"min-width:100px;max-width:75%; width: "+f.value+"px":"width: 0"),class:"vuefinder__treeview__container"},[g("div",{ref_key:"treeViewScrollElement",ref:w,class:"vuefinder__treeview__scroll"},[v(n)("pinned")?(y(),T("div",sz,[g("div",{class:"vuefinder__treeview__pinned-toggle",onClick:b[2]||(b[2]=E=>p.value=!p.value)},[g("div",az,[j(v(mu),{class:"vuefinder__treeview__pin-icon"}),g("div",lz,L(v(i)("Pinned Folders")),1)]),j(rz,{modelValue:p.value,"onUpdate:modelValue":b[1]||(b[1]=E=>p.value=E)},null,8,["modelValue"])]),p.value?(y(),T("ul",cz,[(y(!0),T(Ie,null,He(v(l).pinnedFolders,E=>(y(),T("li",{key:E.path,class:"vuefinder__treeview__pinned-item"},[g("div",We({class:"vuefinder__treeview__pinned-folder"},bn(v(m).events(E),!0),{onClick:x=>v(e).adapter.open(E.path)}),[v(h).path!==E.path?(y(),ne(v(zn),{key:0,class:"vuefinder__treeview__folder-icon vuefinder__item-icon__folder"})):ue("",!0),v(h).path===E.path?(y(),ne(v(gu),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__treeview__open-folder-icon"})):ue("",!0),g("div",{title:E.path,class:Ae(["vuefinder__treeview__folder-name",{"vuefinder__treeview__folder-name--active":v(h).path===E.path}])},L(E.basename),11,dz)],16,uz),g("div",{class:"vuefinder__treeview__remove-folder",onClick:x=>_(E)},[j(v(H3),{class:"vuefinder__treeview__remove-icon"})],8,hz)]))),128)),v(l).pinnedFolders.length?ue("",!0):(y(),T("li",pz,[g("div",fz,L(v(i)("No folders pinned")),1)]))])):ue("",!0)])):ue("",!0),(y(!0),T(Ie,null,He(d.value,E=>(y(),T("div",{key:E,class:"vuefinder__treeview__storage"},[j(nz,{storage:E},null,8,["storage"])]))),128))],512),g("div",{class:"vuefinder__treeview__resize-handle",onMousedown:C},null,32)],4)],64))}}),xt={new_folder:"new_folder",selectAll:"selectAll",pinFolder:"pinFolder",unpinFolder:"unpinFolder",delete:"delete",refresh:"refresh",preview:"preview",open:"open",openDir:"openDir",download:"download",archive:"archive",unarchive:"unarchive",rename:"rename",move:"move",copy:"copy",paste:"paste"};function vz(t){return t.items.length>1&&t.items.some(e=>e.path===t.target?.path)?"many":t.target?"one":"none"}function mt(t){const e=Object.assign({needsSearchQuery:!1},t);return(n,i)=>!(e.needsSearchQuery!==!!i.searchQuery||e.target!==void 0&&e.target!==vz(i)||e.targetType!==void 0&&e.targetType!==i.target?.type||e.mimeType!==void 0&&e.mimeType!==i.target?.mime_type||e.feature!==void 0&&!(n.features[e.feature]??!1))}function Eo(...t){return(e,n)=>t.some(i=>i(e,n))}function xo(...t){return(e,n)=>t.every(i=>i(e,n))}const l_=[{id:xt.openDir,title:({t})=>t("Open containing folder"),action:(t,e)=>{const n=e[0];n&&t.adapter.open(n.dir)},show:mt({target:"one",needsSearchQuery:!0}),order:10},{id:xt.refresh,title:({t})=>t("Refresh"),action:t=>{const e=t.fs;t.adapter.invalidateListQuery(e.path.get().path),t.adapter.open(e.path.get().path)},show:Eo(mt({target:"none"}),mt({target:"many"})),order:20},{id:xt.selectAll,title:({t})=>t("Select All"),action:t=>{t.fs.selectAll(t.selectionMode||"multiple")},show:(t,e)=>t.selectionMode==="multiple"&&mt({target:"none"})(t,e),order:30},{id:xt.new_folder,title:({t})=>t("New Folder"),action:t=>t.modal.open(Su),show:mt({target:"none",feature:"newfolder"}),order:40},{id:xt.open,title:({t})=>t("Open"),action:(t,e)=>{e[0]&&t.adapter.open(e[0].path)},show:mt({target:"one",targetType:"dir"}),order:50},{id:xt.pinFolder,title:({t})=>t("Pin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders"),o=i.concat(e.filter(r=>i.findIndex(s=>s.path===r.path)===-1));n.set("pinnedFolders",o)},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)===-1),order:60},{id:xt.unpinFolder,title:({t})=>t("Unpin Folder"),action:(t,e)=>{const n=t.config,i=n.get("pinnedFolders");n.set("pinnedFolders",i.filter(o=>!e.find(r=>r.path===o.path)))},show:xo(mt({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(n=>n.path===e.target?.path)!==-1),order:70},{id:xt.preview,title:({t})=>t("Preview"),action:(t,e)=>t.modal.open(cr,{storage:e[0]?.storage,item:e[0]}),show:xo(mt({target:"one",feature:"preview"}),(t,e)=>e.target?.type!=="dir"),order:80},{id:xt.download,link:(t,e)=>{if(e[0])return t.adapter.getDownloadUrl(e[0])},title:({t})=>t("Download"),action:()=>{},show:xo(mt({target:"one",feature:"download"}),(t,e)=>e.target?.type!=="dir"),order:90},{id:xt.rename,title:({t})=>t("Rename"),action:(t,e)=>t.modal.open(Qs,{items:e}),show:mt({target:"one",feature:"rename"}),order:100},{id:xt.move,title:({t})=>t("Move files"),action:(t,e)=>{const n=t.fs,i={storage:n.path.get().storage||"",path:n.path.get().path||"",type:"dir"};t.modal.open(uo,{items:{from:e,to:i}})},show:Eo(mt({target:"one",feature:"move"}),mt({target:"many",feature:"move"})),order:110},{id:xt.copy,title:({t})=>t("Copy"),action:(t,e)=>{e.length>0&&t.fs.setClipboard("copy",new Set(e.map(n=>n.path)))},show:Eo(mt({target:"one",feature:"copy"}),mt({target:"many",feature:"copy"})),order:120},{id:xt.paste,title:({t})=>t("Paste"),action:(t,e)=>{const n=t.fs.getClipboard();if(n?.items?.size>0){const i=t.fs.path.get();let o=i.path,r=i.storage;e.length===1&&e[0]?.type==="dir"&&(o=e[0].path,r=e[0].storage);const s={storage:r||"",path:o||"",type:"dir"};t.modal.open(n.type==="cut"?uo:yu,{items:{from:Array.from(n.items),to:s}})}},show:(t,e)=>t.features?.copy??!1?t.fs.getClipboard()?.items?.size>0:!1,order:130},{id:xt.archive,title:({t})=>t("Archive"),action:(t,e)=>t.modal.open(xu,{items:e}),show:Eo(mt({target:"many",feature:"archive"}),xo(mt({target:"one",feature:"archive"}),(t,e)=>e.target?.mime_type!=="application/zip")),order:140},{id:xt.unarchive,title:({t})=>t("Unarchive"),action:(t,e)=>t.modal.open(Eu,{items:e}),show:mt({target:"one",feature:"unarchive",mimeType:"application/zip"}),order:150},{id:xt.delete,title:({t})=>t("Delete"),action:(t,e)=>{t.modal.open(Gs,{items:e})},show:Eo(mt({feature:"delete",target:"one"}),mt({feature:"delete",target:"many"})),order:160}],gz=["data-theme"],_z={key:0,class:"vuefinder__external-drop-overlay vuefinder__external-drop-overlay--relative"},yz={class:"vuefinder__external-drop-message"},bz={class:"vuefinder__main__content"},wz=Ce({__name:"VueFinderView",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean},locale:{},contextMenuItems:{},selectionMode:{},selectionFilterType:{},selectionFilterMimeIncludes:{},onError:{type:Function},onSelect:{type:Function},onPathChange:{type:Function},onUploadComplete:{type:Function},onDeleteComplete:{type:Function},onNotify:{type:Function},onReady:{type:Function},onFileDclick:{type:Function},onFolderDclick:{type:Function},customUploader:{type:Function}},emits:["select","path-change","upload-complete","delete-complete","notify","error","ready","file-dclick","folder-dclick","update:locale"],setup(t,{emit:e}){const n=e,i=t,o=je(),r=In("root"),s=o.config;$e(()=>i.features,w=>{const S=jg(w);Object.keys(o.features).forEach(b=>{delete o.features[b]}),Object.assign(o.features,S)},{deep:!0});const a=o.fs,l=Oe(o.i18n.localeAtom),c=Oe(s.state),u=te(()=>{const w=c.value;return{"--vf-grid-item-width":`${w.gridItemWidth}px`,"--vf-grid-item-height":`${w.gridItemHeight}px`,"--vf-grid-item-gap":`${w.gridItemGap}px`,"--vf-grid-icon-size":`${w.gridIconSize}px`,"--vf-list-item-height":`${w.listItemHeight}px`,"--vf-list-item-gap":`${w.listItemGap}px`,"--vf-list-icon-size":`${w.listIconSize}px`}});E5();const{isDraggingExternal:d,handleDragEnter:h,handleDragOver:m,handleDragLeave:f,handleDrop:p}=x5();function _(w){a.setPath(w.dirname),s.get("persist")&&s.set("path",w.dirname),a.setReadOnly(w.read_only??!1),o.modal.close(),a.setFiles(w.files),a.clearSelection(),a.setSelectedCount(0),a.setStorages(w.storages)}o.adapter.onBeforeOpen=()=>{a.setLoading(!0)},o.adapter.onAfterOpen=w=>{_(w),a.setLoading(!1)},o.emitter.on("vf-upload-complete",w=>{n("upload-complete",w)}),o.emitter.on("vf-delete-complete",w=>{n("delete-complete",w)}),o.emitter.on("vf-notify",w=>{n("notify",w)}),o.emitter.on("vf-file-dclick",w=>{n("file-dclick",w)}),o.emitter.on("vf-folder-dclick",w=>{n("folder-dclick",w)}),$e(()=>i.config?.theme,w=>{w&&s.set("theme",v(w))},{immediate:!0}),$e(l,(w,S)=>{w!==S&&n("update:locale",String(w))},{immediate:!1}),et(()=>{o.root=r.value,$e(()=>s.get("path"),S=>{o.adapter.open(S)});const w=s.get("persist")?s.get("path"):s.get("initialPath")??"";a.setPath(w),o.adapter.open(w),a.path.listen(S=>{n("path-change",S.path)}),a.selectedItems.listen(S=>{n("select",S)}),n("ready")});const C=async w=>{const S=await p(w);S.length>0&&(o.modal.open(Cu),setTimeout(()=>{o.emitter.emit("vf-external-files-dropped",S.map(b=>b.file))},100))};return(w,S)=>(y(),T("div",{ref_key:"root",ref:r,tabindex:"0",class:Ae(["vuefinder vuefinder__main vuefinder__themer",{"vuefinder--dragging-external":v(d)}]),"data-theme":v(o).theme.current,style:At(u.value),onDragenter:S[2]||(S[2]=(...b)=>v(h)&&v(h)(...b)),onDragover:S[3]||(S[3]=(...b)=>v(m)&&v(m)(...b)),onDragleave:S[4]||(S[4]=(...b)=>v(f)&&v(f)(...b)),onDrop:C},[g("div",{class:Ae(v(o).theme.current),style:{height:"100%",width:"100%"}},[g("div",{class:Ae([v(c)?.fullScreen?"vuefinder__main__fixed":"vuefinder__main__relative","vuefinder__main__container"]),onMousedown:S[0]||(S[0]=b=>v(o).emitter.emit("vf-contextmenu-hide")),onTouchstart:S[1]||(S[1]=b=>v(o).emitter.emit("vf-contextmenu-hide"))},[v(d)?(y(),T("div",_z,[g("div",yz,L(v(o).i18n.t("Drag and drop the files/folders to here.")),1)])):ue("",!0),v(c).showMenuBar?(y(),ne(G4,{key:1})):ue("",!0),v(c).showToolbar?(y(),ne(XL,{key:2})):ue("",!0),j(zj),g("div",bz,[j(mz),j(T3,{"on-file-dclick":i.onFileDclick,"on-folder-dclick":i.onFolderDclick},{icon:we(b=>[Ve(w.$slots,"icon",wn(Jn(b)))]),_:3},8,["on-file-dclick","on-folder-dclick"])]),j(U3,null,{actions:we(b=>[Ve(w.$slots,"status-bar",wn(Jn(b)))]),_:3})],34),(y(),ne(ws,{to:"body"},[j(Up,{name:"fade"},{default:we(()=>[v(o).modal.visible?(y(),ne($t(v(o).modal.type),{key:0})):ue("",!0)]),_:1})])),j(O3,{items:v(l_)},null,8,["items"]),v(c).notificationsEnabled?(y(),ne(v(vk),{key:0,position:v(c).notificationPosition,duration:v(c).notificationDuration,"visible-toasts":v(c).notificationVisibleToasts,"rich-colors":v(c).notificationRichColors},null,8,["position","duration","visible-toasts","rich-colors"])):ue("",!0)],2)],46,gz))}}),Sz=Ce({__name:"VueFinderProvider",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean,default:!1},locale:{},contextMenuItems:{default:()=>l_},selectionMode:{default:"multiple"},selectionFilterType:{default:"both"},selectionFilterMimeIncludes:{default:()=>[]},onError:{},onSelect:{},onPathChange:{},onUploadComplete:{},onDeleteComplete:{},onNotify:{},onReady:{},onFileDclick:{},onFolderDclick:{},customUploader:{}},setup(t){const e=t,n=e.id??Ao(Ql);if(!n)throw new Error('VueFinderProvider requires an "id" prop.');const i=dI(e,Ao("VueFinderOptions")||{});return $e(()=>e.config,o=>{if(o){const r={};for(const s in o){const a=v(o[s]);a!==void 0&&(r[s]=a)}i.config.init(r)}},{deep:!0,immediate:!0}),$e(()=>e.locale,o=>{o&&i.i18n.localeAtom&&i.i18n.localeAtom.get()!==o&&i.i18n.localeAtom.set(o)},{immediate:!0}),KR(n,i),Hp(Ql,n),bs(()=>{YR(n)}),(o,r)=>(y(),ne(wz,wn(Jn(e)),{icon:we(s=>[Ve(o.$slots,"icon",wn(Jn(s)))]),"status-bar":we(s=>[Ve(o.$slots,"status-bar",wn(Jn(s)))]),_:3},16))}});function xN(t){const e=je(t),n=o=>o||e.fs.path.get().path||"",i=o=>{Array.isArray(o.files)&&e.fs.setFiles(o.files)};return{async refresh(){const o=e.fs.path.get().path||"";e.adapter.invalidateListQuery(o),await e.adapter.open(o)},async open(o){await e.adapter.open(o)},preview(o){const r=(e.fs.files.get()||[]).find(s=>s.path===o);!r||r.type!=="file"||e.modal.open(cr,{storage:r.storage,item:r})},notify(o,r){Bi(e,o,r)},getPath(){return e.fs.path.get().path||""},select(o){const r=new Set((e.fs.files.get()||[]).map(a=>a.path)),s=(o||[]).filter(a=>r.has(a));e.fs.setSelection(s)},selectOne(o){new Set((e.fs.files.get()||[]).map(r=>r.path)).has(o)&&e.fs.setSelection([o])},clearSelection(){e.fs.clearSelection()},getSelectedPaths(){return(e.fs.selectedItems.get()||[]).map(o=>o.path)},async createFolder(o,r){const s=await e.adapter.createFolder({path:n(r),name:o});i(s)},async createFile(o,r){const s=await e.adapter.createFile({path:n(r),name:o});i(s)},async delete(o,r){const s=n(r),a=new Map((e.fs.files.get()||[]).map(u=>[u.path,u])),l=(o||[]).map(u=>a.get(u)).filter(u=>!!u).map(u=>({path:u.path,type:u.type})),c=await e.adapter.delete({path:s,items:l});i(c)},async rename(o,r,s){const a=await e.adapter.rename({path:n(s),item:o,name:r});i(a)},async copy(o,r,s){const a=await e.adapter.copy({path:n(s),sources:o,destination:r});i(a)},async move(o,r,s){const a=await e.adapter.move({path:n(s),sources:o,destination:r});i(a)},getFiles(){return e.fs.files.get()||[]},getStorages(){return e.fs.storages.get()||[]},isLoading(){return e.fs.isLoading()},isReadOnly(){return e.fs.getReadOnly()}}}const Cz={install(t,e={}){e.i18n=e.i18n??{};const[n]=Object.keys(e.i18n);e.locale=e.locale??n??"en",t.provide("VueFinderOptions",e),t.component("VueFinder",Sz)}};function Ez(t){t.use(Cz,{i18n:{zhCN:()=>nt(()=>import("./zhCN-0_iHo67e.js"),[],import.meta.url),en:()=>nt(()=>import("./en-C_Tot-hO.js"),[],import.meta.url)}})}const xz=()=>{const{i18n:t}=bc;let e=!1,n=null,i=[];async function o(){return e&&n||(e=!0,n=(async()=>{try{return(await Oi.v1Token.tokencontrollerRefresh({headers:{[Ti]:wi.generateBearerToken(Fb())}})).code===0}catch(p){return console.error(p),!1}finally{e=!1,n=null}})()),n}async function r(p){return l(p)?(gr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog(),Promise.reject(t.global.t("message.error.loginExpired"))):new Promise((_,C)=>{i.push({resolve:_,reject:C,config:p}),e||o().then(w=>{w?i.forEach(({resolve:S,reject:b,config:E})=>{E.headers[si]=wi.generateBearerToken(is()),a(E),d.request(E).then(S).catch(b)}):(i.forEach(({reject:S})=>S(t.global.t("message.error.refreshFailed"))),gr.error(t.global.t("message.error.loginExpired")),Qi().logoutDialog()),i=[]})})}function s(p){return p.headers[vt.CSRF_TOKEN_HEADER_NAME]=pm.get(vt.CSRF_KEY),p.headers[si]=wi.generateBearerToken(is()),p.headers[vt.ACCEPT_LANGUAGE_HEADER_NAME]=t.global.locale.value,p}function a(p){p.headers["X-Token-Refreshed"]="true"}function l(p){return p.headers["X-Token-Refreshed"]==="true"}async function c(p){if(p.headers[si]){const _=wi.extractBearerToken(p.headers[si]);Ib(_),p.config.headers[si]=wi.generateBearerToken(_)}if(p.headers[Ti]){const _=wi.extractBearerToken(p.headers[Ti]);Db(_),p.config.headers[Ti]=wi.generateBearerToken(_)}if(p.data.code===zd.Unauthorized&&!p.config.url?.includes("/api/v1/token/refresh"))return r(p.config);if(p.data.code===zd.Forbidden)return Qi().logoutDialog(),Promise.reject(t.global.t("user.notLoggedIn"));if(p.data.code!==0){const _=p.data.message||t.global.t("message.error.requestFailed");return gr.error(_),Promise.reject(_)}return p.data}function u(p){return console.error(p),gr.error(p.message),Promise.reject(p)}const d=Nd(vt.REMOTE_SERVICE_PREFIX,{baseURL:`/${vt.REMOTE_SERVICE_PREFIX}`});d.interceptors.request.use(s,u),d.interceptors.response.use(c,u);const h=$b(),m=window.__GLOBAL_CONFIG__?.projectHash,f=Nd(vt.LOCAL_SERVICE_PREFIX,{baseURL:`${h}/${m}`});f.interceptors.request.use(s,u),f.interceptors.response.use(c,u)},c_=vi("setting",{state:()=>({dependencies:[],devDependencies:[],packageJson:{}}),getters:{vueVersion:t=>t.dependencies.find(e=>e.name==="vue")?.version||"",deps:t=>[...t.dependencies,...t.devDependencies],compHubVersion:()=>window.__GLOBAL_CONFIG__.version||""},actions:{setDependencies(t){this.$patch(e=>{e.dependencies=t})},setDevDependencies(t){this.$patch(e=>{e.devDependencies=t})},setPackageJson(t){this.$patch(e=>{e.packageJson=t})},async initSetting(){await this.fetchPackageJson(),await this.initPreviewSetting()},async fetchPackageJson(){await nC.v1Comp.compcontrollerPackagejson().then(t=>{const e=t.data?.packageJson??{};this.setPackageJson(e)})},async initPreviewSetting(){const t=Ji(Vb,{dependencies:[],devDependencies:[]}),{dependencies:e=[],devDependencies:n=[]}=t.value,i=Object.entries(this.packageJson?.dependencies??{}).map(([r,s])=>{const a=e.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}}),o=Object.entries(this.packageJson?.devDependencies??{}).map(([r,s])=>{const a=n.find(l=>l.name===r);return{name:r,version:s,match:a?.match??vt.COMP_MATCH_TYPE_MAJOR_VERSION}});t.value={dependencies:i,devDependencies:o},this.setDependencies(i),this.setDevDependencies(o)}}}),Tz=vi("upgrade",{state:()=>({upgradeInfo:{}}),getters:{isForceUpgrade:t=>t.upgradeInfo.hasUpgrade&&t.upgradeInfo.isForce,isUpgrade:t=>t.upgradeInfo.hasUpgrade,upgradeDesc:t=>t.upgradeInfo.desc,latestVersion:t=>t.upgradeInfo.latestVersion,hasUpgrade:t=>t.upgradeInfo.hasUpgrade},actions:{setUpgradeInfo(t){this.$patch(e=>{e.upgradeInfo=t})},async getUpgradeInfo(){if(Object.keys(this.upgradeInfo).length>0)return;const t=c_(),e=await Oi.v2Upgrade.upgradecontrollerv2Check({compHubVersion:t.compHubVersion});this.setUpgradeInfo(e.data)}}});var ns={exports:{}};var $z=ns.exports,Np;function kz(){return Np||(Np=1,(function(t,e){(function(n,i){t.exports=i()})($z,function(){var n={};n.version="0.2.0";var i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(f){var p,_;for(p in f)_=f[p],_!==void 0&&f.hasOwnProperty(p)&&(i[p]=_);return this},n.status=null,n.set=function(f){var p=n.isStarted();f=o(f,i.minimum,1),n.status=f===1?null:f;var _=n.render(!p),C=_.querySelector(i.barSelector),w=i.speed,S=i.easing;return _.offsetWidth,a(function(b){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),l(C,s(f,w,S)),f===1?(l(_,{transition:"none",opacity:1}),_.offsetWidth,setTimeout(function(){l(_,{transition:"all "+w+"ms linear",opacity:0}),setTimeout(function(){n.remove(),b()},w)},w)):setTimeout(b,w)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var f=function(){setTimeout(function(){n.status&&(n.trickle(),f())},i.trickleSpeed)};return i.trickle&&f(),this},n.done=function(f){return!f&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(f){var p=n.status;return p?(typeof f!="number"&&(f=(1-p)*o(Math.random()*p,.1,.95)),p=o(p+f,0,.994),n.set(p)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},(function(){var f=0,p=0;n.promise=function(_){return!_||_.state()==="resolved"?this:(p===0&&n.start(),f++,p++,_.always(function(){p--,p===0?(f=0,n.done()):n.set((f-p)/f)}),this)}})(),n.render=function(f){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var p=document.createElement("div");p.id="nprogress",p.innerHTML=i.template;var _=p.querySelector(i.barSelector),C=f?"-100":r(n.status||0),w=document.querySelector(i.parent),S;return l(_,{transition:"all 0 linear",transform:"translate3d("+C+"%,0,0)"}),i.showSpinner||(S=p.querySelector(i.spinnerSelector),S&&m(S)),w!=document.body&&u(w,"nprogress-custom-parent"),w.appendChild(p),p},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(i.parent),"nprogress-custom-parent");var f=document.getElementById("nprogress");f&&m(f)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var f=document.body.style,p="WebkitTransform"in f?"Webkit":"MozTransform"in f?"Moz":"msTransform"in f?"ms":"OTransform"in f?"O":"";return p+"Perspective"in f?"translate3d":p+"Transform"in f?"translate":"margin"};function o(f,p,_){return f<p?p:f>_?_:f}function r(f){return(-1+f)*100}function s(f,p,_){var C;return i.positionUsing==="translate3d"?C={transform:"translate3d("+r(f)+"%,0,0)"}:i.positionUsing==="translate"?C={transform:"translate("+r(f)+"%,0)"}:C={"margin-left":r(f)+"%"},C.transition="all "+p+"ms "+_,C}var a=(function(){var f=[];function p(){var _=f.shift();_&&_(p)}return function(_){f.push(_),f.length==1&&p()}})(),l=(function(){var f=["Webkit","O","Moz","ms"],p={};function _(b){return b.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,x){return x.toUpperCase()})}function C(b){var E=document.body.style;if(b in E)return b;for(var x=f.length,O=b.charAt(0).toUpperCase()+b.slice(1),$;x--;)if($=f[x]+O,$ in E)return $;return b}function w(b){return b=_(b),p[b]||(p[b]=C(b))}function S(b,E,x){E=w(E),b.style[E]=x}return function(b,E){var x=arguments,O,$;if(x.length==2)for(O in E)$=E[O],$!==void 0&&E.hasOwnProperty(O)&&S(b,O,$);else S(b,x[1],x[2])}})();function c(f,p){var _=typeof f=="string"?f:h(f);return _.indexOf(" "+p+" ")>=0}function u(f,p){var _=h(f),C=_+p;c(_,p)||(f.className=C.substring(1))}function d(f,p){var _=h(f),C;c(f,p)&&(C=_.replace(" "+p+" "," "),f.className=C.substring(1,C.length-1))}function h(f){return(" "+(f.className||"")+" ").replace(/\s+/gi," ")}function m(f){f&&f.parentNode&&f.parentNode.removeChild(f)}return n})})(ns)),ns.exports}var Oz=kz();const Zl=Di(Oz),{i18n:Az}=bc;function Pz(){no.beforeEach(async(t,e)=>{Zl.start();const n=Xo(),i=Qi(),o=c_(),r=Tz();if(t.path!==e.path&&(await o.initSetting(),await i.fetchCsrfToken(),await r.getUpgradeInfo()),r.isForceUpgrade&&!t.path.startsWith("/upgrade"))return{path:"/upgrade"};if(t.path===e.path&&t.fullPath!==e.fullPath)return;const s=n.visitedViews.find(l=>l.path===t.path);if(s){if(t.fullPath===s.fullPath)return;const{hash:l="",query:c={}}=t,{query:u={},hash:d=""}=s,h=ty(u);if(!t.redirectedFrom){const m={query:{...h,...c},hash:l||d};return{path:t.path,...m}}}if(i.isGuestLogin()||!i.isAccessTokenExist()){if(!t.meta.noAuth)return i.logoutDialog(),!1}else{if(t.meta.noAuth){if(t.path.startsWith("/login")){const l=t.query.type==="logout";if(i.isAccessTokenExist()&&!l)return"/"}else i.isRealUserLogin()||await i.fetchWhoAmI();return}if(i.isRealUserLogin()||await i.fetchWhoAmI(),!i.isRealUserLogin())return i.logoutDialog(),!1}}),no.afterEach(t=>{const e=t.meta.title;document.title=Az.global.t(e)||vt.SITE_TITLE,Zl.done()})}Zl.configure({easing:"ease",speed:500,showSpinner:!1,trickleSpeed:200,parent:"body"});async function Rz(t){await f$(),xz(),mm(t),vm(t),f2(t),F2(t),Pz(),L2(),V2(),p$(t),m$(t),v$(t),Ez(t)}async function Iz(){const t=ic(Ab);await Rz(t),t.mount("#app")}Iz();export{kE as A,Lw as B,Kz as C,Vb as D,vt as E,Tz as F,l_ as G,Jz as H,jb as I,Qi as J,tN as K,zz as L,Qz as M,Gz as N,Tb as O,Hz as R,Yz as S,Bz as T,Zz as V,nt as _,eN as a,Nz as b,Vz as c,Ug as d,jz as e,Y0 as f,Xz as g,Wz as h,qz as i,Uz as j,Ew as k,ac as l,Gb as m,bc as n,nN as o,xN as p,nC as q,Vw as r,Oi as s,Dz as t,yc as u,Lz as v,$b as w,TE as x,c_ as y,Xo as z};