@abtnode/webapp 1.16.28-beta-7ddc3b2d → 1.16.28

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 (166) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-i_eGmIkF.js → Add-B8Ae2MjM.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-CRJiMsxl.js → ArrowDropDown-BNt-WuI3.js} +1 -1
  5. package/dist/assets/{Autocomplete-BkNAtuyq.js → Autocomplete-Bo6UH2XL.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-D8UxFHZC.js → Breadcrumbs-CkmMkQDW.js} +1 -1
  7. package/dist/assets/{ButtonGroup-G7oFneKA.js → ButtonGroup-OcQcEz6r.js} +1 -1
  8. package/dist/assets/{CheckCircle-CpgwIoc6.js → CheckCircle-BnRenrK4.js} +1 -1
  9. package/dist/assets/{ChevronLeft-BqOWO5Oh.js → ChevronLeft-Dp9aa91c.js} +1 -1
  10. package/dist/assets/{ChevronRight-DDJkuJhV.js → ChevronRight-C3NPaw6o.js} +1 -1
  11. package/dist/assets/{Close-BltjIlg7.js → Close-Cbaq-RRq.js} +1 -1
  12. package/dist/assets/{Delete-KztH8pOq.js → Delete-CnrKsAGC.js} +1 -1
  13. package/dist/assets/DeleteOutline-B4LqoCK2.js +1 -0
  14. package/dist/assets/{Done-CEgWviUN.js → Done-BCLH1e-Y.js} +1 -1
  15. package/dist/assets/{Edit-jbcm5AKt.js → Edit-i_Bman7K.js} +1 -1
  16. package/dist/assets/{EditIcon-DAtBHTkl.js → EditIcon-DmNEjmIQ.js} +1 -1
  17. package/dist/assets/{FilterList-D84A-7C6.js → FilterList-fpG1-3KQ.js} +1 -1
  18. package/dist/assets/{Google-CCNGxrji.js → Google-DLkd6TAZ.js} +1 -1
  19. package/dist/assets/{Https-DsiZfUtZ.js → Https-amCzjB1a.js} +1 -1
  20. package/dist/assets/{InputAdornment-CfEcRXzS.js → InputAdornment-C6LFxcti.js} +1 -1
  21. package/dist/assets/{InputLabel-ERXbfftZ.js → InputLabel-avYwCvJM.js} +1 -1
  22. package/dist/assets/{LastPage-Cad46J9e.js → LastPage-DnBOlrut.js} +1 -1
  23. package/dist/assets/{Launch-fB5PS8PY.js → Launch-DPclIZbd.js} +1 -1
  24. package/dist/assets/{Link-Dzd80klt.js → Link-DfSEdivF.js} +1 -1
  25. package/dist/assets/{LoadingButton-hHC9D6Jh.js → LoadingButton-xveWP_M5.js} +1 -1
  26. package/dist/assets/{LockIcon-BgCC_gMD.js → LockIcon-9c7sG23a.js} +1 -1
  27. package/dist/assets/{Loop-BTQochTH.js → Loop-DwAWKPvc.js} +1 -1
  28. package/dist/assets/{MoreVert-CWypNP8g.js → MoreVert-Nc1QBj2D.js} +1 -1
  29. package/dist/assets/{Pagination-Btpup9Q2.js → Pagination-D5t0OCBH.js} +1 -1
  30. package/dist/assets/{Public-YuAmoyPx.js → Public-BLh26Bb9.js} +1 -1
  31. package/dist/assets/{SchemaReference.es-DbpM2rcO.js → SchemaReference.es--oFfd0mm.js} +1 -1
  32. package/dist/assets/{Search-uFerpv5L.js → Search-DnnCUnjB.js} +1 -1
  33. package/dist/assets/{Select-b09v8FPX.js → Select-CBA-xyOJ.js} +1 -1
  34. package/dist/assets/{Skeleton-zb5bXzJn.js → Skeleton-CQPjJHp3.js} +1 -1
  35. package/dist/assets/{Slider-Ct9swbug.js → Slider-Bdpm9oO4.js} +1 -1
  36. package/dist/assets/{Stepper-WgjnG7-H.js → Stepper-UEQaZPW7.js} +1 -1
  37. package/dist/assets/{TextField-BPO9Hci-.js → TextField-DjRhIjo4.js} +1 -1
  38. package/dist/assets/{ToggleButtonGroup-PBOhq3jx.js → ToggleButtonGroup-Drarswgi.js} +1 -1
  39. package/dist/assets/{ViewList-DiAWVo-f.js → ViewList-CoYI2XgO.js} +1 -1
  40. package/dist/assets/{actions-CS2Trs8B.js → actions-BAUfPsQv.js} +1 -1
  41. package/dist/assets/{actions-CYOQRhpw.js → actions-C1t0ka-G.js} +1 -1
  42. package/dist/assets/{agreement-Br53N-6_.js → agreement-_qYynElX.js} +1 -1
  43. package/dist/assets/api-xvCGCwMn.js +1 -0
  44. package/dist/assets/{app-avatar-BhPctNAT.js → app-avatar-DcgC0kB0.js} +1 -1
  45. package/dist/assets/{audit-logs-DTUtFnAK.js → audit-logs-BqT_1MLt.js} +1 -1
  46. package/dist/assets/{brace-fold.es-BSNAOfKd.js → brace-fold.es-CkrKXotH.js} +1 -1
  47. package/dist/assets/{bundle-avatar-CbU_wbB2.js → bundle-avatar-RiFaz1Hb.js} +1 -1
  48. package/dist/assets/{chart-BUxn7CWp.js → chart-Cinf5zq_.js} +1 -1
  49. package/dist/assets/{click-to-copy-BLqu2SLV.js → click-to-copy-Bj13kdln.js} +1 -1
  50. package/dist/assets/{closebrackets.es-DynJAn1e.js → closebrackets.es-C32XuxI5.js} +1 -1
  51. package/dist/assets/{codemirror.es-cljF5Vfg.js → codemirror.es-oms3GpFv.js} +1 -1
  52. package/dist/assets/{comment.es-CoFz2Oy_.js → comment.es-AVZXTIDr.js} +1 -1
  53. package/dist/assets/{config-navigation-DZx1cn4-.js → config-navigation-LFUjTzgk.js} +1 -1
  54. package/dist/assets/{delete-confirm-CcpxufKB.js → delete-confirm-BoeDYrYX.js} +1 -1
  55. package/dist/assets/{detail-CIhc9jZt.js → detail-CHKmnQLc.js} +3 -3
  56. package/dist/assets/{dialog.es-C6n3qH0v.js → dialog.es-DHZdXjGS.js} +1 -1
  57. package/dist/assets/{download-xUEvruKh.js → download-DFPnF7mz.js} +1 -1
  58. package/dist/assets/{foldgutter.es-C2zr_tXR.js → foldgutter.es-CSicbQSJ.js} +1 -1
  59. package/dist/assets/getValidReactChildren-GMOIXwRG.js +1 -0
  60. package/dist/assets/{hint.es-D0wd5c9g.js → hint.es-DAEQ9N76.js} +1 -1
  61. package/dist/assets/{hint.es2-DMsolbMA.js → hint.es2-DYXluLKu.js} +1 -1
  62. package/dist/assets/{iframe-n_w2gI30.js → iframe-DwuYX0Xq.js} +1 -1
  63. package/dist/assets/{index-xRBNy1in.js → index-0RUAEm49.js} +1 -1
  64. package/dist/assets/{index-C8pFKy9H.js → index-7J6TijHC.js} +1 -1
  65. package/dist/assets/{index-BBEuxxjq.js → index-9R6mPPbN.js} +1 -1
  66. package/dist/assets/{index-Cr1Psinm.js → index-B60jROHj.js} +2 -2
  67. package/dist/assets/{index-Chps_oCL.js → index-BBnT5XB9.js} +1 -1
  68. package/dist/assets/{index-H43aSOyt.js → index-BKck0oIO.js} +1 -1
  69. package/dist/assets/{index-BgG0evtj.js → index-BKi0XLcv.js} +1 -1
  70. package/dist/assets/{index-BOADFDIv.js → index-BVznp3M0.js} +1 -1
  71. package/dist/assets/{index-C2Cgygdk.js → index-BbS1Wq4p.js} +1 -1
  72. package/dist/assets/{index-BEQyLEKb.js → index-BbW2IRRR.js} +1 -1
  73. package/dist/assets/{index-yF_Q2_O-.js → index-BnFWpIPQ.js} +1 -1
  74. package/dist/assets/{index-CxaGo2hZ.js → index-ByF3apMm.js} +10 -10
  75. package/dist/assets/{index-Dvf0fvGe.js → index-CHjwpGia.js} +1 -1
  76. package/dist/assets/{index-DxX4hb7b.js → index-CIbzY-F7.js} +1 -1
  77. package/dist/assets/{index-zZFI1GlJ.js → index-CKOyruf_.js} +1 -1
  78. package/dist/assets/{index-DIuisRmH.js → index-CZKHzmkC.js} +1 -1
  79. package/dist/assets/{index-D3ulER0U.js → index-CiZAReVP.js} +1 -1
  80. package/dist/assets/{index-BLEzKgrJ.js → index-Cl2QG8J6.js} +1 -1
  81. package/dist/assets/{index-DS1JU_-_.js → index-CqcpZ8C3.js} +2 -2
  82. package/dist/assets/{index-BSqmsUTI.js → index-CtzAe2AR.js} +1 -1
  83. package/dist/assets/{index-Dl2hud6k.js → index-CucnV9EX.js} +1 -1
  84. package/dist/assets/{index-DCQd0BKE.js → index-CyYUysSv.js} +1 -1
  85. package/dist/assets/{index-DxGSDzwI.js → index-D5MDxbqt.js} +1 -1
  86. package/dist/assets/{index-BwD5fAbE.js → index-DHYJxTcV.js} +5 -5
  87. package/dist/assets/{index-CHBNQD8C.js → index-DKkTRBZn.js} +3 -3
  88. package/dist/assets/{index-JffoMuKt.js → index-DOsg2sHH.js} +1 -1
  89. package/dist/assets/{index-CLIK5uaQ.js → index-DPx9NPlp.js} +1 -1
  90. package/dist/assets/{index-B2PJyxbf.js → index-DSByvARI.js} +1 -1
  91. package/dist/assets/{index-DNSbmp0u.js → index-DU7hJgoO.js} +1 -1
  92. package/dist/assets/{index-BoHcyWvQ.js → index-DV2quTIn.js} +1 -1
  93. package/dist/assets/{index-DqdZ9FKF.js → index-DcU_Cijj.js} +1 -1
  94. package/dist/assets/{index-Db0xkYaW.js → index-DfNh08gP.js} +3 -3
  95. package/dist/assets/{index-DvtCtx64.js → index-DmPgcoiv.js} +1 -1
  96. package/dist/assets/{index-BtKnBn2o.js → index-DrWhB0MJ.js} +1 -1
  97. package/dist/assets/{index-RAfI5Ovd.js → index-DsUZ7uiP.js} +1 -1
  98. package/dist/assets/{index-DZdSy-Ha.js → index-ECk6dODK.js} +1 -1
  99. package/dist/assets/index-HOVCi07-.js +54 -0
  100. package/dist/assets/index-ZQu91rXz.js +21 -0
  101. package/dist/assets/{index-DitmQRsw.js → index-baq8DMtQ.js} +1 -1
  102. package/dist/assets/{index-B_u7mT5U.js → index-cmiUur_8.js} +1 -1
  103. package/dist/assets/{index-CCIbtRAj.js → index-rPqHtLu4.js} +1 -1
  104. package/dist/assets/{index-BR3eM8Lx.js → index-v2cqn0eS.js} +1 -1
  105. package/dist/assets/{index-CzXBr0fB.js → index-zFXZLqso.js} +1 -1
  106. package/dist/assets/{index.es-Bq5abo39.js → index.es-Dkh9ejMp.js} +1 -1
  107. package/dist/assets/{index.esm-DvG22D3z.js → index.esm-Hqw0Nfnx.js} +1 -1
  108. package/dist/assets/{info-addon.es-C24VfKdY.js → info-addon.es-5NmROke-.js} +1 -1
  109. package/dist/assets/{info.es-Bqu2hgxq.js → info.es-CsELEfUv.js} +1 -1
  110. package/dist/assets/{install-from-url-BsrxhAMw.js → install-from-url-DXGlT7R8.js} +1 -1
  111. package/dist/assets/{invitation-BMg6rGzW.js → invitation-CSNEw5oM.js} +1 -1
  112. package/dist/assets/{is-path-prefix-equal-PjyGugoV.js → is-path-prefix-equal-CoJozASB.js} +1 -1
  113. package/dist/assets/{isEqual-3iEl-twA.js → isEqual-BLnnfE4T.js} +1 -1
  114. package/dist/assets/{item-Yv551hqX.js → item-tD3jAfba.js} +1 -1
  115. package/dist/assets/{javascript.es-DqZLq1Ic.js → javascript.es-BIUhEWTj.js} +1 -1
  116. package/dist/assets/{jump-to-line.es-CUkkqFSr.js → jump-to-line.es-BQjWkUgo.js} +1 -1
  117. package/dist/assets/{jump.es-dT0NLpeH.js → jump.es-D8ZxFsmc.js} +1 -1
  118. package/dist/assets/{line-CG9AJRHJ.js → line-DW0juCGB.js} +3 -3
  119. package/dist/assets/{lint.es-BQv8s92u.js → lint.es-Dv2pWRyz.js} +1 -1
  120. package/dist/assets/{lint.es2-Bw5fcxch.js → lint.es2-CqGQ_rnk.js} +1 -1
  121. package/dist/assets/{lint.es3-CX_qCTWo.js → lint.es3-g58ofVJA.js} +1 -1
  122. package/dist/assets/{list-header-3UZEZSQm.js → list-header-tjKXNgOR.js} +1 -1
  123. package/dist/assets/{log-C6NBJs93.js → log-BFiA_Tyh.js} +1 -1
  124. package/dist/assets/{lottie-GpNsBU3J.js → lottie-yeTV0Y2m.js} +1 -1
  125. package/dist/assets/{matchbrackets.es-Kf3wI0kD.js → matchbrackets.es-B-Xj5H9Q.js} +1 -1
  126. package/dist/assets/{memory-CnY03W9t.js → memory-C7a59RsU.js} +1 -1
  127. package/dist/assets/{mode.es-DGRXJ00j.js → mode.es-BSNxo6gK.js} +1 -1
  128. package/dist/assets/{mode.es2-DtvaqXOt.js → mode.es2-C1LDwVOl.js} +1 -1
  129. package/dist/assets/{mode.es3-B8JtCbCV.js → mode.es3-C6-ZTyOk.js} +1 -1
  130. package/dist/assets/{onlineParser.es-ZkK82Jda.js → onlineParser.es-BzK7GlZv.js} +1 -1
  131. package/dist/assets/{overview-BUJYpj1Q.js → overview-BlWFlRx2.js} +1 -1
  132. package/dist/assets/{react-BjVyu04q.js → react-1fE0Sobf.js} +3 -3
  133. package/dist/assets/{redux-gonzvYQ4.js → redux-hfExDDyr.js} +1 -1
  134. package/dist/assets/{resource-dialog-DO7gkp11.js → resource-dialog-DinbvH2C.js} +1 -1
  135. package/dist/assets/{runtime-BtNyIENm.js → runtime-tAjj0dmb.js} +1 -1
  136. package/dist/assets/{search.es-B_DIO3P6.js → search.es-DxfjuUNu.js} +1 -1
  137. package/dist/assets/{searchcursor.es-DSbkhPIa.js → searchcursor.es-C0Z2DY1c.js} +1 -1
  138. package/dist/assets/service-1GhnQw9a.js +1 -0
  139. package/dist/assets/{show-hint.es-DNIrnFs-.js → show-hint.es-q24U0q_A.js} +1 -1
  140. package/dist/assets/{slicedToArray-CjyU228M.js → slicedToArray-CYGiqzmA.js} +1 -1
  141. package/dist/assets/{spaces-BSCd0GtL.js → spaces-C58gy1rM.js} +1 -1
  142. package/dist/assets/{sublime.es-PWDR4BS_.js → sublime.es-BffqyCoy.js} +1 -1
  143. package/dist/assets/{switch-control-C8El4PwO.js → switch-control-CuPWIx6T.js} +1 -1
  144. package/dist/assets/{table-icons-DwX90JdI.js → table-icons-DOOoyljy.js} +2 -2
  145. package/dist/assets/{tag-Cvwm2gDk.js → tag-Cxx1sXPF.js} +1 -1
  146. package/dist/assets/{team-N6DYcIw9.js → team-BynFP1rM.js} +1 -1
  147. package/dist/assets/{toUpper-psJiJObX.js → toUpper-mYvRPeiI.js} +1 -1
  148. package/dist/assets/{traffic-CQiojOw9.js → traffic-D03HdfGL.js} +1 -1
  149. package/dist/assets/{url-evaluation-DjVe9I2g.js → url-evaluation-dheoi_Nj.js} +1 -1
  150. package/dist/assets/{url-join-D1xrWbhs.js → url-join-DMIMYkEk.js} +1 -1
  151. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-IAC6QCQz.js → use-blocklet-info-for-connect-did-spaces-DWywlTbc.js} +1 -1
  152. package/dist/assets/{useLocalStorage-CcTbqaWM.js → useLocalStorage-C3GQNaV2.js} +1 -1
  153. package/dist/assets/{util-_4tqOqNO.js → util-cf4pvQDW.js} +1 -1
  154. package/dist/assets/{wait-container-4d4Uc1iI.js → wait-container-BwlRhWl0.js} +1 -1
  155. package/dist/assets/{withStyles-BiL7OyyA.js → withStyles-BkcRLEgx.js} +1 -1
  156. package/dist/assets/{wrap-locale-b15Mq8e0.js → wrap-locale-BqGpRCMA.js} +1 -1
  157. package/dist/index.html +1 -1
  158. package/dist/service-worker.js +1 -1
  159. package/package.json +1 -1
  160. package/dist/assets/DeleteOutline-Cwej9e35.js +0 -1
  161. package/dist/assets/DeleteOutline-DvFRqyWQ.js +0 -1
  162. package/dist/assets/api-UFWd_s1k.js +0 -1
  163. package/dist/assets/getValidReactChildren-7IUHA6fR.js +0 -1
  164. package/dist/assets/index-D9E6SEa0.js +0 -21
  165. package/dist/assets/index-DPGMTLlW.js +0 -54
  166. package/dist/assets/service-B4g9jUew.js +0 -1
@@ -1,4 +1,4 @@
1
- import{C}from"./codemirror.es-cljF5Vfg.js";import"./show-hint.es-DNIrnFs-.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-BwD5fAbE.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-ZkK82Jda.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-DS1JU_-_.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
1
+ import{C}from"./codemirror.es-oms3GpFv.js";import"./show-hint.es-q24U0q_A.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-DHYJxTcV.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es-BzK7GlZv.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-CqcpZ8C3.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
2
2
  $1
3
3
  }`,Ce=T(t=>{const r=t.type;return F(r)||w(r)&&F(r.ofType)||Ne(r)&&(F(r.ofType)||w(r.ofType)&&F(r.ofType.ofType))?R:null},"getInsertText");function te(t,r,i){var n;if(r.parentType){const e=r.parentType;let l=[];return"getFields"in e&&(l=N(e.getFields())),F(e)&&l.push(fe),e===((n=i==null?void 0:i.schema)===null||n===void 0?void 0:n.getQueryType())&&l.push(Te,ge),I(t,l.map((o,u)=>{var s;const c={sortText:String(u)+o.name,label:o.name,detail:String(o.type),documentation:(s=o.description)!==null&&s!==void 0?s:void 0,deprecated:!!o.deprecationReason,isDeprecated:!!o.deprecationReason,deprecationReason:o.deprecationReason,kind:m.Field,type:o.type},p=Ce(o);return p&&(c.insertText=o.name+p,c.insertTextFormat=Ee.Snippet,c.command=ee),c}))}return[]}T(te,"getSuggestionsForFieldNames");function ie(t,r,i,n){const e=A(r.inputType),l=B(i,n,t).filter(o=>o.detail===e.name);if(e instanceof H){const o=e.getValues();return I(t,o.map(u=>{var s;return{label:u.name,detail:String(e),documentation:(s=u.description)!==null&&s!==void 0?s:void 0,deprecated:!!u.deprecationReason,isDeprecated:!!u.deprecationReason,deprecationReason:u.deprecationReason,kind:m.EnumMember,type:e}}).concat(l))}else if(e===O)return I(t,l.concat([{label:"true",detail:String(O),documentation:"Not false.",kind:m.Variable,type:O},{label:"false",detail:String(O),documentation:"Not true.",kind:m.Variable,type:O}]));return l}T(ie,"getSuggestionsForInputValues");function re(t,r,i,n,e){if(r.needsSeparator)return[];const l=i.getTypeMap(),o=N(l).filter(me),u=o.map(({name:d})=>d),s=new Set;M(n,(d,f)=>{var v,D,_,b,y;if(f.name&&(f.kind===a.INTERFACE_DEF&&!u.includes(f.name)&&s.add(f.name),f.kind===a.NAMED_TYPE&&((v=f.prevState)===null||v===void 0?void 0:v.kind)===a.IMPLEMENTS)){if(e.interfaceDef){if((D=e.interfaceDef)===null||D===void 0?void 0:D.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(_=e.interfaceDef)===null||_===void 0?void 0:_.toConfig();e.interfaceDef=new P(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}else if(e.objectTypeDef){if((b=e.objectTypeDef)===null||b===void 0?void 0:b.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(y=e.objectTypeDef)===null||y===void 0?void 0:y.toConfig();e.objectTypeDef=new z(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}}});const c=e.interfaceDef||e.objectTypeDef,g=((c==null?void 0:c.getInterfaces())||[]).map(({name:d})=>d),S=o.concat([...s].map(d=>({name:d}))).filter(({name:d})=>d!==(c==null?void 0:c.name)&&!g.includes(d));return I(t,S.map(d=>{const f={label:d.name,kind:m.Interface,type:d};return d!=null&&d.description&&(f.documentation=d.description),f}))}T(re,"getSuggestionsForImplements");function ae(t,r,i,n){let e;if(r.parentType)if(ve(r.parentType)){const l=Se(r.parentType),o=i.getPossibleTypes(l),u=Object.create(null);o.forEach(s=>{s.getInterfaces().forEach(c=>{u[c.name]=c})}),e=o.concat(N(u))}else e=[r.parentType];else{const l=i.getTypeMap();e=N(l).filter(F)}return I(t,e.map(l=>{const o=A(l);return{label:String(l),documentation:(o==null?void 0:o.description)||"",kind:m.Field}}))}T(ae,"getSuggestionsForFragmentTypeConditions");function oe(t,r,i,n,e){if(!n)return[];const l=i.getTypeMap(),o=W(t.state),u=se(n);e&&e.length>0&&u.push(...e);const s=u.filter(c=>l[c.typeCondition.name.value]&&!(o&&o.kind===a.FRAGMENT_DEFINITION&&o.name===c.name.value)&&F(r.parentType)&&F(l[c.typeCondition.name.value])&&ye(i,r.parentType,l[c.typeCondition.name.value]));return I(t,s.map(c=>({label:c.name.value,detail:String(l[c.typeCondition.name.value]),documentation:`fragment ${c.name.value} on ${c.typeCondition.name.value}`,kind:m.Field,type:l[c.typeCondition.name.value]})))}T(oe,"getSuggestionsForFragmentSpread");const Re=T((t,r)=>{var i,n,e,l,o,u,s,c,p,g;if(((i=t.prevState)===null||i===void 0?void 0:i.kind)===r)return t.prevState;if(((e=(n=t.prevState)===null||n===void 0?void 0:n.prevState)===null||e===void 0?void 0:e.kind)===r)return t.prevState.prevState;if(((u=(o=(l=t.prevState)===null||l===void 0?void 0:l.prevState)===null||o===void 0?void 0:o.prevState)===null||u===void 0?void 0:u.kind)===r)return t.prevState.prevState.prevState;if(((g=(p=(c=(s=t.prevState)===null||s===void 0?void 0:s.prevState)===null||c===void 0?void 0:c.prevState)===null||p===void 0?void 0:p.prevState)===null||g===void 0?void 0:g.kind)===r)return t.prevState.prevState.prevState.prevState},"getParentDefinition");function B(t,r,i){let n=null,e;const l=Object.create({});return M(t,(o,u)=>{if((u==null?void 0:u.kind)===a.VARIABLE&&u.name&&(n=u.name),(u==null?void 0:u.kind)===a.NAMED_TYPE&&n){const s=Re(u,a.TYPE);s!=null&&s.type&&(e=r.getType(s==null?void 0:s.type))}n&&e&&(l[n]||(l[n]={detail:e.toString(),insertText:i.string==="$"?n:"$"+n,label:n,type:e,kind:m.Variable},n=null,e=null))}),N(l)}T(B,"getVariableCompletions");function se(t){const r=[];return M(t,(i,n)=>{n.kind===a.FRAGMENT_DEFINITION&&n.name&&n.type&&r.push({kind:a.FRAGMENT_DEFINITION,name:{kind:Y.NAME,value:n.name},selectionSet:{kind:a.SELECTION_SET,selections:[]},typeCondition:{kind:a.NAMED_TYPE,name:{kind:Y.NAME,value:n.type}}})}),r}T(se,"getFragmentDefinitions");function le(t,r,i){const n=r.getTypeMap(),e=N(n).filter(Ie);return I(t,e.map(l=>({label:l.name,documentation:l.description,kind:m.Variable})))}T(le,"getSuggestionsForVariableDefinition");function ce(t,r,i,n){var e;if(!((e=r.prevState)===null||e===void 0)&&e.kind){const l=i.getDirectives().filter(o=>de(r.prevState,o));return I(t,l.map(o=>({label:o.name,documentation:o.description||"",kind:m.Function})))}return[]}T(ce,"getSuggestionsForDirective");function ue(t,r){let i=null,n=null,e=null;const l=M(t,(o,u,s,c)=>{if(c===r.line&&o.getCurrentPosition()>=r.character)return i=s,n=Object.assign({},u),e=o.current(),"BREAK"});return{start:l.start,end:l.end,string:e||l.string,state:n||l.state,style:i||l.style}}T(ue,"getTokenAtPosition");function M(t,r){const i=t.split(`
4
4
  `),n=Oe();let e=n.startState(),l="",o=new Q("");for(let u=0;u<i.length;u++){for(o=new Q(i[u]);!o.eol()&&(l=n.token(o,e),r(o,e,l,u)!=="BREAK"););r(o,e,l,u),e.kind||(e=n.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:e,style:l}}T(M,"runOnlineParser");function de(t,r){var i;if(!t||!t.kind)return!1;const n=t.kind,e=r.locations;switch(n){case a.QUERY:return e.indexOf(E.QUERY)!==-1;case a.MUTATION:return e.indexOf(E.MUTATION)!==-1;case a.SUBSCRIPTION:return e.indexOf(E.SUBSCRIPTION)!==-1;case a.FIELD:case a.ALIASED_FIELD:return e.indexOf(E.FIELD)!==-1;case a.FRAGMENT_DEFINITION:return e.indexOf(E.FRAGMENT_DEFINITION)!==-1;case a.FRAGMENT_SPREAD:return e.indexOf(E.FRAGMENT_SPREAD)!==-1;case a.INLINE_FRAGMENT:return e.indexOf(E.INLINE_FRAGMENT)!==-1;case a.SCHEMA_DEF:return e.indexOf(E.SCHEMA)!==-1;case a.SCALAR_DEF:return e.indexOf(E.SCALAR)!==-1;case a.OBJECT_TYPE_DEF:return e.indexOf(E.OBJECT)!==-1;case a.FIELD_DEF:return e.indexOf(E.FIELD_DEFINITION)!==-1;case a.INTERFACE_DEF:return e.indexOf(E.INTERFACE)!==-1;case a.UNION_DEF:return e.indexOf(E.UNION)!==-1;case a.ENUM_DEF:return e.indexOf(E.ENUM)!==-1;case a.ENUM_VALUE:return e.indexOf(E.ENUM_VALUE)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_OBJECT)!==-1;case a.INPUT_VALUE_DEF:switch((i=t.prevState)===null||i===void 0?void 0:i.kind){case a.ARGUMENTS_DEF:return e.indexOf(E.ARGUMENT_DEFINITION)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_FIELD_DEFINITION)!==-1}}return!1}T(de,"canUseDirective");function pe(t,r){let i,n,e,l,o,u,s,c,p,g,S;return j(r,d=>{var f;switch(d.kind){case a.QUERY:case"ShortQuery":g=t.getQueryType();break;case a.MUTATION:g=t.getMutationType();break;case a.SUBSCRIPTION:g=t.getSubscriptionType();break;case a.INLINE_FRAGMENT:case a.FRAGMENT_DEFINITION:d.type&&(g=t.getType(d.type));break;case a.FIELD:case a.ALIASED_FIELD:{!g||!d.name?o=null:(o=p?V(t,p,d.name):null,g=o?o.type:null);break}case a.SELECTION_SET:p=A(g);break;case a.DIRECTIVE:e=d.name?t.getDirective(d.name):null;break;case a.INTERFACE_DEF:d.name&&(s=null,S=new P({name:d.name,interfaces:[],fields:{}}));break;case a.OBJECT_TYPE_DEF:d.name&&(S=null,s=new z({name:d.name,interfaces:[],fields:{}}));break;case a.ARGUMENTS:{if(!d.prevState)n=null;else switch(d.prevState.kind){case a.FIELD:n=o&&o.args;break;case a.DIRECTIVE:n=e&&e.args;break;case a.ALIASED_FIELD:{const y=(f=d.prevState)===null||f===void 0?void 0:f.name;if(!y){n=null;break}const L=p?V(t,p,y):null;if(!L){n=null;break}n=L.args;break}default:n=null;break}break}case a.ARGUMENT:if(n){for(let y=0;y<n.length;y++)if(n[y].name===d.name){i=n[y];break}}u=i==null?void 0:i.type;break;case a.ENUM_VALUE:const v=A(u);l=v instanceof H?v.getValues().find(y=>y.value===d.name):null;break;case a.LIST_VALUE:const D=_e(u);u=D instanceof Ae?D.ofType:null;break;case a.OBJECT_VALUE:const _=A(u);c=_ instanceof be?_.getFields():null;break;case a.OBJECT_FIELD:const b=d.name&&c?c[d.name]:null;u=b==null?void 0:b.type;break;case a.NAMED_TYPE:d.name&&(g=t.getType(d.name));break}}),{argDef:i,argDefs:n,directiveDef:e,enumValue:l,fieldDef:o,inputType:u,objectFieldDefs:c,parentType:p,type:g,interfaceDef:S,objectTypeDef:s}}T(pe,"getTypeInfo");C.registerHelper("hint","graphql",(t,r)=>{const i=r.schema;if(!i)return;const n=t.getCursor(),e=t.getTokenAt(n),l=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,o=new ke(n.line,l),s={list:ne(i,t.getValue(),o,e,r.externalFragments).map(c=>({text:c.label,type:c.type,description:c.documentation,isDeprecated:c.isDeprecated,deprecationReason:c.deprecationReason})),from:{line:n.line,ch:l},to:{line:n.line,ch:e.end}};return s!=null&&s.list&&s.list.length>0&&(s.from=C.Pos(s.from.line,s.from.ch),s.to=C.Pos(s.to.line,s.to.ch),C.signal(t,"hasCompletion",t,s,e)),s});
@@ -1 +1 @@
1
- import{C as u}from"./codemirror.es-cljF5Vfg.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-BwD5fAbE.js";import"./index-DS1JU_-_.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
1
+ import{C as u}from"./codemirror.es-oms3GpFv.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-DHYJxTcV.js";import"./index-CqcpZ8C3.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
@@ -1 +1 @@
1
- import{go as x,ba as E}from"./index-DS1JU_-_.js";const L=({url:o,allowFullScreen:r,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||o,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
1
+ import{go as x,ba as E}from"./index-CqcpZ8C3.js";const L=({url:o,allowFullScreen:r,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||o,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
@@ -1,4 +1,4 @@
1
- import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-DS1JU_-_.js";import{_ as se}from"./useLocalStorage-CcTbqaWM.js";import{g as _e,D as Fe}from"./index-DIuisRmH.js";import{E as Ne}from"./index-BSqmsUTI.js";import{u as $e,B as oe}from"./url-evaluation-DjVe9I2g.js";import{D as Ue,u as Me,B as ne}from"./actions-CYOQRhpw.js";import{l as le}from"./index-BOADFDIv.js";import{W as Oe}from"./tag-Cvwm2gDk.js";import{I as We,B as ze}from"./install-from-url-BsrxhAMw.js";import{B as ae}from"./app-avatar-BhPctNAT.js";import{d as Ve}from"./Add-i_eGmIkF.js";import{S as E}from"./index-zZFI1GlJ.js";import{T as re}from"./TextField-BPO9Hci-.js";import{F as qe,S as Ke}from"./Select-b09v8FPX.js";import"./FilterList-D84A-7C6.js";import"./Delete-KztH8pOq.js";import"./InputLabel-ERXbfftZ.js";import"./LastPage-Cad46J9e.js";import"./index-DitmQRsw.js";import"./redux-gonzvYQ4.js";import"./Search-uFerpv5L.js";import"./MoreVert-CWypNP8g.js";import"./ButtonGroup-G7oFneKA.js";import"./getValidReactChildren-7IUHA6fR.js";import"./isEqual-3iEl-twA.js";import"./index-BgG0evtj.js";import"./Stepper-WgjnG7-H.js";function N({blocklet:g,skipAccessibilityCheck:c=!1,...p}){const{t:a}=w.useContext(ge),{urls:C,loading:o,recommendedUrl:m}=$e(g);if(o&&!c)return e.jsx(V,{size:12,...p});const x=c?C[0]:m;return x?e.jsx(He,{...p,children:e.jsx(Qe,{children:e.jsx(ke,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:a("common.open")})})}):a("blocklet.router.noAccessibleUrl")}const Qe=$.div`
1
+ import{n as $,P,r as w,f as ge,j as e,C as V,i as ke,u as me,q,t as je,v as ye,D as Ce,B as W,w as ve,m as L,x as Se,y as Be,z as de,A as z,E as we,d as Ae,F as De,H as Te,J as ee,K as Ee,M as T,N as te,O as y,Q as Ie,R as F,S as Le,U as Pe,V as Re}from"./index-CqcpZ8C3.js";import{_ as se}from"./useLocalStorage-C3GQNaV2.js";import{g as _e,D as Fe}from"./index-CZKHzmkC.js";import{E as Ne}from"./index-CtzAe2AR.js";import{u as $e,B as oe}from"./url-evaluation-dheoi_Nj.js";import{D as Ue,u as Me,B as ne}from"./actions-C1t0ka-G.js";import{l as le}from"./index-BVznp3M0.js";import{W as Oe}from"./tag-Cxx1sXPF.js";import{I as We,B as ze}from"./install-from-url-DXGlT7R8.js";import{B as ae}from"./app-avatar-DcgC0kB0.js";import{d as Ve}from"./Add-B8Ae2MjM.js";import{S as E}from"./index-CKOyruf_.js";import{T as re}from"./TextField-DjRhIjo4.js";import{F as qe,S as Ke}from"./Select-CBA-xyOJ.js";import"./FilterList-fpG1-3KQ.js";import"./Delete-CnrKsAGC.js";import"./InputLabel-avYwCvJM.js";import"./LastPage-DnBOlrut.js";import"./index-baq8DMtQ.js";import"./redux-hfExDDyr.js";import"./Search-DnnCUnjB.js";import"./MoreVert-Nc1QBj2D.js";import"./ButtonGroup-OcQcEz6r.js";import"./getValidReactChildren-GMOIXwRG.js";import"./isEqual-BLnnfE4T.js";import"./index-BKi0XLcv.js";import"./Stepper-UEQaZPW7.js";function N({blocklet:g,skipAccessibilityCheck:c=!1,...p}){const{t:a}=w.useContext(ge),{urls:C,loading:o,recommendedUrl:m}=$e(g);if(o&&!c)return e.jsx(V,{size:12,...p});const x=c?C[0]:m;return x?e.jsx(He,{...p,children:e.jsx(Qe,{children:e.jsx(ke,{href:x,target:"_blank",className:"blocklet-interface",underline:"hover",children:a("common.open")})})}):a("blocklet.router.noAccessibleUrl")}const Qe=$.div`
2
2
  display: flex;
3
3
  margin: 4px 0;
4
4
  `,He=$.div`
@@ -1,4 +1,4 @@
1
- import{P as o,s as C,j as n,O as u,aK as x,aL as g,bb as j,q as T}from"./index-DS1JU_-_.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
1
+ import{P as o,s as C,j as n,O as u,aK as x,aL as g,bb as j,q as T}from"./index-CqcpZ8C3.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
2
2
  box-sizing: border-box;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-DS1JU_-_.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-BgG0evtj.js";import{C as I}from"./click-to-copy-BLqu2SLV.js";import{w as ie}from"./withStyles-BiL7OyyA.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
1
+ import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-CqcpZ8C3.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-BKi0XLcv.js";import{C as I}from"./click-to-copy-Bj13kdln.js";import{w as ie}from"./withStyles-BkcRLEgx.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
2
2
  border-left: 1px solid ${n=>n.theme.typography.color.main};
3
3
  padding: 10px 0 10px 16px;
4
4
  @media (max-width: ${n=>n.theme.breakpoints.values.sm}px) {
@@ -1,4 +1,4 @@
1
- import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J,r as f,f as Ce,bp as Je,b as X,M as O,aO as _n,U as Ot,cd as Me,n as F,K as Z,gG as Vo,bH as Fe,aW as ue,aV as ht,aC as Mt,a2 as $,D as gt,F as D,bn as _o,Y as Ke,$ as Wn,a$ as Wo,fD as Ho,fE as Yo,C as re,f8 as Jo,y as po,av as dt,a1 as we,x as Ft,hv as Ko,hw as Qo,B as ne,bb as uo,H as _t,hx as Zo,m as ee,a3 as Xo,ez as $o,W as mo,Z as fo,ak as es,w as ts,J as ho,Q as He,V as ns,hy as go,S as ge,az as os,aA as ss,aB as rs,i as xt,hz as is,cz as as,bg as ls,h6 as cs,hA as ds,ay as Hn,cx as ps,ad as Ge,aJ as xo,bJ as Wt,cf as us,hB as ms,b6 as fs,z as hs,aX as Gt,T as gs,aN as Ye,at as Bt,dE as xs,bq as yo,aF as ys,fP as Pe,dM as Cs,hC as js,ge as Yn,hD as Jn,gg as Kn,aY as vs,G as at,gi as Ss,bI as bs}from"./index-DS1JU_-_.js";import{d as Rs}from"./Add-i_eGmIkF.js";import{a as Es,R as ct,F as Ts,L as ws,d as Ht,b as Yt}from"./line-CG9AJRHJ.js";import{C as Ps,A as Is,d as ks}from"./agreement-Br53N-6_.js";import{E as Us}from"./index-BSqmsUTI.js";import{b as Ds,a as Bs,c as Ns,u as Jt,e as As}from"./actions-CYOQRhpw.js";import{S as Ls}from"./switch-control-C8El4PwO.js";import{u as Os}from"./detail-CIhc9jZt.js";import{d as Co}from"./Edit-jbcm5AKt.js";import{T as Ms}from"./index-DxX4hb7b.js";import{T as Fs,M as Gs,t as zs}from"./table-icons-DwX90JdI.js";import{C as Qn}from"./click-to-copy-BLqu2SLV.js";import{T as K}from"./TextField-BPO9Hci-.js";import{d as Kt}from"./Link-Dzd80klt.js";import{c as qs,C as Vs,a as _s,b as Ws,D as Hs,A as Ys,B as Js,d as Ks,S as Qs}from"./item-Yv551hqX.js";import{u as Zs,a as Xs,P as jo,L as Zn,A as $s,S as er}from"./index-DxGSDzwI.js";import{u as vo,t as tr}from"./toUpper-psJiJObX.js";import{u as ie,a as nr}from"./team-N6DYcIw9.js";import{c as or,d as sr,a as rr,e as ir,f as ar,g as Xn,h as lr,i as $n}from"./spaces-BSCd0GtL.js";import{d as cr}from"./EditIcon-DAtBHTkl.js";import{d as dr}from"./Done-CEgWviUN.js";import{C as pr}from"./Google-CCNGxrji.js";import{I as ur,B as mr}from"./install-from-url-BsrxhAMw.js";import{a as eo}from"./api-UFWd_s1k.js";import{v as So,a as pt}from"./util-_4tqOqNO.js";import{P as fr,u as hr}from"./use-blocklet-info-for-connect-did-spaces-IAC6QCQz.js";import{D as gr}from"./DeleteOutline-DvFRqyWQ.js";import{S as to}from"./index-zZFI1GlJ.js";import{d as xr}from"./ArrowDropDown-CRJiMsxl.js";import{_ as yr}from"./useLocalStorage-CcTbqaWM.js";import{d as Cr}from"./LockIcon-BgCC_gMD.js";import{d as yt}from"./Delete-KztH8pOq.js";import{d as bo}from"./Launch-fB5PS8PY.js";import{C as jr}from"./delete-confirm-CcpxufKB.js";import{W as Qe}from"./tag-Cvwm2gDk.js";import{d as vr}from"./is-path-prefix-equal-PjyGugoV.js";import{R as Sr,b as no,B as Ro}from"./url-evaluation-DjVe9I2g.js";import{B as br}from"./bundle-avatar-CbU_wbB2.js";import{A as Eo}from"./actions-CS2Trs8B.js";import{I as Nt}from"./index-BgG0evtj.js";import{a as Rr}from"./index-DqdZ9FKF.js";import"./ButtonGroup-G7oFneKA.js";import"./getValidReactChildren-7IUHA6fR.js";import"./index-BR3eM8Lx.js";import"./index-C2Cgygdk.js";import"./url-join-D1xrWbhs.js";import"./MoreVert-CWypNP8g.js";import"./app-avatar-BhPctNAT.js";import"./Breadcrumbs-D8UxFHZC.js";import"./FilterList-D84A-7C6.js";import"./Select-b09v8FPX.js";import"./InputLabel-ERXbfftZ.js";import"./LastPage-Cad46J9e.js";import"./slicedToArray-CjyU228M.js";import"./Search-uFerpv5L.js";import"./ChevronLeft-BqOWO5Oh.js";import"./ChevronRight-DDJkuJhV.js";import"./DeleteOutline-Cwej9e35.js";import"./redux-gonzvYQ4.js";import"./Skeleton-zb5bXzJn.js";import"./InputAdornment-CfEcRXzS.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-DCQd0BKE.js";import"./preact.module-B1z5cdvs.js";import"./Close-BltjIlg7.js";import"./lottie-GpNsBU3J.js";import"./Stepper-WgjnG7-H.js";import"./index-B2PJyxbf.js";const Er=qo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Qt={},Tr=Vt;Object.defineProperty(Qt,"__esModule",{value:!0});var To=Qt.default=void 0,wr=Tr(qt()),Pr=e;To=Qt.default=(0,wr.default)((0,Pr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Zt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Os(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ls,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Zt.propTypes={children:r.any};Zt.defaultProps={children:null};const Ir=(t,o)=>{let{description:s}=t;return(Object.values(X.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},At=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function ut({blocklet:t,ancestors:o}){const s=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>At(c,t,o);if(Je(t.status)||t.status==="unknown"&&Je(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=!0;try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Vo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!At(c,t,o)){A.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:!0})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!At(c,t,o)){A.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:!0}]}});m(v.blocklet)}catch(v){A.error(Z(v))}},p=(t.configs||[]).filter(c=>!X.BLOCKLET_CONFIGURABLE_KEY[c.key]),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),b=p.map(c=>({...c,value:Object.values(X.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Qn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Ir(j,n)]})}}];return e.jsxs(kr,{children:[!!d.length&&e.jsx(_n,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(_n,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Ot,{permission:a?"":"mutate_blocklets",role:a?Me:[],children:c=>e.jsx(Fs,{className:"config-table",children:e.jsx(Gs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Ds,...zs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:b,editable:c?x:{}})})})]})}ut.propTypes={blocklet:r.object.isRequired,ancestors:r.array};ut.defaultProps={ancestors:[]};const kr=F.div`
1
+ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J,r as f,f as Ce,bp as Je,b as X,M as O,aO as _n,U as Ot,cd as Me,n as F,K as Z,gG as Vo,bH as Fe,aW as ue,aV as ht,aC as Mt,a2 as $,D as gt,F as D,bn as _o,Y as Ke,$ as Wn,a$ as Wo,fD as Ho,fE as Yo,C as re,f8 as Jo,y as po,av as dt,a1 as we,x as Ft,hv as Ko,hw as Qo,B as ne,bb as uo,H as _t,hx as Zo,m as ee,a3 as Xo,ez as $o,W as mo,Z as fo,ak as es,w as ts,J as ho,Q as He,V as ns,hy as go,S as ge,az as os,aA as ss,aB as rs,i as xt,hz as is,cz as as,bg as ls,h6 as cs,hA as ds,ay as Hn,cx as ps,ad as Ge,aJ as xo,bJ as Wt,cf as us,hB as ms,b6 as fs,z as hs,aX as Gt,T as gs,aN as Ye,at as Bt,dE as xs,bq as yo,aF as ys,fP as Pe,dM as Cs,hC as js,ge as Yn,hD as Jn,gg as Kn,aY as vs,G as at,gi as Ss,bI as bs}from"./index-CqcpZ8C3.js";import{d as Rs}from"./Add-B8Ae2MjM.js";import{a as Es,R as ct,F as Ts,L as ws,d as Ht,b as Yt}from"./line-DW0juCGB.js";import{C as Ps,A as Is,d as ks}from"./agreement-_qYynElX.js";import{E as Us}from"./index-CtzAe2AR.js";import{b as Ds,a as Bs,c as Ns,u as Jt,e as As}from"./actions-C1t0ka-G.js";import{S as Ls}from"./switch-control-CuPWIx6T.js";import{u as Os}from"./detail-CHKmnQLc.js";import{d as Co}from"./Edit-i_Bman7K.js";import{T as Ms}from"./index-CIbzY-F7.js";import{T as Fs,M as Gs,t as zs}from"./table-icons-DOOoyljy.js";import{C as Qn}from"./click-to-copy-Bj13kdln.js";import{T as K}from"./TextField-DjRhIjo4.js";import{d as Kt}from"./Link-DfSEdivF.js";import{c as qs,C as Vs,a as _s,b as Ws,D as Hs,A as Ys,B as Js,d as Ks,S as Qs}from"./item-tD3jAfba.js";import{u as Zs,a as Xs,P as jo,L as Zn,A as $s,S as er}from"./index-D5MDxbqt.js";import{u as vo,t as tr}from"./toUpper-mYvRPeiI.js";import{u as ie,a as nr}from"./team-BynFP1rM.js";import{c as or,d as sr,a as rr,e as ir,f as ar,g as Xn,h as lr,i as $n}from"./spaces-C58gy1rM.js";import{d as cr}from"./EditIcon-DmNEjmIQ.js";import{d as dr}from"./Done-BCLH1e-Y.js";import{C as pr}from"./Google-DLkd6TAZ.js";import{I as ur,B as mr}from"./install-from-url-DXGlT7R8.js";import{a as eo}from"./api-xvCGCwMn.js";import{v as So,a as pt}from"./util-cf4pvQDW.js";import{P as fr,u as hr}from"./use-blocklet-info-for-connect-did-spaces-DWywlTbc.js";import{d as gr}from"./DeleteOutline-B4LqoCK2.js";import{S as to}from"./index-CKOyruf_.js";import{d as xr}from"./ArrowDropDown-BNt-WuI3.js";import{_ as yr}from"./useLocalStorage-C3GQNaV2.js";import{d as Cr}from"./LockIcon-9c7sG23a.js";import{d as yt}from"./Delete-CnrKsAGC.js";import{d as bo}from"./Launch-DPclIZbd.js";import{C as jr}from"./delete-confirm-BoeDYrYX.js";import{W as Qe}from"./tag-Cxx1sXPF.js";import{d as vr}from"./is-path-prefix-equal-CoJozASB.js";import{R as Sr,b as no,B as Ro}from"./url-evaluation-dheoi_Nj.js";import{B as br}from"./bundle-avatar-RiFaz1Hb.js";import{A as Eo}from"./actions-BAUfPsQv.js";import{I as Nt}from"./index-BKi0XLcv.js";import{a as Rr}from"./index-DcU_Cijj.js";import"./ButtonGroup-OcQcEz6r.js";import"./getValidReactChildren-GMOIXwRG.js";import"./index-v2cqn0eS.js";import"./index-BbS1Wq4p.js";import"./url-join-DMIMYkEk.js";import"./MoreVert-Nc1QBj2D.js";import"./app-avatar-DcgC0kB0.js";import"./Breadcrumbs-CkmMkQDW.js";import"./FilterList-fpG1-3KQ.js";import"./Select-CBA-xyOJ.js";import"./InputLabel-avYwCvJM.js";import"./LastPage-DnBOlrut.js";import"./slicedToArray-CYGiqzmA.js";import"./Search-DnnCUnjB.js";import"./ChevronLeft-Dp9aa91c.js";import"./ChevronRight-C3NPaw6o.js";import"./redux-hfExDDyr.js";import"./Skeleton-CQPjJHp3.js";import"./InputAdornment-C6LFxcti.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-CyYUysSv.js";import"./preact.module-B1z5cdvs.js";import"./Close-Cbaq-RRq.js";import"./lottie-yeTV0Y2m.js";import"./Stepper-UEQaZPW7.js";import"./index-DSByvARI.js";const Er=qo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Qt={},Tr=Vt;Object.defineProperty(Qt,"__esModule",{value:!0});var To=Qt.default=void 0,wr=Tr(qt()),Pr=e;To=Qt.default=(0,wr.default)((0,Pr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Zt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Os(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ls,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Zt.propTypes={children:r.any};Zt.defaultProps={children:null};const Ir=(t,o)=>{let{description:s}=t;return(Object.values(X.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},At=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function ut({blocklet:t,ancestors:o}){const s=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>At(c,t,o);if(Je(t.status)||t.status==="unknown"&&Je(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=!0;try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Vo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!At(c,t,o)){A.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:!0})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!At(c,t,o)){A.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:!0}]}});m(v.blocklet)}catch(v){A.error(Z(v))}},p=(t.configs||[]).filter(c=>!X.BLOCKLET_CONFIGURABLE_KEY[c.key]),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),b=p.map(c=>({...c,value:Object.values(X.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Qn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Ir(j,n)]})}}];return e.jsxs(kr,{children:[!!d.length&&e.jsx(_n,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(_n,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Ot,{permission:a?"":"mutate_blocklets",role:a?Me:[],children:c=>e.jsx(Fs,{className:"config-table",children:e.jsx(Gs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Ds,...zs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:b,editable:c?x:{}})})})]})}ut.propTypes={blocklet:r.object.isRequired,ancestors:r.array};ut.defaultProps={ancestors:[]};const kr=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -63,7 +63,7 @@ import{bL as qo,j as e,aK as qt,aL as Vt,q as z,O as y,ax as ve,P as r,A,bl as J
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:so}=D,Lr=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var wo={isInServerlessMode:Lr};function Or(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(or(s))},[s]),{storageEndpoint:t}}const Po=f.createContext({}),{Provider:Mr,Consumer:Ka}=Po;function Xt({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Or(),{api:u}=J();_o(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await sr(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const b=await rr(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Mr,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}Xt.propTypes={children:Ke.node.isRequired};Xt.defaultProps={};function $t(){return f.useContext(Po)}const en={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function tn({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(Wo,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(pr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}tn.propTypes=en;function nn({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(K,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}nn.propTypes=en;nn.defaultProps={componentProps:{}};function on({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Ho.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Yo({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(tn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}on.propTypes={...en,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};on.defaultProps={};const Fr={input:nn,color:tn,passport:on,uploader:t=>e.jsx(ws,{...t.componentProps})};function Gr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Fr[s==null?void 0:s.toLowerCase()]}function sn({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(zr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Gr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,q="change")=>d(x,B,q),componentProps:I};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(k,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(re,{size:24}):e.jsx(dr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Jo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(cr,{})})})]})]},R)})})}sn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};sn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const zr=F(Ts)``;function rn({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Qo(()=>eo.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Ko(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:dt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:dt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Ft,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}rn.propTypes={...qs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};rn.defaultProps={handlePaySuccess:()=>{}};const an=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(Vs,{action:a,onNext:null,onSelect:l})}):e.jsx(rn,{...o,mode:a})});an.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};an.defaultProps={ref:{}};const qr=an;function Vr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function ln({key:t}={key:"sm"}){const o=uo();return _t(o.breakpoints.down(t))}function cn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=ln();return!t||Zo(t.meta)?e.jsx(_r,{children:s}):e.jsxs(Wr,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}cn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};cn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const _r=F(y)`
66
+ `,{NODE_MODES:so}=D,Lr=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var wo={isInServerlessMode:Lr};function Or(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(or(s))},[s]),{storageEndpoint:t}}const Po=f.createContext({}),{Provider:Mr,Consumer:Ja}=Po;function Xt({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Or(),{api:u}=J();_o(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await sr(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const b=await rr(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Mr,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}Xt.propTypes={children:Ke.node.isRequired};Xt.defaultProps={};function $t(){return f.useContext(Po)}const en={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function tn({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(Wo,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(pr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}tn.propTypes=en;function nn({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(K,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}nn.propTypes=en;nn.defaultProps={componentProps:{}};function on({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Ho.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Yo({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(tn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}on.propTypes={...en,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};on.defaultProps={};const Fr={input:nn,color:tn,passport:on,uploader:t=>e.jsx(ws,{...t.componentProps})};function Gr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Fr[s==null?void 0:s.toLowerCase()]}function sn({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(zr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Gr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,q="change")=>d(x,B,q),componentProps:I};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(k,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(re,{size:24}):e.jsx(dr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Jo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(cr,{})})})]})]},R)})})}sn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};sn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const zr=F(Ts)``;function rn({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Qo(()=>eo.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Ko(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:dt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:dt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Ft,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}rn.propTypes={...qs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};rn.defaultProps={handlePaySuccess:()=>{}};const an=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(Vs,{action:a,onNext:null,onSelect:l})}):e.jsx(rn,{...o,mode:a})});an.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};an.defaultProps={ref:{}};const qr=an;function Vr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function ln({key:t}={key:"sm"}){const o=uo();return _t(o.breakpoints.down(t))}function cn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=ln();return!t||Zo(t.meta)?e.jsx(_r,{children:s}):e.jsxs(Wr,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}cn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};cn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const _r=F(y)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -1,4 +1,4 @@
1
- import{j as e,F as r,r as n,f as o,m as i,n as a}from"./index-DS1JU_-_.js";const s=({...t})=>e.jsxs("div",{...t,children:[e.jsx("h3",{children:"End User License Agreement for Blocklet Server"}),e.jsxs("p",{children:["Blocklet Server License Agreement ",r.COPYRIGHT_OWNER," version 2020-08-28"]}),e.jsx("p",{children:"Blocklet Server LICENSE AGREEMENT"}),e.jsxs("p",{children:["PLEASE READ THIS END USER LICENCE AGREEMENT CAREFULLY. This Blocklet Server License Agreement ('Agreement') is a legal agreement between you (the 'End User') and ",r.COPYRIGHT_OWNER," (ARCBLOCK) for the Blocklet Server software (the 'Software') licensed to End User hereunder and supplied to End User. The term Software includes any APIs, software modules, and any associated materials and 'online' or electronic documentation. This Agreement applies to End User's use of the Software but it shall be superseded by any signed agreement between End User and ARCBLOCK concerning the Software."]}),e.jsx("p",{children:"By installing or using the Software, You agree to accept and to be bound by this Agreement at all times. If You do not agree with one of these, please do not install or use the Software."}),e.jsx("h4",{children:"1. Software license"}),e.jsx("p",{children:"Notwithstanding any reference to 'sale' or 'purchase', the Software is licensed, not sold. Subject to the terms and conditions of this Agreement, ARCBLOCK grants End User a non-exclusive, non-transferable right to access and use the Software as part of the services for End User's use ('Authorized Use') in object form in the products, versions, and number of installed instances as purchased from ARCBLOCK."}),e.jsx("h4",{children:"2. Limitations"}),e.jsx("p",{children:"2.1. Restrictions. End User shall not itself, or through any parent, subsidiary, affiliate, agent or other third party: (a) sell, lease, license, distribute, sublicense or otherwise transfer in whole or in part, the Software to a third party; (b) decompile, disassemble, translate, reverse engineer or otherwise attempt to derive source code from the Software except to the limited extent, if any, that applicable law permits such acts notwithstanding any contractual prohibitions, provided, however, before End User exercises any rights that End User believes to be entitled to based on mandatory law, End User shall provide ARCBLOCK with thirty (30) days prior written notice and provide all reasonably requested information to allow ARCBLOCK to assess End User's claim and, at ARCBLOCK sole discretion, to provide alternatives that reduce any adverse impact on ARCBLOCK's intellectual property or other rights; (c) allow access or permit use of the Software by any third party except authorized third party contractors solely to provide services to End User, provided that End User shall be liable for all acts and omissions of such authorized third party contractors; (d) modify or create derivative works based upon the Software; (e) disclose the results of any benchmark test of the Software to any third party; (f) change any proprietary rights notices which appear in the Software; or (g) circumvent the license keys embedded within the Software."}),e.jsx("p",{children:"2.2. Software Transfer. Upon written consent from ARCBLOCK, which will not be unreasonably withheld, End User may permanently transfer all of its rights under this Agreement; provided that the recipient agrees to the terms of this Agreement."}),e.jsx("p",{children:"2.3. High Risk Activities. The Software is not intended for use in hazardous environments requiring fail safe performance (such as, without limitation, the planning, construction, maintenance, control, or direct operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, medical device and life support machines, or weapon systems) in which the failure of the Software could lead to death, personal injury or physical and environmental damage ('High Risk Activities'). Accordingly, this Agreement excludes any High Risk Activities and End User agrees not to use the Software in connection with High Risk Activities."}),e.jsx("h4",{children:"3. Ownership"}),e.jsx("p",{children:"The Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. ARCBLOCK owns all rights, title and interest in the copyrights, patents and all other intellectual property rights in and to the Software and any accompanying printed materials, and all derivative works thereof."}),e.jsx("h4",{children:"4. Open source programs"}),e.jsx("p",{children:"The Software may include individual open source software components, each of which has its own copyright and its own applicable license conditions. The open source software components are licensed to End User under the terms of the applicable open source license conditions and/or copyright notices that can be found in the licenses file, the related documentation or other materials accompanying the Software."}),e.jsx("h4",{children:"5. Trademarks"}),e.jsx("p",{children:"The marks 'ARCBLOCK', ‘BLOCKLETS’ and ‘Blocklet Server’ are trademarks of ARCBLOCK. ARCBLOCK's failure to list a trademark in this Section shall not constitute a waiver of any trademark rights. All other trademarks in the Software not owned by ARCBLOCK are the property of their respective owners."}),e.jsx("h4",{children:"6. Disclaimer and Warranty"}),e.jsx("p",{children:"6.1. DISCLAIMER OF WARRANTIES. THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND AND ARCBLOCK EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED OR ARISING OUT OF A COURSE OF CONDUCT OR COURSE OF DEALING, INCLUDING ALL WARRANTIES OF TITLE, PERFORMANCE, USE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON INFRINGEMENT AND THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. ARCBLOCK MAKES NO WARRANTY REGARDING NON INTERRUPTION OF USE. NO ORAL OR WRITTEN STATEMENT PROVIDED BY ARCBLOCK SHALL CREATE ANY WARRANTY."}),e.jsx("p",{children:"6.2. LIMITATION OF LIABILITY. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY END USER. ARCBLOCK SHALL NOT HAVE ANY LIABILITY TO END USER OR ANY OTHER PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUE, PROFIT OR OPPORTUNITY, LOST OR DAMAGED DATA OR OTHER COMMERCIAL OR ECONOMIC LOSS, EVEN IF ARCBLOCK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR THEY ARE FORESEEABLE. ARCBLOCK'S MAXIMUM AGGREGATE LIABILITY RELATING TO THIS AGREEMENT OR THE SOFTWARE SHALL NOT EXCEED THE AMOUNT PAID BY END USER FOR THE SOFTWARE."}),e.jsx("p",{children:"6.3. ALLOCATION. THE PROVISIONS OF THIS SECTION ALLOCATE RISKS UNDER THIS AGREEMENT BETWEEN ARCBLOCK AND END USER. ARCBLOCK'S LICENSING FEES FOR THE SOFTWARE REFLECT THIS ALLOCATION OF RISKS AND LIMITATION OF LIABILITY. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS IN ITS ESSENTIAL PURPOSE."}),e.jsx("p",{children:"6.4. Limitation. Because some jurisdictions do not allow certain disclaimers, exclusions or limitations of warranties, damages or liability, the above disclaimers, exclusions or limitations may not apply to End User and, therefore, shall apply only to the maximum extent allowed under applicable law."}),e.jsx("h4",{children:"7. Term"}),e.jsx("p",{children:"This Agreement is effective until terminated. End Users may terminate the Agreement at any time by returning or destroying all copies of the Software and related documentation. End User's rights under this Agreement will terminate automatically if End User fails to comply with the Agreement."}),e.jsx("h4",{children:"8. Miscellaneous"}),e.jsx("p",{children:"8.1. Governing Law. This Agreement shall be governed by the laws of the State of Washington, without reference to the principles of conflicts of law. The provisions of the Uniform Computerized Information Transaction Act and United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. Any litigation related to this Agreement shall be brought in the state or federal courts located in Washington, and only in those courts and each party irrevocably waives any objections to such venue. Notwithstanding anything to the contrary herein, ARCBLOCK shall be entitled to seek injunctive or other equitable relief, wherever ARCBLOCK deems appropriate in any jurisdiction, in order to preserve or enforce ARCBLOCK's rights for any breach or threatened breach of this Agreement."}),e.jsx("p",{children:"8.2. Severability. Every term, condition or provision of this Agreement is severable from the others. If a court or an arbitrator of competent jurisdiction holds any term, condition or provision of this Agreement to be invalid, unenforceable or illegal in whole or in part for any reason, the validity and enforceability of the remaining terms, conditions or provisions, or portions of them, will not be affected."}),e.jsx("p",{children:"8.3. Confidentiality. Except as expressly allowed by this Agreement, End User will not use or disclose any Software or related technology, idea, algorithm or information ('Confidential Information') except to the extent End User can document that it is generally available for use and disclosure by the public without charge or license. End User shall hold the Confidential Information in trust and confidence and avoid the disclosure or release thereof to any other person or entity by using the same degree of care as it uses to avoid unauthorized use, disclosure, or dissemination of its own Confidential Information of a similar nature, but not less than reasonable care. End User may disclose Confidential Information as required to comply with binding orders of governmental entities that have jurisdiction over it; provided that End User gives ARCBLOCK reasonable written notice to allow ARCBLOCK to seek a protective order or other appropriate remedy, discloses only such Confidential Information as is required by the governmental entity, and uses commercially reasonable efforts to obtain confidential treatment for any Confidential Information disclosed. End User recognizes and agrees that there is no adequate remedy at law for a breach of this Section, that such a breach would irreparably harm ARCBLOCK and that ARCBLOCK is entitled to equitable relief (without need to post a bond) with respect to any such breach or potential breach in addition to any other remedies."}),e.jsx("p",{children:"8.4. Indemnity. End User shall defend, indemnify and hold harmless ARCBLOCK, and its officers, directors, employees and agents (the ARCBLOCK indemnities’), from and against all suits, claims, demands, losses, liabilities, damages and expenses (including reasonable attorneys' fees and costs) that the ARCBLOCK Indemnities may suffer or incur in connection with: (i) any third party claim arising from End User's breach of this Agreement; and (ii) any infringement by End User of ARCBLOCK's intellectual property rights in the Software."}),e.jsx("p",{children:"8.5. Entire Agreement and Waiver. The Agreement is the sole, final and entire agreement between the parties with respect to the subject matter hereof, may only be amended in writing signed by both ARCBLOCK License parties. A failure or delay in enforcing any provisions, exercising any option or requiring performance, be construed to be a waiver by ARCBLOCK."}),e.jsx("p",{children:"8.6. Marketing. ARCBLOCK may use End User's name and company logo on its customer list and web site, and link to End User's web site."}),e.jsx("p",{children:"8.7. Independent Contractor. The relationship of the parties is that of independent contractors. Neither party will be deemed to be the legal representative of the other nor will it have any right to bind the other party to any contract or commitment. This Agreement does not, and will not, be construed to create an employer employee, agency, joint venture or partnership relationship between the parties. Each party agrees to assume complete responsibility for its own employees regarding federal or state laws, including employers' liability and tax withholding, worker's compensation, social security, unemployment insurance, and OSHA requirements."}),e.jsx("p",{children:"8.8. Notices. All notices must be in writing and will be effective three (3) days after the date sent to each party's corporate headquarters."}),e.jsx("p",{children:"8.9. Audit. During the term of this Agreement and for one (1) year following termination or expiration (but no more than once in a calendar year), ARCBLOCK and its auditors may inspect End User's records relating to its reproduction and use of the Software for the purposes of verifying End User's compliance with this Agreement. End User shall cooperate fully with ARCBLOCK and its auditors in conducting audits and provide reasonable assistance. If an underpayment is discovered, End User shall promptly pay such amount and End User shall reimburse ARCBLOCK for the cost of the audit."}),e.jsx("p",{children:`8.10. Government Regulation. End User acknowledges that the Software is subject to export restrictions by the U.S. government and import restrictions by certain foreign governments. End User may not export or re-export the Software except in compliance with the U.S. Export Administration Act and the related rules and regulations and similar non-U.S. government restrictions, if applicable. End User shall not and shall not allow any third party to remove or export from the United States or allow the export or re export of any part of the Software or any direct product thereof: (i) into (or to a national or resident of) any embargoed or terrorist supporting country; (ii) to anyone on the U.S. Commerce Department's Table of Denial Orders or U.S. Treasury Department's list of Specially Designated Nationals; (iii) to any country to which such export or re export is restricted or prohibited, or as to which the U.S. government or any agency thereof requires an export license or other governmental approval at the time of export or re export without first obtaining such license or approval; or (iv) otherwise in violation of any export or import restrictions, laws or regulations of any United States or foreign agency or authority. End User agrees to the foregoing and warrants that it is not located in, under the control of, or a national or resident of any such prohibited country or on any such prohibited party list. The Software is further restricted from being used for terrorist activity, or for the design or development of nuclear, chemical, or biological weapons or missile technology without the prior permission of the U.S. government. The Software and accompanying documentation are deemed to be "commercial computer software" and "commercial computer software documentation", respectively, pursuant to DFAR Section 227.7202 and FAR Section 12.212(b), as applicable. Any use, modification, reproduction, release, performing, displaying or disclosing of the Software and related documentation by the U.S. Government shall be governed solely by the terms of this Agreement.`})]});function h(){const{t}=n.useContext(o);return e.jsxs(l,{children:[e.jsx(i,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("setup.steps.eula")}),e.jsx(s,{})]})}const l=a.main`
1
+ import{j as e,F as r,r as n,f as o,m as i,n as a}from"./index-CqcpZ8C3.js";const s=({...t})=>e.jsxs("div",{...t,children:[e.jsx("h3",{children:"End User License Agreement for Blocklet Server"}),e.jsxs("p",{children:["Blocklet Server License Agreement ",r.COPYRIGHT_OWNER," version 2020-08-28"]}),e.jsx("p",{children:"Blocklet Server LICENSE AGREEMENT"}),e.jsxs("p",{children:["PLEASE READ THIS END USER LICENCE AGREEMENT CAREFULLY. This Blocklet Server License Agreement ('Agreement') is a legal agreement between you (the 'End User') and ",r.COPYRIGHT_OWNER," (ARCBLOCK) for the Blocklet Server software (the 'Software') licensed to End User hereunder and supplied to End User. The term Software includes any APIs, software modules, and any associated materials and 'online' or electronic documentation. This Agreement applies to End User's use of the Software but it shall be superseded by any signed agreement between End User and ARCBLOCK concerning the Software."]}),e.jsx("p",{children:"By installing or using the Software, You agree to accept and to be bound by this Agreement at all times. If You do not agree with one of these, please do not install or use the Software."}),e.jsx("h4",{children:"1. Software license"}),e.jsx("p",{children:"Notwithstanding any reference to 'sale' or 'purchase', the Software is licensed, not sold. Subject to the terms and conditions of this Agreement, ARCBLOCK grants End User a non-exclusive, non-transferable right to access and use the Software as part of the services for End User's use ('Authorized Use') in object form in the products, versions, and number of installed instances as purchased from ARCBLOCK."}),e.jsx("h4",{children:"2. Limitations"}),e.jsx("p",{children:"2.1. Restrictions. End User shall not itself, or through any parent, subsidiary, affiliate, agent or other third party: (a) sell, lease, license, distribute, sublicense or otherwise transfer in whole or in part, the Software to a third party; (b) decompile, disassemble, translate, reverse engineer or otherwise attempt to derive source code from the Software except to the limited extent, if any, that applicable law permits such acts notwithstanding any contractual prohibitions, provided, however, before End User exercises any rights that End User believes to be entitled to based on mandatory law, End User shall provide ARCBLOCK with thirty (30) days prior written notice and provide all reasonably requested information to allow ARCBLOCK to assess End User's claim and, at ARCBLOCK sole discretion, to provide alternatives that reduce any adverse impact on ARCBLOCK's intellectual property or other rights; (c) allow access or permit use of the Software by any third party except authorized third party contractors solely to provide services to End User, provided that End User shall be liable for all acts and omissions of such authorized third party contractors; (d) modify or create derivative works based upon the Software; (e) disclose the results of any benchmark test of the Software to any third party; (f) change any proprietary rights notices which appear in the Software; or (g) circumvent the license keys embedded within the Software."}),e.jsx("p",{children:"2.2. Software Transfer. Upon written consent from ARCBLOCK, which will not be unreasonably withheld, End User may permanently transfer all of its rights under this Agreement; provided that the recipient agrees to the terms of this Agreement."}),e.jsx("p",{children:"2.3. High Risk Activities. The Software is not intended for use in hazardous environments requiring fail safe performance (such as, without limitation, the planning, construction, maintenance, control, or direct operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, medical device and life support machines, or weapon systems) in which the failure of the Software could lead to death, personal injury or physical and environmental damage ('High Risk Activities'). Accordingly, this Agreement excludes any High Risk Activities and End User agrees not to use the Software in connection with High Risk Activities."}),e.jsx("h4",{children:"3. Ownership"}),e.jsx("p",{children:"The Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. ARCBLOCK owns all rights, title and interest in the copyrights, patents and all other intellectual property rights in and to the Software and any accompanying printed materials, and all derivative works thereof."}),e.jsx("h4",{children:"4. Open source programs"}),e.jsx("p",{children:"The Software may include individual open source software components, each of which has its own copyright and its own applicable license conditions. The open source software components are licensed to End User under the terms of the applicable open source license conditions and/or copyright notices that can be found in the licenses file, the related documentation or other materials accompanying the Software."}),e.jsx("h4",{children:"5. Trademarks"}),e.jsx("p",{children:"The marks 'ARCBLOCK', ‘BLOCKLETS’ and ‘Blocklet Server’ are trademarks of ARCBLOCK. ARCBLOCK's failure to list a trademark in this Section shall not constitute a waiver of any trademark rights. All other trademarks in the Software not owned by ARCBLOCK are the property of their respective owners."}),e.jsx("h4",{children:"6. Disclaimer and Warranty"}),e.jsx("p",{children:"6.1. DISCLAIMER OF WARRANTIES. THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND AND ARCBLOCK EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED OR ARISING OUT OF A COURSE OF CONDUCT OR COURSE OF DEALING, INCLUDING ALL WARRANTIES OF TITLE, PERFORMANCE, USE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON INFRINGEMENT AND THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. ARCBLOCK MAKES NO WARRANTY REGARDING NON INTERRUPTION OF USE. NO ORAL OR WRITTEN STATEMENT PROVIDED BY ARCBLOCK SHALL CREATE ANY WARRANTY."}),e.jsx("p",{children:"6.2. LIMITATION OF LIABILITY. THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY END USER. ARCBLOCK SHALL NOT HAVE ANY LIABILITY TO END USER OR ANY OTHER PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUE, PROFIT OR OPPORTUNITY, LOST OR DAMAGED DATA OR OTHER COMMERCIAL OR ECONOMIC LOSS, EVEN IF ARCBLOCK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR THEY ARE FORESEEABLE. ARCBLOCK'S MAXIMUM AGGREGATE LIABILITY RELATING TO THIS AGREEMENT OR THE SOFTWARE SHALL NOT EXCEED THE AMOUNT PAID BY END USER FOR THE SOFTWARE."}),e.jsx("p",{children:"6.3. ALLOCATION. THE PROVISIONS OF THIS SECTION ALLOCATE RISKS UNDER THIS AGREEMENT BETWEEN ARCBLOCK AND END USER. ARCBLOCK'S LICENSING FEES FOR THE SOFTWARE REFLECT THIS ALLOCATION OF RISKS AND LIMITATION OF LIABILITY. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS IN ITS ESSENTIAL PURPOSE."}),e.jsx("p",{children:"6.4. Limitation. Because some jurisdictions do not allow certain disclaimers, exclusions or limitations of warranties, damages or liability, the above disclaimers, exclusions or limitations may not apply to End User and, therefore, shall apply only to the maximum extent allowed under applicable law."}),e.jsx("h4",{children:"7. Term"}),e.jsx("p",{children:"This Agreement is effective until terminated. End Users may terminate the Agreement at any time by returning or destroying all copies of the Software and related documentation. End User's rights under this Agreement will terminate automatically if End User fails to comply with the Agreement."}),e.jsx("h4",{children:"8. Miscellaneous"}),e.jsx("p",{children:"8.1. Governing Law. This Agreement shall be governed by the laws of the State of Washington, without reference to the principles of conflicts of law. The provisions of the Uniform Computerized Information Transaction Act and United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. Any litigation related to this Agreement shall be brought in the state or federal courts located in Washington, and only in those courts and each party irrevocably waives any objections to such venue. Notwithstanding anything to the contrary herein, ARCBLOCK shall be entitled to seek injunctive or other equitable relief, wherever ARCBLOCK deems appropriate in any jurisdiction, in order to preserve or enforce ARCBLOCK's rights for any breach or threatened breach of this Agreement."}),e.jsx("p",{children:"8.2. Severability. Every term, condition or provision of this Agreement is severable from the others. If a court or an arbitrator of competent jurisdiction holds any term, condition or provision of this Agreement to be invalid, unenforceable or illegal in whole or in part for any reason, the validity and enforceability of the remaining terms, conditions or provisions, or portions of them, will not be affected."}),e.jsx("p",{children:"8.3. Confidentiality. Except as expressly allowed by this Agreement, End User will not use or disclose any Software or related technology, idea, algorithm or information ('Confidential Information') except to the extent End User can document that it is generally available for use and disclosure by the public without charge or license. End User shall hold the Confidential Information in trust and confidence and avoid the disclosure or release thereof to any other person or entity by using the same degree of care as it uses to avoid unauthorized use, disclosure, or dissemination of its own Confidential Information of a similar nature, but not less than reasonable care. End User may disclose Confidential Information as required to comply with binding orders of governmental entities that have jurisdiction over it; provided that End User gives ARCBLOCK reasonable written notice to allow ARCBLOCK to seek a protective order or other appropriate remedy, discloses only such Confidential Information as is required by the governmental entity, and uses commercially reasonable efforts to obtain confidential treatment for any Confidential Information disclosed. End User recognizes and agrees that there is no adequate remedy at law for a breach of this Section, that such a breach would irreparably harm ARCBLOCK and that ARCBLOCK is entitled to equitable relief (without need to post a bond) with respect to any such breach or potential breach in addition to any other remedies."}),e.jsx("p",{children:"8.4. Indemnity. End User shall defend, indemnify and hold harmless ARCBLOCK, and its officers, directors, employees and agents (the ARCBLOCK indemnities’), from and against all suits, claims, demands, losses, liabilities, damages and expenses (including reasonable attorneys' fees and costs) that the ARCBLOCK Indemnities may suffer or incur in connection with: (i) any third party claim arising from End User's breach of this Agreement; and (ii) any infringement by End User of ARCBLOCK's intellectual property rights in the Software."}),e.jsx("p",{children:"8.5. Entire Agreement and Waiver. The Agreement is the sole, final and entire agreement between the parties with respect to the subject matter hereof, may only be amended in writing signed by both ARCBLOCK License parties. A failure or delay in enforcing any provisions, exercising any option or requiring performance, be construed to be a waiver by ARCBLOCK."}),e.jsx("p",{children:"8.6. Marketing. ARCBLOCK may use End User's name and company logo on its customer list and web site, and link to End User's web site."}),e.jsx("p",{children:"8.7. Independent Contractor. The relationship of the parties is that of independent contractors. Neither party will be deemed to be the legal representative of the other nor will it have any right to bind the other party to any contract or commitment. This Agreement does not, and will not, be construed to create an employer employee, agency, joint venture or partnership relationship between the parties. Each party agrees to assume complete responsibility for its own employees regarding federal or state laws, including employers' liability and tax withholding, worker's compensation, social security, unemployment insurance, and OSHA requirements."}),e.jsx("p",{children:"8.8. Notices. All notices must be in writing and will be effective three (3) days after the date sent to each party's corporate headquarters."}),e.jsx("p",{children:"8.9. Audit. During the term of this Agreement and for one (1) year following termination or expiration (but no more than once in a calendar year), ARCBLOCK and its auditors may inspect End User's records relating to its reproduction and use of the Software for the purposes of verifying End User's compliance with this Agreement. End User shall cooperate fully with ARCBLOCK and its auditors in conducting audits and provide reasonable assistance. If an underpayment is discovered, End User shall promptly pay such amount and End User shall reimburse ARCBLOCK for the cost of the audit."}),e.jsx("p",{children:`8.10. Government Regulation. End User acknowledges that the Software is subject to export restrictions by the U.S. government and import restrictions by certain foreign governments. End User may not export or re-export the Software except in compliance with the U.S. Export Administration Act and the related rules and regulations and similar non-U.S. government restrictions, if applicable. End User shall not and shall not allow any third party to remove or export from the United States or allow the export or re export of any part of the Software or any direct product thereof: (i) into (or to a national or resident of) any embargoed or terrorist supporting country; (ii) to anyone on the U.S. Commerce Department's Table of Denial Orders or U.S. Treasury Department's list of Specially Designated Nationals; (iii) to any country to which such export or re export is restricted or prohibited, or as to which the U.S. government or any agency thereof requires an export license or other governmental approval at the time of export or re export without first obtaining such license or approval; or (iv) otherwise in violation of any export or import restrictions, laws or regulations of any United States or foreign agency or authority. End User agrees to the foregoing and warrants that it is not located in, under the control of, or a national or resident of any such prohibited country or on any such prohibited party list. The Software is further restricted from being used for terrorist activity, or for the design or development of nuclear, chemical, or biological weapons or missile technology without the prior permission of the U.S. government. The Software and accompanying documentation are deemed to be "commercial computer software" and "commercial computer software documentation", respectively, pursuant to DFAR Section 227.7202 and FAR Section 12.212(b), as applicable. Any use, modification, reproduction, release, performing, displaying or disclosing of the Software and related documentation by the U.S. Government shall be governed solely by the terms of this Agreement.`})]});function h(){const{t}=n.useContext(o);return e.jsxs(l,{children:[e.jsx(i,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("setup.steps.eula")}),e.jsx(s,{})]})}const l=a.main`
2
2
  .page-header {
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -1,4 +1,4 @@
1
- import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-DS1JU_-_.js";import{c as Un}from"./index-BR3eM8Lx.js";import{d as ye}from"./Add-i_eGmIkF.js";import{d as zn}from"./Loop-BTQochTH.js";import{d as Wn}from"./ViewList-DiAWVo-f.js";import{L as qn,S as Vn,d as Wt}from"./list-header-3UZEZSQm.js";import{D as qe,g as Hn}from"./index-DIuisRmH.js";import"./index-DZdSy-Ha.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-DO7gkp11.js";import{T as Kn}from"./index-DxX4hb7b.js";import{E as Vt}from"./index-BSqmsUTI.js";import"./index-DqdZ9FKF.js";import{W as Ht}from"./tag-Cvwm2gDk.js";import{b as G,u as Kt}from"./team-N6DYcIw9.js";import{C as Se}from"./click-to-copy-BLqu2SLV.js";import{F as Qt,S as Yt}from"./Select-b09v8FPX.js";import{I as Gt}from"./InputLabel-ERXbfftZ.js";import{T as Xt}from"./TextField-BPO9Hci-.js";import{I as Fe}from"./index-BgG0evtj.js";import{d as Qn}from"./Delete-KztH8pOq.js";import{A as Yn}from"./actions-CS2Trs8B.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
1
+ import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-CqcpZ8C3.js";import{c as Un}from"./index-v2cqn0eS.js";import{d as ye}from"./Add-B8Ae2MjM.js";import{d as zn}from"./Loop-DwAWKPvc.js";import{d as Wn}from"./ViewList-CoYI2XgO.js";import{L as qn,S as Vn,d as Wt}from"./list-header-tjKXNgOR.js";import{D as qe,g as Hn}from"./index-CZKHzmkC.js";import"./index-ECk6dODK.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-DinbvH2C.js";import{T as Kn}from"./index-CIbzY-F7.js";import{E as Vt}from"./index-CtzAe2AR.js";import"./index-DcU_Cijj.js";import{W as Ht}from"./tag-Cxx1sXPF.js";import{b as G,u as Kt}from"./team-BynFP1rM.js";import{C as Se}from"./click-to-copy-Bj13kdln.js";import{F as Qt,S as Yt}from"./Select-CBA-xyOJ.js";import{I as Gt}from"./InputLabel-avYwCvJM.js";import{T as Xt}from"./TextField-DjRhIjo4.js";import{I as Fe}from"./index-BKi0XLcv.js";import{d as Qn}from"./Delete-CnrKsAGC.js";import{A as Yn}from"./actions-BAUfPsQv.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  `;function Qe({teamDid:e,onCancel:n,onSuccess:r,onError:i,endpoint:m}){const{api:j,info:P}=H(),{api:p}=I.useContext(Sn),[g,h]=I.useState(!1),{t:u,locale:w}=K(),[f,y]=I.useState(""),[A,C]=I.useState(!1),[x,o]=I.useState(0),[s,a]=I.useState(""),[l,c]=I.useState(""),b=!!Be(P,"ownerNft.did"),d=Cn(async()=>{if(b){const{state:F}=await j.getDelegationState();return F}return{delegated:!0}});if(d.loading)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx("div",{style:{display:"flex",justifyContent:"center"},children:t.jsx(oe,{})})});if(d.error)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx(se,{type:"error",variant:"icon",children:ee(d.error)})});const v=async()=>{y(null),h(!0);try{const{inviteInfo:F}=await j.createTransferInvitation({input:{teamDid:e,role:"owner",remark:l.trim()}});a(F),o(W.length-1)}catch(F){const ne=ee(F);y(ne),i(F)}finally{h(!1)}},k=()=>{C(!0),o(1)},M=()=>{C(!1),o(0)},W=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(se,{type:"warning",children:[t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.progress")}),t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),t.jsx(se,{type:"warning",children:t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:F=>{y(null),c(F.target.value)},disabled:g,"data-cy":"transfer-node-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:n,onConfirm:b&&!Be(d,"value.delegated")?k:v},{body:()=>t.jsx(In,{action:"delegate-transfer-nft",open:A,locale:w,checkFn:p.get,onClose:M,onSuccess:v,checkTimeout:5*60*1e3,webWalletUrl:Rn(P),extraParams:{targetDID:P.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const F=Ue({inviteId:s.inviteId,endpoint:m});return t.jsxs("div",{children:[t.jsx(jr,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:de(s.expireDate,w)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:F})]})},confirm:u("common.confirm"),onConfirm:r}],$=W[x];return t.jsxs(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[$.cancel&&t.jsx(z,{onClick:$.onCancel,color:"inherit",children:$.cancel}),t.jsxs(z,{onClick:$.onConfirm,color:"primary",disabled:g,variant:"contained",autoFocus:!0,children:[g&&t.jsx(oe,{size:16}),$.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof $.body=="function"?$.body():$.body}),!!f&&t.jsx(se,{type:"error",variant:"icon",children:f})]})}Qe.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,endpoint:S.string};Qe.defaultProps={onError:()=>{},endpoint:""};const jr=V.div`
@@ -1,4 +1,4 @@
1
- import{j as r,m as i,P as e,d6 as c,d7 as f,s as u}from"./index-DS1JU_-_.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>c(f(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
1
+ import{j as r,m as i,P as e,d6 as c,d7 as f,s as u}from"./index-CqcpZ8C3.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>c(f(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1 +1 @@
1
- import{cP as H,dy as M,dz as E,dA as g,dB as Y,dC as N,dD as j}from"./index-DS1JU_-_.js";import{a as X}from"./isEqual-3iEl-twA.js";var V={},i={},d={},q=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});d.toStrictHex=d.toBytes=d.toBits=d.DID_PREFIX=void 0;const K=q(M),P=g,v="did:abt:";d.DID_PREFIX=v;const G=e=>{try{if((0,P.isHexStrict)(e))return E.from((0,P.stripHexPrefix)(e),"hex");let t=(0,P.fromBase58)(e.replace(v,""));for(;t.length<26;)t=E.concat([E.from([0]),t]);return t}catch(t){throw new Error(`Cannot convert DID string to byte array: ${t.message}`)}};d.toBytes=G;const J=(e,t)=>(0,K.default)((0,P.toBN)(e).toString(2),t,"0");d.toBits=J;const z=(e,t)=>{const s=e.replace(/^0x/i,"");return typeof t=="number"&&t%2===0?(0,K.default)(e,t,"0"):s.length%2===0?s:`0${s}`};d.toStrictHex=z;var A=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});i.DidType=i.toChecksumAddress=i.isEthereumDid=i.isEthereumType=i.toTypeInfoStr=i.toTypeInfo=i.fromTypeInfo=i.DID_TYPE_ETHEREUM=i.DID_TYPE_ARCBLOCK=void 0;const m=g,D=A(Y),W=A(X),$=A(N),o=j,T=d,b={pk:"key",address:"encoding"},B={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ED25519,hash:o.types.HashType.SHA3,address:o.types.EncodingType.BASE58};i.DID_TYPE_ARCBLOCK=B;const R={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ETHEREUM,hash:o.types.HashType.KECCAK,address:o.types.EncodingType.BASE16};i.DID_TYPE_ETHEREUM=R;const F=e=>{const t=["pk","hash","address"];return(0,W.default)((0,$.default)(e,t),(0,$.default)(R,t))};i.isEthereumType=F;const L=e=>{const t=(0,m.toAddress)(e);return/^(0x)?[0-9a-f]{40}$/i.test(t)?/^(0x|0X)?[0-9a-f]{40}$/.test(t)||/^(0x|0X)?[0-9A-F]{40}$/.test(t)?!0:Q(t):!1};i.isEthereumDid=L;const Q=e=>{const t=e.replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t.toLowerCase()).replace(/^0x/i,"");for(let r=0;r<40;r++)if(parseInt(s[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(s[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},Z=e=>{if(typeof e>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error(`Given address "${e}" is not a valid Ethereum address.`);const t=e.toLowerCase().replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t).replace(/^0x/i,"");let r="0x";for(let n=0;n<t.length;n++)parseInt(s[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r};i.toChecksumAddress=Z;function k(e={}){let t={};["default","arcblock"].includes(e)?t=B:["eth","ethereum"].includes(e)?t=R:t={...B,...e};const{role:s,pk:r,hash:n,address:u}=t;Object.keys(t).forEach(l=>{const _=(0,D.default)(`${b[l]||l}Type`);if(Object.values(o.types[_]).includes(t[l])===!1)throw new Error(`Unsupported ${l} type: ${t[l]}`)});const p={role:s,pk:r,hash:n,address:u};return F(p)===!1&&[o.types.RoleType.ROLE_NODE,o.types.RoleType.ROLE_VALIDATOR,o.types.RoleType.ROLE_TETHER,o.types.RoleType.ROLE_SWAP].includes(p.role)&&(p.hash=o.types.HashType.SHA2),p}i.DidType=k;k.toJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=n[u.indexOf(e[s])],t},{});k.fromJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=u[n.indexOf(e[s])],t},{});const x=e=>{const t=k(e),s=(0,T.toBits)(t.role,6),r=(0,T.toBits)(t.pk,5),n=(0,T.toBits)(t.hash,5),u=`${s}${r}${n}`,p=(0,m.stripHexPrefix)((0,m.numberToHex)(parseInt(u,2)));return(0,T.toStrictHex)(p,4)};i.fromTypeInfo=x;const w=e=>{let t={};try{if(L(e))t=R;else{const r=(0,T.toBytes)(e).slice(0,2),n=(0,T.toStrictHex)(E.from(r).toString("hex")),u=(0,T.toBits)(new m.BN(n,16),16),p=u.slice(0,6),l=u.slice(6,11),_=u.slice(11,16);t={role:parseInt(p,2),pk:parseInt(l,2),hash:parseInt(_,2),address:(0,m.isHex)((0,m.toAddress)(e))?o.types.EncodingType.BASE16:o.types.EncodingType.BASE58}}return Object.keys(t).forEach(s=>{Object.values(o.types[`${(0,D.default)(b[s]||s)}Type`]).includes(t[s])===!1&&delete t[s]}),t}catch{return t}};i.toTypeInfo=w;const ee=e=>{const t=w(e);return Object.keys(t).reduce((s,r)=>{const n=o.types[`${(0,D.default)(b[r]||r)}Type`];return s[r]=Object.keys(n).find(u=>n[u]===t[r]),s},{})};i.toTypeInfoStr=ee;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const t=j;Object.defineProperty(e,"types",{enumerable:!0,get:function(){return t.types}});const s=g;Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return s.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return s.toDid}});const r=i;Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return r.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return r.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return r.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return r.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return r.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return r.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return r.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return r.toTypeInfoStr}});const n=d;Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return n.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return n.toStrictHex}});const u=(y,a)=>{const c=(0,r.DidType)(a),f=(0,t.getSigner)(c.pk).getPublicKey(y);return p(f.indexOf("0x")===0?f:`0x${f}`,c)};e.fromSecretKey=u;const p=(y,a)=>{const c=(0,r.DidType)(a),h=(0,t.getHasher)(c.hash)(y,1);return l(h,c)};e.fromPublicKey=p;const l=(y,a)=>{const c=(0,r.DidType)(a),f=(0,s.stripHexPrefix)(y).slice(0,40),h=(0,t.getHasher)(c.hash),I=(0,r.fromTypeInfo)(c),S=(0,s.stripHexPrefix)(h(`0x${I}${f}`,1)).slice(0,8),O=`0x${I}${f}${S}`;return(0,r.isEthereumType)(c)?(0,r.toChecksumAddress)(`0x${y.slice(-40)}`):c.address===t.types.EncodingType.BASE58?(0,s.toBase58)(O):O};e.fromPublicKeyHash=l;const _=(y,a=t.types.RoleType.ROLE_ACCOUNT)=>{const c=Object.keys(t.types.RoleType),f=Object.values(t.types.RoleType);if(f.indexOf(a)===-1)throw new Error(`Unsupported role type ${a} when gen ddi from hash`);const h=(0,r.DidType)({role:t.types.RoleType[c[f.indexOf(a)]]});return l(y,h)};e.fromHash=_;const U=(y,a)=>{if(C(y)===!1)return!1;const c=(0,r.toTypeInfo)(y),f=p(a,c),h=y.replace(n.DID_PREFIX,"");return f===h};e.isFromPublicKey=U;const C=y=>{if(!y)return!1;const a=(0,s.toAddress)(String(y)),{hash:c}=(0,r.toTypeInfo)(a);if(typeof c>"u")return!1;if((0,r.isEthereumDid)(a))return!0;const f=(0,t.getHasher)(c),h=(0,n.toBytes)(a),I=(0,n.toStrictHex)(E.from(h.slice(0,22)).toString("hex")),S=(0,n.toStrictHex)(E.from(h.slice(22,26)).toString("hex")),O=(0,s.stripHexPrefix)(f(`0x${I}`,1)).slice(0,8);return S===O};e.isValid=C})(V);export{V as l};
1
+ import{cP as H,dy as M,dz as E,dA as g,dB as Y,dC as N,dD as j}from"./index-CqcpZ8C3.js";import{a as X}from"./isEqual-BLnnfE4T.js";var V={},i={},d={},q=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d,"__esModule",{value:!0});d.toStrictHex=d.toBytes=d.toBits=d.DID_PREFIX=void 0;const K=q(M),P=g,v="did:abt:";d.DID_PREFIX=v;const G=e=>{try{if((0,P.isHexStrict)(e))return E.from((0,P.stripHexPrefix)(e),"hex");let t=(0,P.fromBase58)(e.replace(v,""));for(;t.length<26;)t=E.concat([E.from([0]),t]);return t}catch(t){throw new Error(`Cannot convert DID string to byte array: ${t.message}`)}};d.toBytes=G;const J=(e,t)=>(0,K.default)((0,P.toBN)(e).toString(2),t,"0");d.toBits=J;const z=(e,t)=>{const s=e.replace(/^0x/i,"");return typeof t=="number"&&t%2===0?(0,K.default)(e,t,"0"):s.length%2===0?s:`0${s}`};d.toStrictHex=z;var A=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});i.DidType=i.toChecksumAddress=i.isEthereumDid=i.isEthereumType=i.toTypeInfoStr=i.toTypeInfo=i.fromTypeInfo=i.DID_TYPE_ETHEREUM=i.DID_TYPE_ARCBLOCK=void 0;const m=g,D=A(Y),W=A(X),$=A(N),o=j,T=d,b={pk:"key",address:"encoding"},B={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ED25519,hash:o.types.HashType.SHA3,address:o.types.EncodingType.BASE58};i.DID_TYPE_ARCBLOCK=B;const R={role:o.types.RoleType.ROLE_ACCOUNT,pk:o.types.KeyType.ETHEREUM,hash:o.types.HashType.KECCAK,address:o.types.EncodingType.BASE16};i.DID_TYPE_ETHEREUM=R;const F=e=>{const t=["pk","hash","address"];return(0,W.default)((0,$.default)(e,t),(0,$.default)(R,t))};i.isEthereumType=F;const L=e=>{const t=(0,m.toAddress)(e);return/^(0x)?[0-9a-f]{40}$/i.test(t)?/^(0x|0X)?[0-9a-f]{40}$/.test(t)||/^(0x|0X)?[0-9A-F]{40}$/.test(t)?!0:Q(t):!1};i.isEthereumDid=L;const Q=e=>{const t=e.replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t.toLowerCase()).replace(/^0x/i,"");for(let r=0;r<40;r++)if(parseInt(s[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(s[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},Z=e=>{if(typeof e>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error(`Given address "${e}" is not a valid Ethereum address.`);const t=e.toLowerCase().replace(/^0x/i,""),s=o.Hasher.Keccak.hash256(t).replace(/^0x/i,"");let r="0x";for(let n=0;n<t.length;n++)parseInt(s[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r};i.toChecksumAddress=Z;function k(e={}){let t={};["default","arcblock"].includes(e)?t=B:["eth","ethereum"].includes(e)?t=R:t={...B,...e};const{role:s,pk:r,hash:n,address:u}=t;Object.keys(t).forEach(l=>{const _=(0,D.default)(`${b[l]||l}Type`);if(Object.values(o.types[_]).includes(t[l])===!1)throw new Error(`Unsupported ${l} type: ${t[l]}`)});const p={role:s,pk:r,hash:n,address:u};return F(p)===!1&&[o.types.RoleType.ROLE_NODE,o.types.RoleType.ROLE_VALIDATOR,o.types.RoleType.ROLE_TETHER,o.types.RoleType.ROLE_SWAP].includes(p.role)&&(p.hash=o.types.HashType.SHA2),p}i.DidType=k;k.toJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=n[u.indexOf(e[s])],t},{});k.fromJSON=e=>Object.keys(e).reduce((t,s)=>{const r=(0,D.default)(`${b[s]||s}Type`),n=Object.keys(o.types[r]),u=Object.values(o.types[r]);return t[s]=u[n.indexOf(e[s])],t},{});const x=e=>{const t=k(e),s=(0,T.toBits)(t.role,6),r=(0,T.toBits)(t.pk,5),n=(0,T.toBits)(t.hash,5),u=`${s}${r}${n}`,p=(0,m.stripHexPrefix)((0,m.numberToHex)(parseInt(u,2)));return(0,T.toStrictHex)(p,4)};i.fromTypeInfo=x;const w=e=>{let t={};try{if(L(e))t=R;else{const r=(0,T.toBytes)(e).slice(0,2),n=(0,T.toStrictHex)(E.from(r).toString("hex")),u=(0,T.toBits)(new m.BN(n,16),16),p=u.slice(0,6),l=u.slice(6,11),_=u.slice(11,16);t={role:parseInt(p,2),pk:parseInt(l,2),hash:parseInt(_,2),address:(0,m.isHex)((0,m.toAddress)(e))?o.types.EncodingType.BASE16:o.types.EncodingType.BASE58}}return Object.keys(t).forEach(s=>{Object.values(o.types[`${(0,D.default)(b[s]||s)}Type`]).includes(t[s])===!1&&delete t[s]}),t}catch{return t}};i.toTypeInfo=w;const ee=e=>{const t=w(e);return Object.keys(t).reduce((s,r)=>{const n=o.types[`${(0,D.default)(b[r]||r)}Type`];return s[r]=Object.keys(n).find(u=>n[u]===t[r]),s},{})};i.toTypeInfoStr=ee;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_TYPE_ETHEREUM=e.DID_TYPE_ARCBLOCK=e.DID_PREFIX=e.DidType=e.fromTypeInfo=e.toTypeInfoStr=e.toTypeInfo=e.isEthereumType=e.isEthereumDid=e.isValid=e.isFromPublicKey=e.toDid=e.toAddress=e.fromHash=e.fromPublicKeyHash=e.fromPublicKey=e.fromSecretKey=e.toStrictHex=e.types=void 0;const t=j;Object.defineProperty(e,"types",{enumerable:!0,get:function(){return t.types}});const s=g;Object.defineProperty(e,"toAddress",{enumerable:!0,get:function(){return s.toAddress}}),Object.defineProperty(e,"toDid",{enumerable:!0,get:function(){return s.toDid}});const r=i;Object.defineProperty(e,"DidType",{enumerable:!0,get:function(){return r.DidType}}),Object.defineProperty(e,"DID_TYPE_ARCBLOCK",{enumerable:!0,get:function(){return r.DID_TYPE_ARCBLOCK}}),Object.defineProperty(e,"DID_TYPE_ETHEREUM",{enumerable:!0,get:function(){return r.DID_TYPE_ETHEREUM}}),Object.defineProperty(e,"fromTypeInfo",{enumerable:!0,get:function(){return r.fromTypeInfo}}),Object.defineProperty(e,"isEthereumDid",{enumerable:!0,get:function(){return r.isEthereumDid}}),Object.defineProperty(e,"isEthereumType",{enumerable:!0,get:function(){return r.isEthereumType}}),Object.defineProperty(e,"toTypeInfo",{enumerable:!0,get:function(){return r.toTypeInfo}}),Object.defineProperty(e,"toTypeInfoStr",{enumerable:!0,get:function(){return r.toTypeInfoStr}});const n=d;Object.defineProperty(e,"DID_PREFIX",{enumerable:!0,get:function(){return n.DID_PREFIX}}),Object.defineProperty(e,"toStrictHex",{enumerable:!0,get:function(){return n.toStrictHex}});const u=(y,a)=>{const c=(0,r.DidType)(a),f=(0,t.getSigner)(c.pk).getPublicKey(y);return p(f.indexOf("0x")===0?f:`0x${f}`,c)};e.fromSecretKey=u;const p=(y,a)=>{const c=(0,r.DidType)(a),h=(0,t.getHasher)(c.hash)(y,1);return l(h,c)};e.fromPublicKey=p;const l=(y,a)=>{const c=(0,r.DidType)(a),f=(0,s.stripHexPrefix)(y).slice(0,40),h=(0,t.getHasher)(c.hash),I=(0,r.fromTypeInfo)(c),S=(0,s.stripHexPrefix)(h(`0x${I}${f}`,1)).slice(0,8),O=`0x${I}${f}${S}`;return(0,r.isEthereumType)(c)?(0,r.toChecksumAddress)(`0x${y.slice(-40)}`):c.address===t.types.EncodingType.BASE58?(0,s.toBase58)(O):O};e.fromPublicKeyHash=l;const _=(y,a=t.types.RoleType.ROLE_ACCOUNT)=>{const c=Object.keys(t.types.RoleType),f=Object.values(t.types.RoleType);if(f.indexOf(a)===-1)throw new Error(`Unsupported role type ${a} when gen ddi from hash`);const h=(0,r.DidType)({role:t.types.RoleType[c[f.indexOf(a)]]});return l(y,h)};e.fromHash=_;const U=(y,a)=>{if(C(y)===!1)return!1;const c=(0,r.toTypeInfo)(y),f=p(a,c),h=y.replace(n.DID_PREFIX,"");return f===h};e.isFromPublicKey=U;const C=y=>{if(!y)return!1;const a=(0,s.toAddress)(String(y)),{hash:c}=(0,r.toTypeInfo)(a);if(typeof c>"u")return!1;if((0,r.isEthereumDid)(a))return!0;const f=(0,t.getHasher)(c),h=(0,n.toBytes)(a),I=(0,n.toStrictHex)(E.from(h.slice(0,22)).toString("hex")),S=(0,n.toStrictHex)(E.from(h.slice(22,26)).toString("hex")),O=(0,s.stripHexPrefix)(f(`0x${I}`,1)).slice(0,8);return S===O};e.isValid=C})(V);export{V as l};