Rocky_Mountain_Vending/.pnpm-store/v10/files/a1/73a869995b4fff3b87395d1ab7fec2084ef270b93c536cc95a6a9e1902e8d51b06d36dc632a05c1ae61a71a9b1e60b7f389b863b86bbec2268b7fc13d283f9
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
10 KiB
Text

{"version":3,"sources":["../../../src/shared/lib/magic-identifier.ts"],"sourcesContent":["function decodeHex(hexStr: string): string {\n if (hexStr.trim() === '') {\n throw new Error(\"can't decode empty hex\")\n }\n\n const num = parseInt(hexStr, 16)\n if (isNaN(num)) {\n throw new Error(`invalid hex: \\`${hexStr}\\``)\n }\n\n return String.fromCodePoint(num)\n}\n\nconst enum Mode {\n Text,\n Underscore,\n Hex,\n LongHex,\n}\n\nconst DECODE_REGEX = /^__TURBOPACK__([a-zA-Z0-9_$]+)__$/\n\nexport function decodeMagicIdentifier(identifier: string): string {\n const matches = identifier.match(DECODE_REGEX)\n if (!matches) {\n return identifier\n }\n\n const inner = matches[1]\n\n let output = ''\n\n let mode: Mode = Mode.Text\n let buffer = ''\n for (let i = 0; i < inner.length; i++) {\n const char = inner[i]\n\n if (mode === Mode.Text) {\n if (char === '_') {\n mode = Mode.Underscore\n } else if (char === '$') {\n mode = Mode.Hex\n } else {\n output += char\n }\n } else if (mode === Mode.Underscore) {\n if (char === '_') {\n output += ' '\n mode = Mode.Text\n } else if (char === '$') {\n output += '_'\n mode = Mode.Hex\n } else {\n output += char\n mode = Mode.Text\n }\n } else if (mode === Mode.Hex) {\n if (buffer.length === 2) {\n output += decodeHex(buffer)\n buffer = ''\n }\n\n if (char === '_') {\n if (buffer !== '') {\n throw new Error(`invalid hex: \\`${buffer}\\``)\n }\n\n mode = Mode.LongHex\n } else if (char === '$') {\n if (buffer !== '') {\n throw new Error(`invalid hex: \\`${buffer}\\``)\n }\n\n mode = Mode.Text\n } else {\n buffer += char\n }\n } else if (mode === Mode.LongHex) {\n if (char === '_') {\n throw new Error(`invalid hex: \\`${buffer + char}\\``)\n } else if (char === '$') {\n output += decodeHex(buffer)\n buffer = ''\n\n mode = Mode.Text\n } else {\n buffer += char\n }\n }\n }\n\n return output\n}\n\nexport const MAGIC_IDENTIFIER_REGEX = /__TURBOPACK__[a-zA-Z0-9_$]+__/g\n\n/**\n * Cleans up module IDs by removing implementation details.\n * - Replaces [project] with .\n * - Removes content in brackets [], parentheses (), and angle brackets <>\n */\nexport function deobfuscateModuleId(moduleId: string): string {\n return (\n moduleId\n // Replace [project] with .\n .replace(/\\[project\\]/g, '.')\n // Remove content in square brackets (e.g. [app-rsc])\n .replace(/\\s\\[([^\\]]*)\\]/g, '')\n // Remove content in parentheses (e.g. (ecmascript))\n .replace(/\\s\\(([^)]*)\\)/g, '')\n // Remove content in angle brackets (e.g. <locals>)\n .replace(/\\s<([^>]*)>/g, '')\n // Clean up any extra whitespace\n .trim()\n )\n}\n\n/**\n * Removes the free call wrapper pattern (0, expr) from expressions.\n * This is a JavaScript pattern to call a function without binding 'this',\n * but it's noise for developers reading error messages.\n */\nexport function removeFreeCallWrapper(text: string): string {\n // Match (0, <ident>.<ident>) patterns anywhere in the text the beginning\n // Use Unicode property escapes (\\p{ID_Start}, \\p{ID_Continue}) for full JS identifier support\n // Requires the 'u' (unicode) flag in the regex\n return text.replace(\n /\\(0\\s*,\\s*(__TURBOPACK__[a-zA-Z0-9_$]+__\\.[\\p{ID_Start}_$][\\p{ID_Continue}$]*)\\)/u,\n '$1'\n )\n}\n\nexport type TextPartType = 'raw' | 'deobfuscated'\n\n/**\n * Deobfuscates text and returns an array of discriminated parts.\n * Each part is a tuple of [type, string] where type is either 'raw' (unchanged text)\n * or 'deobfuscated' (a magic identifier that was decoded).\n *\n * This is useful when you need to process or display deobfuscated and raw text differently.\n */\nexport function deobfuscateTextParts(\n text: string\n): Array<[TextPartType, string]> {\n // First, remove free call wrappers\n const withoutFreeCall = removeFreeCallWrapper(text)\n\n const parts: Array<[TextPartType, string]> = []\n let lastIndex = 0\n\n // Create a new regex instance for global matching\n const regex = new RegExp(MAGIC_IDENTIFIER_REGEX.source, 'g')\n\n for (\n let match = regex.exec(withoutFreeCall);\n match !== null;\n match = regex.exec(withoutFreeCall)\n ) {\n const matchStart = match.index\n const matchEnd = regex.lastIndex\n const ident = match[0]\n\n // Add raw text before this match (if any)\n if (matchStart > lastIndex) {\n const rawText = withoutFreeCall.substring(lastIndex, matchStart)\n parts.push(['raw', rawText])\n }\n\n // Process and add the deobfuscated part\n try {\n const decoded = decodeMagicIdentifier(ident)\n // If it was a magic identifier, clean up the module ID\n if (decoded !== ident) {\n // Check if this is an \"imported module\" reference\n const importedModuleMatch = decoded.match(/^imported module (.+)$/)\n if (importedModuleMatch) {\n // Clean the entire module path (which includes [app-rsc], etc.)\n const modulePathWithMetadata = importedModuleMatch[1]\n const cleaned = deobfuscateModuleId(modulePathWithMetadata)\n parts.push(['deobfuscated', `{imported module ${cleaned}}`])\n } else {\n const cleaned = deobfuscateModuleId(decoded)\n parts.push(['deobfuscated', `{${cleaned}}`])\n }\n } else {\n // Not actually a magic identifier, treat as raw\n parts.push(['raw', ident])\n }\n } catch (e) {\n parts.push(['deobfuscated', `{${ident} (decoding failed: ${e})}`])\n }\n\n lastIndex = matchEnd\n }\n\n // Add any remaining raw text after the last match\n if (lastIndex < withoutFreeCall.length) {\n const rawText = withoutFreeCall.substring(lastIndex)\n parts.push(['raw', rawText])\n }\n\n return parts\n}\n\n/**\n * Deobfuscates text by:\n * 1. Decoding magic identifiers\n * 2. Cleaning up module IDs\n * 3. Removing free call wrappers\n */\nexport function deobfuscateText(text: string): string {\n const parts = deobfuscateTextParts(text)\n return parts.map((part) => part[1]).join('')\n}\n"],"names":["decodeHex","hexStr","trim","Error","num","parseInt","isNaN","String","fromCodePoint","DECODE_REGEX","decodeMagicIdentifier","identifier","matches","match","inner","output","mode","buffer","i","length","char","MAGIC_IDENTIFIER_REGEX","deobfuscateModuleId","moduleId","replace","removeFreeCallWrapper","text","deobfuscateTextParts","withoutFreeCall","parts","lastIndex","regex","RegExp","source","exec","matchStart","index","matchEnd","ident","rawText","substring","push","decoded","importedModuleMatch","modulePathWithMetadata","cleaned","e","deobfuscateText","map","part","join"],"mappings":"AAAA,SAASA,UAAUC,MAAc;IAC/B,IAAIA,OAAOC,IAAI,OAAO,IAAI;QACxB,MAAM,qBAAmC,CAAnC,IAAIC,MAAM,2BAAV,qBAAA;mBAAA;wBAAA;0BAAA;QAAkC;IAC1C;IAEA,MAAMC,MAAMC,SAASJ,QAAQ;IAC7B,IAAIK,MAAMF,MAAM;QACd,MAAM,qBAAuC,CAAvC,IAAID,MAAM,CAAC,eAAe,EAAEF,OAAO,EAAE,CAAC,GAAtC,qBAAA;mBAAA;wBAAA;0BAAA;QAAsC;IAC9C;IAEA,OAAOM,OAAOC,aAAa,CAACJ;AAC9B;AASA,MAAMK,eAAe;AAErB,OAAO,SAASC,sBAAsBC,UAAkB;IACtD,MAAMC,UAAUD,WAAWE,KAAK,CAACJ;IACjC,IAAI,CAACG,SAAS;QACZ,OAAOD;IACT;IAEA,MAAMG,QAAQF,OAAO,CAAC,EAAE;IAExB,IAAIG,SAAS;IAEb,IAAIC;IACJ,IAAIC,SAAS;IACb,IAAK,IAAIC,IAAI,GAAGA,IAAIJ,MAAMK,MAAM,EAAED,IAAK;QACrC,MAAME,OAAON,KAAK,CAACI,EAAE;QAErB,IAAIF,YAAoB;YACtB,IAAII,SAAS,KAAK;gBAChBJ;YACF,OAAO,IAAII,SAAS,KAAK;gBACvBJ;YACF,OAAO;gBACLD,UAAUK;YACZ;QACF,OAAO,IAAIJ,YAA0B;YACnC,IAAII,SAAS,KAAK;gBAChBL,UAAU;gBACVC;YACF,OAAO,IAAII,SAAS,KAAK;gBACvBL,UAAU;gBACVC;YACF,O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