diff --git a/client/package.json b/client/package.json index 35d924f..d30cf9d 100644 --- a/client/package.json +++ b/client/package.json @@ -14,7 +14,8 @@ "gsap": "^3.12.4", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.18.0" + "react-router-dom": "^6.18.0", + "zustand": "^4.4.7" }, "devDependencies": { "@types/react": "^18.2.15", diff --git a/client/public/images/galleryProjects/gallery-projects-1.jpg b/client/public/images/galleryProjects/gallery-projects-1.jpg new file mode 100644 index 0000000..0aec0df Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-1.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-10.jpg b/client/public/images/galleryProjects/gallery-projects-10.jpg new file mode 100644 index 0000000..368c9fa Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-10.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-11.jpg b/client/public/images/galleryProjects/gallery-projects-11.jpg new file mode 100644 index 0000000..bc043c0 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-11.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-12.jpg b/client/public/images/galleryProjects/gallery-projects-12.jpg new file mode 100644 index 0000000..bdb0175 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-12.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-13.jpg b/client/public/images/galleryProjects/gallery-projects-13.jpg new file mode 100644 index 0000000..840553b Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-13.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-14.jpg b/client/public/images/galleryProjects/gallery-projects-14.jpg new file mode 100644 index 0000000..5fda8b7 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-14.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-15.jpg b/client/public/images/galleryProjects/gallery-projects-15.jpg new file mode 100644 index 0000000..f0be9d5 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-15.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-16.jpg b/client/public/images/galleryProjects/gallery-projects-16.jpg new file mode 100644 index 0000000..4dc8b6e Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-16.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-17.jpg b/client/public/images/galleryProjects/gallery-projects-17.jpg new file mode 100644 index 0000000..bc0b6e4 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-17.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-18.jpg b/client/public/images/galleryProjects/gallery-projects-18.jpg new file mode 100644 index 0000000..10d802f Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-18.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-19.jpg b/client/public/images/galleryProjects/gallery-projects-19.jpg new file mode 100644 index 0000000..f727290 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-19.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-2.jpg b/client/public/images/galleryProjects/gallery-projects-2.jpg new file mode 100644 index 0000000..dd9351c Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-2.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-20.jpg b/client/public/images/galleryProjects/gallery-projects-20.jpg new file mode 100644 index 0000000..63433f9 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-20.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-21.jpg b/client/public/images/galleryProjects/gallery-projects-21.jpg new file mode 100644 index 0000000..6c37f3b Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-21.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-22.jpg b/client/public/images/galleryProjects/gallery-projects-22.jpg new file mode 100644 index 0000000..bf67784 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-22.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-23.jpg b/client/public/images/galleryProjects/gallery-projects-23.jpg new file mode 100644 index 0000000..b8e11f1 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-23.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-24.jpg b/client/public/images/galleryProjects/gallery-projects-24.jpg new file mode 100644 index 0000000..e3af3c1 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-24.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-25.jpg b/client/public/images/galleryProjects/gallery-projects-25.jpg new file mode 100644 index 0000000..758fcf3 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-25.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-26.jpg b/client/public/images/galleryProjects/gallery-projects-26.jpg new file mode 100644 index 0000000..41b834e Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-26.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-27.jpg b/client/public/images/galleryProjects/gallery-projects-27.jpg new file mode 100644 index 0000000..ea6cfd3 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-27.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-28.jpg b/client/public/images/galleryProjects/gallery-projects-28.jpg new file mode 100644 index 0000000..ec35291 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-28.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-29.jpg b/client/public/images/galleryProjects/gallery-projects-29.jpg new file mode 100644 index 0000000..46266ab Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-29.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-3.jpg b/client/public/images/galleryProjects/gallery-projects-3.jpg new file mode 100644 index 0000000..5d99bd6 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-3.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-30.jpg b/client/public/images/galleryProjects/gallery-projects-30.jpg new file mode 100644 index 0000000..cb28c3f Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-30.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-31.jpg b/client/public/images/galleryProjects/gallery-projects-31.jpg new file mode 100644 index 0000000..9652524 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-31.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-32.jpg b/client/public/images/galleryProjects/gallery-projects-32.jpg new file mode 100644 index 0000000..ae22c5f Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-32.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-33.jpg b/client/public/images/galleryProjects/gallery-projects-33.jpg new file mode 100644 index 0000000..6e81039 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-33.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-34.jpg b/client/public/images/galleryProjects/gallery-projects-34.jpg new file mode 100644 index 0000000..8e01834 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-34.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-35.jpg b/client/public/images/galleryProjects/gallery-projects-35.jpg new file mode 100644 index 0000000..e46f83c Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-35.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-36.jpg b/client/public/images/galleryProjects/gallery-projects-36.jpg new file mode 100644 index 0000000..641960e Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-36.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-37.jpg b/client/public/images/galleryProjects/gallery-projects-37.jpg new file mode 100644 index 0000000..e1094ab Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-37.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-38.jpg b/client/public/images/galleryProjects/gallery-projects-38.jpg new file mode 100644 index 0000000..e4dd2af Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-38.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-39.jpg b/client/public/images/galleryProjects/gallery-projects-39.jpg new file mode 100644 index 0000000..a565fe5 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-39.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-4.jpg b/client/public/images/galleryProjects/gallery-projects-4.jpg new file mode 100644 index 0000000..901bb82 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-4.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-40.jpg b/client/public/images/galleryProjects/gallery-projects-40.jpg new file mode 100644 index 0000000..53c1846 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-40.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-41.jpg b/client/public/images/galleryProjects/gallery-projects-41.jpg new file mode 100644 index 0000000..50e25ea Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-41.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-42.jpg b/client/public/images/galleryProjects/gallery-projects-42.jpg new file mode 100644 index 0000000..5afe7c7 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-42.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-43.jpg b/client/public/images/galleryProjects/gallery-projects-43.jpg new file mode 100644 index 0000000..41aab73 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-43.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-44.jpg b/client/public/images/galleryProjects/gallery-projects-44.jpg new file mode 100644 index 0000000..70763c5 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-44.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-45.jpg b/client/public/images/galleryProjects/gallery-projects-45.jpg new file mode 100644 index 0000000..b65ffdc Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-45.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-5.jpg b/client/public/images/galleryProjects/gallery-projects-5.jpg new file mode 100644 index 0000000..cb5ee8e Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-5.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-6.jpg b/client/public/images/galleryProjects/gallery-projects-6.jpg new file mode 100644 index 0000000..c51b1b3 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-6.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-7.jpg b/client/public/images/galleryProjects/gallery-projects-7.jpg new file mode 100644 index 0000000..7efc5eb Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-7.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-8.jpg b/client/public/images/galleryProjects/gallery-projects-8.jpg new file mode 100644 index 0000000..12f379d Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-8.jpg differ diff --git a/client/public/images/galleryProjects/gallery-projects-9.jpg b/client/public/images/galleryProjects/gallery-projects-9.jpg new file mode 100644 index 0000000..f197616 Binary files /dev/null and b/client/public/images/galleryProjects/gallery-projects-9.jpg differ diff --git a/client/src/components/DirectionsPage/DirectionImage.tsx b/client/src/components/DirectionsPage/DirectionImage.tsx index 4a5b5c2..4f9ac69 100644 --- a/client/src/components/DirectionsPage/DirectionImage.tsx +++ b/client/src/components/DirectionsPage/DirectionImage.tsx @@ -14,7 +14,7 @@ const DirectionImage = ({ title, description, image }: DirectionImageProps) => { className="object-cover h-full group-hover:scale-105 transition-all duration-700 w-full" alt="" /> -
+
{title}
diff --git a/client/src/components/GalleryPage/Gallery.tsx b/client/src/components/GalleryPage/Gallery.tsx new file mode 100644 index 0000000..a36bc96 --- /dev/null +++ b/client/src/components/GalleryPage/Gallery.tsx @@ -0,0 +1,13 @@ +import GalleryTabs from "./GalleryTabs"; +import ProjectsContainer from "./ProjectsContainer"; + +const Gallery = () => { + return ( +
+ + +
+ ); +}; + +export default Gallery; diff --git a/client/src/components/GalleryPage/GalleryTabs.tsx b/client/src/components/GalleryPage/GalleryTabs.tsx new file mode 100644 index 0000000..29018b9 --- /dev/null +++ b/client/src/components/GalleryPage/GalleryTabs.tsx @@ -0,0 +1,39 @@ +import { ProjectTab } from "../../types"; +import { projectTabs } from "../../consts/galleryPage"; +import useStore from "../../store/store"; + +const GalleryTabs = () => { + const { selectedTab, setSelectedTab } = useStore(); + + const handleOnTabClick = (tab: ProjectTab) => { + return () => { + setSelectedTab(tab); + }; + }; + + return ( +
+
+ {projectTabs.map((tab) => { + const isSelected = selectedTab.id === tab.id; + + return ( +
+ {tab.title} +
+ ); + })} +
+
+ ); +}; + +export default GalleryTabs; diff --git a/client/src/components/GalleryPage/ProjectsContainer.tsx b/client/src/components/GalleryPage/ProjectsContainer.tsx new file mode 100644 index 0000000..55cb5b4 --- /dev/null +++ b/client/src/components/GalleryPage/ProjectsContainer.tsx @@ -0,0 +1,29 @@ +import { ProjectType } from "../../types"; +import ProjectsSection from "./ProjectsSection"; +import { projects } from "../../consts/galleryPage"; + +function getSlicedProjects(projects: ProjectType[]) { + const chunkSize = 5; + const slicedProjects = []; + + for (let i = 0; i < projects.length; i += chunkSize) { + const chunk = projects.slice(i, i + chunkSize); + slicedProjects.push(chunk); + } + + return slicedProjects; +} + +const ProjectsContainer = () => { + const slicedProjects = getSlicedProjects(projects); + + return ( +
+ {slicedProjects.map((pr) => ( + + ))} +
+ ); +}; + +export default ProjectsContainer; diff --git a/client/src/components/GalleryPage/ProjectsSection.tsx b/client/src/components/GalleryPage/ProjectsSection.tsx new file mode 100644 index 0000000..b8b13e5 --- /dev/null +++ b/client/src/components/GalleryPage/ProjectsSection.tsx @@ -0,0 +1,122 @@ +import { ProjectType } from "../../types"; + +type GalleryProjectsProps = { + projects: ProjectType[]; +}; + +const ProjectsSection = ({ projects }: GalleryProjectsProps) => { + if (projects.length === 5) { + return ; + } + if (projects.length === 4) { + return ; + } + + return ; +}; + +const FiveProjects = ({ projects }: GalleryProjectsProps) => { + const rows = [ + "row-span-2", + "row-span-1", + "row-span-3", + "row-span-2", + "row-span-1", + ]; + + return ( + <> +
+ {projects.map((el, index) => { + const row = rows[index]; + return ( +
+ +
+ {el.title !== "" &&

{el.title}

} + {el.description !== "" && ( +

{el.description}

+ )} +
+
+ ); + })} +
+ + ); +}; + +const FourProjects = ({ projects }: GalleryProjectsProps) => { + const rows = ["row-span-2", "row-span-1", "row-span-2", "row-span-1"]; + return ( + <> +
+ {projects.map((el, index) => { + const row = rows[index]; + return ( +
+ +
+ {el.title !== "" &&

{el.title}

} + {el.description !== "" && ( +

{el.description}

+ )} +
+
+ ); + })} +
+ + ); +}; + +const ThreeProjects = ({ projects }: GalleryProjectsProps) => { + const rows = ["row-span-2", "row-span-3", "row-span-1"]; + + return ( + <> +
+ {projects.map((el, index) => { + const row = rows[index]; + return ( +
+ +
+ {el.title !== "" &&

{el.title}

} + {el.description !== "" && ( +

{el.description}

+ )} +
+
+ ); + })} +
+ + ); +}; + +export default ProjectsSection; diff --git a/client/src/components/Header/Header.tsx b/client/src/components/Header/Header.tsx index 9b839de..2050286 100644 --- a/client/src/components/Header/Header.tsx +++ b/client/src/components/Header/Header.tsx @@ -2,13 +2,22 @@ import LogoIcon from "../../icons/LogoIcon"; import SocialLinks from "./SocialLinks"; import LanguageSwitcher from "./LanguageSwitcher"; import Tabs from "../Tabs"; +import { useNavigate } from "react-router-dom"; const Header = (): JSX.Element => { + const navigate = useNavigate(); + + const handleOnClick = () => { + navigate("/"); + }; + return ( <>
- +
diff --git a/client/src/components/HeaderTitle.tsx b/client/src/components/HeaderTitle.tsx index 0603a07..f0eebaf 100644 --- a/client/src/components/HeaderTitle.tsx +++ b/client/src/components/HeaderTitle.tsx @@ -5,10 +5,10 @@ type HeaderTitleProps = { const HeaderTitle = ({ title, description }: HeaderTitleProps) => { return ( -
+

{title}

{description}

-
+ ); }; diff --git a/client/src/components/TechnologyPage/Accordion.tsx b/client/src/components/TechnologyPage/Accordion.tsx index 5a3049a..c25750d 100644 --- a/client/src/components/TechnologyPage/Accordion.tsx +++ b/client/src/components/TechnologyPage/Accordion.tsx @@ -18,15 +18,16 @@ const Accordion = ({ const handleOnClick = () => { onClick(); + if (!isSelected) { + const timeout = setTimeout(() => { + window.scrollTo({ + top: contentRef.current?.offsetTop, + behavior: "smooth", + }); - const timeout = setTimeout(() => { - window.scrollTo({ - top: contentRef.current?.offsetTop, - behavior: "smooth", - }); - - clearTimeout(timeout); - }, 500); + clearTimeout(timeout); + }, 500); + } }; return ( @@ -55,29 +56,3 @@ const Accordion = ({ }; export default Accordion; - -// const contentRef = useRef(null); -// const divRef = useRef(null); - -// function handleClick() { -// onClick(); - -// setTimeout(() => { -// window.scrollTo({ -// top: divRef.current?.offsetTop, -// behavior: "smooth", -// }); -// }, 200); -// } - -// return ( -//
-// -//
{ + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; + return (
@@ -39,7 +49,10 @@ const AR = () => {
-
+
Как это diff --git a/client/src/components/TechnologyPage/accordions/KinnectRealSense.tsx b/client/src/components/TechnologyPage/accordions/KinnectRealSense.tsx index ba304ab..98cc596 100644 --- a/client/src/components/TechnologyPage/accordions/KinnectRealSense.tsx +++ b/client/src/components/TechnologyPage/accordions/KinnectRealSense.tsx @@ -1,6 +1,8 @@ import TechnologyCategoryIcon from "../../../icons/TechnologyCategoryIcon"; import { AdvantageType } from "../../../types"; import TechnologyAdvantages from "../TechnologyAdvantages"; +import useStore from "../../../store/store"; +import VideoModal from "../../VideoModal"; const ADVANTAGES: AdvantageType[] = [ { @@ -29,6 +31,14 @@ const ADVANTAGES: AdvantageType[] = [ ]; const KinnectRealSense = () => { + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; + return (
@@ -42,7 +52,10 @@ const KinnectRealSense = () => {
-
+
Как это diff --git a/client/src/components/TechnologyPage/accordions/MobileApp.tsx b/client/src/components/TechnologyPage/accordions/MobileApp.tsx index bc48c12..92266aa 100644 --- a/client/src/components/TechnologyPage/accordions/MobileApp.tsx +++ b/client/src/components/TechnologyPage/accordions/MobileApp.tsx @@ -1,5 +1,7 @@ +import useStore from "../../../store/store"; import TechnologyCategoryIcon from "../../../icons/TechnologyCategoryIcon"; import { AdvantageType } from "../../../types"; +import VideoModal from "../../VideoModal"; import TechnologyAdvantages from "../TechnologyAdvantages"; const ADVANTAGES: AdvantageType[] = [ @@ -28,6 +30,14 @@ const ADVANTAGES: AdvantageType[] = [ ]; const MobileApp = () => { + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; + return (
@@ -40,7 +50,10 @@ const MobileApp = () => {
-
+
Как это diff --git a/client/src/components/TechnologyPage/accordions/TouchScreen.tsx b/client/src/components/TechnologyPage/accordions/TouchScreen.tsx index 5e8ddca..033cbef 100644 --- a/client/src/components/TechnologyPage/accordions/TouchScreen.tsx +++ b/client/src/components/TechnologyPage/accordions/TouchScreen.tsx @@ -1,5 +1,7 @@ +import useStore from "../../../store/store"; import TechnologyCategoryIcon from "../../../icons/TechnologyCategoryIcon"; import { AdvantageType } from "../../../types"; +import VideoModal from "../../VideoModal"; import TechnologyAdvantages from "../TechnologyAdvantages"; const ADVANTAGES: AdvantageType[] = [ @@ -30,6 +32,13 @@ const ADVANTAGES: AdvantageType[] = [ ]; const TouchScreen = () => { + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; return (
@@ -44,7 +53,10 @@ const TouchScreen = () => {
-
+
Как это diff --git a/client/src/components/TechnologyPage/accordions/VR.tsx b/client/src/components/TechnologyPage/accordions/VR.tsx index 95abe9b..2bb4840 100644 --- a/client/src/components/TechnologyPage/accordions/VR.tsx +++ b/client/src/components/TechnologyPage/accordions/VR.tsx @@ -1,6 +1,8 @@ import TechnologyCategoryIcon from "../../../icons/TechnologyCategoryIcon"; import { AdvantageType } from "../../../types"; import TechnologyAdvantages from "../TechnologyAdvantages"; +import useStore from "../../../store/store"; +import VideoModal from "../../VideoModal"; const ADVANTAGES: AdvantageType[] = [ { @@ -30,6 +32,14 @@ const ADVANTAGES: AdvantageType[] = [ ]; const VR = () => { + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; + return (
@@ -43,7 +53,10 @@ const VR = () => {
-
+
Как это diff --git a/client/src/components/TechnologyPage/accordions/WebGl.tsx b/client/src/components/TechnologyPage/accordions/WebGl.tsx index 326a261..4057135 100644 --- a/client/src/components/TechnologyPage/accordions/WebGl.tsx +++ b/client/src/components/TechnologyPage/accordions/WebGl.tsx @@ -1,6 +1,8 @@ import TechnologyCategoryIcon from "../../../icons/TechnologyCategoryIcon"; import { AdvantageType } from "../../../types"; +import VideoModal from "../../VideoModal"; import TechnologyAdvantages from "../TechnologyAdvantages"; +import useStore from "../../../store/store"; const ADVANTAGES: AdvantageType[] = [ { @@ -29,6 +31,13 @@ const ADVANTAGES: AdvantageType[] = [ ]; const WebGl = () => { + const { setModal } = useStore(); + + const handleOnVideoClick = () => { + setModal( + + ); + }; return (
@@ -40,7 +49,10 @@ const WebGl = () => {
-
+
Как это diff --git a/client/src/components/VideoModal.tsx b/client/src/components/VideoModal.tsx new file mode 100644 index 0000000..7644eac --- /dev/null +++ b/client/src/components/VideoModal.tsx @@ -0,0 +1,41 @@ +import CrossIcon from "../icons/CrossIcon"; +import useStore from "../store/store"; + +type VideoModalProps = { + path?: string; +}; + +const VideoModal = ({ path }: VideoModalProps) => { + const { setModal } = useStore(); + + const handleOnCloseClick = () => { + setModal(null); + }; + + return ( +
+ + +
+ +
+
+ ); +}; + +export default VideoModal; diff --git a/client/src/components/Wrapper.tsx b/client/src/components/Wrapper.tsx index 82dc0d8..cba2e5e 100644 --- a/client/src/components/Wrapper.tsx +++ b/client/src/components/Wrapper.tsx @@ -2,10 +2,13 @@ import Header from "./Header/Header"; import Footer from "./Footer/Footer"; import { Outlet } from "react-router-dom"; import ScrollToTopButton from "./ScrollToTopButton"; +import useStore from "../store/store"; const Wrapper = () => { + const { modal } = useStore(); return ( <> + {modal}
diff --git a/client/src/consts/galleryPage.ts b/client/src/consts/galleryPage.ts new file mode 100644 index 0000000..63b2ad2 --- /dev/null +++ b/client/src/consts/galleryPage.ts @@ -0,0 +1,160 @@ +import { ProjectTab, ProjectType } from "../types"; + +const projectTabs: ProjectTab[] = [ + { id: 1, title: "ВСЕ ПРОЕКТЫ" }, + { id: 2, title: "VR" }, + { id: 3, title: "AR" }, + { id: 4, title: "TOUCH-SCREEN" }, + { id: 5, title: "WEB GL" }, + { id: 6, title: "MOBILE APP" }, + { id: 7, title: "РЕШЕНИЕ ДЛЯ НЕДВИЖИМОСТИ" }, + ]; + + const projects: ProjectType[] = [ + { + id: 1, + title: "Интерактивный пол: игра «Собери мусор» 2023г.", + imagePath: "/images/galleryProjects/gallery-projects-1.jpg", + description: "", + link: "", + tab:projectTabs[0] + }, + { + id: 2, + title: 'МФК Re:volution towers для АН "НКС" г. Екатеринбург', + imagePath: "/images/galleryProjects/gallery-projects-2.jpg", + description: "Интерактивная презентация 2023.", + link: "", + tab:projectTabs[6] + }, + { + id: 3, + title: "Удалённая демонстрация жилой недвижимости 2023г.", + imagePath: "/images/galleryProjects/gallery-projects-3.jpg", + description: "", + link: "", + tab:projectTabs[0] + }, + { + id: 4, + title: "Baniyas North Abu Dhabi", + imagePath: "/images/galleryProjects/gallery-projects-4.jpg", + description: "Интерактивная презентация жилого проекта 2023г.", + link: "", + tab:projectTabs[6] + }, + { + id: 5, + title: "", + imagePath: "/images/galleryProjects/gallery-projects-5.jpg", + description: "Строительный Форум100+ 2023г.", + link: "", + }, + { + id: 6, + title: 'ЖК "Life Residence" для Паритет девелопмент', + imagePath: "/images/galleryProjects/gallery-projects-6.jpg", + description: "Интерактивная презентация 2023г.", + link: "", + }, + { + id: 7, + title: 'АО "Метаверс', + imagePath: "/images/galleryProjects/gallery-projects-7.jpg", + description: "Web Gl 2022г.", + link: "", + }, + { + id: 8, + title: 'Центральная ППК"', + imagePath: "/images/galleryProjects/gallery-projects-8.jpg", + description: "AR приложение 2022г.", + link: "", + }, + { + id: 9, + title: 'Мобильная компрессорная станция для АО "УЗГА"', + imagePath: "/images/galleryProjects/gallery-projects-9.jpg", + description: "Интерактивная 3D презентация 2022г.", + link: "", + }, + { + id: 10, + title: "Виртуальная лаборатория оценки качества молока для УРГЭУ (СИНХ)", + imagePath: "/images/galleryProjects/gallery-projects-10.jpg", + description: "VR 2022г.", + link: "", + }, + { + id: 11, + title: "AR- приложение для Департамента природопользования 2022г.", + imagePath: "/images/galleryProjects/gallery-projects-11.jpg", + description: "", + link: "", + }, + { + id: 12, + title: 'ЖК "Айвазовский" для ГК "ЭНКО" г. Тюмень', + imagePath: "/images/galleryProjects/gallery-projects-12.jpg", + description: "Интерактивный макет с VR - туром 2021г.", + link: "", + }, + { + id: 13, + title: 'ЖК "Графика" для Мавис Девелопмент г. Санкт-Петербург', + imagePath: "/images/galleryProjects/gallery-projects-13.jpg", + description: "TOUCH-SCREEN 2021г.", + link: "", + }, + { + id: 14, + title: 'ООО "CyberLympha" 2021г.', + imagePath: "/images/galleryProjects/gallery-projects-14.jpg", + description: "Мобильная AR игра", + link: "", + }, + { + id: 15, + title: "AR- приложение Интерктивный квест 2021г.", + imagePath: "/images/galleryProjects/gallery-projects-15.jpg", + description: "", + link: "", + }, + { + id: 16, + title: '"Екатеринбург Сити" для ОАО УГМК г.Екатеринбург', + imagePath: "/images/galleryProjects/gallery-projects-16.jpg", + description: "Интерактивный макет 2021г.", + link: "", + }, + { + id: 17, + title: "Smart oil and gas", + imagePath: "/images/galleryProjects/gallery-projects-17.jpg", + description: "Виртуальная выставка 2021г.", + link: "", + }, + { + id: 18, + title: "World Skills Russia МежВУЗ", + imagePath: "/images/galleryProjects/gallery-projects-18.jpg", + description: "Интерактивная онлайн выставка 2021г.", + link: "", + }, + { + id: 19, + title: "WorldSkills 2020", + imagePath: "/images/galleryProjects/gallery-projects-19.jpg", + description: "Интерактивная онлайн выставка 2020г.", + link: "", + }, + { + id: 20, + title: "Демо квартира", + imagePath: "/images/galleryProjects/gallery-projects-20.jpg", + description: "Интерактивный конфигуратор квартиры 2021г.", + link: "", + }, + ]; + + export {projectTabs, projects} \ No newline at end of file diff --git a/client/src/icons/CrossIcon.tsx b/client/src/icons/CrossIcon.tsx new file mode 100644 index 0000000..686492c --- /dev/null +++ b/client/src/icons/CrossIcon.tsx @@ -0,0 +1,31 @@ +const CrossIcon = () => { + return ( + + + + + + + ); +}; + +export default CrossIcon; diff --git a/client/src/main.tsx b/client/src/main.tsx index c1baa1a..9641a41 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -5,6 +5,7 @@ import MainPage from "./pages/MainPage/MainPage.tsx"; import TechnologyPage from "./pages/TechnologyPage/TechnologyPage.tsx"; import DirectionPage from "./pages/DirectionsPage/DirectionsPage.tsx"; import "./index.css"; +import GalleryPage from "./pages/GalleryPage/GalleryPage.tsx"; const router = createBrowserRouter([ { @@ -23,6 +24,10 @@ const router = createBrowserRouter([ path: "/directions", element: , }, + { + path: "/gallery", + element: , + }, ], }, ]); diff --git a/client/src/pages/GalleryPage/GalleryPage.tsx b/client/src/pages/GalleryPage/GalleryPage.tsx new file mode 100644 index 0000000..3e11534 --- /dev/null +++ b/client/src/pages/GalleryPage/GalleryPage.tsx @@ -0,0 +1,15 @@ +import HeaderTitle from "../../components/HeaderTitle"; +import Gallery from "../../components/GalleryPage/Gallery"; + +const GalleryPage = () => { + return ( + <> +
+ + +
+ + ); +}; + +export default GalleryPage; diff --git a/client/src/store/store.ts b/client/src/store/store.ts index 1807085..302b240 100644 --- a/client/src/store/store.ts +++ b/client/src/store/store.ts @@ -1,12 +1,18 @@ import { create } from "zustand"; +import { ProjectTab } from "../types"; +import { projectTabs } from "../consts/galleryPage"; interface StoreType { modal: React.ReactNode | null; + selectedTab: ProjectTab; + setSelectedTab: (tab: ProjectTab) =>void; setModal: (modal: React.ReactNode | null) => void; } const useStore = create((set) => ({ modal: null, + selectedTab: projectTabs[0], + setSelectedTab: (tab) => set(() => ({ selectedTab: tab })), setModal: (modal) => set(() => ({ modal: modal })), })); diff --git a/client/src/types.ts b/client/src/types.ts index bb5f2c7..7560f2e 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -18,4 +18,18 @@ type DirectionImageType = { image: string; } -export type {AccordionType, AdvantageType, DirectionImageType} \ No newline at end of file +type ProjectType = { + id: number; + title: string; + imagePath: string; + description: string; + link: string; + tab?: ProjectTab; +}; + +type ProjectTab = { + id: number; + title: string; +}; + +export type {ProjectTab, AccordionType, AdvantageType, DirectionImageType, ProjectType} \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index e090a74..02cba73 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1764,6 +1764,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +use-sync-external-store@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -1824,3 +1829,10 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zustand@^4.4.7: + version "4.4.7" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.4.7.tgz#355406be6b11ab335f59a66d2cf9815e8f24038c" + integrity sha512-QFJWJMdlETcI69paJwhSMJz7PPWjVP8Sjhclxmxmxv/RYI7ZOvR5BHX+ktH0we9gTWQMxcne8q1OY8xxz604gw== + dependencies: + use-sync-external-store "1.2.0" diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity deleted file mode 100644 index e4b5e3a..0000000 --- a/node_modules/.yarn-integrity +++ /dev/null @@ -1,17 +0,0 @@ -{ - "systemParams": "win32-x64-115", - "modulesFolders": [ - "node_modules" - ], - "flags": [], - "linkedModules": [], - "topLevelPatterns": [ - "zustand@^4.4.7" - ], - "lockfileEntries": { - "use-sync-external-store@1.2.0": "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a", - "zustand@^4.4.7": "https://registry.yarnpkg.com/zustand/-/zustand-4.4.7.tgz#355406be6b11ab335f59a66d2cf9815e8f24038c" - }, - "files": [], - "artifacts": {} -} \ No newline at end of file diff --git a/node_modules/use-sync-external-store/LICENSE b/node_modules/use-sync-external-store/LICENSE deleted file mode 100644 index b96dcb0..0000000 --- a/node_modules/use-sync-external-store/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/use-sync-external-store/README.md b/node_modules/use-sync-external-store/README.md deleted file mode 100644 index e9987a3..0000000 --- a/node_modules/use-sync-external-store/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# use-sync-external-store - -Backwards-compatible shim for [`React.useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). Works with any React that supports Hooks. - -See also https://github.com/reactwg/react-18/discussions/86. diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js deleted file mode 100644 index c849ab8..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +++ /dev/null @@ -1,239 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = require('react'); - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -var objectIs = typeof Object.is === 'function' ? Object.is : is; - -// dispatch for CommonJS interop named imports. - -var useState = React.useState, - useEffect = React.useEffect, - useLayoutEffect = React.useLayoutEffect, - useDebugValue = React.useDebugValue; -var didWarnOld18Alpha = false; -var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works -// because of a very particular set of implementation details and assumptions -// -- change any one of them and it will break. The most important assumption -// is that updates are always synchronous, because concurrent rendering is -// only available in versions of React that also have a built-in -// useSyncExternalStore API. And we only use this shim when the built-in API -// does not exist. -// -// Do not assume that the clever hacks used by this hook also work in general. -// The point of this shim is to replace the need for hacks by other libraries. - -function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of -// React do not expose a way to check if we're hydrating. So users of the shim -// will need to track that themselves and return the correct value -// from `getSnapshot`. -getServerSnapshot) { - { - if (!didWarnOld18Alpha) { - if (React.startTransition !== undefined) { - didWarnOld18Alpha = true; - - error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.'); - } - } - } // Read the current snapshot from the store on every render. Again, this - // breaks the rules of React, and only works here because of specific - // implementation details, most importantly that updates are - // always synchronous. - - - var value = getSnapshot(); - - { - if (!didWarnUncachedGetSnapshot) { - var cachedValue = getSnapshot(); - - if (!objectIs(value, cachedValue)) { - error('The result of getSnapshot should be cached to avoid an infinite loop'); - - didWarnUncachedGetSnapshot = true; - } - } - } // Because updates are synchronous, we don't queue them. Instead we force a - // re-render whenever the subscribed state changes by updating an some - // arbitrary useState hook. Then, during render, we call getSnapshot to read - // the current value. - // - // Because we don't actually use the state returned by the useState hook, we - // can save a bit of memory by storing other stuff in that slot. - // - // To implement the early bailout, we need to track some things on a mutable - // object. Usually, we would put that in a useRef hook, but we can stash it in - // our useState hook instead. - // - // To force a re-render, we call forceUpdate({inst}). That works because the - // new object always fails an equality check. - - - var _useState = useState({ - inst: { - value: value, - getSnapshot: getSnapshot - } - }), - inst = _useState[0].inst, - forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated - // in the layout phase so we can access it during the tearing check that - // happens on subscribe. - - - useLayoutEffect(function () { - inst.value = value; - inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the - // commit phase if there was an interleaved mutation. In concurrent mode - // this can happen all the time, but even in synchronous mode, an earlier - // effect may have mutated the store. - - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - }, [subscribe, value, getSnapshot]); - useEffect(function () { - // Check for changes right before subscribing. Subsequent changes will be - // detected in the subscription handler. - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - - var handleStoreChange = function () { - // TODO: Because there is no cross-renderer API for batching updates, it's - // up to the consumer of this library to wrap their subscription event - // with unstable_batchedUpdates. Should we try to detect when this isn't - // the case and print a warning in development? - // The store changed. Check if the snapshot changed since the last time we - // read from the store. - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - }; // Subscribe to the store and return a clean-up function. - - - return subscribe(handleStoreChange); - }, [subscribe]); - useDebugValue(value); - return value; -} - -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - var prevValue = inst.value; - - try { - var nextValue = latestGetSnapshot(); - return !objectIs(prevValue, nextValue); - } catch (error) { - return true; - } -} - -function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) { - // Note: The shim does not use getServerSnapshot, because pre-18 versions of - // React do not expose a way to check if we're hydrating. So users of the shim - // will need to track that themselves and return the correct value - // from `getSnapshot`. - return getSnapshot(); -} - -var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); - -var isServerEnvironment = !canUseDOM; - -var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore; -var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim; - -exports.useSyncExternalStore = useSyncExternalStore$2; - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); -} - - })(); -} diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js deleted file mode 100644 index 5e2bebc..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim.native.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = require('react'); - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -var objectIs = typeof Object.is === 'function' ? Object.is : is; - -// dispatch for CommonJS interop named imports. - -var useState = React.useState, - useEffect = React.useEffect, - useLayoutEffect = React.useLayoutEffect, - useDebugValue = React.useDebugValue; -var didWarnOld18Alpha = false; -var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works -// because of a very particular set of implementation details and assumptions -// -- change any one of them and it will break. The most important assumption -// is that updates are always synchronous, because concurrent rendering is -// only available in versions of React that also have a built-in -// useSyncExternalStore API. And we only use this shim when the built-in API -// does not exist. -// -// Do not assume that the clever hacks used by this hook also work in general. -// The point of this shim is to replace the need for hacks by other libraries. - -function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of -// React do not expose a way to check if we're hydrating. So users of the shim -// will need to track that themselves and return the correct value -// from `getSnapshot`. -getServerSnapshot) { - { - if (!didWarnOld18Alpha) { - if (React.startTransition !== undefined) { - didWarnOld18Alpha = true; - - error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.'); - } - } - } // Read the current snapshot from the store on every render. Again, this - // breaks the rules of React, and only works here because of specific - // implementation details, most importantly that updates are - // always synchronous. - - - var value = getSnapshot(); - - { - if (!didWarnUncachedGetSnapshot) { - var cachedValue = getSnapshot(); - - if (!objectIs(value, cachedValue)) { - error('The result of getSnapshot should be cached to avoid an infinite loop'); - - didWarnUncachedGetSnapshot = true; - } - } - } // Because updates are synchronous, we don't queue them. Instead we force a - // re-render whenever the subscribed state changes by updating an some - // arbitrary useState hook. Then, during render, we call getSnapshot to read - // the current value. - // - // Because we don't actually use the state returned by the useState hook, we - // can save a bit of memory by storing other stuff in that slot. - // - // To implement the early bailout, we need to track some things on a mutable - // object. Usually, we would put that in a useRef hook, but we can stash it in - // our useState hook instead. - // - // To force a re-render, we call forceUpdate({inst}). That works because the - // new object always fails an equality check. - - - var _useState = useState({ - inst: { - value: value, - getSnapshot: getSnapshot - } - }), - inst = _useState[0].inst, - forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated - // in the layout phase so we can access it during the tearing check that - // happens on subscribe. - - - useLayoutEffect(function () { - inst.value = value; - inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the - // commit phase if there was an interleaved mutation. In concurrent mode - // this can happen all the time, but even in synchronous mode, an earlier - // effect may have mutated the store. - - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - }, [subscribe, value, getSnapshot]); - useEffect(function () { - // Check for changes right before subscribing. Subsequent changes will be - // detected in the subscription handler. - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - - var handleStoreChange = function () { - // TODO: Because there is no cross-renderer API for batching updates, it's - // up to the consumer of this library to wrap their subscription event - // with unstable_batchedUpdates. Should we try to detect when this isn't - // the case and print a warning in development? - // The store changed. Check if the snapshot changed since the last time we - // read from the store. - if (checkIfSnapshotChanged(inst)) { - // Force a re-render. - forceUpdate({ - inst: inst - }); - } - }; // Subscribe to the store and return a clean-up function. - - - return subscribe(handleStoreChange); - }, [subscribe]); - useDebugValue(value); - return value; -} - -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - var prevValue = inst.value; - - try { - var nextValue = latestGetSnapshot(); - return !objectIs(prevValue, nextValue); - } catch (error) { - return true; - } -} - -var shim = useSyncExternalStore; -var useSyncExternalStore$1 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim; - -exports.useSyncExternalStore = useSyncExternalStore$1; - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); -} - - })(); -} diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js deleted file mode 100644 index 0e7f3dc..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim.native.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var e=require("react");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} -function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:q; diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js deleted file mode 100644 index 0ca00c7..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var e=require("react");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} -function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js deleted file mode 100644 index 3c875ea..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim/with-selector.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = require('react'); -var shim = require('use-sync-external-store/shim'); - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -var objectIs = typeof Object.is === 'function' ? Object.is : is; - -var useSyncExternalStore = shim.useSyncExternalStore; - -// for CommonJS interop. - -var useRef = React.useRef, - useEffect = React.useEffect, - useMemo = React.useMemo, - useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments. - -function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { - // Use this to track the rendered snapshot. - var instRef = useRef(null); - var inst; - - if (instRef.current === null) { - inst = { - hasValue: false, - value: null - }; - instRef.current = inst; - } else { - inst = instRef.current; - } - - var _useMemo = useMemo(function () { - // Track the memoized state using closure variables that are local to this - // memoized instance of a getSnapshot function. Intentionally not using a - // useRef hook, because that state would be shared across all concurrent - // copies of the hook/component. - var hasMemo = false; - var memoizedSnapshot; - var memoizedSelection; - - var memoizedSelector = function (nextSnapshot) { - if (!hasMemo) { - // The first time the hook is called, there is no memoized result. - hasMemo = true; - memoizedSnapshot = nextSnapshot; - - var _nextSelection = selector(nextSnapshot); - - if (isEqual !== undefined) { - // Even if the selector has changed, the currently rendered selection - // may be equal to the new selection. We should attempt to reuse the - // current value if possible, to preserve downstream memoizations. - if (inst.hasValue) { - var currentSelection = inst.value; - - if (isEqual(currentSelection, _nextSelection)) { - memoizedSelection = currentSelection; - return currentSelection; - } - } - } - - memoizedSelection = _nextSelection; - return _nextSelection; - } // We may be able to reuse the previous invocation's result. - - - // We may be able to reuse the previous invocation's result. - var prevSnapshot = memoizedSnapshot; - var prevSelection = memoizedSelection; - - if (objectIs(prevSnapshot, nextSnapshot)) { - // The snapshot is the same as last time. Reuse the previous selection. - return prevSelection; - } // The snapshot has changed, so we need to compute a new selection. - - - // The snapshot has changed, so we need to compute a new selection. - var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data - // has changed. If it hasn't, return the previous selection. That signals - // to React that the selections are conceptually equal, and we can bail - // out of rendering. - - // If a custom isEqual function is provided, use that to check if the data - // has changed. If it hasn't, return the previous selection. That signals - // to React that the selections are conceptually equal, and we can bail - // out of rendering. - if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) { - return prevSelection; - } - - memoizedSnapshot = nextSnapshot; - memoizedSelection = nextSelection; - return nextSelection; - }; // Assigning this to a constant so that Flow knows it can't change. - - - // Assigning this to a constant so that Flow knows it can't change. - var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot; - - var getSnapshotWithSelector = function () { - return memoizedSelector(getSnapshot()); - }; - - var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () { - return memoizedSelector(maybeGetServerSnapshot()); - }; - return [getSnapshotWithSelector, getServerSnapshotWithSelector]; - }, [getSnapshot, getServerSnapshot, selector, isEqual]), - getSelection = _useMemo[0], - getServerSelection = _useMemo[1]; - - var value = useSyncExternalStore(subscribe, getSelection, getServerSelection); - useEffect(function () { - inst.hasValue = true; - inst.value = value; - }, [value]); - useDebugValue(value); - return value; -} - -exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); -} - - })(); -} diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js deleted file mode 100644 index 84485da..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var h=require("react"),n=require("use-sync-external-store/shim");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue; -exports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]); -u(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d}; diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js deleted file mode 100644 index eacc4be..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * @license React - * use-sync-external-store-with-selector.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = require('react'); - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare - ; -} - -var objectIs = typeof Object.is === 'function' ? Object.is : is; - -var useSyncExternalStore = React.useSyncExternalStore; - -// for CommonJS interop. - -var useRef = React.useRef, - useEffect = React.useEffect, - useMemo = React.useMemo, - useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments. - -function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { - // Use this to track the rendered snapshot. - var instRef = useRef(null); - var inst; - - if (instRef.current === null) { - inst = { - hasValue: false, - value: null - }; - instRef.current = inst; - } else { - inst = instRef.current; - } - - var _useMemo = useMemo(function () { - // Track the memoized state using closure variables that are local to this - // memoized instance of a getSnapshot function. Intentionally not using a - // useRef hook, because that state would be shared across all concurrent - // copies of the hook/component. - var hasMemo = false; - var memoizedSnapshot; - var memoizedSelection; - - var memoizedSelector = function (nextSnapshot) { - if (!hasMemo) { - // The first time the hook is called, there is no memoized result. - hasMemo = true; - memoizedSnapshot = nextSnapshot; - - var _nextSelection = selector(nextSnapshot); - - if (isEqual !== undefined) { - // Even if the selector has changed, the currently rendered selection - // may be equal to the new selection. We should attempt to reuse the - // current value if possible, to preserve downstream memoizations. - if (inst.hasValue) { - var currentSelection = inst.value; - - if (isEqual(currentSelection, _nextSelection)) { - memoizedSelection = currentSelection; - return currentSelection; - } - } - } - - memoizedSelection = _nextSelection; - return _nextSelection; - } // We may be able to reuse the previous invocation's result. - - - // We may be able to reuse the previous invocation's result. - var prevSnapshot = memoizedSnapshot; - var prevSelection = memoizedSelection; - - if (objectIs(prevSnapshot, nextSnapshot)) { - // The snapshot is the same as last time. Reuse the previous selection. - return prevSelection; - } // The snapshot has changed, so we need to compute a new selection. - - - // The snapshot has changed, so we need to compute a new selection. - var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data - // has changed. If it hasn't, return the previous selection. That signals - // to React that the selections are conceptually equal, and we can bail - // out of rendering. - - // If a custom isEqual function is provided, use that to check if the data - // has changed. If it hasn't, return the previous selection. That signals - // to React that the selections are conceptually equal, and we can bail - // out of rendering. - if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) { - return prevSelection; - } - - memoizedSnapshot = nextSnapshot; - memoizedSelection = nextSelection; - return nextSelection; - }; // Assigning this to a constant so that Flow knows it can't change. - - - // Assigning this to a constant so that Flow knows it can't change. - var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot; - - var getSnapshotWithSelector = function () { - return memoizedSelector(getSnapshot()); - }; - - var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () { - return memoizedSelector(maybeGetServerSnapshot()); - }; - return [getSnapshotWithSelector, getServerSnapshotWithSelector]; - }, [getSnapshot, getServerSnapshot, selector, isEqual]), - getSelection = _useMemo[0], - getServerSelection = _useMemo[1]; - - var value = useSyncExternalStore(subscribe, getSelection, getServerSelection); - useEffect(function () { - inst.hasValue = true; - inst.value = value; - }, [value]); - useDebugValue(value); - return value; -} - -exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); -} - - })(); -} diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js deleted file mode 100644 index 06bad1a..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license React - * use-sync-external-store-with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var g=require("react");function n(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var p="function"===typeof Object.is?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue; -exports.useSyncExternalStoreWithSelector=function(a,b,e,l,h){var c=r(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=u(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==h&&f.hasValue){var b=f.value;if(h(b,a))return k=b}return k=a}b=k;if(p(d,a))return b;var e=l(a);if(void 0!==h&&h(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,h]);var d=q(a,c[0],c[1]); -t(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d}; diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js deleted file mode 100644 index 82368bc..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license React - * use-sync-external-store.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -if (process.env.NODE_ENV !== "production") { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = require('react'); - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -var useSyncExternalStore = React.useSyncExternalStore; - -{ - error("The main 'use-sync-external-store' entry point is not supported; all it " + "does is re-export useSyncExternalStore from the 'react' package, so " + 'it only works with React 18+.' + '\n\n' + 'If you wish to support React 16 and 17, import from ' + "'use-sync-external-store/shim' instead. It will fall back to a shimmed " + 'implementation when the native one is not available.' + '\n\n' + "If you only support React 18+, you can import directly from 'react'."); -} - -exports.useSyncExternalStore = useSyncExternalStore; - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); -} - - })(); -} diff --git a/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.min.js b/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.min.js deleted file mode 100644 index 8d684a6..0000000 --- a/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license React - * use-sync-external-store.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict';var a=require("react").useSyncExternalStore;exports.useSyncExternalStore=a; diff --git a/node_modules/use-sync-external-store/index.js b/node_modules/use-sync-external-store/index.js deleted file mode 100644 index a9d619a..0000000 --- a/node_modules/use-sync-external-store/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/use-sync-external-store.production.min.js'); -} else { - module.exports = require('./cjs/use-sync-external-store.development.js'); -} diff --git a/node_modules/use-sync-external-store/package.json b/node_modules/use-sync-external-store/package.json deleted file mode 100644 index 7006692..0000000 --- a/node_modules/use-sync-external-store/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "use-sync-external-store", - "description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.", - "version": "1.2.0", - "repository": { - "type": "git", - "url": "https://github.com/facebook/react.git", - "directory": "packages/use-sync-external-store" - }, - "files": [ - "LICENSE", - "README.md", - "index.js", - "index.native.js", - "with-selector.js", - "with-selector.native.js", - "shim/", - "cjs/" - ], - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } -} \ No newline at end of file diff --git a/node_modules/use-sync-external-store/shim/index.js b/node_modules/use-sync-external-store/shim/index.js deleted file mode 100644 index bde36f3..0000000 --- a/node_modules/use-sync-external-store/shim/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim.production.min.js'); -} else { - module.exports = require('../cjs/use-sync-external-store-shim.development.js'); -} diff --git a/node_modules/use-sync-external-store/shim/index.native.js b/node_modules/use-sync-external-store/shim/index.native.js deleted file mode 100644 index 0bd5c7e..0000000 --- a/node_modules/use-sync-external-store/shim/index.native.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim.native.production.min.js'); -} else { - module.exports = require('../cjs/use-sync-external-store-shim.native.development.js'); -} diff --git a/node_modules/use-sync-external-store/shim/with-selector.js b/node_modules/use-sync-external-store/shim/with-selector.js deleted file mode 100644 index 1175186..0000000 --- a/node_modules/use-sync-external-store/shim/with-selector.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js'); -} else { - module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js'); -} diff --git a/node_modules/use-sync-external-store/with-selector.js b/node_modules/use-sync-external-store/with-selector.js deleted file mode 100644 index 9163b3e..0000000 --- a/node_modules/use-sync-external-store/with-selector.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js'); -} else { - module.exports = require('./cjs/use-sync-external-store-with-selector.development.js'); -} diff --git a/node_modules/zustand/LICENSE b/node_modules/zustand/LICENSE deleted file mode 100644 index a2c2649..0000000 --- a/node_modules/zustand/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Paul Henschel - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/zustand/context.d.ts b/node_modules/zustand/context.d.ts deleted file mode 100644 index d16f009..0000000 --- a/node_modules/zustand/context.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import ReactExports from 'react'; -import type { ReactNode } from 'react'; -import type { StoreApi } from 'zustand'; -type UseContextStore> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -}; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type WithoutCallSignature = { - [K in keyof T]: T[K]; -}; -/** - * @deprecated Use `createStore` and `useStore` for context usage - */ -declare function createContext>(): { - Provider: ({ createStore, children, }: { - createStore: () => S; - children: ReactNode; - }) => ReactExports.FunctionComponentElement>; - useStore: UseContextStore; - useStoreApi: () => WithoutCallSignature; -}; -export default createContext; diff --git a/node_modules/zustand/context.js b/node_modules/zustand/context.js deleted file mode 100644 index 7ff2b53..0000000 --- a/node_modules/zustand/context.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -var ReactExports = require('react'); -var traditional = require('zustand/traditional'); - -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} - -var createElement = ReactExports.createElement, - reactCreateContext = ReactExports.createContext, - useContext = ReactExports.useContext, - useMemo = ReactExports.useMemo, - useRef = ReactExports.useRef; -function createContext() { - if (process.env.NODE_ENV !== 'production') { - console.warn("[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180."); - } - var ZustandContext = reactCreateContext(undefined); - var Provider = function Provider(_ref) { - var createStore = _ref.createStore, - children = _ref.children; - var storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = createStore(); - } - return createElement(ZustandContext.Provider, { - value: storeRef.current - }, children); - }; - var useContextStore = function useContextStore(selector, equalityFn) { - var store = useContext(ZustandContext); - if (!store) { - throw new Error('Seems like you have not used zustand provider as an ancestor.'); - } - return traditional.useStoreWithEqualityFn(store, selector, equalityFn); - }; - var useStoreApi = function useStoreApi() { - var store = useContext(ZustandContext); - if (!store) { - throw new Error('Seems like you have not used zustand provider as an ancestor.'); - } - return useMemo(function () { - return _extends({}, store); - }, [store]); - }; - return { - Provider: Provider, - useStore: useContextStore, - useStoreApi: useStoreApi - }; -} - -module.exports = createContext; diff --git a/node_modules/zustand/esm/context.d.mts b/node_modules/zustand/esm/context.d.mts deleted file mode 100644 index d16f009..0000000 --- a/node_modules/zustand/esm/context.d.mts +++ /dev/null @@ -1,25 +0,0 @@ -import ReactExports from 'react'; -import type { ReactNode } from 'react'; -import type { StoreApi } from 'zustand'; -type UseContextStore> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -}; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type WithoutCallSignature = { - [K in keyof T]: T[K]; -}; -/** - * @deprecated Use `createStore` and `useStore` for context usage - */ -declare function createContext>(): { - Provider: ({ createStore, children, }: { - createStore: () => S; - children: ReactNode; - }) => ReactExports.FunctionComponentElement>; - useStore: UseContextStore; - useStoreApi: () => WithoutCallSignature; -}; -export default createContext; diff --git a/node_modules/zustand/esm/context.d.ts b/node_modules/zustand/esm/context.d.ts deleted file mode 100644 index d16f009..0000000 --- a/node_modules/zustand/esm/context.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import ReactExports from 'react'; -import type { ReactNode } from 'react'; -import type { StoreApi } from 'zustand'; -type UseContextStore> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -}; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type WithoutCallSignature = { - [K in keyof T]: T[K]; -}; -/** - * @deprecated Use `createStore` and `useStore` for context usage - */ -declare function createContext>(): { - Provider: ({ createStore, children, }: { - createStore: () => S; - children: ReactNode; - }) => ReactExports.FunctionComponentElement>; - useStore: UseContextStore; - useStoreApi: () => WithoutCallSignature; -}; -export default createContext; diff --git a/node_modules/zustand/esm/context.js b/node_modules/zustand/esm/context.js deleted file mode 100644 index 5f05131..0000000 --- a/node_modules/zustand/esm/context.js +++ /dev/null @@ -1,61 +0,0 @@ -import ReactExports from 'react'; -import { useStoreWithEqualityFn } from 'zustand/traditional'; - -const { - createElement, - createContext: reactCreateContext, - useContext, - useMemo, - useRef -} = ReactExports; -function createContext() { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180." - ); - } - const ZustandContext = reactCreateContext(void 0); - const Provider = ({ - createStore, - children - }) => { - const storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = createStore(); - } - return createElement( - ZustandContext.Provider, - { value: storeRef.current }, - children - ); - }; - const useContextStore = (selector, equalityFn) => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useStoreWithEqualityFn( - store, - selector, - equalityFn - ); - }; - const useStoreApi = () => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useMemo(() => ({ ...store }), [store]); - }; - return { - Provider, - useStore: useContextStore, - useStoreApi - }; -} - -export { createContext as default }; diff --git a/node_modules/zustand/esm/context.mjs b/node_modules/zustand/esm/context.mjs deleted file mode 100644 index 1d2f4ba..0000000 --- a/node_modules/zustand/esm/context.mjs +++ /dev/null @@ -1,61 +0,0 @@ -import ReactExports from 'react'; -import { useStoreWithEqualityFn } from 'zustand/traditional'; - -const { - createElement, - createContext: reactCreateContext, - useContext, - useMemo, - useRef -} = ReactExports; -function createContext() { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180." - ); - } - const ZustandContext = reactCreateContext(void 0); - const Provider = ({ - createStore, - children - }) => { - const storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = createStore(); - } - return createElement( - ZustandContext.Provider, - { value: storeRef.current }, - children - ); - }; - const useContextStore = (selector, equalityFn) => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useStoreWithEqualityFn( - store, - selector, - equalityFn - ); - }; - const useStoreApi = () => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useMemo(() => ({ ...store }), [store]); - }; - return { - Provider, - useStore: useContextStore, - useStoreApi - }; -} - -export { createContext as default }; diff --git a/node_modules/zustand/esm/index.d.mts b/node_modules/zustand/esm/index.d.mts deleted file mode 100644 index 425cbbe..0000000 --- a/node_modules/zustand/esm/index.d.mts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './vanilla.mjs'; -export * from './react.mjs'; -export { default } from './react.mjs'; diff --git a/node_modules/zustand/esm/index.d.ts b/node_modules/zustand/esm/index.d.ts deleted file mode 100644 index 7e9c8b6..0000000 --- a/node_modules/zustand/esm/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './vanilla'; -export * from './react'; -export { default } from './react'; diff --git a/node_modules/zustand/esm/index.js b/node_modules/zustand/esm/index.js deleted file mode 100644 index 70ef1fe..0000000 --- a/node_modules/zustand/esm/index.js +++ /dev/null @@ -1,47 +0,0 @@ -import { createStore } from 'zustand/vanilla'; -export * from 'zustand/vanilla'; -import ReactExports from 'react'; -import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js'; - -const { useDebugValue } = ReactExports; -const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; -let didWarnAboutEqualityFn = false; -function useStore(api, selector = api.getState, equalityFn) { - if (process.env.NODE_ENV !== "production" && equalityFn && !didWarnAboutEqualityFn) { - console.warn( - "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937" - ); - didWarnAboutEqualityFn = true; - } - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; -} -const createImpl = (createState) => { - if (process.env.NODE_ENV !== "production" && typeof createState !== "function") { - console.warn( - "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." - ); - } - const api = typeof createState === "function" ? createStore(createState) : createState; - const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn); - Object.assign(useBoundStore, api); - return useBoundStore; -}; -const create = (createState) => createState ? createImpl(createState) : createImpl; -var react = (createState) => { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`." - ); - } - return create(createState); -}; - -export { create, react as default, useStore }; diff --git a/node_modules/zustand/esm/index.mjs b/node_modules/zustand/esm/index.mjs deleted file mode 100644 index 58e1ae5..0000000 --- a/node_modules/zustand/esm/index.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import { createStore } from 'zustand/vanilla'; -export * from 'zustand/vanilla'; -import ReactExports from 'react'; -import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js'; - -const { useDebugValue } = ReactExports; -const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; -let didWarnAboutEqualityFn = false; -function useStore(api, selector = api.getState, equalityFn) { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) { - console.warn( - "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937" - ); - didWarnAboutEqualityFn = true; - } - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; -} -const createImpl = (createState) => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && typeof createState !== "function") { - console.warn( - "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." - ); - } - const api = typeof createState === "function" ? createStore(createState) : createState; - const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn); - Object.assign(useBoundStore, api); - return useBoundStore; -}; -const create = (createState) => createState ? createImpl(createState) : createImpl; -var react = (createState) => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`." - ); - } - return create(createState); -}; - -export { create, react as default, useStore }; diff --git a/node_modules/zustand/esm/middleware.d.mts b/node_modules/zustand/esm/middleware.d.mts deleted file mode 100644 index e765879..0000000 --- a/node_modules/zustand/esm/middleware.d.mts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './middleware/redux.mjs'; -export * from './middleware/devtools.mjs'; -export * from './middleware/subscribeWithSelector.mjs'; -export * from './middleware/combine.mjs'; -export * from './middleware/persist.mjs'; diff --git a/node_modules/zustand/esm/middleware.d.ts b/node_modules/zustand/esm/middleware.d.ts deleted file mode 100644 index 1806630..0000000 --- a/node_modules/zustand/esm/middleware.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './middleware/redux'; -export * from './middleware/devtools'; -export * from './middleware/subscribeWithSelector'; -export * from './middleware/combine'; -export * from './middleware/persist'; diff --git a/node_modules/zustand/esm/middleware.js b/node_modules/zustand/esm/middleware.js deleted file mode 100644 index fcaa0c8..0000000 --- a/node_modules/zustand/esm/middleware.js +++ /dev/null @@ -1,583 +0,0 @@ -const reduxImpl = (reducer, initial) => (set, _get, api) => { - api.dispatch = (action) => { - set((state) => reducer(state, action), false, action); - return action; - }; - api.dispatchFromDevtools = true; - return { dispatch: (...a) => api.dispatch(...a), ...initial }; -}; -const redux = reduxImpl; - -const trackedConnections = /* @__PURE__ */ new Map(); -const getTrackedConnectionState = (name) => { - const api = trackedConnections.get(name); - if (!api) - return {}; - return Object.fromEntries( - Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()]) - ); -}; -const extractConnectionInformation = (store, extensionConnector, options) => { - if (store === void 0) { - return { - type: "untracked", - connection: extensionConnector.connect(options) - }; - } - const existingConnection = trackedConnections.get(options.name); - if (existingConnection) { - return { type: "tracked", store, ...existingConnection }; - } - const newConnection = { - connection: extensionConnector.connect(options), - stores: {} - }; - trackedConnections.set(options.name, newConnection); - return { type: "tracked", store, ...newConnection }; -}; -const devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => { - const { enabled, anonymousActionType, store, ...options } = devtoolsOptions; - let extensionConnector; - try { - extensionConnector = (enabled != null ? enabled : process.env.NODE_ENV !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__; - } catch (e) { - } - if (!extensionConnector) { - if (process.env.NODE_ENV !== "production" && enabled) { - console.warn( - "[zustand devtools middleware] Please install/enable Redux devtools extension" - ); - } - return fn(set, get, api); - } - const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options); - let isRecording = true; - api.setState = (state, replace, nameOrAction) => { - const r = set(state, replace); - if (!isRecording) - return r; - const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction; - if (store === void 0) { - connection == null ? void 0 : connection.send(action, get()); - return r; - } - connection == null ? void 0 : connection.send( - { - ...action, - type: `${store}/${action.type}` - }, - { - ...getTrackedConnectionState(options.name), - [store]: api.getState() - } - ); - return r; - }; - const setStateFromDevtools = (...a) => { - const originalIsRecording = isRecording; - isRecording = false; - set(...a); - isRecording = originalIsRecording; - }; - const initialState = fn(api.setState, get, api); - if (connectionInformation.type === "untracked") { - connection == null ? void 0 : connection.init(initialState); - } else { - connectionInformation.stores[connectionInformation.store] = api; - connection == null ? void 0 : connection.init( - Object.fromEntries( - Object.entries(connectionInformation.stores).map(([key, store2]) => [ - key, - key === connectionInformation.store ? initialState : store2.getState() - ]) - ) - ); - } - if (api.dispatchFromDevtools && typeof api.dispatch === "function") { - let didWarnAboutReservedActionType = false; - const originalDispatch = api.dispatch; - api.dispatch = (...a) => { - if (process.env.NODE_ENV !== "production" && a[0].type === "__setState" && !didWarnAboutReservedActionType) { - console.warn( - '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.' - ); - didWarnAboutReservedActionType = true; - } - originalDispatch(...a); - }; - } - connection.subscribe((message) => { - var _a; - switch (message.type) { - case "ACTION": - if (typeof message.payload !== "string") { - console.error( - "[zustand devtools middleware] Unsupported action format" - ); - return; - } - return parseJsonThen( - message.payload, - (action) => { - if (action.type === "__setState") { - if (store === void 0) { - setStateFromDevtools(action.state); - return; - } - if (Object.keys(action.state).length !== 1) { - console.error( - ` - [zustand devtools middleware] Unsupported __setState action format. - When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), - and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - ` - ); - } - const stateFromDevtools = action.state[store]; - if (stateFromDevtools === void 0 || stateFromDevtools === null) { - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) { - setStateFromDevtools(stateFromDevtools); - } - return; - } - if (!api.dispatchFromDevtools) - return; - if (typeof api.dispatch !== "function") - return; - api.dispatch(action); - } - ); - case "DISPATCH": - switch (message.payload.type) { - case "RESET": - setStateFromDevtools(initialState); - if (store === void 0) { - return connection == null ? void 0 : connection.init(api.getState()); - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "COMMIT": - if (store === void 0) { - connection == null ? void 0 : connection.init(api.getState()); - return; - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "ROLLBACK": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - connection == null ? void 0 : connection.init(api.getState()); - return; - } - setStateFromDevtools(state[store]); - connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - }); - case "JUMP_TO_STATE": - case "JUMP_TO_ACTION": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) { - setStateFromDevtools(state[store]); - } - }); - case "IMPORT_STATE": { - const { nextLiftedState } = message.payload; - const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state; - if (!lastComputedState) - return; - if (store === void 0) { - setStateFromDevtools(lastComputedState); - } else { - setStateFromDevtools(lastComputedState[store]); - } - connection == null ? void 0 : connection.send( - null, - // FIXME no-any - nextLiftedState - ); - return; - } - case "PAUSE_RECORDING": - return isRecording = !isRecording; - } - return; - } - }); - return initialState; -}; -const devtools = devtoolsImpl; -const parseJsonThen = (stringified, f) => { - let parsed; - try { - parsed = JSON.parse(stringified); - } catch (e) { - console.error( - "[zustand devtools middleware] Could not parse the received json", - e - ); - } - if (parsed !== void 0) - f(parsed); -}; - -const subscribeWithSelectorImpl = (fn) => (set, get, api) => { - const origSubscribe = api.subscribe; - api.subscribe = (selector, optListener, options) => { - let listener = selector; - if (optListener) { - const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; - let currentSlice = selector(api.getState()); - listener = (state) => { - const nextSlice = selector(state); - if (!equalityFn(currentSlice, nextSlice)) { - const previousSlice = currentSlice; - optListener(currentSlice = nextSlice, previousSlice); - } - }; - if (options == null ? void 0 : options.fireImmediately) { - optListener(currentSlice, currentSlice); - } - } - return origSubscribe(listener); - }; - const initialState = fn(set, get, api); - return initialState; -}; -const subscribeWithSelector = subscribeWithSelectorImpl; - -const combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a)); - -function createJSONStorage(getStorage, options) { - let storage; - try { - storage = getStorage(); - } catch (e) { - return; - } - const persistStorage = { - getItem: (name) => { - var _a; - const parse = (str2) => { - if (str2 === null) { - return null; - } - return JSON.parse(str2, options == null ? void 0 : options.reviver); - }; - const str = (_a = storage.getItem(name)) != null ? _a : null; - if (str instanceof Promise) { - return str.then(parse); - } - return parse(str); - }, - setItem: (name, newValue) => storage.setItem( - name, - JSON.stringify(newValue, options == null ? void 0 : options.replacer) - ), - removeItem: (name) => storage.removeItem(name) - }; - return persistStorage; -} -const toThenable = (fn) => (input) => { - try { - const result = fn(input); - if (result instanceof Promise) { - return result; - } - return { - then(onFulfilled) { - return toThenable(onFulfilled)(result); - }, - catch(_onRejected) { - return this; - } - }; - } catch (e) { - return { - then(_onFulfilled) { - return this; - }, - catch(onRejected) { - return toThenable(onRejected)(e); - } - }; - } -}; -const oldImpl = (config, baseOptions) => (set, get, api) => { - let options = { - getStorage: () => localStorage, - serialize: JSON.stringify, - deserialize: JSON.parse, - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage; - try { - storage = options.getStorage(); - } catch (e) { - } - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const thenableSerialize = toThenable(options.serialize); - const setItem = () => { - const state = options.partialize({ ...get() }); - let errorInSync; - const thenable = thenableSerialize({ state, version: options.version }).then( - (serializedValue) => storage.setItem(options.name, serializedValue) - ).catch((e) => { - errorInSync = e; - }); - if (errorInSync) { - throw errorInSync; - } - return thenable; - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => cb(get())); - const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => { - if (storageValue) { - return options.deserialize(storageValue); - } - }).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.getStorage) { - storage = newOptions.getStorage(); - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - hydrate(); - return stateFromStorage || configResult; -}; -const newImpl = (config, baseOptions) => (set, get, api) => { - let options = { - storage: createJSONStorage(() => localStorage), - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage = options.storage; - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const setItem = () => { - const state = options.partialize({ ...get() }); - return storage.setItem(options.name, { - state, - version: options.version - }); - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a, _b; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => { - var _a2; - return cb((_a2 = get()) != null ? _a2 : configResult); - }); - const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - stateFromStorage = get(); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.storage) { - storage = newOptions.storage; - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - if (!options.skipHydration) { - hydrate(); - } - return stateFromStorage || configResult; -}; -const persistImpl = (config, baseOptions) => { - if ("getStorage" in baseOptions || "serialize" in baseOptions || "deserialize" in baseOptions) { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." - ); - } - return oldImpl(config, baseOptions); - } - return newImpl(config, baseOptions); -}; -const persist = persistImpl; - -export { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector }; diff --git a/node_modules/zustand/esm/middleware.mjs b/node_modules/zustand/esm/middleware.mjs deleted file mode 100644 index c0b9cad..0000000 --- a/node_modules/zustand/esm/middleware.mjs +++ /dev/null @@ -1,583 +0,0 @@ -const reduxImpl = (reducer, initial) => (set, _get, api) => { - api.dispatch = (action) => { - set((state) => reducer(state, action), false, action); - return action; - }; - api.dispatchFromDevtools = true; - return { dispatch: (...a) => api.dispatch(...a), ...initial }; -}; -const redux = reduxImpl; - -const trackedConnections = /* @__PURE__ */ new Map(); -const getTrackedConnectionState = (name) => { - const api = trackedConnections.get(name); - if (!api) - return {}; - return Object.fromEntries( - Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()]) - ); -}; -const extractConnectionInformation = (store, extensionConnector, options) => { - if (store === void 0) { - return { - type: "untracked", - connection: extensionConnector.connect(options) - }; - } - const existingConnection = trackedConnections.get(options.name); - if (existingConnection) { - return { type: "tracked", store, ...existingConnection }; - } - const newConnection = { - connection: extensionConnector.connect(options), - stores: {} - }; - trackedConnections.set(options.name, newConnection); - return { type: "tracked", store, ...newConnection }; -}; -const devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => { - const { enabled, anonymousActionType, store, ...options } = devtoolsOptions; - let extensionConnector; - try { - extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__; - } catch (e) { - } - if (!extensionConnector) { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && enabled) { - console.warn( - "[zustand devtools middleware] Please install/enable Redux devtools extension" - ); - } - return fn(set, get, api); - } - const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options); - let isRecording = true; - api.setState = (state, replace, nameOrAction) => { - const r = set(state, replace); - if (!isRecording) - return r; - const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction; - if (store === void 0) { - connection == null ? void 0 : connection.send(action, get()); - return r; - } - connection == null ? void 0 : connection.send( - { - ...action, - type: `${store}/${action.type}` - }, - { - ...getTrackedConnectionState(options.name), - [store]: api.getState() - } - ); - return r; - }; - const setStateFromDevtools = (...a) => { - const originalIsRecording = isRecording; - isRecording = false; - set(...a); - isRecording = originalIsRecording; - }; - const initialState = fn(api.setState, get, api); - if (connectionInformation.type === "untracked") { - connection == null ? void 0 : connection.init(initialState); - } else { - connectionInformation.stores[connectionInformation.store] = api; - connection == null ? void 0 : connection.init( - Object.fromEntries( - Object.entries(connectionInformation.stores).map(([key, store2]) => [ - key, - key === connectionInformation.store ? initialState : store2.getState() - ]) - ) - ); - } - if (api.dispatchFromDevtools && typeof api.dispatch === "function") { - let didWarnAboutReservedActionType = false; - const originalDispatch = api.dispatch; - api.dispatch = (...a) => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && a[0].type === "__setState" && !didWarnAboutReservedActionType) { - console.warn( - '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.' - ); - didWarnAboutReservedActionType = true; - } - originalDispatch(...a); - }; - } - connection.subscribe((message) => { - var _a; - switch (message.type) { - case "ACTION": - if (typeof message.payload !== "string") { - console.error( - "[zustand devtools middleware] Unsupported action format" - ); - return; - } - return parseJsonThen( - message.payload, - (action) => { - if (action.type === "__setState") { - if (store === void 0) { - setStateFromDevtools(action.state); - return; - } - if (Object.keys(action.state).length !== 1) { - console.error( - ` - [zustand devtools middleware] Unsupported __setState action format. - When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), - and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - ` - ); - } - const stateFromDevtools = action.state[store]; - if (stateFromDevtools === void 0 || stateFromDevtools === null) { - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) { - setStateFromDevtools(stateFromDevtools); - } - return; - } - if (!api.dispatchFromDevtools) - return; - if (typeof api.dispatch !== "function") - return; - api.dispatch(action); - } - ); - case "DISPATCH": - switch (message.payload.type) { - case "RESET": - setStateFromDevtools(initialState); - if (store === void 0) { - return connection == null ? void 0 : connection.init(api.getState()); - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "COMMIT": - if (store === void 0) { - connection == null ? void 0 : connection.init(api.getState()); - return; - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "ROLLBACK": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - connection == null ? void 0 : connection.init(api.getState()); - return; - } - setStateFromDevtools(state[store]); - connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - }); - case "JUMP_TO_STATE": - case "JUMP_TO_ACTION": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) { - setStateFromDevtools(state[store]); - } - }); - case "IMPORT_STATE": { - const { nextLiftedState } = message.payload; - const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state; - if (!lastComputedState) - return; - if (store === void 0) { - setStateFromDevtools(lastComputedState); - } else { - setStateFromDevtools(lastComputedState[store]); - } - connection == null ? void 0 : connection.send( - null, - // FIXME no-any - nextLiftedState - ); - return; - } - case "PAUSE_RECORDING": - return isRecording = !isRecording; - } - return; - } - }); - return initialState; -}; -const devtools = devtoolsImpl; -const parseJsonThen = (stringified, f) => { - let parsed; - try { - parsed = JSON.parse(stringified); - } catch (e) { - console.error( - "[zustand devtools middleware] Could not parse the received json", - e - ); - } - if (parsed !== void 0) - f(parsed); -}; - -const subscribeWithSelectorImpl = (fn) => (set, get, api) => { - const origSubscribe = api.subscribe; - api.subscribe = (selector, optListener, options) => { - let listener = selector; - if (optListener) { - const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; - let currentSlice = selector(api.getState()); - listener = (state) => { - const nextSlice = selector(state); - if (!equalityFn(currentSlice, nextSlice)) { - const previousSlice = currentSlice; - optListener(currentSlice = nextSlice, previousSlice); - } - }; - if (options == null ? void 0 : options.fireImmediately) { - optListener(currentSlice, currentSlice); - } - } - return origSubscribe(listener); - }; - const initialState = fn(set, get, api); - return initialState; -}; -const subscribeWithSelector = subscribeWithSelectorImpl; - -const combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a)); - -function createJSONStorage(getStorage, options) { - let storage; - try { - storage = getStorage(); - } catch (e) { - return; - } - const persistStorage = { - getItem: (name) => { - var _a; - const parse = (str2) => { - if (str2 === null) { - return null; - } - return JSON.parse(str2, options == null ? void 0 : options.reviver); - }; - const str = (_a = storage.getItem(name)) != null ? _a : null; - if (str instanceof Promise) { - return str.then(parse); - } - return parse(str); - }, - setItem: (name, newValue) => storage.setItem( - name, - JSON.stringify(newValue, options == null ? void 0 : options.replacer) - ), - removeItem: (name) => storage.removeItem(name) - }; - return persistStorage; -} -const toThenable = (fn) => (input) => { - try { - const result = fn(input); - if (result instanceof Promise) { - return result; - } - return { - then(onFulfilled) { - return toThenable(onFulfilled)(result); - }, - catch(_onRejected) { - return this; - } - }; - } catch (e) { - return { - then(_onFulfilled) { - return this; - }, - catch(onRejected) { - return toThenable(onRejected)(e); - } - }; - } -}; -const oldImpl = (config, baseOptions) => (set, get, api) => { - let options = { - getStorage: () => localStorage, - serialize: JSON.stringify, - deserialize: JSON.parse, - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage; - try { - storage = options.getStorage(); - } catch (e) { - } - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const thenableSerialize = toThenable(options.serialize); - const setItem = () => { - const state = options.partialize({ ...get() }); - let errorInSync; - const thenable = thenableSerialize({ state, version: options.version }).then( - (serializedValue) => storage.setItem(options.name, serializedValue) - ).catch((e) => { - errorInSync = e; - }); - if (errorInSync) { - throw errorInSync; - } - return thenable; - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => cb(get())); - const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => { - if (storageValue) { - return options.deserialize(storageValue); - } - }).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.getStorage) { - storage = newOptions.getStorage(); - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - hydrate(); - return stateFromStorage || configResult; -}; -const newImpl = (config, baseOptions) => (set, get, api) => { - let options = { - storage: createJSONStorage(() => localStorage), - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage = options.storage; - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const setItem = () => { - const state = options.partialize({ ...get() }); - return storage.setItem(options.name, { - state, - version: options.version - }); - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a, _b; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => { - var _a2; - return cb((_a2 = get()) != null ? _a2 : configResult); - }); - const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - stateFromStorage = get(); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.storage) { - storage = newOptions.storage; - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - if (!options.skipHydration) { - hydrate(); - } - return stateFromStorage || configResult; -}; -const persistImpl = (config, baseOptions) => { - if ("getStorage" in baseOptions || "serialize" in baseOptions || "deserialize" in baseOptions) { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." - ); - } - return oldImpl(config, baseOptions); - } - return newImpl(config, baseOptions); -}; -const persist = persistImpl; - -export { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector }; diff --git a/node_modules/zustand/esm/middleware/combine.d.mts b/node_modules/zustand/esm/middleware/combine.d.mts deleted file mode 100644 index d6ebb81..0000000 --- a/node_modules/zustand/esm/middleware/combine.d.mts +++ /dev/null @@ -1,5 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; -type Write = Omit & U; -type Combine = (initialState: T, additionalStateCreator: StateCreator) => StateCreator, Mps, Mcs>; -export declare const combine: Combine; -export {}; diff --git a/node_modules/zustand/esm/middleware/combine.d.ts b/node_modules/zustand/esm/middleware/combine.d.ts deleted file mode 100644 index 6e9d2d1..0000000 --- a/node_modules/zustand/esm/middleware/combine.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Omit & U; -type Combine = (initialState: T, additionalStateCreator: StateCreator) => StateCreator, Mps, Mcs>; -export declare const combine: Combine; -export {}; diff --git a/node_modules/zustand/esm/middleware/devtools.d.mts b/node_modules/zustand/esm/middleware/devtools.d.mts deleted file mode 100644 index b7624c0..0000000 --- a/node_modules/zustand/esm/middleware/devtools.d.mts +++ /dev/null @@ -1,49 +0,0 @@ -import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla.mjs'; -type Config = Parameters<(Window extends { - __REDUX_DEVTOOLS_EXTENSION__?: infer T; -} ? T : { - connect: (param: any) => any; -})['connect']>[0]; -declare module '../vanilla.mjs' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -type Cast = T extends U ? T : U; -type Write = Omit & U; -type TakeTwo = T extends { - length: 0; -} ? [undefined, undefined] : T extends { - length: 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 0 | 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 2; -} ? T : T extends { - length: 1 | 2; -} ? T : T extends { - length: 0 | 1 | 2; -} ? T : T extends [infer A0, infer A1, ...unknown[]] ? [A0, A1] : T extends [infer A0, (infer A1)?, ...unknown[]] ? [A0, A1?] : T extends [(infer A0)?, (infer A1)?, ...unknown[]] ? [A0?, A1?] : never; -type WithDevtools = Write>; -type StoreDevtools = S extends { - setState: (...a: infer Sa) => infer Sr; -} ? { - setState(...a: [...a: TakeTwo, action?: A]): Sr; -} : never; -export interface DevtoolsOptions extends Config { - name?: string; - enabled?: boolean; - anonymousActionType?: string; - store?: string; -} -type Devtools = (initializer: StateCreator, devtoolsOptions?: DevtoolsOptions) => StateCreator; -declare module '../vanilla.mjs' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -export type NamedSet = WithDevtools>['setState']; -export declare const devtools: Devtools; -export {}; diff --git a/node_modules/zustand/esm/middleware/devtools.d.ts b/node_modules/zustand/esm/middleware/devtools.d.ts deleted file mode 100644 index 34489bd..0000000 --- a/node_modules/zustand/esm/middleware/devtools.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla'; -type Config = Parameters<(Window extends { - __REDUX_DEVTOOLS_EXTENSION__?: infer T; -} ? T : { - connect: (param: any) => any; -})['connect']>[0]; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -type Cast = T extends U ? T : U; -type Write = Omit & U; -type TakeTwo = T extends { - length: 0; -} ? [undefined, undefined] : T extends { - length: 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 0 | 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 2; -} ? T : T extends { - length: 1 | 2; -} ? T : T extends { - length: 0 | 1 | 2; -} ? T : T extends [infer A0, infer A1, ...unknown[]] ? [A0, A1] : T extends [infer A0, (infer A1)?, ...unknown[]] ? [A0, A1?] : T extends [(infer A0)?, (infer A1)?, ...unknown[]] ? [A0?, A1?] : never; -type WithDevtools = Write>; -type StoreDevtools = S extends { - setState: (...a: infer Sa) => infer Sr; -} ? { - setState(...a: [...a: TakeTwo, action?: A]): Sr; -} : never; -export interface DevtoolsOptions extends Config { - name?: string; - enabled?: boolean; - anonymousActionType?: string; - store?: string; -} -type Devtools = (initializer: StateCreator, devtoolsOptions?: DevtoolsOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -export type NamedSet = WithDevtools>['setState']; -export declare const devtools: Devtools; -export {}; diff --git a/node_modules/zustand/esm/middleware/immer.d.mts b/node_modules/zustand/esm/middleware/immer.d.mts deleted file mode 100644 index 27bc45f..0000000 --- a/node_modules/zustand/esm/middleware/immer.d.mts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Draft } from 'immer'; -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; -type Immer = (initializer: StateCreator) => StateCreator; -declare module '../vanilla.mjs' { - interface StoreMutators { - ['zustand/immer']: WithImmer; - } -} -type Write = Omit & U; -type SkipTwo = T extends { - length: 0; -} ? [] : T extends { - length: 1; -} ? [] : T extends { - length: 0 | 1; -} ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never; -type WithImmer = Write>; -type StoreImmer = S extends { - getState: () => infer T; - setState: infer SetState; -} ? SetState extends (...a: infer A) => infer Sr ? { - setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; -} : never : never; -export declare const immer: Immer; -export {}; diff --git a/node_modules/zustand/esm/middleware/immer.d.ts b/node_modules/zustand/esm/middleware/immer.d.ts deleted file mode 100644 index e770ab3..0000000 --- a/node_modules/zustand/esm/middleware/immer.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Draft } from 'immer'; -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Immer = (initializer: StateCreator) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/immer']: WithImmer; - } -} -type Write = Omit & U; -type SkipTwo = T extends { - length: 0; -} ? [] : T extends { - length: 1; -} ? [] : T extends { - length: 0 | 1; -} ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never; -type WithImmer = Write>; -type StoreImmer = S extends { - getState: () => infer T; - setState: infer SetState; -} ? SetState extends (...a: infer A) => infer Sr ? { - setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; -} : never : never; -export declare const immer: Immer; -export {}; diff --git a/node_modules/zustand/esm/middleware/immer.js b/node_modules/zustand/esm/middleware/immer.js deleted file mode 100644 index 4c12d2a..0000000 --- a/node_modules/zustand/esm/middleware/immer.js +++ /dev/null @@ -1,12 +0,0 @@ -import { produce } from 'immer'; - -const immerImpl = (initializer) => (set, get, store) => { - store.setState = (updater, replace, ...a) => { - const nextState = typeof updater === "function" ? produce(updater) : updater; - return set(nextState, replace, ...a); - }; - return initializer(store.setState, get, store); -}; -const immer = immerImpl; - -export { immer }; diff --git a/node_modules/zustand/esm/middleware/immer.mjs b/node_modules/zustand/esm/middleware/immer.mjs deleted file mode 100644 index 4c12d2a..0000000 --- a/node_modules/zustand/esm/middleware/immer.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { produce } from 'immer'; - -const immerImpl = (initializer) => (set, get, store) => { - store.setState = (updater, replace, ...a) => { - const nextState = typeof updater === "function" ? produce(updater) : updater; - return set(nextState, replace, ...a); - }; - return initializer(store.setState, get, store); -}; -const immer = immerImpl; - -export { immer }; diff --git a/node_modules/zustand/esm/middleware/persist.d.mts b/node_modules/zustand/esm/middleware/persist.d.mts deleted file mode 100644 index 529bf05..0000000 --- a/node_modules/zustand/esm/middleware/persist.d.mts +++ /dev/null @@ -1,119 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; -export interface StateStorage { - getItem: (name: string) => string | null | Promise; - setItem: (name: string, value: string) => void | Promise; - removeItem: (name: string) => void | Promise; -} -export type StorageValue = { - state: S; - version?: number; -}; -export interface PersistStorage { - getItem: (name: string) => StorageValue | null | Promise | null>; - setItem: (name: string, value: StorageValue) => void | Promise; - removeItem: (name: string) => void | Promise; -} -type JsonStorageOptions = { - reviver?: (key: string, value: unknown) => unknown; - replacer?: (key: string, value: unknown) => unknown; -}; -export declare function createJSONStorage(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage | undefined; -export interface PersistOptions { - /** Name of the storage (must be unique) */ - name: string; - /** - * @deprecated Use `storage` instead. - * A function returning a storage. - * The storage must fit `window.localStorage`'s api (or an async version of it). - * For example the storage could be `AsyncStorage` from React Native. - * - * @default () => localStorage - */ - getStorage?: () => StateStorage; - /** - * @deprecated Use `storage` instead. - * Use a custom serializer. - * The returned string will be stored in the storage. - * - * @default JSON.stringify - */ - serialize?: (state: StorageValue) => string | Promise; - /** - * @deprecated Use `storage` instead. - * Use a custom deserializer. - * Must return an object matching StorageValue - * - * @param str The storage's current value. - * @default JSON.parse - */ - deserialize?: (str: string) => StorageValue | Promise>; - /** - * Use a custom persist storage. - * - * Combining `createJSONStorage` helps creating a persist storage - * with JSON.parse and JSON.stringify. - * - * @default createJSONStorage(() => localStorage) - */ - storage?: PersistStorage | undefined; - /** - * Filter the persisted value. - * - * @params state The state's value - */ - partialize?: (state: S) => PersistedState; - /** - * A function returning another (optional) function. - * The main function will be called before the state rehydration. - * The returned function will be called after the state rehydration or when an error occurred. - */ - onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void; - /** - * If the stored state's version mismatch the one specified here, the storage will not be used. - * This is useful when adding a breaking change to your store. - */ - version?: number; - /** - * A function to perform persisted state migration. - * This function will be called when persisted state versions mismatch with the one specified here. - */ - migrate?: (persistedState: unknown, version: number) => S | Promise; - /** - * A function to perform custom hydration merges when combining the stored state with the current one. - * By default, this function does a shallow merge. - */ - merge?: (persistedState: unknown, currentState: S) => S; - /** - * An optional boolean that will prevent the persist middleware from triggering hydration on initialization, - * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle. - * - * This is useful in SSR application. - * - * @default false - */ - skipHydration?: boolean; -} -type PersistListener = (state: S) => void; -type StorePersist = { - persist: { - setOptions: (options: Partial>) => void; - clearStorage: () => void; - rehydrate: () => Promise | void; - hasHydrated: () => boolean; - onHydrate: (fn: PersistListener) => () => void; - onFinishHydration: (fn: PersistListener) => () => void; - getOptions: () => Partial>; - }; -}; -type Persist = (initializer: StateCreator, options: PersistOptions) => StateCreator; -declare module '../vanilla.mjs' { - interface StoreMutators { - 'zustand/persist': WithPersist; - } -} -type Write = Omit & U; -type WithPersist = S extends { - getState: () => infer T; -} ? Write> : never; -export declare const persist: Persist; -export {}; diff --git a/node_modules/zustand/esm/middleware/persist.d.ts b/node_modules/zustand/esm/middleware/persist.d.ts deleted file mode 100644 index 829951c..0000000 --- a/node_modules/zustand/esm/middleware/persist.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -export interface StateStorage { - getItem: (name: string) => string | null | Promise; - setItem: (name: string, value: string) => void | Promise; - removeItem: (name: string) => void | Promise; -} -export type StorageValue = { - state: S; - version?: number; -}; -export interface PersistStorage { - getItem: (name: string) => StorageValue | null | Promise | null>; - setItem: (name: string, value: StorageValue) => void | Promise; - removeItem: (name: string) => void | Promise; -} -type JsonStorageOptions = { - reviver?: (key: string, value: unknown) => unknown; - replacer?: (key: string, value: unknown) => unknown; -}; -export declare function createJSONStorage(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage | undefined; -export interface PersistOptions { - /** Name of the storage (must be unique) */ - name: string; - /** - * @deprecated Use `storage` instead. - * A function returning a storage. - * The storage must fit `window.localStorage`'s api (or an async version of it). - * For example the storage could be `AsyncStorage` from React Native. - * - * @default () => localStorage - */ - getStorage?: () => StateStorage; - /** - * @deprecated Use `storage` instead. - * Use a custom serializer. - * The returned string will be stored in the storage. - * - * @default JSON.stringify - */ - serialize?: (state: StorageValue) => string | Promise; - /** - * @deprecated Use `storage` instead. - * Use a custom deserializer. - * Must return an object matching StorageValue - * - * @param str The storage's current value. - * @default JSON.parse - */ - deserialize?: (str: string) => StorageValue | Promise>; - /** - * Use a custom persist storage. - * - * Combining `createJSONStorage` helps creating a persist storage - * with JSON.parse and JSON.stringify. - * - * @default createJSONStorage(() => localStorage) - */ - storage?: PersistStorage | undefined; - /** - * Filter the persisted value. - * - * @params state The state's value - */ - partialize?: (state: S) => PersistedState; - /** - * A function returning another (optional) function. - * The main function will be called before the state rehydration. - * The returned function will be called after the state rehydration or when an error occurred. - */ - onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void; - /** - * If the stored state's version mismatch the one specified here, the storage will not be used. - * This is useful when adding a breaking change to your store. - */ - version?: number; - /** - * A function to perform persisted state migration. - * This function will be called when persisted state versions mismatch with the one specified here. - */ - migrate?: (persistedState: unknown, version: number) => S | Promise; - /** - * A function to perform custom hydration merges when combining the stored state with the current one. - * By default, this function does a shallow merge. - */ - merge?: (persistedState: unknown, currentState: S) => S; - /** - * An optional boolean that will prevent the persist middleware from triggering hydration on initialization, - * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle. - * - * This is useful in SSR application. - * - * @default false - */ - skipHydration?: boolean; -} -type PersistListener = (state: S) => void; -type StorePersist = { - persist: { - setOptions: (options: Partial>) => void; - clearStorage: () => void; - rehydrate: () => Promise | void; - hasHydrated: () => boolean; - onHydrate: (fn: PersistListener) => () => void; - onFinishHydration: (fn: PersistListener) => () => void; - getOptions: () => Partial>; - }; -}; -type Persist = (initializer: StateCreator, options: PersistOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/persist': WithPersist; - } -} -type Write = Omit & U; -type WithPersist = S extends { - getState: () => infer T; -} ? Write> : never; -export declare const persist: Persist; -export {}; diff --git a/node_modules/zustand/esm/middleware/redux.d.mts b/node_modules/zustand/esm/middleware/redux.d.mts deleted file mode 100644 index 567c3b8..0000000 --- a/node_modules/zustand/esm/middleware/redux.d.mts +++ /dev/null @@ -1,21 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; -type Write = Omit & U; -type Action = { - type: string; -}; -type StoreRedux = { - dispatch: (a: A) => A; - dispatchFromDevtools: true; -}; -type ReduxState = { - dispatch: StoreRedux['dispatch']; -}; -type WithRedux = Write>; -type Redux = (reducer: (state: T, action: A) => T, initialState: T) => StateCreator>, Cms, [['zustand/redux', A]]>; -declare module '../vanilla.mjs' { - interface StoreMutators { - 'zustand/redux': WithRedux; - } -} -export declare const redux: Redux; -export {}; diff --git a/node_modules/zustand/esm/middleware/redux.d.ts b/node_modules/zustand/esm/middleware/redux.d.ts deleted file mode 100644 index 41a61e1..0000000 --- a/node_modules/zustand/esm/middleware/redux.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Omit & U; -type Action = { - type: string; -}; -type StoreRedux = { - dispatch: (a: A) => A; - dispatchFromDevtools: true; -}; -type ReduxState = { - dispatch: StoreRedux['dispatch']; -}; -type WithRedux = Write>; -type Redux = (reducer: (state: T, action: A) => T, initialState: T) => StateCreator>, Cms, [['zustand/redux', A]]>; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/redux': WithRedux; - } -} -export declare const redux: Redux; -export {}; diff --git a/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts b/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts deleted file mode 100644 index 306e853..0000000 --- a/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts +++ /dev/null @@ -1,25 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; -type SubscribeWithSelector = (initializer: StateCreator) => StateCreator; -type Write = Omit & U; -type WithSelectorSubscribe = S extends { - getState: () => infer T; -} ? Write> : never; -declare module '../vanilla.mjs' { - interface StoreMutators { - ['zustand/subscribeWithSelector']: WithSelectorSubscribe; - } -} -type StoreSubscribeWithSelector = { - subscribe: { - (listener: (selectedState: T, previousSelectedState: T) => void): () => void; - (selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { - equalityFn?: (a: U, b: U) => boolean; - fireImmediately?: boolean; - }): () => void; - }; -}; -export declare const subscribeWithSelector: SubscribeWithSelector; -export {}; diff --git a/node_modules/zustand/esm/middleware/subscribeWithSelector.d.ts b/node_modules/zustand/esm/middleware/subscribeWithSelector.d.ts deleted file mode 100644 index 3243f26..0000000 --- a/node_modules/zustand/esm/middleware/subscribeWithSelector.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type SubscribeWithSelector = (initializer: StateCreator) => StateCreator; -type Write = Omit & U; -type WithSelectorSubscribe = S extends { - getState: () => infer T; -} ? Write> : never; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/subscribeWithSelector']: WithSelectorSubscribe; - } -} -type StoreSubscribeWithSelector = { - subscribe: { - (listener: (selectedState: T, previousSelectedState: T) => void): () => void; - (selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { - equalityFn?: (a: U, b: U) => boolean; - fireImmediately?: boolean; - }): () => void; - }; -}; -export declare const subscribeWithSelector: SubscribeWithSelector; -export {}; diff --git a/node_modules/zustand/esm/react.d.mts b/node_modules/zustand/esm/react.d.mts deleted file mode 100644 index 09a1b8e..0000000 --- a/node_modules/zustand/esm/react.d.mts +++ /dev/null @@ -1,37 +0,0 @@ -import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla.mjs'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStore>>(api: S): ExtractState; -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U): U; -/** - * @deprecated Use `useStoreWithEqualityFn` from 'zustand/traditional' - * https://github.com/pmndrs/zustand/discussions/1937 - */ -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U, equalityFn: ((a: U, b: U) => boolean) | undefined): U; -export type UseBoundStore>> = { - (): ExtractState; - (selector: (state: ExtractState) => U): U; - /** - * @deprecated Use `createWithEqualityFn` from 'zustand/traditional' - */ - (selector: (state: ExtractState) => U, equalityFn: (a: U, b: U) => boolean): U; -} & S; -type Create = { - (initializer: StateCreator): UseBoundStore, Mos>>; - (): (initializer: StateCreator) => UseBoundStore, Mos>>; - /** - * @deprecated Use `useStore` hook to bind store - */ - >(store: S): UseBoundStore; -}; -export declare const create: Create; -/** - * @deprecated Use `import { create } from 'zustand'` - */ -declare const _default: Create; -export default _default; diff --git a/node_modules/zustand/esm/react.d.ts b/node_modules/zustand/esm/react.d.ts deleted file mode 100644 index 5076d12..0000000 --- a/node_modules/zustand/esm/react.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStore>>(api: S): ExtractState; -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U): U; -/** - * @deprecated Use `useStoreWithEqualityFn` from 'zustand/traditional' - * https://github.com/pmndrs/zustand/discussions/1937 - */ -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U, equalityFn: ((a: U, b: U) => boolean) | undefined): U; -export type UseBoundStore>> = { - (): ExtractState; - (selector: (state: ExtractState) => U): U; - /** - * @deprecated Use `createWithEqualityFn` from 'zustand/traditional' - */ - (selector: (state: ExtractState) => U, equalityFn: (a: U, b: U) => boolean): U; -} & S; -type Create = { - (initializer: StateCreator): UseBoundStore, Mos>>; - (): (initializer: StateCreator) => UseBoundStore, Mos>>; - /** - * @deprecated Use `useStore` hook to bind store - */ - >(store: S): UseBoundStore; -}; -export declare const create: Create; -/** - * @deprecated Use `import { create } from 'zustand'` - */ -declare const _default: Create; -export default _default; diff --git a/node_modules/zustand/esm/react/shallow.d.mts b/node_modules/zustand/esm/react/shallow.d.mts deleted file mode 100644 index 9068d46..0000000 --- a/node_modules/zustand/esm/react/shallow.d.mts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallow(selector: (state: S) => U): (state: S) => U; diff --git a/node_modules/zustand/esm/react/shallow.d.ts b/node_modules/zustand/esm/react/shallow.d.ts deleted file mode 100644 index 9068d46..0000000 --- a/node_modules/zustand/esm/react/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallow(selector: (state: S) => U): (state: S) => U; diff --git a/node_modules/zustand/esm/react/shallow.js b/node_modules/zustand/esm/react/shallow.js deleted file mode 100644 index 9edd794..0000000 --- a/node_modules/zustand/esm/react/shallow.js +++ /dev/null @@ -1,51 +0,0 @@ -import ReactExports from 'react'; - -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -const { useRef } = ReactExports; -function useShallow(selector) { - const prev = useRef(); - return (state) => { - const next = selector(state); - return shallow(prev.current, next) ? prev.current : prev.current = next; - }; -} - -export { useShallow }; diff --git a/node_modules/zustand/esm/react/shallow.mjs b/node_modules/zustand/esm/react/shallow.mjs deleted file mode 100644 index 9edd794..0000000 --- a/node_modules/zustand/esm/react/shallow.mjs +++ /dev/null @@ -1,51 +0,0 @@ -import ReactExports from 'react'; - -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -const { useRef } = ReactExports; -function useShallow(selector) { - const prev = useRef(); - return (state) => { - const next = selector(state); - return shallow(prev.current, next) ? prev.current : prev.current = next; - }; -} - -export { useShallow }; diff --git a/node_modules/zustand/esm/shallow.d.mts b/node_modules/zustand/esm/shallow.d.mts deleted file mode 100644 index 61c347b..0000000 --- a/node_modules/zustand/esm/shallow.d.mts +++ /dev/null @@ -1,7 +0,0 @@ -import { shallow } from './vanilla/shallow.mjs'; -/** - * @deprecated Use `import { shallow } from 'zustand/shallow'` - */ -declare const _default: typeof shallow; -export default _default; -export { shallow }; diff --git a/node_modules/zustand/esm/shallow.d.ts b/node_modules/zustand/esm/shallow.d.ts deleted file mode 100644 index 0914a7c..0000000 --- a/node_modules/zustand/esm/shallow.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { shallow } from './vanilla/shallow'; -/** - * @deprecated Use `import { shallow } from 'zustand/shallow'` - */ -declare const _default: typeof shallow; -export default _default; -export { shallow }; diff --git a/node_modules/zustand/esm/shallow.js b/node_modules/zustand/esm/shallow.js deleted file mode 100644 index f5535f6..0000000 --- a/node_modules/zustand/esm/shallow.js +++ /dev/null @@ -1,49 +0,0 @@ -function shallow$1(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -var shallow = (objA, objB) => { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`." - ); - } - return shallow$1(objA, objB); -}; - -export { shallow as default, shallow$1 as shallow }; diff --git a/node_modules/zustand/esm/shallow.mjs b/node_modules/zustand/esm/shallow.mjs deleted file mode 100644 index 167be1f..0000000 --- a/node_modules/zustand/esm/shallow.mjs +++ /dev/null @@ -1,49 +0,0 @@ -function shallow$1(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -var shallow = (objA, objB) => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`." - ); - } - return shallow$1(objA, objB); -}; - -export { shallow as default, shallow$1 as shallow }; diff --git a/node_modules/zustand/esm/traditional.d.mts b/node_modules/zustand/esm/traditional.d.mts deleted file mode 100644 index 3e8e2d7..0000000 --- a/node_modules/zustand/esm/traditional.d.mts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla.mjs'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStoreWithEqualityFn>>(api: S): ExtractState; -export declare function useStoreWithEqualityFn>, U>(api: S, selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -export type UseBoundStoreWithEqualityFn>> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -} & S; -type CreateWithEqualityFn = { - (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean): UseBoundStoreWithEqualityFn, Mos>>; - (): (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn, Mos>>; -}; -export declare const createWithEqualityFn: CreateWithEqualityFn; -export {}; diff --git a/node_modules/zustand/esm/traditional.d.ts b/node_modules/zustand/esm/traditional.d.ts deleted file mode 100644 index c1fdd54..0000000 --- a/node_modules/zustand/esm/traditional.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStoreWithEqualityFn>>(api: S): ExtractState; -export declare function useStoreWithEqualityFn>, U>(api: S, selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -export type UseBoundStoreWithEqualityFn>> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -} & S; -type CreateWithEqualityFn = { - (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean): UseBoundStoreWithEqualityFn, Mos>>; - (): (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn, Mos>>; -}; -export declare const createWithEqualityFn: CreateWithEqualityFn; -export {}; diff --git a/node_modules/zustand/esm/traditional.js b/node_modules/zustand/esm/traditional.js deleted file mode 100644 index 90de5c4..0000000 --- a/node_modules/zustand/esm/traditional.js +++ /dev/null @@ -1,26 +0,0 @@ -import ReactExports from 'react'; -import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js'; -import { createStore } from 'zustand/vanilla'; - -const { useDebugValue } = ReactExports; -const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; -function useStoreWithEqualityFn(api, selector = api.getState, equalityFn) { - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; -} -const createWithEqualityFnImpl = (createState, defaultEqualityFn) => { - const api = createStore(createState); - const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn); - Object.assign(useBoundStoreWithEqualityFn, api); - return useBoundStoreWithEqualityFn; -}; -const createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl; - -export { createWithEqualityFn, useStoreWithEqualityFn }; diff --git a/node_modules/zustand/esm/traditional.mjs b/node_modules/zustand/esm/traditional.mjs deleted file mode 100644 index 90de5c4..0000000 --- a/node_modules/zustand/esm/traditional.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import ReactExports from 'react'; -import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js'; -import { createStore } from 'zustand/vanilla'; - -const { useDebugValue } = ReactExports; -const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; -function useStoreWithEqualityFn(api, selector = api.getState, equalityFn) { - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; -} -const createWithEqualityFnImpl = (createState, defaultEqualityFn) => { - const api = createStore(createState); - const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn); - Object.assign(useBoundStoreWithEqualityFn, api); - return useBoundStoreWithEqualityFn; -}; -const createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl; - -export { createWithEqualityFn, useStoreWithEqualityFn }; diff --git a/node_modules/zustand/esm/vanilla.d.mts b/node_modules/zustand/esm/vanilla.d.mts deleted file mode 100644 index 165e87b..0000000 --- a/node_modules/zustand/esm/vanilla.d.mts +++ /dev/null @@ -1,80 +0,0 @@ -type SetStateInternal = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -export interface StoreApi { - setState: SetStateInternal; - getState: () => T; - subscribe: (listener: (state: T, prevState: T) => void) => () => void; - /** - * @deprecated Use `unsubscribe` returned by `subscribe` - */ - destroy: () => void; -} -type Get = K extends keyof T ? T[K] : F; -export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; -export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { - $$storeMutators?: Mos; -}; -export interface StoreMutators { -} -export type StoreMutatorIdentifier = keyof StoreMutators; -type CreateStore = { - (initializer: StateCreator): Mutate, Mos>; - (): (initializer: StateCreator) => Mutate, Mos>; -}; -export declare const createStore: CreateStore; -/** - * @deprecated Use `import { createStore } from 'zustand/vanilla'` - */ -declare const _default: CreateStore; -export default _default; -/** - * @deprecated Use `unknown` instead of `State` - */ -export type State = unknown; -/** - * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` - */ -export type PartialState = Partial | ((state: T) => Partial); -/** - * @deprecated Use `(s: T) => U` instead of `StateSelector` - */ -export type StateSelector = (state: T) => U; -/** - * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` - */ -export type EqualityChecker = (state: T, newState: T) => boolean; -/** - * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` - */ -export type StateListener = (state: T, previousState: T) => void; -/** - * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. - */ -export type StateSliceListener = (slice: T, previousSlice: T) => void; -/** - * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. - */ -export type Subscribe = { - (listener: (state: T, previousState: T) => void): () => void; -}; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['setState']` instead of `SetState`. - */ -export type SetState = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['getState']` instead of `GetState`. - */ -export type GetState = () => T; -/** - * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. - */ -export type Destroy = () => void; diff --git a/node_modules/zustand/esm/vanilla.d.ts b/node_modules/zustand/esm/vanilla.d.ts deleted file mode 100644 index 165e87b..0000000 --- a/node_modules/zustand/esm/vanilla.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -type SetStateInternal = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -export interface StoreApi { - setState: SetStateInternal; - getState: () => T; - subscribe: (listener: (state: T, prevState: T) => void) => () => void; - /** - * @deprecated Use `unsubscribe` returned by `subscribe` - */ - destroy: () => void; -} -type Get = K extends keyof T ? T[K] : F; -export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; -export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { - $$storeMutators?: Mos; -}; -export interface StoreMutators { -} -export type StoreMutatorIdentifier = keyof StoreMutators; -type CreateStore = { - (initializer: StateCreator): Mutate, Mos>; - (): (initializer: StateCreator) => Mutate, Mos>; -}; -export declare const createStore: CreateStore; -/** - * @deprecated Use `import { createStore } from 'zustand/vanilla'` - */ -declare const _default: CreateStore; -export default _default; -/** - * @deprecated Use `unknown` instead of `State` - */ -export type State = unknown; -/** - * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` - */ -export type PartialState = Partial | ((state: T) => Partial); -/** - * @deprecated Use `(s: T) => U` instead of `StateSelector` - */ -export type StateSelector = (state: T) => U; -/** - * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` - */ -export type EqualityChecker = (state: T, newState: T) => boolean; -/** - * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` - */ -export type StateListener = (state: T, previousState: T) => void; -/** - * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. - */ -export type StateSliceListener = (slice: T, previousSlice: T) => void; -/** - * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. - */ -export type Subscribe = { - (listener: (state: T, previousState: T) => void): () => void; -}; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['setState']` instead of `SetState`. - */ -export type SetState = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['getState']` instead of `GetState`. - */ -export type GetState = () => T; -/** - * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. - */ -export type Destroy = () => void; diff --git a/node_modules/zustand/esm/vanilla.js b/node_modules/zustand/esm/vanilla.js deleted file mode 100644 index 96bbeca..0000000 --- a/node_modules/zustand/esm/vanilla.js +++ /dev/null @@ -1,39 +0,0 @@ -const createStoreImpl = (createState) => { - let state; - const listeners = /* @__PURE__ */ new Set(); - const setState = (partial, replace) => { - const nextState = typeof partial === "function" ? partial(state) : partial; - if (!Object.is(nextState, state)) { - const previousState = state; - state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState); - listeners.forEach((listener) => listener(state, previousState)); - } - }; - const getState = () => state; - const subscribe = (listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }; - const destroy = () => { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." - ); - } - listeners.clear(); - }; - const api = { setState, getState, subscribe, destroy }; - state = createState(setState, getState, api); - return api; -}; -const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl; -var vanilla = (createState) => { - if (process.env.NODE_ENV !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'." - ); - } - return createStore(createState); -}; - -export { createStore, vanilla as default }; diff --git a/node_modules/zustand/esm/vanilla.mjs b/node_modules/zustand/esm/vanilla.mjs deleted file mode 100644 index 8d9f240..0000000 --- a/node_modules/zustand/esm/vanilla.mjs +++ /dev/null @@ -1,39 +0,0 @@ -const createStoreImpl = (createState) => { - let state; - const listeners = /* @__PURE__ */ new Set(); - const setState = (partial, replace) => { - const nextState = typeof partial === "function" ? partial(state) : partial; - if (!Object.is(nextState, state)) { - const previousState = state; - state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState); - listeners.forEach((listener) => listener(state, previousState)); - } - }; - const getState = () => state; - const subscribe = (listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }; - const destroy = () => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." - ); - } - listeners.clear(); - }; - const api = { setState, getState, subscribe, destroy }; - state = createState(setState, getState, api); - return api; -}; -const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl; -var vanilla = (createState) => { - if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'." - ); - } - return createStore(createState); -}; - -export { createStore, vanilla as default }; diff --git a/node_modules/zustand/esm/vanilla/shallow.d.mts b/node_modules/zustand/esm/vanilla/shallow.d.mts deleted file mode 100644 index a8d2354..0000000 --- a/node_modules/zustand/esm/vanilla/shallow.d.mts +++ /dev/null @@ -1 +0,0 @@ -export declare function shallow(objA: T, objB: T): boolean; diff --git a/node_modules/zustand/esm/vanilla/shallow.d.ts b/node_modules/zustand/esm/vanilla/shallow.d.ts deleted file mode 100644 index a8d2354..0000000 --- a/node_modules/zustand/esm/vanilla/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function shallow(objA: T, objB: T): boolean; diff --git a/node_modules/zustand/esm/vanilla/shallow.js b/node_modules/zustand/esm/vanilla/shallow.js deleted file mode 100644 index d50078a..0000000 --- a/node_modules/zustand/esm/vanilla/shallow.js +++ /dev/null @@ -1,40 +0,0 @@ -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -export { shallow }; diff --git a/node_modules/zustand/esm/vanilla/shallow.mjs b/node_modules/zustand/esm/vanilla/shallow.mjs deleted file mode 100644 index d50078a..0000000 --- a/node_modules/zustand/esm/vanilla/shallow.mjs +++ /dev/null @@ -1,40 +0,0 @@ -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -export { shallow }; diff --git a/node_modules/zustand/index.d.ts b/node_modules/zustand/index.d.ts deleted file mode 100644 index 7e9c8b6..0000000 --- a/node_modules/zustand/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './vanilla'; -export * from './react'; -export { default } from './react'; diff --git a/node_modules/zustand/index.js b/node_modules/zustand/index.js deleted file mode 100644 index dcd227a..0000000 --- a/node_modules/zustand/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var vanilla = require('zustand/vanilla'); -var ReactExports = require('react'); -var useSyncExternalStoreExports = require('use-sync-external-store/shim/with-selector'); - -var useDebugValue = ReactExports.useDebugValue; -var useSyncExternalStoreWithSelector = useSyncExternalStoreExports.useSyncExternalStoreWithSelector; -var didWarnAboutEqualityFn = false; -function useStore(api, selector, equalityFn) { - if (selector === void 0) { - selector = api.getState; - } - if (process.env.NODE_ENV !== 'production' && equalityFn && !didWarnAboutEqualityFn) { - console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"); - didWarnAboutEqualityFn = true; - } - var slice = useSyncExternalStoreWithSelector(api.subscribe, api.getState, api.getServerState || api.getState, selector, equalityFn); - useDebugValue(slice); - return slice; -} -var createImpl = function createImpl(createState) { - if (process.env.NODE_ENV !== 'production' && typeof createState !== 'function') { - console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."); - } - var api = typeof createState === 'function' ? vanilla.createStore(createState) : createState; - var useBoundStore = function useBoundStore(selector, equalityFn) { - return useStore(api, selector, equalityFn); - }; - Object.assign(useBoundStore, api); - return useBoundStore; -}; -var create = function create(createState) { - return createState ? createImpl(createState) : createImpl; -}; -var react = (function (createState) { - if (process.env.NODE_ENV !== 'production') { - console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."); - } - return create(createState); -}); - -exports.create = create; -exports.default = react; -exports.useStore = useStore; -Object.keys(vanilla).forEach(function (k) { - if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { - enumerable: true, - get: function () { return vanilla[k]; } - }); -}); - -module.exports = react; -module.exports.create = create; -module.exports.useStore = useStore; -module.exports.createStore = vanilla.createStore; -exports.default = module.exports; diff --git a/node_modules/zustand/middleware.d.ts b/node_modules/zustand/middleware.d.ts deleted file mode 100644 index 1806630..0000000 --- a/node_modules/zustand/middleware.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './middleware/redux'; -export * from './middleware/devtools'; -export * from './middleware/subscribeWithSelector'; -export * from './middleware/combine'; -export * from './middleware/persist'; diff --git a/node_modules/zustand/middleware.js b/node_modules/zustand/middleware.js deleted file mode 100644 index 42da762..0000000 --- a/node_modules/zustand/middleware.js +++ /dev/null @@ -1,609 +0,0 @@ -'use strict'; - -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - return target; -} - -var reduxImpl = function reduxImpl(reducer, initial) { - return function (set, _get, api) { - api.dispatch = function (action) { - set(function (state) { - return reducer(state, action); - }, false, action); - return action; - }; - api.dispatchFromDevtools = true; - return _extends({ - dispatch: function dispatch() { - var _ref; - return (_ref = api).dispatch.apply(_ref, arguments); - } - }, initial); - }; -}; -var redux = reduxImpl; - -var _excluded = ["enabled", "anonymousActionType", "store"], - _excluded2 = ["connection"]; -var trackedConnections = new Map(); -var getTrackedConnectionState = function getTrackedConnectionState(name) { - var api = trackedConnections.get(name); - if (!api) return {}; - return Object.fromEntries(Object.entries(api.stores).map(function (_ref) { - var key = _ref[0], - api = _ref[1]; - return [key, api.getState()]; - })); -}; -var extractConnectionInformation = function extractConnectionInformation(store, extensionConnector, options) { - if (store === undefined) { - return { - type: 'untracked', - connection: extensionConnector.connect(options) - }; - } - var existingConnection = trackedConnections.get(options.name); - if (existingConnection) { - return _extends({ - type: 'tracked', - store: store - }, existingConnection); - } - var newConnection = { - connection: extensionConnector.connect(options), - stores: {} - }; - trackedConnections.set(options.name, newConnection); - return _extends({ - type: 'tracked', - store: store - }, newConnection); -}; -var devtoolsImpl = function devtoolsImpl(fn, devtoolsOptions) { - if (devtoolsOptions === void 0) { - devtoolsOptions = {}; - } - return function (set, get, api) { - var _devtoolsOptions = devtoolsOptions, - enabled = _devtoolsOptions.enabled, - anonymousActionType = _devtoolsOptions.anonymousActionType, - store = _devtoolsOptions.store, - options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded); - var extensionConnector; - try { - extensionConnector = (enabled != null ? enabled : process.env.NODE_ENV !== 'production') && window.__REDUX_DEVTOOLS_EXTENSION__; - } catch (e) {} - if (!extensionConnector) { - if (process.env.NODE_ENV !== 'production' && enabled) { - console.warn('[zustand devtools middleware] Please install/enable Redux devtools extension'); - } - return fn(set, get, api); - } - var _extractConnectionInf = extractConnectionInformation(store, extensionConnector, options), - connection = _extractConnectionInf.connection, - connectionInformation = _objectWithoutPropertiesLoose(_extractConnectionInf, _excluded2); - var isRecording = true; - api.setState = function (state, replace, nameOrAction) { - var _extends2; - var r = set(state, replace); - if (!isRecording) return r; - var action = nameOrAction === undefined ? { - type: anonymousActionType || 'anonymous' - } : typeof nameOrAction === 'string' ? { - type: nameOrAction - } : nameOrAction; - if (store === undefined) { - connection == null || connection.send(action, get()); - return r; - } - connection == null || connection.send(_extends({}, action, { - type: store + "/" + action.type - }), _extends({}, getTrackedConnectionState(options.name), (_extends2 = {}, _extends2[store] = api.getState(), _extends2))); - return r; - }; - var setStateFromDevtools = function setStateFromDevtools() { - var originalIsRecording = isRecording; - isRecording = false; - set.apply(void 0, arguments); - isRecording = originalIsRecording; - }; - var initialState = fn(api.setState, get, api); - if (connectionInformation.type === 'untracked') { - connection == null || connection.init(initialState); - } else { - connectionInformation.stores[connectionInformation.store] = api; - connection == null || connection.init(Object.fromEntries(Object.entries(connectionInformation.stores).map(function (_ref2) { - var key = _ref2[0], - store = _ref2[1]; - return [key, key === connectionInformation.store ? initialState : store.getState()]; - }))); - } - if (api.dispatchFromDevtools && typeof api.dispatch === 'function') { - var didWarnAboutReservedActionType = false; - var originalDispatch = api.dispatch; - api.dispatch = function () { - for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) { - a[_key] = arguments[_key]; - } - if (process.env.NODE_ENV !== 'production' && a[0].type === '__setState' && !didWarnAboutReservedActionType) { - console.warn('[zustand devtools middleware] "__setState" action type is reserved ' + 'to set state from the devtools. Avoid using it.'); - didWarnAboutReservedActionType = true; - } - originalDispatch.apply(void 0, a); - }; - } - connection.subscribe(function (message) { - switch (message.type) { - case 'ACTION': - if (typeof message.payload !== 'string') { - console.error('[zustand devtools middleware] Unsupported action format'); - return; - } - return parseJsonThen(message.payload, function (action) { - if (action.type === '__setState') { - if (store === undefined) { - setStateFromDevtools(action.state); - return; - } - if (Object.keys(action.state).length !== 1) { - console.error("\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n "); - } - var stateFromDevtools = action.state[store]; - if (stateFromDevtools === undefined || stateFromDevtools === null) { - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) { - setStateFromDevtools(stateFromDevtools); - } - return; - } - if (!api.dispatchFromDevtools) return; - if (typeof api.dispatch !== 'function') return; - api.dispatch(action); - }); - case 'DISPATCH': - switch (message.payload.type) { - case 'RESET': - setStateFromDevtools(initialState); - if (store === undefined) { - return connection == null ? void 0 : connection.init(api.getState()); - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case 'COMMIT': - if (store === undefined) { - connection == null || connection.init(api.getState()); - return; - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case 'ROLLBACK': - return parseJsonThen(message.state, function (state) { - if (store === undefined) { - setStateFromDevtools(state); - connection == null || connection.init(api.getState()); - return; - } - setStateFromDevtools(state[store]); - connection == null || connection.init(getTrackedConnectionState(options.name)); - }); - case 'JUMP_TO_STATE': - case 'JUMP_TO_ACTION': - return parseJsonThen(message.state, function (state) { - if (store === undefined) { - setStateFromDevtools(state); - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) { - setStateFromDevtools(state[store]); - } - }); - case 'IMPORT_STATE': - { - var _nextLiftedState$comp; - var nextLiftedState = message.payload.nextLiftedState; - var lastComputedState = (_nextLiftedState$comp = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _nextLiftedState$comp.state; - if (!lastComputedState) return; - if (store === undefined) { - setStateFromDevtools(lastComputedState); - } else { - setStateFromDevtools(lastComputedState[store]); - } - connection == null || connection.send(null, nextLiftedState); - return; - } - case 'PAUSE_RECORDING': - return isRecording = !isRecording; - } - return; - } - }); - return initialState; - }; -}; -var devtools = devtoolsImpl; -var parseJsonThen = function parseJsonThen(stringified, f) { - var parsed; - try { - parsed = JSON.parse(stringified); - } catch (e) { - console.error('[zustand devtools middleware] Could not parse the received json', e); - } - if (parsed !== undefined) f(parsed); -}; - -var subscribeWithSelectorImpl = function subscribeWithSelectorImpl(fn) { - return function (set, get, api) { - var origSubscribe = api.subscribe; - api.subscribe = function (selector, optListener, options) { - var listener = selector; - if (optListener) { - var equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; - var currentSlice = selector(api.getState()); - listener = function listener(state) { - var nextSlice = selector(state); - if (!equalityFn(currentSlice, nextSlice)) { - var previousSlice = currentSlice; - optListener(currentSlice = nextSlice, previousSlice); - } - }; - if (options != null && options.fireImmediately) { - optListener(currentSlice, currentSlice); - } - } - return origSubscribe(listener); - }; - var initialState = fn(set, get, api); - return initialState; - }; -}; -var subscribeWithSelector = subscribeWithSelectorImpl; - -var combine = function combine(initialState, create) { - return function () { - return Object.assign({}, initialState, create.apply(void 0, arguments)); - }; -}; - -function createJSONStorage(getStorage, options) { - var storage; - try { - storage = getStorage(); - } catch (e) { - return; - } - var persistStorage = { - getItem: function getItem(name) { - var _getItem; - var parse = function parse(str) { - if (str === null) { - return null; - } - return JSON.parse(str, options == null ? void 0 : options.reviver); - }; - var str = (_getItem = storage.getItem(name)) != null ? _getItem : null; - if (str instanceof Promise) { - return str.then(parse); - } - return parse(str); - }, - setItem: function setItem(name, newValue) { - return storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)); - }, - removeItem: function removeItem(name) { - return storage.removeItem(name); - } - }; - return persistStorage; -} -var toThenable = function toThenable(fn) { - return function (input) { - try { - var result = fn(input); - if (result instanceof Promise) { - return result; - } - return { - then: function then(onFulfilled) { - return toThenable(onFulfilled)(result); - }, - catch: function _catch(_onRejected) { - return this; - } - }; - } catch (e) { - return { - then: function then(_onFulfilled) { - return this; - }, - catch: function _catch(onRejected) { - return toThenable(onRejected)(e); - } - }; - } - }; -}; -var oldImpl = function oldImpl(config, baseOptions) { - return function (set, get, api) { - var options = _extends({ - getStorage: function getStorage() { - return localStorage; - }, - serialize: JSON.stringify, - deserialize: JSON.parse, - partialize: function partialize(state) { - return state; - }, - version: 0, - merge: function merge(persistedState, currentState) { - return _extends({}, currentState, persistedState); - } - }, baseOptions); - var _hasHydrated = false; - var hydrationListeners = new Set(); - var finishHydrationListeners = new Set(); - var storage; - try { - storage = options.getStorage(); - } catch (e) {} - if (!storage) { - return config(function () { - console.warn("[zustand persist middleware] Unable to update item '" + options.name + "', the given storage is currently unavailable."); - set.apply(void 0, arguments); - }, get, api); - } - var thenableSerialize = toThenable(options.serialize); - var setItem = function setItem() { - var state = options.partialize(_extends({}, get())); - var errorInSync; - var thenable = thenableSerialize({ - state: state, - version: options.version - }).then(function (serializedValue) { - return storage.setItem(options.name, serializedValue); - }).catch(function (e) { - errorInSync = e; - }); - if (errorInSync) { - throw errorInSync; - } - return thenable; - }; - var savedSetState = api.setState; - api.setState = function (state, replace) { - savedSetState(state, replace); - void setItem(); - }; - var configResult = config(function () { - set.apply(void 0, arguments); - void setItem(); - }, get, api); - var stateFromStorage; - var hydrate = function hydrate() { - if (!storage) return; - _hasHydrated = false; - hydrationListeners.forEach(function (cb) { - return cb(get()); - }); - var postRehydrationCallback = (options.onRehydrateStorage == null ? void 0 : options.onRehydrateStorage(get())) || undefined; - return toThenable(storage.getItem.bind(storage))(options.name).then(function (storageValue) { - if (storageValue) { - return options.deserialize(storageValue); - } - }).then(function (deserializedStorageValue) { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === 'number' && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate(deserializedStorageValue.state, deserializedStorageValue.version); - } - console.error("State loaded from storage couldn't be migrated since no migrate function was provided"); - } else { - return deserializedStorageValue.state; - } - } - }).then(function (migratedState) { - var _get; - stateFromStorage = options.merge(migratedState, (_get = get()) != null ? _get : configResult); - set(stateFromStorage, true); - return setItem(); - }).then(function () { - postRehydrationCallback == null || postRehydrationCallback(stateFromStorage, undefined); - _hasHydrated = true; - finishHydrationListeners.forEach(function (cb) { - return cb(stateFromStorage); - }); - }).catch(function (e) { - postRehydrationCallback == null || postRehydrationCallback(undefined, e); - }); - }; - api.persist = { - setOptions: function setOptions(newOptions) { - options = _extends({}, options, newOptions); - if (newOptions.getStorage) { - storage = newOptions.getStorage(); - } - }, - clearStorage: function clearStorage() { - var _storage; - (_storage = storage) == null || _storage.removeItem(options.name); - }, - getOptions: function getOptions() { - return options; - }, - rehydrate: function rehydrate() { - return hydrate(); - }, - hasHydrated: function hasHydrated() { - return _hasHydrated; - }, - onHydrate: function onHydrate(cb) { - hydrationListeners.add(cb); - return function () { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: function onFinishHydration(cb) { - finishHydrationListeners.add(cb); - return function () { - finishHydrationListeners.delete(cb); - }; - } - }; - hydrate(); - return stateFromStorage || configResult; - }; -}; -var newImpl = function newImpl(config, baseOptions) { - return function (set, get, api) { - var options = _extends({ - storage: createJSONStorage(function () { - return localStorage; - }), - partialize: function partialize(state) { - return state; - }, - version: 0, - merge: function merge(persistedState, currentState) { - return _extends({}, currentState, persistedState); - } - }, baseOptions); - var _hasHydrated2 = false; - var hydrationListeners = new Set(); - var finishHydrationListeners = new Set(); - var storage = options.storage; - if (!storage) { - return config(function () { - console.warn("[zustand persist middleware] Unable to update item '" + options.name + "', the given storage is currently unavailable."); - set.apply(void 0, arguments); - }, get, api); - } - var setItem = function setItem() { - var state = options.partialize(_extends({}, get())); - return storage.setItem(options.name, { - state: state, - version: options.version - }); - }; - var savedSetState = api.setState; - api.setState = function (state, replace) { - savedSetState(state, replace); - void setItem(); - }; - var configResult = config(function () { - set.apply(void 0, arguments); - void setItem(); - }, get, api); - var stateFromStorage; - var hydrate = function hydrate() { - var _get3; - if (!storage) return; - _hasHydrated2 = false; - hydrationListeners.forEach(function (cb) { - var _get2; - return cb((_get2 = get()) != null ? _get2 : configResult); - }); - var postRehydrationCallback = (options.onRehydrateStorage == null ? void 0 : options.onRehydrateStorage((_get3 = get()) != null ? _get3 : configResult)) || undefined; - return toThenable(storage.getItem.bind(storage))(options.name).then(function (deserializedStorageValue) { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === 'number' && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate(deserializedStorageValue.state, deserializedStorageValue.version); - } - console.error("State loaded from storage couldn't be migrated since no migrate function was provided"); - } else { - return deserializedStorageValue.state; - } - } - }).then(function (migratedState) { - var _get4; - stateFromStorage = options.merge(migratedState, (_get4 = get()) != null ? _get4 : configResult); - set(stateFromStorage, true); - return setItem(); - }).then(function () { - postRehydrationCallback == null || postRehydrationCallback(stateFromStorage, undefined); - stateFromStorage = get(); - _hasHydrated2 = true; - finishHydrationListeners.forEach(function (cb) { - return cb(stateFromStorage); - }); - }).catch(function (e) { - postRehydrationCallback == null || postRehydrationCallback(undefined, e); - }); - }; - api.persist = { - setOptions: function setOptions(newOptions) { - options = _extends({}, options, newOptions); - if (newOptions.storage) { - storage = newOptions.storage; - } - }, - clearStorage: function clearStorage() { - var _storage2; - (_storage2 = storage) == null || _storage2.removeItem(options.name); - }, - getOptions: function getOptions() { - return options; - }, - rehydrate: function rehydrate() { - return hydrate(); - }, - hasHydrated: function hasHydrated() { - return _hasHydrated2; - }, - onHydrate: function onHydrate(cb) { - hydrationListeners.add(cb); - return function () { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: function onFinishHydration(cb) { - finishHydrationListeners.add(cb); - return function () { - finishHydrationListeners.delete(cb); - }; - } - }; - if (!options.skipHydration) { - hydrate(); - } - return stateFromStorage || configResult; - }; -}; -var persistImpl = function persistImpl(config, baseOptions) { - if ('getStorage' in baseOptions || 'serialize' in baseOptions || 'deserialize' in baseOptions) { - if (process.env.NODE_ENV !== 'production') { - console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.'); - } - return oldImpl(config, baseOptions); - } - return newImpl(config, baseOptions); -}; -var persist = persistImpl; - -exports.combine = combine; -exports.createJSONStorage = createJSONStorage; -exports.devtools = devtools; -exports.persist = persist; -exports.redux = redux; -exports.subscribeWithSelector = subscribeWithSelector; diff --git a/node_modules/zustand/middleware/combine.d.ts b/node_modules/zustand/middleware/combine.d.ts deleted file mode 100644 index 6e9d2d1..0000000 --- a/node_modules/zustand/middleware/combine.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Omit & U; -type Combine = (initialState: T, additionalStateCreator: StateCreator) => StateCreator, Mps, Mcs>; -export declare const combine: Combine; -export {}; diff --git a/node_modules/zustand/middleware/devtools.d.ts b/node_modules/zustand/middleware/devtools.d.ts deleted file mode 100644 index 34489bd..0000000 --- a/node_modules/zustand/middleware/devtools.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla'; -type Config = Parameters<(Window extends { - __REDUX_DEVTOOLS_EXTENSION__?: infer T; -} ? T : { - connect: (param: any) => any; -})['connect']>[0]; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -type Cast = T extends U ? T : U; -type Write = Omit & U; -type TakeTwo = T extends { - length: 0; -} ? [undefined, undefined] : T extends { - length: 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 0 | 1; -} ? [...a0: Cast, a1: undefined] : T extends { - length: 2; -} ? T : T extends { - length: 1 | 2; -} ? T : T extends { - length: 0 | 1 | 2; -} ? T : T extends [infer A0, infer A1, ...unknown[]] ? [A0, A1] : T extends [infer A0, (infer A1)?, ...unknown[]] ? [A0, A1?] : T extends [(infer A0)?, (infer A1)?, ...unknown[]] ? [A0?, A1?] : never; -type WithDevtools = Write>; -type StoreDevtools = S extends { - setState: (...a: infer Sa) => infer Sr; -} ? { - setState(...a: [...a: TakeTwo, action?: A]): Sr; -} : never; -export interface DevtoolsOptions extends Config { - name?: string; - enabled?: boolean; - anonymousActionType?: string; - store?: string; -} -type Devtools = (initializer: StateCreator, devtoolsOptions?: DevtoolsOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -export type NamedSet = WithDevtools>['setState']; -export declare const devtools: Devtools; -export {}; diff --git a/node_modules/zustand/middleware/immer.d.ts b/node_modules/zustand/middleware/immer.d.ts deleted file mode 100644 index e770ab3..0000000 --- a/node_modules/zustand/middleware/immer.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Draft } from 'immer'; -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Immer = (initializer: StateCreator) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/immer']: WithImmer; - } -} -type Write = Omit & U; -type SkipTwo = T extends { - length: 0; -} ? [] : T extends { - length: 1; -} ? [] : T extends { - length: 0 | 1; -} ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never; -type WithImmer = Write>; -type StoreImmer = S extends { - getState: () => infer T; - setState: infer SetState; -} ? SetState extends (...a: infer A) => infer Sr ? { - setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; -} : never : never; -export declare const immer: Immer; -export {}; diff --git a/node_modules/zustand/middleware/immer.js b/node_modules/zustand/middleware/immer.js deleted file mode 100644 index d01990c..0000000 --- a/node_modules/zustand/middleware/immer.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var immer$1 = require('immer'); - -var immerImpl = function immerImpl(initializer) { - return function (set, get, store) { - store.setState = function (updater, replace) { - var nextState = typeof updater === 'function' ? immer$1.produce(updater) : updater; - for (var _len = arguments.length, a = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - a[_key - 2] = arguments[_key]; - } - return set.apply(void 0, [nextState, replace].concat(a)); - }; - return initializer(store.setState, get, store); - }; -}; -var immer = immerImpl; - -exports.immer = immer; diff --git a/node_modules/zustand/middleware/persist.d.ts b/node_modules/zustand/middleware/persist.d.ts deleted file mode 100644 index 829951c..0000000 --- a/node_modules/zustand/middleware/persist.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -export interface StateStorage { - getItem: (name: string) => string | null | Promise; - setItem: (name: string, value: string) => void | Promise; - removeItem: (name: string) => void | Promise; -} -export type StorageValue = { - state: S; - version?: number; -}; -export interface PersistStorage { - getItem: (name: string) => StorageValue | null | Promise | null>; - setItem: (name: string, value: StorageValue) => void | Promise; - removeItem: (name: string) => void | Promise; -} -type JsonStorageOptions = { - reviver?: (key: string, value: unknown) => unknown; - replacer?: (key: string, value: unknown) => unknown; -}; -export declare function createJSONStorage(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage | undefined; -export interface PersistOptions { - /** Name of the storage (must be unique) */ - name: string; - /** - * @deprecated Use `storage` instead. - * A function returning a storage. - * The storage must fit `window.localStorage`'s api (or an async version of it). - * For example the storage could be `AsyncStorage` from React Native. - * - * @default () => localStorage - */ - getStorage?: () => StateStorage; - /** - * @deprecated Use `storage` instead. - * Use a custom serializer. - * The returned string will be stored in the storage. - * - * @default JSON.stringify - */ - serialize?: (state: StorageValue) => string | Promise; - /** - * @deprecated Use `storage` instead. - * Use a custom deserializer. - * Must return an object matching StorageValue - * - * @param str The storage's current value. - * @default JSON.parse - */ - deserialize?: (str: string) => StorageValue | Promise>; - /** - * Use a custom persist storage. - * - * Combining `createJSONStorage` helps creating a persist storage - * with JSON.parse and JSON.stringify. - * - * @default createJSONStorage(() => localStorage) - */ - storage?: PersistStorage | undefined; - /** - * Filter the persisted value. - * - * @params state The state's value - */ - partialize?: (state: S) => PersistedState; - /** - * A function returning another (optional) function. - * The main function will be called before the state rehydration. - * The returned function will be called after the state rehydration or when an error occurred. - */ - onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void; - /** - * If the stored state's version mismatch the one specified here, the storage will not be used. - * This is useful when adding a breaking change to your store. - */ - version?: number; - /** - * A function to perform persisted state migration. - * This function will be called when persisted state versions mismatch with the one specified here. - */ - migrate?: (persistedState: unknown, version: number) => S | Promise; - /** - * A function to perform custom hydration merges when combining the stored state with the current one. - * By default, this function does a shallow merge. - */ - merge?: (persistedState: unknown, currentState: S) => S; - /** - * An optional boolean that will prevent the persist middleware from triggering hydration on initialization, - * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle. - * - * This is useful in SSR application. - * - * @default false - */ - skipHydration?: boolean; -} -type PersistListener = (state: S) => void; -type StorePersist = { - persist: { - setOptions: (options: Partial>) => void; - clearStorage: () => void; - rehydrate: () => Promise | void; - hasHydrated: () => boolean; - onHydrate: (fn: PersistListener) => () => void; - onFinishHydration: (fn: PersistListener) => () => void; - getOptions: () => Partial>; - }; -}; -type Persist = (initializer: StateCreator, options: PersistOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/persist': WithPersist; - } -} -type Write = Omit & U; -type WithPersist = S extends { - getState: () => infer T; -} ? Write> : never; -export declare const persist: Persist; -export {}; diff --git a/node_modules/zustand/middleware/redux.d.ts b/node_modules/zustand/middleware/redux.d.ts deleted file mode 100644 index 41a61e1..0000000 --- a/node_modules/zustand/middleware/redux.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Omit & U; -type Action = { - type: string; -}; -type StoreRedux = { - dispatch: (a: A) => A; - dispatchFromDevtools: true; -}; -type ReduxState = { - dispatch: StoreRedux['dispatch']; -}; -type WithRedux = Write>; -type Redux = (reducer: (state: T, action: A) => T, initialState: T) => StateCreator>, Cms, [['zustand/redux', A]]>; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/redux': WithRedux; - } -} -export declare const redux: Redux; -export {}; diff --git a/node_modules/zustand/middleware/subscribeWithSelector.d.ts b/node_modules/zustand/middleware/subscribeWithSelector.d.ts deleted file mode 100644 index 3243f26..0000000 --- a/node_modules/zustand/middleware/subscribeWithSelector.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type SubscribeWithSelector = (initializer: StateCreator) => StateCreator; -type Write = Omit & U; -type WithSelectorSubscribe = S extends { - getState: () => infer T; -} ? Write> : never; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/subscribeWithSelector']: WithSelectorSubscribe; - } -} -type StoreSubscribeWithSelector = { - subscribe: { - (listener: (selectedState: T, previousSelectedState: T) => void): () => void; - (selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { - equalityFn?: (a: U, b: U) => boolean; - fireImmediately?: boolean; - }): () => void; - }; -}; -export declare const subscribeWithSelector: SubscribeWithSelector; -export {}; diff --git a/node_modules/zustand/package.json b/node_modules/zustand/package.json deleted file mode 100644 index abb2f64..0000000 --- a/node_modules/zustand/package.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "name": "zustand", - "private": false, - "version": "4.4.7", - "description": "🐻 Bear necessities for state management in React", - "main": "./index.js", - "types": "./index.d.ts", - "typesVersions": { - "<4.0": { - "esm/*": [ - "ts3.4/*" - ], - "*": [ - "ts3.4/*" - ] - } - }, - "files": [ - "**" - ], - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./esm/index.d.mts", - "default": "./esm/index.mjs" - }, - "module": { - "types": "./esm/index.d.ts", - "default": "./esm/index.js" - }, - "default": { - "types": "./index.d.ts", - "default": "./index.js" - } - }, - "./vanilla": { - "import": { - "types": "./esm/vanilla.d.mts", - "default": "./esm/vanilla.mjs" - }, - "module": { - "types": "./esm/vanilla.d.ts", - "default": "./esm/vanilla.js" - }, - "default": { - "types": "./vanilla.d.ts", - "default": "./vanilla.js" - } - }, - "./middleware": { - "import": { - "types": "./esm/middleware.d.mts", - "default": "./esm/middleware.mjs" - }, - "module": { - "types": "./esm/middleware.d.ts", - "default": "./esm/middleware.js" - }, - "default": { - "types": "./middleware.d.ts", - "default": "./middleware.js" - } - }, - "./middleware/immer": { - "import": { - "types": "./esm/middleware/immer.d.mts", - "default": "./esm/middleware/immer.mjs" - }, - "module": { - "types": "./esm/middleware/immer.d.ts", - "default": "./esm/middleware/immer.js" - }, - "default": { - "types": "./middleware/immer.d.ts", - "default": "./middleware/immer.js" - } - }, - "./shallow": { - "import": { - "types": "./esm/shallow.d.mts", - "default": "./esm/shallow.mjs" - }, - "module": { - "types": "./esm/shallow.d.ts", - "default": "./esm/shallow.js" - }, - "default": { - "types": "./shallow.d.ts", - "default": "./shallow.js" - } - }, - "./vanilla/shallow": { - "import": { - "types": "./esm/vanilla/shallow.d.mts", - "default": "./esm/vanilla/shallow.mjs" - }, - "module": { - "types": "./esm/vanilla/shallow.d.ts", - "default": "./esm/vanilla/shallow.js" - }, - "default": { - "types": "./vanilla/shallow.d.ts", - "default": "./vanilla/shallow.js" - } - }, - "./react/shallow": { - "import": { - "types": "./esm/react/shallow.d.mts", - "default": "./esm/react/shallow.mjs" - }, - "module": { - "types": "./esm/react/shallow.d.ts", - "default": "./esm/react/shallow.js" - }, - "default": { - "types": "./react/shallow.d.ts", - "default": "./react/shallow.js" - } - }, - "./traditional": { - "import": { - "types": "./esm/traditional.d.mts", - "default": "./esm/traditional.mjs" - }, - "module": { - "types": "./esm/traditional.d.ts", - "default": "./esm/traditional.js" - }, - "default": { - "types": "./traditional.d.ts", - "default": "./traditional.js" - } - }, - "./context": { - "import": { - "types": "./esm/context.d.mts", - "default": "./esm/context.mjs" - }, - "module": { - "types": "./esm/context.d.ts", - "default": "./esm/context.js" - }, - "default": { - "types": "./context.d.ts", - "default": "./context.js" - } - } - }, - "sideEffects": false, - "engines": { - "node": ">=12.7.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/pmndrs/zustand.git" - }, - "keywords": [ - "react", - "state", - "manager", - "management", - "redux", - "store" - ], - "author": "Paul Henschel", - "contributors": [ - "Jeremy Holcomb (https://github.com/JeremyRH)", - "Daishi Kato (https://github.com/dai-shi)" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/pmndrs/zustand/issues" - }, - "homepage": "https://github.com/pmndrs/zustand", - "dependencies": { - "use-sync-external-store": "1.2.0" - }, - "peerDependencies": { - "immer": ">=9.0", - "@types/react": ">=16.8", - "react": ">=16.8" - }, - "peerDependenciesMeta": { - "immer": { - "optional": true - }, - "@types/react": { - "optional": true - }, - "react": { - "optional": true - } - }, - "resolutions": { - "vite": "4.5.0" - } -} diff --git a/node_modules/zustand/react.d.ts b/node_modules/zustand/react.d.ts deleted file mode 100644 index 5076d12..0000000 --- a/node_modules/zustand/react.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStore>>(api: S): ExtractState; -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U): U; -/** - * @deprecated Use `useStoreWithEqualityFn` from 'zustand/traditional' - * https://github.com/pmndrs/zustand/discussions/1937 - */ -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U, equalityFn: ((a: U, b: U) => boolean) | undefined): U; -export type UseBoundStore>> = { - (): ExtractState; - (selector: (state: ExtractState) => U): U; - /** - * @deprecated Use `createWithEqualityFn` from 'zustand/traditional' - */ - (selector: (state: ExtractState) => U, equalityFn: (a: U, b: U) => boolean): U; -} & S; -type Create = { - (initializer: StateCreator): UseBoundStore, Mos>>; - (): (initializer: StateCreator) => UseBoundStore, Mos>>; - /** - * @deprecated Use `useStore` hook to bind store - */ - >(store: S): UseBoundStore; -}; -export declare const create: Create; -/** - * @deprecated Use `import { create } from 'zustand'` - */ -declare const _default: Create; -export default _default; diff --git a/node_modules/zustand/react/shallow.d.ts b/node_modules/zustand/react/shallow.d.ts deleted file mode 100644 index 9068d46..0000000 --- a/node_modules/zustand/react/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallow(selector: (state: S) => U): (state: S) => U; diff --git a/node_modules/zustand/react/shallow.js b/node_modules/zustand/react/shallow.js deleted file mode 100644 index 04adb7c..0000000 --- a/node_modules/zustand/react/shallow.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var ReactExports = require('react'); - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; -} -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -var useRef = ReactExports.useRef; -function useShallow(selector) { - var prev = useRef(); - return function (state) { - var next = selector(state); - return shallow(prev.current, next) ? prev.current : prev.current = next; - }; -} - -exports.useShallow = useShallow; diff --git a/node_modules/zustand/readme.md b/node_modules/zustand/readme.md deleted file mode 100644 index 1a1b3fd..0000000 --- a/node_modules/zustand/readme.md +++ /dev/null @@ -1,530 +0,0 @@ -

- -

- -[![Build Status](https://img.shields.io/github/actions/workflow/status/pmndrs/zustand/lint-and-type.yml?branch=main&style=flat&colorA=000000&colorB=000000)](https://github.com/pmndrs/zustand/actions?query=workflow%3ALint) -[![Build Size](https://img.shields.io/bundlephobia/minzip/zustand?label=bundle%20size&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/result?p=zustand) -[![Version](https://img.shields.io/npm/v/zustand?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/zustand) -[![Downloads](https://img.shields.io/npm/dt/zustand.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/zustand) -[![Discord Shield](https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff)](https://discord.gg/poimandres) - -A small, fast and scalable bearbones state-management solution using simplified flux principles. Has a comfy API based on hooks, isn't boilerplatey or opinionated. - -Don't disregard it because it's cute. It has quite the claws, lots of time was spent dealing with common pitfalls, like the dreaded [zombie child problem](https://react-redux.js.org/api/hooks#stale-props-and-zombie-children), [react concurrency](https://github.com/bvaughn/rfcs/blob/useMutableSource/text/0000-use-mutable-source.md), and [context loss](https://github.com/facebook/react/issues/13332) between mixed renderers. It may be the one state-manager in the React space that gets all of these right. - -You can try a live demo [here](https://githubbox.com/pmndrs/zustand/tree/main/examples/demo). - -```bash -npm install zustand # or yarn add zustand or pnpm add zustand -``` - -:warning: This readme is written for JavaScript users. If you are a TypeScript user, be sure to check out our [TypeScript Usage section](#typescript-usage). - -## First create a store - -Your store is a hook! You can put anything in it: primitives, objects, functions. State has to be updated immutably and the `set` function [merges state](./docs/guides/immutable-state-and-merging.md) to help it. - -```jsx -import { create } from 'zustand' - -const useBearStore = create((set) => ({ - bears: 0, - increasePopulation: () => set((state) => ({ bears: state.bears + 1 })), - removeAllBears: () => set({ bears: 0 }), -})) -``` - -## Then bind your components, and that's it! - -Use the hook anywhere, no providers are needed. Select your state and the component will re-render on changes. - -```jsx -function BearCounter() { - const bears = useBearStore((state) => state.bears) - return

{bears} around here ...

-} - -function Controls() { - const increasePopulation = useBearStore((state) => state.increasePopulation) - return -} -``` - -### Why zustand over redux? - -- Simple and un-opinionated -- Makes hooks the primary means of consuming state -- Doesn't wrap your app in context providers -- [Can inform components transiently (without causing render)](#transient-updates-for-often-occurring-state-changes) - -### Why zustand over context? - -- Less boilerplate -- Renders components only on changes -- Centralized, action-based state management - ---- - -# Recipes - -## Fetching everything - -You can, but bear in mind that it will cause the component to update on every state change! - -```jsx -const state = useBearStore() -``` - -## Selecting multiple state slices - -It detects changes with strict-equality (old === new) by default, this is efficient for atomic state picks. - -```jsx -const nuts = useBearStore((state) => state.nuts) -const honey = useBearStore((state) => state.honey) -``` - -If you want to construct a single object with multiple state-picks inside, similar to redux's mapStateToProps, you can use [useShallow](./docs/guides/prevent-rerenders-with-use-shallow.md) to prevent unnecessary rerenders when the selector output does not change according to shallow equal. - -```jsx -import { create } from 'zustand' -import { useShallow } from 'zustand/react/shallow' - -const useBearStore = create((set) => ({ - bears: 0, - increasePopulation: () => set((state) => ({ bears: state.bears + 1 })), - removeAllBears: () => set({ bears: 0 }), -})) - -// Object pick, re-renders the component when either state.nuts or state.honey change -const { nuts, honey } = useBearStore( - useShallow((state) => ({ nuts: state.nuts, honey: state.honey })), -) - -// Array pick, re-renders the component when either state.nuts or state.honey change -const [nuts, honey] = useBearStore( - useShallow((state) => [state.nuts, state.honey]), -) - -// Mapped picks, re-renders the component when state.treats changes in order, count or keys -const treats = useBearStore(useShallow((state) => Object.keys(state.treats))) -``` - -For more control over re-rendering, you may provide any custom equality function. - -```jsx -const treats = useBearStore( - (state) => state.treats, - (oldTreats, newTreats) => compare(oldTreats, newTreats), -) -``` - -## Overwriting state - -The `set` function has a second argument, `false` by default. Instead of merging, it will replace the state model. Be careful not to wipe out parts you rely on, like actions. - -```jsx -import omit from 'lodash-es/omit' - -const useFishStore = create((set) => ({ - salmon: 1, - tuna: 2, - deleteEverything: () => set({}, true), // clears the entire store, actions included - deleteTuna: () => set((state) => omit(state, ['tuna']), true), -})) -``` - -## Async actions - -Just call `set` when you're ready, zustand doesn't care if your actions are async or not. - -```jsx -const useFishStore = create((set) => ({ - fishies: {}, - fetch: async (pond) => { - const response = await fetch(pond) - set({ fishies: await response.json() }) - }, -})) -``` - -## Read from state in actions - -`set` allows fn-updates `set(state => result)`, but you still have access to state outside of it through `get`. - -```jsx -const useSoundStore = create((set, get) => ({ - sound: 'grunt', - action: () => { - const sound = get().sound - ... -``` - -## Reading/writing state and reacting to changes outside of components - -Sometimes you need to access state in a non-reactive way or act upon the store. For these cases, the resulting hook has utility functions attached to its prototype. - -:warning: This technique is not recommended for adding state in [React Server Components](https://github.com/reactjs/rfcs/blob/main/text/0188-server-components.md) (typically in Next.js 13 and above). It can lead to unexpected bugs and privacy issues for your users. For more details, see [#2200](https://github.com/pmndrs/zustand/discussions/2200). - -```jsx -const useDogStore = create(() => ({ paw: true, snout: true, fur: true })) - -// Getting non-reactive fresh state -const paw = useDogStore.getState().paw -// Listening to all changes, fires synchronously on every change -const unsub1 = useDogStore.subscribe(console.log) -// Updating state, will trigger listeners -useDogStore.setState({ paw: false }) -// Unsubscribe listeners -unsub1() - -// You can of course use the hook as you always would -function Component() { - const paw = useDogStore((state) => state.paw) - ... -``` - -### Using subscribe with selector - -If you need to subscribe with a selector, -`subscribeWithSelector` middleware will help. - -With this middleware `subscribe` accepts an additional signature: - -```ts -subscribe(selector, callback, options?: { equalityFn, fireImmediately }): Unsubscribe -``` - -```js -import { subscribeWithSelector } from 'zustand/middleware' -const useDogStore = create( - subscribeWithSelector(() => ({ paw: true, snout: true, fur: true })), -) - -// Listening to selected changes, in this case when "paw" changes -const unsub2 = useDogStore.subscribe((state) => state.paw, console.log) -// Subscribe also exposes the previous value -const unsub3 = useDogStore.subscribe( - (state) => state.paw, - (paw, previousPaw) => console.log(paw, previousPaw), -) -// Subscribe also supports an optional equality function -const unsub4 = useDogStore.subscribe( - (state) => [state.paw, state.fur], - console.log, - { equalityFn: shallow }, -) -// Subscribe and fire immediately -const unsub5 = useDogStore.subscribe((state) => state.paw, console.log, { - fireImmediately: true, -}) -``` - -## Using zustand without React - -Zustand core can be imported and used without the React dependency. The only difference is that the create function does not return a hook, but the API utilities. - -```jsx -import { createStore } from 'zustand/vanilla' - -const store = createStore((set) => ...) -const { getState, setState, subscribe } = store - -export default store -``` - -You can use a vanilla store with `useStore` hook available since v4. - -```jsx -import { useStore } from 'zustand' -import { vanillaStore } from './vanillaStore' - -const useBoundStore = (selector) => useStore(vanillaStore, selector) -``` - -:warning: Note that middlewares that modify `set` or `get` are not applied to `getState` and `setState`. - -## Transient updates (for often occurring state-changes) - -The subscribe function allows components to bind to a state-portion without forcing re-render on changes. Best combine it with useEffect for automatic unsubscribe on unmount. This can make a [drastic](https://codesandbox.io/s/peaceful-johnson-txtws) performance impact when you are allowed to mutate the view directly. - -```jsx -const useScratchStore = create((set) => ({ scratches: 0, ... })) - -const Component = () => { - // Fetch initial state - const scratchRef = useRef(useScratchStore.getState().scratches) - // Connect to the store on mount, disconnect on unmount, catch state-changes in a reference - useEffect(() => useScratchStore.subscribe( - state => (scratchRef.current = state.scratches) - ), []) - ... -``` - -## Sick of reducers and changing nested states? Use Immer! - -Reducing nested structures is tiresome. Have you tried [immer](https://github.com/mweststrate/immer)? - -```jsx -import { produce } from 'immer' - -const useLushStore = create((set) => ({ - lush: { forest: { contains: { a: 'bear' } } }, - clearForest: () => - set( - produce((state) => { - state.lush.forest.contains = null - }), - ), -})) - -const clearForest = useLushStore((state) => state.clearForest) -clearForest() -``` - -[Alternatively, there are some other solutions.](./docs/guides/updating-state.md#with-immer) - -## Middleware - -You can functionally compose your store any way you like. - -```jsx -// Log every time state is changed -const log = (config) => (set, get, api) => - config( - (...args) => { - console.log(' applying', args) - set(...args) - console.log(' new state', get()) - }, - get, - api, - ) - -const useBeeStore = create( - log((set) => ({ - bees: false, - setBees: (input) => set({ bees: input }), - })), -) -``` - -## Persist middleware - -You can persist your store's data using any kind of storage. - -```jsx -import { create } from 'zustand' -import { persist, createJSONStorage } from 'zustand/middleware' - -const useFishStore = create( - persist( - (set, get) => ({ - fishes: 0, - addAFish: () => set({ fishes: get().fishes + 1 }), - }), - { - name: 'food-storage', // name of the item in the storage (must be unique) - storage: createJSONStorage(() => sessionStorage), // (optional) by default, 'localStorage' is used - }, - ), -) -``` - -[See the full documentation for this middleware.](./docs/integrations/persisting-store-data.md) - -## Immer middleware - -Immer is available as middleware too. - -```jsx -import { create } from 'zustand' -import { immer } from 'zustand/middleware/immer' - -const useBeeStore = create( - immer((set) => ({ - bees: 0, - addBees: (by) => - set((state) => { - state.bees += by - }), - })), -) -``` - -## Can't live without redux-like reducers and action types? - -```jsx -const types = { increase: 'INCREASE', decrease: 'DECREASE' } - -const reducer = (state, { type, by = 1 }) => { - switch (type) { - case types.increase: - return { grumpiness: state.grumpiness + by } - case types.decrease: - return { grumpiness: state.grumpiness - by } - } -} - -const useGrumpyStore = create((set) => ({ - grumpiness: 0, - dispatch: (args) => set((state) => reducer(state, args)), -})) - -const dispatch = useGrumpyStore((state) => state.dispatch) -dispatch({ type: types.increase, by: 2 }) -``` - -Or, just use our redux-middleware. It wires up your main-reducer, sets the initial state, and adds a dispatch function to the state itself and the vanilla API. - -```jsx -import { redux } from 'zustand/middleware' - -const useGrumpyStore = create(redux(reducer, initialState)) -``` - -## Redux devtools - -```jsx -import { devtools } from 'zustand/middleware' - -// Usage with a plain action store, it will log actions as "setState" -const usePlainStore = create(devtools((set) => ...)) -// Usage with a redux store, it will log full action types -const useReduxStore = create(devtools(redux(reducer, initialState))) -``` - -One redux devtools connection for multiple stores - -```jsx -import { devtools } from 'zustand/middleware' - -// Usage with a plain action store, it will log actions as "setState" -const usePlainStore1 = create(devtools((set) => ..., { name, store: storeName1 })) -const usePlainStore2 = create(devtools((set) => ..., { name, store: storeName2 })) -// Usage with a redux store, it will log full action types -const useReduxStore = create(devtools(redux(reducer, initialState)), , { name, store: storeName3 }) -const useReduxStore = create(devtools(redux(reducer, initialState)), , { name, store: storeName4 }) -``` - -Assigning different connection names will separate stores in redux devtools. This also helps group different stores into separate redux devtools connections. - -devtools takes the store function as its first argument, optionally you can name the store or configure [serialize](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#serialize) options with a second argument. - -Name store: `devtools(..., {name: "MyStore"})`, which will create a separate instance named "MyStore" in the devtools. - -Serialize options: `devtools(..., { serialize: { options: true } })`. - -#### Logging Actions - -devtools will only log actions from each separated store unlike in a typical _combined reducers_ redux store. See an approach to combining stores https://github.com/pmndrs/zustand/issues/163 - -You can log a specific action type for each `set` function by passing a third parameter: - -```jsx -const useBearStore = create(devtools((set) => ({ - ... - eatFish: () => set( - (prev) => ({ fishes: prev.fishes > 1 ? prev.fishes - 1 : 0 }), - false, - 'bear/eatFish' - ), - ... -``` - -You can also log the action's type along with its payload: - -```jsx - ... - addFishes: (count) => set( - (prev) => ({ fishes: prev.fishes + count }), - false, - { type: 'bear/addFishes', count, } - ), - ... -``` - -If an action type is not provided, it is defaulted to "anonymous". You can customize this default value by providing an `anonymousActionType` parameter: - -```jsx -devtools(..., { anonymousActionType: 'unknown', ... }) -``` - -If you wish to disable devtools (on production for instance). You can customize this setting by providing the `enabled` parameter: - -```jsx -devtools(..., { enabled: false, ... }) -``` - -## React context - -The store created with `create` doesn't require context providers. In some cases, you may want to use contexts for dependency injection or if you want to initialize your store with props from a component. Because the normal store is a hook, passing it as a normal context value may violate the rules of hooks. - -The recommended method available since v4 is to use the vanilla store. - -```jsx -import { createContext, useContext } from 'react' -import { createStore, useStore } from 'zustand' - -const store = createStore(...) // vanilla store without hooks - -const StoreContext = createContext() - -const App = () => ( - - ... - -) - -const Component = () => { - const store = useContext(StoreContext) - const slice = useStore(store, selector) - ... -``` - -## TypeScript Usage - -Basic typescript usage doesn't require anything special except for writing `create()(...)` instead of `create(...)`... - -```ts -import { create } from 'zustand' -import { devtools, persist } from 'zustand/middleware' -import type {} from '@redux-devtools/extension' // required for devtools typing - -interface BearState { - bears: number - increase: (by: number) => void -} - -const useBearStore = create()( - devtools( - persist( - (set) => ({ - bears: 0, - increase: (by) => set((state) => ({ bears: state.bears + by })), - }), - { - name: 'bear-storage', - }, - ), - ), -) -``` - -A more complete TypeScript guide is [here](docs/guides/typescript.md). - -## Best practices - -- You may wonder how to organize your code for better maintenance: [Splitting the store into separate slices](./docs/guides/slices-pattern.md). -- Recommended usage for this unopinionated library: [Flux inspired practice](./docs/guides/flux-inspired-practice.md). -- [Calling actions outside a React event handler in pre-React 18](./docs/guides/event-handler-in-pre-react-18.md). -- [Testing](./docs/guides/testing.md) -- For more, have a look [in the docs folder](./docs/) - -## Third-Party Libraries - -Some users may want to extend Zustand's feature set which can be done using third-party libraries made by the community. For information regarding third-party libraries with Zustand, visit [the doc](./docs/integrations/third-party-libraries.md). - -## Comparison with other libraries - -- [Difference between zustand and other state management libraries for React](https://docs.pmnd.rs/zustand/getting-started/comparison) diff --git a/node_modules/zustand/shallow.d.ts b/node_modules/zustand/shallow.d.ts deleted file mode 100644 index 0914a7c..0000000 --- a/node_modules/zustand/shallow.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { shallow } from './vanilla/shallow'; -/** - * @deprecated Use `import { shallow } from 'zustand/shallow'` - */ -declare const _default: typeof shallow; -export default _default; -export { shallow }; diff --git a/node_modules/zustand/shallow.js b/node_modules/zustand/shallow.js deleted file mode 100644 index a96ee76..0000000 --- a/node_modules/zustand/shallow.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; -} -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function shallow$1(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -var shallow = (function (objA, objB) { - if (process.env.NODE_ENV !== 'production') { - console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`."); - } - return shallow$1(objA, objB); -}); - -exports.default = shallow; -exports.shallow = shallow$1; - -module.exports = shallow; -module.exports.shallow = shallow$1; -exports.default = module.exports; diff --git a/node_modules/zustand/system/context.development.js b/node_modules/zustand/system/context.development.js deleted file mode 100644 index 2830f14..0000000 --- a/node_modules/zustand/system/context.development.js +++ /dev/null @@ -1,73 +0,0 @@ -System.register(['react', 'zustand/traditional'], (function (exports) { - 'use strict'; - var ReactExports, useStoreWithEqualityFn; - return { - setters: [function (module) { - ReactExports = module.default; - }, function (module) { - useStoreWithEqualityFn = module.useStoreWithEqualityFn; - }], - execute: (function () { - - exports('default', createContext); - - const { - createElement, - createContext: reactCreateContext, - useContext, - useMemo, - useRef - } = ReactExports; - function createContext() { - { - console.warn( - "[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180." - ); - } - const ZustandContext = reactCreateContext(void 0); - const Provider = ({ - createStore, - children - }) => { - const storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = createStore(); - } - return createElement( - ZustandContext.Provider, - { value: storeRef.current }, - children - ); - }; - const useContextStore = (selector, equalityFn) => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useStoreWithEqualityFn( - store, - selector, - equalityFn - ); - }; - const useStoreApi = () => { - const store = useContext(ZustandContext); - if (!store) { - throw new Error( - "Seems like you have not used zustand provider as an ancestor." - ); - } - return useMemo(() => ({ ...store }), [store]); - }; - return { - Provider, - useStore: useContextStore, - useStoreApi - }; - } - - }) - }; -})); diff --git a/node_modules/zustand/system/context.production.js b/node_modules/zustand/system/context.production.js deleted file mode 100644 index 63a6c08..0000000 --- a/node_modules/zustand/system/context.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register(["react","zustand/traditional"],function(a){"use strict";var o,s;return{setters:[function(r){o=r.default},function(r){s=r.useStoreWithEqualityFn}],execute:function(){a("default",l);const{createElement:r,createContext:c,useContext:i,useMemo:d,useRef:f}=o;function l(){const n=c(void 0);return{Provider:({createStore:e,children:u})=>{const t=f();return t.current||(t.current=e()),r(n.Provider,{value:t.current},u)},useStore:(e,u)=>{const t=i(n);if(!t)throw new Error("Seems like you have not used zustand provider as an ancestor.");return s(t,e,u)},useStoreApi:()=>{const e=i(n);if(!e)throw new Error("Seems like you have not used zustand provider as an ancestor.");return d(()=>({...e}),[e])}}}}}}); diff --git a/node_modules/zustand/system/index.development.js b/node_modules/zustand/system/index.development.js deleted file mode 100644 index c07041b..0000000 --- a/node_modules/zustand/system/index.development.js +++ /dev/null @@ -1,69 +0,0 @@ -System.register(['zustand/vanilla', 'react', 'use-sync-external-store/shim/with-selector'], (function (exports) { - 'use strict'; - var _starExcludes = { - create: 1, - default: 1, - useStore: 1 - }; - var createStore, ReactExports, useSyncExternalStoreExports; - return { - setters: [function (module) { - createStore = module.createStore; - var setter = {}; - for (var name in module) { - if (!_starExcludes[name]) setter[name] = module[name]; - } - exports(setter); - }, function (module) { - ReactExports = module.default; - }, function (module) { - useSyncExternalStoreExports = module.default; - }], - execute: (function () { - - exports('useStore', useStore); - - const { useDebugValue } = ReactExports; - const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; - let didWarnAboutEqualityFn = false; - function useStore(api, selector = api.getState, equalityFn) { - if (equalityFn && !didWarnAboutEqualityFn) { - console.warn( - "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937" - ); - didWarnAboutEqualityFn = true; - } - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; - } - const createImpl = (createState) => { - if (typeof createState !== "function") { - console.warn( - "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`." - ); - } - const api = typeof createState === "function" ? createStore(createState) : createState; - const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn); - Object.assign(useBoundStore, api); - return useBoundStore; - }; - const create = exports('create', (createState) => createState ? createImpl(createState) : createImpl); - var react = exports('default', (createState) => { - { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`." - ); - } - return create(createState); - }); - - }) - }; -})); diff --git a/node_modules/zustand/system/index.production.js b/node_modules/zustand/system/index.production.js deleted file mode 100644 index 35306e8..0000000 --- a/node_modules/zustand/system/index.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register(["zustand/vanilla","react","use-sync-external-store/shim/with-selector"],function(c){"use strict";var l={create:1,default:1,useStore:1},o,i,f;return{setters:[function(t){o=t.createStore;var n={};for(var r in t)l[r]||(n[r]=t[r]);c(n)},function(t){i=t.default},function(t){f=t.default}],execute:function(){c("useStore",r);const{useDebugValue:t}=i,{useSyncExternalStoreWithSelector:n}=f;function r(e,s=e.getState,a){const u=n(e.subscribe,e.getState,e.getServerState||e.getState,s,a);return t(u),u}const S=e=>{const s=typeof e=="function"?o(e):e,a=(u,v)=>r(s,u,v);return Object.assign(a,s),a},g=c("create",e=>e?S(e):S);var b=c("default",e=>g(e))}}}); diff --git a/node_modules/zustand/system/middleware.development.js b/node_modules/zustand/system/middleware.development.js deleted file mode 100644 index ebb14fa..0000000 --- a/node_modules/zustand/system/middleware.development.js +++ /dev/null @@ -1,592 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('createJSONStorage', createJSONStorage); - - const reduxImpl = (reducer, initial) => (set, _get, api) => { - api.dispatch = (action) => { - set((state) => reducer(state, action), false, action); - return action; - }; - api.dispatchFromDevtools = true; - return { dispatch: (...a) => api.dispatch(...a), ...initial }; - }; - const redux = exports('redux', reduxImpl); - - const trackedConnections = /* @__PURE__ */ new Map(); - const getTrackedConnectionState = (name) => { - const api = trackedConnections.get(name); - if (!api) - return {}; - return Object.fromEntries( - Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()]) - ); - }; - const extractConnectionInformation = (store, extensionConnector, options) => { - if (store === void 0) { - return { - type: "untracked", - connection: extensionConnector.connect(options) - }; - } - const existingConnection = trackedConnections.get(options.name); - if (existingConnection) { - return { type: "tracked", store, ...existingConnection }; - } - const newConnection = { - connection: extensionConnector.connect(options), - stores: {} - }; - trackedConnections.set(options.name, newConnection); - return { type: "tracked", store, ...newConnection }; - }; - const devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => { - const { enabled, anonymousActionType, store, ...options } = devtoolsOptions; - let extensionConnector; - try { - extensionConnector = (enabled != null ? enabled : true) && window.__REDUX_DEVTOOLS_EXTENSION__; - } catch (e) { - } - if (!extensionConnector) { - if (enabled) { - console.warn( - "[zustand devtools middleware] Please install/enable Redux devtools extension" - ); - } - return fn(set, get, api); - } - const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options); - let isRecording = true; - api.setState = (state, replace, nameOrAction) => { - const r = set(state, replace); - if (!isRecording) - return r; - const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction; - if (store === void 0) { - connection == null ? void 0 : connection.send(action, get()); - return r; - } - connection == null ? void 0 : connection.send( - { - ...action, - type: `${store}/${action.type}` - }, - { - ...getTrackedConnectionState(options.name), - [store]: api.getState() - } - ); - return r; - }; - const setStateFromDevtools = (...a) => { - const originalIsRecording = isRecording; - isRecording = false; - set(...a); - isRecording = originalIsRecording; - }; - const initialState = fn(api.setState, get, api); - if (connectionInformation.type === "untracked") { - connection == null ? void 0 : connection.init(initialState); - } else { - connectionInformation.stores[connectionInformation.store] = api; - connection == null ? void 0 : connection.init( - Object.fromEntries( - Object.entries(connectionInformation.stores).map(([key, store2]) => [ - key, - key === connectionInformation.store ? initialState : store2.getState() - ]) - ) - ); - } - if (api.dispatchFromDevtools && typeof api.dispatch === "function") { - let didWarnAboutReservedActionType = false; - const originalDispatch = api.dispatch; - api.dispatch = (...a) => { - if (a[0].type === "__setState" && !didWarnAboutReservedActionType) { - console.warn( - '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.' - ); - didWarnAboutReservedActionType = true; - } - originalDispatch(...a); - }; - } - connection.subscribe((message) => { - var _a; - switch (message.type) { - case "ACTION": - if (typeof message.payload !== "string") { - console.error( - "[zustand devtools middleware] Unsupported action format" - ); - return; - } - return parseJsonThen( - message.payload, - (action) => { - if (action.type === "__setState") { - if (store === void 0) { - setStateFromDevtools(action.state); - return; - } - if (Object.keys(action.state).length !== 1) { - console.error( - ` - [zustand devtools middleware] Unsupported __setState action format. - When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), - and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - ` - ); - } - const stateFromDevtools = action.state[store]; - if (stateFromDevtools === void 0 || stateFromDevtools === null) { - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) { - setStateFromDevtools(stateFromDevtools); - } - return; - } - if (!api.dispatchFromDevtools) - return; - if (typeof api.dispatch !== "function") - return; - api.dispatch(action); - } - ); - case "DISPATCH": - switch (message.payload.type) { - case "RESET": - setStateFromDevtools(initialState); - if (store === void 0) { - return connection == null ? void 0 : connection.init(api.getState()); - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "COMMIT": - if (store === void 0) { - connection == null ? void 0 : connection.init(api.getState()); - return; - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case "ROLLBACK": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - connection == null ? void 0 : connection.init(api.getState()); - return; - } - setStateFromDevtools(state[store]); - connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - }); - case "JUMP_TO_STATE": - case "JUMP_TO_ACTION": - return parseJsonThen(message.state, (state) => { - if (store === void 0) { - setStateFromDevtools(state); - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) { - setStateFromDevtools(state[store]); - } - }); - case "IMPORT_STATE": { - const { nextLiftedState } = message.payload; - const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state; - if (!lastComputedState) - return; - if (store === void 0) { - setStateFromDevtools(lastComputedState); - } else { - setStateFromDevtools(lastComputedState[store]); - } - connection == null ? void 0 : connection.send( - null, - // FIXME no-any - nextLiftedState - ); - return; - } - case "PAUSE_RECORDING": - return isRecording = !isRecording; - } - return; - } - }); - return initialState; - }; - const devtools = exports('devtools', devtoolsImpl); - const parseJsonThen = (stringified, f) => { - let parsed; - try { - parsed = JSON.parse(stringified); - } catch (e) { - console.error( - "[zustand devtools middleware] Could not parse the received json", - e - ); - } - if (parsed !== void 0) - f(parsed); - }; - - const subscribeWithSelectorImpl = (fn) => (set, get, api) => { - const origSubscribe = api.subscribe; - api.subscribe = (selector, optListener, options) => { - let listener = selector; - if (optListener) { - const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; - let currentSlice = selector(api.getState()); - listener = (state) => { - const nextSlice = selector(state); - if (!equalityFn(currentSlice, nextSlice)) { - const previousSlice = currentSlice; - optListener(currentSlice = nextSlice, previousSlice); - } - }; - if (options == null ? void 0 : options.fireImmediately) { - optListener(currentSlice, currentSlice); - } - } - return origSubscribe(listener); - }; - const initialState = fn(set, get, api); - return initialState; - }; - const subscribeWithSelector = exports('subscribeWithSelector', subscribeWithSelectorImpl); - - const combine = exports('combine', (initialState, create) => (...a) => Object.assign({}, initialState, create(...a))); - - function createJSONStorage(getStorage, options) { - let storage; - try { - storage = getStorage(); - } catch (e) { - return; - } - const persistStorage = { - getItem: (name) => { - var _a; - const parse = (str2) => { - if (str2 === null) { - return null; - } - return JSON.parse(str2, options == null ? void 0 : options.reviver); - }; - const str = (_a = storage.getItem(name)) != null ? _a : null; - if (str instanceof Promise) { - return str.then(parse); - } - return parse(str); - }, - setItem: (name, newValue) => storage.setItem( - name, - JSON.stringify(newValue, options == null ? void 0 : options.replacer) - ), - removeItem: (name) => storage.removeItem(name) - }; - return persistStorage; - } - const toThenable = (fn) => (input) => { - try { - const result = fn(input); - if (result instanceof Promise) { - return result; - } - return { - then(onFulfilled) { - return toThenable(onFulfilled)(result); - }, - catch(_onRejected) { - return this; - } - }; - } catch (e) { - return { - then(_onFulfilled) { - return this; - }, - catch(onRejected) { - return toThenable(onRejected)(e); - } - }; - } - }; - const oldImpl = (config, baseOptions) => (set, get, api) => { - let options = { - getStorage: () => localStorage, - serialize: JSON.stringify, - deserialize: JSON.parse, - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage; - try { - storage = options.getStorage(); - } catch (e) { - } - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const thenableSerialize = toThenable(options.serialize); - const setItem = () => { - const state = options.partialize({ ...get() }); - let errorInSync; - const thenable = thenableSerialize({ state, version: options.version }).then( - (serializedValue) => storage.setItem(options.name, serializedValue) - ).catch((e) => { - errorInSync = e; - }); - if (errorInSync) { - throw errorInSync; - } - return thenable; - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => cb(get())); - const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => { - if (storageValue) { - return options.deserialize(storageValue); - } - }).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.getStorage) { - storage = newOptions.getStorage(); - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - hydrate(); - return stateFromStorage || configResult; - }; - const newImpl = (config, baseOptions) => (set, get, api) => { - let options = { - storage: createJSONStorage(() => localStorage), - partialize: (state) => state, - version: 0, - merge: (persistedState, currentState) => ({ - ...currentState, - ...persistedState - }), - ...baseOptions - }; - let hasHydrated = false; - const hydrationListeners = /* @__PURE__ */ new Set(); - const finishHydrationListeners = /* @__PURE__ */ new Set(); - let storage = options.storage; - if (!storage) { - return config( - (...args) => { - console.warn( - `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.` - ); - set(...args); - }, - get, - api - ); - } - const setItem = () => { - const state = options.partialize({ ...get() }); - return storage.setItem(options.name, { - state, - version: options.version - }); - }; - const savedSetState = api.setState; - api.setState = (state, replace) => { - savedSetState(state, replace); - void setItem(); - }; - const configResult = config( - (...args) => { - set(...args); - void setItem(); - }, - get, - api - ); - let stateFromStorage; - const hydrate = () => { - var _a, _b; - if (!storage) - return; - hasHydrated = false; - hydrationListeners.forEach((cb) => { - var _a2; - return cb((_a2 = get()) != null ? _a2 : configResult); - }); - const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0; - return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate( - deserializedStorageValue.state, - deserializedStorageValue.version - ); - } - console.error( - `State loaded from storage couldn't be migrated since no migrate function was provided` - ); - } else { - return deserializedStorageValue.state; - } - } - }).then((migratedState) => { - var _a2; - stateFromStorage = options.merge( - migratedState, - (_a2 = get()) != null ? _a2 : configResult - ); - set(stateFromStorage, true); - return setItem(); - }).then(() => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); - stateFromStorage = get(); - hasHydrated = true; - finishHydrationListeners.forEach((cb) => cb(stateFromStorage)); - }).catch((e) => { - postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e); - }); - }; - api.persist = { - setOptions: (newOptions) => { - options = { - ...options, - ...newOptions - }; - if (newOptions.storage) { - storage = newOptions.storage; - } - }, - clearStorage: () => { - storage == null ? void 0 : storage.removeItem(options.name); - }, - getOptions: () => options, - rehydrate: () => hydrate(), - hasHydrated: () => hasHydrated, - onHydrate: (cb) => { - hydrationListeners.add(cb); - return () => { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: (cb) => { - finishHydrationListeners.add(cb); - return () => { - finishHydrationListeners.delete(cb); - }; - } - }; - if (!options.skipHydration) { - hydrate(); - } - return stateFromStorage || configResult; - }; - const persistImpl = (config, baseOptions) => { - if ("getStorage" in baseOptions || "serialize" in baseOptions || "deserialize" in baseOptions) { - { - console.warn( - "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead." - ); - } - return oldImpl(config, baseOptions); - } - return newImpl(config, baseOptions); - }; - const persist = exports('persist', persistImpl); - - }) - }; -})); diff --git a/node_modules/zustand/system/middleware.production.js b/node_modules/zustand/system/middleware.production.js deleted file mode 100644 index 6d3831e..0000000 --- a/node_modules/zustand/system/middleware.production.js +++ /dev/null @@ -1,5 +0,0 @@ -System.register([],function(b){"use strict";return{execute:function(){b("createJSONStorage",E);const A=b("redux",(d,c)=>(a,o,n)=>(n.dispatch=e=>(a(g=>d(g,e),!1,e),e),n.dispatchFromDevtools=!0,{dispatch:(...e)=>n.dispatch(...e),...c})),I=new Map,w=d=>{const c=I.get(d);return c?Object.fromEntries(Object.entries(c.stores).map(([a,o])=>[a,o.getState()])):{}},T=(d,c,a)=>{if(d===void 0)return{type:"untracked",connection:c.connect(a)};const o=I.get(a.name);if(o)return{type:"tracked",store:d,...o};const n={connection:c.connect(a),stores:{}};return I.set(a.name,n),{type:"tracked",store:d,...n}},P=b("devtools",(d,c={})=>(a,o,n)=>{const{enabled:e,anonymousActionType:g,store:u,...h}=c;let m;try{m=(e!=null?e:!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!m)return d(a,o,n);const{connection:l,...y}=T(u,m,h);let p=!0;n.setState=(r,s,i)=>{const t=a(r,s);if(!p)return t;const f=i===void 0?{type:g||"anonymous"}:typeof i=="string"?{type:i}:i;return u===void 0?(l==null||l.send(f,o()),t):(l==null||l.send({...f,type:`${u}/${f.type}`},{...w(h.name),[u]:n.getState()}),t)};const v=(...r)=>{const s=p;p=!1,a(...r),p=s},S=d(n.setState,o,n);if(y.type==="untracked"?l==null||l.init(S):(y.stores[y.store]=n,l==null||l.init(Object.fromEntries(Object.entries(y.stores).map(([r,s])=>[r,r===y.store?S:s.getState()])))),n.dispatchFromDevtools&&typeof n.dispatch=="function"){const r=n.dispatch;n.dispatch=(...s)=>{r(...s)}}return l.subscribe(r=>{var s;switch(r.type){case"ACTION":if(typeof r.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return _(r.payload,i=>{if(i.type==="__setState"){if(u===void 0){v(i.state);return}Object.keys(i.state).length!==1&&console.error(` - [zustand devtools middleware] Unsupported __setState action format. - When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), - and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - `);const t=i.state[u];if(t==null)return;JSON.stringify(n.getState())!==JSON.stringify(t)&&v(t);return}n.dispatchFromDevtools&&typeof n.dispatch=="function"&&n.dispatch(i)});case"DISPATCH":switch(r.payload.type){case"RESET":return v(S),u===void 0?l==null?void 0:l.init(n.getState()):l==null?void 0:l.init(w(h.name));case"COMMIT":if(u===void 0){l==null||l.init(n.getState());return}return l==null?void 0:l.init(w(h.name));case"ROLLBACK":return _(r.state,i=>{if(u===void 0){v(i),l==null||l.init(n.getState());return}v(i[u]),l==null||l.init(w(h.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return _(r.state,i=>{if(u===void 0){v(i);return}JSON.stringify(n.getState())!==JSON.stringify(i[u])&&v(i[u])});case"IMPORT_STATE":{const{nextLiftedState:i}=r.payload,t=(s=i.computedStates.slice(-1)[0])==null?void 0:s.state;if(!t)return;v(u===void 0?t:t[u]),l==null||l.send(null,i);return}case"PAUSE_RECORDING":return p=!p}return}}),S}),_=(d,c)=>{let a;try{a=JSON.parse(d)}catch(o){console.error("[zustand devtools middleware] Could not parse the received json",o)}a!==void 0&&c(a)},H=b("subscribeWithSelector",d=>(c,a,o)=>{const n=o.subscribe;return o.subscribe=(e,g,u)=>{let h=e;if(g){const m=(u==null?void 0:u.equalityFn)||Object.is;let l=e(o.getState());h=y=>{const p=e(y);if(!m(l,p)){const v=l;g(l=p,v)}},u!=null&&u.fireImmediately&&g(l,l)}return n(h)},d(c,a,o)}),R=b("combine",(d,c)=>(...a)=>Object.assign({},d,c(...a)));function E(d,c){let a;try{a=d()}catch{return}return{getItem:o=>{var n;const e=u=>u===null?null:JSON.parse(u,c==null?void 0:c.reviver),g=(n=a.getItem(o))!=null?n:null;return g instanceof Promise?g.then(e):e(g)},setItem:(o,n)=>a.setItem(o,JSON.stringify(n,c==null?void 0:c.replacer)),removeItem:o=>a.removeItem(o)}}const O=d=>c=>{try{const a=d(c);return a instanceof Promise?a:{then(o){return O(o)(a)},catch(o){return this}}}catch(a){return{then(o){return this},catch(o){return O(o)(a)}}}},N=(d,c)=>(a,o,n)=>{let e={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:s=>s,version:0,merge:(s,i)=>({...i,...s}),...c},g=!1;const u=new Set,h=new Set;let m;try{m=e.getStorage()}catch{}if(!m)return d((...s)=>{console.warn(`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`),a(...s)},o,n);const l=O(e.serialize),y=()=>{const s=e.partialize({...o()});let i;const t=l({state:s,version:e.version}).then(f=>m.setItem(e.name,f)).catch(f=>{i=f});if(i)throw i;return t},p=n.setState;n.setState=(s,i)=>{p(s,i),y()};const v=d((...s)=>{a(...s),y()},o,n);let S;const r=()=>{var s;if(!m)return;g=!1,u.forEach(t=>t(o()));const i=((s=e.onRehydrateStorage)==null?void 0:s.call(e,o()))||void 0;return O(m.getItem.bind(m))(e.name).then(t=>{if(t)return e.deserialize(t)}).then(t=>{if(t)if(typeof t.version=="number"&&t.version!==e.version){if(e.migrate)return e.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return t.state}).then(t=>{var f;return S=e.merge(t,(f=o())!=null?f:v),a(S,!0),y()}).then(()=>{i==null||i(S,void 0),g=!0,h.forEach(t=>t(S))}).catch(t=>{i==null||i(void 0,t)})};return n.persist={setOptions:s=>{e={...e,...s},s.getStorage&&(m=s.getStorage())},clearStorage:()=>{m==null||m.removeItem(e.name)},getOptions:()=>e,rehydrate:()=>r(),hasHydrated:()=>g,onHydrate:s=>(u.add(s),()=>{u.delete(s)}),onFinishHydration:s=>(h.add(s),()=>{h.delete(s)})},r(),S||v},z=(d,c)=>(a,o,n)=>{let e={storage:E(()=>localStorage),partialize:r=>r,version:0,merge:(r,s)=>({...s,...r}),...c},g=!1;const u=new Set,h=new Set;let m=e.storage;if(!m)return d((...r)=>{console.warn(`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`),a(...r)},o,n);const l=()=>{const r=e.partialize({...o()});return m.setItem(e.name,{state:r,version:e.version})},y=n.setState;n.setState=(r,s)=>{y(r,s),l()};const p=d((...r)=>{a(...r),l()},o,n);let v;const S=()=>{var r,s;if(!m)return;g=!1,u.forEach(t=>{var f;return t((f=o())!=null?f:p)});const i=((s=e.onRehydrateStorage)==null?void 0:s.call(e,(r=o())!=null?r:p))||void 0;return O(m.getItem.bind(m))(e.name).then(t=>{if(t)if(typeof t.version=="number"&&t.version!==e.version){if(e.migrate)return e.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return t.state}).then(t=>{var f;return v=e.merge(t,(f=o())!=null?f:p),a(v,!0),l()}).then(()=>{i==null||i(v,void 0),v=o(),g=!0,h.forEach(t=>t(v))}).catch(t=>{i==null||i(void 0,t)})};return n.persist={setOptions:r=>{e={...e,...r},r.storage&&(m=r.storage)},clearStorage:()=>{m==null||m.removeItem(e.name)},getOptions:()=>e,rehydrate:()=>S(),hasHydrated:()=>g,onHydrate:r=>(u.add(r),()=>{u.delete(r)}),onFinishHydration:r=>(h.add(r),()=>{h.delete(r)})},e.skipHydration||S(),v||p},$=b("persist",(d,c)=>"getStorage"in c||"serialize"in c||"deserialize"in c?N(d,c):z(d,c))}}}); diff --git a/node_modules/zustand/system/middleware/immer.development.js b/node_modules/zustand/system/middleware/immer.development.js deleted file mode 100644 index 745db29..0000000 --- a/node_modules/zustand/system/middleware/immer.development.js +++ /dev/null @@ -1,21 +0,0 @@ -System.register(['immer'], (function (exports) { - 'use strict'; - var produce; - return { - setters: [function (module) { - produce = module.produce; - }], - execute: (function () { - - const immerImpl = (initializer) => (set, get, store) => { - store.setState = (updater, replace, ...a) => { - const nextState = typeof updater === "function" ? produce(updater) : updater; - return set(nextState, replace, ...a); - }; - return initializer(store.setState, get, store); - }; - const immer = exports('immer', immerImpl); - - }) - }; -})); diff --git a/node_modules/zustand/system/middleware/immer.production.js b/node_modules/zustand/system/middleware/immer.production.js deleted file mode 100644 index f194c03..0000000 --- a/node_modules/zustand/system/middleware/immer.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register(["immer"],function(c){"use strict";var r;return{setters:[function(n){r=n.produce}],execute:function(){const S=c("immer",s=>(o,u,t)=>(t.setState=(e,i,...m)=>{const f=typeof e=="function"?r(e):e;return o(f,i,...m)},s(t.setState,u,t)))}}}); diff --git a/node_modules/zustand/system/react/shallow.development.js b/node_modules/zustand/system/react/shallow.development.js deleted file mode 100644 index 148cca7..0000000 --- a/node_modules/zustand/system/react/shallow.development.js +++ /dev/null @@ -1,62 +0,0 @@ -System.register(['react'], (function (exports) { - 'use strict'; - var ReactExports; - return { - setters: [function (module) { - ReactExports = module.default; - }], - execute: (function () { - - exports('useShallow', useShallow); - - function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - const { useRef } = ReactExports; - function useShallow(selector) { - const prev = useRef(); - return (state) => { - const next = selector(state); - return shallow(prev.current, next) ? prev.current : prev.current = next; - }; - } - - }) - }; -})); diff --git a/node_modules/zustand/system/react/shallow.production.js b/node_modules/zustand/system/react/shallow.production.js deleted file mode 100644 index e595508..0000000 --- a/node_modules/zustand/system/react/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register(["react"],function(o){"use strict";var s;return{setters:[function(c){s=c.default}],execute:function(){o("useShallow",f);function c(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{const r=e(n);return c(t.current,r)?t.current:t.current=r}}}}}); diff --git a/node_modules/zustand/system/shallow.development.js b/node_modules/zustand/system/shallow.development.js deleted file mode 100644 index 7c24d45..0000000 --- a/node_modules/zustand/system/shallow.development.js +++ /dev/null @@ -1,58 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('shallow', shallow$1); - - function shallow$1(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - var shallow = exports('default', (objA, objB) => { - { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`." - ); - } - return shallow$1(objA, objB); - }); - - }) - }; -})); diff --git a/node_modules/zustand/system/shallow.production.js b/node_modules/zustand/system/shallow.production.js deleted file mode 100644 index 75f7d5f..0000000 --- a/node_modules/zustand/system/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register([],function(f){"use strict";return{execute:function(){f("shallow",i);function i(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,o]of t)if(!Object.is(o,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;ni(t,e))}}}); diff --git a/node_modules/zustand/system/traditional.development.js b/node_modules/zustand/system/traditional.development.js deleted file mode 100644 index 9336b7d..0000000 --- a/node_modules/zustand/system/traditional.development.js +++ /dev/null @@ -1,39 +0,0 @@ -System.register(['react', 'use-sync-external-store/shim/with-selector', 'zustand/vanilla'], (function (exports) { - 'use strict'; - var ReactExports, useSyncExternalStoreExports, createStore; - return { - setters: [function (module) { - ReactExports = module.default; - }, function (module) { - useSyncExternalStoreExports = module.default; - }, function (module) { - createStore = module.createStore; - }], - execute: (function () { - - exports('useStoreWithEqualityFn', useStoreWithEqualityFn); - - const { useDebugValue } = ReactExports; - const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports; - function useStoreWithEqualityFn(api, selector = api.getState, equalityFn) { - const slice = useSyncExternalStoreWithSelector( - api.subscribe, - api.getState, - api.getServerState || api.getState, - selector, - equalityFn - ); - useDebugValue(slice); - return slice; - } - const createWithEqualityFnImpl = (createState, defaultEqualityFn) => { - const api = createStore(createState); - const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn); - Object.assign(useBoundStoreWithEqualityFn, api); - return useBoundStoreWithEqualityFn; - }; - const createWithEqualityFn = exports('createWithEqualityFn', (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl); - - }) - }; -})); diff --git a/node_modules/zustand/system/traditional.production.js b/node_modules/zustand/system/traditional.production.js deleted file mode 100644 index ed0abba..0000000 --- a/node_modules/zustand/system/traditional.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register(["react","use-sync-external-store/shim/with-selector","zustand/vanilla"],function(a){"use strict";var c,s,i;return{setters:[function(e){c=e.default},function(e){s=e.default},function(e){i=e.createStore}],execute:function(){a("useStoreWithEqualityFn",o);const{useDebugValue:e}=c,{useSyncExternalStoreWithSelector:S}=s;function o(t,n=t.getState,u){const r=S(t.subscribe,t.getState,t.getServerState||t.getState,n,u);return e(r),r}const l=(t,n)=>{const u=i(t),r=(f,g=n)=>o(u,f,g);return Object.assign(r,u),r},h=a("createWithEqualityFn",(t,n)=>t?l(t,n):l)}}}); diff --git a/node_modules/zustand/system/vanilla.development.js b/node_modules/zustand/system/vanilla.development.js deleted file mode 100644 index 376af1f..0000000 --- a/node_modules/zustand/system/vanilla.development.js +++ /dev/null @@ -1,46 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const createStoreImpl = (createState) => { - let state; - const listeners = /* @__PURE__ */ new Set(); - const setState = (partial, replace) => { - const nextState = typeof partial === "function" ? partial(state) : partial; - if (!Object.is(nextState, state)) { - const previousState = state; - state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState); - listeners.forEach((listener) => listener(state, previousState)); - } - }; - const getState = () => state; - const subscribe = (listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }; - const destroy = () => { - { - console.warn( - "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected." - ); - } - listeners.clear(); - }; - const api = { setState, getState, subscribe, destroy }; - state = createState(setState, getState, api); - return api; - }; - const createStore = exports('createStore', (createState) => createState ? createStoreImpl(createState) : createStoreImpl); - var vanilla = exports('default', (createState) => { - { - console.warn( - "[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'." - ); - } - return createStore(createState); - }); - - }) - }; -})); diff --git a/node_modules/zustand/system/vanilla.production.js b/node_modules/zustand/system/vanilla.production.js deleted file mode 100644 index 842d3b4..0000000 --- a/node_modules/zustand/system/vanilla.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register([],function(s){"use strict";return{execute:function(){const a=e=>{let t;const o=new Set,r=(n,l)=>{const c=typeof n=="function"?n(t):n;if(!Object.is(c,t)){const S=t;t=(l!=null?l:typeof c!="object"||c===null)?c:Object.assign({},t,c),o.forEach(b=>b(t,S))}},i=()=>t,u={setState:r,getState:i,subscribe:n=>(o.add(n),()=>o.delete(n)),destroy:()=>{o.clear()}};return t=e(r,i,u),u},f=s("createStore",e=>e?a(e):a);var d=s("default",e=>f(e))}}}); diff --git a/node_modules/zustand/system/vanilla/shallow.development.js b/node_modules/zustand/system/vanilla/shallow.development.js deleted file mode 100644 index df43633..0000000 --- a/node_modules/zustand/system/vanilla/shallow.development.js +++ /dev/null @@ -1,49 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - exports('shallow', shallow); - - function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) - return false; - for (const [key, value] of objA) { - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) - return false; - for (const value of objA) { - if (!objB.has(value)) { - return false; - } - } - return true; - } - const keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (let i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - }) - }; -})); diff --git a/node_modules/zustand/system/vanilla/shallow.production.js b/node_modules/zustand/system/vanilla/shallow.production.js deleted file mode 100644 index d8e95dc..0000000 --- a/node_modules/zustand/system/vanilla/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -System.register([],function(i){"use strict";return{execute:function(){i("shallow",f);function f(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,o]of t)if(!Object.is(o,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStoreWithEqualityFn>>(api: S): ExtractState; -export declare function useStoreWithEqualityFn>, U>(api: S, selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -export type UseBoundStoreWithEqualityFn>> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -} & S; -type CreateWithEqualityFn = { - (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean): UseBoundStoreWithEqualityFn, Mos>>; - (): (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn, Mos>>; -}; -export declare const createWithEqualityFn: CreateWithEqualityFn; -export {}; diff --git a/node_modules/zustand/traditional.js b/node_modules/zustand/traditional.js deleted file mode 100644 index c630886..0000000 --- a/node_modules/zustand/traditional.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var ReactExports = require('react'); -var useSyncExternalStoreExports = require('use-sync-external-store/shim/with-selector'); -var vanilla = require('zustand/vanilla'); - -var useDebugValue = ReactExports.useDebugValue; -var useSyncExternalStoreWithSelector = useSyncExternalStoreExports.useSyncExternalStoreWithSelector; -function useStoreWithEqualityFn(api, selector, equalityFn) { - if (selector === void 0) { - selector = api.getState; - } - var slice = useSyncExternalStoreWithSelector(api.subscribe, api.getState, api.getServerState || api.getState, selector, equalityFn); - useDebugValue(slice); - return slice; -} -var createWithEqualityFnImpl = function createWithEqualityFnImpl(createState, defaultEqualityFn) { - var api = vanilla.createStore(createState); - var useBoundStoreWithEqualityFn = function useBoundStoreWithEqualityFn(selector, equalityFn) { - if (equalityFn === void 0) { - equalityFn = defaultEqualityFn; - } - return useStoreWithEqualityFn(api, selector, equalityFn); - }; - Object.assign(useBoundStoreWithEqualityFn, api); - return useBoundStoreWithEqualityFn; -}; -var createWithEqualityFn = function createWithEqualityFn(createState, defaultEqualityFn) { - return createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl; -}; - -exports.createWithEqualityFn = createWithEqualityFn; -exports.useStoreWithEqualityFn = useStoreWithEqualityFn; diff --git a/node_modules/zustand/ts3.4/context.d.ts b/node_modules/zustand/ts3.4/context.d.ts deleted file mode 100644 index 4be2213..0000000 --- a/node_modules/zustand/ts3.4/context.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import ReactExports from 'react'; -import { ReactNode } from 'react'; -import { StoreApi } from 'zustand'; -type UseContextStore> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -}; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type WithoutCallSignature = { - [K in keyof T]: T[K]; -}; -/** - * @deprecated Use `createStore` and `useStore` for context usage - */ -declare function createContext>(): { - Provider: ({ createStore, children, }: { - createStore: () => S; - children: ReactNode; - }) => ReactExports.FunctionComponentElement>; - useStore: UseContextStore; - useStoreApi: () => WithoutCallSignature; -}; -export default createContext; diff --git a/node_modules/zustand/ts3.4/esm/context.d.ts b/node_modules/zustand/ts3.4/esm/context.d.ts deleted file mode 100644 index 4be2213..0000000 --- a/node_modules/zustand/ts3.4/esm/context.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import ReactExports from 'react'; -import { ReactNode } from 'react'; -import { StoreApi } from 'zustand'; -type UseContextStore> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -}; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type WithoutCallSignature = { - [K in keyof T]: T[K]; -}; -/** - * @deprecated Use `createStore` and `useStore` for context usage - */ -declare function createContext>(): { - Provider: ({ createStore, children, }: { - createStore: () => S; - children: ReactNode; - }) => ReactExports.FunctionComponentElement>; - useStore: UseContextStore; - useStoreApi: () => WithoutCallSignature; -}; -export default createContext; diff --git a/node_modules/zustand/ts3.4/esm/index.d.ts b/node_modules/zustand/ts3.4/esm/index.d.ts deleted file mode 100644 index 7e9c8b6..0000000 --- a/node_modules/zustand/ts3.4/esm/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './vanilla'; -export * from './react'; -export { default } from './react'; diff --git a/node_modules/zustand/ts3.4/esm/middleware.d.ts b/node_modules/zustand/ts3.4/esm/middleware.d.ts deleted file mode 100644 index 1806630..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './middleware/redux'; -export * from './middleware/devtools'; -export * from './middleware/subscribeWithSelector'; -export * from './middleware/combine'; -export * from './middleware/persist'; diff --git a/node_modules/zustand/ts3.4/esm/middleware/combine.d.ts b/node_modules/zustand/ts3.4/esm/middleware/combine.d.ts deleted file mode 100644 index 0701780..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/combine.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Pick> & U; -type Combine = (initialState: T, additionalStateCreator: StateCreator) => StateCreator, Mps, Mcs>; -export declare const combine: Combine; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/middleware/devtools.d.ts b/node_modules/zustand/ts3.4/esm/middleware/devtools.d.ts deleted file mode 100644 index afad734..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/devtools.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla'; -type Config = Parameters<(Window extends { - __REDUX_DEVTOOLS_EXTENSION__?: infer T; -} ? T : { - connect: (param: any) => any; -})['connect']>[0]; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -type Cast = T extends U ? T : U; -type Write = Pick> & U; -type TakeTwo = T extends { - length: 0; -} ? [ - undefined, - undefined -] : T extends { - length: 1; -} ? [ - /*a0*/ ...Cast, - /*a1*/ undefined -] : T extends { - length: 0 | 1; -} ? [ - /*a0*/ ...Cast, - /*a1*/ undefined -] : T extends { - length: 2; -} ? T : T extends { - length: 1 | 2; -} ? T : T extends { - length: 0 | 1 | 2; -} ? T : T extends [ - infer A0, - infer A1, - ...unknown[] -] ? [ - A0, - A1 -] : T extends [ - infer A0, - (infer A1)?, - ...unknown[] -] ? [ - A0, - A1? -] : T extends [ - (infer A0)?, - (infer A1)?, - ...unknown[] -] ? [ - A0?, - A1? -] : never; -type WithDevtools = Write>; -type StoreDevtools = S extends { - setState: (...a: infer Sa) => infer Sr; -} ? { - setState
(...a: [ - /*a*/ ...TakeTwo, - /*action*/ A - ]): Sr; -} : never; -export interface DevtoolsOptions extends Config { - name?: string; - enabled?: boolean; - anonymousActionType?: string; - store?: string; -} -type Devtools = (initializer: StateCreator, devtoolsOptions?: DevtoolsOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -export type NamedSet = WithDevtools>['setState']; -export declare const devtools: Devtools; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/middleware/immer.d.ts b/node_modules/zustand/ts3.4/esm/middleware/immer.d.ts deleted file mode 100644 index 3f06c55..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/immer.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Draft } from 'immer'; -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Immer = (initializer: StateCreator) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/immer']: WithImmer; - } -} -type Write = Pick> & U; -type SkipTwo = T extends { - length: 0; -} ? [ -] : T extends { - length: 1; -} ? [ -] : T extends { - length: 0 | 1; -} ? [ -] : T extends [ - unknown, - unknown, - ...infer A -] ? A : T extends [ - unknown, - unknown?, - ...infer A -] ? A : T extends [ - unknown?, - unknown?, - ...infer A -] ? A : never; -type WithImmer = Write>; -type StoreImmer = S extends { - getState: () => infer T; - setState: infer SetState; -} ? SetState extends (...a: infer A) => infer Sr ? { - setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; -} : never : never; -export declare const immer: Immer; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/middleware/persist.d.ts b/node_modules/zustand/ts3.4/esm/middleware/persist.d.ts deleted file mode 100644 index 39dd638..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/persist.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -export interface StateStorage { - getItem: (name: string) => string | null | Promise; - setItem: (name: string, value: string) => void | Promise; - removeItem: (name: string) => void | Promise; -} -export type StorageValue = { - state: S; - version?: number; -}; -export interface PersistStorage { - getItem: (name: string) => StorageValue | null | Promise | null>; - setItem: (name: string, value: StorageValue) => void | Promise; - removeItem: (name: string) => void | Promise; -} -type JsonStorageOptions = { - reviver?: (key: string, value: unknown) => unknown; - replacer?: (key: string, value: unknown) => unknown; -}; -export declare function createJSONStorage(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage | undefined; -export interface PersistOptions { - /** Name of the storage (must be unique) */ - name: string; - /** - * @deprecated Use `storage` instead. - * A function returning a storage. - * The storage must fit `window.localStorage`'s api (or an async version of it). - * For example the storage could be `AsyncStorage` from React Native. - * - * @default () => localStorage - */ - getStorage?: () => StateStorage; - /** - * @deprecated Use `storage` instead. - * Use a custom serializer. - * The returned string will be stored in the storage. - * - * @default JSON.stringify - */ - serialize?: (state: StorageValue) => string | Promise; - /** - * @deprecated Use `storage` instead. - * Use a custom deserializer. - * Must return an object matching StorageValue - * - * @param str The storage's current value. - * @default JSON.parse - */ - deserialize?: (str: string) => StorageValue | Promise>; - /** - * Use a custom persist storage. - * - * Combining `createJSONStorage` helps creating a persist storage - * with JSON.parse and JSON.stringify. - * - * @default createJSONStorage(() => localStorage) - */ - storage?: PersistStorage | undefined; - /** - * Filter the persisted value. - * - * @params state The state's value - */ - partialize?: (state: S) => PersistedState; - /** - * A function returning another (optional) function. - * The main function will be called before the state rehydration. - * The returned function will be called after the state rehydration or when an error occurred. - */ - onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void; - /** - * If the stored state's version mismatch the one specified here, the storage will not be used. - * This is useful when adding a breaking change to your store. - */ - version?: number; - /** - * A function to perform persisted state migration. - * This function will be called when persisted state versions mismatch with the one specified here. - */ - migrate?: (persistedState: unknown, version: number) => S | Promise; - /** - * A function to perform custom hydration merges when combining the stored state with the current one. - * By default, this function does a shallow merge. - */ - merge?: (persistedState: unknown, currentState: S) => S; - /** - * An optional boolean that will prevent the persist middleware from triggering hydration on initialization, - * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle. - * - * This is useful in SSR application. - * - * @default false - */ - skipHydration?: boolean; -} -type PersistListener = (state: S) => void; -type StorePersist = { - persist: { - setOptions: (options: Partial>) => void; - clearStorage: () => void; - rehydrate: () => Promise | void; - hasHydrated: () => boolean; - onHydrate: (fn: PersistListener) => () => void; - onFinishHydration: (fn: PersistListener) => () => void; - getOptions: () => Partial>; - }; -}; -type Persist = (initializer: StateCreator, options: PersistOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/persist': WithPersist; - } -} -type Write = Pick> & U; -type WithPersist = S extends { - getState: () => infer T; -} ? Write> : never; -export declare const persist: Persist; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/middleware/redux.d.ts b/node_modules/zustand/ts3.4/esm/middleware/redux.d.ts deleted file mode 100644 index 24fe5c7..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/redux.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Pick> & U; -type Action = { - type: string; -}; -type StoreRedux = { - dispatch: (a: A) => A; - dispatchFromDevtools: true; -}; -type ReduxState = { - dispatch: StoreRedux['dispatch']; -}; -type WithRedux = Write>; -type Redux = (reducer: (state: T, action: A) => T, initialState: T) => StateCreator>, Cms, [ - [ - 'zustand/redux', - A - ] -]>; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/redux': WithRedux; - } -} -export declare const redux: Redux; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/middleware/subscribeWithSelector.d.ts b/node_modules/zustand/ts3.4/esm/middleware/subscribeWithSelector.d.ts deleted file mode 100644 index 98991f6..0000000 --- a/node_modules/zustand/ts3.4/esm/middleware/subscribeWithSelector.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type SubscribeWithSelector = (initializer: StateCreator) => StateCreator; -type Write = Pick> & U; -type WithSelectorSubscribe = S extends { - getState: () => infer T; -} ? Write> : never; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/subscribeWithSelector']: WithSelectorSubscribe; - } -} -type StoreSubscribeWithSelector = { - subscribe: { - (listener: (selectedState: T, previousSelectedState: T) => void): () => void; - (selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { - equalityFn?: (a: U, b: U) => boolean; - fireImmediately?: boolean; - }): () => void; - }; -}; -export declare const subscribeWithSelector: SubscribeWithSelector; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/react.d.ts b/node_modules/zustand/ts3.4/esm/react.d.ts deleted file mode 100644 index 24b5ccb..0000000 --- a/node_modules/zustand/ts3.4/esm/react.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStore>>(api: S): ExtractState; -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U): U; -/** - * @deprecated Use `useStoreWithEqualityFn` from 'zustand/traditional' - * https://github.com/pmndrs/zustand/discussions/1937 - */ -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U, equalityFn: ((a: U, b: U) => boolean) | undefined): U; -export type UseBoundStore>> = { - (): ExtractState; - (selector: (state: ExtractState) => U): U; - /** - * @deprecated Use `createWithEqualityFn` from 'zustand/traditional' - */ - (selector: (state: ExtractState) => U, equalityFn: (a: U, b: U) => boolean): U; -} & S; -type Create = { - (initializer: StateCreator): UseBoundStore, Mos>>; - (): (initializer: StateCreator) => UseBoundStore, Mos>>; - /** - * @deprecated Use `useStore` hook to bind store - */ - >(store: S): UseBoundStore; -}; -export declare const create: Create; -/** - * @deprecated Use `import { create } from 'zustand'` - */ -declare const _default: Create; -export default _default; diff --git a/node_modules/zustand/ts3.4/esm/react/shallow.d.ts b/node_modules/zustand/ts3.4/esm/react/shallow.d.ts deleted file mode 100644 index 9068d46..0000000 --- a/node_modules/zustand/ts3.4/esm/react/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallow(selector: (state: S) => U): (state: S) => U; diff --git a/node_modules/zustand/ts3.4/esm/shallow.d.ts b/node_modules/zustand/ts3.4/esm/shallow.d.ts deleted file mode 100644 index 0914a7c..0000000 --- a/node_modules/zustand/ts3.4/esm/shallow.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { shallow } from './vanilla/shallow'; -/** - * @deprecated Use `import { shallow } from 'zustand/shallow'` - */ -declare const _default: typeof shallow; -export default _default; -export { shallow }; diff --git a/node_modules/zustand/ts3.4/esm/traditional.d.ts b/node_modules/zustand/ts3.4/esm/traditional.d.ts deleted file mode 100644 index e16756f..0000000 --- a/node_modules/zustand/ts3.4/esm/traditional.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStoreWithEqualityFn>>(api: S): ExtractState; -export declare function useStoreWithEqualityFn>, U>(api: S, selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -export type UseBoundStoreWithEqualityFn>> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -} & S; -type CreateWithEqualityFn = { - (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean): UseBoundStoreWithEqualityFn, Mos>>; - (): (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn, Mos>>; -}; -export declare const createWithEqualityFn: CreateWithEqualityFn; -export {}; diff --git a/node_modules/zustand/ts3.4/esm/vanilla.d.ts b/node_modules/zustand/ts3.4/esm/vanilla.d.ts deleted file mode 100644 index 24d0bf5..0000000 --- a/node_modules/zustand/ts3.4/esm/vanilla.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -type SetStateInternal = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -export interface StoreApi { - setState: SetStateInternal; - getState: () => T; - subscribe: (listener: (state: T, prevState: T) => void) => () => void; - /** - * @deprecated Use `unsubscribe` returned by `subscribe` - */ - destroy: () => void; -} -type Get = K extends keyof T ? T[K] : F; -export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [ -] ? S : Ms extends [ - [ - infer Mi, - infer Ma - ], - ...infer Mrs -] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; -export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { - $$storeMutators?: Mos; -}; -export interface StoreMutators { -} -export type StoreMutatorIdentifier = keyof StoreMutators; -type CreateStore = { - (initializer: StateCreator): Mutate, Mos>; - (): (initializer: StateCreator) => Mutate, Mos>; -}; -export declare const createStore: CreateStore; -/** - * @deprecated Use `import { createStore } from 'zustand/vanilla'` - */ -declare const _default: CreateStore; -export default _default; -/** - * @deprecated Use `unknown` instead of `State` - */ -export type State = unknown; -/** - * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` - */ -export type PartialState = Partial | ((state: T) => Partial); -/** - * @deprecated Use `(s: T) => U` instead of `StateSelector` - */ -export type StateSelector = (state: T) => U; -/** - * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` - */ -export type EqualityChecker = (state: T, newState: T) => boolean; -/** - * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` - */ -export type StateListener = (state: T, previousState: T) => void; -/** - * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. - */ -export type StateSliceListener = (slice: T, previousSlice: T) => void; -/** - * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. - */ -export type Subscribe = { - (listener: (state: T, previousState: T) => void): () => void; -}; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['setState']` instead of `SetState`. - */ -export type SetState = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['getState']` instead of `GetState`. - */ -export type GetState = () => T; -/** - * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. - */ -export type Destroy = () => void; diff --git a/node_modules/zustand/ts3.4/esm/vanilla/shallow.d.ts b/node_modules/zustand/ts3.4/esm/vanilla/shallow.d.ts deleted file mode 100644 index a8d2354..0000000 --- a/node_modules/zustand/ts3.4/esm/vanilla/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function shallow(objA: T, objB: T): boolean; diff --git a/node_modules/zustand/ts3.4/index.d.ts b/node_modules/zustand/ts3.4/index.d.ts deleted file mode 100644 index 7e9c8b6..0000000 --- a/node_modules/zustand/ts3.4/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './vanilla'; -export * from './react'; -export { default } from './react'; diff --git a/node_modules/zustand/ts3.4/middleware.d.ts b/node_modules/zustand/ts3.4/middleware.d.ts deleted file mode 100644 index 1806630..0000000 --- a/node_modules/zustand/ts3.4/middleware.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './middleware/redux'; -export * from './middleware/devtools'; -export * from './middleware/subscribeWithSelector'; -export * from './middleware/combine'; -export * from './middleware/persist'; diff --git a/node_modules/zustand/ts3.4/middleware/combine.d.ts b/node_modules/zustand/ts3.4/middleware/combine.d.ts deleted file mode 100644 index 0701780..0000000 --- a/node_modules/zustand/ts3.4/middleware/combine.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Pick> & U; -type Combine = (initialState: T, additionalStateCreator: StateCreator) => StateCreator, Mps, Mcs>; -export declare const combine: Combine; -export {}; diff --git a/node_modules/zustand/ts3.4/middleware/devtools.d.ts b/node_modules/zustand/ts3.4/middleware/devtools.d.ts deleted file mode 100644 index afad734..0000000 --- a/node_modules/zustand/ts3.4/middleware/devtools.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla'; -type Config = Parameters<(Window extends { - __REDUX_DEVTOOLS_EXTENSION__?: infer T; -} ? T : { - connect: (param: any) => any; -})['connect']>[0]; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -type Cast = T extends U ? T : U; -type Write = Pick> & U; -type TakeTwo = T extends { - length: 0; -} ? [ - undefined, - undefined -] : T extends { - length: 1; -} ? [ - /*a0*/ ...Cast, - /*a1*/ undefined -] : T extends { - length: 0 | 1; -} ? [ - /*a0*/ ...Cast, - /*a1*/ undefined -] : T extends { - length: 2; -} ? T : T extends { - length: 1 | 2; -} ? T : T extends { - length: 0 | 1 | 2; -} ? T : T extends [ - infer A0, - infer A1, - ...unknown[] -] ? [ - A0, - A1 -] : T extends [ - infer A0, - (infer A1)?, - ...unknown[] -] ? [ - A0, - A1? -] : T extends [ - (infer A0)?, - (infer A1)?, - ...unknown[] -] ? [ - A0?, - A1? -] : never; -type WithDevtools = Write>; -type StoreDevtools = S extends { - setState: (...a: infer Sa) => infer Sr; -} ? { - setState(...a: [ - /*a*/ ...TakeTwo, - /*action*/ A - ]): Sr; -} : never; -export interface DevtoolsOptions extends Config { - name?: string; - enabled?: boolean; - anonymousActionType?: string; - store?: string; -} -type Devtools = (initializer: StateCreator, devtoolsOptions?: DevtoolsOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/devtools': WithDevtools; - } -} -export type NamedSet = WithDevtools>['setState']; -export declare const devtools: Devtools; -export {}; diff --git a/node_modules/zustand/ts3.4/middleware/immer.d.ts b/node_modules/zustand/ts3.4/middleware/immer.d.ts deleted file mode 100644 index 3f06c55..0000000 --- a/node_modules/zustand/ts3.4/middleware/immer.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Draft } from 'immer'; -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Immer = (initializer: StateCreator) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/immer']: WithImmer; - } -} -type Write = Pick> & U; -type SkipTwo = T extends { - length: 0; -} ? [ -] : T extends { - length: 1; -} ? [ -] : T extends { - length: 0 | 1; -} ? [ -] : T extends [ - unknown, - unknown, - ...infer A -] ? A : T extends [ - unknown, - unknown?, - ...infer A -] ? A : T extends [ - unknown?, - unknown?, - ...infer A -] ? A : never; -type WithImmer = Write>; -type StoreImmer = S extends { - getState: () => infer T; - setState: infer SetState; -} ? SetState extends (...a: infer A) => infer Sr ? { - setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; -} : never : never; -export declare const immer: Immer; -export {}; diff --git a/node_modules/zustand/ts3.4/middleware/persist.d.ts b/node_modules/zustand/ts3.4/middleware/persist.d.ts deleted file mode 100644 index 39dd638..0000000 --- a/node_modules/zustand/ts3.4/middleware/persist.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -export interface StateStorage { - getItem: (name: string) => string | null | Promise; - setItem: (name: string, value: string) => void | Promise; - removeItem: (name: string) => void | Promise; -} -export type StorageValue = { - state: S; - version?: number; -}; -export interface PersistStorage { - getItem: (name: string) => StorageValue | null | Promise | null>; - setItem: (name: string, value: StorageValue) => void | Promise; - removeItem: (name: string) => void | Promise; -} -type JsonStorageOptions = { - reviver?: (key: string, value: unknown) => unknown; - replacer?: (key: string, value: unknown) => unknown; -}; -export declare function createJSONStorage(getStorage: () => StateStorage, options?: JsonStorageOptions): PersistStorage | undefined; -export interface PersistOptions { - /** Name of the storage (must be unique) */ - name: string; - /** - * @deprecated Use `storage` instead. - * A function returning a storage. - * The storage must fit `window.localStorage`'s api (or an async version of it). - * For example the storage could be `AsyncStorage` from React Native. - * - * @default () => localStorage - */ - getStorage?: () => StateStorage; - /** - * @deprecated Use `storage` instead. - * Use a custom serializer. - * The returned string will be stored in the storage. - * - * @default JSON.stringify - */ - serialize?: (state: StorageValue) => string | Promise; - /** - * @deprecated Use `storage` instead. - * Use a custom deserializer. - * Must return an object matching StorageValue - * - * @param str The storage's current value. - * @default JSON.parse - */ - deserialize?: (str: string) => StorageValue | Promise>; - /** - * Use a custom persist storage. - * - * Combining `createJSONStorage` helps creating a persist storage - * with JSON.parse and JSON.stringify. - * - * @default createJSONStorage(() => localStorage) - */ - storage?: PersistStorage | undefined; - /** - * Filter the persisted value. - * - * @params state The state's value - */ - partialize?: (state: S) => PersistedState; - /** - * A function returning another (optional) function. - * The main function will be called before the state rehydration. - * The returned function will be called after the state rehydration or when an error occurred. - */ - onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void; - /** - * If the stored state's version mismatch the one specified here, the storage will not be used. - * This is useful when adding a breaking change to your store. - */ - version?: number; - /** - * A function to perform persisted state migration. - * This function will be called when persisted state versions mismatch with the one specified here. - */ - migrate?: (persistedState: unknown, version: number) => S | Promise; - /** - * A function to perform custom hydration merges when combining the stored state with the current one. - * By default, this function does a shallow merge. - */ - merge?: (persistedState: unknown, currentState: S) => S; - /** - * An optional boolean that will prevent the persist middleware from triggering hydration on initialization, - * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle. - * - * This is useful in SSR application. - * - * @default false - */ - skipHydration?: boolean; -} -type PersistListener = (state: S) => void; -type StorePersist = { - persist: { - setOptions: (options: Partial>) => void; - clearStorage: () => void; - rehydrate: () => Promise | void; - hasHydrated: () => boolean; - onHydrate: (fn: PersistListener) => () => void; - onFinishHydration: (fn: PersistListener) => () => void; - getOptions: () => Partial>; - }; -}; -type Persist = (initializer: StateCreator, options: PersistOptions) => StateCreator; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/persist': WithPersist; - } -} -type Write = Pick> & U; -type WithPersist = S extends { - getState: () => infer T; -} ? Write> : never; -export declare const persist: Persist; -export {}; diff --git a/node_modules/zustand/ts3.4/middleware/redux.d.ts b/node_modules/zustand/ts3.4/middleware/redux.d.ts deleted file mode 100644 index 24fe5c7..0000000 --- a/node_modules/zustand/ts3.4/middleware/redux.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type Write = Pick> & U; -type Action = { - type: string; -}; -type StoreRedux = { - dispatch: (a: A) => A; - dispatchFromDevtools: true; -}; -type ReduxState = { - dispatch: StoreRedux['dispatch']; -}; -type WithRedux = Write>; -type Redux = (reducer: (state: T, action: A) => T, initialState: T) => StateCreator>, Cms, [ - [ - 'zustand/redux', - A - ] -]>; -declare module '../vanilla' { - interface StoreMutators { - 'zustand/redux': WithRedux; - } -} -export declare const redux: Redux; -export {}; diff --git a/node_modules/zustand/ts3.4/middleware/subscribeWithSelector.d.ts b/node_modules/zustand/ts3.4/middleware/subscribeWithSelector.d.ts deleted file mode 100644 index 98991f6..0000000 --- a/node_modules/zustand/ts3.4/middleware/subscribeWithSelector.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; -type SubscribeWithSelector = (initializer: StateCreator) => StateCreator; -type Write = Pick> & U; -type WithSelectorSubscribe = S extends { - getState: () => infer T; -} ? Write> : never; -declare module '../vanilla' { - interface StoreMutators { - ['zustand/subscribeWithSelector']: WithSelectorSubscribe; - } -} -type StoreSubscribeWithSelector = { - subscribe: { - (listener: (selectedState: T, previousSelectedState: T) => void): () => void; - (selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: { - equalityFn?: (a: U, b: U) => boolean; - fireImmediately?: boolean; - }): () => void; - }; -}; -export declare const subscribeWithSelector: SubscribeWithSelector; -export {}; diff --git a/node_modules/zustand/ts3.4/react.d.ts b/node_modules/zustand/ts3.4/react.d.ts deleted file mode 100644 index 24b5ccb..0000000 --- a/node_modules/zustand/ts3.4/react.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStore>>(api: S): ExtractState; -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U): U; -/** - * @deprecated Use `useStoreWithEqualityFn` from 'zustand/traditional' - * https://github.com/pmndrs/zustand/discussions/1937 - */ -export declare function useStore>, U>(api: S, selector: (state: ExtractState) => U, equalityFn: ((a: U, b: U) => boolean) | undefined): U; -export type UseBoundStore>> = { - (): ExtractState; - (selector: (state: ExtractState) => U): U; - /** - * @deprecated Use `createWithEqualityFn` from 'zustand/traditional' - */ - (selector: (state: ExtractState) => U, equalityFn: (a: U, b: U) => boolean): U; -} & S; -type Create = { - (initializer: StateCreator): UseBoundStore, Mos>>; - (): (initializer: StateCreator) => UseBoundStore, Mos>>; - /** - * @deprecated Use `useStore` hook to bind store - */ - >(store: S): UseBoundStore; -}; -export declare const create: Create; -/** - * @deprecated Use `import { create } from 'zustand'` - */ -declare const _default: Create; -export default _default; diff --git a/node_modules/zustand/ts3.4/react/shallow.d.ts b/node_modules/zustand/ts3.4/react/shallow.d.ts deleted file mode 100644 index 9068d46..0000000 --- a/node_modules/zustand/ts3.4/react/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function useShallow(selector: (state: S) => U): (state: S) => U; diff --git a/node_modules/zustand/ts3.4/shallow.d.ts b/node_modules/zustand/ts3.4/shallow.d.ts deleted file mode 100644 index 0914a7c..0000000 --- a/node_modules/zustand/ts3.4/shallow.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { shallow } from './vanilla/shallow'; -/** - * @deprecated Use `import { shallow } from 'zustand/shallow'` - */ -declare const _default: typeof shallow; -export default _default; -export { shallow }; diff --git a/node_modules/zustand/ts3.4/traditional.d.ts b/node_modules/zustand/ts3.4/traditional.d.ts deleted file mode 100644 index e16756f..0000000 --- a/node_modules/zustand/ts3.4/traditional.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla'; -type ExtractState = S extends { - getState: () => infer T; -} ? T : never; -type ReadonlyStoreApi = Pick, 'getState' | 'subscribe'>; -type WithReact> = S & { - getServerState?: () => ExtractState; -}; -export declare function useStoreWithEqualityFn>>(api: S): ExtractState; -export declare function useStoreWithEqualityFn>, U>(api: S, selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -export type UseBoundStoreWithEqualityFn>> = { - (): ExtractState; - (selector: (state: ExtractState) => U, equalityFn?: (a: U, b: U) => boolean): U; -} & S; -type CreateWithEqualityFn = { - (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean): UseBoundStoreWithEqualityFn, Mos>>; - (): (initializer: StateCreator, defaultEqualityFn?: (a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn, Mos>>; -}; -export declare const createWithEqualityFn: CreateWithEqualityFn; -export {}; diff --git a/node_modules/zustand/ts3.4/vanilla.d.ts b/node_modules/zustand/ts3.4/vanilla.d.ts deleted file mode 100644 index 24d0bf5..0000000 --- a/node_modules/zustand/ts3.4/vanilla.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -type SetStateInternal = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -export interface StoreApi { - setState: SetStateInternal; - getState: () => T; - subscribe: (listener: (state: T, prevState: T) => void) => () => void; - /** - * @deprecated Use `unsubscribe` returned by `subscribe` - */ - destroy: () => void; -} -type Get = K extends keyof T ? T[K] : F; -export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [ -] ? S : Ms extends [ - [ - infer Mi, - infer Ma - ], - ...infer Mrs -] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; -export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { - $$storeMutators?: Mos; -}; -export interface StoreMutators { -} -export type StoreMutatorIdentifier = keyof StoreMutators; -type CreateStore = { - (initializer: StateCreator): Mutate, Mos>; - (): (initializer: StateCreator) => Mutate, Mos>; -}; -export declare const createStore: CreateStore; -/** - * @deprecated Use `import { createStore } from 'zustand/vanilla'` - */ -declare const _default: CreateStore; -export default _default; -/** - * @deprecated Use `unknown` instead of `State` - */ -export type State = unknown; -/** - * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` - */ -export type PartialState = Partial | ((state: T) => Partial); -/** - * @deprecated Use `(s: T) => U` instead of `StateSelector` - */ -export type StateSelector = (state: T) => U; -/** - * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` - */ -export type EqualityChecker = (state: T, newState: T) => boolean; -/** - * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` - */ -export type StateListener = (state: T, previousState: T) => void; -/** - * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. - */ -export type StateSliceListener = (slice: T, previousSlice: T) => void; -/** - * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. - */ -export type Subscribe = { - (listener: (state: T, previousState: T) => void): () => void; -}; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['setState']` instead of `SetState`. - */ -export type SetState = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['getState']` instead of `GetState`. - */ -export type GetState = () => T; -/** - * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. - */ -export type Destroy = () => void; diff --git a/node_modules/zustand/ts3.4/vanilla/shallow.d.ts b/node_modules/zustand/ts3.4/vanilla/shallow.d.ts deleted file mode 100644 index a8d2354..0000000 --- a/node_modules/zustand/ts3.4/vanilla/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function shallow(objA: T, objB: T): boolean; diff --git a/node_modules/zustand/umd/context.development.js b/node_modules/zustand/umd/context.development.js deleted file mode 100644 index 440229c..0000000 --- a/node_modules/zustand/umd/context.development.js +++ /dev/null @@ -1,68 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('zustand/traditional')) : - typeof define === 'function' && define.amd ? define(['react', 'zustand/traditional'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.zustandContext = factory(global.React, global.traditional)); -})(this, (function (ReactExports, traditional) { 'use strict'; - - function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); - } - - var createElement = ReactExports.createElement, - reactCreateContext = ReactExports.createContext, - useContext = ReactExports.useContext, - useMemo = ReactExports.useMemo, - useRef = ReactExports.useRef; - function createContext() { - { - console.warn("[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180."); - } - var ZustandContext = reactCreateContext(undefined); - var Provider = function Provider(_ref) { - var createStore = _ref.createStore, - children = _ref.children; - var storeRef = useRef(); - if (!storeRef.current) { - storeRef.current = createStore(); - } - return createElement(ZustandContext.Provider, { - value: storeRef.current - }, children); - }; - var useContextStore = function useContextStore(selector, equalityFn) { - var store = useContext(ZustandContext); - if (!store) { - throw new Error('Seems like you have not used zustand provider as an ancestor.'); - } - return traditional.useStoreWithEqualityFn(store, selector, equalityFn); - }; - var useStoreApi = function useStoreApi() { - var store = useContext(ZustandContext); - if (!store) { - throw new Error('Seems like you have not used zustand provider as an ancestor.'); - } - return useMemo(function () { - return _extends({}, store); - }, [store]); - }; - return { - Provider: Provider, - useStore: useContextStore, - useStoreApi: useStoreApi - }; - } - - return createContext; - -})); diff --git a/node_modules/zustand/umd/context.production.js b/node_modules/zustand/umd/context.production.js deleted file mode 100644 index f8f1ce1..0000000 --- a/node_modules/zustand/umd/context.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("zustand/traditional")):"function"==typeof define&&define.amd?define(["react","zustand/traditional"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).zustandContext=t(e.React,e.traditional)}(this,(function(e,t){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t= 0) continue; - target[key] = source[key]; - } - return target; - } - - var reduxImpl = function reduxImpl(reducer, initial) { - return function (set, _get, api) { - api.dispatch = function (action) { - set(function (state) { - return reducer(state, action); - }, false, action); - return action; - }; - api.dispatchFromDevtools = true; - return _extends({ - dispatch: function dispatch() { - var _ref; - return (_ref = api).dispatch.apply(_ref, arguments); - } - }, initial); - }; - }; - var redux = reduxImpl; - - var _excluded = ["enabled", "anonymousActionType", "store"], - _excluded2 = ["connection"]; - var trackedConnections = new Map(); - var getTrackedConnectionState = function getTrackedConnectionState(name) { - var api = trackedConnections.get(name); - if (!api) return {}; - return Object.fromEntries(Object.entries(api.stores).map(function (_ref) { - var key = _ref[0], - api = _ref[1]; - return [key, api.getState()]; - })); - }; - var extractConnectionInformation = function extractConnectionInformation(store, extensionConnector, options) { - if (store === undefined) { - return { - type: 'untracked', - connection: extensionConnector.connect(options) - }; - } - var existingConnection = trackedConnections.get(options.name); - if (existingConnection) { - return _extends({ - type: 'tracked', - store: store - }, existingConnection); - } - var newConnection = { - connection: extensionConnector.connect(options), - stores: {} - }; - trackedConnections.set(options.name, newConnection); - return _extends({ - type: 'tracked', - store: store - }, newConnection); - }; - var devtoolsImpl = function devtoolsImpl(fn, devtoolsOptions) { - if (devtoolsOptions === void 0) { - devtoolsOptions = {}; - } - return function (set, get, api) { - var _devtoolsOptions = devtoolsOptions, - enabled = _devtoolsOptions.enabled, - anonymousActionType = _devtoolsOptions.anonymousActionType, - store = _devtoolsOptions.store, - options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded); - var extensionConnector; - try { - extensionConnector = (enabled != null ? enabled : "development" !== 'production') && window.__REDUX_DEVTOOLS_EXTENSION__; - } catch (e) {} - if (!extensionConnector) { - if (enabled) { - console.warn('[zustand devtools middleware] Please install/enable Redux devtools extension'); - } - return fn(set, get, api); - } - var _extractConnectionInf = extractConnectionInformation(store, extensionConnector, options), - connection = _extractConnectionInf.connection, - connectionInformation = _objectWithoutPropertiesLoose(_extractConnectionInf, _excluded2); - var isRecording = true; - api.setState = function (state, replace, nameOrAction) { - var _extends2; - var r = set(state, replace); - if (!isRecording) return r; - var action = nameOrAction === undefined ? { - type: anonymousActionType || 'anonymous' - } : typeof nameOrAction === 'string' ? { - type: nameOrAction - } : nameOrAction; - if (store === undefined) { - connection == null || connection.send(action, get()); - return r; - } - connection == null || connection.send(_extends({}, action, { - type: store + "/" + action.type - }), _extends({}, getTrackedConnectionState(options.name), (_extends2 = {}, _extends2[store] = api.getState(), _extends2))); - return r; - }; - var setStateFromDevtools = function setStateFromDevtools() { - var originalIsRecording = isRecording; - isRecording = false; - set.apply(void 0, arguments); - isRecording = originalIsRecording; - }; - var initialState = fn(api.setState, get, api); - if (connectionInformation.type === 'untracked') { - connection == null || connection.init(initialState); - } else { - connectionInformation.stores[connectionInformation.store] = api; - connection == null || connection.init(Object.fromEntries(Object.entries(connectionInformation.stores).map(function (_ref2) { - var key = _ref2[0], - store = _ref2[1]; - return [key, key === connectionInformation.store ? initialState : store.getState()]; - }))); - } - if (api.dispatchFromDevtools && typeof api.dispatch === 'function') { - var didWarnAboutReservedActionType = false; - var originalDispatch = api.dispatch; - api.dispatch = function () { - for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) { - a[_key] = arguments[_key]; - } - if (a[0].type === '__setState' && !didWarnAboutReservedActionType) { - console.warn('[zustand devtools middleware] "__setState" action type is reserved ' + 'to set state from the devtools. Avoid using it.'); - didWarnAboutReservedActionType = true; - } - originalDispatch.apply(void 0, a); - }; - } - connection.subscribe(function (message) { - switch (message.type) { - case 'ACTION': - if (typeof message.payload !== 'string') { - console.error('[zustand devtools middleware] Unsupported action format'); - return; - } - return parseJsonThen(message.payload, function (action) { - if (action.type === '__setState') { - if (store === undefined) { - setStateFromDevtools(action.state); - return; - } - if (Object.keys(action.state).length !== 1) { - console.error("\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n "); - } - var stateFromDevtools = action.state[store]; - if (stateFromDevtools === undefined || stateFromDevtools === null) { - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) { - setStateFromDevtools(stateFromDevtools); - } - return; - } - if (!api.dispatchFromDevtools) return; - if (typeof api.dispatch !== 'function') return; - api.dispatch(action); - }); - case 'DISPATCH': - switch (message.payload.type) { - case 'RESET': - setStateFromDevtools(initialState); - if (store === undefined) { - return connection == null ? void 0 : connection.init(api.getState()); - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case 'COMMIT': - if (store === undefined) { - connection == null || connection.init(api.getState()); - return; - } - return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name)); - case 'ROLLBACK': - return parseJsonThen(message.state, function (state) { - if (store === undefined) { - setStateFromDevtools(state); - connection == null || connection.init(api.getState()); - return; - } - setStateFromDevtools(state[store]); - connection == null || connection.init(getTrackedConnectionState(options.name)); - }); - case 'JUMP_TO_STATE': - case 'JUMP_TO_ACTION': - return parseJsonThen(message.state, function (state) { - if (store === undefined) { - setStateFromDevtools(state); - return; - } - if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) { - setStateFromDevtools(state[store]); - } - }); - case 'IMPORT_STATE': - { - var _nextLiftedState$comp; - var nextLiftedState = message.payload.nextLiftedState; - var lastComputedState = (_nextLiftedState$comp = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _nextLiftedState$comp.state; - if (!lastComputedState) return; - if (store === undefined) { - setStateFromDevtools(lastComputedState); - } else { - setStateFromDevtools(lastComputedState[store]); - } - connection == null || connection.send(null, nextLiftedState); - return; - } - case 'PAUSE_RECORDING': - return isRecording = !isRecording; - } - return; - } - }); - return initialState; - }; - }; - var devtools = devtoolsImpl; - var parseJsonThen = function parseJsonThen(stringified, f) { - var parsed; - try { - parsed = JSON.parse(stringified); - } catch (e) { - console.error('[zustand devtools middleware] Could not parse the received json', e); - } - if (parsed !== undefined) f(parsed); - }; - - var subscribeWithSelectorImpl = function subscribeWithSelectorImpl(fn) { - return function (set, get, api) { - var origSubscribe = api.subscribe; - api.subscribe = function (selector, optListener, options) { - var listener = selector; - if (optListener) { - var equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is; - var currentSlice = selector(api.getState()); - listener = function listener(state) { - var nextSlice = selector(state); - if (!equalityFn(currentSlice, nextSlice)) { - var previousSlice = currentSlice; - optListener(currentSlice = nextSlice, previousSlice); - } - }; - if (options != null && options.fireImmediately) { - optListener(currentSlice, currentSlice); - } - } - return origSubscribe(listener); - }; - var initialState = fn(set, get, api); - return initialState; - }; - }; - var subscribeWithSelector = subscribeWithSelectorImpl; - - var combine = function combine(initialState, create) { - return function () { - return Object.assign({}, initialState, create.apply(void 0, arguments)); - }; - }; - - function createJSONStorage(getStorage, options) { - var storage; - try { - storage = getStorage(); - } catch (e) { - return; - } - var persistStorage = { - getItem: function getItem(name) { - var _getItem; - var parse = function parse(str) { - if (str === null) { - return null; - } - return JSON.parse(str, options == null ? void 0 : options.reviver); - }; - var str = (_getItem = storage.getItem(name)) != null ? _getItem : null; - if (str instanceof Promise) { - return str.then(parse); - } - return parse(str); - }, - setItem: function setItem(name, newValue) { - return storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)); - }, - removeItem: function removeItem(name) { - return storage.removeItem(name); - } - }; - return persistStorage; - } - var toThenable = function toThenable(fn) { - return function (input) { - try { - var result = fn(input); - if (result instanceof Promise) { - return result; - } - return { - then: function then(onFulfilled) { - return toThenable(onFulfilled)(result); - }, - catch: function _catch(_onRejected) { - return this; - } - }; - } catch (e) { - return { - then: function then(_onFulfilled) { - return this; - }, - catch: function _catch(onRejected) { - return toThenable(onRejected)(e); - } - }; - } - }; - }; - var oldImpl = function oldImpl(config, baseOptions) { - return function (set, get, api) { - var options = _extends({ - getStorage: function getStorage() { - return localStorage; - }, - serialize: JSON.stringify, - deserialize: JSON.parse, - partialize: function partialize(state) { - return state; - }, - version: 0, - merge: function merge(persistedState, currentState) { - return _extends({}, currentState, persistedState); - } - }, baseOptions); - var _hasHydrated = false; - var hydrationListeners = new Set(); - var finishHydrationListeners = new Set(); - var storage; - try { - storage = options.getStorage(); - } catch (e) {} - if (!storage) { - return config(function () { - console.warn("[zustand persist middleware] Unable to update item '" + options.name + "', the given storage is currently unavailable."); - set.apply(void 0, arguments); - }, get, api); - } - var thenableSerialize = toThenable(options.serialize); - var setItem = function setItem() { - var state = options.partialize(_extends({}, get())); - var errorInSync; - var thenable = thenableSerialize({ - state: state, - version: options.version - }).then(function (serializedValue) { - return storage.setItem(options.name, serializedValue); - }).catch(function (e) { - errorInSync = e; - }); - if (errorInSync) { - throw errorInSync; - } - return thenable; - }; - var savedSetState = api.setState; - api.setState = function (state, replace) { - savedSetState(state, replace); - void setItem(); - }; - var configResult = config(function () { - set.apply(void 0, arguments); - void setItem(); - }, get, api); - var stateFromStorage; - var hydrate = function hydrate() { - if (!storage) return; - _hasHydrated = false; - hydrationListeners.forEach(function (cb) { - return cb(get()); - }); - var postRehydrationCallback = (options.onRehydrateStorage == null ? void 0 : options.onRehydrateStorage(get())) || undefined; - return toThenable(storage.getItem.bind(storage))(options.name).then(function (storageValue) { - if (storageValue) { - return options.deserialize(storageValue); - } - }).then(function (deserializedStorageValue) { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === 'number' && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate(deserializedStorageValue.state, deserializedStorageValue.version); - } - console.error("State loaded from storage couldn't be migrated since no migrate function was provided"); - } else { - return deserializedStorageValue.state; - } - } - }).then(function (migratedState) { - var _get; - stateFromStorage = options.merge(migratedState, (_get = get()) != null ? _get : configResult); - set(stateFromStorage, true); - return setItem(); - }).then(function () { - postRehydrationCallback == null || postRehydrationCallback(stateFromStorage, undefined); - _hasHydrated = true; - finishHydrationListeners.forEach(function (cb) { - return cb(stateFromStorage); - }); - }).catch(function (e) { - postRehydrationCallback == null || postRehydrationCallback(undefined, e); - }); - }; - api.persist = { - setOptions: function setOptions(newOptions) { - options = _extends({}, options, newOptions); - if (newOptions.getStorage) { - storage = newOptions.getStorage(); - } - }, - clearStorage: function clearStorage() { - var _storage; - (_storage = storage) == null || _storage.removeItem(options.name); - }, - getOptions: function getOptions() { - return options; - }, - rehydrate: function rehydrate() { - return hydrate(); - }, - hasHydrated: function hasHydrated() { - return _hasHydrated; - }, - onHydrate: function onHydrate(cb) { - hydrationListeners.add(cb); - return function () { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: function onFinishHydration(cb) { - finishHydrationListeners.add(cb); - return function () { - finishHydrationListeners.delete(cb); - }; - } - }; - hydrate(); - return stateFromStorage || configResult; - }; - }; - var newImpl = function newImpl(config, baseOptions) { - return function (set, get, api) { - var options = _extends({ - storage: createJSONStorage(function () { - return localStorage; - }), - partialize: function partialize(state) { - return state; - }, - version: 0, - merge: function merge(persistedState, currentState) { - return _extends({}, currentState, persistedState); - } - }, baseOptions); - var _hasHydrated2 = false; - var hydrationListeners = new Set(); - var finishHydrationListeners = new Set(); - var storage = options.storage; - if (!storage) { - return config(function () { - console.warn("[zustand persist middleware] Unable to update item '" + options.name + "', the given storage is currently unavailable."); - set.apply(void 0, arguments); - }, get, api); - } - var setItem = function setItem() { - var state = options.partialize(_extends({}, get())); - return storage.setItem(options.name, { - state: state, - version: options.version - }); - }; - var savedSetState = api.setState; - api.setState = function (state, replace) { - savedSetState(state, replace); - void setItem(); - }; - var configResult = config(function () { - set.apply(void 0, arguments); - void setItem(); - }, get, api); - var stateFromStorage; - var hydrate = function hydrate() { - var _get3; - if (!storage) return; - _hasHydrated2 = false; - hydrationListeners.forEach(function (cb) { - var _get2; - return cb((_get2 = get()) != null ? _get2 : configResult); - }); - var postRehydrationCallback = (options.onRehydrateStorage == null ? void 0 : options.onRehydrateStorage((_get3 = get()) != null ? _get3 : configResult)) || undefined; - return toThenable(storage.getItem.bind(storage))(options.name).then(function (deserializedStorageValue) { - if (deserializedStorageValue) { - if (typeof deserializedStorageValue.version === 'number' && deserializedStorageValue.version !== options.version) { - if (options.migrate) { - return options.migrate(deserializedStorageValue.state, deserializedStorageValue.version); - } - console.error("State loaded from storage couldn't be migrated since no migrate function was provided"); - } else { - return deserializedStorageValue.state; - } - } - }).then(function (migratedState) { - var _get4; - stateFromStorage = options.merge(migratedState, (_get4 = get()) != null ? _get4 : configResult); - set(stateFromStorage, true); - return setItem(); - }).then(function () { - postRehydrationCallback == null || postRehydrationCallback(stateFromStorage, undefined); - stateFromStorage = get(); - _hasHydrated2 = true; - finishHydrationListeners.forEach(function (cb) { - return cb(stateFromStorage); - }); - }).catch(function (e) { - postRehydrationCallback == null || postRehydrationCallback(undefined, e); - }); - }; - api.persist = { - setOptions: function setOptions(newOptions) { - options = _extends({}, options, newOptions); - if (newOptions.storage) { - storage = newOptions.storage; - } - }, - clearStorage: function clearStorage() { - var _storage2; - (_storage2 = storage) == null || _storage2.removeItem(options.name); - }, - getOptions: function getOptions() { - return options; - }, - rehydrate: function rehydrate() { - return hydrate(); - }, - hasHydrated: function hasHydrated() { - return _hasHydrated2; - }, - onHydrate: function onHydrate(cb) { - hydrationListeners.add(cb); - return function () { - hydrationListeners.delete(cb); - }; - }, - onFinishHydration: function onFinishHydration(cb) { - finishHydrationListeners.add(cb); - return function () { - finishHydrationListeners.delete(cb); - }; - } - }; - if (!options.skipHydration) { - hydrate(); - } - return stateFromStorage || configResult; - }; - }; - var persistImpl = function persistImpl(config, baseOptions) { - if ('getStorage' in baseOptions || 'serialize' in baseOptions || 'deserialize' in baseOptions) { - { - console.warn('[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.'); - } - return oldImpl(config, baseOptions); - } - return newImpl(config, baseOptions); - }; - var persist = persistImpl; - - exports.combine = combine; - exports.createJSONStorage = createJSONStorage; - exports.devtools = devtools; - exports.persist = persist; - exports.redux = redux; - exports.subscribeWithSelector = subscribeWithSelector; - -})); diff --git a/node_modules/zustand/umd/middleware.production.js b/node_modules/zustand/umd/middleware.production.js deleted file mode 100644 index 361ae08..0000000 --- a/node_modules/zustand/umd/middleware.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zustandMiddleware={})}(this,(function(t){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0||(i[n]=t[n]);return i}var r=function(t,n){return function(r,i,o){return o.dispatch=function(e){return r((function(n){return t(n,e)}),!1,e),e},o.dispatchFromDevtools=!0,e({dispatch:function(){var t;return(t=o).dispatch.apply(t,arguments)}},n)}},i=["enabled","anonymousActionType","store"],o=["connection"],a=new Map,u=function(t){var e=a.get(t);return e?Object.fromEntries(Object.entries(e.stores).map((function(t){return[t[0],t[1].getState()]}))):{}},s=function(t,r){return void 0===r&&(r={}),function(s,f,l){var d,v=r,p=v.enabled,y=v.anonymousActionType,g=v.store,m=n(v,i);try{d=null!=p&&p&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!d)return t(s,f,l);var h=function(t,n,r){if(void 0===t)return{type:"untracked",connection:n.connect(r)};var i=a.get(r.name);if(i)return e({type:"tracked",store:t},i);var o={connection:n.connect(r),stores:{}};return a.set(r.name,o),e({type:"tracked",store:t},o)}(g,d,m),S=h.connection,b=n(h,o),O=!0;l.setState=function(t,n,r){var i,o=s(t,n);if(!O)return o;var a=void 0===r?{type:y||"anonymous"}:"string"==typeof r?{type:r}:r;return void 0===g?(null==S||S.send(a,f()),o):(null==S||S.send(e({},a,{type:g+"/"+a.type}),e({},u(m.name),((i={})[g]=l.getState(),i))),o)};var w=function(){var t=O;O=!1,s.apply(void 0,arguments),O=t},I=t(l.setState,f,l);if("untracked"===b.type?null==S||S.init(I):(b.stores[b.store]=l,null==S||S.init(Object.fromEntries(Object.entries(b.stores).map((function(t){var e=t[0],n=t[1];return[e,e===b.store?I:n.getState()]}))))),l.dispatchFromDevtools&&"function"==typeof l.dispatch){var T=l.dispatch;l.dispatch=function(){for(var t=arguments.length,e=new Array(t),n=0;n 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - a[_key - 2] = arguments[_key]; - } - return set.apply(void 0, [nextState, replace].concat(a)); - }; - return initializer(store.setState, get, store); - }; - }; - var immer = immerImpl; - - exports.immer = immer; - -})); diff --git a/node_modules/zustand/umd/middleware/immer.production.js b/node_modules/zustand/umd/middleware/immer.production.js deleted file mode 100644 index 1405dfb..0000000 --- a/node_modules/zustand/umd/middleware/immer.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("immer")):"function"==typeof define&&define.amd?define(["exports","immer"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zustandMiddlewareImmer={},e.immer)}(this,(function(e,t){"use strict";var n=function(e){return function(n,r,i){return i.setState=function(e,r){for(var i="function"==typeof e?t.produce(e):e,o=arguments.length,f=new Array(o>2?o-2:0),u=2;u arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - var useRef = ReactExports.useRef; - function useShallow(selector) { - var prev = useRef(); - return function (state) { - var next = selector(state); - return shallow(prev.current, next) ? prev.current : prev.current = next; - }; - } - - exports.useShallow = useShallow; - -})); diff --git a/node_modules/zustand/umd/react/shallow.production.js b/node_modules/zustand/umd/react/shallow.production.js deleted file mode 100644 index aecb197..0000000 --- a/node_modules/zustand/umd/react/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zustandReactShallow={},e.React)}(this,(function(e,t){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o=t.useRef;e.useShallow=function(e){var t=o();return function(r){var o=e(r);return function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(var r,o=n(e);!(r=o()).done;){var i=r.value,a=i[0],u=i[1];if(!Object.is(u,t.get(a)))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(var f,c=n(e);!(f=c()).done;){var l=f.value;if(!t.has(l))return!1}return!0}var s=Object.keys(e);if(s.length!==Object.keys(t).length)return!1;for(var y=0;y arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function shallow$1(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - var shallow = (function (objA, objB) { - { - console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`."); - } - return shallow$1(objA, objB); - }); - - exports.default = shallow; - exports.shallow = shallow$1; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/node_modules/zustand/umd/shallow.production.js b/node_modules/zustand/umd/shallow.production.js deleted file mode 100644 index 49198cd..0000000 --- a/node_modules/zustand/umd/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zustandShallow={})}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(var n,o=r(e);!(n=o()).done;){var i=n.value,a=i[0],f=i[1];if(!Object.is(f,t.get(a)))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(var u,l=r(e);!(u=l()).done;){var s=u.value;if(!t.has(s))return!1}return!0}var c=Object.keys(e);if(c.length!==Object.keys(t).length)return!1;for(var d=0;d arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; - } - - exports.shallow = shallow; - -})); diff --git a/node_modules/zustand/umd/vanilla/shallow.production.js b/node_modules/zustand/umd/vanilla/shallow.production.js deleted file mode 100644 index e511ba2..0000000 --- a/node_modules/zustand/umd/vanilla/shallow.production.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zustandVanillaShallow={})}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.shallow=function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(var n,o=r(e);!(n=o()).done;){var i=n.value,a=i[0],f=i[1];if(!Object.is(f,t.get(a)))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(var l,u=r(e);!(l=u()).done;){var s=l.value;if(!t.has(s))return!1}return!0}var c=Object.keys(e);if(c.length!==Object.keys(t).length)return!1;for(var y=0;y = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -export interface StoreApi { - setState: SetStateInternal; - getState: () => T; - subscribe: (listener: (state: T, prevState: T) => void) => () => void; - /** - * @deprecated Use `unsubscribe` returned by `subscribe` - */ - destroy: () => void; -} -type Get = K extends keyof T ? T[K] : F; -export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; -export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { - $$storeMutators?: Mos; -}; -export interface StoreMutators { -} -export type StoreMutatorIdentifier = keyof StoreMutators; -type CreateStore = { - (initializer: StateCreator): Mutate, Mos>; - (): (initializer: StateCreator) => Mutate, Mos>; -}; -export declare const createStore: CreateStore; -/** - * @deprecated Use `import { createStore } from 'zustand/vanilla'` - */ -declare const _default: CreateStore; -export default _default; -/** - * @deprecated Use `unknown` instead of `State` - */ -export type State = unknown; -/** - * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` - */ -export type PartialState = Partial | ((state: T) => Partial); -/** - * @deprecated Use `(s: T) => U` instead of `StateSelector` - */ -export type StateSelector = (state: T) => U; -/** - * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` - */ -export type EqualityChecker = (state: T, newState: T) => boolean; -/** - * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` - */ -export type StateListener = (state: T, previousState: T) => void; -/** - * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. - */ -export type StateSliceListener = (slice: T, previousSlice: T) => void; -/** - * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. - */ -export type Subscribe = { - (listener: (state: T, previousState: T) => void): () => void; -}; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['setState']` instead of `SetState`. - */ -export type SetState = { - _(partial: T | Partial | { - _(state: T): T | Partial; - }['_'], replace?: boolean | undefined): void; -}['_']; -/** - * @deprecated You might be looking for `StateCreator`, if not then - * use `StoreApi['getState']` instead of `GetState`. - */ -export type GetState = () => T; -/** - * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. - */ -export type Destroy = () => void; diff --git a/node_modules/zustand/vanilla.js b/node_modules/zustand/vanilla.js deleted file mode 100644 index 6413277..0000000 --- a/node_modules/zustand/vanilla.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var createStoreImpl = function createStoreImpl(createState) { - var state; - var listeners = new Set(); - var setState = function setState(partial, replace) { - var nextState = typeof partial === 'function' ? partial(state) : partial; - if (!Object.is(nextState, state)) { - var _previousState = state; - state = (replace != null ? replace : typeof nextState !== 'object' || nextState === null) ? nextState : Object.assign({}, state, nextState); - listeners.forEach(function (listener) { - return listener(state, _previousState); - }); - } - }; - var getState = function getState() { - return state; - }; - var subscribe = function subscribe(listener) { - listeners.add(listener); - return function () { - return listeners.delete(listener); - }; - }; - var destroy = function destroy() { - if (process.env.NODE_ENV !== 'production') { - console.warn('[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.'); - } - listeners.clear(); - }; - var api = { - setState: setState, - getState: getState, - subscribe: subscribe, - destroy: destroy - }; - state = createState(setState, getState, api); - return api; -}; -var createStore = function createStore(createState) { - return createState ? createStoreImpl(createState) : createStoreImpl; -}; -var vanilla = (function (createState) { - if (process.env.NODE_ENV !== 'production') { - console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."); - } - return createStore(createState); -}); - -exports.createStore = createStore; -exports.default = vanilla; - -module.exports = vanilla; -module.exports.createStore = createStore; -exports.default = module.exports; diff --git a/node_modules/zustand/vanilla/shallow.d.ts b/node_modules/zustand/vanilla/shallow.d.ts deleted file mode 100644 index a8d2354..0000000 --- a/node_modules/zustand/vanilla/shallow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function shallow(objA: T, objB: T): boolean; diff --git a/node_modules/zustand/vanilla/shallow.js b/node_modules/zustand/vanilla/shallow.js deleted file mode 100644 index b0b8343..0000000 --- a/node_modules/zustand/vanilla/shallow.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; -} -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function shallow(objA, objB) { - if (Object.is(objA, objB)) { - return true; - } - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - if (objA instanceof Map && objB instanceof Map) { - if (objA.size !== objB.size) return false; - for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) { - var _step$value = _step.value, - key = _step$value[0], - value = _step$value[1]; - if (!Object.is(value, objB.get(key))) { - return false; - } - } - return true; - } - if (objA instanceof Set && objB instanceof Set) { - if (objA.size !== objB.size) return false; - for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) { - var _value = _step2.value; - if (!objB.has(_value)) { - return false; - } - } - return true; - } - var keysA = Object.keys(objA); - if (keysA.length !== Object.keys(objB).length) { - return false; - } - for (var i = 0; i < keysA.length; i++) { - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - return true; -} - -exports.shallow = shallow; diff --git a/package.json b/package.json deleted file mode 100644 index 5d45607..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "zustand": "^4.4.7" - } -}