diff --git a/node_modules/.cache/.eslintcache b/node_modules/.cache/.eslintcache index 249f6583..096297a5 100644 --- a/node_modules/.cache/.eslintcache +++ b/node_modules/.cache/.eslintcache @@ -1 +1 @@ -[{"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/index.js":"1","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/App.js":"2","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/reportWebVitals.js":"3","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUs/index.js":"4","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Homepage/index.js":"5","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/BoxNextToEachOther/index.js":"6","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/RoomCardInfo/index.js":"7","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DistributedData/index.js":"8","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUsInfoCard/index.js":"9","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ReligiousTimes/index.js":"10","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Button/index.js":"11","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/FormInput/index.js":"12","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/index.js":"13","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Login/index.js":"14","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/Input.js":"15","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DateRangePicker/index.js":"16","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSelectBox/index.js":"17","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSwitch/index.js":"18","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/DateTime/index.js":"19","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/HorizontalTextDivider/index.js":"20","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/ProfileInfo/index.js":"21","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/fixNumbers.js":"22","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentTime/index.js":"23","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentDateShamsi/index.js":"24","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/LeafletMap/index.js":"25","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign1/index.js":"26","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast/index.js":"27","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/IconText/index.js":"28","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/TitleSubtitle/index.js":"29","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign3/index.js":"30","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast2/index.js":"31","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/SearchBox/index.js":"32","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js":"33","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ButtonDivTag/index.js":"34","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CreateMap/index.js":"35","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/store.js":"36"},{"size":487,"mtime":1659603603609,"results":"37","hashOfConfig":"38"},{"size":437,"mtime":1659628479307,"results":"39","hashOfConfig":"38"},{"size":362,"mtime":1657010915301,"results":"40","hashOfConfig":"38"},{"size":550,"mtime":1659248415210,"results":"41","hashOfConfig":"38"},{"size":2012,"mtime":1659627172347,"results":"42","hashOfConfig":"38"},{"size":1565,"mtime":1659290521337,"results":"43","hashOfConfig":"38"},{"size":1466,"mtime":1659210452590,"results":"44","hashOfConfig":"38"},{"size":2448,"mtime":1659290797172,"results":"45","hashOfConfig":"38"},{"size":1909,"mtime":1659210437404,"results":"46","hashOfConfig":"38"},{"size":1141,"mtime":1659290786467,"results":"47","hashOfConfig":"38"},{"size":990,"mtime":1657432674268,"results":"48","hashOfConfig":"38"},{"size":3649,"mtime":1659614529541,"results":"49","hashOfConfig":"38"},{"size":441,"mtime":1659290777410,"results":"50","hashOfConfig":"38"},{"size":2953,"mtime":1659287041693,"results":"51","hashOfConfig":"38"},{"size":2587,"mtime":1659270739901,"results":"52","hashOfConfig":"38"},{"size":1788,"mtime":1657611566992,"results":"53","hashOfConfig":"38"},{"size":608,"mtime":1657613668288,"results":"54","hashOfConfig":"38"},{"size":1923,"mtime":1657440765149,"results":"55","hashOfConfig":"38"},{"size":522,"mtime":1657434962806,"results":"56","hashOfConfig":"38"},{"size":565,"mtime":1659271142385,"results":"57","hashOfConfig":"38"},{"size":1414,"mtime":1657434935090,"results":"58","hashOfConfig":"38"},{"size":474,"mtime":1657440246924,"results":"59","hashOfConfig":"38"},{"size":375,"mtime":1657434901885,"results":"60","hashOfConfig":"38"},{"size":667,"mtime":1657434876823,"results":"61","hashOfConfig":"38"},{"size":8011,"mtime":1659627126449,"results":"62","hashOfConfig":"38"},{"size":580,"mtime":1659615350300,"results":"63","hashOfConfig":"38"},{"size":494,"mtime":1659600181493,"results":"64","hashOfConfig":"38"},{"size":643,"mtime":1659600158484,"results":"65","hashOfConfig":"38"},{"size":1213,"mtime":1659599668644,"results":"66","hashOfConfig":"38"},{"size":1050,"mtime":1659602857987,"results":"67","hashOfConfig":"38"},{"size":3575,"mtime":1659600462499,"results":"68","hashOfConfig":"38"},{"size":1382,"mtime":1659600474043,"results":"69","hashOfConfig":"38"},{"size":3143,"mtime":1659615826112,"results":"70","hashOfConfig":"38"},{"size":574,"mtime":1659603460996,"results":"71","hashOfConfig":"38"},{"size":773,"mtime":1659628046222,"results":"72","hashOfConfig":"38"},{"size":782,"mtime":1659628579119,"results":"73","hashOfConfig":"38"},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"chbpuq",{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"84","messages":"85","suppressedMessages":"86","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"87","messages":"88","suppressedMessages":"89","errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"90","messages":"91","suppressedMessages":"92","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"93","messages":"94","suppressedMessages":"95","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"99","messages":"100","suppressedMessages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"117","usedDeprecatedRules":"83"},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"124","usedDeprecatedRules":"83"},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"137","messages":"138","suppressedMessages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"140","usedDeprecatedRules":"83"},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"147","usedDeprecatedRules":"83"},{"filePath":"148","messages":"149","suppressedMessages":"150","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"151","messages":"152","suppressedMessages":"153","errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"154","messages":"155","suppressedMessages":"156","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"157","messages":"158","suppressedMessages":"159","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"160","messages":"161","suppressedMessages":"162","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"163","messages":"164","suppressedMessages":"165","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"166","messages":"167","suppressedMessages":"168","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"169","messages":"170","suppressedMessages":"171","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"172","messages":"173","suppressedMessages":"174","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"175","messages":"176","suppressedMessages":"177","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"178","messages":"179","suppressedMessages":"180","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"83"},{"filePath":"181","messages":"182","suppressedMessages":"183","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"184","messages":"185","suppressedMessages":"186","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/App.js",["187","188"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/reportWebVitals.js",[],[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUs/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Homepage/index.js",["189","190","191","192","193","194"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/BoxNextToEachOther/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/RoomCardInfo/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DistributedData/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUsInfoCard/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ReligiousTimes/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Button/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/FormInput/index.js",["195"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Login/index.js",["196"],[],"import React from \"react\";\nimport Input from \"../AnimatedInput/Input\";\nimport { useForm } from \"react-hook-form\";\nimport Button from \"../Button\";\nimport HorizontalTextDivider from \"../HorizontalTextDivider\";\n\nconst Login = () => {\n const { register, getValues } = useForm();\n\n return (\n \n {/* right */}\n
\n {/* logo && site title */}\n
\n {/* logo */}\n \"logo\"\n {/* name */}\n
\n

رزرو

\n

\n سامانه رزرواسیون خدام و زوار موکب مرکز\n

\n
\n
\n {/* user logo && user title */}\n
\n {/* logo */}\n \"logo\"\n {/* divider */}\n
\n {/* name */}\n

ورود زوار و خادمین محترم

\n
\n {/* divider */}\n
\n \n \n \n {\" \"}\n \n
\n {/* divider */}\n
\n {/* left */}\n
\n \n
\n \n );\n};\n\nexport default Login;\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/Input.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DateRangePicker/index.js",["197"],[],"// it has style inside index.scss ---> // Start DateRangePicker && end DateRangePicker\n\nimport React, { useEffect } from \"react\";\nimport DatePicker from \"react-multi-date-picker\";\nimport \"./index.scss\";\n\nimport persian from \"react-date-object/calendars/persian\";\nimport persian_fa from \"react-date-object/locales/persian_fa\";\n\nconst weekDays = [\n \"شنبه\",\n \"یکشنبه\",\n \"دوشنبه\",\n \"سشنبه\",\n \"چهارشنبه\",\n \"پنجشنبه\",\n \"جمعه\",\n];\n\nfunction CustomRangeInput({ openCalendar, value }) {\n useEffect(() => {\n openCalendar();\n }, []);\n\n return (\n
\n \n

تا

\n \n
\n );\n}\n\nconst DateRangePicker = () => {\n return (\n
\n false}\n arrow={false}\n minDate={new Date()}\n render={}\n weekDays={weekDays}\n />\n
\n );\n};\n\nexport default DateRangePicker;\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSelectBox/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSwitch/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/DateTime/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/HorizontalTextDivider/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/ProfileInfo/index.js",["198"],[],"import React from \"react\";\n\nconst ProfileInfo = ({ name, role }) => {\n return (\n
\n \n
\n

{name}

\n {role}\n
\n {/* dropdown */}\n \n \n \n \n \n
  • \n \n Dashboard\n \n
  • \n \n
    \n \n );\n};\n\nexport default ProfileInfo;\n\nProfileInfo.defaultProps = {\n name: \"سبحان قاسمی\",\n role: \"خادم محترم\",\n};\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/fixNumbers.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentTime/index.js",["199"],[],"import React from \"react\";\n\nconst CurrentTime = ({ className }) => {\n const today = new Date(),\n time =\n today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n {\n console.log(time);\n }\n return

    {time}

    ;\n};\n\nexport default CurrentTime;\n\nCurrentTime.defaultProps = {\n className: \"text-sm\",\n};\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentDateShamsi/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/LeafletMap/index.js",["200","201","202","203","204","205"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign1/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/IconText/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/TitleSubtitle/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign3/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast2/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/SearchBox/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ButtonDivTag/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CreateMap/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/store.js",["206"],[],{"ruleId":"207","severity":1,"message":"208","line":4,"column":8,"nodeType":"209","messageId":"210","endLine":4,"endColumn":17},{"ruleId":"207","severity":1,"message":"211","line":5,"column":8,"nodeType":"209","messageId":"210","endLine":5,"endColumn":18},{"ruleId":"207","severity":1,"message":"212","line":4,"column":8,"nodeType":"209","messageId":"210","endLine":4,"endColumn":26},{"ruleId":"207","severity":1,"message":"213","line":5,"column":8,"nodeType":"209","messageId":"210","endLine":5,"endColumn":14},{"ruleId":"207","severity":1,"message":"214","line":7,"column":8,"nodeType":"209","messageId":"210","endLine":7,"endColumn":22},{"ruleId":"207","severity":1,"message":"215","line":8,"column":8,"nodeType":"209","messageId":"210","endLine":8,"endColumn":23},{"ruleId":"207","severity":1,"message":"216","line":9,"column":8,"nodeType":"209","messageId":"210","endLine":9,"endColumn":17},{"ruleId":"207","severity":1,"message":"217","line":10,"column":8,"nodeType":"209","messageId":"210","endLine":10,"endColumn":13},{"ruleId":"207","severity":1,"message":"218","line":13,"column":21,"nodeType":"209","messageId":"210","endLine":13,"endColumn":30},{"ruleId":"207","severity":1,"message":"218","line":8,"column":21,"nodeType":"209","messageId":"210","endLine":8,"endColumn":30},{"ruleId":"219","severity":1,"message":"220","line":23,"column":6,"nodeType":"221","endLine":23,"endColumn":8,"suggestions":"222"},{"ruleId":"223","severity":1,"message":"224","line":36,"column":13,"nodeType":"225","endLine":39,"endColumn":14},{"ruleId":"226","severity":1,"message":"227","line":7,"column":3,"nodeType":"228","messageId":"229","endLine":9,"endColumn":4},{"ruleId":"207","severity":1,"message":"230","line":3,"column":35,"nodeType":"209","messageId":"210","endLine":3,"endColumn":42},{"ruleId":"207","severity":1,"message":"231","line":9,"column":3,"nodeType":"209","messageId":"210","endLine":9,"endColumn":12},{"ruleId":"207","severity":1,"message":"232","line":29,"column":7,"nodeType":"209","messageId":"210","endLine":29,"endColumn":12},{"ruleId":"207","severity":1,"message":"233","line":168,"column":10,"nodeType":"209","messageId":"210","endLine":168,"endColumn":21},{"ruleId":"207","severity":1,"message":"234","line":169,"column":9,"nodeType":"209","messageId":"210","endLine":169,"endColumn":12},{"ruleId":"207","severity":1,"message":"235","line":191,"column":9,"nodeType":"209","messageId":"210","endLine":191,"endColumn":17},{"ruleId":"236","severity":1,"message":"237","line":22,"column":1,"nodeType":"238","endLine":31,"endColumn":3},"no-unused-vars","'ContactUs' is defined but never used.","Identifier","unusedVar","'LeafletMap' is defined but never used.","'BoxNextToEachOther' is defined but never used.","'Button' is defined but never used.","'ReligiousTimes' is defined but never used.","'DistributedData' is defined but never used.","'FormInput' is defined but never used.","'Login' is defined but never used.","'getValues' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'openCalendar'. Either include it or remove the dependency array. If 'openCalendar' changes too often, find the parent component that defines it and wrap that definition in useCallback.","ArrayExpression",["239"],"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-lone-blocks","Nested block is redundant.","BlockStatement","redundantNestedBlock","'useMemo' is defined but never used.","'Rectangle' is defined but never used.","'pinMB' is assigned a value but never used.","'MyComponent' is defined but never used.","'map' is assigned a value but never used.","'location' is assigned a value but never used.","import/no-anonymous-default-export","Assign arrow function to a variable before exporting as module default","ExportDefaultDeclaration",{"desc":"240","fix":"241"},"Update the dependencies array to be: [openCalendar]",{"range":"242","text":"243"},[530,532],"[openCalendar]"] \ No newline at end of file +[{"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/index.js":"1","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/App.js":"2","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/reportWebVitals.js":"3","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUs/index.js":"4","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Homepage/index.js":"5","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/BoxNextToEachOther/index.js":"6","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/RoomCardInfo/index.js":"7","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DistributedData/index.js":"8","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUsInfoCard/index.js":"9","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ReligiousTimes/index.js":"10","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Button/index.js":"11","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/FormInput/index.js":"12","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/index.js":"13","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Login/index.js":"14","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/Input.js":"15","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DateRangePicker/index.js":"16","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSelectBox/index.js":"17","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSwitch/index.js":"18","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/DateTime/index.js":"19","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/HorizontalTextDivider/index.js":"20","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/ProfileInfo/index.js":"21","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/fixNumbers.js":"22","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentTime/index.js":"23","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentDateShamsi/index.js":"24","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/LeafletMap/index.js":"25","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign1/index.js":"26","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast/index.js":"27","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/IconText/index.js":"28","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/TitleSubtitle/index.js":"29","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign3/index.js":"30","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast2/index.js":"31","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/SearchBox/index.js":"32","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js":"33","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ButtonDivTag/index.js":"34","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CreateMap/index.js":"35","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/store.js":"36","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/reducers/index.js":"37"},{"size":487,"mtime":1659603603609,"results":"38","hashOfConfig":"39"},{"size":437,"mtime":1659628479307,"results":"40","hashOfConfig":"39"},{"size":362,"mtime":1657010915301,"results":"41","hashOfConfig":"39"},{"size":550,"mtime":1659248415210,"results":"42","hashOfConfig":"39"},{"size":2012,"mtime":1659627172347,"results":"43","hashOfConfig":"39"},{"size":1565,"mtime":1659290521337,"results":"44","hashOfConfig":"39"},{"size":1466,"mtime":1659210452590,"results":"45","hashOfConfig":"39"},{"size":2448,"mtime":1659290797172,"results":"46","hashOfConfig":"39"},{"size":1909,"mtime":1659210437404,"results":"47","hashOfConfig":"39"},{"size":1141,"mtime":1659290786467,"results":"48","hashOfConfig":"39"},{"size":990,"mtime":1657432674268,"results":"49","hashOfConfig":"39"},{"size":3649,"mtime":1659614529541,"results":"50","hashOfConfig":"39"},{"size":441,"mtime":1659290777410,"results":"51","hashOfConfig":"39"},{"size":2953,"mtime":1659287041693,"results":"52","hashOfConfig":"39"},{"size":2587,"mtime":1659270739901,"results":"53","hashOfConfig":"39"},{"size":1788,"mtime":1657611566992,"results":"54","hashOfConfig":"39"},{"size":608,"mtime":1657613668288,"results":"55","hashOfConfig":"39"},{"size":1923,"mtime":1657440765149,"results":"56","hashOfConfig":"39"},{"size":522,"mtime":1657434962806,"results":"57","hashOfConfig":"39"},{"size":565,"mtime":1659271142385,"results":"58","hashOfConfig":"39"},{"size":1414,"mtime":1657434935090,"results":"59","hashOfConfig":"39"},{"size":474,"mtime":1657440246924,"results":"60","hashOfConfig":"39"},{"size":375,"mtime":1657434901885,"results":"61","hashOfConfig":"39"},{"size":667,"mtime":1657434876823,"results":"62","hashOfConfig":"39"},{"size":8011,"mtime":1659627126449,"results":"63","hashOfConfig":"39"},{"size":580,"mtime":1659615350300,"results":"64","hashOfConfig":"39"},{"size":494,"mtime":1659600181493,"results":"65","hashOfConfig":"39"},{"size":643,"mtime":1659600158484,"results":"66","hashOfConfig":"39"},{"size":1213,"mtime":1659599668644,"results":"67","hashOfConfig":"39"},{"size":1050,"mtime":1659602857987,"results":"68","hashOfConfig":"39"},{"size":3575,"mtime":1659600462499,"results":"69","hashOfConfig":"39"},{"size":1382,"mtime":1659600474043,"results":"70","hashOfConfig":"39"},{"size":3143,"mtime":1659615826112,"results":"71","hashOfConfig":"39"},{"size":574,"mtime":1659603460996,"results":"72","hashOfConfig":"39"},{"size":773,"mtime":1659628046222,"results":"73","hashOfConfig":"39"},{"size":782,"mtime":1659762929337,"results":"74","hashOfConfig":"39"},{"size":0,"mtime":1659762965739,"results":"75","hashOfConfig":"39"},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"chbpuq",{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"119","usedDeprecatedRules":"85"},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"126","usedDeprecatedRules":"85"},{"filePath":"127","messages":"128","suppressedMessages":"129","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"130","messages":"131","suppressedMessages":"132","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"133","messages":"134","suppressedMessages":"135","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"136","messages":"137","suppressedMessages":"138","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"139","messages":"140","suppressedMessages":"141","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"142","usedDeprecatedRules":"85"},{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"149","usedDeprecatedRules":"85"},{"filePath":"150","messages":"151","suppressedMessages":"152","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"153","messages":"154","suppressedMessages":"155","errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"156","messages":"157","suppressedMessages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","suppressedMessages":"161","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"162","messages":"163","suppressedMessages":"164","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"165","messages":"166","suppressedMessages":"167","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"168","messages":"169","suppressedMessages":"170","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"171","messages":"172","suppressedMessages":"173","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","suppressedMessages":"176","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"177","messages":"178","suppressedMessages":"179","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"180","messages":"181","suppressedMessages":"182","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"85"},{"filePath":"183","messages":"184","suppressedMessages":"185","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"186","messages":"187","suppressedMessages":"188","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"189","messages":"190","suppressedMessages":"191","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/App.js",["192","193"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/reportWebVitals.js",[],[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUs/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Homepage/index.js",["194","195","196","197","198","199"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/BoxNextToEachOther/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/RoomCardInfo/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DistributedData/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ContactUsInfoCard/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ReligiousTimes/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Button/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/FormInput/index.js",["200"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/Login/index.js",["201"],[],"import React from \"react\";\nimport Input from \"../AnimatedInput/Input\";\nimport { useForm } from \"react-hook-form\";\nimport Button from \"../Button\";\nimport HorizontalTextDivider from \"../HorizontalTextDivider\";\n\nconst Login = () => {\n const { register, getValues } = useForm();\n\n return (\n \n {/* right */}\n
    \n {/* logo && site title */}\n
    \n {/* logo */}\n \"logo\"\n {/* name */}\n
    \n

    رزرو

    \n

    \n سامانه رزرواسیون خدام و زوار موکب مرکز\n

    \n
    \n
    \n {/* user logo && user title */}\n
    \n {/* logo */}\n \"logo\"\n {/* divider */}\n
    \n {/* name */}\n

    ورود زوار و خادمین محترم

    \n
    \n {/* divider */}\n
    \n \n \n \n {\" \"}\n \n
    \n {/* divider */}\n
    \n {/* left */}\n
    \n \n
    \n \n );\n};\n\nexport default Login;\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/Input.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/DateRangePicker/index.js",["202"],[],"// it has style inside index.scss ---> // Start DateRangePicker && end DateRangePicker\n\nimport React, { useEffect } from \"react\";\nimport DatePicker from \"react-multi-date-picker\";\nimport \"./index.scss\";\n\nimport persian from \"react-date-object/calendars/persian\";\nimport persian_fa from \"react-date-object/locales/persian_fa\";\n\nconst weekDays = [\n \"شنبه\",\n \"یکشنبه\",\n \"دوشنبه\",\n \"سشنبه\",\n \"چهارشنبه\",\n \"پنجشنبه\",\n \"جمعه\",\n];\n\nfunction CustomRangeInput({ openCalendar, value }) {\n useEffect(() => {\n openCalendar();\n }, []);\n\n return (\n
    \n \n

    تا

    \n \n
    \n );\n}\n\nconst DateRangePicker = () => {\n return (\n
    \n false}\n arrow={false}\n minDate={new Date()}\n render={}\n weekDays={weekDays}\n />\n
    \n );\n};\n\nexport default DateRangePicker;\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSelectBox/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomSwitch/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/DateTime/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/HorizontalTextDivider/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/ProfileInfo/index.js",["203"],[],"import React from \"react\";\n\nconst ProfileInfo = ({ name, role }) => {\n return (\n
    \n \n
    \n

    {name}

    \n {role}\n
    \n {/* dropdown */}\n \n \n \n \n \n
  • \n \n Dashboard\n \n
  • \n \n
    \n \n );\n};\n\nexport default ProfileInfo;\n\nProfileInfo.defaultProps = {\n name: \"سبحان قاسمی\",\n role: \"خادم محترم\",\n};\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/AnimatedInput/fixNumbers.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentTime/index.js",["204"],[],"import React from \"react\";\n\nconst CurrentTime = ({ className }) => {\n const today = new Date(),\n time =\n today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n {\n console.log(time);\n }\n return

    {time}

    ;\n};\n\nexport default CurrentTime;\n\nCurrentTime.defaultProps = {\n className: \"text-sm\",\n};\n","/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/UserProfileInfo/CurrentDateShamsi/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/LeafletMap/index.js",["205","206","207","208","209","210"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign1/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/IconText/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/TitleSubtitle/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign3/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CustomToast2/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/SearchBox/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/ButtonDivTag/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CreateMap/index.js",[],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/store.js",["211"],[],"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/reducers/index.js",[],[],{"ruleId":"212","severity":1,"message":"213","line":4,"column":8,"nodeType":"214","messageId":"215","endLine":4,"endColumn":17},{"ruleId":"212","severity":1,"message":"216","line":5,"column":8,"nodeType":"214","messageId":"215","endLine":5,"endColumn":18},{"ruleId":"212","severity":1,"message":"217","line":4,"column":8,"nodeType":"214","messageId":"215","endLine":4,"endColumn":26},{"ruleId":"212","severity":1,"message":"218","line":5,"column":8,"nodeType":"214","messageId":"215","endLine":5,"endColumn":14},{"ruleId":"212","severity":1,"message":"219","line":7,"column":8,"nodeType":"214","messageId":"215","endLine":7,"endColumn":22},{"ruleId":"212","severity":1,"message":"220","line":8,"column":8,"nodeType":"214","messageId":"215","endLine":8,"endColumn":23},{"ruleId":"212","severity":1,"message":"221","line":9,"column":8,"nodeType":"214","messageId":"215","endLine":9,"endColumn":17},{"ruleId":"212","severity":1,"message":"222","line":10,"column":8,"nodeType":"214","messageId":"215","endLine":10,"endColumn":13},{"ruleId":"212","severity":1,"message":"223","line":13,"column":21,"nodeType":"214","messageId":"215","endLine":13,"endColumn":30},{"ruleId":"212","severity":1,"message":"223","line":8,"column":21,"nodeType":"214","messageId":"215","endLine":8,"endColumn":30},{"ruleId":"224","severity":1,"message":"225","line":23,"column":6,"nodeType":"226","endLine":23,"endColumn":8,"suggestions":"227"},{"ruleId":"228","severity":1,"message":"229","line":36,"column":13,"nodeType":"230","endLine":39,"endColumn":14},{"ruleId":"231","severity":1,"message":"232","line":7,"column":3,"nodeType":"233","messageId":"234","endLine":9,"endColumn":4},{"ruleId":"212","severity":1,"message":"235","line":3,"column":35,"nodeType":"214","messageId":"215","endLine":3,"endColumn":42},{"ruleId":"212","severity":1,"message":"236","line":9,"column":3,"nodeType":"214","messageId":"215","endLine":9,"endColumn":12},{"ruleId":"212","severity":1,"message":"237","line":29,"column":7,"nodeType":"214","messageId":"215","endLine":29,"endColumn":12},{"ruleId":"212","severity":1,"message":"238","line":168,"column":10,"nodeType":"214","messageId":"215","endLine":168,"endColumn":21},{"ruleId":"212","severity":1,"message":"239","line":169,"column":9,"nodeType":"214","messageId":"215","endLine":169,"endColumn":12},{"ruleId":"212","severity":1,"message":"240","line":191,"column":9,"nodeType":"214","messageId":"215","endLine":191,"endColumn":17},{"ruleId":"241","severity":1,"message":"242","line":22,"column":1,"nodeType":"243","endLine":31,"endColumn":3},"no-unused-vars","'ContactUs' is defined but never used.","Identifier","unusedVar","'LeafletMap' is defined but never used.","'BoxNextToEachOther' is defined but never used.","'Button' is defined but never used.","'ReligiousTimes' is defined but never used.","'DistributedData' is defined but never used.","'FormInput' is defined but never used.","'Login' is defined but never used.","'getValues' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'openCalendar'. Either include it or remove the dependency array. If 'openCalendar' changes too often, find the parent component that defines it and wrap that definition in useCallback.","ArrayExpression",["244"],"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md","JSXOpeningElement","no-lone-blocks","Nested block is redundant.","BlockStatement","redundantNestedBlock","'useMemo' is defined but never used.","'Rectangle' is defined but never used.","'pinMB' is assigned a value but never used.","'MyComponent' is defined but never used.","'map' is assigned a value but never used.","'location' is assigned a value but never used.","import/no-anonymous-default-export","Assign arrow function to a variable before exporting as module default","ExportDefaultDeclaration",{"desc":"245","fix":"246"},"Update the dependencies array to be: [openCalendar]",{"range":"247","text":"248"},[530,532],"[openCalendar]"] \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/037919599ec58f6e6a1d2675072d310a.json b/node_modules/.cache/babel-loader/037919599ec58f6e6a1d2675072d310a.json new file mode 100644 index 00000000..4972c2b8 --- /dev/null +++ b/node_modules/.cache/babel-loader/037919599ec58f6e6a1d2675072d310a.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { createStore, applyMiddleware, combineReducers } from \"redux\";\nimport { composeWithDevTools } from \"redux-devtools-extension\";\nimport { persistStore, persistReducer } from \"redux-persist\"; // import * as reducers from \"./reducers\";\n\nimport thunk from \"redux-thunk\";\nimport storage from \"redux-persist/lib/storage\"; // defaults to localStorage for web\n\nconst persistConfig = {\n key: \"root\",\n storage\n};\nconst initialState = {};\nconst middleware = [thunk];\nconst persistedReducer = persistReducer(persistConfig, combineReducers(reducers));\nexport default (() => {\n let store = createStore(persistedReducer, initialState, composeWithDevTools(applyMiddleware(...middleware)));\n const persistor = persistStore(store);\n return {\n store,\n persistor\n };\n});","map":{"version":3,"names":["createStore","applyMiddleware","combineReducers","composeWithDevTools","persistStore","persistReducer","thunk","storage","persistConfig","key","initialState","middleware","persistedReducer","reducers","store","persistor"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/store.js"],"sourcesContent":["import { createStore, applyMiddleware, combineReducers } from \"redux\";\nimport { composeWithDevTools } from \"redux-devtools-extension\";\nimport { persistStore, persistReducer } from \"redux-persist\";\n\n// import * as reducers from \"./reducers\";\nimport thunk from \"redux-thunk\";\nimport storage from \"redux-persist/lib/storage\"; // defaults to localStorage for web\n\nconst persistConfig = {\n key: \"root\",\n storage,\n};\n\nconst initialState = {};\nconst middleware = [thunk];\n\nconst persistedReducer = persistReducer(\n persistConfig,\n combineReducers(reducers)\n);\n\nexport default () => {\n let store = createStore(\n persistedReducer,\n initialState,\n composeWithDevTools(applyMiddleware(...middleware))\n );\n const persistor = persistStore(store);\n\n return { store, persistor };\n};\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,eAAtB,EAAuCC,eAAvC,QAA8D,OAA9D;AACA,SAASC,mBAAT,QAAoC,0BAApC;AACA,SAASC,YAAT,EAAuBC,cAAvB,QAA6C,eAA7C,C,CAEA;;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,OAAP,MAAoB,2BAApB,C,CAAiD;;AAEjD,MAAMC,aAAa,GAAG;EACpBC,GAAG,EAAE,MADe;EAEpBF;AAFoB,CAAtB;AAKA,MAAMG,YAAY,GAAG,EAArB;AACA,MAAMC,UAAU,GAAG,CAACL,KAAD,CAAnB;AAEA,MAAMM,gBAAgB,GAAGP,cAAc,CACrCG,aADqC,EAErCN,eAAe,CAACW,QAAD,CAFsB,CAAvC;AAKA,gBAAe,MAAM;EACnB,IAAIC,KAAK,GAAGd,WAAW,CACrBY,gBADqB,EAErBF,YAFqB,EAGrBP,mBAAmB,CAACF,eAAe,CAAC,GAAGU,UAAJ,CAAhB,CAHE,CAAvB;EAKA,MAAMI,SAAS,GAAGX,YAAY,CAACU,KAAD,CAA9B;EAEA,OAAO;IAAEA,KAAF;IAASC;EAAT,CAAP;AACD,CATD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/1272866e4a32d2635e7d52ce18f588e6.json b/node_modules/.cache/babel-loader/1272866e4a32d2635e7d52ce18f588e6.json new file mode 100644 index 00000000..10f469bb --- /dev/null +++ b/node_modules/.cache/babel-loader/1272866e4a32d2635e7d52ce18f588e6.json @@ -0,0 +1 @@ +{"ast":null,"code":"function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\n\n\nexport default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n } // otherwise hard set the new value\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\n}","map":{"version":3,"names":["_typeof","obj","Symbol","iterator","constructor","prototype","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","configurable","writable","autoMergeLevel1","inboundState","originalState","reducedState","_ref","debug","newState","process","env","NODE_ENV","console","log","concat","join"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js"],"sourcesContent":["function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\nexport default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n } // otherwise hard set the new value\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\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AAuCC,aAAvC,EAAsDC,YAAtD,EAAoEC,IAApE,EAA0E;EACvF,IAAIC,KAAK,GAAGD,IAAI,CAACC,KAAjB;;EAEA,IAAIC,QAAQ,GAAGrB,aAAa,CAAC,EAAD,EAAKkB,YAAL,CAA5B,CAHuF,CAGvC;;;EAGhD,IAAIF,YAAY,IAAInC,OAAO,CAACmC,YAAD,CAAP,KAA0B,QAA9C,EAAwD;IACtDzB,MAAM,CAACD,IAAP,CAAY0B,YAAZ,EAA0BV,OAA1B,CAAkC,UAAUC,GAAV,EAAe;MAC/C;MACA,IAAIA,GAAG,KAAK,UAAZ,EAAwB,OAFuB,CAEf;;MAEhC,IAAIU,aAAa,CAACV,GAAD,CAAb,KAAuBW,YAAY,CAACX,GAAD,CAAvC,EAA8C;QAC5C,IAAIe,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCJ,KAA7C,EAAoDK,OAAO,CAACC,GAAR,CAAY,2EAAZ,EAAyFnB,GAAzF;QACpD;MACD,CAP8C,CAO7C;;;MAGFc,QAAQ,CAACd,GAAD,CAAR,GAAgBS,YAAY,CAACT,GAAD,CAA5B;IACD,CAXD;EAYD;;EAED,IAAIe,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCJ,KAAzC,IAAkDJ,YAAlD,IAAkEnC,OAAO,CAACmC,YAAD,CAAP,KAA0B,QAAhG,EAA0GS,OAAO,CAACC,GAAR,CAAY,mDAAmDC,MAAnD,CAA0DpC,MAAM,CAACD,IAAP,CAAY0B,YAAZ,EAA0BY,IAA1B,CAA+B,IAA/B,CAA1D,EAAgG,GAAhG,CAAZ;EAC1G,OAAOP,QAAP;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/17a5bc71a9110abe53b1c01bd510f05e.json b/node_modules/.cache/babel-loader/17a5bc71a9110abe53b1c01bd510f05e.json new file mode 100644 index 00000000..d7899974 --- /dev/null +++ b/node_modules/.cache/babel-loader/17a5bc71a9110abe53b1c01bd510f05e.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { KEY_PREFIX } from './constants';\nexport default function purgeStoredState(config) {\n var storage = config.storage;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n return storage.removeItem(storageKey, warnIfRemoveError);\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('redux-persist/purgeStoredState: Error purging data stored state', err);\n }\n}","map":{"version":3,"names":["KEY_PREFIX","purgeStoredState","config","storage","storageKey","concat","keyPrefix","undefined","key","removeItem","warnIfRemoveError","err","process","env","NODE_ENV","console","error"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/purgeStoredState.js"],"sourcesContent":["import { KEY_PREFIX } from './constants';\nexport default function purgeStoredState(config) {\n var storage = config.storage;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n return storage.removeItem(storageKey, warnIfRemoveError);\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('redux-persist/purgeStoredState: Error purging data stored state', err);\n }\n}"],"mappings":"AAAA,SAASA,UAAT,QAA2B,aAA3B;AACA,eAAe,SAASC,gBAAT,CAA0BC,MAA1B,EAAkC;EAC/C,IAAIC,OAAO,GAAGD,MAAM,CAACC,OAArB;EACA,IAAIC,UAAU,GAAG,GAAGC,MAAH,CAAUH,MAAM,CAACI,SAAP,KAAqBC,SAArB,GAAiCL,MAAM,CAACI,SAAxC,GAAoDN,UAA9D,EAA0EK,MAA1E,CAAiFH,MAAM,CAACM,GAAxF,CAAjB;EACA,OAAOL,OAAO,CAACM,UAAR,CAAmBL,UAAnB,EAA+BM,iBAA/B,CAAP;AACD;;AAED,SAASA,iBAAT,CAA2BC,GAA3B,EAAgC;EAC9B,IAAIA,GAAG,IAAIC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAApC,EAAkD;IAChDC,OAAO,CAACC,KAAR,CAAc,iEAAd,EAAiFL,GAAjF;EACD;AACF"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/17d15ef4eab378e4844569e898e6a26c.json b/node_modules/.cache/babel-loader/17d15ef4eab378e4844569e898e6a26c.json new file mode 100644 index 00000000..75ef10f2 --- /dev/null +++ b/node_modules/.cache/babel-loader/17d15ef4eab378e4844569e898e6a26c.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { KEY_PREFIX, REHYDRATE } from './constants'; // @TODO remove once flow < 0.63 support is no longer required.\n\nexport default function createPersistoid(config) {\n // defaults\n var blacklist = config.blacklist || null;\n var whitelist = config.whitelist || null;\n var transforms = config.transforms || [];\n var throttle = config.throttle || 0;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var serialize;\n\n if (config.serialize === false) {\n serialize = function serialize(x) {\n return x;\n };\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize;\n } else {\n serialize = defaultSerialize;\n }\n\n var writeFailHandler = config.writeFailHandler || null; // initialize stateful values\n\n var lastState = {};\n var stagedState = {};\n var keysToProcess = [];\n var timeIterator = null;\n var writePromise = null;\n\n var update = function update(state) {\n // add any changed keys to the queue\n Object.keys(state).forEach(function (key) {\n if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop\n\n if (lastState[key] === state[key]) return; // value unchanged? noop\n\n if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop\n\n keysToProcess.push(key); // add key to queue\n }); //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n\n Object.keys(lastState).forEach(function (key) {\n if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) {\n keysToProcess.push(key);\n }\n }); // start the time iterator if not running (read: throttle)\n\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle);\n }\n\n lastState = state;\n };\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator);\n timeIterator = null;\n return;\n }\n\n var key = keysToProcess.shift();\n var endState = transforms.reduce(function (subState, transformer) {\n return transformer.in(subState, key, lastState);\n }, lastState[key]);\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState);\n } catch (err) {\n console.error('redux-persist/createPersistoid: error serializing state', err);\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key];\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState();\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(function (key) {\n if (lastState[key] === undefined) {\n delete stagedState[key];\n }\n });\n writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;\n if (blacklist && blacklist.indexOf(key) !== -1) return false;\n return true;\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err);\n\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err);\n }\n }\n\n var flush = function flush() {\n while (keysToProcess.length !== 0) {\n processNextKey();\n }\n\n return writePromise || Promise.resolve();\n }; // return `persistoid`\n\n\n return {\n update: update,\n flush: flush\n };\n} // @NOTE in the future this may be exposed via config\n\nfunction defaultSerialize(data) {\n return JSON.stringify(data);\n}","map":{"version":3,"names":["KEY_PREFIX","REHYDRATE","createPersistoid","config","blacklist","whitelist","transforms","throttle","storageKey","concat","keyPrefix","undefined","key","storage","serialize","x","defaultSerialize","writeFailHandler","lastState","stagedState","keysToProcess","timeIterator","writePromise","update","state","Object","keys","forEach","passWhitelistBlacklist","indexOf","push","setInterval","processNextKey","length","clearInterval","shift","endState","reduce","subState","transformer","in","err","console","error","writeStagedState","setItem","catch","onWriteFail","process","env","NODE_ENV","flush","Promise","resolve","data","JSON","stringify"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/createPersistoid.js"],"sourcesContent":["import { KEY_PREFIX, REHYDRATE } from './constants';\n// @TODO remove once flow < 0.63 support is no longer required.\nexport default function createPersistoid(config) {\n // defaults\n var blacklist = config.blacklist || null;\n var whitelist = config.whitelist || null;\n var transforms = config.transforms || [];\n var throttle = config.throttle || 0;\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var serialize;\n\n if (config.serialize === false) {\n serialize = function serialize(x) {\n return x;\n };\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize;\n } else {\n serialize = defaultSerialize;\n }\n\n var writeFailHandler = config.writeFailHandler || null; // initialize stateful values\n\n var lastState = {};\n var stagedState = {};\n var keysToProcess = [];\n var timeIterator = null;\n var writePromise = null;\n\n var update = function update(state) {\n // add any changed keys to the queue\n Object.keys(state).forEach(function (key) {\n if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop\n\n if (lastState[key] === state[key]) return; // value unchanged? noop\n\n if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop\n\n keysToProcess.push(key); // add key to queue\n }); //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n\n Object.keys(lastState).forEach(function (key) {\n if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) {\n keysToProcess.push(key);\n }\n }); // start the time iterator if not running (read: throttle)\n\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle);\n }\n\n lastState = state;\n };\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator);\n timeIterator = null;\n return;\n }\n\n var key = keysToProcess.shift();\n var endState = transforms.reduce(function (subState, transformer) {\n return transformer.in(subState, key, lastState);\n }, lastState[key]);\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState);\n } catch (err) {\n console.error('redux-persist/createPersistoid: error serializing state', err);\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key];\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState();\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(function (key) {\n if (lastState[key] === undefined) {\n delete stagedState[key];\n }\n });\n writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;\n if (blacklist && blacklist.indexOf(key) !== -1) return false;\n return true;\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err);\n\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err);\n }\n }\n\n var flush = function flush() {\n while (keysToProcess.length !== 0) {\n processNextKey();\n }\n\n return writePromise || Promise.resolve();\n }; // return `persistoid`\n\n\n return {\n update: update,\n flush: flush\n };\n} // @NOTE in the future this may be exposed via config\n\nfunction defaultSerialize(data) {\n return JSON.stringify(data);\n}"],"mappings":"AAAA,SAASA,UAAT,EAAqBC,SAArB,QAAsC,aAAtC,C,CACA;;AACA,eAAe,SAASC,gBAAT,CAA0BC,MAA1B,EAAkC;EAC/C;EACA,IAAIC,SAAS,GAAGD,MAAM,CAACC,SAAP,IAAoB,IAApC;EACA,IAAIC,SAAS,GAAGF,MAAM,CAACE,SAAP,IAAoB,IAApC;EACA,IAAIC,UAAU,GAAGH,MAAM,CAACG,UAAP,IAAqB,EAAtC;EACA,IAAIC,QAAQ,GAAGJ,MAAM,CAACI,QAAP,IAAmB,CAAlC;EACA,IAAIC,UAAU,GAAG,GAAGC,MAAH,CAAUN,MAAM,CAACO,SAAP,KAAqBC,SAArB,GAAiCR,MAAM,CAACO,SAAxC,GAAoDV,UAA9D,EAA0ES,MAA1E,CAAiFN,MAAM,CA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CAACC,SAAL,CAAeF,IAAf,CAAP;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/1dbc405df2e5a88e7627cc80505608dc.json b/node_modules/.cache/babel-loader/1dbc405df2e5a88e7627cc80505608dc.json new file mode 100644 index 00000000..c0bdc71c --- /dev/null +++ b/node_modules/.cache/babel-loader/1dbc405df2e5a88e7627cc80505608dc.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { DEFAULT_VERSION } from './constants';\nexport default function createMigrate(migrations, config) {\n var _ref = config || {},\n debug = _ref.debug;\n\n return function (state, currentVersion) {\n if (!state) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration');\n return Promise.resolve(undefined);\n }\n\n var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : DEFAULT_VERSION;\n\n if (inboundVersion === currentVersion) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration');\n return Promise.resolve(state);\n }\n\n if (inboundVersion > currentVersion) {\n if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported');\n return Promise.resolve(state);\n }\n\n var migrationKeys = Object.keys(migrations).map(function (ver) {\n return parseInt(ver);\n }).filter(function (key) {\n return currentVersion >= key && key > inboundVersion;\n }).sort(function (a, b) {\n return a - b;\n });\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys);\n\n try {\n var migratedState = migrationKeys.reduce(function (state, versionKey) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey);\n return migrations[versionKey](state);\n }, state);\n return Promise.resolve(migratedState);\n } catch (err) {\n return Promise.reject(err);\n }\n };\n}","map":{"version":3,"names":["DEFAULT_VERSION","createMigrate","migrations","config","_ref","debug","state","currentVersion","process","env","NODE_ENV","console","log","Promise","resolve","undefined","inboundVersion","_persist","version","error","migrationKeys","Object","keys","map","ver","parseInt","filter","key","sort","a","b","migratedState","reduce","versionKey","err","reject"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/createMigrate.js"],"sourcesContent":["import { DEFAULT_VERSION } from './constants';\nexport default function createMigrate(migrations, config) {\n var _ref = config || {},\n debug = _ref.debug;\n\n return function (state, currentVersion) {\n if (!state) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration');\n return Promise.resolve(undefined);\n }\n\n var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : DEFAULT_VERSION;\n\n if (inboundVersion === currentVersion) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration');\n return Promise.resolve(state);\n }\n\n if (inboundVersion > currentVersion) {\n if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported');\n return Promise.resolve(state);\n }\n\n var migrationKeys = Object.keys(migrations).map(function (ver) {\n return parseInt(ver);\n }).filter(function (key) {\n return currentVersion >= key && key > inboundVersion;\n }).sort(function (a, b) {\n return a - b;\n });\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys);\n\n try {\n var migratedState = migrationKeys.reduce(function (state, versionKey) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey);\n return migrations[versionKey](state);\n }, state);\n return Promise.resolve(migratedState);\n } catch (err) {\n return Promise.reject(err);\n }\n };\n}"],"mappings":"AAAA,SAASA,eAAT,QAAgC,aAAhC;AACA,eAAe,SAASC,aAAT,CAAuBC,UAAvB,EAAmCC,MAAnC,EAA2C;EACxD,IAAIC,IAAI,GAAGD,MAAM,IAAI,EAArB;EAAA,IACIE,KAAK,GAAGD,IAAI,CAACC,KADjB;;EAGA,OAAO,UAAUC,KAAV,EAAiBC,cAAjB,EAAiC;IACtC,IAAI,CAACD,KAAL,EAAY;MACV,IAAIE,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCL,KA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Aa,CAACY,MAAd,CAAqB,UAAU1B,KAAV,EAAiB2B,UAAjB,EAA6B;QACpE,IAAIzB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCL,KAA7C,EAAoDM,OAAO,CAACC,GAAR,CAAY,iDAAZ,EAA+DqB,UAA/D;QACpD,OAAO/B,UAAU,CAAC+B,UAAD,CAAV,CAAuB3B,KAAvB,CAAP;MACD,CAHmB,EAGjBA,KAHiB,CAApB;MAIA,OAAOO,OAAO,CAACC,OAAR,CAAgBiB,aAAhB,CAAP;IACD,CAND,CAME,OAAOG,GAAP,EAAY;MACZ,OAAOrB,OAAO,CAACsB,MAAR,CAAeD,GAAf,CAAP;IACD;EACF,CApCD;AAqCD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/263897157338748d1b89948a7f90d940.json b/node_modules/.cache/babel-loader/263897157338748d1b89948a7f90d940.json new file mode 100644 index 00000000..165b36d7 --- /dev/null +++ b/node_modules/.cache/babel-loader/263897157338748d1b89948a7f90d940.json @@ -0,0 +1 @@ +{"ast":null,"code":"export { default as persistReducer } from './persistReducer';\nexport { default as persistCombineReducers } from './persistCombineReducers';\nexport { default as persistStore } from './persistStore';\nexport { default as createMigrate } from './createMigrate';\nexport { default as createTransform } from './createTransform';\nexport { default as getStoredState } from './getStoredState';\nexport { default as createPersistoid } from './createPersistoid';\nexport { default as purgeStoredState } from './purgeStoredState';\nexport * from './constants';","map":{"version":3,"names":["default","persistReducer","persistCombineReducers","persistStore","createMigrate","createTransform","getStoredState","createPersistoid","purgeStoredState"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/index.js"],"sourcesContent":["export { default as persistReducer } from './persistReducer';\nexport { default as persistCombineReducers } from './persistCombineReducers';\nexport { default as persistStore } from './persistStore';\nexport { default as createMigrate } from './createMigrate';\nexport { default as createTransform } from './createTransform';\nexport { default as getStoredState } from './getStoredState';\nexport { default as createPersistoid } from './createPersistoid';\nexport { default as purgeStoredState } from './purgeStoredState';\nexport * from './constants';"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAApB,QAA0C,kBAA1C;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,0BAAlD;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,gBAAxC;AACA,SAASH,OAAO,IAAII,aAApB,QAAyC,iBAAzC;AACA,SAASJ,OAAO,IAAIK,eAApB,QAA2C,mBAA3C;AACA,SAASL,OAAO,IAAIM,cAApB,QAA0C,kBAA1C;AACA,SAASN,OAAO,IAAIO,gBAApB,QAA4C,oBAA5C;AACA,SAASP,OAAO,IAAIQ,gBAApB,QAA4C,oBAA5C;AACA,cAAc,aAAd"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/2fa6b34306a513472a3177bf303311f4.json b/node_modules/.cache/babel-loader/2fa6b34306a513472a3177bf303311f4.json new file mode 100644 index 00000000..371360e2 --- /dev/null +++ b/node_modules/.cache/babel-loader/2fa6b34306a513472a3177bf303311f4.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { combineReducers } from 'redux';\nimport persistReducer from './persistReducer';\nimport autoMergeLevel2 from './stateReconciler/autoMergeLevel2'; // combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2\n\nexport default function persistCombineReducers(config, reducers) {\n config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler;\n return persistReducer(config, combineReducers(reducers));\n}","map":{"version":3,"names":["combineReducers","persistReducer","autoMergeLevel2","persistCombineReducers","config","reducers","stateReconciler","undefined"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/persistCombineReducers.js"],"sourcesContent":["import { combineReducers } from 'redux';\nimport persistReducer from './persistReducer';\nimport autoMergeLevel2 from './stateReconciler/autoMergeLevel2';\n// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2\nexport default function persistCombineReducers(config, reducers) {\n config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler;\n return persistReducer(config, combineReducers(reducers));\n}"],"mappings":"AAAA,SAASA,eAAT,QAAgC,OAAhC;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,eAAP,MAA4B,mCAA5B,C,CACA;;AACA,eAAe,SAASC,sBAAT,CAAgCC,MAAhC,EAAwCC,QAAxC,EAAkD;EAC/DD,MAAM,CAACE,eAAP,GAAyBF,MAAM,CAACE,eAAP,KAA2BC,SAA3B,GAAuCL,eAAvC,GAAyDE,MAAM,CAACE,eAAzF;EACA,OAAOL,cAAc,CAACG,MAAD,EAASJ,eAAe,CAACK,QAAD,CAAxB,CAArB;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/36a58eeefbefeb0202b0295bb1368fa8.json b/node_modules/.cache/babel-loader/36a58eeefbefeb0202b0295bb1368fa8.json new file mode 100644 index 00000000..e488aed6 --- /dev/null +++ b/node_modules/.cache/babel-loader/36a58eeefbefeb0202b0295bb1368fa8.json @@ -0,0 +1 @@ +{"ast":null,"code":"export var KEY_PREFIX = 'persist:';\nexport var FLUSH = 'persist/FLUSH';\nexport var REHYDRATE = 'persist/REHYDRATE';\nexport var PAUSE = 'persist/PAUSE';\nexport var PERSIST = 'persist/PERSIST';\nexport var PURGE = 'persist/PURGE';\nexport var REGISTER = 'persist/REGISTER';\nexport var DEFAULT_VERSION = -1;","map":{"version":3,"names":["KEY_PREFIX","FLUSH","REHYDRATE","PAUSE","PERSIST","PURGE","REGISTER","DEFAULT_VERSION"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/constants.js"],"sourcesContent":["export var KEY_PREFIX = 'persist:';\nexport var FLUSH = 'persist/FLUSH';\nexport var REHYDRATE = 'persist/REHYDRATE';\nexport var PAUSE = 'persist/PAUSE';\nexport var PERSIST = 'persist/PERSIST';\nexport var PURGE = 'persist/PURGE';\nexport var REGISTER = 'persist/REGISTER';\nexport var DEFAULT_VERSION = -1;"],"mappings":"AAAA,OAAO,IAAIA,UAAU,GAAG,UAAjB;AACP,OAAO,IAAIC,KAAK,GAAG,eAAZ;AACP,OAAO,IAAIC,SAAS,GAAG,mBAAhB;AACP,OAAO,IAAIC,KAAK,GAAG,eAAZ;AACP,OAAO,IAAIC,OAAO,GAAG,iBAAd;AACP,OAAO,IAAIC,KAAK,GAAG,eAAZ;AACP,OAAO,IAAIC,QAAQ,GAAG,kBAAf;AACP,OAAO,IAAIC,eAAe,GAAG,CAAC,CAAvB"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/4a8d9c13ca6069c2f1964defdcf7569f.json b/node_modules/.cache/babel-loader/4a8d9c13ca6069c2f1964defdcf7569f.json new file mode 100644 index 00000000..8c8e48d1 --- /dev/null +++ b/node_modules/.cache/babel-loader/4a8d9c13ca6069c2f1964defdcf7569f.json @@ -0,0 +1 @@ +{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.default = getStorage;\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction noop() {}\n\nvar noopStorage = {\n getItem: noop,\n setItem: noop,\n removeItem: noop\n};\n\nfunction hasStorage(storageType) {\n if ((typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) !== 'object' || !(storageType in self)) {\n return false;\n }\n\n try {\n var storage = self[storageType];\n var testKey = \"redux-persist \".concat(storageType, \" test\");\n storage.setItem(testKey, 'test');\n storage.getItem(testKey);\n storage.removeItem(testKey);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') console.warn(\"redux-persist \".concat(storageType, \" test failed, persistence will be disabled.\"));\n return false;\n }\n\n return true;\n}\n\nfunction getStorage(type) {\n var storageType = \"\".concat(type, \"Storage\");\n if (hasStorage(storageType)) return self[storageType];else {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\"redux-persist failed to create sync storage. falling back to noop storage.\");\n }\n\n return noopStorage;\n }\n}","map":{"version":3,"names":["exports","__esModule","default","getStorage","_typeof","obj","Symbol","iterator","constructor","prototype","noop","noopStorage","getItem","setItem","removeItem","hasStorage","storageType","self","storage","testKey","concat","e","process","env","NODE_ENV","console","warn","type","error"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/lib/storage/getStorage.js"],"sourcesContent":["\"use strict\";\n\nexports.__esModule = true;\nexports.default = getStorage;\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction noop() {}\n\nvar noopStorage = {\n getItem: noop,\n setItem: noop,\n removeItem: noop\n};\n\nfunction hasStorage(storageType) {\n if ((typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) !== 'object' || !(storageType in self)) {\n return false;\n }\n\n try {\n var storage = self[storageType];\n var testKey = \"redux-persist \".concat(storageType, \" test\");\n storage.setItem(testKey, 'test');\n storage.getItem(testKey);\n storage.removeItem(testKey);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') console.warn(\"redux-persist \".concat(storageType, \" test failed, persistence will be disabled.\"));\n return false;\n }\n\n return true;\n}\n\nfunction getStorage(type) {\n var storageType = \"\".concat(type, \"Storage\");\n if (hasStorage(storageType)) return self[storageType];else {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\"redux-persist failed to create sync storage. falling back to noop storage.\");\n }\n\n return noopStorage;\n }\n}"],"mappings":"AAAA;;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AAO,CAACJ,UAAR,CAAmBK,OAAnB;EACD,CAND,CAME,OAAOE,CAAP,EAAU;IACV,IAAIC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2CC,OAAO,CAACC,IAAR,CAAa,iBAAiBN,MAAjB,CAAwBJ,WAAxB,EAAqC,6CAArC,CAAb;IAC3C,OAAO,KAAP;EACD;;EAED,OAAO,IAAP;AACD;;AAED,SAASb,UAAT,CAAoBwB,IAApB,EAA0B;EACxB,IAAIX,WAAW,GAAG,GAAGI,MAAH,CAAUO,IAAV,EAAgB,SAAhB,CAAlB;EACA,IAAIZ,UAAU,CAACC,WAAD,CAAd,EAA6B,OAAOC,IAAI,CAACD,WAAD,CAAX,CAA7B,KAA2D;IACzD,IAAIM,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACzCC,OAAO,CAACG,KAAR,CAAc,4EAAd;IACD;;IAED,OAAOjB,WAAP;EACD;AACF"},"metadata":{},"sourceType":"script"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/544fb0b28c549faaab59ef8323177430.json b/node_modules/.cache/babel-loader/544fb0b28c549faaab59ef8323177430.json new file mode 100644 index 00000000..9f9c6cf8 --- /dev/null +++ b/node_modules/.cache/babel-loader/544fb0b28c549faaab59ef8323177430.json @@ -0,0 +1 @@ +{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.default = createWebStorage;\n\nvar _getStorage = _interopRequireDefault(require(\"./getStorage\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction createWebStorage(type) {\n var storage = (0, _getStorage.default)(type);\n return {\n getItem: function getItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.getItem(key));\n });\n },\n setItem: function setItem(key, item) {\n return new Promise(function (resolve, reject) {\n resolve(storage.setItem(key, item));\n });\n },\n removeItem: function removeItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.removeItem(key));\n });\n }\n };\n}","map":{"version":3,"names":["exports","__esModule","default","createWebStorage","_getStorage","_interopRequireDefault","require","obj","type","storage","getItem","key","Promise","resolve","reject","setItem","item","removeItem"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/lib/storage/createWebStorage.js"],"sourcesContent":["\"use strict\";\n\nexports.__esModule = true;\nexports.default = createWebStorage;\n\nvar _getStorage = _interopRequireDefault(require(\"./getStorage\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createWebStorage(type) {\n var storage = (0, _getStorage.default)(type);\n return {\n getItem: function getItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.getItem(key));\n });\n },\n setItem: function setItem(key, item) {\n return new Promise(function (resolve, reject) {\n resolve(storage.setItem(key, item));\n });\n },\n removeItem: function removeItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.removeItem(key));\n });\n }\n };\n}"],"mappings":"AAAA;;AAEAA,OAAO,CAACC,UAAR,GAAqB,IAArB;AACAD,OAAO,CAACE,OAAR,GAAkBC,gBAAlB;;AAEA,IAAIC,WAAW,GAAGC,sBAAsB,CAACC,OAAO,CAAC,cAAD,CAAR,CAAxC;;AAEA,SAASD,sBAAT,CAAgCE,GAAhC,EAAqC;EAAE,OAAOA,GAAG,IAAIA,GAAG,CAACN,UAAX,GAAwBM,GAAxB,GAA8B;IAAEL,OAAO,EAAEK;EAAX,CAArC;AAAwD;;AAE/F,SAASJ,gBAAT,CAA0BK,IAA1B,EAAgC;EAC9B,IAAIC,OAAO,GAAG,CAAC,GAAGL,WAAW,CAACF,OAAhB,EAAyBM,IAAzB,CAAd;EACA,OAAO;IACLE,OAAO,EAAE,SAASA,OAAT,CAAiBC,GAAjB,EAAsB;MAC7B,OAAO,IAAIC,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;QAC5CD,OAAO,CAACJ,OAAO,CAACC,OAAR,CAAgBC,GAAhB,CAAD,CAAP;MACD,CAFM,CAAP;IAGD,CALI;IAMLI,OAAO,EAAE,SAASA,OAAT,CAAiBJ,GAAjB,EAAsBK,IAAtB,EAA4B;MACnC,OAAO,IAAIJ,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;QAC5CD,OAAO,CAACJ,OAAO,CAACM,OAAR,CAAgBJ,GAAhB,EAAqBK,IAArB,CAAD,CAAP;MACD,CAFM,CAAP;IAGD,CAVI;IAWLC,UAAU,EAAE,SAASA,UAAT,CAAoBN,GAApB,EAAyB;MACnC,OAAO,IAAIC,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;QAC5CD,OAAO,CAACJ,OAAO,CAACQ,UAAR,CAAmBN,GAAnB,CAAD,CAAP;MACD,CAFM,CAAP;IAGD;EAfI,CAAP;AAiBD"},"metadata":{},"sourceType":"script"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/69901f74b955d7d91fa9ed69544509e6.json b/node_modules/.cache/babel-loader/69901f74b955d7d91fa9ed69544509e6.json new file mode 100644 index 00000000..af998242 --- /dev/null +++ b/node_modules/.cache/babel-loader/69901f74b955d7d91fa9ed69544509e6.json @@ -0,0 +1 @@ +{"ast":null,"code":"function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n/*\n autoMergeLevel2: \n - merges 2 level of substate\n - skips substate if already modified\n - this is essentially redux-perist v4 behavior\n*/\n\n\nexport default function autoMergeLevel2(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n }\n\n if (isPlainEnoughObject(reducedState[key])) {\n // if object is plain enough shallow merge the new values (hence \"Level2\")\n newState[key] = _objectSpread({}, newState[key], {}, inboundState[key]);\n return;\n } // otherwise hard set\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\n}\n\nfunction isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && _typeof(o) === 'object';\n}","map":{"version":3,"names":["_typeof","obj","Symbol","iterator","constructor","prototype","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","configurable","writable","autoMergeLevel2","inboundState","originalState","reducedState","_ref","debug","newState","process","env","NODE_ENV","console","log","isPlainEnoughObject","concat","join","o","Array","isArray"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js"],"sourcesContent":["function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/*\n autoMergeLevel2: \n - merges 2 level of substate\n - skips substate if already modified\n - this is essentially redux-perist v4 behavior\n*/\nexport default function autoMergeLevel2(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object\n\n\n if (inboundState && _typeof(inboundState) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration\n\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n }\n\n if (isPlainEnoughObject(reducedState[key])) {\n // if object is plain enough shallow merge the new values (hence \"Level2\")\n newState[key] = _objectSpread({}, newState[key], {}, inboundState[key]);\n return;\n } // otherwise hard set\n\n\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log(\"redux-persist/stateReconciler: rehydrated keys '\".concat(Object.keys(inboundState).join(', '), \"'\"));\n return newState;\n}\n\nfunction isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && _typeof(o) === 'object';\n}"],"mappings":"AAAA,SAASA,OAAT,CAAiBC,GAAjB,EAAsB;EAAE,IAAI,OAAOC,MAAP,KAAkB,UAAlB,IAAgC,OAAOA,MAAM,CAACC,QAAd,KAA2B,QAA/D,EAAyE;IAAEH,OAAO,GAAG,SAASA,OAAT,CAAiBC,GAAjB,EAAsB;MAAE,OAAO,OAAOA,GAAd;IAAoB,CAAtD;EAAyD,CAApI,MAA0I;IAAED,OAAO,GAAG,SAASA,OAAT,CAAiBC,GAAjB,EAAsB;MAAE,OAAOA,GAAG,IAAI,OAAOC,MAAP,KAAkB,UAAzB,IAAuCD,GAAG,CAACG,WAAJ,KAAoBF,MAA3D,IAAqED,GAAG,KAAKC,MAAM,CAACG,SAApF,GAAgG,QAAhG,GAA2G,OAAOJ,GAAzH;IAA+H,CAAjK;EAAoK;;EAAC,OAAOD,OAAO,CAACC,GAAD,CAAd;AAAsB;;AAE/V,SAASK,OAAT,CAAiBC,MAAjB,EAAyBC,cAAzB,EAAyC;EAAE,IAAIC,IAAI,G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;;MAED,IAAIoB,mBAAmB,CAACT,YAAY,CAACX,GAAD,CAAb,CAAvB,EAA4C;QAC1C;QACAc,QAAQ,CAACd,GAAD,CAAR,GAAgBP,aAAa,CAAC,EAAD,EAAKqB,QAAQ,CAACd,GAAD,CAAb,EAAoB,EAApB,EAAwBS,YAAY,CAACT,GAAD,CAApC,CAA7B;QACA;MACD,CAb8C,CAa7C;;;MAGFc,QAAQ,CAACd,GAAD,CAAR,GAAgBS,YAAY,CAACT,GAAD,CAA5B;IACD,CAjBD;EAkBD;;EAED,IAAIe,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCJ,KAAzC,IAAkDJ,YAAlD,IAAkEnC,OAAO,CAACmC,YAAD,CAAP,KAA0B,QAAhG,EAA0GS,OAAO,CAACC,GAAR,CAAY,mDAAmDE,MAAnD,CAA0DrC,MAAM,CAACD,IAAP,CAAY0B,YAAZ,EAA0Ba,IAA1B,CAA+B,IAA/B,CAA1D,EAAgG,GAAhG,CAAZ;EAC1G,OAAOR,QAAP;AACD;;AAED,SAASM,mBAAT,CAA6BG,CAA7B,EAAgC;EAC9B,OAAOA,CAAC,KAAK,IAAN,IAAc,CAACC,KAAK,CAACC,OAAN,CAAcF,CAAd,CAAf,IAAmCjD,OAAO,CAACiD,CAAD,CAAP,KAAe,QAAzD;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/7314573d3b37b632fb54e62bf9662a55.json b/node_modules/.cache/babel-loader/7314573d3b37b632fb54e62bf9662a55.json new file mode 100644 index 00000000..1862d88c --- /dev/null +++ b/node_modules/.cache/babel-loader/7314573d3b37b632fb54e62bf9662a55.json @@ -0,0 +1 @@ +{"ast":null,"code":"export { default as components } from \"./components\";\nexport { default as alert } from \"./alert\";","map":{"version":3,"names":["default","components","alert"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/reducers/index.js"],"sourcesContent":["export { default as components } from \"./components\";\nexport { default as alert } from \"./alert\";\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAApB,QAAsC,cAAtC;AACA,SAASD,OAAO,IAAIE,KAApB,QAAiC,SAAjC"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/7fd1adaebc0325fcea5d26e6d5e2e0be.json b/node_modules/.cache/babel-loader/7fd1adaebc0325fcea5d26e6d5e2e0be.json new file mode 100644 index 00000000..0dd24326 --- /dev/null +++ b/node_modules/.cache/babel-loader/7fd1adaebc0325fcea5d26e6d5e2e0be.json @@ -0,0 +1 @@ +{"ast":null,"code":"function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport { createStore } from 'redux';\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants';\nvar initialState = {\n registry: [],\n bootstrapped: false\n};\n\nvar persistorReducer = function persistorReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case REGISTER:\n return _objectSpread({}, state, {\n registry: [].concat(_toConsumableArray(state.registry), [action.key])\n });\n\n case REHYDRATE:\n var firstIndex = state.registry.indexOf(action.key);\n\n var registry = _toConsumableArray(state.registry);\n\n registry.splice(firstIndex, 1);\n return _objectSpread({}, state, {\n registry: registry,\n bootstrapped: registry.length === 0\n });\n\n default:\n return state;\n }\n};\n\nexport default function persistStore(store, options, cb) {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n var optionsToTest = options || {};\n var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];\n bannedKeys.forEach(function (k) {\n if (!!optionsToTest[k]) console.error(\"redux-persist: invalid option passed to persistStore: \\\"\".concat(k, \"\\\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.\"));\n });\n }\n\n var boostrappedCb = cb || false;\n\n var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined);\n\n var register = function register(key) {\n _pStore.dispatch({\n type: REGISTER,\n key: key\n });\n };\n\n var rehydrate = function rehydrate(key, payload, err) {\n var rehydrateAction = {\n type: REHYDRATE,\n payload: payload,\n err: err,\n key: key // dispatch to `store` to rehydrate and `persistor` to track result\n\n };\n store.dispatch(rehydrateAction);\n\n _pStore.dispatch(rehydrateAction);\n\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb();\n boostrappedCb = false;\n }\n };\n\n var persistor = _objectSpread({}, _pStore, {\n purge: function purge() {\n var results = [];\n store.dispatch({\n type: PURGE,\n result: function result(purgeResult) {\n results.push(purgeResult);\n }\n });\n return Promise.all(results);\n },\n flush: function flush() {\n var results = [];\n store.dispatch({\n type: FLUSH,\n result: function result(flushResult) {\n results.push(flushResult);\n }\n });\n return Promise.all(results);\n },\n pause: function pause() {\n store.dispatch({\n type: PAUSE\n });\n },\n persist: function persist() {\n store.dispatch({\n type: PERSIST,\n register: register,\n rehydrate: rehydrate\n });\n }\n });\n\n if (!(options && options.manualPersist)) {\n persistor.persist();\n }\n\n return persistor;\n}","map":{"version":3,"names":["_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","TypeError","iter","Symbol","iterator","Object","prototype","toString","call","Array","from","isArray","i","arr2","length","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","configurable","writable","createStore","FLUSH","PAUSE","PERSIST","PURGE","REGISTER","REHYDRATE","initialState","registry","bootstrapped","persistorReducer","state","undefined","action","type","concat","firstIndex","indexOf","splice","persistStore","store","options","cb","process","env","NODE_ENV","optionsToTest","bannedKeys","k","console","error","boostrappedCb","_pStore","enhancer","register","dispatch","rehydrate","payload","err","rehydrateAction","persistor","getState","purge","results","result","purgeResult","Promise","all","flush","flushResult","pause","persist","manualPersist"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/persistStore.js"],"sourcesContent":["function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { createStore } from 'redux';\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants';\nvar initialState = {\n registry: [],\n bootstrapped: false\n};\n\nvar persistorReducer = function persistorReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments.length > 1 ? arguments[1] : undefined;\n\n switch (action.type) {\n case REGISTER:\n return _objectSpread({}, state, {\n registry: [].concat(_toConsumableArray(state.registry), [action.key])\n });\n\n case REHYDRATE:\n var firstIndex = state.registry.indexOf(action.key);\n\n var registry = _toConsumableArray(state.registry);\n\n registry.splice(firstIndex, 1);\n return _objectSpread({}, state, {\n registry: registry,\n bootstrapped: registry.length === 0\n });\n\n default:\n return state;\n }\n};\n\nexport default function persistStore(store, options, cb) {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n var optionsToTest = options || {};\n var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];\n bannedKeys.forEach(function (k) {\n if (!!optionsToTest[k]) console.error(\"redux-persist: invalid option passed to persistStore: \\\"\".concat(k, \"\\\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.\"));\n });\n }\n\n var boostrappedCb = cb || false;\n\n var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined);\n\n var register = function register(key) {\n _pStore.dispatch({\n type: REGISTER,\n key: key\n });\n };\n\n var rehydrate = function rehydrate(key, payload, err) {\n var rehydrateAction = {\n type: REHYDRATE,\n payload: payload,\n err: err,\n key: key // dispatch to `store` to rehydrate and `persistor` to track result\n\n };\n store.dispatch(rehydrateAction);\n\n _pStore.dispatch(rehydrateAction);\n\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb();\n boostrappedCb = false;\n }\n };\n\n var persistor = _objectSpread({}, _pStore, {\n purge: function purge() {\n var results = [];\n store.dispatch({\n type: PURGE,\n result: function result(purgeResult) {\n results.push(purgeResult);\n }\n });\n return Promise.all(results);\n },\n flush: function flush() {\n var results = [];\n store.dispatch({\n type: FLUSH,\n result: function result(flushResult) {\n results.push(flushResult);\n }\n });\n return Promise.all(results);\n },\n pause: function pause() {\n store.dispatch({\n type: PAUSE\n });\n },\n persist: function persist() {\n store.dispatch({\n type: PERSIST,\n register: register,\n rehydrate: rehydrate\n });\n }\n });\n\n if (!(options && options.manualPersist)) {\n persistor.persist();\n }\n\n return persistor;\n}"],"mappings":"AAAA,SAASA,kBAAT,CAA4BC,GAA5B,EAAiC;EAAE,OAAOC,kBAAkB,CAACD,GAAD,CAAlB,IAA2BE,gBAAgB,CAACF,GAAD,CAA3C,IAAoDG,kBAAkB,EAA7E;AAAkF;;AAErH,SAASA,kBAAT,GAA8B;EAAE,MAAM,IAAIC,SAAJ,C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C;IACvCZ,SAAS,CAACW,OAAV;EACD;;EAED,OAAOX,SAAP;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/835067bf8c87aba565b2f66a661f1058.json b/node_modules/.cache/babel-loader/835067bf8c87aba565b2f66a661f1058.json new file mode 100644 index 00000000..8ff1afa7 --- /dev/null +++ b/node_modules/.cache/babel-loader/835067bf8c87aba565b2f66a661f1058.json @@ -0,0 +1 @@ +{"ast":null,"code":"export default function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored\ninbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux\noutbound) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var whitelist = config.whitelist || null;\n var blacklist = config.blacklist || null;\n\n function whitelistBlacklistCheck(key) {\n if (whitelist && whitelist.indexOf(key) === -1) return true;\n if (blacklist && blacklist.indexOf(key) !== -1) return true;\n return false;\n }\n\n return {\n in: function _in(state, key, fullState) {\n return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state;\n },\n out: function out(state, key, fullState) {\n return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state;\n }\n };\n}","map":{"version":3,"names":["createTransform","inbound","outbound","config","arguments","length","undefined","whitelist","blacklist","whitelistBlacklistCheck","key","indexOf","in","_in","state","fullState","out"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/createTransform.js"],"sourcesContent":["export default function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored\ninbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux\noutbound) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var whitelist = config.whitelist || null;\n var blacklist = config.blacklist || null;\n\n function whitelistBlacklistCheck(key) {\n if (whitelist && whitelist.indexOf(key) === -1) return true;\n if (blacklist && blacklist.indexOf(key) !== -1) return true;\n return false;\n }\n\n return {\n in: function _in(state, key, fullState) {\n return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state;\n },\n out: function out(state, key, fullState) {\n return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state;\n }\n };\n}"],"mappings":"AAAA,eAAe,SAASA,eAAT,EAA0B;AACzCC,OADe,EACN;AACTC,QAFe,EAEL;EACR,IAAIC,MAAM,GAAGC,SAAS,CAACC,MAAV,GAAmB,CAAnB,IAAwBD,SAAS,CAAC,CAAD,CAAT,KAAiBE,SAAzC,GAAqDF,SAAS,CAAC,CAAD,CAA9D,GAAoE,EAAjF;EACA,IAAIG,SAAS,GAAGJ,MAAM,CAACI,SAAP,IAAoB,IAApC;EACA,IAAIC,SAAS,GAAGL,MAAM,CAACK,SAAP,IAAoB,IAApC;;EAEA,SAASC,uBAAT,CAAiCC,GAAjC,EAAsC;IACpC,IAAIH,SAAS,IAAIA,SAAS,CAACI,OAAV,CAAkBD,GAAlB,MAA2B,CAAC,CAA7C,EAAgD,OAAO,IAAP;IAChD,IAAIF,SAAS,IAAIA,SAAS,CAACG,OAAV,CAAkBD,GAAlB,MAA2B,CAAC,CAA7C,EAAgD,OAAO,IAAP;IAChD,OAAO,KAAP;EACD;;EAED,OAAO;IACLE,EAAE,EAAE,SAASC,GAAT,CAAaC,KAAb,EAAoBJ,GAApB,EAAyBK,SAAzB,EAAoC;MACtC,OAAO,CAACN,uBAAuB,CAACC,GAAD,CAAxB,IAAiCT,OAAjC,GAA2CA,OAAO,CAACa,KAAD,EAAQJ,GAAR,EAAaK,SAAb,CAAlD,GAA4ED,KAAnF;IACD,CAHI;IAILE,GAAG,EAAE,SAASA,GAAT,CAAaF,KAAb,EAAoBJ,GAApB,EAAyBK,SAAzB,EAAoC;MACvC,OAAO,CAACN,uBAAuB,CAACC,GAAD,CAAxB,IAAiCR,QAAjC,GAA4CA,QAAQ,CAACY,KAAD,EAAQJ,GAAR,EAAaK,SAAb,CAApD,GAA8ED,KAArF;IACD;EANI,CAAP;AAQD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/bbd3b50f76286f7c2173866e7e74df57.json b/node_modules/.cache/babel-loader/bbd3b50f76286f7c2173866e7e74df57.json new file mode 100644 index 00000000..63524bd4 --- /dev/null +++ b/node_modules/.cache/babel-loader/bbd3b50f76286f7c2173866e7e74df57.json @@ -0,0 +1 @@ +{"ast":null,"code":"'use strict';\n\nvar compose = require('redux').compose;\n\nexports.__esModule = true;\nexports.composeWithDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\n if (arguments.length === 0) return undefined;\n if (typeof arguments[0] === 'object') return compose;\n return compose.apply(null, arguments);\n};\nexports.devToolsEnhancer = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\n return function (noop) {\n return noop;\n };\n};","map":{"version":3,"names":["compose","require","exports","__esModule","composeWithDevTools","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","arguments","length","undefined","apply","devToolsEnhancer","__REDUX_DEVTOOLS_EXTENSION__","noop"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-devtools-extension/index.js"],"sourcesContent":["'use strict';\n\nvar compose = require('redux').compose;\n\nexports.__esModule = true;\nexports.composeWithDevTools =\n typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n : function () {\n if (arguments.length === 0) return undefined;\n if (typeof arguments[0] === 'object') return compose;\n return compose.apply(null, arguments);\n };\n\nexports.devToolsEnhancer =\n typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__\n : function () {\n return function (noop) {\n return noop;\n };\n };\n"],"mappings":"AAAA;;AAEA,IAAIA,OAAO,GAAGC,OAAO,CAAC,OAAD,CAAP,CAAiBD,OAA/B;;AAEAE,OAAO,CAACC,UAAR,GAAqB,IAArB;AACAD,OAAO,CAACE,mBAAR,GACE,OAAOC,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,oCAAxC,GACID,MAAM,CAACC,oCADX,GAEI,YAAY;EACV,IAAIC,SAAS,CAACC,MAAV,KAAqB,CAAzB,EAA4B,OAAOC,SAAP;EAC5B,IAAI,OAAOF,SAAS,CAAC,CAAD,CAAhB,KAAwB,QAA5B,EAAsC,OAAOP,OAAP;EACtC,OAAOA,OAAO,CAACU,KAAR,CAAc,IAAd,EAAoBH,SAApB,CAAP;AACD,CAPP;AASAL,OAAO,CAACS,gBAAR,GACE,OAAON,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACO,4BAAxC,GACIP,MAAM,CAACO,4BADX,GAEI,YAAY;EACV,OAAO,UAAUC,IAAV,EAAgB;IACrB,OAAOA,IAAP;EACD,CAFD;AAGD,CAPP"},"metadata":{},"sourceType":"script"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/d1cc7a10b2ca4e621518f02c5a20b32b.json b/node_modules/.cache/babel-loader/d1cc7a10b2ca4e621518f02c5a20b32b.json new file mode 100644 index 00000000..eb3c14a9 --- /dev/null +++ b/node_modules/.cache/babel-loader/d1cc7a10b2ca4e621518f02c5a20b32b.json @@ -0,0 +1 @@ +{"ast":null,"code":"function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nimport { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants';\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1';\nimport createPersistoid from './createPersistoid';\nimport defaultGetStoredState from './getStoredState';\nimport purgeStoredState from './purgeStoredState';\nvar DEFAULT_TIMEOUT = 5000;\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\n\nexport default function persistReducer(config, baseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer');\n if (!config.key) throw new Error('key is required in persistor config');\n if (!config.storage) throw new Error(\"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\");\n }\n\n var version = config.version !== undefined ? config.version : DEFAULT_VERSION;\n var debug = config.debug || false;\n var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler;\n var getStoredState = config.getStoredState || defaultGetStoredState;\n var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT;\n var _persistoid = null;\n var _purge = false;\n var _paused = true;\n\n var conditionalUpdate = function conditionalUpdate(state) {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state);\n return state;\n };\n\n return function (state, action) {\n var _ref = state || {},\n _persist = _ref._persist,\n rest = _objectWithoutProperties(_ref, [\"_persist\"]); // $FlowIgnore need to update State type\n\n\n var restState = rest;\n\n if (action.type === PERSIST) {\n var _sealed = false;\n\n var _rehydrate = function _rehydrate(payload, err) {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed) console.error(\"redux-persist: rehydrate for \\\"\".concat(config.key, \"\\\" called after timeout.\"), payload, err); // only rehydrate if we are not already sealed\n\n if (!_sealed) {\n action.rehydrate(config.key, payload, err);\n _sealed = true;\n }\n };\n\n timeout && setTimeout(function () {\n !_sealed && _rehydrate(undefined, new Error(\"redux-persist: persist timed out for persist key \\\"\".concat(config.key, \"\\\"\")));\n }, timeout); // @NOTE PERSIST resumes if paused.\n\n _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n\n if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first\n\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n }\n\n if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');\n action.register(config.key);\n getStoredState(config).then(function (restoredState) {\n var migrate = config.migrate || function (s, v) {\n return Promise.resolve(s);\n };\n\n migrate(restoredState, version).then(function (migratedState) {\n _rehydrate(migratedState);\n }, function (migrateErr) {\n if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);\n\n _rehydrate(undefined, migrateErr);\n });\n }, function (err) {\n _rehydrate(undefined, err);\n });\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: {\n version: version,\n rehydrated: false\n }\n });\n } else if (action.type === PURGE) {\n _purge = true;\n action.result(purgeStoredState(config));\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush());\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === PAUSE) {\n _paused = true;\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge) return _objectSpread({}, restState, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n }) // @NOTE if key does not match, will continue to default else below\n\n });\n\n if (action.key === config.key) {\n var reducedState = baseReducer(restState, action);\n var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined\n\n var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState;\n\n var _newState = _objectSpread({}, reconciledRest, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n })\n });\n\n return conditionalUpdate(_newState);\n }\n } // if we have not already handled PERSIST, straight passthrough\n\n\n if (!_persist) return baseReducer(state, action); // run base reducer:\n // is state modified ? return original : return updated\n\n var newState = baseReducer(restState, action);\n if (newState === restState) return state;\n return conditionalUpdate(_objectSpread({}, newState, {\n _persist: _persist\n }));\n };\n}","map":{"version":3,"names":["ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","configurable","writable","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","sourceSymbolKeys","indexOf","prototype","propertyIsEnumerable","call","sourceKeys","FLUSH","PAUSE","PERSIST","PURGE","REHYDRATE","DEFAULT_VERSION","autoMergeLevel1","createPersistoid","defaultGetStoredState","purgeStoredState","DEFAULT_TIMEOUT","persistReducer","config","baseReducer","process","env","NODE_ENV","Error","storage","version","undefined","debug","stateReconciler","getStoredState","timeout","_persistoid","_purge","_paused","conditionalUpdate","state","_persist","rehydrated","update","action","_ref","rest","restState","type","_sealed","_rehydrate","payload","err","console","error","concat","rehydrate","setTimeout","register","then","restoredState","migrate","s","v","Promise","resolve","migratedState","migrateErr","result","flush","reducedState","inboundState","reconciledRest","_newState","newState"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/persistReducer.js"],"sourcesContent":["function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _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; }\n\nimport { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants';\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1';\nimport createPersistoid from './createPersistoid';\nimport defaultGetStoredState from './getStoredState';\nimport purgeStoredState from './purgeStoredState';\nvar DEFAULT_TIMEOUT = 5000;\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\n\nexport default function persistReducer(config, baseReducer) {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer');\n if (!config.key) throw new Error('key is required in persistor config');\n if (!config.storage) throw new Error(\"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\");\n }\n\n var version = config.version !== undefined ? config.version : DEFAULT_VERSION;\n var debug = config.debug || false;\n var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler;\n var getStoredState = config.getStoredState || defaultGetStoredState;\n var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT;\n var _persistoid = null;\n var _purge = false;\n var _paused = true;\n\n var conditionalUpdate = function conditionalUpdate(state) {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state);\n return state;\n };\n\n return function (state, action) {\n var _ref = state || {},\n _persist = _ref._persist,\n rest = _objectWithoutProperties(_ref, [\"_persist\"]); // $FlowIgnore need to update State type\n\n\n var restState = rest;\n\n if (action.type === PERSIST) {\n var _sealed = false;\n\n var _rehydrate = function _rehydrate(payload, err) {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed) console.error(\"redux-persist: rehydrate for \\\"\".concat(config.key, \"\\\" called after timeout.\"), payload, err); // only rehydrate if we are not already sealed\n\n if (!_sealed) {\n action.rehydrate(config.key, payload, err);\n _sealed = true;\n }\n };\n\n timeout && setTimeout(function () {\n !_sealed && _rehydrate(undefined, new Error(\"redux-persist: persist timed out for persist key \\\"\".concat(config.key, \"\\\"\")));\n }, timeout); // @NOTE PERSIST resumes if paused.\n\n _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n\n if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first\n\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n }\n\n if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');\n action.register(config.key);\n getStoredState(config).then(function (restoredState) {\n var migrate = config.migrate || function (s, v) {\n return Promise.resolve(s);\n };\n\n migrate(restoredState, version).then(function (migratedState) {\n _rehydrate(migratedState);\n }, function (migrateErr) {\n if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);\n\n _rehydrate(undefined, migrateErr);\n });\n }, function (err) {\n _rehydrate(undefined, err);\n });\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: {\n version: version,\n rehydrated: false\n }\n });\n } else if (action.type === PURGE) {\n _purge = true;\n action.result(purgeStoredState(config));\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush());\n return _objectSpread({}, baseReducer(restState, action), {\n _persist: _persist\n });\n } else if (action.type === PAUSE) {\n _paused = true;\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge) return _objectSpread({}, restState, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n }) // @NOTE if key does not match, will continue to default else below\n\n });\n\n if (action.key === config.key) {\n var reducedState = baseReducer(restState, action);\n var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined\n\n var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState;\n\n var _newState = _objectSpread({}, reconciledRest, {\n _persist: _objectSpread({}, _persist, {\n rehydrated: true\n })\n });\n\n return conditionalUpdate(_newState);\n }\n } // if we have not already handled PERSIST, straight passthrough\n\n\n if (!_persist) return baseReducer(state, action); // run base reducer:\n // is state modified ? return original : return updated\n\n var newState = baseReducer(restState, action);\n if (newState === restState) return state;\n return conditionalUpdate(_objectSpread({}, newState, {\n _persist: _persist\n }));\n };\n}"],"mappings":"AAAA,SAASA,OAAT,CAAiBC,MAAjB,EAAyBC,cAAzB,EAAyC;EAAE,IAAIC,IAAI,GAAGC,MAAM,CAACD,IAAP,CAAYF,MAAZ,CAAX;;EAAgC,IAAIG,MAAM,CAACC,qBAAX,EAAkC;IAAE,IAAIC,OAAO,GAAGF,MAAM,CAACC,qBAAP,CAA6BJ,MAA7B,CAAd;IAAoD,IAAIC,cAAJ,EAAoBI,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,UAAUC,GAAV,EAAe;MAAE,OAAOJ,MAAM,CAACK,wBAAP,CAAgCR,MAAhC,EAAwCO,GAAxC,EAA6CE,UAApD;IAAiE,CAAjG,CAAV;IAA8GP,IAAI,CAACQ,IAAL,CAAUC,KAAV,CAAgBT,IAAhB,EAAsBG,OAAtB;EAAiC;;EAAC,OAAOH,IAAP;AAAc;;AAErV,SAASU,aAAT,CAAuBC,MAAvB,EAA+B;EAAE,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGC,SAAS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AAC9B,GAA1B,EAA+B;QAC7B,IAAI6E,YAAY,GAAG9C,WAAW,CAACuB,SAAD,EAAYH,MAAZ,CAA9B;QACA,IAAI2B,YAAY,GAAG3B,MAAM,CAACO,OAA1B,CAF6B,CAEM;;QAEnC,IAAIqB,cAAc,GAAGvC,eAAe,KAAK,KAApB,IAA6BsC,YAAY,KAAKxC,SAA9C,GAA0DE,eAAe,CAACsC,YAAD,EAAe/B,KAAf,EAAsB8B,YAAtB,EAAoC/C,MAApC,CAAzE,GAAuH+C,YAA5I;;QAEA,IAAIG,SAAS,GAAGvF,aAAa,CAAC,EAAD,EAAKsF,cAAL,EAAqB;UAChD/B,QAAQ,EAAEvD,aAAa,CAAC,EAAD,EAAKuD,QAAL,EAAe;YACpCC,UAAU,EAAE;UADwB,CAAf;QADyB,CAArB,CAA7B;;QAMA,OAAOH,iBAAiB,CAACkC,SAAD,CAAxB;MACD;IACF,CAhG6B,CAgG5B;;;IAGF,IAAI,CAAChC,QAAL,EAAe,OAAOjB,WAAW,CAACgB,KAAD,EAAQI,MAAR,CAAlB,CAnGe,CAmGoB;IAClD;;IAEA,IAAI8B,QAAQ,GAAGlD,WAAW,CAACuB,SAAD,EAAYH,MAAZ,CAA1B;IACA,IAAI8B,QAAQ,KAAK3B,SAAjB,EAA4B,OAAOP,KAAP;IAC5B,OAAOD,iBAAiB,CAACrD,aAAa,CAAC,EAAD,EAAKwF,QAAL,EAAe;MACnDjC,QAAQ,EAAEA;IADyC,CAAf,CAAd,CAAxB;EAGD,CA3GD;AA4GD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/d53c3329448b00f04e06436528618a3f.json b/node_modules/.cache/babel-loader/d53c3329448b00f04e06436528618a3f.json new file mode 100644 index 00000000..4a05e9fb --- /dev/null +++ b/node_modules/.cache/babel-loader/d53c3329448b00f04e06436528618a3f.json @@ -0,0 +1 @@ +{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _createWebStorage = _interopRequireDefault(require(\"./createWebStorage\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar _default = (0, _createWebStorage.default)('local');\n\nexports.default = _default;","map":{"version":3,"names":["exports","__esModule","default","_createWebStorage","_interopRequireDefault","require","obj","_default"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/lib/storage/index.js"],"sourcesContent":["\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _createWebStorage = _interopRequireDefault(require(\"./createWebStorage\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = (0, _createWebStorage.default)('local');\n\nexports.default = _default;"],"mappings":"AAAA;;AAEAA,OAAO,CAACC,UAAR,GAAqB,IAArB;AACAD,OAAO,CAACE,OAAR,GAAkB,KAAK,CAAvB;;AAEA,IAAIC,iBAAiB,GAAGC,sBAAsB,CAACC,OAAO,CAAC,oBAAD,CAAR,CAA9C;;AAEA,SAASD,sBAAT,CAAgCE,GAAhC,EAAqC;EAAE,OAAOA,GAAG,IAAIA,GAAG,CAACL,UAAX,GAAwBK,GAAxB,GAA8B;IAAEJ,OAAO,EAAEI;EAAX,CAArC;AAAwD;;AAE/F,IAAIC,QAAQ,GAAG,CAAC,GAAGJ,iBAAiB,CAACD,OAAtB,EAA+B,OAA/B,CAAf;;AAEAF,OAAO,CAACE,OAAR,GAAkBK,QAAlB"},"metadata":{},"sourceType":"script"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/e021b83673e937a666c8e36d09b25a63.json b/node_modules/.cache/babel-loader/e021b83673e937a666c8e36d09b25a63.json new file mode 100644 index 00000000..5ca9452a --- /dev/null +++ b/node_modules/.cache/babel-loader/e021b83673e937a666c8e36d09b25a63.json @@ -0,0 +1 @@ +{"ast":null,"code":"import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}","map":{"version":3,"names":["KEY_PREFIX","getStoredState","config","transforms","storageKey","concat","keyPrefix","undefined","key","storage","debug","deserialize","x","defaultDeserialize","getItem","then","serialized","state","rawState","Object","keys","forEach","reduceRight","subState","transformer","out","err","process","env","NODE_ENV","console","log","serial","JSON","parse"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-persist/es/getStoredState.js"],"sourcesContent":["import { KEY_PREFIX } from './constants';\nexport default function getStoredState(config) {\n var transforms = config.transforms || [];\n var storageKey = \"\".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key);\n var storage = config.storage;\n var debug = config.debug;\n var deserialize;\n\n if (config.deserialize === false) {\n deserialize = function deserialize(x) {\n return x;\n };\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize;\n } else {\n deserialize = defaultDeserialize;\n }\n\n return storage.getItem(storageKey).then(function (serialized) {\n if (!serialized) return undefined;else {\n try {\n var state = {};\n var rawState = deserialize(serialized);\n Object.keys(rawState).forEach(function (key) {\n state[key] = transforms.reduceRight(function (subState, transformer) {\n return transformer.out(subState, key, rawState);\n }, deserialize(rawState[key]));\n });\n return state;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log(\"redux-persist/getStoredState: Error restoring data \".concat(serialized), err);\n throw err;\n }\n }\n });\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial);\n}"],"mappings":"AAAA,SAASA,UAAT,QAA2B,aAA3B;AACA,eAAe,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;EAC7C,IAAIC,UAAU,GAAGD,MAAM,CAACC,UAAP,IAAqB,EAAtC;EACA,IAAIC,UAAU,GAAG,GAAGC,MAAH,CAAUH,MAAM,CAACI,SAAP,KAAqBC,SAArB,GAAiCL,MAAM,CAACI,SAAxC,GAAoDN,UAA9D,EAA0EK,MAA1E,CAAiFH,MAAM,CAACM,GAAxF,CAAjB;EACA,IAAIC,OAAO,GAAGP,MAAM,CAACO,OAArB;EACA,IAAIC,KAAK,GAAGR,MAAM,CAACQ,KAAnB;EACA,IAAIC,WAAJ;;EAEA,IAAIT,MAAM,CAACS,WAAP,KAAuB,KAA3B,EAAkC;IAChCA,WAAW,GAAG,SAASA,WAAT,CAAqBC,CAArB,EAAwB;MACpC,OAAOA,CAAP;IACD,CAFD;EAGD,CAJD,MAIO,IAAI,OAAOV,MAAM,CAACS,WAAd,KAA8B,UAAlC,EAA8C;IACnDA,WAAW,GAAGT,MAAM,CAACS,WAArB;EACD,CAFM,MAEA;IACLA,WAAW,GAAGE,kBAAd;EACD;;EAED,OAAOJ,OAAO,CAACK,OAAR,CAAgBV,UAAhB,EAA4BW,IAA5B,CAAiC,UAAUC,UAAV,EAAsB;IAC5D,IAAI,CAACA,UAAL,EAAiB,OAAOT,SAAP,CAAjB,KAAuC;MACrC,IAAI;QACF,IAAIU,KAAK,GAAG,EAAZ;QACA,IAAIC,QAAQ,GAAGP,WAAW,CAACK,UAAD,CAA1B;QACAG,MAAM,CAACC,IAAP,CAAYF,QAAZ,EAAsBG,OAAtB,CAA8B,UAAUb,GAAV,EAAe;UAC3CS,KAAK,CAACT,GAAD,CAAL,GAAaL,UAAU,CAACmB,WAAX,CAAuB,UAAUC,QAAV,EAAoBC,WAApB,EAAiC;YACnE,OAAOA,WAAW,CAACC,GAAZ,CAAgBF,QAAhB,EAA0Bf,GAA1B,EAA+BU,QAA/B,CAAP;UACD,CAFY,EAEVP,WAAW,CAACO,QAAQ,CAACV,GAAD,CAAT,CAFD,CAAb;QAGD,CAJD;QAKA,OAAOS,KAAP;MACD,CATD,CASE,OAAOS,GAAP,EAAY;QACZ,IAAIC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,IAAyCnB,KAA7C,EAAoDoB,OAAO,CAACC,GAAR,CAAY,sDAAsD1B,MAAtD,CAA6DW,UAA7D,CAAZ,EAAsFU,GAAtF;QACpD,MAAMA,GAAN;MACD;IACF;EACF,CAhBM,CAAP;AAiBD;;AAED,SAASb,kBAAT,CAA4BmB,MAA5B,EAAoC;EAClC,OAAOC,IAAI,CAACC,KAAL,CAAWF,MAAX,CAAP;AACD"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/e27261c9a8c9fe15d0c52d35af7439ba.json b/node_modules/.cache/babel-loader/e27261c9a8c9fe15d0c52d35af7439ba.json new file mode 100644 index 00000000..c1ad1ddf --- /dev/null +++ b/node_modules/.cache/babel-loader/e27261c9a8c9fe15d0c52d35af7439ba.json @@ -0,0 +1 @@ +{"ast":null,"code":"/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","map":{"version":3,"names":["createThunkMiddleware","extraArgument","middleware","_ref","dispatch","getState","next","action","thunk","withExtraArgument"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/redux-thunk/es/index.js"],"sourcesContent":["/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,qBAAT,CAA+BC,aAA/B,EAA8C;EAC5C;EACA;EACA,IAAIC,UAAU,GAAG,SAASA,UAAT,CAAoBC,IAApB,EAA0B;IACzC,IAAIC,QAAQ,GAAGD,IAAI,CAACC,QAApB;IAAA,IACIC,QAAQ,GAAGF,IAAI,CAACE,QADpB;IAEA,OAAO,UAAUC,IAAV,EAAgB;MACrB,OAAO,UAAUC,MAAV,EAAkB;QACvB;QACA;QACA,IAAI,OAAOA,MAAP,KAAkB,UAAtB,EAAkC;UAChC;UACA,OAAOA,MAAM,CAACH,QAAD,EAAWC,QAAX,EAAqBJ,aAArB,CAAb;QACD,CANsB,CAMrB;;;QAGF,OAAOK,IAAI,CAACC,MAAD,CAAX;MACD,CAVD;IAWD,CAZD;EAaD,CAhBD;;EAkBA,OAAOL,UAAP;AACD;;AAED,IAAIM,KAAK,GAAGR,qBAAqB,EAAjC,C,CAAqC;AACrC;;AAEAQ,KAAK,CAACC,iBAAN,GAA0BT,qBAA1B;AACA,eAAeQ,KAAf"},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/e593719ffa4d8342a9dcbd211e5d6b0f.json b/node_modules/.cache/babel-loader/e593719ffa4d8342a9dcbd211e5d6b0f.json new file mode 100644 index 00000000..30f9a716 --- /dev/null +++ b/node_modules/.cache/babel-loader/e593719ffa4d8342a9dcbd211e5d6b0f.json @@ -0,0 +1 @@ +{"ast":null,"code":"","map":{"version":3,"names":[],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/redux/reducers/index.js"],"sourcesContent":[""],"mappings":""},"metadata":{},"sourceType":"module"} \ No newline at end of file diff --git a/node_modules/.cache/default-development/0.pack b/node_modules/.cache/default-development/0.pack index 42275903..c5ab81dd 100644 Binary files a/node_modules/.cache/default-development/0.pack and b/node_modules/.cache/default-development/0.pack differ diff --git a/node_modules/.cache/default-development/1.pack b/node_modules/.cache/default-development/1.pack index 98178d91..8a38325b 100644 Binary files a/node_modules/.cache/default-development/1.pack and b/node_modules/.cache/default-development/1.pack differ diff --git a/node_modules/.cache/default-development/10.pack b/node_modules/.cache/default-development/10.pack index 495c54d3..5e3efd2c 100644 Binary files a/node_modules/.cache/default-development/10.pack and b/node_modules/.cache/default-development/10.pack differ diff --git a/node_modules/.cache/default-development/12.pack b/node_modules/.cache/default-development/12.pack index 3308d00c..cc10467f 100644 Binary files a/node_modules/.cache/default-development/12.pack and b/node_modules/.cache/default-development/12.pack differ diff --git a/node_modules/.cache/default-development/13.pack b/node_modules/.cache/default-development/13.pack index f42d8523..8d2c93c6 100644 Binary files a/node_modules/.cache/default-development/13.pack and b/node_modules/.cache/default-development/13.pack differ diff --git a/node_modules/.cache/default-development/14.pack b/node_modules/.cache/default-development/14.pack index dfe453a0..e292998f 100644 Binary files a/node_modules/.cache/default-development/14.pack and b/node_modules/.cache/default-development/14.pack differ diff --git a/node_modules/.cache/default-development/15.pack b/node_modules/.cache/default-development/15.pack index 8ba4831a..58385bf9 100644 Binary files a/node_modules/.cache/default-development/15.pack and b/node_modules/.cache/default-development/15.pack differ diff --git a/node_modules/.cache/default-development/16.pack b/node_modules/.cache/default-development/16.pack index 2481911c..abb5bdda 100644 Binary files a/node_modules/.cache/default-development/16.pack and b/node_modules/.cache/default-development/16.pack differ diff --git a/node_modules/.cache/default-development/17.pack b/node_modules/.cache/default-development/17.pack new file mode 100644 index 00000000..96255ac6 Binary files /dev/null and b/node_modules/.cache/default-development/17.pack differ diff --git a/node_modules/.cache/default-development/18.pack b/node_modules/.cache/default-development/18.pack new file mode 100644 index 00000000..97893745 Binary files /dev/null and b/node_modules/.cache/default-development/18.pack differ diff --git a/node_modules/.cache/default-development/19.pack b/node_modules/.cache/default-development/19.pack new file mode 100644 index 00000000..cd009882 Binary files /dev/null and b/node_modules/.cache/default-development/19.pack differ diff --git a/node_modules/.cache/default-development/2.pack b/node_modules/.cache/default-development/2.pack index 82e3a259..fec75ad2 100644 Binary files a/node_modules/.cache/default-development/2.pack and b/node_modules/.cache/default-development/2.pack differ diff --git a/node_modules/.cache/default-development/3.pack b/node_modules/.cache/default-development/3.pack index c911a676..f0b3dd65 100644 Binary files a/node_modules/.cache/default-development/3.pack and b/node_modules/.cache/default-development/3.pack differ diff --git a/node_modules/.cache/default-development/4.pack b/node_modules/.cache/default-development/4.pack index b5403ca3..8b690b09 100644 Binary files a/node_modules/.cache/default-development/4.pack and b/node_modules/.cache/default-development/4.pack differ diff --git a/node_modules/.cache/default-development/5.pack b/node_modules/.cache/default-development/5.pack index d8b3e36a..c407cecf 100644 Binary files a/node_modules/.cache/default-development/5.pack and b/node_modules/.cache/default-development/5.pack differ diff --git a/node_modules/.cache/default-development/6.pack b/node_modules/.cache/default-development/6.pack index 4e9f0203..cddd6239 100644 Binary files a/node_modules/.cache/default-development/6.pack and b/node_modules/.cache/default-development/6.pack differ diff --git a/node_modules/.cache/default-development/7.pack b/node_modules/.cache/default-development/7.pack index ac1d45d9..3c13c2bf 100644 Binary files a/node_modules/.cache/default-development/7.pack and b/node_modules/.cache/default-development/7.pack differ diff --git a/node_modules/.cache/default-development/9.pack b/node_modules/.cache/default-development/9.pack index 95c1e6e6..0fdea0f1 100644 Binary files a/node_modules/.cache/default-development/9.pack and b/node_modules/.cache/default-development/9.pack differ diff --git a/node_modules/.cache/default-development/index.pack b/node_modules/.cache/default-development/index.pack index 65eb08bc..f38fa828 100644 Binary files a/node_modules/.cache/default-development/index.pack and b/node_modules/.cache/default-development/index.pack differ diff --git a/node_modules/.cache/default-development/index.pack.old b/node_modules/.cache/default-development/index.pack.old index 11f6f3f8..f067f544 100644 Binary files a/node_modules/.cache/default-development/index.pack.old and b/node_modules/.cache/default-development/index.pack.old differ diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity index d755942c..4deba12f 100644 --- a/node_modules/.yarn-integrity +++ b/node_modules/.yarn-integrity @@ -23,6 +23,9 @@ "react-qr-code@^2.0.7", "react-scripts@5.0.1", "react@^18.2.0", + "redux-devtools-extension@^2.13.9", + "redux-persist@^6.0.0", + "redux-thunk@^2.4.1", "tailwindcss@^3.1.4", "web-vitals@^2.1.4" ], @@ -1372,6 +1375,9 @@ "readdirp@~3.6.0": "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7", "recursive-readdir@^2.2.2": "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f", "redent@^3.0.0": "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f", + "redux-devtools-extension@^2.13.9": "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz#6b764e8028b507adcb75a1cae790f71e6be08ae7", + "redux-persist@^6.0.0": "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8", + "redux-thunk@^2.4.1": "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714", "redux@^4.0.0": "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13", "redux@^4.0.4": "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13", "regenerate-unicode-properties@^10.0.1": "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56", diff --git a/node_modules/redux-devtools-extension/CHANGELOG.md b/node_modules/redux-devtools-extension/CHANGELOG.md new file mode 100644 index 00000000..3b2fc8fa --- /dev/null +++ b/node_modules/redux-devtools-extension/CHANGELOG.md @@ -0,0 +1,8 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 2.13.9 (2021-03-06) + +**Note:** Version bump only for package redux-devtools-extension diff --git a/node_modules/redux-devtools-extension/README.md b/node_modules/redux-devtools-extension/README.md new file mode 100644 index 00000000..fdc90a1a --- /dev/null +++ b/node_modules/redux-devtools-extension/README.md @@ -0,0 +1,50 @@ +# Redux DevTools Extension's helper + +[![Join the chat at https://gitter.im/zalmoxisus/redux-devtools-extension](https://badges.gitter.im/zalmoxisus/redux-devtools-extension.svg)](https://gitter.im/zalmoxisus/redux-devtools-extension?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +## Usage + +Install: + +``` +npm install --save redux-devtools-extension +``` + +and use like that: + +```js +import { createStore, applyMiddleware } from 'redux'; +import { composeWithDevTools } from 'redux-devtools-extension'; + +const store = createStore( + reducer, + composeWithDevTools( + applyMiddleware(...middleware) + // other store enhancers if any + ) +); +``` + +or if needed to apply [extension’s options](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#windowdevtoolsextensionconfig): + +```js +import { createStore, applyMiddleware } from 'redux'; +import { composeWithDevTools } from 'redux-devtools-extension'; + +const composeEnhancers = composeWithDevTools({ + // Specify here name, actionsBlacklist, actionsCreators and other options +}); +const store = createStore( + reducer, + composeEnhancers( + applyMiddleware(...middleware) + // other store enhancers if any + ) +); +``` + +There’re just [few lines of code](https://github.com/zalmoxisus/redux-devtools-extension/blob/master/npm-package/index.js). If you don’t want to allow the extension in production, just use ‘redux-devtools-extension/developmentOnly’ instead of ‘redux-devtools-extension’. + +## License + +MIT diff --git a/node_modules/redux-devtools-extension/developmentOnly.d.ts b/node_modules/redux-devtools-extension/developmentOnly.d.ts new file mode 100644 index 00000000..e45b4859 --- /dev/null +++ b/node_modules/redux-devtools-extension/developmentOnly.d.ts @@ -0,0 +1 @@ +export * from 'redux-devtools-extension'; diff --git a/node_modules/redux-devtools-extension/developmentOnly.js b/node_modules/redux-devtools-extension/developmentOnly.js new file mode 100644 index 00000000..0294f1f9 --- /dev/null +++ b/node_modules/redux-devtools-extension/developmentOnly.js @@ -0,0 +1,26 @@ +'use strict'; + +var compose = require('redux').compose; + +exports.__esModule = true; +exports.composeWithDevTools = + process.env.NODE_ENV !== 'production' && + typeof window !== 'undefined' && + window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + : function () { + if (arguments.length === 0) return undefined; + if (typeof arguments[0] === 'object') return compose; + return compose.apply(null, arguments); + }; + +exports.devToolsEnhancer = + process.env.NODE_ENV !== 'production' && + typeof window !== 'undefined' && + window.__REDUX_DEVTOOLS_EXTENSION__ + ? window.__REDUX_DEVTOOLS_EXTENSION__ + : function () { + return function (noop) { + return noop; + }; + }; diff --git a/node_modules/redux-devtools-extension/index.d.ts b/node_modules/redux-devtools-extension/index.d.ts new file mode 100644 index 00000000..f2e43cb5 --- /dev/null +++ b/node_modules/redux-devtools-extension/index.d.ts @@ -0,0 +1,174 @@ +import { Action, ActionCreator, StoreEnhancer, compose } from 'redux'; + +export interface EnhancerOptions { + /** + * the instance name to be showed on the monitor page. Default value is `document.title`. + * If not specified and there's no document title, it will consist of `tabId` and `instanceId`. + */ + name?: string; + /** + * action creators functions to be available in the Dispatcher. + */ + actionCreators?: ActionCreator[] | { [key: string]: ActionCreator }; + /** + * if more than one action is dispatched in the indicated interval, all new actions will be collected and sent at once. + * It is the joint between performance and speed. When set to `0`, all actions will be sent instantly. + * Set it to a higher value when experiencing perf issues (also `maxAge` to a lower value). + * + * @default 500 ms. + */ + latency?: number; + /** + * (> 1) - maximum allowed actions to be stored in the history tree. The oldest actions are removed once maxAge is reached. It's critical for performance. + * + * @default 50 + */ + maxAge?: number; + /** + * - `undefined` - will use regular `JSON.stringify` to send data (it's the fast mode). + * - `false` - will handle also circular references. + * - `true` - will handle also date, regex, undefined, error objects, symbols, maps, sets and functions. + * - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys. + * For each of them you can indicate if to include (by setting as `true`). + * For `function` key you can also specify a custom function which handles serialization. + * See [`jsan`](https://github.com/kolodny/jsan) for more details. + */ + serialize?: + | boolean + | { + date?: boolean; + regex?: boolean; + undefined?: boolean; + error?: boolean; + symbol?: boolean; + map?: boolean; + set?: boolean; + function?: boolean | Function; + }; + /** + * function which takes `action` object and id number as arguments, and should return `action` object back. + */ + actionSanitizer?: (action: A, id: number) => A; + /** + * function which takes `state` object and index as arguments, and should return `state` object back. + */ + stateSanitizer?: (state: S, index: number) => S; + /** + * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers). + * If `actionsWhitelist` specified, `actionsBlacklist` is ignored. + */ + actionsBlacklist?: string | string[]; + /** + * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers). + * If `actionsWhitelist` specified, `actionsBlacklist` is ignored. + */ + actionsWhitelist?: string | string[]; + /** + * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor. + * Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters. + */ + predicate?: (state: S, action: A) => boolean; + /** + * if specified as `false`, it will not record the changes till clicking on `Start recording` button. + * Available only for Redux enhancer, for others use `autoPause`. + * + * @default true + */ + shouldRecordChanges?: boolean; + /** + * if specified, whenever clicking on `Pause recording` button and there are actions in the history log, will add this action type. + * If not specified, will commit when paused. Available only for Redux enhancer. + * + * @default "@@PAUSED"" + */ + pauseActionType?: string; + /** + * auto pauses when the extension’s window is not opened, and so has zero impact on your app when not in use. + * Not available for Redux enhancer (as it already does it but storing the data to be sent). + * + * @default false + */ + autoPause?: boolean; + /** + * if specified as `true`, it will not allow any non-monitor actions to be dispatched till clicking on `Unlock changes` button. + * Available only for Redux enhancer. + * + * @default false + */ + shouldStartLocked?: boolean; + /** + * if set to `false`, will not recompute the states on hot reloading (or on replacing the reducers). Available only for Redux enhancer. + * + * @default true + */ + shouldHotReload?: boolean; + /** + * if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched. + * + * @default false + */ + shouldCatchErrors?: boolean; + /** + * If you want to restrict the extension, specify the features you allow. + * If not specified, all of the features are enabled. When set as an object, only those included as `true` will be allowed. + * Note that except `true`/`false`, `import` and `export` can be set as `custom` (which is by default for Redux enhancer), meaning that the importing/exporting occurs on the client side. + * Otherwise, you'll get/set the data right from the monitor part. + */ + features?: { + /** + * start/pause recording of dispatched actions + */ + pause?: boolean; + /** + * lock/unlock dispatching actions and side effects + */ + lock?: boolean; + /** + * persist states on page reloading + */ + persist?: boolean; + /** + * export history of actions in a file + */ + export?: boolean | 'custom'; + /** + * import history of actions from a file + */ + import?: boolean | 'custom'; + /** + * jump back and forth (time travelling) + */ + jump?: boolean; + /** + * skip (cancel) actions + */ + skip?: boolean; + /** + * drag and drop actions in the history list + */ + reorder?: boolean; + /** + * dispatch custom actions or action creators + */ + dispatch?: boolean; + /** + * generate tests for the selected actions + */ + test?: boolean; + }; + /** + * Set to true or a stacktrace-returning function to record call stack traces for dispatched actions. + * Defaults to false. + */ + trace?: boolean | ((action: A) => string); + /** + * The maximum number of stack trace entries to record per action. Defaults to 10. + */ + traceLimit?: number; +} + +export function composeWithDevTools( + ...funcs: Array> +): StoreEnhancer; +export function composeWithDevTools(options: EnhancerOptions): typeof compose; +export function devToolsEnhancer(options: EnhancerOptions): StoreEnhancer; diff --git a/node_modules/redux-devtools-extension/index.js b/node_modules/redux-devtools-extension/index.js new file mode 100644 index 00000000..02fca412 --- /dev/null +++ b/node_modules/redux-devtools-extension/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var compose = require('redux').compose; + +exports.__esModule = true; +exports.composeWithDevTools = + typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + : function () { + if (arguments.length === 0) return undefined; + if (typeof arguments[0] === 'object') return compose; + return compose.apply(null, arguments); + }; + +exports.devToolsEnhancer = + typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ + ? window.__REDUX_DEVTOOLS_EXTENSION__ + : function () { + return function (noop) { + return noop; + }; + }; diff --git a/node_modules/redux-devtools-extension/logOnly.d.ts b/node_modules/redux-devtools-extension/logOnly.d.ts new file mode 100644 index 00000000..e45b4859 --- /dev/null +++ b/node_modules/redux-devtools-extension/logOnly.d.ts @@ -0,0 +1 @@ +export * from 'redux-devtools-extension'; diff --git a/node_modules/redux-devtools-extension/logOnly.js b/node_modules/redux-devtools-extension/logOnly.js new file mode 100644 index 00000000..8aa4237b --- /dev/null +++ b/node_modules/redux-devtools-extension/logOnly.js @@ -0,0 +1,60 @@ +'use strict'; + +var assign = require('./utils/assign'); +var compose = require('redux').compose; + +function enhancer() { + var config = arguments[0] || {}; + config.features = { pause: true, export: true, test: true }; + config.type = 'redux'; + if (config.autoPause === undefined) config.autoPause = true; + if (config.latency === undefined) config.latency = 500; + + return function (createStore) { + return function (reducer, preloadedState, enhancer) { + var store = createStore(reducer, preloadedState, enhancer); + var origDispatch = store.dispatch; + + var devTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect(config); + devTools.init(store.getState()); + + var dispatch = function (action) { + var r = origDispatch(action); + devTools.send(action, store.getState()); + return r; + }; + + if (Object.assign) return Object.assign(store, { dispatch: dispatch }); + return assign(store, 'dispatch', dispatch); + }; + }; +} + +function composeWithEnhancer(config) { + return function () { + return compose(compose.apply(null, arguments), enhancer(config)); + }; +} + +exports.__esModule = true; +exports.composeWithDevTools = function () { + if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) { + if (arguments.length === 0) return enhancer(); + if (typeof arguments[0] === 'object') + return composeWithEnhancer(arguments[0]); + return composeWithEnhancer().apply(null, arguments); + } + + if (arguments.length === 0) return undefined; + if (typeof arguments[0] === 'object') return compose; + return compose.apply(null, arguments); +}; + +exports.devToolsEnhancer = + typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ + ? enhancer + : function () { + return function (noop) { + return noop; + }; + }; diff --git a/node_modules/redux-devtools-extension/logOnlyInProduction.d.ts b/node_modules/redux-devtools-extension/logOnlyInProduction.d.ts new file mode 100644 index 00000000..e45b4859 --- /dev/null +++ b/node_modules/redux-devtools-extension/logOnlyInProduction.d.ts @@ -0,0 +1 @@ +export * from 'redux-devtools-extension'; diff --git a/node_modules/redux-devtools-extension/logOnlyInProduction.js b/node_modules/redux-devtools-extension/logOnlyInProduction.js new file mode 100644 index 00000000..3c18b389 --- /dev/null +++ b/node_modules/redux-devtools-extension/logOnlyInProduction.js @@ -0,0 +1,28 @@ +'use strict'; + +var compose = require('redux').compose; +var logOnly = require('./logOnly'); + +exports.__esModule = true; +exports.composeWithDevTools = + process.env.NODE_ENV === 'production' + ? logOnly.composeWithDevTools + : typeof window !== 'undefined' && + window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + : function () { + if (arguments.length === 0) return undefined; + if (typeof arguments[0] === 'object') return compose; + return compose.apply(null, arguments); + }; + +exports.devToolsEnhancer = + process.env.NODE_ENV === 'production' + ? logOnly.devToolsEnhancer + : typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ + ? window.__REDUX_DEVTOOLS_EXTENSION__ + : function () { + return function (noop) { + return noop; + }; + }; diff --git a/node_modules/redux-devtools-extension/package.json b/node_modules/redux-devtools-extension/package.json new file mode 100644 index 00000000..5628c974 --- /dev/null +++ b/node_modules/redux-devtools-extension/package.json @@ -0,0 +1,17 @@ +{ + "name": "redux-devtools-extension", + "version": "2.13.9", + "description": "Wrappers for Redux DevTools Extension.", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/zalmoxisus/redux-devtools-extension" + }, + "homepage": "https://github.com/zalmoxisus/redux-devtools-extension", + "author": "Mihail Diordiev (https://github.com/zalmoxisus)", + "license": "MIT", + "peerDependencies": { + "redux": "^3.1.0 || ^4.0.0" + }, + "gitHead": "5ef9b00cd4717ac878068ce8003e1999e680c72e" +} diff --git a/node_modules/redux-devtools-extension/utils/assign.js b/node_modules/redux-devtools-extension/utils/assign.js new file mode 100644 index 00000000..75b70438 --- /dev/null +++ b/node_modules/redux-devtools-extension/utils/assign.js @@ -0,0 +1,24 @@ +var objectKeys = + Object.keys || + function (obj) { + var keys = []; + for (var key in obj) { + if ({}.hasOwnProperty.call(obj, key)) keys.push(key); + } + return keys; + }; + +function assign(obj, newKey, newValue) { + var keys = objectKeys(obj); + var copy = {}; + + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + copy[key] = obj[key]; + } + + copy[newKey] = newValue; + return copy; +} + +module.exports = assign; diff --git a/node_modules/redux-persist/CHANGELOG.md b/node_modules/redux-persist/CHANGELOG.md new file mode 100644 index 00000000..7e3bce49 --- /dev/null +++ b/node_modules/redux-persist/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added +- [PR #974](https://github.com/rt2zz/redux-persist/pull/974) **Add correct PersistGate defaultProps to support newer flow versions.** Adds `children` to defaultProps in `PersistGate` component and removes the optional (`?`) flag in order to be compatible with flow type checking (more explanation can be found in [this flow issue](facebook/flow#1660)). Fixes [#953](https://github.com/rt2zz/redux-persist/issues/953) +- [PR #949](https://github.com/rt2zz/redux-persist/pull/949) **Allow onWriteFail +to be passed in config.** The value should be a function to be called in the +case a write fails (i.e. because the disk it out of space). +- **Add Community section to README.** Add link to Reactiflux #redux-persist +channel. Add blog articles about redux-persist from the community. + +## 0.2.0 through 5.10.0 - 2015-07-24 through 2018-06-05 +See notes on [GitHub releases page](https://github.com/rt2zz/redux-persist/releases) + +[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v5.10.0...HEAD +[0.2.0 through 5.10.0]: See notes on [GitHub releases page](https://github.com/rt2zz/redux-persist/releases) diff --git a/node_modules/redux-persist/LICENSE b/node_modules/redux-persist/LICENSE new file mode 100644 index 00000000..4c472dbb --- /dev/null +++ b/node_modules/redux-persist/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Zack Story + +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/redux-persist/README.md b/node_modules/redux-persist/README.md new file mode 100644 index 00000000..0b7d6c6a --- /dev/null +++ b/node_modules/redux-persist/README.md @@ -0,0 +1,266 @@ +# Redux Persist + +Persist and rehydrate a redux store. + +[![build status](https://img.shields.io/travis/rt2zz/redux-persist/master.svg?style=flat-square)](https://travis-ci.org/rt2zz/redux-persist) [![npm version](https://img.shields.io/npm/v/redux-persist.svg?style=flat-square)](https://www.npmjs.com/package/redux-persist) [![npm downloads](https://img.shields.io/npm/dm/redux-persist.svg?style=flat-square)](https://www.npmjs.com/package/redux-persist) +[![#redux-persist on Discord](https://img.shields.io/discord/102860784329052160.svg)](https://discord.gg/ExrEvmv) + +## Quickstart +`npm install redux-persist` + +Usage Examples: +1. [Basic Usage](#basic-usage) +2. [Nested Persists](#nested-persists) +3. [Hot Module Replacement](./docs/hot-module-replacement.md) +4. Code Splitting [coming soon] + +#### Basic Usage +Basic usage involves adding `persistReducer` and `persistStore` to your setup. **IMPORTANT** Every app needs to decide how many levels of state they want to "merge". The default is 1 level. Please read through the [state reconciler docs](#state-reconciler) for more information. + +```js +// configureStore.js + +import { createStore } from 'redux' +import { persistStore, persistReducer } from 'redux-persist' +import storage from 'redux-persist/lib/storage' // defaults to localStorage for web + +import rootReducer from './reducers' + +const persistConfig = { + key: 'root', + storage, +} + +const persistedReducer = persistReducer(persistConfig, rootReducer) + +export default () => { + let store = createStore(persistedReducer) + let persistor = persistStore(store) + return { store, persistor } +} +``` + +If you are using react, wrap your root component with [PersistGate](./docs/PersistGate.md). This delays the rendering of your app's UI until your persisted state has been retrieved and saved to redux. **NOTE** the `PersistGate` loading prop can be null, or any react instance, e.g. `loading={}` + +```js +import { PersistGate } from 'redux-persist/integration/react' + +// ... normal setup, create store and persistor, import components etc. + +const App = () => { + return ( + + + + + + ); +}; +``` + +## API +[Full API](./docs/api.md) + +#### `persistReducer(config, reducer)` + - arguments + - [**config**](https://github.com/rt2zz/redux-persist/blob/master/src/types.js#L13-L27) *object* + - required config: `key, storage` + - notable other config: `whitelist, blacklist, version, stateReconciler, debug` + - **reducer** *function* + - any reducer will work, typically this would be the top level reducer returned by `combineReducers` + - returns an enhanced reducer + +#### `persistStore(store, [config, callback])` + - arguments + - **store** *redux store* The store to be persisted. + - **config** *object* (typically null) + - If you want to avoid that the persistence starts immediately after calling `persistStore`, set the option manualPersist. Example: `{ manualPersist: true }` Persistence can then be started at any point with `peristor.persist()`. You usually want to do this if your storage is not ready when the `persistStore` call is made. + - **callback** *function* will be called after rehydration is finished. + - returns **persistor** object + +#### `persistor object` + - the persistor object is returned by persistStore with the following methods: + - `.purge()` + - purges state from disk and returns a promise + - `.flush()` + - immediately writes all pending state to disk and returns a promise + - `.pause()` + - pauses persistence + - `.persist()` + - resumes persistence + +## State Reconciler +State reconcilers define how incoming state is merged in with initial state. It is critical to choose the right state reconciler for your state. There are three options that ship out of the box, let's look at how each operates: + +1. **hardSet** (`import hardSet from 'redux-persist/lib/stateReconciler/hardSet'`) +This will hard set incoming state. This can be desirable in some cases where persistReducer is nested deeper in your reducer tree, or if you do not rely on initialState in your reducer. + - **incoming state**: `{ foo: incomingFoo }` + - **initial state**: `{ foo: initialFoo, bar: initialBar }` + - **reconciled state**: `{ foo: incomingFoo }` // note bar has been dropped +2. **autoMergeLevel1** (default) +This will auto merge one level deep. Auto merge means if the some piece of substate was modified by your reducer during the REHYDRATE action, it will skip this piece of state. Level 1 means it will shallow merge 1 level deep. + - **incoming state**: `{ foo: incomingFoo }` + - **initial state**: `{ foo: initialFoo, bar: initialBar }` + - **reconciled state**: `{ foo: incomingFoo, bar: initialBar }` // note incomingFoo overwrites initialFoo +3. **autoMergeLevel2** (`import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'`) +This acts just like autoMergeLevel1, except it shallow merges two levels + - **incoming state**: `{ foo: incomingFoo }` + - **initial state**: `{ foo: initialFoo, bar: initialBar }` + - **reconciled state**: `{ foo: mergedFoo, bar: initialBar }` // note: initialFoo and incomingFoo are shallow merged + +#### Example +```js +import hardSet from 'redux-persist/lib/stateReconciler/hardSet' + +const persistConfig = { + key: 'root', + storage, + stateReconciler: hardSet, +} +``` + +## React Integration +Redux persist ships with react integration as a convenience. The `PersistGate` component is the recommended way to delay rendering until persistence is complete. It works in one of two modes: +1. `loading` prop: The provided loading value will be rendered until persistence is complete at which point children will be rendered. +2. function children: The function will be invoked with a single `bootstrapped` argument. When bootstrapped is true, persistence is complete and it is safe to render the full app. This can be useful for adding transition animations. + +## Blacklist & Whitelist +By Example: +```js +// BLACKLIST +const persistConfig = { + key: 'root', + storage: storage, + blacklist: ['navigation'] // navigation will not be persisted +}; + +// WHITELIST +const persistConfig = { + key: 'root', + storage: storage, + whitelist: ['navigation'] // only navigation will be persisted +}; +``` + +## Nested Persists +Nested persist can be useful for including different storage adapters, code splitting, or deep filtering. For example while blacklist and whitelist only work one level deep, but we can use a nested persist to blacklist a deeper value: +```js +import { combineReducers } from 'redux' +import { persistReducer } from 'redux-persist' +import storage from 'redux-persist/lib/storage' + +import { authReducer, otherReducer } from './reducers' + +const rootPersistConfig = { + key: 'root', + storage: storage, + blacklist: ['auth'] +} + +const authPersistConfig = { + key: 'auth', + storage: storage, + blacklist: ['somethingTemporary'] +} + +const rootReducer = combineReducers({ + auth: persistReducer(authPersistConfig, authReducer), + other: otherReducer, +}) + +export default persistReducer(rootPersistConfig, rootReducer) +``` + +## Migrations +`persistReducer` has a general purpose "migrate" config which will be called after getting stored state but before actually reconciling with the reducer. It can be any function which takes state as an argument and returns a promise to return a new state object. + +Redux Persist ships with `createMigrate`, which helps create a synchronous migration for moving from any version of stored state to the current state version. [[Additional information]](./docs/migrations.md) + +## Transforms +Transforms allow you to customize the state object that gets persisted and rehydrated. + +There are several libraries that tackle some of the common implementations for transforms. +- [immutable](https://github.com/rt2zz/redux-persist-transform-immutable) - support immutable reducers +- [seamless-immutable](https://github.com/hilkeheremans/redux-persist-seamless-immutable) - support seamless-immutable reducers +- [compress](https://github.com/rt2zz/redux-persist-transform-compress) - compress your serialized state with lz-string +- [encrypt](https://github.com/maxdeviant/redux-persist-transform-encrypt) - encrypt your serialized state with AES +- [filter](https://github.com/edy/redux-persist-transform-filter) - store or load a subset of your state +- [filter-immutable](https://github.com/actra-development/redux-persist-transform-filter-immutable) - store or load a subset of your state with support for immutablejs +- [expire](https://github.com/gabceb/redux-persist-transform-expire) - expire a specific subset of your state based on a property +- [expire-reducer](https://github.com/kamranahmedse/redux-persist-expire) - more flexible alternative to expire transformer above with more options + +When the state object gets persisted, it first gets serialized with `JSON.stringify()`. If parts of your state object are not mappable to JSON objects, the serialization process may transform these parts of your state in unexpected ways. For example, the javascript [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) type does not exist in JSON. When you try to serialize a Set via `JSON.stringify()`, it gets converted to an empty object. Probably not what you want. + +Below is a Transform that successfully persists a Set property, which simply converts it to an array and back. In this way, the Set gets converted to an Array, which is a recognized data structure in JSON. When pulled out of the persisted store, the array gets converted back to a Set before being saved to the redux store. + +```js +import { createTransform } from 'redux-persist'; + +const SetTransform = createTransform( + // transform state on its way to being serialized and persisted. + (inboundState, key) => { + // convert mySet to an Array. + return { ...inboundState, mySet: [...inboundState.mySet] }; + }, + // transform state being rehydrated + (outboundState, key) => { + // convert mySet back to a Set. + return { ...outboundState, mySet: new Set(outboundState.mySet) }; + }, + // define which reducers this transform gets called for. + { whitelist: ['someReducer'] } +); + +export default SetTransform; +``` + +The `createTransform` function takes three parameters. +1. An "inbound" function that gets called right before state is persisted (optional). +2. An "outbound" function that gets called right before state is rehydrated (optional). +3. A config object that determines which keys in your state will be transformed (by default no keys are transformed). + +In order to take effect transforms need to be added to a `PersistReducer`’s config object. + +``` +import storage from 'redux-persist/lib/storage'; +import { SetTransform } from './transforms'; + +const persistConfig = { + key: 'root', + storage: storage, + transforms: [SetTransform] +}; +``` + +## Storage Engines +- **localStorage** `import storage from 'redux-persist/lib/storage'` +- **sessionStorage** `import storageSession from 'redux-persist/lib/storage/session'` +- **AsyncStorage** react-native `import AsyncStorage from '@react-native-community/async-storage'` +- **[localForage](https://github.com/mozilla/localForage)** recommended for web +- **[electron storage](https://github.com/psperber/redux-persist-electron-storage)** Electron support via [electron store](https://github.com/sindresorhus/electron-store) +- **[redux-persist-filesystem-storage](https://github.com/robwalkerco/redux-persist-filesystem-storage)** react-native, to mitigate storage size limitations in android ([#199](https://github.com/rt2zz/redux-persist/issues/199), [#284](https://github.com/rt2zz/redux-persist/issues/284)) +- **[redux-persist-node-storage](https://github.com/pellejacobs/redux-persist-node-storage)** for use in nodejs environments. +- **[redux-persist-sensitive-storage](https://github.com/CodingZeal/redux-persist-sensitive-storage)** react-native, for sensitive information (uses [react-native-sensitive-info](https://github.com/mCodex/react-native-sensitive-info)). +- **[redux-persist-expo-filesystem](https://github.com/t73liu/redux-persist-expo-filesystem)** react-native, similar to redux-persist-filesystem-storage but does not require linking or ejecting CRNA/Expo app. Only available if using Expo SDK (Expo, create-react-native-app, standalone). +- **[redux-persist-expo-securestore](https://github.com/Cretezy/redux-persist-expo-securestore)** react-native, for sensitive information using Expo's SecureStore. Only available if using Expo SDK (Expo, create-react-native-app, standalone). +- **[redux-persist-fs-storage](https://github.com/leethree/redux-persist-fs-storage)** react-native-fs engine +- **[redux-persist-cookie-storage](https://github.com/abersager/redux-persist-cookie-storage)** Cookie storage engine, works in browser and Node.js, for universal / isomorphic apps +- **[redux-persist-weapp-storage](https://github.com/cuijiemmx/redux-casa/tree/master/packages/redux-persist-weapp-storage)** Storage engine for wechat mini program, also compatible with wepy +- **[redux-persist-webextension-storage](https://github.com/ssorallen/redux-persist-webextension-storage)** Storage engine for browser (Chrome, Firefox) web extension storage +- **[@bankify/redux-persist-realm](https://github.com/bankifyio/redux-persist-realm)** Storage engine for Realm database, you will need to install Realm first +- **[redux-persist-pouchdb](https://github.com/yanick/redux-persist-pouchdb)** Storage engine for PouchDB. +- **custom** any conforming storage api implementing the following methods: `setItem` `getItem` `removeItem`. (**NB**: These methods must support promises) + +## Community + +### Chat Room + +[![#redux-persist on Discord](https://img.shields.io/discord/102860784329052160.svg)](https://discord.gg/ExrEvmv) #redux-persist channel in the [Reactiflux](https://www.reactiflux.com/) Discord + +### Blog articles from the community + +* [The Definitive Guide to Redux Persist: Persist your Redux state in between app launches with Redux Persist](https://blog.reactnativecoach.com/the-definitive-guide-to-redux-persist-84738167975) by Mark Newton +* [Redux-persist: The Good Parts](https://codeburst.io/redux-persist-the-good-parts-adfab9f91c3b) by Feargal Walsh +* [Redux: Persist Your State](https://medium.com/async-la/redux-persist-your-state-7ad346c4dd07) by Zack +* [{Persist}ence is Key: Using Redux-Persist to Store Your State in LocalStorage](https://medium.com/@clrksanford/persist-ence-is-key-using-redux-persist-to-store-your-state-in-localstorage-ac6a000aee63) by Clark Sanford +* [How to use Redux Persist when migrating your states](https://medium.freecodecamp.org/how-to-use-redux-persist-when-migrating-your-states-a5dee16b5ead) by Lusan Das diff --git a/node_modules/redux-persist/dist/redux-persist.js b/node_modules/redux-persist/dist/redux-persist.js new file mode 100644 index 00000000..6168f267 --- /dev/null +++ b/node_modules/redux-persist/dist/redux-persist.js @@ -0,0 +1,1244 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.ReduxPersist = {}))); +}(this, (function (exports) { 'use strict'; + +function _typeof(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +} + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; +} + +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; +} + +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; +} + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; +} + +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); +} + +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } +} + +function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} + +var KEY_PREFIX = 'persist:'; +var FLUSH = 'persist/FLUSH'; +var REHYDRATE = 'persist/REHYDRATE'; +var PAUSE = 'persist/PAUSE'; +var PERSIST = 'persist/PERSIST'; +var PURGE = 'persist/PURGE'; +var REGISTER = 'persist/REGISTER'; +var DEFAULT_VERSION = -1; + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ +function autoMergeLevel1(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread2({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if ("development" !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } // otherwise hard set the new value + + + newState[key] = inboundState[key]; + }); + } + + if ("development" !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} + +// @TODO remove once flow < 0.63 support is no longer required. +function createPersistoid(config) { + // defaults + var blacklist = config.blacklist || null; + var whitelist = config.whitelist || null; + var transforms = config.transforms || []; + var throttle = config.throttle || 0; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + var storage = config.storage; + var serialize; + + if (config.serialize === false) { + serialize = function serialize(x) { + return x; + }; + } else if (typeof config.serialize === 'function') { + serialize = config.serialize; + } else { + serialize = defaultSerialize; + } + + var writeFailHandler = config.writeFailHandler || null; // initialize stateful values + + var lastState = {}; + var stagedState = {}; + var keysToProcess = []; + var timeIterator = null; + var writePromise = null; + + var update = function update(state) { + // add any changed keys to the queue + Object.keys(state).forEach(function (key) { + if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop + + if (lastState[key] === state[key]) return; // value unchanged? noop + + if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop + + keysToProcess.push(key); // add key to queue + }); //if any key is missing in the new state which was present in the lastState, + //add it for processing too + + Object.keys(lastState).forEach(function (key) { + if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) { + keysToProcess.push(key); + } + }); // start the time iterator if not running (read: throttle) + + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle); + } + + lastState = state; + }; + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator); + timeIterator = null; + return; + } + + var key = keysToProcess.shift(); + var endState = transforms.reduce(function (subState, transformer) { + return transformer.in(subState, key, lastState); + }, lastState[key]); + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState); + } catch (err) { + console.error('redux-persist/createPersistoid: error serializing state', err); + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key]; + } + + if (keysToProcess.length === 0) { + writeStagedState(); + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(function (key) { + if (lastState[key] === undefined) { + delete stagedState[key]; + } + }); + writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail); + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false; + if (blacklist && blacklist.indexOf(key) !== -1) return false; + return true; + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err); + + if (err && "development" !== 'production') { + console.error('Error storing data', err); + } + } + + var flush = function flush() { + while (keysToProcess.length !== 0) { + processNextKey(); + } + + return writePromise || Promise.resolve(); + }; // return `persistoid` + + + return { + update: update, + flush: flush + }; +} // @NOTE in the future this may be exposed via config + +function defaultSerialize(data) { + return JSON.stringify(data); +} + +function getStoredState(config) { + var transforms = config.transforms || []; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + var storage = config.storage; + var debug = config.debug; + var deserialize; + + if (config.deserialize === false) { + deserialize = function deserialize(x) { + return x; + }; + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize; + } else { + deserialize = defaultDeserialize; + } + + return storage.getItem(storageKey).then(function (serialized) { + if (!serialized) return undefined;else { + try { + var state = {}; + var rawState = deserialize(serialized); + Object.keys(rawState).forEach(function (key) { + state[key] = transforms.reduceRight(function (subState, transformer) { + return transformer.out(subState, key, rawState); + }, deserialize(rawState[key])); + }); + return state; + } catch (err) { + if ("development" !== 'production' && debug) console.log("redux-persist/getStoredState: Error restoring data ".concat(serialized), err); + throw err; + } + } + }); +} + +function defaultDeserialize(serial) { + return JSON.parse(serial); +} + +function purgeStoredState(config) { + var storage = config.storage; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + return storage.removeItem(storageKey, warnIfRemoveError); +} + +function warnIfRemoveError(err) { + if (err && "development" !== 'production') { + console.error('redux-persist/purgeStoredState: Error purging data stored state', err); + } +} + +var DEFAULT_TIMEOUT = 5000; +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ + +function persistReducer(config, baseReducer) { + { + if (!config) throw new Error('config is required for persistReducer'); + if (!config.key) throw new Error('key is required in persistor config'); + if (!config.storage) throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`"); + } + + var version = config.version !== undefined ? config.version : DEFAULT_VERSION; + var debug = config.debug || false; + var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler; + var getStoredState$$1 = config.getStoredState || getStoredState; + var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT; + var _persistoid = null; + var _purge = false; + var _paused = true; + + var conditionalUpdate = function conditionalUpdate(state) { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state); + return state; + }; + + return function (state, action) { + var _ref = state || {}, + _persist = _ref._persist, + rest = _objectWithoutProperties(_ref, ["_persist"]); // $FlowIgnore need to update State type + + + var restState = rest; + + if (action.type === PERSIST) { + var _sealed = false; + + var _rehydrate = function _rehydrate(payload, err) { + // dev warning if we are already sealed + if ("development" !== 'production' && _sealed) console.error("redux-persist: rehydrate for \"".concat(config.key, "\" called after timeout."), payload, err); // only rehydrate if we are not already sealed + + if (!_sealed) { + action.rehydrate(config.key, payload, err); + _sealed = true; + } + }; + + timeout && setTimeout(function () { + !_sealed && _rehydrate(undefined, new Error("redux-persist: persist timed out for persist key \"".concat(config.key, "\""))); + }, timeout); // @NOTE PERSIST resumes if paused. + + _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + + if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first + + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return _objectSpread2({}, baseReducer(restState, action), { + _persist: _persist + }); + } + + if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'); + action.register(config.key); + getStoredState$$1(config).then(function (restoredState) { + var migrate = config.migrate || function (s, v) { + return Promise.resolve(s); + }; + + migrate(restoredState, version).then(function (migratedState) { + _rehydrate(migratedState); + }, function (migrateErr) { + if ("development" !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr); + + _rehydrate(undefined, migrateErr); + }); + }, function (err) { + _rehydrate(undefined, err); + }); + return _objectSpread2({}, baseReducer(restState, action), { + _persist: { + version: version, + rehydrated: false + } + }); + } else if (action.type === PURGE) { + _purge = true; + action.result(purgeStoredState(config)); + return _objectSpread2({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === FLUSH) { + action.result(_persistoid && _persistoid.flush()); + return _objectSpread2({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === PAUSE) { + _paused = true; + } else if (action.type === REHYDRATE) { + // noop on restState if purging + if (_purge) return _objectSpread2({}, restState, { + _persist: _objectSpread2({}, _persist, { + rehydrated: true + }) // @NOTE if key does not match, will continue to default else below + + }); + + if (action.key === config.key) { + var reducedState = baseReducer(restState, action); + var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined + + var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState; + + var _newState = _objectSpread2({}, reconciledRest, { + _persist: _objectSpread2({}, _persist, { + rehydrated: true + }) + }); + + return conditionalUpdate(_newState); + } + } // if we have not already handled PERSIST, straight passthrough + + + if (!_persist) return baseReducer(state, action); // run base reducer: + // is state modified ? return original : return updated + + var newState = baseReducer(restState, action); + if (newState === restState) return state; + return conditionalUpdate(_objectSpread2({}, newState, { + _persist: _persist + })); + }; +} + +function symbolObservablePonyfill(root) { + var result; + var Symbol = root.Symbol; + + if (typeof Symbol === 'function') { + if (Symbol.observable) { + result = Symbol.observable; + } else { + result = Symbol('observable'); + Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +} + +/* global window */ +var root; + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = symbolObservablePonyfill(root); + +/** + * These are private action types reserved by Redux. + * For any unknown actions, you must return the current state. + * If the current state is undefined, you must return the initial state. + * Do not reference these action types directly in your code. + */ +var randomString = function randomString() { + return Math.random().toString(36).substring(7).split('').join('.'); +}; + +var ActionTypes = { + INIT: "@@redux/INIT" + randomString(), + REPLACE: "@@redux/REPLACE" + randomString(), + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); + } +}; + +/** + * @param {any} obj The object to inspect. + * @returns {boolean} True if the argument appears to be a plain object. + */ +function isPlainObject(obj) { + if (typeof obj !== 'object' || obj === null) return false; + var proto = obj; + + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + + return Object.getPrototypeOf(obj) === proto; +} + +/** + * Creates a Redux store that holds the state tree. + * The only way to change the data in the store is to call `dispatch()` on it. + * + * There should only be a single store in your app. To specify how different + * parts of the state tree respond to actions, you may combine several reducers + * into a single reducer function by using `combineReducers`. + * + * @param {Function} reducer A function that returns the next state tree, given + * the current state tree and the action to handle. + * + * @param {any} [preloadedState] The initial state. You may optionally specify it + * to hydrate the state from the server in universal apps, or to restore a + * previously serialized user session. + * If you use `combineReducers` to produce the root reducer function, this must be + * an object with the same shape as `combineReducers` keys. + * + * @param {Function} [enhancer] The store enhancer. You may optionally specify it + * to enhance the store with third-party capabilities such as middleware, + * time travel, persistence, etc. The only store enhancer that ships with Redux + * is `applyMiddleware()`. + * + * @returns {Store} A Redux store that lets you read the state, dispatch actions + * and subscribe to changes. + */ + +function createStore(reducer, preloadedState, enhancer) { + var _ref2; + + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { + throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.'); + } + + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { + enhancer = preloadedState; + preloadedState = undefined; + } + + if (typeof enhancer !== 'undefined') { + if (typeof enhancer !== 'function') { + throw new Error('Expected the enhancer to be a function.'); + } + + return enhancer(createStore)(reducer, preloadedState); + } + + if (typeof reducer !== 'function') { + throw new Error('Expected the reducer to be a function.'); + } + + var currentReducer = reducer; + var currentState = preloadedState; + var currentListeners = []; + var nextListeners = currentListeners; + var isDispatching = false; + /** + * This makes a shallow copy of currentListeners so we can use + * nextListeners as a temporary list while dispatching. + * + * This prevents any bugs around consumers calling + * subscribe/unsubscribe in the middle of a dispatch. + */ + + function ensureCanMutateNextListeners() { + if (nextListeners === currentListeners) { + nextListeners = currentListeners.slice(); + } + } + /** + * Reads the state tree managed by the store. + * + * @returns {any} The current state tree of your application. + */ + + + function getState() { + if (isDispatching) { + throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.'); + } + + return currentState; + } + /** + * Adds a change listener. It will be called any time an action is dispatched, + * and some part of the state tree may potentially have changed. You may then + * call `getState()` to read the current state tree inside the callback. + * + * You may call `dispatch()` from a change listener, with the following + * caveats: + * + * 1. The subscriptions are snapshotted just before every `dispatch()` call. + * If you subscribe or unsubscribe while the listeners are being invoked, this + * will not have any effect on the `dispatch()` that is currently in progress. + * However, the next `dispatch()` call, whether nested or not, will use a more + * recent snapshot of the subscription list. + * + * 2. The listener should not expect to see all state changes, as the state + * might have been updated multiple times during a nested `dispatch()` before + * the listener is called. It is, however, guaranteed that all subscribers + * registered before the `dispatch()` started will be called with the latest + * state by the time it exits. + * + * @param {Function} listener A callback to be invoked on every dispatch. + * @returns {Function} A function to remove this change listener. + */ + + + function subscribe(listener) { + if (typeof listener !== 'function') { + throw new Error('Expected the listener to be a function.'); + } + + if (isDispatching) { + throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); + } + + var isSubscribed = true; + ensureCanMutateNextListeners(); + nextListeners.push(listener); + return function unsubscribe() { + if (!isSubscribed) { + return; + } + + if (isDispatching) { + throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); + } + + isSubscribed = false; + ensureCanMutateNextListeners(); + var index = nextListeners.indexOf(listener); + nextListeners.splice(index, 1); + }; + } + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will + * be considered the **next** state of the tree, and the change listeners + * will be notified. + * + * The base implementation only supports plain object actions. If you want to + * dispatch a Promise, an Observable, a thunk, or something else, you need to + * wrap your store creating function into the corresponding middleware. For + * example, see the documentation for the `redux-thunk` package. Even the + * middleware will eventually dispatch plain object actions using this method. + * + * @param {Object} action A plain object representing “what changed”. It is + * a good idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must have + * a `type` property which may not be `undefined`. It is a good idea to use + * string constants for action types. + * + * @returns {Object} For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + + + function dispatch(action) { + if (!isPlainObject(action)) { + throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); + } + + if (typeof action.type === 'undefined') { + throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); + } + + if (isDispatching) { + throw new Error('Reducers may not dispatch actions.'); + } + + try { + isDispatching = true; + currentState = currentReducer(currentState, action); + } finally { + isDispatching = false; + } + + var listeners = currentListeners = nextListeners; + + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); + } + + return action; + } + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param {Function} nextReducer The reducer for the store to use instead. + * @returns {void} + */ + + + function replaceReducer(nextReducer) { + if (typeof nextReducer !== 'function') { + throw new Error('Expected the nextReducer to be a function.'); + } + + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. + // Any reducers that existed in both the new and old rootReducer + // will receive the previous state. This effectively populates + // the new state tree with any relevant data from the old one. + + dispatch({ + type: ActionTypes.REPLACE + }); + } + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ + + + function observable() { + var _ref; + + var outerSubscribe = subscribe; + return _ref = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: function subscribe(observer) { + if (typeof observer !== 'object' || observer === null) { + throw new TypeError('Expected the observer to be an object.'); + } + + function observeState() { + if (observer.next) { + observer.next(getState()); + } + } + + observeState(); + var unsubscribe = outerSubscribe(observeState); + return { + unsubscribe: unsubscribe + }; + } + }, _ref[result] = function () { + return this; + }, _ref; + } // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + + + dispatch({ + type: ActionTypes.INIT + }); + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[result] = observable, _ref2; +} + +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); + } + /* eslint-enable no-console */ + + + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + } catch (e) {} // eslint-disable-line no-empty + +} + +function getUndefinedStateErrorMessage(key, action) { + var actionType = action && action.type; + var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action'; + return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined."; +} + +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { + var reducerKeys = Object.keys(reducers); + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; + + if (reducerKeys.length === 0) { + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; + } + + if (!isPlainObject(inputState)) { + return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); + } + + var unexpectedKeys = Object.keys(inputState).filter(function (key) { + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; + }); + unexpectedKeys.forEach(function (key) { + unexpectedKeyCache[key] = true; + }); + if (action && action.type === ActionTypes.REPLACE) return; + + if (unexpectedKeys.length > 0) { + return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); + } +} + +function assertReducerShape(reducers) { + Object.keys(reducers).forEach(function (key) { + var reducer = reducers[key]; + var initialState = reducer(undefined, { + type: ActionTypes.INIT + }); + + if (typeof initialState === 'undefined') { + throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined."); + } + + if (typeof reducer(undefined, { + type: ActionTypes.PROBE_UNKNOWN_ACTION() + }) === 'undefined') { + throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null."); + } + }); +} +/** + * Turns an object whose values are different reducer functions, into a single + * reducer function. It will call every child reducer, and gather their results + * into a single state object, whose keys correspond to the keys of the passed + * reducer functions. + * + * @param {Object} reducers An object whose values correspond to different + * reducer functions that need to be combined into one. One handy way to obtain + * it is to use ES6 `import * as reducers` syntax. The reducers may never return + * undefined for any action. Instead, they should return their initial state + * if the state passed to them was undefined, and the current state for any + * unrecognized action. + * + * @returns {Function} A reducer function that invokes every reducer inside the + * passed object, and builds a state object with the same shape. + */ + + +function combineReducers(reducers) { + var reducerKeys = Object.keys(reducers); + var finalReducers = {}; + + for (var i = 0; i < reducerKeys.length; i++) { + var key = reducerKeys[i]; + + { + if (typeof reducers[key] === 'undefined') { + warning("No reducer provided for key \"" + key + "\""); + } + } + + if (typeof reducers[key] === 'function') { + finalReducers[key] = reducers[key]; + } + } + + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same + // keys multiple times. + + var unexpectedKeyCache; + + { + unexpectedKeyCache = {}; + } + + var shapeAssertionError; + + try { + assertReducerShape(finalReducers); + } catch (e) { + shapeAssertionError = e; + } + + return function combination(state, action) { + if (state === void 0) { + state = {}; + } + + if (shapeAssertionError) { + throw shapeAssertionError; + } + + { + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); + + if (warningMessage) { + warning(warningMessage); + } + } + + var hasChanged = false; + var nextState = {}; + + for (var _i = 0; _i < finalReducerKeys.length; _i++) { + var _key = finalReducerKeys[_i]; + var reducer = finalReducers[_key]; + var previousStateForKey = state[_key]; + var nextStateForKey = reducer(previousStateForKey, action); + + if (typeof nextStateForKey === 'undefined') { + var errorMessage = getUndefinedStateErrorMessage(_key, action); + throw new Error(errorMessage); + } + + nextState[_key] = nextStateForKey; + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; + } + + return hasChanged ? nextState : state; + }; +} + +/* + * This is a dummy function to check if the function name has been altered by minification. + * If the function has been minified and NODE_ENV !== 'production', warn the user. + */ + +function isCrushed() {} + +if ("development" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { + warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.'); +} + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ +function autoMergeLevel2(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread2({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if ("development" !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } + + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = _objectSpread2({}, newState[key], {}, inboundState[key]); + return; + } // otherwise hard set + + + newState[key] = inboundState[key]; + }); + } + + if ("development" !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && _typeof(o) === 'object'; +} + +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +function persistCombineReducers(config, reducers) { + config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler; + return persistReducer(config, combineReducers(reducers)); +} + +var initialState = { + registry: [], + bootstrapped: false +}; + +var persistorReducer = function persistorReducer() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case REGISTER: + return _objectSpread2({}, state, { + registry: [].concat(_toConsumableArray(state.registry), [action.key]) + }); + + case REHYDRATE: + var firstIndex = state.registry.indexOf(action.key); + + var registry = _toConsumableArray(state.registry); + + registry.splice(firstIndex, 1); + return _objectSpread2({}, state, { + registry: registry, + bootstrapped: registry.length === 0 + }); + + default: + return state; + } +}; + +function persistStore(store, options, cb) { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + { + var optionsToTest = options || {}; + var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate']; + bannedKeys.forEach(function (k) { + if (!!optionsToTest[k]) console.error("redux-persist: invalid option passed to persistStore: \"".concat(k, "\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.")); + }); + } + + var boostrappedCb = cb || false; + + var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined); + + var register = function register(key) { + _pStore.dispatch({ + type: REGISTER, + key: key + }); + }; + + var rehydrate = function rehydrate(key, payload, err) { + var rehydrateAction = { + type: REHYDRATE, + payload: payload, + err: err, + key: key // dispatch to `store` to rehydrate and `persistor` to track result + + }; + store.dispatch(rehydrateAction); + + _pStore.dispatch(rehydrateAction); + + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb(); + boostrappedCb = false; + } + }; + + var persistor = _objectSpread2({}, _pStore, { + purge: function purge() { + var results = []; + store.dispatch({ + type: PURGE, + result: function result(purgeResult) { + results.push(purgeResult); + } + }); + return Promise.all(results); + }, + flush: function flush() { + var results = []; + store.dispatch({ + type: FLUSH, + result: function result(flushResult) { + results.push(flushResult); + } + }); + return Promise.all(results); + }, + pause: function pause() { + store.dispatch({ + type: PAUSE + }); + }, + persist: function persist() { + store.dispatch({ + type: PERSIST, + register: register, + rehydrate: rehydrate + }); + } + }); + + if (!(options && options.manualPersist)) { + persistor.persist(); + } + + return persistor; +} + +function createMigrate(migrations, config) { + var _ref = config || {}, + debug = _ref.debug; + + return function (state, currentVersion) { + if (!state) { + if ("development" !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration'); + return Promise.resolve(undefined); + } + + var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : DEFAULT_VERSION; + + if (inboundVersion === currentVersion) { + if ("development" !== 'production' && debug) console.log('redux-persist: versions match, noop migration'); + return Promise.resolve(state); + } + + if (inboundVersion > currentVersion) { + console.error('redux-persist: downgrading version is not supported'); + return Promise.resolve(state); + } + + var migrationKeys = Object.keys(migrations).map(function (ver) { + return parseInt(ver); + }).filter(function (key) { + return currentVersion >= key && key > inboundVersion; + }).sort(function (a, b) { + return a - b; + }); + if ("development" !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys); + + try { + var migratedState = migrationKeys.reduce(function (state, versionKey) { + if ("development" !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey); + return migrations[versionKey](state); + }, state); + return Promise.resolve(migratedState); + } catch (err) { + return Promise.reject(err); + } + }; +} + +function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored +inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux +outbound) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var whitelist = config.whitelist || null; + var blacklist = config.blacklist || null; + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true; + if (blacklist && blacklist.indexOf(key) !== -1) return true; + return false; + } + + return { + in: function _in(state, key, fullState) { + return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state; + }, + out: function out(state, key, fullState) { + return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state; + } + }; +} + +exports.persistReducer = persistReducer; +exports.persistCombineReducers = persistCombineReducers; +exports.persistStore = persistStore; +exports.createMigrate = createMigrate; +exports.createTransform = createTransform; +exports.getStoredState = getStoredState; +exports.createPersistoid = createPersistoid; +exports.purgeStoredState = purgeStoredState; +exports.KEY_PREFIX = KEY_PREFIX; +exports.FLUSH = FLUSH; +exports.REHYDRATE = REHYDRATE; +exports.PAUSE = PAUSE; +exports.PERSIST = PERSIST; +exports.PURGE = PURGE; +exports.REGISTER = REGISTER; +exports.DEFAULT_VERSION = DEFAULT_VERSION; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=redux-persist.js.map diff --git a/node_modules/redux-persist/dist/redux-persist.js.map b/node_modules/redux-persist/dist/redux-persist.js.map new file mode 100644 index 00000000..16901633 --- /dev/null +++ b/node_modules/redux-persist/dist/redux-persist.js.map @@ -0,0 +1 @@ +{"version":3,"file":"redux-persist.js","sources":["../src/constants.js","../src/stateReconciler/autoMergeLevel1.js","../src/createPersistoid.js","../src/getStoredState.js","../src/purgeStoredState.js","../src/persistReducer.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/symbol-observable/es/index.js","../node_modules/redux/es/redux.js","../src/stateReconciler/autoMergeLevel2.js","../src/persistCombineReducers.js","../src/persistStore.js","../src/createMigrate.js","../src/createTransform.js"],"sourcesContent":["// @flow\n\nexport const KEY_PREFIX = 'persist:'\nexport const FLUSH = 'persist/FLUSH'\nexport const REHYDRATE = 'persist/REHYDRATE'\nexport const PAUSE = 'persist/PAUSE'\nexport const PERSIST = 'persist/PERSIST'\nexport const PURGE = 'persist/PURGE'\nexport const REGISTER = 'persist/REGISTER'\nexport const DEFAULT_VERSION = -1\n","// @flow\n\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\n\nimport type { PersistConfig } from '../types'\n\nexport default function autoMergeLevel1(\n inboundState: State,\n originalState: State,\n reducedState: State,\n { debug }: PersistConfig\n): State {\n let newState = { ...reducedState }\n // only rehydrate if inboundState exists and is an object\n if (inboundState && typeof inboundState === 'object') {\n Object.keys(inboundState).forEach(key => {\n // ignore _persist data\n if (key === '_persist') return\n // if reducer modifies substate, skip auto rehydration\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',\n key\n )\n return\n }\n // otherwise hard set the new value\n newState[key] = inboundState[key]\n })\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n debug &&\n inboundState &&\n typeof inboundState === 'object'\n )\n console.log(\n `redux-persist/stateReconciler: rehydrated keys '${Object.keys(\n inboundState\n ).join(', ')}'`\n )\n\n return newState\n}\n","// @flow\n\nimport { KEY_PREFIX, REHYDRATE } from './constants'\n\nimport type { Persistoid, PersistConfig, Transform } from './types'\n\ntype IntervalID = any // @TODO remove once flow < 0.63 support is no longer required.\n\nexport default function createPersistoid(config: PersistConfig): Persistoid {\n // defaults\n const blacklist: ?Array = config.blacklist || null\n const whitelist: ?Array = config.whitelist || null\n const transforms = config.transforms || []\n const throttle = config.throttle || 0\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n const storage = config.storage\n let serialize\n if (config.serialize === false) {\n serialize = x => x\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize\n } else {\n serialize = defaultSerialize\n }\n const writeFailHandler = config.writeFailHandler || null\n\n // initialize stateful values\n let lastState = {}\n let stagedState = {}\n let keysToProcess = []\n let timeIterator: ?IntervalID = null\n let writePromise = null\n\n const update = (state: Object) => {\n // add any changed keys to the queue\n Object.keys(state).forEach(key => {\n if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop\n if (lastState[key] === state[key]) return // value unchanged? noop\n if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop\n keysToProcess.push(key) // add key to queue\n })\n\n //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n Object.keys(lastState).forEach(key => {\n if (\n state[key] === undefined &&\n passWhitelistBlacklist(key) &&\n keysToProcess.indexOf(key) === -1 &&\n lastState[key] !== undefined\n ) {\n keysToProcess.push(key)\n }\n })\n\n // start the time iterator if not running (read: throttle)\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle)\n }\n\n lastState = state\n }\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator)\n timeIterator = null\n return\n }\n\n let key = keysToProcess.shift()\n let endState = transforms.reduce((subState, transformer) => {\n return transformer.in(subState, key, lastState)\n }, lastState[key])\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState)\n } catch (err) {\n console.error(\n 'redux-persist/createPersistoid: error serializing state',\n err\n )\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key]\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState()\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(key => {\n if (lastState[key] === undefined) {\n delete stagedState[key]\n }\n })\n\n writePromise = storage\n .setItem(storageKey, serialize(stagedState))\n .catch(onWriteFail)\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist')\n return false\n if (blacklist && blacklist.indexOf(key) !== -1) return false\n return true\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err)\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err)\n }\n }\n\n const flush = () => {\n while (keysToProcess.length !== 0) {\n processNextKey()\n }\n return writePromise || Promise.resolve()\n }\n\n // return `persistoid`\n return {\n update,\n flush,\n }\n}\n\n// @NOTE in the future this may be exposed via config\nfunction defaultSerialize(data) {\n return JSON.stringify(data)\n}\n","// @flow\n\nimport type { PersistConfig } from './types'\n\nimport { KEY_PREFIX } from './constants'\n\nexport default function getStoredState(\n config: PersistConfig\n): Promise {\n const transforms = config.transforms || []\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n const storage = config.storage\n const debug = config.debug\n let deserialize\n if (config.deserialize === false) {\n deserialize = x => x\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize\n } else {\n deserialize = defaultDeserialize\n }\n return storage.getItem(storageKey).then(serialized => {\n if (!serialized) return undefined\n else {\n try {\n let state = {}\n let rawState = deserialize(serialized)\n Object.keys(rawState).forEach(key => {\n state[key] = transforms.reduceRight((subState, transformer) => {\n return transformer.out(subState, key, rawState)\n }, deserialize(rawState[key]))\n })\n return state\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n `redux-persist/getStoredState: Error restoring data ${serialized}`,\n err\n )\n throw err\n }\n }\n })\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial)\n}\n","// @flow\n\nimport type { PersistConfig } from './types'\n\nimport { KEY_PREFIX } from './constants'\n\nexport default function purgeStoredState(config: PersistConfig) {\n const storage = config.storage\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n return storage.removeItem(storageKey, warnIfRemoveError)\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error(\n 'redux-persist/purgeStoredState: Error purging data stored state',\n err\n )\n }\n}\n","// @flow\nimport {\n FLUSH,\n PAUSE,\n PERSIST,\n PURGE,\n REHYDRATE,\n DEFAULT_VERSION,\n} from './constants'\n\nimport type {\n PersistConfig,\n MigrationManifest,\n PersistState,\n Persistoid,\n} from './types'\n\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1'\nimport createPersistoid from './createPersistoid'\nimport defaultGetStoredState from './getStoredState'\nimport purgeStoredState from './purgeStoredState'\n\ntype PersistPartial = { _persist: PersistState }\nconst DEFAULT_TIMEOUT = 5000\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\nexport default function persistReducer(\n config: PersistConfig,\n baseReducer: (State, Action) => State\n): (State, Action) => State & PersistPartial {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer')\n if (!config.key) throw new Error('key is required in persistor config')\n if (!config.storage)\n throw new Error(\n \"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\"\n )\n }\n\n const version =\n config.version !== undefined ? config.version : DEFAULT_VERSION\n const debug = config.debug || false\n const stateReconciler =\n config.stateReconciler === undefined\n ? autoMergeLevel1\n : config.stateReconciler\n const getStoredState = config.getStoredState || defaultGetStoredState\n const timeout =\n config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT\n let _persistoid = null\n let _purge = false\n let _paused = true\n const conditionalUpdate = state => {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated &&\n _persistoid &&\n !_paused &&\n _persistoid.update(state)\n return state\n }\n\n return (state: State, action: Action) => {\n let { _persist, ...rest } = state || {}\n // $FlowIgnore need to update State type\n let restState: State = rest\n\n if (action.type === PERSIST) {\n let _sealed = false\n let _rehydrate = (payload, err) => {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed)\n console.error(\n `redux-persist: rehydrate for \"${\n config.key\n }\" called after timeout.`,\n payload,\n err\n )\n\n // only rehydrate if we are not already sealed\n if (!_sealed) {\n action.rehydrate(config.key, payload, err)\n _sealed = true\n }\n }\n timeout &&\n setTimeout(() => {\n !_sealed &&\n _rehydrate(\n undefined,\n new Error(\n `redux-persist: persist timed out for persist key \"${\n config.key\n }\"`\n )\n )\n }, timeout)\n\n // @NOTE PERSIST resumes if paused.\n _paused = false\n\n // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n if (!_persistoid) _persistoid = createPersistoid(config)\n\n // @NOTE PERSIST can be called multiple times, noop after the first\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return {\n ...baseReducer(restState, action),\n _persist,\n };\n }\n\n if (\n typeof action.rehydrate !== 'function' ||\n typeof action.register !== 'function'\n )\n throw new Error(\n 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'\n )\n\n action.register(config.key)\n\n getStoredState(config).then(\n restoredState => {\n const migrate = config.migrate || ((s, v) => Promise.resolve(s))\n migrate(restoredState, version).then(\n migratedState => {\n _rehydrate(migratedState)\n },\n migrateErr => {\n if (process.env.NODE_ENV !== 'production' && migrateErr)\n console.error('redux-persist: migration error', migrateErr)\n _rehydrate(undefined, migrateErr)\n }\n )\n },\n err => {\n _rehydrate(undefined, err)\n }\n )\n\n return {\n ...baseReducer(restState, action),\n _persist: { version, rehydrated: false },\n }\n } else if (action.type === PURGE) {\n _purge = true\n action.result(purgeStoredState(config))\n return {\n ...baseReducer(restState, action),\n _persist,\n }\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush())\n return {\n ...baseReducer(restState, action),\n _persist,\n }\n } else if (action.type === PAUSE) {\n _paused = true\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge)\n return {\n ...restState,\n _persist: { ..._persist, rehydrated: true },\n }\n\n // @NOTE if key does not match, will continue to default else below\n if (action.key === config.key) {\n let reducedState = baseReducer(restState, action)\n let inboundState = action.payload\n // only reconcile state if stateReconciler and inboundState are both defined\n let reconciledRest: State =\n stateReconciler !== false && inboundState !== undefined\n ? stateReconciler(inboundState, state, reducedState, config)\n : reducedState\n\n let newState = {\n ...reconciledRest,\n _persist: { ..._persist, rehydrated: true },\n }\n return conditionalUpdate(newState)\n }\n }\n\n // if we have not already handled PERSIST, straight passthrough\n if (!_persist) return baseReducer(state, action)\n\n // run base reducer:\n // is state modified ? return original : return updated\n let newState = baseReducer(restState, action)\n if (newState === restState) return state\n return conditionalUpdate({ ...newState, _persist })\n }\n}\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle \" + ActionTypes.INIT + \" or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n keys.push.apply(keys, Object.getOwnPropertySymbols(object));\n }\n\n if (enumerableOnly) keys = keys.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread2({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","// @flow\n\n/*\n autoMergeLevel2: \n - merges 2 level of substate\n - skips substate if already modified\n - this is essentially redux-perist v4 behavior\n*/\n\nimport type { PersistConfig } from '../types'\n\nexport default function autoMergeLevel2(\n inboundState: State,\n originalState: State,\n reducedState: State,\n { debug }: PersistConfig\n): State {\n let newState = { ...reducedState }\n // only rehydrate if inboundState exists and is an object\n if (inboundState && typeof inboundState === 'object') {\n Object.keys(inboundState).forEach(key => {\n // ignore _persist data\n if (key === '_persist') return\n // if reducer modifies substate, skip auto rehydration\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',\n key\n )\n return\n }\n if (isPlainEnoughObject(reducedState[key])) {\n // if object is plain enough shallow merge the new values (hence \"Level2\")\n newState[key] = { ...newState[key], ...inboundState[key] }\n return\n }\n // otherwise hard set\n newState[key] = inboundState[key]\n })\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n debug &&\n inboundState &&\n typeof inboundState === 'object'\n )\n console.log(\n `redux-persist/stateReconciler: rehydrated keys '${Object.keys(\n inboundState\n ).join(', ')}'`\n )\n\n return newState\n}\n\nfunction isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && typeof o === 'object'\n}\n","// @flow\n\nimport { combineReducers } from 'redux'\nimport persistReducer from './persistReducer'\nimport autoMergeLevel2 from './stateReconciler/autoMergeLevel2'\n\nimport type { PersistConfig } from './types'\n\ntype Reducers = {\n [key: string]: Function,\n}\n\ntype Reducer = (state: Object, action: Object) => Object\n\n// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2\nexport default function persistCombineReducers(\n config: PersistConfig,\n reducers: Reducers\n): Reducer {\n config.stateReconciler =\n config.stateReconciler === undefined\n ? autoMergeLevel2\n : config.stateReconciler\n return persistReducer(config, combineReducers(reducers))\n}\n","// @flow\n\nimport type {\n Persistor,\n PersistConfig,\n PersistorOptions,\n PersistorState,\n MigrationManifest,\n RehydrateAction,\n RehydrateErrorType,\n} from './types'\n\nimport { createStore } from 'redux'\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'\n\ntype PendingRehydrate = [Object, RehydrateErrorType, PersistConfig]\ntype Persist = (PersistConfig, MigrationManifest) => R => R\ntype CreatePersistor = Object => void\ntype BoostrappedCb = () => any\n\nconst initialState: PersistorState = {\n registry: [],\n bootstrapped: false,\n}\n\nconst persistorReducer = (state = initialState, action) => {\n switch (action.type) {\n case REGISTER:\n return { ...state, registry: [...state.registry, action.key] }\n case REHYDRATE:\n let firstIndex = state.registry.indexOf(action.key)\n let registry = [...state.registry]\n registry.splice(firstIndex, 1)\n return { ...state, registry, bootstrapped: registry.length === 0 }\n default:\n return state\n }\n}\n\nexport default function persistStore(\n store: Object,\n options?: ?PersistorOptions,\n cb?: BoostrappedCb\n): Persistor {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n let optionsToTest: Object = options || {}\n let bannedKeys = [\n 'blacklist',\n 'whitelist',\n 'transforms',\n 'storage',\n 'keyPrefix',\n 'migrate',\n ]\n bannedKeys.forEach(k => {\n if (!!optionsToTest[k])\n console.error(\n `redux-persist: invalid option passed to persistStore: \"${k}\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.`\n )\n })\n }\n let boostrappedCb = cb || false\n\n let _pStore = createStore(\n persistorReducer,\n initialState,\n options && options.enhancer ? options.enhancer : undefined\n )\n let register = (key: string) => {\n _pStore.dispatch({\n type: REGISTER,\n key,\n })\n }\n\n let rehydrate = (key: string, payload: Object, err: any) => {\n let rehydrateAction = {\n type: REHYDRATE,\n payload,\n err,\n key,\n }\n // dispatch to `store` to rehydrate and `persistor` to track result\n store.dispatch(rehydrateAction)\n _pStore.dispatch(rehydrateAction)\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb()\n boostrappedCb = false\n }\n }\n\n let persistor: Persistor = {\n ..._pStore,\n purge: () => {\n let results = []\n store.dispatch({\n type: PURGE,\n result: purgeResult => {\n results.push(purgeResult)\n },\n })\n return Promise.all(results)\n },\n flush: () => {\n let results = []\n store.dispatch({\n type: FLUSH,\n result: flushResult => {\n results.push(flushResult)\n },\n })\n return Promise.all(results)\n },\n pause: () => {\n store.dispatch({\n type: PAUSE,\n })\n },\n persist: () => {\n store.dispatch({ type: PERSIST, register, rehydrate })\n },\n }\n\n if (!(options && options.manualPersist)){\n persistor.persist()\n }\n\n return persistor\n}\n","// @flow\n\nimport { DEFAULT_VERSION } from './constants'\n\nimport type { PersistedState, MigrationManifest } from './types'\n\nexport default function createMigrate(\n migrations: MigrationManifest,\n config?: { debug: boolean }\n) {\n let { debug } = config || {}\n return function(\n state: PersistedState,\n currentVersion: number\n ): Promise {\n if (!state) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: no inbound state, skipping migration')\n return Promise.resolve(undefined)\n }\n\n let inboundVersion: number =\n state._persist && state._persist.version !== undefined\n ? state._persist.version\n : DEFAULT_VERSION\n if (inboundVersion === currentVersion) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: versions match, noop migration')\n return Promise.resolve(state)\n }\n if (inboundVersion > currentVersion) {\n if (process.env.NODE_ENV !== 'production')\n console.error('redux-persist: downgrading version is not supported')\n return Promise.resolve(state)\n }\n\n let migrationKeys = Object.keys(migrations)\n .map(ver => parseInt(ver))\n .filter(key => currentVersion >= key && key > inboundVersion)\n .sort((a, b) => a - b)\n\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: migrationKeys', migrationKeys)\n try {\n let migratedState = migrationKeys.reduce((state, versionKey) => {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist: running migration for versionKey',\n versionKey\n )\n return migrations[versionKey](state)\n }, state)\n return Promise.resolve(migratedState)\n } catch (err) {\n return Promise.reject(err)\n }\n }\n}\n","// @flow\n\ntype TransformConfig = {\n whitelist?: Array,\n blacklist?: Array,\n}\n\nexport default function createTransform(\n // @NOTE inbound: transform state coming from redux on its way to being serialized and stored\n inbound: ?Function,\n // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux\n outbound: ?Function,\n config: TransformConfig = {}\n) {\n let whitelist = config.whitelist || null\n let blacklist = config.blacklist || null\n\n function whitelistBlacklistCheck(key) {\n if (whitelist && whitelist.indexOf(key) === -1) return true\n if (blacklist && blacklist.indexOf(key) !== -1) return true\n return false\n }\n\n return {\n in: (state: Object, key: string, fullState: Object) =>\n !whitelistBlacklistCheck(key) && inbound\n ? inbound(state, key, fullState)\n : state,\n out: (state: Object, key: string, fullState: Object) =>\n !whitelistBlacklistCheck(key) && outbound\n ? outbound(state, key, fullState)\n : state,\n }\n}\n"],"names":["KEY_PREFIX","FLUSH","REHYDRATE","PAUSE","PERSIST","PURGE","REGISTER","DEFAULT_VERSION","autoMergeLevel1","inboundState","originalState","reducedState","debug","newState","Object","keys","forEach","key","process","console","log","join","createPersistoid","config","blacklist","whitelist","transforms","throttle","storageKey","keyPrefix","undefined","storage","serialize","x","defaultSerialize","writeFailHandler","lastState","stagedState","keysToProcess","timeIterator","writePromise","update","state","passWhitelistBlacklist","indexOf","push","setInterval","processNextKey","length","clearInterval","shift","endState","reduce","subState","transformer","in","err","error","writeStagedState","setItem","catch","onWriteFail","flush","Promise","resolve","data","JSON","stringify","getStoredState","deserialize","defaultDeserialize","getItem","then","serialized","rawState","reduceRight","out","serial","parse","purgeStoredState","removeItem","warnIfRemoveError","DEFAULT_TIMEOUT","persistReducer","baseReducer","Error","version","stateReconciler","defaultGetStoredState","timeout","_persistoid","_purge","_paused","conditionalUpdate","_persist","rehydrated","action","rest","restState","type","_sealed","_rehydrate","payload","rehydrate","setTimeout","register","restoredState","migrate","s","v","migratedState","migrateErr","result","reconciledRest","ponyfill","$$observable","autoMergeLevel2","isPlainEnoughObject","o","Array","isArray","persistCombineReducers","reducers","combineReducers","initialState","registry","bootstrapped","persistorReducer","firstIndex","splice","persistStore","store","options","cb","optionsToTest","bannedKeys","k","boostrappedCb","_pStore","createStore","enhancer","dispatch","rehydrateAction","persistor","getState","purge","results","purgeResult","all","flushResult","pause","persist","manualPersist","createMigrate","migrations","currentVersion","inboundVersion","migrationKeys","map","ver","parseInt","filter","sort","a","b","versionKey","reject","createTransform","inbound","outbound","whitelistBlacklistCheck","fullState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,UAAU,GAAG,UAAnB;AACP,AAAO,IAAMC,KAAK,GAAG,eAAd;AACP,AAAO,IAAMC,SAAS,GAAG,mBAAlB;AACP,AAAO,IAAMC,KAAK,GAAG,eAAd;AACP,AAAO,IAAMC,OAAO,GAAG,iBAAhB;AACP,AAAO,IAAMC,KAAK,GAAG,eAAd;AACP,AAAO,IAAMC,QAAQ,GAAG,kBAAjB;AACP,AAAO,IAAMC,eAAe,GAAG,CAAC,CAAzB;;ACPP;;;;;AAQA,AAAe,SAASC,eAAT,CACbC,YADa,EAEbC,aAFa,EAGbC,YAHa,QAKN;MADLC,KACK,QADLA,KACK;;MACHC,QAAQ,sBAAQF,YAAR,CAAZ,CADO;;;MAGHF,YAAY,IAAI,QAAOA,YAAP,MAAwB,QAA5C,EAAsD;IACpDK,MAAM,CAACC,IAAP,CAAYN,YAAZ,EAA0BO,OAA1B,CAAkC,UAAAC,GAAG,EAAI;;UAEnCA,GAAG,KAAK,UAAZ,EAAwB,OAFe;;UAInCP,aAAa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IAAP;QAC5CO,SAAS,IAAIA,SAAS,CAACoB,OAAV,CAAkB3B,GAAlB,MAA2B,CAAC,CAA7C,EAAgD,OAAO,IAAP;WACzC,KAAP;;;SAGK;IACLsC,EAAE,EAAE,aAACb,KAAD,EAAgBzB,GAAhB,EAA6B0J,SAA7B;aACF,CAACD,uBAAuB,CAACzJ,GAAD,CAAxB,IAAiCuJ,OAAjC,GACIA,OAAO,CAAC9H,KAAD,EAAQzB,GAAR,EAAa0J,SAAb,CADX,GAEIjI,KAHF;KADC;IAKLkC,GAAG,EAAE,aAAClC,KAAD,EAAgBzB,GAAhB,EAA6B0J,SAA7B;aACH,CAACD,uBAAuB,CAACzJ,GAAD,CAAxB,IAAiCwJ,QAAjC,GACIA,QAAQ,CAAC/H,KAAD,EAAQzB,GAAR,EAAa0J,SAAb,CADZ,GAEIjI,KAHD;;GALP;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/redux-persist/dist/redux-persist.min.js b/node_modules/redux-persist/dist/redux-persist.min.js new file mode 100644 index 00000000..599777a5 --- /dev/null +++ b/node_modules/redux-persist/dist/redux-persist.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ReduxPersist={})}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;arguments.length>t;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(o,!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;i.length>n;n++)0>t.indexOf(r=i[n])&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);e.length>t;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s="persist:",c="persist/FLUSH",a="persist/REHYDRATE",f="persist/PAUSE",l="persist/PERSIST",d="persist/PURGE",p="persist/REGISTER",y=-1;function h(e,r,n,i){var u=o({},n);return e&&"object"===t(e)&&Object.keys(e).forEach(function(t){"_persist"!==t&&r[t]===n[t]&&(u[t]=e[t])}),u}function v(e){var t,r=e.blacklist||null,n=e.whitelist||null,o=e.transforms||[],i=e.throttle||0,u="".concat(void 0!==e.keyPrefix?e.keyPrefix:s).concat(e.key),c=e.storage;t=!1===e.serialize?function(e){return e}:"function"==typeof e.serialize?e.serialize:b;var a=e.writeFailHandler||null,f={},l={},d=[],p=null,y=null;function h(){if(0===d.length)return p&&clearInterval(p),void(p=null);var e=d.shift(),r=o.reduce(function(t,r){return r.in(t,e,f)},f[e]);if(void 0!==r)try{l[e]=t(r)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete l[e];0===d.length&&(Object.keys(l).forEach(function(e){void 0===f[e]&&delete l[e]}),y=c.setItem(u,t(l)).catch(g))}function v(e){return(!n||-1!==n.indexOf(e)||"_persist"===e)&&(!r||-1===r.indexOf(e))}function g(e){a&&a(e)}return{update:function(e){Object.keys(e).forEach(function(t){v(t)&&f[t]!==e[t]&&-1===d.indexOf(t)&&d.push(t)}),Object.keys(f).forEach(function(t){void 0===e[t]&&v(t)&&-1===d.indexOf(t)&&void 0!==f[t]&&d.push(t)}),null===p&&(p=setInterval(h,i)),f=e},flush:function(){for(;0!==d.length;)h();return y||Promise.resolve()}}}function b(e){return JSON.stringify(e)}function g(e){var t,r=e.transforms||[],n="".concat(void 0!==e.keyPrefix?e.keyPrefix:s).concat(e.key);return t=!1===e.deserialize?function(e){return e}:"function"==typeof e.deserialize?e.deserialize:m,e.storage.getItem(n).then(function(e){if(e)try{var n={},o=t(e);return Object.keys(o).forEach(function(e){n[e]=r.reduceRight(function(t,r){return r.out(t,e,o)},t(o[e]))}),n}catch(e){throw e}})}function m(e){return JSON.parse(e)}function O(e){var t=e.storage,r="".concat(void 0!==e.keyPrefix?e.keyPrefix:s).concat(e.key);return t.removeItem(r,E)}function E(e){0}var w=5e3;function P(e,t){var r=void 0!==e.version?e.version:y,n=void 0===e.stateReconciler?h:e.stateReconciler,u=e.getStoredState||g,s=void 0!==e.timeout?e.timeout:w,p=null,b=!1,m=!0,E=function(e){return e._persist.rehydrated&&p&&!m&&p.update(e),e};return function(y,h){var g=y||{},w=g._persist,P=i(g,["_persist"]);if(h.type===l){var j=!1,x=function(t,r){j||(h.rehydrate(e.key,t,r),j=!0)};if(s&&setTimeout(function(){!j&&x(void 0,Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},s),m=!1,p||(p=v(e)),w)return o({},t(P,h),{_persist:w});if("function"!=typeof h.rehydrate||"function"!=typeof h.register)throw Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),u(e).then(function(t){(e.migrate||function(e,t){return Promise.resolve(e)})(t,r).then(function(e){x(e)},function(e){x(void 0,e)})},function(e){x(void 0,e)}),o({},t(P,h),{_persist:{version:r,rehydrated:!1}})}if(h.type===d)return b=!0,h.result(O(e)),o({},t(P,h),{_persist:w});if(h.type===c)return h.result(p&&p.flush()),o({},t(P,h),{_persist:w});if(h.type===f)m=!0;else if(h.type===a){if(b)return o({},P,{_persist:o({},w,{rehydrated:!0})});if(h.key===e.key){var S=t(P,h),k=h.payload,I=o({},!1!==n&&void 0!==k?n(k,y,S,e):S,{_persist:o({},w,{rehydrated:!0})});return E(I)}}if(!w)return t(y,h);var R=t(P,h);return R===P?y:E(o({},R,{_persist:w}))}}var j=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),x=function(){return Math.random().toString(36).substring(7).split("").join(".")},S={INIT:"@@redux/INIT"+x(),REPLACE:"@@redux/REPLACE"+x(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+x()}};function k(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw Error("Expected the enhancer to be a function.");return r(k)(e,t)}if("function"!=typeof e)throw Error("Expected the reducer to be a function.");var o=e,i=t,u=[],s=u,c=!1;function a(){s===u&&(s=u.slice())}function f(){if(c)throw Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function l(e){if("function"!=typeof e)throw Error("Expected the listener to be a function.");if(c)throw Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return a(),s.push(e),function(){if(t){if(c)throw Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,a();var r=s.indexOf(e);s.splice(r,1)}}}function d(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw Error("Reducers may not dispatch actions.");try{c=!0,i=o(i,e)}finally{c=!1}for(var t=u=s,r=0;t.length>r;r++){(0,t[r])()}return e}return d({type:S.INIT}),(n={dispatch:d,subscribe:l,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw Error("Expected the nextReducer to be a function.");o=e,d({type:S.REPLACE})}})[j]=function(){var e,t=l;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function r(){e.next&&e.next(f())}return r(),{unsubscribe:t(r)}}})[j]=function(){return this},e},n}function I(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+r+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function R(e){for(var t=Object.keys(e),r={},n=0;t.length>n;n++){var o=t[n];"function"==typeof e[o]&&(r[o]=e[o])}var i,u=Object.keys(r);try{!function(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:S.INIT}))throw Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:S.PROBE_UNKNOWN_ACTION()}))throw Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+S.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var n=!1,o={},s=0;u.length>s;s++){var c=u[s],a=e[c],f=(0,r[c])(a,t);if(void 0===f){var l=I(c,t);throw Error(l)}o[c]=f,n=n||f!==a}return n?o:e}}function T(e,r,n,i){var u=o({},n);return e&&"object"===t(e)&&Object.keys(e).forEach(function(i){var s;"_persist"!==i&&(r[i]===n[i]&&(u[i]=null===(s=n[i])||Array.isArray(s)||"object"!==t(s)?e[i]:o({},u[i],{},e[i])))}),u}var _={registry:[],bootstrapped:!1},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case p:return o({},e,{registry:[].concat(u(e.registry),[t.key])});case a:var r=e.registry.indexOf(t.key),n=u(e.registry);return n.splice(r,1),o({},e,{registry:n,bootstrapped:0===n.length});default:return e}};e.persistReducer=P,e.persistCombineReducers=function(e,t){return e.stateReconciler=void 0===e.stateReconciler?T:e.stateReconciler,P(e,R(t))},e.persistStore=function(e,t,r){var n=r||!1,i=k(A,_,t&&t.enhancer?t.enhancer:void 0),u=function(e){i.dispatch({type:p,key:e})},s=function(t,r,o){var u={type:a,payload:r,err:o,key:t};e.dispatch(u),i.dispatch(u),n&&y.getState().bootstrapped&&(n(),n=!1)},y=o({},i,{purge:function(){var t=[];return e.dispatch({type:d,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:c,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:f})},persist:function(){e.dispatch({type:l,register:u,rehydrate:s})}});return t&&t.manualPersist||y.persist(),y},e.createMigrate=function(e,t){return function(t,r){if(!t)return Promise.resolve(void 0);var n=t._persist&&void 0!==t._persist.version?t._persist.version:y;if(n===r)return Promise.resolve(t);if(n>r)return Promise.resolve(t);var o=Object.keys(e).map(function(e){return parseInt(e)}).filter(function(e){return r>=e&&e>n}).sort(function(e,t){return e-t});try{var i=o.reduce(function(t,r){return e[r](t)},t);return Promise.resolve(i)}catch(e){return Promise.reject(e)}}},e.createTransform=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.whitelist||null,o=r.blacklist||null;function i(e){return!(!n||-1!==n.indexOf(e))||!(!o||-1===o.indexOf(e))}return{in:function(t,r,n){return!i(r)&&e?e(t,r,n):t},out:function(e,r,n){return!i(r)&&t?t(e,r,n):e}}},e.getStoredState=g,e.createPersistoid=v,e.purgeStoredState=O,e.KEY_PREFIX=s,e.FLUSH=c,e.REHYDRATE=a,e.PAUSE=f,e.PERSIST=l,e.PURGE=d,e.REGISTER=p,e.DEFAULT_VERSION=y,Object.defineProperty(e,"__esModule",{value:!0})}); +//# sourceMappingURL=redux-persist.min.js.map diff --git a/node_modules/redux-persist/dist/redux-persist.min.js.map b/node_modules/redux-persist/dist/redux-persist.min.js.map new file mode 100644 index 00000000..90ecbc66 --- /dev/null +++ b/node_modules/redux-persist/dist/redux-persist.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"redux-persist.min.js","sources":["../src/constants.js","../src/stateReconciler/autoMergeLevel1.js","../src/createPersistoid.js","../src/getStoredState.js","../src/purgeStoredState.js","../src/persistReducer.js","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/redux/es/redux.js","../src/stateReconciler/autoMergeLevel2.js","../src/persistStore.js","../src/persistCombineReducers.js","../src/createMigrate.js","../src/createTransform.js"],"sourcesContent":["// @flow\n\nexport const KEY_PREFIX = 'persist:'\nexport const FLUSH = 'persist/FLUSH'\nexport const REHYDRATE = 'persist/REHYDRATE'\nexport const PAUSE = 'persist/PAUSE'\nexport const PERSIST = 'persist/PERSIST'\nexport const PURGE = 'persist/PURGE'\nexport const REGISTER = 'persist/REGISTER'\nexport const DEFAULT_VERSION = -1\n","// @flow\n\n/*\n autoMergeLevel1: \n - merges 1 level of substate\n - skips substate if already modified\n*/\n\nimport type { PersistConfig } from '../types'\n\nexport default function autoMergeLevel1(\n inboundState: State,\n originalState: State,\n reducedState: State,\n { debug }: PersistConfig\n): State {\n let newState = { ...reducedState }\n // only rehydrate if inboundState exists and is an object\n if (inboundState && typeof inboundState === 'object') {\n Object.keys(inboundState).forEach(key => {\n // ignore _persist data\n if (key === '_persist') return\n // if reducer modifies substate, skip auto rehydration\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',\n key\n )\n return\n }\n // otherwise hard set the new value\n newState[key] = inboundState[key]\n })\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n debug &&\n inboundState &&\n typeof inboundState === 'object'\n )\n console.log(\n `redux-persist/stateReconciler: rehydrated keys '${Object.keys(\n inboundState\n ).join(', ')}'`\n )\n\n return newState\n}\n","// @flow\n\nimport { KEY_PREFIX, REHYDRATE } from './constants'\n\nimport type { Persistoid, PersistConfig, Transform } from './types'\n\ntype IntervalID = any // @TODO remove once flow < 0.63 support is no longer required.\n\nexport default function createPersistoid(config: PersistConfig): Persistoid {\n // defaults\n const blacklist: ?Array = config.blacklist || null\n const whitelist: ?Array = config.whitelist || null\n const transforms = config.transforms || []\n const throttle = config.throttle || 0\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n const storage = config.storage\n let serialize\n if (config.serialize === false) {\n serialize = x => x\n } else if (typeof config.serialize === 'function') {\n serialize = config.serialize\n } else {\n serialize = defaultSerialize\n }\n const writeFailHandler = config.writeFailHandler || null\n\n // initialize stateful values\n let lastState = {}\n let stagedState = {}\n let keysToProcess = []\n let timeIterator: ?IntervalID = null\n let writePromise = null\n\n const update = (state: Object) => {\n // add any changed keys to the queue\n Object.keys(state).forEach(key => {\n if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop\n if (lastState[key] === state[key]) return // value unchanged? noop\n if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop\n keysToProcess.push(key) // add key to queue\n })\n\n //if any key is missing in the new state which was present in the lastState,\n //add it for processing too\n Object.keys(lastState).forEach(key => {\n if (\n state[key] === undefined &&\n passWhitelistBlacklist(key) &&\n keysToProcess.indexOf(key) === -1 &&\n lastState[key] !== undefined\n ) {\n keysToProcess.push(key)\n }\n })\n\n // start the time iterator if not running (read: throttle)\n if (timeIterator === null) {\n timeIterator = setInterval(processNextKey, throttle)\n }\n\n lastState = state\n }\n\n function processNextKey() {\n if (keysToProcess.length === 0) {\n if (timeIterator) clearInterval(timeIterator)\n timeIterator = null\n return\n }\n\n let key = keysToProcess.shift()\n let endState = transforms.reduce((subState, transformer) => {\n return transformer.in(subState, key, lastState)\n }, lastState[key])\n\n if (endState !== undefined) {\n try {\n stagedState[key] = serialize(endState)\n } catch (err) {\n console.error(\n 'redux-persist/createPersistoid: error serializing state',\n err\n )\n }\n } else {\n //if the endState is undefined, no need to persist the existing serialized content\n delete stagedState[key]\n }\n\n if (keysToProcess.length === 0) {\n writeStagedState()\n }\n }\n\n function writeStagedState() {\n // cleanup any removed keys just before write.\n Object.keys(stagedState).forEach(key => {\n if (lastState[key] === undefined) {\n delete stagedState[key]\n }\n })\n\n writePromise = storage\n .setItem(storageKey, serialize(stagedState))\n .catch(onWriteFail)\n }\n\n function passWhitelistBlacklist(key) {\n if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist')\n return false\n if (blacklist && blacklist.indexOf(key) !== -1) return false\n return true\n }\n\n function onWriteFail(err) {\n // @TODO add fail handlers (typically storage full)\n if (writeFailHandler) writeFailHandler(err)\n if (err && process.env.NODE_ENV !== 'production') {\n console.error('Error storing data', err)\n }\n }\n\n const flush = () => {\n while (keysToProcess.length !== 0) {\n processNextKey()\n }\n return writePromise || Promise.resolve()\n }\n\n // return `persistoid`\n return {\n update,\n flush,\n }\n}\n\n// @NOTE in the future this may be exposed via config\nfunction defaultSerialize(data) {\n return JSON.stringify(data)\n}\n","// @flow\n\nimport type { PersistConfig } from './types'\n\nimport { KEY_PREFIX } from './constants'\n\nexport default function getStoredState(\n config: PersistConfig\n): Promise {\n const transforms = config.transforms || []\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n const storage = config.storage\n const debug = config.debug\n let deserialize\n if (config.deserialize === false) {\n deserialize = x => x\n } else if (typeof config.deserialize === 'function') {\n deserialize = config.deserialize\n } else {\n deserialize = defaultDeserialize\n }\n return storage.getItem(storageKey).then(serialized => {\n if (!serialized) return undefined\n else {\n try {\n let state = {}\n let rawState = deserialize(serialized)\n Object.keys(rawState).forEach(key => {\n state[key] = transforms.reduceRight((subState, transformer) => {\n return transformer.out(subState, key, rawState)\n }, deserialize(rawState[key]))\n })\n return state\n } catch (err) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n `redux-persist/getStoredState: Error restoring data ${serialized}`,\n err\n )\n throw err\n }\n }\n })\n}\n\nfunction defaultDeserialize(serial) {\n return JSON.parse(serial)\n}\n","// @flow\n\nimport type { PersistConfig } from './types'\n\nimport { KEY_PREFIX } from './constants'\n\nexport default function purgeStoredState(config: PersistConfig) {\n const storage = config.storage\n const storageKey = `${\n config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX\n }${config.key}`\n return storage.removeItem(storageKey, warnIfRemoveError)\n}\n\nfunction warnIfRemoveError(err) {\n if (err && process.env.NODE_ENV !== 'production') {\n console.error(\n 'redux-persist/purgeStoredState: Error purging data stored state',\n err\n )\n }\n}\n","// @flow\nimport {\n FLUSH,\n PAUSE,\n PERSIST,\n PURGE,\n REHYDRATE,\n DEFAULT_VERSION,\n} from './constants'\n\nimport type {\n PersistConfig,\n MigrationManifest,\n PersistState,\n Persistoid,\n} from './types'\n\nimport autoMergeLevel1 from './stateReconciler/autoMergeLevel1'\nimport createPersistoid from './createPersistoid'\nimport defaultGetStoredState from './getStoredState'\nimport purgeStoredState from './purgeStoredState'\n\ntype PersistPartial = { _persist: PersistState }\nconst DEFAULT_TIMEOUT = 5000\n/*\n @TODO add validation / handling for:\n - persisting a reducer which has nested _persist\n - handling actions that fire before reydrate is called\n*/\nexport default function persistReducer(\n config: PersistConfig,\n baseReducer: (State, Action) => State\n): (State, Action) => State & PersistPartial {\n if (process.env.NODE_ENV !== 'production') {\n if (!config) throw new Error('config is required for persistReducer')\n if (!config.key) throw new Error('key is required in persistor config')\n if (!config.storage)\n throw new Error(\n \"redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`\"\n )\n }\n\n const version =\n config.version !== undefined ? config.version : DEFAULT_VERSION\n const debug = config.debug || false\n const stateReconciler =\n config.stateReconciler === undefined\n ? autoMergeLevel1\n : config.stateReconciler\n const getStoredState = config.getStoredState || defaultGetStoredState\n const timeout =\n config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT\n let _persistoid = null\n let _purge = false\n let _paused = true\n const conditionalUpdate = state => {\n // update the persistoid only if we are rehydrated and not paused\n state._persist.rehydrated &&\n _persistoid &&\n !_paused &&\n _persistoid.update(state)\n return state\n }\n\n return (state: State, action: Action) => {\n let { _persist, ...rest } = state || {}\n // $FlowIgnore need to update State type\n let restState: State = rest\n\n if (action.type === PERSIST) {\n let _sealed = false\n let _rehydrate = (payload, err) => {\n // dev warning if we are already sealed\n if (process.env.NODE_ENV !== 'production' && _sealed)\n console.error(\n `redux-persist: rehydrate for \"${\n config.key\n }\" called after timeout.`,\n payload,\n err\n )\n\n // only rehydrate if we are not already sealed\n if (!_sealed) {\n action.rehydrate(config.key, payload, err)\n _sealed = true\n }\n }\n timeout &&\n setTimeout(() => {\n !_sealed &&\n _rehydrate(\n undefined,\n new Error(\n `redux-persist: persist timed out for persist key \"${\n config.key\n }\"`\n )\n )\n }, timeout)\n\n // @NOTE PERSIST resumes if paused.\n _paused = false\n\n // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set\n if (!_persistoid) _persistoid = createPersistoid(config)\n\n // @NOTE PERSIST can be called multiple times, noop after the first\n if (_persist) {\n // We still need to call the base reducer because there might be nested\n // uses of persistReducer which need to be aware of the PERSIST action\n return {\n ...baseReducer(restState, action),\n _persist,\n };\n }\n\n if (\n typeof action.rehydrate !== 'function' ||\n typeof action.register !== 'function'\n )\n throw new Error(\n 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'\n )\n\n action.register(config.key)\n\n getStoredState(config).then(\n restoredState => {\n const migrate = config.migrate || ((s, v) => Promise.resolve(s))\n migrate(restoredState, version).then(\n migratedState => {\n _rehydrate(migratedState)\n },\n migrateErr => {\n if (process.env.NODE_ENV !== 'production' && migrateErr)\n console.error('redux-persist: migration error', migrateErr)\n _rehydrate(undefined, migrateErr)\n }\n )\n },\n err => {\n _rehydrate(undefined, err)\n }\n )\n\n return {\n ...baseReducer(restState, action),\n _persist: { version, rehydrated: false },\n }\n } else if (action.type === PURGE) {\n _purge = true\n action.result(purgeStoredState(config))\n return {\n ...baseReducer(restState, action),\n _persist,\n }\n } else if (action.type === FLUSH) {\n action.result(_persistoid && _persistoid.flush())\n return {\n ...baseReducer(restState, action),\n _persist,\n }\n } else if (action.type === PAUSE) {\n _paused = true\n } else if (action.type === REHYDRATE) {\n // noop on restState if purging\n if (_purge)\n return {\n ...restState,\n _persist: { ..._persist, rehydrated: true },\n }\n\n // @NOTE if key does not match, will continue to default else below\n if (action.key === config.key) {\n let reducedState = baseReducer(restState, action)\n let inboundState = action.payload\n // only reconcile state if stateReconciler and inboundState are both defined\n let reconciledRest: State =\n stateReconciler !== false && inboundState !== undefined\n ? stateReconciler(inboundState, state, reducedState, config)\n : reducedState\n\n let newState = {\n ...reconciledRest,\n _persist: { ..._persist, rehydrated: true },\n }\n return conditionalUpdate(newState)\n }\n }\n\n // if we have not already handled PERSIST, straight passthrough\n if (!_persist) return baseReducer(state, action)\n\n // run base reducer:\n // is state modified ? return original : return updated\n let newState = baseReducer(restState, action)\n if (newState === restState) return state\n return conditionalUpdate({ ...newState, _persist })\n }\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","import $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle \" + ActionTypes.INIT + \" or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n keys.push.apply(keys, Object.getOwnPropertySymbols(object));\n }\n\n if (enumerableOnly) keys = keys.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread2({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };\n","// @flow\n\n/*\n autoMergeLevel2: \n - merges 2 level of substate\n - skips substate if already modified\n - this is essentially redux-perist v4 behavior\n*/\n\nimport type { PersistConfig } from '../types'\n\nexport default function autoMergeLevel2(\n inboundState: State,\n originalState: State,\n reducedState: State,\n { debug }: PersistConfig\n): State {\n let newState = { ...reducedState }\n // only rehydrate if inboundState exists and is an object\n if (inboundState && typeof inboundState === 'object') {\n Object.keys(inboundState).forEach(key => {\n // ignore _persist data\n if (key === '_persist') return\n // if reducer modifies substate, skip auto rehydration\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',\n key\n )\n return\n }\n if (isPlainEnoughObject(reducedState[key])) {\n // if object is plain enough shallow merge the new values (hence \"Level2\")\n newState[key] = { ...newState[key], ...inboundState[key] }\n return\n }\n // otherwise hard set\n newState[key] = inboundState[key]\n })\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n debug &&\n inboundState &&\n typeof inboundState === 'object'\n )\n console.log(\n `redux-persist/stateReconciler: rehydrated keys '${Object.keys(\n inboundState\n ).join(', ')}'`\n )\n\n return newState\n}\n\nfunction isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && typeof o === 'object'\n}\n","// @flow\n\nimport type {\n Persistor,\n PersistConfig,\n PersistorOptions,\n PersistorState,\n MigrationManifest,\n RehydrateAction,\n RehydrateErrorType,\n} from './types'\n\nimport { createStore } from 'redux'\nimport { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'\n\ntype PendingRehydrate = [Object, RehydrateErrorType, PersistConfig]\ntype Persist = (PersistConfig, MigrationManifest) => R => R\ntype CreatePersistor = Object => void\ntype BoostrappedCb = () => any\n\nconst initialState: PersistorState = {\n registry: [],\n bootstrapped: false,\n}\n\nconst persistorReducer = (state = initialState, action) => {\n switch (action.type) {\n case REGISTER:\n return { ...state, registry: [...state.registry, action.key] }\n case REHYDRATE:\n let firstIndex = state.registry.indexOf(action.key)\n let registry = [...state.registry]\n registry.splice(firstIndex, 1)\n return { ...state, registry, bootstrapped: registry.length === 0 }\n default:\n return state\n }\n}\n\nexport default function persistStore(\n store: Object,\n options?: ?PersistorOptions,\n cb?: BoostrappedCb\n): Persistor {\n // help catch incorrect usage of passing PersistConfig in as PersistorOptions\n if (process.env.NODE_ENV !== 'production') {\n let optionsToTest: Object = options || {}\n let bannedKeys = [\n 'blacklist',\n 'whitelist',\n 'transforms',\n 'storage',\n 'keyPrefix',\n 'migrate',\n ]\n bannedKeys.forEach(k => {\n if (!!optionsToTest[k])\n console.error(\n `redux-persist: invalid option passed to persistStore: \"${k}\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.`\n )\n })\n }\n let boostrappedCb = cb || false\n\n let _pStore = createStore(\n persistorReducer,\n initialState,\n options && options.enhancer ? options.enhancer : undefined\n )\n let register = (key: string) => {\n _pStore.dispatch({\n type: REGISTER,\n key,\n })\n }\n\n let rehydrate = (key: string, payload: Object, err: any) => {\n let rehydrateAction = {\n type: REHYDRATE,\n payload,\n err,\n key,\n }\n // dispatch to `store` to rehydrate and `persistor` to track result\n store.dispatch(rehydrateAction)\n _pStore.dispatch(rehydrateAction)\n if (boostrappedCb && persistor.getState().bootstrapped) {\n boostrappedCb()\n boostrappedCb = false\n }\n }\n\n let persistor: Persistor = {\n ..._pStore,\n purge: () => {\n let results = []\n store.dispatch({\n type: PURGE,\n result: purgeResult => {\n results.push(purgeResult)\n },\n })\n return Promise.all(results)\n },\n flush: () => {\n let results = []\n store.dispatch({\n type: FLUSH,\n result: flushResult => {\n results.push(flushResult)\n },\n })\n return Promise.all(results)\n },\n pause: () => {\n store.dispatch({\n type: PAUSE,\n })\n },\n persist: () => {\n store.dispatch({ type: PERSIST, register, rehydrate })\n },\n }\n\n if (!(options && options.manualPersist)){\n persistor.persist()\n }\n\n return persistor\n}\n","// @flow\n\nimport { combineReducers } from 'redux'\nimport persistReducer from './persistReducer'\nimport autoMergeLevel2 from './stateReconciler/autoMergeLevel2'\n\nimport type { PersistConfig } from './types'\n\ntype Reducers = {\n [key: string]: Function,\n}\n\ntype Reducer = (state: Object, action: Object) => Object\n\n// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2\nexport default function persistCombineReducers(\n config: PersistConfig,\n reducers: Reducers\n): Reducer {\n config.stateReconciler =\n config.stateReconciler === undefined\n ? autoMergeLevel2\n : config.stateReconciler\n return persistReducer(config, combineReducers(reducers))\n}\n","// @flow\n\nimport { DEFAULT_VERSION } from './constants'\n\nimport type { PersistedState, MigrationManifest } from './types'\n\nexport default function createMigrate(\n migrations: MigrationManifest,\n config?: { debug: boolean }\n) {\n let { debug } = config || {}\n return function(\n state: PersistedState,\n currentVersion: number\n ): Promise {\n if (!state) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: no inbound state, skipping migration')\n return Promise.resolve(undefined)\n }\n\n let inboundVersion: number =\n state._persist && state._persist.version !== undefined\n ? state._persist.version\n : DEFAULT_VERSION\n if (inboundVersion === currentVersion) {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: versions match, noop migration')\n return Promise.resolve(state)\n }\n if (inboundVersion > currentVersion) {\n if (process.env.NODE_ENV !== 'production')\n console.error('redux-persist: downgrading version is not supported')\n return Promise.resolve(state)\n }\n\n let migrationKeys = Object.keys(migrations)\n .map(ver => parseInt(ver))\n .filter(key => currentVersion >= key && key > inboundVersion)\n .sort((a, b) => a - b)\n\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log('redux-persist: migrationKeys', migrationKeys)\n try {\n let migratedState = migrationKeys.reduce((state, versionKey) => {\n if (process.env.NODE_ENV !== 'production' && debug)\n console.log(\n 'redux-persist: running migration for versionKey',\n versionKey\n )\n return migrations[versionKey](state)\n }, state)\n return Promise.resolve(migratedState)\n } catch (err) {\n return Promise.reject(err)\n }\n }\n}\n","// @flow\n\ntype TransformConfig = {\n whitelist?: Array,\n blacklist?: Array,\n}\n\nexport default function createTransform(\n // @NOTE inbound: transform state coming from redux on its way to being serialized and stored\n inbound: ?Function,\n // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux\n outbound: ?Function,\n config: TransformConfig = {}\n) {\n let whitelist = config.whitelist || null\n let blacklist = config.blacklist || null\n\n function whitelistBlacklistCheck(key) {\n if (whitelist && whitelist.indexOf(key) === -1) return true\n if (blacklist && blacklist.indexOf(key) !== -1) return true\n return false\n }\n\n return {\n in: (state: Object, key: string, fullState: Object) =>\n !whitelistBlacklistCheck(key) && inbound\n ? inbound(state, key, fullState)\n : state,\n out: (state: Object, key: string, fullState: Object) =>\n !whitelistBlacklistCheck(key) && outbound\n ? outbound(state, key, fullState)\n : state,\n }\n}\n"],"names":["KEY_PREFIX","FLUSH","REHYDRATE","PAUSE","PERSIST","PURGE","REGISTER","DEFAULT_VERSION","autoMergeLevel1","inboundState","originalState","reducedState","newState","_typeof","Object","keys","forEach","key","createPersistoid","config","serialize","blacklist","whitelist","transforms","throttle","storageKey","undefined","keyPrefix","storage","x","defaultSerialize","writeFailHandler","lastState","stagedState","keysToProcess","timeIterator","writePromise","processNextKey","length","clearInterval","shift","endState","reduce","subState","transformer","in","err","console","error","setItem","catch","onWriteFail","passWhitelistBlacklist","indexOf","update","state","push","setInterval","flush","Promise","resolve","data","JSON","stringify","getStoredState","deserialize","defaultDeserialize","getItem","then","serialized","rawState","reduceRight","out","serial","parse","purgeStoredState","removeItem","warnIfRemoveError","DEFAULT_TIMEOUT","persistReducer","baseReducer","version","stateReconciler","defaultGetStoredState","timeout","_persistoid","_purge","_paused","conditionalUpdate","_persist","rehydrated","action","restState","type","_sealed","_rehydrate","payload","rehydrate","setTimeout","Error","register","restoredState","migrate","s","v","migratedState","migrateErr","result","root","Symbol","observable","ponyfill","self","window","global","module","Function","randomString","Math","random","toString","substring","split","join","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","createStore","reducer","preloadedState","enhancer","_ref2","arguments","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","slice","getState","subscribe","listener","isSubscribed","index","splice","dispatch","obj","proto","getPrototypeOf","isPlainObject","listeners","i","replaceReducer","nextReducer","$$observable","_ref","outerSubscribe","observer","TypeError","observeState","next","unsubscribe","this","getUndefinedStateErrorMessage","actionType","combineReducers","reducers","reducerKeys","finalReducers","shapeAssertionError","finalReducerKeys","assertReducerShape","e","hasChanged","nextState","_i","_key","previousStateForKey","nextStateForKey","errorMessage","autoMergeLevel2","o","Array","isArray","initialState","registry","bootstrapped","persistorReducer","firstIndex","store","options","cb","boostrappedCb","_pStore","rehydrateAction","persistor","purge","results","purgeResult","all","flushResult","pause","persist","manualPersist","migrations","currentVersion","inboundVersion","migrationKeys","map","ver","parseInt","filter","sort","a","b","versionKey","reject","inbound","outbound","whitelistBlacklistCheck","fullState"],"mappings":"owDAEO,IAAMA,EAAa,WACbC,EAAQ,gBACRC,EAAY,oBACZC,EAAQ,gBACRC,EAAU,kBACVC,EAAQ,gBACRC,EAAW,mBACXC,GAAmB,ECChC,SAAwBC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,SAACa,EAAOkK,UAMxCX,EAAWW,GAAYlK,IAC7BA,UACII,QAAQC,QAAQ6C,GACvB,MAAO3D,UACAa,QAAQ+J,OAAO5K,iCC7C1B6K,EAEAC,OACAzM,4DAEIG,EAAYH,EAAOG,WAAa,KAChCD,EAAYF,EAAOE,WAAa,cAE3BwM,EAAwB5M,YAC3BK,IAAyC,IAA5BA,EAAU+B,QAAQpC,QAC/BI,IAAyC,IAA5BA,EAAUgC,QAAQpC,WAKnC4B,GAAI,SAACU,EAAetC,EAAa6M,UAC9BD,EAAwB5M,IAAQ0M,EAC7BA,EAAQpK,EAAOtC,EAAK6M,GACpBvK,GACNiB,IAAK,SAACjB,EAAetC,EAAa6M,UAC/BD,EAAwB5M,IAAQ2M,EAC7BA,EAASrK,EAAOtC,EAAK6M,GACrBvK"} \ No newline at end of file diff --git a/node_modules/redux-persist/es/constants.js b/node_modules/redux-persist/es/constants.js new file mode 100644 index 00000000..4302a376 --- /dev/null +++ b/node_modules/redux-persist/es/constants.js @@ -0,0 +1,8 @@ +export var KEY_PREFIX = 'persist:'; +export var FLUSH = 'persist/FLUSH'; +export var REHYDRATE = 'persist/REHYDRATE'; +export var PAUSE = 'persist/PAUSE'; +export var PERSIST = 'persist/PERSIST'; +export var PURGE = 'persist/PURGE'; +export var REGISTER = 'persist/REGISTER'; +export var DEFAULT_VERSION = -1; \ No newline at end of file diff --git a/node_modules/redux-persist/es/constants.js.flow b/node_modules/redux-persist/es/constants.js.flow new file mode 100644 index 00000000..009705f1 --- /dev/null +++ b/node_modules/redux-persist/es/constants.js.flow @@ -0,0 +1,10 @@ +// @flow + +export const KEY_PREFIX = 'persist:' +export const FLUSH = 'persist/FLUSH' +export const REHYDRATE = 'persist/REHYDRATE' +export const PAUSE = 'persist/PAUSE' +export const PERSIST = 'persist/PERSIST' +export const PURGE = 'persist/PURGE' +export const REGISTER = 'persist/REGISTER' +export const DEFAULT_VERSION = -1 diff --git a/node_modules/redux-persist/es/createMigrate.js b/node_modules/redux-persist/es/createMigrate.js new file mode 100644 index 00000000..394295ba --- /dev/null +++ b/node_modules/redux-persist/es/createMigrate.js @@ -0,0 +1,43 @@ +import { DEFAULT_VERSION } from './constants'; +export default function createMigrate(migrations, config) { + var _ref = config || {}, + debug = _ref.debug; + + return function (state, currentVersion) { + if (!state) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration'); + return Promise.resolve(undefined); + } + + var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : DEFAULT_VERSION; + + if (inboundVersion === currentVersion) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration'); + return Promise.resolve(state); + } + + if (inboundVersion > currentVersion) { + if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported'); + return Promise.resolve(state); + } + + var migrationKeys = Object.keys(migrations).map(function (ver) { + return parseInt(ver); + }).filter(function (key) { + return currentVersion >= key && key > inboundVersion; + }).sort(function (a, b) { + return a - b; + }); + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys); + + try { + var migratedState = migrationKeys.reduce(function (state, versionKey) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey); + return migrations[versionKey](state); + }, state); + return Promise.resolve(migratedState); + } catch (err) { + return Promise.reject(err); + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/createMigrate.js.flow b/node_modules/redux-persist/es/createMigrate.js.flow new file mode 100644 index 00000000..5426c462 --- /dev/null +++ b/node_modules/redux-persist/es/createMigrate.js.flow @@ -0,0 +1,58 @@ +// @flow + +import { DEFAULT_VERSION } from './constants' + +import type { PersistedState, MigrationManifest } from './types' + +export default function createMigrate( + migrations: MigrationManifest, + config?: { debug: boolean } +) { + let { debug } = config || {} + return function( + state: PersistedState, + currentVersion: number + ): Promise { + if (!state) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: no inbound state, skipping migration') + return Promise.resolve(undefined) + } + + let inboundVersion: number = + state._persist && state._persist.version !== undefined + ? state._persist.version + : DEFAULT_VERSION + if (inboundVersion === currentVersion) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: versions match, noop migration') + return Promise.resolve(state) + } + if (inboundVersion > currentVersion) { + if (process.env.NODE_ENV !== 'production') + console.error('redux-persist: downgrading version is not supported') + return Promise.resolve(state) + } + + let migrationKeys = Object.keys(migrations) + .map(ver => parseInt(ver)) + .filter(key => currentVersion >= key && key > inboundVersion) + .sort((a, b) => a - b) + + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: migrationKeys', migrationKeys) + try { + let migratedState = migrationKeys.reduce((state, versionKey) => { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist: running migration for versionKey', + versionKey + ) + return migrations[versionKey](state) + }, state) + return Promise.resolve(migratedState) + } catch (err) { + return Promise.reject(err) + } + } +} diff --git a/node_modules/redux-persist/es/createPersistoid.js b/node_modules/redux-persist/es/createPersistoid.js new file mode 100644 index 00000000..8b43b9ac --- /dev/null +++ b/node_modules/redux-persist/es/createPersistoid.js @@ -0,0 +1,127 @@ +import { KEY_PREFIX, REHYDRATE } from './constants'; +// @TODO remove once flow < 0.63 support is no longer required. +export default function createPersistoid(config) { + // defaults + var blacklist = config.blacklist || null; + var whitelist = config.whitelist || null; + var transforms = config.transforms || []; + var throttle = config.throttle || 0; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + var storage = config.storage; + var serialize; + + if (config.serialize === false) { + serialize = function serialize(x) { + return x; + }; + } else if (typeof config.serialize === 'function') { + serialize = config.serialize; + } else { + serialize = defaultSerialize; + } + + var writeFailHandler = config.writeFailHandler || null; // initialize stateful values + + var lastState = {}; + var stagedState = {}; + var keysToProcess = []; + var timeIterator = null; + var writePromise = null; + + var update = function update(state) { + // add any changed keys to the queue + Object.keys(state).forEach(function (key) { + if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop + + if (lastState[key] === state[key]) return; // value unchanged? noop + + if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop + + keysToProcess.push(key); // add key to queue + }); //if any key is missing in the new state which was present in the lastState, + //add it for processing too + + Object.keys(lastState).forEach(function (key) { + if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) { + keysToProcess.push(key); + } + }); // start the time iterator if not running (read: throttle) + + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle); + } + + lastState = state; + }; + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator); + timeIterator = null; + return; + } + + var key = keysToProcess.shift(); + var endState = transforms.reduce(function (subState, transformer) { + return transformer.in(subState, key, lastState); + }, lastState[key]); + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState); + } catch (err) { + console.error('redux-persist/createPersistoid: error serializing state', err); + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key]; + } + + if (keysToProcess.length === 0) { + writeStagedState(); + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(function (key) { + if (lastState[key] === undefined) { + delete stagedState[key]; + } + }); + writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail); + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false; + if (blacklist && blacklist.indexOf(key) !== -1) return false; + return true; + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err); + + if (err && process.env.NODE_ENV !== 'production') { + console.error('Error storing data', err); + } + } + + var flush = function flush() { + while (keysToProcess.length !== 0) { + processNextKey(); + } + + return writePromise || Promise.resolve(); + }; // return `persistoid` + + + return { + update: update, + flush: flush + }; +} // @NOTE in the future this may be exposed via config + +function defaultSerialize(data) { + return JSON.stringify(data); +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/createPersistoid.js.flow b/node_modules/redux-persist/es/createPersistoid.js.flow new file mode 100644 index 00000000..349b7b81 --- /dev/null +++ b/node_modules/redux-persist/es/createPersistoid.js.flow @@ -0,0 +1,142 @@ +// @flow + +import { KEY_PREFIX, REHYDRATE } from './constants' + +import type { Persistoid, PersistConfig, Transform } from './types' + +type IntervalID = any // @TODO remove once flow < 0.63 support is no longer required. + +export default function createPersistoid(config: PersistConfig): Persistoid { + // defaults + const blacklist: ?Array = config.blacklist || null + const whitelist: ?Array = config.whitelist || null + const transforms = config.transforms || [] + const throttle = config.throttle || 0 + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + let serialize + if (config.serialize === false) { + serialize = x => x + } else if (typeof config.serialize === 'function') { + serialize = config.serialize + } else { + serialize = defaultSerialize + } + const writeFailHandler = config.writeFailHandler || null + + // initialize stateful values + let lastState = {} + let stagedState = {} + let keysToProcess = [] + let timeIterator: ?IntervalID = null + let writePromise = null + + const update = (state: Object) => { + // add any changed keys to the queue + Object.keys(state).forEach(key => { + if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop + if (lastState[key] === state[key]) return // value unchanged? noop + if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop + keysToProcess.push(key) // add key to queue + }) + + //if any key is missing in the new state which was present in the lastState, + //add it for processing too + Object.keys(lastState).forEach(key => { + if ( + state[key] === undefined && + passWhitelistBlacklist(key) && + keysToProcess.indexOf(key) === -1 && + lastState[key] !== undefined + ) { + keysToProcess.push(key) + } + }) + + // start the time iterator if not running (read: throttle) + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle) + } + + lastState = state + } + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator) + timeIterator = null + return + } + + let key = keysToProcess.shift() + let endState = transforms.reduce((subState, transformer) => { + return transformer.in(subState, key, lastState) + }, lastState[key]) + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState) + } catch (err) { + console.error( + 'redux-persist/createPersistoid: error serializing state', + err + ) + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key] + } + + if (keysToProcess.length === 0) { + writeStagedState() + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(key => { + if (lastState[key] === undefined) { + delete stagedState[key] + } + }) + + writePromise = storage + .setItem(storageKey, serialize(stagedState)) + .catch(onWriteFail) + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') + return false + if (blacklist && blacklist.indexOf(key) !== -1) return false + return true + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err) + if (err && process.env.NODE_ENV !== 'production') { + console.error('Error storing data', err) + } + } + + const flush = () => { + while (keysToProcess.length !== 0) { + processNextKey() + } + return writePromise || Promise.resolve() + } + + // return `persistoid` + return { + update, + flush, + } +} + +// @NOTE in the future this may be exposed via config +function defaultSerialize(data) { + return JSON.stringify(data) +} diff --git a/node_modules/redux-persist/es/createTransform.js b/node_modules/redux-persist/es/createTransform.js new file mode 100644 index 00000000..6ae789ec --- /dev/null +++ b/node_modules/redux-persist/es/createTransform.js @@ -0,0 +1,22 @@ +export default function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored +inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux +outbound) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var whitelist = config.whitelist || null; + var blacklist = config.blacklist || null; + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true; + if (blacklist && blacklist.indexOf(key) !== -1) return true; + return false; + } + + return { + in: function _in(state, key, fullState) { + return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state; + }, + out: function out(state, key, fullState) { + return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state; + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/createTransform.js.flow b/node_modules/redux-persist/es/createTransform.js.flow new file mode 100644 index 00000000..04a97338 --- /dev/null +++ b/node_modules/redux-persist/es/createTransform.js.flow @@ -0,0 +1,34 @@ +// @flow + +type TransformConfig = { + whitelist?: Array, + blacklist?: Array, +} + +export default function createTransform( + // @NOTE inbound: transform state coming from redux on its way to being serialized and stored + inbound: ?Function, + // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux + outbound: ?Function, + config: TransformConfig = {} +) { + let whitelist = config.whitelist || null + let blacklist = config.blacklist || null + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true + if (blacklist && blacklist.indexOf(key) !== -1) return true + return false + } + + return { + in: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && inbound + ? inbound(state, key, fullState) + : state, + out: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && outbound + ? outbound(state, key, fullState) + : state, + } +} diff --git a/node_modules/redux-persist/es/getStoredState.js b/node_modules/redux-persist/es/getStoredState.js new file mode 100644 index 00000000..4cda3900 --- /dev/null +++ b/node_modules/redux-persist/es/getStoredState.js @@ -0,0 +1,40 @@ +import { KEY_PREFIX } from './constants'; +export default function getStoredState(config) { + var transforms = config.transforms || []; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + var storage = config.storage; + var debug = config.debug; + var deserialize; + + if (config.deserialize === false) { + deserialize = function deserialize(x) { + return x; + }; + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize; + } else { + deserialize = defaultDeserialize; + } + + return storage.getItem(storageKey).then(function (serialized) { + if (!serialized) return undefined;else { + try { + var state = {}; + var rawState = deserialize(serialized); + Object.keys(rawState).forEach(function (key) { + state[key] = transforms.reduceRight(function (subState, transformer) { + return transformer.out(subState, key, rawState); + }, deserialize(rawState[key])); + }); + return state; + } catch (err) { + if (process.env.NODE_ENV !== 'production' && debug) console.log("redux-persist/getStoredState: Error restoring data ".concat(serialized), err); + throw err; + } + } + }); +} + +function defaultDeserialize(serial) { + return JSON.parse(serial); +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/getStoredState.js.flow b/node_modules/redux-persist/es/getStoredState.js.flow new file mode 100644 index 00000000..e28db0d3 --- /dev/null +++ b/node_modules/redux-persist/es/getStoredState.js.flow @@ -0,0 +1,50 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function getStoredState( + config: PersistConfig +): Promise { + const transforms = config.transforms || [] + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + const debug = config.debug + let deserialize + if (config.deserialize === false) { + deserialize = x => x + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize + } else { + deserialize = defaultDeserialize + } + return storage.getItem(storageKey).then(serialized => { + if (!serialized) return undefined + else { + try { + let state = {} + let rawState = deserialize(serialized) + Object.keys(rawState).forEach(key => { + state[key] = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, rawState) + }, deserialize(rawState[key])) + }) + return state + } catch (err) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + `redux-persist/getStoredState: Error restoring data ${serialized}`, + err + ) + throw err + } + } + }) +} + +function defaultDeserialize(serial) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/es/index.js b/node_modules/redux-persist/es/index.js new file mode 100644 index 00000000..646ccaa2 --- /dev/null +++ b/node_modules/redux-persist/es/index.js @@ -0,0 +1,9 @@ +export { default as persistReducer } from './persistReducer'; +export { default as persistCombineReducers } from './persistCombineReducers'; +export { default as persistStore } from './persistStore'; +export { default as createMigrate } from './createMigrate'; +export { default as createTransform } from './createTransform'; +export { default as getStoredState } from './getStoredState'; +export { default as createPersistoid } from './createPersistoid'; +export { default as purgeStoredState } from './purgeStoredState'; +export * from './constants'; \ No newline at end of file diff --git a/node_modules/redux-persist/es/index.js.flow b/node_modules/redux-persist/es/index.js.flow new file mode 100644 index 00000000..0d9c0482 --- /dev/null +++ b/node_modules/redux-persist/es/index.js.flow @@ -0,0 +1,12 @@ +// @flow + +export { default as persistReducer } from './persistReducer' +export { default as persistCombineReducers } from './persistCombineReducers' +export { default as persistStore } from './persistStore' +export { default as createMigrate } from './createMigrate' +export { default as createTransform } from './createTransform' +export { default as getStoredState } from './getStoredState' +export { default as createPersistoid } from './createPersistoid' +export { default as purgeStoredState } from './purgeStoredState' + +export * from './constants' diff --git a/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js new file mode 100644 index 00000000..7c75448f --- /dev/null +++ b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js @@ -0,0 +1,166 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import getStoredStateV5 from '../getStoredState'; +export default function getStoredState(v4Config) { + return function (v5Config) { + return getStoredStateV5(v5Config).then(function (state) { + if (state) return state;else return getStoredStateV4(v4Config); + }); + }; +} +var KEY_PREFIX = 'reduxPersist:'; + +function hasLocalStorage() { + if ((typeof self === "undefined" ? "undefined" : _typeof(self)) !== 'object' || !('localStorage' in self)) { + return false; + } + + try { + var storage = self.localStorage; + var testKey = "redux-persist localStorage test"; + storage.setItem(testKey, 'test'); + storage.getItem(testKey); + storage.removeItem(testKey); + } catch (e) { + if (process.env.NODE_ENV !== 'production') console.warn("redux-persist localStorage test failed, persistence will be disabled."); + return false; + } + + return true; +} + +var noop = function noop() { + /* noop */ + return null; +}; + +var noStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, + getAllKeys: noop +}; + +var createAsyncLocalStorage = function createAsyncLocalStorage() { + if (!hasLocalStorage()) return noStorage; + var localStorage = self.localStorage; + return { + getAllKeys: function getAllKeys(cb) { + try { + var keys = []; + + for (var i = 0; i < localStorage.length; i++) { + keys.push(localStorage.key(i)); + } + + cb(null, keys); + } catch (e) { + cb(e); + } + }, + getItem: function getItem(key, cb) { + try { + var s = localStorage.getItem(key); + cb(null, s); + } catch (e) { + cb(e); + } + }, + setItem: function setItem(key, string, cb) { + try { + localStorage.setItem(key, string); + cb(null); + } catch (e) { + cb(e); + } + }, + removeItem: function removeItem(key, cb) { + try { + localStorage.removeItem(key); + cb && cb(null); + } catch (e) { + cb(e); + } + } + }; +}; + +function getStoredStateV4(v4Config) { + return new Promise(function (resolve, reject) { + var storage = v4Config.storage || createAsyncLocalStorage(); + var deserializer = v4Config.serialize === false ? function (data) { + return data; + } : function (serial) { + return JSON.parse(serial); + }; + var blacklist = v4Config.blacklist || []; + var whitelist = v4Config.whitelist || false; + var transforms = v4Config.transforms || []; + var keyPrefix = v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX; // fallback getAllKeys to `keys` if present (LocalForage compatability) + + if (storage.keys && !storage.getAllKeys) storage = _objectSpread({}, storage, { + getAllKeys: storage.keys + }); + var restoredState = {}; + var completionCount = 0; + storage.getAllKeys(function (err) { + var allKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (err) { + if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error in storage.getAllKeys'); + return reject(err); + } + + var persistKeys = allKeys.filter(function (key) { + return key.indexOf(keyPrefix) === 0; + }).map(function (key) { + return key.slice(keyPrefix.length); + }); + var keysToRestore = persistKeys.filter(passWhitelistBlacklist); + var restoreCount = keysToRestore.length; + if (restoreCount === 0) resolve(undefined); + keysToRestore.forEach(function (key) { + storage.getItem(createStorageKey(key), function (err, serialized) { + if (err && process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);else restoredState[key] = rehydrate(key, serialized); + completionCount += 1; + if (completionCount === restoreCount) resolve(restoredState); + }); + }); + }); + + function rehydrate(key, serialized) { + var state = null; + + try { + var data = serialized ? deserializer(serialized) : undefined; + state = transforms.reduceRight(function (subState, transformer) { + return transformer.out(subState, key, {}); + }, data); + } catch (err) { + if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err); + } + + return state; + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1) return false; + if (blacklist.indexOf(key) !== -1) return false; + return true; + } + + function createStorageKey(key) { + return "".concat(keyPrefix).concat(key); + } + }); +} + +function defaultDeserializer(serial) { + return JSON.parse(serial); +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow new file mode 100644 index 00000000..b41828f2 --- /dev/null +++ b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow @@ -0,0 +1,184 @@ +// @flow + +import getStoredStateV5 from '../getStoredState' + +import type { PersistConfig, Transform } from '../types' + +type V4Config = { + storage?: Object, + serialize: boolean, + keyPrefix?: string, + transforms?: Array, + blacklist?: Array, + whitelist?: Array, +} + +export default function getStoredState(v4Config: V4Config) { + return function(v5Config: PersistConfig) { + return getStoredStateV5(v5Config).then(state => { + if (state) return state + else return getStoredStateV4(v4Config) + }) + } +} + +const KEY_PREFIX = 'reduxPersist:' + +function hasLocalStorage() { + if (typeof self !== 'object' || !('localStorage' in self)) { + return false + } + + try { + let storage = self.localStorage + const testKey = `redux-persist localStorage test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist localStorage test failed, persistence will be disabled.` + ) + return false + } + return true +} + +let noop = (...args: any) => { + /* noop */ return null +} +const noStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, + getAllKeys: noop, +} +const createAsyncLocalStorage = () => { + if (!hasLocalStorage()) return noStorage + let localStorage = self.localStorage + return { + getAllKeys: function(cb) { + try { + var keys = [] + for (var i = 0; i < localStorage.length; i++) { + keys.push(localStorage.key(i)) + } + cb(null, keys) + } catch (e) { + cb(e) + } + }, + getItem(key, cb) { + try { + var s = localStorage.getItem(key) + cb(null, s) + } catch (e) { + cb(e) + } + }, + setItem(key, string, cb) { + try { + localStorage.setItem(key, string) + cb(null) + } catch (e) { + cb(e) + } + }, + removeItem(key, cb) { + try { + localStorage.removeItem(key) + cb && cb(null) + } catch (e) { + cb(e) + } + }, + } +} + +function getStoredStateV4(v4Config: V4Config) { + return new Promise((resolve, reject) => { + let storage = v4Config.storage || createAsyncLocalStorage() + const deserializer = + v4Config.serialize === false + ? data => data + : (serial: string) => JSON.parse(serial) + const blacklist = v4Config.blacklist || [] + const whitelist = v4Config.whitelist || false + const transforms = v4Config.transforms || [] + const keyPrefix = + v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX + + // fallback getAllKeys to `keys` if present (LocalForage compatability) + if (storage.keys && !storage.getAllKeys) + storage = { ...storage, getAllKeys: storage.keys } + + let restoredState = {} + let completionCount = 0 + + storage.getAllKeys((err, allKeys = []) => { + if (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error in storage.getAllKeys' + ) + return reject(err) + } + + let persistKeys = allKeys + .filter(key => key.indexOf(keyPrefix) === 0) + .map(key => key.slice(keyPrefix.length)) + let keysToRestore = persistKeys.filter(passWhitelistBlacklist) + + let restoreCount = keysToRestore.length + if (restoreCount === 0) resolve(undefined) + keysToRestore.forEach(key => { + storage.getItem(createStorageKey(key), (err, serialized) => { + if (err && process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + else restoredState[key] = rehydrate(key, serialized) + completionCount += 1 + if (completionCount === restoreCount) resolve(restoredState) + }) + }) + }) + + function rehydrate(key: string, serialized: ?string) { + let state = null + + try { + let data = serialized ? deserializer(serialized) : undefined + state = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, {}) + }, data) + } catch (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + } + + return state + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1) return false + if (blacklist.indexOf(key) !== -1) return false + return true + } + + function createStorageKey(key) { + return `${keyPrefix}${key}` + } + }) +} + +function defaultDeserializer(serial: string) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/es/integration/react.js b/node_modules/redux-persist/es/integration/react.js new file mode 100644 index 00000000..d90849e4 --- /dev/null +++ b/node_modules/redux-persist/es/integration/react.js @@ -0,0 +1,105 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import React, { PureComponent } from 'react'; // eslint-disable-line import/no-unresolved + +export var PersistGate = +/*#__PURE__*/ +function (_PureComponent) { + _inherits(PersistGate, _PureComponent); + + function PersistGate() { + var _getPrototypeOf2; + + var _this; + + _classCallCheck(this, PersistGate); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PersistGate)).call.apply(_getPrototypeOf2, [this].concat(args))); + + _defineProperty(_assertThisInitialized(_this), "state", { + bootstrapped: false + }); + + _defineProperty(_assertThisInitialized(_this), "_unsubscribe", void 0); + + _defineProperty(_assertThisInitialized(_this), "handlePersistorState", function () { + var persistor = _this.props.persistor; + + var _persistor$getState = persistor.getState(), + bootstrapped = _persistor$getState.bootstrapped; + + if (bootstrapped) { + if (_this.props.onBeforeLift) { + Promise.resolve(_this.props.onBeforeLift()).finally(function () { + return _this.setState({ + bootstrapped: true + }); + }); + } else { + _this.setState({ + bootstrapped: true + }); + } + + _this._unsubscribe && _this._unsubscribe(); + } + }); + + return _this; + } + + _createClass(PersistGate, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState); + this.handlePersistorState(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._unsubscribe && this._unsubscribe(); + } + }, { + key: "render", + value: function render() { + if (process.env.NODE_ENV !== 'production') { + if (typeof this.props.children === 'function' && this.props.loading) console.error('redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored.'); + } + + if (typeof this.props.children === 'function') { + return this.props.children(this.state.bootstrapped); + } + + return this.state.bootstrapped ? this.props.children : this.props.loading; + } + }]); + + return PersistGate; +}(PureComponent); + +_defineProperty(PersistGate, "defaultProps", { + children: null, + loading: null +}); \ No newline at end of file diff --git a/node_modules/redux-persist/es/integration/react.js.flow b/node_modules/redux-persist/es/integration/react.js.flow new file mode 100644 index 00000000..18d397a3 --- /dev/null +++ b/node_modules/redux-persist/es/integration/react.js.flow @@ -0,0 +1,66 @@ +// @flow +import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved +import type { Node } from 'react' // eslint-disable-line import/no-unresolved +import type { Persistor } from '../types' + +type Props = { + onBeforeLift?: Function, + children: Node | Function, + loading: Node, + persistor: Persistor, +} + +type State = { + bootstrapped: boolean, +} + +export class PersistGate extends PureComponent { + static defaultProps = { + children: null, + loading: null, + } + + state = { + bootstrapped: false, + } + _unsubscribe: ?Function + + componentDidMount() { + this._unsubscribe = this.props.persistor.subscribe( + this.handlePersistorState + ) + this.handlePersistorState() + } + + handlePersistorState = () => { + const { persistor } = this.props + let { bootstrapped } = persistor.getState() + if (bootstrapped) { + if (this.props.onBeforeLift) { + Promise.resolve(this.props.onBeforeLift()) + .finally(() => this.setState({ bootstrapped: true })) + } else { + this.setState({ bootstrapped: true }) + } + this._unsubscribe && this._unsubscribe() + } + } + + componentWillUnmount() { + this._unsubscribe && this._unsubscribe() + } + + render() { + if (process.env.NODE_ENV !== 'production') { + if (typeof this.props.children === 'function' && this.props.loading) + console.error( + 'redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored.' + ) + } + if (typeof this.props.children === 'function') { + return this.props.children(this.state.bootstrapped) + } + + return this.state.bootstrapped ? this.props.children : this.props.loading + } +} diff --git a/node_modules/redux-persist/es/persistCombineReducers.js b/node_modules/redux-persist/es/persistCombineReducers.js new file mode 100644 index 00000000..d03f7dc3 --- /dev/null +++ b/node_modules/redux-persist/es/persistCombineReducers.js @@ -0,0 +1,8 @@ +import { combineReducers } from 'redux'; +import persistReducer from './persistReducer'; +import autoMergeLevel2 from './stateReconciler/autoMergeLevel2'; +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +export default function persistCombineReducers(config, reducers) { + config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler; + return persistReducer(config, combineReducers(reducers)); +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/persistCombineReducers.js.flow b/node_modules/redux-persist/es/persistCombineReducers.js.flow new file mode 100644 index 00000000..a4b8cc5d --- /dev/null +++ b/node_modules/redux-persist/es/persistCombineReducers.js.flow @@ -0,0 +1,25 @@ +// @flow + +import { combineReducers } from 'redux' +import persistReducer from './persistReducer' +import autoMergeLevel2 from './stateReconciler/autoMergeLevel2' + +import type { PersistConfig } from './types' + +type Reducers = { + [key: string]: Function, +} + +type Reducer = (state: Object, action: Object) => Object + +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +export default function persistCombineReducers( + config: PersistConfig, + reducers: Reducers +): Reducer { + config.stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel2 + : config.stateReconciler + return persistReducer(config, combineReducers(reducers)) +} diff --git a/node_modules/redux-persist/es/persistReducer.js b/node_modules/redux-persist/es/persistReducer.js new file mode 100644 index 00000000..ad490553 --- /dev/null +++ b/node_modules/redux-persist/es/persistReducer.js @@ -0,0 +1,153 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +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; } + +import { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants'; +import autoMergeLevel1 from './stateReconciler/autoMergeLevel1'; +import createPersistoid from './createPersistoid'; +import defaultGetStoredState from './getStoredState'; +import purgeStoredState from './purgeStoredState'; +var DEFAULT_TIMEOUT = 5000; +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ + +export default function persistReducer(config, baseReducer) { + if (process.env.NODE_ENV !== 'production') { + if (!config) throw new Error('config is required for persistReducer'); + if (!config.key) throw new Error('key is required in persistor config'); + if (!config.storage) throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`"); + } + + var version = config.version !== undefined ? config.version : DEFAULT_VERSION; + var debug = config.debug || false; + var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler; + var getStoredState = config.getStoredState || defaultGetStoredState; + var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT; + var _persistoid = null; + var _purge = false; + var _paused = true; + + var conditionalUpdate = function conditionalUpdate(state) { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state); + return state; + }; + + return function (state, action) { + var _ref = state || {}, + _persist = _ref._persist, + rest = _objectWithoutProperties(_ref, ["_persist"]); // $FlowIgnore need to update State type + + + var restState = rest; + + if (action.type === PERSIST) { + var _sealed = false; + + var _rehydrate = function _rehydrate(payload, err) { + // dev warning if we are already sealed + if (process.env.NODE_ENV !== 'production' && _sealed) console.error("redux-persist: rehydrate for \"".concat(config.key, "\" called after timeout."), payload, err); // only rehydrate if we are not already sealed + + if (!_sealed) { + action.rehydrate(config.key, payload, err); + _sealed = true; + } + }; + + timeout && setTimeout(function () { + !_sealed && _rehydrate(undefined, new Error("redux-persist: persist timed out for persist key \"".concat(config.key, "\""))); + }, timeout); // @NOTE PERSIST resumes if paused. + + _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + + if (!_persistoid) _persistoid = createPersistoid(config); // @NOTE PERSIST can be called multiple times, noop after the first + + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } + + if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'); + action.register(config.key); + getStoredState(config).then(function (restoredState) { + var migrate = config.migrate || function (s, v) { + return Promise.resolve(s); + }; + + migrate(restoredState, version).then(function (migratedState) { + _rehydrate(migratedState); + }, function (migrateErr) { + if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr); + + _rehydrate(undefined, migrateErr); + }); + }, function (err) { + _rehydrate(undefined, err); + }); + return _objectSpread({}, baseReducer(restState, action), { + _persist: { + version: version, + rehydrated: false + } + }); + } else if (action.type === PURGE) { + _purge = true; + action.result(purgeStoredState(config)); + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === FLUSH) { + action.result(_persistoid && _persistoid.flush()); + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === PAUSE) { + _paused = true; + } else if (action.type === REHYDRATE) { + // noop on restState if purging + if (_purge) return _objectSpread({}, restState, { + _persist: _objectSpread({}, _persist, { + rehydrated: true + }) // @NOTE if key does not match, will continue to default else below + + }); + + if (action.key === config.key) { + var reducedState = baseReducer(restState, action); + var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined + + var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState; + + var _newState = _objectSpread({}, reconciledRest, { + _persist: _objectSpread({}, _persist, { + rehydrated: true + }) + }); + + return conditionalUpdate(_newState); + } + } // if we have not already handled PERSIST, straight passthrough + + + if (!_persist) return baseReducer(state, action); // run base reducer: + // is state modified ? return original : return updated + + var newState = baseReducer(restState, action); + if (newState === restState) return state; + return conditionalUpdate(_objectSpread({}, newState, { + _persist: _persist + })); + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/persistReducer.js.flow b/node_modules/redux-persist/es/persistReducer.js.flow new file mode 100644 index 00000000..cf8d980f --- /dev/null +++ b/node_modules/redux-persist/es/persistReducer.js.flow @@ -0,0 +1,201 @@ +// @flow +import { + FLUSH, + PAUSE, + PERSIST, + PURGE, + REHYDRATE, + DEFAULT_VERSION, +} from './constants' + +import type { + PersistConfig, + MigrationManifest, + PersistState, + Persistoid, +} from './types' + +import autoMergeLevel1 from './stateReconciler/autoMergeLevel1' +import createPersistoid from './createPersistoid' +import defaultGetStoredState from './getStoredState' +import purgeStoredState from './purgeStoredState' + +type PersistPartial = { _persist: PersistState } +const DEFAULT_TIMEOUT = 5000 +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ +export default function persistReducer( + config: PersistConfig, + baseReducer: (State, Action) => State +): (State, Action) => State & PersistPartial { + if (process.env.NODE_ENV !== 'production') { + if (!config) throw new Error('config is required for persistReducer') + if (!config.key) throw new Error('key is required in persistor config') + if (!config.storage) + throw new Error( + "redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`" + ) + } + + const version = + config.version !== undefined ? config.version : DEFAULT_VERSION + const debug = config.debug || false + const stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel1 + : config.stateReconciler + const getStoredState = config.getStoredState || defaultGetStoredState + const timeout = + config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT + let _persistoid = null + let _purge = false + let _paused = true + const conditionalUpdate = state => { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && + _persistoid && + !_paused && + _persistoid.update(state) + return state + } + + return (state: State, action: Action) => { + let { _persist, ...rest } = state || {} + // $FlowIgnore need to update State type + let restState: State = rest + + if (action.type === PERSIST) { + let _sealed = false + let _rehydrate = (payload, err) => { + // dev warning if we are already sealed + if (process.env.NODE_ENV !== 'production' && _sealed) + console.error( + `redux-persist: rehydrate for "${ + config.key + }" called after timeout.`, + payload, + err + ) + + // only rehydrate if we are not already sealed + if (!_sealed) { + action.rehydrate(config.key, payload, err) + _sealed = true + } + } + timeout && + setTimeout(() => { + !_sealed && + _rehydrate( + undefined, + new Error( + `redux-persist: persist timed out for persist key "${ + config.key + }"` + ) + ) + }, timeout) + + // @NOTE PERSIST resumes if paused. + _paused = false + + // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + if (!_persistoid) _persistoid = createPersistoid(config) + + // @NOTE PERSIST can be called multiple times, noop after the first + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return { + ...baseReducer(restState, action), + _persist, + }; + } + + if ( + typeof action.rehydrate !== 'function' || + typeof action.register !== 'function' + ) + throw new Error( + 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.' + ) + + action.register(config.key) + + getStoredState(config).then( + restoredState => { + const migrate = config.migrate || ((s, v) => Promise.resolve(s)) + migrate(restoredState, version).then( + migratedState => { + _rehydrate(migratedState) + }, + migrateErr => { + if (process.env.NODE_ENV !== 'production' && migrateErr) + console.error('redux-persist: migration error', migrateErr) + _rehydrate(undefined, migrateErr) + } + ) + }, + err => { + _rehydrate(undefined, err) + } + ) + + return { + ...baseReducer(restState, action), + _persist: { version, rehydrated: false }, + } + } else if (action.type === PURGE) { + _purge = true + action.result(purgeStoredState(config)) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === FLUSH) { + action.result(_persistoid && _persistoid.flush()) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === PAUSE) { + _paused = true + } else if (action.type === REHYDRATE) { + // noop on restState if purging + if (_purge) + return { + ...restState, + _persist: { ..._persist, rehydrated: true }, + } + + // @NOTE if key does not match, will continue to default else below + if (action.key === config.key) { + let reducedState = baseReducer(restState, action) + let inboundState = action.payload + // only reconcile state if stateReconciler and inboundState are both defined + let reconciledRest: State = + stateReconciler !== false && inboundState !== undefined + ? stateReconciler(inboundState, state, reducedState, config) + : reducedState + + let newState = { + ...reconciledRest, + _persist: { ..._persist, rehydrated: true }, + } + return conditionalUpdate(newState) + } + } + + // if we have not already handled PERSIST, straight passthrough + if (!_persist) return baseReducer(state, action) + + // run base reducer: + // is state modified ? return original : return updated + let newState = baseReducer(restState, action) + if (newState === restState) return state + return conditionalUpdate({ ...newState, _persist }) + } +} diff --git a/node_modules/redux-persist/es/persistStore.js b/node_modules/redux-persist/es/persistStore.js new file mode 100644 index 00000000..dade4f32 --- /dev/null +++ b/node_modules/redux-persist/es/persistStore.js @@ -0,0 +1,127 @@ +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { createStore } from 'redux'; +import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'; +var initialState = { + registry: [], + bootstrapped: false +}; + +var persistorReducer = function persistorReducer() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case REGISTER: + return _objectSpread({}, state, { + registry: [].concat(_toConsumableArray(state.registry), [action.key]) + }); + + case REHYDRATE: + var firstIndex = state.registry.indexOf(action.key); + + var registry = _toConsumableArray(state.registry); + + registry.splice(firstIndex, 1); + return _objectSpread({}, state, { + registry: registry, + bootstrapped: registry.length === 0 + }); + + default: + return state; + } +}; + +export default function persistStore(store, options, cb) { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + if (process.env.NODE_ENV !== 'production') { + var optionsToTest = options || {}; + var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate']; + bannedKeys.forEach(function (k) { + if (!!optionsToTest[k]) console.error("redux-persist: invalid option passed to persistStore: \"".concat(k, "\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.")); + }); + } + + var boostrappedCb = cb || false; + + var _pStore = createStore(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined); + + var register = function register(key) { + _pStore.dispatch({ + type: REGISTER, + key: key + }); + }; + + var rehydrate = function rehydrate(key, payload, err) { + var rehydrateAction = { + type: REHYDRATE, + payload: payload, + err: err, + key: key // dispatch to `store` to rehydrate and `persistor` to track result + + }; + store.dispatch(rehydrateAction); + + _pStore.dispatch(rehydrateAction); + + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb(); + boostrappedCb = false; + } + }; + + var persistor = _objectSpread({}, _pStore, { + purge: function purge() { + var results = []; + store.dispatch({ + type: PURGE, + result: function result(purgeResult) { + results.push(purgeResult); + } + }); + return Promise.all(results); + }, + flush: function flush() { + var results = []; + store.dispatch({ + type: FLUSH, + result: function result(flushResult) { + results.push(flushResult); + } + }); + return Promise.all(results); + }, + pause: function pause() { + store.dispatch({ + type: PAUSE + }); + }, + persist: function persist() { + store.dispatch({ + type: PERSIST, + register: register, + rehydrate: rehydrate + }); + } + }); + + if (!(options && options.manualPersist)) { + persistor.persist(); + } + + return persistor; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/persistStore.js.flow b/node_modules/redux-persist/es/persistStore.js.flow new file mode 100644 index 00000000..f1267534 --- /dev/null +++ b/node_modules/redux-persist/es/persistStore.js.flow @@ -0,0 +1,130 @@ +// @flow + +import type { + Persistor, + PersistConfig, + PersistorOptions, + PersistorState, + MigrationManifest, + RehydrateAction, + RehydrateErrorType, +} from './types' + +import { createStore } from 'redux' +import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants' + +type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig] +type Persist = (PersistConfig, MigrationManifest) => R => R +type CreatePersistor = Object => void +type BoostrappedCb = () => any + +const initialState: PersistorState = { + registry: [], + bootstrapped: false, +} + +const persistorReducer = (state = initialState, action) => { + switch (action.type) { + case REGISTER: + return { ...state, registry: [...state.registry, action.key] } + case REHYDRATE: + let firstIndex = state.registry.indexOf(action.key) + let registry = [...state.registry] + registry.splice(firstIndex, 1) + return { ...state, registry, bootstrapped: registry.length === 0 } + default: + return state + } +} + +export default function persistStore( + store: Object, + options?: ?PersistorOptions, + cb?: BoostrappedCb +): Persistor { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + if (process.env.NODE_ENV !== 'production') { + let optionsToTest: Object = options || {} + let bannedKeys = [ + 'blacklist', + 'whitelist', + 'transforms', + 'storage', + 'keyPrefix', + 'migrate', + ] + bannedKeys.forEach(k => { + if (!!optionsToTest[k]) + console.error( + `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.` + ) + }) + } + let boostrappedCb = cb || false + + let _pStore = createStore( + persistorReducer, + initialState, + options && options.enhancer ? options.enhancer : undefined + ) + let register = (key: string) => { + _pStore.dispatch({ + type: REGISTER, + key, + }) + } + + let rehydrate = (key: string, payload: Object, err: any) => { + let rehydrateAction = { + type: REHYDRATE, + payload, + err, + key, + } + // dispatch to `store` to rehydrate and `persistor` to track result + store.dispatch(rehydrateAction) + _pStore.dispatch(rehydrateAction) + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb() + boostrappedCb = false + } + } + + let persistor: Persistor = { + ..._pStore, + purge: () => { + let results = [] + store.dispatch({ + type: PURGE, + result: purgeResult => { + results.push(purgeResult) + }, + }) + return Promise.all(results) + }, + flush: () => { + let results = [] + store.dispatch({ + type: FLUSH, + result: flushResult => { + results.push(flushResult) + }, + }) + return Promise.all(results) + }, + pause: () => { + store.dispatch({ + type: PAUSE, + }) + }, + persist: () => { + store.dispatch({ type: PERSIST, register, rehydrate }) + }, + } + + if (!(options && options.manualPersist)){ + persistor.persist() + } + + return persistor +} diff --git a/node_modules/redux-persist/es/purgeStoredState.js b/node_modules/redux-persist/es/purgeStoredState.js new file mode 100644 index 00000000..bad3f7dc --- /dev/null +++ b/node_modules/redux-persist/es/purgeStoredState.js @@ -0,0 +1,12 @@ +import { KEY_PREFIX } from './constants'; +export default function purgeStoredState(config) { + var storage = config.storage; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX).concat(config.key); + return storage.removeItem(storageKey, warnIfRemoveError); +} + +function warnIfRemoveError(err) { + if (err && process.env.NODE_ENV !== 'production') { + console.error('redux-persist/purgeStoredState: Error purging data stored state', err); + } +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/purgeStoredState.js.flow b/node_modules/redux-persist/es/purgeStoredState.js.flow new file mode 100644 index 00000000..e6619a89 --- /dev/null +++ b/node_modules/redux-persist/es/purgeStoredState.js.flow @@ -0,0 +1,22 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function purgeStoredState(config: PersistConfig) { + const storage = config.storage + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + return storage.removeItem(storageKey, warnIfRemoveError) +} + +function warnIfRemoveError(err) { + if (err && process.env.NODE_ENV !== 'production') { + console.error( + 'redux-persist/purgeStoredState: Error purging data stored state', + err + ) + } +} diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js new file mode 100644 index 00000000..427741d7 --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js @@ -0,0 +1,37 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ +export default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } // otherwise hard set the new value + + + newState[key] = inboundState[key]; + }); + } + + if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow new file mode 100644 index 00000000..880f28a1 --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow @@ -0,0 +1,50 @@ +// @flow + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel1( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + // otherwise hard set the new value + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js new file mode 100644 index 00000000..efdfe374 --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js @@ -0,0 +1,48 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ +export default function autoMergeLevel2(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } + + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = _objectSpread({}, newState[key], {}, inboundState[key]); + return; + } // otherwise hard set + + + newState[key] = inboundState[key]; + }); + } + + if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && _typeof(o) === 'object'; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow new file mode 100644 index 00000000..f451380e --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow @@ -0,0 +1,60 @@ +// @flow + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel2( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = { ...newState[key], ...inboundState[key] } + return + } + // otherwise hard set + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && typeof o === 'object' +} diff --git a/node_modules/redux-persist/es/stateReconciler/hardSet.js b/node_modules/redux-persist/es/stateReconciler/hardSet.js new file mode 100644 index 00000000..1081f749 --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/hardSet.js @@ -0,0 +1,7 @@ +/* + hardSet: + - hard set incoming state +*/ +export default function hardSet(inboundState) { + return inboundState; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow b/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow new file mode 100644 index 00000000..1f5fcda1 --- /dev/null +++ b/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow @@ -0,0 +1,10 @@ +// @flow + +/* + hardSet: + - hard set incoming state +*/ + +export default function hardSet(inboundState: State): State { + return inboundState +} diff --git a/node_modules/redux-persist/es/storage/createWebStorage.js b/node_modules/redux-persist/es/storage/createWebStorage.js new file mode 100644 index 00000000..01c8155a --- /dev/null +++ b/node_modules/redux-persist/es/storage/createWebStorage.js @@ -0,0 +1,21 @@ +import getStorage from './getStorage'; +export default function createWebStorage(type) { + var storage = getStorage(type); + return { + getItem: function getItem(key) { + return new Promise(function (resolve, reject) { + resolve(storage.getItem(key)); + }); + }, + setItem: function setItem(key, item) { + return new Promise(function (resolve, reject) { + resolve(storage.setItem(key, item)); + }); + }, + removeItem: function removeItem(key) { + return new Promise(function (resolve, reject) { + resolve(storage.removeItem(key)); + }); + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/storage/createWebStorage.js.flow b/node_modules/redux-persist/es/storage/createWebStorage.js.flow new file mode 100644 index 00000000..b77132cc --- /dev/null +++ b/node_modules/redux-persist/es/storage/createWebStorage.js.flow @@ -0,0 +1,23 @@ +// @flow +import getStorage from './getStorage' + +export default function createWebStorage(type: string) { + let storage = getStorage(type) + return { + getItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.getItem(key)) + }) + }, + setItem: (key: string, item: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.setItem(key, item)) + }) + }, + removeItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.removeItem(key)) + }) + }, + } +} diff --git a/node_modules/redux-persist/es/storage/getStorage.js b/node_modules/redux-persist/es/storage/getStorage.js new file mode 100644 index 00000000..031a4337 --- /dev/null +++ b/node_modules/redux-persist/es/storage/getStorage.js @@ -0,0 +1,39 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function noop() {} + +var noopStorage = { + getItem: noop, + setItem: noop, + removeItem: noop +}; + +function hasStorage(storageType) { + if ((typeof self === "undefined" ? "undefined" : _typeof(self)) !== 'object' || !(storageType in self)) { + return false; + } + + try { + var storage = self[storageType]; + var testKey = "redux-persist ".concat(storageType, " test"); + storage.setItem(testKey, 'test'); + storage.getItem(testKey); + storage.removeItem(testKey); + } catch (e) { + if (process.env.NODE_ENV !== 'production') console.warn("redux-persist ".concat(storageType, " test failed, persistence will be disabled.")); + return false; + } + + return true; +} + +export default function getStorage(type) { + var storageType = "".concat(type, "Storage"); + if (hasStorage(storageType)) return self[storageType];else { + if (process.env.NODE_ENV !== 'production') { + console.error("redux-persist failed to create sync storage. falling back to noop storage."); + } + + return noopStorage; + } +} \ No newline at end of file diff --git a/node_modules/redux-persist/es/storage/getStorage.js.flow b/node_modules/redux-persist/es/storage/getStorage.js.flow new file mode 100644 index 00000000..802ddc51 --- /dev/null +++ b/node_modules/redux-persist/es/storage/getStorage.js.flow @@ -0,0 +1,44 @@ +// @flow + +import type { Storage } from '../types' + +function noop() {} +let noopStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, +} + +function hasStorage(storageType) { + if (typeof self !== 'object' || !(storageType in self)) { + return false + } + + try { + let storage = self[storageType] + const testKey = `redux-persist ${storageType} test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist ${storageType} test failed, persistence will be disabled.` + ) + return false + } + return true +} + +export default function getStorage(type: string): Storage { + const storageType = `${type}Storage` + if (hasStorage(storageType)) return self[storageType] + else { + if (process.env.NODE_ENV !== 'production') { + console.error( + `redux-persist failed to create sync storage. falling back to noop storage.` + ) + } + return noopStorage + } +} diff --git a/node_modules/redux-persist/es/storage/index.js b/node_modules/redux-persist/es/storage/index.js new file mode 100644 index 00000000..18910a90 --- /dev/null +++ b/node_modules/redux-persist/es/storage/index.js @@ -0,0 +1,2 @@ +import createWebStorage from './createWebStorage'; +export default createWebStorage('local'); \ No newline at end of file diff --git a/node_modules/redux-persist/es/storage/index.js.flow b/node_modules/redux-persist/es/storage/index.js.flow new file mode 100644 index 00000000..0532b1fb --- /dev/null +++ b/node_modules/redux-persist/es/storage/index.js.flow @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('local') diff --git a/node_modules/redux-persist/es/storage/session.js b/node_modules/redux-persist/es/storage/session.js new file mode 100644 index 00000000..521ca556 --- /dev/null +++ b/node_modules/redux-persist/es/storage/session.js @@ -0,0 +1,2 @@ +import createWebStorage from './createWebStorage'; +export default createWebStorage('session'); \ No newline at end of file diff --git a/node_modules/redux-persist/es/storage/session.js.flow b/node_modules/redux-persist/es/storage/session.js.flow new file mode 100644 index 00000000..1bb16d60 --- /dev/null +++ b/node_modules/redux-persist/es/storage/session.js.flow @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('session') diff --git a/node_modules/redux-persist/es/types.js b/node_modules/redux-persist/es/types.js new file mode 100644 index 00000000..219176bc --- /dev/null +++ b/node_modules/redux-persist/es/types.js @@ -0,0 +1 @@ +import { REHYDRATE, REGISTER } from './constants'; \ No newline at end of file diff --git a/node_modules/redux-persist/es/types.js.flow b/node_modules/redux-persist/es/types.js.flow new file mode 100644 index 00000000..c50d3cd3 --- /dev/null +++ b/node_modules/redux-persist/es/types.js.flow @@ -0,0 +1,89 @@ +// @flow +import { REHYDRATE, REGISTER } from './constants' + +export type PersistState = { + version: number, + rehydrated: boolean, +} + +export type PersistedState = { + _persist: PersistState, +} | void + +export type PersistConfig = { + version?: number, + storage: Object, + key: string, + keyPrefix?: string, // @TODO remove in v6 + blacklist?: Array, + whitelist?: Array, + transforms?: Array, + throttle?: number, + migrate?: (PersistedState, number) => Promise, + stateReconciler?: false | Function, + getStoredState?: PersistConfig => Promise, // used for migrations + debug?: boolean, + serialize?: boolean | Function, + deserialize?: boolean | Function, + timeout?: number, + writeFailHandler?: Function, +} + +export type PersistorOptions = { + enhancer?: Function, + manualPersist?: boolean +} + +export type Storage = { + getItem: (string, ?(string) => any) => any, + setItem: (string, string, ?() => any) => any, + removeItem: (string, ?() => any) => any, +} + +export type MigrationManifest = { + [number | string]: (PersistedState) => PersistedState, +} + +export type Transform = { + in: (Object | string, string, Object | string) => Object, + out: (Object | string, string, Object | string) => Object, + config?: PersistConfig, +} + +export type RehydrateErrorType = any + +export type RehydrateAction = { + type: typeof REHYDRATE, + key: string, + payload: ?Object, + err: ?RehydrateErrorType, +} + +export type Persistoid = { + update: Object => void, + flush: () => Promise, +} + +type RegisterAction = { + type: typeof REGISTER, + key: string, +} + +type PersistorAction = RehydrateAction | RegisterAction + +export type PersistorState = { + registry: Array, + bootstrapped: boolean, +} + +type PersistorSubscribeCallback = () => any + +export type Persistor = { + pause: () => void, + persist: () => void, + purge: () => Promise, + flush: () => Promise, + +dispatch: PersistorAction => PersistorAction, + +getState: () => PersistorState, + +subscribe: PersistorSubscribeCallback => () => any, +} diff --git a/node_modules/redux-persist/integration/README.md b/node_modules/redux-persist/integration/README.md new file mode 100644 index 00000000..81fed611 --- /dev/null +++ b/node_modules/redux-persist/integration/README.md @@ -0,0 +1,4 @@ +Proxy package to enable +```js +import { PersistGate } from 'redux-persist/integration/react' +``` \ No newline at end of file diff --git a/node_modules/redux-persist/integration/react/package.json b/node_modules/redux-persist/integration/react/package.json new file mode 100644 index 00000000..460f9fc0 --- /dev/null +++ b/node_modules/redux-persist/integration/react/package.json @@ -0,0 +1,7 @@ +{ + "name": "redux-persist/integration/react", + "private": true, + "main": "../../lib/integration/react", + "module": "../../es/integration/react", + "jsnext:main": "../../es/integration/react" + } \ No newline at end of file diff --git a/node_modules/redux-persist/lib/constants.js b/node_modules/redux-persist/lib/constants.js new file mode 100644 index 00000000..d1bcd61c --- /dev/null +++ b/node_modules/redux-persist/lib/constants.js @@ -0,0 +1,20 @@ +"use strict"; + +exports.__esModule = true; +exports.DEFAULT_VERSION = exports.REGISTER = exports.PURGE = exports.PERSIST = exports.PAUSE = exports.REHYDRATE = exports.FLUSH = exports.KEY_PREFIX = void 0; +var KEY_PREFIX = 'persist:'; +exports.KEY_PREFIX = KEY_PREFIX; +var FLUSH = 'persist/FLUSH'; +exports.FLUSH = FLUSH; +var REHYDRATE = 'persist/REHYDRATE'; +exports.REHYDRATE = REHYDRATE; +var PAUSE = 'persist/PAUSE'; +exports.PAUSE = PAUSE; +var PERSIST = 'persist/PERSIST'; +exports.PERSIST = PERSIST; +var PURGE = 'persist/PURGE'; +exports.PURGE = PURGE; +var REGISTER = 'persist/REGISTER'; +exports.REGISTER = REGISTER; +var DEFAULT_VERSION = -1; +exports.DEFAULT_VERSION = DEFAULT_VERSION; \ No newline at end of file diff --git a/node_modules/redux-persist/lib/constants.js.flow b/node_modules/redux-persist/lib/constants.js.flow new file mode 100644 index 00000000..009705f1 --- /dev/null +++ b/node_modules/redux-persist/lib/constants.js.flow @@ -0,0 +1,10 @@ +// @flow + +export const KEY_PREFIX = 'persist:' +export const FLUSH = 'persist/FLUSH' +export const REHYDRATE = 'persist/REHYDRATE' +export const PAUSE = 'persist/PAUSE' +export const PERSIST = 'persist/PERSIST' +export const PURGE = 'persist/PURGE' +export const REGISTER = 'persist/REGISTER' +export const DEFAULT_VERSION = -1 diff --git a/node_modules/redux-persist/lib/createMigrate.js b/node_modules/redux-persist/lib/createMigrate.js new file mode 100644 index 00000000..ef32d943 --- /dev/null +++ b/node_modules/redux-persist/lib/createMigrate.js @@ -0,0 +1,49 @@ +"use strict"; + +exports.__esModule = true; +exports.default = createMigrate; + +var _constants = require("./constants"); + +function createMigrate(migrations, config) { + var _ref = config || {}, + debug = _ref.debug; + + return function (state, currentVersion) { + if (!state) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration'); + return Promise.resolve(undefined); + } + + var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : _constants.DEFAULT_VERSION; + + if (inboundVersion === currentVersion) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration'); + return Promise.resolve(state); + } + + if (inboundVersion > currentVersion) { + if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported'); + return Promise.resolve(state); + } + + var migrationKeys = Object.keys(migrations).map(function (ver) { + return parseInt(ver); + }).filter(function (key) { + return currentVersion >= key && key > inboundVersion; + }).sort(function (a, b) { + return a - b; + }); + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys); + + try { + var migratedState = migrationKeys.reduce(function (state, versionKey) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey); + return migrations[versionKey](state); + }, state); + return Promise.resolve(migratedState); + } catch (err) { + return Promise.reject(err); + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/createMigrate.js.flow b/node_modules/redux-persist/lib/createMigrate.js.flow new file mode 100644 index 00000000..5426c462 --- /dev/null +++ b/node_modules/redux-persist/lib/createMigrate.js.flow @@ -0,0 +1,58 @@ +// @flow + +import { DEFAULT_VERSION } from './constants' + +import type { PersistedState, MigrationManifest } from './types' + +export default function createMigrate( + migrations: MigrationManifest, + config?: { debug: boolean } +) { + let { debug } = config || {} + return function( + state: PersistedState, + currentVersion: number + ): Promise { + if (!state) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: no inbound state, skipping migration') + return Promise.resolve(undefined) + } + + let inboundVersion: number = + state._persist && state._persist.version !== undefined + ? state._persist.version + : DEFAULT_VERSION + if (inboundVersion === currentVersion) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: versions match, noop migration') + return Promise.resolve(state) + } + if (inboundVersion > currentVersion) { + if (process.env.NODE_ENV !== 'production') + console.error('redux-persist: downgrading version is not supported') + return Promise.resolve(state) + } + + let migrationKeys = Object.keys(migrations) + .map(ver => parseInt(ver)) + .filter(key => currentVersion >= key && key > inboundVersion) + .sort((a, b) => a - b) + + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: migrationKeys', migrationKeys) + try { + let migratedState = migrationKeys.reduce((state, versionKey) => { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist: running migration for versionKey', + versionKey + ) + return migrations[versionKey](state) + }, state) + return Promise.resolve(migratedState) + } catch (err) { + return Promise.reject(err) + } + } +} diff --git a/node_modules/redux-persist/lib/createPersistoid.js b/node_modules/redux-persist/lib/createPersistoid.js new file mode 100644 index 00000000..b0265629 --- /dev/null +++ b/node_modules/redux-persist/lib/createPersistoid.js @@ -0,0 +1,134 @@ +"use strict"; + +exports.__esModule = true; +exports.default = createPersistoid; + +var _constants = require("./constants"); + +// @TODO remove once flow < 0.63 support is no longer required. +function createPersistoid(config) { + // defaults + var blacklist = config.blacklist || null; + var whitelist = config.whitelist || null; + var transforms = config.transforms || []; + var throttle = config.throttle || 0; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX).concat(config.key); + var storage = config.storage; + var serialize; + + if (config.serialize === false) { + serialize = function serialize(x) { + return x; + }; + } else if (typeof config.serialize === 'function') { + serialize = config.serialize; + } else { + serialize = defaultSerialize; + } + + var writeFailHandler = config.writeFailHandler || null; // initialize stateful values + + var lastState = {}; + var stagedState = {}; + var keysToProcess = []; + var timeIterator = null; + var writePromise = null; + + var update = function update(state) { + // add any changed keys to the queue + Object.keys(state).forEach(function (key) { + if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop + + if (lastState[key] === state[key]) return; // value unchanged? noop + + if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop + + keysToProcess.push(key); // add key to queue + }); //if any key is missing in the new state which was present in the lastState, + //add it for processing too + + Object.keys(lastState).forEach(function (key) { + if (state[key] === undefined && passWhitelistBlacklist(key) && keysToProcess.indexOf(key) === -1 && lastState[key] !== undefined) { + keysToProcess.push(key); + } + }); // start the time iterator if not running (read: throttle) + + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle); + } + + lastState = state; + }; + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator); + timeIterator = null; + return; + } + + var key = keysToProcess.shift(); + var endState = transforms.reduce(function (subState, transformer) { + return transformer.in(subState, key, lastState); + }, lastState[key]); + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState); + } catch (err) { + console.error('redux-persist/createPersistoid: error serializing state', err); + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key]; + } + + if (keysToProcess.length === 0) { + writeStagedState(); + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(function (key) { + if (lastState[key] === undefined) { + delete stagedState[key]; + } + }); + writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail); + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false; + if (blacklist && blacklist.indexOf(key) !== -1) return false; + return true; + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err); + + if (err && process.env.NODE_ENV !== 'production') { + console.error('Error storing data', err); + } + } + + var flush = function flush() { + while (keysToProcess.length !== 0) { + processNextKey(); + } + + return writePromise || Promise.resolve(); + }; // return `persistoid` + + + return { + update: update, + flush: flush + }; +} // @NOTE in the future this may be exposed via config + + +function defaultSerialize(data) { + return JSON.stringify(data); +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/createPersistoid.js.flow b/node_modules/redux-persist/lib/createPersistoid.js.flow new file mode 100644 index 00000000..349b7b81 --- /dev/null +++ b/node_modules/redux-persist/lib/createPersistoid.js.flow @@ -0,0 +1,142 @@ +// @flow + +import { KEY_PREFIX, REHYDRATE } from './constants' + +import type { Persistoid, PersistConfig, Transform } from './types' + +type IntervalID = any // @TODO remove once flow < 0.63 support is no longer required. + +export default function createPersistoid(config: PersistConfig): Persistoid { + // defaults + const blacklist: ?Array = config.blacklist || null + const whitelist: ?Array = config.whitelist || null + const transforms = config.transforms || [] + const throttle = config.throttle || 0 + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + let serialize + if (config.serialize === false) { + serialize = x => x + } else if (typeof config.serialize === 'function') { + serialize = config.serialize + } else { + serialize = defaultSerialize + } + const writeFailHandler = config.writeFailHandler || null + + // initialize stateful values + let lastState = {} + let stagedState = {} + let keysToProcess = [] + let timeIterator: ?IntervalID = null + let writePromise = null + + const update = (state: Object) => { + // add any changed keys to the queue + Object.keys(state).forEach(key => { + if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop + if (lastState[key] === state[key]) return // value unchanged? noop + if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop + keysToProcess.push(key) // add key to queue + }) + + //if any key is missing in the new state which was present in the lastState, + //add it for processing too + Object.keys(lastState).forEach(key => { + if ( + state[key] === undefined && + passWhitelistBlacklist(key) && + keysToProcess.indexOf(key) === -1 && + lastState[key] !== undefined + ) { + keysToProcess.push(key) + } + }) + + // start the time iterator if not running (read: throttle) + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle) + } + + lastState = state + } + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator) + timeIterator = null + return + } + + let key = keysToProcess.shift() + let endState = transforms.reduce((subState, transformer) => { + return transformer.in(subState, key, lastState) + }, lastState[key]) + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState) + } catch (err) { + console.error( + 'redux-persist/createPersistoid: error serializing state', + err + ) + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key] + } + + if (keysToProcess.length === 0) { + writeStagedState() + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(key => { + if (lastState[key] === undefined) { + delete stagedState[key] + } + }) + + writePromise = storage + .setItem(storageKey, serialize(stagedState)) + .catch(onWriteFail) + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') + return false + if (blacklist && blacklist.indexOf(key) !== -1) return false + return true + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err) + if (err && process.env.NODE_ENV !== 'production') { + console.error('Error storing data', err) + } + } + + const flush = () => { + while (keysToProcess.length !== 0) { + processNextKey() + } + return writePromise || Promise.resolve() + } + + // return `persistoid` + return { + update, + flush, + } +} + +// @NOTE in the future this may be exposed via config +function defaultSerialize(data) { + return JSON.stringify(data) +} diff --git a/node_modules/redux-persist/lib/createTransform.js b/node_modules/redux-persist/lib/createTransform.js new file mode 100644 index 00000000..9f47a7cb --- /dev/null +++ b/node_modules/redux-persist/lib/createTransform.js @@ -0,0 +1,27 @@ +"use strict"; + +exports.__esModule = true; +exports.default = createTransform; + +function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored +inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux +outbound) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var whitelist = config.whitelist || null; + var blacklist = config.blacklist || null; + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true; + if (blacklist && blacklist.indexOf(key) !== -1) return true; + return false; + } + + return { + in: function _in(state, key, fullState) { + return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state; + }, + out: function out(state, key, fullState) { + return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state; + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/createTransform.js.flow b/node_modules/redux-persist/lib/createTransform.js.flow new file mode 100644 index 00000000..04a97338 --- /dev/null +++ b/node_modules/redux-persist/lib/createTransform.js.flow @@ -0,0 +1,34 @@ +// @flow + +type TransformConfig = { + whitelist?: Array, + blacklist?: Array, +} + +export default function createTransform( + // @NOTE inbound: transform state coming from redux on its way to being serialized and stored + inbound: ?Function, + // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux + outbound: ?Function, + config: TransformConfig = {} +) { + let whitelist = config.whitelist || null + let blacklist = config.blacklist || null + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true + if (blacklist && blacklist.indexOf(key) !== -1) return true + return false + } + + return { + in: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && inbound + ? inbound(state, key, fullState) + : state, + out: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && outbound + ? outbound(state, key, fullState) + : state, + } +} diff --git a/node_modules/redux-persist/lib/getStoredState.js b/node_modules/redux-persist/lib/getStoredState.js new file mode 100644 index 00000000..9ac6cbca --- /dev/null +++ b/node_modules/redux-persist/lib/getStoredState.js @@ -0,0 +1,46 @@ +"use strict"; + +exports.__esModule = true; +exports.default = getStoredState; + +var _constants = require("./constants"); + +function getStoredState(config) { + var transforms = config.transforms || []; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX).concat(config.key); + var storage = config.storage; + var debug = config.debug; + var deserialize; + + if (config.deserialize === false) { + deserialize = function deserialize(x) { + return x; + }; + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize; + } else { + deserialize = defaultDeserialize; + } + + return storage.getItem(storageKey).then(function (serialized) { + if (!serialized) return undefined;else { + try { + var state = {}; + var rawState = deserialize(serialized); + Object.keys(rawState).forEach(function (key) { + state[key] = transforms.reduceRight(function (subState, transformer) { + return transformer.out(subState, key, rawState); + }, deserialize(rawState[key])); + }); + return state; + } catch (err) { + if (process.env.NODE_ENV !== 'production' && debug) console.log("redux-persist/getStoredState: Error restoring data ".concat(serialized), err); + throw err; + } + } + }); +} + +function defaultDeserialize(serial) { + return JSON.parse(serial); +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/getStoredState.js.flow b/node_modules/redux-persist/lib/getStoredState.js.flow new file mode 100644 index 00000000..e28db0d3 --- /dev/null +++ b/node_modules/redux-persist/lib/getStoredState.js.flow @@ -0,0 +1,50 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function getStoredState( + config: PersistConfig +): Promise { + const transforms = config.transforms || [] + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + const debug = config.debug + let deserialize + if (config.deserialize === false) { + deserialize = x => x + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize + } else { + deserialize = defaultDeserialize + } + return storage.getItem(storageKey).then(serialized => { + if (!serialized) return undefined + else { + try { + let state = {} + let rawState = deserialize(serialized) + Object.keys(rawState).forEach(key => { + state[key] = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, rawState) + }, deserialize(rawState[key])) + }) + return state + } catch (err) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + `redux-persist/getStoredState: Error restoring data ${serialized}`, + err + ) + throw err + } + } + }) +} + +function defaultDeserialize(serial) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/lib/index.js b/node_modules/redux-persist/lib/index.js new file mode 100644 index 00000000..989549bf --- /dev/null +++ b/node_modules/redux-persist/lib/index.js @@ -0,0 +1,56 @@ +"use strict"; + +exports.__esModule = true; +var _exportNames = { + persistReducer: true, + persistCombineReducers: true, + persistStore: true, + createMigrate: true, + createTransform: true, + getStoredState: true, + createPersistoid: true, + purgeStoredState: true +}; +exports.purgeStoredState = exports.createPersistoid = exports.getStoredState = exports.createTransform = exports.createMigrate = exports.persistStore = exports.persistCombineReducers = exports.persistReducer = void 0; + +var _persistReducer = _interopRequireDefault(require("./persistReducer")); + +exports.persistReducer = _persistReducer.default; + +var _persistCombineReducers = _interopRequireDefault(require("./persistCombineReducers")); + +exports.persistCombineReducers = _persistCombineReducers.default; + +var _persistStore = _interopRequireDefault(require("./persistStore")); + +exports.persistStore = _persistStore.default; + +var _createMigrate = _interopRequireDefault(require("./createMigrate")); + +exports.createMigrate = _createMigrate.default; + +var _createTransform = _interopRequireDefault(require("./createTransform")); + +exports.createTransform = _createTransform.default; + +var _getStoredState = _interopRequireDefault(require("./getStoredState")); + +exports.getStoredState = _getStoredState.default; + +var _createPersistoid = _interopRequireDefault(require("./createPersistoid")); + +exports.createPersistoid = _createPersistoid.default; + +var _purgeStoredState = _interopRequireDefault(require("./purgeStoredState")); + +exports.purgeStoredState = _purgeStoredState.default; + +var _constants = require("./constants"); + +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _constants[key]; +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/node_modules/redux-persist/lib/index.js.flow b/node_modules/redux-persist/lib/index.js.flow new file mode 100644 index 00000000..0d9c0482 --- /dev/null +++ b/node_modules/redux-persist/lib/index.js.flow @@ -0,0 +1,12 @@ +// @flow + +export { default as persistReducer } from './persistReducer' +export { default as persistCombineReducers } from './persistCombineReducers' +export { default as persistStore } from './persistStore' +export { default as createMigrate } from './createMigrate' +export { default as createTransform } from './createTransform' +export { default as getStoredState } from './getStoredState' +export { default as createPersistoid } from './createPersistoid' +export { default as purgeStoredState } from './purgeStoredState' + +export * from './constants' diff --git a/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js new file mode 100644 index 00000000..58bcebb6 --- /dev/null +++ b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js @@ -0,0 +1,175 @@ +"use strict"; + +exports.__esModule = true; +exports.default = getStoredState; + +var _getStoredState = _interopRequireDefault(require("../getStoredState")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function getStoredState(v4Config) { + return function (v5Config) { + return (0, _getStoredState.default)(v5Config).then(function (state) { + if (state) return state;else return getStoredStateV4(v4Config); + }); + }; +} + +var KEY_PREFIX = 'reduxPersist:'; + +function hasLocalStorage() { + if ((typeof self === "undefined" ? "undefined" : _typeof(self)) !== 'object' || !('localStorage' in self)) { + return false; + } + + try { + var storage = self.localStorage; + var testKey = "redux-persist localStorage test"; + storage.setItem(testKey, 'test'); + storage.getItem(testKey); + storage.removeItem(testKey); + } catch (e) { + if (process.env.NODE_ENV !== 'production') console.warn("redux-persist localStorage test failed, persistence will be disabled."); + return false; + } + + return true; +} + +var noop = function noop() { + /* noop */ + return null; +}; + +var noStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, + getAllKeys: noop +}; + +var createAsyncLocalStorage = function createAsyncLocalStorage() { + if (!hasLocalStorage()) return noStorage; + var localStorage = self.localStorage; + return { + getAllKeys: function getAllKeys(cb) { + try { + var keys = []; + + for (var i = 0; i < localStorage.length; i++) { + keys.push(localStorage.key(i)); + } + + cb(null, keys); + } catch (e) { + cb(e); + } + }, + getItem: function getItem(key, cb) { + try { + var s = localStorage.getItem(key); + cb(null, s); + } catch (e) { + cb(e); + } + }, + setItem: function setItem(key, string, cb) { + try { + localStorage.setItem(key, string); + cb(null); + } catch (e) { + cb(e); + } + }, + removeItem: function removeItem(key, cb) { + try { + localStorage.removeItem(key); + cb && cb(null); + } catch (e) { + cb(e); + } + } + }; +}; + +function getStoredStateV4(v4Config) { + return new Promise(function (resolve, reject) { + var storage = v4Config.storage || createAsyncLocalStorage(); + var deserializer = v4Config.serialize === false ? function (data) { + return data; + } : function (serial) { + return JSON.parse(serial); + }; + var blacklist = v4Config.blacklist || []; + var whitelist = v4Config.whitelist || false; + var transforms = v4Config.transforms || []; + var keyPrefix = v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX; // fallback getAllKeys to `keys` if present (LocalForage compatability) + + if (storage.keys && !storage.getAllKeys) storage = _objectSpread({}, storage, { + getAllKeys: storage.keys + }); + var restoredState = {}; + var completionCount = 0; + storage.getAllKeys(function (err) { + var allKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (err) { + if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error in storage.getAllKeys'); + return reject(err); + } + + var persistKeys = allKeys.filter(function (key) { + return key.indexOf(keyPrefix) === 0; + }).map(function (key) { + return key.slice(keyPrefix.length); + }); + var keysToRestore = persistKeys.filter(passWhitelistBlacklist); + var restoreCount = keysToRestore.length; + if (restoreCount === 0) resolve(undefined); + keysToRestore.forEach(function (key) { + storage.getItem(createStorageKey(key), function (err, serialized) { + if (err && process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);else restoredState[key] = rehydrate(key, serialized); + completionCount += 1; + if (completionCount === restoreCount) resolve(restoredState); + }); + }); + }); + + function rehydrate(key, serialized) { + var state = null; + + try { + var data = serialized ? deserializer(serialized) : undefined; + state = transforms.reduceRight(function (subState, transformer) { + return transformer.out(subState, key, {}); + }, data); + } catch (err) { + if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err); + } + + return state; + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1) return false; + if (blacklist.indexOf(key) !== -1) return false; + return true; + } + + function createStorageKey(key) { + return "".concat(keyPrefix).concat(key); + } + }); +} + +function defaultDeserializer(serial) { + return JSON.parse(serial); +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow new file mode 100644 index 00000000..b41828f2 --- /dev/null +++ b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow @@ -0,0 +1,184 @@ +// @flow + +import getStoredStateV5 from '../getStoredState' + +import type { PersistConfig, Transform } from '../types' + +type V4Config = { + storage?: Object, + serialize: boolean, + keyPrefix?: string, + transforms?: Array, + blacklist?: Array, + whitelist?: Array, +} + +export default function getStoredState(v4Config: V4Config) { + return function(v5Config: PersistConfig) { + return getStoredStateV5(v5Config).then(state => { + if (state) return state + else return getStoredStateV4(v4Config) + }) + } +} + +const KEY_PREFIX = 'reduxPersist:' + +function hasLocalStorage() { + if (typeof self !== 'object' || !('localStorage' in self)) { + return false + } + + try { + let storage = self.localStorage + const testKey = `redux-persist localStorage test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist localStorage test failed, persistence will be disabled.` + ) + return false + } + return true +} + +let noop = (...args: any) => { + /* noop */ return null +} +const noStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, + getAllKeys: noop, +} +const createAsyncLocalStorage = () => { + if (!hasLocalStorage()) return noStorage + let localStorage = self.localStorage + return { + getAllKeys: function(cb) { + try { + var keys = [] + for (var i = 0; i < localStorage.length; i++) { + keys.push(localStorage.key(i)) + } + cb(null, keys) + } catch (e) { + cb(e) + } + }, + getItem(key, cb) { + try { + var s = localStorage.getItem(key) + cb(null, s) + } catch (e) { + cb(e) + } + }, + setItem(key, string, cb) { + try { + localStorage.setItem(key, string) + cb(null) + } catch (e) { + cb(e) + } + }, + removeItem(key, cb) { + try { + localStorage.removeItem(key) + cb && cb(null) + } catch (e) { + cb(e) + } + }, + } +} + +function getStoredStateV4(v4Config: V4Config) { + return new Promise((resolve, reject) => { + let storage = v4Config.storage || createAsyncLocalStorage() + const deserializer = + v4Config.serialize === false + ? data => data + : (serial: string) => JSON.parse(serial) + const blacklist = v4Config.blacklist || [] + const whitelist = v4Config.whitelist || false + const transforms = v4Config.transforms || [] + const keyPrefix = + v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX + + // fallback getAllKeys to `keys` if present (LocalForage compatability) + if (storage.keys && !storage.getAllKeys) + storage = { ...storage, getAllKeys: storage.keys } + + let restoredState = {} + let completionCount = 0 + + storage.getAllKeys((err, allKeys = []) => { + if (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error in storage.getAllKeys' + ) + return reject(err) + } + + let persistKeys = allKeys + .filter(key => key.indexOf(keyPrefix) === 0) + .map(key => key.slice(keyPrefix.length)) + let keysToRestore = persistKeys.filter(passWhitelistBlacklist) + + let restoreCount = keysToRestore.length + if (restoreCount === 0) resolve(undefined) + keysToRestore.forEach(key => { + storage.getItem(createStorageKey(key), (err, serialized) => { + if (err && process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + else restoredState[key] = rehydrate(key, serialized) + completionCount += 1 + if (completionCount === restoreCount) resolve(restoredState) + }) + }) + }) + + function rehydrate(key: string, serialized: ?string) { + let state = null + + try { + let data = serialized ? deserializer(serialized) : undefined + state = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, {}) + }, data) + } catch (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + } + + return state + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1) return false + if (blacklist.indexOf(key) !== -1) return false + return true + } + + function createStorageKey(key) { + return `${keyPrefix}${key}` + } + }) +} + +function defaultDeserializer(serial: string) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/lib/integration/react.js b/node_modules/redux-persist/lib/integration/react.js new file mode 100644 index 00000000..5c9a98d2 --- /dev/null +++ b/node_modules/redux-persist/lib/integration/react.js @@ -0,0 +1,114 @@ +"use strict"; + +exports.__esModule = true; +exports.PersistGate = void 0; + +var _react = _interopRequireWildcard(require("react")); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var PersistGate = +/*#__PURE__*/ +function (_PureComponent) { + _inherits(PersistGate, _PureComponent); + + function PersistGate() { + var _getPrototypeOf2; + + var _this; + + _classCallCheck(this, PersistGate); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PersistGate)).call.apply(_getPrototypeOf2, [this].concat(args))); + + _defineProperty(_assertThisInitialized(_this), "state", { + bootstrapped: false + }); + + _defineProperty(_assertThisInitialized(_this), "_unsubscribe", void 0); + + _defineProperty(_assertThisInitialized(_this), "handlePersistorState", function () { + var persistor = _this.props.persistor; + + var _persistor$getState = persistor.getState(), + bootstrapped = _persistor$getState.bootstrapped; + + if (bootstrapped) { + if (_this.props.onBeforeLift) { + Promise.resolve(_this.props.onBeforeLift()).finally(function () { + return _this.setState({ + bootstrapped: true + }); + }); + } else { + _this.setState({ + bootstrapped: true + }); + } + + _this._unsubscribe && _this._unsubscribe(); + } + }); + + return _this; + } + + _createClass(PersistGate, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState); + this.handlePersistorState(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._unsubscribe && this._unsubscribe(); + } + }, { + key: "render", + value: function render() { + if (process.env.NODE_ENV !== 'production') { + if (typeof this.props.children === 'function' && this.props.loading) console.error('redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored.'); + } + + if (typeof this.props.children === 'function') { + return this.props.children(this.state.bootstrapped); + } + + return this.state.bootstrapped ? this.props.children : this.props.loading; + } + }]); + + return PersistGate; +}(_react.PureComponent); + +exports.PersistGate = PersistGate; + +_defineProperty(PersistGate, "defaultProps", { + children: null, + loading: null +}); \ No newline at end of file diff --git a/node_modules/redux-persist/lib/integration/react.js.flow b/node_modules/redux-persist/lib/integration/react.js.flow new file mode 100644 index 00000000..18d397a3 --- /dev/null +++ b/node_modules/redux-persist/lib/integration/react.js.flow @@ -0,0 +1,66 @@ +// @flow +import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved +import type { Node } from 'react' // eslint-disable-line import/no-unresolved +import type { Persistor } from '../types' + +type Props = { + onBeforeLift?: Function, + children: Node | Function, + loading: Node, + persistor: Persistor, +} + +type State = { + bootstrapped: boolean, +} + +export class PersistGate extends PureComponent { + static defaultProps = { + children: null, + loading: null, + } + + state = { + bootstrapped: false, + } + _unsubscribe: ?Function + + componentDidMount() { + this._unsubscribe = this.props.persistor.subscribe( + this.handlePersistorState + ) + this.handlePersistorState() + } + + handlePersistorState = () => { + const { persistor } = this.props + let { bootstrapped } = persistor.getState() + if (bootstrapped) { + if (this.props.onBeforeLift) { + Promise.resolve(this.props.onBeforeLift()) + .finally(() => this.setState({ bootstrapped: true })) + } else { + this.setState({ bootstrapped: true }) + } + this._unsubscribe && this._unsubscribe() + } + } + + componentWillUnmount() { + this._unsubscribe && this._unsubscribe() + } + + render() { + if (process.env.NODE_ENV !== 'production') { + if (typeof this.props.children === 'function' && this.props.loading) + console.error( + 'redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored.' + ) + } + if (typeof this.props.children === 'function') { + return this.props.children(this.state.bootstrapped) + } + + return this.state.bootstrapped ? this.props.children : this.props.loading + } +} diff --git a/node_modules/redux-persist/lib/persistCombineReducers.js b/node_modules/redux-persist/lib/persistCombineReducers.js new file mode 100644 index 00000000..07c1a032 --- /dev/null +++ b/node_modules/redux-persist/lib/persistCombineReducers.js @@ -0,0 +1,18 @@ +"use strict"; + +exports.__esModule = true; +exports.default = persistCombineReducers; + +var _redux = require("redux"); + +var _persistReducer = _interopRequireDefault(require("./persistReducer")); + +var _autoMergeLevel = _interopRequireDefault(require("./stateReconciler/autoMergeLevel2")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +function persistCombineReducers(config, reducers) { + config.stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel.default : config.stateReconciler; + return (0, _persistReducer.default)(config, (0, _redux.combineReducers)(reducers)); +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/persistCombineReducers.js.flow b/node_modules/redux-persist/lib/persistCombineReducers.js.flow new file mode 100644 index 00000000..a4b8cc5d --- /dev/null +++ b/node_modules/redux-persist/lib/persistCombineReducers.js.flow @@ -0,0 +1,25 @@ +// @flow + +import { combineReducers } from 'redux' +import persistReducer from './persistReducer' +import autoMergeLevel2 from './stateReconciler/autoMergeLevel2' + +import type { PersistConfig } from './types' + +type Reducers = { + [key: string]: Function, +} + +type Reducer = (state: Object, action: Object) => Object + +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +export default function persistCombineReducers( + config: PersistConfig, + reducers: Reducers +): Reducer { + config.stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel2 + : config.stateReconciler + return persistReducer(config, combineReducers(reducers)) +} diff --git a/node_modules/redux-persist/lib/persistReducer.js b/node_modules/redux-persist/lib/persistReducer.js new file mode 100644 index 00000000..1116881b --- /dev/null +++ b/node_modules/redux-persist/lib/persistReducer.js @@ -0,0 +1,165 @@ +"use strict"; + +exports.__esModule = true; +exports.default = persistReducer; + +var _constants = require("./constants"); + +var _autoMergeLevel = _interopRequireDefault(require("./stateReconciler/autoMergeLevel1")); + +var _createPersistoid = _interopRequireDefault(require("./createPersistoid")); + +var _getStoredState = _interopRequireDefault(require("./getStoredState")); + +var _purgeStoredState = _interopRequireDefault(require("./purgeStoredState")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +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 DEFAULT_TIMEOUT = 5000; +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ + +function persistReducer(config, baseReducer) { + if (process.env.NODE_ENV !== 'production') { + if (!config) throw new Error('config is required for persistReducer'); + if (!config.key) throw new Error('key is required in persistor config'); + if (!config.storage) throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`"); + } + + var version = config.version !== undefined ? config.version : _constants.DEFAULT_VERSION; + var debug = config.debug || false; + var stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel.default : config.stateReconciler; + var getStoredState = config.getStoredState || _getStoredState.default; + var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT; + var _persistoid = null; + var _purge = false; + var _paused = true; + + var conditionalUpdate = function conditionalUpdate(state) { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state); + return state; + }; + + return function (state, action) { + var _ref = state || {}, + _persist = _ref._persist, + rest = _objectWithoutProperties(_ref, ["_persist"]); // $FlowIgnore need to update State type + + + var restState = rest; + + if (action.type === _constants.PERSIST) { + var _sealed = false; + + var _rehydrate = function _rehydrate(payload, err) { + // dev warning if we are already sealed + if (process.env.NODE_ENV !== 'production' && _sealed) console.error("redux-persist: rehydrate for \"".concat(config.key, "\" called after timeout."), payload, err); // only rehydrate if we are not already sealed + + if (!_sealed) { + action.rehydrate(config.key, payload, err); + _sealed = true; + } + }; + + timeout && setTimeout(function () { + !_sealed && _rehydrate(undefined, new Error("redux-persist: persist timed out for persist key \"".concat(config.key, "\""))); + }, timeout); // @NOTE PERSIST resumes if paused. + + _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + + if (!_persistoid) _persistoid = (0, _createPersistoid.default)(config); // @NOTE PERSIST can be called multiple times, noop after the first + + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } + + if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'); + action.register(config.key); + getStoredState(config).then(function (restoredState) { + var migrate = config.migrate || function (s, v) { + return Promise.resolve(s); + }; + + migrate(restoredState, version).then(function (migratedState) { + _rehydrate(migratedState); + }, function (migrateErr) { + if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr); + + _rehydrate(undefined, migrateErr); + }); + }, function (err) { + _rehydrate(undefined, err); + }); + return _objectSpread({}, baseReducer(restState, action), { + _persist: { + version: version, + rehydrated: false + } + }); + } else if (action.type === _constants.PURGE) { + _purge = true; + action.result((0, _purgeStoredState.default)(config)); + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === _constants.FLUSH) { + action.result(_persistoid && _persistoid.flush()); + return _objectSpread({}, baseReducer(restState, action), { + _persist: _persist + }); + } else if (action.type === _constants.PAUSE) { + _paused = true; + } else if (action.type === _constants.REHYDRATE) { + // noop on restState if purging + if (_purge) return _objectSpread({}, restState, { + _persist: _objectSpread({}, _persist, { + rehydrated: true + }) // @NOTE if key does not match, will continue to default else below + + }); + + if (action.key === config.key) { + var reducedState = baseReducer(restState, action); + var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined + + var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState; + + var _newState = _objectSpread({}, reconciledRest, { + _persist: _objectSpread({}, _persist, { + rehydrated: true + }) + }); + + return conditionalUpdate(_newState); + } + } // if we have not already handled PERSIST, straight passthrough + + + if (!_persist) return baseReducer(state, action); // run base reducer: + // is state modified ? return original : return updated + + var newState = baseReducer(restState, action); + if (newState === restState) return state; + return conditionalUpdate(_objectSpread({}, newState, { + _persist: _persist + })); + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/persistReducer.js.flow b/node_modules/redux-persist/lib/persistReducer.js.flow new file mode 100644 index 00000000..cf8d980f --- /dev/null +++ b/node_modules/redux-persist/lib/persistReducer.js.flow @@ -0,0 +1,201 @@ +// @flow +import { + FLUSH, + PAUSE, + PERSIST, + PURGE, + REHYDRATE, + DEFAULT_VERSION, +} from './constants' + +import type { + PersistConfig, + MigrationManifest, + PersistState, + Persistoid, +} from './types' + +import autoMergeLevel1 from './stateReconciler/autoMergeLevel1' +import createPersistoid from './createPersistoid' +import defaultGetStoredState from './getStoredState' +import purgeStoredState from './purgeStoredState' + +type PersistPartial = { _persist: PersistState } +const DEFAULT_TIMEOUT = 5000 +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ +export default function persistReducer( + config: PersistConfig, + baseReducer: (State, Action) => State +): (State, Action) => State & PersistPartial { + if (process.env.NODE_ENV !== 'production') { + if (!config) throw new Error('config is required for persistReducer') + if (!config.key) throw new Error('key is required in persistor config') + if (!config.storage) + throw new Error( + "redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`" + ) + } + + const version = + config.version !== undefined ? config.version : DEFAULT_VERSION + const debug = config.debug || false + const stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel1 + : config.stateReconciler + const getStoredState = config.getStoredState || defaultGetStoredState + const timeout = + config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT + let _persistoid = null + let _purge = false + let _paused = true + const conditionalUpdate = state => { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && + _persistoid && + !_paused && + _persistoid.update(state) + return state + } + + return (state: State, action: Action) => { + let { _persist, ...rest } = state || {} + // $FlowIgnore need to update State type + let restState: State = rest + + if (action.type === PERSIST) { + let _sealed = false + let _rehydrate = (payload, err) => { + // dev warning if we are already sealed + if (process.env.NODE_ENV !== 'production' && _sealed) + console.error( + `redux-persist: rehydrate for "${ + config.key + }" called after timeout.`, + payload, + err + ) + + // only rehydrate if we are not already sealed + if (!_sealed) { + action.rehydrate(config.key, payload, err) + _sealed = true + } + } + timeout && + setTimeout(() => { + !_sealed && + _rehydrate( + undefined, + new Error( + `redux-persist: persist timed out for persist key "${ + config.key + }"` + ) + ) + }, timeout) + + // @NOTE PERSIST resumes if paused. + _paused = false + + // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + if (!_persistoid) _persistoid = createPersistoid(config) + + // @NOTE PERSIST can be called multiple times, noop after the first + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return { + ...baseReducer(restState, action), + _persist, + }; + } + + if ( + typeof action.rehydrate !== 'function' || + typeof action.register !== 'function' + ) + throw new Error( + 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.' + ) + + action.register(config.key) + + getStoredState(config).then( + restoredState => { + const migrate = config.migrate || ((s, v) => Promise.resolve(s)) + migrate(restoredState, version).then( + migratedState => { + _rehydrate(migratedState) + }, + migrateErr => { + if (process.env.NODE_ENV !== 'production' && migrateErr) + console.error('redux-persist: migration error', migrateErr) + _rehydrate(undefined, migrateErr) + } + ) + }, + err => { + _rehydrate(undefined, err) + } + ) + + return { + ...baseReducer(restState, action), + _persist: { version, rehydrated: false }, + } + } else if (action.type === PURGE) { + _purge = true + action.result(purgeStoredState(config)) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === FLUSH) { + action.result(_persistoid && _persistoid.flush()) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === PAUSE) { + _paused = true + } else if (action.type === REHYDRATE) { + // noop on restState if purging + if (_purge) + return { + ...restState, + _persist: { ..._persist, rehydrated: true }, + } + + // @NOTE if key does not match, will continue to default else below + if (action.key === config.key) { + let reducedState = baseReducer(restState, action) + let inboundState = action.payload + // only reconcile state if stateReconciler and inboundState are both defined + let reconciledRest: State = + stateReconciler !== false && inboundState !== undefined + ? stateReconciler(inboundState, state, reducedState, config) + : reducedState + + let newState = { + ...reconciledRest, + _persist: { ..._persist, rehydrated: true }, + } + return conditionalUpdate(newState) + } + } + + // if we have not already handled PERSIST, straight passthrough + if (!_persist) return baseReducer(state, action) + + // run base reducer: + // is state modified ? return original : return updated + let newState = baseReducer(restState, action) + if (newState === restState) return state + return conditionalUpdate({ ...newState, _persist }) + } +} diff --git a/node_modules/redux-persist/lib/persistStore.js b/node_modules/redux-persist/lib/persistStore.js new file mode 100644 index 00000000..fecb7945 --- /dev/null +++ b/node_modules/redux-persist/lib/persistStore.js @@ -0,0 +1,134 @@ +"use strict"; + +exports.__esModule = true; +exports.default = persistStore; + +var _redux = require("redux"); + +var _constants = require("./constants"); + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var initialState = { + registry: [], + bootstrapped: false +}; + +var persistorReducer = function persistorReducer() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments.length > 1 ? arguments[1] : undefined; + + switch (action.type) { + case _constants.REGISTER: + return _objectSpread({}, state, { + registry: [].concat(_toConsumableArray(state.registry), [action.key]) + }); + + case _constants.REHYDRATE: + var firstIndex = state.registry.indexOf(action.key); + + var registry = _toConsumableArray(state.registry); + + registry.splice(firstIndex, 1); + return _objectSpread({}, state, { + registry: registry, + bootstrapped: registry.length === 0 + }); + + default: + return state; + } +}; + +function persistStore(store, options, cb) { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + if (process.env.NODE_ENV !== 'production') { + var optionsToTest = options || {}; + var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate']; + bannedKeys.forEach(function (k) { + if (!!optionsToTest[k]) console.error("redux-persist: invalid option passed to persistStore: \"".concat(k, "\". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.")); + }); + } + + var boostrappedCb = cb || false; + + var _pStore = (0, _redux.createStore)(persistorReducer, initialState, options && options.enhancer ? options.enhancer : undefined); + + var register = function register(key) { + _pStore.dispatch({ + type: _constants.REGISTER, + key: key + }); + }; + + var rehydrate = function rehydrate(key, payload, err) { + var rehydrateAction = { + type: _constants.REHYDRATE, + payload: payload, + err: err, + key: key // dispatch to `store` to rehydrate and `persistor` to track result + + }; + store.dispatch(rehydrateAction); + + _pStore.dispatch(rehydrateAction); + + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb(); + boostrappedCb = false; + } + }; + + var persistor = _objectSpread({}, _pStore, { + purge: function purge() { + var results = []; + store.dispatch({ + type: _constants.PURGE, + result: function result(purgeResult) { + results.push(purgeResult); + } + }); + return Promise.all(results); + }, + flush: function flush() { + var results = []; + store.dispatch({ + type: _constants.FLUSH, + result: function result(flushResult) { + results.push(flushResult); + } + }); + return Promise.all(results); + }, + pause: function pause() { + store.dispatch({ + type: _constants.PAUSE + }); + }, + persist: function persist() { + store.dispatch({ + type: _constants.PERSIST, + register: register, + rehydrate: rehydrate + }); + } + }); + + if (!(options && options.manualPersist)) { + persistor.persist(); + } + + return persistor; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/persistStore.js.flow b/node_modules/redux-persist/lib/persistStore.js.flow new file mode 100644 index 00000000..f1267534 --- /dev/null +++ b/node_modules/redux-persist/lib/persistStore.js.flow @@ -0,0 +1,130 @@ +// @flow + +import type { + Persistor, + PersistConfig, + PersistorOptions, + PersistorState, + MigrationManifest, + RehydrateAction, + RehydrateErrorType, +} from './types' + +import { createStore } from 'redux' +import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants' + +type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig] +type Persist = (PersistConfig, MigrationManifest) => R => R +type CreatePersistor = Object => void +type BoostrappedCb = () => any + +const initialState: PersistorState = { + registry: [], + bootstrapped: false, +} + +const persistorReducer = (state = initialState, action) => { + switch (action.type) { + case REGISTER: + return { ...state, registry: [...state.registry, action.key] } + case REHYDRATE: + let firstIndex = state.registry.indexOf(action.key) + let registry = [...state.registry] + registry.splice(firstIndex, 1) + return { ...state, registry, bootstrapped: registry.length === 0 } + default: + return state + } +} + +export default function persistStore( + store: Object, + options?: ?PersistorOptions, + cb?: BoostrappedCb +): Persistor { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + if (process.env.NODE_ENV !== 'production') { + let optionsToTest: Object = options || {} + let bannedKeys = [ + 'blacklist', + 'whitelist', + 'transforms', + 'storage', + 'keyPrefix', + 'migrate', + ] + bannedKeys.forEach(k => { + if (!!optionsToTest[k]) + console.error( + `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.` + ) + }) + } + let boostrappedCb = cb || false + + let _pStore = createStore( + persistorReducer, + initialState, + options && options.enhancer ? options.enhancer : undefined + ) + let register = (key: string) => { + _pStore.dispatch({ + type: REGISTER, + key, + }) + } + + let rehydrate = (key: string, payload: Object, err: any) => { + let rehydrateAction = { + type: REHYDRATE, + payload, + err, + key, + } + // dispatch to `store` to rehydrate and `persistor` to track result + store.dispatch(rehydrateAction) + _pStore.dispatch(rehydrateAction) + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb() + boostrappedCb = false + } + } + + let persistor: Persistor = { + ..._pStore, + purge: () => { + let results = [] + store.dispatch({ + type: PURGE, + result: purgeResult => { + results.push(purgeResult) + }, + }) + return Promise.all(results) + }, + flush: () => { + let results = [] + store.dispatch({ + type: FLUSH, + result: flushResult => { + results.push(flushResult) + }, + }) + return Promise.all(results) + }, + pause: () => { + store.dispatch({ + type: PAUSE, + }) + }, + persist: () => { + store.dispatch({ type: PERSIST, register, rehydrate }) + }, + } + + if (!(options && options.manualPersist)){ + persistor.persist() + } + + return persistor +} diff --git a/node_modules/redux-persist/lib/purgeStoredState.js b/node_modules/redux-persist/lib/purgeStoredState.js new file mode 100644 index 00000000..624bed32 --- /dev/null +++ b/node_modules/redux-persist/lib/purgeStoredState.js @@ -0,0 +1,18 @@ +"use strict"; + +exports.__esModule = true; +exports.default = purgeStoredState; + +var _constants = require("./constants"); + +function purgeStoredState(config) { + var storage = config.storage; + var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX).concat(config.key); + return storage.removeItem(storageKey, warnIfRemoveError); +} + +function warnIfRemoveError(err) { + if (err && process.env.NODE_ENV !== 'production') { + console.error('redux-persist/purgeStoredState: Error purging data stored state', err); + } +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/purgeStoredState.js.flow b/node_modules/redux-persist/lib/purgeStoredState.js.flow new file mode 100644 index 00000000..e6619a89 --- /dev/null +++ b/node_modules/redux-persist/lib/purgeStoredState.js.flow @@ -0,0 +1,22 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function purgeStoredState(config: PersistConfig) { + const storage = config.storage + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + return storage.removeItem(storageKey, warnIfRemoveError) +} + +function warnIfRemoveError(err) { + if (err && process.env.NODE_ENV !== 'production') { + console.error( + 'redux-persist/purgeStoredState: Error purging data stored state', + err + ) + } +} diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js new file mode 100644 index 00000000..8fa2940d --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js @@ -0,0 +1,42 @@ +"use strict"; + +exports.__esModule = true; +exports.default = autoMergeLevel1; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ +function autoMergeLevel1(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } // otherwise hard set the new value + + + newState[key] = inboundState[key]; + }); + } + + if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow new file mode 100644 index 00000000..880f28a1 --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow @@ -0,0 +1,50 @@ +// @flow + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel1( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + // otherwise hard set the new value + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js new file mode 100644 index 00000000..83d05d6f --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js @@ -0,0 +1,53 @@ +"use strict"; + +exports.__esModule = true; +exports.default = autoMergeLevel2; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ +function autoMergeLevel2(inboundState, originalState, reducedState, _ref) { + var debug = _ref.debug; + + var newState = _objectSpread({}, reducedState); // only rehydrate if inboundState exists and is an object + + + if (inboundState && _typeof(inboundState) === 'object') { + Object.keys(inboundState).forEach(function (key) { + // ignore _persist data + if (key === '_persist') return; // if reducer modifies substate, skip auto rehydration + + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key); + return; + } + + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = _objectSpread({}, newState[key], {}, inboundState[key]); + return; + } // otherwise hard set + + + newState[key] = inboundState[key]; + }); + } + + if (process.env.NODE_ENV !== 'production' && debug && inboundState && _typeof(inboundState) === 'object') console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(inboundState).join(', '), "'")); + return newState; +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && _typeof(o) === 'object'; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow new file mode 100644 index 00000000..f451380e --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow @@ -0,0 +1,60 @@ +// @flow + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel2( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = { ...newState[key], ...inboundState[key] } + return + } + // otherwise hard set + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && typeof o === 'object' +} diff --git a/node_modules/redux-persist/lib/stateReconciler/hardSet.js b/node_modules/redux-persist/lib/stateReconciler/hardSet.js new file mode 100644 index 00000000..aacdd7b6 --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/hardSet.js @@ -0,0 +1,12 @@ +"use strict"; + +exports.__esModule = true; +exports.default = hardSet; + +/* + hardSet: + - hard set incoming state +*/ +function hardSet(inboundState) { + return inboundState; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow b/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow new file mode 100644 index 00000000..1f5fcda1 --- /dev/null +++ b/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow @@ -0,0 +1,10 @@ +// @flow + +/* + hardSet: + - hard set incoming state +*/ + +export default function hardSet(inboundState: State): State { + return inboundState +} diff --git a/node_modules/redux-persist/lib/storage/createWebStorage.js b/node_modules/redux-persist/lib/storage/createWebStorage.js new file mode 100644 index 00000000..3639f2f4 --- /dev/null +++ b/node_modules/redux-persist/lib/storage/createWebStorage.js @@ -0,0 +1,29 @@ +"use strict"; + +exports.__esModule = true; +exports.default = createWebStorage; + +var _getStorage = _interopRequireDefault(require("./getStorage")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createWebStorage(type) { + var storage = (0, _getStorage.default)(type); + return { + getItem: function getItem(key) { + return new Promise(function (resolve, reject) { + resolve(storage.getItem(key)); + }); + }, + setItem: function setItem(key, item) { + return new Promise(function (resolve, reject) { + resolve(storage.setItem(key, item)); + }); + }, + removeItem: function removeItem(key) { + return new Promise(function (resolve, reject) { + resolve(storage.removeItem(key)); + }); + } + }; +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/storage/createWebStorage.js.flow b/node_modules/redux-persist/lib/storage/createWebStorage.js.flow new file mode 100644 index 00000000..b77132cc --- /dev/null +++ b/node_modules/redux-persist/lib/storage/createWebStorage.js.flow @@ -0,0 +1,23 @@ +// @flow +import getStorage from './getStorage' + +export default function createWebStorage(type: string) { + let storage = getStorage(type) + return { + getItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.getItem(key)) + }) + }, + setItem: (key: string, item: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.setItem(key, item)) + }) + }, + removeItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.removeItem(key)) + }) + }, + } +} diff --git a/node_modules/redux-persist/lib/storage/getStorage.js b/node_modules/redux-persist/lib/storage/getStorage.js new file mode 100644 index 00000000..6674279f --- /dev/null +++ b/node_modules/redux-persist/lib/storage/getStorage.js @@ -0,0 +1,44 @@ +"use strict"; + +exports.__esModule = true; +exports.default = getStorage; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function noop() {} + +var noopStorage = { + getItem: noop, + setItem: noop, + removeItem: noop +}; + +function hasStorage(storageType) { + if ((typeof self === "undefined" ? "undefined" : _typeof(self)) !== 'object' || !(storageType in self)) { + return false; + } + + try { + var storage = self[storageType]; + var testKey = "redux-persist ".concat(storageType, " test"); + storage.setItem(testKey, 'test'); + storage.getItem(testKey); + storage.removeItem(testKey); + } catch (e) { + if (process.env.NODE_ENV !== 'production') console.warn("redux-persist ".concat(storageType, " test failed, persistence will be disabled.")); + return false; + } + + return true; +} + +function getStorage(type) { + var storageType = "".concat(type, "Storage"); + if (hasStorage(storageType)) return self[storageType];else { + if (process.env.NODE_ENV !== 'production') { + console.error("redux-persist failed to create sync storage. falling back to noop storage."); + } + + return noopStorage; + } +} \ No newline at end of file diff --git a/node_modules/redux-persist/lib/storage/getStorage.js.flow b/node_modules/redux-persist/lib/storage/getStorage.js.flow new file mode 100644 index 00000000..802ddc51 --- /dev/null +++ b/node_modules/redux-persist/lib/storage/getStorage.js.flow @@ -0,0 +1,44 @@ +// @flow + +import type { Storage } from '../types' + +function noop() {} +let noopStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, +} + +function hasStorage(storageType) { + if (typeof self !== 'object' || !(storageType in self)) { + return false + } + + try { + let storage = self[storageType] + const testKey = `redux-persist ${storageType} test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist ${storageType} test failed, persistence will be disabled.` + ) + return false + } + return true +} + +export default function getStorage(type: string): Storage { + const storageType = `${type}Storage` + if (hasStorage(storageType)) return self[storageType] + else { + if (process.env.NODE_ENV !== 'production') { + console.error( + `redux-persist failed to create sync storage. falling back to noop storage.` + ) + } + return noopStorage + } +} diff --git a/node_modules/redux-persist/lib/storage/index.js b/node_modules/redux-persist/lib/storage/index.js new file mode 100644 index 00000000..39a305d7 --- /dev/null +++ b/node_modules/redux-persist/lib/storage/index.js @@ -0,0 +1,12 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; + +var _createWebStorage = _interopRequireDefault(require("./createWebStorage")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _createWebStorage.default)('local'); + +exports.default = _default; \ No newline at end of file diff --git a/node_modules/redux-persist/lib/storage/index.js.flow b/node_modules/redux-persist/lib/storage/index.js.flow new file mode 100644 index 00000000..0532b1fb --- /dev/null +++ b/node_modules/redux-persist/lib/storage/index.js.flow @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('local') diff --git a/node_modules/redux-persist/lib/storage/session.js b/node_modules/redux-persist/lib/storage/session.js new file mode 100644 index 00000000..46117f81 --- /dev/null +++ b/node_modules/redux-persist/lib/storage/session.js @@ -0,0 +1,12 @@ +"use strict"; + +exports.__esModule = true; +exports.default = void 0; + +var _createWebStorage = _interopRequireDefault(require("./createWebStorage")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var _default = (0, _createWebStorage.default)('session'); + +exports.default = _default; \ No newline at end of file diff --git a/node_modules/redux-persist/lib/storage/session.js.flow b/node_modules/redux-persist/lib/storage/session.js.flow new file mode 100644 index 00000000..1bb16d60 --- /dev/null +++ b/node_modules/redux-persist/lib/storage/session.js.flow @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('session') diff --git a/node_modules/redux-persist/lib/types.js b/node_modules/redux-persist/lib/types.js new file mode 100644 index 00000000..85a921a7 --- /dev/null +++ b/node_modules/redux-persist/lib/types.js @@ -0,0 +1,3 @@ +"use strict"; + +var _constants = require("./constants"); \ No newline at end of file diff --git a/node_modules/redux-persist/lib/types.js.flow b/node_modules/redux-persist/lib/types.js.flow new file mode 100644 index 00000000..c50d3cd3 --- /dev/null +++ b/node_modules/redux-persist/lib/types.js.flow @@ -0,0 +1,89 @@ +// @flow +import { REHYDRATE, REGISTER } from './constants' + +export type PersistState = { + version: number, + rehydrated: boolean, +} + +export type PersistedState = { + _persist: PersistState, +} | void + +export type PersistConfig = { + version?: number, + storage: Object, + key: string, + keyPrefix?: string, // @TODO remove in v6 + blacklist?: Array, + whitelist?: Array, + transforms?: Array, + throttle?: number, + migrate?: (PersistedState, number) => Promise, + stateReconciler?: false | Function, + getStoredState?: PersistConfig => Promise, // used for migrations + debug?: boolean, + serialize?: boolean | Function, + deserialize?: boolean | Function, + timeout?: number, + writeFailHandler?: Function, +} + +export type PersistorOptions = { + enhancer?: Function, + manualPersist?: boolean +} + +export type Storage = { + getItem: (string, ?(string) => any) => any, + setItem: (string, string, ?() => any) => any, + removeItem: (string, ?() => any) => any, +} + +export type MigrationManifest = { + [number | string]: (PersistedState) => PersistedState, +} + +export type Transform = { + in: (Object | string, string, Object | string) => Object, + out: (Object | string, string, Object | string) => Object, + config?: PersistConfig, +} + +export type RehydrateErrorType = any + +export type RehydrateAction = { + type: typeof REHYDRATE, + key: string, + payload: ?Object, + err: ?RehydrateErrorType, +} + +export type Persistoid = { + update: Object => void, + flush: () => Promise, +} + +type RegisterAction = { + type: typeof REGISTER, + key: string, +} + +type PersistorAction = RehydrateAction | RegisterAction + +export type PersistorState = { + registry: Array, + bootstrapped: boolean, +} + +type PersistorSubscribeCallback = () => any + +export type Persistor = { + pause: () => void, + persist: () => void, + purge: () => Promise, + flush: () => Promise, + +dispatch: PersistorAction => PersistorAction, + +getState: () => PersistorState, + +subscribe: PersistorSubscribeCallback => () => any, +} diff --git a/node_modules/redux-persist/package.json b/node_modules/redux-persist/package.json new file mode 100644 index 00000000..6ce80112 --- /dev/null +++ b/node_modules/redux-persist/package.json @@ -0,0 +1,91 @@ +{ + "name": "redux-persist", + "version": "6.0.0", + "description": "persist and rehydrate redux stores", + "main": "lib/index.js", + "module": "es/index.js", + "types": "./types/index.d.ts", + "repository": "rt2zz/redux-persist", + "files": [ + "es", + "src", + "lib", + "dist", + "integration", + "types", + "README.md" + ], + "scripts": { + "ava": "cross-env BABEL_ENV=commonjs ava", + "build": "npm run flow-copy && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min", + "build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib", + "build:es": "cross-env BABEL_ENV=es babel src --out-dir es", + "build:umd": "cross-env BABEL_ENV=es NODE_ENV=development rollup -c -i src/index.js -o dist/redux-persist.js", + "build:umd:min": "cross-env BABEL_ENV=es NODE_ENV=production rollup -c -i src/index.js -o dist/redux-persist.min.js", + "clean": "rimraf es && rimraf lib", + "flow-copy": "flow-copy-source src es && flow-copy-source src lib", + "prepare": "npm run build", + "precommit": "lint-staged", + "stats:size": "node ./scripts/size-estimator.js", + "test": "flow && cross-env BABEL_ENV=commonjs ava", + "test:typescript": "dtslint types", + "version": "npm run clean && npm run build && npm run stats:size | tail -1 >> LIBSIZE.md && git add LIBSIZE.md" + }, + "lint-staged": { + "src/**/*.js": [ + "prettier --write", + "git add" + ] + }, + "author": "", + "license": "MIT", + "homepage": "https://github.com/rt2zz/redux-persist#readme", + "ava": { + "files": [ + "tests/**/*.spec.js" + ], + "require": [ + "@babel/polyfill", + "@babel/register" + ] + }, + "devDependencies": { + "@babel/cli": "^7.5.5", + "@babel/core": "^7.5.5", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-object-rest-spread": "^7.5.5", + "@babel/plugin-transform-modules-commonjs": "^7.5.0", + "@babel/polyfill": "^7.4.4", + "@babel/preset-env": "^7.5.5", + "@babel/preset-flow": "^7.0.0", + "@babel/register": "^7.5.5", + "@types/react": "^16.9.2", + "ava": "^1.4.1", + "babel-eslint": "^10.0.3", + "cross-env": "^5.2.1", + "dtslint": "^0.3.0", + "eslint": "^4.16.0", + "eslint-plugin-flowtype": "^2.42.0", + "eslint-plugin-import": "^2.18.2", + "flow-bin": "^0.98.1", + "flow-copy-source": "^1.2.2", + "husky": "^0.14.3", + "lint-staged": "^6.1.0", + "lodash": "^4.17.15", + "prettier": "^1.18.2", + "redux": "^4.0.4", + "redux-mock-store": "^1.5.1", + "rimraf": "^2.7.1", + "rollup": "^0.55.3", + "rollup-plugin-babel": "^4.3.3", + "rollup-plugin-node-resolve": "^4.2.4", + "rollup-plugin-replace": "^2.2.0", + "rollup-plugin-uglify": "^3.0.0", + "sinon": "^4.2.2", + "storage-memory": "0.0.2" + }, + "peerDependencies": { + "redux": ">4.0.0" + }, + "dependencies": {} +} diff --git a/node_modules/redux-persist/src/constants.js b/node_modules/redux-persist/src/constants.js new file mode 100644 index 00000000..009705f1 --- /dev/null +++ b/node_modules/redux-persist/src/constants.js @@ -0,0 +1,10 @@ +// @flow + +export const KEY_PREFIX = 'persist:' +export const FLUSH = 'persist/FLUSH' +export const REHYDRATE = 'persist/REHYDRATE' +export const PAUSE = 'persist/PAUSE' +export const PERSIST = 'persist/PERSIST' +export const PURGE = 'persist/PURGE' +export const REGISTER = 'persist/REGISTER' +export const DEFAULT_VERSION = -1 diff --git a/node_modules/redux-persist/src/createMigrate.js b/node_modules/redux-persist/src/createMigrate.js new file mode 100644 index 00000000..5426c462 --- /dev/null +++ b/node_modules/redux-persist/src/createMigrate.js @@ -0,0 +1,58 @@ +// @flow + +import { DEFAULT_VERSION } from './constants' + +import type { PersistedState, MigrationManifest } from './types' + +export default function createMigrate( + migrations: MigrationManifest, + config?: { debug: boolean } +) { + let { debug } = config || {} + return function( + state: PersistedState, + currentVersion: number + ): Promise { + if (!state) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: no inbound state, skipping migration') + return Promise.resolve(undefined) + } + + let inboundVersion: number = + state._persist && state._persist.version !== undefined + ? state._persist.version + : DEFAULT_VERSION + if (inboundVersion === currentVersion) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: versions match, noop migration') + return Promise.resolve(state) + } + if (inboundVersion > currentVersion) { + if (process.env.NODE_ENV !== 'production') + console.error('redux-persist: downgrading version is not supported') + return Promise.resolve(state) + } + + let migrationKeys = Object.keys(migrations) + .map(ver => parseInt(ver)) + .filter(key => currentVersion >= key && key > inboundVersion) + .sort((a, b) => a - b) + + if (process.env.NODE_ENV !== 'production' && debug) + console.log('redux-persist: migrationKeys', migrationKeys) + try { + let migratedState = migrationKeys.reduce((state, versionKey) => { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist: running migration for versionKey', + versionKey + ) + return migrations[versionKey](state) + }, state) + return Promise.resolve(migratedState) + } catch (err) { + return Promise.reject(err) + } + } +} diff --git a/node_modules/redux-persist/src/createPersistoid.js b/node_modules/redux-persist/src/createPersistoid.js new file mode 100644 index 00000000..349b7b81 --- /dev/null +++ b/node_modules/redux-persist/src/createPersistoid.js @@ -0,0 +1,142 @@ +// @flow + +import { KEY_PREFIX, REHYDRATE } from './constants' + +import type { Persistoid, PersistConfig, Transform } from './types' + +type IntervalID = any // @TODO remove once flow < 0.63 support is no longer required. + +export default function createPersistoid(config: PersistConfig): Persistoid { + // defaults + const blacklist: ?Array = config.blacklist || null + const whitelist: ?Array = config.whitelist || null + const transforms = config.transforms || [] + const throttle = config.throttle || 0 + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + let serialize + if (config.serialize === false) { + serialize = x => x + } else if (typeof config.serialize === 'function') { + serialize = config.serialize + } else { + serialize = defaultSerialize + } + const writeFailHandler = config.writeFailHandler || null + + // initialize stateful values + let lastState = {} + let stagedState = {} + let keysToProcess = [] + let timeIterator: ?IntervalID = null + let writePromise = null + + const update = (state: Object) => { + // add any changed keys to the queue + Object.keys(state).forEach(key => { + if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop + if (lastState[key] === state[key]) return // value unchanged? noop + if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop + keysToProcess.push(key) // add key to queue + }) + + //if any key is missing in the new state which was present in the lastState, + //add it for processing too + Object.keys(lastState).forEach(key => { + if ( + state[key] === undefined && + passWhitelistBlacklist(key) && + keysToProcess.indexOf(key) === -1 && + lastState[key] !== undefined + ) { + keysToProcess.push(key) + } + }) + + // start the time iterator if not running (read: throttle) + if (timeIterator === null) { + timeIterator = setInterval(processNextKey, throttle) + } + + lastState = state + } + + function processNextKey() { + if (keysToProcess.length === 0) { + if (timeIterator) clearInterval(timeIterator) + timeIterator = null + return + } + + let key = keysToProcess.shift() + let endState = transforms.reduce((subState, transformer) => { + return transformer.in(subState, key, lastState) + }, lastState[key]) + + if (endState !== undefined) { + try { + stagedState[key] = serialize(endState) + } catch (err) { + console.error( + 'redux-persist/createPersistoid: error serializing state', + err + ) + } + } else { + //if the endState is undefined, no need to persist the existing serialized content + delete stagedState[key] + } + + if (keysToProcess.length === 0) { + writeStagedState() + } + } + + function writeStagedState() { + // cleanup any removed keys just before write. + Object.keys(stagedState).forEach(key => { + if (lastState[key] === undefined) { + delete stagedState[key] + } + }) + + writePromise = storage + .setItem(storageKey, serialize(stagedState)) + .catch(onWriteFail) + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') + return false + if (blacklist && blacklist.indexOf(key) !== -1) return false + return true + } + + function onWriteFail(err) { + // @TODO add fail handlers (typically storage full) + if (writeFailHandler) writeFailHandler(err) + if (err && process.env.NODE_ENV !== 'production') { + console.error('Error storing data', err) + } + } + + const flush = () => { + while (keysToProcess.length !== 0) { + processNextKey() + } + return writePromise || Promise.resolve() + } + + // return `persistoid` + return { + update, + flush, + } +} + +// @NOTE in the future this may be exposed via config +function defaultSerialize(data) { + return JSON.stringify(data) +} diff --git a/node_modules/redux-persist/src/createTransform.js b/node_modules/redux-persist/src/createTransform.js new file mode 100644 index 00000000..04a97338 --- /dev/null +++ b/node_modules/redux-persist/src/createTransform.js @@ -0,0 +1,34 @@ +// @flow + +type TransformConfig = { + whitelist?: Array, + blacklist?: Array, +} + +export default function createTransform( + // @NOTE inbound: transform state coming from redux on its way to being serialized and stored + inbound: ?Function, + // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux + outbound: ?Function, + config: TransformConfig = {} +) { + let whitelist = config.whitelist || null + let blacklist = config.blacklist || null + + function whitelistBlacklistCheck(key) { + if (whitelist && whitelist.indexOf(key) === -1) return true + if (blacklist && blacklist.indexOf(key) !== -1) return true + return false + } + + return { + in: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && inbound + ? inbound(state, key, fullState) + : state, + out: (state: Object, key: string, fullState: Object) => + !whitelistBlacklistCheck(key) && outbound + ? outbound(state, key, fullState) + : state, + } +} diff --git a/node_modules/redux-persist/src/getStoredState.js b/node_modules/redux-persist/src/getStoredState.js new file mode 100644 index 00000000..e28db0d3 --- /dev/null +++ b/node_modules/redux-persist/src/getStoredState.js @@ -0,0 +1,50 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function getStoredState( + config: PersistConfig +): Promise { + const transforms = config.transforms || [] + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + const storage = config.storage + const debug = config.debug + let deserialize + if (config.deserialize === false) { + deserialize = x => x + } else if (typeof config.deserialize === 'function') { + deserialize = config.deserialize + } else { + deserialize = defaultDeserialize + } + return storage.getItem(storageKey).then(serialized => { + if (!serialized) return undefined + else { + try { + let state = {} + let rawState = deserialize(serialized) + Object.keys(rawState).forEach(key => { + state[key] = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, rawState) + }, deserialize(rawState[key])) + }) + return state + } catch (err) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + `redux-persist/getStoredState: Error restoring data ${serialized}`, + err + ) + throw err + } + } + }) +} + +function defaultDeserialize(serial) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/src/index.js b/node_modules/redux-persist/src/index.js new file mode 100644 index 00000000..0d9c0482 --- /dev/null +++ b/node_modules/redux-persist/src/index.js @@ -0,0 +1,12 @@ +// @flow + +export { default as persistReducer } from './persistReducer' +export { default as persistCombineReducers } from './persistCombineReducers' +export { default as persistStore } from './persistStore' +export { default as createMigrate } from './createMigrate' +export { default as createTransform } from './createTransform' +export { default as getStoredState } from './getStoredState' +export { default as createPersistoid } from './createPersistoid' +export { default as purgeStoredState } from './purgeStoredState' + +export * from './constants' diff --git a/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js new file mode 100644 index 00000000..b41828f2 --- /dev/null +++ b/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js @@ -0,0 +1,184 @@ +// @flow + +import getStoredStateV5 from '../getStoredState' + +import type { PersistConfig, Transform } from '../types' + +type V4Config = { + storage?: Object, + serialize: boolean, + keyPrefix?: string, + transforms?: Array, + blacklist?: Array, + whitelist?: Array, +} + +export default function getStoredState(v4Config: V4Config) { + return function(v5Config: PersistConfig) { + return getStoredStateV5(v5Config).then(state => { + if (state) return state + else return getStoredStateV4(v4Config) + }) + } +} + +const KEY_PREFIX = 'reduxPersist:' + +function hasLocalStorage() { + if (typeof self !== 'object' || !('localStorage' in self)) { + return false + } + + try { + let storage = self.localStorage + const testKey = `redux-persist localStorage test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist localStorage test failed, persistence will be disabled.` + ) + return false + } + return true +} + +let noop = (...args: any) => { + /* noop */ return null +} +const noStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, + getAllKeys: noop, +} +const createAsyncLocalStorage = () => { + if (!hasLocalStorage()) return noStorage + let localStorage = self.localStorage + return { + getAllKeys: function(cb) { + try { + var keys = [] + for (var i = 0; i < localStorage.length; i++) { + keys.push(localStorage.key(i)) + } + cb(null, keys) + } catch (e) { + cb(e) + } + }, + getItem(key, cb) { + try { + var s = localStorage.getItem(key) + cb(null, s) + } catch (e) { + cb(e) + } + }, + setItem(key, string, cb) { + try { + localStorage.setItem(key, string) + cb(null) + } catch (e) { + cb(e) + } + }, + removeItem(key, cb) { + try { + localStorage.removeItem(key) + cb && cb(null) + } catch (e) { + cb(e) + } + }, + } +} + +function getStoredStateV4(v4Config: V4Config) { + return new Promise((resolve, reject) => { + let storage = v4Config.storage || createAsyncLocalStorage() + const deserializer = + v4Config.serialize === false + ? data => data + : (serial: string) => JSON.parse(serial) + const blacklist = v4Config.blacklist || [] + const whitelist = v4Config.whitelist || false + const transforms = v4Config.transforms || [] + const keyPrefix = + v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX + + // fallback getAllKeys to `keys` if present (LocalForage compatability) + if (storage.keys && !storage.getAllKeys) + storage = { ...storage, getAllKeys: storage.keys } + + let restoredState = {} + let completionCount = 0 + + storage.getAllKeys((err, allKeys = []) => { + if (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error in storage.getAllKeys' + ) + return reject(err) + } + + let persistKeys = allKeys + .filter(key => key.indexOf(keyPrefix) === 0) + .map(key => key.slice(keyPrefix.length)) + let keysToRestore = persistKeys.filter(passWhitelistBlacklist) + + let restoreCount = keysToRestore.length + if (restoreCount === 0) resolve(undefined) + keysToRestore.forEach(key => { + storage.getItem(createStorageKey(key), (err, serialized) => { + if (err && process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + else restoredState[key] = rehydrate(key, serialized) + completionCount += 1 + if (completionCount === restoreCount) resolve(restoredState) + }) + }) + }) + + function rehydrate(key: string, serialized: ?string) { + let state = null + + try { + let data = serialized ? deserializer(serialized) : undefined + state = transforms.reduceRight((subState, transformer) => { + return transformer.out(subState, key, {}) + }, data) + } catch (err) { + if (process.env.NODE_ENV !== 'production') + console.warn( + 'redux-persist/getStoredState: Error restoring data for key:', + key, + err + ) + } + + return state + } + + function passWhitelistBlacklist(key) { + if (whitelist && whitelist.indexOf(key) === -1) return false + if (blacklist.indexOf(key) !== -1) return false + return true + } + + function createStorageKey(key) { + return `${keyPrefix}${key}` + } + }) +} + +function defaultDeserializer(serial: string) { + return JSON.parse(serial) +} diff --git a/node_modules/redux-persist/src/integration/react.js b/node_modules/redux-persist/src/integration/react.js new file mode 100644 index 00000000..18d397a3 --- /dev/null +++ b/node_modules/redux-persist/src/integration/react.js @@ -0,0 +1,66 @@ +// @flow +import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved +import type { Node } from 'react' // eslint-disable-line import/no-unresolved +import type { Persistor } from '../types' + +type Props = { + onBeforeLift?: Function, + children: Node | Function, + loading: Node, + persistor: Persistor, +} + +type State = { + bootstrapped: boolean, +} + +export class PersistGate extends PureComponent { + static defaultProps = { + children: null, + loading: null, + } + + state = { + bootstrapped: false, + } + _unsubscribe: ?Function + + componentDidMount() { + this._unsubscribe = this.props.persistor.subscribe( + this.handlePersistorState + ) + this.handlePersistorState() + } + + handlePersistorState = () => { + const { persistor } = this.props + let { bootstrapped } = persistor.getState() + if (bootstrapped) { + if (this.props.onBeforeLift) { + Promise.resolve(this.props.onBeforeLift()) + .finally(() => this.setState({ bootstrapped: true })) + } else { + this.setState({ bootstrapped: true }) + } + this._unsubscribe && this._unsubscribe() + } + } + + componentWillUnmount() { + this._unsubscribe && this._unsubscribe() + } + + render() { + if (process.env.NODE_ENV !== 'production') { + if (typeof this.props.children === 'function' && this.props.loading) + console.error( + 'redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored.' + ) + } + if (typeof this.props.children === 'function') { + return this.props.children(this.state.bootstrapped) + } + + return this.state.bootstrapped ? this.props.children : this.props.loading + } +} diff --git a/node_modules/redux-persist/src/persistCombineReducers.js b/node_modules/redux-persist/src/persistCombineReducers.js new file mode 100644 index 00000000..a4b8cc5d --- /dev/null +++ b/node_modules/redux-persist/src/persistCombineReducers.js @@ -0,0 +1,25 @@ +// @flow + +import { combineReducers } from 'redux' +import persistReducer from './persistReducer' +import autoMergeLevel2 from './stateReconciler/autoMergeLevel2' + +import type { PersistConfig } from './types' + +type Reducers = { + [key: string]: Function, +} + +type Reducer = (state: Object, action: Object) => Object + +// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 +export default function persistCombineReducers( + config: PersistConfig, + reducers: Reducers +): Reducer { + config.stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel2 + : config.stateReconciler + return persistReducer(config, combineReducers(reducers)) +} diff --git a/node_modules/redux-persist/src/persistReducer.js b/node_modules/redux-persist/src/persistReducer.js new file mode 100644 index 00000000..cf8d980f --- /dev/null +++ b/node_modules/redux-persist/src/persistReducer.js @@ -0,0 +1,201 @@ +// @flow +import { + FLUSH, + PAUSE, + PERSIST, + PURGE, + REHYDRATE, + DEFAULT_VERSION, +} from './constants' + +import type { + PersistConfig, + MigrationManifest, + PersistState, + Persistoid, +} from './types' + +import autoMergeLevel1 from './stateReconciler/autoMergeLevel1' +import createPersistoid from './createPersistoid' +import defaultGetStoredState from './getStoredState' +import purgeStoredState from './purgeStoredState' + +type PersistPartial = { _persist: PersistState } +const DEFAULT_TIMEOUT = 5000 +/* + @TODO add validation / handling for: + - persisting a reducer which has nested _persist + - handling actions that fire before reydrate is called +*/ +export default function persistReducer( + config: PersistConfig, + baseReducer: (State, Action) => State +): (State, Action) => State & PersistPartial { + if (process.env.NODE_ENV !== 'production') { + if (!config) throw new Error('config is required for persistReducer') + if (!config.key) throw new Error('key is required in persistor config') + if (!config.storage) + throw new Error( + "redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`" + ) + } + + const version = + config.version !== undefined ? config.version : DEFAULT_VERSION + const debug = config.debug || false + const stateReconciler = + config.stateReconciler === undefined + ? autoMergeLevel1 + : config.stateReconciler + const getStoredState = config.getStoredState || defaultGetStoredState + const timeout = + config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT + let _persistoid = null + let _purge = false + let _paused = true + const conditionalUpdate = state => { + // update the persistoid only if we are rehydrated and not paused + state._persist.rehydrated && + _persistoid && + !_paused && + _persistoid.update(state) + return state + } + + return (state: State, action: Action) => { + let { _persist, ...rest } = state || {} + // $FlowIgnore need to update State type + let restState: State = rest + + if (action.type === PERSIST) { + let _sealed = false + let _rehydrate = (payload, err) => { + // dev warning if we are already sealed + if (process.env.NODE_ENV !== 'production' && _sealed) + console.error( + `redux-persist: rehydrate for "${ + config.key + }" called after timeout.`, + payload, + err + ) + + // only rehydrate if we are not already sealed + if (!_sealed) { + action.rehydrate(config.key, payload, err) + _sealed = true + } + } + timeout && + setTimeout(() => { + !_sealed && + _rehydrate( + undefined, + new Error( + `redux-persist: persist timed out for persist key "${ + config.key + }"` + ) + ) + }, timeout) + + // @NOTE PERSIST resumes if paused. + _paused = false + + // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set + if (!_persistoid) _persistoid = createPersistoid(config) + + // @NOTE PERSIST can be called multiple times, noop after the first + if (_persist) { + // We still need to call the base reducer because there might be nested + // uses of persistReducer which need to be aware of the PERSIST action + return { + ...baseReducer(restState, action), + _persist, + }; + } + + if ( + typeof action.rehydrate !== 'function' || + typeof action.register !== 'function' + ) + throw new Error( + 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.' + ) + + action.register(config.key) + + getStoredState(config).then( + restoredState => { + const migrate = config.migrate || ((s, v) => Promise.resolve(s)) + migrate(restoredState, version).then( + migratedState => { + _rehydrate(migratedState) + }, + migrateErr => { + if (process.env.NODE_ENV !== 'production' && migrateErr) + console.error('redux-persist: migration error', migrateErr) + _rehydrate(undefined, migrateErr) + } + ) + }, + err => { + _rehydrate(undefined, err) + } + ) + + return { + ...baseReducer(restState, action), + _persist: { version, rehydrated: false }, + } + } else if (action.type === PURGE) { + _purge = true + action.result(purgeStoredState(config)) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === FLUSH) { + action.result(_persistoid && _persistoid.flush()) + return { + ...baseReducer(restState, action), + _persist, + } + } else if (action.type === PAUSE) { + _paused = true + } else if (action.type === REHYDRATE) { + // noop on restState if purging + if (_purge) + return { + ...restState, + _persist: { ..._persist, rehydrated: true }, + } + + // @NOTE if key does not match, will continue to default else below + if (action.key === config.key) { + let reducedState = baseReducer(restState, action) + let inboundState = action.payload + // only reconcile state if stateReconciler and inboundState are both defined + let reconciledRest: State = + stateReconciler !== false && inboundState !== undefined + ? stateReconciler(inboundState, state, reducedState, config) + : reducedState + + let newState = { + ...reconciledRest, + _persist: { ..._persist, rehydrated: true }, + } + return conditionalUpdate(newState) + } + } + + // if we have not already handled PERSIST, straight passthrough + if (!_persist) return baseReducer(state, action) + + // run base reducer: + // is state modified ? return original : return updated + let newState = baseReducer(restState, action) + if (newState === restState) return state + return conditionalUpdate({ ...newState, _persist }) + } +} diff --git a/node_modules/redux-persist/src/persistStore.js b/node_modules/redux-persist/src/persistStore.js new file mode 100644 index 00000000..f1267534 --- /dev/null +++ b/node_modules/redux-persist/src/persistStore.js @@ -0,0 +1,130 @@ +// @flow + +import type { + Persistor, + PersistConfig, + PersistorOptions, + PersistorState, + MigrationManifest, + RehydrateAction, + RehydrateErrorType, +} from './types' + +import { createStore } from 'redux' +import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants' + +type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig] +type Persist = (PersistConfig, MigrationManifest) => R => R +type CreatePersistor = Object => void +type BoostrappedCb = () => any + +const initialState: PersistorState = { + registry: [], + bootstrapped: false, +} + +const persistorReducer = (state = initialState, action) => { + switch (action.type) { + case REGISTER: + return { ...state, registry: [...state.registry, action.key] } + case REHYDRATE: + let firstIndex = state.registry.indexOf(action.key) + let registry = [...state.registry] + registry.splice(firstIndex, 1) + return { ...state, registry, bootstrapped: registry.length === 0 } + default: + return state + } +} + +export default function persistStore( + store: Object, + options?: ?PersistorOptions, + cb?: BoostrappedCb +): Persistor { + // help catch incorrect usage of passing PersistConfig in as PersistorOptions + if (process.env.NODE_ENV !== 'production') { + let optionsToTest: Object = options || {} + let bannedKeys = [ + 'blacklist', + 'whitelist', + 'transforms', + 'storage', + 'keyPrefix', + 'migrate', + ] + bannedKeys.forEach(k => { + if (!!optionsToTest[k]) + console.error( + `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.` + ) + }) + } + let boostrappedCb = cb || false + + let _pStore = createStore( + persistorReducer, + initialState, + options && options.enhancer ? options.enhancer : undefined + ) + let register = (key: string) => { + _pStore.dispatch({ + type: REGISTER, + key, + }) + } + + let rehydrate = (key: string, payload: Object, err: any) => { + let rehydrateAction = { + type: REHYDRATE, + payload, + err, + key, + } + // dispatch to `store` to rehydrate and `persistor` to track result + store.dispatch(rehydrateAction) + _pStore.dispatch(rehydrateAction) + if (boostrappedCb && persistor.getState().bootstrapped) { + boostrappedCb() + boostrappedCb = false + } + } + + let persistor: Persistor = { + ..._pStore, + purge: () => { + let results = [] + store.dispatch({ + type: PURGE, + result: purgeResult => { + results.push(purgeResult) + }, + }) + return Promise.all(results) + }, + flush: () => { + let results = [] + store.dispatch({ + type: FLUSH, + result: flushResult => { + results.push(flushResult) + }, + }) + return Promise.all(results) + }, + pause: () => { + store.dispatch({ + type: PAUSE, + }) + }, + persist: () => { + store.dispatch({ type: PERSIST, register, rehydrate }) + }, + } + + if (!(options && options.manualPersist)){ + persistor.persist() + } + + return persistor +} diff --git a/node_modules/redux-persist/src/purgeStoredState.js b/node_modules/redux-persist/src/purgeStoredState.js new file mode 100644 index 00000000..e6619a89 --- /dev/null +++ b/node_modules/redux-persist/src/purgeStoredState.js @@ -0,0 +1,22 @@ +// @flow + +import type { PersistConfig } from './types' + +import { KEY_PREFIX } from './constants' + +export default function purgeStoredState(config: PersistConfig) { + const storage = config.storage + const storageKey = `${ + config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX + }${config.key}` + return storage.removeItem(storageKey, warnIfRemoveError) +} + +function warnIfRemoveError(err) { + if (err && process.env.NODE_ENV !== 'production') { + console.error( + 'redux-persist/purgeStoredState: Error purging data stored state', + err + ) + } +} diff --git a/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js new file mode 100644 index 00000000..880f28a1 --- /dev/null +++ b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js @@ -0,0 +1,50 @@ +// @flow + +/* + autoMergeLevel1: + - merges 1 level of substate + - skips substate if already modified +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel1( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + // otherwise hard set the new value + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} diff --git a/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js new file mode 100644 index 00000000..f451380e --- /dev/null +++ b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js @@ -0,0 +1,60 @@ +// @flow + +/* + autoMergeLevel2: + - merges 2 level of substate + - skips substate if already modified + - this is essentially redux-perist v4 behavior +*/ + +import type { PersistConfig } from '../types' + +export default function autoMergeLevel2( + inboundState: State, + originalState: State, + reducedState: State, + { debug }: PersistConfig +): State { + let newState = { ...reducedState } + // only rehydrate if inboundState exists and is an object + if (inboundState && typeof inboundState === 'object') { + Object.keys(inboundState).forEach(key => { + // ignore _persist data + if (key === '_persist') return + // if reducer modifies substate, skip auto rehydration + if (originalState[key] !== reducedState[key]) { + if (process.env.NODE_ENV !== 'production' && debug) + console.log( + 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', + key + ) + return + } + if (isPlainEnoughObject(reducedState[key])) { + // if object is plain enough shallow merge the new values (hence "Level2") + newState[key] = { ...newState[key], ...inboundState[key] } + return + } + // otherwise hard set + newState[key] = inboundState[key] + }) + } + + if ( + process.env.NODE_ENV !== 'production' && + debug && + inboundState && + typeof inboundState === 'object' + ) + console.log( + `redux-persist/stateReconciler: rehydrated keys '${Object.keys( + inboundState + ).join(', ')}'` + ) + + return newState +} + +function isPlainEnoughObject(o) { + return o !== null && !Array.isArray(o) && typeof o === 'object' +} diff --git a/node_modules/redux-persist/src/stateReconciler/hardSet.js b/node_modules/redux-persist/src/stateReconciler/hardSet.js new file mode 100644 index 00000000..1f5fcda1 --- /dev/null +++ b/node_modules/redux-persist/src/stateReconciler/hardSet.js @@ -0,0 +1,10 @@ +// @flow + +/* + hardSet: + - hard set incoming state +*/ + +export default function hardSet(inboundState: State): State { + return inboundState +} diff --git a/node_modules/redux-persist/src/storage/createWebStorage.js b/node_modules/redux-persist/src/storage/createWebStorage.js new file mode 100644 index 00000000..b77132cc --- /dev/null +++ b/node_modules/redux-persist/src/storage/createWebStorage.js @@ -0,0 +1,23 @@ +// @flow +import getStorage from './getStorage' + +export default function createWebStorage(type: string) { + let storage = getStorage(type) + return { + getItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.getItem(key)) + }) + }, + setItem: (key: string, item: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.setItem(key, item)) + }) + }, + removeItem: (key: string): Promise => { + return new Promise((resolve, reject) => { + resolve(storage.removeItem(key)) + }) + }, + } +} diff --git a/node_modules/redux-persist/src/storage/getStorage.js b/node_modules/redux-persist/src/storage/getStorage.js new file mode 100644 index 00000000..802ddc51 --- /dev/null +++ b/node_modules/redux-persist/src/storage/getStorage.js @@ -0,0 +1,44 @@ +// @flow + +import type { Storage } from '../types' + +function noop() {} +let noopStorage = { + getItem: noop, + setItem: noop, + removeItem: noop, +} + +function hasStorage(storageType) { + if (typeof self !== 'object' || !(storageType in self)) { + return false + } + + try { + let storage = self[storageType] + const testKey = `redux-persist ${storageType} test` + storage.setItem(testKey, 'test') + storage.getItem(testKey) + storage.removeItem(testKey) + } catch (e) { + if (process.env.NODE_ENV !== 'production') + console.warn( + `redux-persist ${storageType} test failed, persistence will be disabled.` + ) + return false + } + return true +} + +export default function getStorage(type: string): Storage { + const storageType = `${type}Storage` + if (hasStorage(storageType)) return self[storageType] + else { + if (process.env.NODE_ENV !== 'production') { + console.error( + `redux-persist failed to create sync storage. falling back to noop storage.` + ) + } + return noopStorage + } +} diff --git a/node_modules/redux-persist/src/storage/index.js b/node_modules/redux-persist/src/storage/index.js new file mode 100644 index 00000000..0532b1fb --- /dev/null +++ b/node_modules/redux-persist/src/storage/index.js @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('local') diff --git a/node_modules/redux-persist/src/storage/session.js b/node_modules/redux-persist/src/storage/session.js new file mode 100644 index 00000000..1bb16d60 --- /dev/null +++ b/node_modules/redux-persist/src/storage/session.js @@ -0,0 +1,5 @@ +// @flow + +import createWebStorage from './createWebStorage' + +export default createWebStorage('session') diff --git a/node_modules/redux-persist/src/types.js b/node_modules/redux-persist/src/types.js new file mode 100644 index 00000000..c50d3cd3 --- /dev/null +++ b/node_modules/redux-persist/src/types.js @@ -0,0 +1,89 @@ +// @flow +import { REHYDRATE, REGISTER } from './constants' + +export type PersistState = { + version: number, + rehydrated: boolean, +} + +export type PersistedState = { + _persist: PersistState, +} | void + +export type PersistConfig = { + version?: number, + storage: Object, + key: string, + keyPrefix?: string, // @TODO remove in v6 + blacklist?: Array, + whitelist?: Array, + transforms?: Array, + throttle?: number, + migrate?: (PersistedState, number) => Promise, + stateReconciler?: false | Function, + getStoredState?: PersistConfig => Promise, // used for migrations + debug?: boolean, + serialize?: boolean | Function, + deserialize?: boolean | Function, + timeout?: number, + writeFailHandler?: Function, +} + +export type PersistorOptions = { + enhancer?: Function, + manualPersist?: boolean +} + +export type Storage = { + getItem: (string, ?(string) => any) => any, + setItem: (string, string, ?() => any) => any, + removeItem: (string, ?() => any) => any, +} + +export type MigrationManifest = { + [number | string]: (PersistedState) => PersistedState, +} + +export type Transform = { + in: (Object | string, string, Object | string) => Object, + out: (Object | string, string, Object | string) => Object, + config?: PersistConfig, +} + +export type RehydrateErrorType = any + +export type RehydrateAction = { + type: typeof REHYDRATE, + key: string, + payload: ?Object, + err: ?RehydrateErrorType, +} + +export type Persistoid = { + update: Object => void, + flush: () => Promise, +} + +type RegisterAction = { + type: typeof REGISTER, + key: string, +} + +type PersistorAction = RehydrateAction | RegisterAction + +export type PersistorState = { + registry: Array, + bootstrapped: boolean, +} + +type PersistorSubscribeCallback = () => any + +export type Persistor = { + pause: () => void, + persist: () => void, + purge: () => Promise, + flush: () => Promise, + +dispatch: PersistorAction => PersistorAction, + +getState: () => PersistorState, + +subscribe: PersistorSubscribeCallback => () => any, +} diff --git a/node_modules/redux-persist/types/constants.d.ts b/node_modules/redux-persist/types/constants.d.ts new file mode 100644 index 00000000..6a0e4038 --- /dev/null +++ b/node_modules/redux-persist/types/constants.d.ts @@ -0,0 +1,14 @@ +declare module "redux-persist/es/constants" { + const KEY_PREFIX: 'persist:'; + const FLUSH: 'persist/FLUSH'; + const REHYDRATE: 'persist/REHYDRATE'; + const PAUSE: 'persist/PAUSE'; + const PERSIST: 'persist/PERSIST'; + const PURGE: 'persist/PURGE'; + const REGISTER: 'persist/REGISTER'; + const DEFAULT_VERSION: number; +} + +declare module "redux-persist/lib/constants" { + export * from "redux-persist/es/constants"; +} diff --git a/node_modules/redux-persist/types/createMigrate.d.ts b/node_modules/redux-persist/types/createMigrate.d.ts new file mode 100644 index 00000000..2c1329da --- /dev/null +++ b/node_modules/redux-persist/types/createMigrate.d.ts @@ -0,0 +1,20 @@ +declare module "redux-persist/es/createMigrate" { + import { MigrationManifest, PersistMigrate, PersistedState } from "redux-persist/es/types"; + + interface MigrationConfig { + debug: boolean; + } + + /** + * @desc Creates a migration path for your app's state. + * @param migrations migration manifest + * @param config migration configuration + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export default function createMigrate(migrations: MigrationManifest, config?: MigrationConfig): PersistMigrate; +} + +declare module "redux-persist/lib/createMigrate" { + export * from "redux-persist/es/createMigrate"; + export { default } from "redux-persist/es/createMigrate"; +} diff --git a/node_modules/redux-persist/types/createPersistoid.d.ts b/node_modules/redux-persist/types/createPersistoid.d.ts new file mode 100644 index 00000000..74e91bc1 --- /dev/null +++ b/node_modules/redux-persist/types/createPersistoid.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/createPersistoid" { + import { PersistConfig, Persistoid } from "redux-persist/es/types"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function createPersistoid(config: PersistConfig): Persistoid; +} + +declare module "redux-persist/lib/createPersistoid" { + export * from "redux-persist/es/createPersistoid"; + export { default } from "redux-persist/es/createPersistoid"; +} diff --git a/node_modules/redux-persist/types/createTransform.d.ts b/node_modules/redux-persist/types/createTransform.d.ts new file mode 100644 index 00000000..84bdbc36 --- /dev/null +++ b/node_modules/redux-persist/types/createTransform.d.ts @@ -0,0 +1,20 @@ +declare module "redux-persist/es/createTransform" { + import { PersistConfig, Transform, TransformInbound, TransformOutbound } from "redux-persist/es/types"; + + interface TransformConfig { + whitelist?: Array; + blacklist?: Array; + } + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function createTransform( + inbound?: TransformInbound | null, + outbound?: TransformOutbound | null, + config?: TransformConfig, + ): Transform; +} + +declare module "redux-persist/lib/createTransform" { + export * from "redux-persist/es/createTransform"; + export { default } from "redux-persist/es/createTransform"; +} diff --git a/node_modules/redux-persist/types/getStoredState.d.ts b/node_modules/redux-persist/types/getStoredState.d.ts new file mode 100644 index 00000000..e3ec1621 --- /dev/null +++ b/node_modules/redux-persist/types/getStoredState.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/getStoredState" { + import { PersistConfig } from "redux-persist/es/types"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function getStoredState(config: PersistConfig): Promise; +} + +declare module "redux-persist/lib/getStoredState" { + export * from "redux-persist/es/getStoredState"; + export { default } from "redux-persist/es/getStoredState"; +} diff --git a/node_modules/redux-persist/types/index.d.ts b/node_modules/redux-persist/types/index.d.ts new file mode 100644 index 00000000..801a1f70 --- /dev/null +++ b/node_modules/redux-persist/types/index.d.ts @@ -0,0 +1,38 @@ +// Definitions by: Junyoung Clare Jang +// TypeScript Version: 2.3 + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +// This is not single module. There are many module included by reference directives. +// tslint:disable-next-line: no-single-declare-module +declare module "redux-persist" { + export { default as persistReducer } from 'redux-persist/es/persistReducer'; + export { default as persistCombineReducers } from 'redux-persist/es/persistCombineReducers'; + export { default as persistStore } from 'redux-persist/es/persistStore'; + export { default as createMigrate } from 'redux-persist/es/createMigrate'; + export { default as createTransform } from 'redux-persist/es/createTransform'; + export { default as getStoredState } from 'redux-persist/es/getStoredState'; + export { default as createPersistoid } from 'redux-persist/es/createPersistoid'; + export { default as purgeStoredState } from 'redux-persist/es/purgeStoredState'; + + export * from "redux-persist/es/constants"; + export * from "redux-persist/es/types"; +} diff --git a/node_modules/redux-persist/types/integration/getStoredStateMigrateV4.d.ts b/node_modules/redux-persist/types/integration/getStoredStateMigrateV4.d.ts new file mode 100644 index 00000000..6297d7ec --- /dev/null +++ b/node_modules/redux-persist/types/integration/getStoredStateMigrateV4.d.ts @@ -0,0 +1,25 @@ +declare module "redux-persist/es/integration/getStoredStateMigrateV4" { + import { PersistConfig, Transform } from "redux-persist/es/types"; + + interface V4Storage { + keys?(cb: (err: any, allKeys: Array) => any): any; + getAllKeys?(cb: (err: any, allKeys: Array) => any): any; + getItem?(cb: (err: any, serialized?: string | null) => any): any; + } + + interface V4Config { + storage?: V4Storage; + keyPrefix?: string; + transforms?: Array>; + blacklist?: Array; + whitelist?: Array; + } + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function getStoredState(v4Config: V4Config): (config: PersistConfig) => Promise; +} + +declare module "redux-persist/lib/integration/getStoredStateMigrateV4" { + export * from "redux-persist/es/integration/getStoredStateMigrateV4"; + export { default } from "redux-persist/es/integration/getStoredStateMigrateV4"; +} diff --git a/node_modules/redux-persist/types/integration/react.d.ts b/node_modules/redux-persist/types/integration/react.d.ts new file mode 100644 index 00000000..7c467506 --- /dev/null +++ b/node_modules/redux-persist/types/integration/react.d.ts @@ -0,0 +1,33 @@ +declare module "redux-persist/integration/react" { + import { ReactNode, PureComponent } from "react"; + import { Persistor } from "redux-persist/es/types"; + + /** @see PersistGate */ + interface PersistGateProps { + persistor: Persistor; + onBeforeLift?(): void | Promise; + children?: ReactNode | ((bootstrapped: boolean) => ReactNode); + loading?: ReactNode; + } + + /** @see PersistGate */ + interface PersistorGateState { + bootstrapped: boolean; + } + + /** + * Entry point of your react application to allow it persist a given store @see Persistor and its configuration. + * @see Persistor + * @see PersistGateProps + * @see PersistGateState + */ + class PersistGate extends React.PureComponent {} +} + +declare module "redux-persist/es/integration/react" { + export * from "redux-persist/integration/react"; +} + +declare module "redux-persist/lib/integration/react" { + export * from "redux-persist/integration/react"; +} diff --git a/node_modules/redux-persist/types/persistCombineReducers.d.ts b/node_modules/redux-persist/types/persistCombineReducers.d.ts new file mode 100644 index 00000000..09001203 --- /dev/null +++ b/node_modules/redux-persist/types/persistCombineReducers.d.ts @@ -0,0 +1,19 @@ +declare module "redux-persist/es/persistCombineReducers" { + import { Action, Reducer, ReducersMapObject } from "redux"; + import { PersistPartial } from "redux-persist/es/persistReducer"; + import { PersistConfig } from "redux-persist/es/types"; + + /** + * @desc It provides a way of combining the reducers, replacing redux's @see combineReducers + * @param config persistence configuration + * @param reducers set of keyed functions mapping to the application state + * @returns reducer + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export default function persistCombineReducers(config: PersistConfig, reducers: ReducersMapObject): Reducer; +} + +declare module "redux-persist/lib/persistCombineReducers" { + export * from "redux-persist/es/persistCombineReducers"; + export { default } from "redux-persist/es/persistCombineReducers"; +} diff --git a/node_modules/redux-persist/types/persistReducer.d.ts b/node_modules/redux-persist/types/persistReducer.d.ts new file mode 100644 index 00000000..d56b2127 --- /dev/null +++ b/node_modules/redux-persist/types/persistReducer.d.ts @@ -0,0 +1,21 @@ +declare module "redux-persist/es/persistReducer" { + import { Action, Reducer } from "redux"; + import { PersistState, PersistConfig } from "redux-persist/es/types"; + + interface PersistPartial { + _persist: PersistState; + } + + /** + * @desc It provides a way of combining the reducers, replacing redux's @see combineReducers + * @param config persistence configuration + * @param baseReducer reducer used to persist the state + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export default function persistReducer(config: PersistConfig, baseReducer: Reducer): Reducer; +} + +declare module "redux-persist/lib/persistReducer" { + export * from "redux-persist/es/persistReducer"; + export { default } from "redux-persist/es/persistReducer"; +} diff --git a/node_modules/redux-persist/types/persistStore.d.ts b/node_modules/redux-persist/types/persistStore.d.ts new file mode 100644 index 00000000..bdcf2f32 --- /dev/null +++ b/node_modules/redux-persist/types/persistStore.d.ts @@ -0,0 +1,18 @@ +declare module "redux-persist/es/persistStore" { + import { Store } from 'redux'; + import { PersistorOptions, Persistor } from "redux-persist/es/types"; + + /** + * @desc Creates a persistor for a given store. + * @param store store to be persisted (or match an existent storage) + * @param persistorOptions enhancers of the persistor + * @param callback bootstrap callback of sort. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export default function persistStore(store: Store, persistorOptions?: PersistorOptions | null, callback?: () => any): Persistor; +} + +declare module "redux-persist/lib/persistStore" { + export * from "redux-persist/es/persistStore"; + export { default } from "redux-persist/es/persistStore"; +} diff --git a/node_modules/redux-persist/types/purgeStoredState.d.ts b/node_modules/redux-persist/types/purgeStoredState.d.ts new file mode 100644 index 00000000..5c8ce2fb --- /dev/null +++ b/node_modules/redux-persist/types/purgeStoredState.d.ts @@ -0,0 +1,14 @@ +declare module "redux-persist/es/purgeStoredState" { + import { PersistConfig } from "redux-persist/es/types"; + /** + * @desc Removes stored state. + * @param config persist configuration + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export default function purgeStoredState(config: PersistConfig): any; +} + +declare module "redux-persist/lib/purgeStoredState" { + export * from "redux-persist/es/purgeStoredState"; + export { default } from "redux-persist/es/purgeStoredState"; +} diff --git a/node_modules/redux-persist/types/stateReconciler/autoMergeLevel1.d.ts b/node_modules/redux-persist/types/stateReconciler/autoMergeLevel1.d.ts new file mode 100644 index 00000000..086e6d23 --- /dev/null +++ b/node_modules/redux-persist/types/stateReconciler/autoMergeLevel1.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/stateReconciler/autoMergeLevel1" { + import { PersistConfig } from "redux-persist"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function autoMergeLevel1(inboundState: S, originalState: S, reducedState: S, config: PersistConfig): S; +} + +declare module "redux-persist/lib/stateReconciler/autoMergeLevel1" { + export * from "redux-persist/es/stateReconciler/autoMergeLevel1"; + export { default } from "redux-persist/es/stateReconciler/autoMergeLevel1"; +} diff --git a/node_modules/redux-persist/types/stateReconciler/autoMergeLevel2.d.ts b/node_modules/redux-persist/types/stateReconciler/autoMergeLevel2.d.ts new file mode 100644 index 00000000..c8c21879 --- /dev/null +++ b/node_modules/redux-persist/types/stateReconciler/autoMergeLevel2.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/stateReconciler/autoMergeLevel2" { + import { PersistConfig } from "redux-persist"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function autoMergeLevel2(inboundState: S, originalState: S, reducedState: S, config: PersistConfig): S; +} + +declare module "redux-persist/lib/stateReconciler/autoMergeLevel2" { + export * from "redux-persist/es/stateReconciler/autoMergeLevel2"; + export { default } from "redux-persist/es/stateReconciler/autoMergeLevel2"; +} diff --git a/node_modules/redux-persist/types/stateReconciler/hardSet.d.ts b/node_modules/redux-persist/types/stateReconciler/hardSet.d.ts new file mode 100644 index 00000000..739c6a68 --- /dev/null +++ b/node_modules/redux-persist/types/stateReconciler/hardSet.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/stateReconciler/hardSet" { + import { PersistConfig } from "redux-persist"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function hardSet(inboundState: S): S; +} + +declare module "redux-persist/lib/stateReconciler/hardSet" { + export * from "redux-persist/es/stateReconciler/hardSet"; + export { default } from "redux-persist/es/stateReconciler/hardSet"; +} diff --git a/node_modules/redux-persist/types/storage/createWebStorage.d.ts b/node_modules/redux-persist/types/storage/createWebStorage.d.ts new file mode 100644 index 00000000..e82d8055 --- /dev/null +++ b/node_modules/redux-persist/types/storage/createWebStorage.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/storage/createWebStorage" { + import { WebStorage } from "redux-persist/es/types"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function createWebStorage(type: string): WebStorage; +} + +declare module "redux-persist/lib/storage/createWebStorage" { + export * from "redux-persist/es/storage/createWebStorage"; + export { default } from "redux-persist/es/storage/createWebStorage"; +} diff --git a/node_modules/redux-persist/types/storage/getStorage.d.ts b/node_modules/redux-persist/types/storage/getStorage.d.ts new file mode 100644 index 00000000..477d6555 --- /dev/null +++ b/node_modules/redux-persist/types/storage/getStorage.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/storage/getStorage" { + import { Storage } from "redux-persist/es/types"; + + // tslint:disable-next-line: strict-export-declare-modifiers + export default function getStorage(type: string): Storage; +} + +declare module "redux-persist/lib/storage/getStorage" { + export * from "redux-persist/es/storage/getStorage"; + export { default } from "redux-persist/es/storage/getStorage"; +} diff --git a/node_modules/redux-persist/types/storage/index.d.ts b/node_modules/redux-persist/types/storage/index.d.ts new file mode 100644 index 00000000..6d1e120e --- /dev/null +++ b/node_modules/redux-persist/types/storage/index.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/storage" { + import { WebStorage } from "redux-persist/es/types"; + + const localStorage: WebStorage; + export default localStorage; +} + +declare module "redux-persist/lib/storage" { + export * from "redux-persist/es/storage"; + export { default } from "redux-persist/es/storage"; +} diff --git a/node_modules/redux-persist/types/storage/session.d.ts b/node_modules/redux-persist/types/storage/session.d.ts new file mode 100644 index 00000000..c1b5cdb7 --- /dev/null +++ b/node_modules/redux-persist/types/storage/session.d.ts @@ -0,0 +1,11 @@ +declare module "redux-persist/es/storage/session" { + import { WebStorage } from "redux-persist/es/types"; + + const sessionStorage: WebStorage; + export default sessionStorage; +} + +declare module "redux-persist/lib/storage/session" { + export * from "redux-persist/es/storage/session"; + export { default } from "redux-persist/es/storage/session"; +} diff --git a/node_modules/redux-persist/types/tests/index.ts b/node_modules/redux-persist/types/tests/index.ts new file mode 100644 index 00000000..0ff502a4 --- /dev/null +++ b/node_modules/redux-persist/types/tests/index.ts @@ -0,0 +1,24 @@ +import { Reducer, createStore } from 'redux'; +import { persistReducer, persistStore } from 'redux-persist'; +import storage from 'redux-persist/lib/storage'; + +interface State { + value: string; + other: number; +} + +declare const rootReducer: Reducer; + +const persistConfig = { + key: 'root', + storage, +}; + +const persistedReducer = persistReducer(persistConfig, rootReducer); + +export default () => { + const store = createStore(persistedReducer); + const persistor = persistStore(store); + + return { store, persistor }; +}; diff --git a/node_modules/redux-persist/types/tsconfig.json b/node_modules/redux-persist/types/tsconfig.json new file mode 100644 index 00000000..3e249375 --- /dev/null +++ b/node_modules/redux-persist/types/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "lib": [ + "ES5", + "ES2015.Promise" + ], + "module": "commonjs", + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strict": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "target": "es5", + "typeRoots": [ + "../" + ], + "types": [] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ] +} diff --git a/node_modules/redux-persist/types/tslint.json b/node_modules/redux-persist/types/tslint.json new file mode 100644 index 00000000..0d3b62d3 --- /dev/null +++ b/node_modules/redux-persist/types/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "array-type": [ + true, + "generic" + ], + "file-name-casing": false, + + "no-unnecessary-generics": false + } +} diff --git a/node_modules/redux-persist/types/types.d.ts b/node_modules/redux-persist/types/types.d.ts new file mode 100644 index 00000000..b3733bc8 --- /dev/null +++ b/node_modules/redux-persist/types/types.d.ts @@ -0,0 +1,150 @@ +declare module "redux-persist/es/types" { + import { StoreEnhancer } from "redux"; + + interface PersistState { + version: number; + rehydrated: boolean; + } + + type PersistedState = { + _persist: PersistState; + } | undefined; + + type PersistMigrate = + (state: PersistedState, currentVersion: number) => Promise; + + type StateReconciler = + (inboundState: any, state: S, reducedState: S, config: PersistConfig) => S; + + /** + * @desc + * `HSS` means HydratedSubState + * `ESS` means EndSubState + * `S` means State + * `RS` means RawState + */ + interface PersistConfig { + version?: number; + storage: Storage; + key: string; + /** + * @deprecated keyPrefix is going to be removed in v6. + */ + keyPrefix?: string; + blacklist?: Array; + whitelist?: Array; + transforms?: Array>; + throttle?: number; + migrate?: PersistMigrate; + stateReconciler?: false | StateReconciler; + /** + * @desc Used for migrations. + */ + getStoredState?: (config: PersistConfig) => Promise; + debug?: boolean; + serialize?: boolean; + timeout?: number; + writeFailHandler?: (err: Error) => void; + } + + interface PersistorOptions { + enhancer?: StoreEnhancer; + } + + interface Storage { + getItem(key: string, ...args: Array): any; + setItem(key: string, value: any, ...args: Array): any; + removeItem(key: string, ...args: Array): any; + } + + interface WebStorage extends Storage { + /** + * @desc Fetches key and returns item in a promise. + */ + getItem(key: string): Promise; + /** + * @desc Sets value for key and returns item in a promise. + */ + setItem(key: string, item: string): Promise; + /** + * @desc Removes value for key. + */ + removeItem(key: string): Promise; + } + + interface MigrationManifest { + [key: string]: (state: PersistedState) => PersistedState; + } + + /** + * @desc + * `SS` means SubState + * `ESS` means EndSubState + * `S` means State + */ + type TransformInbound = + (subState: SS, key: keyof S, state: S) => ESS; + + /** + * @desc + * `SS` means SubState + * `HSS` means HydratedSubState + * `RS` means RawState + */ + type TransformOutbound = + (state: SS, key: keyof RS, rawState: RS) => HSS; + + interface Transform { + in: TransformInbound; + out: TransformOutbound; + } + + type RehydrateErrorType = any; + + interface RehydrateAction { + type: 'persist/REHYDRATE'; + key: string; + payload?: object | null; + err?: RehydrateErrorType | null; + } + + interface Persistoid { + update(state: object): void; + flush(): Promise; + } + + interface RegisterAction { + type: 'persist/REGISTER'; + key: string; + } + + type PersistorAction = + | RehydrateAction + | RegisterAction + ; + + interface PersistorState { + registry: Array; + bootstrapped: boolean; + } + + type PersistorSubscribeCallback = () => any; + + /** + * A persistor is a redux store unto itself, allowing you to purge stored state, flush all + * pending state serialization and immediately write to disk + */ + interface Persistor { + pause(): void; + persist(): void; + purge(): Promise; + flush(): Promise; + dispatch(action: PersistorAction): PersistorAction; + getState(): PersistorState; + subscribe(callback: PersistorSubscribeCallback): () => any; + } +} + +declare module "redux-persist/lib/types" { + export * from "redux-persist/es/types"; +} diff --git a/node_modules/redux-thunk/LICENSE.md b/node_modules/redux-thunk/LICENSE.md new file mode 100644 index 00000000..c108bf37 --- /dev/null +++ b/node_modules/redux-thunk/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present Dan Abramov + +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/redux-thunk/README.md b/node_modules/redux-thunk/README.md new file mode 100644 index 00000000..ddc0e5ca --- /dev/null +++ b/node_modules/redux-thunk/README.md @@ -0,0 +1,406 @@ +# Redux Thunk + +Thunk [middleware](https://redux.js.org/tutorials/fundamentals/part-4-store#middleware) for Redux. It allows writing functions with logic inside that can interact with a Redux store's `dispatch` and `getState` methods. + +For complete usage instructions and useful patterns, see the [Redux docs **Writing Logic with Thunks** page](https://redux.js.org/usage/writing-logic-thunks). + +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/reduxjs/redux-thunk/Tests) +[![npm version](https://img.shields.io/npm/v/redux-thunk.svg?style=flat-square)](https://www.npmjs.com/package/redux-thunk) +[![npm downloads](https://img.shields.io/npm/dm/redux-thunk.svg?style=flat-square)](https://www.npmjs.com/package/redux-thunk) + +## Installation and Setup + +### Redux Toolkit + +If you're using [our official Redux Toolkit package](https://redux-toolkit.js.org) as recommended, there's nothing to install - RTK's `configureStore` API already adds the thunk middleware by default: + +```js +import { configureStore } from '@reduxjs/toolkit' + +import todosReducer from './features/todos/todosSlice' +import filtersReducer from './features/filters/filtersSlice' + +const store = configureStore({ + reducer: { + todos: todosReducer, + filters: filtersReducer + } +}) + +// The thunk middleware was automatically added +``` + +### Manual Setup + +If you're using the basic Redux `createStore` API and need to set this up manually, first add the `redux-thunk` package: + +```sh +npm install redux-thunk + +yarn add redux-thunk +``` + +The thunk middleware is the default export. + +
    +More Details: Importing the thunk middleware + +If you're using ES modules: + +```js +import thunk from 'redux-thunk' // no changes here 😀 +``` + +If you use Redux Thunk 2.x in a CommonJS environment, +[don’t forget to add `.default` to your import](https://github.com/reduxjs/redux-thunk/releases/tag/v2.0.0): + +```diff +- const thunk = require('redux-thunk') ++ const thunk = require('redux-thunk').default +``` + +Additionally, since 2.x, we also support a +[UMD build](https://unpkg.com/redux-thunk/dist/redux-thunk.min.js) for use as a global script tag: + +```js +const ReduxThunk = window.ReduxThunk +``` + +
    + +Then, to enable Redux Thunk, use +[`applyMiddleware()`](https://redux.js.org/api/applymiddleware): + +```js +import { createStore, applyMiddleware } from 'redux' +import thunk from 'redux-thunk' +import rootReducer from './reducers/index' + +const store = createStore(rootReducer, applyMiddleware(thunk)) +``` + +### Injecting a Custom Argument + +Since 2.1.0, Redux Thunk supports injecting a custom argument into the thunk middleware. This is typically useful for cases like using an API service layer that could be swapped out for a mock service in tests. + +For Redux Toolkit, the `getDefaultMiddleware` callback inside of `configureStore` lets you pass in a custom `extraArgument`: + +```js +import { configureStore } from '@reduxjs/toolkit' +import rootReducer from './reducer' +import { myCustomApiService } from './api' + +const store = configureStore({ + reducer: rootReducer, + middleware: getDefaultMiddleware => + getDefaultMiddleware({ + thunk: { + extraArgument: myCustomApiService + } + }) +}) + +// later +function fetchUser(id) { + // The `extraArgument` is the third arg for thunk functions + return (dispatch, getState, api) => { + // you can use api here + } +} +``` + +If you need to pass in multiple values, combine them into a single object: + +```js +const store = configureStore({ + reducer: rootReducer, + middleware: getDefaultMiddleware => + getDefaultMiddleware({ + thunk: { + extraArgument: { + api: myCustomApiService, + otherValue: 42 + } + } + }) +}) + +// later +function fetchUser(id) { + return (dispatch, getState, { api, otherValue }) => { + // you can use api and something else here + } +} +``` + +If you're setting up the store by hand, the default `thunk` export has an attached `thunk.withExtraArgument()` function that should be used to generate the correct thunk middleware: + +```js +const store = createStore( + reducer, + applyMiddleware(thunk.withExtraArgument(api)) +) +``` + +## Why Do I Need This? + +With a plain basic Redux store, you can only do simple synchronous updates by +dispatching an action. Middleware extends the store's abilities, and lets you +write async logic that interacts with the store. + +Thunks are the recommended middleware for basic Redux side effects logic, +including complex synchronous logic that needs access to the store, and simple +async logic like AJAX requests. + +For more details on why thunks are useful, see: + +- **Redux docs: Writing Logic with Thunks** + https://redux.js.org/usage/writing-logic-thunks + The official usage guide page on thunks. Covers why they exist, how the thunk middleware works, and uesful patterns for using thunks. + +- **Stack Overflow: Dispatching Redux Actions with a Timeout** + http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559#35415559 + Dan Abramov explains the basics of managing async behavior in Redux, walking + through a progressive series of approaches (inline async calls, async action + creators, thunk middleware). + +- **Stack Overflow: Why do we need middleware for async flow in Redux?** + http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux/34599594#34599594 + Dan Abramov gives reasons for using thunks and async middleware, and some + useful patterns for using thunks. + +- **What the heck is a "thunk"?** + https://daveceddia.com/what-is-a-thunk/ + A quick explanation for what the word "thunk" means in general, and for Redux + specifically. + +- **Thunks in Redux: The Basics** + https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60 + A detailed look at what thunks are, what they solve, and how to use them. + +You may also want to read the +**[Redux FAQ entry on choosing which async middleware to use](https://redux.js.org/faq/actions#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else)**. + +While the thunk middleware is not directly included with the Redux core library, +it is used by default in our +**[`@reduxjs/toolkit` package](https://github.com/reduxjs/redux-toolkit)**. + +## Motivation + +Redux Thunk [middleware](https://redux.js.org/tutorials/fundamentals/part-4-store#middleware) +allows you to write action creators that return a function instead of an action. +The thunk can be used to delay the dispatch of an action, or to dispatch only if +a certain condition is met. The inner function receives the store methods +`dispatch` and `getState` as parameters. + +An action creator that returns a function to perform asynchronous dispatch: + +```js +const INCREMENT_COUNTER = 'INCREMENT_COUNTER' + +function increment() { + return { + type: INCREMENT_COUNTER + } +} + +function incrementAsync() { + return dispatch => { + setTimeout(() => { + // Yay! Can invoke sync or async actions with `dispatch` + dispatch(increment()) + }, 1000) + } +} +``` + +An action creator that returns a function to perform conditional dispatch: + +```js +function incrementIfOdd() { + return (dispatch, getState) => { + const { counter } = getState() + + if (counter % 2 === 0) { + return + } + + dispatch(increment()) + } +} +``` + +## What’s a thunk?! + +A [thunk](https://en.wikipedia.org/wiki/Thunk) is a function that wraps an +expression to delay its evaluation. + +```js +// calculation of 1 + 2 is immediate +// x === 3 +let x = 1 + 2 + +// calculation of 1 + 2 is delayed +// foo can be called later to perform the calculation +// foo is a thunk! +let foo = () => 1 + 2 +``` + +The term [originated](https://en.wikipedia.org/wiki/Thunk#cite_note-1) as a +humorous past-tense version of "think". + +## Composition + +Any return value from the inner function will be available as the return value +of `dispatch` itself. This is convenient for orchestrating an asynchronous +control flow with thunk action creators dispatching each other and returning +Promises to wait for each other’s completion: + +```js +import { createStore, applyMiddleware } from 'redux' +import thunk from 'redux-thunk' +import rootReducer from './reducers' + +// Note: this API requires redux@>=3.1.0 +const store = createStore(rootReducer, applyMiddleware(thunk)) + +function fetchSecretSauce() { + return fetch('https://www.google.com/search?q=secret+sauce') +} + +// These are the normal action creators you have seen so far. +// The actions they return can be dispatched without any middleware. +// However, they only express “facts” and not the “async flow”. + +function makeASandwich(forPerson, secretSauce) { + return { + type: 'MAKE_SANDWICH', + forPerson, + secretSauce + } +} + +function apologize(fromPerson, toPerson, error) { + return { + type: 'APOLOGIZE', + fromPerson, + toPerson, + error + } +} + +function withdrawMoney(amount) { + return { + type: 'WITHDRAW', + amount + } +} + +// Even without middleware, you can dispatch an action: +store.dispatch(withdrawMoney(100)) + +// But what do you do when you need to start an asynchronous action, +// such as an API call, or a router transition? + +// Meet thunks. +// A thunk in this context is a function that can be dispatched to perform async +// activity and can dispatch actions and read state. +// This is an action creator that returns a thunk: +function makeASandwichWithSecretSauce(forPerson) { + // We can invert control here by returning a function - the "thunk". + // When this function is passed to `dispatch`, the thunk middleware will intercept it, + // and call it with `dispatch` and `getState` as arguments. + // This gives the thunk function the ability to run some logic, and still interact with the store. + return function (dispatch) { + return fetchSecretSauce().then( + sauce => dispatch(makeASandwich(forPerson, sauce)), + error => dispatch(apologize('The Sandwich Shop', forPerson, error)) + ) + } +} + +// Thunk middleware lets me dispatch thunk async actions +// as if they were actions! + +store.dispatch(makeASandwichWithSecretSauce('Me')) + +// It even takes care to return the thunk’s return value +// from the dispatch, so I can chain Promises as long as I return them. + +store.dispatch(makeASandwichWithSecretSauce('My partner')).then(() => { + console.log('Done!') +}) + +// In fact I can write action creators that dispatch +// actions and async actions from other action creators, +// and I can build my control flow with Promises. + +function makeSandwichesForEverybody() { + return function (dispatch, getState) { + if (!getState().sandwiches.isShopOpen) { + // You don’t have to return Promises, but it’s a handy convention + // so the caller can always call .then() on async dispatch result. + + return Promise.resolve() + } + + // We can dispatch both plain object actions and other thunks, + // which lets us compose the asynchronous actions in a single flow. + + return dispatch(makeASandwichWithSecretSauce('My Grandma')) + .then(() => + Promise.all([ + dispatch(makeASandwichWithSecretSauce('Me')), + dispatch(makeASandwichWithSecretSauce('My wife')) + ]) + ) + .then(() => dispatch(makeASandwichWithSecretSauce('Our kids'))) + .then(() => + dispatch( + getState().myMoney > 42 + ? withdrawMoney(42) + : apologize('Me', 'The Sandwich Shop') + ) + ) + } +} + +// This is very useful for server side rendering, because I can wait +// until data is available, then synchronously render the app. + +store + .dispatch(makeSandwichesForEverybody()) + .then(() => + response.send(ReactDOMServer.renderToString()) + ) + +// I can also dispatch a thunk async action from a component +// any time its props change to load the missing data. + +import { connect } from 'react-redux' +import { Component } from 'react' + +class SandwichShop extends Component { + componentDidMount() { + this.props.dispatch(makeASandwichWithSecretSauce(this.props.forPerson)) + } + + componentDidUpdate(prevProps) { + if (prevProps.forPerson !== this.props.forPerson) { + this.props.dispatch(makeASandwichWithSecretSauce(this.props.forPerson)) + } + } + + render() { + return

    {this.props.sandwiches.join('mustard')}

    + } +} + +export default connect(state => ({ + sandwiches: state.sandwiches +}))(SandwichShop) +``` + +## License + +MIT diff --git a/node_modules/redux-thunk/dist/redux-thunk.js b/node_modules/redux-thunk/dist/redux-thunk.js new file mode 100644 index 00000000..eacc5a1a --- /dev/null +++ b/node_modules/redux-thunk/dist/redux-thunk.js @@ -0,0 +1,41 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ReduxThunk = factory()); +})(this, (function () { 'use strict'; + + /** A function that accepts a potential "extra argument" value to be injected later, + * and returns an instance of the thunk middleware that uses that value + */ + function createThunkMiddleware(extraArgument) { + // Standard Redux middleware definition pattern: + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware + var middleware = function middleware(_ref) { + var dispatch = _ref.dispatch, + getState = _ref.getState; + return function (next) { + return function (action) { + // The thunk middleware looks for any functions that were passed to `store.dispatch`. + // If this "action" is really a function, call it and return the result. + if (typeof action === 'function') { + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" + return action(dispatch, getState, extraArgument); + } // Otherwise, pass the action down the middleware chain as usual + + + return next(action); + }; + }; + }; + + return middleware; + } + + var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version + // with whatever "extra arg" they want to inject into their thunks + + thunk.withExtraArgument = createThunkMiddleware; + + return thunk; + +})); diff --git a/node_modules/redux-thunk/dist/redux-thunk.min.js b/node_modules/redux-thunk/dist/redux-thunk.min.js new file mode 100644 index 00000000..78578ccf --- /dev/null +++ b/node_modules/redux-thunk/dist/redux-thunk.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ReduxThunk=t()}(this,(function(){"use strict";function e(e){return function(t){var n=t.dispatch,u=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,u,e):t(o)}}}}var t=e();return t.withExtraArgument=e,t})); diff --git a/node_modules/redux-thunk/es/index.d.ts b/node_modules/redux-thunk/es/index.d.ts new file mode 100644 index 00000000..14812228 --- /dev/null +++ b/node_modules/redux-thunk/es/index.d.ts @@ -0,0 +1,7 @@ +import type { Action, AnyAction } from 'redux'; +import type { ThunkMiddleware } from './types'; +export type { ThunkAction, ThunkDispatch, ThunkActionDispatch, ThunkMiddleware } from './types'; +declare const thunk: ThunkMiddleware & { + withExtraArgument = AnyAction>(extraArgument: ExtraThunkArg): ThunkMiddleware; +}; +export default thunk; diff --git a/node_modules/redux-thunk/es/index.js b/node_modules/redux-thunk/es/index.js new file mode 100644 index 00000000..891fc342 --- /dev/null +++ b/node_modules/redux-thunk/es/index.js @@ -0,0 +1,32 @@ +/** A function that accepts a potential "extra argument" value to be injected later, + * and returns an instance of the thunk middleware that uses that value + */ +function createThunkMiddleware(extraArgument) { + // Standard Redux middleware definition pattern: + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware + var middleware = function middleware(_ref) { + var dispatch = _ref.dispatch, + getState = _ref.getState; + return function (next) { + return function (action) { + // The thunk middleware looks for any functions that were passed to `store.dispatch`. + // If this "action" is really a function, call it and return the result. + if (typeof action === 'function') { + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" + return action(dispatch, getState, extraArgument); + } // Otherwise, pass the action down the middleware chain as usual + + + return next(action); + }; + }; + }; + + return middleware; +} + +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version +// with whatever "extra arg" they want to inject into their thunks + +thunk.withExtraArgument = createThunkMiddleware; +export default thunk; \ No newline at end of file diff --git a/node_modules/redux-thunk/es/types.d.ts b/node_modules/redux-thunk/es/types.d.ts new file mode 100644 index 00000000..27e0aa9d --- /dev/null +++ b/node_modules/redux-thunk/es/types.d.ts @@ -0,0 +1,50 @@ +import { Action, AnyAction, Middleware } from 'redux'; +/** + * The dispatch method as modified by React-Thunk; overloaded so that you can + * dispatch: + * - standard (object) actions: `dispatch()` returns the action itself + * - thunk actions: `dispatch()` returns the thunk's return value + * + * @template State The redux state + * @template ExtraThunkArg The extra argument passed to the inner function of + * thunks (if specified when setting up the Thunk middleware) + * @template BasicAction The (non-thunk) actions that can be dispatched. + */ +export interface ThunkDispatch { + /** Accepts a thunk function, runs it, and returns whatever the thunk itself returns */ + (thunkAction: ThunkAction): ReturnType; + /** Accepts a standard action object, and returns that action object */ + (action: Action): Action; + /** A union of the other two overloads for TS inference purposes */ + (action: Action | ThunkAction): Action | ReturnType; +} +/** + * A "thunk" action (a callback function that can be dispatched to the Redux + * store.) + * + * Also known as the "thunk inner function", when used with the typical pattern + * of an action creator function that returns a thunk action. + * + * @template ReturnType The return type of the thunk's inner function + * @template State The redux state + * @template ExtraThunkArg Optional extra argument passed to the inner function + * (if specified when setting up the Thunk middleware) + * @template BasicAction The (non-thunk) actions that can be dispatched. + */ +export declare type ThunkAction = (dispatch: ThunkDispatch, getState: () => State, extraArgument: ExtraThunkArg) => ReturnType; +/** + * A generic type that takes a thunk action creator and returns a function + * signature which matches how it would appear after being processed using + * bindActionCreators(): a function that takes the arguments of the outer + * function, and returns the return type of the inner "thunk" function. + * + * @template ActionCreator Thunk action creator to be wrapped + */ +export declare type ThunkActionDispatch ThunkAction> = (...args: Parameters) => ReturnType>; +/** + * @template State The redux state + * @template BasicAction The (non-thunk) actions that can be dispatched + * @template ExtraThunkArg An optional extra argument to pass to a thunk's + * inner function. (Only used if you call `thunk.withExtraArgument()`) + */ +export declare type ThunkMiddleware = Middleware, State, ThunkDispatch>; diff --git a/node_modules/redux-thunk/extend-redux.d.ts b/node_modules/redux-thunk/extend-redux.d.ts new file mode 100644 index 00000000..94cf649b --- /dev/null +++ b/node_modules/redux-thunk/extend-redux.d.ts @@ -0,0 +1,42 @@ +import { ThunkAction } from './src/index' + +/** + * Globally alter the Redux `bindActionCreators` and `Dispatch` types to assume + * that the thunk middleware always exists, for ease of use. + * This is kept as a separate file that may be optionally imported, to + * avoid polluting the default types in case the thunk middleware is _not_ + * actually being used. + * + * To add these types to your app: + * import 'redux-thunk/extend-redux' + */ +declare module 'redux' { + /** + * Overload for bindActionCreators redux function, returns expects responses + * from thunk actions + */ + function bindActionCreators< + ActionCreators extends ActionCreatorsMapObject + >( + actionCreators: ActionCreators, + dispatch: Dispatch + ): { + [ActionCreatorName in keyof ActionCreators]: ReturnType< + ActionCreators[ActionCreatorName] + > extends ThunkAction + ? ( + ...args: Parameters + ) => ReturnType> + : ActionCreators[ActionCreatorName] + } + + /* + * Overload to add thunk support to Redux's dispatch() function. + * Useful for react-redux or any other library which could use this type. + */ + export interface Dispatch { + ( + thunkAction: ThunkAction + ): ReturnType + } +} diff --git a/node_modules/redux-thunk/lib/index.js b/node_modules/redux-thunk/lib/index.js new file mode 100644 index 00000000..99a2dc8f --- /dev/null +++ b/node_modules/redux-thunk/lib/index.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** A function that accepts a potential "extra argument" value to be injected later, + * and returns an instance of the thunk middleware that uses that value + */ +function createThunkMiddleware(extraArgument) { + // Standard Redux middleware definition pattern: + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware + var middleware = function middleware(_ref) { + var dispatch = _ref.dispatch, + getState = _ref.getState; + return function (next) { + return function (action) { + // The thunk middleware looks for any functions that were passed to `store.dispatch`. + // If this "action" is really a function, call it and return the result. + if (typeof action === 'function') { + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" + return action(dispatch, getState, extraArgument); + } // Otherwise, pass the action down the middleware chain as usual + + + return next(action); + }; + }; + }; + + return middleware; +} + +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version +// with whatever "extra arg" they want to inject into their thunks + +thunk.withExtraArgument = createThunkMiddleware; +var _default = thunk; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/redux-thunk/package.json b/node_modules/redux-thunk/package.json new file mode 100644 index 00000000..669a6e63 --- /dev/null +++ b/node_modules/redux-thunk/package.json @@ -0,0 +1,76 @@ +{ + "name": "redux-thunk", + "version": "2.4.1", + "license": "MIT", + "description": "Thunk middleware for Redux.", + "repository": "github:reduxjs/redux-thunk", + "bugs": "https://github.com/reduxjs/redux-thunk/issues", + "homepage": "https://github.com/reduxjs/redux-thunk", + "keywords": [ + "redux", + "thunk", + "middleware", + "redux-middleware", + "flux" + ], + "author": "Dan Abramov ", + "main": "lib/index.js", + "module": "es/index.js", + "types": "es/index.d.ts", + "sideEffects": false, + "files": [ + "lib", + "es", + "src", + "dist", + "extend-redux.d.ts" + ], + "scripts": { + "clean": "rimraf lib dist es", + "prepublishOnly": "npm run clean && npm run lint && npm run test && npm run build", + "format": "prettier --write {src,test,typescript_test}/**/*.{js,ts}", + "format:check": "prettier --check {src,test,typescript_test}/**/*.{js,ts}", + "lint": "eslint {src,test,typescript_test}/**/*.{js,ts}", + "test": "jest", + "test:cov": "jest --coverage", + "test:typescript": "npm run test:typescript:main && npm run test:typescript:extended", + "test:typescript:main": "tsc --noEmit -p typescript_test/tsconfig.json", + "test:typescript:extended": "tsc --noEmit -p typescript_test/typescript_extended/tsconfig.json", + "build:commonjs": "cross-env BABEL_ENV=commonjs babel src/*.ts --ignore src/types.ts --extensions .ts --out-dir lib ", + "build:es": "babel src/*.ts --ignore src/types.ts --extensions .ts --out-dir es", + "build:umd": "cross-env NODE_ENV=development rollup -c -o dist/redux-thunk.js", + "build:umd:min": "cross-env NODE_ENV=production rollup -c -o dist/redux-thunk.min.js", + "build:types": "tsc", + "build": "rimraf dist lib es && npm run build:types && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min", + "api-types": "api-extractor run --local" + }, + "peerDependencies": { + "redux": "^4" + }, + "devDependencies": { + "@babel/cli": "^7.15.7", + "@babel/core": "^7.15.8", + "@babel/preset-env": "^7.15.8", + "@babel/preset-typescript": "^7.15.0", + "@babel/register": "^7.15.3", + "@microsoft/api-extractor": "^7.18.16", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-node-resolve": "^13.0.6", + "@rollup/plugin-replace": "^3.0.0", + "@types/jest": "^27.0.2", + "@typescript-eslint/eslint-plugin": "^5.1.0", + "@typescript-eslint/parser": "^5.1.0", + "cross-env": "^7.0.3", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "jest": "^27.3.1", + "prettier": "^2.4.1", + "redux": "^4", + "rimraf": "^3.0.2", + "rollup": "^2.58.1", + "rollup-plugin-terser": "^7.0.2", + "ts-jest": "27.0.7", + "typescript": "^4.4" + } +} diff --git a/node_modules/redux-thunk/src/index.ts b/node_modules/redux-thunk/src/index.ts new file mode 100644 index 00000000..6aee4179 --- /dev/null +++ b/node_modules/redux-thunk/src/index.ts @@ -0,0 +1,53 @@ +import type { Action, AnyAction } from 'redux' + +import type { ThunkMiddleware } from './types' + +export type { + ThunkAction, + ThunkDispatch, + ThunkActionDispatch, + ThunkMiddleware +} from './types' + +/** A function that accepts a potential "extra argument" value to be injected later, + * and returns an instance of the thunk middleware that uses that value + */ +function createThunkMiddleware< + State = any, + BasicAction extends Action = AnyAction, + ExtraThunkArg = undefined +>(extraArgument?: ExtraThunkArg) { + // Standard Redux middleware definition pattern: + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware + const middleware: ThunkMiddleware = + ({ dispatch, getState }) => + next => + action => { + // The thunk middleware looks for any functions that were passed to `store.dispatch`. + // If this "action" is really a function, call it and return the result. + if (typeof action === 'function') { + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" + return action(dispatch, getState, extraArgument) + } + + // Otherwise, pass the action down the middleware chain as usual + return next(action) + } + return middleware +} + +const thunk = createThunkMiddleware() as ThunkMiddleware & { + withExtraArgument< + ExtraThunkArg, + State = any, + BasicAction extends Action = AnyAction + >( + extraArgument: ExtraThunkArg + ): ThunkMiddleware +} + +// Attach the factory function so users can create a customized version +// with whatever "extra arg" they want to inject into their thunks +thunk.withExtraArgument = createThunkMiddleware + +export default thunk diff --git a/node_modules/redux-thunk/src/types.ts b/node_modules/redux-thunk/src/types.ts new file mode 100644 index 00000000..c8eda256 --- /dev/null +++ b/node_modules/redux-thunk/src/types.ts @@ -0,0 +1,91 @@ +import { Action, AnyAction, Middleware, Dispatch } from 'redux' + +/** + * The dispatch method as modified by React-Thunk; overloaded so that you can + * dispatch: + * - standard (object) actions: `dispatch()` returns the action itself + * - thunk actions: `dispatch()` returns the thunk's return value + * + * @template State The redux state + * @template ExtraThunkArg The extra argument passed to the inner function of + * thunks (if specified when setting up the Thunk middleware) + * @template BasicAction The (non-thunk) actions that can be dispatched. + */ +export interface ThunkDispatch< + State, + ExtraThunkArg, + BasicAction extends Action +> { + // When the thunk middleware is added, `store.dispatch` now has three overloads (NOTE: the order here matters for correct behavior and is very fragile - do not reorder these!): + + // 1) The specific thunk function overload + /** Accepts a thunk function, runs it, and returns whatever the thunk itself returns */ + ( + thunkAction: ThunkAction + ): ReturnType + + // 2) The base overload. + /** Accepts a standard action object, and returns that action object */ + (action: Action): Action + + // 3) A union of the other two overloads. This overload exists to work around a problem + // with TS inference ( see https://github.com/microsoft/TypeScript/issues/14107 ) + /** A union of the other two overloads for TS inference purposes */ + ( + action: Action | ThunkAction + ): Action | ReturnType +} + +/** + * A "thunk" action (a callback function that can be dispatched to the Redux + * store.) + * + * Also known as the "thunk inner function", when used with the typical pattern + * of an action creator function that returns a thunk action. + * + * @template ReturnType The return type of the thunk's inner function + * @template State The redux state + * @template ExtraThunkArg Optional extra argument passed to the inner function + * (if specified when setting up the Thunk middleware) + * @template BasicAction The (non-thunk) actions that can be dispatched. + */ +export type ThunkAction< + ReturnType, + State, + ExtraThunkArg, + BasicAction extends Action +> = ( + dispatch: ThunkDispatch, + getState: () => State, + extraArgument: ExtraThunkArg +) => ReturnType + +/** + * A generic type that takes a thunk action creator and returns a function + * signature which matches how it would appear after being processed using + * bindActionCreators(): a function that takes the arguments of the outer + * function, and returns the return type of the inner "thunk" function. + * + * @template ActionCreator Thunk action creator to be wrapped + */ +export type ThunkActionDispatch< + ActionCreator extends (...args: any[]) => ThunkAction +> = ( + ...args: Parameters +) => ReturnType> + +/** + * @template State The redux state + * @template BasicAction The (non-thunk) actions that can be dispatched + * @template ExtraThunkArg An optional extra argument to pass to a thunk's + * inner function. (Only used if you call `thunk.withExtraArgument()`) + */ +export type ThunkMiddleware< + State = any, + BasicAction extends Action = AnyAction, + ExtraThunkArg = undefined +> = Middleware< + ThunkDispatch, + State, + ThunkDispatch +> diff --git a/package.json b/package.json index dd479d3e..9c4079fc 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ "react-multi-date-picker": "^3.3.0", "react-qr-code": "^2.0.7", "react-scripts": "5.0.1", + "redux-devtools-extension": "^2.13.9", + "redux-persist": "^6.0.0", + "redux-thunk": "^2.4.1", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/src/redux/actions/public.js b/src/redux/actions/public.js new file mode 100644 index 00000000..e69de29b diff --git a/src/redux/reducers/index.js b/src/redux/reducers/index.js new file mode 100644 index 00000000..e69de29b diff --git a/src/redux/reducers/public.js b/src/redux/reducers/public.js new file mode 100644 index 00000000..db31afb6 --- /dev/null +++ b/src/redux/reducers/public.js @@ -0,0 +1,222 @@ +import location from "../../utils/location"; + +const initialState = { + sliderList: [], + isMobile: false, + isDark: false, + homeData: [], + newProducts: [], + levels: [], + loading: false, + error: null, + searchResult: [], + arList: [], + blogList: [], + blog: null, + province: ["استان"], + city: ["شهر"], + departmans: [ + { + id: 0, + name: "محتوا", + }, + { + id: 0, + name: "دیزاین", + }, + { + id: 0, + name: "برنامه نویسی", + }, + ], + header: [], + selectedMenu: null, + contactData: null, + selectedVideo: null, + bookInfo: null, + activeCategory: null, + categories: null, + bookSection: null, + grades: + window.innerWidth >= 1024 + ? { + 0: "پیش دبستان", + 1: "اول", + 2: "دوم", + 3: "سوم", + 4: "چهارم", + 5: "پنجم", + 6: "ششم", + 7: "هفتم", + 8: "هشتم", + 9: "نهم", + 10: "دهم", + 11: "یازدهم", + 12: "دوازدهم", + } + : { + 0: "پایه تحصیلی", + 1: "اول", + 2: "دوم", + 3: "سوم", + 4: "چهارم", + 5: "پنجم", + 6: "ششم", + 7: "هفتم", + 8: "هشتم", + 9: "نهم", + 10: "دهم", + 11: "یازدهم", + 12: "دوازدهم", + }, + headerOptions: { + shown: false, + logo: false, + hamburgerMenu: false, + qr: false, + menu: false, + back: false, + title: false, + }, + desktopContentTransform: false, + overLayer: false, + provinces: [], + cities: [], + dashboardOptions: { + profile: null, + support: null, + }, +}; + +const grades = [ + "پیش دبستان", + "اول", + "دوم", + "سوم", + "چهارم", + "پنجم", + "ششم", + "هفتم", + "هشتم", + "نهم", + "دهم", + "یازدهم", + "دوازدهم", +]; + +export default function publicApi(state = initialState, action) { + let { type, data } = action; + switch (type) { + case "public/dashboard": + return { ...state, error: null, loading: false, dashboardOptions: data }; + case "public/setOverLayer": + return { ...state, overLayer: data }; + case "public/setDesktopContentTransform": + return { ...state, desktopContentTransform: data }; + case "public/setHeaderOptions": + return { ...state, headerOptions: data }; + case "public/setIsDark": + localStorage.setItem("isDark", data); + return { ...state, location: false, error: null, isDark: data }; + case "active/video": + return { + ...state, + loading: false, + error: null, + selectedVideo: data, + }; + case "active/category": + return { + ...state, + loading: false, + activeCategory: state.activeCategory === data ? null : data, + error: null, + }; + case "public/vod/bookSection": + const videoId = location.getId(); + return { + ...state, + loading: false, + bookSection: data, + error: null, + selectedVideo: data.vods?.filter((item) => item.id !== videoId)[0], + }; + case "public/vod/bookCourse": + let allCats; + allCats = Array.from( + new Set(data.vods.map((item) => item.categoryId && item.categoryId)) + ); + + return { + ...state, + loading: false, + bookInfo: { + ...data, + vods: data.vods.map((item) => { + return { ...item, active: false }; + }), + }, + error: null, + categories: allCats.map((item) => + data.vods.filter((item1) => item1.categoryId === item) + ), + selectedVideo: data.vods.filter( + (item) => item.id !== location.getId() + )[0], + }; + case "public/slider/list": + return { ...state, sliderList: data }; + case "public/homePage": + let itemsLevel; + if (window.innerWidth > 1000) { + const jadidTarin = data.filter( + (item) => item.title === "جدیدترین کتاب‌های دانوین" + ); + itemsLevel = jadidTarin[0].data + .map((item) => item.book.gradeId * 1) + .sort((a, b) => a - b) + .map((e) => grades[e]); + itemsLevel.unshift("همه"); + } + + return { + ...state, + loading: false, + levels: window.innerWidth > 1000 ? Array.from(new Set(itemsLevel)) : [], + error: null, + homeData: data, + }; + case "public/ar": + return { ...state, loading: false, error: null, arList: data }; + case "public/contact": + return { ...state, loading: false, error: null, contactData: data }; + case "public/setSubscribe": + return { ...state, loading: false, error: null, selectedSubscribe: data }; + case "public/province": + return { + ...state, + loading: false, + error: null, + province: [...state.province, ...data.map((item) => item.name)], + provinces: data, + }; + case "public/city": + return { + ...state, + loading: false, + error: null, + city: [...data.map((item) => item.name)], + cities: data, + }; + case "public/selectMenu": + return { ...state, loading: false, error: null, selectedMenu: data }; + case "public/VOD/homePage": + return { ...state, loading: false, error: null, header: data }; + case "loading": + return { ...state, loading: true }; + case "error": + return { ...state, loading: false, error: data.message }; + default: + return state; + } +} diff --git a/yarn.lock b/yarn.lock index b237822a..d7fbab0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8201,6 +8201,21 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +redux-devtools-extension@^2.13.9: + version "2.13.9" + resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.9.tgz#6b764e8028b507adcb75a1cae790f71e6be08ae7" + integrity sha512-cNJ8Q/EtjhQaZ71c8I9+BPySIBVEKssbPpskBfsXqb8HJ002A3KRVHfeRzwRo6mGPqsm7XuHTqNSNeS1Khig0A== + +redux-persist@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8" + integrity sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ== + +redux-thunk@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714" + integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q== + redux@^4.0.0, redux@^4.0.4: version "4.2.0" resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13"