{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/4g9vhq2MfTGWOlcnUF5u/4AoPN1Bg6hm8KL9UtuQh/Function.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({titles:[],chagedLink:false,className:\"\",textStyles:\"\",anchorStyles:\"\",subscriptionCheckbox:false,showErrorMessage:true});export function CheckIfInDocument(Component){return props=>{const compRef=useRef(null);console.log(compRef.current);return /*#__PURE__*/_jsx(Component,{...props,ref:compRef});};}export function ErrorMessage(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,style:store.showErrorMessage===true?{display:\"none\",cursor:\"not-allowed\"}:\"\"});};}export function Beehiiv(Component){return props=>{const[store,setStore]=useStore();// const handleClick = () => {\n//     console.log(\"hello it is clickable\")\n//     setStore({ showErrorMessage: true })\n// }\nreturn /*#__PURE__*/_jsx(Component,{...props,// onClick={handleClick}\nstyle:store.subscriptionCheckbox===false?{pointerEvents:\"none\",opacity:\"0.7\"}:null});};}export function BeehiivParent(Component){return props=>{const[store,setStore]=useStore();const handleClick=()=>{console.log(\"hello it is clickable\");setStore({showErrorMessage:false});};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}export function SubscriptionCheckbox(Component){return props=>{const[store,setStore]=useStore();const handleChange=e=>{if(props.onChange)props.onChange(e)// \u041F\u0435\u0440\u0435\u0434\u0430\u0454\u043C\u043E onChange \u0434\u0430\u043B\u0456, \u044F\u043A\u0449\u043E \u0454\n;setStore({subscriptionCheckbox:e.target.checked,showErrorMessage:e.target.checked===true?true:false});};// useEffect(() => {\n//     console.log(store.subscriptionCheckbox)\n// }, [store.subscriptionCheckbox])\nconst className=`${props.className||\"\"} subscription-checkbox`;return /*#__PURE__*/_jsx(Component,{...props,className:className,onChange:handleChange});};}function getSecondPart(str){return str.split(\"/\")[1];}export function getLinks(Component){return props=>{const[boolean,setBoolean]=useState(false);const[store,setStore]=useStore();const Link=useRef(null);useEffect(()=>{setBoolean(window.location.href.includes(props.link));setStore({chagedLink:true});},[]);props.className+=\" sidebar-link\";return /*#__PURE__*/_jsx(Component,{...props,variant:boolean?\"Select\":\"Default\",ref:Link});};}export function getTitles(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{var html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";var content=document.getElementById(\"content-data\");if(!content){return;}var headings=content.querySelectorAll(\"h1, h2\");var headingsArray=[];for(let i=0;i<headings.length;i++){const element=headings[i];element.style.position=\"relative\";element.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);headingsArray.push(element.innerText.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));}const textStyles=props.children[0]?.props?.children?.props.children?.props;const anchorStyles=textStyles?.children?.props.children?.props;setStore({titles:headingsArray,className:props.className,textStyles:textStyles||{},anchorStyles:anchorStyles||{}});},[]);const divStyles={display:\"flex\",flexDirection:\"column\",gap:\"12px\",fontSize:\"16px\",fontFamily:'\"Inter\", \"Inter Placeholder\", sans-serif'};return /*#__PURE__*/_jsx(\"div\",{style:divStyles,children:Array.isArray(store.titles)?store.titles.map((element,i)=>{return element&&/*#__PURE__*/_jsx(\"p\",{className:` ${store.textStyles?.className}`,children:/*#__PURE__*/_jsx(\"a\",{href:\"#title-\"+i,className:`framer-text ${store.anchorStyles?.className}`,children:element},i)});}):null});};}export function setActiveStateFromLink(Component){return props=>{const card=useRef(null);const[boolean,setBoolean]=useState(false);useEffect(()=>{var cardHref=card.current?.getAttribute(\"href\");if(!cardHref)return;setBoolean(String(window.location.href).includes(getSecondPart(String(cardHref))));},[]);props.className+=\" collection-card\";return /*#__PURE__*/_jsx(Component,{...props,ref:card,variant:boolean?\"Select\":\"Default\"});};}export function SearchShortcutKey(Component){function handleKeyDown(event){var e=event;console.log(e);console.log(e.keyCode);console.log(e.metaKey);console.log(e.key);if(e.keyCode===75&&e.altKey||// (e.keyCode === 75 && e.ctrlKey) ||\ne.keyCode===75&&e.metaKey){console.log(\"search\");var input=document.querySelector(\".search-input button\");console.log(input);input.click();}}return props=>{useEffect(()=>{document.addEventListener(\"keydown\",handleKeyDown);var input=document.querySelector(\".search-input\");console.log(input);console.log(\"useeffect\");},[]);props.className+=\" search-input\";return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"CheckIfInDocument\":{\"type\":\"reactHoc\",\"name\":\"CheckIfInDocument\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTitles\":{\"type\":\"reactHoc\",\"name\":\"getTitles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLinks\":{\"type\":\"reactHoc\",\"name\":\"getLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setActiveStateFromLink\":{\"type\":\"reactHoc\",\"name\":\"setActiveStateFromLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SearchShortcutKey\":{\"type\":\"reactHoc\",\"name\":\"SearchShortcutKey\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BeehiivParent\":{\"type\":\"reactHoc\",\"name\":\"BeehiivParent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SubscriptionCheckbox\":{\"type\":\"reactHoc\",\"name\":\"SubscriptionCheckbox\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Beehiiv\":{\"type\":\"reactHoc\",\"name\":\"Beehiiv\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ErrorMessage\":{\"type\":\"reactHoc\",\"name\":\"ErrorMessage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Function.map"],
  "mappings": "uJAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,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C,CAAC,OAAOC,IAAQC,EAAU,IAAI,CAAC,SAAS,iBAAiB,UAAUJ,CAAa,EAAE,IAAIE,EAAM,SAAS,cAAc,eAAe,EAAE,QAAQ,IAAIA,CAAK,EAAE,QAAQ,IAAI,WAAW,CAAE,EAAE,CAAC,CAAC,EAAEC,EAAM,WAAW,gBAAoCE,EAAKN,EAAU,CAAC,GAAGI,CAAK,CAAC,EAAI",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "ErrorMessage", "Component", "props", "store", "setStore", "useStore", "p", "Beehiiv", "BeehiivParent", "SubscriptionCheckbox", "handleChange", "e", "className", "getLinks", "Component", "props", "boolean", "setBoolean", "ye", "store", "setStore", "useStore", "Link", "pe", "ue", "window", "p", "getTitles", "html", "content", "headings", "headingsArray", "i", "element", "textStyles", "anchorStyles", "SearchShortcutKey", "Component", "handleKeyDown", "event", "input", "props", "ue", "p"]
}
