{"version":3,"file":"Function.De_Al4ku.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js","https:/framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m","https:/framerusercontent.com/modules/5Zw7qJ6zQVnKUBGcyIon/Ri9scuWEPSipk2U3P8Ok/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","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","/**\n * Reusable framer utilities\n * @description This file contains utility functions which can be used in any code-overides or\n * code-components in framer.\n * @author Manjunath\n * @see {@link https://manjumjn.com/}\n *//**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx}from\"react/jsx-runtime\";export default function Utilities(props){return /*#__PURE__*/_jsx(\"div\",{});}/**\n * Get element props by tag inside the component\n * @param {Object} elementProps Component props\n * @param {String} elementTag Tag of props to be returned. Eg: a, div, p\n * @returns {Object} props of the `elementTag`\n */export const getPropertiesByTag=(elemProps,elementTag)=>{// Check if the current object is of the target type\nif(elemProps.type===elementTag){return elemProps;}// Iterate through object properties that can hold nested objects (children and props)\nfor(const key of[\"children\",\"props\"]){if(elemProps[key]&&typeof elemProps[key]===\"object\"){// Check if props has more children, if so get first one\nconst childrenProps=Array.isArray(elemProps[key])?elemProps[key][0]:elemProps[key];// Recursively search for the target type within the nested object\nconst result=getPropertiesByTag(childrenProps,elementTag);if(result){return result;}}}// Not found in current object or its children/props\nreturn null;};\nexport const __FramerMetadata__ = {\"exports\":{\"getPropertiesByTag\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Utilities\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utilities.map","/*\n * Utilities\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\nexport { default } from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\n","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\";import{getPropertiesByTag}from\"https://framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m\";const useStore=createStore({titles:[],chagedLink:false,className:\"\",pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});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 _ptagProps_props,_ptagProps_props1,_atagProps_props;var html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";var content=document.getElementById(\"content-data\");if(!content){return;}const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");var headings=content.querySelectorAll(\"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,\"\"));}setStore({titles:headingsArray,pTagStyle:(ptagProps===null||ptagProps===void 0?void 0:(_ptagProps_props=ptagProps.props)===null||_ptagProps_props===void 0?void 0:_ptagProps_props.style)||{},pTagClass:(ptagProps===null||ptagProps===void 0?void 0:(_ptagProps_props1=ptagProps.props)===null||_ptagProps_props1===void 0?void 0:_ptagProps_props1.className)||\"\",aTagClass:(atagProps===null||atagProps===void 0?void 0:(_atagProps_props=atagProps.props)===null||_atagProps_props===void 0?void 0:_atagProps_props.className)||\"\"});},[]);const divStyles={display:\"flex\",flexDirection:\"column\",gap:\"12px\"};return /*#__PURE__*/_jsx(\"div\",{style:divStyles,children:Array.isArray(store.titles)?store.titles.map((element,i)=>{return element&&/*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:store.pTagStyle,children:/*#__PURE__*/_jsx(\"a\",{href:\"#title-\"+i,className:`framer-text ${store.aTagClass}`,children:element},i)});}):null});};}export function setActiveStateFromLink(Component){return props=>{const card=useRef(null);const[boolean,setBoolean]=useState(false);useEffect(()=>{var _card_current;var cardHref=(_card_current=card.current)===null||_card_current===void 0?void 0:_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\":{\"setActiveStateFromLink\":{\"type\":\"reactHoc\",\"name\":\"setActiveStateFromLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SearchShortcutKey\":{\"type\":\"reactHoc\",\"name\":\"SearchShortcutKey\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTitles\":{\"type\":\"reactHoc\",\"name\":\"getTitles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLinks\":{\"type\":\"reactHoc\",\"name\":\"getLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Function.map"],"mappings":"oLAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,EACjD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,CAAQ,CAAC,CAAE,EACjI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,EAAE,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,CAAU,GAAG,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,CAAQ,CAAC,EAAE,EACjJ,EAAa,QAAQ,GAAQ,EAAO,CAAU,CAAC,CAAE,EACjD,SAAS,GAAU,CACnB,GAAK,CAAC,EAAM,GAAUA,EAAS,CAAU,EAKzC,OAHA,OACA,EAAa,IAAI,CAAQ,MAAY,EAAa,OAAO,CAAQ,GAAI,CAAC,CAAC,EACpE,EAAe,IAAI,IAAM,EAAe,EAAQ,CAAC,EAAU,MAAM,CAAY,GAC1E,CAAC,EAAM,CAAa,CAAG,CAAC,OAAO,CAAS,iBAfT,IAAwC,oCEYhC,EAK7B,GAAoB,EAAU,IAAa,CAC3D,GAAG,EAAU,OAAO,EAAY,OAAO,EACvC,IAAI,IAAM,IAAM,CAAC,WAAW,OAAO,EAAG,GAAG,EAAU,IAAM,OAAO,EAAU,IAAO,SAAS,CAC1F,IAAM,EAAc,MAAM,QAAQ,EAAU,EAAI,EAAE,EAAU,EAAI,CAAC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