{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^0.3.0"],
  "sourcesContent": ["import { Data, useObserveData } from \"framer\";\nexport function createStore(state) {\n    // Use Data so that a Preview reload resets the state\n    const store = Data({\n        state: Object.freeze({\n            ...state\n        })\n    });\n    // Create a set function that updates the state\n    const setStoreState = (newState)=>{\n        // If the state is an object, make sure we copy it\n        if (typeof newState === \"function\") {\n            newState = newState(store.state);\n        }\n        store.state = Object.freeze({\n            ...store.state,\n            ...newState\n        });\n    };\n    // Create the actual hook based on everything above\n    function useStore() {\n        useObserveData();\n        return [\n            store.state,\n            setStoreState\n        ];\n    }\n    return useStore;\n}\n\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./createStore.map"],
  "mappings": "gDACO,SAASA,EAAYC,EAAO,CAE/B,IAAMC,EAAQC,EAAK,CACf,MAAO,OAAO,OAAO,CACjB,GAAGF,CACP,CAAC,CACL,CAAC,EAEKG,EAAiBC,GAAW,CAE1B,OAAOA,GAAa,aACpBA,EAAWA,EAASH,EAAM,KAAK,GAEnCA,EAAM,MAAQ,OAAO,OAAO,CACxB,GAAGA,EAAM,MACT,GAAGG,CACP,CAAC,CACL,EAEA,SAASC,GAAW,CAChB,OAAAC,EAAe,EACR,CACHL,EAAM,MACNE,CACJ,CACJ,CACA,OAAOE,CACX",
  "names": ["createStore", "state", "store", "Data", "setStoreState", "newState", "useStore", "useObserveData"]
}
