From b1f5bd93ae8f4bc36a2d78312f971cf7d43a79e9 Mon Sep 17 00:00:00 2001 From: yangbo <1832064870@qq.com> Date: Sun, 28 Jul 2024 22:30:32 +0800 Subject: [PATCH] Updates --- 404.html | 4 +- assets/index-BJRLkIX1.css | 1 + assets/index-CJl--pu0.css | 1 - .../{index-DddKu5Ar.js => index-j9_fwNZl.js} | 1167 +++++++++++++---- index.html | 4 +- stats.html | 2 +- 6 files changed, 938 insertions(+), 241 deletions(-) create mode 100644 assets/index-BJRLkIX1.css delete mode 100644 assets/index-CJl--pu0.css rename assets/{index-DddKu5Ar.js => index-j9_fwNZl.js} (64%) diff --git a/404.html b/404.html index 23e02e1..c7c5b6e 100644 --- a/404.html +++ b/404.html @@ -6,8 +6,8 @@ React 19 - 这波能反杀 - - + +
diff --git a/assets/index-BJRLkIX1.css b/assets/index-BJRLkIX1.css new file mode 100644 index 0000000..1d64966 --- /dev/null +++ b/assets/index-BJRLkIX1.css @@ -0,0 +1 @@ +.loader{display:inline-block;vertical-align:middle;position:relative;margin:10px}@keyframes loader-bubbles{0%{box-shadow:0 -10px #3b82f6,3px 0 #3b82f6,5px 0 #3b82f6}30%{box-shadow:3px -20px #efdfff00,5px -10px #3b82f6,5px 0 #3b82f6}60%{box-shadow:3px 0 #efdfff00,4px -20px #efdfff00,3px -10px #3b82f6}61%{box-shadow:3px 0 #3b82f6,4px -20px #efdfff00,3px -10px #3b82f6}to{box-shadow:0 -10px #3b82f6,4px -20px #efdfff00,5px -20px #efdfff00}}.loader{width:10px;height:20px;margin-left:20px;margin-right:20px;background:#3b82f6}.loader:before,.loader:after{content:"";position:absolute}.loader:before{top:-8px;left:-13px;width:0;height:0;border:18px solid transparent;border-bottom:20px solid #3b82f6;border-radius:3px}.loader:after{top:0;left:0;width:4px;height:4px;background:#3b82f6;border-radius:50%;animation:loader-bubbles 1s linear infinite forwards}._modal_fd6cp_1{position:fixed;left:0;top:0;bottom:0;right:0;background-color:#0006;animation-duration:.4s;z-index:1000}._modal_fd6cp_1._in_fd6cp_12{animation-name:_show_fd6cp_1}._modal_fd6cp_1._out_fd6cp_16{animation-name:_hide_fd6cp_1;animation-fill-mode:forwards}@keyframes _show_fd6cp_1{0%{opacity:0}to{opacity:1}}@keyframes _hide_fd6cp_1{0%{opacity:1}to{opacity:0}}.pyramid-loader{position:absolute;width:60px;height:30px;display:block;transform-style:preserve-3d;transform:rotateX(-20deg);top:0;bottom:0;left:-40%;margin:auto}.pyramid-loader .wrapper{position:relative;width:100%;height:100%;transform-style:preserve-3d;animation:spin 4s linear infinite}@keyframes spin{to{transform:rotateY(360deg)}}.pyramid-loader .wrapper .side{width:14px;height:14px;background:linear-gradient(to bottom right,orange,#ff4500);position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;transform-origin:center top;clip-path:polygon(50% 0%,0% 100%,100% 100%)}.pyramid-loader .wrapper .side1{transform:rotate(-30deg) rotateY(90deg);background:linear-gradient(to bottom right,#ff4500,orange)}.pyramid-loader .wrapper .side2{transform:rotate(30deg) rotateY(90deg);background:linear-gradient(to bottom right,orange,#ff4500)}.pyramid-loader .wrapper .side3{transform:rotateX(30deg);background:linear-gradient(to bottom right,orange,#ff4500)}.pyramid-loader .wrapper .side4{transform:rotateX(-30deg);background:linear-gradient(to bottom right,#ff4500,orange)}.pyramid-loader .wrapper .shadow{width:60px;height:60px;background:#ff8c00;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;transform:rotateX(90deg) translateZ(-40px);filter:blur(12px)}.dialog-wrapper{max-width:520px;width:90%;background-color:#fff;margin:80px auto;border-radius:8px;padding:20px 24px;animation-duration:.4s}.dialog-wrapper.in{animation-name:dialog-show}.dialog-wrapper.out{animation-name:dialog-hide}@keyframes dialog-show{0%{transform:scale(1);opacity:0}1%{transform:scale(0)}to{transform:scale(1);opacity:1}}@keyframes dialog-hide{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:0}}input{display:block;width:100%;height:34px;text-indent:12px;border:1px solid rgba(0,0,0,.1);border-radius:4px!important;position:relative;outline:none}.input{position:relative}.input:has(>input):after{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;display:flex;justify-content:center;color:#fff;border-radius:50%;font-size:12px}.input:has(>input:invalid):after{content:"྾";line-height:13px;background-color:red}.input:has(>input:valid):after{content:"✓";line-height:16px;background-color:#4dbf2a}input:invalid:required:after{content:"此项为必填项"}input[type=email]:invalid:after{content:"请输入有效的电子邮件地址"}input[type=number]:invalid:after{content:"请输入数字"}.orange{background-color:orange}.red{background-color:#f44336}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888;margin:1px}.sp-wrapper{height:100%}.sp-layout{height:100%;display:flex}.sp-resize-handler{display:none}.sp-editor{height:100%!important;overflow-y:auto!important;--sp-font-lineHeight: 24px}.sp-421664233{--sp-font-size: 12px}.sp-preview{width:100%!important;height:100%!important}@layer switch{.left{--bg-color: rgba(0, 0, 0, .1);--border-color: rgba(0, 0, 0, .2);--x: 0}.right{--bg-color: rgba(0, 0, 0, .9);--border-color: rgba(0, 0, 0, .5);--x: 24px}}.switch{width:3.5rem;cursor:pointer;border-radius:9999px;border-width:1px;padding:1px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.switch:hover{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}.switch{background-color:var(--bg-color);border-color:var(--border-color)}.switch .circle{height:1.5rem;width:1.5rem;border-radius:9999px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;background-color:#fff;transform:translate(var(--x))}@layer context_count{.theme-dark{--text-color: rgba(255, 255, 255, .8);--bg-color: rgba(0, 0, 0, .8);--border-color: rgba(0, 0, 0, .1)}.theme-light{--text-color: rgba(0, 0, 0, .88);--bg-color: rgba(0, 0, 0, .02);--border-color: rgba(0, 0, 0, .1)}}.context-card{background-color:var(--bg-color);border:1px solid var(--border-color);color:var(--text-color)}.spin{position:absolute;left:0;top:0;bottom:0;right:0;animation-duration:.4s;z-index:1000}.spin.in{animation-name:show}.spin.out{animation-name:hide;animation-fill-mode:forwards}@keyframes show{0%{opacity:0}to{opacity:1}}@keyframes hide{0%{opacity:1}to{opacity:0}}._star_1fvk4_1{position:relative;transform:scale(.2);height:200px;--active-color: #d5093c;--normal-color: #cdcdcd}._cen_1fvk4_8{width:200px;height:200px;background-color:var(--normal-color)}._cen_1fvk4_8._active_1fvk4_13{background-color:var(--active-color);animation:1s _aj_1fvk4_1}#_lef_1fvk4_1{border-radius:100px;position:absolute;top:200px;left:300px}#_c_1fvk4_8{transform:rotate(45deg);position:absolute;top:275px;left:375px}#_rig_1fvk4_1{border-radius:100px;position:absolute;top:200px;left:450px}._loading_1fvk4_37{text-align:center}@keyframes _aj_1fvk4_1{0%{transform:scale(1)rotate(45deg)}50%{transform:scale(1.1)rotate(45deg)}to{transform:scale(1)rotate(45deg)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--color-text-base: #FFF;--color-text-muted: #c7d2f7;--color-text-inverted: #4f46e5;--color-fill: #4338ca;--color-button-accent: #FFF;--color-button-accent-hover: #eef2ff;--color-button-muted: 99, 102, 241}.theme-swiss{--color-text-base: #FFF;--color-text-muted: #fecaca;--color-text-inverted: #dc2626;--color-fill: #b91c1c;--color-button-accent: #FFF;--color-button-accent-hover: #fef2f2;--color-button-muted: 239, 68, 68}.theme-neon{--color-text-base: #111802;--color-text-muted: #2fc306;--color-text-inverted: #ebfacc;--color-fill: #b3ff17;--color-button-accent: #243403;--color-button-accent-hover: #374f05;--color-button-muted: 212, 255, 122}.keep p,.keep li{margin-top:1.25rem;margin-bottom:1.25rem;font-size:14px;line-height:2rem;letter-spacing:.05em;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.keep li{position:relative;margin-top:1rem;margin-bottom:1rem;border-radius:.375rem;border-width:1px;border-color:rgb(243 244 246 / var(--tw-border-opacity));--tw-border-opacity: 1;border-bottom-color:rgb(103 232 249 / var(--tw-border-opacity));padding:.75rem 1rem;font-size:13px;line-height:1.5rem}.keep pre:not(.sp-pristine){margin-top:1rem;margin-bottom:1rem;overflow:hidden;border-radius:.375rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity));padding:.25rem;font-size:.875rem;line-height:1.25rem}.keep pre:not(.sp-pristine) div:first-child{border-radius:.375rem;--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;padding:1rem!important;line-height:1.75rem}.keep pre:has(>div>code.language-error){--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity));padding:0}.keep pre:has(>div>code.language-error):before{display:block;--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity));background-repeat:no-repeat;padding-top:.5rem;padding-bottom:.5rem;padding-left:2.5rem;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity));--tw-content: "Error";content:var(--tw-content);background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0icmdiKDIzOSwgNjgsIDY4KSIgY2xhc3M9InNpemUtNiI+CiAgPHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTIgOXYzLjc1bS05LjMwMyAzLjM3NmMtLjg2NiAxLjUuMjE3IDMuMzc0IDEuOTQ4IDMuMzc0aDE0LjcxYzEuNzMgMCAyLjgxMy0xLjg3NCAxLjk0OC0zLjM3NEwxMy45NDkgMy4zNzhjLS44NjYtMS41LTMuMDMyLTEuNS0zLjg5OCAwTDIuNjk3IDE2LjEyNlpNMTIgMTUuNzVoLjAwN3YuMDA4SDEydi0uMDA4WiIgLz4KPC9zdmc+Cg==);background-size:1.25rem;background-position:.75rem center}.keep pre:not(.sp-pristine) div:first-child:has(>code.language-error){--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.keep pre div:has(>code.language-error) code{white-space:pre-wrap!important;overflow-wrap:break-word!important}.keep pre div:has(>code.language-error) span{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.keep p a{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity));text-decoration-line:underline}.keep h1{margin-top:2.5rem;margin-bottom:2.5rem;font-size:1.5rem;line-height:2rem;font-weight:700}.keep h2{margin-top:3rem;margin-bottom:3rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.keep h2+p:has(>strong){margin-top:0;margin-bottom:2.5rem;text-align:center;--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity));color:#ff4500}.keep blockquote{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity));padding:.125rem 1rem;line-height:1.5rem}.keep blockquote:before{margin-top:1rem;display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));--tw-content: "i";content:var(--tw-content)}.keep blockquote p{margin-top:.75rem;margin-bottom:1rem;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity));font-size:13px}.keep p code{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.keep h3{margin-top:1.5rem;font-size:15px;font-weight:700}.keep h2:has(+p){margin-bottom:.25rem;text-align:center}.keep h2:has(+p):before,.keep h2:has(+p):after{display:inline-block;font-weight:400;content:"__"}.keep hr{margin-top:3rem;margin-bottom:3rem;border-top-width:1px;--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.keepx pre:not(.sp-pristine){margin-top:0;margin-bottom:0;overflow:hidden;border-color:transparent;font-size:.875rem;line-height:1.25rem}.keepx pre:not(.sp-pristine) div:first-child{border-radius:.375rem;--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;padding:.75rem!important;line-height:1.75rem}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.card{display:inline-block;padding:1rem;border:1px solid;border-radius:4px;border-color:#f87171;margin:1rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-\[-30\%\]{top:-30%;bottom:-30%}.inset-y-\[-50\%\]{top:-50%;bottom:-50%}.bottom-6{bottom:1.5rem}.left-1\/2{left:50%}.right-6{right:1.5rem}.right-\[-5px\]{right:-5px}.top-0{top:0}.top-16{top:4rem}.top-\[-5px\]{top:-5px}.top-\[8rem\]{top:8rem}.-z-10{z-index:-10}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.m-8{margin:2rem}.\!my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-0{margin-left:0;margin-right:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.-mb-px{margin-bottom:-1px}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-\[-19rem\]{margin-left:-19rem}.ml-\[-38rem\]{margin-left:-38rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-48{margin-top:12rem}.mt-8{margin-top:2rem}.box-border{box-sizing:border-box}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.hidden{display:none}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[160\%\]{height:160%}.h-\[1px\]{height:1px}.h-\[200\%\]{height:200%}.h-\[25rem\]{height:25rem}.h-\[300px\]{height:300px}.h-\[calc\(100vh_-_5rem\)\]{height:calc(100vh - 5rem)}.h-\[calc\(100vh_-_8rem\)\]{height:calc(100vh - 8rem)}.h-\[calc\(100vh_-_9rem_-_35px\)\]{height:calc(100vh - 9rem - 35px)}.h-full{height:100%}.min-h-\[calc\(100vh_-_5rem\)\]{min-height:calc(100vh - 5rem)}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[100px\]{width:100px}.w-\[69\.5625rem\]{width:69.5625rem}.w-\[81\.25rem\]{width:81.25rem}.w-full{width:100%}.min-w-\[320px\]{min-width:320px}.min-w-\[400px\]{min-width:400px}.min-w-full{min-width:100%}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-\[1050px\]{max-width:1050px}.max-w-\[1244px\]{max-width:1244px}.max-w-\[700px\]{max-width:700px}.max-w-\[750px\]{max-width:750px}.max-w-\[768px\]{max-width:768px}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.skew-y-\[-18deg\]{--tw-skew-y: -18deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-none{border-style:none!important}.border-amber-50{--tw-border-opacity: 1;border-color:rgb(255 251 235 / var(--tw-border-opacity))}.border-blue-100{--tw-border-opacity: 1;border-color:rgb(219 234 254 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-cyan-200{--tw-border-opacity: 1;border-color:rgb(165 243 252 / var(--tw-border-opacity))}.border-fuchsia-500{--tw-border-opacity: 1;border-color:rgb(217 70 239 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity))}.border-orange-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity))}.border-sky-300{--tw-border-opacity: 1;border-color:rgb(125 211 252 / var(--tw-border-opacity))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-fuchsia-100{--tw-bg-opacity: 1;background-color:rgb(250 232 255 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-skin-button-accent{background-color:var(--color-button-accent)}.bg-skin-button-muted{--tw-bg-opacity: 1;background-color:rgba(var(--color-button-muted),var(--tw-bg-opacity))}.bg-skin-fill{background-color:var(--color-fill)}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity))}.bg-sky-500{--tw-bg-opacity: 1;background-color:rgb(14 165 233 / var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-zinc-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-zinc-900\/5{background-color:#18181b0d}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#36b49f\]{--tw-gradient-from: #36b49f var(--tw-gradient-from-position);--tw-gradient-to: rgb(54 180 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#D7EDEA\]{--tw-gradient-from: #D7EDEA var(--tw-gradient-from-position);--tw-gradient-to: rgb(215 237 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-skin-hue{--tw-gradient-from: var(--color-fill) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-skin-hue{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-fill) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-\[\#DBFF75\]{--tw-gradient-to: #DBFF75 var(--tw-gradient-to-position)}.to-\[\#F4FBDF\]{--tw-gradient-to: #F4FBDF var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-cover{background-size:cover}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.fill-black\/40{fill:#0006}.fill-black\/50{fill:#00000080}.fill-black\/\[0\.02\]{fill:#00000005}.fill-white{fill:#fff}.fill-zinc-700\/10{fill:#3f3f461a}.stroke-black\/5{stroke:#0000000d}.stroke-black\/50{stroke:#00000080}.stroke-black\/70{stroke:#000000b3}.stroke-zinc-700{stroke:#3f3f46}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-16{padding-left:4rem;padding-right:4rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-10{padding-bottom:2.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pt-16{padding-top:4rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-end{text-align:end}.indent-1{text-indent:.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.\!text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity))!important}.text-blue-50{--tw-text-opacity: 1;color:rgb(239 246 255 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-cyan-500{--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity))}.text-fuchsia-500{--tw-text-opacity: 1;color:rgb(217 70 239 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-skin-base{color:var(--color-text-base)}.text-skin-inverted{color:var(--color-text-inverted)}.text-skin-muted{color:var(--color-text-muted)}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-violet-500{--tw-text-opacity: 1;color:rgb(139 92 246 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.mix-blend-overlay{mix-blend-mode:overlay}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.ring-slate-900\/5{--tw-ring-color: rgb(15 23 42 / .05)}.ring-zinc-900\/25{--tw-ring-color: rgb(24 24 27 / .25)}.blur-\[26px\]{--tw-blur: blur(26px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-\[2px\]{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.\[mask-image\:linear-gradient\(white\,transparent\)\]{-webkit-mask-image:linear-gradient(white,transparent);mask-image:linear-gradient(white,transparent)}.\[mask-image\:radial-gradient\(farthest-side_at_top\,white\,transparent\)\]{-webkit-mask-image:radial-gradient(farthest-side at top,white,transparent);mask-image:radial-gradient(farthest-side at top,white,transparent)}button{cursor:pointer;border-radius:.375rem;border-width:1px;border-style:solid;border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}button:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}::-webkit-scrollbar{display:none}.decorationsOverviewRuler{display:none!important}.first\:pt-0:first-child{padding-top:0}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.hover\:bg-skin-button-accent-hover:hover{background-color:var(--color-button-accent-hover)}.hover\:bg-sky-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.hover\:bg-opacity-70:hover{--tw-bg-opacity: .7}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.hover\:shadow:hover{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-zinc-900\/5:hover{--tw-shadow-color: rgb(24 24 27 / .05);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:stroke-zinc-900{stroke:#18181b}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-50{opacity:.5}.group:hover .group-hover\:ring-zinc-900\/10{--tw-ring-color: rgb(24 24 27 / .1)}.group:hover .group-hover\:ring-zinc-900\/25{--tw-ring-color: rgb(24 24 27 / .25)}.dark\:hidden:is(.dark *){display:none}.dark\:bg-slate-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\:from-\[\#202D2E\]:is(.dark *){--tw-gradient-from: #202D2E var(--tw-gradient-from-position);--tw-gradient-to: rgb(32 45 46 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-\[\#36b49f\]\/30:is(.dark *){--tw-gradient-from: rgb(54 180 159 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(54 180 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-\[\#303428\]:is(.dark *){--tw-gradient-to: #303428 var(--tw-gradient-to-position)}.dark\:to-\[\#DBFF75\]\/30:is(.dark *){--tw-gradient-to: rgb(219 255 117 / .3) var(--tw-gradient-to-position)}.dark\:fill-white\/10:is(.dark *){fill:#ffffff1a}.dark\:stroke-white\/10:is(.dark *){stroke:#ffffff1a}.dark\:stroke-white\/5:is(.dark *){stroke:#ffffff0d}.dark\:stroke-zinc-400:is(.dark *){stroke:#a1a1aa}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-zinc-400:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.dark\:opacity-100:is(.dark *){opacity:1}.dark\:ring-slate-200\/20:is(.dark *){--tw-ring-color: rgb(226 232 240 / .2)}.dark\:ring-white\/10:is(.dark *){--tw-ring-color: rgb(255 255 255 / .1)}.dark\:ring-white\/15:is(.dark *){--tw-ring-color: rgb(255 255 255 / .15)}.dark\:\[mask-image\:linear-gradient\(white\,transparent\)\]:is(.dark *){-webkit-mask-image:linear-gradient(white,transparent);mask-image:linear-gradient(white,transparent)}.dark\:hover\:shadow-black\/5:hover:is(.dark *){--tw-shadow-color: rgb(0 0 0 / .05);--tw-shadow: var(--tw-shadow-colored)}.group:hover .dark\:group-hover\:bg-emerald-300\/10:is(.dark *){background-color:#6ee7b71a}.group:hover .dark\:group-hover\:fill-emerald-300\/10:is(.dark *){fill:#6ee7b71a}.group:hover .dark\:group-hover\:stroke-emerald-400:is(.dark *){stroke:#34d399}.group:hover .dark\:group-hover\:ring-emerald-400:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(52 211 153 / var(--tw-ring-opacity))}.group:hover .dark\:group-hover\:ring-white\/20:is(.dark *){--tw-ring-color: rgb(255 255 255 / .2)}@media (min-width: 640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:ml-16{margin-left:4rem}.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:table-cell{display:table-cell}.sm\:hidden{display:none}.sm\:h-auto{height:auto}.sm\:w-1\/2{width:50%}.sm\:w-1\/6{width:16.666667%}.sm\:w-\[1px\]{width:1px}.sm\:flex-auto{flex:1 1 auto}.sm\:flex-none{flex:none}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:pl-0{padding-left:0}.sm\:pr-0{padding-right:0}}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-\[calc\(100vw_-_15rem\)\]{width:calc(100vw - 15rem)}.md\:flex-1{flex:1 1 0%}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:pl-10{padding-left:2.5rem}.md\:pr-4{padding-right:1rem}}@media (min-width: 1024px){.lg\:px-8{padding-left:2rem;padding-right:2rem}} diff --git a/assets/index-CJl--pu0.css b/assets/index-CJl--pu0.css deleted file mode 100644 index b777347..0000000 --- a/assets/index-CJl--pu0.css +++ /dev/null @@ -1 +0,0 @@ -.loader{display:inline-block;vertical-align:middle;position:relative;margin:10px}@keyframes loader-bubbles{0%{box-shadow:0 -10px #3b82f6,3px 0 #3b82f6,5px 0 #3b82f6}30%{box-shadow:3px -20px #efdfff00,5px -10px #3b82f6,5px 0 #3b82f6}60%{box-shadow:3px 0 #efdfff00,4px -20px #efdfff00,3px -10px #3b82f6}61%{box-shadow:3px 0 #3b82f6,4px -20px #efdfff00,3px -10px #3b82f6}to{box-shadow:0 -10px #3b82f6,4px -20px #efdfff00,5px -20px #efdfff00}}.loader{width:10px;height:20px;margin-left:20px;margin-right:20px;background:#3b82f6}.loader:before,.loader:after{content:"";position:absolute}.loader:before{top:-8px;left:-13px;width:0;height:0;border:18px solid transparent;border-bottom:20px solid #3b82f6;border-radius:3px}.loader:after{top:0;left:0;width:4px;height:4px;background:#3b82f6;border-radius:50%;animation:loader-bubbles 1s linear infinite forwards}._modal_fd6cp_1{position:fixed;left:0;top:0;bottom:0;right:0;background-color:#0006;animation-duration:.4s;z-index:1000}._modal_fd6cp_1._in_fd6cp_12{animation-name:_show_fd6cp_1}._modal_fd6cp_1._out_fd6cp_16{animation-name:_hide_fd6cp_1;animation-fill-mode:forwards}@keyframes _show_fd6cp_1{0%{opacity:0}to{opacity:1}}@keyframes _hide_fd6cp_1{0%{opacity:1}to{opacity:0}}.pyramid-loader{position:absolute;width:60px;height:30px;display:block;transform-style:preserve-3d;transform:rotateX(-20deg);top:0;bottom:0;left:-40%;margin:auto}.pyramid-loader .wrapper{position:relative;width:100%;height:100%;transform-style:preserve-3d;animation:spin 4s linear infinite}@keyframes spin{to{transform:rotateY(360deg)}}.pyramid-loader .wrapper .side{width:14px;height:14px;background:linear-gradient(to bottom right,orange,#ff4500);position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;transform-origin:center top;clip-path:polygon(50% 0%,0% 100%,100% 100%)}.pyramid-loader .wrapper .side1{transform:rotate(-30deg) rotateY(90deg);background:linear-gradient(to bottom right,#ff4500,orange)}.pyramid-loader .wrapper .side2{transform:rotate(30deg) rotateY(90deg);background:linear-gradient(to bottom right,orange,#ff4500)}.pyramid-loader .wrapper .side3{transform:rotateX(30deg);background:linear-gradient(to bottom right,orange,#ff4500)}.pyramid-loader .wrapper .side4{transform:rotateX(-30deg);background:linear-gradient(to bottom right,#ff4500,orange)}.pyramid-loader .wrapper .shadow{width:60px;height:60px;background:#ff8c00;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;transform:rotateX(90deg) translateZ(-40px);filter:blur(12px)}.dialog-wrapper{max-width:520px;width:90%;background-color:#fff;margin:80px auto;border-radius:8px;padding:20px 24px;animation-duration:.4s}.dialog-wrapper.in{animation-name:dialog-show}.dialog-wrapper.out{animation-name:dialog-hide}@keyframes dialog-show{0%{transform:scale(1);opacity:0}1%{transform:scale(0)}to{transform:scale(1);opacity:1}}@keyframes dialog-hide{0%{transform:scale(1);opacity:1}to{transform:scale(0);opacity:0}}input{display:block;width:100%;height:34px;text-indent:12px;border:1px solid rgba(0,0,0,.1);border-radius:4px!important;position:relative;outline:none}.input{position:relative}.input:has(>input):after{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;display:flex;justify-content:center;color:#fff;border-radius:50%;font-size:12px}.input:has(>input:invalid):after{content:"྾";line-height:13px;background-color:red}.input:has(>input:valid):after{content:"✓";line-height:16px;background-color:#4dbf2a}input:invalid:required:after{content:"此项为必填项"}input[type=email]:invalid:after{content:"请输入有效的电子邮件地址"}input[type=number]:invalid:after{content:"请输入数字"}.orange{background-color:orange}.red{background-color:#f44336}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888;margin:1px}.sp-wrapper{height:100%}.sp-layout{height:100%;display:flex}.sp-resize-handler{display:none}.sp-editor{height:100%!important;overflow-y:auto!important;--sp-font-lineHeight: 24px}.sp-421664233{--sp-font-size: 12px}.sp-preview{width:100%!important;height:100%!important}@layer switch{.left{--bg-color: rgba(0, 0, 0, .1);--border-color: rgba(0, 0, 0, .2);--x: 0}.right{--bg-color: rgba(0, 0, 0, .9);--border-color: rgba(0, 0, 0, .5);--x: 24px}}.switch{width:3.5rem;cursor:pointer;border-radius:9999px;border-width:1px;padding:1px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.switch:hover{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}.switch{background-color:var(--bg-color);border-color:var(--border-color)}.switch .circle{height:1.5rem;width:1.5rem;border-radius:9999px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;background-color:#fff;transform:translate(var(--x))}@layer context_count{.theme-dark{--text-color: rgba(255, 255, 255, .8);--bg-color: rgba(0, 0, 0, .8);--border-color: rgba(0, 0, 0, .1)}.theme-light{--text-color: rgba(0, 0, 0, .88);--bg-color: rgba(0, 0, 0, .02);--border-color: rgba(0, 0, 0, .1)}}.context-card{background-color:var(--bg-color);border:1px solid var(--border-color);color:var(--text-color)}.spin{position:absolute;left:0;top:0;bottom:0;right:0;animation-duration:.4s;z-index:1000}.spin.in{animation-name:show}.spin.out{animation-name:hide;animation-fill-mode:forwards}@keyframes show{0%{opacity:0}to{opacity:1}}@keyframes hide{0%{opacity:1}to{opacity:0}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--color-text-base: #FFF;--color-text-muted: #c7d2f7;--color-text-inverted: #4f46e5;--color-fill: #4338ca;--color-button-accent: #FFF;--color-button-accent-hover: #eef2ff;--color-button-muted: 99, 102, 241}.theme-swiss{--color-text-base: #FFF;--color-text-muted: #fecaca;--color-text-inverted: #dc2626;--color-fill: #b91c1c;--color-button-accent: #FFF;--color-button-accent-hover: #fef2f2;--color-button-muted: 239, 68, 68}.theme-neon{--color-text-base: #111802;--color-text-muted: #2fc306;--color-text-inverted: #ebfacc;--color-fill: #b3ff17;--color-button-accent: #243403;--color-button-accent-hover: #374f05;--color-button-muted: 212, 255, 122}.keep p,.keep li{margin-top:1.25rem;margin-bottom:1.25rem;font-size:14px;line-height:2rem;letter-spacing:.05em;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.keep li{position:relative;margin-top:1rem;margin-bottom:1rem;border-radius:.375rem;border-width:1px;border-color:rgb(243 244 246 / var(--tw-border-opacity));--tw-border-opacity: 1;border-bottom-color:rgb(103 232 249 / var(--tw-border-opacity));padding:.75rem 1rem;font-size:13px;line-height:1.5rem}.keep pre:not(.sp-pristine){margin-top:1rem;margin-bottom:1rem;overflow:hidden;border-radius:.375rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity));padding:.25rem;font-size:.875rem;line-height:1.25rem}.keep pre:not(.sp-pristine) div:first-child{border-radius:.375rem;--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;padding:1rem!important;line-height:1.75rem}.keep pre:has(>div>code.language-error){--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity));padding:0}.keep pre:has(>div>code.language-error):before{display:block;--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity));background-repeat:no-repeat;padding-top:.5rem;padding-bottom:.5rem;padding-left:2.5rem;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity));--tw-content: "Error";content:var(--tw-content);background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0icmdiKDIzOSwgNjgsIDY4KSIgY2xhc3M9InNpemUtNiI+CiAgPHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTIgOXYzLjc1bS05LjMwMyAzLjM3NmMtLjg2NiAxLjUuMjE3IDMuMzc0IDEuOTQ4IDMuMzc0aDE0LjcxYzEuNzMgMCAyLjgxMy0xLjg3NCAxLjk0OC0zLjM3NEwxMy45NDkgMy4zNzhjLS44NjYtMS41LTMuMDMyLTEuNS0zLjg5OCAwTDIuNjk3IDE2LjEyNlpNMTIgMTUuNzVoLjAwN3YuMDA4SDEydi0uMDA4WiIgLz4KPC9zdmc+Cg==);background-size:1.25rem;background-position:.75rem center}.keep pre:not(.sp-pristine) div:first-child:has(>code.language-error){--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.keep pre div:has(>code.language-error) code{white-space:pre-wrap!important;overflow-wrap:break-word!important}.keep pre div:has(>code.language-error) span{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.keep p a{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity));text-decoration-line:underline}.keep h1{margin-top:2.5rem;margin-bottom:2.5rem;font-size:1.5rem;line-height:2rem;font-weight:700}.keep h2{margin-top:3rem;margin-bottom:3rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.keep h2+p:has(>strong){margin-top:0;margin-bottom:2.5rem;text-align:center;--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity));color:#ff4500}.keep blockquote{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity));padding:.125rem 1rem;line-height:1.5rem}.keep blockquote:before{margin-top:1rem;display:flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));--tw-content: "i";content:var(--tw-content)}.keep blockquote p{margin-top:.75rem;margin-bottom:1rem;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity));font-size:13px}.keep p code{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.keep h3{margin-top:1.5rem;font-size:15px;font-weight:700}.keep h2:has(+p){margin-bottom:.25rem;text-align:center}.keep h2:has(+p):before,.keep h2:has(+p):after{display:inline-block;font-weight:400;content:"__"}.keep hr{margin-top:3rem;margin-bottom:3rem;border-top-width:1px;--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.keepx pre:not(.sp-pristine){margin-top:0;margin-bottom:0;overflow:hidden;border-color:transparent;font-size:.875rem;line-height:1.25rem}.keepx pre:not(.sp-pristine) div:first-child{border-radius:.375rem;--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important;padding:.75rem!important;line-height:1.75rem}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.card{display:inline-block;padding:1rem;border:1px solid;border-radius:4px;border-color:#f87171;margin:1rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-\[-30\%\]{top:-30%;bottom:-30%}.inset-y-\[-50\%\]{top:-50%;bottom:-50%}.bottom-6{bottom:1.5rem}.left-1\/2{left:50%}.right-6{right:1.5rem}.right-\[-5px\]{right:-5px}.top-0{top:0}.top-16{top:4rem}.top-\[-5px\]{top:-5px}.top-\[8rem\]{top:8rem}.-z-10{z-index:-10}.z-40{z-index:40}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.m-8{margin:2rem}.\!my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-0{margin-left:0;margin-right:0}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.-mb-px{margin-bottom:-1px}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-\[-19rem\]{margin-left:-19rem}.ml-\[-38rem\]{margin-left:-38rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-48{margin-top:12rem}.mt-8{margin-top:2rem}.box-border{box-sizing:border-box}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.hidden{display:none}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[160\%\]{height:160%}.h-\[1px\]{height:1px}.h-\[200\%\]{height:200%}.h-\[25rem\]{height:25rem}.h-\[300px\]{height:300px}.h-\[calc\(100vh_-_5rem\)\]{height:calc(100vh - 5rem)}.h-\[calc\(100vh_-_8rem\)\]{height:calc(100vh - 8rem)}.h-\[calc\(100vh_-_9rem_-_35px\)\]{height:calc(100vh - 9rem - 35px)}.h-full{height:100%}.min-h-\[calc\(100vh_-_5rem\)\]{min-height:calc(100vh - 5rem)}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[100px\]{width:100px}.w-\[69\.5625rem\]{width:69.5625rem}.w-\[81\.25rem\]{width:81.25rem}.w-full{width:100%}.min-w-\[320px\]{min-width:320px}.min-w-\[400px\]{min-width:400px}.min-w-full{min-width:100%}.max-w-0{max-width:0px}.max-w-2xl{max-width:42rem}.max-w-\[1050px\]{max-width:1050px}.max-w-\[1244px\]{max-width:1244px}.max-w-\[700px\]{max-width:700px}.max-w-\[750px\]{max-width:750px}.max-w-\[768px\]{max-width:768px}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.skew-y-\[-18deg\]{--tw-skew-y: -18deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-none{border-style:none!important}.border-amber-50{--tw-border-opacity: 1;border-color:rgb(255 251 235 / var(--tw-border-opacity))}.border-blue-100{--tw-border-opacity: 1;border-color:rgb(219 234 254 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-cyan-200{--tw-border-opacity: 1;border-color:rgb(165 243 252 / var(--tw-border-opacity))}.border-fuchsia-500{--tw-border-opacity: 1;border-color:rgb(217 70 239 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity))}.border-orange-500{--tw-border-opacity: 1;border-color:rgb(249 115 22 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity))}.border-sky-300{--tw-border-opacity: 1;border-color:rgb(125 211 252 / var(--tw-border-opacity))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-fuchsia-100{--tw-bg-opacity: 1;background-color:rgb(250 232 255 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-skin-button-accent{background-color:var(--color-button-accent)}.bg-skin-button-muted{--tw-bg-opacity: 1;background-color:rgba(var(--color-button-muted),var(--tw-bg-opacity))}.bg-skin-fill{background-color:var(--color-fill)}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity))}.bg-sky-50{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity))}.bg-sky-500{--tw-bg-opacity: 1;background-color:rgb(14 165 233 / var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-zinc-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-zinc-900\/5{background-color:#18181b0d}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\[\#36b49f\]{--tw-gradient-from: #36b49f var(--tw-gradient-from-position);--tw-gradient-to: rgb(54 180 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-\[\#D7EDEA\]{--tw-gradient-from: #D7EDEA var(--tw-gradient-from-position);--tw-gradient-to: rgb(215 237 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-skin-hue{--tw-gradient-from: var(--color-fill) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-skin-hue{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-fill) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-\[\#DBFF75\]{--tw-gradient-to: #DBFF75 var(--tw-gradient-to-position)}.to-\[\#F4FBDF\]{--tw-gradient-to: #F4FBDF var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-cover{background-size:cover}.bg-center{background-position:center}.bg-no-repeat{background-repeat:no-repeat}.fill-black\/40{fill:#0006}.fill-black\/50{fill:#00000080}.fill-black\/\[0\.02\]{fill:#00000005}.fill-white{fill:#fff}.fill-zinc-700\/10{fill:#3f3f461a}.stroke-black\/5{stroke:#0000000d}.stroke-black\/50{stroke:#00000080}.stroke-black\/70{stroke:#000000b3}.stroke-zinc-700{stroke:#3f3f46}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-16{padding-left:4rem;padding-right:4rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-10{padding-bottom:2.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-6{padding-right:1.5rem}.pt-16{padding-top:4rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-end{text-align:end}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.\!text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity))!important}.text-blue-50{--tw-text-opacity: 1;color:rgb(239 246 255 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-cyan-500{--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity))}.text-fuchsia-500{--tw-text-opacity: 1;color:rgb(217 70 239 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-skin-base{color:var(--color-text-base)}.text-skin-inverted{color:var(--color-text-inverted)}.text-skin-muted{color:var(--color-text-muted)}.text-sky-500{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-violet-500{--tw-text-opacity: 1;color:rgb(139 92 246 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.mix-blend-overlay{mix-blend-mode:overlay}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.ring-slate-900\/5{--tw-ring-color: rgb(15 23 42 / .05)}.ring-zinc-900\/25{--tw-ring-color: rgb(24 24 27 / .25)}.blur-\[26px\]{--tw-blur: blur(26px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-\[2px\]{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.\[mask-image\:linear-gradient\(white\,transparent\)\]{-webkit-mask-image:linear-gradient(white,transparent);mask-image:linear-gradient(white,transparent)}.\[mask-image\:radial-gradient\(farthest-side_at_top\,white\,transparent\)\]{-webkit-mask-image:radial-gradient(farthest-side at top,white,transparent);mask-image:radial-gradient(farthest-side at top,white,transparent)}button{cursor:pointer;border-radius:.375rem;border-width:1px;border-style:solid;border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity));padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:500;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}button:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}::-webkit-scrollbar{display:none}.decorationsOverviewRuler{display:none!important}.first\:pt-0:first-child{padding-top:0}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.hover\:bg-amber-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.hover\:bg-skin-button-accent-hover:hover{background-color:var(--color-button-accent-hover)}.hover\:bg-sky-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 249 255 / var(--tw-bg-opacity))}.hover\:bg-opacity-70:hover{--tw-bg-opacity: .7}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.hover\:shadow:hover{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-zinc-900\/5:hover{--tw-shadow-color: rgb(24 24 27 / .05);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:stroke-zinc-900{stroke:#18181b}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-50{opacity:.5}.group:hover .group-hover\:ring-zinc-900\/10{--tw-ring-color: rgb(24 24 27 / .1)}.group:hover .group-hover\:ring-zinc-900\/25{--tw-ring-color: rgb(24 24 27 / .25)}.dark\:hidden:is(.dark *){display:none}.dark\:bg-slate-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\:from-\[\#202D2E\]:is(.dark *){--tw-gradient-from: #202D2E var(--tw-gradient-from-position);--tw-gradient-to: rgb(32 45 46 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-\[\#36b49f\]\/30:is(.dark *){--tw-gradient-from: rgb(54 180 159 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(54 180 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:to-\[\#303428\]:is(.dark *){--tw-gradient-to: #303428 var(--tw-gradient-to-position)}.dark\:to-\[\#DBFF75\]\/30:is(.dark *){--tw-gradient-to: rgb(219 255 117 / .3) var(--tw-gradient-to-position)}.dark\:fill-white\/10:is(.dark *){fill:#ffffff1a}.dark\:stroke-white\/10:is(.dark *){stroke:#ffffff1a}.dark\:stroke-white\/5:is(.dark *){stroke:#ffffff0d}.dark\:stroke-zinc-400:is(.dark *){stroke:#a1a1aa}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-zinc-400:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.dark\:opacity-100:is(.dark *){opacity:1}.dark\:ring-slate-200\/20:is(.dark *){--tw-ring-color: rgb(226 232 240 / .2)}.dark\:ring-white\/10:is(.dark *){--tw-ring-color: rgb(255 255 255 / .1)}.dark\:ring-white\/15:is(.dark *){--tw-ring-color: rgb(255 255 255 / .15)}.dark\:\[mask-image\:linear-gradient\(white\,transparent\)\]:is(.dark *){-webkit-mask-image:linear-gradient(white,transparent);mask-image:linear-gradient(white,transparent)}.dark\:hover\:shadow-black\/5:hover:is(.dark *){--tw-shadow-color: rgb(0 0 0 / .05);--tw-shadow: var(--tw-shadow-colored)}.group:hover .dark\:group-hover\:bg-emerald-300\/10:is(.dark *){background-color:#6ee7b71a}.group:hover .dark\:group-hover\:fill-emerald-300\/10:is(.dark *){fill:#6ee7b71a}.group:hover .dark\:group-hover\:stroke-emerald-400:is(.dark *){stroke:#34d399}.group:hover .dark\:group-hover\:ring-emerald-400:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(52 211 153 / var(--tw-ring-opacity))}.group:hover .dark\:group-hover\:ring-white\/20:is(.dark *){--tw-ring-color: rgb(255 255 255 / .2)}@media (min-width: 640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:ml-16{margin-left:4rem}.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:table-cell{display:table-cell}.sm\:hidden{display:none}.sm\:h-auto{height:auto}.sm\:w-1\/2{width:50%}.sm\:w-1\/6{width:16.666667%}.sm\:w-\[1px\]{width:1px}.sm\:flex-auto{flex:1 1 auto}.sm\:flex-none{flex:none}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:pl-0{padding-left:0}.sm\:pr-0{padding-right:0}}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-\[calc\(100vw_-_15rem\)\]{width:calc(100vw - 15rem)}.md\:flex-1{flex:1 1 0%}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.md\:p-8{padding:2rem}.md\:pl-10{padding-left:2.5rem}.md\:pr-4{padding-right:1rem}}@media (min-width: 1024px){.lg\:px-8{padding-left:2rem;padding-right:2rem}} diff --git a/assets/index-DddKu5Ar.js b/assets/index-j9_fwNZl.js similarity index 64% rename from assets/index-DddKu5Ar.js rename to assets/index-j9_fwNZl.js index ef26a9a..28baddd 100644 --- a/assets/index-DddKu5Ar.js +++ b/assets/index-j9_fwNZl.js @@ -1,4 +1,4 @@ -function Ax(n,e){for(var s=0;sa[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function s(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(l){if(l.ep)return;l.ep=!0;const r=s(l);fetch(l.href,r)}})();function so(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bp={exports:{}},Br={};/** +function Wx(n,e){for(var s=0;sa[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function s(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(l){if(l.ep)return;l.ep=!0;const r=s(l);fetch(l.href,r)}})();function _p(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kp={exports:{}},Br={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ function Ax(n,e){for(var s=0;s>>1,J=C[V];if(0>>1;Vl(w,$))El(O,w)?(C[V]=O,C[E]=$,V=E):(C[V]=w,C[He]=$,V=He);else if(El(O,$))C[V]=O,C[E]=$,V=E;else break e}}return L}function l(C,L){var $=C.sortIndex-L.sortIndex;return $!==0?$:C.id-L.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var c=Date,i=c.now();n.unstable_now=function(){return c.now()-i}}var o=[],d=[],u=1,m=null,p=3,g=!1,y=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;function v(C){for(var L=s(d);L!==null;){if(L.callback===null)a(d);else if(L.startTime<=C)a(d),L.sortIndex=L.expirationTime,e(o,L);else break;L=s(d)}}function j(C){if(b=!1,v(C),!y)if(s(o)!==null)y=!0,Ue();else{var L=s(d);L!==null&&ge(j,L.startTime-C)}}var _=!1,k=-1,R=5,M=-1;function Y(){return!(n.unstable_now()-MC&&Y());){var V=m.callback;if(typeof V=="function"){m.callback=null,p=m.priorityLevel;var J=V(m.expirationTime<=C);if(C=n.unstable_now(),typeof J=="function"){m.callback=J,v(C),L=!0;break n}m===s(o)&&a(o),v(C)}else a(o);m=s(o)}if(m!==null)L=!0;else{var Ae=s(d);Ae!==null&&ge(j,Ae.startTime-C),L=!1}}break e}finally{m=null,p=$,g=!1}L=void 0}}finally{L?ce():_=!1}}}var ce;if(typeof f=="function")ce=function(){f(B)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,tn=U.port2;U.port1.onmessage=B,ce=function(){tn.postMessage(null)}}else ce=function(){N(B,0)};function Ue(){_||(_=!0,ce())}function ge(C,L){k=N(function(){C(n.unstable_now())},L)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(C){C.callback=null},n.unstable_continueExecution=function(){y||g||(y=!0,Ue())},n.unstable_forceFrameRate=function(C){0>C||125V?(C.sortIndex=$,e(d,C),s(o)===null&&C===s(d)&&(b?(x(k),k=-1):b=!0,ge(j,$-V))):(C.sortIndex=J,e(o,C),y||g||(y=!0,Ue())),C},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(C){var L=p;return function(){var $=p;p=L;try{return C.apply(this,arguments)}finally{p=$}}}})(Ap);Mp.exports=Ap;var Wx=Mp.exports,Tp={exports:{}},Ye={};/** + */(function(n){function e(C,D){var $=C.length;C.push(D);e:for(;0<$;){var V=$-1>>>1,J=C[V];if(0>>1;Vl(w,$))Ml(B,w)?(C[V]=B,C[M]=$,V=M):(C[V]=w,C[He]=$,V=He);else if(Ml(B,$))C[V]=B,C[M]=$,V=M;else break e}}return D}function l(C,D){var $=C.sortIndex-D.sortIndex;return $!==0?$:C.id-D.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var i=Date,c=i.now();n.unstable_now=function(){return i.now()-c}}var o=[],u=[],d=1,m=null,p=3,j=!1,y=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function g(C){for(var D=s(u);D!==null;){if(D.callback===null)a(u);else if(D.startTime<=C)a(u),D.sortIndex=D.expirationTime,e(o,D);else break;D=s(u)}}function v(C){if(b=!1,g(C),!y)if(s(o)!==null)y=!0,Ue();else{var D=s(u);D!==null&&ge(v,D.startTime-C)}}var _=!1,k=-1,R=5,E=-1;function Y(){return!(n.unstable_now()-EC&&Y());){var V=m.callback;if(typeof V=="function"){m.callback=null,p=m.priorityLevel;var J=V(m.expirationTime<=C);if(C=n.unstable_now(),typeof J=="function"){m.callback=J,g(C),D=!0;break n}m===s(o)&&a(o),g(C)}else a(o);m=s(o)}if(m!==null)D=!0;else{var Ae=s(u);Ae!==null&&ge(v,Ae.startTime-C),D=!1}}break e}finally{m=null,p=$,j=!1}D=void 0}}finally{D?ie():_=!1}}}var ie;if(typeof h=="function")ie=function(){h(O)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,tn=U.port2;U.port1.onmessage=O,ie=function(){tn.postMessage(null)}}else ie=function(){N(O,0)};function Ue(){_||(_=!0,ie())}function ge(C,D){k=N(function(){C(n.unstable_now())},D)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(C){C.callback=null},n.unstable_continueExecution=function(){y||j||(y=!0,Ue())},n.unstable_forceFrameRate=function(C){0>C||125V?(C.sortIndex=$,e(u,C),s(o)===null&&C===s(u)&&(b?(x(k),k=-1):b=!0,ge(v,$-V))):(C.sortIndex=J,e(o,C),y||j||(y=!0,Ue())),C},n.unstable_shouldYield=Y,n.unstable_wrapCallback=function(C){var D=p;return function(){var $=p;p=D;try{return C.apply(this,arguments)}finally{p=$}}}})(Bp);Op.exports=Bp;var h1=Op.exports,zp={exports:{}},Ye={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ function Ax(n,e){for(var s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dp)}catch(n){console.error(n)}}Dp(),Tp.exports=Ye;var cl=Tp.exports;/** + */function Up(n){var e="https://react.dev/errors/"+n;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hp)}catch(n){console.error(n)}}Hp(),zp.exports=Ye;var cl=zp.exports;/** * @license React * react-dom-client.production.js * @@ -38,14 +38,14 @@ function Ax(n,e){for(var s=0;svs||(n.current=si[vs],si[vs]=null,vs--)}function de(n,e){vs++,si[vs]=n.current,n.current=e}var Tn=zn(null),Ha=zn(null),Nt=zn(null),ai=zn(null),sr={$$typeof:gt,Provider:null,Consumer:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ar(n,e){switch(de(Nt,e),de(Ha,n),de(Tn,null),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)&&(e=e.namespaceURI)?Od(e):0;break;default:if(n=n===8?e.parentNode:e,e=n.tagName,n=n.namespaceURI)n=Od(n),e=n0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Me(Tn),de(Tn,e)}function Us(){Me(Tn),Me(Ha),Me(Nt)}function li(n){n.memoizedState!==null&&de(ai,n);var e=Tn.current,s=n0(e,n.type);e!==s&&(de(Ha,n),de(Tn,s))}function lr(n){Ha.current===n&&(Me(Tn),Me(Ha)),ai.current===n&&(Me(ai),sr._currentValue=null)}var ri=Object.prototype.hasOwnProperty,oo=Ce.unstable_scheduleCallback,oc=Ce.unstable_cancelCallback,c1=Ce.unstable_shouldYield,i1=Ce.unstable_requestPaint,$n=Ce.unstable_now,o1=Ce.unstable_getCurrentPriorityLevel,uo=Ce.unstable_ImmediatePriority,Vp=Ce.unstable_UserBlockingPriority,rr=Ce.unstable_NormalPriority,u1=Ce.unstable_LowPriority,Xp=Ce.unstable_IdlePriority,d1=Ce.log,m1=Ce.unstable_setDisableYieldValue,il=null,en=null;function p1(n){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(il,n,void 0,(n.current.flags&128)===128)}catch{}}function vt(n){if(typeof d1=="function"&&m1(n),en&&typeof en.setStrictMode=="function")try{en.setStrictMode(il,n)}catch{}}var mn=Math.clz32?Math.clz32:x1,f1=Math.log,h1=Math.LN2;function x1(n){return n>>>=0,n===0?32:31-(f1(n)/h1|0)|0}var wl=128,_l=4194304;function ja(n){var e=n&42;if(e!==0)return e;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function cr(n,e){var s=n.pendingLanes;if(s===0)return 0;var a=0,l=n.suspendedLanes;n=n.pingedLanes;var r=s&134217727;return r!==0?(s=r&~l,s!==0?a=ja(s):(n&=r,n!==0&&(a=ja(n)))):(s&=~l,s!==0?a=ja(s):n!==0&&(a=ja(n))),a===0?0:e!==0&&e!==a&&!(e&l)&&(l=a&-a,n=e&-e,l>=n||l===32&&(n&4194176)!==0)?e:a}function g1(n,e){switch(n){case 1:case 2:case 4:case 8:return e+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gp(n,e){return n.errorRecoveryDisabledLanes&e?0:(n=n.pendingLanes&-536870913,n!==0?n:n&536870912?536870912:0)}function Zp(){var n=wl;return wl<<=1,!(wl&4194176)&&(wl=128),n}function Yp(){var n=_l;return _l<<=1,!(_l&62914560)&&(_l=4194304),n}function uc(n){for(var e=[],s=0;31>s;s++)e.push(n);return e}function v1(n,e,s){var a=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.entangledLanes&=e,n.errorRecoveryDisabledLanes&=e,n.shellSuspendCounter=0,e=n.entanglements;for(var l=n.expirationTimes,r=n.hiddenUpdates;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),N1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Vu={},Xu={};function S1(n){return ri.call(Xu,n)?!0:ri.call(Vu,n)?!1:N1.test(n)?Xu[n]=!0:(Vu[n]=!0,!1)}function ii(n,e,s){if(S1(e))if(s===null)n.removeAttribute(e);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(e);return;case"boolean":var a=e.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){n.removeAttribute(e);return}}n.setAttribute(e,""+s)}}function dc(n,e,s){if(s===null)n.removeAttribute(e);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(e);return}n.setAttribute(e,""+s)}}function Hn(n,e,s,a){if(a===null)n.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(e,s,""+a)}}var mc;function ya(n){if(mc===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);mc=e&&e[1]||""}return` -`+mc+n}var pc=!1;function fc(n,e){if(!n||pc)return"";pc=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var a={DetermineComponentFrameRoot:function(){try{if(e){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(g){var p=g}Reflect.construct(n,[],m)}else{try{m.call()}catch(g){p=g}n.call(m.prototype)}}else{try{throw Error()}catch(g){p=g}(m=n())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack=="string")return[g.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});try{var r=a.DetermineComponentFrameRoot(),c=r[0],i=r[1];if(c&&i){var o=c.split(` -`),d=i.split(` -`);for(l=a=0;al||o[a]!==d[l]){var u=` -`+o[a].replace(" at new "," at ");return n.displayName&&u.includes("")&&(u=u.replace("",n.displayName)),u}while(1<=a&&0<=l);break}}}finally{pc=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ya(s):""}function w1(n){switch(n.tag){case 26:case 27:case 5:return ya(n.type);case 16:return ya("Lazy");case 13:return ya("Suspense");case 19:return ya("SuspenseList");case 0:case 15:return n=fc(n.type,!1),n;case 11:return n=fc(n.type.render,!1),n;case 1:return n=fc(n.type,!0),n;default:return""}}function Gu(n){try{var e="";do e+=w1(n),n=n.return;while(n);return e}catch(s){return` + */var Ce=h1,j1=f,v1=cl;function S(n){var e="https://react.dev/errors/"+n;if(1vs||(n.current=sc[vs],sc[vs]=null,vs--)}function de(n,e){vs++,sc[vs]=n.current,n.current=e}var Tn=Un(null),qa=Un(null),wt=Un(null),ac=Un(null),ar={$$typeof:vt,Provider:null,Consumer:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lr(n,e){switch(de(wt,e),de(qa,n),de(Tn,null),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)&&(e=e.namespaceURI)?Bd(e):0;break;default:if(n=n===8?e.parentNode:e,e=n.tagName,n=n.namespaceURI)n=Bd(n),e=i0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ee(Tn),de(Tn,e)}function Hs(){Ee(Tn),Ee(qa),Ee(wt)}function lc(n){n.memoizedState!==null&&de(ac,n);var e=Tn.current,s=i0(e,n.type);e!==s&&(de(qa,n),de(Tn,s))}function rr(n){qa.current===n&&(Ee(Tn),Ee(qa)),ac.current===n&&(Ee(ac),ar._currentValue=null)}var rc=Object.prototype.hasOwnProperty,oo=Ce.unstable_scheduleCallback,ui=Ce.unstable_cancelCallback,k1=Ce.unstable_shouldYield,C1=Ce.unstable_requestPaint,$n=Ce.unstable_now,R1=Ce.unstable_getCurrentPriorityLevel,uo=Ce.unstable_ImmediatePriority,Jp=Ce.unstable_UserBlockingPriority,ir=Ce.unstable_NormalPriority,M1=Ce.unstable_LowPriority,Pp=Ce.unstable_IdlePriority,E1=Ce.log,A1=Ce.unstable_setDisableYieldValue,ol=null,en=null;function T1(n){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(ol,n,void 0,(n.current.flags&128)===128)}catch{}}function bt(n){if(typeof E1=="function"&&A1(n),en&&typeof en.setStrictMode=="function")try{en.setStrictMode(ol,n)}catch{}}var mn=Math.clz32?Math.clz32:D1,$1=Math.log,L1=Math.LN2;function D1(n){return n>>>=0,n===0?32:31-($1(n)/L1|0)|0}var _l=128,kl=4194304;function ba(n){var e=n&42;if(e!==0)return e;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function cr(n,e){var s=n.pendingLanes;if(s===0)return 0;var a=0,l=n.suspendedLanes;n=n.pingedLanes;var r=s&134217727;return r!==0?(s=r&~l,s!==0?a=ba(s):(n&=r,n!==0&&(a=ba(n)))):(s&=~l,s!==0?a=ba(s):n!==0&&(a=ba(n))),a===0?0:e!==0&&e!==a&&!(e&l)&&(l=a&-a,n=e&-e,l>=n||l===32&&(n&4194176)!==0)?e:a}function O1(n,e){switch(n){case 1:case 2:case 4:case 8:return e+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wp(n,e){return n.errorRecoveryDisabledLanes&e?0:(n=n.pendingLanes&-536870913,n!==0?n:n&536870912?536870912:0)}function Kp(){var n=_l;return _l<<=1,!(_l&4194176)&&(_l=128),n}function Ip(){var n=kl;return kl<<=1,!(kl&62914560)&&(kl=4194304),n}function di(n){for(var e=[],s=0;31>s;s++)e.push(n);return e}function B1(n,e,s){var a=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.entangledLanes&=e,n.errorRecoveryDisabledLanes&=e,n.shellSuspendCounter=0,e=n.entanglements;for(var l=n.expirationTimes,r=n.hiddenUpdates;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Vu={},Xu={};function V1(n){return rc.call(Xu,n)?!0:rc.call(Vu,n)?!1:q1.test(n)?Xu[n]=!0:(Vu[n]=!0,!1)}function cc(n,e,s){if(V1(e))if(s===null)n.removeAttribute(e);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(e);return;case"boolean":var a=e.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){n.removeAttribute(e);return}}n.setAttribute(e,""+s)}}function mi(n,e,s){if(s===null)n.removeAttribute(e);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(e);return}n.setAttribute(e,""+s)}}function qn(n,e,s,a){if(a===null)n.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(e,s,""+a)}}var pi;function Na(n){if(pi===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);pi=e&&e[1]||""}return` +`+pi+n}var fi=!1;function hi(n,e){if(!n||fi)return"";fi=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var a={DetermineComponentFrameRoot:function(){try{if(e){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(j){var p=j}Reflect.construct(n,[],m)}else{try{m.call()}catch(j){p=j}n.call(m.prototype)}}else{try{throw Error()}catch(j){p=j}(m=n())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(j){if(j&&p&&typeof j.stack=="string")return[j.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});try{var r=a.DetermineComponentFrameRoot(),i=r[0],c=r[1];if(i&&c){var o=i.split(` +`),u=c.split(` +`);for(l=a=0;al||o[a]!==u[l]){var d=` +`+o[a].replace(" at new "," at ");return n.displayName&&d.includes("")&&(d=d.replace("",n.displayName)),d}while(1<=a&&0<=l);break}}}finally{fi=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Na(s):""}function X1(n){switch(n.tag){case 26:case 27:case 5:return Na(n.type);case 16:return Na("Lazy");case 13:return Na("Suspense");case 19:return Na("SuspenseList");case 0:case 15:return n=hi(n.type,!1),n;case 11:return n=hi(n.type.render,!1),n;case 1:return n=hi(n.type,!0),n;default:return""}}function Gu(n){try{var e="";do e+=X1(n),n=n.return;while(n);return e}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}function rn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ip(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _1(n){var e=Ip(n)?"checked":"value",s=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),a=""+n[e];if(!n.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var l=s.get,r=s.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return l.call(this)},set:function(c){a=""+c,r.call(this,c)}}),Object.defineProperty(n,e,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(c){a=""+c},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function ir(n){n._valueTracker||(n._valueTracker=_1(n))}function ef(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var s=e.getValue(),a="";return n&&(a=Ip(n)?n.checked?"true":"false":n.value),n=a,n!==s?(e.setValue(n),!0):!1}function or(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var k1=/[\n"\\]/g;function un(n){return n.replace(k1,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function oi(n,e,s,a,l,r,c,i){n.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?n.type=c:n.removeAttribute("type"),e!=null?c==="number"?(e===0&&n.value===""||n.value!=e)&&(n.value=""+rn(e)):n.value!==""+rn(e)&&(n.value=""+rn(e)):c!=="submit"&&c!=="reset"||n.removeAttribute("value"),e!=null?ui(n,c,rn(e)):s!=null?ui(n,c,rn(s)):a!=null&&n.removeAttribute("value"),l==null&&r!=null&&(n.defaultChecked=!!r),l!=null&&(n.checked=l&&typeof l!="function"&&typeof l!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?n.name=""+rn(i):n.removeAttribute("name")}function nf(n,e,s,a,l,r,c,i){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(n.type=r),e!=null||s!=null){if(!(r!=="submit"&&r!=="reset"||e!=null))return;s=s!=null?""+rn(s):"",e=e!=null?""+rn(e):s,i||e===n.value||(n.value=e),n.defaultValue=e}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,n.checked=i?n.checked:!!a,n.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(n.name=c)}function ui(n,e,s){e==="number"&&or(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Ms(n,e,s,a){if(n=n.options,e){e={};for(var l=0;l=ka),Pu=" ",Fu=!1;function of(n,e){switch(n){case"keyup":return F1.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var bs=!1;function eg(n,e){switch(n){case"compositionend":return uf(e);case"keypress":return e.which!==32?null:(Fu=!0,Pu);case"textInput":return n=e.data,n===Pu&&Fu?null:n;default:return null}}function ng(n,e){if(bs)return n==="compositionend"||!go&&of(n,e)?(n=rf(),Gl=ho=jt=null,bs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:s,offset:e-n};n=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=sd(s)}}function ff(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?ff(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function hf(){for(var n=window,e=or();e instanceof n.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)n=e.contentWindow;else break;e=or(n.document)}return e}function vo(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function og(n){var e=hf(),s=n.focusedElem,a=n.selectionRange;if(e!==s&&s&&s.ownerDocument&&ff(s.ownerDocument.documentElement,s)){if(a!==null&&vo(s)){if(e=a.start,n=a.end,n===void 0&&(n=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(n,s.value.length);else if(n=(e=s.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var l=s.textContent.length,r=Math.min(a.start,l);a=a.end===void 0?r:Math.min(a.end,l),!n.extend&&r>a&&(l=a,a=r,r=l),l=ad(s,r);var c=ad(s,a);l&&c&&(n.rangeCount!==1||n.anchorNode!==l.node||n.anchorOffset!==l.offset||n.focusNode!==c.node||n.focusOffset!==c.offset)&&(e=e.createRange(),e.setStart(l.node,l.offset),n.removeAllRanges(),r>a?(n.addRange(e),n.extend(c.node,c.offset)):(e.setEnd(c.node,c.offset),n.addRange(e)))}}for(e=[],n=s;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ys=null,pi=null,Ra=null,fi=!1;function ld(n,e,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;fi||ys==null||ys!==or(a)||(a=ys,"selectionStart"in a&&vo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ra&&Ga(Ra,a)||(Ra=a,a=_r(pi,"onSelect"),0>=c,l-=c,Qn=1<<32-mn(e)+l|s<M?(Y=R,R=null):Y=R.sibling;var B=p(x,R,v[M],j);if(B===null){R===null&&(R=Y);break}n&&R&&B.alternate===null&&e(x,R),f=r(B,f,M),k===null?_=B:k.sibling=B,k=B,R=Y}if(M===v.length)return s(x,R),P&&Ht(x,M),_;if(R===null){for(;MM?(Y=R,R=null):Y=R.sibling;var ce=p(x,R,B.value,j);if(ce===null){R===null&&(R=Y);break}n&&R&&ce.alternate===null&&e(x,R),f=r(ce,f,M),k===null?_=ce:k.sibling=ce,k=ce,R=Y}if(B.done)return s(x,R),P&&Ht(x,M),_;if(R===null){for(;!B.done;M++,B=v.next(),null)B=m(x,B.value,j),B!==null&&(f=r(B,f,M),k===null?_=B:k.sibling=B,k=B);return P&&Ht(x,M),_}for(R=a(R);!B.done;M++,B=v.next(),null)B=g(R,x,M,B.value,j),B!==null&&(n&&B.alternate!==null&&R.delete(B.key===null?M:B.key),f=r(B,f,M),k===null?_=B:k.sibling=B,k=B);return n&&R.forEach(function(U){return e(x,U)}),P&&Ht(x,M),_}function N(x,f,v,j){if(typeof v=="object"&&v!==null&&v.type===ga&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Nl:e:{for(var _=v.key,k=f;k!==null;){if(k.key===_){if(_=v.type,_===ga){if(k.tag===7){s(x,k.sibling),f=l(k,v.props.children),f.return=x,x=f;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ut&&md(_)===k.type){s(x,k.sibling),f=l(k,v.props),da(x,k,f,v),f.return=x,x=f;break e}s(x,k);break}else e(x,k);k=k.sibling}v.type===ga?(f=Qt(v.props.children,x.mode,j,v.key),f.return=x,x=f):(j=Pl(v.type,v.key,v.props,null,x.mode,j),da(x,f,j,v),j.return=x,x=j)}return c(x);case Sl:e:{for(k=v.key;f!==null;){if(f.key===k)if(f.tag===4&&f.stateNode.containerInfo===v.containerInfo&&f.stateNode.implementation===v.implementation){s(x,f.sibling),f=l(f,v.children||[]),f.return=x,x=f;break e}else{s(x,f);break}else e(x,f);f=f.sibling}f=Lc(v,x.mode,j),f.return=x,x=f}return c(x);case Ut:return k=v._init,N(x,f,k(v._payload),j)}if(va(v))return y(x,f,v,j);if(ca(v)){if(k=ca(v),typeof k!="function")throw Error(S(150));return v=k.call(v),b(x,f,v,j)}if(typeof v.then=="function")return N(x,f,Rl(v),j);if(v.$$typeof===gt)return N(x,f,Tl(x,v,j),j);El(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,f!==null&&f.tag===6?(s(x,f.sibling),f=l(f,v),f.return=x,x=f):(s(x,f),f=Dc(v,x.mode,j),f.return=x,x=f),c(x)):s(x,f)}return function(x,f,v,j){return Ya=0,x=N(x,f,v,j),Ts=null,x}}var Wt=kf(!0),Cf=kf(!1),Vs=zn(null),pr=zn(0);function pd(n,e){n=tt,de(pr,n),de(Vs,e),tt=n|e.baseLanes}function gi(){de(pr,tt),de(Vs,Vs.current)}function So(){tt=pr.current,Me(Vs),Me(pr)}var Ln=zn(null),Dn=null;function pt(n){var e=n.alternate;de(ke,ke.current&1),de(Ln,n),Dn===null&&(e===null||Vs.current!==null||e.memoizedState!==null)&&(Dn=n)}function Rf(n){if(n.tag===22){if(de(ke,ke.current),de(Ln,n),Dn===null){var e=n.alternate;e!==null&&e.memoizedState!==null&&(Dn=n)}}else ft()}function ft(){de(ke,ke.current),de(Ln,Ln.current)}function Kn(n){Me(Ln),Dn===n&&(Dn=null),Me(ke)}var ke=zn(0);function fr(n){for(var e=n;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var fg=typeof AbortController<"u"?AbortController:function(){var n=[],e=this.signal={aborted:!1,addEventListener:function(s,a){n.push(a)}};this.abort=function(){e.aborted=!0,n.forEach(function(s){return s()})}},hg=Ce.unstable_scheduleCallback,xg=Ce.unstable_NormalPriority,_e={$$typeof:gt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wo(){return{controller:new fg,data:new Map,refCount:0}}function dl(n){n.refCount--,n.refCount===0&&hg(xg,function(){n.controller.abort()})}var Ma=null,vi=0,Xs=0,$s=null;function gg(n,e){if(Ma===null){var s=Ma=[];vi=0,Xs=Wo(),$s={status:"pending",value:void 0,then:function(a){s.push(a)}}}return vi++,e.then(fd,fd),e}function fd(){if(Ma!==null&&--vi===0){$s!==null&&($s.status="fulfilled");var n=Ma;Ma=null,Xs=0,$s=null;for(var e=0;er?r:8;var c=Z.T,i={_callbacks:new Set};Z.T=i,zo(n,!1,e,s);try{var o=l();if(o!==null&&typeof o=="object"&&typeof o.then=="function"){Ef(i,o);var d=vg(o,a);Bs(n,e,d)}else Bs(n,e,a)}catch(u){Bs(n,e,{then:function(){},status:"rejected",reason:u})}finally{ue.p=r,Z.T=c}}function wg(){}function bi(n,e,s,a){if(n.tag!==5)throw Error(S(476));var l=nh(n).queue;eh(n,l,e,_a,s===null?wg:function(){return th(n),s(a)})}function nh(n){var e=n.memoizedState;if(e!==null)return e;e={memoizedState:_a,baseState:_a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nt,lastRenderedState:_a},next:null};var s={};return e.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nt,lastRenderedState:s},next:null},n.memoizedState=e,n=n.alternate,n!==null&&(n.memoizedState=e),e}function th(n){_o();var e=nh(n).next.queue;Bs(n,e,{})}function Oo(){var n=ze(sr);return n!==null?n:_a}function sh(){return we().memoizedState}function ah(){return we().memoizedState}function _g(n){for(var e=n.return;e!==null;){switch(e.tag){case 24:case 3:var s=Fn();n=Pn(s);var a=St(e,n,s);a!==null&&(Ze(a,e,s),Ta(a,e,s)),e={cache:wo()},n.payload=e;return}e=e.return}}function kg(n,e,s){var a=Fn();s={lane:a,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},Qr(n)?lh(e,s):(s=bo(n,e,s,a),s!==null&&(Ze(s,n,a),rh(s,e,a)))}function Bs(n,e,s){var a=Fn(),l={lane:a,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(Qr(n))lh(e,l);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var c=e.lastRenderedState,i=r(c,s);if(l.hasEagerState=!0,l.eagerState=i,pn(i,c)){Xr(n,e,l,0),te===null&&Vr();return}}catch{}finally{}s=bo(n,e,l,a),s!==null&&(Ze(s,n,a),rh(s,e,a))}}function zo(n,e,s,a){if(_o(),a={lane:2,revertLane:Wo(),action:a,hasEagerState:!1,eagerState:null,next:null},Qr(n)){if(e)throw Error(S(479))}else e=bo(n,s,a,2),e!==null&&Ze(e,n,2)}function Qr(n){var e=n.alternate;return n===H||e!==null&&e===H}function lh(n,e){Ds=hr=!0;var s=n.pending;s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e}function rh(n,e,s){if(s&4194176){var a=e.lanes;a&=n.pendingLanes,s|=a,e.lanes=s,Jp(n,s)}}var Bn={readContext:ze,use:Zr,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useLayoutEffect:ve,useInsertionEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useSyncExternalStore:ve,useId:ve};Bn.useCacheRefresh=ve;Bn.useMemoCache=ve;Bn.useHostTransitionStatus=ve;Bn.useFormState=ve;Bn.useActionState=ve;Bn.useOptimistic=ve;var ts={readContext:ze,use:Zr,useCallback:function(n,e){return Je().memoizedState=[n,e===void 0?null:e],n},useContext:ze,useEffect:hd,useImperativeHandle:function(n,e,s){s=s!=null?s.concat([n]):null,Kl(4194308,4,Kf.bind(null,e,n),s)},useLayoutEffect:function(n,e){return Kl(4194308,4,n,e)},useInsertionEffect:function(n,e){Kl(4,2,n,e)},useMemo:function(n,e){var s=Je();e=e===void 0?null:e;var a=n();return Pt&&(vt(!0),n(),vt(!1)),s.memoizedState=[a,e],a},useReducer:function(n,e,s){var a=Je();if(s!==void 0){var l=s(e);Pt&&(vt(!0),s(e),vt(!1))}else l=e;return a.memoizedState=a.baseState=l,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:l},a.queue=n,n=n.dispatch=kg.bind(null,H,n),[a.memoizedState,n]},useRef:function(n){var e=Je();return n={current:n},e.memoizedState=n},useState:function(n){n=ji(n);var e=n.queue,s=Bs.bind(null,H,e);return e.dispatch=s,[n.memoizedState,s]},useDebugValue:Lo,useDeferredValue:function(n,e){var s=Je();return Bo(s,n,e)},useTransition:function(){var n=ji(!1);return n=eh.bind(null,H,n.queue,!0,!1),Je().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,e,s){var a=H,l=Je();if(P){if(s===void 0)throw Error(S(407));s=s()}else{if(s=e(),te===null)throw Error(S(349));K&60||Df(a,e,s)}l.memoizedState=s;var r={value:s,getSnapshot:e};return l.queue=r,hd(Bf.bind(null,a,r,n),[n]),a.flags|=2048,Gs(9,Lf.bind(null,a,r,s,e),{destroy:void 0},null),s},useId:function(){var n=Je(),e=te.identifierPrefix;if(P){var s=Jn,a=Qn;s=(a&~(1<<32-mn(a)-1)).toString(32)+s,e=":"+e+"R"+s,s=xr++,0 title"))),Le(l,a,s),l[Oe]=n,Ee(l),a=l;break e;case"link":var r=Vd("link","href",e).get(a+(s.href||""));if(r){for(var c=0;c<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?l.createElement("select",{is:a.is}):l.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?l.createElement(s,{is:a.is}):l.createElement(s)}}n[Oe]=e,n[Ge]=a;e:for(l=e.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===e)break e;for(;l.sibling===null;){if(l.return===null||l.return===e)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}e.stateNode=n;e:switch(Le(n,s,a),s){case"button":case"input":case"select":case"textarea":n=!!a.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Xn(e)}}return he(e),e.flags&=-16777217,null;case 6:if(n&&e.stateNode!=null)n.memoizedProps!==a&&Xn(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(S(166));if(n=Nt.current,ua(e)){if(n=e.stateNode,s=e.memoizedProps,a=null,l=Ve,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}n[Oe]=e,n=!!(n.nodeValue===s||a!==null&&a.suppressHydrationWarning===!0||e0(n.nodeValue,s)),n||Kt(e)}else n=kr(n).createTextNode(a),n[Oe]=e,e.stateNode=n}return he(e),null;case 13:if(a=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(l=ua(e),a!==null&&a.dehydrated!==null){if(n===null){if(!l)throw Error(S(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(S(317));l[Oe]=e}else ul(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;he(e),l=!1}else vn!==null&&(Li(vn),vn=null),l=!0;if(!l)return e.flags&256?(Kn(e),e):(Kn(e),null)}if(Kn(e),e.flags&128)return e.lanes=s,e;if(s=a!==null,n=n!==null&&n.memoizedState!==null,s){a=e.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool);var r=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==l&&(a.flags|=2048)}return s!==n&&s&&(e.child.flags|=8192),$l(e,e.updateQueue),he(e),null;case 4:return Us(),n===null&&Po(e.stateNode.containerInfo),he(e),null;case 10:return Wn(e.type),he(e),null;case 19:if(Me(ke),l=e.memoizedState,l===null)return he(e),null;if(a=(e.flags&128)!==0,r=l.rendering,r===null)if(a)ma(l,!1);else{if(xe!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(r=fr(n),r!==null){for(e.flags|=128,ma(l,!1),n=r.updateQueue,e.updateQueue=n,$l(e,n),e.subtreeFlags=0,n=s,s=e.child;s!==null;)zh(s,n),s=s.sibling;return de(ke,ke.current&1|2),e.child}n=n.sibling}l.tail!==null&&$n()>yr&&(e.flags|=128,a=!0,ma(l,!1),e.lanes=4194304)}else{if(!a)if(n=fr(r),n!==null){if(e.flags|=128,a=!0,n=n.updateQueue,e.updateQueue=n,$l(e,n),ma(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!P)return he(e),null}else 2*$n()-l.renderingStartTime>yr&&s!==536870912&&(e.flags|=128,a=!0,ma(l,!1),e.lanes=4194304);l.isBackwards?(r.sibling=e.child,e.child=r):(n=l.last,n!==null?n.sibling=r:e.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$n(),e.sibling=null,n=ke.current,de(ke,a?n&1|2:n&1),e):(he(e),null);case 22:case 23:return Kn(e),So(),a=e.memoizedState!==null,n!==null?n.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?s&536870912&&!(e.flags&128)&&(he(e),e.subtreeFlags&6&&(e.flags|=8192)):he(e),s=e.updateQueue,s!==null&&$l(e,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==s&&(e.flags|=2048),n!==null&&Me(Yt),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),e.memoizedState.cache!==s&&(e.flags|=2048),Wn(_e),he(e),null;case 25:return null}throw Error(S(156,e.tag))}function $g(n,e){switch(No(e),e.tag){case 1:return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Wn(_e),Us(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 26:case 27:case 5:return lr(e),null;case 13:if(Kn(e),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(S(340));ul()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Me(ke),null;case 4:return Us(),null;case 10:return Wn(e.type),null;case 22:case 23:return Kn(e),So(),n!==null&&Me(Yt),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 24:return Wn(_e),null;case 25:return null;default:return null}}function Hh(n,e){switch(No(e),e.tag){case 3:Wn(_e),Us();break;case 26:case 27:case 5:lr(e);break;case 4:Us();break;case 13:Kn(e);break;case 19:Me(ke);break;case 10:Wn(e.type);break;case 22:case 23:Kn(e),So(),n!==null&&Me(Yt);break;case 24:Wn(_e)}}var Dg={getCacheForType:function(n){var e=ze(_e),s=e.data.get(n);return s===void 0&&(s=n(),e.data.set(n,s)),s}},Lg=typeof WeakMap=="function"?WeakMap:Map,I=0,te=null,Q=null,K=0,pe=0,ln=null,Zo=!1,tt=0,xe=0,st=0,ea=0,Yo=0,Ke=0,Ba=null,bn=null,Ys=!1,br=!1,Qo=0,yr=1/0,Ja=null,_t=null,Dl=!1,qt=null,Oa=0,Ti=0,$i=null,za=0,Di=null;function Fn(){if(I&2&&K!==0)return K&-K;if(_o()!==null){var n=Xs;return n!==0?n:Wo()}return Wp()}function qh(){Ke===0&&(Ke=!(K&536870912)||P?Zp():536870912);var n=Ln.current;return n!==null&&(n.flags|=32),Ke}function Ze(n,e,s){(n===te&&pe===2||n.cancelPendingCommit!==null)&&(ls(n,0),An(n,K,Ke)),pl(n,s),(!(I&2)||n!==te)&&(n===te&&(!(I&2)&&(ea|=s),xe===4&&An(n,K,Ke)),We(n))}function Vh(n,e){if(I&6)throw Error(S(327));var s=n.callbackNode;if(Os()&&n.callbackNode!==s)return null;var a=cr(n,n===te?K:0);if(a===0)return null;var l=(a&60)===0&&(a&n.expiredLanes)===0&&!e;if(e=l?Ug(n,a):Nr(n,a),e!==0){var r=l;do{if(e===6)An(n,a,0);else{if(l=n.current.alternate,r&&!Bg(l)){e=Nr(n,a),r=!1;continue}if(e===2){r=a;var c=Gp(n,r);if(c!==0&&(a=c,e=Xh(n,r,c),r=!1,e!==2))continue}if(e===1){ls(n,0),An(n,a,0);break}n.finishedWork=l,n.finishedLanes=a;e:{switch(r=n,e){case 0:case 1:throw Error(S(345));case 4:if((a&4194176)===a){An(r,a,Ke);break e}break;case 2:bn=null;break;case 3:case 5:break;default:throw Error(S(329))}if((a&62914560)===a&&(e=Qo+300-$n(),10s?32:s,Z.T=null,qt===null)var r=!1;else{s=$i,$i=null;var c=qt,i=Oa;if(qt=null,Oa=0,I&6)throw Error(S(331));var o=I;if(I|=4,Bh(c.current),$h(c,c.current,i,s),I=o,fl(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(il,c)}catch{}r=!0}return r}finally{ue.p=l,Z.T=a,Kh(n,e)}}return!1}function Ad(n,e,s){e=dn(s,e),e=yi(n.stateNode,e,2),n=St(n,e,2),n!==null&&(pl(n,2),We(n))}function re(n,e,s){if(n.tag===3)Ad(n,n,s);else for(;e!==null;){if(e.tag===3){Ad(e,n,s);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(_t===null||!_t.has(a))){n=dn(s,n),s=uh(2),a=St(e,s,2),a!==null&&(dh(s,a,e,n),pl(a,2),We(a));break}}e=e.return}}function Bc(n,e,s){var a=n.pingCache;if(a===null){a=n.pingCache=new Lg;var l=new Set;a.set(e,l)}else l=a.get(e),l===void 0&&(l=new Set,a.set(e,l));l.has(s)||(Zo=!0,l.add(s),n=Vg.bind(null,n,e,s),e.then(n,n))}function Vg(n,e,s){var a=n.pingCache;a!==null&&a.delete(e),n.pingedLanes|=n.suspendedLanes&s,I&2?Ys=!0:I&4&&(br=!0),Ko(),te===n&&(K&s)===s&&(xe===4||xe===3&&(K&62914560)===K&&300>$n()-Qo?!(I&2)&&ls(n,0):Yo|=s),We(n)}function Wh(n,e){e===0&&(e=Yp()),n=Mt(n,e),n!==null&&(pl(n,e),We(n))}function Xg(n){var e=n.memoizedState,s=0;e!==null&&(s=e.retryLane),Wh(n,s)}function Gg(n,e){var s=0;switch(n.tag){case 13:var a=n.stateNode,l=n.memoizedState;l!==null&&(s=l.retryLane);break;case 19:a=n.stateNode;break;case 22:a=n.stateNode._retryCache;break;default:throw Error(S(314))}a!==null&&a.delete(e),Wh(n,s)}function Ko(){if(50"u"?null:document;function a0(n,e,s){var a=na;if(a&&typeof e=="string"&&e){var l=un(e);l='link[rel="'+n+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),Hd.has(l)||(Hd.add(l),n={rel:n,crossOrigin:s,href:e},a.querySelector(l)===null&&(e=a.createElement("link"),Le(e,"link",n),Ee(e),a.head.appendChild(e)))}}function i2(n){at.D(n),a0("dns-prefetch",n,null)}function o2(n,e){at.C(n,e),a0("preconnect",n,e)}function u2(n,e,s){at.L(n,e,s);var a=na;if(a&&n&&e){var l='link[rel="preload"][as="'+un(e)+'"]';e==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+un(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+un(s.imageSizes)+'"]')):l+='[href="'+un(n)+'"]';var r=l;switch(e){case"style":r=Qs(n);break;case"script":r=ta(n)}fn.has(r)||(n=me({rel:"preload",href:e==="image"&&s&&s.imageSrcSet?void 0:n,as:e},s),fn.set(r,n),a.querySelector(l)!==null||e==="style"&&a.querySelector(hl(r))||e==="script"&&a.querySelector(xl(r))||(e=a.createElement("link"),Le(e,"link",n),Ee(e),a.head.appendChild(e)))}}function d2(n,e){at.m(n,e);var s=na;if(s&&n){var a=e&&typeof e.as=="string"?e.as:"script",l='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(n)+'"]',r=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ta(n)}if(!fn.has(r)&&(n=me({rel:"modulepreload",href:n},e),fn.set(r,n),s.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(xl(r)))return}a=s.createElement("link"),Le(a,"link",n),Ee(a),s.head.appendChild(a)}}}function m2(n,e,s){at.S(n,e,s);var a=na;if(a&&n){var l=Es(a).hoistableStyles,r=Qs(n);e=e||"default";var c=l.get(r);if(!c){var i={loading:0,preload:null};if(c=a.querySelector(hl(r)))i.loading=5;else{n=me({rel:"stylesheet",href:n,"data-precedence":e},s),(s=fn.get(r))&&Fo(n,s);var o=c=a.createElement("link");Ee(o),Le(o,"link",n),o._p=new Promise(function(d,u){o.onload=d,o.onerror=u}),o.addEventListener("load",function(){i.loading|=1}),o.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Fl(c,e,a)}c={type:"stylesheet",instance:c,count:1,state:i},l.set(r,c)}}}function p2(n,e){at.X(n,e);var s=na;if(s&&n){var a=Es(s).hoistableScripts,l=ta(n),r=a.get(l);r||(r=s.querySelector(xl(l)),r||(n=me({src:n,async:!0},e),(e=fn.get(l))&&Io(n,e),r=s.createElement("script"),Ee(r),Le(r,"link",n),s.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function f2(n,e){at.M(n,e);var s=na;if(s&&n){var a=Es(s).hoistableScripts,l=ta(n),r=a.get(l);r||(r=s.querySelector(xl(l)),r||(n=me({src:n,async:!0,type:"module"},e),(e=fn.get(l))&&Io(n,e),r=s.createElement("script"),Ee(r),Le(r,"link",n),s.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function h2(n,e,s){if(e=(e=Nt.current)?Cr(e):null,!e)throw Error(S(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Qs(s.href),e=Es(e).hoistableStyles,n=e.get(s),n||(n={type:"style",instance:null,count:0,state:null},e.set(s,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Qs(s.href);var a=Es(e).hoistableStyles,l=a.get(n);return l||(e=e.ownerDocument||e,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(n,l),fn.has(n)||x2(e,n,{rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},l.state)),l}return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(s=ta(s),e=Es(e).hoistableScripts,n=e.get(s),n||(n={type:"script",instance:null,count:0,state:null},e.set(s,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(S(444,n))}}function Qs(n){return'href="'+un(n)+'"'}function hl(n){return'link[rel="stylesheet"]['+n+"]"}function l0(n){return me({},n,{"data-precedence":n.precedence,precedence:null})}function x2(n,e,s,a){fn.set(e,s),n.querySelector(hl(e))||(n.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=n.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),Le(e,"link",s),Ee(e),n.head.appendChild(e)))}function ta(n){return'[src="'+un(n)+'"]'}function xl(n){return"script[async]"+n}function qd(n,e,s){if(e.count++,e.instance===null)switch(e.type){case"style":var a=n.querySelector('style[data-href~="'+un(s.href)+'"]');if(a)return e.instance=a,Ee(a),a;var l=me({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return a=(n.ownerDocument||n).createElement("style"),Ee(a),Le(a,"style",l),Fl(a,s.precedence,n),e.instance=a;case"stylesheet":l=Qs(s.href);var r=n.querySelector(hl(l));if(r)return e.state.loading|=4,e.instance=r,Ee(r),r;a=l0(s),(l=fn.get(l))&&Fo(a,l),r=(n.ownerDocument||n).createElement("link"),Ee(r);var c=r;return c._p=new Promise(function(i,o){c.onload=i,c.onerror=o}),Le(r,"link",a),e.state.loading|=4,Fl(r,s.precedence,n),e.instance=r;case"script":return r=ta(s.src),(l=n.querySelector(xl(r)))?(e.instance=l,Ee(l),l):(a=s,(l=fn.get(r))&&(a=me({},s),Io(a,l)),n=n.ownerDocument||n,l=n.createElement("script"),Ee(l),Le(l,"link",a),n.head.appendChild(l),e.instance=l);case"void":return null;default:throw Error(S(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(a=e.instance,e.state.loading|=4,Fl(a,s.precedence,n));return e.instance}function Fl(n,e,s){for(var a=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,r=l,c=0;c title"):null)}function g2(n,e,s){if(s===1||e.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return n=e.disabled,typeof e.precedence=="string"&&n==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}var Pa=null;function v2(){}function j2(n,e,s){if(Pa===null)throw Error(S(475));var a=Pa;if(e.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var l=Qs(s.href),r=n.querySelector(hl(l));if(r){n=r._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(a.count++,a=Rr.bind(a),n.then(a,a)),e.state.loading|=4,e.instance=r,Ee(r);return}r=n.ownerDocument||n,s=l0(s),(l=fn.get(l))&&Fo(s,l),r=r.createElement("link"),Ee(r);var c=r;c._p=new Promise(function(i,o){c.onload=i,c.onerror=o}),Le(r,"link",s),e.instance=r}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(e,n),(n=e.state.preload)&&!(e.state.loading&3)&&(a.count++,e=Rr.bind(a),n.addEventListener("load",e),n.addEventListener("error",e))}}function b2(){if(Pa===null)throw Error(S(475));var n=Pa;return n.stylesheets&&n.count===0&&Gi(n,n.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m0)}catch(n){console.error(n)}}m0(),Ep.exports=Or;var M2=Ep.exports;/** +`+s.stack}}function rn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function lf(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function G1(n){var e=lf(n)?"checked":"value",s=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),a=""+n[e];if(!n.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var l=s.get,r=s.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return l.call(this)},set:function(i){a=""+i,r.call(this,i)}}),Object.defineProperty(n,e,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function or(n){n._valueTracker||(n._valueTracker=G1(n))}function rf(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var s=e.getValue(),a="";return n&&(a=lf(n)?n.checked?"true":"false":n.value),n=a,n!==s?(e.setValue(n),!0):!1}function ur(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Z1=/[\n"\\]/g;function un(n){return n.replace(Z1,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function oc(n,e,s,a,l,r,i,c){n.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?n.type=i:n.removeAttribute("type"),e!=null?i==="number"?(e===0&&n.value===""||n.value!=e)&&(n.value=""+rn(e)):n.value!==""+rn(e)&&(n.value=""+rn(e)):i!=="submit"&&i!=="reset"||n.removeAttribute("value"),e!=null?uc(n,i,rn(e)):s!=null?uc(n,i,rn(s)):a!=null&&n.removeAttribute("value"),l==null&&r!=null&&(n.defaultChecked=!!r),l!=null&&(n.checked=l&&typeof l!="function"&&typeof l!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?n.name=""+rn(c):n.removeAttribute("name")}function cf(n,e,s,a,l,r,i,c){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(n.type=r),e!=null||s!=null){if(!(r!=="submit"&&r!=="reset"||e!=null))return;s=s!=null?""+rn(s):"",e=e!=null?""+rn(e):s,c||e===n.value||(n.value=e),n.defaultValue=e}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,n.checked=c?n.checked:!!a,n.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(n.name=i)}function uc(n,e,s){e==="number"&&ur(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function As(n,e,s,a){if(n=n.options,e){e={};for(var l=0;l=Ca),Ku=" ",Iu=!1;function hf(n,e){switch(n){case"keyup":return gg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ys=!1;function vg(n,e){switch(n){case"compositionend":return xf(e);case"keypress":return e.which!==32?null:(Iu=!0,Ku);case"textInput":return n=e.data,n===Ku&&Iu?null:n;default:return null}}function bg(n,e){if(ys)return n==="compositionend"||!go&&hf(n,e)?(n=pf(),Zl=ho=yt=null,ys=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:s,offset:e-n};n=a}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=sd(s)}}function bf(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?bf(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function yf(){for(var n=window,e=ur();e instanceof n.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)n=e.contentWindow;else break;e=ur(n.document)}return e}function jo(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Rg(n){var e=yf(),s=n.focusedElem,a=n.selectionRange;if(e!==s&&s&&s.ownerDocument&&bf(s.ownerDocument.documentElement,s)){if(a!==null&&jo(s)){if(e=a.start,n=a.end,n===void 0&&(n=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(n,s.value.length);else if(n=(e=s.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var l=s.textContent.length,r=Math.min(a.start,l);a=a.end===void 0?r:Math.min(a.end,l),!n.extend&&r>a&&(l=a,a=r,r=l),l=ad(s,r);var i=ad(s,a);l&&i&&(n.rangeCount!==1||n.anchorNode!==l.node||n.anchorOffset!==l.offset||n.focusNode!==i.node||n.focusOffset!==i.offset)&&(e=e.createRange(),e.setStart(l.node,l.offset),n.removeAllRanges(),r>a?(n.addRange(e),n.extend(i.node,i.offset)):(e.setEnd(i.node,i.offset),n.addRange(e)))}}for(e=[],n=s;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,Ns=null,pc=null,Ma=null,fc=!1;function ld(n,e,s){var a=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;fc||Ns==null||Ns!==ur(a)||(a=Ns,"selectionStart"in a&&jo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ma&&Za(Ma,a)||(Ma=a,a=kr(pc,"onSelect"),0>=i,l-=i,Jn=1<<32-mn(e)+l|s<E?(Y=R,R=null):Y=R.sibling;var O=p(x,R,g[E],v);if(O===null){R===null&&(R=Y);break}n&&R&&O.alternate===null&&e(x,R),h=r(O,h,E),k===null?_=O:k.sibling=O,k=O,R=Y}if(E===g.length)return s(x,R),I&&Ht(x,E),_;if(R===null){for(;EE?(Y=R,R=null):Y=R.sibling;var ie=p(x,R,O.value,v);if(ie===null){R===null&&(R=Y);break}n&&R&&ie.alternate===null&&e(x,R),h=r(ie,h,E),k===null?_=ie:k.sibling=ie,k=ie,R=Y}if(O.done)return s(x,R),I&&Ht(x,E),_;if(R===null){for(;!O.done;E++,O=g.next(),null)O=m(x,O.value,v),O!==null&&(h=r(O,h,E),k===null?_=O:k.sibling=O,k=O);return I&&Ht(x,E),_}for(R=a(R);!O.done;E++,O=g.next(),null)O=j(R,x,E,O.value,v),O!==null&&(n&&O.alternate!==null&&R.delete(O.key===null?E:O.key),h=r(O,h,E),k===null?_=O:k.sibling=O,k=O);return n&&R.forEach(function(U){return e(x,U)}),I&&Ht(x,E),_}function N(x,h,g,v){if(typeof g=="object"&&g!==null&&g.type===ja&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Sl:e:{for(var _=g.key,k=h;k!==null;){if(k.key===_){if(_=g.type,_===ja){if(k.tag===7){s(x,k.sibling),h=l(k,g.props.children),h.return=x,x=h;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ut&&md(_)===k.type){s(x,k.sibling),h=l(k,g.props),ma(x,k,h,g),h.return=x,x=h;break e}s(x,k);break}else e(x,k);k=k.sibling}g.type===ja?(h=Qt(g.props.children,x.mode,v,g.key),h.return=x,x=h):(v=Il(g.type,g.key,g.props,null,x.mode,v),ma(x,h,v,g),v.return=x,x=v)}return i(x);case wl:e:{for(k=g.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){s(x,h.sibling),h=l(h,g.children||[]),h.return=x,x=h;break e}else{s(x,h);break}else e(x,h);h=h.sibling}h=Oi(g,x.mode,v),h.return=x,x=h}return i(x);case Ut:return k=g._init,N(x,h,k(g._payload),v)}if(va(g))return y(x,h,g,v);if(ca(g)){if(k=ca(g),typeof k!="function")throw Error(S(150));return g=k.call(g),b(x,h,g,v)}if(typeof g.then=="function")return N(x,h,Ml(g),v);if(g.$$typeof===vt)return N(x,h,$l(x,g,v),v);El(x,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,h!==null&&h.tag===6?(s(x,h.sibling),h=l(h,g),h.return=x,x=h):(s(x,h),h=Di(g,x.mode,v),h.return=x,x=h),i(x)):s(x,h)}return function(x,h,g,v){return Qa=0,x=N(x,h,g,v),$s=null,x}}var Wt=Tf(!0),$f=Tf(!1),Xs=Un(null),fr=Un(0);function pd(n,e){n=tt,de(fr,n),de(Xs,e),tt=n|e.baseLanes}function gc(){de(fr,tt),de(Xs,Xs.current)}function So(){tt=fr.current,Ee(Xs),Ee(fr)}var On=Un(null),Ln=null;function ht(n){var e=n.alternate;de(ke,ke.current&1),de(On,n),Ln===null&&(e===null||Xs.current!==null||e.memoizedState!==null)&&(Ln=n)}function Lf(n){if(n.tag===22){if(de(ke,ke.current),de(On,n),Ln===null){var e=n.alternate;e!==null&&e.memoizedState!==null&&(Ln=n)}}else xt()}function xt(){de(ke,ke.current),de(On,On.current)}function Wn(n){Ee(On),Ln===n&&(Ln=null),Ee(ke)}var ke=Un(0);function hr(n){for(var e=n;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var $g=typeof AbortController<"u"?AbortController:function(){var n=[],e=this.signal={aborted:!1,addEventListener:function(s,a){n.push(a)}};this.abort=function(){e.aborted=!0,n.forEach(function(s){return s()})}},Lg=Ce.unstable_scheduleCallback,Dg=Ce.unstable_NormalPriority,_e={$$typeof:vt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wo(){return{controller:new $g,data:new Map,refCount:0}}function ml(n){n.refCount--,n.refCount===0&&Lg(Dg,function(){n.controller.abort()})}var Aa=null,jc=0,Gs=0,Ls=null;function Og(n,e){if(Aa===null){var s=Aa=[];jc=0,Gs=Wo(),Ls={status:"pending",value:void 0,then:function(a){s.push(a)}}}return jc++,e.then(fd,fd),e}function fd(){if(Aa!==null&&--jc===0){Ls!==null&&(Ls.status="fulfilled");var n=Aa;Aa=null,Gs=0,Ls=null;for(var e=0;er?r:8;var i=Z.T,c={_callbacks:new Set};Z.T=c,zo(n,!1,e,s);try{var o=l();if(o!==null&&typeof o=="object"&&typeof o.then=="function"){Df(c,o);var u=Bg(o,a);Bs(n,e,u)}else Bs(n,e,a)}catch(d){Bs(n,e,{then:function(){},status:"rejected",reason:d})}finally{ue.p=r,Z.T=i}}function Xg(){}function bc(n,e,s,a){if(n.tag!==5)throw Error(S(476));var l=ih(n).queue;rh(n,l,e,ka,s===null?Xg:function(){return ch(n),s(a)})}function ih(n){var e=n.memoizedState;if(e!==null)return e;e={memoizedState:ka,baseState:ka,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nt,lastRenderedState:ka},next:null};var s={};return e.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nt,lastRenderedState:s},next:null},n.memoizedState=e,n=n.alternate,n!==null&&(n.memoizedState=e),e}function ch(n){_o();var e=ih(n).next.queue;Bs(n,e,{})}function Bo(){var n=ze(ar);return n!==null?n:ka}function oh(){return we().memoizedState}function uh(){return we().memoizedState}function Gg(n){for(var e=n.return;e!==null;){switch(e.tag){case 24:case 3:var s=Fn();n=In(s);var a=_t(e,n,s);a!==null&&(Ze(a,e,s),$a(a,e,s)),e={cache:wo()},n.payload=e;return}e=e.return}}function Zg(n,e,s){var a=Fn();s={lane:a,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},Jr(n)?dh(e,s):(s=bo(n,e,s,a),s!==null&&(Ze(s,n,a),mh(s,e,a)))}function Bs(n,e,s){var a=Fn(),l={lane:a,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(Jr(n))dh(e,l);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var i=e.lastRenderedState,c=r(i,s);if(l.hasEagerState=!0,l.eagerState=c,pn(c,i)){Gr(n,e,l,0),se===null&&Xr();return}}catch{}finally{}s=bo(n,e,l,a),s!==null&&(Ze(s,n,a),mh(s,e,a))}}function zo(n,e,s,a){if(_o(),a={lane:2,revertLane:Wo(),action:a,hasEagerState:!1,eagerState:null,next:null},Jr(n)){if(e)throw Error(S(479))}else e=bo(n,s,a,2),e!==null&&Ze(e,n,2)}function Jr(n){var e=n.alternate;return n===H||e!==null&&e===H}function dh(n,e){Ds=xr=!0;var s=n.pending;s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e}function mh(n,e,s){if(s&4194176){var a=e.lanes;a&=n.pendingLanes,s|=a,e.lanes=s,ef(n,s)}}var Bn={readContext:ze,use:Yr,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useLayoutEffect:je,useInsertionEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useSyncExternalStore:je,useId:je};Bn.useCacheRefresh=je;Bn.useMemoCache=je;Bn.useHostTransitionStatus=je;Bn.useFormState=je;Bn.useActionState=je;Bn.useOptimistic=je;var ts={readContext:ze,use:Yr,useCallback:function(n,e){return Je().memoizedState=[n,e===void 0?null:e],n},useContext:ze,useEffect:hd,useImperativeHandle:function(n,e,s){s=s!=null?s.concat([n]):null,Wl(4194308,4,nh.bind(null,e,n),s)},useLayoutEffect:function(n,e){return Wl(4194308,4,n,e)},useInsertionEffect:function(n,e){Wl(4,2,n,e)},useMemo:function(n,e){var s=Je();e=e===void 0?null:e;var a=n();return Kt&&(bt(!0),n(),bt(!1)),s.memoizedState=[a,e],a},useReducer:function(n,e,s){var a=Je();if(s!==void 0){var l=s(e);Kt&&(bt(!0),s(e),bt(!1))}else l=e;return a.memoizedState=a.baseState=l,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:l},a.queue=n,n=n.dispatch=Zg.bind(null,H,n),[a.memoizedState,n]},useRef:function(n){var e=Je();return n={current:n},e.memoizedState=n},useState:function(n){n=vc(n);var e=n.queue,s=Bs.bind(null,H,e);return e.dispatch=s,[n.memoizedState,s]},useDebugValue:Do,useDeferredValue:function(n,e){var s=Je();return Oo(s,n,e)},useTransition:function(){var n=vc(!1);return n=rh.bind(null,H,n.queue,!0,!1),Je().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,e,s){var a=H,l=Je();if(I){if(s===void 0)throw Error(S(407));s=s()}else{if(s=e(),se===null)throw Error(S(349));P&60||Hf(a,e,s)}l.memoizedState=s;var r={value:s,getSnapshot:e};return l.queue=r,hd(Vf.bind(null,a,r,n),[n]),a.flags|=2048,Zs(9,qf.bind(null,a,r,s,e),{destroy:void 0},null),s},useId:function(){var n=Je(),e=se.identifierPrefix;if(I){var s=Pn,a=Jn;s=(a&~(1<<32-mn(a)-1)).toString(32)+s,e=":"+e+"R"+s,s=gr++,0 title"))),De(l,a,s),l[Be]=n,Me(l),a=l;break e;case"link":var r=Vd("link","href",e).get(a+(s.href||""));if(r){for(var i=0;i<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?l.createElement("select",{is:a.is}):l.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?l.createElement(s,{is:a.is}):l.createElement(s)}}n[Be]=e,n[Ge]=a;e:for(l=e.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===e)break e;for(;l.sibling===null;){if(l.return===null||l.return===e)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}e.stateNode=n;e:switch(De(n,s,a),s){case"button":case"input":case"select":case"textarea":n=!!a.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Gn(e)}}return he(e),e.flags&=-16777217,null;case 6:if(n&&e.stateNode!=null)n.memoizedProps!==a&&Gn(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(S(166));if(n=wt.current,da(e)){if(n=e.stateNode,s=e.memoizedProps,a=null,l=Ve,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}n[Be]=e,n=!!(n.nodeValue===s||a!==null&&a.suppressHydrationWarning===!0||r0(n.nodeValue,s)),n||Pt(e)}else n=Cr(n).createTextNode(a),n[Be]=e,e.stateNode=n}return he(e),null;case 13:if(a=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(l=da(e),a!==null&&a.dehydrated!==null){if(n===null){if(!l)throw Error(S(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(S(317));l[Be]=e}else dl(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;he(e),l=!1}else jn!==null&&(Dc(jn),jn=null),l=!0;if(!l)return e.flags&256?(Wn(e),e):(Wn(e),null)}if(Wn(e),e.flags&128)return e.lanes=s,e;if(s=a!==null,n=n!==null&&n.memoizedState!==null,s){a=e.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool);var r=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==l&&(a.flags|=2048)}return s!==n&&s&&(e.child.flags|=8192),Ll(e,e.updateQueue),he(e),null;case 4:return Hs(),n===null&&Ko(e.stateNode.containerInfo),he(e),null;case 10:return Kn(e.type),he(e),null;case 19:if(Ee(ke),l=e.memoizedState,l===null)return he(e),null;if(a=(e.flags&128)!==0,r=l.rendering,r===null)if(a)pa(l,!1);else{if(xe!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(r=hr(n),r!==null){for(e.flags|=128,pa(l,!1),n=r.updateQueue,e.updateQueue=n,Ll(e,n),e.subtreeFlags=0,n=s,s=e.child;s!==null;)Gh(s,n),s=s.sibling;return de(ke,ke.current&1|2),e.child}n=n.sibling}l.tail!==null&&$n()>Nr&&(e.flags|=128,a=!0,pa(l,!1),e.lanes=4194304)}else{if(!a)if(n=hr(r),n!==null){if(e.flags|=128,a=!0,n=n.updateQueue,e.updateQueue=n,Ll(e,n),pa(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!I)return he(e),null}else 2*$n()-l.renderingStartTime>Nr&&s!==536870912&&(e.flags|=128,a=!0,pa(l,!1),e.lanes=4194304);l.isBackwards?(r.sibling=e.child,e.child=r):(n=l.last,n!==null?n.sibling=r:e.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$n(),e.sibling=null,n=ke.current,de(ke,a?n&1|2:n&1),e):(he(e),null);case 22:case 23:return Wn(e),So(),a=e.memoizedState!==null,n!==null?n.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?s&536870912&&!(e.flags&128)&&(he(e),e.subtreeFlags&6&&(e.flags|=8192)):he(e),s=e.updateQueue,s!==null&&Ll(e,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==s&&(e.flags|=2048),n!==null&&Ee(Yt),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),e.memoizedState.cache!==s&&(e.flags|=2048),Kn(_e),he(e),null;case 25:return null}throw Error(S(156,e.tag))}function Ig(n,e){switch(No(e),e.tag){case 1:return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Kn(_e),Hs(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 26:case 27:case 5:return rr(e),null;case 13:if(Wn(e),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(S(340));dl()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Ee(ke),null;case 4:return Hs(),null;case 10:return Kn(e.type),null;case 22:case 23:return Wn(e),So(),n!==null&&Ee(Yt),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 24:return Kn(_e),null;case 25:return null;default:return null}}function Yh(n,e){switch(No(e),e.tag){case 3:Kn(_e),Hs();break;case 26:case 27:case 5:rr(e);break;case 4:Hs();break;case 13:Wn(e);break;case 19:Ee(ke);break;case 10:Kn(e.type);break;case 22:case 23:Wn(e),So(),n!==null&&Ee(Yt);break;case 24:Kn(_e)}}var Fg={getCacheForType:function(n){var e=ze(_e),s=e.data.get(n);return s===void 0&&(s=n(),e.data.set(n,s)),s}},e2=typeof WeakMap=="function"?WeakMap:Map,ee=0,se=null,Q=null,P=0,pe=0,ln=null,Zo=!1,tt=0,xe=0,st=0,na=0,Yo=0,Pe=0,Ba=null,bn=null,Qs=!1,yr=!1,Qo=0,Nr=1/0,Pa=null,Ct=null,Dl=!1,qt=null,za=0,Tc=0,$c=null,Ua=0,Lc=null;function Fn(){if(ee&2&&P!==0)return P&-P;if(_o()!==null){var n=Gs;return n!==0?n:Wo()}return tf()}function Qh(){Pe===0&&(Pe=!(P&536870912)||I?Kp():536870912);var n=On.current;return n!==null&&(n.flags|=32),Pe}function Ze(n,e,s){(n===se&&pe===2||n.cancelPendingCommit!==null)&&(ls(n,0),An(n,P,Pe)),fl(n,s),(!(ee&2)||n!==se)&&(n===se&&(!(ee&2)&&(na|=s),xe===4&&An(n,P,Pe)),We(n))}function Jh(n,e){if(ee&6)throw Error(S(327));var s=n.callbackNode;if(zs()&&n.callbackNode!==s)return null;var a=cr(n,n===se?P:0);if(a===0)return null;var l=(a&60)===0&&(a&n.expiredLanes)===0&&!e;if(e=l?a2(n,a):Sr(n,a),e!==0){var r=l;do{if(e===6)An(n,a,0);else{if(l=n.current.alternate,r&&!n2(l)){e=Sr(n,a),r=!1;continue}if(e===2){r=a;var i=Wp(n,r);if(i!==0&&(a=i,e=Ph(n,r,i),r=!1,e!==2))continue}if(e===1){ls(n,0),An(n,a,0);break}n.finishedWork=l,n.finishedLanes=a;e:{switch(r=n,e){case 0:case 1:throw Error(S(345));case 4:if((a&4194176)===a){An(r,a,Pe);break e}break;case 2:bn=null;break;case 3:case 5:break;default:throw Error(S(329))}if((a&62914560)===a&&(e=Qo+300-$n(),10s?32:s,Z.T=null,qt===null)var r=!1;else{s=$c,$c=null;var i=qt,c=za;if(qt=null,za=0,ee&6)throw Error(S(331));var o=ee;if(ee|=4,Vh(i.current),Uh(i,i.current,c,s),ee=o,hl(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(ol,i)}catch{}r=!0}return r}finally{ue.p=l,Z.T=a,n0(n,e)}}return!1}function Ad(n,e,s){e=dn(s,e),e=yc(n.stateNode,e,2),n=_t(n,e,2),n!==null&&(fl(n,2),We(n))}function re(n,e,s){if(n.tag===3)Ad(n,n,s);else for(;e!==null;){if(e.tag===3){Ad(e,n,s);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ct===null||!Ct.has(a))){n=dn(s,n),s=xh(2),a=_t(e,s,2),a!==null&&(gh(s,a,e,n),fl(a,2),We(a));break}}e=e.return}}function Bi(n,e,s){var a=n.pingCache;if(a===null){a=n.pingCache=new e2;var l=new Set;a.set(e,l)}else l=a.get(e),l===void 0&&(l=new Set,a.set(e,l));l.has(s)||(Zo=!0,l.add(s),n=i2.bind(null,n,e,s),e.then(n,n))}function i2(n,e,s){var a=n.pingCache;a!==null&&a.delete(e),n.pingedLanes|=n.suspendedLanes&s,ee&2?Qs=!0:ee&4&&(yr=!0),Po(),se===n&&(P&s)===s&&(xe===4||xe===3&&(P&62914560)===P&&300>$n()-Qo?!(ee&2)&&ls(n,0):Yo|=s),We(n)}function t0(n,e){e===0&&(e=Ip()),n=Tt(n,e),n!==null&&(fl(n,e),We(n))}function c2(n){var e=n.memoizedState,s=0;e!==null&&(s=e.retryLane),t0(n,s)}function o2(n,e){var s=0;switch(n.tag){case 13:var a=n.stateNode,l=n.memoizedState;l!==null&&(s=l.retryLane);break;case 19:a=n.stateNode;break;case 22:a=n.stateNode._retryCache;break;default:throw Error(S(314))}a!==null&&a.delete(e),t0(n,s)}function Po(){if(50"u"?null:document;function u0(n,e,s){var a=ta;if(a&&typeof e=="string"&&e){var l=un(e);l='link[rel="'+n+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),Hd.has(l)||(Hd.add(l),n={rel:n,crossOrigin:s,href:e},a.querySelector(l)===null&&(e=a.createElement("link"),De(e,"link",n),Me(e),a.head.appendChild(e)))}}function C2(n){at.D(n),u0("dns-prefetch",n,null)}function R2(n,e){at.C(n,e),u0("preconnect",n,e)}function M2(n,e,s){at.L(n,e,s);var a=ta;if(a&&n&&e){var l='link[rel="preload"][as="'+un(e)+'"]';e==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+un(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+un(s.imageSizes)+'"]')):l+='[href="'+un(n)+'"]';var r=l;switch(e){case"style":r=Js(n);break;case"script":r=sa(n)}fn.has(r)||(n=me({rel:"preload",href:e==="image"&&s&&s.imageSrcSet?void 0:n,as:e},s),fn.set(r,n),a.querySelector(l)!==null||e==="style"&&a.querySelector(xl(r))||e==="script"&&a.querySelector(gl(r))||(e=a.createElement("link"),De(e,"link",n),Me(e),a.head.appendChild(e)))}}function E2(n,e){at.m(n,e);var s=ta;if(s&&n){var a=e&&typeof e.as=="string"?e.as:"script",l='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(n)+'"]',r=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=sa(n)}if(!fn.has(r)&&(n=me({rel:"modulepreload",href:n},e),fn.set(r,n),s.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(gl(r)))return}a=s.createElement("link"),De(a,"link",n),Me(a),s.head.appendChild(a)}}}function A2(n,e,s){at.S(n,e,s);var a=ta;if(a&&n){var l=Es(a).hoistableStyles,r=Js(n);e=e||"default";var i=l.get(r);if(!i){var c={loading:0,preload:null};if(i=a.querySelector(xl(r)))c.loading=5;else{n=me({rel:"stylesheet",href:n,"data-precedence":e},s),(s=fn.get(r))&&Io(n,s);var o=i=a.createElement("link");Me(o),De(o,"link",n),o._p=new Promise(function(u,d){o.onload=u,o.onerror=d}),o.addEventListener("load",function(){c.loading|=1}),o.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Fl(i,e,a)}i={type:"stylesheet",instance:i,count:1,state:c},l.set(r,i)}}}function T2(n,e){at.X(n,e);var s=ta;if(s&&n){var a=Es(s).hoistableScripts,l=sa(n),r=a.get(l);r||(r=s.querySelector(gl(l)),r||(n=me({src:n,async:!0},e),(e=fn.get(l))&&Fo(n,e),r=s.createElement("script"),Me(r),De(r,"link",n),s.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function $2(n,e){at.M(n,e);var s=ta;if(s&&n){var a=Es(s).hoistableScripts,l=sa(n),r=a.get(l);r||(r=s.querySelector(gl(l)),r||(n=me({src:n,async:!0,type:"module"},e),(e=fn.get(l))&&Fo(n,e),r=s.createElement("script"),Me(r),De(r,"link",n),s.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function L2(n,e,s){if(e=(e=wt.current)?Rr(e):null,!e)throw Error(S(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Js(s.href),e=Es(e).hoistableStyles,n=e.get(s),n||(n={type:"style",instance:null,count:0,state:null},e.set(s,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Js(s.href);var a=Es(e).hoistableStyles,l=a.get(n);return l||(e=e.ownerDocument||e,l={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(n,l),fn.has(n)||D2(e,n,{rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},l.state)),l}return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(s=sa(s),e=Es(e).hoistableScripts,n=e.get(s),n||(n={type:"script",instance:null,count:0,state:null},e.set(s,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(S(444,n))}}function Js(n){return'href="'+un(n)+'"'}function xl(n){return'link[rel="stylesheet"]['+n+"]"}function d0(n){return me({},n,{"data-precedence":n.precedence,precedence:null})}function D2(n,e,s,a){fn.set(e,s),n.querySelector(xl(e))||(n.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=n.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),De(e,"link",s),Me(e),n.head.appendChild(e)))}function sa(n){return'[src="'+un(n)+'"]'}function gl(n){return"script[async]"+n}function qd(n,e,s){if(e.count++,e.instance===null)switch(e.type){case"style":var a=n.querySelector('style[data-href~="'+un(s.href)+'"]');if(a)return e.instance=a,Me(a),a;var l=me({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return a=(n.ownerDocument||n).createElement("style"),Me(a),De(a,"style",l),Fl(a,s.precedence,n),e.instance=a;case"stylesheet":l=Js(s.href);var r=n.querySelector(xl(l));if(r)return e.state.loading|=4,e.instance=r,Me(r),r;a=d0(s),(l=fn.get(l))&&Io(a,l),r=(n.ownerDocument||n).createElement("link"),Me(r);var i=r;return i._p=new Promise(function(c,o){i.onload=c,i.onerror=o}),De(r,"link",a),e.state.loading|=4,Fl(r,s.precedence,n),e.instance=r;case"script":return r=sa(s.src),(l=n.querySelector(gl(r)))?(e.instance=l,Me(l),l):(a=s,(l=fn.get(r))&&(a=me({},s),Fo(a,l)),n=n.ownerDocument||n,l=n.createElement("script"),Me(l),De(l,"link",a),n.head.appendChild(l),e.instance=l);case"void":return null;default:throw Error(S(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(a=e.instance,e.state.loading|=4,Fl(a,s.precedence,n));return e.instance}function Fl(n,e,s){for(var a=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,r=l,i=0;i title"):null)}function O2(n,e,s){if(s===1||e.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return n=e.disabled,typeof e.precedence=="string"&&n==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}var Ia=null;function B2(){}function z2(n,e,s){if(Ia===null)throw Error(S(475));var a=Ia;if(e.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var l=Js(s.href),r=n.querySelector(xl(l));if(r){n=r._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(a.count++,a=Mr.bind(a),n.then(a,a)),e.state.loading|=4,e.instance=r,Me(r);return}r=n.ownerDocument||n,s=d0(s),(l=fn.get(l))&&Io(s,l),r=r.createElement("link"),Me(r);var i=r;i._p=new Promise(function(c,o){i.onload=c,i.onerror=o}),De(r,"link",s),e.instance=r}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(e,n),(n=e.state.preload)&&!(e.state.loading&3)&&(a.count++,e=Mr.bind(a),n.addEventListener("load",e),n.addEventListener("error",e))}}function U2(){if(Ia===null)throw Error(S(475));var n=Ia;return n.stylesheets&&n.count===0&&Gc(n,n.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j0)}catch(n){console.error(n)}}j0(),Dp.exports=zr;var P2=Dp.exports;/** * @remix-run/router v1.16.1 * * Copyright (c) Remix Software Inc. @@ -54,7 +54,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function nl(){return nl=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function p0(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function T2(){return Math.random().toString(36).substr(2,8)}function Kd(n,e){return{usr:n.state,key:n.key,idx:e}}function Qi(n,e,s,a){return s===void 0&&(s=null),nl({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?sa(e):e,{state:s,key:e&&e.key||a||T2()})}function Tr(n){let{pathname:e="/",search:s="",hash:a=""}=n;return s&&s!=="?"&&(e+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function sa(n){let e={};if(n){let s=n.indexOf("#");s>=0&&(e.hash=n.substr(s),n=n.substr(0,s));let a=n.indexOf("?");a>=0&&(e.search=n.substr(a),n=n.substr(0,a)),n&&(e.pathname=n)}return e}function $2(n,e,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:r=!1}=a,c=l.history,i=bt.Pop,o=null,d=u();d==null&&(d=0,c.replaceState(nl({},c.state,{idx:d}),""));function u(){return(c.state||{idx:null}).idx}function m(){i=bt.Pop;let N=u(),x=N==null?null:N-d;d=N,o&&o({action:i,location:b.location,delta:x})}function p(N,x){i=bt.Push;let f=Qi(b.location,N,x);d=u()+1;let v=Kd(f,d),j=b.createHref(f);try{c.pushState(v,"",j)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;l.location.assign(j)}r&&o&&o({action:i,location:b.location,delta:1})}function g(N,x){i=bt.Replace;let f=Qi(b.location,N,x);d=u();let v=Kd(f,d),j=b.createHref(f);c.replaceState(v,"",j),r&&o&&o({action:i,location:b.location,delta:0})}function y(N){let x=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof N=="string"?N:Tr(N);return f=f.replace(/ $/,"%20"),je(x,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,x)}let b={get action(){return i},get location(){return n(l,c)},listen(N){if(o)throw new Error("A history only accepts one active listener");return l.addEventListener(Jd,m),o=N,()=>{l.removeEventListener(Jd,m),o=null}},createHref(N){return e(l,N)},createURL:y,encodeLocation(N){let x=y(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:g,go(N){return c.go(N)}};return b}var Wd;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Wd||(Wd={}));function D2(n,e,s){s===void 0&&(s="/");let a=typeof e=="string"?sa(e):e,l=au(a.pathname||"/",s);if(l==null)return null;let r=f0(n);L2(r);let c=null;for(let i=0;c==null&&i{let o={relativePath:i===void 0?r.path||"":i,caseSensitive:r.caseSensitive===!0,childrenIndex:c,route:r};o.relativePath.startsWith("/")&&(je(o.relativePath.startsWith(a),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(a.length));let d=Et([a,o.relativePath]),u=s.concat(o);r.children&&r.children.length>0&&(je(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),f0(r.children,e,u,d)),!(r.path==null&&!r.index)&&e.push({path:d,score:V2(d,r.index),routesMeta:u})};return n.forEach((r,c)=>{var i;if(r.path===""||!((i=r.path)!=null&&i.includes("?")))l(r,c);else for(let o of h0(r.path))l(r,c,o)}),e}function h0(n){let e=n.split("/");if(e.length===0)return[];let[s,...a]=e,l=s.endsWith("?"),r=s.replace(/\?$/,"");if(a.length===0)return l?[r,""]:[r];let c=h0(a.join("/")),i=[];return i.push(...c.map(o=>o===""?r:[r,o].join("/"))),l&&i.push(...c),i.map(o=>n.startsWith("/")&&o===""?"/":o)}function L2(n){n.sort((e,s)=>e.score!==s.score?s.score-e.score:X2(e.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const B2=/^:[\w-]+$/,O2=3,z2=2,U2=1,H2=10,q2=-2,Pd=n=>n==="*";function V2(n,e){let s=n.split("/"),a=s.length;return s.some(Pd)&&(a+=q2),e&&(a+=z2),s.filter(l=>!Pd(l)).reduce((l,r)=>l+(B2.test(r)?O2:r===""?U2:H2),a)}function X2(n,e){return n.length===e.length&&n.slice(0,-1).every((a,l)=>a===e[l])?n[n.length-1]-e[e.length-1]:0}function G2(n,e){let{routesMeta:s}=n,a={},l="/",r=[];for(let c=0;c{let{paramName:p,isOptional:g}=u;if(p==="*"){let b=i[m]||"";c=r.slice(0,r.length-b.length).replace(/(.)\/+$/,"$1")}const y=i[m];return g&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:r,pathnameBase:c,pattern:n}}function Z2(n,e,s){e===void 0&&(e=!1),s===void 0&&(s=!0),p0(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let a=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,i,o)=>(a.push({paramName:i,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(a.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,e?void 0:"i"),a]}function Y2(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return p0(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function au(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let s=e.endsWith("/")?e.length-1:e.length,a=n.charAt(s);return a&&a!=="/"?null:n.slice(s)||"/"}function Q2(n,e){e===void 0&&(e="/");let{pathname:s,search:a="",hash:l=""}=typeof n=="string"?sa(n):n;return{pathname:s?s.startsWith("/")?s:J2(s,e):e,search:P2(a),hash:F2(l)}}function J2(n,e){let s=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Gc(n,e,s,a){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function K2(n){return n.filter((e,s)=>s===0||e.route.path&&e.route.path.length>0)}function g0(n,e){let s=K2(n);return e?s.map((a,l)=>l===n.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function v0(n,e,s,a){a===void 0&&(a=!1);let l;typeof n=="string"?l=sa(n):(l=nl({},n),je(!l.pathname||!l.pathname.includes("?"),Gc("?","pathname","search",l)),je(!l.pathname||!l.pathname.includes("#"),Gc("#","pathname","hash",l)),je(!l.search||!l.search.includes("#"),Gc("#","search","hash",l)));let r=n===""||l.pathname==="",c=r?"/":l.pathname,i;if(c==null)i=s;else{let m=e.length-1;if(!a&&c.startsWith("..")){let p=c.split("/");for(;p[0]==="..";)p.shift(),m-=1;l.pathname=p.join("/")}i=m>=0?e[m]:"/"}let o=Q2(l,i),d=c&&c!=="/"&&c.endsWith("/"),u=(r||c===".")&&s.endsWith("/");return!o.pathname.endsWith("/")&&(d||u)&&(o.pathname+="/"),o}const Et=n=>n.join("/").replace(/\/\/+/g,"/"),W2=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),P2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,F2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function I2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const j0=["post","put","patch","delete"];new Set(j0);const ev=["get",...j0];new Set(ev);/** + */function tl(){return tl=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function v0(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function K2(){return Math.random().toString(36).substr(2,8)}function Pd(n,e){return{usr:n.state,key:n.key,idx:e}}function Qc(n,e,s,a){return s===void 0&&(s=null),tl({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?aa(e):e,{state:s,key:e&&e.key||a||K2()})}function $r(n){let{pathname:e="/",search:s="",hash:a=""}=n;return s&&s!=="?"&&(e+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function aa(n){let e={};if(n){let s=n.indexOf("#");s>=0&&(e.hash=n.substr(s),n=n.substr(0,s));let a=n.indexOf("?");a>=0&&(e.search=n.substr(a),n=n.substr(0,a)),n&&(e.pathname=n)}return e}function I2(n,e,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:r=!1}=a,i=l.history,c=Nt.Pop,o=null,u=d();u==null&&(u=0,i.replaceState(tl({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function m(){c=Nt.Pop;let N=d(),x=N==null?null:N-u;u=N,o&&o({action:c,location:b.location,delta:x})}function p(N,x){c=Nt.Push;let h=Qc(b.location,N,x);u=d()+1;let g=Pd(h,u),v=b.createHref(h);try{i.pushState(g,"",v)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;l.location.assign(v)}r&&o&&o({action:c,location:b.location,delta:1})}function j(N,x){c=Nt.Replace;let h=Qc(b.location,N,x);u=d();let g=Pd(h,u),v=b.createHref(h);i.replaceState(g,"",v),r&&o&&o({action:c,location:b.location,delta:0})}function y(N){let x=l.location.origin!=="null"?l.location.origin:l.location.href,h=typeof N=="string"?N:$r(N);return h=h.replace(/ $/,"%20"),ve(x,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,x)}let b={get action(){return c},get location(){return n(l,i)},listen(N){if(o)throw new Error("A history only accepts one active listener");return l.addEventListener(Jd,m),o=N,()=>{l.removeEventListener(Jd,m),o=null}},createHref(N){return e(l,N)},createURL:y,encodeLocation(N){let x=y(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:j,go(N){return i.go(N)}};return b}var Wd;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Wd||(Wd={}));function F2(n,e,s){s===void 0&&(s="/");let a=typeof e=="string"?aa(e):e,l=au(a.pathname||"/",s);if(l==null)return null;let r=b0(n);ej(r);let i=null;for(let c=0;i==null&&c{let o={relativePath:c===void 0?r.path||"":c,caseSensitive:r.caseSensitive===!0,childrenIndex:i,route:r};o.relativePath.startsWith("/")&&(ve(o.relativePath.startsWith(a),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(a.length));let u=At([a,o.relativePath]),d=s.concat(o);r.children&&r.children.length>0&&(ve(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),b0(r.children,e,d,u)),!(r.path==null&&!r.index)&&e.push({path:u,score:ij(u,r.index),routesMeta:d})};return n.forEach((r,i)=>{var c;if(r.path===""||!((c=r.path)!=null&&c.includes("?")))l(r,i);else for(let o of y0(r.path))l(r,i,o)}),e}function y0(n){let e=n.split("/");if(e.length===0)return[];let[s,...a]=e,l=s.endsWith("?"),r=s.replace(/\?$/,"");if(a.length===0)return l?[r,""]:[r];let i=y0(a.join("/")),c=[];return c.push(...i.map(o=>o===""?r:[r,o].join("/"))),l&&c.push(...i),c.map(o=>n.startsWith("/")&&o===""?"/":o)}function ej(n){n.sort((e,s)=>e.score!==s.score?s.score-e.score:cj(e.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const nj=/^:[\w-]+$/,tj=3,sj=2,aj=1,lj=10,rj=-2,Kd=n=>n==="*";function ij(n,e){let s=n.split("/"),a=s.length;return s.some(Kd)&&(a+=rj),e&&(a+=sj),s.filter(l=>!Kd(l)).reduce((l,r)=>l+(nj.test(r)?tj:r===""?aj:lj),a)}function cj(n,e){return n.length===e.length&&n.slice(0,-1).every((a,l)=>a===e[l])?n[n.length-1]-e[e.length-1]:0}function oj(n,e){let{routesMeta:s}=n,a={},l="/",r=[];for(let i=0;i{let{paramName:p,isOptional:j}=d;if(p==="*"){let b=c[m]||"";i=r.slice(0,r.length-b.length).replace(/(.)\/+$/,"$1")}const y=c[m];return j&&!y?u[p]=void 0:u[p]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:r,pathnameBase:i,pattern:n}}function uj(n,e,s){e===void 0&&(e=!1),s===void 0&&(s=!0),v0(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let a=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,o)=>(a.push({paramName:c,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(a.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,e?void 0:"i"),a]}function dj(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return v0(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function au(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let s=e.endsWith("/")?e.length-1:e.length,a=n.charAt(s);return a&&a!=="/"?null:n.slice(s)||"/"}function mj(n,e){e===void 0&&(e="/");let{pathname:s,search:a="",hash:l=""}=typeof n=="string"?aa(n):n;return{pathname:s?s.startsWith("/")?s:pj(s,e):e,search:xj(a),hash:gj(l)}}function pj(n,e){let s=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Zi(n,e,s,a){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fj(n){return n.filter((e,s)=>s===0||e.route.path&&e.route.path.length>0)}function S0(n,e){let s=fj(n);return e?s.map((a,l)=>l===n.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function w0(n,e,s,a){a===void 0&&(a=!1);let l;typeof n=="string"?l=aa(n):(l=tl({},n),ve(!l.pathname||!l.pathname.includes("?"),Zi("?","pathname","search",l)),ve(!l.pathname||!l.pathname.includes("#"),Zi("#","pathname","hash",l)),ve(!l.search||!l.search.includes("#"),Zi("#","search","hash",l)));let r=n===""||l.pathname==="",i=r?"/":l.pathname,c;if(i==null)c=s;else{let m=e.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),m-=1;l.pathname=p.join("/")}c=m>=0?e[m]:"/"}let o=mj(l,c),u=i&&i!=="/"&&i.endsWith("/"),d=(r||i===".")&&s.endsWith("/");return!o.pathname.endsWith("/")&&(u||d)&&(o.pathname+="/"),o}const At=n=>n.join("/").replace(/\/\/+/g,"/"),hj=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),xj=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,gj=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function jj(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const _0=["post","put","patch","delete"];new Set(_0);const vj=["get",..._0];new Set(vj);/** * React Router v6.23.1 * * Copyright (c) Remix Software Inc. @@ -63,7 +63,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function tl(){return tl=Object.assign?Object.assign.bind():function(n){for(var e=1;ex0(n,e),[e,n])}function y0(n){h.useContext(rs).static||h.useLayoutEffect(n)}function ru(){let{isDataRoute:n}=h.useContext($t);return n?gv():av()}function av(){aa()||je(!1);let n=h.useContext(lu),{basename:e,future:s,navigator:a}=h.useContext(rs),{matches:l}=h.useContext($t),{pathname:r}=cs(),c=JSON.stringify(g0(l,s.v7_relativeSplatPath)),i=h.useRef(!1);return y0(()=>{i.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!i.current)return;if(typeof d=="number"){a.go(d);return}let m=v0(d,JSON.parse(c),r,u.relative==="path");n==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:Et([e,m.pathname])),(u.replace?a.replace:a.push)(m,u.state,u)},[e,a,c,r,n])}const lv=h.createContext(null);function cu(n){let e=h.useContext($t).outlet;return e&&h.createElement(lv.Provider,{value:n},e)}function iu(n,e){let{relative:s}=e===void 0?{}:e,{future:a}=h.useContext(rs),{matches:l}=h.useContext($t),{pathname:r}=cs(),c=JSON.stringify(g0(l,a.v7_relativeSplatPath));return h.useMemo(()=>v0(n,JSON.parse(c),r,s==="path"),[n,c,r,s])}function rv(n,e){return cv(n,e)}function cv(n,e,s,a){aa()||je(!1);let{navigator:l}=h.useContext(rs),{matches:r}=h.useContext($t),c=r[r.length-1],i=c?c.params:{};c&&c.pathname;let o=c?c.pathnameBase:"/";c&&c.route;let d=cs(),u;if(e){var m;let N=typeof e=="string"?sa(e):e;o==="/"||(m=N.pathname)!=null&&m.startsWith(o)||je(!1),u=N}else u=d;let p=u.pathname||"/",g=p;if(o!=="/"){let N=o.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(N.length).join("/")}let y=D2(n,{pathname:g}),b=mv(y&&y.map(N=>Object.assign({},N,{params:Object.assign({},i,N.params),pathname:Et([o,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?o:Et([o,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),r,s,a);return e&&b?h.createElement(ec.Provider,{value:{location:tl({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:bt.Pop}},b):b}function iv(){let n=xv(),e=I2(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},e),s?h.createElement("pre",{style:l},s):null,null)}const ov=h.createElement(iv,null);class uv extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,s){return s.location!==e.location||s.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:s.error,location:s.location,revalidation:e.revalidation||s.revalidation}}componentDidCatch(e,s){console.error("React Router caught the following error during render",e,s)}render(){return this.state.error!==void 0?h.createElement($t.Provider,{value:this.props.routeContext},h.createElement(b0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dv(n){let{routeContext:e,match:s,children:a}=n,l=h.useContext(lu);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),h.createElement($t.Provider,{value:e},a)}function mv(n,e,s,a){var l;if(e===void 0&&(e=[]),s===void 0&&(s=null),a===void 0&&(a=null),n==null){var r;if((r=s)!=null&&r.errors)n=s.matches;else return null}let c=n,i=(l=s)==null?void 0:l.errors;if(i!=null){let u=c.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);u>=0||je(!1),c=c.slice(0,Math.min(c.length,u+1))}let o=!1,d=-1;if(s&&a&&a.v7_partialHydration)for(let u=0;u=0?c=c.slice(0,d+1):c=[c[0]];break}}}return c.reduceRight((u,m,p)=>{let g,y=!1,b=null,N=null;s&&(g=i&&m.route.id?i[m.route.id]:void 0,b=m.route.errorElement||ov,o&&(d<0&&p===0?(y=!0,N=null):d===p&&(y=!0,N=m.route.hydrateFallbackElement||null)));let x=e.concat(c.slice(0,p+1)),f=()=>{let v;return g?v=b:y?v=N:m.route.Component?v=h.createElement(m.route.Component,null):m.route.element?v=m.route.element:v=u,h.createElement(dv,{match:m,routeContext:{outlet:u,matches:x,isDataRoute:s!=null},children:v})};return s&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?h.createElement(uv,{location:s.location,revalidation:s.revalidation,component:b,error:g,children:f(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):f()},null)}var N0=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(N0||{}),$r=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}($r||{});function pv(n){let e=h.useContext(lu);return e||je(!1),e}function fv(n){let e=h.useContext(nv);return e||je(!1),e}function hv(n){let e=h.useContext($t);return e||je(!1),e}function S0(n){let e=hv(),s=e.matches[e.matches.length-1];return s.route.id||je(!1),s.route.id}function xv(){var n;let e=h.useContext(b0),s=fv($r.UseRouteError),a=S0($r.UseRouteError);return e!==void 0?e:(n=s.errors)==null?void 0:n[a]}function gv(){let{router:n}=pv(N0.UseNavigateStable),e=S0($r.UseNavigateStable),s=h.useRef(!1);return y0(()=>{s.current=!0}),h.useCallback(function(l,r){r===void 0&&(r={}),s.current&&(typeof l=="number"?n.navigate(l):n.navigate(l,tl({fromRouteId:e},r)))},[n,e])}function vv(n){return cu(n.context)}function dt(n){je(!1)}function jv(n){let{basename:e="/",children:s=null,location:a,navigationType:l=bt.Pop,navigator:r,static:c=!1,future:i}=n;aa()&&je(!1);let o=e.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:o,navigator:r,static:c,future:tl({v7_relativeSplatPath:!1},i)}),[o,i,r,c]);typeof a=="string"&&(a=sa(a));let{pathname:u="/",search:m="",hash:p="",state:g=null,key:y="default"}=a,b=h.useMemo(()=>{let N=au(u,o);return N==null?null:{location:{pathname:N,search:m,hash:p,state:g,key:y},navigationType:l}},[o,u,m,p,g,y,l]);return b==null?null:h.createElement(rs.Provider,{value:d},h.createElement(ec.Provider,{children:s,value:b}))}function bv(n){let{children:e,location:s}=n;return rv(Ji(e),s)}new Promise(()=>{});function Ji(n,e){e===void 0&&(e=[]);let s=[];return h.Children.forEach(n,(a,l)=>{if(!h.isValidElement(a))return;let r=[...e,l];if(a.type===h.Fragment){s.push.apply(s,Ji(a.props.children,r));return}a.type!==dt&&je(!1),!a.props.index||!a.props.children||je(!1);let c={id:a.props.id||r.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=Ji(a.props.children,r)),s.push(c)}),s}/** + */function sl(){return sl=Object.assign?Object.assign.bind():function(n){for(var e=1;eN0(n,e),[e,n])}function C0(n){f.useContext(rs).static||f.useLayoutEffect(n)}function ru(){let{isDataRoute:n}=f.useContext(Dt);return n?Oj():Sj()}function Sj(){la()||ve(!1);let n=f.useContext(lu),{basename:e,future:s,navigator:a}=f.useContext(rs),{matches:l}=f.useContext(Dt),{pathname:r}=is(),i=JSON.stringify(S0(l,s.v7_relativeSplatPath)),c=f.useRef(!1);return C0(()=>{c.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!c.current)return;if(typeof u=="number"){a.go(u);return}let m=w0(u,JSON.parse(i),r,d.relative==="path");n==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:At([e,m.pathname])),(d.replace?a.replace:a.push)(m,d.state,d)},[e,a,i,r,n])}const wj=f.createContext(null);function iu(n){let e=f.useContext(Dt).outlet;return e&&f.createElement(wj.Provider,{value:n},e)}function cu(n,e){let{relative:s}=e===void 0?{}:e,{future:a}=f.useContext(rs),{matches:l}=f.useContext(Dt),{pathname:r}=is(),i=JSON.stringify(S0(l,a.v7_relativeSplatPath));return f.useMemo(()=>w0(n,JSON.parse(i),r,s==="path"),[n,i,r,s])}function _j(n,e){return kj(n,e)}function kj(n,e,s,a){la()||ve(!1);let{navigator:l}=f.useContext(rs),{matches:r}=f.useContext(Dt),i=r[r.length-1],c=i?i.params:{};i&&i.pathname;let o=i?i.pathnameBase:"/";i&&i.route;let u=is(),d;if(e){var m;let N=typeof e=="string"?aa(e):e;o==="/"||(m=N.pathname)!=null&&m.startsWith(o)||ve(!1),d=N}else d=u;let p=d.pathname||"/",j=p;if(o!=="/"){let N=o.replace(/^\//,"").split("/");j="/"+p.replace(/^\//,"").split("/").slice(N.length).join("/")}let y=F2(n,{pathname:j}),b=Aj(y&&y.map(N=>Object.assign({},N,{params:Object.assign({},c,N.params),pathname:At([o,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?o:At([o,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),r,s,a);return e&&b?f.createElement(ni.Provider,{value:{location:sl({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Nt.Pop}},b):b}function Cj(){let n=Dj(),e=jj(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},e),s?f.createElement("pre",{style:l},s):null,null)}const Rj=f.createElement(Cj,null);class Mj extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,s){return s.location!==e.location||s.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:s.error,location:s.location,revalidation:e.revalidation||s.revalidation}}componentDidCatch(e,s){console.error("React Router caught the following error during render",e,s)}render(){return this.state.error!==void 0?f.createElement(Dt.Provider,{value:this.props.routeContext},f.createElement(k0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ej(n){let{routeContext:e,match:s,children:a}=n,l=f.useContext(lu);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),f.createElement(Dt.Provider,{value:e},a)}function Aj(n,e,s,a){var l;if(e===void 0&&(e=[]),s===void 0&&(s=null),a===void 0&&(a=null),n==null){var r;if((r=s)!=null&&r.errors)n=s.matches;else return null}let i=n,c=(l=s)==null?void 0:l.errors;if(c!=null){let d=i.findIndex(m=>m.route.id&&(c==null?void 0:c[m.route.id])!==void 0);d>=0||ve(!1),i=i.slice(0,Math.min(i.length,d+1))}let o=!1,u=-1;if(s&&a&&a.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,m,p)=>{let j,y=!1,b=null,N=null;s&&(j=c&&m.route.id?c[m.route.id]:void 0,b=m.route.errorElement||Rj,o&&(u<0&&p===0?(y=!0,N=null):u===p&&(y=!0,N=m.route.hydrateFallbackElement||null)));let x=e.concat(i.slice(0,p+1)),h=()=>{let g;return j?g=b:y?g=N:m.route.Component?g=f.createElement(m.route.Component,null):m.route.element?g=m.route.element:g=d,f.createElement(Ej,{match:m,routeContext:{outlet:d,matches:x,isDataRoute:s!=null},children:g})};return s&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?f.createElement(Mj,{location:s.location,revalidation:s.revalidation,component:b,error:j,children:h(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):h()},null)}var R0=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(R0||{}),Lr=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(Lr||{});function Tj(n){let e=f.useContext(lu);return e||ve(!1),e}function $j(n){let e=f.useContext(bj);return e||ve(!1),e}function Lj(n){let e=f.useContext(Dt);return e||ve(!1),e}function M0(n){let e=Lj(),s=e.matches[e.matches.length-1];return s.route.id||ve(!1),s.route.id}function Dj(){var n;let e=f.useContext(k0),s=$j(Lr.UseRouteError),a=M0(Lr.UseRouteError);return e!==void 0?e:(n=s.errors)==null?void 0:n[a]}function Oj(){let{router:n}=Tj(R0.UseNavigateStable),e=M0(Lr.UseNavigateStable),s=f.useRef(!1);return C0(()=>{s.current=!0}),f.useCallback(function(l,r){r===void 0&&(r={}),s.current&&(typeof l=="number"?n.navigate(l):n.navigate(l,sl({fromRouteId:e},r)))},[n,e])}function Bj(n){return iu(n.context)}function pt(n){ve(!1)}function zj(n){let{basename:e="/",children:s=null,location:a,navigationType:l=Nt.Pop,navigator:r,static:i=!1,future:c}=n;la()&&ve(!1);let o=e.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:o,navigator:r,static:i,future:sl({v7_relativeSplatPath:!1},c)}),[o,c,r,i]);typeof a=="string"&&(a=aa(a));let{pathname:d="/",search:m="",hash:p="",state:j=null,key:y="default"}=a,b=f.useMemo(()=>{let N=au(d,o);return N==null?null:{location:{pathname:N,search:m,hash:p,state:j,key:y},navigationType:l}},[o,d,m,p,j,y,l]);return b==null?null:f.createElement(rs.Provider,{value:u},f.createElement(ni.Provider,{children:s,value:b}))}function Uj(n){let{children:e,location:s}=n;return _j(Jc(e),s)}new Promise(()=>{});function Jc(n,e){e===void 0&&(e=[]);let s=[];return f.Children.forEach(n,(a,l)=>{if(!f.isValidElement(a))return;let r=[...e,l];if(a.type===f.Fragment){s.push.apply(s,Jc(a.props.children,r));return}a.type!==pt&&ve(!1),!a.props.index||!a.props.children||ve(!1);let i={id:a.props.id||r.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=Jc(a.props.children,r)),s.push(i)}),s}/** * React Router DOM v6.23.1 * * Copyright (c) Remix Software Inc. @@ -72,7 +72,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ki(){return Ki=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(s[l]=n[l]);return s}function Nv(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Sv(n,e){return n.button===0&&(!e||e==="_self")&&!Nv(n)}const wv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],_v="6";try{window.__reactRouterVersion=_v}catch{}const kv="startTransition",Fd=Kx[kv];function Cv(n){let{basename:e,children:s,future:a,window:l}=n,r=h.useRef();r.current==null&&(r.current=A2({window:l,v5Compat:!0}));let c=r.current,[i,o]=h.useState({action:c.action,location:c.location}),{v7_startTransition:d}=a||{},u=h.useCallback(m=>{d&&Fd?Fd(()=>o(m)):o(m)},[o,d]);return h.useLayoutEffect(()=>c.listen(u),[c,u]),h.createElement(jv,{basename:e,children:s,location:i.location,navigationType:i.action,navigator:c,future:a})}const Rv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ev=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w0=h.forwardRef(function(e,s){let{onClick:a,relative:l,reloadDocument:r,replace:c,state:i,target:o,to:d,preventScrollReset:u,unstable_viewTransition:m}=e,p=yv(e,wv),{basename:g}=h.useContext(rs),y,b=!1;if(typeof d=="string"&&Ev.test(d)&&(y=d,Rv))try{let v=new URL(window.location.href),j=d.startsWith("//")?new URL(v.protocol+d):new URL(d),_=au(j.pathname,g);j.origin===v.origin&&_!=null?d=_+j.search+j.hash:b=!0}catch{}let N=tv(d,{relative:l}),x=Mv(d,{replace:c,state:i,target:o,preventScrollReset:u,relative:l,unstable_viewTransition:m});function f(v){a&&a(v),v.defaultPrevented||x(v)}return h.createElement("a",Ki({},p,{href:y||N,onClick:b||r?a:f,ref:s,target:o}))});var Id;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Id||(Id={}));var em;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(em||(em={}));function Mv(n,e){let{target:s,replace:a,state:l,preventScrollReset:r,relative:c,unstable_viewTransition:i}=e===void 0?{}:e,o=ru(),d=cs(),u=iu(n,{relative:c});return h.useCallback(m=>{if(Sv(m,s)){m.preventDefault();let p=a!==void 0?a:Tr(d)===Tr(u);o(n,{replace:p,state:l,preventScrollReset:r,relative:c,unstable_viewTransition:i})}},[d,o,u,a,l,s,n,r,c,i])}function nm(){return t.jsxs("div",{className:"w-full h-64 flex flex-col items-center justify-center",children:[t.jsx("div",{className:"loader"}),t.jsx("div",{className:"text-sm text-blue-500 mt-3",children:"page loading..."})]})}function _0(n){var e,s,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(e=0;ei(r)))==null?void 0:c.classGroupId}const tm=/^\[(.+)\]$/;function Tv(n){if(tm.test(n)){const e=tm.exec(n)[1],s=e==null?void 0:e.substring(0,e.indexOf(":"));if(s)return"arbitrary.."+s}}function $v(n){const{theme:e,prefix:s}=n,a={nextPart:new Map,validators:[]};return Lv(Object.entries(n.classGroups),s).forEach(([r,c])=>{Wi(c,a,r,e)}),a}function Wi(n,e,s,a){n.forEach(l=>{if(typeof l=="string"){const r=l===""?e:sm(e,l);r.classGroupId=s;return}if(typeof l=="function"){if(Dv(l)){Wi(l(a),e,s,a);return}e.validators.push({validator:l,classGroupId:s});return}Object.entries(l).forEach(([r,c])=>{Wi(c,sm(e,r),s,a)})})}function sm(n,e){let s=n;return e.split(ou).forEach(a=>{s.nextPart.has(a)||s.nextPart.set(a,{nextPart:new Map,validators:[]}),s=s.nextPart.get(a)}),s}function Dv(n){return n.isThemeGetter}function Lv(n,e){return e?n.map(([s,a])=>{const l=a.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([c,i])=>[e+c,i])):r);return[s,l]}):n}function Bv(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,s=new Map,a=new Map;function l(r,c){s.set(r,c),e++,e>n&&(e=0,a=s,s=new Map)}return{get(r){let c=s.get(r);if(c!==void 0)return c;if((c=a.get(r))!==void 0)return l(r,c),c},set(r,c){s.has(r)?s.set(r,c):l(r,c)}}}const C0="!";function Ov(n){const e=n.separator,s=e.length===1,a=e[0],l=e.length;return function(c){const i=[];let o=0,d=0,u;for(let b=0;bd?u-d:void 0;return{modifiers:i,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}}}function zv(n){if(n.length<=1)return n;const e=[];let s=[];return n.forEach(a=>{a[0]==="["?(e.push(...s.sort(),a),s=[]):s.push(a)}),e.push(...s.sort()),e}function Uv(n){return{cache:Bv(n.cacheSize),splitModifiers:Ov(n),...Av(n)}}const Hv=/\s+/;function qv(n,e){const{splitModifiers:s,getClassGroupId:a,getConflictingClassGroupIds:l}=e,r=new Set;return n.trim().split(Hv).map(c=>{const{modifiers:i,hasImportantModifier:o,baseClassName:d,maybePostfixModifierPosition:u}=s(c);let m=a(u?d.substring(0,u):d),p=!!u;if(!m){if(!u)return{isTailwindClass:!1,originalClassName:c};if(m=a(d),!m)return{isTailwindClass:!1,originalClassName:c};p=!1}const g=zv(i).join(":");return{isTailwindClass:!0,modifierId:o?g+C0:g,classGroupId:m,originalClassName:c,hasPostfixModifier:p}}).reverse().filter(c=>{if(!c.isTailwindClass)return!0;const{modifierId:i,classGroupId:o,hasPostfixModifier:d}=c,u=i+o;return r.has(u)?!1:(r.add(u),l(o,d).forEach(m=>r.add(i+m)),!0)}).reverse().map(c=>c.originalClassName).join(" ")}function Vv(){let n=0,e,s,a="";for(;nm(u),n());return s=Uv(d),a=s.cache.get,l=s.cache.set,r=i,i(o)}function i(o){const d=a(o);if(d)return d;const u=qv(o,s);return l(o,u),u}return function(){return r(Vv.apply(null,arguments))}}function ie(n){const e=s=>s[n]||[];return e.isThemeGetter=!0,e}const E0=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gv=/^\d+\/\d+$/,Zv=new Set(["px","full","screen"]),Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Kv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Gn(n){return Gt(n)||Zv.has(n)||Gv.test(n)}function it(n){return la(n,"length",aj)}function Gt(n){return!!n&&!Number.isNaN(Number(n))}function Ul(n){return la(n,"number",Gt)}function ha(n){return!!n&&Number.isInteger(Number(n))}function Pv(n){return n.endsWith("%")&&Gt(n.slice(0,-1))}function z(n){return E0.test(n)}function ot(n){return Yv.test(n)}const Fv=new Set(["length","size","percentage"]);function Iv(n){return la(n,Fv,M0)}function ej(n){return la(n,"position",M0)}const nj=new Set(["image","url"]);function tj(n){return la(n,nj,rj)}function sj(n){return la(n,"",lj)}function xa(){return!0}function la(n,e,s){const a=E0.exec(n);return a?a[1]?typeof e=="string"?a[1]===e:e.has(a[1]):s(a[2]):!1}function aj(n){return Qv.test(n)&&!Jv.test(n)}function M0(){return!1}function lj(n){return Kv.test(n)}function rj(n){return Wv.test(n)}function cj(){const n=ie("colors"),e=ie("spacing"),s=ie("blur"),a=ie("brightness"),l=ie("borderColor"),r=ie("borderRadius"),c=ie("borderSpacing"),i=ie("borderWidth"),o=ie("contrast"),d=ie("grayscale"),u=ie("hueRotate"),m=ie("invert"),p=ie("gap"),g=ie("gradientColorStops"),y=ie("gradientColorStopPositions"),b=ie("inset"),N=ie("margin"),x=ie("opacity"),f=ie("padding"),v=ie("saturate"),j=ie("scale"),_=ie("sepia"),k=ie("skew"),R=ie("space"),M=ie("translate"),Y=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],ce=()=>["auto",z,e],U=()=>[z,e],tn=()=>["",Gn,it],Ue=()=>["auto",Gt,z],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",z],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[Gt,Ul],He=()=>[Gt,z];return{cacheSize:500,separator:":",theme:{colors:[xa],spacing:[Gn,it],blur:["none","",ot,z],brightness:Ae(),borderColor:[n],borderRadius:["none","","full",ot,z],borderSpacing:U(),borderWidth:tn(),contrast:Ae(),grayscale:V(),hueRotate:He(),invert:V(),gap:U(),gradientColorStops:[n],gradientColorStopPositions:[Pv,it],inset:ce(),margin:ce(),opacity:Ae(),padding:U(),saturate:Ae(),scale:Ae(),sepia:V(),skew:He(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[ot]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),z]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ha,z]}],basis:[{basis:ce()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",ha,z]}],"grid-cols":[{"grid-cols":[xa]}],"col-start-end":[{col:["auto",{span:["full",ha,z]},z]}],"col-start":[{"col-start":Ue()}],"col-end":[{"col-end":Ue()}],"grid-rows":[{"grid-rows":[xa]}],"row-start-end":[{row:["auto",{span:[ha,z]},z]}],"row-start":[{"row-start":Ue()}],"row-end":[{"row-end":Ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,e]}],"min-w":[{"min-w":[z,e,"min","max","fit"]}],"max-w":[{"max-w":[z,e,"none","full","min","max","fit","prose",{screen:[ot]},ot]}],h:[{h:[z,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ot,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ul]}],"font-family":[{font:[xa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z]}],"line-clamp":[{"line-clamp":["none",Gt,Ul]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gn,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gn,it]}],"underline-offset":[{"underline-offset":["auto",Gn,z]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),ej]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Iv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},tj]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:C()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[Gn,z]}],"outline-w":[{outline:[Gn,it]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:tn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Gn,it]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",ot,sj]}],"shadow-color":[{shadow:[xa]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[a]}],contrast:[{contrast:[o]}],"drop-shadow":[{"drop-shadow":["","none",ot,z]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[o]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:He()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:He()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[ha,z]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Gn,it,Ul]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Pe=Xv(cj);function Cn(n){const{children:e,className:s="",end:a=!0,activeName:l,to:r,onClick:c,...i}=n,o=iu(r);let d=sv({path:o.pathname,end:a});const u=Pe(se(s,"transition cursor-pointer",{[l]:!!d}));function m(p){d&&p.preventDefault(),c&&c(p)}return t.jsx(w0,{className:u,to:r,...i,onClick:m,children:e})}const ij="_modal_fd6cp_1",oj="_show_fd6cp_1",uj="_hide_fd6cp_1",dj="_out_fd6cp_16",Zc={modal:ij,show:oj,hide:uj,in:"_in_fd6cp_12",out:dj};function nc(n){const{onClose:e,children:s,ref:a}=n,[l,r]=h.useState(!1),[c,i]=h.useState(!1);h.useImperativeHandle(a,()=>({show:()=>{r(!0),document.body.style.overflow="hidden",i(!0)},close:()=>{document.body.style.overflow="visible",r(!1)}}));const o=se(Zc.modal,{[Zc.in]:l,[Zc.out]:!l});function d(){l||i(!1)}function u(){r(!1),e&&e()}return c?t.jsx(t.Fragment,{children:cl.createPortal(t.jsx("div",{className:o,onAnimationEnd:d,onClick:u,children:s}),document.body)}):null}function mj(){return t.jsx("div",{className:"w-10 h-10 ml-4 border rounded-full overflow-hidden relative",children:t.jsx("div",{className:"pyramid-loader",children:t.jsxs("div",{className:"wrapper",children:[t.jsx("span",{className:"side side1"}),t.jsx("span",{className:"side side2"}),t.jsx("span",{className:"side side3"}),t.jsx("span",{className:"side side4"}),t.jsx("span",{className:"shadow"})]})})})}function pj(){const[n,e]=h.useState(!0),[s,a]=h.useState({});return h.useEffect(()=>{function l(r){if(r.origin!=="https://giscus.app")return;e(!1);let c=r.data.giscus;c.viewer&&a(c.viewer)}window.addEventListener("message",l,!1)},[]),n?t.jsx(mj,{}):t.jsx("div",{className:"w-10 h-10 ml-4 border rounded-full overflow-hidden",children:t.jsx("img",{className:"w-full h-full",src:s.avatarUrl,alt:""})})}document.documentElement.style.fontSize="14px";function le(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,ghost:o,rect:d,disabled:u,...m}=n,b=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative text-gray-600","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"bg-transparent border-transparent hover:bg-gray-100":o,"bg-opacity-70":u,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r,"w-8 h-8 p-0":d},e));return t.jsxs("button",{className:b,...m,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}let Ua;const fj=n=>{Ua={x:n.pageX,y:n.pageY},setTimeout(()=>{Ua=null},100)};document.documentElement.addEventListener("click",fj,!0);function hj(n,e){var s=n.style;["Webkit","Moz","Ms","ms"].forEach(function(a){s[a+"TransformOrigin"]=e}),s.transformOrigin=e}function xj(n){const e=n.getBoundingClientRect(),s={left:e.left,top:e.top},l=n.ownerDocument.defaultView;return s.left+=am(l),s.top+=am(l,1),s}function am(n,e){var s=n["page"+(e?"Y":"X")+"Offset"],a="scroll"+(e?"Top":"Left");if(typeof s!="number"){var l=n.document;s=l.documentElement[a],typeof s!="number"&&(s=l.body[a])}return s}function ra(n){const{title:e,onClose:s,children:a,onSure:l,onCancel:r,ref:c,footer:i}=n,[o,d]=h.useState(!1),[u,m]=h.useState(!1),p=h.useRef(null),g=h.useRef(null);h.useImperativeHandle(c,()=>({show:()=>{g.current.show(),document.body.style.overflow="hidden",d(!0),m(!0)},close:y}));function y(){d(!1),g.current.close(),document.body.style.overflow="visible"}function b(){y(),s&&s()}function N(j){j.stopPropagation()}function x(j){j.stopPropagation(),l&&l()}function f(){o||m(!1)}const v=se("dialog-wrapper",{in:o,out:!o});return h.useEffect(()=>{const j=p.current;if(u&&j){const _=xj(j);Ua&&hj(j,Ua.x-_.left+"px "+(Ua.y-_.top)+"px")}},[u]),t.jsx(nc,{ref:g,onClose:b,children:u?t.jsxs("div",{ref:p,className:v,onClick:N,onAnimationEnd:f,children:[t.jsxs("header",{className:"flex justify-between items-center mb-2",children:[t.jsx("div",{className:"font-bold text-lg leading-6",children:e}),t.jsx("div",{onClick:b,className:"p-2 rounded-md cursor-pointer transition hover:bg-gray-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),t.jsx("section",{className:"leading-6",children:a}),i||t.jsx("footer",{className:"text-end mt-4",children:t.jsx(le,{primary:!0,onClick:x,children:"确认"})})]}):null})}function gj(){const n=h.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs(t.Fragment,{children:[t.jsxs(Cn,{className:"flex items-center",onClick:e,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"})}),t.jsx("div",{className:"ml-1 text-sm",children:"交流群"})]}),t.jsxs(ra,{ref:n,title:"Message",onSure:()=>n.current.close(),children:["添加我的微信:",t.jsx("span",{className:"text-red-500 text-xl",children:"icanmeetu"}),", 注明:添加 react19 付费交流群"]})]})}function yn(n){const{type:e="text",className:s,required:a,label:l,help:r="此项规则不匹配",pattern:c,...i}=n,{pending:o}=cl.useFormStatus(),d=se("flex items-center my-10",s);return t.jsxs("div",{className:d,children:[l&&t.jsxs("label",{className:"w-20 text-right font-bold",children:[l,":"]}),t.jsx("div",{className:"input flex-1",children:t.jsx("input",{type:e,required:a,pattern:c,...i,disabled:o})})]})}function vj(){const n=h.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs(t.Fragment,{children:[t.jsxs(Cn,{className:"flex items-center ml-4 bg-gray-900 px-4 py-2 rounded-full",to:"/",onClick:e,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5 text-blue-50",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),t.jsx("div",{className:"ml-1 text-sm text-blue-50",children:"激活码"})]}),t.jsxs(ra,{ref:n,title:"Message",onSure:()=>n.current.close(),children:["请添加交流群获得激活码,或者联系网站开发者这波能反杀获得激活码,联系方式如下",t.jsxs("div",{className:"flex my-4",children:[t.jsx("div",{className:"w-8",children:"wx:"}),t.jsx("div",{className:"text-red-500",children:"icanmeetu"})]})]})]})}const lm=[{path:"tutorial",text:"教程"},{path:"component",text:"组件"},{path:"other",text:"其他"}];function jj(){const n=h.useRef(null);return t.jsxs("header",{className:"fixed z-50 top-0 flex justify-between border-b border-slate-200 min-w-[320px] bg-white bg-opacity-70 backdrop-blur-sm w-full",children:[t.jsxs("div",{className:"pl-6 h-16 flex items-center md:pl-10 transition-all",children:[t.jsxs(Cn,{className:"flex items-center",to:"/",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"font-bold ml-2",children:"React 19"})]}),t.jsx("div",{className:"hidden md:block",children:lm.map((e,s)=>t.jsx(Cn,{to:e.path,className:"ml-8 text-gray-500",end:!1,activeName:"text-gray-900",children:e.text},e.path))}),t.jsxs("a",{className:"hidden md:flex text-xs m-8 rounded-full bg-red-100 py-2 px-4 text-red-400 transition hover:bg-red-300 hover:text-red-700 cursor-pointer",href:"https://appxw863qeq2150.h5.xiaoeknow.com/p/decorate/homepage?entry=2&entry_type=2002&share_user_id=u_626bf7dfafe72_zLCXc4Qr0O&wework_share_customer_id=u_626bf7dfafe72_zLCXc4Qr0O",target:"_blank",children:["推荐:JavaScript 核心进阶",t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4 ml-2",children:t.jsx("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"})})]})]}),t.jsxs("div",{className:"hidden md:flex h-16 items-center pr-6 text-gray-500",children:[t.jsx(gj,{alt:"交流群"}),t.jsx(vj,{alt:"激活码"}),t.jsx(pj,{})]}),t.jsx("div",{className:"md:hidden flex items-center pr-6 text-gray-700",onClick:()=>n.current.show(),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25"})})}),t.jsxs(nc,{ref:n,onClose:()=>n.current.close(),children:[t.jsxs("header",{className:"sticky top-0 flex justify-between border-b border-amber-50 bg-amber-50",children:[t.jsx("div",{className:"pl-6 h-16 flex items-center md:pl-10 transition-all",children:t.jsxs(Cn,{className:"flex items-center",to:"/",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"font-bold ml-2",children:"React 19"})]})}),t.jsx("div",{className:"flex h-16 items-center pr-6 text-gray-500",children:t.jsx("div",{className:"flex items-center text-gray-700",onClick:()=>n.current.show(),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})]}),lm.map((e,s)=>t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:e.path,children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5",children:t.jsx("path",{fillRule:"evenodd",d:"M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"ml-2 text-sm",children:e.text})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})},e.path)),t.jsx("div",{className:"flex items-center text-red-500 bg-red-50 px-8 py-5 transition hover:text-red-700 hover:bg-red-200",children:t.jsxs("a",{className:"flex items-center justify-between w-full",href:"https://appxw863qeq2150.h5.xiaoeknow.com/p/decorate/homepage?entry=2&entry_type=2002&share_user_id=u_626bf7dfafe72_zLCXc4Qr0O&wework_share_customer_id=u_626bf7dfafe72_zLCXc4Qr0O",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5",children:t.jsx("path",{fillRule:"evenodd",d:"M10.5 3.798v5.02a3 3 0 0 1-.879 2.121l-2.377 2.377a9.845 9.845 0 0 1 5.091 1.013 8.315 8.315 0 0 0 5.713.636l.285-.071-3.954-3.955a3 3 0 0 1-.879-2.121v-5.02a23.614 23.614 0 0 0-3 0Zm4.5.138a.75.75 0 0 0 .093-1.495A24.837 24.837 0 0 0 12 2.25a25.048 25.048 0 0 0-3.093.191A.75.75 0 0 0 9 3.936v4.882a1.5 1.5 0 0 1-.44 1.06l-6.293 6.294c-1.62 1.621-.903 4.475 1.471 4.88 2.686.46 5.447.698 8.262.698 2.816 0 5.576-.239 8.262-.697 2.373-.406 3.092-3.26 1.47-4.881L15.44 9.879A1.5 1.5 0 0 1 15 8.818V3.936Z",clipRule:"evenodd"})}),t.jsx("div",{className:"ml-2 text-sm",children:"推荐:JavaScript 核心进阶"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})}),t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:"/",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"交流群"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})}),t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:"/",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"激活码"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})})]})]})}function bj(){const[n,e]=h.useState(""),s=`relative ${n} bg-skin-fill overflow-hidden rounded`;return t.jsxs("div",{className:"my-8 border border-gray-150 rounded px-8 pb-8",children:[t.jsxs("div",{className:"flex justify-center",children:[t.jsx("div",{onClick:()=>e(""),className:"my-6 mx-2 h-6 w-6 rounded bg-indigo-500 cursor-pointer"}),t.jsx("div",{onClick:()=>e("theme-swiss"),className:"my-6 mx-2 h-6 w-6 rounded bg-red-600 cursor-pointer"}),t.jsx("div",{onClick:()=>e("theme-neon"),className:"my-6 mx-2 h-6 w-6 rounded bg-green-400 cursor-pointer"})]}),t.jsxs("div",{className:s,children:[t.jsx("img",{className:"absolute inset-0 h-full w-full object-cover opacity-30",src:"https://images.unsplash.com/photo-1602576666092-bf6447a729fc?q=80&w=3732&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",alt:""}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-skin-hue via-skin-hue to-transparent opacity-90 transition"}),t.jsxs("div",{className:"relative max-w-2xl mx-auto text-center py-16 px-8",children:[t.jsx("h2",{className:"font-extrabold text-skin-base text-4xl transition",children:t.jsx("span",{children:"极客时间、掘金买课优惠"})}),t.jsx("p",{className:"mt-4 text-md text-left text-skin-muted transition",children:"官方的课程返现全部归还,需要从网站 coursesub.top 或者公众号「课程减减」通过邀请链接进行下单,购买后添加客服微信发送课程名确认后即可收到红包,可正常使用极客时间的优惠券或者学生半价优惠。"}),t.jsx("div",{className:"mt-10 max-w-sm mx-auto sm:max-w-one sm:flex sm:justify-center",children:t.jsxs("div",{className:"space-y-0 mx-auto inline-grid grid-cols-2 gap-5",children:[t.jsx("a",{target:"_blank",className:"transition text-skin-inverted bg-skin-button-accent hover:bg-skin-button-accent-hover flex items-center justify-center py-3 border border-transparent text-base font-medium rounded-md shadow-lg px-8",href:"https://coursesub.top/?key=react",children:"去选课"}),t.jsx("a",{target:"_blank",className:"transition text-skin-base bg-skin-button-muted hover:bg-opacity-70 flex items-center justify-center py-3 border border-transparent text-base font-medium rounded-lg shadow-sm px-8",href:"https://mp.weixin.qq.com/s?__biz=MzUyMjkwNTgwOA==&mid=2247485923&idx=1&sn=0710d33fd1e1287e10f88bd4139e0a0e&chksm=f9c5f85cceb2714a585567f21751ae703f8ba80519a7a089746079a05c4f916c962fe81332d1#rd",children:"详细规则"})]})})]})]})]})}function yj(){return t.jsx("div",{className:"fixed top-0 inset-0 -z-10 mx-0 max-w-none overflow-hidden",children:t.jsxs("div",{className:"absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem] dark:[mask-image:linear-gradient(white,transparent)]",children:[t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#36b49f] to-[#DBFF75] opacity-40 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)] dark:from-[#36b49f]/30 dark:to-[#DBFF75]/30 dark:opacity-100",children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-50%] h-[200%] w-full skew-y-[-18deg] fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":S1:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"-12",y:"4",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:S1:)"}),t.jsxs("svg",{x:"-12",y:"4",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"288",y:"168"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"144",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"504",y:"168"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"720",y:"336"})]})]})}),t.jsx("svg",{viewBox:"0 0 1113 440","aria-hidden":"true",className:"absolute left-1/2 top-0 ml-[-19rem] w-[69.5625rem] fill-white blur-[26px] dark:hidden",children:t.jsx("path",{d:"M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z"})})]})})}function Yc({title:n,desc:e="",path:s,icon:a,className:l}){const[r,c]=h.useState({x:0,y:0}),i=h.useRef(null),o=unescape(n.replace(/\\u/gi,"%u")),d=unescape(e.replace(/\\u/gi,"%u"));h.useEffect(()=>{const g=i.current.getBoundingClientRect();function y(b){c({x:b.x-g.left,y:b.y+document.documentElement.scrollTop-g.top})}i.current.addEventListener("mouseenter",b=>{document.addEventListener("mousemove",y,!1)},!1),i.current.addEventListener("mouseleave",b=>{document.removeEventListener("mousemove",y,!1)},!1)},[]);const u=`radial-gradient(180px at ${r.x}px ${r.y}px, white, transparent)`,p=se("group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5",l);return t.jsxs("div",{ref:i,className:p,children:[t.jsxs("div",{className:"pointer-events-none",children:[t.jsx("div",{className:"absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50",children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":Rkq5jsqja:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"50%",y:"16",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:Rkq5jsqja:)"}),t.jsxs("svg",{x:"50%",y:"16",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"0",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"72",y:"168"})]})]})}),t.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-[#D7EDEA] to-[#F4FBDF] opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]",style:{maskImage:u}}),t.jsx("div",{className:"absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100",style:{maskImage:u},children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":R5kq5jsqja:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"50%",y:"16",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:R5kq5jsqja:)"}),t.jsxs("svg",{x:"50%",y:"16",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"0",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"72",y:"168"})]})]})})]}),t.jsx("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-gray-200 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20"}),t.jsxs("div",{className:"relative rounded-2xl px-4 pb-4 pt-16",children:[t.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-emerald-300/10 dark:group-hover:ring-emerald-400",children:t.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",className:"h-5 w-5 fill-zinc-700/10 stroke-zinc-700 transition-colors duration-300 group-hover:stroke-zinc-900 dark:fill-white/10 dark:stroke-zinc-400 dark:group-hover:fill-emerald-300/10 dark:group-hover:stroke-emerald-400",children:[t.jsx("path",{strokeWidth:"0",fillRule:"evenodd",clipRule:"evenodd",d:"M10 .5a9.5 9.5 0 0 1 5.598 17.177C14.466 15.177 12.383 13.5 10 13.5s-4.466 1.677-5.598 4.177A9.5 9.5 0 0 1 10 .5ZM12.5 8a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"}),t.jsx("path",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",d:"M10 .5a9.5 9.5 0 0 1 5.598 17.177A9.458 9.458 0 0 1 10 19.5a9.458 9.458 0 0 1-5.598-1.823A9.5 9.5 0 0 1 10 .5Z"}),t.jsx("path",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",d:"M4.402 17.677C5.534 15.177 7.617 13.5 10 13.5s4.466 1.677 5.598 4.177M10 5.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z"})]})}),t.jsx("h3",{className:"mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white",children:t.jsxs("a",{href:s,children:[t.jsx("span",{className:"absolute inset-0 rounded-2xl"}),o]})}),t.jsx("p",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:d})]})]})}function Hl(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:c,...i}=n,m=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...i,children:n.children})}function Nj(){return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"min-w-[400px] mx-auto px-16 h-[300px] flex flex-col justify-center",children:[t.jsx("div",{className:"my-2",children:t.jsx("div",{className:"font-bold",children:"按钮类型"})}),t.jsxs("div",{className:"flex items-center justify-between my-4",children:[t.jsx(Hl,{children:"Normal"}),t.jsx(Hl,{danger:!0,children:"Danger"}),t.jsx(Hl,{primary:!0,children:"Primary"}),t.jsx(Hl,{success:!0,children:"Success"})]})]})})}const Sj=`import Button from './Button.jsx' + */function Pc(){return Pc=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(s[l]=n[l]);return s}function qj(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Vj(n,e){return n.button===0&&(!e||e==="_self")&&!qj(n)}const Xj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Gj="6";try{window.__reactRouterVersion=Gj}catch{}const Zj="startTransition",Id=f1[Zj];function Yj(n){let{basename:e,children:s,future:a,window:l}=n,r=f.useRef();r.current==null&&(r.current=W2({window:l,v5Compat:!0}));let i=r.current,[c,o]=f.useState({action:i.action,location:i.location}),{v7_startTransition:u}=a||{},d=f.useCallback(m=>{u&&Id?Id(()=>o(m)):o(m)},[o,u]);return f.useLayoutEffect(()=>i.listen(d),[i,d]),f.createElement(zj,{basename:e,children:s,location:c.location,navigationType:c.action,navigator:i,future:a})}const Qj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,E0=f.forwardRef(function(e,s){let{onClick:a,relative:l,reloadDocument:r,replace:i,state:c,target:o,to:u,preventScrollReset:d,unstable_viewTransition:m}=e,p=Hj(e,Xj),{basename:j}=f.useContext(rs),y,b=!1;if(typeof u=="string"&&Jj.test(u)&&(y=u,Qj))try{let g=new URL(window.location.href),v=u.startsWith("//")?new URL(g.protocol+u):new URL(u),_=au(v.pathname,j);v.origin===g.origin&&_!=null?u=_+v.search+v.hash:b=!0}catch{}let N=yj(u,{relative:l}),x=Pj(u,{replace:i,state:c,target:o,preventScrollReset:d,relative:l,unstable_viewTransition:m});function h(g){a&&a(g),g.defaultPrevented||x(g)}return f.createElement("a",Pc({},p,{href:y||N,onClick:b||r?a:h,ref:s,target:o}))});var Fd;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Fd||(Fd={}));var em;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(em||(em={}));function Pj(n,e){let{target:s,replace:a,state:l,preventScrollReset:r,relative:i,unstable_viewTransition:c}=e===void 0?{}:e,o=ru(),u=is(),d=cu(n,{relative:i});return f.useCallback(m=>{if(Vj(m,s)){m.preventDefault();let p=a!==void 0?a:$r(u)===$r(d);o(n,{replace:p,state:l,preventScrollReset:r,relative:i,unstable_viewTransition:c})}},[u,o,d,a,l,s,n,r,i,c])}function nm(){return t.jsxs("div",{className:"w-full h-64 flex flex-col items-center justify-center",children:[t.jsx("div",{className:"loader"}),t.jsx("div",{className:"text-sm text-blue-500 mt-3",children:"page loading..."})]})}function A0(n){var e,s,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(e=0;ec(r)))==null?void 0:i.classGroupId}const tm=/^\[(.+)\]$/;function Kj(n){if(tm.test(n)){const e=tm.exec(n)[1],s=e==null?void 0:e.substring(0,e.indexOf(":"));if(s)return"arbitrary.."+s}}function Ij(n){const{theme:e,prefix:s}=n,a={nextPart:new Map,validators:[]};return ev(Object.entries(n.classGroups),s).forEach(([r,i])=>{Wc(i,a,r,e)}),a}function Wc(n,e,s,a){n.forEach(l=>{if(typeof l=="string"){const r=l===""?e:sm(e,l);r.classGroupId=s;return}if(typeof l=="function"){if(Fj(l)){Wc(l(a),e,s,a);return}e.validators.push({validator:l,classGroupId:s});return}Object.entries(l).forEach(([r,i])=>{Wc(i,sm(e,r),s,a)})})}function sm(n,e){let s=n;return e.split(ou).forEach(a=>{s.nextPart.has(a)||s.nextPart.set(a,{nextPart:new Map,validators:[]}),s=s.nextPart.get(a)}),s}function Fj(n){return n.isThemeGetter}function ev(n,e){return e?n.map(([s,a])=>{const l=a.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([i,c])=>[e+i,c])):r);return[s,l]}):n}function nv(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,s=new Map,a=new Map;function l(r,i){s.set(r,i),e++,e>n&&(e=0,a=s,s=new Map)}return{get(r){let i=s.get(r);if(i!==void 0)return i;if((i=a.get(r))!==void 0)return l(r,i),i},set(r,i){s.has(r)?s.set(r,i):l(r,i)}}}const $0="!";function tv(n){const e=n.separator,s=e.length===1,a=e[0],l=e.length;return function(i){const c=[];let o=0,u=0,d;for(let b=0;bu?d-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:j,maybePostfixModifierPosition:y}}}function sv(n){if(n.length<=1)return n;const e=[];let s=[];return n.forEach(a=>{a[0]==="["?(e.push(...s.sort(),a),s=[]):s.push(a)}),e.push(...s.sort()),e}function av(n){return{cache:nv(n.cacheSize),splitModifiers:tv(n),...Wj(n)}}const lv=/\s+/;function rv(n,e){const{splitModifiers:s,getClassGroupId:a,getConflictingClassGroupIds:l}=e,r=new Set;return n.trim().split(lv).map(i=>{const{modifiers:c,hasImportantModifier:o,baseClassName:u,maybePostfixModifierPosition:d}=s(i);let m=a(d?u.substring(0,d):u),p=!!d;if(!m){if(!d)return{isTailwindClass:!1,originalClassName:i};if(m=a(u),!m)return{isTailwindClass:!1,originalClassName:i};p=!1}const j=sv(c).join(":");return{isTailwindClass:!0,modifierId:o?j+$0:j,classGroupId:m,originalClassName:i,hasPostfixModifier:p}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:c,classGroupId:o,hasPostfixModifier:u}=i,d=c+o;return r.has(d)?!1:(r.add(d),l(o,u).forEach(m=>r.add(c+m)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function iv(){let n=0,e,s,a="";for(;nm(d),n());return s=av(u),a=s.cache.get,l=s.cache.set,r=c,c(o)}function c(o){const u=a(o);if(u)return u;const d=rv(o,s);return l(o,d),d}return function(){return r(iv.apply(null,arguments))}}function ce(n){const e=s=>s[n]||[];return e.isThemeGetter=!0,e}const D0=/^\[(?:([a-z-]+):)?(.+)\]$/i,ov=/^\d+\/\d+$/,uv=new Set(["px","full","screen"]),dv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Zn(n){return Gt(n)||uv.has(n)||ov.test(n)}function ot(n){return ra(n,"length",Sv)}function Gt(n){return!!n&&!Number.isNaN(Number(n))}function Hl(n){return ra(n,"number",Gt)}function xa(n){return!!n&&Number.isInteger(Number(n))}function xv(n){return n.endsWith("%")&&Gt(n.slice(0,-1))}function z(n){return D0.test(n)}function ut(n){return dv.test(n)}const gv=new Set(["length","size","percentage"]);function jv(n){return ra(n,gv,O0)}function vv(n){return ra(n,"position",O0)}const bv=new Set(["image","url"]);function yv(n){return ra(n,bv,_v)}function Nv(n){return ra(n,"",wv)}function ga(){return!0}function ra(n,e,s){const a=D0.exec(n);return a?a[1]?typeof e=="string"?a[1]===e:e.has(a[1]):s(a[2]):!1}function Sv(n){return mv.test(n)&&!pv.test(n)}function O0(){return!1}function wv(n){return fv.test(n)}function _v(n){return hv.test(n)}function kv(){const n=ce("colors"),e=ce("spacing"),s=ce("blur"),a=ce("brightness"),l=ce("borderColor"),r=ce("borderRadius"),i=ce("borderSpacing"),c=ce("borderWidth"),o=ce("contrast"),u=ce("grayscale"),d=ce("hueRotate"),m=ce("invert"),p=ce("gap"),j=ce("gradientColorStops"),y=ce("gradientColorStopPositions"),b=ce("inset"),N=ce("margin"),x=ce("opacity"),h=ce("padding"),g=ce("saturate"),v=ce("scale"),_=ce("sepia"),k=ce("skew"),R=ce("space"),E=ce("translate"),Y=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",z,e],U=()=>[z,e],tn=()=>["",Zn,ot],Ue=()=>["auto",Gt,z],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",z],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ae=()=>[Gt,Hl],He=()=>[Gt,z];return{cacheSize:500,separator:":",theme:{colors:[ga],spacing:[Zn,ot],blur:["none","",ut,z],brightness:Ae(),borderColor:[n],borderRadius:["none","","full",ut,z],borderSpacing:U(),borderWidth:tn(),contrast:Ae(),grayscale:V(),hueRotate:He(),invert:V(),gap:U(),gradientColorStops:[n],gradientColorStopPositions:[xv,ot],inset:ie(),margin:ie(),opacity:Ae(),padding:U(),saturate:Ae(),scale:Ae(),sepia:V(),skew:He(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[ut]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),z]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xa,z]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",xa,z]}],"grid-cols":[{"grid-cols":[ga]}],"col-start-end":[{col:["auto",{span:["full",xa,z]},z]}],"col-start":[{"col-start":Ue()}],"col-end":[{"col-end":Ue()}],"grid-rows":[{"grid-rows":[ga]}],"row-start-end":[{row:["auto",{span:[xa,z]},z]}],"row-start":[{"row-start":Ue()}],"row-end":[{"row-end":Ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,e]}],"min-w":[{"min-w":[z,e,"min","max","fit"]}],"max-w":[{"max-w":[z,e,"none","full","min","max","fit","prose",{screen:[ut]},ut]}],h:[{h:[z,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ut,ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hl]}],"font-family":[{font:[ga]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z]}],"line-clamp":[{"line-clamp":["none",Gt,Hl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zn,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zn,ot]}],"underline-offset":[{"underline-offset":["auto",Zn,z]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),vv]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yv]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[j]}],"gradient-via":[{via:[j]}],"gradient-to":[{to:[j]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:C()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[Zn,z]}],"outline-w":[{outline:[Zn,ot]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:tn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Zn,ot]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",ut,Nv]}],"shadow-color":[{shadow:[ga]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[a]}],contrast:[{contrast:[o]}],"drop-shadow":[{"drop-shadow":["","none",ut,z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[m]}],saturate:[{saturate:[g]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[o]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:He()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:He()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[xa,z]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Zn,ot,Hl]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Ke=cv(kv);function Cn(n){const{children:e,className:s="",end:a=!0,activeName:l,to:r,onClick:i,...c}=n,o=cu(r);let u=Nj({path:o.pathname,end:a});const d=Ke(ae(s,"transition cursor-pointer",{[l]:!!u}));function m(p){u&&p.preventDefault(),i&&i(p)}return t.jsx(E0,{className:d,to:r,...c,onClick:m,children:e})}const Cv="_modal_fd6cp_1",Rv="_show_fd6cp_1",Mv="_hide_fd6cp_1",Ev="_out_fd6cp_16",Yi={modal:Cv,show:Rv,hide:Mv,in:"_in_fd6cp_12",out:Ev};function ti(n){const{onClose:e,children:s,ref:a}=n,[l,r]=f.useState(!1),[i,c]=f.useState(!1);f.useImperativeHandle(a,()=>({show:()=>{r(!0),document.body.style.overflow="hidden",c(!0)},close:()=>{document.body.style.overflow="visible",r(!1)}}));const o=ae(Yi.modal,{[Yi.in]:l,[Yi.out]:!l});function u(){l||c(!1)}function d(){r(!1),e&&e()}return i?t.jsx(t.Fragment,{children:cl.createPortal(t.jsx("div",{className:o,onAnimationEnd:u,onClick:d,children:s}),document.body)}):null}function Av(){return t.jsx("div",{className:"w-10 h-10 ml-4 border rounded-full overflow-hidden relative",children:t.jsx("div",{className:"pyramid-loader",children:t.jsxs("div",{className:"wrapper",children:[t.jsx("span",{className:"side side1"}),t.jsx("span",{className:"side side2"}),t.jsx("span",{className:"side side3"}),t.jsx("span",{className:"side side4"}),t.jsx("span",{className:"shadow"})]})})})}function Tv(){const[n,e]=f.useState(!0),[s,a]=f.useState({});return f.useEffect(()=>{function l(r){if(r.origin!=="https://giscus.app")return;e(!1);let i=r.data.giscus;i.viewer&&a(i.viewer)}window.addEventListener("message",l,!1)},[]),n?t.jsx(Av,{}):t.jsx("div",{className:"w-10 h-10 ml-4 border rounded-full overflow-hidden",children:t.jsx("img",{className:"w-full h-full",src:s.avatarUrl,alt:""})})}document.documentElement.style.fontSize="14px";function le(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,ghost:o,rect:u,disabled:d,...m}=n,b=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative text-gray-600","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"bg-transparent border-transparent hover:bg-gray-100":o,"bg-opacity-70":d,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r,"w-8 h-8 p-0":u},e));return t.jsxs("button",{className:b,...m,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}let Ha;const $v=n=>{Ha={x:n.pageX,y:n.pageY},setTimeout(()=>{Ha=null},100)};document.documentElement.addEventListener("click",$v,!0);function Lv(n,e){var s=n.style;["Webkit","Moz","Ms","ms"].forEach(function(a){s[a+"TransformOrigin"]=e}),s.transformOrigin=e}function Dv(n){const e=n.getBoundingClientRect(),s={left:e.left,top:e.top},l=n.ownerDocument.defaultView;return s.left+=am(l),s.top+=am(l,1),s}function am(n,e){var s=n["page"+(e?"Y":"X")+"Offset"],a="scroll"+(e?"Top":"Left");if(typeof s!="number"){var l=n.document;s=l.documentElement[a],typeof s!="number"&&(s=l.body[a])}return s}function ia(n){const{title:e,onClose:s,children:a,onSure:l,onCancel:r,ref:i,footer:c}=n,[o,u]=f.useState(!1),[d,m]=f.useState(!1),p=f.useRef(null),j=f.useRef(null);f.useImperativeHandle(i,()=>({show:()=>{j.current.show(),document.body.style.overflow="hidden",u(!0),m(!0)},close:y}));function y(){u(!1),j.current.close(),document.body.style.overflow="visible"}function b(){y(),s&&s()}function N(v){v.stopPropagation()}function x(v){v.stopPropagation(),l&&l()}function h(){o||m(!1)}const g=ae("dialog-wrapper",{in:o,out:!o});return f.useEffect(()=>{const v=p.current;if(d&&v){const _=Dv(v);Ha&&Lv(v,Ha.x-_.left+"px "+(Ha.y-_.top)+"px")}},[d]),t.jsx(ti,{ref:j,onClose:b,children:d?t.jsxs("div",{ref:p,className:g,onClick:N,onAnimationEnd:h,children:[t.jsxs("header",{className:"flex justify-between items-center mb-2",children:[t.jsx("div",{className:"font-bold text-lg leading-6",children:e}),t.jsx("div",{onClick:b,className:"p-2 rounded-md cursor-pointer transition hover:bg-gray-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),t.jsx("section",{className:"leading-6",children:a}),c||t.jsx("footer",{className:"text-end mt-4",children:t.jsx(le,{primary:!0,onClick:x,children:"确认"})})]}):null})}function Ov(){const n=f.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs(t.Fragment,{children:[t.jsxs(Cn,{className:"flex items-center",onClick:e,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"})}),t.jsx("div",{className:"ml-1 text-sm",children:"交流群"})]}),t.jsxs(ia,{ref:n,title:"Message",onSure:()=>n.current.close(),children:["添加我的微信:",t.jsx("span",{className:"text-red-500 text-xl",children:"icanmeetu"}),", 注明:添加 react19 付费交流群"]})]})}function yn(n){const{type:e="text",className:s,required:a,label:l,help:r="此项规则不匹配",pattern:i,...c}=n,{pending:o}=cl.useFormStatus(),u=ae("flex items-center my-10",s);return t.jsxs("div",{className:u,children:[l&&t.jsxs("label",{className:"w-20 text-right font-bold",children:[l,":"]}),t.jsx("div",{className:"input flex-1",children:t.jsx("input",{type:e,required:a,pattern:i,...c,disabled:o})})]})}function Bv(){const n=f.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs(t.Fragment,{children:[t.jsxs(Cn,{className:"flex items-center ml-4 bg-gray-900 px-4 py-2 rounded-full",to:"/",onClick:e,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5 text-blue-50",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),t.jsx("div",{className:"ml-1 text-sm text-blue-50",children:"激活码"})]}),t.jsxs(ia,{ref:n,title:"Message",onSure:()=>n.current.close(),children:["请添加交流群获得激活码,或者联系网站开发者这波能反杀获得激活码,联系方式如下",t.jsxs("div",{className:"flex my-4",children:[t.jsx("div",{className:"w-8",children:"wx:"}),t.jsx("div",{className:"text-red-500",children:"icanmeetu"})]})]})]})}const lm=[{path:"tutorial",text:"教程"},{path:"component",text:"组件"},{path:"other",text:"其他"}];function zv(){const n=f.useRef(null);return t.jsxs("header",{className:"fixed z-50 top-0 flex justify-between border-b border-slate-200 min-w-[320px] bg-white bg-opacity-70 backdrop-blur-sm w-full",children:[t.jsxs("div",{className:"pl-6 h-16 flex items-center md:pl-10 transition-all",children:[t.jsxs(Cn,{className:"flex items-center",to:"/",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"font-bold ml-2",children:"React 19"})]}),t.jsx("div",{className:"hidden md:block",children:lm.map((e,s)=>t.jsx(Cn,{to:e.path,className:"ml-8 text-gray-500",end:!1,activeName:"text-gray-900",children:e.text},e.path))}),t.jsxs("a",{className:"hidden md:flex text-xs m-8 rounded-full bg-red-100 py-2 px-4 text-red-400 transition hover:bg-red-300 hover:text-red-700 cursor-pointer",href:"https://appxw863qeq2150.h5.xiaoeknow.com/p/decorate/homepage?entry=2&entry_type=2002&share_user_id=u_626bf7dfafe72_zLCXc4Qr0O&wework_share_customer_id=u_626bf7dfafe72_zLCXc4Qr0O",target:"_blank",children:["推荐:JavaScript 核心进阶",t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4 ml-2",children:t.jsx("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"})})]})]}),t.jsxs("div",{className:"hidden md:flex h-16 items-center pr-6 text-gray-500",children:[t.jsx(Ov,{alt:"交流群"}),t.jsx(Bv,{alt:"激活码"}),t.jsx(Tv,{})]}),t.jsx("div",{className:"md:hidden flex items-center pr-6 text-gray-700",onClick:()=>n.current.show(),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25"})})}),t.jsxs(ti,{ref:n,onClose:()=>n.current.close(),children:[t.jsxs("header",{className:"sticky top-0 flex justify-between border-b border-amber-50 bg-amber-50",children:[t.jsx("div",{className:"pl-6 h-16 flex items-center md:pl-10 transition-all",children:t.jsxs(Cn,{className:"flex items-center",to:"/",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"font-bold ml-2",children:"React 19"})]})}),t.jsx("div",{className:"flex h-16 items-center pr-6 text-gray-500",children:t.jsx("div",{className:"flex items-center text-gray-700",onClick:()=>n.current.show(),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-6",children:t.jsx("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})})]}),lm.map((e,s)=>t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:e.path,children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5",children:t.jsx("path",{fillRule:"evenodd",d:"M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"})}),t.jsx("div",{className:"ml-2 text-sm",children:e.text})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})},e.path)),t.jsx("div",{className:"flex items-center text-red-500 bg-red-50 px-8 py-5 transition hover:text-red-700 hover:bg-red-200",children:t.jsxs("a",{className:"flex items-center justify-between w-full",href:"https://appxw863qeq2150.h5.xiaoeknow.com/p/decorate/homepage?entry=2&entry_type=2002&share_user_id=u_626bf7dfafe72_zLCXc4Qr0O&wework_share_customer_id=u_626bf7dfafe72_zLCXc4Qr0O",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5",children:t.jsx("path",{fillRule:"evenodd",d:"M10.5 3.798v5.02a3 3 0 0 1-.879 2.121l-2.377 2.377a9.845 9.845 0 0 1 5.091 1.013 8.315 8.315 0 0 0 5.713.636l.285-.071-3.954-3.955a3 3 0 0 1-.879-2.121v-5.02a23.614 23.614 0 0 0-3 0Zm4.5.138a.75.75 0 0 0 .093-1.495A24.837 24.837 0 0 0 12 2.25a25.048 25.048 0 0 0-3.093.191A.75.75 0 0 0 9 3.936v4.882a1.5 1.5 0 0 1-.44 1.06l-6.293 6.294c-1.62 1.621-.903 4.475 1.471 4.88 2.686.46 5.447.698 8.262.698 2.816 0 5.576-.239 8.262-.697 2.373-.406 3.092-3.26 1.47-4.881L15.44 9.879A1.5 1.5 0 0 1 15 8.818V3.936Z",clipRule:"evenodd"})}),t.jsx("div",{className:"ml-2 text-sm",children:"推荐:JavaScript 核心进阶"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})}),t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:"/",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"交流群"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})}),t.jsx("div",{className:"flex items-center text-gray-700 bg-white px-8 py-5 transition hover:bg-amber-100",children:t.jsxs(Cn,{className:"flex items-center justify-between w-full",to:"/",children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"激活码"})]}),t.jsx("div",{children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-4",children:t.jsx("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})})]})})]})]})}function Uv(){const[n,e]=f.useState(""),s=`relative ${n} bg-skin-fill overflow-hidden rounded`;return t.jsxs("div",{className:"my-8 border border-gray-150 rounded px-8 pb-8",children:[t.jsxs("div",{className:"flex justify-center",children:[t.jsx("div",{onClick:()=>e(""),className:"my-6 mx-2 h-6 w-6 rounded bg-indigo-500 cursor-pointer"}),t.jsx("div",{onClick:()=>e("theme-swiss"),className:"my-6 mx-2 h-6 w-6 rounded bg-red-600 cursor-pointer"}),t.jsx("div",{onClick:()=>e("theme-neon"),className:"my-6 mx-2 h-6 w-6 rounded bg-green-400 cursor-pointer"})]}),t.jsxs("div",{className:s,children:[t.jsx("img",{className:"absolute inset-0 h-full w-full object-cover opacity-30",src:"https://images.unsplash.com/photo-1602576666092-bf6447a729fc?q=80&w=3732&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",alt:""}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-skin-hue via-skin-hue to-transparent opacity-90 transition"}),t.jsxs("div",{className:"relative max-w-2xl mx-auto text-center py-16 px-8",children:[t.jsx("h2",{className:"font-extrabold text-skin-base text-4xl transition",children:t.jsx("span",{children:"极客时间、掘金买课优惠"})}),t.jsx("p",{className:"mt-4 text-md text-left text-skin-muted transition",children:"官方的课程返现全部归还,需要从网站 coursesub.top 或者公众号「课程减减」通过邀请链接进行下单,购买后添加客服微信发送课程名确认后即可收到红包,可正常使用极客时间的优惠券或者学生半价优惠。"}),t.jsx("div",{className:"mt-10 max-w-sm mx-auto sm:max-w-one sm:flex sm:justify-center",children:t.jsxs("div",{className:"space-y-0 mx-auto inline-grid grid-cols-2 gap-5",children:[t.jsx("a",{target:"_blank",className:"transition text-skin-inverted bg-skin-button-accent hover:bg-skin-button-accent-hover flex items-center justify-center py-3 border border-transparent text-base font-medium rounded-md shadow-lg px-8",href:"https://coursesub.top/?key=react",children:"去选课"}),t.jsx("a",{target:"_blank",className:"transition text-skin-base bg-skin-button-muted hover:bg-opacity-70 flex items-center justify-center py-3 border border-transparent text-base font-medium rounded-lg shadow-sm px-8",href:"https://mp.weixin.qq.com/s?__biz=MzUyMjkwNTgwOA==&mid=2247485923&idx=1&sn=0710d33fd1e1287e10f88bd4139e0a0e&chksm=f9c5f85cceb2714a585567f21751ae703f8ba80519a7a089746079a05c4f916c962fe81332d1#rd",children:"详细规则"})]})})]})]})]})}function Hv(){return t.jsx("div",{className:"fixed top-0 inset-0 -z-10 mx-0 max-w-none overflow-hidden",children:t.jsxs("div",{className:"absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem] dark:[mask-image:linear-gradient(white,transparent)]",children:[t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#36b49f] to-[#DBFF75] opacity-40 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)] dark:from-[#36b49f]/30 dark:to-[#DBFF75]/30 dark:opacity-100",children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-50%] h-[200%] w-full skew-y-[-18deg] fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":S1:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"-12",y:"4",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:S1:)"}),t.jsxs("svg",{x:"-12",y:"4",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"288",y:"168"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"144",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"504",y:"168"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"720",y:"336"})]})]})}),t.jsx("svg",{viewBox:"0 0 1113 440","aria-hidden":"true",className:"absolute left-1/2 top-0 ml-[-19rem] w-[69.5625rem] fill-white blur-[26px] dark:hidden",children:t.jsx("path",{d:"M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z"})})]})})}function Qi({title:n,desc:e="",path:s,icon:a,className:l}){const[r,i]=f.useState({x:0,y:0}),c=f.useRef(null),o=unescape(n.replace(/\\u/gi,"%u")),u=unescape(e.replace(/\\u/gi,"%u"));f.useEffect(()=>{const j=c.current.getBoundingClientRect();function y(b){i({x:b.x-j.left,y:b.y+document.documentElement.scrollTop-j.top})}c.current.addEventListener("mouseenter",b=>{document.addEventListener("mousemove",y,!1)},!1),c.current.addEventListener("mouseleave",b=>{document.removeEventListener("mousemove",y,!1)},!1)},[]);const d=`radial-gradient(180px at ${r.x}px ${r.y}px, white, transparent)`,p=ae("group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5",l);return t.jsxs("div",{ref:c,className:p,children:[t.jsxs("div",{className:"pointer-events-none",children:[t.jsx("div",{className:"absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50",children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":Rkq5jsqja:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"50%",y:"16",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:Rkq5jsqja:)"}),t.jsxs("svg",{x:"50%",y:"16",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"0",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"72",y:"168"})]})]})}),t.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-[#D7EDEA] to-[#F4FBDF] opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]",style:{maskImage:d}}),t.jsx("div",{className:"absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100",style:{maskImage:d},children:t.jsxs("svg",{"aria-hidden":"true",className:"absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10",children:[t.jsx("defs",{children:t.jsx("pattern",{id:":R5kq5jsqja:",width:"72",height:"56",patternUnits:"userSpaceOnUse",x:"50%",y:"16",children:t.jsx("path",{d:"M.5 56V.5H72",fill:"none"})})}),t.jsx("rect",{width:"100%",height:"100%",strokeWidth:"0",fill:"url(#:R5kq5jsqja:)"}),t.jsxs("svg",{x:"50%",y:"16",className:"overflow-visible",children:[t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"0",y:"56"}),t.jsx("rect",{strokeWidth:"0",width:"73",height:"57",x:"72",y:"168"})]})]})})]}),t.jsx("div",{className:"absolute inset-0 rounded-2xl ring-1 ring-gray-200 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20"}),t.jsxs("div",{className:"relative rounded-2xl px-4 pb-4 pt-16",children:[t.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-emerald-300/10 dark:group-hover:ring-emerald-400",children:t.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",className:"h-5 w-5 fill-zinc-700/10 stroke-zinc-700 transition-colors duration-300 group-hover:stroke-zinc-900 dark:fill-white/10 dark:stroke-zinc-400 dark:group-hover:fill-emerald-300/10 dark:group-hover:stroke-emerald-400",children:[t.jsx("path",{strokeWidth:"0",fillRule:"evenodd",clipRule:"evenodd",d:"M10 .5a9.5 9.5 0 0 1 5.598 17.177C14.466 15.177 12.383 13.5 10 13.5s-4.466 1.677-5.598 4.177A9.5 9.5 0 0 1 10 .5ZM12.5 8a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"}),t.jsx("path",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",d:"M10 .5a9.5 9.5 0 0 1 5.598 17.177A9.458 9.458 0 0 1 10 19.5a9.458 9.458 0 0 1-5.598-1.823A9.5 9.5 0 0 1 10 .5Z"}),t.jsx("path",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",d:"M4.402 17.677C5.534 15.177 7.617 13.5 10 13.5s4.466 1.677 5.598 4.177M10 5.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z"})]})}),t.jsx("h3",{className:"mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white",children:t.jsxs("a",{href:s,children:[t.jsx("span",{className:"absolute inset-0 rounded-2xl"}),o]})}),t.jsx("p",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:u})]})]})}function ql(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:i,...c}=n,m=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...c,children:n.children})}function qv(){return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"min-w-[400px] mx-auto px-16 h-[300px] flex flex-col justify-center",children:[t.jsx("div",{className:"my-2",children:t.jsx("div",{className:"font-bold",children:"按钮类型"})}),t.jsxs("div",{className:"flex items-center justify-between my-4",children:[t.jsx(ql,{children:"Normal"}),t.jsx(ql,{danger:!0,children:"Danger"}),t.jsx(ql,{primary:!0,children:"Primary"}),t.jsx(ql,{success:!0,children:"Success"})]})]})})}const Vv=`import Button from './Button.jsx' export default function ButtonCase() { return ( @@ -91,7 +91,7 @@ export default function ButtonCase() { ) } -`,gl=`import {twMerge} from 'tailwind-merge' +`,jl=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -135,15 +135,15 @@ export default function Button(props) { ) } -`;function wj(n,e){if(n==null)return{};var s={};for(var a in n)if({}.hasOwnProperty.call(n,a)){if(e.indexOf(a)>=0)continue;s[a]=n[a]}return s}function _j(n,e){if(n==null)return{};var s,a,l=wj(n,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(a=0;a=0||{}.propertyIsEnumerable.call(n,s)&&(l[s]=n[s])}return l}function Pi(n,e){(e==null||e>n.length)&&(e=n.length);for(var s=0,a=Array(e);s=4)return[n[0],n[1],n[2],n[3],"".concat(n[0],".").concat(n[1]),"".concat(n[0],".").concat(n[2]),"".concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[0]),"".concat(n[1],".").concat(n[2]),"".concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[0]),"".concat(n[2],".").concat(n[1]),"".concat(n[2],".").concat(n[3]),"".concat(n[3],".").concat(n[0]),"".concat(n[3],".").concat(n[1]),"".concat(n[3],".").concat(n[2]),"".concat(n[0],".").concat(n[1],".").concat(n[2]),"".concat(n[0],".").concat(n[1],".").concat(n[3]),"".concat(n[0],".").concat(n[2],".").concat(n[1]),"".concat(n[0],".").concat(n[2],".").concat(n[3]),"".concat(n[0],".").concat(n[3],".").concat(n[1]),"".concat(n[0],".").concat(n[3],".").concat(n[2]),"".concat(n[1],".").concat(n[0],".").concat(n[2]),"".concat(n[1],".").concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[2],".").concat(n[0]),"".concat(n[1],".").concat(n[2],".").concat(n[3]),"".concat(n[1],".").concat(n[3],".").concat(n[0]),"".concat(n[1],".").concat(n[3],".").concat(n[2]),"".concat(n[2],".").concat(n[0],".").concat(n[1]),"".concat(n[2],".").concat(n[0],".").concat(n[3]),"".concat(n[2],".").concat(n[1],".").concat(n[0]),"".concat(n[2],".").concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[3],".").concat(n[0]),"".concat(n[2],".").concat(n[3],".").concat(n[1]),"".concat(n[3],".").concat(n[0],".").concat(n[1]),"".concat(n[3],".").concat(n[0],".").concat(n[2]),"".concat(n[3],".").concat(n[1],".").concat(n[0]),"".concat(n[3],".").concat(n[1],".").concat(n[2]),"".concat(n[3],".").concat(n[2],".").concat(n[0]),"".concat(n[3],".").concat(n[2],".").concat(n[1]),"".concat(n[0],".").concat(n[1],".").concat(n[2],".").concat(n[3]),"".concat(n[0],".").concat(n[1],".").concat(n[3],".").concat(n[2]),"".concat(n[0],".").concat(n[2],".").concat(n[1],".").concat(n[3]),"".concat(n[0],".").concat(n[2],".").concat(n[3],".").concat(n[1]),"".concat(n[0],".").concat(n[3],".").concat(n[1],".").concat(n[2]),"".concat(n[0],".").concat(n[3],".").concat(n[2],".").concat(n[1]),"".concat(n[1],".").concat(n[0],".").concat(n[2],".").concat(n[3]),"".concat(n[1],".").concat(n[0],".").concat(n[3],".").concat(n[2]),"".concat(n[1],".").concat(n[2],".").concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[2],".").concat(n[3],".").concat(n[0]),"".concat(n[1],".").concat(n[3],".").concat(n[0],".").concat(n[2]),"".concat(n[1],".").concat(n[3],".").concat(n[2],".").concat(n[0]),"".concat(n[2],".").concat(n[0],".").concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[0],".").concat(n[3],".").concat(n[1]),"".concat(n[2],".").concat(n[1],".").concat(n[0],".").concat(n[3]),"".concat(n[2],".").concat(n[1],".").concat(n[3],".").concat(n[0]),"".concat(n[2],".").concat(n[3],".").concat(n[0],".").concat(n[1]),"".concat(n[2],".").concat(n[3],".").concat(n[1],".").concat(n[0]),"".concat(n[3],".").concat(n[0],".").concat(n[1],".").concat(n[2]),"".concat(n[3],".").concat(n[0],".").concat(n[2],".").concat(n[1]),"".concat(n[3],".").concat(n[1],".").concat(n[0],".").concat(n[2]),"".concat(n[3],".").concat(n[1],".").concat(n[2],".").concat(n[0]),"".concat(n[3],".").concat(n[2],".").concat(n[0],".").concat(n[1]),"".concat(n[3],".").concat(n[2],".").concat(n[1],".").concat(n[0])]}var Qc={};function Dj(n){if(n.length===0||n.length===1)return n;var e=n.join(".");return Qc[e]||(Qc[e]=$j(n)),Qc[e]}function Lj(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,a=n.filter(function(r){return r!=="token"}),l=Dj(a);return l.reduce(function(r,c){return Rs(Rs({},r),s[c])},e)}function cm(n){return n.join(" ")}function Bj(n,e){var s=0;return function(a){return s+=1,a.map(function(l,r){return T0({node:l,stylesheet:n,useInlineStyles:e,key:"code-segment-".concat(s,"-").concat(r)})})}}function T0(n){var e=n.node,s=n.stylesheet,a=n.style,l=a===void 0?{}:a,r=n.useInlineStyles,c=n.key,i=e.properties,o=e.type,d=e.tagName,u=e.value;if(o==="text")return u;if(d){var m=Bj(s,r),p;if(!r)p=Rs(Rs({},i),{},{className:cm(i.className)});else{var g=Object.keys(s).reduce(function(x,f){return f.split(".").forEach(function(v){x.includes(v)||x.push(v)}),x},[]),y=i.className&&i.className.includes("token")?["token"]:[],b=i.className&&y.concat(i.className.filter(function(x){return!g.includes(x)}));p=Rs(Rs({},i),{},{className:cm(b)||void 0,style:Lj(i.className,Object.assign({},i.style,l),s)})}var N=m(e.children);return Zn.createElement(d,Fi({key:c},p),N)}}const Oj=function(n,e){var s=n.listLanguages();return s.indexOf(e)!==-1};var zj=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function im(n,e){var s=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),s.push.apply(s,a)}return s}function Rn(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a2&&arguments[2]!==void 0?arguments[2]:[];return nr({children:_,lineNumber:k,lineNumberStyle:i,largestLineNumber:c,showInlineLineNumbers:l,lineProps:s,className:R,showLineNumbers:a,wrapLongLines:o})}function b(_,k){if(a&&k&&l){var R=D0(i,k,c);_.unshift($0(k,R))}return _}function N(_,k){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return e||R.length>0?y(_,k,R):b(_,k)}for(var x=function(){var k=u[g],R=k.children[0].value,M=Hj(R);if(M){var Y=R.split(` -`);Y.forEach(function(B,ce){var U=a&&m.length+r,tn={type:"text",value:"".concat(B,` -`)};if(ce===0){var Ue=u.slice(p+1,g).concat(nr({children:[tn],className:k.properties.className})),ge=N(Ue,U);m.push(ge)}else if(ce===Y.length-1){var C=u[g+1]&&u[g+1].children&&u[g+1].children[0],L={type:"text",value:"".concat(B)};if(C){var $=nr({children:[L],className:k.properties.className});u.splice(g+1,0,$)}else{var V=[L],J=N(V,U,k.properties.className);m.push(J)}}else{var Ae=[tn],He=N(Ae,U,k.properties.className);m.push(He)}}),p=g}g++};g/g,">").replace(/"/g,""").replace(/'/g,"'")}function yt(n,...e){const s=Object.create(null);for(const a in n)s[a]=n[a];return e.forEach(function(a){for(const l in a)s[l]=a[l]}),s}const Kj="",um=n=>!!n.kind;class Wj{constructor(e,s){this.buffer="",this.classPrefix=s.classPrefix,e.walk(this)}addText(e){this.buffer+=zs(e)}openNode(e){if(!um(e))return;let s=e.kind;e.sublanguage||(s=`${this.classPrefix}${s}`),this.span(s)}closeNode(e){um(e)&&(this.buffer+=Kj)}value(){return this.buffer}span(e){this.buffer+=``}}class du{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const s={kind:e,children:[]};this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,s){return typeof s=="string"?e.addText(s):s.children&&(e.openNode(s),s.children.forEach(a=>this._walk(e,a)),e.closeNode(s)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(s=>typeof s=="string")?e.children=[e.children.join("")]:e.children.forEach(s=>{du._collapse(s)}))}}class Pj extends du{constructor(e){super(),this.options=e}addKeyword(e,s){e!==""&&(this.openNode(s),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,s){const a=e.root;a.kind=s,a.sublanguage=!0,this.add(a)}toHTML(){return new Wj(this,this.options).value()}finalize(){return!0}}function Fj(n){return new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function al(n){return n?typeof n=="string"?n:n.source:null}function Ij(...n){return n.map(s=>al(s)).join("")}function eb(...n){return"("+n.map(s=>al(s)).join("|")+")"}function nb(n){return new RegExp(n.toString()+"|").exec("").length-1}function tb(n,e){const s=n&&n.exec(e);return s&&s.index===0}const sb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ab(n,e="|"){let s=0;return n.map(a=>{s+=1;const l=s;let r=al(a),c="";for(;r.length>0;){const i=sb.exec(r);if(!i){c+=r;break}c+=r.substring(0,i.index),r=r.substring(i.index+i[0].length),i[0][0]==="\\"&&i[1]?c+="\\"+String(Number(i[1])+l):(c+=i[0],i[0]==="("&&s++)}return c}).map(a=>`(${a})`).join(e)}const lb=/\b\B/,z0="[a-zA-Z]\\w*",mu="[a-zA-Z_]\\w*",pu="\\b\\d+(\\.\\d+)?",U0="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",H0="\\b(0b[01]+)",rb="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cb=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=Ij(e,/.*\b/,n.binary,/\b.*/)),yt({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(s,a)=>{s.index!==0&&a.ignoreMatch()}},n)},ll={begin:"\\\\[\\s\\S]",relevance:0},ib={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[ll]},ob={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[ll]},q0={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},tc=function(n,e,s={}){const a=yt({className:"comment",begin:n,end:e,contains:[]},s);return a.contains.push(q0),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},ub=tc("//","$"),db=tc("/\\*","\\*/"),mb=tc("#","$"),pb={className:"number",begin:pu,relevance:0},fb={className:"number",begin:U0,relevance:0},hb={className:"number",begin:H0,relevance:0},xb={className:"number",begin:pu+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},gb={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[ll,{begin:/\[/,end:/\]/,relevance:0,contains:[ll]}]}]},vb={className:"title",begin:z0,relevance:0},jb={className:"title",begin:mu,relevance:0},bb={begin:"\\.\\s*"+mu,relevance:0},yb=function(n){return Object.assign(n,{"on:begin":(e,s)=>{s.data._beginMatch=e[1]},"on:end":(e,s)=>{s.data._beginMatch!==e[1]&&s.ignoreMatch()}})};var ql=Object.freeze({__proto__:null,MATCH_NOTHING_RE:lb,IDENT_RE:z0,UNDERSCORE_IDENT_RE:mu,NUMBER_RE:pu,C_NUMBER_RE:U0,BINARY_NUMBER_RE:H0,RE_STARTERS_RE:rb,SHEBANG:cb,BACKSLASH_ESCAPE:ll,APOS_STRING_MODE:ib,QUOTE_STRING_MODE:ob,PHRASAL_WORDS_MODE:q0,COMMENT:tc,C_LINE_COMMENT_MODE:ub,C_BLOCK_COMMENT_MODE:db,HASH_COMMENT_MODE:mb,NUMBER_MODE:pb,C_NUMBER_MODE:fb,BINARY_NUMBER_MODE:hb,CSS_NUMBER_MODE:xb,REGEXP_MODE:gb,TITLE_MODE:vb,UNDERSCORE_TITLE_MODE:jb,METHOD_GUARD:bb,END_SAME_AS_BEGIN:yb});function Nb(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function Sb(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=Nb,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function wb(n,e){Array.isArray(n.illegal)&&(n.illegal=eb(...n.illegal))}function _b(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function kb(n,e){n.relevance===void 0&&(n.relevance=1)}const Cb=["of","and","for","in","not","or","if","then","parent","list","value"],Rb="keyword";function V0(n,e,s=Rb){const a={};return typeof n=="string"?l(s,n.split(" ")):Array.isArray(n)?l(s,n):Object.keys(n).forEach(function(r){Object.assign(a,V0(n[r],e,r))}),a;function l(r,c){e&&(c=c.map(i=>i.toLowerCase())),c.forEach(function(i){const o=i.split("|");a[o[0]]=[r,Eb(o[0],o[1])]})}}function Eb(n,e){return e?Number(e):Mb(n)?0:1}function Mb(n){return Cb.includes(n.toLowerCase())}function Ab(n,{plugins:e}){function s(i,o){return new RegExp(al(i),"m"+(n.case_insensitive?"i":"")+(o?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,o]),this.matchAt+=nb(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(d=>d[1]);this.matcherRe=s(ab(o),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(o);if(!d)return null;const u=d.findIndex((p,g)=>g>0&&p!==void 0),m=this.matchIndexes[u];return d.splice(0,u),Object.assign(d,m)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const d=new a;return this.rules.slice(o).forEach(([u,m])=>d.addRule(u,m)),d.compile(),this.multiRegexes[o]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,d){this.rules.push([o,d]),d.type==="begin"&&this.count++}exec(o){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let u=d.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const m=this.getMatcher(0);m.lastIndex=this.lastIndex+1,u=m.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){const o=new l;return i.contains.forEach(d=>o.addRule(d.begin,{rule:d,type:"begin"})),i.terminatorEnd&&o.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&o.addRule(i.illegal,{type:"illegal"}),o}function c(i,o){const d=i;if(i.isCompiled)return d;[_b].forEach(m=>m(i,o)),n.compilerExtensions.forEach(m=>m(i,o)),i.__beforeBegin=null,[Sb,wb,kb].forEach(m=>m(i,o)),i.isCompiled=!0;let u=null;if(typeof i.keywords=="object"&&(u=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=V0(i.keywords,n.case_insensitive)),i.lexemes&&u)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return u=u||i.lexemes||/\w+/,d.keywordPatternRe=s(u,!0),o&&(i.begin||(i.begin=/\B|\b/),d.beginRe=s(i.begin),i.endSameAsBegin&&(i.end=i.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(d.endRe=s(i.end)),d.terminatorEnd=al(i.end)||"",i.endsWithParent&&o.terminatorEnd&&(d.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(d.illegalRe=s(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(m){return Tb(m==="self"?i:m)})),i.contains.forEach(function(m){c(m,d)}),i.starts&&c(i.starts,o),d.matcher=r(d),d}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=yt(n.classNameAliases||{}),c(n)}function X0(n){return n?n.endsWithParent||X0(n.starts):!1}function Tb(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return yt(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:X0(n)?yt(n,{starts:n.starts?yt(n.starts):null}):Object.isFrozen(n)?yt(n):n}var $b="10.7.3";function Db(n){return!!(n||n==="")}function Lb(n){const e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!n.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,zs(this.code);let a={};return this.autoDetect?(a=n.highlightAuto(this.code),this.detectedLanguage=a.language):(a=n.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),a.value},autoDetect(){return!this.language||Db(this.autodetect)},ignoreIllegals(){return!0}},render(a){return a("pre",{},[a("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:e,VuePlugin:{install(a){a.component("highlightjs",e)}}}}const Bb={"after:highlightElement":({el:n,result:e,text:s})=>{const a=dm(n);if(!a.length)return;const l=document.createElement("div");l.innerHTML=e.value,e.value=Ob(a,dm(l),s)}};function Ii(n){return n.nodeName.toLowerCase()}function dm(n){const e=[];return function s(a,l){for(let r=a.firstChild;r;r=r.nextSibling)r.nodeType===3?l+=r.nodeValue.length:r.nodeType===1&&(e.push({event:"start",offset:l,node:r}),l=s(r,l),Ii(r).match(/br|hr|img|input/)||e.push({event:"stop",offset:l,node:r}));return l}(n,0),e}function Ob(n,e,s){let a=0,l="";const r=[];function c(){return!n.length||!e.length?n.length?n:e:n[0].offset!==e[0].offset?n[0].offset"}function o(u){l+=""}function d(u){(u.event==="start"?i:o)(u.node)}for(;n.length||e.length;){let u=c();if(l+=zs(s.substring(a,u[0].offset)),a=u[0].offset,u===n){r.reverse().forEach(o);do d(u.splice(0,1)[0]),u=c();while(u===n&&u.length&&u[0].offset===a);r.reverse().forEach(i)}else u[0].event==="start"?r.push(u[0].node):r.pop(),d(u.splice(0,1)[0])}return l+zs(s.substr(a))}const mm={},Jc=n=>{console.error(n)},pm=(n,...e)=>{console.log(`WARN: ${n}`,...e)},sn=(n,e)=>{mm[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),mm[`${n}/${e}`]=!0)},Kc=zs,fm=yt,hm=Symbol("nomatch"),zb=function(n){const e=Object.create(null),s=Object.create(null),a=[];let l=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,c="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let o={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:Pj};function d(w){return o.noHighlightRe.test(w)}function u(w){let E=w.className+" ";E+=w.parentNode?w.parentNode.className:"";const O=o.languageDetectRe.exec(E);if(O){const W=ge(O[1]);return W||(pm(c.replace("{}",O[1])),pm("Falling back to no-highlight mode for this block.",w)),W?O[1]:"no-highlight"}return E.split(/\s+/).find(W=>d(W)||ge(W))}function m(w,E,O,W){let be="",Un="";typeof E=="object"?(be=w,O=E.ignoreIllegals,Un=E.language,W=void 0):(sn("10.7.0","highlight(lang, code, ...args) has been deprecated."),sn("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),Un=w,be=E);const wn={code:be,language:Un};J("before:highlight",wn);const _n=wn.result?wn.result:p(wn.language,wn.code,O,W);return _n.code=wn.code,J("after:highlight",_n),_n}function p(w,E,O,W){function be(A,D){const G=os.case_insensitive?D[0].toLowerCase():D[0];return Object.prototype.hasOwnProperty.call(A.keywords,G)&&A.keywords[G]}function Un(){if(!X.keywords){qe.addText(ye);return}let A=0;X.keywordPatternRe.lastIndex=0;let D=X.keywordPatternRe.exec(ye),G="";for(;D;){G+=ye.substring(A,D.index);const ee=be(X,D);if(ee){const[Qe,bl]=ee;if(qe.addText(G),G="",jl+=bl,Qe.startsWith("_"))G+=D[0];else{const Mx=os.classNameAliases[Qe]||Qe;qe.addKeyword(D[0],Mx)}}else G+=D[0];A=X.keywordPatternRe.lastIndex,D=X.keywordPatternRe.exec(ye)}G+=ye.substr(A),qe.addText(G)}function wn(){if(ye==="")return;let A=null;if(typeof X.subLanguage=="string"){if(!e[X.subLanguage]){qe.addText(ye);return}A=p(X.subLanguage,ye,!0,Mu[X.subLanguage]),Mu[X.subLanguage]=A.top}else A=y(ye,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(jl+=A.relevance),qe.addSublanguage(A.emitter,A.language)}function _n(){X.subLanguage!=null?wn():Un(),ye=""}function kn(A){return A.className&&qe.openNode(os.classNameAliases[A.className]||A.className),X=Object.create(A,{parent:{value:X}}),X}function rt(A,D,G){let ee=tb(A.endRe,G);if(ee){if(A["on:end"]){const Qe=new om(A);A["on:end"](D,Qe),Qe.isMatchIgnored&&(ee=!1)}if(ee){for(;A.endsParent&&A.parent;)A=A.parent;return A}}if(A.endsWithParent)return rt(A.parent,D,G)}function _x(A){return X.matcher.regexIndex===0?(ye+=A[0],1):(cc=!0,0)}function kx(A){const D=A[0],G=A.rule,ee=new om(G),Qe=[G.__beforeBegin,G["on:begin"]];for(const bl of Qe)if(bl&&(bl(A,ee),ee.isMatchIgnored))return _x(D);return G&&G.endSameAsBegin&&(G.endRe=Fj(D)),G.skip?ye+=D:(G.excludeBegin&&(ye+=D),_n(),!G.returnBegin&&!G.excludeBegin&&(ye=D)),kn(G),G.returnBegin?0:D.length}function Cx(A){const D=A[0],G=E.substr(A.index),ee=rt(X,A,G);if(!ee)return hm;const Qe=X;Qe.skip?ye+=D:(Qe.returnEnd||Qe.excludeEnd||(ye+=D),_n(),Qe.excludeEnd&&(ye=D));do X.className&&qe.closeNode(),!X.skip&&!X.subLanguage&&(jl+=X.relevance),X=X.parent;while(X!==ee.parent);return ee.starts&&(ee.endSameAsBegin&&(ee.starts.endRe=ee.endRe),kn(ee.starts)),Qe.returnEnd?0:D.length}function Rx(){const A=[];for(let D=X;D!==os;D=D.parent)D.className&&A.unshift(D.className);A.forEach(D=>qe.openNode(D))}let vl={};function Eu(A,D){const G=D&&D[0];if(ye+=A,G==null)return _n(),0;if(vl.type==="begin"&&D.type==="end"&&vl.index===D.index&&G===""){if(ye+=E.slice(D.index,D.index+1),!l){const ee=new Error("0 width match regex");throw ee.languageName=w,ee.badRule=vl.rule,ee}return 1}if(vl=D,D.type==="begin")return kx(D);if(D.type==="illegal"&&!O){const ee=new Error('Illegal lexeme "'+G+'" for mode "'+(X.className||"")+'"');throw ee.mode=X,ee}else if(D.type==="end"){const ee=Cx(D);if(ee!==hm)return ee}if(D.type==="illegal"&&G==="")return 1;if(rc>1e5&&rc>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=G,G.length}const os=ge(w);if(!os)throw Jc(c.replace("{}",w)),new Error('Unknown language: "'+w+'"');const Ex=Ab(os,{plugins:a});let lc="",X=W||Ex;const Mu={},qe=new o.__emitter(o);Rx();let ye="",jl=0,us=0,rc=0,cc=!1;try{for(X.matcher.considerAll();;){rc++,cc?cc=!1:X.matcher.considerAll(),X.matcher.lastIndex=us;const A=X.matcher.exec(E);if(!A)break;const D=E.substring(us,A.index),G=Eu(D,A);us=A.index+G}return Eu(E.substr(us)),qe.closeAllNodes(),qe.finalize(),lc=qe.toHTML(),{relevance:Math.floor(jl),value:lc,language:w,illegal:!1,emitter:qe,top:X}}catch(A){if(A.message&&A.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:A.message,context:E.slice(us-100,us+100),mode:A.mode},sofar:lc,relevance:0,value:Kc(E),emitter:qe};if(l)return{illegal:!1,relevance:0,value:Kc(E),emitter:qe,language:w,top:X,errorRaised:A};throw A}}function g(w){const E={relevance:0,emitter:new o.__emitter(o),value:Kc(w),illegal:!1,top:i};return E.emitter.addText(w),E}function y(w,E){E=E||o.languages||Object.keys(e);const O=g(w),W=E.filter(ge).filter(L).map(kn=>p(kn,w,!1));W.unshift(O);const be=W.sort((kn,rt)=>{if(kn.relevance!==rt.relevance)return rt.relevance-kn.relevance;if(kn.language&&rt.language){if(ge(kn.language).supersetOf===rt.language)return 1;if(ge(rt.language).supersetOf===kn.language)return-1}return 0}),[Un,wn]=be,_n=Un;return _n.second_best=wn,_n}function b(w){return o.tabReplace||o.useBR?w.replace(r,E=>E===` -`?o.useBR?"
":E:o.tabReplace?E.replace(/\t/g,o.tabReplace):E):w}function N(w,E,O){const W=E?s[E]:O;w.classList.add("hljs"),W&&w.classList.add(W)}const x={"before:highlightElement":({el:w})=>{o.useBR&&(w.innerHTML=w.innerHTML.replace(/\n/g,"").replace(//g,` -`))},"after:highlightElement":({result:w})=>{o.useBR&&(w.value=w.value.replace(/\n/g,"
"))}},f=/^(<[^>]+>|\t)+/gm,v={"after:highlightElement":({result:w})=>{o.tabReplace&&(w.value=w.value.replace(f,E=>E.replace(/\t/g,o.tabReplace)))}};function j(w){let E=null;const O=u(w);if(d(O))return;J("before:highlightElement",{el:w,language:O}),E=w;const W=E.textContent,be=O?m(W,{language:O,ignoreIllegals:!0}):y(W);J("after:highlightElement",{el:w,result:be,text:W}),w.innerHTML=be.value,N(w,O,be.language),w.result={language:be.language,re:be.relevance,relavance:be.relevance},be.second_best&&(w.second_best={language:be.second_best.language,re:be.second_best.relevance,relavance:be.second_best.relevance})}function _(w){w.useBR&&(sn("10.3.0","'useBR' will be removed entirely in v11.0"),sn("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),o=fm(o,w)}const k=()=>{if(k.called)return;k.called=!0,sn("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(j)};function R(){sn("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),M=!0}let M=!1;function Y(){if(document.readyState==="loading"){M=!0;return}document.querySelectorAll("pre code").forEach(j)}function B(){M&&Y()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function ce(w,E){let O=null;try{O=E(n)}catch(W){if(Jc("Language definition for '{}' could not be registered.".replace("{}",w)),l)Jc(W);else throw W;O=i}O.name||(O.name=w),e[w]=O,O.rawDefinition=E.bind(null,n),O.aliases&&C(O.aliases,{languageName:w})}function U(w){delete e[w];for(const E of Object.keys(s))s[E]===w&&delete s[E]}function tn(){return Object.keys(e)}function Ue(w){sn("10.4.0","requireLanguage will be removed entirely in v11."),sn("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const E=ge(w);if(E)return E;throw new Error("The '{}' language is required, but not loaded.".replace("{}",w))}function ge(w){return w=(w||"").toLowerCase(),e[w]||e[s[w]]}function C(w,{languageName:E}){typeof w=="string"&&(w=[w]),w.forEach(O=>{s[O.toLowerCase()]=E})}function L(w){const E=ge(w);return E&&!E.disableAutodetect}function $(w){w["before:highlightBlock"]&&!w["before:highlightElement"]&&(w["before:highlightElement"]=E=>{w["before:highlightBlock"](Object.assign({block:E.el},E))}),w["after:highlightBlock"]&&!w["after:highlightElement"]&&(w["after:highlightElement"]=E=>{w["after:highlightBlock"](Object.assign({block:E.el},E))})}function V(w){$(w),a.push(w)}function J(w,E){const O=w;a.forEach(function(W){W[O]&&W[O](E)})}function Ae(w){return sn("10.2.0","fixMarkup will be removed entirely in v11.0"),sn("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),b(w)}function He(w){return sn("10.7.0","highlightBlock will be removed entirely in v12.0"),sn("10.7.0","Please use highlightElement now."),j(w)}Object.assign(n,{highlight:m,highlightAuto:y,highlightAll:Y,fixMarkup:Ae,highlightElement:j,highlightBlock:He,configure:_,initHighlighting:k,initHighlightingOnLoad:R,registerLanguage:ce,unregisterLanguage:U,listLanguages:tn,getLanguage:ge,registerAliases:C,requireLanguage:Ue,autoDetection:L,inherit:fm,addPlugin:V,vuePlugin:Lb(n).VuePlugin}),n.debugMode=function(){l=!1},n.safeMode=function(){l=!0},n.versionString=$b;for(const w in ql)typeof ql[w]=="object"&&O0(ql[w]);return Object.assign(n,ql),n.addPlugin(x),n.addPlugin(Bb),n.addPlugin(v),n};var Ub=zb({}),Hb=Ub,G0={exports:{}};(function(n){(function(){var e;e=n.exports=l,e.format=l,e.vsprintf=a,typeof console<"u"&&typeof console.log=="function"&&(e.printf=s);function s(){console.log(l.apply(null,arguments))}function a(r,c){return l.apply(null,[r].concat(c))}function l(r){for(var c=1,i=[].slice.call(arguments),o=0,d=r.length,u="",m,p=!1,g,y,b=!1,N,x=function(){return i[c++]},f=function(){for(var v="";/\d/.test(r[o]);)v+=r[o++],m=r[o];return v.length>0?parseInt(v):null};oi.relevance&&(i=o),o.relevance>c.relevance&&(i=c,c=o));return i.language&&(c.secondBest=i),c}function Yb(n,e){Mn.registerLanguage(n,e)}function Qb(){return Mn.listLanguages()}function Jb(n,e){var s=n,a;e&&(s={},s[n]=e);for(a in s)Mn.registerAliases(s[a],{languageName:a})}function lt(n){this.options=n,this.rootNode={children:[]},this.stack=[this.rootNode]}function Kb(n,e){this.openNode(e),this.addText(n),this.closeNode()}function Wb(n,e){var s=this.stack,a=s[s.length-1],l=n.rootNode.children,r=e?{type:"element",tagName:"span",properties:{className:[e]},children:l}:l;a.children=a.children.concat(r)}function Pb(n){var e=this.stack,s,a;n!==""&&(s=e[e.length-1],a=s.children[s.children.length-1],a&&a.type==="text"?a.value+=n:s.children.push({type:"text",value:n}))}function Fb(n){var e=this.stack,s=this.options.classPrefix+n,a=e[e.length-1],l={type:"element",tagName:"span",properties:{className:[s]},children:[]};a.children.push(l),e.push(l)}function Ib(){this.stack.pop()}function e5(){return""}function Y0(){}const xm="[A-Za-z$_][0-9A-Za-z$_]*",n5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],t5=["true","false","null","undefined","NaN","Infinity"],s5=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],a5=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],r5=["arguments","this","super","console","window","document","localStorage","module","global"],c5=[].concat(l5,r5,s5,a5);function i5(n){return n?typeof n=="string"?n:n.source:null}function gm(n){return eo("(?=",n,")")}function eo(...n){return n.map(s=>i5(s)).join("")}function o5(n){const e=(j,{after:_})=>{const k="",end:""},l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(j,_)=>{const k=j[0].length+j.index,R=j.input[k];if(R==="<"){_.ignoreMatch();return}R===">"&&(e(j,{after:k})||_.ignoreMatch())}},r={$pattern:xm,keyword:n5,literal:t5,built_in:c5},c="[0-9](_?[0-9])*",i=`\\.(${c})`,o="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${o})((${i})|\\.)?|(${i}))[eE][+-]?(${c})\\b`},{begin:`\\b(${o})\\b((${i})\\b|\\.)?|(${i})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,u],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,u]},b={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,m,p,g,d,n.REGEXP_MODE];u.contains=N.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(N)});const x=[].concat(b,u.contains),f=x.concat([{begin:/\(/,end:/\)/,keywords:r,contains:["self"].concat(x)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:f};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:f},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,m,p,g,b,d,{begin:eo(/[{,\n]\s*/,gm(eo(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,s+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:s+gm("\\s*:"),relevance:0}]},{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[b,n.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:f}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:a.begin,end:a.end},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:r,contains:["self",n.inherit(n.TITLE_MODE,{begin:s}),v],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[v,n.inherit(n.TITLE_MODE,{begin:s})]},{variants:[{begin:"\\."+s},{begin:"\\$"+s}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},n.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[n.inherit(n.TITLE_MODE,{begin:s}),"self",v]},{begin:"(get|set)\\s+(?="+s+"\\()",end:/\{/,keywords:"get set",contains:[n.inherit(n.TITLE_MODE,{begin:s}),{begin:/\(\)/},v]},{begin:/\$[(.]/}]}}var u5=o5;const fu=so(u5),d5="modulepreload",m5=function(n){return"/"+n},vm={},p5=function(e,s,a){let l=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.all(s.map(i=>{if(i=m5(i),i in vm)return;vm[i]=!0;const o=i.endsWith(".css"),d=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${d}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":d5,o||(u.as="script",u.crossOrigin=""),u.href=i,c&&u.setAttribute("nonce",c),document.head.appendChild(u),o)return new Promise((m,p)=>{u.addEventListener("load",m),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${i}`)))})}))}return l.then(()=>e()).catch(r=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r})};var Bt=Qj(is,{});Bt.registerLanguage=is.registerLanguage;var Wc,jm;function f5(){if(jm)return Wc;jm=1,Wc=n,n.displayName="jsx",n.aliases=[];function n(e){(function(s){var a=s.util.clone(s.languages.javascript),l=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,c=/(?:\{*\.{3}(?:[^{}]|)*\})/.source;function i(u,m){return u=u.replace(//g,function(){return l}).replace(//g,function(){return r}).replace(//g,function(){return c}),RegExp(u,m)}c=i(c).source,s.languages.jsx=s.languages.extend("markup",a),s.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),s.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,s.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,s.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,s.languages.jsx.tag.inside.comment=a.comment,s.languages.insertBefore("inside","attr-name",{spread:{pattern:i(//.source),inside:s.languages.jsx}},s.languages.jsx.tag),s.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:s.languages.jsx}}},s.languages.jsx.tag);var o=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(o).join(""):""},d=function(u){for(var m=[],p=0;p0&&m[m.length-1].tagName===o(g.content[0].content[1])&&m.pop():g.content[g.content.length-1].content==="/>"||m.push({tagName:o(g.content[0].content[1]),openedBraces:0}):m.length>0&&g.type==="punctuation"&&g.content==="{"?m[m.length-1].openedBraces++:m.length>0&&m[m.length-1].openedBraces>0&&g.type==="punctuation"&&g.content==="}"?m[m.length-1].openedBraces--:y=!0),(y||typeof g=="string")&&m.length>0&&m[m.length-1].openedBraces===0){var b=o(g);p0&&(typeof u[p-1]=="string"||u[p-1].type==="plain-text")&&(b=o(u[p-1])+b,u.splice(p-1,1),p--),u[p]=new s.Token("plain-text",b,null,b)}g.content&&typeof g.content!="string"&&d(g.content)}};s.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||d(u.tokens)})})(e)}return Wc}var h5=f5();const x5=so(h5),hu={hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:"#383a42",background:"#fafafa"},"hljs-comment":{color:"#a0a1a7",fontStyle:"italic"},"hljs-quote":{color:"#a0a1a7",fontStyle:"italic"},"hljs-doctag":{color:"#a626a4"},"hljs-keyword":{color:"#a626a4"},"hljs-formula":{color:"#a626a4"},"hljs-section":{color:"#e45649"},"hljs-name":{color:"#e45649"},"hljs-selector-tag":{color:"#e45649"},"hljs-deletion":{color:"#e45649"},"hljs-subst":{color:"#e45649"},"hljs-literal":{color:"#0184bb"},"hljs-string":{color:"#50a14f"},"hljs-regexp":{color:"#50a14f"},"hljs-addition":{color:"#50a14f"},"hljs-attribute":{color:"#50a14f"},"hljs-meta-string":{color:"#50a14f"},"hljs-built_in":{color:"#c18401"},"hljs-class .hljs-title":{color:"#c18401"},"hljs-attr":{color:"#986801"},"hljs-variable":{color:"#986801"},"hljs-template-variable":{color:"#986801"},"hljs-type":{color:"#986801"},"hljs-selector-class":{color:"#986801"},"hljs-selector-attr":{color:"#986801"},"hljs-selector-pseudo":{color:"#986801"},"hljs-number":{color:"#986801"},"hljs-symbol":{color:"#4078f2"},"hljs-bullet":{color:"#4078f2"},"hljs-link":{color:"#4078f2",textDecoration:"underline"},"hljs-meta":{color:"#4078f2"},"hljs-selector-id":{color:"#4078f2"},"hljs-title":{color:"#4078f2"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},g5=`import Button from 'components/Button' +`;function Xv(n,e){if(n==null)return{};var s={};for(var a in n)if({}.hasOwnProperty.call(n,a)){if(e.indexOf(a)>=0)continue;s[a]=n[a]}return s}function Gv(n,e){if(n==null)return{};var s,a,l=Xv(n,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(a=0;a=0||{}.propertyIsEnumerable.call(n,s)&&(l[s]=n[s])}return l}function Kc(n,e){(e==null||e>n.length)&&(e=n.length);for(var s=0,a=Array(e);s=4)return[n[0],n[1],n[2],n[3],"".concat(n[0],".").concat(n[1]),"".concat(n[0],".").concat(n[2]),"".concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[0]),"".concat(n[1],".").concat(n[2]),"".concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[0]),"".concat(n[2],".").concat(n[1]),"".concat(n[2],".").concat(n[3]),"".concat(n[3],".").concat(n[0]),"".concat(n[3],".").concat(n[1]),"".concat(n[3],".").concat(n[2]),"".concat(n[0],".").concat(n[1],".").concat(n[2]),"".concat(n[0],".").concat(n[1],".").concat(n[3]),"".concat(n[0],".").concat(n[2],".").concat(n[1]),"".concat(n[0],".").concat(n[2],".").concat(n[3]),"".concat(n[0],".").concat(n[3],".").concat(n[1]),"".concat(n[0],".").concat(n[3],".").concat(n[2]),"".concat(n[1],".").concat(n[0],".").concat(n[2]),"".concat(n[1],".").concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[2],".").concat(n[0]),"".concat(n[1],".").concat(n[2],".").concat(n[3]),"".concat(n[1],".").concat(n[3],".").concat(n[0]),"".concat(n[1],".").concat(n[3],".").concat(n[2]),"".concat(n[2],".").concat(n[0],".").concat(n[1]),"".concat(n[2],".").concat(n[0],".").concat(n[3]),"".concat(n[2],".").concat(n[1],".").concat(n[0]),"".concat(n[2],".").concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[3],".").concat(n[0]),"".concat(n[2],".").concat(n[3],".").concat(n[1]),"".concat(n[3],".").concat(n[0],".").concat(n[1]),"".concat(n[3],".").concat(n[0],".").concat(n[2]),"".concat(n[3],".").concat(n[1],".").concat(n[0]),"".concat(n[3],".").concat(n[1],".").concat(n[2]),"".concat(n[3],".").concat(n[2],".").concat(n[0]),"".concat(n[3],".").concat(n[2],".").concat(n[1]),"".concat(n[0],".").concat(n[1],".").concat(n[2],".").concat(n[3]),"".concat(n[0],".").concat(n[1],".").concat(n[3],".").concat(n[2]),"".concat(n[0],".").concat(n[2],".").concat(n[1],".").concat(n[3]),"".concat(n[0],".").concat(n[2],".").concat(n[3],".").concat(n[1]),"".concat(n[0],".").concat(n[3],".").concat(n[1],".").concat(n[2]),"".concat(n[0],".").concat(n[3],".").concat(n[2],".").concat(n[1]),"".concat(n[1],".").concat(n[0],".").concat(n[2],".").concat(n[3]),"".concat(n[1],".").concat(n[0],".").concat(n[3],".").concat(n[2]),"".concat(n[1],".").concat(n[2],".").concat(n[0],".").concat(n[3]),"".concat(n[1],".").concat(n[2],".").concat(n[3],".").concat(n[0]),"".concat(n[1],".").concat(n[3],".").concat(n[0],".").concat(n[2]),"".concat(n[1],".").concat(n[3],".").concat(n[2],".").concat(n[0]),"".concat(n[2],".").concat(n[0],".").concat(n[1],".").concat(n[3]),"".concat(n[2],".").concat(n[0],".").concat(n[3],".").concat(n[1]),"".concat(n[2],".").concat(n[1],".").concat(n[0],".").concat(n[3]),"".concat(n[2],".").concat(n[1],".").concat(n[3],".").concat(n[0]),"".concat(n[2],".").concat(n[3],".").concat(n[0],".").concat(n[1]),"".concat(n[2],".").concat(n[3],".").concat(n[1],".").concat(n[0]),"".concat(n[3],".").concat(n[0],".").concat(n[1],".").concat(n[2]),"".concat(n[3],".").concat(n[0],".").concat(n[2],".").concat(n[1]),"".concat(n[3],".").concat(n[1],".").concat(n[0],".").concat(n[2]),"".concat(n[3],".").concat(n[1],".").concat(n[2],".").concat(n[0]),"".concat(n[3],".").concat(n[2],".").concat(n[0],".").concat(n[1]),"".concat(n[3],".").concat(n[2],".").concat(n[1],".").concat(n[0])]}var Ji={};function Fv(n){if(n.length===0||n.length===1)return n;var e=n.join(".");return Ji[e]||(Ji[e]=Iv(n)),Ji[e]}function eb(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,a=n.filter(function(r){return r!=="token"}),l=Fv(a);return l.reduce(function(r,i){return Ms(Ms({},r),s[i])},e)}function im(n){return n.join(" ")}function nb(n,e){var s=0;return function(a){return s+=1,a.map(function(l,r){return z0({node:l,stylesheet:n,useInlineStyles:e,key:"code-segment-".concat(s,"-").concat(r)})})}}function z0(n){var e=n.node,s=n.stylesheet,a=n.style,l=a===void 0?{}:a,r=n.useInlineStyles,i=n.key,c=e.properties,o=e.type,u=e.tagName,d=e.value;if(o==="text")return d;if(u){var m=nb(s,r),p;if(!r)p=Ms(Ms({},c),{},{className:im(c.className)});else{var j=Object.keys(s).reduce(function(x,h){return h.split(".").forEach(function(g){x.includes(g)||x.push(g)}),x},[]),y=c.className&&c.className.includes("token")?["token"]:[],b=c.className&&y.concat(c.className.filter(function(x){return!j.includes(x)}));p=Ms(Ms({},c),{},{className:im(b)||void 0,style:eb(c.className,Object.assign({},c.style,l),s)})}var N=m(e.children);return Yn.createElement(u,Ic({key:i},p),N)}}const tb=function(n,e){var s=n.listLanguages();return s.indexOf(e)!==-1};var sb=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function cm(n,e){var s=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),s.push.apply(s,a)}return s}function Rn(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a2&&arguments[2]!==void 0?arguments[2]:[];return tr({children:_,lineNumber:k,lineNumberStyle:c,largestLineNumber:i,showInlineLineNumbers:l,lineProps:s,className:R,showLineNumbers:a,wrapLongLines:o})}function b(_,k){if(a&&k&&l){var R=H0(c,k,i);_.unshift(U0(k,R))}return _}function N(_,k){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return e||R.length>0?y(_,k,R):b(_,k)}for(var x=function(){var k=d[j],R=k.children[0].value,E=lb(R);if(E){var Y=R.split(` +`);Y.forEach(function(O,ie){var U=a&&m.length+r,tn={type:"text",value:"".concat(O,` +`)};if(ie===0){var Ue=d.slice(p+1,j).concat(tr({children:[tn],className:k.properties.className})),ge=N(Ue,U);m.push(ge)}else if(ie===Y.length-1){var C=d[j+1]&&d[j+1].children&&d[j+1].children[0],D={type:"text",value:"".concat(O)};if(C){var $=tr({children:[D],className:k.properties.className});d.splice(j+1,0,$)}else{var V=[D],J=N(V,U,k.properties.className);m.push(J)}}else{var Ae=[tn],He=N(Ae,U,k.properties.className);m.push(He)}}),p=j}j++};j/g,">").replace(/"/g,""").replace(/'/g,"'")}function St(n,...e){const s=Object.create(null);for(const a in n)s[a]=n[a];return e.forEach(function(a){for(const l in a)s[l]=a[l]}),s}const fb="
",um=n=>!!n.kind;class hb{constructor(e,s){this.buffer="",this.classPrefix=s.classPrefix,e.walk(this)}addText(e){this.buffer+=Us(e)}openNode(e){if(!um(e))return;let s=e.kind;e.sublanguage||(s=`${this.classPrefix}${s}`),this.span(s)}closeNode(e){um(e)&&(this.buffer+=fb)}value(){return this.buffer}span(e){this.buffer+=``}}class du{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const s={kind:e,children:[]};this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,s){return typeof s=="string"?e.addText(s):s.children&&(e.openNode(s),s.children.forEach(a=>this._walk(e,a)),e.closeNode(s)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(s=>typeof s=="string")?e.children=[e.children.join("")]:e.children.forEach(s=>{du._collapse(s)}))}}class xb extends du{constructor(e){super(),this.options=e}addKeyword(e,s){e!==""&&(this.openNode(s),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,s){const a=e.root;a.kind=s,a.sublanguage=!0,this.add(a)}toHTML(){return new hb(this,this.options).value()}finalize(){return!0}}function gb(n){return new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function ll(n){return n?typeof n=="string"?n:n.source:null}function jb(...n){return n.map(s=>ll(s)).join("")}function vb(...n){return"("+n.map(s=>ll(s)).join("|")+")"}function bb(n){return new RegExp(n.toString()+"|").exec("").length-1}function yb(n,e){const s=n&&n.exec(e);return s&&s.index===0}const Nb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Sb(n,e="|"){let s=0;return n.map(a=>{s+=1;const l=s;let r=ll(a),i="";for(;r.length>0;){const c=Nb.exec(r);if(!c){i+=r;break}i+=r.substring(0,c.index),r=r.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?i+="\\"+String(Number(c[1])+l):(i+=c[0],c[0]==="("&&s++)}return i}).map(a=>`(${a})`).join(e)}const wb=/\b\B/,G0="[a-zA-Z]\\w*",mu="[a-zA-Z_]\\w*",pu="\\b\\d+(\\.\\d+)?",Z0="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y0="\\b(0b[01]+)",_b="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",kb=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=jb(e,/.*\b/,n.binary,/\b.*/)),St({className:"meta",begin:e,end:/$/,relevance:0,"on:begin":(s,a)=>{s.index!==0&&a.ignoreMatch()}},n)},rl={begin:"\\\\[\\s\\S]",relevance:0},Cb={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[rl]},Rb={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[rl]},Q0={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},si=function(n,e,s={}){const a=St({className:"comment",begin:n,end:e,contains:[]},s);return a.contains.push(Q0),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},Mb=si("//","$"),Eb=si("/\\*","\\*/"),Ab=si("#","$"),Tb={className:"number",begin:pu,relevance:0},$b={className:"number",begin:Z0,relevance:0},Lb={className:"number",begin:Y0,relevance:0},Db={className:"number",begin:pu+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},Ob={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[rl,{begin:/\[/,end:/\]/,relevance:0,contains:[rl]}]}]},Bb={className:"title",begin:G0,relevance:0},zb={className:"title",begin:mu,relevance:0},Ub={begin:"\\.\\s*"+mu,relevance:0},Hb=function(n){return Object.assign(n,{"on:begin":(e,s)=>{s.data._beginMatch=e[1]},"on:end":(e,s)=>{s.data._beginMatch!==e[1]&&s.ignoreMatch()}})};var Vl=Object.freeze({__proto__:null,MATCH_NOTHING_RE:wb,IDENT_RE:G0,UNDERSCORE_IDENT_RE:mu,NUMBER_RE:pu,C_NUMBER_RE:Z0,BINARY_NUMBER_RE:Y0,RE_STARTERS_RE:_b,SHEBANG:kb,BACKSLASH_ESCAPE:rl,APOS_STRING_MODE:Cb,QUOTE_STRING_MODE:Rb,PHRASAL_WORDS_MODE:Q0,COMMENT:si,C_LINE_COMMENT_MODE:Mb,C_BLOCK_COMMENT_MODE:Eb,HASH_COMMENT_MODE:Ab,NUMBER_MODE:Tb,C_NUMBER_MODE:$b,BINARY_NUMBER_MODE:Lb,CSS_NUMBER_MODE:Db,REGEXP_MODE:Ob,TITLE_MODE:Bb,UNDERSCORE_TITLE_MODE:zb,METHOD_GUARD:Ub,END_SAME_AS_BEGIN:Hb});function qb(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function Vb(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=qb,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function Xb(n,e){Array.isArray(n.illegal)&&(n.illegal=vb(...n.illegal))}function Gb(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function Zb(n,e){n.relevance===void 0&&(n.relevance=1)}const Yb=["of","and","for","in","not","or","if","then","parent","list","value"],Qb="keyword";function J0(n,e,s=Qb){const a={};return typeof n=="string"?l(s,n.split(" ")):Array.isArray(n)?l(s,n):Object.keys(n).forEach(function(r){Object.assign(a,J0(n[r],e,r))}),a;function l(r,i){e&&(i=i.map(c=>c.toLowerCase())),i.forEach(function(c){const o=c.split("|");a[o[0]]=[r,Jb(o[0],o[1])]})}}function Jb(n,e){return e?Number(e):Pb(n)?0:1}function Pb(n){return Yb.includes(n.toLowerCase())}function Wb(n,{plugins:e}){function s(c,o){return new RegExp(ll(c),"m"+(n.case_insensitive?"i":"")+(o?"g":""))}class a{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,o]),this.matchAt+=bb(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(u=>u[1]);this.matcherRe=s(Sb(o),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(o);if(!u)return null;const d=u.findIndex((p,j)=>j>0&&p!==void 0),m=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,m)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const u=new a;return this.rules.slice(o).forEach(([d,m])=>u.addRule(d,m)),u.compile(),this.multiRegexes[o]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,u){this.rules.push([o,u]),u.type==="begin"&&this.count++}exec(o){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(o);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const m=this.getMatcher(0);m.lastIndex=this.lastIndex+1,d=m.exec(o)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function r(c){const o=new l;return c.contains.forEach(u=>o.addRule(u.begin,{rule:u,type:"begin"})),c.terminatorEnd&&o.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&o.addRule(c.illegal,{type:"illegal"}),o}function i(c,o){const u=c;if(c.isCompiled)return u;[Gb].forEach(m=>m(c,o)),n.compilerExtensions.forEach(m=>m(c,o)),c.__beforeBegin=null,[Vb,Xb,Zb].forEach(m=>m(c,o)),c.isCompiled=!0;let d=null;if(typeof c.keywords=="object"&&(d=c.keywords.$pattern,delete c.keywords.$pattern),c.keywords&&(c.keywords=J0(c.keywords,n.case_insensitive)),c.lexemes&&d)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return d=d||c.lexemes||/\w+/,u.keywordPatternRe=s(d,!0),o&&(c.begin||(c.begin=/\B|\b/),u.beginRe=s(c.begin),c.endSameAsBegin&&(c.end=c.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(u.endRe=s(c.end)),u.terminatorEnd=ll(c.end)||"",c.endsWithParent&&o.terminatorEnd&&(u.terminatorEnd+=(c.end?"|":"")+o.terminatorEnd)),c.illegal&&(u.illegalRe=s(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(m){return Kb(m==="self"?c:m)})),c.contains.forEach(function(m){i(m,u)}),c.starts&&i(c.starts,o),u.matcher=r(u),u}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=St(n.classNameAliases||{}),i(n)}function P0(n){return n?n.endsWithParent||P0(n.starts):!1}function Kb(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return St(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:P0(n)?St(n,{starts:n.starts?St(n.starts):null}):Object.isFrozen(n)?St(n):n}var Ib="10.7.3";function Fb(n){return!!(n||n==="")}function e5(n){const e={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!n.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,Us(this.code);let a={};return this.autoDetect?(a=n.highlightAuto(this.code),this.detectedLanguage=a.language):(a=n.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),a.value},autoDetect(){return!this.language||Fb(this.autodetect)},ignoreIllegals(){return!0}},render(a){return a("pre",{},[a("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:e,VuePlugin:{install(a){a.component("highlightjs",e)}}}}const n5={"after:highlightElement":({el:n,result:e,text:s})=>{const a=dm(n);if(!a.length)return;const l=document.createElement("div");l.innerHTML=e.value,e.value=t5(a,dm(l),s)}};function Fc(n){return n.nodeName.toLowerCase()}function dm(n){const e=[];return function s(a,l){for(let r=a.firstChild;r;r=r.nextSibling)r.nodeType===3?l+=r.nodeValue.length:r.nodeType===1&&(e.push({event:"start",offset:l,node:r}),l=s(r,l),Fc(r).match(/br|hr|img|input/)||e.push({event:"stop",offset:l,node:r}));return l}(n,0),e}function t5(n,e,s){let a=0,l="";const r=[];function i(){return!n.length||!e.length?n.length?n:e:n[0].offset!==e[0].offset?n[0].offset"}function o(d){l+=""}function u(d){(d.event==="start"?c:o)(d.node)}for(;n.length||e.length;){let d=i();if(l+=Us(s.substring(a,d[0].offset)),a=d[0].offset,d===n){r.reverse().forEach(o);do u(d.splice(0,1)[0]),d=i();while(d===n&&d.length&&d[0].offset===a);r.reverse().forEach(c)}else d[0].event==="start"?r.push(d[0].node):r.pop(),u(d.splice(0,1)[0])}return l+Us(s.substr(a))}const mm={},Pi=n=>{console.error(n)},pm=(n,...e)=>{console.log(`WARN: ${n}`,...e)},sn=(n,e)=>{mm[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),mm[`${n}/${e}`]=!0)},Wi=Us,fm=St,hm=Symbol("nomatch"),s5=function(n){const e=Object.create(null),s=Object.create(null),a=[];let l=!0;const r=/(^(<[^>]+>|\t|)+|\n)/gm,i="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let o={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:xb};function u(w){return o.noHighlightRe.test(w)}function d(w){let M=w.className+" ";M+=w.parentNode?w.parentNode.className:"";const B=o.languageDetectRe.exec(M);if(B){const K=ge(B[1]);return K||(pm(i.replace("{}",B[1])),pm("Falling back to no-highlight mode for this block.",w)),K?B[1]:"no-highlight"}return M.split(/\s+/).find(K=>u(K)||ge(K))}function m(w,M,B,K){let be="",Hn="";typeof M=="object"?(be=w,B=M.ignoreIllegals,Hn=M.language,K=void 0):(sn("10.7.0","highlight(lang, code, ...args) has been deprecated."),sn("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),Hn=w,be=M);const wn={code:be,language:Hn};J("before:highlight",wn);const _n=wn.result?wn.result:p(wn.language,wn.code,B,K);return _n.code=wn.code,J("after:highlight",_n),_n}function p(w,M,B,K){function be(T,L){const G=us.case_insensitive?L[0].toLowerCase():L[0];return Object.prototype.hasOwnProperty.call(T.keywords,G)&&T.keywords[G]}function Hn(){if(!X.keywords){qe.addText(ye);return}let T=0;X.keywordPatternRe.lastIndex=0;let L=X.keywordPatternRe.exec(ye),G="";for(;L;){G+=ye.substring(T,L.index);const ne=be(X,L);if(ne){const[Qe,yl]=ne;if(qe.addText(G),G="",bl+=yl,Qe.startsWith("_"))G+=L[0];else{const Px=us.classNameAliases[Qe]||Qe;qe.addKeyword(L[0],Px)}}else G+=L[0];T=X.keywordPatternRe.lastIndex,L=X.keywordPatternRe.exec(ye)}G+=ye.substr(T),qe.addText(G)}function wn(){if(ye==="")return;let T=null;if(typeof X.subLanguage=="string"){if(!e[X.subLanguage]){qe.addText(ye);return}T=p(X.subLanguage,ye,!0,Eu[X.subLanguage]),Eu[X.subLanguage]=T.top}else T=y(ye,X.subLanguage.length?X.subLanguage:null);X.relevance>0&&(bl+=T.relevance),qe.addSublanguage(T.emitter,T.language)}function _n(){X.subLanguage!=null?wn():Hn(),ye=""}function kn(T){return T.className&&qe.openNode(us.classNameAliases[T.className]||T.className),X=Object.create(T,{parent:{value:X}}),X}function it(T,L,G){let ne=yb(T.endRe,G);if(ne){if(T["on:end"]){const Qe=new om(T);T["on:end"](L,Qe),Qe.isMatchIgnored&&(ne=!1)}if(ne){for(;T.endsParent&&T.parent;)T=T.parent;return T}}if(T.endsWithParent)return it(T.parent,L,G)}function Gx(T){return X.matcher.regexIndex===0?(ye+=T[0],1):(ci=!0,0)}function Zx(T){const L=T[0],G=T.rule,ne=new om(G),Qe=[G.__beforeBegin,G["on:begin"]];for(const yl of Qe)if(yl&&(yl(T,ne),ne.isMatchIgnored))return Gx(L);return G&&G.endSameAsBegin&&(G.endRe=gb(L)),G.skip?ye+=L:(G.excludeBegin&&(ye+=L),_n(),!G.returnBegin&&!G.excludeBegin&&(ye=L)),kn(G),G.returnBegin?0:L.length}function Yx(T){const L=T[0],G=M.substr(T.index),ne=it(X,T,G);if(!ne)return hm;const Qe=X;Qe.skip?ye+=L:(Qe.returnEnd||Qe.excludeEnd||(ye+=L),_n(),Qe.excludeEnd&&(ye=L));do X.className&&qe.closeNode(),!X.skip&&!X.subLanguage&&(bl+=X.relevance),X=X.parent;while(X!==ne.parent);return ne.starts&&(ne.endSameAsBegin&&(ne.starts.endRe=ne.endRe),kn(ne.starts)),Qe.returnEnd?0:L.length}function Qx(){const T=[];for(let L=X;L!==us;L=L.parent)L.className&&T.unshift(L.className);T.forEach(L=>qe.openNode(L))}let vl={};function Mu(T,L){const G=L&&L[0];if(ye+=T,G==null)return _n(),0;if(vl.type==="begin"&&L.type==="end"&&vl.index===L.index&&G===""){if(ye+=M.slice(L.index,L.index+1),!l){const ne=new Error("0 width match regex");throw ne.languageName=w,ne.badRule=vl.rule,ne}return 1}if(vl=L,L.type==="begin")return Zx(L);if(L.type==="illegal"&&!B){const ne=new Error('Illegal lexeme "'+G+'" for mode "'+(X.className||"")+'"');throw ne.mode=X,ne}else if(L.type==="end"){const ne=Yx(L);if(ne!==hm)return ne}if(L.type==="illegal"&&G==="")return 1;if(ii>1e5&&ii>L.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=G,G.length}const us=ge(w);if(!us)throw Pi(i.replace("{}",w)),new Error('Unknown language: "'+w+'"');const Jx=Wb(us,{plugins:a});let ri="",X=K||Jx;const Eu={},qe=new o.__emitter(o);Qx();let ye="",bl=0,ds=0,ii=0,ci=!1;try{for(X.matcher.considerAll();;){ii++,ci?ci=!1:X.matcher.considerAll(),X.matcher.lastIndex=ds;const T=X.matcher.exec(M);if(!T)break;const L=M.substring(ds,T.index),G=Mu(L,T);ds=T.index+G}return Mu(M.substr(ds)),qe.closeAllNodes(),qe.finalize(),ri=qe.toHTML(),{relevance:Math.floor(bl),value:ri,language:w,illegal:!1,emitter:qe,top:X}}catch(T){if(T.message&&T.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:T.message,context:M.slice(ds-100,ds+100),mode:T.mode},sofar:ri,relevance:0,value:Wi(M),emitter:qe};if(l)return{illegal:!1,relevance:0,value:Wi(M),emitter:qe,language:w,top:X,errorRaised:T};throw T}}function j(w){const M={relevance:0,emitter:new o.__emitter(o),value:Wi(w),illegal:!1,top:c};return M.emitter.addText(w),M}function y(w,M){M=M||o.languages||Object.keys(e);const B=j(w),K=M.filter(ge).filter(D).map(kn=>p(kn,w,!1));K.unshift(B);const be=K.sort((kn,it)=>{if(kn.relevance!==it.relevance)return it.relevance-kn.relevance;if(kn.language&&it.language){if(ge(kn.language).supersetOf===it.language)return 1;if(ge(it.language).supersetOf===kn.language)return-1}return 0}),[Hn,wn]=be,_n=Hn;return _n.second_best=wn,_n}function b(w){return o.tabReplace||o.useBR?w.replace(r,M=>M===` +`?o.useBR?"
":M:o.tabReplace?M.replace(/\t/g,o.tabReplace):M):w}function N(w,M,B){const K=M?s[M]:B;w.classList.add("hljs"),K&&w.classList.add(K)}const x={"before:highlightElement":({el:w})=>{o.useBR&&(w.innerHTML=w.innerHTML.replace(/\n/g,"").replace(//g,` +`))},"after:highlightElement":({result:w})=>{o.useBR&&(w.value=w.value.replace(/\n/g,"
"))}},h=/^(<[^>]+>|\t)+/gm,g={"after:highlightElement":({result:w})=>{o.tabReplace&&(w.value=w.value.replace(h,M=>M.replace(/\t/g,o.tabReplace)))}};function v(w){let M=null;const B=d(w);if(u(B))return;J("before:highlightElement",{el:w,language:B}),M=w;const K=M.textContent,be=B?m(K,{language:B,ignoreIllegals:!0}):y(K);J("after:highlightElement",{el:w,result:be,text:K}),w.innerHTML=be.value,N(w,B,be.language),w.result={language:be.language,re:be.relevance,relavance:be.relevance},be.second_best&&(w.second_best={language:be.second_best.language,re:be.second_best.relevance,relavance:be.second_best.relevance})}function _(w){w.useBR&&(sn("10.3.0","'useBR' will be removed entirely in v11.0"),sn("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),o=fm(o,w)}const k=()=>{if(k.called)return;k.called=!0,sn("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(v)};function R(){sn("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),E=!0}let E=!1;function Y(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll("pre code").forEach(v)}function O(){E&&Y()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",O,!1);function ie(w,M){let B=null;try{B=M(n)}catch(K){if(Pi("Language definition for '{}' could not be registered.".replace("{}",w)),l)Pi(K);else throw K;B=c}B.name||(B.name=w),e[w]=B,B.rawDefinition=M.bind(null,n),B.aliases&&C(B.aliases,{languageName:w})}function U(w){delete e[w];for(const M of Object.keys(s))s[M]===w&&delete s[M]}function tn(){return Object.keys(e)}function Ue(w){sn("10.4.0","requireLanguage will be removed entirely in v11."),sn("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const M=ge(w);if(M)return M;throw new Error("The '{}' language is required, but not loaded.".replace("{}",w))}function ge(w){return w=(w||"").toLowerCase(),e[w]||e[s[w]]}function C(w,{languageName:M}){typeof w=="string"&&(w=[w]),w.forEach(B=>{s[B.toLowerCase()]=M})}function D(w){const M=ge(w);return M&&!M.disableAutodetect}function $(w){w["before:highlightBlock"]&&!w["before:highlightElement"]&&(w["before:highlightElement"]=M=>{w["before:highlightBlock"](Object.assign({block:M.el},M))}),w["after:highlightBlock"]&&!w["after:highlightElement"]&&(w["after:highlightElement"]=M=>{w["after:highlightBlock"](Object.assign({block:M.el},M))})}function V(w){$(w),a.push(w)}function J(w,M){const B=w;a.forEach(function(K){K[B]&&K[B](M)})}function Ae(w){return sn("10.2.0","fixMarkup will be removed entirely in v11.0"),sn("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),b(w)}function He(w){return sn("10.7.0","highlightBlock will be removed entirely in v12.0"),sn("10.7.0","Please use highlightElement now."),v(w)}Object.assign(n,{highlight:m,highlightAuto:y,highlightAll:Y,fixMarkup:Ae,highlightElement:v,highlightBlock:He,configure:_,initHighlighting:k,initHighlightingOnLoad:R,registerLanguage:ie,unregisterLanguage:U,listLanguages:tn,getLanguage:ge,registerAliases:C,requireLanguage:Ue,autoDetection:D,inherit:fm,addPlugin:V,vuePlugin:e5(n).VuePlugin}),n.debugMode=function(){l=!1},n.safeMode=function(){l=!0},n.versionString=Ib;for(const w in Vl)typeof Vl[w]=="object"&&X0(Vl[w]);return Object.assign(n,Vl),n.addPlugin(x),n.addPlugin(n5),n.addPlugin(g),n};var a5=s5({}),l5=a5,W0={exports:{}};(function(n){(function(){var e;e=n.exports=l,e.format=l,e.vsprintf=a,typeof console<"u"&&typeof console.log=="function"&&(e.printf=s);function s(){console.log(l.apply(null,arguments))}function a(r,i){return l.apply(null,[r].concat(i))}function l(r){for(var i=1,c=[].slice.call(arguments),o=0,u=r.length,d="",m,p=!1,j,y,b=!1,N,x=function(){return c[i++]},h=function(){for(var g="";/\d/.test(r[o]);)g+=r[o++],m=r[o];return g.length>0?parseInt(g):null};oc.relevance&&(c=o),o.relevance>i.relevance&&(c=i,i=o));return c.language&&(i.secondBest=c),i}function d5(n,e){En.registerLanguage(n,e)}function m5(){return En.listLanguages()}function p5(n,e){var s=n,a;e&&(s={},s[n]=e);for(a in s)En.registerAliases(s[a],{languageName:a})}function lt(n){this.options=n,this.rootNode={children:[]},this.stack=[this.rootNode]}function f5(n,e){this.openNode(e),this.addText(n),this.closeNode()}function h5(n,e){var s=this.stack,a=s[s.length-1],l=n.rootNode.children,r=e?{type:"element",tagName:"span",properties:{className:[e]},children:l}:l;a.children=a.children.concat(r)}function x5(n){var e=this.stack,s,a;n!==""&&(s=e[e.length-1],a=s.children[s.children.length-1],a&&a.type==="text"?a.value+=n:s.children.push({type:"text",value:n}))}function g5(n){var e=this.stack,s=this.options.classPrefix+n,a=e[e.length-1],l={type:"element",tagName:"span",properties:{className:[s]},children:[]};a.children.push(l),e.push(l)}function j5(){this.stack.pop()}function v5(){return""}function I0(){}const xm="[A-Za-z$_][0-9A-Za-z$_]*",b5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],y5=["true","false","null","undefined","NaN","Infinity"],N5=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],S5=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],w5=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_5=["arguments","this","super","console","window","document","localStorage","module","global"],k5=[].concat(w5,_5,N5,S5);function C5(n){return n?typeof n=="string"?n:n.source:null}function gm(n){return eo("(?=",n,")")}function eo(...n){return n.map(s=>C5(s)).join("")}function R5(n){const e=(v,{after:_})=>{const k="",end:""},l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,_)=>{const k=v[0].length+v.index,R=v.input[k];if(R==="<"){_.ignoreMatch();return}R===">"&&(e(v,{after:k})||_.ignoreMatch())}},r={$pattern:xm,keyword:b5,literal:y5,built_in:k5},i="[0-9](_?[0-9])*",c=`\\.(${i})`,o="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${o})((${c})|\\.)?|(${c}))[eE][+-]?(${i})\\b`},{begin:`\\b(${o})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,d],subLanguage:"css"}},j={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,d]},b={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,m,p,j,u,n.REGEXP_MODE];d.contains=N.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(N)});const x=[].concat(b,d.contains),h=x.concat([{begin:/\(/,end:/\)/,keywords:r,contains:["self"].concat(x)}]),g={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:h};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:h},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,m,p,j,b,u,{begin:eo(/[{,\n]\s*/,gm(eo(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,s+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:s+gm("\\s*:"),relevance:0}]},{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[b,n.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:h}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:a.begin,end:a.end},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:r,contains:["self",n.inherit(n.TITLE_MODE,{begin:s}),g],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[g,n.inherit(n.TITLE_MODE,{begin:s})]},{variants:[{begin:"\\."+s},{begin:"\\$"+s}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},n.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[n.inherit(n.TITLE_MODE,{begin:s}),"self",g]},{begin:"(get|set)\\s+(?="+s+"\\()",end:/\{/,keywords:"get set",contains:[n.inherit(n.TITLE_MODE,{begin:s}),{begin:/\(\)/},g]},{begin:/\$[(.]/}]}}var M5=R5;const fu=_p(M5),E5="modulepreload",A5=function(n){return"/"+n},jm={},T5=function(e,s,a){let l=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),i=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.all(s.map(c=>{if(c=A5(c),c in jm)return;jm[c]=!0;const o=c.endsWith(".css"),u=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=o?"stylesheet":E5,o||(d.as="script",d.crossOrigin=""),d.href=c,i&&d.setAttribute("nonce",i),document.head.appendChild(d),o)return new Promise((m,p)=>{d.addEventListener("load",m),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}return l.then(()=>e()).catch(r=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=r,window.dispatchEvent(i),!i.defaultPrevented)throw r})};var os=mb(cs,{});os.registerLanguage=cs.registerLanguage;const hu={hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:"#383a42",background:"#fafafa"},"hljs-comment":{color:"#a0a1a7",fontStyle:"italic"},"hljs-quote":{color:"#a0a1a7",fontStyle:"italic"},"hljs-doctag":{color:"#a626a4"},"hljs-keyword":{color:"#a626a4"},"hljs-formula":{color:"#a626a4"},"hljs-section":{color:"#e45649"},"hljs-name":{color:"#e45649"},"hljs-selector-tag":{color:"#e45649"},"hljs-deletion":{color:"#e45649"},"hljs-subst":{color:"#e45649"},"hljs-literal":{color:"#0184bb"},"hljs-string":{color:"#50a14f"},"hljs-regexp":{color:"#50a14f"},"hljs-addition":{color:"#50a14f"},"hljs-attribute":{color:"#50a14f"},"hljs-meta-string":{color:"#50a14f"},"hljs-built_in":{color:"#c18401"},"hljs-class .hljs-title":{color:"#c18401"},"hljs-attr":{color:"#986801"},"hljs-variable":{color:"#986801"},"hljs-template-variable":{color:"#986801"},"hljs-type":{color:"#986801"},"hljs-selector-class":{color:"#986801"},"hljs-selector-attr":{color:"#986801"},"hljs-selector-pseudo":{color:"#986801"},"hljs-number":{color:"#986801"},"hljs-symbol":{color:"#4078f2"},"hljs-bullet":{color:"#4078f2"},"hljs-link":{color:"#4078f2",textDecoration:"underline"},"hljs-meta":{color:"#4078f2"},"hljs-selector-id":{color:"#4078f2"},"hljs-title":{color:"#4078f2"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},$5=`import Button from 'components/Button' export default function ButtonCase() { return ( @@ -161,7 +161,7 @@ export default function ButtonCase() { ) -}`;Bt.registerLanguage("javascript",fu);Bt.registerLanguage("jsx",x5);const v5={ButtonCase:g5,Button:gl};function In(n){const{files:e=v5,caseRender:s,active:a=0,className:l}=n,r=Object.keys(e),[c,i]=h.useState(r[a]);function o(m){i(r[m])}const u=se("border border-gray-100 flex bg-white keepx flex-col-reverse sm:flex-row",l);return t.jsxs("div",{className:u,children:[t.jsxs("div",{className:"overflow-scroll flex-1 relative",children:[t.jsx("div",{className:"flex border-b border-gray-100 sticky top-0 bg-white",children:r.map((m,p)=>t.jsx(le,{ghost:!0,onClick:()=>o(p),className:c===m?"text-green-500":"",children:m},m))}),t.jsx("pre",{className:"text-sm leading-6",children:t.jsx(Bt,{language:"javascript",PreTag:"div",style:hu,children:e[c]})})]}),s&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sm:w-[1px] h-[1px] sm:h-auto bg-gray-100"}),t.jsxs("div",{className:"flex-1 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-100 items-center pl-3",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),t.jsx(le,{ghost:!0,className:"px-2",children:"预览"})]}),s]})]})]})}function j5(){return t.jsx(In,{files:{ButtonCase:Sj,Button:gl},caseRender:t.jsx(Nj,{})})}function xu({id:n,host:e,repo:s,repoId:a,category:l,categoryId:r,mapping:c,term:i,strict:o,reactionsEnabled:d,emitMetadata:u,inputPosition:m,theme:p,lang:g,loading:y}){const[b,N]=h.useState(!1);return h.useEffect(()=>{b||(p5(()=>import("./giscus-BNK3dBIH-B_EkeIy7.js"),[]),N(!0))},[]),b?t.jsx("giscus-widget",{id:n,host:e,repo:s,repoid:a,category:l,categoryid:r,mapping:c,term:i,strict:o,reactionsenabled:d,emitmetadata:u,inputposition:m,theme:p,lang:g,loading:y}):null}const b5="/assets/ercode-w1g_eexN.png";function Pc(n){const{title:e,desc:s,href:a,className:l}=n,c=se("block border rounded-xl p-4 bg-slate-50 border-slate-300 hover:shadow cursor-pointer",l);return t.jsxs("a",{href:a,target:"_blank",className:c,children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-blue-500",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})}),t.jsx("div",{className:"font-bold ml-2",children:e})]}),t.jsx("div",{className:"mt-3 text-slate-600 leading-8",children:s}),t.jsx("div",{className:"block text-end mt-4 text-blue-500",href:a,target:"_blank",children:"点击了解详情"})]})}function y5(){const n=h.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs("div",{className:"relative pt-16",children:[t.jsx(yj,{}),t.jsxs("div",{className:"max-w-[1050px] mx-auto px-4",children:[t.jsxs("div",{className:"mt-20 max-w-[750px]",children:[t.jsx("h2",{className:"text-lg font-bold",children:"React 19 全解"}),t.jsx("p",{className:"mt-4 text-gray-500 leading-8 text-md",children:"全网第一本系统学习 React 19 的专栏。本专栏在公众号「这波能反杀」首发,受到了大量粉丝的喜爱。专栏中包含大量实践案例,深入简出,理论结合实践为大家分享 React19 的学习。"}),t.jsx("p",{className:"text-md mt-4 text-gray-500 leading-8",children:"React19 为开发者带来了新的开发理念,这又是一次开发方式上的一次变革。并且在开发体验和性能上都有大幅度的提升,值得每一位 React 开发者学习,赶紧行动吧。"}),t.jsxs("div",{className:"mt-8",children:[t.jsxs(w0,{to:"tutorial/index",className:"inline-flex items-center px-5 py-2 bg-gray-800 hover:bg-gray-900 text-white text-sm rounded-full",children:[t.jsx("span",{className:"mr-2",children:"快速开始"}),t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"})})]}),t.jsx("a",{onClick:e,href:"",className:"inline-flex px-4 py-2 text-gray-600 ring-1 ring-gray-200 text-sm rounded-full ml-4",children:t.jsx("span",{children:"关注公众号"})}),t.jsx(ra,{ref:n,title:"Follow me!",children:t.jsx("img",{src:b5,alt:""})})]})]}),t.jsxs("div",{className:"mt-20 max-w-[750px]",children:[t.jsx("h2",{className:"text-lg font-bold",children:"学前准备"}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-8",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"具备一定的 JavaScript 基础"})]}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-4",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"熟悉异步请求,熟悉 fetch 与 Promise"})]}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-4",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"熟悉 React 之前的版本的使用"})]})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"主要内容"}),t.jsxs("div",{className:"flex items-stretch md:justify-between flex-col md:flex-row md:space-x-6 space-y-6 md:space-y-0",children:[t.jsx(Yc,{title:"Compiler",path:"./tutorial/use/importwith19",desc:"你可以不再使用 memo、useMemo、useCallback 来优化你的项目性能,大幅度提高开发体验",className:"flex-1"}),t.jsx(Yc,{title:"新的架构思路",path:"./tutorial/index",desc:"并发模式变得更加实用,得益于并发模式的成熟,我们将可以使用新的架构思路构思我的项目",className:"flex-1"}),t.jsx(Yc,{title:"新的交互方式",path:"./tutorial/use/base",desc:"React 在人机交互的开发体验上做了很多努力和尝试,他们将在这个版本中得以体现",className:"flex-1"})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"案例展示方式"}),t.jsxs("p",{className:"mt-10 flex items-center",children:["所见即所得。所有案例直接渲染,可操作、可交互。例如:点击按钮,切换皮肤",t.jsx("span",{className:"animate-bounce bg-white dark:bg-slate-800 p-2 w-10 h-10 ring-1 ring-slate-900/5 dark:ring-slate-200/20 shadow-lg rounded-full flex items-center justify-center ml-4",children:t.jsx("svg",{className:"w-6 h-6 text-violet-500",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]}),t.jsx(bj,{}),t.jsx("p",{className:"mb-4",children:"沉浸式学习体验。通过可在线编辑的案例,你能获得沉浸式的学习体验"}),t.jsx(j5,{}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"其他课程"}),t.jsxs("div",{className:"flex justify-between flex-col md:flex-row space-y-6 md:space-y-0 md:space-x-6",children:[t.jsx(Pc,{title:"私人面试指导",desc:"前端专家:这波能反杀,为您提供全网最专业的面试辅导,结合个人目标与工作经验,时长 2 ~ 3 小时,一次沟通,解决所有问题",href:"https://appxw863qeq2150.h5.xiaoeknow.com/v1/goods/goods_detail/course_2YWwycNZDt3u59naEs57g0gGa0H?",className:"flex-1"}),t.jsx(Pc,{title:"keepCoder",desc:"资深前端进阶通道,1V1深度沟通辅导,聚焦学习方法,深挖知识体系,深挖应用场景,凝聚核心竞争力",href:"https://www.yuque.com/coreadvance/ar2my1/apk8cr",className:"flex-1 bg-orange-100 border-orange-300"}),t.jsx(Pc,{title:"keepCharts",desc:"聚焦技术深度,手写基于 Canvas 的渲染引擎,并在此基础之上实现可视化图表等应用层库,打造自己牢不可破的核心竞争力",href:"https://www.yuque.com/coreadvance/ar2my1/em5rrk6p1umptsxw",className:"flex-1 bg-green-200 border-green-600"})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",loading:"lazy",crossorigin:"anonymous",async:!0}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsxs("div",{className:"flex justify-between pb-10",children:[t.jsxs("span",{className:"text-gray-400",children:["© Copyright 2024.",t.jsx("a",{href:"https://beian.miit.gov.cn/",target:"_blank",children:"这波能反杀."}),t.jsx("a",{href:"https://beian.miit.gov.cn/",target:"_blank",children:"粤ICP备2024222174号"})]}),t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})})}),t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})})})]})]})]})]})}function Q0(n){const{label:e,type:s,primary:a,warning:l,danger:r,newer:c,hard:i,className:o}=n,u=se("text-sm text-gray-500 border px-3 rounded-full",{"bg-blue-100 text-blue-500 border-blue-500":!!a,"bg-green-100 text-green-500 border-green-500":!!c,"bg-red-100 text-red-500 border-red-500":!!r,"bg-orange-100-100 text-orange-500 border-orange-500":!!r,"bg-fuchsia-100 text-fuchsia-500 border-fuchsia-500":!!i},o);return t.jsx("label",{className:Pe(u),children:e})}const N5=`import {Suspense, useState, useTransition} from 'react' +}`;os.registerLanguage("javascript",fu);const L5={ButtonCase:$5,Button:jl};function Dn(n){const{files:e=L5,caseRender:s,active:a=0,className:l}=n,r=Object.keys(e),[i,c]=f.useState(r[a]);function o(m){c(r[m])}const d=ae("border border-gray-100 flex bg-white keepx flex-col-reverse sm:flex-row",l);return t.jsxs("div",{className:d,children:[t.jsxs("div",{className:"overflow-scroll flex-1 relative",children:[t.jsx("div",{className:"flex border-b border-gray-100 sticky top-0 bg-white",children:r.map((m,p)=>t.jsx(le,{ghost:!0,onClick:()=>o(p),className:i===m?"text-green-500":"",children:m},m))}),t.jsx("pre",{className:"text-sm leading-6",children:t.jsx(os,{language:"javascript",PreTag:"div",style:hu,children:e[i]})})]}),s&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sm:w-[1px] h-[1px] sm:h-auto bg-gray-100"}),t.jsxs("div",{className:"flex-1 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-100 items-center pl-3",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),t.jsx(le,{ghost:!0,className:"px-2",children:"预览"})]}),s]})]})]})}function D5(){return t.jsx(Dn,{files:{ButtonCase:Vv,Button:jl},caseRender:t.jsx(qv,{})})}function xu({id:n,host:e,repo:s,repoId:a,category:l,categoryId:r,mapping:i,term:c,strict:o,reactionsEnabled:u,emitMetadata:d,inputPosition:m,theme:p,lang:j,loading:y}){const[b,N]=f.useState(!1);return f.useEffect(()=>{b||(T5(()=>import("./giscus-BNK3dBIH-B_EkeIy7.js"),[]),N(!0))},[]),b?t.jsx("giscus-widget",{id:n,host:e,repo:s,repoid:a,category:l,categoryid:r,mapping:i,term:c,strict:o,reactionsenabled:u,emitmetadata:d,inputposition:m,theme:p,lang:j,loading:y}):null}const O5="/assets/ercode-w1g_eexN.png";function Ki(n){const{title:e,desc:s,href:a,className:l}=n,i=ae("block border rounded-xl p-4 bg-slate-50 border-slate-300 hover:shadow cursor-pointer",l);return t.jsxs("a",{href:a,target:"_blank",className:i,children:[t.jsxs("div",{className:"flex",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-blue-500",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})}),t.jsx("div",{className:"font-bold ml-2",children:e})]}),t.jsx("div",{className:"mt-3 text-slate-600 leading-8",children:s}),t.jsx("div",{className:"block text-end mt-4 text-blue-500",href:a,target:"_blank",children:"点击了解详情"})]})}function B5(){const n=f.useRef(null);function e(s){s.preventDefault(),n.current.show()}return t.jsxs("div",{className:"relative pt-16",children:[t.jsx(Hv,{}),t.jsxs("div",{className:"max-w-[1050px] mx-auto px-4",children:[t.jsxs("div",{className:"mt-20 max-w-[750px]",children:[t.jsx("h2",{className:"text-lg font-bold",children:"React 19 全解"}),t.jsx("p",{className:"mt-4 text-gray-500 leading-8 text-md",children:"全网第一本系统学习 React 19 的专栏。本专栏在公众号「这波能反杀」首发,受到了大量粉丝的喜爱。专栏中包含大量实践案例,深入简出,理论结合实践为大家分享 React19 的学习。"}),t.jsx("p",{className:"text-md mt-4 text-gray-500 leading-8",children:"React19 为开发者带来了新的开发理念,这又是一次开发方式上的一次变革。并且在开发体验和性能上都有大幅度的提升,值得每一位 React 开发者学习,赶紧行动吧。"}),t.jsxs("div",{className:"mt-8",children:[t.jsxs(E0,{to:"tutorial/index",className:"inline-flex items-center px-5 py-2 bg-gray-800 hover:bg-gray-900 text-white text-sm rounded-full",children:[t.jsx("span",{className:"mr-2",children:"快速开始"}),t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"})})]}),t.jsx("a",{onClick:e,href:"",className:"inline-flex px-4 py-2 text-gray-600 ring-1 ring-gray-200 text-sm rounded-full ml-4",children:t.jsx("span",{children:"关注公众号"})}),t.jsx(ia,{ref:n,title:"Follow me!",children:t.jsx("img",{src:O5,alt:""})})]})]}),t.jsxs("div",{className:"mt-20 max-w-[750px]",children:[t.jsx("h2",{className:"text-lg font-bold",children:"学前准备"}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-8",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"具备一定的 JavaScript 基础"})]}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-4",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"熟悉异步请求,熟悉 fetch 与 Promise"})]}),t.jsxs("div",{className:"flex items-center text-gray-600 mt-4",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t.jsx("div",{className:"ml-2",children:"熟悉 React 之前的版本的使用"})]})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"主要内容"}),t.jsxs("div",{className:"flex items-stretch md:justify-between flex-col md:flex-row md:space-x-6 space-y-6 md:space-y-0",children:[t.jsx(Qi,{title:"Compiler",path:"./tutorial/use/importwith19",desc:"你可以不再使用 memo、useMemo、useCallback 来优化你的项目性能,大幅度提高开发体验",className:"flex-1"}),t.jsx(Qi,{title:"新的架构思路",path:"./tutorial/index",desc:"并发模式变得更加实用,得益于并发模式的成熟,我们将可以使用新的架构思路构思我的项目",className:"flex-1"}),t.jsx(Qi,{title:"新的交互方式",path:"./tutorial/use/base",desc:"React 在人机交互的开发体验上做了很多努力和尝试,他们将在这个版本中得以体现",className:"flex-1"})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"案例展示方式"}),t.jsxs("p",{className:"mt-10 flex items-center",children:["所见即所得。所有案例直接渲染,可操作、可交互。例如:点击按钮,切换皮肤",t.jsx("span",{className:"animate-bounce bg-white dark:bg-slate-800 p-2 w-10 h-10 ring-1 ring-slate-900/5 dark:ring-slate-200/20 shadow-lg rounded-full flex items-center justify-center ml-4",children:t.jsx("svg",{className:"w-6 h-6 text-violet-500",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]}),t.jsx(Uv,{}),t.jsx("p",{className:"mb-4",children:"沉浸式学习体验。通过可在线编辑的案例,你能获得沉浸式的学习体验"}),t.jsx(D5,{}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3",children:"其他课程"}),t.jsxs("div",{className:"flex justify-between flex-col md:flex-row space-y-6 md:space-y-0 md:space-x-6",children:[t.jsx(Ki,{title:"私人面试指导",desc:"前端专家:这波能反杀,为您提供全网最专业的面试辅导,结合个人目标与工作经验,时长 2 ~ 3 小时,一次沟通,解决所有问题",href:"https://appxw863qeq2150.h5.xiaoeknow.com/v1/goods/goods_detail/course_2YWwycNZDt3u59naEs57g0gGa0H?",className:"flex-1"}),t.jsx(Ki,{title:"keepCoder",desc:"资深前端进阶通道,1V1深度沟通辅导,聚焦学习方法,深挖知识体系,深挖应用场景,凝聚核心竞争力",href:"https://www.yuque.com/coreadvance/ar2my1/apk8cr",className:"flex-1 bg-orange-100 border-orange-300"}),t.jsx(Ki,{title:"keepCharts",desc:"聚焦技术深度,手写基于 Canvas 的渲染引擎,并在此基础之上实现可视化图表等应用层库,打造自己牢不可破的核心竞争力",href:"https://www.yuque.com/coreadvance/ar2my1/em5rrk6p1umptsxw",className:"flex-1 bg-green-200 border-green-600"})]}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",loading:"lazy",crossorigin:"anonymous",async:!0}),t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsxs("div",{className:"flex justify-between pb-10",children:[t.jsxs("span",{className:"text-gray-400",children:["© Copyright 2024.",t.jsx("a",{href:"https://beian.miit.gov.cn/",target:"_blank",children:"这波能反杀."}),t.jsx("a",{href:"https://beian.miit.gov.cn/",target:"_blank",children:"粤ICP备2024222174号"})]}),t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})})}),t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),t.jsx("div",{className:"ml-3",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})})})]})]})]})]})}function F0(n){const{label:e,type:s,primary:a,warning:l,danger:r,newer:i,hard:c,className:o}=n,d=ae("text-sm text-gray-500 border px-3 rounded-full",{"bg-blue-100 text-blue-500 border-blue-500":!!a,"bg-green-100 text-green-500 border-green-500":!!i,"bg-red-100 text-red-500 border-red-500":!!r,"bg-orange-100-100 text-orange-500 border-orange-500":!!r,"bg-fuchsia-100 text-fuchsia-500 border-fuchsia-500":!!c},o);return t.jsx("label",{className:Ke(d),children:e})}const z5=`import {Suspense, useState, useTransition} from 'react' import Message from './Message' import Button from './Button' import Skeleton from './Skeleton' @@ -189,7 +189,7 @@ export default function App() { ) } -`,S5=`const random = [ +`,U5=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -217,7 +217,7 @@ export const getApi = async () => { value: random[i] } } -`,w5=`import { use } from 'react' +`,H5=`import { use } from 'react' const Message = (props) => { const {isPending, response} = props @@ -229,7 +229,7 @@ const Message = (props) => { ) } export default Message -`,_5=`document.documentElement.style.fontSize = '14px' +`,q5=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -249,7 +249,7 @@ export default function Skeleton(props) { ) } -`,k5=`import {twMerge} from 'tailwind-merge' +`,V5=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' // 本组件只是一个简单的 UI 组件,学习时无需多过关注 @@ -279,7 +279,7 @@ export default function Button(props) { ) } -`;function T(n){const{reload:e,className:s}=n,[a,l]=h.useState(!0),r=h.useRef(null);function c(){const d=r.current.getBoundingClientRect().height;r.current.style.minHeight=`${d}px`,l(!1),setTimeout(()=>{l(!0)},200)}const o=se("border rounded-md my-4",s);return t.jsxs("div",{className:o,children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-gray-100 items-center px-3 py-2 text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"预览"})]}),t.jsx("div",{className:"p-4",ref:r,children:a?n.children:null}),e?t.jsx("div",{className:"mx-4 mb-4 text-right",children:t.jsx(le,{signal:!0,onClick:c,children:"reload"})}):null]})}const J0=n=>{const{isPending:e,response:s}=n,a=h.use(s);return t.jsx("div",{className:"text-sm leading-6 transition border border-blue-100 shadow rounded-md p-4 w-full mt-4",style:{opacity:e?.5:1},children:a.value})};document.documentElement.style.fontSize="14px";function K0(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsx("div",{className:"animate-pulse",children:t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})})})}const C5=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var W0=new Headers;W0.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var R5={method:"GET",headers:W0,redirect:"follow",data:"hex"};const E5="https://echo.apifox.com/delay/1",no=async()=>{await fetch(E5,R5);const n=Math.floor(Math.random()*10)%5;return{value:C5[n]}};function M5(){const n=no();return t.jsx(h.Suspense,{fallback:t.jsx(K0,{}),children:t.jsx(J0,{response:n})})}function bm(n){const e={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` +`;function A(n){const{reload:e,className:s}=n,[a,l]=f.useState(!0),r=f.useRef(null);function i(){const u=r.current.getBoundingClientRect().height;r.current.style.minHeight=`${u}px`,l(!1),setTimeout(()=>{l(!0)},200)}const o=ae("border rounded-md my-4",s);return t.jsxs("div",{className:o,children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-gray-100 items-center px-3 py-2 text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),t.jsx("div",{className:"ml-2 text-sm",children:"预览"})]}),t.jsx("div",{className:"p-4",ref:r,children:a?n.children:null}),e?t.jsx("div",{className:"mx-4 mb-4 text-right",children:t.jsx(le,{signal:!0,onClick:i,children:"reload"})}):null]})}const ex=n=>{const{isPending:e,response:s}=n,a=f.use(s);return t.jsx("div",{className:"text-sm leading-6 transition border border-blue-100 shadow rounded-md p-4 w-full mt-4",style:{opacity:e?.5:1},children:a.value})};document.documentElement.style.fontSize="14px";function nx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsx("div",{className:"animate-pulse",children:t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})})})}const X5=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var tx=new Headers;tx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var G5={method:"GET",headers:tx,redirect:"follow",data:"hex"};const Z5="https://echo.apifox.com/delay/1",no=async()=>{await fetch(Z5,G5);const n=Math.floor(Math.random()*10)%5;return{value:X5[n]}};function Y5(){const n=no();return t.jsx(f.Suspense,{fallback:t.jsx(nx,{}),children:t.jsx(ex,{response:n})})}function vm(n){const e={a:"a",blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"序"})}),` `,t.jsx(e.p,{children:"目前写 React 19 的文章已经有很多很多了,但是,写到点子上的并不多。包括官方文档,只是简单的罗列出了它新增了一些 hook,一些特性,却并没有进一步说明这些 hook 背后所代表的含义,它们的最佳实践是什么。"}),` `,t.jsx(e.p,{children:"以至于,在这个时间节点,期待 React 19 的人也并不是很多。"}),` @@ -362,7 +362,7 @@ export default function Button(props) { } `})}),` `,t.jsx(e.p,{children:"演示效果如下"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(M5,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(Y5,{})}),` `,t.jsxs(e.p,{children:["大家可以自行感受一下新的开发方式与以前基于 ",t.jsx(e.code,{children:"useEffect"})," 请求数据有什么不同之处。我在右侧案例演示中,还提供了更完整更具代表性的案例。大家可以先瞄一眼体会一下。案例代码有对应的完整演示效果,你可以通过修改代码观察案例的变化。"]}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"注意:一套成熟架构思维,不是使用一个简单的方案解决某一个问题,而是要基于这套思维去解决项目中的绝大多数场景。因此我们一定要结合大量的场景去理解一套项目架构思维。"}),` @@ -370,7 +370,7 @@ export default function Button(props) { `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"5"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"合集介绍"})}),` `,t.jsxs(e.p,{children:["本合集名为:",t.jsx(e.strong,{children:"「React19 全解」"})," ,是 ",t.jsx(e.strong,{children:"「React 知命境」"})," 的续集。首发与公众号",t.jsx(e.a,{href:"",children:"这波能反杀"}),"。后为了提高大家的学习体验,迁移至此处。在这里我基于",t.jsx(e.strong,{children:"沉浸式"}),"的学习体验,内置了大量可操作可交互的真实案例。摒弃了使用截图演示案例的方式。除此之外,为了让大家能够获得更好的学习效果,每一个案例都精心设计了 UI。在细节上精心打磨,争取让大家能够所学即所得。快速掌握 React19."]}),` -`,t.jsx(e.p,{children:"希望大家能够在这里获得全网最好的学习体验!Let's go."})]})}function A5(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(bm,{...n})}):bm(n)}const sc="U2FsdGVkX3xOPhN009";function T5(){function n(e){localStorage.setItem("active_code",e.get("code")),location.reload()}return t.jsxs("div",{className:"pt-4",children:[t.jsx("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-400",children:t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-yellow-700",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"Attention needed"}),t.jsx("div",{className:"mt-2 text-sm text-yellow-700",children:t.jsx("p",{children:"你还未输入激活码,或者激活码已过期,请重新输入即可访问"})})]})]})}),t.jsxs("form",{action:n,className:"flex items-center justify-between",children:[t.jsx(yn,{name:"code",placeholder:"Please input your active code",className:"flex-1 mr-4",pattern:sc}),t.jsx("button",{type:"submit",children:"确认"})]})]})}Bt.registerLanguage("javascript",fu);function $5({className:n,...e}){const s=/language-(\w+)/.exec(n||"");return s?t.jsx(Bt,{language:s[1],PreTag:"div",...e,style:hu}):t.jsx("code",{className:n,...e})}function ae(n){const{renderArticle:e,files:s,caseRender:a,isAuth:l=!0}=n,r=localStorage.getItem("active_code"),c=l?r===sc:!0;let i=t.jsx(T5,{});return c&&(i=t.jsxs(t.Fragment,{children:[a?t.jsx(T,{reload:!0,className:"mt-0",children:a}):null,t.jsx("div",{className:"md:hidden",children:t.jsx(In,{files:s,className:"h-full rounded-md border-gray-200"})}),e($5)]})),t.jsxs("div",{className:"md:flex h-[calc(100vh_-_8rem)] overflow-hidden mx-auto w-full max-w-[1244px]",children:[t.jsxs("div",{className:"md:flex-1 h-full overflow-scroll md:pr-4 keep w-full max-w-[768px]",children:[i,t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",crossorigin:"anonymous",async:!0})]}),t.jsx("div",{className:"hidden md:block md:flex-1 top-[8rem] h-full overflow-y-auto max-w-[768px]",children:t.jsx(In,{files:s,className:"h-full rounded-md border-gray-200"})})]})}function D5(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:c,...i}=n,m=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...i,children:n.children})}function L5(){const[n,e]=h.useState(no),[s,a]=h.useTransition();function l(){a(()=>{e(no())})}return t.jsxs("div",{children:[t.jsx(D5,{onClick:l,disabled:s,children:"点击更新"}),t.jsx(h.Suspense,{fallback:t.jsx(K0,{}),children:t.jsx(J0,{response:n,isPending:s})})]})}const B5={"App.js":N5,"api.js":S5,"Message.jsx":w5,"Skeleton.jsx":_5,"Button.jsx":k5};function O5(){return t.jsx(ae,{files:B5,renderArticle:n=>t.jsx(A5,{components:{code:n}}),caseRender:t.jsx(L5,{})})}const z5=`import React, { useEffect, useState, Suspense, use } from 'react'; +`,t.jsx(e.p,{children:"希望大家能够在这里获得全网最好的学习体验!Let's go."})]})}function Q5(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(vm,{...n})}):vm(n)}const ai="U2FsdGVkX3xOPhN009";function J5(){function n(e){localStorage.setItem("active_code",e.get("code")),location.reload()}return t.jsxs("div",{className:"pt-4",children:[t.jsx("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-400",children:t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-yellow-700",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"Attention needed"}),t.jsx("div",{className:"mt-2 text-sm text-yellow-700",children:t.jsx("p",{children:"你还未输入激活码,或者激活码已过期,请重新输入即可访问"})})]})]})}),t.jsxs("form",{action:n,className:"flex items-center justify-between",children:[t.jsx(yn,{name:"code",placeholder:"Please input your active code",className:"flex-1 mr-4",pattern:ai}),t.jsx("button",{type:"submit",children:"确认"})]})]})}os.registerLanguage("javascript",fu);function P5({className:n,...e}){const s=/language-(\w+)/.exec(n||"");return s?t.jsx(os,{language:s[1],PreTag:"div",...e,style:hu}):t.jsx("code",{className:n,...e})}function W(n){const{renderArticle:e,files:s,caseRender:a,isAuth:l=!0}=n,r=localStorage.getItem("active_code"),i=l?r===ai:!0;let c=t.jsx(J5,{});return i&&(c=t.jsxs(t.Fragment,{children:[a?t.jsx(A,{reload:!0,className:"mt-0",children:a}):null,t.jsx("div",{className:"md:hidden",children:t.jsx(Dn,{files:s,className:"h-full rounded-md border-gray-200"})}),e(P5)]})),t.jsxs("div",{className:"md:flex h-[calc(100vh_-_8rem)] overflow-hidden mx-auto w-full max-w-[1244px]",children:[t.jsxs("div",{className:"md:flex-1 h-full overflow-scroll md:pr-4 keep w-full max-w-[768px]",children:[c,t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",crossorigin:"anonymous",async:!0})]}),t.jsx("div",{className:"hidden md:block md:flex-1 top-[8rem] h-full overflow-y-auto max-w-[768px]",children:t.jsx(Dn,{files:s,className:"h-full rounded-md border-gray-200"})})]})}function W5(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:i,...c}=n,m=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...c,children:n.children})}function K5(){const[n,e]=f.useState(no),[s,a]=f.useTransition();function l(){a(()=>{e(no())})}return t.jsxs("div",{children:[t.jsx(W5,{onClick:l,disabled:s,children:"点击更新"}),t.jsx(f.Suspense,{fallback:t.jsx(nx,{}),children:t.jsx(ex,{response:n,isPending:s})})]})}const I5={"App.js":z5,"api.js":U5,"Message.jsx":H5,"Skeleton.jsx":q5,"Button.jsx":V5};function F5(){return t.jsx(W,{files:I5,renderArticle:n=>t.jsx(Q5,{components:{code:n}}),caseRender:t.jsx(K5,{})})}const e4=`import React, { useEffect, useState, Suspense, use } from 'react'; import Button from './Button' import Skeleton from './Skeleton' import {fetchList} from './api' @@ -416,7 +416,7 @@ function CurrentList({promise}) { ) } -`,U5=`import {twMerge} from 'tailwind-merge' +`,n4=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -447,14 +447,14 @@ export default function Button(props) { ) } -`,H5=`const count = 3; +`,t4=`const count = 3; const fakeDataUrl = \`https://randomuser.me/api/?results=\${count}&inc=name,gender,email,nat,picture&noinfo\`; export const fetchList = async () => { const res = await fetch(fakeDataUrl) return res.json() } -`,q5=`// header +`,s4=`// header export default function Skeleton(props) { return (
@@ -473,7 +473,7 @@ export default function Skeleton(props) {
) } -`;function ym(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"这篇文章文字内容不会很多,但是是整个专栏最重要的部分之一。"}),` +`;function bm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"这篇文章文字内容不会很多,但是是整个专栏最重要的部分之一。"}),` `,t.jsx(e.p,{children:"本专栏会围绕如下三个层次逐渐为大家由浅入深分析 React19 的学习,他们确保了我们的学习方向的正确性与难度的循序渐进。"}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"初级版:优化异步开发体验"})}),` @@ -503,7 +503,7 @@ useOptimistic `,t.jsx(e.p,{children:"透彻理解 React Compiler 的原理,需要对现有 React 的底层原理有一个大概的了解,这样我们才能形成一个完整的知识体系闭环。学习之前,做好这个心理准备和知识铺垫即可。"}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsxs(e.p,{children:["在 隔壁的合集 ",t.jsx(e.strong,{children:"React 知命境"})," 中,我有几篇高质量的文章介绍了 React 的底层原理,读者朋友们可以去看看。"]}),` -`]})]})}function V5(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ym,{...n})}):ym(n)}document.documentElement.style.fontSize="14px";function X5(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:c,...i}=n,m=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...i,children:n.children})}function G5(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})})}const Z5=3,Y5=`https://randomuser.me/api/?results=${Z5}&inc=name,gender,email,nat,picture&noinfo`,Nm=async()=>(await fetch(Y5)).json(),Q5=()=>{const[n,e]=h.useState(()=>[Nm()]),s=()=>{n.push(Nm()),e([...n])};return t.jsxs(t.Fragment,{children:[n.map((a,l)=>t.jsx(h.Suspense,{fallback:t.jsx(G5,{}),children:t.jsx(J5,{promise:a})},`hello ${l}`)),t.jsx("div",{className:"text-center my-4",children:t.jsx(X5,{onClick:s,children:"loading more"})})]})};function J5({promise:n}){const{results:e}=h.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"border-b border-dashed py-4 mx-4 items-center flex",children:[t.jsx("img",{className:"w-14 h-14 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"a design language for background applications, is refined by Ant UED Team"})]})]},s.name.last))})}const K5={"App.js":z5,"api.js":H5,"Button.jsx":U5,"Skeleton.jsx":q5};function W5(){return t.jsx(ae,{files:K5,renderArticle:n=>t.jsx(V5,{components:{code:n}}),caseRender:t.jsx(Q5,{})})}function Sm(n){const e={blockquote:"blockquote",code:"code",img:"img",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:t.jsx(e.img,{src:"https://files.mdnice.com/user/3925/b4869674-83ae-4ed2-a70d-34574d4451da.png",alt:""})}),` +`]})]})}function a4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(bm,{...n})}):bm(n)}document.documentElement.style.fontSize="14px";function l4(n){const{className:e,primary:s,danger:a,sm:l,lg:r,success:i,...c}=n,m=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r}));return t.jsx("button",{className:m,...c,children:n.children})}function r4(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})})}const i4=3,c4=`https://randomuser.me/api/?results=${i4}&inc=name,gender,email,nat,picture&noinfo`,ym=async()=>(await fetch(c4)).json(),o4=()=>{const[n,e]=f.useState(()=>[ym()]),s=()=>{n.push(ym()),e([...n])};return t.jsxs(t.Fragment,{children:[n.map((a,l)=>t.jsx(f.Suspense,{fallback:t.jsx(r4,{}),children:t.jsx(u4,{promise:a})},`hello ${l}`)),t.jsx("div",{className:"text-center my-4",children:t.jsx(l4,{onClick:s,children:"loading more"})})]})};function u4({promise:n}){const{results:e}=f.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"border-b border-dashed py-4 mx-4 items-center flex",children:[t.jsx("img",{className:"w-14 h-14 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"a design language for background applications, is refined by Ant UED Team"})]})]},s.name.last))})}const d4={"App.js":e4,"api.js":t4,"Button.jsx":n4,"Skeleton.jsx":s4};function m4(){return t.jsx(W,{files:d4,renderArticle:n=>t.jsx(a4,{components:{code:n}}),caseRender:t.jsx(o4,{})})}function Nm(n){const e={blockquote:"blockquote",code:"code",img:"img",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:t.jsx(e.img,{src:"https://files.mdnice.com/user/3925/b4869674-83ae-4ed2-a70d-34574d4451da.png",alt:""})}),` `,t.jsx(e.p,{children:"首先,我们使用 vite 创建一个 React 项目"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-bash",children:`npm create vite `})}),` @@ -562,7 +562,7 @@ export default defineConfig({ `,t.jsxs(e.blockquote,{children:[` `,t.jsxs(e.p,{children:["如果你需要支持更多的文件后缀,则需要在 ",t.jsx(e.code,{children:"fileRegex"})," 中添加,本项目仅支持 ",t.jsx(e.code,{children:".js"})," 与 ",t.jsx(e.code,{children:".jsx"})]}),` `]}),` -`,t.jsx(e.p,{children:"最后重启项目即可。"})]})}function P5(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Sm,{...n})}):Sm(n)}const F5=`import { useState } from 'react' +`,t.jsx(e.p,{children:"最后重启项目即可。"})]})}function p4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Nm,{...n})}):Nm(n)}const f4=`import { useState } from 'react' import reactLogo from './react.svg' import viteLogo from '/vite.svg' import './index.css' @@ -598,7 +598,7 @@ function App() { } export default App -`,I5=`#root { +`,h4=`#root { max-width: 1280px; margin: 0 auto; padding: 2rem; @@ -640,7 +640,7 @@ export default App .read-the-docs { color: #888; } -`,e4=`:root { +`,x4=`:root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; font-weight: 400; @@ -708,9 +708,9 @@ button:focus-visible { background-color: #f9f9f9; } } -`,n4=` -`,t4=` -`,s4={"App.js":F5,"App.css":I5,"index.css":e4,"vite.svg":n4,"react.svg":t4};function a4(){return t.jsx(ae,{files:s4,renderArticle:n=>t.jsx(P5,{components:{code:n}})})}const l4=`import React, { useEffect, useState, Suspense, use } from 'react'; +`,g4=` +`,j4=` +`,v4={"App.js":f4,"App.css":h4,"index.css":x4,"vite.svg":g4,"react.svg":j4};function b4(){return t.jsx(W,{files:v4,renderArticle:n=>t.jsx(p4,{components:{code:n}})})}const y4=`import React, { useEffect, useState, Suspense, use } from 'react'; import Button from './Button' import Skeleton from './Skeleton' import {getMessage} from './api' @@ -744,7 +744,7 @@ const Message = (props) => { ) } -`,r4=`import {twMerge} from 'tailwind-merge' +`,N4=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -784,7 +784,7 @@ export default function Button(props) { ) } -`,c4=`const random = [ +`,S4=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -812,7 +812,7 @@ export const getMessage = async () => { value: random[i] } } -`,i4=`export default function Skeleton(props) { +`,w4=`export default function Skeleton(props) { return (
@@ -831,7 +831,7 @@ export const getMessage = async () => {
) } -`,gu=n=>{const e=n.message;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},o4=new Promise(n=>{n({value:"Unlike React Hooks, use can be called within loops and conditional statements like if. Like React Hooks, the function that calls use must be a Component or Hook."})});function u4(){const n=h.use(o4);return t.jsx(gu,{message:n.value})}document.documentElement.style.fontSize="14px";function P0(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function ac(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const d4=new Promise(n=>{n({value:"Unlike React Hooks, use can be called within loops and conditional statements like if. Like React Hooks, the function that calls use must be a Component or Hook."})});function m4(){const[n,e]=h.useState(!1);let s={value:""};return n||(s=h.use(d4)),t.jsxs(t.Fragment,{children:[n?t.jsx(ac,{}):t.jsx(gu,{message:s.value}),t.jsx("div",{className:"mt-4 text-right",children:t.jsx(P0,{signal:!0,onClick:()=>e(!n),children:"切换"})})]})}const p4=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var F0=new Headers;F0.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var f4={method:"GET",headers:F0,redirect:"follow",data:"hex"};const h4="https://echo.apifox.com/delay/1",I0=async()=>{await fetch(h4,f4);const n=Math.floor(Math.random()*10)%5;return{value:p4[n]}};function x4(){const[n,e]=h.useState(!0);return t.jsx(h.Suspense,{fallback:t.jsx("div",{}),children:t.jsx("div",{children:n?t.jsx(g4,{}):t.jsx(ac,{})})})}function g4(){let[n,e]=h.useState(!0);const s=I0().then(l=>(e(!1),l));let a={value:"",icon_url:""};return n||(a=h.use(s)),n?t.jsx(ac,{}):t.jsx(gu,{message:a.value})}function wm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:[t.jsx(e.code,{children:"use()"})," 是 React19 提升异步开发体验最重要的 hook。也是让 useEffect 重要性大幅度削弱的主要原因。"]}),` +`,gu=n=>{const e=n.message;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},_4=new Promise(n=>{n({value:"Unlike React Hooks, use can be called within loops and conditional statements like if. Like React Hooks, the function that calls use must be a Component or Hook."})});function k4(){const n=f.use(_4);return t.jsx(gu,{message:n.value})}document.documentElement.style.fontSize="14px";function sx(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function li(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const C4=new Promise(n=>{n({value:"Unlike React Hooks, use can be called within loops and conditional statements like if. Like React Hooks, the function that calls use must be a Component or Hook."})});function R4(){const[n,e]=f.useState(!1);let s={value:""};return n||(s=f.use(C4)),t.jsxs(t.Fragment,{children:[n?t.jsx(li,{}):t.jsx(gu,{message:s.value}),t.jsx("div",{className:"mt-4 text-right",children:t.jsx(sx,{signal:!0,onClick:()=>e(!n),children:"切换"})})]})}const M4=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ax=new Headers;ax.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var E4={method:"GET",headers:ax,redirect:"follow",data:"hex"};const A4="https://echo.apifox.com/delay/1",lx=async()=>{await fetch(A4,E4);const n=Math.floor(Math.random()*10)%5;return{value:M4[n]}};function T4(){const[n,e]=f.useState(!0);return t.jsx(f.Suspense,{fallback:t.jsx("div",{}),children:t.jsx("div",{children:n?t.jsx($4,{}):t.jsx(li,{})})})}function $4(){let[n,e]=f.useState(!0);const s=lx().then(l=>(e(!1),l));let a={value:"",icon_url:""};return n||(a=f.use(s)),n?t.jsx(li,{}):t.jsx(gu,{message:a.value})}function Sm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:[t.jsx(e.code,{children:"use()"})," 是 React19 提升异步开发体验最重要的 hook。也是让 useEffect 重要性大幅度削弱的主要原因。"]}),` `,t.jsxs(e.p,{children:["我们可以利用 use 读取 ",t.jsx(e.code,{children:"Promise"})," 中的值。"]}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"也可以使用 use 读取 context 中的资源,后续详细介绍该能力"}),` @@ -877,7 +877,7 @@ export default function Demo01() { ) } `})}),` -`,t.jsx(T,{children:t.jsx(u4,{})}),` +`,t.jsx(A,{children:t.jsx(k4,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"在条件判断中使用"})}),` `,t.jsxs(e.p,{children:["和其他 hook 一样,",t.jsx(e.code,{children:"use()"})," 必须在函数组件中使用。但是很不一样的是,use 可以在循环和条件判断语句中使用。我们这里如下案例来演示这个结论。"]}),` @@ -913,7 +913,7 @@ export default function Demo01() { ) } `})}),` -`,t.jsx(T,{children:t.jsx(m4,{})}),` +`,t.jsx(A,{children:t.jsx(R4,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"2"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"在异步请求中使用"})}),` `,t.jsx(e.p,{children:"通常,我们在处理异步请求时,也会结合 promise 来使用。但是我们并不能直接使用 use 来读取异步请求中的 promise,因为我们已经非常明确,use 只能读取有确定 resolve 结果的 promise 中的值。但是有可能第一时间异步请求包装的 promise 状态为 pending。因此在这种情况下,我们必须结合 Suspense 来使用。"}),` @@ -934,9 +934,9 @@ export default function Demo01() { return loading ? : } `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(x4,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(T4,{})}),` `,t.jsx(e.p,{children:"点击按钮可以重新加载执行该组件。我们可以观察一下效果,在目前的 React 版本中,并不能合理的处理好这种存在风险的读取方式,虽然我们最终读取到了 promise 中的值,内容也顺利渲染出来了,但是中间存在一次明显的闪烁。表现为包括按钮在内的内容全部消失,这种体验非常的糟糕。"}),` -`,t.jsx(e.p,{children:"因此,在实践中,如果我们要读取异步请求的 promise 中的值,必须结合 Suspense 来处理。在右侧的案例中,我们列举了一个 use + Suspense 合理处理异步请求的案例,大家可以先暂时了解一下,在后续的章节中,我们详细学习了 Suspense 之后再来进行案例分析。"})]})}function v4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(wm,{...n})}):wm(n)}function j4(){const n=I0();return t.jsxs(t.Fragment,{children:[t.jsx(h.Suspense,{fallback:t.jsx(ac,{}),children:t.jsx(b4,{promise:n})}),t.jsx("div",{className:"mt-8 text-center",children:t.jsx(P0,{signal:!0,children:"点击下方刷新按钮可重置演示"})})]})}const b4=n=>{const e=h.use(n.promise);return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e.value})]})]})},y4={"App.js":l4,"api.js":c4,"Button.jsx":r4,"Skeleton.jsx":i4};function N4(){return t.jsx(ae,{files:y4,renderArticle:n=>t.jsx(v4,{components:{code:n}}),caseRender:t.jsx(j4,{})})}const S4=`import React, { useEffect, useState, Suspense, use } from 'react'; +`,t.jsx(e.p,{children:"因此,在实践中,如果我们要读取异步请求的 promise 中的值,必须结合 Suspense 来处理。在右侧的案例中,我们列举了一个 use + Suspense 合理处理异步请求的案例,大家可以先暂时了解一下,在后续的章节中,我们详细学习了 Suspense 之后再来进行案例分析。"})]})}function L4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Sm,{...n})}):Sm(n)}function D4(){const n=lx();return t.jsxs(t.Fragment,{children:[t.jsx(f.Suspense,{fallback:t.jsx(li,{}),children:t.jsx(O4,{promise:n})}),t.jsx("div",{className:"mt-8 text-center",children:t.jsx(sx,{signal:!0,children:"点击下方刷新按钮可重置演示"})})]})}const O4=n=>{const e=f.use(n.promise);return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e.value})]})]})},B4={"App.js":y4,"api.js":S4,"Button.jsx":N4,"Skeleton.jsx":w4};function z4(){return t.jsx(W,{files:B4,renderArticle:n=>t.jsx(L4,{components:{code:n}}),caseRender:t.jsx(D4,{})})}const U4=`import React, { useEffect, useState, Suspense, use } from 'react'; import Button from './Button' import Skeleton from './Skeleton' import {getMessage} from './api' @@ -980,7 +980,7 @@ const Message = (props) => {
) } -`,w4=`import {twMerge} from 'tailwind-merge' +`,H4=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -1020,7 +1020,7 @@ export default function Button(props) { ) } -`,_4=`const random = [ +`,q4=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -1048,7 +1048,7 @@ export const getMessage = async () => { value: random[i] } } -`,k4=`export default function Skeleton(props) { +`,V4=`export default function Skeleton(props) { return (
@@ -1067,7 +1067,7 @@ export const getMessage = async () => {
) } -`,ex=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},C4=()=>new Promise(n=>{n({value:"React does not preserve any state for renders that got suspended before they were able to mount for the first time. When the component has loaded, React will retry rendering the suspended tree from scratch."})});function R4(){const n=C4();return t.jsx(h.Suspense,{fallback:"",children:t.jsx(E4,{promise:n})})}function E4(n){const{value:e}=h.use(n.promise);return t.jsx(ex,{message:e})}document.documentElement.style.fontSize="14px";function M4(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function vu(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const A4=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var nx=new Headers;nx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var T4={method:"GET",headers:nx,redirect:"follow",data:"hex"};const $4="https://echo.apifox.com/delay/1",tx=async()=>{await fetch($4,T4);const n=Math.floor(Math.random()*10)%5;return{value:A4[n]}};function _m(){const n=tx();return t.jsx(h.Suspense,{fallback:t.jsx(vu,{}),children:t.jsx(D4,{promise:n})})}const D4=n=>{const e=h.use(n.promise);return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e.value})]})]})};function L4(){return t.jsx(h.Suspense,{fallback:t.jsx(vu,{}),children:t.jsx(ex,{message:"这是一个普通的 UI 组件,Skeleton 组件不会有任何渲染机会,直接渲染 Message 组件",title:"Primary"})})}function km(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` +`,rx=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},X4=()=>new Promise(n=>{n({value:"React does not preserve any state for renders that got suspended before they were able to mount for the first time. When the component has loaded, React will retry rendering the suspended tree from scratch."})});function G4(){const n=X4();return t.jsx(f.Suspense,{fallback:"",children:t.jsx(Z4,{promise:n})})}function Z4(n){const{value:e}=f.use(n.promise);return t.jsx(rx,{message:e})}document.documentElement.style.fontSize="14px";function Y4(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function ju(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Q4=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ix=new Headers;ix.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var J4={method:"GET",headers:ix,redirect:"follow",data:"hex"};const P4="https://echo.apifox.com/delay/1",cx=async()=>{await fetch(P4,J4);const n=Math.floor(Math.random()*10)%5;return{value:Q4[n]}};function wm(){const n=cx();return t.jsx(f.Suspense,{fallback:t.jsx(ju,{}),children:t.jsx(W4,{promise:n})})}const W4=n=>{const e=f.use(n.promise);return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e.value})]})]})};function K4(){return t.jsx(f.Suspense,{fallback:t.jsx(ju,{}),children:t.jsx(rx,{message:"这是一个普通的 UI 组件,Skeleton 组件不会有任何渲染机会,直接渲染 Message 组件",title:"Primary"})})}function _m(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"Suspense"})}),` `,t.jsx(e.p,{children:"先来回顾一下这段代码。在前面一篇文中,我们知道,如果直接使用 use 获取未直接创建的 Promise 中的值,会抛出一个异常。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const _api3 = () => { @@ -1107,7 +1107,7 @@ function Content(props) { } `})}),` `,t.jsxs(e.p,{children:["在这段代码中,为了让 Suspense 捕获更小范围的组件,我们单独定义了一个子组件 ",t.jsx(e.code,{children:"Content"})," 来使用 use 获取 promise 中的数据。这也是未来使用的比较常规的思路和手段。案例预览效果如下所示。"]}),` -`,t.jsx(T,{reload:!0,children:t.jsx(R4,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(G4,{})}),` `,t.jsx(e.p,{children:"当然,在开发中更常见的效果是使用 use 读取异步 promise,主要的场景就是接口请求。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:`}> @@ -1151,7 +1151,7 @@ function Content(props) { `,t.jsxs(e.p,{children:["当 Message 组件首次渲染时,由于直接读取 promise 导致报错,Suspense 捕获到该异常后,会渲染 ",t.jsx(e.code,{children:"fallback"})," 中设置的组件。此时我们设置了一个骨架屏 Skeleton 组件,大家可以多次点击 reload 按钮查看演示效果。"]}),` `,t.jsx(e.p,{children:"因此,这个案例的视觉表现应该为:1. 首先渲染 Skeleton 组件。然后请求成功之后,use 渲染 Message 组件。"}),` `,t.jsx(e.p,{children:"演示案例运行结果如下"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(_m,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(wm,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"Suspense 工作原理"})}),` `,t.jsxs(e.p,{children:["Suspense 提供了一个加载数据的标准。在源码中,Suspense 的子组件被称为 ",t.jsx(e.code,{children:"primary"}),"。"]}),` @@ -1187,7 +1187,7 @@ export default function Index() { } `})}),` `,t.jsx(e.p,{children:"渲染结果如下"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(L4,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(K4,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"3"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"新旧实现对比"})}),` `,t.jsx(e.p,{children:"在前面我们 结合 use 与 Suspense 实现了一个初始化加载的案例。该案例的视觉表现是在初始化时,首先显示 Skeleton 组件,请求成功之后,显示 Message 组件。"}),` @@ -1202,7 +1202,7 @@ export default function Index() { } `})}),` `,t.jsx(e.p,{children:"刷新页面时重新请求数据渲染,请求过程中显示骨架屏组件 Skeleton"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(_m,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(wm,{})}),` `,t.jsxs(e.p,{children:["这里我们需要关注的是,对比以前必须要借助 ",t.jsx(e.code,{children:"state"})," ",t.jsx(e.code,{children:"useEffect"})," 的实现方式,体会一下差别。核心逻辑如下"]}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`// 之前的实现方式 export default function Index() { @@ -1262,7 +1262,7 @@ export default function Index() { `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"Vue3 也是这种类似自定义 hook 的方式。但是这两种开发方式是有本质区别的。"}),` `]}),` -`,t.jsx(e.p,{children:"这是我们之前版本的最佳实践。注意体会他们之间的区别。相似,但却不同。我们后续会列举更多案例,尽可能用新的开发思路去复现开发过程中会出现的场景。"})]})}function B4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(km,{...n})}):km(n)}function O4(){const[n,e]=h.useState({value:""}),[s,a]=h.useState(!0);return h.useEffect(()=>{tx().then(l=>{e(l),a(!1)})},[]),s?t.jsx(vu,{}):t.jsxs(t.Fragment,{children:[t.jsx(z4,{message:n.value}),t.jsx("div",{className:"mt-8 text-center",children:t.jsx(M4,{signal:!0,children:"点击下方刷新按钮可重置演示"})})]})}const z4=n=>{const e=n.message;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"a new message!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},U4={"App.js":S4,"api.js":_4,"Button.jsx":w4,"Skeleton.jsx":k4};function H4(){return t.jsx(ae,{files:U4,renderArticle:n=>t.jsx(B4,{components:{code:n}}),caseRender:t.jsx(O4,{})})}const q4=`import {use, useState, Suspense} from 'react' +`,t.jsx(e.p,{children:"这是我们之前版本的最佳实践。注意体会他们之间的区别。相似,但却不同。我们后续会列举更多案例,尽可能用新的开发思路去复现开发过程中会出现的场景。"})]})}function I4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(_m,{...n})}):_m(n)}function F4(){const[n,e]=f.useState({value:""}),[s,a]=f.useState(!0);return f.useEffect(()=>{cx().then(l=>{e(l),a(!1)})},[]),s?t.jsx(ju,{}):t.jsxs(t.Fragment,{children:[t.jsx(ey,{message:n.value}),t.jsx("div",{className:"mt-8 text-center",children:t.jsx(Y4,{signal:!0,children:"点击下方刷新按钮可重置演示"})})]})}const ey=n=>{const e=n.message;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md shadow",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:"a new message!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})},ny={"App.js":U4,"api.js":q4,"Button.jsx":H4,"Skeleton.jsx":V4};function ty(){return t.jsx(W,{files:ny,renderArticle:n=>t.jsx(I4,{components:{code:n}}),caseRender:t.jsx(F4,{})})}const sy=`import {use, useState, Suspense} from 'react' import Message from './Message' import Skeleton from './Skeleton' import Button from './Button' @@ -1297,7 +1297,7 @@ function Content(props) { ) } -`,V4=`import {twMerge} from 'tailwind-merge' +`,ay=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -1337,7 +1337,7 @@ export default function Button(props) { ) } -`,X4=`const random = [ +`,ly=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -1365,7 +1365,7 @@ export const getMessage = async () => { value: random[i] } } -`,G4=`export default function Skeleton(props) { +`,ry=`export default function Skeleton(props) { return (
@@ -1384,7 +1384,7 @@ export const getMessage = async () => {
) } -`,Z4=`const Message = (props) => { +`,iy=`const Message = (props) => { const message = unescape(props.message.replace(/\\\\u/gi,'%u')); const title = unescape((props.title || '').replace(/\\\\u/gi,'%u')); @@ -1417,10 +1417,10 @@ export const getMessage = async () => { } export default Message -`,rl=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function ju(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function bu(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const Y4=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var sx=new Headers;sx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var Q4={method:"GET",headers:sx,redirect:"follow",data:"hex"};const J4="https://echo.apifox.com/delay/1",yu=async()=>{await fetch(J4,Q4);const n=Math.floor(Math.random()*10)%5;return{value:Y4[n]}};function K4(){const[n,e]=h.useState(null);function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(ju,{}),children:t.jsx(W4,{promise:n})})]})}function W4(n){if(!n.promise)return t.jsx(rl,{message:""});const{value:e}=h.use(n.promise);return t.jsx(rl,{message:e})}function P4(){const[n,e]=h.useState(Promise.resolve({value:""}));function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(ju,{}),children:t.jsx(F4,{promise:n})})]})}function F4(n){const{value:e}=h.use(n.promise);return t.jsx(rl,{message:e})}function Cm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"接下来,我们将会以大量的实践案例来展开 React 19 新 hook 的运用。"}),` +`,il=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function vu(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function bu(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const cy=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ox=new Headers;ox.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var oy={method:"GET",headers:ox,redirect:"follow",data:"hex"};const uy="https://echo.apifox.com/delay/1",yu=async()=>{await fetch(uy,oy);const n=Math.floor(Math.random()*10)%5;return{value:cy[n]}};function dy(){const[n,e]=f.useState(null);function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(vu,{}),children:t.jsx(my,{promise:n})})]})}function my(n){if(!n.promise)return t.jsx(il,{message:""});const{value:e}=f.use(n.promise);return t.jsx(il,{message:e})}function py(){const[n,e]=f.useState(Promise.resolve({value:""}));function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(vu,{}),children:t.jsx(fy,{promise:n})})]})}function fy(n){const{value:e}=f.use(n.promise);return t.jsx(il,{message:e})}function km(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"接下来,我们将会以大量的实践案例来展开 React 19 新 hook 的运用。"}),` `,t.jsxs(e.p,{children:["本文模拟的实践案例为",t.jsx(e.strong,{children:"点击按钮更新数据"}),"。这在开发中是一个非常常见的场景。"]}),` `,t.jsx(e.p,{children:"案例完成之后的最终演示效果图如下。案例的视觉表现为:初始化时没有请求,所以组件显示为空数据样式。当我们点击按钮时请求一条数据,数据更新,请求成功之后显示更新之后的内容。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(K4,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(dy,{})}),` `,t.jsx(e.p,{children:"接下来,我们直接用 React 19 新的开发方式来完成这个需求。"}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"基础实现"})}),` @@ -1532,8 +1532,8 @@ const [promise, update] = useState(null) } `})}),` `,t.jsx(e.p,{children:"演示效果如下图所示"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(P4,{})}),` -`,t.jsx(e.p,{children:"这种写法有一个很小的瑕疵,就是在初始化时,也不可避免的显示了 Skeleton 组件,实际上是不需要的。因此具体采用哪种写法,要依据实践中的需求而定。"})]})}function I4(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Cm,{...n})}):Cm(n)}function e3(){const[n,e]=h.useState(null);function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(ju,{}),children:t.jsx(n3,{promise:n})})]})}function n3(n){if(!n.promise)return t.jsx(rl,{message:""});const{value:e}=h.use(n.promise);return t.jsx(rl,{message:e})}const t3={"App.js":q4,"api.js":X4,"Message.jsx":Z4,"Button.jsx":V4,"Skeleton.jsx":G4};function s3(){return t.jsx(ae,{files:t3,renderArticle:n=>t.jsx(I4,{components:{code:n}}),caseRender:t.jsx(e3,{})})}const a3=`import {use, useState, Suspense} from 'react' +`,t.jsx(A,{reload:!0,children:t.jsx(py,{})}),` +`,t.jsx(e.p,{children:"这种写法有一个很小的瑕疵,就是在初始化时,也不可避免的显示了 Skeleton 组件,实际上是不需要的。因此具体采用哪种写法,要依据实践中的需求而定。"})]})}function hy(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(km,{...n})}):km(n)}function xy(){const[n,e]=f.useState(null);function s(){e(yu())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(bu,{onClick:s,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(vu,{}),children:t.jsx(gy,{promise:n})})]})}function gy(n){if(!n.promise)return t.jsx(il,{message:""});const{value:e}=f.use(n.promise);return t.jsx(il,{message:e})}const jy={"App.js":sy,"api.js":ly,"Message.jsx":iy,"Button.jsx":ay,"Skeleton.jsx":ry};function vy(){return t.jsx(W,{files:jy,renderArticle:n=>t.jsx(hy,{components:{code:n}}),caseRender:t.jsx(xy,{})})}const by=`import {use, useState, Suspense} from 'react' import Message from './Message' import Skeleton from './Skeleton' import Button from './Button' @@ -1564,7 +1564,7 @@ function Content(props) { ) } -`,l3=`import {twMerge} from 'tailwind-merge' +`,yy=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -1604,7 +1604,7 @@ export default function Button(props) { ) } -`,r3=`const random = [ +`,Ny=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -1632,7 +1632,7 @@ export const getMessage = async () => { value: random[i] } } -`,c3=`export default function Skeleton(props) { +`,Sy=`export default function Skeleton(props) { return (
@@ -1651,7 +1651,7 @@ export const getMessage = async () => {
) } -`,i3=`const Message = (props) => { +`,wy=`const Message = (props) => { const message = unescape(props.message.replace(/\\\\u/gi,'%u')); const title = unescape((props.title || '').replace(/\\\\u/gi,'%u')); @@ -1684,7 +1684,7 @@ export const getMessage = async () => { } export default Message -`,Nu=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function Su(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function wu(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const o3=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ax=new Headers;ax.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var u3={method:"GET",headers:ax,redirect:"follow",data:"hex"};const d3="https://echo.apifox.com/delay/1",Js=async()=>{await fetch(d3,u3);const n=Math.floor(Math.random()*10)%5;return{value:o3[n]}};function m3(){const[n,e]=h.useState({value:""}),[s,a]=h.useState(!0);h.useEffect(()=>{Js().then(r=>{e(r),a(!1)})},[]);function l(){a(!0),Js().then(r=>{e(r),a(!1)})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:l,children:"更新数据"})}),s?t.jsx(Su,{}):t.jsx(Nu,{message:n.value})]})}function p3(){const[n,e]=h.useState(Js());function s(){e(Js())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:s,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(Su,{}),children:t.jsx(f3,{promise:n})})]})}function f3(n){const{value:e}=h.use(n.promise);return t.jsx(Nu,{message:e})}function Rm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:["在上一章的基础之上,我们做一个小的需求变动。上一章的案例要求我们不要初始化时请求一条数据,因此,默认渲染结果是 ",t.jsx(e.code,{children:"no data"})]}),` +`,Nu=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function Su(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function wu(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const _y=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ux=new Headers;ux.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var ky={method:"GET",headers:ux,redirect:"follow",data:"hex"};const Cy="https://echo.apifox.com/delay/1",Ps=async()=>{await fetch(Cy,ky);const n=Math.floor(Math.random()*10)%5;return{value:_y[n]}};function Ry(){const[n,e]=f.useState({value:""}),[s,a]=f.useState(!0);f.useEffect(()=>{Ps().then(r=>{e(r),a(!1)})},[]);function l(){a(!0),Ps().then(r=>{e(r),a(!1)})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:l,children:"更新数据"})}),s?t.jsx(Su,{}):t.jsx(Nu,{message:n.value})]})}function My(){const[n,e]=f.useState(Ps());function s(){e(Ps())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:s,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(Su,{}),children:t.jsx(Ey,{promise:n})})]})}function Ey(n){const{value:e}=f.use(n.promise);return t.jsx(Nu,{message:e})}function Cm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:["在上一章的基础之上,我们做一个小的需求变动。上一章的案例要求我们不要初始化时请求一条数据,因此,默认渲染结果是 ",t.jsx(e.code,{children:"no data"})]}),` `,t.jsx(e.p,{children:"这一章的案例则不同,我们需要在初始化时请求数据。也就是说,我们此时同时需要初始化和更新的逻辑"}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"需求变动之后的思考"})}),` @@ -1747,7 +1747,7 @@ export default function Demo01() { } `})}),` `,t.jsx(e.p,{children:"演示效果如下案例所示"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(m3,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(Ry,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"新的实现方式"})}),` `,t.jsx(e.p,{children:"与之前版本的实现方式相比,新的开发方式就简单了许多。"}),` @@ -1790,7 +1790,7 @@ function Content(props) { } `})}),` `,t.jsx(e.p,{children:"演示效果如下所示"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(p3,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(My,{})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"非常的方便省事。"})}),` `,t.jsxs(e.p,{children:["最后需要注意的是一个小的细节,如果不考虑 Compiler 编译之后的代码去缓存初始化时的 ",t.jsx(e.code,{children:"getMessage()"}),",那么每次更新组件时,该方法都会执行一次,因此,会导致冗余的接口请求。"]}),` `,t.jsxs(e.blockquote,{children:[` @@ -1800,7 +1800,7 @@ function Content(props) { `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-diff",children:`- const [promise, update] = useState(getMessage()) + const [promise, update] = useState(getMessage) `})}),` -`,t.jsx(e.p,{children:"这样,即使不用 Compiler 编译缓存,也不会出现冗余请求的情况。完整的代码和演示案例请在右侧模块中查看。"})]})}function h3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Rm,{...n})}):Rm(n)}function x3(){const[n,e]=h.useState(Js);function s(){e(Js())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:s,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(Su,{}),children:t.jsx(g3,{promise:n})})]})}function g3(n){const{value:e}=h.use(n.promise);return t.jsx(Nu,{message:e})}const v3={"App.js":a3,"api.js":r3,"Message.jsx":i3,"Button.jsx":l3,"Skeleton.jsx":c3};function j3(){return t.jsx(ae,{files:v3,renderArticle:n=>t.jsx(h3,{components:{code:n}}),caseRender:t.jsx(x3,{})})}const b3=`import {use, useState, Suspense, useEffect} from 'react' +`,t.jsx(e.p,{children:"这样,即使不用 Compiler 编译缓存,也不会出现冗余请求的情况。完整的代码和演示案例请在右侧模块中查看。"})]})}function Ay(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Cm,{...n})}):Cm(n)}function dx(){const[n,e]=f.useState(Ps);function s(){e(Ps())}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(wu,{onClick:s,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(Su,{}),children:t.jsx(Ty,{promise:n})})]})}function Ty(n){const{value:e}=f.use(n.promise);return t.jsx(Nu,{message:e})}const $y={"App.js":by,"api.js":Ny,"Message.jsx":wy,"Button.jsx":yy,"Skeleton.jsx":Sy};function Ly(){return t.jsx(W,{files:$y,renderArticle:n=>t.jsx(Ay,{components:{code:n}}),caseRender:t.jsx(dx,{})})}const Dy=`import {use, useState, Suspense, useEffect} from 'react' import Userinfo from './Userinfo' import Skeleton from './Skeleton' import Button from './Button' @@ -1833,7 +1833,7 @@ function User(props) { ) } -`,y3=`import {twMerge} from 'tailwind-merge' +`,Oy=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -1873,7 +1873,7 @@ export default function Button(props) { ) } -`,N3=`const random = [ +`,By=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -1914,7 +1914,7 @@ function getUuid() { let uuid = s.join("") return uuid } -`,S3=`export default function Skeleton(props) { +`,zy=`export default function Skeleton(props) { return (
@@ -1933,7 +1933,7 @@ function getUuid() {
) } -`,w3=`const Userinfo = (props) => { +`,Uy=`const Userinfo = (props) => { const message = unescape(props.message.replace(/\\\\u/gi,'%u')); const username = unescape((props.username || '').replace(/\\\\u/gi,'%u')); const index = props.index || 0; @@ -1952,7 +1952,7 @@ function getUuid() { } export default Userinfo -`,lx=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.username||"").replace(/\\u/gi,"%u")),a=n.index||0;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md my-4 items-start",children:[t.jsx("img",{className:"w-10",src:`https://api.dicebear.com/7.x/miniavs/svg?seed=${a}`,alt:""}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"no name"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})};function rx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function cx(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const _3=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var ix=new Headers;ix.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var k3={method:"GET",headers:ix,redirect:"follow",data:"hex"};const C3="https://echo.apifox.com/delay/1",Dr=async()=>{await fetch(C3,k3);const n=Math.floor(Math.random()*10)%5;return{value:_3[n],id:R3()}};function R3(){for(var n=[],e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=0;s<16;s++)n[s]=e.substr(Math.floor(Math.random()*16),1);return n[8]="-",n.join("")}function E3(){const[n,e]=h.useState([]);h.useEffect(()=>{e([...n,{type:"loading"}]),Dr().then(a=>{e([...n,a])})},[]);function s(){e([...n,{type:"loading"}]),Dr().then(a=>{e([...n,a])})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(cx,{onClick:s,children:"新增数据"})}),t.jsx(M3,{list:n})]})}function M3(n){const e=n.list;return t.jsx(t.Fragment,{children:e.map((s,a)=>s.type==="loading"?t.jsx(rx,{},`hello ${a}`):t.jsx(lx,{index:a,username:s.id,message:s.value},`h${a}`))})}function Em(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"这一章我们要学习的是一个新增加载项到列表的案例。首先我们会通过接口获取到一条数据,然后将该数据渲染到列表中。你可以先通过右侧预览查看最终演示效果。"}),` +`,mx=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.username||"").replace(/\\u/gi,"%u")),a=n.index||0;return t.jsxs("div",{className:"flex border border-blue-100 p-4 rounded-md my-4 items-start",children:[t.jsx("img",{className:"w-10",src:`https://api.dicebear.com/7.x/miniavs/svg?seed=${a}`,alt:""}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"no name"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]})};function px(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function fx(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const Hy=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var hx=new Headers;hx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var qy={method:"GET",headers:hx,redirect:"follow",data:"hex"};const Vy="https://echo.apifox.com/delay/1",Dr=async()=>{await fetch(Vy,qy);const n=Math.floor(Math.random()*10)%5;return{value:Hy[n],id:Xy()}};function Xy(){for(var n=[],e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=0;s<16;s++)n[s]=e.substr(Math.floor(Math.random()*16),1);return n[8]="-",n.join("")}function Gy(){const[n,e]=f.useState([]);f.useEffect(()=>{e([...n,{type:"loading"}]),Dr().then(a=>{e([...n,a])})},[]);function s(){e([...n,{type:"loading"}]),Dr().then(a=>{e([...n,a])})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(fx,{onClick:s,children:"新增数据"})}),t.jsx(Zy,{list:n})]})}function Zy(n){const e=n.list;return t.jsx(t.Fragment,{children:e.map((s,a)=>s.type==="loading"?t.jsx(px,{},`hello ${a}`):t.jsx(mx,{index:a,username:s.id,message:s.value},`h${a}`))})}function Rm(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"这一章我们要学习的是一个新增加载项到列表的案例。首先我们会通过接口获取到一条数据,然后将该数据渲染到列表中。你可以先通过右侧预览查看最终演示效果。"}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"使用旧的方案实现"})}),` `,t.jsx(e.p,{children:"首先,先定义请求数据的 promise"}),` @@ -2040,7 +2040,7 @@ function List(props) { } `})}),` `,t.jsx(e.p,{children:"案例演示效果如下所示"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(E3,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(Gy,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"新的思路"})}),` `,t.jsx(e.p,{children:"旧的思路在实现上非常巧妙。但是简洁度依然弱于新的实现方案。除此之外,旧的实现思路还有许多问题需要处理,例如初始化时请求了两次,我们要考虑接口防重的问题。以及当我们多次连续点击按钮时,会出现竞态问题而导致渲染结果出现混乱。"}),` @@ -2057,7 +2057,7 @@ function List(props) { `,t.jsx(e.p,{children:"处理好之后,我们只需要使用 map 遍历该数组即可。在遍历逻辑中,每一项都返回 Suspense 包裹的子组件。我们将 promise 传递给该子组件,并在子组件中使用 use 读取 promise 中的值。"}),` `,t.jsx(e.p,{children:"最终的完整代码与演示结果请在右侧案例中查看。"}),` `,t.jsx(e.p,{children:"此时通过案例演示结果可以观察到,初始化时的接口重复问题被解决掉了,并且当我们多次连续点击新增时,也不会出现接口竞态混乱的问题。"}),` -`,t.jsx(e.p,{children:"希望大家能够通过这个案例,进一步感受到新的开发思维的强大之处。"})]})}function A3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Em,{...n})}):Em(n)}function T3(){const[n,e]=h.useState(()=>[Dr()]);function s(){e([...n,Dr()])}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(cx,{onClick:s,children:"新增数据"})}),n.map((a,l)=>t.jsx(h.Suspense,{fallback:t.jsx(rx,{}),children:t.jsx($3,{promise:a,index:l})},`hello ${l}`))]})}function $3(n){const e=h.use(n.promise);return t.jsx(lx,{index:n.index,username:e.id,message:e.value})}const D3={"App.js":b3,"api.js":N3,"Userinfo.jsx":w3,"Button.jsx":y3,"Skeleton.jsx":S3};function L3(){return t.jsx(ae,{files:D3,renderArticle:n=>t.jsx(A3,{components:{code:n}}),caseRender:t.jsx(T3,{})})}const B3=`import { useState, Suspense } from 'react'; +`,t.jsx(e.p,{children:"希望大家能够通过这个案例,进一步感受到新的开发思维的强大之处。"})]})}function Yy(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Rm,{...n})}):Rm(n)}function Qy(){const[n,e]=f.useState(()=>[Dr()]);function s(){e([...n,Dr()])}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(fx,{onClick:s,children:"新增数据"})}),n.map((a,l)=>t.jsx(f.Suspense,{fallback:t.jsx(px,{}),children:t.jsx(Jy,{promise:a,index:l})},`hello ${l}`))]})}function Jy(n){const e=f.use(n.promise);return t.jsx(mx,{index:n.index,username:e.id,message:e.value})}const Py={"App.js":Dy,"api.js":By,"Userinfo.jsx":Uy,"Button.jsx":Oy,"Skeleton.jsx":zy};function Wy(){return t.jsx(W,{files:Py,renderArticle:n=>t.jsx(Yy,{components:{code:n}}),caseRender:t.jsx(Qy,{})})}const Ky=`import { useState, Suspense } from 'react'; import List from './List' import Button from './Button' import Skeleton from './Skeleton' @@ -2084,7 +2084,7 @@ const Index = () => { ); }; export default Index; -`,O3=`import {twMerge} from 'tailwind-merge' +`,Iy=`import {twMerge} from 'tailwind-merge' import clsx from 'clsx' document.documentElement.style.fontSize = '14px' @@ -2124,14 +2124,14 @@ export default function Button(props) { ) } -`,z3=`const count = 3; +`,Fy=`const count = 3; const fakeDataUrl = \`https://randomuser.me/api/?results=\${count}&inc=name,gender,email,nat,picture&noinfo\`; export const fetchList = async () => { const res = await fetch(fakeDataUrl) return res.json() } -`,U3=`// header +`,e3=`// header export default function Skeleton(props) { return (
@@ -2150,7 +2150,7 @@ export default function Skeleton(props) {
) } -`,H3=`import { use } from 'react'; +`,n3=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) return ( @@ -2238,7 +2238,7 @@ export default function CurrentList({promise}) { `,t.jsx(e.p,{children:"完整的代码与演示效果请查看右侧案例。"}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"分页参数的维护、最后一页的判断,大家在实践中要自行维护,这里只做方案的演示,没有考虑所有边界情况"}),` -`]})]})}function q3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Mm,{...n})}):Mm(n)}function V3({promise:n}){const{results:e}=h.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border-b py-4 mx-4 items-center border-dashed",children:[t.jsx("img",{className:"w-14 h-14 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 repo, a design language for background applications"})]})]},s.name.last))})}document.documentElement.style.fontSize="14px";function X3(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function G3(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})})}const Z3=3,Y3=`https://randomuser.me/api/?results=${Z3}&inc=name,gender,email,nat,picture&noinfo`,Am=async()=>(await fetch(Y3)).json(),Q3=()=>{const[n,e]=h.useState(()=>[Am()]),s=()=>{e([...n,Am()])};return t.jsxs(t.Fragment,{children:[n.map((a,l)=>t.jsx(h.Suspense,{fallback:t.jsx(G3,{}),children:t.jsx(V3,{promise:a})},`hello ${l}`)),t.jsx("div",{className:"text-center my-4",children:t.jsx(X3,{onClick:s,children:"loading more"})})]})},J3={"App.js":B3,"api.js":z3,"List.jsx":H3,"Button.jsx":O3,"Skeleton.jsx":U3};function K3(){return t.jsx(ae,{files:J3,renderArticle:n=>t.jsx(q3,{components:{code:n}}),caseRender:t.jsx(Q3,{})})}const W3=`import {useState, Suspense} from 'react' +`]})]})}function t3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Mm,{...n})}):Mm(n)}function s3({promise:n}){const{results:e}=f.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border-b py-4 mx-4 items-center border-dashed",children:[t.jsx("img",{className:"w-14 h-14 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 repo, a design language for background applications"})]})]},s.name.last))})}document.documentElement.style.fontSize="14px";function a3(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}function l3(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})})}const r3=3,i3=`https://randomuser.me/api/?results=${r3}&inc=name,gender,email,nat,picture&noinfo`,Em=async()=>(await fetch(i3)).json(),c3=()=>{const[n,e]=f.useState(()=>[Em()]),s=()=>{e([...n,Em()])};return t.jsxs(t.Fragment,{children:[n.map((a,l)=>t.jsx(f.Suspense,{fallback:t.jsx(l3,{}),children:t.jsx(s3,{promise:a})},`hello ${l}`)),t.jsx("div",{className:"text-center my-4",children:t.jsx(a3,{onClick:s,children:"loading more"})})]})},o3={"App.js":Ky,"api.js":Fy,"List.jsx":n3,"Button.jsx":Iy,"Skeleton.jsx":e3};function u3(){return t.jsx(W,{files:o3,renderArticle:n=>t.jsx(t3,{components:{code:n}}),caseRender:t.jsx(c3,{})})}const d3=`import {useState, Suspense} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' import List from './List' @@ -2262,7 +2262,7 @@ export default function Demo01() {
) } -`,P3=`export const fetchList = async (number) => { +`,m3=`export const fetchList = async (number) => { const res = await fetch(\`https://randomuser.me/api/?results=\${number}&inc=name,gender,email,nat,picture&noinfo\`) return res.json() } @@ -2288,7 +2288,7 @@ export const fetchListWithCancel = (number) => { } return promise } -`,F3=`document.documentElement.style.fontSize = '14px' +`,p3=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -2309,7 +2309,7 @@ export default function Skeleton(props) {
) } -`,I3=`import { use } from 'react'; +`,f3=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) console.log('我会执行几次呢') @@ -2327,7 +2327,7 @@ export default function CurrentList({promise}) {
) } -`,ey=`export default function Input(props) { +`,h3=`export default function Input(props) { const {...other} = props return (
@@ -2343,7 +2343,7 @@ export default function CurrentList({promise}) {
) } -`;document.documentElement.style.fontSize="14px";function ny(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Tm=async n=>(await fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`)).json();function ty({promise:n}){const{results:e}=h.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function sy(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function ay(){const[n,e]=h.useState(()=>Tm(5));function s(a){const l=a.target.value.length%10;e(Tm(l))}return t.jsxs("div",{children:[t.jsx(sy,{onChange:s,placeholder:"Enter something"}),t.jsx(h.Suspense,{fallback:t.jsx(ny,{}),children:t.jsx(ty,{promise:n})})]})}function $m(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(ay,{})}),` +`;document.documentElement.style.fontSize="14px";function x3(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Am=async n=>(await fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`)).json();function g3({promise:n}){const{results:e}=f.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function j3(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function v3(){const[n,e]=f.useState(()=>Am(5));function s(a){const l=a.target.value.length%10;e(Am(l))}return t.jsxs("div",{children:[t.jsx(j3,{onChange:s,placeholder:"Enter something"}),t.jsx(f.Suspense,{fallback:t.jsx(x3,{}),children:t.jsx(g3,{promise:n})})]})}function Tm(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(v3,{})}),` `,t.jsx(e.p,{children:"这是一个搜索的案例。当我们学会把数据存放在 promise 中时,实现这个案例的代码将会非常简单。案例演示如上面所示。"}),` `,t.jsx(e.p,{children:"首先,我们需要定义一个 List 组件,用于显示列表数据。我们计划将列表数据存放在一个 promise 中,然后使用 use 从该 promise 中读取列表然后渲染。"}),` `,t.jsx(e.p,{children:"因此,该 List 组件的代码如下所示"}),` @@ -2468,7 +2468,7 @@ alert(signal.aborted); // true update(fetchListWithCancel(len)) } `})}),` -`,t.jsx(e.p,{children:"其他的逻辑基本保持不变,完整代码和演示效果请在右侧区域查看。请务必结合调试工具中的网络请求一起观察演示效果。"})]})}function ly(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx($m,{...n})}):$m(n)}const ry={"App.js":W3,"api.js":P3,"List.jsx":I3,"Input.jsx":ey,"Skeleton.jsx":F3};function cy(){return t.jsx(ae,{files:ry,renderArticle:n=>t.jsx(ly,{components:{code:n}})})}const iy=`import {useState, Suspense} from 'react' +`,t.jsx(e.p,{children:"其他的逻辑基本保持不变,完整代码和演示效果请在右侧区域查看。请务必结合调试工具中的网络请求一起观察演示效果。"})]})}function b3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Tm,{...n})}):Tm(n)}const y3={"App.js":d3,"api.js":m3,"List.jsx":f3,"Input.jsx":h3,"Skeleton.jsx":p3};function N3(){return t.jsx(W,{files:y3,renderArticle:n=>t.jsx(b3,{components:{code:n}})})}const xx=`import {useState, Suspense} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' import Tabs from './Tabs' @@ -2506,7 +2506,7 @@ export default function Example() {
) } -`,oy=`export const fetchList = async (number) => { +`,gx=`export const fetchList = async (number) => { const res = await fetch(\`https://randomuser.me/api/?results=\${number}&inc=name,gender,email,nat,picture&noinfo\`) return res.json() } @@ -2532,7 +2532,7 @@ export const fetchListWithCancel = (number) => { } return promise } -`,uy=`document.documentElement.style.fontSize = '14px' +`,jx=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -2553,7 +2553,7 @@ export default function Skeleton(props) { ) } -`,dy=`import { use } from 'react'; +`,vx=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) console.log('我会执行几次呢') @@ -2571,7 +2571,7 @@ export default function CurrentList({promise}) { ) } -`,my=`function classNames(...classes) { +`,bx=`function classNames(...classes) { return classes.filter(Boolean).join(' ') } @@ -2619,7 +2619,7 @@ export default function Tabs({tabs, onSwitch}) { ) } -`;function py(...n){return n.filter(Boolean).join(" ")}function ox({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:py(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:l=>{l.preventDefault(),e(a)},children:s.name},s.name))})})]})}const Vl=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function fy(){const[n,e]=h.useState(0);function s(a){Vl[n].current=!1,Vl[a].current=!0,e(a)}return t.jsxs("div",{children:[t.jsx(ox,{tabs:Vl,onSwitch:s}),t.jsxs("div",{className:"mt-4 text-gray-500",children:["当前选中:",Vl[n].name]})]})}function Dm(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"Tab 切换的过程中,请求接口也是日常开发中非常常见的交互方式。不过 tabs 切换的情况比较多,很考验开发者的个人能力。我们准备了三个不同的场景以供大家直接学习。"}),` +`;function S3(...n){return n.filter(Boolean).join(" ")}function yx({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:S3(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:l=>{l.preventDefault(),e(a)},children:s.name},s.name))})})]})}const Xl=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function w3(){const[n,e]=f.useState(0);function s(a){Xl[n].current=!1,Xl[a].current=!0,e(a)}return t.jsxs("div",{children:[t.jsx(yx,{tabs:Xl,onSwitch:s}),t.jsxs("div",{className:"mt-4 text-gray-500",children:["当前选中:",Xl[n].name]})]})}function $m(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"Tab 切换的过程中,请求接口也是日常开发中非常常见的交互方式。不过 tabs 切换的情况比较多,很考验开发者的个人能力。我们准备了三个不同的场景以供大家直接学习。"}),` `,t.jsxs(e.p,{children:["第一个案例比较简单。是",t.jsx(e.strong,{children:"多对一"}),":多个 tab 按钮,对应一个组件。具体表现为按钮切换时,该组件本身重新获取数据渲染。演示效果如右侧案例所示。"]}),` `,t.jsxs(e.p,{children:["首先,我们需要先封装一个 Tab 切换按钮。具体的封装代码可以查看右面的 ",t.jsx(e.code,{children:"Tabs.jsx"})," 文件。"]}),` `,t.jsx(e.p,{children:"然后使用一下,检测一下效果"}),` @@ -2652,7 +2652,7 @@ export default function Example() { ) } `})}),` -`,t.jsx(T,{children:t.jsx(fy,{})}),` +`,t.jsx(A,{children:t.jsx(w3,{})}),` `,t.jsx(e.p,{children:"这里需要注意观察的是,案例中我们对 tabs 数据和 current 当前选中项的一个管理方式。在使用过程中,我们可以尽量减少对于 state 的使用,能不用就不用。但是许多人在开发过程中会非常依赖于 state,管理不善时,可能会导致数据的大量冗余 re-render 产生。这里当我们切换点击时,会修改两个数据,但是最终只有一个 state 变化。"}),` `,t.jsx(e.p,{children:"接下来的事情就比较简单了,跟之前的案例一样,只需要在切换时,通过改变 promise 的方式请求接口即可。"}),` `,t.jsx(e.p,{children:"所以我们需要声明一个新的状态 promise"}),` @@ -2669,7 +2669,7 @@ export default function Example() { + update(fetchListWithCancel(len)) } `})}),` -`,t.jsx(e.p,{children:"这里我们依然需要取消上一次请求是因为可能有的使用者会连续快速切换,我们可以通过取消为完成请求的方式让页面响应变得合理与流畅。完整的案例请看右侧区域。"})]})}function hy(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Dm,{...n})}):Dm(n)}document.documentElement.style.fontSize="14px";function xy(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Lm=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function gy({promise:n}){const{results:e}=h.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}const Fc=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function vy(){const[n,e]=h.useState(0),[s,a]=h.useState(()=>Lm(5));function l(r){Fc[n].current=!1,Fc[r].current=!0,e(r),s.cancel();const c=Math.floor(Math.random()*10);a(Lm(c))}return t.jsxs("div",{children:[t.jsx(ox,{tabs:Fc,onSwitch:l}),t.jsx(h.Suspense,{fallback:t.jsx(xy,{}),children:t.jsx(gy,{promise:s})})]})}const jy={"App.js":iy,"api.js":oy,"List.jsx":dy,"Tabs.jsx":my,"Skeleton.jsx":uy};function by(){return t.jsx(ae,{files:jy,renderArticle:n=>t.jsx(hy,{components:{code:n}}),caseRender:t.jsx(vy,{})})}const yy=`import {useState, Suspense, useRef} from 'react' +`,t.jsx(e.p,{children:"这里我们依然需要取消上一次请求是因为可能有的使用者会连续快速切换,我们可以通过取消为完成请求的方式让页面响应变得合理与流畅。完整的案例请看右侧区域。"})]})}function _3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx($m,{...n})}):$m(n)}document.documentElement.style.fontSize="14px";function k3(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Lm=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function C3({promise:n}){const{results:e}=f.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}const Ii=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function Nx(){const[n,e]=f.useState(0),[s,a]=f.useState(()=>Lm(5));function l(r){Ii[n].current=!1,Ii[r].current=!0,e(r),s.cancel();const i=Math.floor(Math.random()*10);a(Lm(i))}return t.jsxs("div",{children:[t.jsx(yx,{tabs:Ii,onSwitch:l}),t.jsx(f.Suspense,{fallback:t.jsx(k3,{}),children:t.jsx(C3,{promise:s})})]})}const R3={"App.js":xx,"api.js":gx,"List.jsx":vx,"Tabs.jsx":bx,"Skeleton.jsx":jx};function M3(){return t.jsx(W,{files:R3,renderArticle:n=>t.jsx(_3,{components:{code:n}}),caseRender:t.jsx(Nx,{})})}const E3=`import {useState, Suspense, useRef} from 'react' import Tabs from './Tabs' import Account from './Account' @@ -2710,7 +2710,7 @@ export default function Example() { ) } -`,Ny=`export const fetchListWithCancel = (number) => { +`,A3=`export const fetchListWithCancel = (number) => { let controller = new AbortController(); let signal = controller.signal; const promise = new Promise(resolve => { @@ -2731,7 +2731,7 @@ export default function Example() { } return promise } -`,Sy=`document.documentElement.style.fontSize = '14px' +`,T3=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -2752,7 +2752,7 @@ export default function Skeleton(props) { ) } -`,wy=`import { use } from 'react'; +`,$3=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) @@ -2770,7 +2770,7 @@ export default function CurrentList({promise}) { ) } -`,_y=`export default function Input(props) { +`,L3=`export default function Input(props) { const {...other} = props return (
@@ -2786,7 +2786,7 @@ export default function CurrentList({promise}) {
) } -`,ky=`import clsx from 'clsx' +`,D3=`import clsx from 'clsx' import {useState, Suspense} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' @@ -2807,7 +2807,7 @@ export default function Account(props) { ) } -`,Cy=`import clsx from 'clsx' +`,O3=`import clsx from 'clsx' import {useState, Suspense} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' @@ -2836,7 +2836,7 @@ export default function Search(props) { ) } -`,Ry=`function classNames(...classes) { +`,B3=`function classNames(...classes) { return classes.filter(Boolean).join(' ') } @@ -2881,7 +2881,7 @@ export default function Tabs({tabs, onSwitch}) { ) } -`;function Ey(...n){return n.filter(Boolean).join(" ")}function My({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:Ey(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:()=>e(a),children:s.name},s.name))})})]})}document.documentElement.style.fontSize="14px";function ux(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const to=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function dx({promise:n}){const{results:e}=h.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function Ic(n){const[e,s]=h.useState(()=>to(5)),a=se({hidden:!n.selected});return t.jsx("div",{className:a,children:t.jsx(h.Suspense,{fallback:t.jsx(ux,{}),children:t.jsx(dx,{promise:e})})})}function Ay(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function Ty(n){const[e,s]=h.useState(()=>to(10));function a(r){e.cancel();const c=r.target.value.length%10;s(to(c))}const l=se("pt-4",{hidden:!n.selected});return t.jsxs("div",{className:l,children:[t.jsx(Ay,{onChange:a,placeholder:"Enter something"}),t.jsx(h.Suspense,{fallback:t.jsx(ux,{}),children:t.jsx(dx,{promise:e})})]})}function $y(){const[n,e]=h.useState(0),s=h.useRef([{name:"My Account",href:"#",current:!0,element:Ic},{name:"Company",href:"#",current:!1,element:Ic},{name:"Team Members",href:"#",current:!1,element:Ic},{name:"Billing",href:"#",current:!1,element:Ty}]),a=h.useRef(new Set([s.current[n]]));function l(c){s.current[n].current=!1,s.current[c].current=!0;const i=s.current[c];a.current.has(i)||a.current.add(i),e(c)}let r=Array.from(a.current);return t.jsxs("div",{children:[t.jsx(My,{tabs:s.current,onSwitch:l}),r.map((c,i)=>t.jsx(c.element,{selected:c.current},`z-${i}`))]})}function Bm(n){const e={blockquote:"blockquote",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{reload:!0,children:t.jsx($y,{})}),` +`;function z3(...n){return n.filter(Boolean).join(" ")}function U3({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:z3(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:()=>e(a),children:s.name},s.name))})})]})}document.documentElement.style.fontSize="14px";function Sx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const to=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function wx({promise:n}){const{results:e}=f.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function Fi(n){const[e,s]=f.useState(()=>to(5)),a=ae({hidden:!n.selected});return t.jsx("div",{className:a,children:t.jsx(f.Suspense,{fallback:t.jsx(Sx,{}),children:t.jsx(wx,{promise:e})})})}function H3(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function q3(n){const[e,s]=f.useState(()=>to(10));function a(r){e.cancel();const i=r.target.value.length%10;s(to(i))}const l=ae("pt-4",{hidden:!n.selected});return t.jsxs("div",{className:l,children:[t.jsx(H3,{onChange:a,placeholder:"Enter something"}),t.jsx(f.Suspense,{fallback:t.jsx(Sx,{}),children:t.jsx(wx,{promise:e})})]})}function V3(){const[n,e]=f.useState(0),s=f.useRef([{name:"My Account",href:"#",current:!0,element:Fi},{name:"Company",href:"#",current:!1,element:Fi},{name:"Team Members",href:"#",current:!1,element:Fi},{name:"Billing",href:"#",current:!1,element:q3}]),a=f.useRef(new Set([s.current[n]]));function l(i){s.current[n].current=!1,s.current[i].current=!0;const c=s.current[i];a.current.has(c)||a.current.add(c),e(i)}let r=Array.from(a.current);return t.jsxs("div",{children:[t.jsx(U3,{tabs:s.current,onSwitch:l}),r.map((i,c)=>t.jsx(i.element,{selected:i.current},`z-${c}`))]})}function Dm(n){const e={blockquote:"blockquote",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{reload:!0,children:t.jsx(V3,{})}),` `,t.jsx(e.p,{children:"这个案例的实现就稍微有点难度了。我们需要满足如下条件"}),` `,t.jsxs(e.ol,{children:[` `,t.jsx(e.li,{children:"1、初始化时,只渲染默认的当前列页,而不会渲染其他任何未被点击过的页面/组件。"}),` @@ -2944,7 +2944,7 @@ export default function Account(props) { } `})}),` `,t.jsxs(e.p,{children:["这里我们还要考虑一个布局的问题。只能当前选中的页面显示出来。因此我们这里通过利用 ",t.jsx(e.code,{children:"display"})," 的值来控制。传入一个 ",t.jsx(e.code,{children:"selected"})," 来判断是否需要将其值从 ",t.jsx(e.code,{children:"block"})," 改变为 ",t.jsx(e.code,{children:"none"})]}),` -`,t.jsx(e.p,{children:"完整代码与案例演示请看右侧区域。"})]})}function Dy(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Bm,{...n})}):Bm(n)}const Ly={"App.js":yy,"Account.jsx":ky,"Search.jsx":Cy,"api.js":Ny,"Tabs.jsx":Ry,"List.jsx":wy,"Input.jsx":_y,"Skeleton.jsx":Sy};function By(){return t.jsx(ae,{files:Ly,renderArticle:n=>t.jsx(Dy,{components:{code:n}})})}const Oy=`import {useState, Suspense, useCallback} from 'react' +`,t.jsx(e.p,{children:"完整代码与案例演示请看右侧区域。"})]})}function X3(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Dm,{...n})}):Dm(n)}const G3={"App.js":E3,"Account.jsx":D3,"Search.jsx":O3,"api.js":A3,"Tabs.jsx":B3,"List.jsx":$3,"Input.jsx":L3,"Skeleton.jsx":T3};function Z3(){return t.jsx(W,{files:G3,renderArticle:n=>t.jsx(X3,{components:{code:n}})})}const Y3=`import {useState, Suspense, useCallback} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' import Tabs from './Tabs' @@ -2987,7 +2987,7 @@ export default function Example() { ) } -`,zy=`export const fetchList = async (number) => { +`,Q3=`export const fetchList = async (number) => { const res = await fetch(\`https://randomuser.me/api/?results=\${number}&inc=name,gender,email,nat,picture&noinfo\`) return res.json() } @@ -3015,7 +3015,7 @@ export const fetchListWithCancel = (number) => { return promise } -`,Uy=`document.documentElement.style.fontSize = '14px' +`,J3=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -3036,7 +3036,7 @@ export default function Skeleton(props) { ) } -`,Hy=`import { use, useEffect } from 'react'; +`,P3=`import { use, useEffect } from 'react'; function CurrentList({promise, onComplete}) { const {results} = use(promise) @@ -3061,7 +3061,7 @@ function CurrentList({promise, onComplete}) { } export default CurrentList -`,qy=`function classNames(...classes) { +`,W3=`function classNames(...classes) { return classes.filter(Boolean).join(' ') } @@ -3101,7 +3101,7 @@ export default function Tabs({tabs, onSwitch}) { ) } -`;document.documentElement.style.fontSize="14px";function Vy(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Om=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{localStorage.setItem("modal","xxx"),l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function zm(...n){return n.filter(Boolean).join(" ")}function Xy({tabs:n,onSwitch:e}){return t.jsx("div",{children:t.jsx("div",{className:"border-b border-gray-200",children:t.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:n.map((s,a)=>t.jsxs("a",{href:"#",onClick:()=>e(a),className:zm(s.current?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-200 hover:text-gray-700","flex whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium"),"aria-current":s.current?"page":void 0,children:[s.name,s.count?t.jsx("span",{className:zm(s.current?"bg-indigo-100 text-indigo-600":"bg-gray-100 text-gray-900","ml-3 rounded-full px-2.5 py-0.5 text-xs font-medium inline-block"),children:s.count}):null]},s.name))})})})}function Gy({promise:n,onComplete:e}){const{results:s}=h.use(n);return h.useEffect(()=>{e&&e(s.length)},[s.length]),t.jsx("div",{children:s.map((a,l)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:a.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:a.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${l}`))})}const Zy=[{name:"Applied",href:"#",count:0,current:!0},{name:"Phone Screening",href:"#",count:0,current:!1},{name:"Interview",href:"#",count:0,current:!1},{name:"Offer",href:"#",count:0,current:!1},{name:"Disqualified",href:"#",count:0,current:!1}];function Yy(){const[n,e]=h.useState(0),[s,a]=h.useState(()=>Om(5)),[l,r]=h.useState(Zy);function c(o){l.forEach(u=>{u.current=!1}),l[o].current=!0,e(o),r([...l]),s.cancel();const d=Math.floor(Math.random()*10);a(Om(d))}function i(o){l[n].count=o,r([...l])}return t.jsxs("div",{children:[t.jsx(Xy,{tabs:l,onSwitch:c}),t.jsx(h.Suspense,{fallback:t.jsx(Vy,{}),children:t.jsx(Gy,{promise:s,onComplete:i})})]})}function Um(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{reload:!0,children:t.jsx(Yy,{})}),` +`;document.documentElement.style.fontSize="14px";function K3(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Om=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{localStorage.setItem("modal","xxx"),l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function Bm(...n){return n.filter(Boolean).join(" ")}function I3({tabs:n,onSwitch:e}){return t.jsx("div",{children:t.jsx("div",{className:"border-b border-gray-200",children:t.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:n.map((s,a)=>t.jsxs("a",{href:"#",onClick:()=>e(a),className:Bm(s.current?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-200 hover:text-gray-700","flex whitespace-nowrap border-b-2 px-1 py-4 text-sm font-medium"),"aria-current":s.current?"page":void 0,children:[s.name,s.count?t.jsx("span",{className:Bm(s.current?"bg-indigo-100 text-indigo-600":"bg-gray-100 text-gray-900","ml-3 rounded-full px-2.5 py-0.5 text-xs font-medium inline-block"),children:s.count}):null]},s.name))})})})}function F3({promise:n,onComplete:e}){const{results:s}=f.use(n);return f.useEffect(()=>{e&&e(s.length)},[s.length]),t.jsx("div",{children:s.map((a,l)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:a.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:a.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${l}`))})}const e6=[{name:"Applied",href:"#",count:0,current:!0},{name:"Phone Screening",href:"#",count:0,current:!1},{name:"Interview",href:"#",count:0,current:!1},{name:"Offer",href:"#",count:0,current:!1},{name:"Disqualified",href:"#",count:0,current:!1}];function n6(){const[n,e]=f.useState(0),[s,a]=f.useState(()=>Om(5)),[l,r]=f.useState(e6);function i(o){l.forEach(d=>{d.current=!1}),l[o].current=!0,e(o),r([...l]),s.cancel();const u=Math.floor(Math.random()*10);a(Om(u))}function c(o){l[n].count=o,r([...l])}return t.jsxs("div",{children:[t.jsx(I3,{tabs:l,onSwitch:i}),t.jsx(f.Suspense,{fallback:t.jsx(K3,{}),children:t.jsx(F3,{promise:s,onComplete:c})})]})}function zm(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{reload:!0,children:t.jsx(n6,{})}),` `,t.jsx(e.p,{children:"有的时候我们需要从 Suspense 包裹的子组件中获取数据。"}),` `,t.jsx(e.p,{children:"注意看这个案例。我设计了一个随机数量的请求,每一次请求返回随机数量的列表,Tabs 中的按钮旁边需要显示当前列表的长度。"}),` `,t.jsx(e.p,{children:"但是此时,和将列表数据直接维护到 state 中不同,此时我们在 state 中维护的是 promise ,然后我们使用 use 从 promise 中读取数据。所以只有子组件使用 use 读取才能获得列表的长度。这个时候,我们如何在保持现有解决方案的前提之下,在父组件中拿到列表的数据呢?"}),` @@ -3134,7 +3134,7 @@ export default function Tabs({tabs, onSwitch}) { changeTabs([...tabs]) } `})}),` -`,t.jsx(e.p,{children:"完整代码与案例演示查看右侧区域。"})]})}function Qy(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Um,{...n})}):Um(n)}const Jy={"App.js":Oy,"api.js":zy,"List.jsx":Hy,"Tabs.jsx":qy,"Skeleton.jsx":Uy};function Ky(){return t.jsx(ae,{files:Jy,renderArticle:n=>t.jsx(Qy,{components:{code:n}})})}const Wy=`import {use, useState, Suspense} from 'react' +`,t.jsx(e.p,{children:"完整代码与案例演示查看右侧区域。"})]})}function t6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(zm,{...n})}):zm(n)}const s6={"App.js":Y3,"api.js":Q3,"List.jsx":P3,"Tabs.jsx":W3,"Skeleton.jsx":J3};function a6(){return t.jsx(W,{files:s6,renderArticle:n=>t.jsx(t6,{components:{code:n}})})}const l6=`import {use, useState, Suspense} from 'react' import Skeleton from './Skeleton' import {fetchList} from './api' import List from './List' @@ -3172,7 +3172,7 @@ function AccountUse(props) { ) } -`,Py=`export const fetchList = async (number) => { +`,r6=`export const fetchList = async (number) => { const res = await fetch(\`https://randomuser.me/api/?results=\${number}&inc=name,gender,email,nat,picture&noinfo\`) return res.json() } @@ -3198,7 +3198,7 @@ export const fetchListWithCancel = (number) => { } return promise } -`,Fy=`document.documentElement.style.fontSize = '14px' +`,i6=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { if (props.type === 'card') { @@ -3259,7 +3259,7 @@ export default function Skeleton(props) { ) } -`,Iy=`import { use } from 'react'; +`,c6=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) return ( @@ -3276,7 +3276,7 @@ export default function CurrentList({promise}) { ) } -`;document.documentElement.style.fontSize="14px";function mx(n){return n.type==="card"?t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsx("div",{className:"animate-pulse flex space-x-4 items-center",children:[1,2,3].map((e,s)=>t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"rounded-md bg-slate-200 h-32"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-2",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"grid grid-cols-4 gap-4 mt-2",children:t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-3"})})]},`z-${s}`))})}):n.type==="header"?t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})}):t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const px=async n=>(await fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`)).json();function e6({promise:n}){const{results:e}=h.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function n6(){const[n,e]=h.useState(()=>px(3));return t.jsx("div",{children:t.jsx(h.Suspense,{fallback:t.jsx(mx,{type:"card"}),children:t.jsx(t6,{promise:n})})})}function t6(n){const{results:e}=h.use(n.promise),[s,a]=h.useState(()=>px(5));return t.jsxs("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:[t.jsx("div",{className:"flex space-x-4",children:e.map((l,r)=>t.jsxs("div",{className:"flex-1 overflow-hidden",children:[t.jsx("div",{className:"rounded-md h-32 overflow-hidden bg-cover bg-no-repeat bg-center",style:{backgroundImage:`url(${l.picture.large})`}}),t.jsx("div",{className:"mt-4 font-bold",children:l.name.last}),t.jsx("div",{className:"mt-1 text-gray-400 text-sm",children:l.email})]},`z-${r}`))}),t.jsx("div",{className:"mt-8 text-gray-400 text-sm",children:"Account users"}),t.jsx(h.Suspense,{fallback:t.jsx(mx,{}),children:t.jsx(e6,{promise:s})})]})}function s6(){return t.jsx("div",{children:t.jsx(n6,{})})}function Hm(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{reload:!0,children:t.jsx(s6,{})}),` +`;document.documentElement.style.fontSize="14px";function _x(n){return n.type==="card"?t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsx("div",{className:"animate-pulse flex space-x-4 items-center",children:[1,2,3].map((e,s)=>t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"rounded-md bg-slate-200 h-32"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-2",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"grid grid-cols-4 gap-4 mt-2",children:t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-3"})})]},`z-${s}`))})}):n.type==="header"?t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4 items-center",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]})})]})]})}):t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const kx=async n=>(await fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`)).json();function o6({promise:n}){const{results:e}=f.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function u6(){const[n,e]=f.useState(()=>kx(3));return t.jsx("div",{children:t.jsx(f.Suspense,{fallback:t.jsx(_x,{type:"card"}),children:t.jsx(d6,{promise:n})})})}function d6(n){const{results:e}=f.use(n.promise),[s,a]=f.useState(()=>kx(5));return t.jsxs("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:[t.jsx("div",{className:"flex space-x-4",children:e.map((l,r)=>t.jsxs("div",{className:"flex-1 overflow-hidden",children:[t.jsx("div",{className:"rounded-md h-32 overflow-hidden bg-cover bg-no-repeat bg-center",style:{backgroundImage:`url(${l.picture.large})`}}),t.jsx("div",{className:"mt-4 font-bold",children:l.name.last}),t.jsx("div",{className:"mt-1 text-gray-400 text-sm",children:l.email})]},`z-${r}`))}),t.jsx("div",{className:"mt-8 text-gray-400 text-sm",children:"Account users"}),t.jsx(f.Suspense,{fallback:t.jsx(_x,{}),children:t.jsx(o6,{promise:s})})]})}function m6(){return t.jsx("div",{children:t.jsx(u6,{})})}function Um(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{reload:!0,children:t.jsx(m6,{})}),` `,t.jsxs(e.p,{children:["如案例演示的这样,有的时候,我们需要这种",t.jsx(e.strong,{children:"瀑布流式"}),"的接口请求交互方式。也就是上一个模块请求成功之后,再请求下一个模块。"]}),` `,t.jsx(e.p,{children:"我们可以利用 Suspense 的嵌套来轻松做到这个事情。"}),` `,t.jsx(e.p,{children:"我们可以在父组件中,通过一个 promise 向子组件传递数据"}),` @@ -3323,7 +3323,7 @@ export default function CurrentList({promise}) { } `})}),` `,t.jsx(e.p,{children:"这里需要注意的是,当你决定这样用时,往往后请求的接口都会依赖先请求的结果,如果并没有明确的先后依赖关系,我们并不建议采用这种交互方案。"}),` -`,t.jsx(e.p,{children:"完整的代码和案例演示看右侧区域。"})]})}function a6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Hm,{...n})}):Hm(n)}const l6={"App.js":Wy,"api.js":Py,"List.jsx":Iy,"Skeleton.jsx":Fy};function r6(){return t.jsx(ae,{files:l6,renderArticle:n=>t.jsx(a6,{components:{code:n}})})}const c6=`import React, {useState, Suspense} from 'react' +`,t.jsx(e.p,{children:"完整的代码和案例演示看右侧区域。"})]})}function p6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Um,{...n})}):Um(n)}const f6={"App.js":l6,"api.js":r6,"List.jsx":c6,"Skeleton.jsx":i6};function h6(){return t.jsx(W,{files:f6,renderArticle:n=>t.jsx(p6,{components:{code:n}})})}const x6=`import React, {useState, Suspense} from 'react' import Userinfo from './Userinfo' import Skeleton from './Skeleton' import Button from './Button' @@ -3358,7 +3358,7 @@ function User(props) { ) } -`,i6=`import React from 'react'; +`,g6=`import React from 'react'; import {twMerge} from 'tailwind-merge' import clsx from 'clsx' @@ -3399,7 +3399,7 @@ export default function Button(props) { ) } -`,o6=`const random = [ +`,j6=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -3440,7 +3440,7 @@ function getUuid() { let uuid = s.join("") return uuid } -`,u6=`import React from 'react'; +`,v6=`import React from 'react'; export default function Skeleton(props) { return (
@@ -3460,7 +3460,7 @@ export default function Skeleton(props) {
) } -`,d6=`import React from 'react' +`,b6=`import React from 'react' const Userinfo = (props) => { const message = unescape(props.message.replace(/\\\\u/gi,'%u')); @@ -3481,12 +3481,12 @@ const Userinfo = (props) => { } export default Userinfo -`,m6=`import React from 'react'; +`,y6=`import React from 'react'; import ReactDOM from 'react-dom'; import App from './App' ReactDOM.render(, document.getElementById('root')) -`,p6=`export default function use(promise) { +`,N6=`export default function use(promise) { if (promise.status === 'fulfilled') { return promise.value } else if (promise.status === 'rejected') { @@ -3505,7 +3505,7 @@ ReactDOM.render(, document.getElementById('root')) throw promise } } -`;function qm(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"可以看到,use + Suspense 的结合,可以极大的简化我们的开发代码,在开发体验上的提升是非常明显的。但是,如果由于客观原因,我们的项目无法升级到 React 19,那么我们就无法享受这种开发体验带来的提升了吗?"}),` +`;function Hm(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"可以看到,use + Suspense 的结合,可以极大的简化我们的开发代码,在开发体验上的提升是非常明显的。但是,如果由于客观原因,我们的项目无法升级到 React 19,那么我们就无法享受这种开发体验带来的提升了吗?"}),` `,t.jsx(e.p,{children:"当然不是。早在 React 16 的后期版本中,就提供了对 Suspense 的支持,因此,我们只需要在这个基础之上,自己定义一个 use 方法,去读取 promise 中的值就可以实现我们前面所有章节的效果了。"}),` `,t.jsx(e.p,{children:"自定义的代码如下"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`export default function use(promise) { @@ -3533,7 +3533,7 @@ ReactDOM.render(, document.getElementById('root')) `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-diff",children:`- import React, {use} from 'react' + import use from './use' `})}),` -`,t.jsxs(e.p,{children:["在右侧代码中,我提供了一个完整的案例来使用 use,右侧案例的 React 运行版本是 ",t.jsx(e.code,{children:"react@16.14.0"})]})]})}function f6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(qm,{...n})}):qm(n)}document.documentElement.style.fontSize="14px";var h6=new Headers;h6.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");const x6={"App.js":c6,"index.js":m6,"api.js":o6,"use.js":p6,"Userinfo.jsx":d6,"Button.jsx":i6,"Skeleton.jsx":u6};function g6(){return t.jsx(ae,{files:x6,renderArticle:n=>t.jsx(f6,{components:{code:n}})})}const v6=`import { useRef } from 'react'; +`,t.jsxs(e.p,{children:["在右侧代码中,我提供了一个完整的案例来使用 use,右侧案例的 React 运行版本是 ",t.jsx(e.code,{children:"react@16.14.0"})]})]})}function S6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Hm,{...n})}):Hm(n)}document.documentElement.style.fontSize="14px";var w6=new Headers;w6.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");const _6={"App.js":x6,"index.js":y6,"api.js":j6,"use.js":N6,"Userinfo.jsx":b6,"Button.jsx":g6,"Skeleton.jsx":v6};function k6(){return t.jsx(W,{files:_6,renderArticle:n=>t.jsx(S6,{components:{code:n}})})}const C6=`import { useRef } from 'react'; import Button from 'components/Button' import Post from './Post' @@ -3552,7 +3552,7 @@ export default function App() { ); } -`,j6=`import { useRef, useImperativeHandle } from 'react'; +`,R6=`import { useRef, useImperativeHandle } from 'react'; import Input from './Input' export default function Post({ref}) { @@ -3610,7 +3610,7 @@ function AddComment(props) { ) } -`,b6=`import clsx from 'clsx' +`,M6=`import clsx from 'clsx' import {twMerge} from 'tailwind-merge' export default function Input(props) { @@ -3632,7 +3632,7 @@ export default function Input(props) { ) } -`;function y6(){const n=h.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("input",{ref:n,type:"text",className:"border p-2 rounded-md flex-1"}),t.jsx("button",{onClick:()=>n.current.focus(),className:"ml-3",children:"点击获取焦"})]})}function _u(n){const{ref:e,className:s,...a}=n,r=se("flex items-center border px-2 rounded-md text-gray-500",s);return t.jsxs("div",{className:Pe(r),children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{ref:e,className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...a})]})}function N6(){const n=h.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx(_u,{ref:n,type:"text",className:"flex-1"}),t.jsx("button",{onClick:()=>n.current.focus(),className:"ml-3",children:"点击获取焦"})]})}function S6(){const n=h.useRef(null);function e(){n.current.scrollAndFocusAddComment()}return t.jsxs(t.Fragment,{children:[t.jsx(le,{onClick:e,primary:!0,children:"Write a comment"}),t.jsx(w6,{ref:n})]})}const w6=({ref:n})=>{const e=h.useRef(null),s=h.useRef(null);return h.useImperativeHandle(n,()=>({scrollAndFocusAddComment(){e.current.scrollToBottom(),s.current.focus()}}),[]),t.jsxs(t.Fragment,{children:[t.jsx("article",{children:t.jsx("p",{children:"Welcome to my Blog!"})}),t.jsx(_6,{ref:e}),t.jsx(k6,{ref:s})]})},_6=({ref:n})=>{const e=h.useRef(null);h.useImperativeHandle(n,()=>({scrollToBottom(){const a=e.current;a.scrollTop=a.scrollHeight}}),[]);let s=[];for(let a=0;a<50;a++)s.push(t.jsxs("p",{children:["Comment #",a]},a));return t.jsx("div",{className:"border p-4 rounded h-32 overflow-y-auto",ref:e,children:s})};function k6(n){return t.jsx(_u,{placeholder:"Add comment...",ref:n.ref,className:"mt-4"})}function Vm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` +`;function E6(){const n=f.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("input",{ref:n,type:"text",className:"border p-2 rounded-md flex-1"}),t.jsx("button",{onClick:()=>n.current.focus(),className:"ml-3",children:"点击获取焦"})]})}function _u(n){const{ref:e,className:s,...a}=n,r=ae("flex items-center border px-2 rounded-md text-gray-500",s);return t.jsxs("div",{className:Ke(r),children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{ref:e,className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...a})]})}function A6(){const n=f.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx(_u,{ref:n,type:"text",className:"flex-1"}),t.jsx("button",{onClick:()=>n.current.focus(),className:"ml-3",children:"点击获取焦"})]})}function T6(){const n=f.useRef(null);function e(){n.current.scrollAndFocusAddComment()}return t.jsxs(t.Fragment,{children:[t.jsx(le,{onClick:e,primary:!0,children:"Write a comment"}),t.jsx($6,{ref:n})]})}const $6=({ref:n})=>{const e=f.useRef(null),s=f.useRef(null);return f.useImperativeHandle(n,()=>({scrollAndFocusAddComment(){e.current.scrollToBottom(),s.current.focus()}}),[]),t.jsxs(t.Fragment,{children:[t.jsx("article",{children:t.jsx("p",{children:"Welcome to my Blog!"})}),t.jsx(L6,{ref:e}),t.jsx(D6,{ref:s})]})},L6=({ref:n})=>{const e=f.useRef(null);f.useImperativeHandle(n,()=>({scrollToBottom(){const a=e.current;a.scrollTop=a.scrollHeight}}),[]);let s=[];for(let a=0;a<50;a++)s.push(t.jsxs("p",{children:["Comment #",a]},a));return t.jsx("div",{className:"border p-4 rounded h-32 overflow-y-auto",ref:e,children:s})};function D6(n){return t.jsx(_u,{placeholder:"Add comment...",ref:n.ref,className:"mt-4"})}function qm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"React 中的控制反转"})}),` `,t.jsx(e.p,{children:"在面向对象编程中,IOC (Inversion of Control) 控制反转是一个非常高级的概念。它是一种设计理念,在减少对象之间的耦合关系上有非常重要的作用。"}),` `,t.jsxs(e.blockquote,{children:[` @@ -3656,7 +3656,7 @@ export default function Demo01() { ) } `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(y6,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(E6,{})}),` `,t.jsxs(e.p,{children:["但是许多时候,直接使用 ",t.jsx(e.code,{children:"input"})," 标签并不能满足我们的需求,我们需要基于 input 做额外的封装。但是封装之后,我们还是希望能通过调用 ",t.jsx(e.code,{children:".focus"})," 让输入框获取焦点。"]}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const input = useRef(null) `})}),` @@ -3690,7 +3690,7 @@ export default function Demo02() { ) } `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(N6,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(A6,{})}),` `,t.jsx(e.p,{children:"这个案例中 Input 代码封装逻辑如下"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`import clsx from 'clsx' import {twMerge} from 'tailwind-merge' @@ -3928,7 +3928,7 @@ export default AddComment; `,t.jsx(e.h2,{children:"5"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"总结"})}),` `,t.jsx(e.p,{children:"如果你对封装解耦比较重视,那么你一定能明显感受到,ref 与 useImperativeHandle 的结合能发挥的想象空间远不止于此,这种方式给 React 提供了一种扩展 React 能力的重要手段,因此,当你成为 React 高手之后,你一定会非常喜欢使用它们,他们的组合能让 React 项目变得更加多样化。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(S6,{})})]})}function C6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Vm,{...n})}):Vm(n)}function R6({ref:n}){const e=h.useRef(null),s=h.useRef(null);return h.useImperativeHandle(n,()=>({scrollAndFocusAddComment(){e.current.scrollToBottom(),s.current.focus()}}),[]),t.jsxs(t.Fragment,{children:[t.jsx("article",{children:t.jsx("p",{className:"my-5",children:"Welcome to my Blog!"})}),t.jsx(E6,{ref:e}),t.jsx(M6,{ref:s})]})}const E6=({ref:n})=>{const e=h.useRef(null);h.useImperativeHandle(n,()=>({scrollToBottom(){const a=e.current;a.scrollTop=a.scrollHeight}}),[]);let s=[];for(let a=0;a<50;a++)s.push(t.jsxs("p",{children:["Comment #",a]},a));return t.jsx("div",{className:"border p-4 rounded h-32 overflow-y-auto",ref:e,children:s})};function M6(n){return t.jsx(_u,{placeholder:"Add comment...",ref:n.ref,className:"mt-4"})}function A6(){const n=h.useRef(null);function e(){n.current.scrollAndFocusAddComment()}return t.jsxs(t.Fragment,{children:[t.jsx(le,{onClick:e,primary:!0,children:"Write a comment"}),t.jsx(R6,{ref:n})]})}const T6={"App.js":v6,"Post.jsx":j6,"Button.jsx":gl,"Input.jsx":b6};function $6(){return t.jsx(ae,{files:T6,renderArticle:n=>t.jsx(C6,{components:{code:n}}),caseRender:t.jsx(A6,{})})}const D6=`import { useRef } from 'react' +`,t.jsx(A,{reload:!0,children:t.jsx(T6,{})})]})}function O6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(qm,{...n})}):qm(n)}function B6({ref:n}){const e=f.useRef(null),s=f.useRef(null);return f.useImperativeHandle(n,()=>({scrollAndFocusAddComment(){e.current.scrollToBottom(),s.current.focus()}}),[]),t.jsxs(t.Fragment,{children:[t.jsx("article",{children:t.jsx("p",{className:"my-5",children:"Welcome to my Blog!"})}),t.jsx(z6,{ref:e}),t.jsx(U6,{ref:s})]})}const z6=({ref:n})=>{const e=f.useRef(null);f.useImperativeHandle(n,()=>({scrollToBottom(){const a=e.current;a.scrollTop=a.scrollHeight}}),[]);let s=[];for(let a=0;a<50;a++)s.push(t.jsxs("p",{children:["Comment #",a]},a));return t.jsx("div",{className:"border p-4 rounded h-32 overflow-y-auto",ref:e,children:s})};function U6(n){return t.jsx(_u,{placeholder:"Add comment...",ref:n.ref,className:"mt-4"})}function H6(){const n=f.useRef(null);function e(){n.current.scrollAndFocusAddComment()}return t.jsxs(t.Fragment,{children:[t.jsx(le,{onClick:e,primary:!0,children:"Write a comment"}),t.jsx(B6,{ref:n})]})}const q6={"App.js":C6,"Post.jsx":R6,"Button.jsx":jl,"Input.jsx":M6};function V6(){return t.jsx(W,{files:q6,renderArticle:n=>t.jsx(O6,{components:{code:n}}),caseRender:t.jsx(H6,{})})}const X6=`import { useRef } from 'react' import Dialog from 'components/Dialog' export default function App() { @@ -3949,7 +3949,7 @@ export default function App() { ) } -`,L6=`import { useEffect, useRef, useState, useImperativeHandle } from 'react'; +`,G6=`import { useEffect, useRef, useState, useImperativeHandle } from 'react'; import Modal from '../Modal' import Button from "components/Button"; import clsx from 'clsx' @@ -4093,7 +4093,7 @@ export default function Dialog(props) { ) } -`,B6=`import { useState, useImperativeHandle} from "react"; +`,Z6=`import { useState, useImperativeHandle} from "react"; import s from './index.module.css' import {createPortal} from 'react-dom' import clsx from 'clsx' @@ -4145,7 +4145,7 @@ export default function Modal(props) { ) } -`;function O6(){const n=h.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"点击弹窗显示"}),t.jsx(nc,{ref:n,children:t.jsx("div",{className:"bg-white p-4 max-w-xl mt-48 mx-auto rounded",children:"这是一个小弹窗"})})]})}function Xm(){const n=h.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"点击我,显示对话框组件"}),t.jsxs(ra,{ref:n,title:"Message For You",onSure:()=>n.current.close(),children:[t.jsx("strong",{className:"text-red-500",children:"React 19"})," 是全网学习体验最好的小册,没有之一。它能帮助你快速领悟到 React 的独特的开发魅力,你将会感受到更快的学习速度,更高效的开发速度,更专业的开发思维。",t.jsx("div",{className:"mt-4",children:t.jsx("img",{src:"https://images.unsplash.com/photo-1485856407642-7f9ba0268b51?q=80&w=3540&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",alt:""})})]})]})}function Gm(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(Xm,{})}),` +`;function Y6(){const n=f.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"点击弹窗显示"}),t.jsx(ti,{ref:n,children:t.jsx("div",{className:"bg-white p-4 max-w-xl mt-48 mx-auto rounded",children:"这是一个小弹窗"})})]})}function Vm(){const n=f.useRef(null);return t.jsxs("div",{className:"flex justify-between",children:[t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"点击我,显示对话框组件"}),t.jsxs(ia,{ref:n,title:"Message For You",onSure:()=>n.current.close(),children:[t.jsx("strong",{className:"text-red-500",children:"React 19"})," 是全网学习体验最好的小册,没有之一。它能帮助你快速领悟到 React 的独特的开发魅力,你将会感受到更快的学习速度,更高效的开发速度,更专业的开发思维。",t.jsx("div",{className:"mt-4",children:t.jsx("img",{src:"https://images.unsplash.com/photo-1485856407642-7f9ba0268b51?q=80&w=3540&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",alt:""})})]})]})}function Xm(n){const e={code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(Vm,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"基于 ref 封装一个 Madal 组件"})}),` `,t.jsxs(e.p,{children:["我们的目标是封装一个 Modal 组件,但是我并不需要传入 ",t.jsx(e.code,{children:"show"})," 等状态来控制 Modal 的显示与隐藏。而是使用 ref 来控制。目标代码如下"]}),` @@ -4171,7 +4171,7 @@ export default function Task() { `})}),` `,t.jsxs(e.p,{children:["这里的核心是,当我想要让弹窗显示时,只需要调用 ",t.jsx(e.code,{children:"modal.current.show()"})," 即可。这种方式可以有效避免在应用层组件中声明过多的状态来控制一切。"]}),` `,t.jsx(e.p,{children:"演示案例如下:"}),` -`,t.jsx(T,{children:t.jsx(O6,{})}),` +`,t.jsx(A,{children:t.jsx(Y6,{})}),` `,t.jsx(e.p,{children:"对于刚接触 React 的新人来说,要实现这种带有动画的显示隐藏效果比较困难。我们这里就简单来拆解一下实现思路。"}),` `,t.jsxs(e.p,{children:["首先,基于数据驱动 UI 的思路,那么在弹窗组件内部,我们肯定要首先定义一个状态 ",t.jsx(e.code,{children:"show"}),", 用于控制弹窗的显示与隐藏。"]}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`function Modal() { @@ -4220,7 +4220,7 @@ function __animationendHandler() { `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"基于 Modal 封装 Dialog 组件"})}),` `,t.jsx(e.p,{children:"先来点击按钮感受一下演示效果。"}),` -`,t.jsx(T,{children:t.jsx(Xm,{})}),` +`,t.jsx(A,{children:t.jsx(Vm,{})}),` `,t.jsx(e.p,{children:"这个案例中,比较有难度的是我们记录了鼠标的点击位置,并基于该位置对内部元素进行放大显示。退场时,还要往这个位置进行缩小隐藏。原理并不复杂,只是如果自己实现的话,要稍微花点时间调一下位置的计算。大家在使用时可以直接 copy 这段代码就行,我在兼容性上也做了完整的处理。"}),` `,t.jsx(e.p,{children:"动画是基于缩放 scale 来实现,这里我们只需要基于鼠标点击的位置和目标位置更改变换中心即可,具体的计算细节请看右侧代码。动画 css 代码如下所示。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-css",children:`.dialog.in { @@ -4241,7 +4241,7 @@ function __animationendHandler() { } `})}),` `,t.jsxs(e.p,{children:["这里我们需要观察的是,ref 的多层传递和使用。在我们使用 ",t.jsx(e.code,{children:"Modal"})," 时,并不需要特别关注 ref 在内部是如何处理的,只需要知道如何使用它即可。我们可以利用这种思维把类似的嵌套逻辑简化成单一逻辑。"]}),` -`,t.jsxs(e.p,{children:["最终的代码请看右侧案例中的 ",t.jsx(e.code,{children:"Dialog.jsx"})]})]})}function z6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Gm,{...n})}):Gm(n)}const U6={"App.js":D6,"Dialog.jsx":L6,"Modal.jsx":B6};function H6(){return t.jsx(ae,{files:U6,hidePreview:!0,renderArticle:n=>t.jsx(z6,{components:{code:n}})})}const q6=`import Provider from './context' +`,t.jsxs(e.p,{children:["最终的代码请看右侧案例中的 ",t.jsx(e.code,{children:"Dialog.jsx"})]})]})}function Q6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Xm,{...n})}):Xm(n)}const J6={"App.js":X6,"Dialog.jsx":G6,"Modal.jsx":Z6};function P6(){return t.jsx(W,{files:J6,hidePreview:!0,renderArticle:n=>t.jsx(Q6,{components:{code:n}})})}const W6=`import Provider from './context' import Task from './task' export default function App() { @@ -4253,7 +4253,7 @@ export default function App() { ) } -`,V6=`import {createContext, useState} from 'react' +`,K6=`import {createContext, useState} from 'react' const def = { task: 'TASK-8878', @@ -4271,7 +4271,7 @@ export default function Provider({ children }) { {children} ) } -`,X6=`import { useRef, use } from 'react' +`,I6=`import { useRef, use } from 'react' import Editor from './editor' import {Context} from './context' @@ -4293,7 +4293,7 @@ export default function Demo03() { ) } -`,G6=`import { use } from 'react' +`,F6=`import { use } from 'react' import Dialog from 'components/Dialog' import {Context} from './context.jsx' @@ -4336,7 +4336,7 @@ export default function Editor(props) { ) } -`,Z6={task:"TASK-8878",content:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",status:"Progress",priority:"Medium"},ku=h.createContext({});function Y6({children:n}){const[e,s]=h.useState(Z6);return t.jsx(ku,{value:{task:e,updateTask:s},children:n})}function Q6(n){const{ref:e,...s}=n,{task:a,updateTask:l}=h.use(ku);function r(c){l({...a,content:c.target.value})}return t.jsxs(ra,{ref:e,...s,onSure:()=>e.current.close(),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"w-20",children:"name"}),t.jsx("div",{className:"flex-1 p-2 text-sm font-bold",children:a.task})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"content"}),t.jsx("input",{value:a.content,className:"flex-1 border rounded-md p-2 text-sm",onChange:r})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"status"}),t.jsx("div",{className:"flex-1 p-2 text-sm text-green-500",children:a.status})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"Priority"}),t.jsx("div",{className:"flex-1 p-2 text-sm text-red-500",children:a.priority})]})]})}function J6(){const n=h.useRef(null),{task:e}=h.use(ku);return t.jsxs("div",{className:"flex items-center border-t pt-4",children:[t.jsx("div",{className:"font-bold",children:e.task}),t.jsx("div",{className:"flex-1 mx-3 line-clamp-1",children:e.content}),t.jsx("div",{className:"text-green-500",children:e.status}),t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"edit"}),t.jsx(Q6,{ref:n,title:"Editor"})]})}function Zm(){return t.jsxs(Y6,{children:[t.jsx("h3",{className:"font-bold",children:"Your Task"}),t.jsx("p",{className:"!text-gray-400",children:"Here's a task for you!"}),t.jsx(J6,{})]})}function Ym(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(Zm,{})}),` +`,e7={task:"TASK-8878",content:"Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",status:"Progress",priority:"Medium"},ku=f.createContext({});function n7({children:n}){const[e,s]=f.useState(e7);return t.jsx(ku,{value:{task:e,updateTask:s},children:n})}function t7(n){const{ref:e,...s}=n,{task:a,updateTask:l}=f.use(ku);function r(i){l({...a,content:i.target.value})}return t.jsxs(ia,{ref:e,...s,onSure:()=>e.current.close(),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"w-20",children:"name"}),t.jsx("div",{className:"flex-1 p-2 text-sm font-bold",children:a.task})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"content"}),t.jsx("input",{value:a.content,className:"flex-1 border rounded-md p-2 text-sm",onChange:r})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"status"}),t.jsx("div",{className:"flex-1 p-2 text-sm text-green-500",children:a.status})]}),t.jsxs("div",{className:"flex items-center mt-4",children:[t.jsx("div",{className:"w-20",children:"Priority"}),t.jsx("div",{className:"flex-1 p-2 text-sm text-red-500",children:a.priority})]})]})}function s7(){const n=f.useRef(null),{task:e}=f.use(ku);return t.jsxs("div",{className:"flex items-center border-t pt-4",children:[t.jsx("div",{className:"font-bold",children:e.task}),t.jsx("div",{className:"flex-1 mx-3 line-clamp-1",children:e.content}),t.jsx("div",{className:"text-green-500",children:e.status}),t.jsx("button",{onClick:()=>n.current.show(),className:"ml-3",children:"edit"}),t.jsx(t7,{ref:n,title:"Editor"})]})}function Gm(){return t.jsxs(n7,{children:[t.jsx("h3",{className:"font-bold",children:"Your Task"}),t.jsx("p",{className:"!text-gray-400",children:"Here's a task for you!"}),t.jsx(s7,{})]})}function Zm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(Gm,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"改动"})}),` `,t.jsx(e.p,{children:"与之前的版本相比,在 React19 中,context 有一些细微的变化。主要体现在如下三个方面。"}),` @@ -4484,7 +4484,7 @@ function App() { `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"3"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"案例:在弹窗中更改页面的值"})}),` `,t.jsx(e.p,{children:"学习了 context 的知识之后,我们来结合之前自定义的弹窗组件,一起来实现一下页面最开始的那个案例。"}),` -`,t.jsx(T,{children:t.jsx(Zm,{})}),` +`,t.jsx(A,{children:t.jsx(Gm,{})}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"由于是演示案例,所以数据比较简单,组件层级也不够深,所以大家把重点关注在 context 的技术学习上即可。并非代表真实实践中需要这样使用。"}),` `]}),` @@ -4530,7 +4530,7 @@ export default function Editor(props) { ... `})}),` `,t.jsx(e.p,{children:"完整的代码请查看右侧代码。"}),` -`,t.jsxs(e.p,{children:["这里比较有意思的一个地方是在 ",t.jsx(e.code,{children:"editor.jsx"})," 文件中,对于 ref 的使用和处理,大家可以留心观察一下。"]})]})}function K6(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Ym,{...n})}):Ym(n)}const W6={"App.js":q6,"context.jsx":V6,"task.jsx":X6,"editor.jsx":G6};function P6(){return t.jsx(ae,{files:W6,hidePreview:!0,renderArticle:n=>t.jsx(K6,{components:{code:n}})})}const F6=`import Provider from './context' +`,t.jsxs(e.p,{children:["这里比较有意思的一个地方是在 ",t.jsx(e.code,{children:"editor.jsx"})," 文件中,对于 ref 的使用和处理,大家可以留心观察一下。"]})]})}function a7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Zm,{...n})}):Zm(n)}const l7={"App.js":W6,"context.jsx":K6,"task.jsx":I6,"editor.jsx":F6};function r7(){return t.jsx(W,{files:l7,hidePreview:!0,renderArticle:n=>t.jsx(a7,{components:{code:n}})})}const i7=`import Provider from './context' import Total from './Total' import Card from './Card.jsx' import './skin.css' @@ -4545,7 +4545,7 @@ export default function App() { ) } -`,I6=`import {createContext, useState} from 'react' +`,c7=`import {createContext, useState} from 'react' export const Context = createContext({}) @@ -4561,7 +4561,7 @@ export default function Provider({ children }) { {children} ) } -`,e7=`import {use, useState} from 'react' +`,o7=`import {use, useState} from 'react' import {Context} from './context.jsx' export default function Total() { @@ -4573,7 +4573,7 @@ export default function Total() { ) } -`,n7=`import {use, useState} from 'react' +`,u7=`import {use, useState} from 'react' import {Context} from './context.jsx' import Switch from 'components/Switch' @@ -4602,7 +4602,7 @@ export default function Card() { ) } -`,t7=`@layer context_count { +`,d7=`@layer context_count { .theme-dark { --text-color: rgba(255, 255, 255, 0.8); --bg-color: rgba(0, 0, 0, 0.8); @@ -4619,7 +4619,7 @@ export default function Card() { border: 1px solid var(--border-color); color: var(--text-color); } -`,Cu=h.createContext({});function s7({children:n}){const[e,s]=h.useState(0),a={count:e,incrementer:s};return t.jsx(Cu,{value:a,children:n})}function a7(){const{count:n}=h.use(Cu);return t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold",children:"Total Switch Count"}),t.jsxs("p",{className:"!text-gray-400",children:["这里统计的是所有组件的切换次数: ",n]})]})}function l7(n){const{value:e=!1,onChange:s}=n,[a,l]=h.useState(e),r=a?"switch right":"switch left";function c(i){l(i),s&&s(i)}return t.jsx("div",{className:r,onClick:()=>c(!a),children:t.jsx("div",{className:"circle"})})}function ei(){const{count:n,incrementer:e}=h.use(Cu),[s,a]=h.useState("theme-light"),[l,r]=h.useState(0);function c(i){a(i?"theme-dark":"theme-light"),r(l+1),e(n+1)}return t.jsxs("div",{className:s,children:[t.jsxs("div",{className:"context-card p-4 rounded transition",children:[t.jsx("div",{className:"title font-bold",children:"Canary"}),t.jsx("div",{className:"mt-4",children:"The useActionState Hook is currently only available in React’s Canary and experimental channels. Learn more about release channels here. "})]}),t.jsxs("div",{className:"flex justify-between py-4 items-center",children:[t.jsxs("div",{className:"mr-4 text-green-500",children:["当前组件切换次数: ",l]}),t.jsx(l7,{onChange:c})]})]})}function Qm(){return t.jsxs(s7,{children:[t.jsx(a7,{}),t.jsx(ei,{}),t.jsx(ei,{}),t.jsx(ei,{})]})}function Jm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{reload:!0,children:t.jsx(Qm,{})}),` +`,Cu=f.createContext({});function m7({children:n}){const[e,s]=f.useState(0),a={count:e,incrementer:s};return t.jsx(Cu,{value:a,children:n})}function p7(){const{count:n}=f.use(Cu);return t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold",children:"Total Switch Count"}),t.jsxs("p",{className:"!text-gray-400",children:["这里统计的是所有组件的切换次数: ",n]})]})}function f7(n){const{value:e=!1,onChange:s}=n,[a,l]=f.useState(e),r=a?"switch right":"switch left";function i(c){l(c),s&&s(c)}return t.jsx("div",{className:r,onClick:()=>i(!a),children:t.jsx("div",{className:"circle"})})}function ec(){const{count:n,incrementer:e}=f.use(Cu),[s,a]=f.useState("theme-light"),[l,r]=f.useState(0);function i(c){a(c?"theme-dark":"theme-light"),r(l+1),e(n+1)}return t.jsxs("div",{className:s,children:[t.jsxs("div",{className:"context-card p-4 rounded transition",children:[t.jsx("div",{className:"title font-bold",children:"Canary"}),t.jsx("div",{className:"mt-4",children:"The useActionState Hook is currently only available in React’s Canary and experimental channels. Learn more about release channels here. "})]}),t.jsxs("div",{className:"flex justify-between py-4 items-center",children:[t.jsxs("div",{className:"mr-4 text-green-500",children:["当前组件切换次数: ",l]}),t.jsx(f7,{onChange:i})]})]})}function Ym(){return t.jsxs(m7,{children:[t.jsx(p7,{}),t.jsx(ec,{}),t.jsx(ec,{}),t.jsx(ec,{})]})}function Qm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{reload:!0,children:t.jsx(Ym,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"0"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"皮肤切换方案"})}),` `,t.jsx(e.p,{children:"利用 CSS 变量来实现皮肤切换,是目前最简单优雅的方案,也是最流行的方案。"}),` @@ -4720,7 +4720,7 @@ export default function Total() { } `})}),` `,t.jsx(e.p,{children:"演示效果如下,完整代码,请看右侧代码区域。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(Qm,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(Ym,{})}),` `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"2"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"皮肤切换思路的扩展"})}),` `,t.jsx(e.p,{children:"我们可以把皮肤切换的方案,扩展到类似于 Switch 组件的实现上。在 Switch 组件中,当我们点击时,除了有颜色相关的样式切换之外,还有元素的位置要发生变化,因此,我们只需要额外多设计一个自定义属性就可以用完全一样的思路来实现这个组件了。"}),` @@ -4768,7 +4768,7 @@ export default function Switch(props) { ) } -`})})]})}function r7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Jm,{...n})}):Jm(n)}const c7={"App.js":F6,"context.jsx":I6,"Total.jsx":e7,"Card.jsx":n7,"skin.css":t7};function i7(){return t.jsx(ae,{files:c7,hidePreview:!0,renderArticle:n=>t.jsx(r7,{components:{code:n}})})}const o7=`import {useState, Suspense, useDeferredValue} from 'react' +`})})]})}function h7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Qm,{...n})}):Qm(n)}const x7={"App.js":i7,"context.jsx":c7,"Total.jsx":o7,"Card.jsx":u7,"skin.css":d7};function g7(){return t.jsx(W,{files:x7,hidePreview:!0,renderArticle:n=>t.jsx(h7,{components:{code:n}})})}const j7=`import {useState, Suspense, useDeferredValue} from 'react' import Spin from './Spin' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' @@ -4797,7 +4797,7 @@ export default function App() { ) } -`,u7=`export const fetchList = async (number) => { +`,v7=`export const fetchList = async (number) => { const res = await fetch(\`https://randomuser.me/api/?results=\${number}&inc=name,gender,email,nat,picture&noinfo\`) return res.json() } @@ -4823,7 +4823,7 @@ export const fetchListWithCancel = (number) => { } return promise } -`,d7=`document.documentElement.style.fontSize = '14px' +`,b7=`document.documentElement.style.fontSize = '14px' export default function Skeleton(props) { return ( @@ -4844,7 +4844,7 @@ export default function Skeleton(props) { ) } -`,m7=`import { use } from 'react'; +`,y7=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) console.log('我会执行几次呢') @@ -4862,7 +4862,7 @@ export default function CurrentList({promise}) { ) } -`,p7=`export default function Input(props) { +`,N7=`export default function Input(props) { const {...other} = props return (
@@ -4878,7 +4878,7 @@ export default function CurrentList({promise}) {
) } -`,fx=`import {useState, useEffect} from 'react' +`,Cx=`import {useState, useEffect} from 'react' import clsx from 'clsx' import './index.css' @@ -4917,7 +4917,7 @@ export default function Index(props) { ) } -`,hx=`.spin { +`,Rx=`.spin { position: absolute; left: 0; top: 0; @@ -4944,11 +4944,11 @@ export default function Index(props) { 0% { opacity: 1 } 100% { opacity: 0 } } -`;function Ru(n){const{loading:e,type:s="icon"}=n,[a,l]=h.useState(!1),[r,c]=h.useState(!1);h.useEffect(()=>{e?(l(!0),c(!0)):l(!1)},[e]);const o=se("spin flex items-center justify-center top-0 bg-white bg-opacity-50",{in:a,out:!a});function d(){a||c(!1)}return t.jsxs("div",{className:"relative",children:[n.children,r?t.jsx("div",{className:o,onAnimationEnd:d,children:s==="icon"&&t.jsx("svg",{className:"animate-spin",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24",height:"24",children:t.jsx("path",{d:"M249.836 210.77c5.558-3.827 10.73-7.527 15.812-10.695 4.967-3.314 9.807-6.121 14.208-8.785 2.18-1.362 4.374-2.515 6.425-3.673l5.873-3.281c0.945-0.551 1.789-0.953 2.625-1.377l2.425-1.226 4.381-2.233 1.954-1.004 2.219-1.093 3.918-1.924 7.184-3.527c2.883-1.44 5.996-3.272 8.694-5.22 26.969-19.458 33.057-57.094 13.599-84.063-19.458-26.968-57.094-33.057-84.063-13.599l-6.49 4.682-3.54 2.554-2.071 1.499-2.62 1.947-5.824 4.351a7267.87 7267.87 0 0 0-3.193 2.399c-1.091 0.824-2.25 1.676-3.282 2.533a33346.62 33346.62 0 0 1-6.735 5.441c-2.343 1.915-4.833 3.859-7.308 6.046-4.991 4.313-10.423 8.905-15.952 14.121-5.645 5.071-11.353 10.792-17.394 16.739-5.886 6.125-12.079 12.515-18.185 19.505-12.303 13.875-24.827 29.53-36.839 46.835a494.61 494.61 0 0 0-33.896 56.497 491.342 491.342 0 0 0-27.329 64.159c-1.02 2.77-1.888 5.605-2.789 8.428l-2.688 8.477c-1.692 5.691-3.266 11.429-4.857 17.152l-2.135 8.669c-0.683 2.896-1.479 5.756-2.051 8.682l-1.84 8.729-0.914 4.358-0.785 4.387a479.254 479.254 0 0 0-7.583 69.967c-0.302 5.759-0.239 11.514-0.279 17.214l-0.017 4.267c-0.001 1.42 0.069 2.841 0.101 4.257l0.25 8.464 0.127 4.204 0.264 4.188 0.531 8.317 0.278 4.451 0.399 3.933 0.792 7.821c0.14 1.313 0.244 2.561 0.412 3.918l0.527 4.098 1.056 8.115c0.185 1.337 0.33 2.695 0.549 4.002l0.648 3.91 1.289 7.744c1.825 10.246 3.911 20.188 6.263 29.766a463.195 463.195 0 0 0 16.342 52.81l2.255 5.904 1.108 2.899 1.186 2.836 4.611 10.976c3.247 7.033 6.19 13.723 9.353 19.831 6.048 12.328 12.043 22.661 17.007 31.096 5.121 8.359 9.212 14.84 12.197 19.141l4.472 6.638-3.293-7.292c-2.209-4.713-5.148-11.776-8.748-20.761-3.443-9.059-7.545-20.055-11.346-32.919-2.041-6.376-3.771-13.301-5.726-20.516l-2.612-11.204-0.667-2.878-0.583-2.935-1.183-5.957c-3.105-16.055-5.568-33.549-6.889-52.052-0.668-9.251-1.027-18.753-1.1-28.437l0.03-7.3 0.014-3.67c0.002-1.227 0.084-2.416 0.122-3.629l0.284-7.263 0.139-3.644c0.053-1.229 0.166-2.577 0.247-3.863a35704.717 35704.717 0 0 1 0.798-11.787l0.017-0.247c0.013 0.588 0.018 0.028 0.027 0.098l0.05-0.472 0.101-0.945 0.2-1.891 0.8-7.581 0.4-3.801 0.535-3.801 1.069-7.62c0.187-1.271 0.335-2.545 0.555-3.815l0.67-3.811c0.909-5.082 1.708-10.185 2.859-15.253a424.734 424.734 0 0 1 17.057-60.03l1.316-3.663 1.437-3.623 2.859-7.225c0.907-2.417 2.03-4.761 3.033-7.135l3.079-7.082c2.208-4.653 4.37-9.295 6.624-13.867l3.508-6.783c1.167-2.252 2.294-4.513 3.565-6.702a414.503 414.503 0 0 1 31.89-49.502 407.116 407.116 0 0 1 35.476-41.25 406.598 406.598 0 0 1 35.793-32.288c5.751-4.687 11.515-8.857 16.918-12.861zM1023.966 510.486l-0.001-0.005-0.875-7.954-1.051-9.554-0.687-6.125-1.153-8.152c-0.828-5.729-1.741-12.089-2.813-18.907l-4.259-20.887c-0.691-3.726-1.738-7.517-2.729-11.425l-3.102-12.024c-0.558-2.048-1.019-4.142-1.677-6.221l-1.958-6.314-4.07-13.021-1.049-3.333-1.211-3.324c-0.814-2.223-1.638-4.467-2.469-6.732-1.673-4.522-3.34-9.131-5.115-13.781l-5.938-13.981-3.046-7.123c-1.037-2.384-2.247-4.72-3.375-7.102l-6.997-14.388c-0.569-1.22-1.222-2.408-1.877-3.598l-1.958-3.583-3.95-7.211-3.995-7.265c-1.354-2.422-2.881-4.773-4.324-7.175l-8.875-14.427c-12.567-18.998-26.533-37.793-42.018-55.643-15.662-17.71-32.638-34.534-50.581-50.045a527.617 527.617 0 0 0-56.726-41.602c-19.622-12.201-39.702-22.647-59.484-31.64l-14.925-6.188c-2.47-0.995-4.881-2.072-7.356-2.979l-7.402-2.651-7.306-2.609-3.615-1.289c-1.198-0.434-2.394-0.863-3.618-1.21l-14.37-4.353c-2.366-0.691-4.68-1.466-7.035-2.069l-7.02-1.754-13.669-3.402c-4.524-0.941-8.985-1.788-13.341-2.655l-6.47-1.271-3.184-0.621-3.186-0.465-12.373-1.797-5.96-0.862c-1.957-0.298-3.928-0.403-5.85-0.61l-11.239-1.057c-3.638-0.329-7.151-0.735-10.598-0.81l-19.18-0.823-16.258 0.11-6.935 0.057c-2.177 0.091-4.219 0.237-6.115 0.34l-9.619 0.566-7.982 0.472 7.959 0.875 9.529 1.05c1.872 0.215 3.884 0.411 6.023 0.683l6.797 1.101 15.801 2.578 18.393 3.951c3.283 0.628 6.614 1.603 10.051 2.514l10.571 2.838c1.801 0.509 3.644 0.92 5.469 1.526l5.542 1.793 11.432 3.697 2.927 0.946 2.914 1.104 5.902 2.242c3.965 1.517 8.007 3.017 12.084 4.613l12.243 5.366 6.241 2.733c2.088 0.929 4.128 2.029 6.212 3.044l12.59 6.277c1.068 0.506 2.106 1.094 3.145 1.685l3.131 1.761 6.302 3.542 6.353 3.568c2.118 1.209 4.165 2.586 6.263 3.878l12.601 7.922c16.565 11.247 32.949 23.681 48.48 37.44a473.639 473.639 0 0 1 43.435 44.87 467.917 467.917 0 0 1 35.892 50.115c10.476 17.304 19.389 34.971 27.062 52.322 1.761 4.404 3.506 8.772 5.234 13.098 0.843 2.166 1.771 4.273 2.532 6.444l2.224 6.49 2.201 6.396 1.093 3.162c0.368 1.047 0.734 2.092 1.019 3.166l3.633 12.572c0.578 2.068 1.242 4.086 1.738 6.146l1.441 6.137 2.829 11.931 2.152 11.645 1.045 5.64 0.514 2.772 0.362 2.779 1.423 10.784 0.697 5.188c0.245 1.704 0.3 3.423 0.458 5.098l0.794 9.786c0.249 3.167 0.584 6.22 0.595 9.223l0.516 16.686-0.346 13.152-0.109 5.579-0.343 6.014-0.567 9.595-0.472 7.988c-0.169 3.219-0.107 6.829 0.256 10.138 3.638 33.056 33.383 56.904 66.438 53.267 33.056-3.637 56.905-33.382 53.268-66.438zM885.176 762.451l-4.868 5.897c-1.711 2.052-3.44 4.238-5.4 6.399-3.858 4.365-7.946 9.128-12.608 13.957-4.517 4.944-9.632 9.919-14.922 15.205-5.467 5.131-11.147 10.547-17.374 15.864-12.349 10.726-26.262 21.624-41.613 32.046a434.435 434.435 0 0 1-50.026 29.303 431.157 431.157 0 0 1-56.59 23.39c-2.436 0.874-4.935 1.6-7.419 2.361l-7.455 2.279c-5.006 1.425-10.053 2.742-15.078 4.091-2.536 0.593-5.075 1.187-7.617 1.78-2.545 0.566-5.051 1.25-7.622 1.714l-7.663 1.523-3.822 0.763-3.851 0.64a419.278 419.278 0 0 1-61.304 5.938c-5.039 0.219-10.081 0.088-15.068 0.072l-3.733-0.022c-1.238-0.012-2.392-0.1-3.587-0.145l-7.067-0.313-3.505-0.146-3.997-0.27-7.961-0.537-1.981-0.133-0.989-0.067-0.494-0.033c0.221-0.008-0.844-0.005 0.433-0.022l-0.226-0.025-3.593-0.396-7.127-0.78a406.62 406.62 0 0 1-53.494-10.013 402.48 402.48 0 0 1-45.808-14.792l-5.111-2.022-2.511-0.99-2.452-1.066-9.494-4.124c-6.074-2.917-11.861-5.522-17.131-8.352-10.648-5.379-19.552-10.718-26.826-15.11l-1.338-0.807a1085.391 1085.391 0 0 0-3.457-2.276l-4.116-2.687c-0.638-0.414-1.252-0.813-1.842-1.194l-2.021-1.354-3.621-2.439-6.637-4.472c-2.685-1.782-5.825-3.567-8.857-4.938-30.307-13.689-65.973-0.218-79.662 30.089-13.689 30.308-0.218 65.974 30.089 79.663l7.293 3.294 3.979 1.797 2.369 1.063 2.994 1.302c2.073 0.896 4.3 1.857 6.676 2.885l3.672 1.574 1.917 0.819 1.9 0.745c10.22 4.014 22.646 8.772 37.189 13.242 7.215 2.375 15.042 4.443 23.216 6.727l12.687 3.1 3.261 0.787 3.325 0.701 6.75 1.415c18.195 3.715 38.044 6.719 59.054 8.439a494.284 494.284 0 0 0 65.863 0.997l8.535-0.519 4.285-0.266 0.268-0.017c1.44-0.02 0.541-0.02 0.927-0.03l0.492-0.051 0.986-0.1 1.977-0.201 7.938-0.807 3.991-0.406 4.502-0.554 9.015-1.133c1.492-0.2 3.034-0.365 4.486-0.598l4.344-0.709c5.795-0.965 11.61-1.832 17.399-3.066a485.178 485.178 0 0 0 68.692-18.701l4.2-1.463 4.157-1.588 8.292-3.176c2.771-1.016 5.468-2.251 8.194-3.37l8.134-3.434c5.351-2.451 10.685-4.869 15.941-7.39l7.805-3.918c2.591-1.307 5.188-2.576 7.712-3.991a474.344 474.344 0 0 0 57.071-35.83 467.174 467.174 0 0 0 47.72-40.068 466.596 466.596 0 0 0 37.51-40.586c5.455-6.542 10.335-13.082 14.998-19.24 4.483-6.313 8.789-12.218 12.512-18 3.868-5.667 7.179-11.177 10.297-16.204 1.589-2.492 2.957-4.989 4.318-7.332 1.349-2.348 2.635-4.586 3.854-6.711 4.686-8.611 8.271-15.384 10.509-20.116l3.527-7.185-4.682 6.489c-2.985 4.266-7.65 10.33-13.635 17.935z"})})}):null]})}document.documentElement.style.fontSize="14px";function xx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Lr=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function gx({promise:n}){const{results:e}=h.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function vx(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function f7(){const[n,e]=h.useState(()=>Lr(5)),s=h.useDeferredValue(n);function a(l){n.cancel();const r=l.target.value.length%5;e(Lr(r))}return t.jsxs("div",{children:[t.jsx(vx,{onChange:a,placeholder:"Enter something"}),t.jsx(h.Suspense,{fallback:t.jsx(xx,{}),children:t.jsx(Ru,{loading:s!==n,type:"mask",children:t.jsx(gx,{promise:s})})})]})}function h7(){const[n,e]=h.useState(()=>Lr(5));function s(a){n.cancel();const l=a.target.value.length%5;e(Lr(l))}return t.jsxs("div",{children:[t.jsx(vx,{onChange:s,placeholder:"Enter something"}),t.jsx(h.Suspense,{fallback:t.jsx(xx,{}),children:t.jsx(gx,{promise:n})})]})}function x7(){const[n,e]=h.useState(0);function s(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsxs("div",{className:"mt-4",children:["counter: ",n]})]}),t.jsx("button",{onClick:s,children:"counter++"})]})}function g7(){const[n,e]=h.useState(0),s=h.useDeferredValue(n);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsxs("div",{className:"mt-4",children:["counter: ",s]})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}function v7(){const[n,e]=h.useState(0),s=h.useDeferredValue(n,0);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsx(j7,{counter:s})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}const j7=({counter:n})=>{const e=performance.now();for(;performance.now()-e<200;);return t.jsxs("div",{className:"mt-4",children:["Deferred: ",n]})};function b7(){const[n,e]=h.useState(0),s=h.useDeferredValue(n);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsx(y7,{counter:s})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}const y7=({counter:n})=>{let e=[];for(let s=0;s<200;s++)e.push(t.jsx(N7,{counter:n},s));return t.jsxs("div",{className:"mt-4 text-green-500",children:[t.jsxs("div",{children:["Deferred: ",n]}),t.jsx("ul",{className:"h-32 hidden",children:e})]})};function N7({counter:n}){let e=performance.now();for(;performance.now()-e<1;);return t.jsx("li",{children:n})}function Km(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"重头戏来了!"}),` +`;function Ru(n){const{loading:e,type:s="icon"}=n,[a,l]=f.useState(!1),[r,i]=f.useState(!1);f.useEffect(()=>{e?(l(!0),i(!0)):l(!1)},[e]);const o=ae("spin flex items-center justify-center top-0 bg-white bg-opacity-50",{in:a,out:!a});function u(){a||i(!1)}return t.jsxs("div",{className:"relative",children:[n.children,r?t.jsx("div",{className:o,onAnimationEnd:u,children:s==="icon"&&t.jsx("svg",{className:"animate-spin",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24",height:"24",children:t.jsx("path",{d:"M249.836 210.77c5.558-3.827 10.73-7.527 15.812-10.695 4.967-3.314 9.807-6.121 14.208-8.785 2.18-1.362 4.374-2.515 6.425-3.673l5.873-3.281c0.945-0.551 1.789-0.953 2.625-1.377l2.425-1.226 4.381-2.233 1.954-1.004 2.219-1.093 3.918-1.924 7.184-3.527c2.883-1.44 5.996-3.272 8.694-5.22 26.969-19.458 33.057-57.094 13.599-84.063-19.458-26.968-57.094-33.057-84.063-13.599l-6.49 4.682-3.54 2.554-2.071 1.499-2.62 1.947-5.824 4.351a7267.87 7267.87 0 0 0-3.193 2.399c-1.091 0.824-2.25 1.676-3.282 2.533a33346.62 33346.62 0 0 1-6.735 5.441c-2.343 1.915-4.833 3.859-7.308 6.046-4.991 4.313-10.423 8.905-15.952 14.121-5.645 5.071-11.353 10.792-17.394 16.739-5.886 6.125-12.079 12.515-18.185 19.505-12.303 13.875-24.827 29.53-36.839 46.835a494.61 494.61 0 0 0-33.896 56.497 491.342 491.342 0 0 0-27.329 64.159c-1.02 2.77-1.888 5.605-2.789 8.428l-2.688 8.477c-1.692 5.691-3.266 11.429-4.857 17.152l-2.135 8.669c-0.683 2.896-1.479 5.756-2.051 8.682l-1.84 8.729-0.914 4.358-0.785 4.387a479.254 479.254 0 0 0-7.583 69.967c-0.302 5.759-0.239 11.514-0.279 17.214l-0.017 4.267c-0.001 1.42 0.069 2.841 0.101 4.257l0.25 8.464 0.127 4.204 0.264 4.188 0.531 8.317 0.278 4.451 0.399 3.933 0.792 7.821c0.14 1.313 0.244 2.561 0.412 3.918l0.527 4.098 1.056 8.115c0.185 1.337 0.33 2.695 0.549 4.002l0.648 3.91 1.289 7.744c1.825 10.246 3.911 20.188 6.263 29.766a463.195 463.195 0 0 0 16.342 52.81l2.255 5.904 1.108 2.899 1.186 2.836 4.611 10.976c3.247 7.033 6.19 13.723 9.353 19.831 6.048 12.328 12.043 22.661 17.007 31.096 5.121 8.359 9.212 14.84 12.197 19.141l4.472 6.638-3.293-7.292c-2.209-4.713-5.148-11.776-8.748-20.761-3.443-9.059-7.545-20.055-11.346-32.919-2.041-6.376-3.771-13.301-5.726-20.516l-2.612-11.204-0.667-2.878-0.583-2.935-1.183-5.957c-3.105-16.055-5.568-33.549-6.889-52.052-0.668-9.251-1.027-18.753-1.1-28.437l0.03-7.3 0.014-3.67c0.002-1.227 0.084-2.416 0.122-3.629l0.284-7.263 0.139-3.644c0.053-1.229 0.166-2.577 0.247-3.863a35704.717 35704.717 0 0 1 0.798-11.787l0.017-0.247c0.013 0.588 0.018 0.028 0.027 0.098l0.05-0.472 0.101-0.945 0.2-1.891 0.8-7.581 0.4-3.801 0.535-3.801 1.069-7.62c0.187-1.271 0.335-2.545 0.555-3.815l0.67-3.811c0.909-5.082 1.708-10.185 2.859-15.253a424.734 424.734 0 0 1 17.057-60.03l1.316-3.663 1.437-3.623 2.859-7.225c0.907-2.417 2.03-4.761 3.033-7.135l3.079-7.082c2.208-4.653 4.37-9.295 6.624-13.867l3.508-6.783c1.167-2.252 2.294-4.513 3.565-6.702a414.503 414.503 0 0 1 31.89-49.502 407.116 407.116 0 0 1 35.476-41.25 406.598 406.598 0 0 1 35.793-32.288c5.751-4.687 11.515-8.857 16.918-12.861zM1023.966 510.486l-0.001-0.005-0.875-7.954-1.051-9.554-0.687-6.125-1.153-8.152c-0.828-5.729-1.741-12.089-2.813-18.907l-4.259-20.887c-0.691-3.726-1.738-7.517-2.729-11.425l-3.102-12.024c-0.558-2.048-1.019-4.142-1.677-6.221l-1.958-6.314-4.07-13.021-1.049-3.333-1.211-3.324c-0.814-2.223-1.638-4.467-2.469-6.732-1.673-4.522-3.34-9.131-5.115-13.781l-5.938-13.981-3.046-7.123c-1.037-2.384-2.247-4.72-3.375-7.102l-6.997-14.388c-0.569-1.22-1.222-2.408-1.877-3.598l-1.958-3.583-3.95-7.211-3.995-7.265c-1.354-2.422-2.881-4.773-4.324-7.175l-8.875-14.427c-12.567-18.998-26.533-37.793-42.018-55.643-15.662-17.71-32.638-34.534-50.581-50.045a527.617 527.617 0 0 0-56.726-41.602c-19.622-12.201-39.702-22.647-59.484-31.64l-14.925-6.188c-2.47-0.995-4.881-2.072-7.356-2.979l-7.402-2.651-7.306-2.609-3.615-1.289c-1.198-0.434-2.394-0.863-3.618-1.21l-14.37-4.353c-2.366-0.691-4.68-1.466-7.035-2.069l-7.02-1.754-13.669-3.402c-4.524-0.941-8.985-1.788-13.341-2.655l-6.47-1.271-3.184-0.621-3.186-0.465-12.373-1.797-5.96-0.862c-1.957-0.298-3.928-0.403-5.85-0.61l-11.239-1.057c-3.638-0.329-7.151-0.735-10.598-0.81l-19.18-0.823-16.258 0.11-6.935 0.057c-2.177 0.091-4.219 0.237-6.115 0.34l-9.619 0.566-7.982 0.472 7.959 0.875 9.529 1.05c1.872 0.215 3.884 0.411 6.023 0.683l6.797 1.101 15.801 2.578 18.393 3.951c3.283 0.628 6.614 1.603 10.051 2.514l10.571 2.838c1.801 0.509 3.644 0.92 5.469 1.526l5.542 1.793 11.432 3.697 2.927 0.946 2.914 1.104 5.902 2.242c3.965 1.517 8.007 3.017 12.084 4.613l12.243 5.366 6.241 2.733c2.088 0.929 4.128 2.029 6.212 3.044l12.59 6.277c1.068 0.506 2.106 1.094 3.145 1.685l3.131 1.761 6.302 3.542 6.353 3.568c2.118 1.209 4.165 2.586 6.263 3.878l12.601 7.922c16.565 11.247 32.949 23.681 48.48 37.44a473.639 473.639 0 0 1 43.435 44.87 467.917 467.917 0 0 1 35.892 50.115c10.476 17.304 19.389 34.971 27.062 52.322 1.761 4.404 3.506 8.772 5.234 13.098 0.843 2.166 1.771 4.273 2.532 6.444l2.224 6.49 2.201 6.396 1.093 3.162c0.368 1.047 0.734 2.092 1.019 3.166l3.633 12.572c0.578 2.068 1.242 4.086 1.738 6.146l1.441 6.137 2.829 11.931 2.152 11.645 1.045 5.64 0.514 2.772 0.362 2.779 1.423 10.784 0.697 5.188c0.245 1.704 0.3 3.423 0.458 5.098l0.794 9.786c0.249 3.167 0.584 6.22 0.595 9.223l0.516 16.686-0.346 13.152-0.109 5.579-0.343 6.014-0.567 9.595-0.472 7.988c-0.169 3.219-0.107 6.829 0.256 10.138 3.638 33.056 33.383 56.904 66.438 53.267 33.056-3.637 56.905-33.382 53.268-66.438zM885.176 762.451l-4.868 5.897c-1.711 2.052-3.44 4.238-5.4 6.399-3.858 4.365-7.946 9.128-12.608 13.957-4.517 4.944-9.632 9.919-14.922 15.205-5.467 5.131-11.147 10.547-17.374 15.864-12.349 10.726-26.262 21.624-41.613 32.046a434.435 434.435 0 0 1-50.026 29.303 431.157 431.157 0 0 1-56.59 23.39c-2.436 0.874-4.935 1.6-7.419 2.361l-7.455 2.279c-5.006 1.425-10.053 2.742-15.078 4.091-2.536 0.593-5.075 1.187-7.617 1.78-2.545 0.566-5.051 1.25-7.622 1.714l-7.663 1.523-3.822 0.763-3.851 0.64a419.278 419.278 0 0 1-61.304 5.938c-5.039 0.219-10.081 0.088-15.068 0.072l-3.733-0.022c-1.238-0.012-2.392-0.1-3.587-0.145l-7.067-0.313-3.505-0.146-3.997-0.27-7.961-0.537-1.981-0.133-0.989-0.067-0.494-0.033c0.221-0.008-0.844-0.005 0.433-0.022l-0.226-0.025-3.593-0.396-7.127-0.78a406.62 406.62 0 0 1-53.494-10.013 402.48 402.48 0 0 1-45.808-14.792l-5.111-2.022-2.511-0.99-2.452-1.066-9.494-4.124c-6.074-2.917-11.861-5.522-17.131-8.352-10.648-5.379-19.552-10.718-26.826-15.11l-1.338-0.807a1085.391 1085.391 0 0 0-3.457-2.276l-4.116-2.687c-0.638-0.414-1.252-0.813-1.842-1.194l-2.021-1.354-3.621-2.439-6.637-4.472c-2.685-1.782-5.825-3.567-8.857-4.938-30.307-13.689-65.973-0.218-79.662 30.089-13.689 30.308-0.218 65.974 30.089 79.663l7.293 3.294 3.979 1.797 2.369 1.063 2.994 1.302c2.073 0.896 4.3 1.857 6.676 2.885l3.672 1.574 1.917 0.819 1.9 0.745c10.22 4.014 22.646 8.772 37.189 13.242 7.215 2.375 15.042 4.443 23.216 6.727l12.687 3.1 3.261 0.787 3.325 0.701 6.75 1.415c18.195 3.715 38.044 6.719 59.054 8.439a494.284 494.284 0 0 0 65.863 0.997l8.535-0.519 4.285-0.266 0.268-0.017c1.44-0.02 0.541-0.02 0.927-0.03l0.492-0.051 0.986-0.1 1.977-0.201 7.938-0.807 3.991-0.406 4.502-0.554 9.015-1.133c1.492-0.2 3.034-0.365 4.486-0.598l4.344-0.709c5.795-0.965 11.61-1.832 17.399-3.066a485.178 485.178 0 0 0 68.692-18.701l4.2-1.463 4.157-1.588 8.292-3.176c2.771-1.016 5.468-2.251 8.194-3.37l8.134-3.434c5.351-2.451 10.685-4.869 15.941-7.39l7.805-3.918c2.591-1.307 5.188-2.576 7.712-3.991a474.344 474.344 0 0 0 57.071-35.83 467.174 467.174 0 0 0 47.72-40.068 466.596 466.596 0 0 0 37.51-40.586c5.455-6.542 10.335-13.082 14.998-19.24 4.483-6.313 8.789-12.218 12.512-18 3.868-5.667 7.179-11.177 10.297-16.204 1.589-2.492 2.957-4.989 4.318-7.332 1.349-2.348 2.635-4.586 3.854-6.711 4.686-8.611 8.271-15.384 10.509-20.116l3.527-7.185-4.682 6.489c-2.985 4.266-7.65 10.33-13.635 17.935z"})})}):null]})}document.documentElement.style.fontSize="14px";function Mx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full mt-4",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}const Or=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function Ex({promise:n}){const{results:e}=f.use(n);return console.log("我会执行几次呢"),t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}function Ax(n){const{...e}=n;return t.jsxs("div",{className:"flex items-center border px-2 rounded-md text-gray-500",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),t.jsx("input",{className:"flex-1 !border-none p-2",style:{outline:"none"},type:"text",...e})]})}function S7(){const[n,e]=f.useState(()=>Or(5)),s=f.useDeferredValue(n);function a(l){n.cancel();const r=l.target.value.length%5;e(Or(r))}return t.jsxs("div",{children:[t.jsx(Ax,{onChange:a,placeholder:"Enter something"}),t.jsx(f.Suspense,{fallback:t.jsx(Mx,{}),children:t.jsx(Ru,{loading:s!==n,type:"mask",children:t.jsx(Ex,{promise:s})})})]})}function w7(){const[n,e]=f.useState(()=>Or(5));function s(a){n.cancel();const l=a.target.value.length%5;e(Or(l))}return t.jsxs("div",{children:[t.jsx(Ax,{onChange:s,placeholder:"Enter something"}),t.jsx(f.Suspense,{fallback:t.jsx(Mx,{}),children:t.jsx(Ex,{promise:n})})]})}function _7(){const[n,e]=f.useState(0);function s(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsxs("div",{className:"mt-4",children:["counter: ",n]})]}),t.jsx("button",{onClick:s,children:"counter++"})]})}function k7(){const[n,e]=f.useState(0),s=f.useDeferredValue(n);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsxs("div",{className:"mt-4",children:["counter: ",s]})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}function C7(){const[n,e]=f.useState(0),s=f.useDeferredValue(n,0);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsx(R7,{counter:s})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}const R7=({counter:n})=>{const e=performance.now();for(;performance.now()-e<200;);return t.jsxs("div",{className:"mt-4",children:["Deferred: ",n]})};function M7(){const[n,e]=f.useState(0),s=f.useDeferredValue(n);function a(){e(n+1)}return t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{children:["counter: ",n]}),t.jsx(E7,{counter:s})]}),t.jsx("button",{onClick:a,children:"counter++"})]})}const E7=({counter:n})=>{let e=[];for(let s=0;s<200;s++)e.push(t.jsx(A7,{counter:n},s));return t.jsxs("div",{className:"mt-4 text-green-500",children:[t.jsxs("div",{children:["Deferred: ",n]}),t.jsx("ul",{className:"h-32 hidden",children:e})]})};function A7({counter:n}){let e=performance.now();for(;performance.now()-e<1;);return t.jsx("li",{children:n})}function Jm(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"重头戏来了!"}),` `,t.jsx(e.p,{children:"在进一步学习之前,道友们先操作感受一下这个案例中,搜索时 loading 的交互状态。在输入框中,快速输入任意内容。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(f7,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(S7,{})}),` `,t.jsx(e.p,{children:"然后再对比一下前后两种 Loading 交互方式的区别。"}),` -`,t.jsx(T,{children:t.jsx(h7,{})}),` +`,t.jsx(A,{children:t.jsx(w7,{})}),` `,t.jsx(e.p,{children:"很显然,大多数时候,第一种 Loading 交互方案的体验是更好的。他的具体表现为:"}),` `,t.jsx(e.p,{children:"初始化时,显示 Skeleton 组件,表示此时列表中没有内容,即将加载新的内容进来。"}),` `,t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"更新时,保持现有列表"}),",可在此的基础之上显示 Loading/蒙层/透明度,如果你确定接口请求的时间非常短,也可以没有任何 Loading 显示"]}),` @@ -4985,7 +4985,7 @@ export default function Index() { `})}),` `,t.jsxs(e.p,{children:["这里需要注意的是,状态 ",t.jsx(e.code,{children:"counter"})," 被两个元素使用,因此,这两个元素的更改,实际上是",t.jsx(e.strong,{children:"一个任务"}),"。他们必定会同时响应 counter 的变化。"]}),` `,t.jsx(e.p,{children:"因此,当你快速点击按钮时,两个元素的变化是快速同时响应"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(x7,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(_7,{})}),` `,t.jsx(e.p,{children:"这个时候,我们可以利用 useDeferredValue,把他们拆分成两个任务。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`import {useState, useDeferredValue} from 'react' @@ -5016,7 +5016,7 @@ export default function Index() { `,t.jsx(e.p,{children:"此时,第二个元素的更新,就不再与第一个元素同步。它更新的优先级被降低。这个时候它的执行在理论上是可以被更高的优先级插队和中断的。"}),` `,t.jsx(e.p,{children:"但是由于渲染都太短了,我们肉眼无法区分出来两个任务已经被分开了,因此,从视觉上的表现结果和刚才的案例没啥区别。"}),` `,t.jsx(e.p,{children:"快速点击按钮查看一下演示效果"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(g7,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(k7,{})}),` `,t.jsx(e.p,{children:"为了看出区别,我们把第二个元素重构成一个子组件,并模拟成一个耗时组件"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`import {useState, useDeferredValue} from 'react' @@ -5048,7 +5048,7 @@ const Expensive = ({counter}) => { } `})}),` `,t.jsx(e.p,{children:"快速点击按钮,此时我们发现,两个按钮的更新可以区分开了。并且在快速点击时,第二个 counter 的更新,会落后于第一个 counter,此时表示,我们可以利用 useDeferredValue 推迟 UI 的更新。将对应任务的优先级降低,使其可以被插队与中断。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(v7,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(C7,{})}),` `,t.jsxs(e.p,{children:["此时我们也发现另外一个情况,那就是 counter 直接对应的高优先级执行也没有那么流畅,这是为什么呢?其实很简单,因为在我们的模拟案例中,",t.jsx(e.strong,{children:"并没有把耗时定位在渲染上"}),"。这就和实际的情况不太一样了。我们把耗时写在了 Expensive 函数里,而这个函数每次都会执行,它的执行阻塞了渲染。所以我们会觉得第一个 counter 的更新变得比较卡顿"]}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"所以这里我们一定要区分开渲染任务和 Expensive 函数,他们是不同的,UI 渲染是一个异步任务,而 Expensive 函数是同步执行的。useDeferredValue 推迟的是 UI 渲染任务。因此,我们需要特别注意的是,不要在同步逻辑上执行过多的耗时任务。"}),` @@ -5103,7 +5103,7 @@ function SlowItem({counter}) { } `})}),` `,t.jsx(e.p,{children:"再来感受一下演示结果,我们就发现,第一个 counter 的更新也变得非常流畅了。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(b7,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(M7,{})}),` `,t.jsx(e.p,{children:"此时我们注意观察,不要错漏这个细节。slowList 中包含了 250 个子组件。每个子组件都渲染 1ms,那么整个组件渲染就需要耗时至少 250ms."}),` `,t.jsx(e.p,{children:"在父组件中,我们把 deferred 传递给 Expensive"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:` @@ -5169,7 +5169,7 @@ function SlowItem({counter}) { `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"4"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"总结"})}),` `,t.jsx(e.p,{children:"这种场景的最佳实践代码非常的简洁和优雅。写起来也很舒服,性能也非常强悍。但是理解起来会比较困难。因此想要做到灵活运用,还需要多多消化。"}),` -`,t.jsx(e.p,{children:"但是,等你彻底掌握它之后,你就会发现 React 19 在异步交互上真的太优雅了。这样的开发体验,是依赖 useEffect 完全比不了的。"})]})}function S7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Km,{...n})}):Km(n)}const w7={"App.js":o7,"api.js":u7,"List.jsx":m7,"Input.jsx":p7,"Skeleton.jsx":d7,"Spin.jsx":fx,"index.css":hx};function _7(){return t.jsx(ae,{files:w7,renderArticle:n=>t.jsx(S7,{components:{code:n}})})}const k7=`import {useState, Suspense, useDeferredValue} from 'react' +`,t.jsx(e.p,{children:"但是,等你彻底掌握它之后,你就会发现 React 19 在异步交互上真的太优雅了。这样的开发体验,是依赖 useEffect 完全比不了的。"})]})}function T7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Jm,{...n})}):Jm(n)}const $7={"App.js":j7,"api.js":v7,"List.jsx":y7,"Input.jsx":N7,"Skeleton.jsx":b7,"Spin.jsx":Cx,"index.css":Rx};function L7(){return t.jsx(W,{files:$7,renderArticle:n=>t.jsx(T7,{components:{code:n}})})}const D7=`import {useState, Suspense, useDeferredValue} from 'react' import Skeleton from './Skeleton' import {fetchListWithCancel} from './api' import Tabs from './Tabs' @@ -5183,7 +5183,6 @@ const tabs = [ { name: 'Billing', href: '#', current: false }, ] - export default function Example() { const [current, switchToSelected] = useState(0) const [promise, update] = useState(() => fetchListWithCancel(5)) @@ -5210,7 +5209,7 @@ export default function Example() { ) } -`,C7=`const random = [ +`,O7=`const random = [ 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', 'Whether you work on your own or with thousands of other developers, using React feels the same.', 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', @@ -5260,7 +5259,7 @@ export const fetchListWithCancel = (number) => { } return promise } -`,R7=`export default function Skeleton(props) { +`,B7=`export default function Skeleton(props) { return (
@@ -5279,7 +5278,7 @@ export const fetchListWithCancel = (number) => {
) } -`,E7=`import { use } from 'react'; +`,z7=`import { use } from 'react'; export default function CurrentList({promise}) { const {results} = use(promise) return ( @@ -5296,7 +5295,7 @@ export default function CurrentList({promise}) {
) } -`,M7=`function classNames(...classes) { +`,U7=`function classNames(...classes) { return classes.filter(Boolean).join(' ') } @@ -5344,7 +5343,7 @@ export default function Tabs({tabs, onSwitch}) { ) } -`,A7=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function jx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function T7(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:c,success:i,...o}=n,p=Pe(se("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":i,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":c,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,c&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const $7=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var bx=new Headers;bx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var D7={method:"GET",headers:bx,redirect:"follow",data:"hex"};const L7="https://echo.apifox.com/delay/1",Wm=async()=>{await fetch(L7,D7);const n=Math.floor(Math.random()*10)%5;return{value:$7[n]}},Pm=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function B7(){const[n,e]=h.useState(Wm()),[s,a]=h.useTransition();function l(){console.log("click"),a(()=>{console.log("transition"),e(Wm())})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(T7,{onClick:l,children:"更新数据"})}),t.jsx(h.Suspense,{fallback:t.jsx(jx,{}),children:t.jsx(Ru,{loading:s,children:t.jsx(O7,{promise:n})})})]})}function O7(n){const{value:e}=h.use(n.promise);return t.jsx(A7,{message:e})}function z7(...n){return n.filter(Boolean).join(" ")}function U7({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:z7(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:l=>{l.preventDefault(),e(a)},children:s.name},s.name))})})]})}function H7({promise:n}){const{results:e}=h.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}const ni=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function q7(){const[n,e]=h.useState(0),[s,a]=h.useState(()=>Pm(5)),[l,r]=h.useTransition();function c(i){ni[n].current=!1,ni[i].current=!0,e(i),s.cancel(),r(()=>{a(Pm(5))})}return t.jsxs("div",{children:[t.jsx(U7,{tabs:ni,onSwitch:c}),t.jsx(h.Suspense,{fallback:t.jsx(jx,{}),children:t.jsx(Ru,{loading:l,type:"mask",children:t.jsx(H7,{promise:s})})})]})}function Fm(n){const e={blockquote:"blockquote",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{reload:!0,children:t.jsx(B7,{})}),` +`,H7=n=>{const e=unescape(n.message.replace(/\\u/gi,"%u")),s=unescape((n.title||"").replace(/\\u/gi,"%u"));let a="flex border border-blue-100 p-4 rounded-md shadow";return e?t.jsxs("div",{className:a,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 mt-2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),t.jsxs("div",{className:"flex-1 ml-3",children:[t.jsx("div",{children:s||"Heads Up!"}),t.jsx("div",{className:"text-sm mt-1 text-gray-600",children:e})]})]}):t.jsxs("div",{className:`${a} justify-center items-center flex-col text-gray-500`,children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})}),t.jsx("div",{className:"mt-2",children:"no data."})]})};function Tx(n){return t.jsx("div",{className:"border border-blue-100 shadow rounded-md p-4 w-full",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}document.documentElement.style.fontSize="14px";function q7(n){const{className:e,primary:s,danger:a,sm:l,lg:r,signal:i,success:c,...o}=n,p=Ke(ae("rounded-md border border-transparent font-medium cursor-pointer transition relative","bg-gray-100 hover:bg-gray-200","text-xs py-2 px-4",{"bg-blue-500 text-white hover:bg-blue-600":s,"bg-red-500 text-white hover:bg-red-600":a,"bg-green-500 text-white hover:bg-green-600":c,"text-sky-500 bg-white border border-sky-300 hover:bg-sky-50":i,"text-xs py-1.5 px-3":l,"text-lg py-2 px-6":r},e));return t.jsxs("button",{className:p,...o,children:[n.children,i&&t.jsxs("span",{className:"absolute flex h-3 w-3 right-[-5px] top-[-5px]",children:[t.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"}),t.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-sky-500"})]})]})}const V7=["React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.","Whether you work on your own or with thousands of other developers, using React feels the same.","React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.","This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ","You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it."];var $x=new Headers;$x.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var X7={method:"GET",headers:$x,redirect:"follow",data:"hex"};const G7="https://echo.apifox.com/delay/1",Pm=async()=>{await fetch(G7,X7);const n=Math.floor(Math.random()*10)%5;return{value:V7[n]}},Wm=n=>{let e=new AbortController,s=e.signal;const a=new Promise(l=>{fetch(`https://randomuser.me/api/?results=${n}&inc=name,gender,email,nat,picture&noinfo`,{signal:s}).then(r=>{l(r.json())}).catch(()=>{console.log("接口成功取消!")})});return a.cancel=()=>{e&&e.abort()},a};function Z7(){const[n,e]=f.useState(Pm()),[s,a]=f.useTransition();function l(){console.log("click"),a(()=>{console.log("transition"),e(Pm())})}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-right mb-4",children:t.jsx(q7,{onClick:l,children:"更新数据"})}),t.jsx(f.Suspense,{fallback:t.jsx(Tx,{}),children:t.jsx(Ru,{loading:s,children:t.jsx(Y7,{promise:n})})})]})}function Y7(n){const{value:e}=f.use(n.promise);return t.jsx(H7,{message:e})}function Q7(...n){return n.filter(Boolean).join(" ")}function J7({tabs:n,onSwitch:e}){return t.jsxs("div",{children:[t.jsxs("div",{className:"hidden",children:[t.jsx("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t.jsx("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500",defaultValue:n.find(s=>s.current).name,onChange:s=>e(s.target.selectedIndex),children:n.map(s=>t.jsx("option",{children:s.name},s.name))})]}),t.jsx("div",{className:"block",children:t.jsx("nav",{className:"flex space-x-4","aria-label":"Tabs",children:n.map((s,a)=>t.jsx("a",{href:s.href,className:Q7(s.current?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:text-gray-700","rounded-md px-3 py-2 text-sm font-medium"),"aria-current":s.current?"page":void 0,onClick:l=>{l.preventDefault(),e(a)},children:s.name},s.name))})})]})}function P7({promise:n}){const{results:e}=f.use(n);return t.jsx("div",{children:e.map((s,a)=>t.jsxs("div",{className:"flex border p-4 items-center my-4 rounded-md",children:[t.jsx("img",{className:"w-12 h-12 rounded-full",src:s.picture.large,alt:""}),t.jsxs("div",{className:"flex-1 ml-4",children:[t.jsx("div",{className:"font-bold",children:s.name.last}),t.jsx("div",{className:"text-gray-400 mt-1 text-sm line-clamp-1",children:"react 19 re, a design language for background applications"})]})]},`h${a}`))})}const nc=[{name:"My Account",href:"#",current:!0},{name:"Company",href:"#",current:!1},{name:"Team Members",href:"#",current:!1},{name:"Billing",href:"#",current:!1}];function W7(){const[n,e]=f.useState(0),[s,a]=f.useState(()=>Wm(5)),[l,r]=f.useTransition();function i(c){nc[n].current=!1,nc[c].current=!0,e(c),s.cancel(),r(()=>{a(Wm(5))})}return t.jsxs("div",{children:[t.jsx(J7,{tabs:nc,onSwitch:i}),t.jsx(f.Suspense,{fallback:t.jsx(Tx,{}),children:t.jsx(Ru,{loading:l,type:"mask",children:t.jsx(P7,{promise:s})})})]})}function Km(n){const e={blockquote:"blockquote",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{reload:!0,children:t.jsx(Z7,{})}),` `,t.jsx(e.p,{children:"useTransition 与 useDeferredValue 有几乎一致的作用。他们都可以降低 UI 任务更新的优先级。只是在语法上有一些不太一样。因此这一章我们主要重点是介绍 useTransition 的语法,以及它与 useDeferredValue 的细微差异。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`const [isPending, startTransition] = useTransition() `})}),` @@ -5487,7 +5486,7 @@ export default function Example() { ) } `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(q7,{})})]})}function V7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Fm,{...n})}):Fm(n)}const X7={"App.js":k7,"api.js":C7,"Tabs.jsx":M7,"List.jsx":E7,"Skeleton.jsx":R7,"Spin.jsx":fx,"index.css":hx};function G7(){return t.jsx(ae,{files:X7,renderArticle:n=>t.jsx(V7,{components:{code:n}})})}const Z7=`function Layou2t() { +`,t.jsx(A,{reload:!0,children:t.jsx(W7,{})})]})}function K7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Km,{...n})}):Km(n)}const I7={"App.js":D7,"api.js":O7,"Tabs.jsx":U7,"List.jsx":z7,"Skeleton.jsx":B7,"Spin.jsx":Cx,"index.css":Rx};function F7(){return t.jsx(W,{files:I7,renderArticle:n=>t.jsx(K7,{components:{code:n}})})}const eN=`function Layou2t() { const $ = _c(3); if ($[0] !== "af424edd0cc2f0a8b6bcc96ea18b6e0ad26e18b67ffafe80bf321ad9ef551a1f") { for (let $i = 0; $i < 3; $i += 1) { @@ -5686,7 +5685,7 @@ module.exports = reactCompilerLoader; `})}),` `,t.jsx(e.p,{children:"我们可以在 React 官方了解到更多关于 React Compiler 的介绍与注意事项。具体地址如下"}),` `,t.jsx(e.p,{children:t.jsx(e.a,{href:"https://react.dev/learn/react-compiler",children:"https://react.dev/learn/react-compiler"})}),` -`,t.jsxs(e.p,{children:["引入成功之后,我们可以在开发者工具中的 ",t.jsx(e.code,{children:"Sources"})," 面板的 ",t.jsx(e.code,{children:"Page"})," 目录中查看编译之后的代码,长得跟右侧代码差不多就表示编译成功了。"]})]})}function Y7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Im,{...n})}):Im(n)}const Q7={"App.js":Z7};function J7(){return t.jsx(ae,{files:Q7,hidePreview:!0,renderArticle:n=>t.jsx(Y7,{components:{code:n}})})}const K7=`import { c as _c } from "/src/mycache.js"; +`,t.jsxs(e.p,{children:["引入成功之后,我们可以在开发者工具中的 ",t.jsx(e.code,{children:"Sources"})," 面板的 ",t.jsx(e.code,{children:"Page"})," 目录中查看编译之后的代码,长得跟右侧代码差不多就表示编译成功了。"]})]})}function nN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Im,{...n})}):Im(n)}const tN={"App.js":eN};function sN(){return t.jsx(W,{files:tN,hidePreview:!0,renderArticle:n=>t.jsx(nN,{components:{code:n}})})}const aN=`import { c as _c } from "/src/mycache.js"; import __vite__cjsImport4_react from "/node_modules/.vite/deps/react.js?v=f1f30d19"; const useState = __vite__cjsImport4_react["useState"]; import reactLogo from "/src/assets/react.svg?import"; import viteLogo from "/vite.svg?import"; @@ -5851,7 +5850,7 @@ if (import.meta.hot && !inWebWorker) { }); }); } -`,W7=`import { useState } from 'react' +`,lN=`import { useState } from 'react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' import './App.css' @@ -5886,7 +5885,7 @@ function App() { } export default App -`;function ep(n){const e={a:"a",blockquote:"blockquote",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"非常的 nice,经过几天的尝试和研究,我在低版本中成功引入了 Compiler,目前已经在 vite 中运行起来了。"}),` +`;function Fm(n){const e={a:"a",blockquote:"blockquote",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"非常的 nice,经过几天的尝试和研究,我在低版本中成功引入了 Compiler,目前已经在 vite 中运行起来了。"}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsxs(e.p,{children:["我的思考过程,你可以",t.jsx(e.a,{href:"https://mp.weixin.qq.com/s/RQ1c6YdNgyG-vCCPQBFMjw",children:"点击这篇文章阅读"}),",其他脚手架暂时还没试过,不过基本原理应该都是一致的,大家可以自己按照我的思路尝试一下"]}),` `]}),` @@ -5931,7 +5930,7 @@ export default defineConfig({ `,t.jsx(e.p,{children:"配置搞好之后,我们再引入 babel 插件,就可以正常运行了。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-bash",children:`yarn add babel-plugin-react-compiler `})}),` -`,t.jsx(e.p,{children:"运行项目,查看开发者工具的 Sources 面板中的 Page 目录,我们发现 App.jsx 已经被编译成了右侧代码的样子。搞定。"})]})}function P7(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ep,{...n})}):ep(n)}const F7={"App.js":K7,原代码:W7};function I7(){return t.jsx(ae,{files:F7,hidePreview:!0,renderArticle:n=>t.jsx(P7,{components:{code:n}})})}const e8=`import { c as _c } from "/src/mycache.js"; +`,t.jsx(e.p,{children:"运行项目,查看开发者工具的 Sources 面板中的 Page 目录,我们发现 App.jsx 已经被编译成了右侧代码的样子。搞定。"})]})}function rN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Fm,{...n})}):Fm(n)}const iN={"App.js":aN,原代码:lN};function cN(){return t.jsx(W,{files:iN,hidePreview:!0,renderArticle:n=>t.jsx(rN,{components:{code:n}})})}const oN=`import { c as _c } from "/src/mycache.js"; import __vite__cjsImport4_react from "/node_modules/.vite/deps/react.js?v=f1f30d19"; const useState = __vite__cjsImport4_react["useState"]; import reactLogo from "/src/assets/react.svg?import"; import viteLogo from "/vite.svg?import"; @@ -6096,7 +6095,7 @@ if (import.meta.hot && !inWebWorker) { }); }); } -`,n8=`import { useState } from 'react' +`,uN=`import { useState } from 'react' import reactLogo from './assets/react.svg' import viteLogo from '/vite.svg' import './App.css' @@ -6131,7 +6130,7 @@ function App() { } export default App -`;function np(n){const e={a:"a",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"在 webpack 中引入会稍微麻烦一点,因为我们要自己定义一个 Loader,许多小伙伴对于 webpack 自定义 loader 比较陌生,因此我这里直接放了一个比较完整的代码如下"}),` +`;function ep(n){const e={a:"a",code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"在 webpack 中引入会稍微麻烦一点,因为我们要自己定义一个 Loader,许多小伙伴对于 webpack 自定义 loader 比较陌生,因此我这里直接放了一个比较完整的代码如下"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`const babel = require('@babel/core') @@ -6219,7 +6218,7 @@ export function c(size: number) { } ] } -`})})]})}function t8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(np,{...n})}):np(n)}const s8={"App.js":e8,原代码:n8};function a8(){return t.jsx(ae,{files:s8,hidePreview:!0,renderArticle:n=>t.jsx(t8,{components:{code:n}})})}const l8=`import {useState} from 'react' +`})})]})}function dN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ep,{...n})}):ep(n)}const mN={"App.js":oN,原代码:uN};function pN(){return t.jsx(W,{files:mN,hidePreview:!0,renderArticle:n=>t.jsx(dN,{components:{code:n}})})}const fN=`import {useState} from 'react' import Button from './Button' import {_c} from './useCache.js' @@ -6298,7 +6297,7 @@ export default function Counter() { return t4; } -`,r8=`import {useState} from 'react' +`,hN=`import {useState} from 'react' export default function Counter() { const [count, setCount] = useState(0) @@ -6317,7 +6316,7 @@ export default function Counter() { ) } -`;function c8(){const[n,e]=h.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Base Case"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:["currnt count is: ",n]}),t.jsx("button",{onClick:s,children:"Increment"})]})]})}function tp(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` +`;function xN(){const[n,e]=f.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Base Case"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:["currnt count is: ",n]}),t.jsx("button",{onClick:s,children:"Increment"})]})]})}function np(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h2,{children:t.jsx(e.em,{children:"1"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"如何查看编译之后的代码"})}),` `,t.jsxs(e.p,{children:["通常情况下,你只需要在合适的位置打印一个 log。然后我们就可以通过下图所示的位置,在 ",t.jsx(e.code,{children:"console"})," 面板中,点击跳转到编译之后的代码。"]}),` `,t.jsx(e.p,{children:"当然,我们可以直接在 Sources 面板中查看。"}),` @@ -6331,7 +6330,7 @@ export default function Counter() { `,t.jsx(e.p,{children:"我本来最初的想法是看懂编译之后的代码不是很有必要。但是偶尔会出现一些情况,程序运行的结果跟我预想的不一样。"}),` `,t.jsx(e.p,{children:"出现这种迷惑行为的时候就感觉贼困惑,为啥会这样呢?布吉岛 ~,如何调整我自己的写法呢?也不知道。我很不喜欢这种一脸懵逼的感觉。"}),` `,t.jsx(e.p,{children:"看是得看懂才行。虽然这个代码很不像是正常人应该去阅读的代码。先来感受一下编译之后的代码长什么样,下面是一个案例的运行结果与其对应的代码。"}),` -`,t.jsx(T,{children:t.jsx(c8,{})}),` +`,t.jsx(A,{children:t.jsx(xN,{})}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`function Counter() { const $ = _c(10); @@ -6850,7 +6849,7 @@ console.log(now - cur) `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"顶尖前端都在关注我,就差你啦,右下角"}),` `,t.jsx(e.p,{children:"成为 React 高手,推荐阅读 React 哲学"}),` -`]})]})}function i8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(tp,{...n})}):tp(n)}const o8={"App.js":l8,原代码:r8};function u8(){return t.jsx(ae,{files:o8,renderArticle:n=>t.jsx(i8,{components:{code:n}})})}const d8=`import {useState} from 'react' +`]})]})}function gN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(np,{...n})}):np(n)}const jN={"App.js":fN,原代码:hN};function vN(){return t.jsx(W,{files:jN,renderArticle:n=>t.jsx(gN,{components:{code:n}})})}const bN=`import {useState} from 'react' import Button from './Button' import {_c} from './useCache.js' @@ -6929,7 +6928,7 @@ export default function Counter() { return t4; } -`,m8=`import {useState} from 'react' +`,yN=`import {useState} from 'react' export default function Counter() { const [count, setCount] = useState(0) @@ -6948,9 +6947,9 @@ export default function Counter() { ) } -`;function p8(){const[n,e]=h.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Base Case"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:["currnt count is: ",n]}),t.jsx("button",{onClick:s,children:"Increment"})]})]})}function sp(n){const e={blockquote:"blockquote",code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:["通过上面对 Compiler 渲染结果的理解,我们应该已经大概知道我们的 React 代码最终会渲染成什么样。我们目前要思考的问题就是,我们的代码通过 Compiler 编译之后,",t.jsx(e.strong,{children:"收益表现在哪里?"})]}),` +`;function NN(){const[n,e]=f.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Base Case"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:["currnt count is: ",n]}),t.jsx("button",{onClick:s,children:"Increment"})]})]})}function tp(n){const e={blockquote:"blockquote",code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:["通过上面对 Compiler 渲染结果的理解,我们应该已经大概知道我们的 React 代码最终会渲染成什么样。我们目前要思考的问题就是,我们的代码通过 Compiler 编译之后,",t.jsx(e.strong,{children:"收益表现在哪里?"})]}),` `,t.jsx(e.p,{children:"接下来我们要分析三个不同的案例,来思考这个问题。这篇文章先分析第一个出现在上一章中,最简单的基础案例"}),` -`,t.jsx(T,{children:t.jsx(p8,{})}),` +`,t.jsx(A,{children:t.jsx(NN,{})}),` `,t.jsx(e.p,{children:"完整的源代码与编译之后的代码在右侧可以看到。"}),` `,t.jsxs(e.p,{children:["本文的这个案例中,当我们点击按钮时,此时 ",t.jsx(e.code,{children:"count"})," 增加,"]}),` `,t.jsxs(e.p,{children:["由于 ",t.jsx(e.code,{children:"__clickHandler"})," 函数内部使用了外部的 ",t.jsx(e.code,{children:"count"})," 状态,因此 ",t.jsx(e.code,{children:"__clickHanler"})," 无法缓存,需要重新创建,"]}),` @@ -6972,7 +6971,7 @@ export default function Counter() { `,t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"我们可以通过有意违背规则的方式让编译不发生"}),` `]}),` -`,t.jsx(e.p,{children:"当然,这里多执行的逻辑也并不是很多,我们也可以选择无视。"})]})}function f8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(sp,{...n})}):sp(n)}const h8={"App.js":d8,原代码:m8};function x8(){return t.jsx(ae,{files:h8,renderArticle:n=>t.jsx(f8,{components:{code:n}})})}const g8=`import {useState} from 'react' +`,t.jsx(e.p,{children:"当然,这里多执行的逻辑也并不是很多,我们也可以选择无视。"})]})}function SN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(tp,{...n})}):tp(n)}const wN={"App.js":bN,原代码:yN};function _N(){return t.jsx(W,{files:wN,renderArticle:n=>t.jsx(SN,{components:{code:n}})})}const kN=`import {useState} from 'react' import Button from './Button' import {_c} from './useCache.js' @@ -7089,7 +7088,7 @@ function Expensive() { ) } -`,v8=`import { useState } from 'react' +`,CN=`import { useState } from 'react' function App() { var [counter, setCounter] = useState(0) @@ -7125,7 +7124,7 @@ function Expensive() { ) } -`;function j8(){var[n,e]=h.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Expensive Case"}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"counter",children:["current counter is: ",n]}),t.jsx("button",{onClick:s,children:"counter++"})]}),t.jsx(b8,{})]})}function b8(){for(var n=performance.now();performance.now()-n<100;);return t.jsx("div",{className:"border border-red-500 rounded p-4 mt-4 text-red-500 text-sm leading-6",children:"这是模拟的一个耗时子组件,我的渲染至少要损耗 100ms 的时间,因此如果不做任何优化的情况下,当你快速点击按钮时,你会感受到 counter 的递增会有明显的掉帧。"})}function ap(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(j8,{})}),` +`;function RN(){var[n,e]=f.useState(0);function s(){e(n+1)}return t.jsxs("div",{children:[t.jsx("div",{children:"A Expensive Case"}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"counter",children:["current counter is: ",n]}),t.jsx("button",{onClick:s,children:"counter++"})]}),t.jsx(MN,{})]})}function MN(){for(var n=performance.now();performance.now()-n<100;);return t.jsx("div",{className:"border border-red-500 rounded p-4 mt-4 text-red-500 text-sm leading-6",children:"这是模拟的一个耗时子组件,我的渲染至少要损耗 100ms 的时间,因此如果不做任何优化的情况下,当你快速点击按钮时,你会感受到 counter 的递增会有明显的掉帧。"})}function sp(n){const e={code:"code",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(RN,{})}),` `,t.jsx(e.p,{children:"这里是未被编译优化的案例。右侧区域渲染的是已经被编译优化之后的案例。他们的初始代码都一模一样。大家可以通过快速点击按钮感受一下编译之后的优化提升。"}),` `,t.jsx(e.p,{children:"完整的源代码与编译之后的代码在右侧可以看到。"}),` `,t.jsx(e.p,{children:"我们来分析一下这段代码所带来的提升具体表现在什么地方。"}),` @@ -7161,7 +7160,7 @@ if ($[10] === Symbol.for("react.memo_cache_sentinel")) { t5 = $[10]; } `})}),` -`,t.jsxs(e.p,{children:["因此,编译优化之后,我们能够非常明显的感受到",t.jsx(e.strong,{children:"掉帧的现象"}),"消失了。在优化之前,由于 counter 导致组件 re-render,所以该子组件虽然没有任何参数传递进去,但是依然不可避免的需要重新执行,从而导致每次更新的耗时都非常大。"]})]})}function y8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ap,{...n})}):ap(n)}const N8={"App.js":g8,原代码:v8};function S8(){return t.jsx(ae,{files:N8,renderArticle:n=>t.jsx(y8,{components:{code:n}})})}const w8=`import { useState, useEffect, useRef } from 'react' +`,t.jsxs(e.p,{children:["因此,编译优化之后,我们能够非常明显的感受到",t.jsx(e.strong,{children:"掉帧的现象"}),"消失了。在优化之前,由于 counter 导致组件 re-render,所以该子组件虽然没有任何参数传递进去,但是依然不可避免的需要重新执行,从而导致每次更新的耗时都非常大。"]})]})}function EN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(sp,{...n})}):sp(n)}const AN={"App.js":kN,原代码:CN};function TN(){return t.jsx(W,{files:AN,renderArticle:n=>t.jsx(EN,{components:{code:n}})})}const $N=`import { useState, useEffect, useRef } from 'react' import Panel1 from "./Panel1"; import Panel2 from "./Panel2"; import Panel3 from "./Panel3"; @@ -7207,7 +7206,7 @@ function App() { } export default App -`,_8=`import clsx from 'clsx' +`,LN=`import clsx from 'clsx' function Panel({selected, appeared}) { // 这里是会执行的 @@ -7228,7 +7227,7 @@ function Panel({selected, appeared}) { } export default Panel; -`,k8=`import clsx from 'clsx' +`,DN=`import clsx from 'clsx' function Panel({selected, appeared}) { // 这里是会执行的 @@ -7249,7 +7248,7 @@ function Panel({selected, appeared}) { } export default Panel; -`,C8=`import clsx from 'clsx' +`,ON=`import clsx from 'clsx' function Panel({selected, appeared}) { // 这里是会执行的 @@ -7270,7 +7269,7 @@ function Panel({selected, appeared}) { } export default Panel; -`,R8=`import clsx from 'clsx' +`,BN=`import clsx from 'clsx' function Panel({selected, appeared}) { // 这里是会执行的 @@ -7291,7 +7290,7 @@ function Panel({selected, appeared}) { } export default Panel; -`;function E8({selected:n,appeared:e}){if(!n&&!e)return null;const s=se("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"A utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup."})}function M8({selected:n,appeared:e}){if(!n&&!e)return null;const s=se("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps."})}function A8({selected:n,appeared:e}){if(!n&&!e)return null;const s=se("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"UnoCSS is the instant atomic CSS engine, that is designed to be flexible and extensible. The core is un-opinionated and all the CSS utilities are provided via presets."})}function T8({selected:n,appeared:e}){if(!n&&!e)return null;const s=se("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"React Compiler is a new experimental compiler that we’ve open sourced to get early feedback from the community. It still has rough edges and is not yet fully ready for production."})}const lp=[{title:"Tailwindcss",component:E8,appeared:!1},{title:"React",component:M8,appeared:!1},{title:"Unocss",component:A8,appeared:!1},{title:"Compiler",component:T8,appeared:!1}];function $8(){const[n,e]=h.useState(0),s=h.useRef([...lp]);function a(o){s.current[o].appeared=!0,e(o)}let l=s.current[0],r=s.current[1],c=s.current[2],i=s.current[3];return t.jsxs("div",{className:"bg-gray-100 p-8 rounded-md border border-gray-200",children:[t.jsx("div",{children:lp.map((o,d)=>t.jsx("button",{className:d===n?"text-blue-500":"text-gray-500",onClick:()=>a(d),children:o.title},o.title))}),t.jsx(l.component,{appearder:l.appeared,selected:n===0}),t.jsx(r.component,{appearder:r.appeared,selected:n===1}),t.jsx(c.component,{appearder:c.appeared,selected:n===2}),t.jsx(i.component,{appearder:i.appeared,selected:n===3})]})}function D8(){return t.jsxs("div",{children:[t.jsx(L8,{}),t.jsx(B8,{})]})}function L8(){var n=performance.now();return t.jsxs("div",{className:"mt-4",children:["仅执行 1000,000 次耗时 for 循环耗时:",t.jsxs("span",{className:"text-red-500",children:[performance.now()-n," ms"]})]})}function B8(){var n=performance.now();return t.jsxs("div",{className:"mt-4",children:["for 循环中,比较 1000,000 次耗时:",t.jsxs("span",{className:"text-red-500",children:[performance.now()-n," ms"]})]})}function rp(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx($8,{})}),` +`;function zN({selected:n,appeared:e}){if(!n&&!e)return null;const s=ae("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"A utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup."})}function UN({selected:n,appeared:e}){if(!n&&!e)return null;const s=ae("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps."})}function HN({selected:n,appeared:e}){if(!n&&!e)return null;const s=ae("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"UnoCSS is the instant atomic CSS engine, that is designed to be flexible and extensible. The core is un-opinionated and all the CSS utilities are provided via presets."})}function qN({selected:n,appeared:e}){if(!n&&!e)return null;const s=ae("border px-4 mt-4 py-4 rounded-md bg-gray-50 leading-8",{hidden:!n});return t.jsx("div",{className:s,children:"React Compiler is a new experimental compiler that we’ve open sourced to get early feedback from the community. It still has rough edges and is not yet fully ready for production."})}const ap=[{title:"Tailwindcss",component:zN,appeared:!1},{title:"React",component:UN,appeared:!1},{title:"Unocss",component:HN,appeared:!1},{title:"Compiler",component:qN,appeared:!1}];function VN(){const[n,e]=f.useState(0),s=f.useRef([...ap]);function a(o){s.current[o].appeared=!0,e(o)}let l=s.current[0],r=s.current[1],i=s.current[2],c=s.current[3];return t.jsxs("div",{className:"bg-gray-100 p-8 rounded-md border border-gray-200",children:[t.jsx("div",{children:ap.map((o,u)=>t.jsx("button",{className:u===n?"text-blue-500":"text-gray-500",onClick:()=>a(u),children:o.title},o.title))}),t.jsx(l.component,{appearder:l.appeared,selected:n===0}),t.jsx(r.component,{appearder:r.appeared,selected:n===1}),t.jsx(i.component,{appearder:i.appeared,selected:n===2}),t.jsx(c.component,{appearder:c.appeared,selected:n===3})]})}function XN(){return t.jsxs("div",{children:[t.jsx(GN,{}),t.jsx(ZN,{})]})}function GN(){var n=performance.now();return t.jsxs("div",{className:"mt-4",children:["仅执行 1000,000 次耗时 for 循环耗时:",t.jsxs("span",{className:"text-red-500",children:[performance.now()-n," ms"]})]})}function ZN(){var n=performance.now();return t.jsxs("div",{className:"mt-4",children:["for 循环中,比较 1000,000 次耗时:",t.jsxs("span",{className:"text-red-500",children:[performance.now()-n," ms"]})]})}function lp(n){const e={blockquote:"blockquote",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(VN,{})}),` `,t.jsx(e.p,{children:"这个案例会非常的复杂,经验稍微欠缺一点的前端开发可能都实现不了。我们可以先操作一下上面的按钮,看一下我想要实现的演示效果。"}),` `,t.jsx(e.p,{children:"从演示效果上来看,这是一个普通的 tab 切换。但是先别急,我还有要求。我希望能实现极限的性能优化。"}),` `,t.jsxs(e.ul,{children:[` @@ -7404,7 +7403,7 @@ function ForAndJudge() { ) } `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(D8,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(XN,{})}),` `,t.jsxs(e.p,{children:["由于 for 循环本身也会消耗一点时间,因此我这里单独列出来了 for 循环中不执行任何逻辑的耗时结果。我们可以多次点击 ",t.jsx(e.code,{children:"reload"})," 按钮查看耗时波动。"]}),` `,t.jsx(e.p,{children:"执行结果发现,在我的设备上,在 for 循环中比较 100 万次,总花费时间在 0.5ms 到 1.5ms 之间波动,而且通过对比我们可以知道,这里边的耗时的一大部分是 for 循环的逻辑。如果去除 for 循环的耗时,我们会发现,纯粹的比较耗时可能仅 0.1ms 到 0.5ms 之间。"}),` `,t.jsxs(e.blockquote,{children:[` @@ -7447,7 +7446,7 @@ function ForAndJudge() { `,t.jsx(e.h2,{children:t.jsx(e.em,{children:"3"})}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"总结"})}),` `,t.jsx(e.p,{children:"React Compiler 在保持了对原有语法的弱侵入性的同时,又做到了保持了函数式编程的开发范式,并且弥补了之前可能存在性能问题的缺陷,这无疑是进一步确认了 React 在前端框架方向都领先地位。React Compiler 把虚拟 DOM 的性能表现推向了极致。和进几年声望比较大的 signal 相比,将不会存在性能短板,甚至由于并发模式的存在,React 项目的上限将会比其他前端框架更高。"}),` -`,t.jsx(e.p,{children:"并且 React Compiler 上手成本低,理解起来也不难,未来肯定会快速被大量开发者所接受。作为开发者我们只需要放心使用即可。"})]})}function O8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(rp,{...n})}):rp(n)}const z8={"App.js":w8,"Panel1.jsx":_8,"Panel2.jsx":k8,"Panel3.jsx":C8,"Panel4.jsx":R8,"Button.jsx":gl};function U8(){return t.jsx(ae,{files:z8,renderArticle:n=>t.jsx(O8,{components:{code:n}})})}function H8(){return t.jsxs("form",{id:"form",method:"get",className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"First name: "}),t.jsx("input",{type:"text",defaultValue:"Jake",name:"fname"})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"Last name: "}),t.jsx("input",{type:"text",defaultValue:"Ma",name:"lname"})]}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"提交"})})]})}function cp(n){const e={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"在 html 的基础知识中,表单是很重要的一个环节"}),",但是由于前端框架的盛行,原生表单开发方式相关的知识被部分前端框架所遗忘,很多人对 form action,formdata 很陌生。因此,当看到有消息称 React 19 支持了 form action 之后,许多前端感觉有点懵。这是啥?"]}),` +`,t.jsx(e.p,{children:"并且 React Compiler 上手成本低,理解起来也不难,未来肯定会快速被大量开发者所接受。作为开发者我们只需要放心使用即可。"})]})}function YN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(lp,{...n})}):lp(n)}const QN={"App.js":$N,"Panel1.jsx":LN,"Panel2.jsx":DN,"Panel3.jsx":ON,"Panel4.jsx":BN,"Button.jsx":jl};function JN(){return t.jsx(W,{files:QN,renderArticle:n=>t.jsx(YN,{components:{code:n}})})}function PN(){return t.jsxs("form",{id:"form",method:"get",className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"First name: "}),t.jsx("input",{type:"text",defaultValue:"Jake",name:"fname"})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"Last name: "}),t.jsx("input",{type:"text",defaultValue:"Ma",name:"lname"})]}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"提交"})})]})}function rp(n){const e={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"在 html 的基础知识中,表单是很重要的一个环节"}),",但是由于前端框架的盛行,原生表单开发方式相关的知识被部分前端框架所遗忘,很多人对 form action,formdata 很陌生。因此,当看到有消息称 React 19 支持了 form action 之后,许多前端感觉有点懵。这是啥?"]}),` `,t.jsxs(e.p,{children:["React 19 在开发方式的引导上,意图非常明显,那就是希望开发者能尽量减少对 useState 与 useEffect 的使用。因此,在获取数据时,提供了 ",t.jsx(e.code,{children:"use(promise)"})," 开发方式,在提交数据时,则提供了 ",t.jsx(e.code,{children:"formaction"})," 的方式,这实际上是更加靠近原生 html 的思路。因此在学习 form action 时,需要道友们对 html 中的表单元素,有一个基础的认识。"]}),` `,t.jsx(e.hr,{}),` `,t.jsx(e.h3,{children:"HTML form action"}),` @@ -7460,7 +7459,7 @@ function ForAndJudge() { `})}),` -`,t.jsx(T,{reload:!0,children:t.jsx(H8,{})}),` +`,t.jsx(A,{reload:!0,children:t.jsx(PN,{})}),` `,t.jsx(e.p,{children:"大家可以在 input 中修改输入内容,然后点击提高,此时页面会刷新,然后观察 url 中参数的变化。"}),` `,t.jsxs(e.p,{children:["当我们使用表单 form 元素时,内部的表单元素可以根据 ",t.jsx(e.code,{children:"name"})," 属性与 ",t.jsx(e.code,{children:"value | defaultValue"})," 值自动组合成一个完整的序列化表单对象。我们不再需要额外去拼接他们。"]}),` `,t.jsx(e.p,{children:"合成的序列化对象,我们称之为 FormData, 这是一个特殊的对象。我们可以直接通过如下方式获取到该对象"}),` @@ -7502,7 +7501,7 @@ formdata.get('lname') `})}),` `,t.jsx(e.p,{children:"服务端可以拦截该地址,并定义响应行为。"}),` `,t.jsx(e.p,{children:"这样做的好处就是我们可以简化提交行为的代码。无需使用 JavaScript 对逻辑进行任何额外的处理,就能完成一次提交操作。在没有额外要求的情况下,我们可以非常方便的使用这种方式来提交表单数据,上传文件等。"}),` -`,t.jsx(e.p,{children:"了解了这些html form 元素中的基础知识之后,我们下一章再来详细的学习一下 FormData 的基础知识。"})]})}function q8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(cp,{...n})}):cp(n)}function V8(){function n(e){localStorage.setItem("active_code",e.get("code")),location.reload()}return t.jsxs("div",{className:"pt-4",children:[t.jsx("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-400",children:t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-yellow-700",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"Attention needed"}),t.jsx("div",{className:"mt-2 text-sm text-yellow-700",children:t.jsx("p",{children:"你还未输入激活码,或者激活码已过期,请重新输入即可访问"})})]})]})}),t.jsxs("form",{action:n,className:"flex items-center justify-between",children:[t.jsx(yn,{name:"code",placeholder:"Please input your active code",className:"flex-1 mr-4",pattern:sc}),t.jsx("button",{type:"submit",children:"确认"})]})]})}Bt.registerLanguage("javascript",fu);function X8({className:n,...e}){const s=/language-(\w+)/.exec(n||"");return s?t.jsx(Bt,{language:s[1],PreTag:"div",...e,style:hu}):t.jsx("code",{className:n,...e})}function Ot(n){const{renderArticle:e,isAuth:s=!0,isGiscus:a=!0}=n,l=localStorage.getItem("active_code"),r=s?l===sc:!0;return t.jsxs("div",{className:"keep max-w-[700px] mx-auto",children:[r?e(X8):t.jsx(V8,{}),a&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",crossorigin:"anonymous",async:!0})]})]})}function G8(){return t.jsx(Ot,{renderArticle:n=>t.jsx(q8,{components:{code:n}})})}function ip(n){const e={code:"code",h3:"h3",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:"FormData 使用详解"}),` +`,t.jsx(e.p,{children:"了解了这些html form 元素中的基础知识之后,我们下一章再来详细的学习一下 FormData 的基础知识。"})]})}function WN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(rp,{...n})}):rp(n)}function KN(){function n(e){localStorage.setItem("active_code",e.get("code")),location.reload()}return t.jsxs("div",{className:"pt-4",children:[t.jsx("div",{className:"rounded-md bg-yellow-50 p-4 border border-yellow-400",children:t.jsxs("div",{className:"flex",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6 text-yellow-700",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"Attention needed"}),t.jsx("div",{className:"mt-2 text-sm text-yellow-700",children:t.jsx("p",{children:"你还未输入激活码,或者激活码已过期,请重新输入即可访问"})})]})]})}),t.jsxs("form",{action:n,className:"flex items-center justify-between",children:[t.jsx(yn,{name:"code",placeholder:"Please input your active code",className:"flex-1 mr-4",pattern:ai}),t.jsx("button",{type:"submit",children:"确认"})]})]})}os.registerLanguage("javascript",fu);function IN({className:n,...e}){const s=/language-(\w+)/.exec(n||"");return s?t.jsx(os,{language:s[1],PreTag:"div",...e,style:hu}):t.jsx("code",{className:n,...e})}function rt(n){const{renderArticle:e,isAuth:s=!0,isGiscus:a=!0}=n,l=localStorage.getItem("active_code"),r=s?l===ai:!0;return t.jsxs("div",{className:"keep max-w-[700px] mx-auto",children:[r?e(IN):t.jsx(KN,{}),a&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"border-b mt-20 mb-8 text-lg font-bold pb-3"}),t.jsx(xu,{repo:"yangbo5207/react19feature",repoId:"R_kgDOMGiHOw",category:"General",categoryId:"DIC_kwDOMGiHO84Cf8dR",maping:"pathname",term:"欢迎道友",strict:"0",reactionsEnabled:"1",emitMetadata:"1",inputPosition:"top",lang:"zh-CN",crossorigin:"anonymous",async:!0})]})]})}function FN(){return t.jsx(rt,{renderArticle:n=>t.jsx(WN,{components:{code:n}})})}function ip(n){const e={code:"code",h3:"h3",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:"FormData 使用详解"}),` `,t.jsx(e.p,{children:"FormData API 如下所示。"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-c++",children:`FormData [[Prototype]] @@ -7567,7 +7566,7 @@ formdata.getAll('age') // do something } `})}),` -`,t.jsx(e.p,{children:"OK,简单了解了 FormData 的常用方式之后,有了这个基础,我们再来学习 react 中的 form action."})]})}function Z8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ip,{...n})}):ip(n)}function Y8(){return t.jsx(Ot,{renderArticle:n=>t.jsx(Z8,{components:{code:n}})})}function Q8(){function n(e){const s=e.get("fname"),a=e.get("lname");alert(`输入内容:FirstName: ${s}, LastName: ${a}`)}return t.jsxs("form",{action:n,className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"First name: "}),t.jsx("input",{type:"text",defaultValue:"Jake",name:"fname"})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"Last name: "}),t.jsx("input",{type:"text",defaultValue:"Ma",name:"lname"})]}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"提交"})})]})}function yx(){for(var n=[],e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=0;s<16;s++)n[s]=e.substr(Math.floor(Math.random()*16),1);return n[8]="-",n.join("")}function J8(n){const{ref:e,onChange:s}=n;function a(l){const r={id:yx(),name:l.get("name"),desc:l.get("desc"),hours:l.get("hours"),rate:l.get("rate"),price:l.get("price")};e.current.close(),s&&s(r)}return t.jsx(ra,{ref:e,footer:!0,children:t.jsxs("form",{action:a,children:[t.jsx(yn,{label:"Name",name:"name",placeholder:"Plase input your project name.",required:!0}),t.jsx(yn,{label:"Desc",name:"desc",placeholder:"please input your project description.",required:!0}),t.jsx(yn,{label:"Hours",name:"hours",type:"number",placeholder:"please input hours.",required:!0}),t.jsx(yn,{label:"Rate",name:"rate",type:"number",placeholder:"please input rate.",required:!0}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"Submit"})})]})})}function K8(){const n=h.useRef(null),[e,s]=h.useState([{id:yx(),name:"Logo redesign",desc:"New logo and digital asset playbook.",hours:"20.0",rate:"100.00"}]);function a(r){s([...e,r])}const l=e.reduce((r,c)=>r+c.hours*c.rate,0);return t.jsxs("div",{className:"px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"sm:flex sm:items-center",children:[t.jsxs("div",{className:"sm:flex-auto",children:[t.jsx("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Invoice"}),t.jsxs("p",{className:"mt-2 text-sm text-gray-700",children:["For work completed from ",t.jsx("time",{dateTime:"2022-08-01",children:"August 1, 2022"})," to"," ",t.jsx("time",{dateTime:"2022-08-31",children:"August 31, 2022"}),"."]})]}),t.jsx("div",{className:"mt-4 sm:ml-16 sm:mt-0 sm:flex-none",children:t.jsx("button",{className:"primary",onClick:()=>n.current.show(),children:"Add"})})]}),t.jsx(J8,{ref:n,onChange:a}),t.jsx("div",{className:"-mx-4 mt-8 flow-root sm:mx-0",children:t.jsxs("table",{className:"min-w-full",children:[t.jsxs("colgroup",{children:[t.jsx("col",{className:"w-full sm:w-1/2"}),t.jsx("col",{className:"sm:w-1/6"}),t.jsx("col",{className:"sm:w-1/6"}),t.jsx("col",{className:"sm:w-1/6"})]}),t.jsx("thead",{className:"border-b border-gray-300 text-gray-900",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0",children:"Project"}),t.jsx("th",{scope:"col",className:"hidden px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:table-cell",children:"Hours"}),t.jsx("th",{scope:"col",className:"hidden px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:table-cell",children:"Rate"}),t.jsx("th",{scope:"col",className:"py-3.5 pl-3 pr-4 text-right text-sm font-semibold text-gray-900 sm:pr-0",children:"Price"})]})}),t.jsx("tbody",{children:e.map(r=>t.jsxs("tr",{className:"border-b border-gray-200",children:[t.jsxs("td",{className:"max-w-0 py-5 pl-4 pr-3 text-sm sm:pl-0",children:[t.jsx("div",{className:"font-medium text-gray-900",children:r.name}),t.jsx("div",{className:"mt-1 truncate text-gray-500",children:r.desc})]}),t.jsx("td",{className:"hidden px-3 py-5 text-right text-sm text-gray-500 sm:table-cell",children:r.hours}),t.jsxs("td",{className:"hidden px-3 py-5 text-right text-sm text-gray-500 sm:table-cell",children:["$",r.rate]}),t.jsxs("td",{className:"py-5 pl-3 pr-4 text-right text-sm text-gray-500 sm:pr-0",children:["$",r.hours*r.rate]})]},r.id))}),t.jsxs("tfoot",{children:[t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-6 text-right text-sm font-normal text-gray-500 sm:table-cell sm:pl-0",children:"Subtotal"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-6 text-left text-sm font-normal text-gray-500 sm:hidden",children:"Subtotal"}),t.jsxs("td",{className:"pl-3 pr-4 pt-6 text-right text-sm text-gray-500 sm:pr-0",children:["$",l]})]}),t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-4 text-right text-sm font-normal text-gray-500 sm:table-cell sm:pl-0",children:"Tax"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-4 text-left text-sm font-normal text-gray-500 sm:hidden",children:"Tax"}),t.jsx("td",{className:"pl-3 pr-4 pt-4 text-right text-sm text-gray-500 sm:pr-0",children:"$1760.00"})]}),t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-4 text-right text-sm font-semibold text-gray-900 sm:table-cell sm:pl-0",children:"Total"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-4 text-left text-sm font-semibold text-gray-900 sm:hidden",children:"Total"}),t.jsxs("td",{className:"pl-3 pr-4 pt-4 text-right text-sm font-semibold text-gray-900 sm:pr-0",children:["$",l-1760]})]})]})]})})]})}const W8=`import Dialog from 'components/Dialog' +`,t.jsx(e.p,{children:"OK,简单了解了 FormData 的常用方式之后,有了这个基础,我们再来学习 react 中的 form action."})]})}function e8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(ip,{...n})}):ip(n)}function n8(){return t.jsx(rt,{renderArticle:n=>t.jsx(e8,{components:{code:n}})})}function t8(){function n(e){const s=e.get("fname"),a=e.get("lname");alert(`输入内容:FirstName: ${s}, LastName: ${a}`)}return t.jsxs("form",{action:n,className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"First name: "}),t.jsx("input",{type:"text",defaultValue:"Jake",name:"fname"})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("label",{className:"w-[100px]",children:"Last name: "}),t.jsx("input",{type:"text",defaultValue:"Ma",name:"lname"})]}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"提交"})})]})}function Lx(){for(var n=[],e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=0;s<16;s++)n[s]=e.substr(Math.floor(Math.random()*16),1);return n[8]="-",n.join("")}function s8(n){const{ref:e,onChange:s}=n;function a(l){const r={id:Lx(),name:l.get("name"),desc:l.get("desc"),hours:l.get("hours"),rate:l.get("rate"),price:l.get("price")};e.current.close(),s&&s(r)}return t.jsx(ia,{ref:e,footer:!0,children:t.jsxs("form",{action:a,children:[t.jsx(yn,{label:"Name",name:"name",placeholder:"Plase input your project name.",required:!0}),t.jsx(yn,{label:"Desc",name:"desc",placeholder:"please input your project description.",required:!0}),t.jsx(yn,{label:"Hours",name:"hours",type:"number",placeholder:"please input hours.",required:!0}),t.jsx(yn,{label:"Rate",name:"rate",type:"number",placeholder:"please input rate.",required:!0}),t.jsx("div",{className:"flex justify-end",children:t.jsx("button",{type:"submit",children:"Submit"})})]})})}function a8(){const n=f.useRef(null),[e,s]=f.useState([{id:Lx(),name:"Logo redesign",desc:"New logo and digital asset playbook.",hours:"20.0",rate:"100.00"}]);function a(r){s([...e,r])}const l=e.reduce((r,i)=>r+i.hours*i.rate,0);return t.jsxs("div",{className:"px-4 sm:px-6 lg:px-8",children:[t.jsxs("div",{className:"sm:flex sm:items-center",children:[t.jsxs("div",{className:"sm:flex-auto",children:[t.jsx("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Invoice"}),t.jsxs("p",{className:"mt-2 text-sm text-gray-700",children:["For work completed from ",t.jsx("time",{dateTime:"2022-08-01",children:"August 1, 2022"})," to"," ",t.jsx("time",{dateTime:"2022-08-31",children:"August 31, 2022"}),"."]})]}),t.jsx("div",{className:"mt-4 sm:ml-16 sm:mt-0 sm:flex-none",children:t.jsx("button",{className:"primary",onClick:()=>n.current.show(),children:"Add"})})]}),t.jsx(s8,{ref:n,onChange:a}),t.jsx("div",{className:"-mx-4 mt-8 flow-root sm:mx-0",children:t.jsxs("table",{className:"min-w-full",children:[t.jsxs("colgroup",{children:[t.jsx("col",{className:"w-full sm:w-1/2"}),t.jsx("col",{className:"sm:w-1/6"}),t.jsx("col",{className:"sm:w-1/6"}),t.jsx("col",{className:"sm:w-1/6"})]}),t.jsx("thead",{className:"border-b border-gray-300 text-gray-900",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0",children:"Project"}),t.jsx("th",{scope:"col",className:"hidden px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:table-cell",children:"Hours"}),t.jsx("th",{scope:"col",className:"hidden px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:table-cell",children:"Rate"}),t.jsx("th",{scope:"col",className:"py-3.5 pl-3 pr-4 text-right text-sm font-semibold text-gray-900 sm:pr-0",children:"Price"})]})}),t.jsx("tbody",{children:e.map(r=>t.jsxs("tr",{className:"border-b border-gray-200",children:[t.jsxs("td",{className:"max-w-0 py-5 pl-4 pr-3 text-sm sm:pl-0",children:[t.jsx("div",{className:"font-medium text-gray-900",children:r.name}),t.jsx("div",{className:"mt-1 truncate text-gray-500",children:r.desc})]}),t.jsx("td",{className:"hidden px-3 py-5 text-right text-sm text-gray-500 sm:table-cell",children:r.hours}),t.jsxs("td",{className:"hidden px-3 py-5 text-right text-sm text-gray-500 sm:table-cell",children:["$",r.rate]}),t.jsxs("td",{className:"py-5 pl-3 pr-4 text-right text-sm text-gray-500 sm:pr-0",children:["$",r.hours*r.rate]})]},r.id))}),t.jsxs("tfoot",{children:[t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-6 text-right text-sm font-normal text-gray-500 sm:table-cell sm:pl-0",children:"Subtotal"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-6 text-left text-sm font-normal text-gray-500 sm:hidden",children:"Subtotal"}),t.jsxs("td",{className:"pl-3 pr-4 pt-6 text-right text-sm text-gray-500 sm:pr-0",children:["$",l]})]}),t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-4 text-right text-sm font-normal text-gray-500 sm:table-cell sm:pl-0",children:"Tax"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-4 text-left text-sm font-normal text-gray-500 sm:hidden",children:"Tax"}),t.jsx("td",{className:"pl-3 pr-4 pt-4 text-right text-sm text-gray-500 sm:pr-0",children:"$1760.00"})]}),t.jsxs("tr",{children:[t.jsx("th",{scope:"row",colSpan:3,className:"hidden pl-4 pr-3 pt-4 text-right text-sm font-semibold text-gray-900 sm:table-cell sm:pl-0",children:"Total"}),t.jsx("th",{scope:"row",className:"pl-4 pr-3 pt-4 text-left text-sm font-semibold text-gray-900 sm:hidden",children:"Total"}),t.jsxs("td",{className:"pl-3 pr-4 pt-4 text-right text-sm font-semibold text-gray-900 sm:pr-0",children:["$",l-1760]})]})]})]})})]})}const l8=`import Dialog from 'components/Dialog' import Input from "components/Input"; import getUuid from "@/utils/uuid"; @@ -7601,7 +7600,7 @@ export default function Modal(props) { ) -}`,P8=`import { useState, useRef } from 'react' +}`,r8=`import { useState, useRef } from 'react' import Modal from './Modal' import getUuid from "@/utils/uuid.js"; @@ -7729,7 +7728,7 @@ export default function Table() { ) -}`;function op(n){const e={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"React 19 在表单上提供了更多充满想象空间的 API,它们用好了非常爽,不过一个麻烦的事情是如果你通过自学,想要透彻理解并找到最佳实践可能会非常困难。"}),` +}`;function cp(n){const e={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"React 19 在表单上提供了更多充满想象空间的 API,它们用好了非常爽,不过一个麻烦的事情是如果你通过自学,想要透彻理解并找到最佳实践可能会非常困难。"}),` `,t.jsx(e.p,{children:"这里最核心的原因是因为开发思维发生了比较彻底的变化,主要体现在 React19 在尝试弱化受控组件的概念,尝试引导开发者尽可能少的使用 useEffect,并且尽可能少的使用 useState 存储数据。"}),` `,t.jsx(e.p,{children:"抛开学习成本不谈,我个人认为这是一个非常好的变化,新的开发方式上在开发体验和性能表现上都有非常大的提升。它充分利用了 HTML 中表单元素本身已经支持的能力,例如表单验证,自定义异常样式,自定义错误信息等。"}),` `,t.jsx(e.p,{children:"不过没关系,我会尽量拆分去学习。确保大家都能读有所得。这一章节就先简单给大家介绍一下 React 在表单上的基础表现。"}),` @@ -7763,7 +7762,7 @@ export default function Table() { ) } `})}),` -`,t.jsx(T,{children:t.jsx(Q8,{})}),` +`,t.jsx(A,{children:t.jsx(t8,{})}),` `,t.jsxs(e.p,{children:["当我们点击提交按钮时,action 方法就会触发执行。当然,我们也可以给 ",t.jsx(e.code,{children:"submit"})," 一个 ",t.jsx(e.code,{children:"formAction"})," 属性来达到同样的效果"]}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`
... @@ -7782,10 +7781,10 @@ export default function Table() { `,t.jsx(e.hr,{}),` `,t.jsx(e.h3,{children:"案例"}),` `,t.jsx(e.p,{children:"学习了这些基础知识之后,我们来完成一个比较简单的案例。我们在表单中输入信息,并把信息记录展示在一个列表中。案例演示效果如下"}),` -`,t.jsx(T,{children:t.jsx(K8,{})}),` +`,t.jsx(A,{children:t.jsx(a8,{})}),` `,t.jsxs(e.p,{children:["在这个案例中,我们提供了一个 ",t.jsx(e.code,{children:"Add"})," 按钮,点击该按钮之后,会出现一个弹窗。在弹窗中,我们可以输入每一条信息。输入完成之后,点击提交,输入的信息就会展示在列表中。"]}),` `,t.jsx(e.p,{children:"完整代码如下"}),` -`,t.jsx(In,{files:{"index.jsx":P8,"Modal.jsx":W8}})]})}function F8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(op,{...n})}):op(n)}function I8(){return t.jsx(Ot,{renderArticle:n=>t.jsx(F8,{components:{code:n}})})}async function Nx(n){const e=n.get("title"),s=n.get("content");if(!e||!s)return alert("Miss");await new Promise(a=>setTimeout(a,1e3)),alert(`Title: ${e}, Content: ${s}`)}function eN(){return t.jsxs("form",{action:Nx,children:[t.jsx(yn,{label:"Title",name:"title"}),t.jsx(yn,{label:"content",name:"content"}),t.jsx(le,{children:"Submit"})]})}function nN({children:n}){const{pending:e}=cl.useFormStatus();return t.jsx(le,{primary:!0,disabled:e,children:e?"loading...":n})}function up(){return t.jsxs("form",{action:Nx,children:[t.jsx(yn,{label:"Title",name:"title"}),t.jsx(yn,{label:"content",name:"content"}),t.jsx(nN,{children:"Submit"})]})}const ti=`export async function formAction(fd) { +`,t.jsx(Dn,{files:{"index.jsx":r8,"Modal.jsx":l8}})]})}function i8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(cp,{...n})}):cp(n)}function c8(){return t.jsx(rt,{renderArticle:n=>t.jsx(i8,{components:{code:n}})})}async function Dx(n){const e=n.get("title"),s=n.get("content");if(!e||!s)return alert("Miss");await new Promise(a=>setTimeout(a,1e3)),alert(`Title: ${e}, Content: ${s}`)}function o8(){return t.jsxs("form",{action:Dx,children:[t.jsx(yn,{label:"Title",name:"title"}),t.jsx(yn,{label:"content",name:"content"}),t.jsx(le,{children:"Submit"})]})}function u8({children:n}){const{pending:e}=cl.useFormStatus();return t.jsx(le,{primary:!0,disabled:e,children:e?"loading...":n})}function op(){return t.jsxs("form",{action:Dx,children:[t.jsx(yn,{label:"Title",name:"title"}),t.jsx(yn,{label:"content",name:"content"}),t.jsx(u8,{children:"Submit"})]})}const tc=`export async function formAction(fd) { const title = fd.get('title') const content = fd.get('content') if (!title || !content) { @@ -7794,7 +7793,7 @@ export default function Table() { await new Promise(resolve => setTimeout(resolve, 1000)) alert(\`Title: \${title}, Content: \${content}\`) } -`,tN=`import Input from 'components/Input' +`,d8=`import Input from 'components/Input' import Button from 'components/Button' import {formAction} from './actions' @@ -7807,7 +7806,7 @@ export default function Demo01() {
) } -`,dp=`import Input from 'components/Input' +`,up=`import Input from 'components/Input' import {formAction} from './actions' import SubmitButton from './SubmitButton' @@ -7820,7 +7819,7 @@ export default function Demo01() { ) } -`,mp=`import {useFormStatus} from 'react-dom' +`,dp=`import {useFormStatus} from 'react-dom' import Button from "components/Button"; export default function SubmitButton({children}) { @@ -7831,7 +7830,7 @@ export default function SubmitButton({children}) { ) } -`,sN=`import {useState} from 'react' +`,m8=`import {useState} from 'react' import { useFormStatus } from 'react-dom' import clsx from 'clsx' import './index.css' @@ -7851,10 +7850,10 @@ export default function Input(props) { ) } -`;function pp(n){const e={blockquote:"blockquote",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.blockquote,{children:[` +`;function mp(n){const e={blockquote:"blockquote",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"注:由于 FormAction 在 next.js 中的表现暂时还不稳定,因此,本文以及后续文章的探讨全部都是基于他们在客户端的交互与表现"}),` `]}),` -`,t.jsx(T,{children:t.jsx(eN,{})}),` +`,t.jsx(A,{children:t.jsx(o8,{})}),` `,t.jsx(e.h2,{children:"1"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"action 支持异步回调"})}),` `,t.jsx(e.p,{children:"一个令人振奋的特性就是,在 React19 中,action 支持传入异步回调函数。我们可以在上面的案例中,输入内容,然后点击提交按钮,你会发现弹窗会在延迟一秒之后展示。"}),` @@ -7879,7 +7878,7 @@ export default function Input(props) { } `})}),` `,t.jsxs(e.p,{children:["这里一个比较好玩的事情是,我们可以把 ",t.jsx(e.code,{children:"formAction"})," 函数定义到组件外面去。"]}),` -`,t.jsx(In,{files:{Demo01:tN,"actions.js":ti}}),` +`,t.jsx(Dn,{files:{Demo01:d8,"actions.js":tc}}),` `,t.jsx(e.p,{children:"有了这个特性的支持,我们就可以非常方便的利用它来实现一些上传逻辑。不过一个小小的需求就是,点击提交之后,接口请求的过程中,我们希望按钮处于禁用状态,那应该怎么办呢?"}),` `,t.jsxs(e.p,{children:["React 19 提供了名为 ",t.jsx(e.code,{children:"useFormStatus"})," 的 hook 来帮助我们做到这个事情。"]}),` `,t.jsx(e.h2,{children:"2"}),` @@ -7908,10 +7907,10 @@ export default function Input(props) { `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"案例一:提交时设置禁用按钮"})}),` `,t.jsx(e.p,{children:"为了防止重复提交,我们希望在提交之后就马上禁用按钮,等到提交完成之后再恢复按钮的点击。与此同时,我们可能还需要在 UI 交互上做出一些提示,让用户知道当前正在发送请求"}),` `,t.jsx(e.p,{children:"交互效果如如下,大家可以自行操作感受一下"}),` -`,t.jsx(T,{children:t.jsx(up,{})}),` +`,t.jsx(A,{children:t.jsx(op,{})}),` `,t.jsxs(e.p,{children:["这里主要是针对提交按钮做的操作,因此我们需要单独将提交按钮相关的部分拿出来封装成为一个子组件,并在子组件中利用 ",t.jsx(e.code,{children:"useFormStatus"})," 获取异步 action 的 pending 状态。"]}),` `,t.jsx(e.p,{children:"代码非常的简单,如下所示"}),` -`,t.jsx(In,{files:{Demo02:dp,SubmitButton:mp,"actions.js":ti},active:"1"}),` +`,t.jsx(Dn,{files:{Demo02:up,SubmitButton:dp,"actions.js":tc},active:"1"}),` `,t.jsx(e.h2,{children:"4"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"案例二:提交时禁止输入内容"})}),` `,t.jsx(e.p,{children:"通常情况下,我们也希望在表单提交时,不允许输入内容。useFormStatus 可以很容易帮我们做到这一点。"}),` @@ -7944,8 +7943,8 @@ export default function Input(props) { `})}),` `,t.jsxs(e.p,{children:["我们还可以更激进一点,将其逻辑下层到 ",t.jsx(e.code,{children:"Input"})," 基础组件的封装,演示效果与代码如下"]}),` -`,t.jsx(T,{children:t.jsx(up,{})}),` -`,t.jsx(In,{files:{Demo03:dp,Input:sN,SubmitButton:mp,"actions.js":ti},active:"1"}),` +`,t.jsx(A,{children:t.jsx(op,{})}),` +`,t.jsx(Dn,{files:{Demo03:up,Input:m8,SubmitButton:dp,"actions.js":tc},active:"1"}),` `,t.jsx(e.h2,{children:"5"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"总结"})}),` `,t.jsx(e.p,{children:"useFormStatus 是结合 action 异步请求时使用的 hook,它们是对 HTML 表单能力的增强。因此我们可以借助他们与 HTML 表单元素自身支持的特性实现更复杂的表单交互逻辑。"}),` @@ -7955,7 +7954,7 @@ export default function Input(props) { // ... } `})}),` -`,t.jsx(e.p,{children:"在 onSubmit 中,我们可以结合 state,通过控制数据的行为来自定义表单行为,而无需过多依赖 HTML 表单元素本身的能力。具体如何抉择大家需要根据自身项目的需求情况来定。"})]})}function aN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(pp,{...n})}):pp(n)}function lN(){return t.jsx(Ot,{renderArticle:n=>t.jsx(aN,{components:{code:n}})})}async function rN(n){return n+1}function cN(){const[n,e]=h.useActionState(rN,0);return t.jsxs("form",{action:e,className:"flex items-center",children:[t.jsx("button",{children:"count++"}),t.jsx("div",{className:"ml-4",children:n})]})}function iN({cart:n=[]}){return t.jsx("div",{children:n.map((e,s)=>t.jsxs("div",{className:"border border-yellow-400 p-4 rounded my-4",children:[t.jsxs("div",{className:"font-bold",children:["title: ",e.title]}),t.jsxs("div",{children:["id: ",e.id]}),t.jsxs("div",{children:["count: ",e.count||0]})]},`cart_${s}`))})}async function oN(n,e,s){const a=e.get("id"),l=e.get("title");return await new Promise(r=>{setTimeout(()=>{s({id:a,title:l,count:n+1}),r()},300)}),n+1}function uN({children:n}){const{pending:e}=cl.useFormStatus();return t.jsxs(le,{primary:!0,disabled:e,children:[n,e?"...":""]})}function fp({id:n,title:e,onSubmit:s}){const[a,l]=h.useActionState((r,c)=>oN(r,c,s),0);return t.jsxs("form",{action:l,className:"border p-4 my-3 rounded",children:[t.jsxs("h1",{className:"!my-2",children:["book name: ",e]}),t.jsx("input",{type:"hidden",name:"title",value:e}),t.jsx("input",{type:"hidden",name:"id",value:n}),t.jsxs("div",{style:{marginBottom:"20px"},children:["cart count: ",a]}),t.jsx(uN,{children:"ADD TO CART"})]})}function dN(){const[n,e]=h.useState([]);function s(a){const l=n.find(r=>r.id===a.id);if(l)return l.count+=1,e([...n]);e(r=>[...r,a])}return t.jsxs("div",{children:[t.jsx(fp,{id:"001",title:"JavaScript Core advance",onSubmit:s}),t.jsx(fp,{id:"002",title:"React19 all solution",onSubmit:s}),t.jsx(iN,{cart:n})]})}const mN=`export async function submit(cur, formData, onSubmit) { +`,t.jsx(e.p,{children:"在 onSubmit 中,我们可以结合 state,通过控制数据的行为来自定义表单行为,而无需过多依赖 HTML 表单元素本身的能力。具体如何抉择大家需要根据自身项目的需求情况来定。"})]})}function p8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(mp,{...n})}):mp(n)}function f8(){return t.jsx(rt,{renderArticle:n=>t.jsx(p8,{components:{code:n}})})}async function h8(n){return n+1}function x8(){const[n,e]=f.useActionState(h8,0);return t.jsxs("form",{action:e,className:"flex items-center",children:[t.jsx("button",{children:"count++"}),t.jsx("div",{className:"ml-4",children:n})]})}function g8({cart:n=[]}){return t.jsx("div",{children:n.map((e,s)=>t.jsxs("div",{className:"border border-yellow-400 p-4 rounded my-4",children:[t.jsxs("div",{className:"font-bold",children:["title: ",e.title]}),t.jsxs("div",{children:["id: ",e.id]}),t.jsxs("div",{children:["count: ",e.count||0]})]},`cart_${s}`))})}async function j8(n,e,s){const a=e.get("id"),l=e.get("title");return await new Promise(r=>{setTimeout(()=>{s({id:a,title:l,count:n+1}),r()},300)}),n+1}function v8({children:n}){const{pending:e}=cl.useFormStatus();return t.jsxs(le,{primary:!0,disabled:e,children:[n,e?"...":""]})}function pp({id:n,title:e,onSubmit:s}){const[a,l]=f.useActionState((r,i)=>j8(r,i,s),0);return t.jsxs("form",{action:l,className:"border p-4 my-3 rounded",children:[t.jsxs("h1",{className:"!my-2",children:["book name: ",e]}),t.jsx("input",{type:"hidden",name:"title",value:e}),t.jsx("input",{type:"hidden",name:"id",value:n}),t.jsxs("div",{style:{marginBottom:"20px"},children:["cart count: ",a]}),t.jsx(v8,{children:"ADD TO CART"})]})}function b8(){const[n,e]=f.useState([]);function s(a){const l=n.find(r=>r.id===a.id);if(l)return l.count+=1,e([...n]);e(r=>[...r,a])}return t.jsxs("div",{children:[t.jsx(pp,{id:"001",title:"JavaScript Core advance",onSubmit:s}),t.jsx(pp,{id:"002",title:"React19 all solution",onSubmit:s}),t.jsx(g8,{cart:n})]})}const y8=`export async function submit(cur, formData, onSubmit) { const id = formData.get('id') const title = formData.get('title') await new Promise((resolve) => { @@ -7966,7 +7965,7 @@ export default function Input(props) { }) return cur + 1 } -`,pN=`import { useState } from 'react' +`,N8=`import { useState } from 'react' import List from './List' import BookItem from './BookItem' @@ -7991,7 +7990,7 @@ export default function Demo02() { ) } -`,fN=`import {useFormStatus} from 'react-dom' +`,S8=`import {useFormStatus} from 'react-dom' import Button from "components/Button"; export default function SubmitButton({children}) { @@ -8002,7 +8001,7 @@ export default function SubmitButton({children}) { ) } -`,hN=`import {useActionState} from 'react' +`,w8=`import {useActionState} from 'react' import {submit} from './actions.js' import SubmitButton from './SubmitButton' @@ -8021,7 +8020,7 @@ function BookItem({id, title, onSubmit}) { } export default BookItem; -`,xN=`function CartList({cart = []}) { +`,_8=`function CartList({cart = []}) { return (
{cart.map((item, index) => ( @@ -8036,10 +8035,10 @@ export default BookItem; } export default CartList -`;function hp(n){const e={blockquote:"blockquote",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.blockquote,{children:[` +`;function fp(n){const e={blockquote:"blockquote",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsxs(e.blockquote,{children:[` `,t.jsx(e.p,{children:"注:由于 FormAction 在 next.js 中的表现暂时还不稳定,因此,本文以及后续文章的探讨全部都是基于他们在客户端的交互与表现"}),` `]}),` -`,t.jsx(T,{children:t.jsx(cN,{})}),` +`,t.jsx(A,{children:t.jsx(x8,{})}),` `,t.jsx(e.h2,{children:"1"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"useActionState"})}),` `,t.jsxs(e.p,{children:[t.jsx(e.code,{children:"useActionState"})," 与 useState 的使用基本上是一致的。它同样可以用来定义一个",t.jsx(e.strong,{children:"状态"}),"。他和 useState 不一样的是,",t.jsx(e.code,{children:"useActionState"})," 需要结合 form action 使用,它的更新机制依赖于 action。实例代码如下所示。"]}),` @@ -8066,8 +8065,8 @@ export default function Demo01() { `,t.jsx(e.h2,{children:"2"}),` `,t.jsx(e.p,{children:t.jsx(e.strong,{children:"复杂案例"})}),` `,t.jsx(e.p,{children:"大家先来看一下演示效果。然后再根据代码学习,这是一个比较复杂的案例。"}),` -`,t.jsx(T,{reload:!0,children:t.jsx(dN,{})}),` -`,t.jsx(In,{files:{Demo02:pN,BookItem:hN,"actions.js":mN,SubmitButton:fN,List:xN}}),` +`,t.jsx(A,{reload:!0,children:t.jsx(b8,{})}),` +`,t.jsx(Dn,{files:{Demo02:N8,BookItem:w8,"actions.js":y8,SubmitButton:S8,List:_8}}),` `,t.jsxs(e.blockquote,{children:[` `,t.jsxs(e.p,{children:["在 next.js 中使用时,我们可以把 action 单独执行服务端的逻辑,从而轻松做到客户端组件与服务端组件的交互。上面案例中的 ",t.jsx(e.code,{children:"actions.js"})," 则表示服务端的代码"]}),` `]}),` @@ -8087,7 +8086,705 @@ export async function addToCart(prevState, queryData) { }; } } -`})})]})}function gN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(hp,{...n})}):hp(n)}function vN(){return t.jsx(Ot,{renderArticle:n=>t.jsx(gN,{components:{code:n}})})}const Sx=[{type:"tip",name:"前言"},{path:"index",name:"1、开发方式变革",component:O5},{path:"layers",name:"2、学习的三个层次",component:W5},{path:"create",name:"3、创建项目",component:a4},{type:"tip",name:"use(promise)"},{path:"use/base",name:"3、use 基础知识",component:N4},{path:"use/suspense",name:"4、Suspense",component:H4},{path:"use/update",name:"5、点击更新数据",component:s3},{path:"use/initialize",name:"6、初始化请求并更新",component:j3},{path:"use/updatetolist",name:"7、请求并新增到列表",component:L3},{path:"use/loadmore",name:"8、分页列表加载更多",component:K3},{path:"use/search",name:"9、搜索",component:cy},{path:"use/tabs",name:"10、tab 简单切换",component:by,label:"1"},{path:"use/tabshard",name:"11、tab 缓存切换",component:By,label:"2"},{path:"use/fromchildren",name:"12、父级获取数据",component:Ky,label:"3"},{path:"use/nest",name:"13、Suspense 嵌套",component:r6},{path:"use/react16",name:"14、在低版本中使用",component:g6},{type:"tip",name:"use(context)"},{path:"use/ref",name:"15、ref 调整",component:$6},{path:"use/modal",name:"16、自定义弹窗组件",component:H6},{path:"use/contextmodify",name:"17、弹窗中更改内容",component:P6},{path:"use/skinswitch",name:"18、皮肤切换次数",component:i7},{type:"tip",name:"并发 API"},{path:"use/deferred",name:"19、useDeferredValue",component:_7},{path:"use/transition",name:"20、useTransition",component:G7},{type:"tip",name:"Compiler"},{path:"use/importwith19",name:"21、React 19 中引入",component:J7},{path:"use/importwithlower",name:"22、低版本中引入",component:I7},{path:"use/importwithwebpack",name:"23、webpack中引入",component:a8},{path:"use/compilerbase",name:"24、Compiler 编译原理",component:u8},{path:"use/compilercount",name:"25、收益分析-递增",component:x8},{path:"use/compilerexpensive",name:"26、收益分析-耗时子组件",component:S8},{path:"use/compilertabs",name:"27、收益分析-tabs",component:U8},{type:"tip",name:"form action"},{path:"formaction/base",name:"28、form 基础",component:G8},{path:"formaction/formdata",name:"29、FormData 基础",component:Y8},{path:"formaction/action",name:"30、form action",component:I8},{path:"formaction/useformstatus",name:"31、useFormStatus",component:lN},{path:"formaction/useactionstate",name:"32、useActionState",component:vN}];function xp(){return t.jsx("div",{children:Sx.map((n,e)=>n.type==="tip"?t.jsx("div",{className:"mx-2 text-sm px-4 text-gray-400 first:pt-0 pb-4 pt-8",children:n.name},`z-${e}`):t.jsx(Cn,{className:"text-gray-700",activeName:"text-blue-700",to:n.path,children:t.jsxs("li",{className:"mx-2 px-4 py-3 transition hover:bg-blue-100 text-sm flex items-center justify-between hover:text-blue-700 rounded",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),t.jsx("div",{className:"ml-2 line-clamp-1",children:n.name})]}),n.label?t.jsx(Q0,{label:n.label,primary:!0,className:"ml-2"}):null]},n.path)},n.path))})}function jN(){const n=ru(),e=h.useRef(new Map),s=cu(),{pathname:a}=cs();h.useReducer(r=>!r)[1];const l=h.useRef(null);return e.current.has(a)||e.current.set(a,s),h.useEffect(()=>{location.pathname==="/tutorial"&&n("index")},[a]),t.jsxs("div",{className:"pt-16 md:flex",children:[t.jsx(le,{signal:!0,className:"fixed bottom-6 right-6 z-40 md:hidden",onClick:()=>l.current.show(),children:"目录"}),t.jsx(nc,{ref:l,onClose:()=>l.current.close(),children:t.jsx("div",{className:"bg-white h-full py-4 overflow-scroll",children:t.jsx(xp,{})})}),t.jsxs("nav",{className:"hidden md:block w-60 sticky top-16 h-[calc(100vh_-_5rem)] overflow-y-auto bg-hei",children:[t.jsxs("div",{className:"flex items-center px-4 py-8",children:[t.jsx("div",{className:"flex items-center justify-between p-1 border mr-3 rounded-md border-cyan-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5 text-cyan-500",children:t.jsx("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v4.19l-1.72-1.72a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 1 0-1.06-1.06l-1.72 1.72V10.5Z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"text-sm",children:[t.jsx("div",{children:"当前版本"}),t.jsx("div",{className:"text-gray-500",children:"React@19.0.0-rc"})]})]}),t.jsx("ul",{className:"border-r h-[calc(100vh_-_9rem_-_35px)] overflow-y-auto pb-8",children:t.jsx(xp,{})})]}),t.jsx("div",{className:"md:flex-1 md:w-[calc(100vw_-_15rem)] p-4 md:p-8 min-h-[calc(100vh_-_5rem)] box-border",children:Array.from(e.current).map(([r,c])=>t.jsx("div",{style:{display:a===r?"block":"none"},children:c},r))})]})}function gp(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"基础使用"}),` +`})})]})}function k8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(fp,{...n})}):fp(n)}function C8(){return t.jsx(rt,{renderArticle:n=>t.jsx(k8,{components:{code:n}})})}const R8=`import { useOptimistic, useState, useRef } from "react"; +import { getMessage } from "./api"; +import {reducer} from './reducer' + +export default function Index() { + const [messages, setMessages] = useState([]); + const [optimisticMessages, addOptimisticMessage] = useOptimistic(messages, reducer); + + const form = useRef(null); + + async function formAction(formData) { + let newMessage = formData.get("message") + addOptimisticMessage(newMessage); + form.current.reset(); + let message = await getMessage(newMessage); + setMessages([...messages, {text: message}]) + } + + return ( + <> +
+ + +
+ + {optimisticMessages.map((message, index) => ( +
+ {message.text} {!!message.sending && (Sending...)} +
+ ))} + + ); +} + +`,M8=`const random = [ + 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', + 'Whether you work on your own or with thousands of other developers, using React feels the same.', + 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', + 'This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ', + 'You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it.' +] + +var myHeaders = new Headers(); +myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)"); + +var requestOptions = { + method: 'GET', + headers: myHeaders, + redirect: 'follow', + data: 'hex' +}; + +// 你可以动态修改最后的数字,然后观察请求情况 +const url = 'https://echo.apifox.com/delay/1' + +export const getMessage = async (message) => { + await fetch(url, requestOptions) + return message +} +`,E8=`export function reducer(state, newMessage) { + let newItem = { + text: newMessage, + sending: true + } + return [...state, newItem] +}`;var Ox=new Headers;Ox.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var A8={method:"GET",headers:Ox,redirect:"follow",data:"hex"};const T8="https://echo.apifox.com/delay/1",$8=async n=>(await fetch(T8,A8),n);function L8(n,e){let s={text:e,sending:!0};return[...n,s]}function so(){const[n,e]=f.useState([]),[s,a]=f.useOptimistic(n,L8),l=f.useRef(null);async function r(i){let c=i.get("message");a(c),l.current.reset();let o=await $8(c);e([...n,{text:o}])}return t.jsxs(t.Fragment,{children:[t.jsxs("form",{action:r,ref:l,className:"flex",children:[t.jsx("input",{type:"text",name:"message",placeholder:"enter your message"}),t.jsx("button",{type:"submit",className:"ml-2",children:"Send"})]}),s.map((i,c)=>t.jsxs("div",{className:"indent-1 text-slate-600 mt-1 hover:bg-slate-100 p-2 cursor-pointer rounded",children:[i.text," ",!!i.sending&&t.jsx("small",{children:" (Sending...)"})]},c))]})}function hp(n){const e={blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:t.jsx(e.strong,{children:"useOptimistic"})}),` +`,t.jsxs(e.p,{children:["如果你在之前的项目开发过程中,被乐观更新的需求折磨过,那么你一定会喜欢这个新 hook:",t.jsx(e.code,{children:"useOptimistic"}),"。它让原本实现起来比较困难的乐观更新,变得非常简单。"]}),` +`,t.jsx(e.p,{children:"通常是指在提交数据时,乐观估计请求结果,不等待真实的请求结果,而直接基于乐观结果修改页面状态的交互方式。例如,我们在聊天软件中,发送一条消息时,当我们点击发送之后,消息就会立即出现在聊天界面。而不会等待发送成功之后再更新页面 UI"}),` +`,t.jsx(e.p,{children:"普通的逻辑为"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-bash",children:`1、事件触发 +2、发起请求,等待请求成功 Loading +3、请求成功 +4、更新 UI 为正确结果 +`})}),` +`,t.jsx(e.p,{children:"乐观更新的执行过程为"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-bash",children:`1、事件触发 -> 直接更新 UI +2、更新 UI 的同时发起请求 Loading +3、请求成功 -> 保持UI 不变 +4、若请求失败 -> 则回退 UI +`})}),` +`,t.jsx(e.p,{children:"乐观更新在合适的场景之下,能够更加快速的响应用户交互,在体验上更好一些,因此这是许多项目都想要追求的交互结果。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"适用场景"}),` +`,t.jsx(e.p,{children:"并不是所有的操作都适合乐观更新,这需要一些明确的前提条件"}),` +`,t.jsxs(e.ul,{children:[` +`,t.jsx(e.li,{children:"1、请求成功的概率非常大,几乎不会失败"}),` +`,t.jsx(e.li,{children:"2、不涉及到频繁的,密集的 UI 变化"}),` +`,t.jsx(e.li,{children:"3、可撤回的 UI 变化"}),` +`,t.jsx(e.li,{children:"4、与服务端的反馈时间短,不是一个长期的持续的响应过程"}),` +`]}),` +`,t.jsx(e.p,{children:"例如,在聊天软件中,发送一条消息,在阅读文章时,点赞收藏按钮的交互,给文章发送一条评论,删除一条评论等都非常适合乐观更新。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"实现乐观更新需要具备的技术条件"}),` +`,t.jsxs(e.p,{children:["由于乐观更新是一种在",t.jsx(e.strong,{children:"低概率"}),"的情况下,需要撤回更新状态的交互机制,因此,我们在第一时间更新到最新状态时,需要保留上一次的更新状态以便撤回。"]}),` +`,t.jsxs(e.p,{children:["这样的场景与 ",t.jsx(e.code,{children:"redux/useReducer"})," 需要的技术架构非常类似。因此,每一次的更新我们都可以将其设计为一次 action,通过 reducer 的方式将其合并到完整数据中去"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`interface Action { + // 操作方式 + type: string, + // 乐观更新的数据结构 + state: { + id: 'xxx', + text: 'xxx' + } +} +`})}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`// 假设 state 是一个列表 +reducer(state, action) { + return [...state, action.state] +} +`})}),` +`,t.jsx(e.p,{children:"如果保留了上一次的更新状态,我们也可以非常方便的还原数据。"}),` +`,t.jsxs(e.p,{children:["除此之外,乐观更新的数据结构是我们在客户端根据预估情况生成的,因此不能直接存储在服务端,有的数据需要按照服务端的逻辑来创建,例如一条数据包含了 ",t.jsx(e.code,{children:"id"}),",那么我们就不能按照客户端的逻辑来创建 id,这个时候,需要我们",t.jsx(e.strong,{children:"在接口请求成功之后,完整的完成一次数据的替换"}),"。"]}),` +`,t.jsx(e.p,{children:"最后,还有一个非常重要的问题。那就是更新快速重复的发生时如何处理。这是乐观更新最考验开发者技术能力的地方。"}),` +`,t.jsx(e.p,{children:"当第一次请求还没结束的时候,但是此时当乐观更新重复发生,就会引发一系列不合理的问题。因此,什么时候将 action 合并到真实数据中去,就需要反正斟酌。"}),` +`,t.jsx(e.p,{children:"这里不仅要考虑更新失败时我们应该如何处理,更需要考虑竞态的顺序问题,我们必须以 action 创建的顺序将 action 合并到数据中。"}),` +`,t.jsx(e.p,{children:"在保证顺序的这个基础之上,我们还需要考虑前面如果某个 action 迟迟得不到响应,会阻塞后面 action 的合并。因此,我们还需要设计一个合理的超时机制。"}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"所以,如果我们自己来设计一套完善的乐观更新机制,对开发者开发能力的要求非常高,我们可以将其作为项目亮点在面试中去介绍"}),` +`]}),` +`,t.jsx(e.p,{children:"因此,显而易见的是,基于并发模式的 React,解决乐观更新这类交互问题非常的适合,接下来我们就一起来学习一下 React 19 中,针对乐观更新提出来的解决方案"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"React 19 是如何实现乐观更新的"}),` +`,t.jsx(e.p,{children:"React 19 针对乐观更新,提出了一个新的 hook,useOptimistic"}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"注意,乐观更新完整的技术实现一定要结合我们刚才所提到的技术基础来理解,单独只学习一个 hook,无法构成乐观更新的完整方案"}),` +`]}),` +`,t.jsx(e.p,{children:"它的基础语法如下"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const [optimisticState, addOptimistic] = useOptimistic(state, updateFn); +`})}),` +`,t.jsxs(e.p,{children:["注意看,useOptimistic 接收两个参数,其实这两个参数与 ",t.jsx(e.code,{children:"reducer"})," 的参数非常相似。"]}),` +`,t.jsxs(e.p,{children:[t.jsx(e.code,{children:"state"})," 表示当前状态,",t.jsx(e.code,{children:"updateFn"})," 表示我们如何将新的 action 合并到 ",t.jsx(e.code,{children:"state"})," 中去"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`updateFn = (currentState, value) => { + // 根据上一次状态与新的 value 合并 + // merge and return new state +} +`})}),` +`,t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"optimisticState"})," 表示合并之后的新状态。但是这里我们需要特别注意的是,它是一个临时状态,并非最终状态。通常情况下,我们会使用该临时状态渲染 UI,以便 UI 能够得到最快速的响应。"]}),` +`,t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"addOptimistic"})," 是一次操作行为,类似于 dispatch,它会将参数传递给 ",t.jsx(e.code,{children:"updateFn"})]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`addOptimistic({a: 1}) + +-> + +// 此时 value = {a: 1} +updateFn = (currentState, value) => { + return [...currentState, value] +} +`})}),` +`,t.jsx(e.p,{children:"因此,在使用 useOptimistic 之前,我们还需要借助 useState 创造一个状态,该状态为更新的真实状态。我们通过 useOptimistic 得到的状态是一个副本,它通过 useState 的状态来初始化,在接口请求成功之后,真实状态才会得到更新。"}),` +`,t.jsx(e.p,{children:"接下来,我们来实现一个简单的案例。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"案例一:消息发送"}),` +`,t.jsx(A,{children:t.jsx(so,{})}),` +`,t.jsx(e.p,{children:"我们要实现的效果案例如上。"}),` +`,t.jsxs(e.p,{children:["首先明确一点,消息发送是一个异步过程,因此我们把这个过程使用 ",t.jsx(e.code,{children:"Sending..."})," 字符来表示,当每条消息的 ",t.jsx(e.code,{children:"Sending..."})," 消失,才表示数据更新成功。"]}),` +`,t.jsx(e.p,{children:"先来考虑布局。"}),` +`,t.jsx(e.p,{children:"首先我们需要一个 form 表单来处理输入的交互"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:`
+ + +
+`})}),` +`,t.jsxs(e.p,{children:["然后我们需要一个列表来渲染输出之后的结果。根据我们之前的学习结果,该列表需要用 ",t.jsx(e.code,{children:"useOptimistic"})," 返回的临时状态来处理,这样我们才能够第一时间在 UI 上看到反馈结果"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-jsx",children:`{optimisticMessages.map((message, index) => ( +
+ {message.text} + {!!message.sending && (Sending...)} +
+))} +`})}),` +`,t.jsx(e.p,{children:"再来思考状态如何设计。"}),` +`,t.jsx(e.p,{children:"首先我们需要使用 useState 来设计一个状态,用于存储真实的状态结果"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const [messages, setMessages] = useState([]); +`})}),` +`,t.jsxs(e.p,{children:["然后我们需要使用 ",t.jsx(e.code,{children:"useOptimistic"})," 来设计临时状态,这里需要注意的是,我们可以把它当成一个 reducer 来看待,第一个参数表示当前状态,第二参数表示一个合并方式"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const [optimisticMessages, addOptimisticMessage] = useOptimistic( + messages, + (state, newMessage) => [ + ...state, + { + text: newMessage, + sending: true + } + ] +); +`})}),` +`,t.jsxs(e.p,{children:["临时状态中包含一个 ",t.jsx(e.code,{children:"sending: true"}),",用于标识当前请求正在发生。"]}),` +`,t.jsxs(e.p,{children:["在 ",t.jsx(e.code,{children:"formAction"})," 回调函数中,我们会调用 ",t.jsx(e.code,{children:"addOptimisticMessage"})," 立即更新临时状态,并发送请求,我们提前把发送请求的接口写好"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`// actions.js +export async function deliverMessage(message) { + await new Promise((res) => setTimeout(res, 1000)); + return message; +} +`})}),` +`,t.jsxs(e.p,{children:["那么,",t.jsx(e.code,{children:"formAction"})," 的完整逻辑为"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`async function formAction(formData) { + let newMessage = formData.get("message") + addOptimisticMessage(newMessage); + let message = await deliverMessage(newMessage); + setMessages([...messages, {text: message}]) +} +`})}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"请求发送成功之后,更新真实状态"}),` +`]}),` +`,t.jsx(e.p,{children:"这样,一个简单的乐观更新交互,我们就完成了,该案例的完整代码右侧所示。"}),` +`,t.jsx(A,{children:t.jsx(so,{})}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"reset() 用于立即重置表单内容,可进行下一次输入。默认行为是接口请求成功之后才会重置"}),` +`]}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"问题"}),` +`,t.jsxs(e.p,{children:["尝试一下快速连续输入内容并 ",t.jsx(e.code,{children:"Send"}),",我们会发现,最终的效果并非我们所愿,此时会有多条内容同时正在 ",t.jsx(e.code,{children:"Sending"}),",但是最终请求成功之后,这些同时的 ",t.jsx(e.code,{children:"Sending"})," 内容仅有一条信息被合并到最终结果中,其他的内容会消失。那么在此基础之上,我们需要如何来解决这个问题呢?下一章我们继续学习。"]})]})}function D8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(hp,{...n})}):hp(n)}const O8={"App.js":R8,"api.js":M8,"reducer.js":E8};function B8(){return t.jsx(W,{files:O8,renderArticle:n=>t.jsx(D8,{components:{code:n}}),caseRender:t.jsx(so,{})})}const z8=`import { useOptimistic, useState, useRef, useTransition } from "react"; +import { getMessage } from "./api"; +import {reducer} from './reducer' + +export default function Index() { + const [messages, setMessages] = useState([]); + const [optimisticMessages, addOptimisticMessage] = useOptimistic(messages, reducer); + const [isPending, startTransition] = useTransition() + + const form = useRef(null); + + async function formAction(formData) { + let newMessage = formData.get("message") + form.current.reset(); + startTransition(async () => { + addOptimisticMessage(newMessage); + let message = await getMessage(newMessage); + setMessages([...messages, {text: message}]) + }) + } + + return ( + <> +
+ + +
+ + {optimisticMessages.map((message, index) => ( +
+ {message.text} {!!message.sending && (Sending...)} +
+ ))} + + ); +} + +`,U8=`const random = [ + 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', + 'Whether you work on your own or with thousands of other developers, using React feels the same.', + 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', + 'This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ', + 'You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it.' +] + +var myHeaders = new Headers(); +myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)"); + +var requestOptions = { + method: 'GET', + headers: myHeaders, + redirect: 'follow', + data: 'hex' +}; + +// 你可以动态修改最后的数字,然后观察请求情况 +const url = 'https://echo.apifox.com/delay/1' + +export const getMessage = async (message) => { + await fetch(url, requestOptions) + return message +} +`,H8=`export function reducer(state, newMessage) { + let newItem = { + text: newMessage, + sending: true + } + return [...state, newItem] +}`;var Bx=new Headers;Bx.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var q8={method:"GET",headers:Bx,redirect:"follow",data:"hex"};const V8="https://echo.apifox.com/delay/1",X8=async n=>(await fetch(V8,q8),n);function G8(n,e){let s={text:e,sending:!0};return[...n,s]}function zx(){const[n,e]=f.useState([]),[s,a]=f.useOptimistic(n,G8),[l,r]=f.useTransition(),i=f.useRef(null);async function c(o){let u=o.get("message");i.current.reset(),r(async()=>{a(u);let d=await X8(u);e([...n,{text:d}])})}return t.jsxs(t.Fragment,{children:[t.jsxs("form",{action:c,ref:i,className:"flex",children:[t.jsx("input",{type:"text",name:"message",placeholder:"enter your message",disabled:l}),t.jsx("button",{type:"submit",className:"ml-2",disabled:l,children:"Send"})]}),s.map((o,u)=>t.jsxs("div",{className:"indent-1 text-slate-600 mt-1 hover:bg-slate-100 p-2 cursor-pointer rounded",children:[o.text," ",!!o.sending&&t.jsx("small",{children:" (Sending...)"})]},u))]})}function xp(n){const e={code:"code",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:"案例二:结合 useTransition"}),` +`,t.jsx(e.p,{children:"在上一章的案例中,当我们快速发送多条信息时,我们发现,并不是每一条消息都被成功合并到真实状态中了。最终结果是有的消息不见了。那如何解决这个问题呢?"}),` +`,t.jsxs(e.p,{children:["我们可以结合 ",t.jsx(e.code,{children:"useTransition"})," 来防止用户连续触发 ",t.jsx(e.code,{children:"formAction"})," 的执行"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`const [isPending, startTransition] = useTransition() +`})}),` +`,t.jsx(e.p,{children:"formAction 的定义调整为:"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`async function formAction(formData) { + let newMessage = formData.get("message") + form.current.reset() + startTransition(async () => { + addOptimisticMessage(newMessage); + let message = await deliverMessage(newMessage); + setMessages((messages) => [...messages, {text: message}]) + }) +} +`})}),` +`,t.jsxs(e.p,{children:["然后使用 ",t.jsx(e.code,{children:"isPending"})," 来控制输入的禁用状态"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:`
+ + +
+`})}),` +`,t.jsx(e.p,{children:"感受一下最终演示效果"}),` +`,t.jsx(A,{children:t.jsx(zx,{})}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"问题"}),` +`,t.jsxs(e.p,{children:["很明显,这并不是最合理的交互方案。我们期望的是,",t.jsx(e.strong,{children:"连续输入依然能够发生"}),",在这个基础之上我们可以控制好数据的合并逻辑,那么借助 react 19 的机制,我们可以如何实现呢?"]})]})}function Z8(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(xp,{...n})}):xp(n)}const Y8={"App.js":z8,"api.js":U8,"reducer.js":H8};function Q8(){return t.jsx(W,{files:Y8,renderArticle:n=>t.jsx(Z8,{components:{code:n}}),caseRender:t.jsx(zx,{})})}const J8=`import { useState, useRef, use, Suspense } from "react"; +import { getMessage } from "./api"; + +export default function Index() { + const [actions, updateActions] = useState([]); + const form = useRef(null); + + function formAction(formData) { + let newMessage = formData.get("message") + form.current.reset(); + let action = { + newMessage, + promise: getMessage(newMessage) + } + updateActions((actions) => [...actions, action]) + } + + return ( + <> +
+ + +
+ + {actions.map((action, index) => ( + {action.newMessage}(Seding...)}> + + + ))} + + ); +} + +function Message({children}) { + return ( +
+ {children} +
+ ) +} + +function ListItem(props) { + const msg = use(props.promise) + return ( + {msg} + ) +}`,P8=`const random = [ + 'React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.', + 'Whether you work on your own or with thousands of other developers, using React feels the same.', + 'React components are JavaScript functions. Want to show some content conditionally? Use an if statement. Displaying a list? Try array map(). Learning React is learning programming.', + 'This markup syntax is called JSX. It is a JavaScript syntax extension popularized by React. ', + 'You don’t have to build your whole page in React. Add React to your existing HTML page, and render interactive React components anywhere on it.' +] + +var myHeaders = new Headers(); +myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)"); + +var requestOptions = { + method: 'GET', + headers: myHeaders, + redirect: 'follow', + data: 'hex' +}; + +// 你可以动态修改最后的数字,然后观察请求情况 +const url = 'https://echo.apifox.com/delay/1' + +export const getMessage = async (message) => { + await fetch(url, requestOptions) + return message +} +`;var Ux=new Headers;Ux.append("User-Agent","Apifox/1.0.0 (https://apifox.com)");var W8={method:"GET",headers:Ux,redirect:"follow",data:"hex"};const K8="https://echo.apifox.com/delay/1",I8=async n=>(await fetch(K8,W8),n);function Hx(){const[n,e]=f.useState([]),s=f.useRef(null);function a(l){let r=l.get("message");s.current.reset();let i={newMessage:r,promise:I8(r)};e(c=>[...c,i])}return t.jsxs(t.Fragment,{children:[t.jsxs("form",{action:a,ref:s,className:"flex",children:[t.jsx("input",{type:"text",name:"message",placeholder:"enter your message"}),t.jsx("button",{type:"submit",className:"ml-2",children:"Send"})]}),n.map((l,r)=>t.jsx(f.Suspense,{fallback:t.jsxs(qx,{children:[l.newMessage,"(Seding...)"]}),children:t.jsx(F8,{promise:l.promise})},`h-${r}`))]})}function qx({children:n}){return t.jsx("div",{className:"indent-1 text-slate-600 mt-1 hover:bg-slate-100 p-2 cursor-pointer rounded",children:n})}function F8(n){const e=f.use(n.promise);return t.jsx(qx,{children:e})}function gp(n){const e={blockquote:"blockquote",code:"code",h3:"h3",p:"p",pre:"pre",strong:"strong",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:t.jsx(e.strong,{children:"解决上一章的问题"})}),` +`,t.jsx(e.p,{children:"我们这一章要解决的问题是,如果我要连续快速输入,内容,又不想多个 Sending 中的信息被合并,同时呢,我们又不想使用一些方式限制用户的输入,那么我们应该怎么做?"}),` +`,t.jsx(e.p,{children:"我们在解决问题时,一定要对问题做出精准的分析,从而找到合适的解决方案。这里需求发生了一点变动,这里的变动就是,我不希望多个同时处于发送状态中的信息被回退重置。因此,我们要把状态拆分开,每一条信息各自维护自己的状态。"}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"因此,通常情况下,我们会把需求进一步调整成为请求失败也不回退,而是给出重试按钮或者异常状态,这种情况下,就和乐观更新的需求产生了一点微妙的差异。基于这个基础,我们来重新思考实现方案"}),` +`]}),` +`,t.jsx(e.p,{children:"即然已经跟乐观更新产生了差异,那么我们就只需要借助常规的手段来实现即可。这里需要注意的是,虽然从需求上来说,我们可以不再思考回退,但是还需要保持乐观更新的 UI 特性。因此,在数据结构的设计上就需要有一些技巧。"}),` +`,t.jsx(e.p,{children:"UI 需求的步骤为"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`1、事件触发 -> UI 立即更新 +2、UI 更新的同时,发送请求,此时可以显示 Loading 状态 +3、请求成功之后,UI 确定更新,Loading 状态小时 +4、请求失败,显示失败状态 +`})}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"我们注意看,这里虽然与我们之前描述的乐观更新有所差异,但是保留了大部分乐观更新的核心特征,只是没有失败回退的效果,而是失败重置或者显示失败状态"}),` +`]}),` +`,t.jsxs(e.p,{children:["首先,我们设计一个状态数据结构,该状态将要保留了乐观更新时提前展示的消息,以及一个 promise 用于请求。我们准备结合 ",t.jsx(e.code,{children:"use"})," + ",t.jsx(e.code,{children:"Suspense"})," 共同完成这个事情。"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`action = { + newMessage: 'hello world', + promise: getMessage(newMessage) +} +`})}),` +`,t.jsx(e.p,{children:"我们将会维护一个 action 组成的数组作为状态"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`const [actions, updateActions] = useState([]); +`})}),` +`,t.jsxs(e.p,{children:["我们将结合 Suspense fallback 的特性,请求过程中通过 fallback 展示 ",t.jsx(e.code,{children:"newMessage"}),",然后请求成功之后再使用 promise 的请求结果来替换"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`{actions.map((action, index) => ( + {action.newMessage}(Seding...)}> + + +))} +`})}),` +`,t.jsx(e.p,{children:"然后在 form 的 action 回调中,新增新的 action"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-javascript",children:`function formAction(formData) { + let newMessage = formData.get("message") + form.current.reset(); + let action = { + newMessage, + promise: getMessage(newMessage) + } + updateActions((actions) => [...actions, action]) +} +`})}),` +`,t.jsx(e.p,{children:"完整代码请看右侧展示区域,代码演示如下"}),` +`,t.jsx(A,{children:t.jsx(Hx,{})}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsx(e.p,{children:"剩下一个需求,是请求失败展示错误或者重试,留一个小挑战,大家可以自行扩展一下"}),` +`]})]})}function e9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(gp,{...n})}):gp(n)}const n9={"App.js":J8,"api.js":P8};function t9(){return t.jsx(W,{files:n9,renderArticle:n=>t.jsx(e9,{components:{code:n}}),caseRender:t.jsx(Hx,{})})}const s9=`import { useOptimistic, useState, useTransition } from "react"; +import {reducer} from './reducer' +import { likeApi } from "./api"; +import s from './index.module.css' + +export default function Index() { + const [like, setLike] = useState(false); + const [optimisticLike, dispatch] = useOptimistic(like, reducer); + const [isPending, startTransition] = useTransition() + const [end, setEnd] = useState() + + function __clickHandler() { + if (isPending) return + let newState = !like; + startTransition(async () => { + dispatch(newState) + try { + let state = await likeApi(newState) + setLike(state) + setEnd(true) + } catch (e) { + setEnd(false) + } + }) + } + + let __cls = optimisticLike ? \`\${s.cen} \${s.active}\` : s.cen + + return ( +
+
+
+
+
+
+
+ 状态: + {isPending && '请求中...'} + {!isPending && end === true && '请求成功'} + {!isPending && end === false && '请求失败'} +
+
+ ); +} + +`,a9=`export async function likeApi(message) { + await new Promise((resolve, reject) => { + setTimeout(() => { + if (Math.random() > 0.1) { + resolve(message) + } else { + reject(message) + } + }, 1000) + }); + return message; +} +`,l9=`export function reducer(state, newState) { + return newState +} +`,r9=`.star { + position: relative; + transform: scale(0.2); + height: 200px; + --active-color: #d5093c; + --normal-color: #cdcdcd; +} +.cen { + width: 200px; + height: 200px; + background-color: var(--normal-color); +} +.cen.active { + background-color: var(--active-color); + animation: 1s aj; +} + +#lef { + border-radius: 100px; + position: absolute; + top:200px; + left: 300px; +} +#c { + transform: rotate(45deg); + position: absolute; + top:275px; + left: 375px; +} +#rig { + border-radius: 100px; + position: absolute; + top:200px; + left: 450px; +} + +.loading { + text-align: center; +} + +@keyframes aj { + 0%{transform: scale(1)rotate(45deg);} + 50%{transform: scale(1.1)rotate(45deg);} + 100%{transform: scale(1)rotate(45deg);} +} +`;function i9(n,e){return e}async function c9(n){return await new Promise((e,s)=>{setTimeout(()=>{Math.random()>.1?e(n):s(n)},1e3)}),n}const o9="_star_1fvk4_1",u9="_cen_1fvk4_8",d9="_active_1fvk4_13",m9="_aj_1fvk4_1",p9="_lef_1fvk4_1",f9="_c_1fvk4_8",h9="_rig_1fvk4_1",x9="_loading_1fvk4_37",dt={star:o9,cen:u9,active:d9,aj:m9,lef:p9,c:f9,rig:h9,loading:x9};function g9(){const[n,e]=f.useState(!1),[s,a]=f.useOptimistic(n,i9),[l,r]=f.useTransition(),[i,c]=f.useState();function o(){if(l)return;let d=!n;r(async()=>{a(d);try{let m=await c9(d);e(m),c(!0)}catch{c(!1)}})}let u=s?`${dt.cen} ${dt.active}`:dt.cen;return t.jsxs("div",{children:[t.jsxs("div",{className:dt.star,onClick:o,children:[t.jsx("div",{id:dt.lef,className:u}),t.jsx("div",{id:dt.c,className:u}),t.jsx("div",{id:dt.rig,className:u})]}),t.jsxs("div",{className:dt.loading,children:["状态:",l&&"请求中...",!l&&i===!0&&"请求成功",!l&&i===!1&&"请求失败"]})]})}function jp(n){const e={code:"code",h3:"h3",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:"一个复杂的案例"}),` +`,t.jsx(e.p,{children:"再来实现一个比较常见的点赞按钮的交互逻辑。演示效果如上图所示。具体需求如下:"}),` +`,t.jsx(e.p,{children:"当按钮处于灰色状态时,表示用户还未点赞该文章。点击之后,变成红色,表示点赞。"}),` +`,t.jsx(e.p,{children:"当按钮处于红色状态时,表示用户已经点赞该文章。点击之后变成灰色,表示取消点赞。"}),` +`,t.jsxs(e.p,{children:["解决方案与前面提到的完全一致,同时也结合了 ",t.jsx(e.code,{children:"useTransition"})," ,我们就不再一一分析步骤,直接展示完整代码"]}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`import { useOptimistic, useState, useTransition } from "react"; +import { likeApi } from "./api.js"; +import s from './index.module.css' + +export default function Index() { + const [like, setLike] = useState(false); + const [optimisticLike, updateLike] = useOptimistic( + like, + (state, newState) => newState + ); + const [isPending, startTransition] = useTransition() + const [end, setEnd] = useState() + + function __clickHandler() { + if (isPending) return + let newState = !like; + startTransition(async () => { + updateLike(newState) + try { + let state = await likeApi(newState) + setLike(state) + setEnd(true) + } catch (e) { + setEnd(false) + } + }) + } + + let __cls = optimisticLike ? \`\${s.cen} \${s.active}\` : s.cen + + return ( +
+
+
+
+
+
+
+ 状态: + {isPending && '请求中...'} + {!isPending && end === true && '请求成功'} + {!isPending && end === false && '请求失败'} +
+
+ ); +} +`})}),` +`,t.jsx(e.p,{children:"在 api 的请求中,我们可以通过判断随机数的大小来模拟请求失败时的表现。目前请求失败的概率是 10%"}),` +`,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:`// api.js +export async function likeApi(message) { + await new Promise((resolve, reject) => { + setTimeout(() => { + if (Math.random() > 0.1) { + resolve(message) + } else { + reject(message) + } + }, 1000) + }); + return message; +} +`})}),` +`,t.jsx(e.p,{children:"由于逻辑与之前几乎保持一致,因此本案例主要通过代码学习,未做详细讲解,完整代码如右侧所示。"})]})}function j9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(jp,{...n})}):jp(n)}const v9={"App.js":s9,"api.js":a9,"reducer.js":l9,"index.module.css":r9};function b9(){return t.jsx(W,{files:v9,renderArticle:n=>t.jsx(j9,{components:{code:n}}),caseRender:t.jsx(g9,{})})}function vp(n){const e={a:"a",blockquote:"blockquote",code:"code",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.h3,{children:"完结感言"}),` +`,t.jsxs(e.p,{children:["从 5 月 18 号左右,萌生了要写一本这样的付费小册,到现在 7 月 27 号,历时两个多月,",t.jsx(e.strong,{children:"这本小册终于正式完结啦。"})," 。:.゚ヽ(*´∀`)ノ゚.:。 由于我没有上班,几乎可以说是全职投入这本小册,因此看上去历时并不久,但是我经历的东西和过程确实非常多。"]}),` +`,t.jsx(e.p,{children:"当我看着付费群里的 300 多人,从盈利的角度来说,在没有经历过大面积长时间的宣传,这本小册无疑是非常非常成功的。"}),` +`,t.jsx(e.p,{children:"但是除此之外,在这本小册里,我还投入了对于新的学习方式和商业模式的探索,是对于我学习能力的一次重要考验,是对于我综合能力的一次有力验证,因此这本小册对我个人而言,意义非凡,它可能是一个重要的转折点。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"学习方法上的探索"}),` +`,t.jsxs(e.p,{children:["大约从 2017 年开始,我就在",t.jsx(e.a,{href:"https://www.yuque.com/coreadvance/ar2my1/apk8cr",children:"从事 1V1 帮助别人提高前端技术能力的副业"}),",在这个长达 7 年的教学生涯中,我接触到了大量的形形色色的人。在学习的基础能力上,每个人都各不相同。有的人本身就具备较强的基础学习能力,稍加指点,就能够在职场中获得巨大的蜕变。而更多的却是连最基础的学习方法都没有掌握的人。"]}),` +`,t.jsxs(e.p,{children:[t.jsx(e.strong,{children:"因此他们的一个共同的表现就是,他们在学习新知识的时候非常吃力。"})," 甚至还有很多人长时间不得其法。所以在这个过程中,我慢慢变得擅长为每个人量身定做适合的学习方法,并且在教学的过程中,把学习方法的培养变成重中之重。在这个基础之上,他们在跟我学习一段时间之后,就能够自己有足够的学习能力学习新的知识,从而具备自我成长的潜力。一个很好的结果就是,",t.jsx(e.strong,{children:"有好些人在技术方面的成就已经在我之上。"})]}),` +`,t.jsxs(e.p,{children:["但是一个很大的问题就是,这样量身定做学习方法的方式并",t.jsx(e.strong,{children:"不具备普适价值"}),"。我有一个很大的感受就是,",t.jsx(e.strong,{children:"学霸的学习方法往往都是共通的,但是学霸之外,大家在学习上的痛,就长得奇形怪状,千奇百怪。"})," 同样的学习方法,在一个人身上闪闪发光,但是在另外一个人的身上,甚至毫无作用。甚至有的人由于自律的问题,需要在沟通的过程中不停的给他施加压力,否则就是长时间的自我懈怠。"]}),` +`,t.jsx(e.p,{children:"更多的时候,还需要在学习过程中进行大量的心理辅导,帮助它解决各种原因导致的心里内耗。"}),` +`,t.jsxs(e.p,{children:["因此我一直在思考,如何找到一种适合更多人的学习方式。虽然这种学习方法效果不如学霸级学习方法那么立竿见影,但是至少能够保证大多数人都学有所得。经过很多次思考、探索、实践,后来我才发现被广为病垢的",t.jsx(e.strong,{children:"填鸭式学习法"}),"可能才是我想要找的内容。"]}),` +`,t.jsx(e.p,{children:"因为我在很长一段时间里,都一直认为填鸭式学习法是一种落后的,低效的学习方式,但是在带过很多学生之后发现,这可能是大多数人更愿意接受、并且效果性价比最高的一种学习方式。这样的思维转变对我来说非常困难。但是后来我重新审视了我自己长期以来带有偏见的观念。"}),` +`,t.jsx(e.p,{children:"这个思考的灵感来源于付费群里的同学有人跟我说,很多时候不用非得彻底理解,先知道怎么用,用多了自然就理解了。因此在这个基础之上,我在文章内容中,内置了大量的实战案例,以及对应的,原样的代码。大概如下所示。"}),` +`,t.jsx(A,{children:t.jsx(Dn,{files:{App:xx,"api.js":gx,List:vx,Tabs:bx,Skeleton:jx},caseRender:t.jsx(Nx,{})})}),` +`,t.jsx(e.p,{children:"在大量这样的案例的支撑之下,有可能读者无法快速理解我想要传达的开发思维与架构思维,但是现成的案例可以让他快速将其运用到项目实践中。大量的运用实践可以帮助读者在实践中消化,在实践中理解与感悟,这样的障碍和瓶颈会降低很多。学习推进的进度可能会比较慢,但不会让人感觉窒息,不得其法。"}),` +`,t.jsx(e.p,{children:"有真实案例运行的呈现方式,和只是贴代码或者截图很不一样。"}),` +`,t.jsxs(e.ul,{children:[` +`,t.jsx(e.li,{children:"这里的不同则来源于很多时候,贴的代码可能会存在缺少部分细节从而导致代码压根无法正确运行的情况,给学习者带来巨大的困扰。"}),` +`,t.jsx(e.li,{children:"另外一方面则是排版的不规则和零散,会让学习者不得其法。"}),` +`,t.jsx(e.li,{children:"真实案例能够更加直观的展示出来一篇文章的目标,在理解成本上也会降低很多。"}),` +`,t.jsx(e.li,{children:"除此之外,很多只贴代码的表达,是可以不用经过验证的,许多人的文章虽然写出来了,但是并没有真的运行成功过,因此真实案例也是一次有效的验证成功,学习者不用担心这样的代码是无法运行的,减少了很多心里负担。"}),` +`]}),` +`,t.jsxs(e.p,{children:["也是到了后来,群友的正向学习反馈,让我更加理解了",t.jsx(e.strong,{children:"书读百遍,其义自现"}),"的含义。因此实际上这本小册很早就已经写完了,大概是 6 月 27 号发布了第一个版本。这一个月时间里,经历了许多群友的学习验证之后,我才敢写这篇完结感言,因为从大家的反馈中,我感受到了我的这一次探索是达到了我的预期成效的。"]}),` +`,t.jsxs(e.blockquote,{children:[` +`,t.jsxs(e.p,{children:["我写的每一本付费小册,都会深度践行我在学习方法上的思考和感悟,因此在小册开头,我都会花费大量的篇幅为大家讲解在学习方法上我是如何思考的,以便于大家能够快速明确应该以什么样的心态和理念去学习它,例如之前的",t.jsx(e.a,{href:"https://mp.weixin.qq.com/s?__biz=MzI4NjE3MzQzNg==&mid=2649867007&idx=1&sn=6443ff970cd077bbb50de74ce84afa06",children:"《React 哲学》"}),"、",t.jsx(e.a,{href:"https://appxw863qeq2150.h5.xiaoeknow.com/v1/goods/goods_detail/course_2Y46vk3Fhd2CF4CrB5qSNjW6A9R?",children:"《JavaScript 核心进阶》"}),",这本小册也是这样,可能未来我会将这些学习理念融合到一起,那么我的小册质量会越来越高"]}),` +`]}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"商业模式上的思考"}),` +`,t.jsxs(e.p,{children:["这本付费小册,是在我",t.jsx(e.a,{href:"https://mp.weixin.qq.com/s/W7jb77rSzML9vUbF-G0cPg",children:"探索微信小程序流量主模式失败"}),"之后的另外一种尝试。我希望能够在我获得收益的同时能够真实的帮助到他人,从而达到一种",t.jsx(e.strong,{children:"互利共赢"}),"的局面。"]}),` +`,t.jsxs(e.p,{children:["因此,在付费群里面我多次与大家分享了这本小册可以使用在什么地方。首先要明确的一个就是,React 19 代表了一种新的开发方式,",t.jsx(e.strong,{children:"它本身在架构思维上是具有很强的先进性的"}),"。因此我们可以"]}),` +`,t.jsxs(e.ul,{children:[` +`,t.jsx(e.li,{children:"1、在面试中表达自己对 React19 的学习成果,从而展示自己对于新知识的热情"}),` +`,t.jsx(e.li,{children:"2、在团队中做相关的技术分享,为年底绩效等铺垫内容"}),` +`,t.jsx(e.li,{children:"3、彻底掌握 React19 的架构思维,重构团队中已经负重前行的项目,从而体现自己的团队贡献,为晋升打好基础,并且在这个过程中提升自己的项目架构能力"}),` +`]}),` +`,t.jsx(e.p,{children:"值得高兴的是,在这个一个月的时间里,确实有少数几位同学按照我的推荐去认真执行了,并且取得了不错的成效。因此,我希望这种商业模式能够健康的持续下去,以帮助到更多的人。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"技术方案上的思考"}),` +`,t.jsx(e.p,{children:"从最开始萌生一个简单的想法,到最终将这个想法落地,其实中间还需要走很长的路。因此制作一本这样的付费小册的想法只需要一个一瞬间,但是真实要落地下来,面临的困难却非常多。如何实现它成为了一个难题。"}),` +`,t.jsxs(e.p,{children:["这其中比较困难的就在于,如何让演示案例与演示代码",t.jsx(e.strong,{children:"共存"}),",并且案例运行的代码与展示的代码是同一份。这样就极大程度的确保了",t.jsx(e.strong,{children:"一致性"}),"。"]}),` +`,t.jsx(e.p,{children:"为了解决这个难题,我做了一些尝试"}),` +`,t.jsx(e.p,{children:t.jsx(e.strong,{children:"一、调研现有成熟的技术网站"})}),` +`,t.jsx(e.p,{children:"我调研了大多数常用的技术博客论坛,例如大家熟知的知乎、掘金、语雀、以及国外的一些平台,Medium,github 等,但是他们都无法支持我的想法,当然,我本身对我的想法能够被满足也不报太大的希望。"}),` +`,t.jsx(e.p,{children:t.jsxs(e.strong,{children:["二、与 ",t.jsx(e.code,{children:"mdnice"})," 核心开发大鹏沟通,是否能够新增一些需求满足我的想法"]})}),` +`,t.jsxs(e.p,{children:["大鹏是我在做自由职业时认识的一位大佬,他的个人作品 ",t.jsx(e.code,{children:"mdnice"})," 在 md 编辑器上的积累已经非常成熟,因此,因此我第二个想到的是看看能不能在这个基础之上做一些扩展,来满足我的需求,不过后续我们相互沟通之后发现我的这种需求放到他现有的体系里不是很合适,因为 ",t.jsx(e.code,{children:"mdnice"})," 主要面向的是针对公众号的布局开发。"]}),` +`,t.jsx(e.p,{children:"不过在后续的沟通过程中,我们又迸发了许多新的想法,并且后续我可能也会参与 mdnice 的一些开发工作,发挥我的独特优势进一步补全我们的想法,让 mdnice 在商业化的道路上变得更加完善。"}),` +`,t.jsx(e.p,{children:t.jsx(e.strong,{children:"三、调研现有的博客系统,例如 dumi、vitepress、Rspress"})}),` +`,t.jsx(e.p,{children:"这些都是非常成熟的解决方案。并且内置的 mdx 可以比较轻松的完成我的构想。但是由于我的设想中,定制化程度太高,在花费了俩三天时间学习 vitepress 的使用过程中,感觉有一些想要的东西还是实现不了,因此最终决定放弃使用别人现有的方案,而是基于 mdx 自己组装一套方案出来。"}),` +`,t.jsx(e.p,{children:t.jsx(e.strong,{children:"四、调研现有的技术方案"})}),` +`,t.jsx(e.p,{children:"得益于 React 生态的强大,我原本认为会很困难的事情,没想到都有好几种对应的解决方案。"}),` +`,t.jsx(e.p,{children:"这里边需要解决问题包括"}),` +`,t.jsxs(e.ul,{children:[` +`,t.jsx(e.li,{children:"1、md 文件格式的渲染。可选的方案有 react-markdown、mdx 等"}),` +`,t.jsx(e.li,{children:"2、代码高亮 可选的方案有 react-syntax-highlighter、remarkjs、highlight 等"}),` +`,t.jsx(e.li,{children:"3、内置编辑器有 Monaco Editor、Mirror Editor 等"}),` +`,t.jsx(e.li,{children:"4、案例热更新方案 Sandpack"}),` +`]}),` +`,t.jsx(e.p,{children:"我花了很大的精力去分别验证这些解决方案的可行性,最终经过试用淘汰,演变成目前的状态,虽然有的方案最终我并没有采用,但是在这个过程中我对他们的运用已经非常熟练。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"对我综合能力的考验"}),` +`,t.jsx(e.p,{children:"自己开发一个网站,很多时候最考验我的,反而是综合能力。例如在做这个网站的过程中,我自己为整个网站摸索了 UI 风格,并且为每一个案例都精心准备了视觉效果良好的 UI 设计。例如这个案例"}),` +`,t.jsx(A,{children:t.jsx(dx,{})}),` +`,t.jsx(e.p,{children:"我自己设计并实现了常用的 UI 组件。"}),` +`,t.jsx(e.p,{children:"我自己从零到一完成了移动端的适配。"}),` +`,t.jsx(e.p,{children:"我自己重新设计了整个网站的架构,以便于扩展到下一份付费小册中去。"}),` +`,t.jsx(e.p,{children:"我自己招商引资,寻找了几个赞助商进行合作。"}),` +`,t.jsx(e.p,{children:"我自己负责宣传,虽然目前宣传力度很微弱,但是也在某种程度上让几百位同学认同了我的这本小册的价值。"}),` +`,t.jsx(e.p,{children:"所有的事情从头到尾都需要一个人来做,这对于我综合能力的要求是非常高的。事实上在刚开始的时候,我并没有很大的预期他能够取得成功,包括现在我也没有很大的底气能够得到更多人的认可。每一次的宣传都是小心翼翼的试探,很担心最终的结果是无人理会,只是我单方面的自娱自乐。"}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"对于最佳实践的探索"}),` +`,t.jsxs(e.p,{children:["很显然,React 19 的出现,意味着一种",t.jsx(e.strong,{children:"新的开发思维"}),"被正式抬到了大众眼前。在这种新的开发思维之下,我也是从头开始尝试与学习,那么如何找到最佳实践本身就是一件充满挑战的事情。"]}),` +`,t.jsx(e.p,{children:"因此,在写每一个案例时,我都会非常小心的去求证和对比,感受每一种写法在开发思维上所带来的提升。这是最难的一个方向。因此在写这本小册之前,我会把每一个知识点我的学习体会、过程、疑问都放到公众号中与大家进行探讨,在多方求证之后,确定了这样的做法是目前的最佳实践之后,才形成完整的教学文章。"}),` +`,t.jsxs(e.p,{children:["因此,在我的个人公众号",t.jsx(e.code,{children:"这波能反杀"}),"中,你能看到一系列关于 React 19 的文章。幸运的是,在公众号中,我遇到了很多顶尖的大佬跟我探讨学习心得。这才确保了这本付费小册的质量是非常高的。感谢每一位参与过探讨帮助我成长的大佬。"]}),` +`,t.jsx(e.hr,{}),` +`,t.jsx(e.h3,{children:"最后"}),` +`,t.jsxs(e.p,{children:["学习与进步是一个需要持续不断做下去的事情。在写这本小册的过程中,我也收获了大量的新的知识。我的进步非常大。很庆幸我自己可以",t.jsx(e.strong,{children:"很纯粹"}),"的做完这个事情。也希望自己能够长期保持下去,摈弃掉一些外界乱七八糟的杂念与内耗,持续学习,持续进步,以此与大家共勉。"]}),` +`,t.jsxs(e.p,{children:["小册目前价格:",t.jsx(e.strong,{children:"30 元"})]}),` +`,t.jsxs(e.p,{children:["购买方式:添加我的微信 ",t.jsx(e.code,{children:"icanmeetu"})," 微信转账即可,获得激活码即可阅读所有内容"]})]})}function y9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(vp,{...n})}):vp(n)}function bp(){return t.jsx(rt,{isAuth:!1,renderArticle:n=>t.jsx(y9,{components:{code:n}})})}const Vx=[{path:"formaction/end",name:"附录:完结感言",component:bp},{type:"tip",name:"前言"},{path:"index",name:"1、开发方式变革",component:F5},{path:"layers",name:"2、学习的三个层次",component:m4},{path:"create",name:"3、创建项目",component:b4},{type:"tip",name:"use(promise)"},{path:"use/base",name:"3、use 基础知识",component:z4},{path:"use/suspense",name:"4、Suspense",component:ty},{path:"use/update",name:"5、点击更新数据",component:vy},{path:"use/initialize",name:"6、初始化请求并更新",component:Ly},{path:"use/updatetolist",name:"7、请求并新增到列表",component:Wy},{path:"use/loadmore",name:"8、分页列表加载更多",component:u3},{path:"use/search",name:"9、搜索",component:N3},{path:"use/tabs",name:"10、tab 简单切换",component:M3,label:"1"},{path:"use/tabshard",name:"11、tab 缓存切换",component:Z3,label:"2"},{path:"use/fromchildren",name:"12、父级获取数据",component:a6,label:"3"},{path:"use/nest",name:"13、Suspense 嵌套",component:h6},{path:"use/react16",name:"14、在低版本中使用",component:k6},{type:"tip",name:"use(context)"},{path:"use/ref",name:"15、ref 调整",component:V6},{path:"use/modal",name:"16、自定义弹窗组件",component:P6},{path:"use/contextmodify",name:"17、弹窗中更改内容",component:r7},{path:"use/skinswitch",name:"18、皮肤切换次数",component:g7},{type:"tip",name:"并发 API"},{path:"use/deferred",name:"19、useDeferredValue",component:L7},{path:"use/transition",name:"20、useTransition",component:F7},{type:"tip",name:"Compiler"},{path:"use/importwith19",name:"21、React 19 中引入",component:sN},{path:"use/importwithlower",name:"22、低版本中引入",component:cN},{path:"use/importwithwebpack",name:"23、webpack中引入",component:pN},{path:"use/compilerbase",name:"24、Compiler 编译原理",component:vN},{path:"use/compilercount",name:"25、收益分析-递增",component:_N},{path:"use/compilerexpensive",name:"26、收益分析-耗时子组件",component:TN},{path:"use/compilertabs",name:"27、收益分析-tabs",component:JN},{type:"tip",name:"form action"},{path:"formaction/base",name:"28、form 基础",component:FN},{path:"formaction/formdata",name:"29、FormData 基础",component:n8},{path:"formaction/action",name:"30、form action",component:c8},{path:"formaction/useformstatus",name:"31、useFormStatus",component:f8},{path:"formaction/useactionstate",name:"32、useActionState",component:C8},{path:"formaction/useoptimistic",name:"33、useOptimistic",component:B8,label:"1"},{path:"formaction/useoptimistic2",name:"33、useOptimistic",component:Q8,label:"2"},{path:"formaction/useoptimistic3",name:"33、useOptimistic",component:t9,label:"3"},{path:"formaction/useoptimistic4",name:"34、复杂案例",component:b9,label:"4"},{type:"tip",name:"后续闲谈"},{path:"formaction/end",name:"35、完结感言",component:bp}];function yp(){return t.jsx("div",{children:Vx.map((n,e)=>n.type==="tip"?t.jsx("div",{className:"mx-2 text-sm px-4 text-gray-400 first:pt-0 pb-4 pt-8",children:n.name},`z-${e}`):t.jsx(Cn,{className:"text-gray-700",activeName:"text-blue-700",to:n.path,children:t.jsxs("li",{className:"mx-2 px-4 py-3 transition hover:bg-blue-100 text-sm flex items-center justify-between hover:text-blue-700 rounded",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),t.jsx("div",{className:"ml-2 line-clamp-1",children:n.name})]}),n.label?t.jsx(F0,{label:n.label,primary:!0,className:"ml-2"}):null]},n.path)},n.path))})}function N9(){const n=ru(),e=f.useRef(new Map),s=iu(),{pathname:a}=is();f.useReducer(r=>!r)[1];const l=f.useRef(null);return e.current.has(a)||e.current.set(a,s),f.useEffect(()=>{location.pathname==="/tutorial"&&n("index")},[a]),t.jsxs("div",{className:"pt-16 md:flex",children:[t.jsx(le,{signal:!0,className:"fixed bottom-6 right-6 z-40 md:hidden",onClick:()=>l.current.show(),children:"目录"}),t.jsx(ti,{ref:l,onClose:()=>l.current.close(),children:t.jsx("div",{className:"bg-white h-full py-4 overflow-scroll",children:t.jsx(yp,{})})}),t.jsxs("nav",{className:"hidden md:block w-60 sticky top-16 h-[calc(100vh_-_5rem)] overflow-y-auto bg-hei",children:[t.jsxs("div",{className:"flex items-center px-4 py-8",children:[t.jsx("div",{className:"flex items-center justify-between p-1 border mr-3 rounded-md border-cyan-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5 text-cyan-500",children:t.jsx("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v4.19l-1.72-1.72a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 1 0-1.06-1.06l-1.72 1.72V10.5Z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"text-sm",children:[t.jsx("div",{children:"当前版本"}),t.jsx("div",{className:"text-gray-500",children:"React@19.0.0-rc"})]})]}),t.jsx("ul",{className:"border-r h-[calc(100vh_-_9rem_-_35px)] overflow-y-auto pb-8",children:t.jsx(yp,{})})]}),t.jsx("div",{className:"md:flex-1 md:w-[calc(100vw_-_15rem)] p-4 md:p-8 min-h-[calc(100vh_-_5rem)] box-border",children:Array.from(e.current).map(([r,i])=>t.jsx("div",{style:{display:a===r?"block":"none"},children:i},r))})]})}function Np(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"基础使用"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:` `})}),` `,t.jsx("div",{children:t.jsx(le,{children:"hello button"})}),` @@ -8097,18 +8794,18 @@ export async function addToCart(prevState, queryData) { `})}),` -`,t.jsx(T,{children:t.jsxs("div",{className:"mt-4 flex justify-around",children:[t.jsx(le,{danger:!0,children:"Danger"}),t.jsx(le,{primary:!0,children:"Primary"}),t.jsx(le,{success:!0,children:"Success"}),t.jsx(le,{signal:!0,children:"Signal"})]})}),` +`,t.jsx(A,{children:t.jsxs("div",{className:"mt-4 flex justify-around",children:[t.jsx(le,{danger:!0,children:"Danger"}),t.jsx(le,{primary:!0,children:"Primary"}),t.jsx(le,{success:!0,children:"Success"}),t.jsx(le,{signal:!0,children:"Signal"})]})}),` `,t.jsx(e.p,{children:"大小"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:` `})}),` -`,t.jsxs(T,{children:[t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{danger:!0,sm:!0,className:"mr-4",children:"Danger"}),t.jsx(le,{danger:!0,className:"mr-4",children:"Danger"}),t.jsx(le,{danger:!0,lg:!0,children:"Danger"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{success:!0,lg:!0,className:"mr-4",children:"Success"}),t.jsx(le,{success:!0,className:"mr-4",children:"Success"}),t.jsx(le,{success:!0,sm:!0,children:"Success"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{primary:!0,sm:!0,className:"mr-4",children:"Primary"}),t.jsx(le,{primary:!0,className:"mr-4",children:"Primary"}),t.jsx(le,{primary:!0,lg:!0,children:"Primary"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{signal:!0,lg:!0,className:"mr-4",children:"Signal"}),t.jsx(le,{signal:!0,className:"mr-4",children:"Signal"}),t.jsx(le,{signal:!0,sm:!0,children:"Signal"})]})]}),` +`,t.jsxs(A,{children:[t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{danger:!0,sm:!0,className:"mr-4",children:"Danger"}),t.jsx(le,{danger:!0,className:"mr-4",children:"Danger"}),t.jsx(le,{danger:!0,lg:!0,children:"Danger"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{success:!0,lg:!0,className:"mr-4",children:"Success"}),t.jsx(le,{success:!0,className:"mr-4",children:"Success"}),t.jsx(le,{success:!0,sm:!0,children:"Success"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{primary:!0,sm:!0,className:"mr-4",children:"Primary"}),t.jsx(le,{primary:!0,className:"mr-4",children:"Primary"}),t.jsx(le,{primary:!0,lg:!0,children:"Primary"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(le,{signal:!0,lg:!0,className:"mr-4",children:"Signal"}),t.jsx(le,{signal:!0,className:"mr-4",children:"Signal"}),t.jsx(le,{signal:!0,sm:!0,children:"Signal"})]})]}),` `,t.jsx(e.p,{children:"完整源码"}),` -`,t.jsx(In,{files:{"index.jsx":gl}})]})}function bN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(gp,{...n})}):gp(n)}function yN(){return t.jsx(Ot,{renderArticle:n=>t.jsx(bN,{components:{code:n}}),isGiscus:!1})}function vp(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"Input 基础使用"}),` +`,t.jsx(Dn,{files:{"index.jsx":jl}})]})}function S9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Np,{...n})}):Np(n)}function w9(){return t.jsx(rt,{renderArticle:n=>t.jsx(S9,{components:{code:n}}),isGiscus:!1})}function Sp(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"Input 基础使用"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-html",children:` `})}),` -`,t.jsx(T,{children:t.jsx(yn,{placeholder:"请输入任意内容"})})]})}function NN(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(vp,{...n})}):vp(n)}function SN(){return t.jsx(Ot,{renderArticle:n=>t.jsx(NN,{components:{code:n}}),isGiscus:!1})}function wN(n){return t.jsx("div",{className:"border border-blue-300 shadow rounded-md p-4 max-w-sm w-full mx-auto",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}function jp(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"基础使用"}),` +`,t.jsx(A,{children:t.jsx(yn,{placeholder:"请输入任意内容"})})]})}function _9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(Sp,{...n})}):Sp(n)}function k9(){return t.jsx(rt,{renderArticle:n=>t.jsx(_9,{components:{code:n}}),isGiscus:!1})}function C9(n){return t.jsx("div",{className:"border border-blue-300 shadow rounded-md p-4 max-w-sm w-full mx-auto",children:t.jsxs("div",{className:"animate-pulse flex space-x-4",children:[t.jsx("div",{className:"rounded-full bg-slate-200 h-10 w-10"}),t.jsxs("div",{className:"flex-1 space-y-6 py-1",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-2"}),t.jsx("div",{className:"h-2 bg-slate-200 rounded col-span-1"})]}),t.jsx("div",{className:"h-2 bg-slate-200 rounded"})]})]})]})})}function wp(n){const e={code:"code",p:"p",pre:"pre",...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(e.p,{children:"基础使用"}),` `,t.jsx(e.pre,{children:t.jsx(e.code,{className:"language-js",children:` `})}),` -`,t.jsx(wN,{})]})}function _N(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(jp,{...n})}):jp(n)}function kN(){return t.jsx(Ot,{renderArticle:n=>t.jsx(_N,{components:{code:n}}),isGiscus:!1})}const wx=[{type:"tip",name:"基础组件"},{path:"button",name:"1、按钮 Button",component:yN},{path:"input",name:"2、输入框 Input",component:SN},{path:"skeleton",name:"2、骨架屏 Skeleton",component:kN}];function CN(){const n=ru(),e=h.useRef(new Map),s=cu(),{pathname:a}=cs(),l=h.useReducer(r=>!r)[1];return e.current.has(a)||e.current.set(a,s),h.useEffect(()=>{location.pathname==="/component"&&n("button")},[a]),t.jsxs("div",{className:"pt-16 flex",children:[t.jsxs("nav",{className:"hidden md:block w-60 sticky top-16 h-[calc(100vh_-_5rem)] overflow-y-auto bg-hei",children:[t.jsxs("div",{className:"flex items-center px-4 py-8",children:[t.jsx("div",{className:"flex items-center justify-between p-1 border mr-3 rounded-md border-cyan-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5 text-cyan-500",children:t.jsx("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v4.19l-1.72-1.72a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 1 0-1.06-1.06l-1.72 1.72V10.5Z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"text-sm",children:[t.jsx("div",{children:"当前版本"}),t.jsx("div",{className:"text-gray-500",children:"React@19.0.0-rc"})]})]}),t.jsx("ul",{className:"border-r h-[calc(100vh_-_9rem_-_35px)] overflow-y-auto pb-8",children:wx.map((r,c)=>r.type==="tip"?t.jsx("div",{className:"mx-2 text-sm px-4 text-gray-400 first:pt-0 pb-4 pt-8",children:r.name},`z-${c}`):t.jsx(Cn,{className:"text-gray-700",activeName:"text-blue-700",to:r.path,onClick:l,children:t.jsxs("li",{className:"mx-2 px-4 py-3 transition hover:bg-blue-100 text-sm flex items-center justify-between hover:text-blue-700 rounded",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),t.jsx("div",{className:"ml-2 line-clamp-1",children:r.name})]}),r.label?t.jsx(Q0,{label:r.label,primary:!0,className:"ml-2"}):null]},r.path)},r.path))})]}),t.jsx("div",{className:"w-full md:w-[calc(100vw_-_15rem)] p-8 min-h-[calc(100vh_-_5rem)] box-border",children:Array.from(e.current).map(([r,c])=>t.jsx("div",{style:{display:a===r?"block":"none"},children:c},r))})]})}function RN(){return t.jsxs("div",{children:[t.jsx(jj,{className:"line"}),t.jsx(vv,{})]})}function EN(){return t.jsx(bv,{children:t.jsxs(dt,{path:"/",element:t.jsx(RN,{}),children:[t.jsx(dt,{index:!0,element:t.jsx(y5,{})}),t.jsx(dt,{path:"tutorial",element:t.jsx(jN,{}),children:Sx.filter(n=>!!n.path).map((n,e)=>t.jsx(dt,{path:n.path,element:t.jsx(h.Suspense,{fallback:t.jsx(nm,{}),children:t.jsx(n.component,{})})},n.path))}),t.jsx(dt,{path:"component",element:t.jsx(CN,{}),children:wx.filter(n=>!!n.path).map((n,e)=>t.jsx(dt,{path:n.path,element:t.jsx(h.Suspense,{fallback:t.jsx(nm,{}),children:t.jsx(n.component,{})})},n.path))}),t.jsx(dt,{path:"*",element:t.jsx("div",{children:"nothingsdfsdfsdf"})})]})})}M2.createRoot(document.getElementById("root")).render(t.jsx(h.StrictMode,{children:t.jsx(Cv,{children:t.jsx(EN,{})})})); +`,t.jsx(C9,{})]})}function R9(n={}){const{wrapper:e}=n.components||{};return e?t.jsx(e,{...n,children:t.jsx(wp,{...n})}):wp(n)}function M9(){return t.jsx(rt,{renderArticle:n=>t.jsx(R9,{components:{code:n}}),isGiscus:!1})}const Xx=[{type:"tip",name:"基础组件"},{path:"button",name:"1、按钮 Button",component:w9},{path:"input",name:"2、输入框 Input",component:k9},{path:"skeleton",name:"2、骨架屏 Skeleton",component:M9}];function E9(){const n=ru(),e=f.useRef(new Map),s=iu(),{pathname:a}=is(),l=f.useReducer(r=>!r)[1];return e.current.has(a)||e.current.set(a,s),f.useEffect(()=>{location.pathname==="/component"&&n("button")},[a]),t.jsxs("div",{className:"pt-16 flex",children:[t.jsxs("nav",{className:"hidden md:block w-60 sticky top-16 h-[calc(100vh_-_5rem)] overflow-y-auto bg-hei",children:[t.jsxs("div",{className:"flex items-center px-4 py-8",children:[t.jsx("div",{className:"flex items-center justify-between p-1 border mr-3 rounded-md border-cyan-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"size-5 text-cyan-500",children:t.jsx("path",{fillRule:"evenodd",d:"M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v4.19l-1.72-1.72a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l3-3a.75.75 0 1 0-1.06-1.06l-1.72 1.72V10.5Z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"text-sm",children:[t.jsx("div",{children:"当前版本"}),t.jsx("div",{className:"text-gray-500",children:"React@19.0.0-rc"})]})]}),t.jsx("ul",{className:"border-r h-[calc(100vh_-_9rem_-_35px)] overflow-y-auto pb-8",children:Xx.map((r,i)=>r.type==="tip"?t.jsx("div",{className:"mx-2 text-sm px-4 text-gray-400 first:pt-0 pb-4 pt-8",children:r.name},`z-${i}`):t.jsx(Cn,{className:"text-gray-700",activeName:"text-blue-700",to:r.path,onClick:l,children:t.jsxs("li",{className:"mx-2 px-4 py-3 transition hover:bg-blue-100 text-sm flex items-center justify-between hover:text-blue-700 rounded",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-4",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),t.jsx("div",{className:"ml-2 line-clamp-1",children:r.name})]}),r.label?t.jsx(F0,{label:r.label,primary:!0,className:"ml-2"}):null]},r.path)},r.path))})]}),t.jsx("div",{className:"w-full md:w-[calc(100vw_-_15rem)] p-8 min-h-[calc(100vh_-_5rem)] box-border",children:Array.from(e.current).map(([r,i])=>t.jsx("div",{style:{display:a===r?"block":"none"},children:i},r))})]})}function A9(){return t.jsxs("div",{children:[t.jsx(zv,{className:"line"}),t.jsx(Bj,{})]})}function T9(){return t.jsx(Uj,{children:t.jsxs(pt,{path:"/",element:t.jsx(A9,{}),children:[t.jsx(pt,{index:!0,element:t.jsx(B5,{})}),t.jsx(pt,{path:"tutorial",element:t.jsx(N9,{}),children:Vx.filter(n=>!!n.path).map((n,e)=>t.jsx(pt,{path:n.path,element:t.jsx(f.Suspense,{fallback:t.jsx(nm,{}),children:t.jsx(n.component,{})})},n.path))}),t.jsx(pt,{path:"component",element:t.jsx(E9,{}),children:Xx.filter(n=>!!n.path).map((n,e)=>t.jsx(pt,{path:n.path,element:t.jsx(f.Suspense,{fallback:t.jsx(nm,{}),children:t.jsx(n.component,{})})},n.path))}),t.jsx(pt,{path:"*",element:t.jsx("div",{children:"nothingsdfsdfsdf"})})]})})}P2.createRoot(document.getElementById("root")).render(t.jsx(f.StrictMode,{children:t.jsx(Yj,{children:t.jsx(T9,{})})})); diff --git a/index.html b/index.html index 23e02e1..c7c5b6e 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ React 19 - 这波能反杀 - - + +
diff --git a/stats.html b/stats.html index 52c9a86..aa91433 100644 --- a/stats.html +++ b/stats.html @@ -4822,7 +4822,7 @@