{"version":3,"file":"Function.CCKEMZAr.mjs","names":[],"sources":["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":["/**\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":"oMAY8C,CAK9B,GAAoB,EAAU,IAAa,CAC3D,GAAG,EAAU,OAAO,EAAY,OAAO,EACvC,IAAI,IAAM,IAAM,CAAC,WAAW,QAAQ,CAAE,GAAG,EAAU,IAAM,OAAO,EAAU,IAAO,SAAS,CAE1F,IAAM,EAAO,EADO,MAAM,QAAQ,EAAU,GAAK,CAAC,EAAU,GAAK,GAAG,EAAU,GAChC,EAAW,CAAC,GAAG,EAAQ,OAAO,EAC5E,OAAO,0BCf+G,ICPkqB,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAsuC,OAAruC,MAAc,CAAC,IAA4D,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,MAAM,eAAe,SAAS,IAAI,EAAQ,SAAS,eAAe,eAAe,CAAC,GAAG,CAAC,EAAS,OAAQ,IAAM,EAAU,EAAmB,EAAM,IAAI,CAAO,EAAU,EAAmB,GAAW,EAAE,CAAC,IAAI,CAAC,IAAI,EAAS,EAAQ,iBAAiB,KAAK,CAAK,EAAc,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,EAAS,OAAO,IAAI,CAAC,IAAM,EAAQ,EAAS,GAAG,EAAQ,MAAM,SAAS,WAAW,EAAQ,mBAAmB,YAAY,mBAAmB,EAAE,mDAAmD,CAAC,EAAc,KAAK,EAAQ,UAAU,QAAQ,iBAAiB,GAAG,CAAC,CAAE,EAAS,CAAC,OAAO,EAAc,UAAW,GAAwE,OAAiE,OAAQ,EAAE,CAAC,UAAW,GAAyE,OAAmE,WAAY,GAAG,UAAW,GAAwE,OAA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