@abtnode/webapp 1.16.28 → 1.16.29-beta-e04c6f40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-B8Ae2MjM.js → Add-xExgHDod.js} +1 -1
- package/dist/assets/{ArrowDropDown-BNt-WuI3.js → ArrowDropDown-KUzipi3t.js} +1 -1
- package/dist/assets/{Autocomplete-Bo6UH2XL.js → Autocomplete-Er311sva.js} +1 -1
- package/dist/assets/{Breadcrumbs-CkmMkQDW.js → Breadcrumbs-Pqx4il3S.js} +1 -1
- package/dist/assets/{ButtonGroup-OcQcEz6r.js → ButtonGroup-BcupcRIM.js} +1 -1
- package/dist/assets/{CheckCircle-BnRenrK4.js → CheckCircle-zUiCwNZs.js} +1 -1
- package/dist/assets/{ChevronLeft-Dp9aa91c.js → ChevronLeft-Bet4yQzf.js} +1 -1
- package/dist/assets/{ChevronRight-C3NPaw6o.js → ChevronRight-DVus-Y96.js} +1 -1
- package/dist/assets/{Close-Cbaq-RRq.js → Close-O3YNtovt.js} +1 -1
- package/dist/assets/Delete-DOCRW1Ln.js +1 -0
- package/dist/assets/{DeleteOutline-B4LqoCK2.js → DeleteOutline-CUojn4xn.js} +1 -1
- package/dist/assets/{Done-BCLH1e-Y.js → Done-BbWcazKr.js} +1 -1
- package/dist/assets/{Edit-i_Bman7K.js → Edit-BhCFwv7o.js} +1 -1
- package/dist/assets/{EditIcon-DmNEjmIQ.js → EditIcon-CERx0ivQ.js} +1 -1
- package/dist/assets/{FilterList-fpG1-3KQ.js → FilterList-BRYDdfFq.js} +4 -4
- package/dist/assets/{Google-DLkd6TAZ.js → Google-CdmAvvA5.js} +3 -3
- package/dist/assets/{Https-amCzjB1a.js → Https-D3zQe1g3.js} +1 -1
- package/dist/assets/{InputAdornment-C6LFxcti.js → InputAdornment-CiVUPEjM.js} +1 -1
- package/dist/assets/{InputLabel-avYwCvJM.js → InputLabel-Cl0jKlH9.js} +1 -1
- package/dist/assets/{LastPage-DnBOlrut.js → LastPage-DIXa5YVo.js} +1 -1
- package/dist/assets/{Launch-DPclIZbd.js → Launch-u57ssxVt.js} +1 -1
- package/dist/assets/{Link-DfSEdivF.js → Link-8ntBDNt-.js} +1 -1
- package/dist/assets/{LoadingButton-xveWP_M5.js → LoadingButton-BhxaC5Ed.js} +1 -1
- package/dist/assets/{LockIcon-9c7sG23a.js → LockIcon-CkFf2isB.js} +1 -1
- package/dist/assets/{Loop-DwAWKPvc.js → Loop-BnL-Vxc4.js} +1 -1
- package/dist/assets/{MoreVert-Nc1QBj2D.js → MoreVert-LBoMA9yq.js} +1 -1
- package/dist/assets/{Pagination-D5t0OCBH.js → Pagination-B0vuu0Jz.js} +1 -1
- package/dist/assets/{Public-BLh26Bb9.js → Public-BPRyPUP1.js} +1 -1
- package/dist/assets/{SchemaReference.es--oFfd0mm.js → SchemaReference.es-Cw9PnK9u.js} +1 -1
- package/dist/assets/{Search-DnnCUnjB.js → Search-DoXY8XQp.js} +1 -1
- package/dist/assets/{Select-CBA-xyOJ.js → Select-CSRNZbOq.js} +2 -2
- package/dist/assets/{Skeleton-CQPjJHp3.js → Skeleton-CZxXS4jE.js} +5 -5
- package/dist/assets/{Slider-Bdpm9oO4.js → Slider-BcITXKtu.js} +1 -1
- package/dist/assets/{Stepper-UEQaZPW7.js → Stepper-mccJibcr.js} +1 -1
- package/dist/assets/TextField-HCXJkIb-.js +1 -0
- package/dist/assets/{ToggleButtonGroup-Drarswgi.js → ToggleButtonGroup-DNi-APKM.js} +1 -1
- package/dist/assets/{ViewList-CoYI2XgO.js → ViewList-B0D9uEjF.js} +1 -1
- package/dist/assets/{actions-BAUfPsQv.js → actions-CAskIzvr.js} +1 -1
- package/dist/assets/actions-Cs-U54uv.js +11 -0
- package/dist/assets/{agreement-_qYynElX.js → agreement-Dqwk0Qk1.js} +3 -3
- package/dist/assets/api-UGqvGbaE.js +1 -0
- package/dist/assets/app-avatar-DnQtdz_O.js +1 -0
- package/dist/assets/ar-DDqDOM6_.js +1 -0
- package/dist/assets/{audit-logs-BqT_1MLt.js → audit-logs-elaTyIYr.js} +1 -1
- package/dist/assets/{brace-fold.es-CkrKXotH.js → brace-fold.es-CHAwFrP-.js} +1 -1
- package/dist/assets/{bundle-avatar-RiFaz1Hb.js → bundle-avatar-DQKqTcLf.js} +1 -1
- package/dist/assets/{chart-Cinf5zq_.js → chart-B4WtoTol.js} +1 -1
- package/dist/assets/{click-to-copy-Bj13kdln.js → click-to-copy-BxTGXnkW.js} +1 -1
- package/dist/assets/{closebrackets.es-C32XuxI5.js → closebrackets.es-Cowrx9Wh.js} +1 -1
- package/dist/assets/{codemirror.es-oms3GpFv.js → codemirror.es-DDaWBk7v.js} +1 -1
- package/dist/assets/{comment.es-AVZXTIDr.js → comment.es-BpMZ3nSF.js} +1 -1
- package/dist/assets/config-navigation-mgsMFCq0.js +25 -0
- package/dist/assets/de-Df9PmQSL.js +1 -0
- package/dist/assets/delete-confirm-G3-jMPGR.js +1 -0
- package/dist/assets/{detail-CHKmnQLc.js → detail-BBKDt7TH.js} +3 -3
- package/dist/assets/{dialog.es-DHZdXjGS.js → dialog.es-CRh6VOLz.js} +1 -1
- package/dist/assets/{download-DFPnF7mz.js → download-BK5ocL5s.js} +1 -1
- package/dist/assets/es-BQD9zWi-.js +1 -0
- package/dist/assets/{foldgutter.es-CSicbQSJ.js → foldgutter.es-CHLe3IFg.js} +1 -1
- package/dist/assets/fr-DNx2OQyQ.js +1 -0
- package/dist/assets/getValidReactChildren-C2KGwF2r.js +1 -0
- package/dist/assets/hi-BmEkoTIE.js +1 -0
- package/dist/assets/{hint.es-DAEQ9N76.js → hint.es-qHNwvQXY.js} +1 -1
- package/dist/assets/{hint.es2-DYXluLKu.js → hint.es2-DRHlNN6z.js} +1 -1
- package/dist/assets/id-DXu5sStK.js +1 -0
- package/dist/assets/{iframe-DwuYX0Xq.js → iframe-D-PNyLg3.js} +1 -1
- package/dist/assets/{index-B60jROHj.js → index-3ruoHhFa.js} +26 -26
- package/dist/assets/{index-zFXZLqso.js → index-3sl31tmo.js} +2 -2
- package/dist/assets/{index-CZKHzmkC.js → index-B1h0P1L0.js} +1 -1
- package/dist/assets/index-B1yKtvhn.js +54 -0
- package/dist/assets/{index-BbS1Wq4p.js → index-B6HWus5t.js} +1 -1
- package/dist/assets/{index-baq8DMtQ.js → index-BhwGm9ir.js} +9 -9
- package/dist/assets/{index-DKkTRBZn.js → index-BlSaylBC.js} +4 -4
- package/dist/assets/{index-DOsg2sHH.js → index-Boc7heJK.js} +1 -1
- package/dist/assets/{index-cmiUur_8.js → index-Boe-4fof.js} +1 -1
- package/dist/assets/{index-CiZAReVP.js → index-Br7MMAwb.js} +1 -1
- package/dist/assets/{index-ZQu91rXz.js → index-Bt8_a71i.js} +1 -1
- package/dist/assets/{index-BVznp3M0.js → index-C4esebAE.js} +1 -1
- package/dist/assets/{index-BbW2IRRR.js → index-C5c3sxc7.js} +3 -3
- package/dist/assets/{index-0RUAEm49.js → index-C7piHvhS.js} +2 -2
- package/dist/assets/{index-BKi0XLcv.js → index-C8OOX63T.js} +1 -1
- package/dist/assets/{index-DfNh08gP.js → index-CAP7ccf-.js} +3 -3
- package/dist/assets/{index-Cl2QG8J6.js → index-CCMFLAjE.js} +16 -16
- package/dist/assets/{index-CKOyruf_.js → index-CGedY69r.js} +2 -2
- package/dist/assets/{index-ByF3apMm.js → index-CI3-G8f5.js} +3 -3
- package/dist/assets/{index-9R6mPPbN.js → index-CMw6A55r.js} +1 -1
- package/dist/assets/index-COVe-oac.js +1 -0
- package/dist/assets/{index-D5MDxbqt.js → index-CTWxKp8R.js} +1 -1
- package/dist/assets/{index-DHYJxTcV.js → index-CU4Kco8M.js} +57 -57
- package/dist/assets/{index-DrWhB0MJ.js → index-CfjU2vkP.js} +1 -1
- package/dist/assets/{index-BBnT5XB9.js → index-Cjw9QiwF.js} +1 -1
- package/dist/assets/{index-CyYUysSv.js → index-CpWB9aT7.js} +1 -1
- package/dist/assets/{index-CIbzY-F7.js → index-CsGASsXO.js} +1 -1
- package/dist/assets/{index-v2cqn0eS.js → index-CuZgQfxG.js} +1 -1
- package/dist/assets/{index-BnFWpIPQ.js → index-Cx08Fq4-.js} +1 -1
- package/dist/assets/{index-CHjwpGia.js → index-D0mxQWU5.js} +7 -7
- package/dist/assets/{index-DSByvARI.js → index-DHWCojAQ.js} +1 -1
- package/dist/assets/{index-DcU_Cijj.js → index-DIJ53y8c.js} +1 -1
- package/dist/assets/index-DIbFXQTV.js +1 -0
- package/dist/assets/{index-7J6TijHC.js → index-Dkkm6kzm.js} +1 -1
- package/dist/assets/{index-rPqHtLu4.js → index-Dw9clXjq.js} +1 -1
- package/dist/assets/{index-CucnV9EX.js → index-DzW0Cxov.js} +25 -25
- package/dist/assets/index-LlxzMpy3.js +231 -0
- package/dist/assets/{index-DV2quTIn.js → index-M5WcRzZV.js} +1 -1
- package/dist/assets/index-P1GJ1Y4T.js +177 -0
- package/dist/assets/{index-CqcpZ8C3.js → index-Pf5VRxU2.js} +174 -210
- package/dist/assets/{index-CtzAe2AR.js → index-RQQsaMDK.js} +1 -1
- package/dist/assets/{index-DPx9NPlp.js → index-_RvLZsys.js} +1 -1
- package/dist/assets/index-hFhjFjqL.js +58 -0
- package/dist/assets/{index-ECk6dODK.js → index-y8_7sFXl.js} +10 -10
- package/dist/assets/{index.es-Dkh9ejMp.js → index.es-0GspS0hl.js} +1 -1
- package/dist/assets/{index.esm-Hqw0Nfnx.js → index.esm-CJT_Vb_Y.js} +1 -1
- package/dist/assets/{info-addon.es-5NmROke-.js → info-addon.es-BvWPiOWh.js} +1 -1
- package/dist/assets/{info.es-CsELEfUv.js → info.es-D6grONEz.js} +1 -1
- package/dist/assets/{install-from-url-DXGlT7R8.js → install-from-url-CLk48T0_.js} +1 -1
- package/dist/assets/invitation-4W3IOdXy.js +200 -0
- package/dist/assets/{is-path-prefix-equal-CoJozASB.js → is-path-prefix-equal-DQciVrFn.js} +1 -1
- package/dist/assets/{isEqual-BLnnfE4T.js → isEqual-C5Iu_kl-.js} +1 -1
- package/dist/assets/{item-tD3jAfba.js → item-C9bzNYRu.js} +31 -31
- package/dist/assets/ja-thyFR9rH.js +1 -0
- package/dist/assets/{javascript.es-BIUhEWTj.js → javascript.es-CWlPpygW.js} +1 -1
- package/dist/assets/{jump-to-line.es-BQjWkUgo.js → jump-to-line.es-D7dd2At6.js} +1 -1
- package/dist/assets/{jump.es-D8ZxFsmc.js → jump.es-WtAW-Ijf.js} +1 -1
- package/dist/assets/ko-BJSWgMML.js +1 -0
- package/dist/assets/{line-DW0juCGB.js → line-Cfyg0g9I.js} +4 -4
- package/dist/assets/{lint.es-Dv2pWRyz.js → lint.es-aUUps1ME.js} +1 -1
- package/dist/assets/{lint.es2-CqGQ_rnk.js → lint.es2-CDvv_d9A.js} +1 -1
- package/dist/assets/{lint.es3-g58ofVJA.js → lint.es3-DTrQmP6j.js} +1 -1
- package/dist/assets/{list-header-tjKXNgOR.js → list-header-BG2QMZZz.js} +1 -1
- package/dist/assets/{log-BFiA_Tyh.js → log-DIJPVIRP.js} +1 -1
- package/dist/assets/{lottie-yeTV0Y2m.js → lottie-BkwIvhEu.js} +1 -1
- package/dist/assets/{matchbrackets.es-B-Xj5H9Q.js → matchbrackets.es-CCjeMHPP.js} +1 -1
- package/dist/assets/{memory-C7a59RsU.js → memory-CYabGN8q.js} +1 -1
- package/dist/assets/{mode.es-BSNxo6gK.js → mode.es-kZQjUXx0.js} +1 -1
- package/dist/assets/{mode.es2-C1LDwVOl.js → mode.es2-hCaXf0ad.js} +1 -1
- package/dist/assets/{mode.es3-C6-ZTyOk.js → mode.es3-DlVh9_RV.js} +1 -1
- package/dist/assets/{onlineParser.es-BzK7GlZv.js → onlineParser.es-g03lcwfp.js} +1 -1
- package/dist/assets/overview-BFHUS9cz.js +23 -0
- package/dist/assets/{pt-fvVMjgC8.js → pt-D828CXoS.js} +1 -1
- package/dist/assets/{react-1fE0Sobf.js → react-DjQtZm70.js} +7 -7
- package/dist/assets/{redux-hfExDDyr.js → redux-0yltQfyb.js} +1 -1
- package/dist/assets/{resource-dialog-DinbvH2C.js → resource-dialog-B2vu5Of2.js} +2 -2
- package/dist/assets/ru-t_aX-wsm.js +1 -0
- package/dist/assets/{runtime-tAjj0dmb.js → runtime-C9hFU3Ij.js} +1 -1
- package/dist/assets/{search.es-DxfjuUNu.js → search.es-C20qP8Vq.js} +1 -1
- package/dist/assets/{searchcursor.es-C0Z2DY1c.js → searchcursor.es-Cy-3eaEN.js} +1 -1
- package/dist/assets/service-CkoGqY1V.js +1 -0
- package/dist/assets/{show-hint.es-q24U0q_A.js → show-hint.es-DAqKK5Qn.js} +1 -1
- package/dist/assets/{slicedToArray-CYGiqzmA.js → slicedToArray-Bl_ysqUF.js} +3 -3
- package/dist/assets/{spaces-C58gy1rM.js → spaces-CE3KwDvq.js} +1 -1
- package/dist/assets/{sublime.es-BffqyCoy.js → sublime.es-DPcVE8hJ.js} +1 -1
- package/dist/assets/{switch-control-CuPWIx6T.js → switch-control-CCSLs9W3.js} +1 -1
- package/dist/assets/{table-icons-DOOoyljy.js → table-icons-B9NLkXar.js} +10 -10
- package/dist/assets/{tag-Cxx1sXPF.js → tag-_nponNF2.js} +1 -1
- package/dist/assets/{team-BynFP1rM.js → team-wy2ENAAe.js} +1 -1
- package/dist/assets/th-DvaD_9E5.js +1 -0
- package/dist/assets/toUpper-D-lxmi1w.js +1 -0
- package/dist/assets/{traffic-D03HdfGL.js → traffic-BU3E2tw9.js} +5 -5
- package/dist/assets/{url-evaluation-dheoi_Nj.js → url-evaluation-CAG0Y4FK.js} +4 -4
- package/dist/assets/{url-join-DMIMYkEk.js → url-join-DMJmszyo.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DWywlTbc.js → use-blocklet-info-for-connect-did-spaces-Bc-o6Zkq.js} +1 -1
- package/dist/assets/{useLocalStorage-C3GQNaV2.js → useLocalStorage-D4xQyg06.js} +1 -1
- package/dist/assets/{util-cf4pvQDW.js → util-CuvemqGW.js} +1 -1
- package/dist/assets/vi-B4VdHKzm.js +1 -0
- package/dist/assets/{wait-container-BwlRhWl0.js → wait-container-CdR6E8LE.js} +4 -4
- package/dist/assets/{withStyles-BkcRLEgx.js → withStyles-Ct7uoTy7.js} +1 -1
- package/dist/assets/wrap-locale-C2k9YLGh.js +1 -0
- package/dist/assets/zh-D0ck6JaG.js +2 -0
- package/dist/assets/zh-tw-C19pg5Jo.js +1 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Delete-CnrKsAGC.js +0 -1
- package/dist/assets/TextField-DjRhIjo4.js +0 -1
- package/dist/assets/actions-C1t0ka-G.js +0 -11
- package/dist/assets/api-xvCGCwMn.js +0 -1
- package/dist/assets/app-avatar-DcgC0kB0.js +0 -1
- package/dist/assets/ar-B5gcsN0k.js +0 -1
- package/dist/assets/config-navigation-LFUjTzgk.js +0 -25
- package/dist/assets/de-WUCASh9G.js +0 -1
- package/dist/assets/delete-confirm-BoeDYrYX.js +0 -1
- package/dist/assets/es-DsRorAcf.js +0 -1
- package/dist/assets/fr-CUMFVKph.js +0 -1
- package/dist/assets/getValidReactChildren-GMOIXwRG.js +0 -1
- package/dist/assets/hi-BinC6-tx.js +0 -1
- package/dist/assets/id-BVFhYsL8.js +0 -1
- package/dist/assets/index-BKck0oIO.js +0 -234
- package/dist/assets/index-DU7hJgoO.js +0 -1
- package/dist/assets/index-DmPgcoiv.js +0 -150
- package/dist/assets/index-DsUZ7uiP.js +0 -58
- package/dist/assets/index-HOVCi07-.js +0 -54
- package/dist/assets/invitation-CSNEw5oM.js +0 -200
- package/dist/assets/ja-B1xj2XMp.js +0 -1
- package/dist/assets/ko-Buo9FEc0.js +0 -1
- package/dist/assets/overview-BlWFlRx2.js +0 -23
- package/dist/assets/ru-OQD02sOm.js +0 -1
- package/dist/assets/service-1GhnQw9a.js +0 -1
- package/dist/assets/th-DaDxf6qI.js +0 -1
- package/dist/assets/toUpper-mYvRPeiI.js +0 -1
- package/dist/assets/vi-D2hO2mdU.js +0 -1
- package/dist/assets/wrap-locale-BqGpRCMA.js +0 -1
- package/dist/assets/zh-OQY8LvIH.js +0 -2
- package/dist/assets/zh-tw-Dd8o0udA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as y,j as i,s as h,O as p,P as o}from"./index-
|
|
1
|
+
import{r as y,j as i,s as h,O as p,P as o}from"./index-Pf5VRxU2.js";var a={};Object.defineProperty(a,"__esModule",{value:!0});var f=a.default=void 0;v(y);var s=i;function v(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(n){g(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g(e,t,r){return t=b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=O(e,"string");return typeof t=="symbol"?t:String(t)}function O(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l=function(t){return(0,s.jsx)("svg",c(c({},t),{},{children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};l.displayName="empty";f=a.default=l;const j=h(p)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as l,
|
|
1
|
+
import{z as l,bf as m,u as p,j as s,S as u}from"./index-Pf5VRxU2.js";import{L as g,D as v}from"./download-BK5ocL5s.js";import{F as f,S as x}from"./Select-CSRNZbOq.js";import"./ButtonGroup-BcupcRIM.js";import"./getValidReactChildren-C2KGwF2r.js";function k(){const i=l(),{name:a="abtnode"}=m(),{info:n}=p(),r=n.routing.provider,o=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(r){const e=`Service Gateway(${r})`;o.push({id:`service-gateway-${r}`,name:e,types:["error","access"]})}const c=e=>{i(`/logs/${e.target.value}`)},d=s.jsx(f,{sx:{minWidth:240},children:s.jsx(x,{value:a,onChange:c,size:"small",children:o.map(e=>s.jsx(u,{value:e.id,children:e.name},e.id))})}),t=o.find(e=>e.id===a)||o[0];return s.jsx(g,{name:t.name,logId:t.id,types:t.types,prepend:d,postpend:s.jsx(v,{id:n.did,name:"blocklet-server"})},t.id)}export{k as default};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{aK as S,aL as D,j as e,bk as _,r as p,f as O,m as u,aW as U,aX as E,U as F,cc as V,B as $,C,bc as K,a7 as W,a8 as R,N as X,cd as w,ce as A,cf as L,a9 as I,a6 as P,ax as T,a2 as M,O as G,at as H,n as J,P as i,o as Q,cg as Y}from"./index-Pf5VRxU2.js";import{f as Z}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-B0vuu0Jz.js";import"./LastPage-DIXa5YVo.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,k=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,N),children:Z(new Date(t.createdAt),Q(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(C,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(W,{className:"notification-list",children:[c&&e.jsx(C,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:X,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:k(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:k(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
|
|
2
|
+
min-height: 60vh;
|
|
3
|
+
|
|
4
|
+
.page-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
.notification-actions {
|
|
10
|
+
width: auto;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.page-content {
|
|
17
|
+
margin-top: 16px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.list-item-avatar {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
min-width: 80px;
|
|
25
|
+
|
|
26
|
+
.notification-tag {
|
|
27
|
+
margin-top: 4px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.MuiListItem-root:not(.Mui-disabled) {
|
|
32
|
+
.MuiAvatar-root {
|
|
33
|
+
background: ${a=>a.theme.palette.primary.light};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.list-item-text {
|
|
38
|
+
.title {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
.time-ago {
|
|
42
|
+
background: #bdbdbd;
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
margin-left: 8px;
|
|
45
|
+
color: #f7f8f8;
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
padding: 1px 4px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.Mui-disabled .list-item-text .title .time-ago {
|
|
52
|
+
background: #666;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.list-item-secondary-text {
|
|
56
|
+
word-break: break-word;
|
|
57
|
+
}
|
|
58
|
+
`;h.propTypes={loading:i.bool,paging:i.objectOf(i.any),api:i.shape({readNotifications:i.func.isRequired,readBlockletNotifications:i.func.isRequired}).isRequired,notifications:i.arrayOf(i.shape({id:i.string,read:i.bool,entityType:i.string,title:i.string,createdAt:i.string,description:i.string}).isRequired).isRequired,updateNotifications:i.func.isRequired,teamDid:i.string};h.defaultProps={paging:!1,loading:!1,teamDid:""};function ce(){const{api:a,data:o,paging:c,refresh:s,loading:r}=Y();return e.jsx(h,{paging:c,loading:r,api:a,notifications:o,updateNotifications:s})}export{ce as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var
|
|
1
|
+
var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>(Ht(e,typeof t!="symbol"?t+"":t,n),n);import{P as l,j as d,ce,fP as ot,fQ as Ut,r as T,cn as Dt,ci as Bt,a2 as Qt,fR as _e,dS as Vt,dQ as Wt,fS as Zt,dP as Gt,d8 as A,a7 as Jt,a8 as Yt,fT as Xt,O as P,fU as Kt,m as en,fV as tn,fW as nn,B as on,fX as rn,fB as rt,q as te,fY as sn,fZ as cn,co as an,f_ as ln,s as M,f$ as st,g0 as un,c8 as it,g1 as fn,aA as ct,bU as de,b3 as dn,ba as pn,cp as at,g2 as hn}from"./index-Pf5VRxU2.js";/**
|
|
2
2
|
* (c) Iconify
|
|
3
3
|
*
|
|
4
4
|
* For the full copyright and license information, please view the license.txt
|
|
@@ -8,7 +8,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
* @version 1.0.8
|
|
11
|
-
*/const lt=Object.freeze({left:0,top:0,width:16,height:16}),J=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),U=Object.freeze({...lt,...J}),pe=Object.freeze({...U,body:"",hidden:!1}),gn=Object.freeze({width:null,height:null}),ut=Object.freeze({...gn,...J});function mn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const yn=/[\s,]+/;function bn(e,t){t.split(yn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const ft={...ut,preserveAspectRatio:""};function _e(e){const t={...ft},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=mn(n("rotate","")),bn(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function xn(e,t){for(const n in ft)if(e[n]!==t[n])return!0;return!1}const _=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Z(a,n)?null:a}return null},Z=(e,t)=>e?!!((e.provider===""||e.provider.match(_))&&(t&&e.prefix===""||e.prefix.match(_))&&e.name.match(_)):!1;function wn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Fe(e,t){const n=wn(e,t);for(const r in pe)r in J?r in e&&!(r in n)&&(n[r]=J[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function vn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function kn(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Fe(r[a]||o[a],s)}return i(t),n.forEach(i),Fe(e,s)}function dt(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=vn(e);for(const o in r){const s=r[o];s&&(t(o,kn(e,o,s)),n.push(o))}return n}const jn={provider:"",aliases:{},not_found:{},...lt};function ae(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function pt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ae(e,jn))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(_)||typeof s.body!="string"||!ae(s,pe))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(_)||typeof i!="string"||!n[i]&&!r[i]||!ae(s,pe))return null}return t}const Y=Object.create(null);function In(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function L(e,t){const n=Y[e]||(Y[e]=Object.create(null));return n[t]||(n[t]=In(e,t))}function ve(e,t){return pt(t)?dt(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Sn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Tn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Y)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Y[o]||{})).forEach(i=>{const a=L(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let z=!1;function ht(e){return typeof e=="boolean"&&(z=e),z}function H(e){const t=typeof e=="string"?B(e,!0,z):e;if(t){const n=L(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function gt(e,t){const n=B(e,!0,z);if(!n)return!1;const r=L(n.provider,n.prefix);return Sn(r,n.name,t)}function ze(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),z&&!t&&!e.prefix){let o=!1;return pt(e)&&(e.prefix="",dt(e,(s,i)=>{i&>(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Z({provider:t,prefix:n,name:"a"}))return!1;const r=L(t,n);return!!ve(r,e)}function Cn(e){return!!H(e)}function An(e){const t=H(e);return t?{...U,...t}:null}function Pn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=L(s,i));let f;a in u.icons?f=t.loaded:i===""||u.missing.has(a)?f=t.missing:f=t.pending;const p={provider:s,prefix:i,name:a};f.push(p)}),t}function mt(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(e.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||mt([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Nn=0;function Ln(e,t,n){const r=Nn++,o=mt.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const he=Object.create(null);function He(e,t){he[e]=t}function ge(e){return he[e]||he[""]}function Rn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?B(o,t,n):o;s&&r.push(s)}),r}var On={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function En(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let y=e.resources.slice(0);for(i=[];y.length>1;){const I=Math.floor(Math.random()*y.length);i.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}i=i.concat(y)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof r=="function"&&g.push(r);function m(){p&&(clearTimeout(p),p=null)}function x(){c==="pending"&&(c="aborted"),m(),h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function v(y,I){I&&(g=[]),typeof y=="function"&&g.push(y)}function k(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:h.length,subscribe:v,abort:x}}function b(){c="failed",g.forEach(y=>{y(void 0,f)})}function w(){h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function C(y,I,N){const S=I!=="success";switch(h=h.filter(R=>R!==y),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=N,b();return}if(S){f=N,h.length||(i.length?j():b());return}if(m(),w(),!e.random){const R=e.resources.indexOf(y.resource);R!==-1&&R!==e.index&&(e.index=R)}c="completed",g.forEach(R=>{R(N)})}function j(){if(c!=="pending")return;m();const y=i.shift();if(y===void 0){if(h.length){p=setTimeout(()=>{m(),c==="pending"&&(w(),b())},e.timeout);return}b();return}const I={status:"pending",resource:y,callback:(N,S)=>{C(I,N,S)}};h.push(I),u++,p=setTimeout(j,e.rotate),n(y,t,I.callback)}return setTimeout(j),k}function yt(e){const t={...On,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const f=En(t,a,c,(p,h)=>{r(),u&&u(p,h)});return n.push(f),f}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ke(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ne=Object.create(null),q=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;q.length>0;)q.length===1||Math.random()>.5?G.push(q.shift()):G.push(q.pop());ne[""]=ke({resources:["https://api.iconify.design"].concat(G)});function De(e,t){const n=ke(t);return n===null?!1:(ne[e]=n,!0)}function oe(e){return ne[e]}function $n(){return Object.keys(ne)}function Ue(){}const le=Object.create(null);function qn(e){if(!le[e]){const t=oe(e);if(!t)return;const n=yt(t),r={config:t,redundancy:n};le[e]=r}return le[e]}function bt(e,t,n){let r,o;if(typeof e=="string"){const s=ge(e);if(!s)return n(void 0,424),Ue;o=s.send;const i=qn(e);i&&(r=i.redundancy)}else{const s=ke(e);if(s){r=yt(s);const i=e.resources?e.resources[0]:"",a=ge(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),Ue):r.query(t,o,n)().abort}const Be="iconify2",D="iconify",xt=D+"-count",Ve=D+"-version",wt=36e5,_n=168;function me(e,t){try{return e.getItem(t)}catch{}}function je(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Qe(e,t){try{e.removeItem(t)}catch{}}function ye(e,t){return je(e,xt,t.toString())}function be(e){return parseInt(me(e,xt))||0}const O={local:!0,session:!0},vt={local:new Set,session:new Set};let Ie=!1;function Fn(e){Ie=e}let W=typeof window>"u"?{}:window;function kt(e){const t=e+"Storage";try{if(W&&W[t]&&typeof W[t].length=="number")return W[t]}catch{}O[e]=!1}function jt(e,t){const n=kt(e);if(!n)return;const r=me(n,Ve);if(r!==Be){if(r){const a=be(n);for(let c=0;c<a;c++)Qe(n,D+c.toString())}je(n,Ve,Be),ye(n,0);return}const o=Math.floor(Date.now()/wt)-_n,s=a=>{const c=D+a.toString(),u=me(n,c);if(typeof u=="string"){try{const f=JSON.parse(u);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>o&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}Qe(n,c)}};let i=be(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ye(n,i)):vt[e].add(a))}function It(){if(!Ie){Fn(!0);for(const e in O)jt(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=L(r,o);if(!ve(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function zn(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in O)jt(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Hn(e,t){Ie||It();function n(r){let o;if(!O[r]||!(o=kt(r)))return;const s=vt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=be(o),!ye(o,i+1))return;const a={cached:Math.floor(Date.now()/wt),provider:e.provider,data:t};return je(o,D+i.toString(),JSON.stringify(a))}t.lastModified&&!zn(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function We(){}function Dn(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Mn(e)}))}function Un(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ge(n)))return;s.prepare(n,r,o).forEach(a=>{bt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=ve(e,c);if(!u.length)return;const f=e.pendingIcons;f&&u.forEach(p=>{f.delete(p)}),Hn(e,c)}catch(u){console.error(u)}Dn(e)})})}))}const Se=(e,t)=>{const n=Rn(e,!0,ht()),r=Pn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,We)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===a&&u===i)return;i=u,a=f,s.push(L(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=L(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const{provider:u,prefix:f}=c;o[u][f].length&&Un(c,o[u][f])}),t?Ln(t,r,s):We},Bn=e=>new Promise((t,n)=>{const r=typeof e=="string"?B(e,!0):e;if(!r){n(e);return}Se([r||e],o=>{if(o.length&&r){const s=H(r);if(s){t({...U,...s});return}}n(e)})});function Vn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Qn(e,t){const n=typeof e=="string"?B(e,!0,!0):null;if(!n){const s=Vn(e);return{value:e,data:s}}const r=H(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=Se([n],()=>t(e,n,H(n)));return{value:e,name:n,loading:o}}function ue(e){return e.hasAttribute("inline")}let St=!1;try{St=navigator.vendor.indexOf("Apple")===0}catch{}function Wn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(St||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const Zn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Gn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xe(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Zn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Gn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Jn=e=>e==="unset"||e==="undefined"||e==="none";function Tt(e,t){const n={...U,...e},r={...ut,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(m=>{const x=[],v=m.hFlip,k=m.vFlip;let b=m.rotate;v?k?b+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):k&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=o.height/2+o.top,x.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,x.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let f,p;i===null?(p=a===null?"1em":a==="auto"?u:a,f=xe(p,c/u)):(f=i==="auto"?c:i,p=a===null?xe(f,u/c):a==="auto"?u:a);const h={},g=(m,x)=>{Jn(x)||(h[m]=x.toString())};return g("width",f),g("height",p),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Yn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=Yn();function Xn(e){X=e}function Kn(){return X}function eo(e,t){const n=oe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function to(e){return e===404}const no=(e,t,n)=>{const r=[],o=eo(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function oo(e){if(typeof e=="string"){const t=oe(e);if(t)return t.path}return"/"}const ro=(e,t,n)=>{if(!X){n("abort",424);return}let r=oo(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(to(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},so={prepare:no,send:ro};function Ze(e,t){switch(e){case"local":case"session":O[e]=t;break;case"all":for(const n in O)O[n]=t;break}}const fe="data-style";let Ct="";function io(e){Ct=e}function Ge(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(fe));n||(n=document.createElement("style"),n.setAttribute(fe,fe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Ct}function At(){He("",so),ht(!0);let e;try{e=window}catch{}if(e){if(It(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ze(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;De(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ze(n,!0),disableCache:n=>Ze(n,!1),iconExists:Cn,getIcon:An,listIcons:Tn,addIcon:gt,addCollection:ze,calculateSize:xe,buildIcon:Tt,loadIcons:Se,loadIcon:Bn,addAPIProvider:De,appendCustomStyle:io,_api:{getAPIConfig:oe,setAPIModule:He,sendAPIQuery:bt,setFetch:Xn,getFetch:Kn,listAPIProviders:$n}}}function Pt(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function co(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ao(e){return"data:image/svg+xml,"+co(e)}function lo(e){return'url("'+ao(e)+'")'}const we={"background-color":"currentColor"},Mt={"background-color":"transparent"},Je={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ye={"-webkit-mask":we,mask:we,background:Mt};for(const e in Ye){const t=Ye[e];for(const n in Je)t[e+"-"+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function uo(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=Pt(o,{...s,width:t.width+"",height:t.height+""}),a=lo(i),c=r.style,u={"--svg":a,width:Xe(s.width),height:Xe(s.height),...n?we:Mt};for(const f in u)c.setProperty(f,u[f]);return r}let F;function fo(){try{F=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{F=null}}function po(e){return F===void 0&&fo(),F?F.createHTML(e):e}function ho(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Pt(e.body,n);return t.innerHTML=po(o),t.firstChild}function Ke(e,t){const n=t.icon.data,r=t.customisations,o=Tt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=ho(o);break;default:i=uo(o,{...U,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function et(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function go(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();Q(this,"_shadowRoot");Q(this,"_state");Q(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=ue(this);Ge(c,u),this._state=et({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=ue(this),f=this._state;u!==f.inline&&(f.inline=u,Ge(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ue(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}Ke(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const f=this.getAttribute("mode"),p=_e(this);(c.attrMode!==f||xn(c.customisations,p))&&this._renderIcon(c.icon,p,f)}_iconChanged(c){const u=Qn(c,(f,p,h)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==f)return;const m={value:f,name:p,data:h};m.data?this._gotIconData(m):g.icon=m});u.data?this._gotIconData(u):this._state=et(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,_e(this),this.getAttribute("mode"))}_renderIcon(c,u,f){const p=Wn(c.data.body,f),h=this._state.inline;Ke(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:f,renderedMode:p})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=At();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}go()||At();const E=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:E(r[n],t,n)}):t(r)),Nt=(e,t="children")=>{const n=[];return E(e,r=>n.push(r),t),n},Te=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=Te(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),Lt=e=>/^https?:\/\//.test(e),mo=e=>/^[\w-]+:[\w-]+$/.test(e),yo=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},Rt=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>yo(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};function V({icon:e,size:t,sx:n,...r}){const o=[...Array.isArray(n)?n:[n]];if(t&&o.push({width:t,height:t}),r.variant||o.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),Lt(e))return d.jsx(ce,{as:"span",...r,src:e,sx:o});if(mo(e)){const s=t?.6*t+4:0;return d.jsx(ce,{as:"span",...r,sx:o,children:d.jsx("iconify-icon",{icon:e,height:s||void 0})})}return e&&typeof e=="string"?(o.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),d.jsx(ce,{as:"span",...r,sx:o,children:Array.from(e)[0]})):null}V.propTypes={icon:l.string.isRequired,size:l.number,sx:l.oneOfType([l.array,l.func,l.object])};V.defaultProps={size:null,sx:null};const bo=ot();function re({theme:e,children:t}){const n=e?ot(e):bo;return d.jsx(Dt,{theme:n,children:t})}re.propTypes={children:l.any.isRequired,theme:l.object};re.defaultProps={theme:null};const Ce=l.shape({appLogo:l.node,appName:l.string,theme:l.shape({background:l.string}),enableConnect:l.bool,enableLocale:l.bool,navigation:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object]),icon:l.string,items:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object])}))}))}),Ae=l.shape({showText:l.bool,showRole:l.bool,switchDid:l.bool,switchProfile:l.bool,switchPassport:l.bool,disableLogout:l.bool,onLogin:l.func,onLogout:l.func,onSwitchDid:l.func,onSwitchProfile:l.func,onSwitchPassport:l.func,menu:l.array,menuRender:l.func,dark:l.bool,size:l.number});var tt,nt;const K=((tt=window==null?void 0:window.blocklet)==null?void 0:tt.groupPrefix)||((nt=window==null?void 0:window.blocklet)==null?void 0:nt.prefix)||"/",xo=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},$=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(Lt(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return E(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},wo=e=>E(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),vo=e=>{if(!(e!=null&&e.length))return null;const t=wo(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},Pe=e=>{if(!e)return null;const t={...e};return t.theme=xo(t.theme),t.navigation=vo(ko(t.navigation)),t},ko=(e=[])=>Te(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),Ot=(e,t)=>Te(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),jo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Io={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Me({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var u;return!!((c==null?void 0:c.role)||[]).includes(((u=e==null?void 0:e.user)==null?void 0:u.role)||"guest")}).map(c=>{const u=((r==null?void 0:r.componentMountPoints)||[]).find(f=>c.component===f.name);return{...c,component:u}}),s=T.useRef(null),i=Ut({open:!1}),a=Bt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:d.jsxs(d.Fragment,{children:[d.jsx(Vt,{size:"medium",ref:s,onClick:()=>a(),children:d.jsx(qe,{icon:jo,fontSize:n,style:{transform:"scale(1.08)"}})}),d.jsx(Qt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>d.jsx(Wt,{onClickAway:u=>{u.preventDefault(),u.stopPropagation(),a(!1)},children:d.jsx(Zt,{...c,timeout:350,children:d.jsxs(Gt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[d.jsx(Jt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(u=>{var f;return d.jsx(Yt,{disablePadding:!0,children:d.jsxs(Xt,{href:u.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(f=u==null?void 0:u.component)!=null&&f.did?d.jsx(P,{component:"img",src:`${Kt}/blocklet/logo-bundle/${u.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):d.jsx(qe,{fontSize:50,icon:u.icon||Io,color:A.textSubtitle}),d.jsx(en,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:tn(u.title,t)})]})},u.id)})}),d.jsx(nn,{session:e,children:d.jsx(on,{variant:"outlined",fullWidth:!0,href:rn,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}Me.propTypes={session:l.object.isRequired,locale:l.string,size:l.number};Me.defaultProps={locale:"en",size:24};function se({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var h,g,m,x;const r=T.useContext(rt),{locale:o}=te()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=$((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=Ot(c,(x=(m=r==null?void 0:r.session)==null?void 0:m.user)==null?void 0:x.role);const f=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let v=[];if(i&&o&&v.push(d.jsx(sn,{showText:!1},"locale-selector")),s&&r){const k=[];a&&(c?c.slice(0,5):[]).forEach(w=>{k.push({label:w.title,icon:w.icon?d.jsx("iconify-icon",{icon:w.icon,height:24,style:{marginRight:8}}):null,component:"a",href:w.link,key:w.link})}),v.push(d.jsx(Me,{session:r.session,locale:o},"session-blocklet")),v.push(d.jsx(cn,{session:r.session,locale:o,menu:k,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(v=t(v)||[]),v})();return T.createElement(d.Fragment,null,...Array.isArray(f)?f:[f])}se.propTypes={formattedBlocklet:l.object.isRequired,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae};se.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Et=()=>{const e=an();T.useEffect(()=>{e.wallet&&ln.call("arcHideTopBar","{}")},[e])},So=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const r=E(e,i=>{var u,f;const a=i.icon?d.jsx(V,{icon:i.icon}):null;if(i.items)return{id:`${t++}`,label:i.title,icon:a,children:i.items};let c={};return((u=i.link)!=null&&u.startsWith("http://")||(f=i.link)!=null&&f.startsWith("https://"))&&(c={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:d.jsx("a",{href:i.link,...c,children:i.title}),icon:a,link:i.link}},"items"),o=Nt(r),s=Rt(o.map(i=>i.link));return{navItems:r,activeId:s>=0?o[s].id:null}};function Ne({meta:e,addons:t,sessionManagerProps:n,homeLink:r,theme:o,hideNavMenu:s,...i}){var b,w;Et();const{locale:a}=te()||{},c=T.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return Pe(C)}catch(j){return console.error("Failed to format blocklet info",j,C),C}},[e]);if(!c.appName)return null;const{appLogo:u,appLogoRect:f,theme:p}=c,h=$((b=c==null?void 0:c.navigation)==null?void 0:b.header,a),g=So(h),{navItems:m,activeId:x}=g,v=typeof t=="function"?C=>t(C,{navigation:g}):t,k=d.jsx(se,{formattedBlocklet:c,addons:v,sessionManagerProps:n});return d.jsx(re,{theme:o,children:d.jsx(To,{homeLink:r,logo:d.jsx("img",{src:f||u,alt:"logo"}),addons:k,...it(i,["bordered"]),$bordered:i==null?void 0:i.bordered,$bgcolor:(w=p==null?void 0:p.background)==null?void 0:w.header,children:s||!(m!=null&&m.length)?null:({isMobile:C})=>d.jsx(fn,{mode:C?"inline":"horizontal",activeId:x,items:m,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}Ne.propTypes={meta:Ce,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,homeLink:l.string,theme:l.object,hideNavMenu:l.bool};Ne.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:K,theme:null,hideNavMenu:!1};const To=M(un)`
|
|
11
|
+
*/const lt=Object.freeze({left:0,top:0,width:16,height:16}),J=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),D=Object.freeze({...lt,...J}),pe=Object.freeze({...D,body:"",hidden:!1}),gn=Object.freeze({width:null,height:null}),ut=Object.freeze({...gn,...J});function mn(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const yn=/[\s,]+/;function bn(e,t){t.split(yn).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const ft={...ut,preserveAspectRatio:""};function qe(e){const t={...ft},n=(r,o)=>e.getAttribute(r)||o;return t.width=n("width",null),t.height=n("height",null),t.rotate=mn(n("rotate","")),bn(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function xn(e,t){for(const n in ft)if(e[n]!==t[n])return!0;return!1}const q=/^[a-z0-9]+(-[a-z0-9]+)*$/,B=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),u={provider:o.length>0?o[0]:r,prefix:c,name:a};return t&&!Z(u)?null:u}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Z(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:s};return t&&!Z(a,n)?null:a}return null},Z=(e,t)=>e?!!((e.provider===""||e.provider.match(q))&&(t&&e.prefix===""||e.prefix.match(q))&&e.name.match(q)):!1;function wn(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Fe(e,t){const n=wn(e,t);for(const r in pe)r in J?r in e&&!(r in n)&&(n[r]=J[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function vn(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(n[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),o}function kn(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=Fe(r[a]||o[a],s)}return i(t),n.forEach(i),Fe(e,s)}function dt(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=vn(e);for(const o in r){const s=r[o];s&&(t(o,kn(e,o,s)),n.push(o))}return n}const jn={provider:"",aliases:{},not_found:{},...lt};function ae(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function pt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ae(e,jn))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(q)||typeof s.body!="string"||!ae(s,pe))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(q)||typeof i!="string"||!n[i]&&!r[i]||!ae(s,pe))return null}return t}const Y=Object.create(null);function In(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function N(e,t){const n=Y[e]||(Y[e]=Object.create(null));return n[t]||(n[t]=In(e,t))}function ve(e,t){return pt(t)?dt(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Sn(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Tn(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Y)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Y[o]||{})).forEach(i=>{const a=N(o,i);n=n.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),n}let z=!1;function ht(e){return typeof e=="boolean"&&(z=e),z}function H(e){const t=typeof e=="string"?B(e,!0,z):e;if(t){const n=N(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function gt(e,t){const n=B(e,!0,z);if(!n)return!1;const r=N(n.provider,n.prefix);return Sn(r,n.name,t)}function ze(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),z&&!t&&!e.prefix){let o=!1;return pt(e)&&(e.prefix="",dt(e,(s,i)=>{i&>(s,i)&&(o=!0)})),o}const n=e.prefix;if(!Z({provider:t,prefix:n,name:"a"}))return!1;const r=N(t,n);return!!ve(r,e)}function Cn(e){return!!H(e)}function An(e){const t=H(e);return t?{...D,...t}:null}function Pn(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=n[s]||(n[s]=Object.create(null)),u=c[i]||(c[i]=N(s,i));let f;a in u.icons?f=t.loaded:i===""||u.missing.has(a)?f=t.missing:f=t.pending;const p={provider:s,prefix:i,name:a};f.push(p)}),t}function mt(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Mn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const u=c.name;if(e.icons[u])i.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))i.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),i.pending.length!==a&&(n||mt([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Ln=0;function Nn(e,t,n){const r=Ln++,o=mt.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const he=Object.create(null);function He(e,t){he[e]=t}function ge(e){return he[e]||he[""]}function Rn(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?B(o,t,n):o;s&&r.push(s)}),r}var On={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function En(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let y=e.resources.slice(0);for(i=[];y.length>1;){const I=Math.floor(Math.random()*y.length);i.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}i=i.concat(y)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",u=0,f,p=null,h=[],g=[];typeof r=="function"&&g.push(r);function m(){p&&(clearTimeout(p),p=null)}function x(){c==="pending"&&(c="aborted"),m(),h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function v(y,I){I&&(g=[]),typeof y=="function"&&g.push(y)}function k(){return{startTime:a,payload:t,status:c,queriesSent:u,queriesPending:h.length,subscribe:v,abort:x}}function b(){c="failed",g.forEach(y=>{y(void 0,f)})}function w(){h.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),h=[]}function C(y,I,L){const S=I!=="success";switch(h=h.filter(R=>R!==y),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){f=L,b();return}if(S){f=L,h.length||(i.length?j():b());return}if(m(),w(),!e.random){const R=e.resources.indexOf(y.resource);R!==-1&&R!==e.index&&(e.index=R)}c="completed",g.forEach(R=>{R(L)})}function j(){if(c!=="pending")return;m();const y=i.shift();if(y===void 0){if(h.length){p=setTimeout(()=>{m(),c==="pending"&&(w(),b())},e.timeout);return}b();return}const I={status:"pending",resource:y,callback:(L,S)=>{C(I,L,S)}};h.push(I),u++,p=setTimeout(j,e.rotate),n(y,t,I.callback)}return setTimeout(j),k}function yt(e){const t={...On,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function o(a,c,u){const f=En(t,a,c,(p,h)=>{r(),u&&u(p,h)});return n.push(f),f}function s(a){return n.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function ke(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ne=Object.create(null),_=["https://api.simplesvg.com","https://api.unisvg.com"],G=[];for(;_.length>0;)_.length===1||Math.random()>.5?G.push(_.shift()):G.push(_.pop());ne[""]=ke({resources:["https://api.iconify.design"].concat(G)});function Ue(e,t){const n=ke(t);return n===null?!1:(ne[e]=n,!0)}function oe(e){return ne[e]}function $n(){return Object.keys(ne)}function De(){}const le=Object.create(null);function _n(e){if(!le[e]){const t=oe(e);if(!t)return;const n=yt(t),r={config:t,redundancy:n};le[e]=r}return le[e]}function bt(e,t,n){let r,o;if(typeof e=="string"){const s=ge(e);if(!s)return n(void 0,424),De;o=s.send;const i=_n(e);i&&(r=i.redundancy)}else{const s=ke(e);if(s){r=yt(s);const i=e.resources?e.resources[0]:"",a=ge(i);a&&(o=a.send)}}return!r||!o?(n(void 0,424),De):r.query(t,o,n)().abort}const Be="iconify2",U="iconify",xt=U+"-count",Qe=U+"-version",wt=36e5,qn=168;function me(e,t){try{return e.getItem(t)}catch{}}function je(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ve(e,t){try{e.removeItem(t)}catch{}}function ye(e,t){return je(e,xt,t.toString())}function be(e){return parseInt(me(e,xt))||0}const O={local:!0,session:!0},vt={local:new Set,session:new Set};let Ie=!1;function Fn(e){Ie=e}let W=typeof window>"u"?{}:window;function kt(e){const t=e+"Storage";try{if(W&&W[t]&&typeof W[t].length=="number")return W[t]}catch{}O[e]=!1}function jt(e,t){const n=kt(e);if(!n)return;const r=me(n,Qe);if(r!==Be){if(r){const a=be(n);for(let c=0;c<a;c++)Ve(n,U+c.toString())}je(n,Qe,Be),ye(n,0);return}const o=Math.floor(Date.now()/wt)-qn,s=a=>{const c=U+a.toString(),u=me(n,c);if(typeof u=="string"){try{const f=JSON.parse(u);if(typeof f=="object"&&typeof f.cached=="number"&&f.cached>o&&typeof f.provider=="string"&&typeof f.data=="object"&&typeof f.data.prefix=="string"&&t(f,a))return!0}catch{}Ve(n,c)}};let i=be(n);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,ye(n,i)):vt[e].add(a))}function It(){if(!Ie){Fn(!0);for(const e in O)jt(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=N(r,o);if(!ve(s,n).length)return!1;const i=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function zn(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in O)jt(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Hn(e,t){Ie||It();function n(r){let o;if(!O[r]||!(o=kt(r)))return;const s=vt[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=be(o),!ye(o,i+1))return;const a={cached:Math.floor(Date.now()/wt),provider:e.provider,data:t};return je(o,U+i.toString(),JSON.stringify(a))}t.lastModified&&!zn(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function We(){}function Un(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Mn(e)}))}function Dn(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ge(n)))return;s.prepare(n,r,o).forEach(a=>{bt(n,a,c=>{if(typeof c!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=ve(e,c);if(!u.length)return;const f=e.pendingIcons;f&&u.forEach(p=>{f.delete(p)}),Hn(e,c)}catch(u){console.error(u)}Un(e)})})}))}const Se=(e,t)=>{const n=Rn(e,!0,ht()),r=Pn(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,We)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:u,prefix:f}=c;if(f===a&&u===i)return;i=u,a=f,s.push(N(u,f));const p=o[u]||(o[u]=Object.create(null));p[f]||(p[f]=[])}),r.pending.forEach(c=>{const{provider:u,prefix:f,name:p}=c,h=N(u,f),g=h.pendingIcons||(h.pendingIcons=new Set);g.has(p)||(g.add(p),o[u][f].push(p))}),s.forEach(c=>{const{provider:u,prefix:f}=c;o[u][f].length&&Dn(c,o[u][f])}),t?Nn(t,r,s):We},Bn=e=>new Promise((t,n)=>{const r=typeof e=="string"?B(e,!0):e;if(!r){n(e);return}Se([r||e],o=>{if(o.length&&r){const s=H(r);if(s){t({...D,...s});return}}n(e)})});function Qn(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Vn(e,t){const n=typeof e=="string"?B(e,!0,!0):null;if(!n){const s=Qn(e);return{value:e,data:s}}const r=H(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const o=Se([n],()=>t(e,n,H(n)));return{value:e,name:n,loading:o}}function ue(e){return e.hasAttribute("inline")}let St=!1;try{St=navigator.vendor.indexOf("Apple")===0}catch{}function Wn(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(St||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const Zn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Gn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xe(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Zn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=Gn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const Jn=e=>e==="unset"||e==="undefined"||e==="none";function Tt(e,t){const n={...D,...e},r={...ut,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(m=>{const x=[],v=m.hFlip,k=m.vFlip;let b=m.rotate;v?k?b+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):k&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=o.height/2+o.top,x.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,x.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,u=o.height;let f,p;i===null?(p=a===null?"1em":a==="auto"?u:a,f=xe(p,c/u)):(f=i==="auto"?c:i,p=a===null?xe(f,u/c):a==="auto"?u:a);const h={},g=(m,x)=>{Jn(x)||(h[m]=x.toString())};return g("width",f),g("height",p),h.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+u.toString(),{attributes:h,body:s}}const Yn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let X=Yn();function Xn(e){X=e}function Kn(){return X}function eo(e,t){const n=oe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(i=>{o=Math.max(o,i.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function to(e){return e===404}const no=(e,t,n)=>{const r=[],o=eo(e,t),s="icons";let i={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((c,u)=>{a+=c.length+1,a>=o&&u>0&&(r.push(i),i={type:s,provider:e,prefix:t,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function oo(e){if(typeof e=="string"){const t=oe(e);if(t)return t.path}return"/"}const ro=(e,t,n)=>{if(!X){n("abort",424);return}let r=oo(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;X(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{n(to(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},so={prepare:no,send:ro};function Ze(e,t){switch(e){case"local":case"session":O[e]=t;break;case"all":for(const n in O)O[n]=t;break}}const fe="data-style";let Ct="";function io(e){Ct=e}function Ge(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(fe));n||(n=document.createElement("style"),n.setAttribute(fe,fe),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Ct}function At(){He("",so),ht(!0);let e;try{e=window}catch{}if(e){if(It(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ze(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const o="IconifyProviders["+r+"] is invalid.";try{const s=n[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Ue(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:n=>Ze(n,!0),disableCache:n=>Ze(n,!1),iconExists:Cn,getIcon:An,listIcons:Tn,addIcon:gt,addCollection:ze,calculateSize:xe,buildIcon:Tt,loadIcons:Se,loadIcon:Bn,addAPIProvider:Ue,appendCustomStyle:io,_api:{getAPIConfig:oe,setAPIModule:He,sendAPIQuery:bt,setFetch:Xn,getFetch:Kn,listAPIProviders:$n}}}function Pt(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function co(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ao(e){return"data:image/svg+xml,"+co(e)}function lo(e){return'url("'+ao(e)+'")'}const we={"background-color":"currentColor"},Mt={"background-color":"transparent"},Je={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ye={"-webkit-mask":we,mask:we,background:Mt};for(const e in Ye){const t=Ye[e];for(const n in Je)t[e+"-"+n]=Je[n]}function Xe(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function uo(e,t,n){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=Pt(o,{...s,width:t.width+"",height:t.height+""}),a=lo(i),c=r.style,u={"--svg":a,width:Xe(s.width),height:Xe(s.height),...n?we:Mt};for(const f in u)c.setProperty(f,u[f]);return r}let F;function fo(){try{F=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{F=null}}function po(e){return F===void 0&&fo(),F?F.createHTML(e):e}function ho(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const o=Pt(e.body,n);return t.innerHTML=po(o),t.firstChild}function Ke(e,t){const n=t.icon.data,r=t.customisations,o=Tt(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=t.renderedMode;let i;switch(s){case"svg":i=ho(o);break;default:i=uo(o,{...D,...n},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const u=c.tagName&&c.tagName.toUpperCase();return u==="SPAN"||u==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function et(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function go(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super();V(this,"_shadowRoot");V(this,"_state");V(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),u=ue(this);Ge(c,u),this._state=et({value:""},u),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const u=ue(this),f=this._state;u!==f.inline&&(f.inline=u,Ge(this._shadowRoot,u))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return ue(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const u=this._shadowRoot;if(c.renderedMode==="svg")try{u.lastChild.setCurrentTime(0);return}catch{}Ke(u,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,u=this.getAttribute("icon");if(u!==c.icon.value){this._iconChanged(u);return}if(!c.rendered)return;const f=this.getAttribute("mode"),p=qe(this);(c.attrMode!==f||xn(c.customisations,p))&&this._renderIcon(c.icon,p,f)}_iconChanged(c){const u=Vn(c,(f,p,h)=>{const g=this._state;if(g.rendered||this.getAttribute("icon")!==f)return;const m={value:f,name:p,data:h};m.data?this._gotIconData(m):g.icon=m});u.data?this._gotIconData(u):this._state=et(u,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,qe(this),this.getAttribute("mode"))}_renderIcon(c,u,f){const p=Wn(c.data.body,f),h=this._state.inline;Ke(this._shadowRoot,this._state={rendered:!0,icon:c,inline:h,customisations:u,attrMode:f,renderedMode:p})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=At();for(const a in i)s[a]=s.prototype[a]=i[a];return t.define(e,s),s}go()||At();const E=(e,t,n="children")=>e.map(r=>Array.isArray(r[n])?t({...r,[n]:E(r[n],t,n)}):t(r)),Lt=(e,t="children")=>{const n=[];return E(e,r=>n.push(r),t),n},Te=(e,t,n="children")=>e.map(r=>({...r})).filter(r=>{const o=r[n];if(Array.isArray(o)){const i=Te(o,t,n);r[n]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[n],isLeaf:!(o!=null&&o.length)};return t(r,s)}),Nt=e=>/^https?:\/\//.test(e),mo=e=>/^[\w-]+:[\w-]+$/.test(e),yo=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const t=o=>o.endsWith("/")?o:`${o}/`,n=t(window.location.pathname),r=t(new URL(e,window.location.origin).pathname);return n.startsWith(r)},Rt=(e=[])=>{const t=e.map((r,o)=>({path:r,index:o})).filter(r=>yo(r.path));return t!=null&&t.length?t.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,t[0]).index:-1};function Q({icon:e,size:t,sx:n,...r}){const o=[...Array.isArray(n)?n:[n]];if(t&&o.push({width:t,height:t}),r.variant||o.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),Nt(e))return d.jsx(ce,{as:"span",...r,src:e,sx:o});if(mo(e)){const s=t?.6*t+4:0;return d.jsx(ce,{as:"span",...r,sx:o,children:d.jsx("iconify-icon",{icon:e,height:s||void 0})})}return e&&typeof e=="string"?(o.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),d.jsx(ce,{as:"span",...r,sx:o,children:Array.from(e)[0]})):null}Q.propTypes={icon:l.string.isRequired,size:l.number,sx:l.oneOfType([l.array,l.func,l.object])};Q.defaultProps={size:null,sx:null};const bo=ot();function re({theme:e,children:t}){const n=e?ot(e):bo;return d.jsx(Ut,{theme:n,children:t})}re.propTypes={children:l.any.isRequired,theme:l.object};re.defaultProps={theme:null};const Ce=l.shape({appLogo:l.node,appName:l.string,theme:l.shape({background:l.string}),enableConnect:l.bool,enableLocale:l.bool,navigation:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object]),icon:l.string,items:l.arrayOf(l.shape({title:l.oneOfType([l.string,l.object]),link:l.oneOfType([l.string,l.object])}))}))}),Ae=l.shape({showText:l.bool,showRole:l.bool,switchDid:l.bool,switchProfile:l.bool,switchPassport:l.bool,disableLogout:l.bool,onLogin:l.func,onLogout:l.func,onSwitchDid:l.func,onSwitchProfile:l.func,onSwitchPassport:l.func,menu:l.array,menuRender:l.func,dark:l.bool,size:l.number});var tt,nt;const K=((tt=window==null?void 0:window.blocklet)==null?void 0:tt.groupPrefix)||((nt=window==null?void 0:window.blocklet)==null?void 0:nt.prefix)||"/",xo=e=>{const t={...e},n=e==null?void 0:e.background;return typeof n=="string"?t.background={header:n,footer:n,default:n}:n&&typeof n=="object"&&(t.background={header:n.header||n.default,footer:n.footer||n.default,default:n.default}),t},$=(e,t="en")=>{if(!(e!=null&&e.length))return e;const n=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(Nt(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return E(e,o=>{var s;return{...o,title:n(o.title,t),link:(s=o.items)!=null&&s.length?o.link:r(o.link,t),_rawLink:o.link}},"items")},wo=e=>E(e,t=>t.role?{...t,role:Array.isArray(t.role)?t.role:[t.role]}:t,"items"),vo=e=>{if(!(e!=null&&e.length))return null;const t=wo(e),n={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return t.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=n[s])==null||i.push(r)}):typeof r.section=="string"&&((o=n[r.section])==null||o.push(r)):n.header.push(r)}),n},Pe=e=>{if(!e)return null;const t={...e};return t.theme=xo(t.theme),t.navigation=vo(ko(t.navigation)),t},ko=(e=[])=>Te(e,(t,n)=>{var r;return!!t.link||((r=n.filteredChildren)==null?void 0:r.length)},"items"),Ot=(e,t)=>Te(e,(n,r)=>{var s;const o=!n.role||t&&n.role.includes(t);return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),jo={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Io={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Me({session:e,locale:t,size:n}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var u;return!!((c==null?void 0:c.role)||[]).includes(((u=e==null?void 0:e.user)==null?void 0:u.role)||"guest")}).map(c=>{const u=((r==null?void 0:r.componentMountPoints)||[]).find(f=>c.component===f.name);return{...c,component:u}}),s=T.useRef(null),i=Dt({open:!1}),a=Bt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:d.jsxs(d.Fragment,{children:[d.jsx(Qt,{size:"medium",ref:s,onClick:()=>a(),children:d.jsx(_e,{icon:jo,fontSize:n,style:{transform:"scale(1.08)"}})}),d.jsx(Vt,{open:i.open,onClose:()=>a(!1),anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>d.jsx(Wt,{onClickAway:u=>{u.preventDefault(),u.stopPropagation(),a(!1)},children:d.jsx(Zt,{...c,timeout:350,children:d.jsxs(Gt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[d.jsx(Jt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(u=>{var f;return d.jsx(Yt,{disablePadding:!0,children:d.jsxs(Xt,{href:u.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(f=u==null?void 0:u.component)!=null&&f.did?d.jsx(P,{component:"img",src:`${Kt}/blocklet/logo-bundle/${u.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):d.jsx(_e,{fontSize:50,icon:u.icon||Io,color:A.textSubtitle}),d.jsx(en,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:tn(u.title,t)})]})},u.id)})}),d.jsx(nn,{session:e,children:d.jsx(on,{variant:"outlined",fullWidth:!0,href:rn,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:t==="zh"?"管理":"Manage"})})]})})})})]})}Me.propTypes={session:l.object.isRequired,locale:l.string,size:l.number};Me.defaultProps={locale:"en",size:24};function se({formattedBlocklet:e,addons:t,sessionManagerProps:n}){var h,g,m,x;const r=T.useContext(rt),{locale:o}=te()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((h=r==null?void 0:r.session)!=null&&h.user);let c=$((g=e==null?void 0:e.navigation)==null?void 0:g.sessionManager,o)||[];c=Ot(c,(x=(m=r==null?void 0:r.session)==null?void 0:m.user)==null?void 0:x.role);const f=(()=>{if(t&&typeof t!="function")return Array.isArray(t)?t:[t];let v=[];if(i&&o&&v.push(d.jsx(sn,{showText:!1},"locale-selector")),s&&r){const k=[];a&&(c?c.slice(0,5):[]).forEach(w=>{k.push({label:w.title,icon:w.icon?d.jsx("iconify-icon",{icon:w.icon,height:24,style:{marginRight:8}}):null,component:"a",href:w.link,key:w.link})}),v.push(d.jsx(Me,{session:r.session,locale:o},"session-blocklet")),v.push(d.jsx(cn,{session:r.session,locale:o,menu:k,showRole:!0,...n},"session-user"))}return typeof t=="function"&&(v=t(v)||[]),v})();return T.createElement(d.Fragment,null,...Array.isArray(f)?f:[f])}se.propTypes={formattedBlocklet:l.object.isRequired,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae};se.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Et=()=>{const e=an();T.useEffect(()=>{e.wallet&&ln.call("arcHideTopBar","{}")},[e])},So=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const r=E(e,i=>{var u,f;const a=i.icon?d.jsx(Q,{icon:i.icon}):null;if(i.items)return{id:`${t++}`,label:i.title,icon:a,children:i.items};let c={};return((u=i.link)!=null&&u.startsWith("http://")||(f=i.link)!=null&&f.startsWith("https://"))&&(c={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:d.jsx("a",{href:i.link,...c,children:i.title}),icon:a,link:i.link}},"items"),o=Lt(r),s=Rt(o.map(i=>i.link));return{navItems:r,activeId:s>=0?o[s].id:null}};function Le({meta:e,addons:t,sessionManagerProps:n,homeLink:r,theme:o,hideNavMenu:s,...i}){var b,w;Et();const{locale:a}=te()||{},c=T.useMemo(()=>{const C=Object.assign({},window.blocklet,e);try{return Pe(C)}catch(j){return console.error("Failed to format blocklet info",j,C),C}},[e]);if(!c.appName)return null;const{appLogo:u,appLogoRect:f,theme:p}=c,h=$((b=c==null?void 0:c.navigation)==null?void 0:b.header,a),g=So(h),{navItems:m,activeId:x}=g,v=typeof t=="function"?C=>t(C,{navigation:g}):t,k=d.jsx(se,{formattedBlocklet:c,addons:v,sessionManagerProps:n});return d.jsx(re,{theme:o,children:d.jsx(To,{homeLink:r,logo:d.jsx("img",{src:f||u,alt:"logo"}),addons:k,...it(i,["bordered"]),$bordered:i==null?void 0:i.bordered,$bgcolor:(w=p==null?void 0:p.background)==null?void 0:w.header,children:s||!(m!=null&&m.length)?null:({isMobile:C})=>d.jsx(fn,{mode:C?"inline":"horizontal",activeId:x,items:m,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}Le.propTypes={meta:Ce,addons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,homeLink:l.string,theme:l.object,hideNavMenu:l.bool};Le.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:K,theme:null,hideNavMenu:!1};const To=M(un)`
|
|
12
12
|
${({$bgcolor:e})=>`background-color: ${e||"#fff"};`}
|
|
13
13
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
14
14
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -41,7 +41,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
41
41
|
height: 20px;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`,qo=st(Le,{FallbackComponent:ct});function Ne({name:e,logo:t,description:n,...r}){if(!e&&!t&&!n)return null;const o=T.isValidElement(t)?t:d.jsx("img",{src:t,alt:e});return d.jsxs(Co,{...r,children:[d.jsxs("div",{children:[t&&d.jsx(P,{component:"a",href:"/",className:"footer-brand-logo",children:o}),e&&d.jsx("div",{className:"footer-brand-name",children:e})]}),n&&d.jsx("div",{className:"footer-brand-desc",children:n})]})}Ne.propTypes={name:l.node,logo:l.node,description:l.string};Ne.defaultProps={name:"",logo:"",description:""};const Co=M("div")`
|
|
45
45
|
display: flex;
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
font-size: 14px;
|
|
@@ -86,7 +86,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
`;function ee({links:e,flowLayout:t,...n}){const[r,o]=T.useState(-1);if(!(e!=null&&e.length))return null;const s=e.some(a=>{var c;return(c=a.items)==null?void 0:c.length}),i=({label:a,link:c,icon:u,render:f,props:p})=>{let h=a;return f?h=f({label:a,link:c,props:p}):c&&(h=d.jsx("a",{href:c,"aria-label":`Footer link for ${a}`,...p,children:a})),d.jsxs(d.Fragment,{children:[u&&d.jsx(
|
|
89
|
+
`;function ee({links:e,flowLayout:t,...n}){const[r,o]=T.useState(-1);if(!(e!=null&&e.length))return null;const s=e.some(a=>{var c;return(c=a.items)==null?void 0:c.length}),i=({label:a,link:c,icon:u,render:f,props:p})=>{let h=a;return f?h=f({label:a,link:c,props:p}):c&&(h=d.jsx("a",{href:c,"aria-label":`Footer link for ${a}`,...p,children:a})),d.jsxs(d.Fragment,{children:[u&&d.jsx(Q,{icon:u,size:20,sx:{mr:.5}}),h]})};return d.jsx(Ao,{...n,className:de(n.className,{"footer-links--grouped":s,"footer-links--flow":t}),children:d.jsxs("div",{className:"footer-links-inner",children:[t&&e.map((a,c)=>d.jsx("span",{className:"footer-links-item",children:i(a)},c)),!t&&e.map((a,c)=>{const{items:u}=a,f=c===r;return d.jsxs("div",{className:de("footer-links-group",{"footer-links-group--active":f}),onClick:()=>o(r===c?-1:c),children:[d.jsxs("span",{className:"footer-links-item",children:[i(a),!!(u!=null&&u.length)&&d.jsx("span",{className:"footer-links-group-expand-icon",children:d.jsx(dn,{style:{transform:`rotate(${f?180:0}deg)`}})})]}),!!(u!=null&&u.length)&&d.jsx("div",{className:"footer-links-sub",children:u.map((p,h)=>d.jsx("span",{className:"footer-links-item",children:i(p)},h))})]},c)})]})})}ee.propTypes={links:l.arrayOf(l.shape({label:l.string,link:l.string,render:l.func,props:l.object})),flowLayout:l.bool};ee.defaultProps={links:[],flowLayout:!1};const Ao=M("div")`
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
color: ${e=>e.theme.palette.grey[600]};
|
|
92
92
|
.footer-links-inner {
|
|
@@ -209,7 +209,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
`;function Re({items:e,...t}){const n=pn();return e!=null&&e.length?d.jsx(Po,{...t,children:e.map((r,o)=>d.jsx("a",{href:r.link,target:"_blank","aria-label":`Social media icon${r.title?` for ${r.title}`:""}`,rel:"noreferrer",children:d.jsx(
|
|
212
|
+
`;function Re({items:e,...t}){const n=pn();return e!=null&&e.length?d.jsx(Po,{...t,children:e.map((r,o)=>d.jsx("a",{href:r.link,target:"_blank","aria-label":`Social media icon${r.title?` for ${r.title}`:""}`,rel:"noreferrer",children:d.jsx(Q,{icon:r.icon||r.title,sx:{bgcolor:n.palette.grey[600],color:"#fff"},size:24,component:"span"})},o))}):null}Re.propTypes={items:l.arrayOf(l.shape({icon:l.string,link:l.string}))};Re.defaultProps={items:null};const Po=M("div")`
|
|
213
213
|
display: inline-flex;
|
|
214
214
|
flex-wrap: wrap;
|
|
215
215
|
align-items: center;
|
|
@@ -230,7 +230,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
230
230
|
align-items: center;
|
|
231
231
|
margin: 0;
|
|
232
232
|
font-size: 13px;
|
|
233
|
-
`;function ie({children:e,autoCenter:t,...n}){return e?d.jsx(
|
|
233
|
+
`;function ie({children:e,autoCenter:t,...n}){return e?d.jsx(Lo,{...n,className:de(n.className,{"footer-row-auto-center":t}),children:e}):null}ie.propTypes={children:l.any,autoCenter:l.bool};ie.defaultProps={children:null,autoCenter:!1};const Lo=M(P)`
|
|
234
234
|
display: flex;
|
|
235
235
|
justify-content: space-between;
|
|
236
236
|
& + & {
|
|
@@ -251,7 +251,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
251
251
|
margin: 0 auto;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
`;function $t({elements:e,data:t,...n}){var r;return d.jsx(
|
|
254
|
+
`;function $t({elements:e,data:t,...n}){var r;return d.jsx(No,{...n,children:d.jsxs(at,{children:[d.jsxs(P,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"center",md:"space-between"},gap:2,pb:3},children:[d.jsx(P,{children:e.brand}),d.jsx(P,{lineHeight:1,children:e.socialMedia})]}),!!((r=t.navigation)!=null&&r.length)&&d.jsx(P,{sx:{mb:6,pt:3,borderTop:1,borderColor:"grey.200"},children:e.navigation}),d.jsxs(ie,{sx:{pt:3,borderTop:1,borderColor:"grey.200"},autoCenter:!0,children:[e.copyright,e.links]})]})})}$t.propTypes={elements:l.shape({brand:l.element,navigation:l.element,socialMedia:l.element,copyright:l.element,links:l.element}).isRequired,data:l.object.isRequired};const No=M("div")`
|
|
255
255
|
padding: 32px 0 24px 0;
|
|
256
256
|
.footer-brand-name,
|
|
257
257
|
.footer-brand-desc {
|
|
@@ -260,7 +260,7 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
260
260
|
&& .footer-brand-logo {
|
|
261
261
|
margin-right: 0;
|
|
262
262
|
}
|
|
263
|
-
`;function
|
|
263
|
+
`;function _t({elements:e,data:t,...n}){return d.jsx(Ro,{...n,children:d.jsxs(at,{className:"plain-layout-container",children:[!!t.links&&d.jsxs(ie,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!t.links&&d.jsxs(d.Fragment,{children:[T.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})}_t.propTypes={elements:l.shape({brand:l.element,navigation:l.element,socialMedia:l.element,copyright:l.element,links:l.element}).isRequired,data:l.object.isRequired};const Ro=M("div")`
|
|
264
264
|
padding: 24px 0;
|
|
265
265
|
.plain-layout-container {
|
|
266
266
|
display: flex;
|
|
@@ -269,10 +269,10 @@ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,config
|
|
|
269
269
|
flex-wrap: wrap;
|
|
270
270
|
gap: 8px;
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`,qt=[{name:"plain",support:(e,t)=>{var n,r;return!((n=t.navigation)!=null&&n.length)&&!((r=t.socialMedia)!=null&&r.length)},component:_t},{name:"standard",support:()=>!0,component:$t}],Oo=qt.reduce((e,t)=>({...e,[t.name]:t}),{});function Ee(e){var x,v;const{brand:t,navigation:n,socialMedia:r,copyright:o,links:s,layout:i,...a}=e,c=()=>t?d.jsx(Ne,{...t}):null,u=()=>n!=null&&n.length?d.jsx(ee,{links:n}):null,f=()=>r!=null&&r.length?d.jsx(Re,{items:r}):null,p=()=>{const k=(o==null?void 0:o.owner)||(t==null?void 0:t.name);return k?d.jsx(Oe,{owner:k,year:(o==null?void 0:o.year)||void 0}):null},h=()=>s!=null&&s.length?d.jsx(ee,{flowLayout:!0,links:s}):null,g={brand:c(),navigation:u(),socialMedia:f(),copyright:p(),links:h()};let m=null;if(i==="auto"?m=qt.find(k=>k.support(g,e)).component:m=(x=Oo[i])==null?void 0:x.component,!m)throw new Error(`layout ${i} is not supported.`);return d.jsxs(P,{position:"relative",...a,children:[d.jsx(m,{elements:g,data:e}),d.jsx(P,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:(v=window==null?void 0:window.blocklet)==null?void 0:v.version})]})}Ee.propTypes={brand:l.shape({name:l.node,description:l.string,logo:l.node}),navigation:l.arrayOf(l.shape({label:l.node,link:l.string})),socialMedia:l.arrayOf(l.shape({icon:l.node,link:l.string})),copyright:l.shape({owner:l.string,year:l.oneOfType([l.string,l.number])}),links:l.arrayOf(l.shape({label:l.node,link:l.string})),layout:l.oneOf(["auto","standard","plain"])};Ee.defaultProps={brand:null,navigation:null,copyright:null,socialMedia:null,links:null,layout:"auto"};function $e({meta:e,theme:t,...n}){var m,x,v,k;const{locale:r}=te()||{},o=T.useMemo(()=>{const b=Object.assign({},window.blocklet,e);try{return Pe(b)}catch(w){return console.error("Failed to format blocklet info",w,b),b}},[e]);if(!o.appName)return null;const{appLogo:s,appLogoRect:i,appName:a,appDescription:c,description:u,theme:f,copyright:p}=o,h={footerNav:$((m=o==null?void 0:o.navigation)==null?void 0:m.footer,r)||[],socialMedia:$((x=o==null?void 0:o.navigation)==null?void 0:x.social,r)||[],links:$((v=o==null?void 0:o.navigation)==null?void 0:v.bottom,r)||[]},g={brand:{name:a,description:c||u,logo:i||s},navigation:E(h.footerNav,b=>({...b,label:b.title,link:b.link}),"items"),copyright:p,socialMedia:h.socialMedia,links:h.links.map(b=>({...b,label:b.title}))};return d.jsx(re,{theme:t,children:d.jsx(Eo,{...g,...it(n,["bordered"]),$bordered:n==null?void 0:n.bordered,$bgcolor:(k=f==null?void 0:f.background)==null?void 0:k.footer})})}$e.propTypes={meta:Ce,theme:l.object};$e.defaultProps={meta:{},theme:null};const Eo=M(Ee)`
|
|
273
273
|
${({$bordered:e})=>`border-top: 1px solid ${e?A.strokeSep:"#eee"};`}
|
|
274
274
|
color: ${e=>e.theme.palette.grey[600]};
|
|
275
275
|
${({$bgcolor:e})=>e&&`background-color: ${e};`}
|
|
276
276
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
277
277
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
278
|
-
`,Fo=st($e,{FallbackComponent:ct});function Ft({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var C;Et();const a=T.useContext(rt),c=(C=a==null?void 0:a.session)==null?void 0:C.user,u=c==null?void 0:c.role,{locale:f}=te()||{},p=T.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return Pe(j)}catch(y){return console.error("Failed to format blocklet info",y,j),j}},[e]),{localizedNav:h,flattened:g,matchedIndex:m}=T.useMemo(()=>{var
|
|
278
|
+
`,Fo=st($e,{FallbackComponent:ct});function Ft({meta:e,fallbackUrl:t,invalidPathFallback:n,headerAddons:r,sessionManagerProps:o,links:s,...i}){var C;Et();const a=T.useContext(rt),c=(C=a==null?void 0:a.session)==null?void 0:C.user,u=c==null?void 0:c.role,{locale:f}=te()||{},p=T.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return Pe(j)}catch(y){return console.error("Failed to format blocklet info",y,j),j}},[e]),{localizedNav:h,flattened:g,matchedIndex:m}=T.useMemo(()=>{var L;let j=$((L=p==null?void 0:p.navigation)==null?void 0:L.dashboard,f)||[];j=Ot(j,u),j=E(j,S=>({title:S.title,url:S.link,icon:S.icon?d.jsx("iconify-icon",{height:"100%",width:"100%",icon:S.icon}):null,external:!0,children:S.items}),"items");const y=Lt(j).filter(S=>!!S.url),I=Rt(y.map(S=>S.url));return I!==-1&&(y[I].active=!0),{localizedNav:j,flattened:y,matchedIndex:I}},[p,f,u]),x=typeof s=="function"?s(h):[...h,...s];if(T.useLayoutEffect(()=>{c&&!(g!=null&&g.length)&&t&&(window.location.href=t)},[t]),T.useLayoutEffect(()=>{c&&(g!=null&&g.length)&&m===-1&&n&&n()},[n,g,m]),!p.appName)return null;const{appLogo:v,appLogoRect:k,appName:b}=p,w=d.jsx(se,{formattedBlocklet:p,addons:r,sessionManagerProps:o});return d.jsx(hn,{title:b,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:K,logo:d.jsx("img",{src:k||v,alt:"logo"}),addons:w,...i.headerProps}})}Ft.propTypes={meta:Ce,fallbackUrl:l.string,invalidPathFallback:l.func,headerAddons:l.oneOfType([l.func,l.node]),sessionManagerProps:Ae,links:l.oneOfType([l.array,l.func])};Ft.defaultProps={meta:{},fallbackUrl:K,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=K}},links:[]};export{Ft as D,Fo as F,qo as H};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as q}from"./lottie-
|
|
1
|
+
import{l as q}from"./lottie-BkwIvhEu.js";import{r as D,b9 as z}from"./index-Pf5VRxU2.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,o,b=[],s=!0,A=!1;try{if(c=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);s=!0);}catch(g){A=!0,u=g}finally{try{if(!s&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var ie=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],oe=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,o=e.initialSegment,b=e.onComplete,s=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,ie),P=D.useState(!1),d=Z(P,2),C=d[0],I=d[1],i=D.useRef(),v=D.useRef(null),H=function(){var a;(a=i.current)===null||a===void 0||a.play()},M=function(){var a;(a=i.current)===null||a===void 0||a.stop()},F=function(){var a;(a=i.current)===null||a===void 0||a.pause()},V=function(a){var f;(f=i.current)===null||f===void 0||f.setSpeed(a)},N=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndPlay(a,f)},B=function(a,f){var m;(m=i.current)===null||m===void 0||m.goToAndStop(a,f)},$=function(a){var f;(f=i.current)===null||f===void 0||f.setDirection(a)},k=function(a,f){var m;(m=i.current)===null||m===void 0||m.playSegments(a,f)},W=function(a){var f;(f=i.current)===null||f===void 0||f.setSubframe(a)},K=function(a){var f;return(f=i.current)===null||f===void 0?void 0:f.getDuration(a)},U=function(){var a;(a=i.current)===null||a===void 0||a.destroy(),i.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f;if(v.current){(f=i.current)===null||f===void 0||f.destroy();var m=T(T(T({},e),a),{},{container:v.current});return i.current=q.loadAnimation(m),I(!!i.current),function(){var R;(R=i.current)===null||R===void 0||R.destroy(),i.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){i.current&&(i.current.autoplay=!!c)},[c]),D.useEffect(function(){if(i.current){if(!o){i.current.resetSegments(!0);return}!Array.isArray(o)||!o.length||((i.current.currentRawFrame<o[0]||i.current.currentRawFrame>o[1])&&(i.current.currentRawFrame=o[0]),i.current.setSegment(o[0],o[1]))}},[o]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:s},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var f=a.map(function(m){var R;return(R=i.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var _;(_=i.current)===null||_===void 0||_.removeEventListener(m.name,m.handler)}});return function(){f.forEach(function(m){return m()})}}},[b,s,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",T({style:r,ref:v},p));return{View:Y,play:H,stop:M,pause:F,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:i.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,o=n.width,b=n.height,s=(e-c)/o,A=(r-u)/b;return{x:s,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var o=r.current;if(!(!o||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(o),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
|
|
3
3
|
n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},s=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(o,S,p);S=P.x,p=P.y}var d=c.find(function(i){var v=i.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(d){if(d.type==="seek"&&d.position&&Array.isArray(d.position.x)&&Array.isArray(d.position.y)&&d.frames.length===2){var C=(S-d.position.x[0])/(d.position.x[1]-d.position.x[0]),I=(p-d.position.y[0])/(d.position.y[1]-d.position.y[0]);n.playSegments(d.frames,!0),n.goToAndStop(Math.ceil((C+I)/2*(d.frames[1]-d.frames[0])),!0)}d.type==="loop"&&n.playSegments(d.frames,!0),d.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(d.frames)),d.type==="stop"&&n.goToAndStop(d.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return o.addEventListener("mousemove",O),o.addEventListener("mouseout",w),function(){o.removeEventListener("mousemove",O),o.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return s()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,o=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),o},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,o=e.interactivity,b=x(e,fe),s=oe(b,c),A=s.View,g=s.play,O=s.stop,w=s.pause,h=s.setSpeed,l=s.goToAndStop,L=s.goToAndPlay,S=s.setDirection,p=s.playSegments,P=s.setSubframe,d=s.getDuration,C=s.destroy,I=s.animationContainerRef,i=s.animationLoaded,v=s.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:d,destroy:C,animationContainerRef:I,animationLoaded:i,animationItem:v},actions:(n=o==null?void 0:o.actions)!==null&&n!==void 0?n:[],mode:(u=o==null?void 0:o.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,oe as useLottie,de as useLottieInteractivity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ba as D}from"./index-CqcpZ8C3.js";var fe=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=ce(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let m=t;if(u!==y){const S=e[h];m=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=m,e=e[h]}return e};const _e={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=D.createContext(null),Le=()=>D.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},B=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return B(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},he=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||he(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=D.useRef(e);s.current=e,D.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=D.useState(t._formState),m=D.useRef(!0),S=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=D.useRef(n);return _.current=n,Ue({disabled:u,next:v=>m.current&<(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),D.useEffect(()=>(m.current=!0,S.current.isValid&&t._updateValid(!0),()=>{m.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=D.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[m,S]=D.useState(t._getWatch(u,n));return D.useEffect(()=>t._removeUnmounted()),m}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),m=Dt({control:n,name:t}),S=D.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return D.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),D.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||m.disabled?{disabled:m.disabled||u}:{},onChange:D.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:_e.CHANGE}),[t]),onBlur:D.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:_e.BLUR}),[t,n]),ref:_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(m.validatingFields,t)},error:{enumerable:!0,get:()=>f(m.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const oe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;oe(h,s)}else T(h)&&oe(h,s)}}};var kt=(e,s,t)=>{const u=ce(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",be=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ve=e=>$(e),pe=e=>e.type==="radio",Ve=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(ve(e)||Array.isArray(e)&&e.every(ve)||j(e)&&!e)return{type:t,message:ve(e)?e:"",ref:s}}var se=e=>T(e)&&!Ve(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:m,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=fe(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||be(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=ve(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((m||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(m),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(Ve(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!B(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!B(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&B(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Fe=e=>O(e)||!et(e);function Z(e,s){if(Fe(e)||Fe(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||fe(e),ke=e=>be(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Ae(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Ae(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Fe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Ae(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):fe(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:Ve(e)?e.source:T(e)?Ve(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!ce(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?B((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!B(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const M=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),M||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!M}if(l){const M=f(t.touchedFields,r);M||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&M!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(m=xe(()=>K(r,l)),m(e.delayError)):(clearTimeout(S),m=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!B(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}g&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>ce(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=be(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?fe(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Fe(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const M=o(),re=r.type===_e.BLUR||r.type===_e.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,M),re?(c._f.onBlur&&c._f.onBlur(r),m&&m(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,M,re,!1),Vt=!B(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(M),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=B(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(M),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=he(r);if(s.resolver){const o=await te(w(r)?r:c);l=B(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&oe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&he(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?he(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&oe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),oe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),B(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=B(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(be(E)){const M=E.closest("form");if(M){M.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?[]:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=D.useRef(),t=D.useRef(),[u,n]=D.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),D.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),D.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),D.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),D.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
|
|
1
|
+
import{b9 as D}from"./index-Pf5VRxU2.js";var fe=e=>e.type==="checkbox",ie=e=>e instanceof Date,O=e=>e==null;const et=e=>typeof e=="object";var T=e=>!O(e)&&!Array.isArray(e)&&et(e)&&!ie(e),tt=e=>T(e)&&e.target?fe(e.target)?e.target.checked:e.target.value:e,At=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rt=(e,s)=>e.has(At(s)),xt=e=>{const s=e.constructor&&e.constructor.prototype;return T(s)&&s.hasOwnProperty("isPrototypeOf")},Re=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function p(e){let s;const t=Array.isArray(e);if(e instanceof Date)s=new Date(e);else if(e instanceof Set)s=new Set(e);else if(!(Re&&(e instanceof Blob||e instanceof FileList))&&(t||T(e)))if(s=t?[]:{},!t&&!xt(e))s=e;else for(const u in e)e.hasOwnProperty(u)&&(s[u]=p(e[u]));else return e;return s}var ce=e=>Array.isArray(e)?e.filter(Boolean):[],w=e=>e===void 0,f=(e,s,t)=>{if(!s||!T(e))return t;const u=ce(s.split(/[,[\].]+?/)).reduce((n,a)=>O(n)?n:n[a],e);return w(u)||u===e?w(e[s])?t:e[s]:u},j=e=>typeof e=="boolean",Te=e=>/^\w*$/.test(e),st=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),x=(e,s,t)=>{let u=-1;const n=Te(s)?[s]:st(s),a=n.length,y=a-1;for(;++u<a;){const h=n[u];let m=t;if(u!==y){const S=e[h];m=T(S)||Array.isArray(S)?S:isNaN(+n[u+1])?{}:[]}if(h==="__proto__")return;e[h]=m,e=e[h]}return e};const _e={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},W={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},z={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mt=D.createContext(null),Le=()=>D.useContext(mt);var it=(e,s,t,u=!0)=>{const n={defaultValues:s._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const y=a;return s._proxyFormState[y]!==W.all&&(s._proxyFormState[y]=!u||W.all),t&&(t[y]=!0),e[y]}});return n},B=e=>T(e)&&!Object.keys(e).length,ut=(e,s,t,u)=>{t(e);const{name:n,...a}=e;return B(a)||Object.keys(a).length>=Object.keys(s).length||Object.keys(a).find(y=>s[y]===(!u||W.all))},he=e=>Array.isArray(e)?e:[e],lt=(e,s,t)=>!e||!s||e===s||he(e).some(u=>u&&(t?u===s:u.startsWith(s)||s.startsWith(u)));function Ue(e){const s=D.useRef(e);s.current=e,D.useEffect(()=>{const t=!e.disabled&&s.current.subject&&s.current.subject.subscribe({next:s.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}function Dt(e){const s=Le(),{control:t=s.control,disabled:u,name:n,exact:a}=e||{},[y,h]=D.useState(t._formState),m=D.useRef(!0),S=D.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),_=D.useRef(n);return _.current=n,Ue({disabled:u,next:v=>m.current&<(_.current,v.name,a)&&ut(v,S.current,t._updateFormState)&&h({...t._formState,...v}),subject:t._subjects.state}),D.useEffect(()=>(m.current=!0,S.current.isValid&&t._updateValid(!0),()=>{m.current=!1}),[t]),it(y,t,S.current,!1)}var $=e=>typeof e=="string",at=(e,s,t,u,n)=>$(e)?(u&&s.watch.add(e),f(t,e,n)):Array.isArray(e)?e.map(a=>(u&&s.watch.add(a),f(t,a))):(u&&(s.watchAll=!0),t);function wt(e){const s=Le(),{control:t=s.control,name:u,defaultValue:n,disabled:a,exact:y}=e||{},h=D.useRef(u);h.current=u,Ue({disabled:a,subject:t._subjects.values,next:_=>{lt(h.current,_.name,y)&&S(p(at(h.current,t._names,_.values||t._formValues,!1,n)))}});const[m,S]=D.useState(t._getWatch(u,n));return D.useEffect(()=>t._removeUnmounted()),m}function Et(e){const s=Le(),{name:t,disabled:u,control:n=s.control,shouldUnregister:a}=e,y=rt(n._names.array,t),h=wt({control:n,name:t,defaultValue:f(n._formValues,t,f(n._defaultValues,t,e.defaultValue)),exact:!0}),m=Dt({control:n,name:t}),S=D.useRef(n.register(t,{...e.rules,value:h,...j(e.disabled)?{disabled:e.disabled}:{}}));return D.useEffect(()=>{const _=n._options.shouldUnregister||a,v=(N,H)=>{const L=f(n._fields,N);L&&L._f&&(L._f.mount=H)};if(v(t,!0),_){const N=p(f(n._options.defaultValues,t));x(n._defaultValues,t,N),w(f(n._formValues,t))&&x(n._formValues,t,N)}return()=>{(y?_&&!n._state.action:_)?n.unregister(t):v(t,!1)}},[t,n,y,a]),D.useEffect(()=>{f(n._fields,t)&&n._updateDisabledField({disabled:u,fields:n._fields,name:t,value:f(n._fields,t)._f.value})},[u,t,n]),{field:{name:t,value:h,...j(u)||m.disabled?{disabled:m.disabled||u}:{},onChange:D.useCallback(_=>S.current.onChange({target:{value:tt(_),name:t},type:_e.CHANGE}),[t]),onBlur:D.useCallback(()=>S.current.onBlur({target:{value:f(n._formValues,t),name:t},type:_e.BLUR}),[t,n]),ref:_=>{const v=f(n._fields,t);v&&_&&(v._f.ref={focus:()=>_.focus(),select:()=>_.select(),setCustomValidity:N=>_.setCustomValidity(N),reportValidity:()=>_.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!f(m.errors,t)},isDirty:{enumerable:!0,get:()=>!!f(m.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!f(m.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!f(m.validatingFields,t)},error:{enumerable:!0,get:()=>f(m.errors,t)}})}}const Wt=e=>e.render(Et(e));var St=(e,s,t,u,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[u]:n||!0}}:{},Ke=e=>({isOnSubmit:!e||e===W.onSubmit,isOnBlur:e===W.onBlur,isOnChange:e===W.onChange,isOnAll:e===W.all,isOnTouch:e===W.onTouched}),Ge=(e,s,t)=>!t&&(s.watchAll||s.watch.has(e)||[...s.watch].some(u=>e.startsWith(u)&&/^\.\w+/.test(e.slice(u.length))));const oe=(e,s,t,u)=>{for(const n of t||Object.keys(e)){const a=f(e,n);if(a){const{_f:y,...h}=a;if(y){if(y.refs&&y.refs[0]&&s(y.refs[0],n)&&!u)break;if(y.ref&&s(y.ref,y.name)&&!u)break;oe(h,s)}else T(h)&&oe(h,s)}}};var kt=(e,s,t)=>{const u=ce(f(e,t));return x(u,"root",s[t]),x(e,t,u),e},Oe=e=>e.type==="file",X=e=>typeof e=="function",be=e=>{if(!Re)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},ve=e=>$(e),pe=e=>e.type==="radio",Ve=e=>e instanceof RegExp;const ze={value:!1,isValid:!1},Je={value:!0,isValid:!0};var nt=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!w(e[0].attributes.value)?w(e[0].value)||e[0].value===""?Je:{value:e[0].value,isValid:!0}:Je:ze}return ze};const Qe={isValid:!1,value:null};var ot=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Qe):Qe;function Xe(e,s,t="validate"){if(ve(e)||Array.isArray(e)&&e.every(ve)||j(e)&&!e)return{type:t,message:ve(e)?e:"",ref:s}}var se=e=>T(e)&&!Ve(e)?e:{value:e,message:""},Ye=async(e,s,t,u,n)=>{const{ref:a,refs:y,required:h,maxLength:m,minLength:S,min:_,max:v,pattern:N,validate:H,name:L,valueAsNumber:xe,mount:J,disabled:Q}=e._f,V=f(s,L);if(!J||Q)return{};const K=y?y[0]:a,G=b=>{u&&K.reportValidity&&(K.setCustomValidity(j(b)?"":b||""),K.reportValidity())},k={},ee=pe(a),de=fe(a),Y=ee||de,te=(xe||Oe(a))&&w(a.value)&&w(V)||be(a)&&a.value===""||V===""||Array.isArray(V)&&!V.length,P=St.bind(null,L,t,k),ye=(b,F,C,U=z.maxLength,q=z.minLength)=>{const I=b?F:C;k[L]={type:b?U:q,message:I,ref:a,...P(b?U:q,I)}};if(n?!Array.isArray(V)||!V.length:h&&(!Y&&(te||O(V))||j(V)&&!V||de&&!nt(y).isValid||ee&&!ot(y).isValid)){const{value:b,message:F}=ve(h)?{value:!!h,message:h}:se(h);if(b&&(k[L]={type:z.required,message:F,ref:K,...P(z.required,F)},!t))return G(F),k}if(!te&&(!O(_)||!O(v))){let b,F;const C=se(v),U=se(_);if(!O(V)&&!isNaN(V)){const q=a.valueAsNumber||V&&+V;O(C.value)||(b=q>C.value),O(U.value)||(F=q<U.value)}else{const q=a.valueAsDate||new Date(V),I=ae=>new Date(new Date().toDateString()+" "+ae),ue=a.type=="time",le=a.type=="week";$(C.value)&&V&&(b=ue?I(V)>I(C.value):le?V>C.value:q>new Date(C.value)),$(U.value)&&V&&(F=ue?I(V)<I(U.value):le?V<U.value:q<new Date(U.value))}if((b||F)&&(ye(!!b,C.message,U.message,z.max,z.min),!t))return G(k[L].message),k}if((m||S)&&!te&&($(V)||n&&Array.isArray(V))){const b=se(m),F=se(S),C=!O(b.value)&&V.length>+b.value,U=!O(F.value)&&V.length<+F.value;if((C||U)&&(ye(C,b.message,F.message),!t))return G(k[L].message),k}if(N&&!te&&$(V)){const{value:b,message:F}=se(N);if(Ve(b)&&!V.match(b)&&(k[L]={type:z.pattern,message:F,ref:a,...P(z.pattern,F)},!t))return G(F),k}if(H){if(X(H)){const b=await H(V,s),F=Xe(b,K);if(F&&(k[L]={...F,...P(z.validate,F.message)},!t))return G(F.message),k}else if(T(H)){let b={};for(const F in H){if(!B(b)&&!t)break;const C=Xe(await H[F](V,s),K,F);C&&(b={...C,...P(F,C.message)},G(C.message),t&&(k[L]=b))}if(!B(b)&&(k[L]={ref:K,...b},!t))return k}}return G(!0),k};function Ct(e,s){const t=s.slice(0,-1).length;let u=0;for(;u<t;)e=w(e)?u++:e[s[u++]];return e}function Rt(e){for(const s in e)if(e.hasOwnProperty(s)&&!w(e[s]))return!1;return!0}function R(e,s){const t=Array.isArray(s)?s:Te(s)?[s]:st(s),u=t.length===1?e:Ct(e,t),n=t.length-1,a=t[n];return u&&delete u[a],n!==0&&(T(u)&&B(u)||Array.isArray(u)&&Rt(u))&&R(e,t.slice(0,-1)),e}var Se=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},Fe=e=>O(e)||!et(e);function Z(e,s){if(Fe(e)||Fe(s))return e===s;if(ie(e)&&ie(s))return e.getTime()===s.getTime();const t=Object.keys(e),u=Object.keys(s);if(t.length!==u.length)return!1;for(const n of t){const a=e[n];if(!u.includes(n))return!1;if(n!=="ref"){const y=s[n];if(ie(a)&&ie(y)||T(a)&&T(y)||Array.isArray(a)&&Array.isArray(y)?!Z(a,y):a!==y)return!1}}return!0}var ft=e=>e.type==="select-multiple",Tt=e=>pe(e)||fe(e),ke=e=>be(e)&&e.isConnected,ct=e=>{for(const s in e)if(X(e[s]))return!0;return!1};function Ae(e,s={}){const t=Array.isArray(e);if(T(e)||t)for(const u in e)Array.isArray(e[u])||T(e[u])&&!ct(e[u])?(s[u]=Array.isArray(e[u])?[]:{},Ae(e[u],s[u])):O(e[u])||(s[u]=!0);return s}function dt(e,s,t){const u=Array.isArray(e);if(T(e)||u)for(const n in e)Array.isArray(e[n])||T(e[n])&&!ct(e[n])?w(s)||Fe(t[n])?t[n]=Array.isArray(e[n])?Ae(e[n],[]):{...Ae(e[n])}:dt(e[n],O(s)?{}:s[n],t[n]):t[n]=!Z(e[n],s[n]);return t}var ge=(e,s)=>dt(e,s,Ae(s)),yt=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:u})=>w(e)?e:s?e===""?NaN:e&&+e:t&&$(e)?new Date(e):u?u(e):e;function Ce(e){const s=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):s.disabled))return Oe(s)?s.files:pe(s)?ot(e.refs).value:ft(s)?[...s.selectedOptions].map(({value:t})=>t):fe(s)?nt(e.refs).value:yt(w(s.value)?e.ref.value:s.value,e)}var Lt=(e,s,t,u)=>{const n={};for(const a of e){const y=f(s,a);y&&x(n,a,y._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:u}},ne=e=>w(e)?e:Ve(e)?e.source:T(e)?Ve(e.value)?e.value.source:e.value:e,Ut=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ze(e,s,t){const u=f(e,t);if(u||Te(t))return{error:u,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),y=f(s,a),h=f(e,a);if(y&&!Array.isArray(y)&&t!==a)return{name:t};if(h&&h.type)return{name:a,error:h};n.pop()}return{name:t}}var Ot=(e,s,t,u,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?u.isOnBlur:n.isOnBlur)?!e:(t?u.isOnChange:n.isOnChange)?e:!0,pt=(e,s)=>!ce(f(e,s)).length&&R(e,s);const Mt={mode:W.onSubmit,reValidateMode:W.onChange,shouldFocusError:!0};function Bt(e={}){let s={...Mt,...e},t={submitCount:0,isDirty:!1,isLoading:X(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1},u={},n=T(s.defaultValues)||T(s.values)?p(s.defaultValues||s.values)||{}:{},a=s.shouldUnregister?{}:p(n),y={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,S=0;const _={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:Se(),array:Se(),state:Se()},N=Ke(s.mode),H=Ke(s.reValidateMode),L=s.criteriaMode===W.all,xe=r=>i=>{clearTimeout(S),S=setTimeout(r,i)},J=async r=>{if(_.isValid||r){const i=s.resolver?B((await Y()).errors):await P(u,!0);i!==t.isValid&&v.state.next({isValid:i})}},Q=(r,i)=>{(_.isValidating||_.validatingFields)&&((r||Array.from(h.mount)).forEach(l=>{l&&(i?x(t.validatingFields,l,i):R(t.validatingFields,l))}),v.state.next({validatingFields:t.validatingFields,isValidating:!B(t.validatingFields)}))},V=(r,i=[],l,d,c=!0,o=!0)=>{if(d&&l){if(y.action=!0,o&&Array.isArray(f(u,r))){const g=l(f(u,r),d.argA,d.argB);c&&x(u,r,g)}if(o&&Array.isArray(f(t.errors,r))){const g=l(f(t.errors,r),d.argA,d.argB);c&&x(t.errors,r,g),pt(t.errors,r)}if(_.touchedFields&&o&&Array.isArray(f(t.touchedFields,r))){const g=l(f(t.touchedFields,r),d.argA,d.argB);c&&x(t.touchedFields,r,g)}_.dirtyFields&&(t.dirtyFields=ge(n,a)),v.state.next({name:r,isDirty:b(r,i),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else x(a,r,i)},K=(r,i)=>{x(t.errors,r,i),v.state.next({errors:t.errors})},G=r=>{t.errors=r,v.state.next({errors:t.errors,isValid:!1})},k=(r,i,l,d)=>{const c=f(u,r);if(c){const o=f(a,r,w(l)?f(n,r):l);w(o)||d&&d.defaultChecked||i?x(a,r,i?o:Ce(c._f)):U(r,o),y.mount&&J()}},ee=(r,i,l,d,c)=>{let o=!1,g=!1;const A={name:r},E=!!(f(u,r)&&f(u,r)._f&&f(u,r)._f.disabled);if(!l||d){_.isDirty&&(g=t.isDirty,t.isDirty=A.isDirty=b(),o=g!==A.isDirty);const M=E||Z(f(n,r),i);g=!!(!E&&f(t.dirtyFields,r)),M||E?R(t.dirtyFields,r):x(t.dirtyFields,r,!0),A.dirtyFields=t.dirtyFields,o=o||_.dirtyFields&&g!==!M}if(l){const M=f(t.touchedFields,r);M||(x(t.touchedFields,r,l),A.touchedFields=t.touchedFields,o=o||_.touchedFields&&M!==l)}return o&&c&&v.state.next(A),o?A:{}},de=(r,i,l,d)=>{const c=f(t.errors,r),o=_.isValid&&j(i)&&t.isValid!==i;if(e.delayError&&l?(m=xe(()=>K(r,l)),m(e.delayError)):(clearTimeout(S),m=null,l?x(t.errors,r,l):R(t.errors,r)),(l?!Z(c,l):c)||!B(d)||o){const g={...d,...o&&j(i)?{isValid:i}:{},errors:t.errors,name:r};t={...t,...g},v.state.next(g)}},Y=async r=>{Q(r,!0);const i=await s.resolver(a,s.context,Lt(r||h.mount,u,s.criteriaMode,s.shouldUseNativeValidation));return Q(r),i},te=async r=>{const{errors:i}=await Y(r);if(r)for(const l of r){const d=f(i,l);d?x(t.errors,l,d):R(t.errors,l)}else t.errors=i;return i},P=async(r,i,l={valid:!0})=>{for(const d in r){const c=r[d];if(c){const{_f:o,...g}=c;if(o){const A=h.array.has(o.name);Q([d],!0);const E=await Ye(c,a,L,s.shouldUseNativeValidation&&!i,A);if(Q([d]),E[o.name]&&(l.valid=!1,i))break;!i&&(f(E,o.name)?A?kt(t.errors,E,o.name):x(t.errors,o.name,E[o.name]):R(t.errors,o.name))}g&&await P(g,i,l)}}return l.valid},ye=()=>{for(const r of h.unMount){const i=f(u,r);i&&(i._f.refs?i._f.refs.every(l=>!ke(l)):!ke(i._f.ref))&&me(r)}h.unMount=new Set},b=(r,i)=>(r&&i&&x(a,r,i),!Z(Me(),n)),F=(r,i,l)=>at(r,h,{...y.mount?a:w(i)?n:$(r)?{[r]:i}:i},l,i),C=r=>ce(f(y.mount?a:n,r,e.shouldUnregister?f(n,r,[]):[])),U=(r,i,l={})=>{const d=f(u,r);let c=i;if(d){const o=d._f;o&&(!o.disabled&&x(a,r,yt(i,o)),c=be(o.ref)&&O(i)?"":i,ft(o.ref)?[...o.ref.options].forEach(g=>g.selected=c.includes(g.value)):o.refs?fe(o.ref)?o.refs.length>1?o.refs.forEach(g=>(!g.defaultChecked||!g.disabled)&&(g.checked=Array.isArray(c)?!!c.find(A=>A===g.value):c===g.value)):o.refs[0]&&(o.refs[0].checked=!!c):o.refs.forEach(g=>g.checked=g.value===c):Oe(o.ref)?o.ref.value="":(o.ref.value=c,o.ref.type||v.values.next({name:r,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&ee(r,c,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&ae(r)},q=(r,i,l)=>{for(const d in i){const c=i[d],o=`${r}.${d}`,g=f(u,o);(h.array.has(r)||!Fe(c)||g&&!g._f)&&!ie(c)?q(o,c,l):U(o,c,l)}},I=(r,i,l={})=>{const d=f(u,r),c=h.array.has(r),o=p(i);x(a,r,o),c?(v.array.next({name:r,values:{...a}}),(_.isDirty||_.dirtyFields)&&l.shouldDirty&&v.state.next({name:r,dirtyFields:ge(n,a),isDirty:b(r,o)})):d&&!d._f&&!O(o)?q(r,o,l):U(r,o,l),Ge(r,h)&&v.state.next({...t}),v.values.next({name:y.mount?r:void 0,values:{...a}})},ue=async r=>{y.mount=!0;const i=r.target;let l=i.name,d=!0;const c=f(u,l),o=()=>i.type?Ce(c._f):tt(r),g=A=>{d=Number.isNaN(A)||A===f(a,l,A)};if(c){let A,E;const M=o(),re=r.type===_e.BLUR||r.type===_e.FOCUS_OUT,bt=!Ut(c._f)&&!s.resolver&&!f(t.errors,l)&&!c._f.deps||Ot(re,f(t.touchedFields,l),t.isSubmitted,H,N),we=Ge(l,h,re);x(a,l,M),re?(c._f.onBlur&&c._f.onBlur(r),m&&m(0)):c._f.onChange&&c._f.onChange(r);const Ee=ee(l,M,re,!1),Vt=!B(Ee)||we;if(!re&&v.values.next({name:l,type:r.type,values:{...a}}),bt)return _.isValid&&J(),Vt&&v.state.next({name:l,...we?{}:Ee});if(!re&&we&&v.state.next({...t}),s.resolver){const{errors:je}=await Y([l]);if(g(M),d){const Ft=Ze(t.errors,u,l),$e=Ze(je,u,Ft.name||l);A=$e.error,l=$e.name,E=B(je)}}else Q([l],!0),A=(await Ye(c,a,L,s.shouldUseNativeValidation))[l],Q([l]),g(M),d&&(A?E=!1:_.isValid&&(E=await P(u,!0)));d&&(c._f.deps&&ae(c._f.deps),de(l,E,A,Ee))}},le=(r,i)=>{if(f(t.errors,i)&&r.focus)return r.focus(),1},ae=async(r,i={})=>{let l,d;const c=he(r);if(s.resolver){const o=await te(w(r)?r:c);l=B(o),d=r?!c.some(g=>f(o,g)):l}else r?(d=(await Promise.all(c.map(async o=>{const g=f(u,o);return await P(g&&g._f?{[o]:g}:g)}))).every(Boolean),!(!d&&!t.isValid)&&J()):d=l=await P(u);return v.state.next({...!$(r)||_.isValid&&l!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:l}:{},errors:t.errors}),i.shouldFocus&&!d&&oe(u,le,r?c:h.mount),d},Me=r=>{const i={...y.mount?a:n};return w(r)?i:$(r)?f(i,r):r.map(l=>f(i,l))},Be=(r,i)=>({invalid:!!f((i||t).errors,r),isDirty:!!f((i||t).dirtyFields,r),error:f((i||t).errors,r),isValidating:!!f(t.validatingFields,r),isTouched:!!f((i||t).touchedFields,r)}),gt=r=>{r&&he(r).forEach(i=>R(t.errors,i)),v.state.next({errors:r?t.errors:{}})},Pe=(r,i,l)=>{const d=(f(u,r,{_f:{}})._f||{}).ref,c=f(t.errors,r)||{},{ref:o,message:g,type:A,...E}=c;x(t.errors,r,{...E,...i,ref:d}),v.state.next({name:r,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&d&&d.focus&&d.focus()},ht=(r,i)=>X(r)?v.values.subscribe({next:l=>r(F(void 0,i),l)}):F(r,i,!0),me=(r,i={})=>{for(const l of r?he(r):h.mount)h.mount.delete(l),h.array.delete(l),i.keepValue||(R(u,l),R(a,l)),!i.keepError&&R(t.errors,l),!i.keepDirty&&R(t.dirtyFields,l),!i.keepTouched&&R(t.touchedFields,l),!i.keepIsValidating&&R(t.validatingFields,l),!s.shouldUnregister&&!i.keepDefaultValue&&R(n,l);v.values.next({values:{...a}}),v.state.next({...t,...i.keepDirty?{isDirty:b()}:{}}),!i.keepIsValid&&J()},Ie=({disabled:r,name:i,field:l,fields:d,value:c})=>{if(j(r)&&y.mount||r){const o=r?void 0:w(c)?Ce(l?l._f:f(d,i)._f):c;x(a,i,o),ee(i,o,!1,!1,!0)}},De=(r,i={})=>{let l=f(u,r);const d=j(i.disabled);return x(u,r,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:r}},name:r,mount:!0,...i}}),h.mount.add(r),l?Ie({field:l,disabled:i.disabled,name:r,value:i.value}):k(r,!0,i.value),{...d?{disabled:i.disabled}:{},...s.progressive?{required:!!i.required,min:ne(i.min),max:ne(i.max),minLength:ne(i.minLength),maxLength:ne(i.maxLength),pattern:ne(i.pattern)}:{},name:r,onChange:ue,onBlur:ue,ref:c=>{if(c){De(r,i),l=f(u,r);const o=w(c.value)&&c.querySelectorAll&&c.querySelectorAll("input,select,textarea")[0]||c,g=Tt(o),A=l._f.refs||[];if(g?A.find(E=>E===o):o===l._f.ref)return;x(u,r,{_f:{...l._f,...g?{refs:[...A.filter(ke),o,...Array.isArray(f(n,r))?[{}]:[]],ref:{type:o.type,name:r}}:{ref:o}}}),k(r,!1,void 0,o)}else l=f(u,r,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||i.shouldUnregister)&&!(rt(h.array,r)&&y.action)&&h.unMount.add(r)}}},Ne=()=>s.shouldFocusError&&oe(u,le,h.mount),vt=r=>{j(r)&&(v.state.next({disabled:r}),oe(u,(i,l)=>{const d=f(u,l);d&&(i.disabled=d._f.disabled||r,Array.isArray(d._f.refs)&&d._f.refs.forEach(c=>{c.disabled=d._f.disabled||r}))},0,!1))},qe=(r,i)=>async l=>{let d;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let c=p(a);if(v.state.next({isSubmitting:!0}),s.resolver){const{errors:o,values:g}=await Y();t.errors=o,c=g}else await P(u);if(R(t.errors,"root"),B(t.errors)){v.state.next({errors:{}});try{await r(c,l)}catch(o){d=o}}else i&&await i({...t.errors},l),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:B(t.errors)&&!d,submitCount:t.submitCount+1,errors:t.errors}),d)throw d},_t=(r,i={})=>{f(u,r)&&(w(i.defaultValue)?I(r,p(f(n,r))):(I(r,i.defaultValue),x(n,r,p(i.defaultValue))),i.keepTouched||R(t.touchedFields,r),i.keepDirty||(R(t.dirtyFields,r),t.isDirty=i.defaultValue?b(r,p(f(n,r))):b()),i.keepError||(R(t.errors,r),_.isValid&&J()),v.state.next({...t}))},We=(r,i={})=>{const l=r?p(r):n,d=p(l),c=B(r),o=c?n:d;if(i.keepDefaultValues||(n=l),!i.keepValues){if(i.keepDirtyValues)for(const g of h.mount)f(t.dirtyFields,g)?x(o,g,f(a,g)):I(g,f(o,g));else{if(Re&&w(r))for(const g of h.mount){const A=f(u,g);if(A&&A._f){const E=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(be(E)){const M=E.closest("form");if(M){M.reset();break}}}}u={}}a=e.shouldUnregister?i.keepDefaultValues?p(n):{}:p(o),v.array.next({values:{...o}}),v.values.next({values:{...o}})}h={mount:i.keepDirtyValues?h.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},y.mount=!_.isValid||!!i.keepIsValid||!!i.keepDirtyValues,y.watch=!!e.shouldUnregister,v.state.next({submitCount:i.keepSubmitCount?t.submitCount:0,isDirty:c?!1:i.keepDirty?t.isDirty:!!(i.keepDefaultValues&&!Z(r,n)),isSubmitted:i.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:c?[]:i.keepDirtyValues?i.keepDefaultValues&&a?ge(n,a):t.dirtyFields:i.keepDefaultValues&&r?ge(n,r):i.keepDirty?t.dirtyFields:{},touchedFields:i.keepTouched?t.touchedFields:{},errors:i.keepErrors?t.errors:{},isSubmitSuccessful:i.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},He=(r,i)=>We(X(r)?r(a):r,i);return{control:{register:De,unregister:me,getFieldState:Be,handleSubmit:qe,setError:Pe,_executeSchema:Y,_getWatch:F,_getDirty:b,_updateValid:J,_removeUnmounted:ye,_updateFieldArray:V,_updateDisabledField:Ie,_getFieldArray:C,_reset:We,_resetDefaultValues:()=>X(s.defaultValues)&&s.defaultValues().then(r=>{He(r,s.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:r=>{t={...t,...r}},_disableForm:vt,_subjects:v,_proxyFormState:_,_setErrors:G,get _fields(){return u},get _formValues(){return a},get _state(){return y},set _state(r){y=r},get _defaultValues(){return n},get _names(){return h},set _names(r){h=r},get _formState(){return t},set _formState(r){t=r},get _options(){return s},set _options(r){s={...s,...r}}},trigger:ae,register:De,handleSubmit:qe,watch:ht,setValue:I,getValues:Me,reset:He,resetField:_t,clearErrors:gt,unregister:me,setError:Pe,setFocus:(r,i={})=>{const l=f(u,r),d=l&&l._f;if(d){const c=d.refs?d.refs[0]:d.ref;c.focus&&(c.focus(),i.shouldSelect&&c.select())}},getFieldState:Be}}function Ht(e={}){const s=D.useRef(),t=D.useRef(),[u,n]=D.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});s.current||(s.current={...Bt(e),formState:u});const a=s.current.control;return a._options=e,Ue({subject:a._subjects.state,next:y=>{ut(y,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),D.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),D.useEffect(()=>{if(a._proxyFormState.isDirty){const y=a._getDirty();y!==u.isDirty&&a._subjects.state.next({isDirty:y})}},[a,u.isDirty]),D.useEffect(()=>{e.values&&!Z(e.values,t.current)?(a._reset(e.values,a._options.resetOptions),t.current=e.values,n(y=>({...y}))):a._resetDefaultValues()},[e.values,a]),D.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),D.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),D.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),s.current.formState=it(u,a),s.current}export{Wt as C,wt as a,Ht as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as i}from"./codemirror.es-
|
|
1
|
+
import{C as i}from"./codemirror.es-DDaWBk7v.js";import"./index-CU4Kco8M.js";import"./index-Pf5VRxU2.js";var y=Object.defineProperty,u=(e,t)=>y(e,"name",{value:t,configurable:!0});i.defineOption("info",!1,(e,t,n)=>{if(n&&n!==i.Init){const o=e.state.info.onMouseOver;i.off(e.getWrapperElement(),"mouseover",o),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){const o=e.state.info=v(t);o.onMouseOver=h.bind(null,e),i.on(e.getWrapperElement(),"mouseover",o.onMouseOver)}});function v(e){return{options:e instanceof Function?{render:e}:e===!0?{}:e}}u(v,"createState");function g(e){const t=e.state.info.options;return(t==null?void 0:t.hoverTime)||500}u(g,"getHoverTime");function h(e,t){const n=e.state.info,o=t.target||t.srcElement;if(!(o instanceof HTMLElement)||o.nodeName!=="SPAN"||n.hoverTimeout!==void 0)return;const s=o.getBoundingClientRect(),r=u(function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(f,a)},"onMouseMove"),p=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},"onMouseOut"),f=u(function(){i.off(document,"mousemove",r),i.off(e.getWrapperElement(),"mouseout",p),n.hoverTimeout=void 0,T(e,s)},"onHover"),a=g(e);n.hoverTimeout=setTimeout(f,a),i.on(document,"mousemove",r),i.on(e.getWrapperElement(),"mouseout",p)}u(h,"onMouseOver");function T(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),s=e.state.info.options,r=s.render||e.getHelper(n,"info");if(r){const p=e.getTokenAt(n,!0);if(p){const f=r(p,s,e,n);f&&M(e,t,f)}}}u(T,"onMouseHover");function M(e,t,n){const o=document.createElement("div");o.className="CodeMirror-info",o.appendChild(n),document.body.appendChild(o);const s=o.getBoundingClientRect(),r=window.getComputedStyle(o),p=s.right-s.left+parseFloat(r.marginLeft)+parseFloat(r.marginRight),f=s.bottom-s.top+parseFloat(r.marginTop)+parseFloat(r.marginBottom);let a=t.bottom;f>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(a=t.top-f),a<0&&(a=t.bottom);let l=Math.max(0,window.innerWidth-p-15);l>t.left&&(l=t.left),o.style.opacity="1",o.style.top=a+"px",o.style.left=l+"px";let d;const c=u(function(){clearTimeout(d)},"onMouseOverPopup"),m=u(function(){clearTimeout(d),d=setTimeout(O,200)},"onMouseOut"),O=u(function(){i.off(o,"mouseover",c),i.off(o,"mouseout",m),i.off(e.getWrapperElement(),"mouseout",m),o.style.opacity?(o.style.opacity="0",setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o)},600)):o.parentNode&&o.parentNode.removeChild(o)},"hidePopup");i.on(o,"mouseover",c),i.on(o,"mouseout",m),i.on(e.getWrapperElement(),"mouseout",m)}u(M,"showPopup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as h}from"./codemirror.es-
|
|
1
|
+
import{C as h}from"./codemirror.es-DDaWBk7v.js";import{g as E,a as C,b as N,c as _,d as V,e as x}from"./SchemaReference.es-Cw9PnK9u.js";import"./info-addon.es-BvWPiOWh.js";import{Y as A,r as F}from"./index-CU4Kco8M.js";import"./index-Pf5VRxU2.js";import"./introspection.es-CPJcz6nz.js";import"./forEachState.es-D8bf0zSr.js";var L=Object.defineProperty,l=(r,e)=>L(r,"name",{value:e,configurable:!0});h.registerHelper("info","graphql",(r,e)=>{if(!e.schema||!r.state)return;const i=r.state,n=i.kind,d=i.step,c=E(e.schema,r.state);if(n==="Field"&&d===0&&c.fieldDef||n==="AliasedField"&&d===2&&c.fieldDef){const a=document.createElement("div");return o(a,c,e),u(a,e,c.fieldDef),a}else if(n==="Directive"&&d===1&&c.directiveDef){const a=document.createElement("div");return f(a,c,e),u(a,e,c.directiveDef),a}else if(n==="Argument"&&d===0&&c.argDef){const a=document.createElement("div");return p(a,c,e),u(a,e,c.argDef),a}else if(n==="EnumValue"&&c.enumValue&&c.enumValue.description){const a=document.createElement("div");return D(a,c,e),u(a,e,c.enumValue),a}else if(n==="NamedType"&&c.type&&c.type.description){const a=document.createElement("div");return m(a,c,e,c.type),u(a,e,c.type),a}});function o(r,e,i){s(r,e,i),v(r,e,i,e.type)}l(o,"renderField");function s(r,e,i){var n;const d=((n=e.fieldDef)===null||n===void 0?void 0:n.name)||"";d.slice(0,2)!=="__"&&(m(r,e,i,e.parentType),t(r,".")),t(r,d,"field-name",i,C(e))}l(s,"renderQualifiedField");function f(r,e,i){var n;const d="@"+(((n=e.directiveDef)===null||n===void 0?void 0:n.name)||"");t(r,d,"directive-name",i,N(e))}l(f,"renderDirective");function p(r,e,i){var n;e.directiveDef?f(r,e,i):e.fieldDef&&s(r,e,i);const d=((n=e.argDef)===null||n===void 0?void 0:n.name)||"";t(r,"("),t(r,d,"arg-name",i,_(e)),v(r,e,i,e.inputType),t(r,")")}l(p,"renderArg");function v(r,e,i,n){t(r,": "),m(r,e,i,n)}l(v,"renderTypeAnnotation");function D(r,e,i){var n;const d=((n=e.enumValue)===null||n===void 0?void 0:n.name)||"";m(r,e,i,e.inputType),t(r,"."),t(r,d,"enum-value",i,V(e))}l(D,"renderEnumValue");function m(r,e,i,n){n instanceof A?(m(r,e,i,n.ofType),t(r,"!")):n instanceof F?(t(r,"["),m(r,e,i,n.ofType),t(r,"]")):t(r,(n==null?void 0:n.name)||"","type-name",i,x(e,n))}l(m,"renderType");function u(r,e,i){const n=i.description;if(n){const d=document.createElement("div");d.className="info-description",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n)),r.appendChild(d)}T(r,e,i)}l(u,"renderDescription");function T(r,e,i){const n=i.deprecationReason;if(n){const d=document.createElement("div");d.className="info-deprecation",e.renderDescription?d.innerHTML=e.renderDescription(n):d.appendChild(document.createTextNode(n));const c=document.createElement("span");c.className="info-deprecation-label",c.appendChild(document.createTextNode("Deprecated: ")),d.insertBefore(c,d.firstChild),r.appendChild(d)}}l(T,"renderDeprecation");function t(r,e,i="",n={onClick:null},d=null){if(i){const c=n.onClick;let a;c?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",g=>{c(d,g)})):a=document.createElement("span"),a.className=i,a.appendChild(document.createTextNode(e)),r.appendChild(a)}else r.appendChild(document.createTextNode(e))}l(t,"text");
|