{"version":3,"file":"PDF_Downloader.D3XRIZ-s.mjs","names":["React.useRef","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/g0oQdZqO54VV05Z8mvGc/rC9ue7ky7cyouROCQwyN/PDF_Downloader.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * PDF Downloader Trigger - Invisible PDF Handler Component\n *\n * Add this component as a child to any element to make it trigger PDF operations.\n * The component is completely invisible and only provides PDF functionality\n * when the parent element is clicked or keyboard shortcut is pressed.\n *\n * Features:\n * • Advanced capture controls with inclusion/exclusion options\n * • Color mode selection (RGB, Grayscale, Black & White)\n * • Keyboard shortcut support\n * • Lazy loading and fallback methods (enabled by default)\n *\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PDFDownloaderTrigger(props){const{operation=\"download\",contentSource=\"current-page\",externalUrl=\"\",uploadedDocument,captureSpecificArea=false,targetFrameName=\"\",excludeSpecificAreas=false,excludeFrameNames=\"\",outputFilename=\"document\",colorMode=\"rgb\",clickDelay=0,enableKeyboardShortcuts=false,keyboardShortcut=\"ctrl+p\"}=props;// Ref to access the component and find parent\nconst triggerRef=React.useRef(null);// Component state\nconst[operationInProgress,setOperationInProgress]=React.useState(false);const[browserEnvironment,setBrowserEnvironment]=React.useState(false);const[librariesLoaded,setLibrariesLoaded]=React.useState(false);// Environment detection\nconst currentRenderTarget=RenderTarget.current();const isDesignCanvas=currentRenderTarget===RenderTarget.canvas;// Initialize browser detection\nReact.useEffect(()=>{const isBrowser=typeof window!==\"undefined\"&&window.document;setBrowserEnvironment(isBrowser);},[]);// Sanitize filename\nconst sanitizeFilename=React.useCallback(filename=>{if(!filename||filename.trim()===\"\"){return\"document\";}return filename.trim().replace(/[<>:\"/\\\\|?*\\x00-\\x1f]/g,\"\").replace(/\\s+/g,\"_\").substring(0,100);},[]);// Enhanced library loaders with lazy loading and fallback\nconst initializePDFGenerator=React.useCallback(async()=>{if(!browserEnvironment)return null;try{if(librariesLoaded){return window.jsPDF||(await import(\"https://esm.sh/jspdf@2.5.1\")).default;}try{const lib=await import(\"https://esm.sh/jspdf@2.5.1\");setLibrariesLoaded(true);return lib.default||lib.jsPDF;}catch(err){// Fallback to CDN version\nreturn new Promise((resolve,reject)=>{const script=document.createElement(\"script\");script.src=\"https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js\";script.onload=()=>{setLibrariesLoaded(true);resolve(window.jsPDF);};script.onerror=reject;document.head.appendChild(script);});}}catch(err){return null;}},[browserEnvironment,librariesLoaded]);const initializeCanvasRenderer=React.useCallback(async()=>{if(!browserEnvironment)return null;try{try{const lib=await import(\"https://esm.sh/html2canvas@1.4.1\");return lib.default||lib.html2canvas;}catch(err){// Fallback to CDN version\nreturn new Promise((resolve,reject)=>{const script=document.createElement(\"script\");script.src=\"https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js\";script.onload=()=>resolve(window.html2canvas);script.onerror=reject;document.head.appendChild(script);});}}catch(err){// Ultimate fallback - return null, will use window.print\nreturn null;}},[browserEnvironment]);const initializePrintUtility=React.useCallback(async()=>{if(!browserEnvironment)return null;try{const lib=await import(\"https://esm.sh/print-js@1.6.0\");return lib.default||lib.printJS;}catch(err){return null;}},[browserEnvironment]);// Enhanced element finder with exclusion support\nconst findTargetElement=React.useCallback(frameName=>{if(!frameName){return document.body;}let targetElement=document.querySelector(`[data-framer-name=\"${frameName}\"]`);if(!targetElement){try{targetElement=document.querySelector(frameName);}catch(err){// Invalid selector, continue with fallback\n}}return targetElement||document.body;},[]);// Hide excluded elements during capture\nconst hideExcludedElements=React.useCallback(()=>{const hiddenElements=[];if(excludeSpecificAreas&&excludeFrameNames.trim()){const frameNames=excludeFrameNames.split(\",\").map(name=>name.trim()).filter(Boolean);frameNames.forEach(frameName=>{// Try data-framer-name first\nconst elements=document.querySelectorAll(`[data-framer-name=\"${frameName}\"]`);elements.forEach(el=>{if(el.style.display!==\"none\"){el.style.display=\"none\";el.setAttribute(\"data-pdf-hidden\",\"true\");hiddenElements.push(el);}});// Fallback to CSS selector\nif(elements.length===0){try{const cssElements=document.querySelectorAll(frameName);cssElements.forEach(el=>{if(el.style.display!==\"none\"){el.style.display=\"none\";el.setAttribute(\"data-pdf-hidden\",\"true\");hiddenElements.push(el);}});}catch(err){// Invalid selector, skip\n}}});}return hiddenElements;},[excludeSpecificAreas,excludeFrameNames]);// Restore hidden elements after capture\nconst restoreHiddenElements=React.useCallback(hiddenElements=>{hiddenElements.forEach(el=>{if(el.getAttribute(\"data-pdf-hidden\")===\"true\"){el.style.display=\"\";el.removeAttribute(\"data-pdf-hidden\");}});},[]);// Apply color mode filter to canvas\nconst applyColorModeFilter=React.useCallback(canvas=>{if(colorMode===\"rgb\")return canvas;const ctx=canvas.getContext(\"2d\");if(!ctx)return canvas;const imageData=ctx.getImageData(0,0,canvas.width,canvas.height);const data=imageData.data;for(let i=0;i<data.length;i+=4){const r=data[i];const g=data[i+1];const b=data[i+2];if(colorMode===\"grayscale\"){// Convert to grayscale using luminance formula\nconst gray=Math.round(.299*r+.587*g+.114*b);data[i]=gray// R\n;data[i+1]=gray// G\n;data[i+2]=gray// B\n;}else if(colorMode===\"blackwhite\"){// Convert to black and white (threshold at 128)\nconst gray=Math.round(.299*r+.587*g+.114*b);const bw=gray>128?255:0;data[i]=bw// R\n;data[i+1]=bw// G\n;data[i+2]=bw// B\n;}}ctx.putImageData(imageData,0,0);return canvas;},[colorMode]);// Current page download handler with SVG fix\nconst handleCurrentPageDownload=React.useCallback(async filename=>{setOperationInProgress(true);let hiddenElements=[];try{const[PDFGenerator,CanvasRenderer]=await Promise.all([initializePDFGenerator(),initializeCanvasRenderer()]);if(!PDFGenerator||!CanvasRenderer){alert(\"PDF generation unavailable. Opening print dialog instead.\");window.print();return;}// Hide excluded elements\nhiddenElements=hideExcludedElements();// Determine target element\nconst targetNode=captureSpecificArea&&targetFrameName?findTargetElement(targetFrameName):document.body;if(!targetNode){alert(\"Target element not found\");return;}// 🔧 FIXED: Added SVG <use> handling\nconst renderedCanvas=await CanvasRenderer(targetNode,{scale:2.5,useCORS:true,allowTaint:true,backgroundColor:\"#ffffff\",logging:false,// 🔧 NEW: Added onclone callback to handle SVG <use> elements\nonclone:(clonedDoc,element)=>{// Handle SVG <use> elements that reference symbols\nconst svgElements=clonedDoc.querySelectorAll(\"svg\");svgElements.forEach(svg=>{try{const useElements=svg.querySelectorAll(\"use\");useElements.forEach(useEl=>{const href=useEl.getAttribute(\"href\")||useEl.getAttribute(\"xlink:href\");if(href&&href.startsWith(\"#\")){const symbolId=href.substring(1)// Remove the #\n;// Find the symbol in the main document\nlet symbolElement=document.getElementById(symbolId);if(!symbolElement){// Also search in <defs> sections\nconst allDefs=document.querySelectorAll(\"defs\");allDefs.forEach(defs=>{const found=defs.querySelector(`#${symbolId}`);if(found)symbolElement=found;});}if(symbolElement){// Clone the symbol and create a group\nconst symbolClone=symbolElement.cloneNode(true);const group=clonedDoc.createElementNS(\"http://www.w3.org/2000/svg\",\"g\");// Get the color from the original SVG\nconst originalSvg=document.querySelector(`svg[class=\"${svg.getAttribute(\"class\")}\"]`);let fillColor=\"#ffffff\"// Default white\n;if(originalSvg){const styles=window.getComputedStyle(originalSvg);fillColor=styles.getPropertyValue(\"--21h8s6\")||styles.color||styles.fill||\"#ffffff\";}// Set the color on the group\ngroup.setAttribute(\"fill\",fillColor);// Move symbol content to group\nif(symbolClone.nodeName.toLowerCase()===\"symbol\"){// Copy children from symbol\nwhile(symbolClone.firstChild){const child=symbolClone.firstChild;// Set fill color on paths that use currentColor\nif(child.nodeType===1&&child.tagName){const childEl=child;if(childEl.getAttribute(\"fill\")===\"currentColor\"||!childEl.getAttribute(\"fill\")){childEl.setAttribute(\"fill\",fillColor);}}group.appendChild(child);}}else{group.appendChild(symbolClone);}// Replace the <use> element with our group\nuseEl.parentNode?.replaceChild(group,useEl);}else{// Fallback: create a simple shape if symbol not found\nconsole.warn(`Symbol ${symbolId} not found`);const rect=clonedDoc.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\");rect.setAttribute(\"width\",\"24\");rect.setAttribute(\"height\",\"24\");rect.setAttribute(\"fill\",\"#ffffff\");useEl.parentNode?.replaceChild(rect,useEl);}}});// Ensure SVG has proper namespace\nif(!svg.hasAttribute(\"xmlns\")){svg.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");}}catch(err){console.error(\"SVG processing error:\",err);}});// Copy <defs> sections to cloned document to ensure symbols are available\nconst originalDefs=document.querySelectorAll(\"defs\");originalDefs.forEach(def=>{const clonedDef=def.cloneNode(true);if(clonedDoc.body){clonedDoc.body.appendChild(clonedDef);}});}});// Apply color mode filter\nconst processedCanvas=applyColorModeFilter(renderedCanvas);const canvasImageData=processedCanvas.toDataURL(\"image/png\",.95);const pdfDocument=new PDFGenerator({orientation:processedCanvas.width>processedCanvas.height?\"landscape\":\"portrait\",unit:\"mm\",format:\"a4\"});const pageWidth=pdfDocument.internal.pageSize.getWidth();const scaledHeight=processedCanvas.height*pageWidth/processedCanvas.width;pdfDocument.addImage(canvasImageData,\"PNG\",0,0,pageWidth,scaledHeight);pdfDocument.save(`${filename}.pdf`);}catch(err){alert(\"PDF generation failed. Opening print dialog as fallback.\");window.print();}finally{// Always restore hidden elements\nrestoreHiddenElements(hiddenElements);setOperationInProgress(false);}},[initializePDFGenerator,initializeCanvasRenderer,hideExcludedElements,restoreHiddenElements,captureSpecificArea,targetFrameName,findTargetElement,colorMode,applyColorModeFilter]);const handleExternalDownload=React.useCallback(async filename=>{if(!externalUrl){alert(\"External PDF URL required\");return;}try{const response=await fetch(externalUrl,{mode:\"cors\",headers:{Accept:\"application/pdf\"}});if(!response.ok)throw new Error(`Request failed: ${response.status}`);const documentBlob=await response.blob();const objectUrl=URL.createObjectURL(documentBlob);const downloadLink=document.createElement(\"a\");downloadLink.href=objectUrl;downloadLink.download=`${filename}.pdf`;downloadLink.style.display=\"none\";document.body.appendChild(downloadLink);downloadLink.click();document.body.removeChild(downloadLink);setTimeout(()=>URL.revokeObjectURL(objectUrl),150);}catch(err){const fallbackLink=document.createElement(\"a\");fallbackLink.href=externalUrl;fallbackLink.download=`${filename}.pdf`;fallbackLink.target=\"_blank\";fallbackLink.click();}},[externalUrl]);const handleUploadedFileDownload=React.useCallback(async filename=>{if(!uploadedDocument){alert(\"No document uploaded\");return;}try{const response=await fetch(uploadedDocument);const blob=await response.blob();const blobUrl=URL.createObjectURL(blob);const downloadLink=document.createElement(\"a\");downloadLink.href=blobUrl;downloadLink.download=`${filename}.pdf`;downloadLink.style.display=\"none\";document.body.appendChild(downloadLink);downloadLink.click();document.body.removeChild(downloadLink);setTimeout(()=>URL.revokeObjectURL(blobUrl),150);}catch(err){const directLink=document.createElement(\"a\");directLink.href=uploadedDocument;directLink.download=`${filename}.pdf`;directLink.target=\"_blank\";directLink.click();}},[uploadedDocument]);const handleCurrentPagePrint=React.useCallback(async filename=>{let hiddenElements=[];try{// Hide excluded elements\nhiddenElements=hideExcludedElements();const targetNode=captureSpecificArea&&targetFrameName?findTargetElement(targetFrameName):document.body;if(captureSpecificArea&&targetFrameName&&targetNode!==document.body){const printUtility=await initializePrintUtility();if(printUtility){printUtility({printable:targetNode,type:\"html\",documentTitle:filename,style:`@media print { \n                            body * { visibility: hidden; } \n                            [data-framer-name=\"${targetFrameName}\"], \n                            [data-framer-name=\"${targetFrameName}\"] * { visibility: visible; } \n                            [data-framer-name=\"${targetFrameName}\"] { position: absolute; left: 0; top: 0; } \n                        }`});}else{window.print();}}else{window.print();}}catch(err){window.print();}finally{// Restore elements after a delay to allow print dialog to capture\nsetTimeout(()=>{restoreHiddenElements(hiddenElements);},1e3);}},[hideExcludedElements,restoreHiddenElements,captureSpecificArea,targetFrameName,findTargetElement,initializePrintUtility]);const handleExternalPrint=React.useCallback(async()=>{if(!externalUrl){alert(\"External PDF URL required\");return;}try{const printUtility=await initializePrintUtility();if(printUtility){printUtility({printable:externalUrl,type:\"pdf\",showModal:true,modalMessage:\"Preparing document for print...\"});}else{window.open(externalUrl,\"_blank\");}}catch(err){window.open(externalUrl,\"_blank\");}},[externalUrl,initializePrintUtility]);const handleUploadedFilePrint=React.useCallback(async()=>{if(!uploadedDocument){alert(\"No document uploaded\");return;}try{const printUtility=await initializePrintUtility();if(printUtility){printUtility(uploadedDocument,\"pdf\");}else{window.open(uploadedDocument,\"_blank\");}}catch(err){window.open(uploadedDocument,\"_blank\");}},[uploadedDocument,initializePrintUtility]);// Main operation execution function\nconst executeMainOperation=React.useCallback(async()=>{if(!browserEnvironment||isDesignCanvas||operationInProgress)return;const sanitizedFilename=sanitizeFilename(outputFilename);try{if(operation===\"download\"){if(contentSource===\"current-page\"){await handleCurrentPageDownload(sanitizedFilename);}else if(contentSource===\"external-url\"){await handleExternalDownload(sanitizedFilename);}else if(contentSource===\"uploaded-file\"){await handleUploadedFileDownload(sanitizedFilename);}}else if(operation===\"print\"){if(contentSource===\"current-page\"){await handleCurrentPagePrint(sanitizedFilename);}else if(contentSource===\"external-url\"){await handleExternalPrint();}else if(contentSource===\"uploaded-file\"){await handleUploadedFilePrint();}}}catch(err){// Silent error handling - operation will fail gracefully\n}},[browserEnvironment,isDesignCanvas,operationInProgress,operation,contentSource,sanitizeFilename,outputFilename,handleCurrentPageDownload,handleExternalDownload,handleUploadedFileDownload,handleCurrentPagePrint,handleExternalPrint,handleUploadedFilePrint]);// Keyboard shortcut handler\nReact.useEffect(()=>{if(!browserEnvironment||isDesignCanvas||!enableKeyboardShortcuts)return;const handleKeyPress=event=>{if(operationInProgress)return;const shortcut=keyboardShortcut.toLowerCase().trim();const parts=shortcut.split(\"+\").map(part=>part.trim());if(parts.length===0)return;const key=parts[parts.length-1];const modifiers=parts.slice(0,-1);// Check modifiers\nconst needsCtrl=modifiers.includes(\"ctrl\");const needsAlt=modifiers.includes(\"alt\");const needsShift=modifiers.includes(\"shift\");const needsMeta=modifiers.includes(\"meta\")||modifiers.includes(\"cmd\");// 🔧 ENHANCED: Better cross-platform detection\nconst isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform)||/Mac|iPhone|iPad|iPod/.test(navigator.userAgent);// Smart platform conversion:\n// - On Mac: \"ctrl\" becomes \"cmd\" automatically for native feel\n// - On Windows/Linux: \"ctrl\" stays \"ctrl\"\nconst actualNeedsCtrl=needsCtrl&&!isMac;const actualNeedsMeta=needsMeta||needsCtrl&&isMac;const hasRequiredModifiers=(!actualNeedsCtrl||event.ctrlKey)&&(!needsAlt||event.altKey)&&(!needsShift||event.shiftKey)&&(!actualNeedsMeta||event.metaKey);// Enhanced key matching - handle multiple formats\nconst keyLower=event.key.toLowerCase();const codeLower=event.code.toLowerCase();const keyMatch=keyLower===key||codeLower===`key${key}`||codeLower===`digit${key}`||codeLower===key||key===\"p\"&&keyLower===\"p\"||key===\"s\"&&keyLower===\"s\"||key===\"d\"&&keyLower===\"d\";if(hasRequiredModifiers&&keyMatch){event.preventDefault();event.stopPropagation();executeMainOperation();}};document.addEventListener(\"keydown\",handleKeyPress,true);return()=>{document.removeEventListener(\"keydown\",handleKeyPress,true);};},[browserEnvironment,isDesignCanvas,enableKeyboardShortcuts,keyboardShortcut,operationInProgress,executeMainOperation]);// Set up click listener\nReact.useEffect(()=>{if(!browserEnvironment||isDesignCanvas)return;const currentElement=triggerRef.current;if(!currentElement)return;const parentElement=currentElement.parentElement?.parentElement;if(!parentElement)return;const handleParentClick=event=>{if(operationInProgress)return;const executeOperation=()=>{executeMainOperation();};if(clickDelay>0){setTimeout(executeOperation,clickDelay*1e3)// ← Multiply by 1000\n;}else{executeOperation();}};parentElement.addEventListener(\"click\",handleParentClick);return()=>{parentElement.removeEventListener(\"click\",handleParentClick);};},[browserEnvironment,isDesignCanvas,operationInProgress,clickDelay,executeMainOperation]);return /*#__PURE__*/_jsx(\"div\",{ref:triggerRef,className:\"pdf-trigger-component\",style:{display:\"none\",position:\"absolute\",pointerEvents:\"none\"}});}PDFDownloaderTrigger.displayName=\"PDF Downloader Trigger\";addPropertyControls(PDFDownloaderTrigger,{operation:{title:\"PDF Operation\",description:\"Choose the action to perform when the trigger is activated\",type:ControlType.Enum,options:[\"download\",\"print\"],optionTitles:[\"Download PDF\",\"Print PDF\"],defaultValue:\"download\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},contentSource:{title:\"Content Source\",description:\"Select the content source for PDF operations\",type:ControlType.Enum,options:[\"current-page\",\"external-url\",\"uploaded-file\"],optionTitles:[\"Current Page\",\"External PDF URL\",\"Uploaded PDF File\"],defaultValue:\"current-page\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},externalUrl:{title:\"PDF Document URL\",description:\"Enter the URL of the PDF document to process\",type:ControlType.String,defaultValue:\"\",placeholder:\"https://example.com/document.pdf\",hidden:props=>props.contentSource!==\"external-url\"},uploadedDocument:{title:\"Upload PDF File\",description:\"Upload a PDF file to process when the trigger is activated\",type:ControlType.File,allowedFileTypes:[\"pdf\"],hidden:props=>props.contentSource!==\"uploaded-file\"},captureSpecificArea:{title:\"Capture Specific Area\",description:\"Enable to capture only a specific frame instead of the entire page\",type:ControlType.Boolean,defaultValue:false,hidden:props=>props.contentSource!==\"current-page\"},targetFrameName:{title:\"Target Frame Name\",description:\"Enter the name of the Framer frame you want to capture\",type:ControlType.String,defaultValue:\"\",placeholder:\"MainContent\",hidden:props=>props.contentSource!==\"current-page\"||!props.captureSpecificArea},excludeSpecificAreas:{title:\"Exclude Specific Areas\",description:\"Enable to hide specific frames during PDF capture\",type:ControlType.Boolean,defaultValue:false,hidden:props=>props.contentSource!==\"current-page\"},excludeFrameNames:{title:\"Exclude Frame Names\",description:\"Enter frame names to hide during capture (separate multiple names with commas)\",type:ControlType.String,defaultValue:\"\",placeholder:\"Navbar, Footer, Sidebar\",hidden:props=>props.contentSource!==\"current-page\"||!props.excludeSpecificAreas},colorMode:{title:\"Color Mode\",description:\"Choose the color mode for PDF generation\",type:ControlType.Enum,options:[\"rgb\",\"grayscale\",\"blackwhite\"],optionTitles:[\"Full Color (RGB)\",\"Grayscale\",\"Black & White\"],defaultValue:\"rgb\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",hidden:props=>props.contentSource!==\"current-page\"},outputFilename:{title:\"Output Filename\",description:\"Set the name for the generated or downloaded PDF file (without .pdf extension)\",type:ControlType.String,defaultValue:\"document\",placeholder:\"my-document\"},enableKeyboardShortcuts:{title:\"Enable Keyboard Shortcuts\",description:\"Allow triggering PDF operations via keyboard shortcuts\",type:ControlType.Boolean,defaultValue:false},keyboardShortcut:{title:\"Keyboard Shortcut\",description:\"Set your preferred keyboard shortcut. The component automatically adapts to your platform:\\n\\n *Windows/Linux:* 'ctrl+p' = Ctrl+P\\n *macOS:* 'ctrl+p' = Cmd+P (auto-converted)\\n\\nNo need to worry about platform differences!\",type:ControlType.String,defaultValue:\"ctrl+p\",placeholder:\"ctrl+p, ctrl+s, alt+d\",hidden:props=>!props.enableKeyboardShortcuts},clickDelay:{title:\"Click Delay (s)\",description:\"Add a delay before PDF operation executes (useful for animations). Example: Create a variant with a 1.5-second loader, then set click delay to 1.5s so the PDF downloads after the loader completes.\\n\\nMade with ❤️ by [Nitso](https://framer.link/MBYIDPK)\",type:ControlType.Number,min:0,max:10,step:.1,unit:\"s\",defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PDFDownloaderTrigger\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PDF_Downloader.map"],"mappings":"uNAgBG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,YAAU,WAAW,gBAAc,eAAe,cAAY,GAAG,mBAAiB,sBAAoB,GAAM,kBAAgB,GAAG,uBAAqB,GAAM,oBAAkB,GAAG,iBAAe,WAAW,Y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