{"version":3,"file":"BackToCollectionButton.BMUNH50s.mjs","names":["React.useMemo","_Fragment","React.useCallback"],"sources":["https:/framerusercontent.com/modules/405bnogcv5omjuWLIAhx/L7qgTUYqBaTjIy9Vfapa/BackToCollectionButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * Instructions:\n * create a button to return to the collection page\n *//**\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 44\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function BackToCollectionButton(props){const{label,ariaLabel,mode,link,openInNewTab,background,textColor,border,borderRadius,padding,gap,font,icon,iconSize,iconColor,hoverOpacity,pressedScale,transition,style}=props;const isFixedWidth=style?.width===\"100%\";const isFixedHeight=style?.height===\"100%\";const normalizedHref=React.useMemo(()=>{const raw=link?.trim?.();if(!raw)return undefined;// If user enters \"collection\" instead of \"/collection\", normalize it to an absolute path\nconst looksLikeProtocol=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(raw);if(looksLikeProtocol||raw.startsWith(\"/\")||raw.startsWith(\"#\"))return raw;return\"/\"+raw;},[link]);const content=/*#__PURE__*/_jsxs(_Fragment,{children:[icon===\"leftArrow\"&&/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",style:{flex:\"0 0 auto\",color:iconColor},children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 18l-6-6 6-6\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{style:{...font,color:\"inherit\",whiteSpace:\"nowrap\",minWidth:\"max-content\",lineHeight:font?.lineHeight??\"1em\"},children:label})]});const baseStyle={position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap,padding,backgroundColor:background,color:textColor,backgroundImage:\"linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02))\",border,borderRadius,boxShadow:\"0 10px 30px rgba(0,0,0,0.18)\",backdropFilter:\"blur(12px) saturate(140%)\",WebkitBackdropFilter:\"blur(12px) saturate(140%)\",textDecoration:\"none\",cursor:\"pointer\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",width:isFixedWidth?\"100%\":\"max-content\",height:isFixedHeight?\"100%\":\"auto\",boxSizing:\"border-box\",outline:\"none\",transition:\"box-shadow 0.2s ease, background-color 0.2s ease\",...style};const handleHistoryBack=React.useCallback(e=>{if(mode!==\"history\")return;e.preventDefault();if(typeof window!==\"undefined\"){const referrer=document?.referrer;const currentHref=window.location?.href;// Prefer a real previous page (referrer) over intra-page history entries.\nif(referrer&&currentHref&&referrer!==currentHref){window.location.assign(referrer);return;}if(window.history&&window.history.length>1){window.history.go(-1);return;}// If there is no previous page in history, fall back to the provided link (if any)\nconst fallbackHref=normalizedHref;if(fallbackHref)window.location.assign(fallbackHref);}},[mode,normalizedHref]);const commonMotionProps={style:baseStyle,whileHover:{opacity:hoverOpacity,backgroundColor:\"rgba(0, 0, 0, 0.32)\",color:\"#FFFFFF\"},whileTap:{scale:pressedScale},transition};if(mode===\"history\"){return /*#__PURE__*/_jsx(motion.button,{...commonMotionProps,type:\"button\",onClick:handleHistoryBack,\"aria-label\":ariaLabel,children:content});}const safeHref=normalizedHref;return /*#__PURE__*/_jsx(motion.a,{...commonMotionProps,href:safeHref,onClick:e=>{if(!safeHref)e.preventDefault();},target:openInNewTab?\"_blank\":undefined,rel:openInNewTab?\"noreferrer noopener\":undefined,\"aria-label\":ariaLabel,children:content});}addPropertyControls(BackToCollectionButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Back to collection\"},ariaLabel:{type:ControlType.String,title:\"ARIA Label\",defaultValue:\"Return to the collection page\"},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"link\",\"history\"],optionTitles:[\"Link\",\"History Back\"],defaultValue:\"link\",displaySegmentedControl:true},link:{type:ControlType.Link,title:\"Button Link\",defaultValue:\"/collection\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:({mode})=>mode!==\"link\"},icon:{type:ControlType.Enum,title:\"Icon\",options:[\"none\",\"leftArrow\"],optionTitles:[\"None\",\"Left Arrow\"],defaultValue:\"leftArrow\",displaySegmentedControl:true},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:10,max:40,step:1,unit:\"px\",hidden:({icon})=>icon===\"none\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\",hidden:({icon})=>icon===\"none\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:32,step:1,unit:\"px\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(0, 0, 0, 0.22)\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"rgba(255, 255, 255, 0.86)\"},border:{type:ControlType.String,title:\"Border\",defaultValue:\"1px solid rgba(255, 255, 255, 0.18)\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"14px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 14px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},hoverOpacity:{type:ControlType.Number,title:\"Hover Opacity\",defaultValue:.9,min:.2,max:1,step:.01},pressedScale:{type:ControlType.Number,title:\"Pressed Scale\",defaultValue:.98,min:.9,max:1,step:.01},transition:{type:ControlType.Transition,title:\"Transition\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToCollectionButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"44\",\"framerIntrinsicWidth\":\"220\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToCollectionButton.map"],"mappings":"yPASG,SAAwB,EAAuB,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,OAAK,OAAK,eAAa,aAAW,YAAU,SAAO,eAAa,UAAQ,MAAI,OAAK,OAAK,WAAS,YAAU,eAAa,eAAa,aAAW,SAAO,EAAY,EAAa,GAAO,QAAQ,OAAa,EAAc,GAAO,SAAS,OAAa,EAAeA,MAAkB,CAAC,IAAM,EAAI,GAAM,OAAO,EAAM,KAC3P,MAAhH,4BAA4B,KAAK,CAAwB,GAAG,EAAI,WAAW,GAAG,GAAG,EAAI,WAAW,GAAG,EAAS,EAAU,IAAI,CAAI,EAAE,CAAC,CAAI,CAAC,EAAQ,EAAqB,EAAMC,EAAU,CAAC,SAAS,CAAC,IAAO,aAA0B,EAAK,MAAM,CAAC,MAAM,EAAS,OAAO,EAAS,QAAQ,YAAY,KAAK,OAAO,cAAc,OAAO,UAAU,QAAQ,MAAM,CAAC,KAAK,WAAW,MAAM,CAAS,EAAE,SAAsB,EAAK,OAAO,CAAC,EAAE,kBAAkB,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,OAAO,CAAC,CAAC,CAAC,EAAe,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAK,MAAM,UAAU,WAAW,SAAS,SAAS,cAAc,WAAW,GAAM,YAAY,KAAK,EAAE,SAAS,CAAK,CAAC,CAAC,CAAC,CAAC,EAAQ,EAAU,CAAC,SAAS,WAAW,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,MAAI,UAAQ,gBAAgB,EAAW,MAAM,EAAU,gBAAgB,0EAA0E,SAAO,eAAa,UAAU,+BAA+B,eAAe,4BAA4B,qBAAqB,4BAA4B,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