{"version":3,"file":"LanguageToggle.CKx22B9J.mjs","names":["React.useState","React.Fragment","__esmMin","init_npm_react_18_3_1","x","_e","p","c","init_jsx_runtime","init_framer_BWFVvmND","addPropertyControls","useLocaleInfo","ControlType","LanguageToggle","props","hovered","setHovered","list","locales","activeId","activeLocale","l","labelFor","code","locale","font","isActive","isHovered","index","inactiveColor","separator","setLocale","activeColor","hoverColor","init_LanguageToggle"],"sources":["https:/framerusercontent.com/modules/xRZ6lnarOfknMEcfbUko/FDmAMsBM29QNXlNfnxGr/LanguageToggle.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";/**\n * Language toggle for the nav: \"EN / NO\".\n * The active language is shown in the active colour; click the other to switch.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function LanguageToggle(props){const{font,activeColor=\"#080808\",inactiveColor=\"#737370\",hoverColor=\"#080808\",separator=\"/\",gap=6}=props;const{activeLocale,locales,setLocale}=useLocaleInfo();const[hovered,setHovered]=React.useState(null);// Fallback so the toggle is visible on the canvas before locales load\nconst list=locales&&locales.length>0?locales:[{id:\"default\",code:\"en\",name:\"English\"},{id:\"nb\",code:\"nb\",name:\"Norsk\"}];const activeId=activeLocale?.id??list.find(l=>l.id===\"default\")?.id??list[0]?.id;const labelFor=locale=>{const code=String(locale?.code||locale?.slug||locale?.name||\"\").toLowerCase().trim();if(code.startsWith(\"nb\")||code.startsWith(\"nn\")||code.startsWith(\"no\"))return\"NO\";return code.slice(0,2).toUpperCase();};return /*#__PURE__*/_jsx(\"nav\",{\"aria-label\":\"Language\",style:{display:\"flex\",alignItems:\"center\",gap,whiteSpace:\"nowrap\",...font},children:list.map((locale,index)=>{const isActive=locale.id===activeId;const isHovered=hovered===locale.id;return /*#__PURE__*/_jsxs(React.Fragment,{children:[index>0&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{color:inactiveColor},children:separator}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",lang:String(locale.code||\"\").split(\"-\")[0]||undefined,\"aria-label\":locale.name,\"aria-current\":isActive?\"true\":undefined,onClick:()=>{if(!isActive&&setLocale)setLocale(locale);},onMouseEnter:()=>setHovered(locale.id),onMouseLeave:()=>setHovered(null),style:{appearance:\"none\",background:\"none\",border:\"none\",padding:0,margin:0,font:\"inherit\",letterSpacing:\"inherit\",lineHeight:\"inherit\",cursor:isActive?\"default\":\"pointer\",color:isActive?activeColor:isHovered?hoverColor:inactiveColor,transition:\"color 0.15s ease\"},children:labelFor(locale)})]},locale.id);})});}LanguageToggle.displayName=\"Language Toggle\";addPropertyControls(LanguageToggle,{font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.3}},activeColor:{type:ControlType.Color,title:\"Active\",defaultValue:\"#080808\"},inactiveColor:{type:ControlType.Color,title:\"Inactive\",defaultValue:\"#737370\"},hoverColor:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#080808\"},separator:{type:ControlType.String,title:\"Separator\",defaultValue:\"/\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:6,min:0,max:24,step:1,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LanguageToggle\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LanguageToggle.map"],"mappings":"A,gMAMG,SAAwBa,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,cAAY,UAAU,gBAAc,UAAU,aAAW,UAAU,YAAU,IAAI,MAAI,GAAGC,EAAW,CAAC,eAAa,UAAQ,aAAWH,EAAc,EAAO,CAACI,EAAQC,GAAYhB,EAAe,IAAI,EACvPiB,EAAKC,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