{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/AIpN91hRihXhNwwWGBQ0/9cMsZf4PrG7DiSbTKRaT/International_Button.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withRefCode(Component){return props=>{const useRedirectUrl=()=>{const[fullUrl,setFullUrl]=useState(\"https://sca.trive.com/register/open-trading-account\");useEffect(()=>{if(typeof window!==\"undefined\"){const{pathname,search,href}=window.location;const currentParams=new URLSearchParams(search);const refCode=currentParams.get(\"refCode\");let paramString=\"\";let redirectUrl=\"https://sca.trive.com/register/open-trading-account\";if(search.includes(\"partner\")&&pathname.includes(\"/partnership\")&&pathname.match(/^\\/(afr|int-es|int-kr|int-ph|int-tw|int-hi|int-th|int)/)){const regionMap={\"/int-th\":\"https://sca-int.trive.com/th/register/open-trading-account\",\"/int-kr\":\"https://sca-int.trive.com/kr/register/open-trading-account\",\"/int-ph\":\"https://sca-int.trive.com/PH/register/open-trading-account\",\"/int-tw\":\"https://sca-int.trive.com/TW/register/open-trading-account\",\"/int-es\":\"https://sca-int.trive.com/es/register/open-trading-account\",\"/int-hi\":\"https://sca-int.trive.com/in/register/open-trading-account\",\"/int-jp\":\"https://sca-int.trive.com/jp/register/open-trading-account\",\"/int/\":\"https://sca-int.trive.com/register/open-trading-account\"};Object.keys(regionMap).forEach(region=>{if(href.includes(region)){redirectUrl=regionMap[region];}});// URL'yi ? ile gelen parametrelerle birle\u015Ftir\nconst urlParams=window.location.search// Mevcut URL'deki query string\n;if(urlParams){redirectUrl+=urlParams// Query string ekleniyor\n;}}else if(pathname.includes(\"/partnership\")&&search.includes(\"refCode\")||pathname.includes(\"/partnership\")){const languageMatch=pathname.match(/^\\/(afr|int-es|int-kr|int-ph|int-tw|int-hi|int-th|int|int-jp)/);if(languageMatch){redirectUrl=`https://www.trive.com/${languageMatch[1]}/open-account`;}else{redirectUrl=`https://go.trivepartners.com/signup/`;}const paramString=currentParams.toString();if(paramString){redirectUrl+=`?${paramString}&redirect=false`;}else{redirectUrl+=`?redirect=false`;}}else{const regionMap={\"/int-th\":\"https://sca-int.trive.com/th/register/open-trading-account\",\"/int-kr\":\"https://sca-int.trive.com/kr/register/open-trading-account\",\"/int-ph\":\"https://sca-int.trive.com/PH/register/open-trading-account\",\"/int-tw\":\"https://sca-int.trive.com/TW/register/open-trading-account\",\"/int-es\":\"https://sca-int.trive.com/es/register/open-trading-account\",\"/int-hi\":\"https://sca-int.trive.com/in/register/open-trading-account\",\"/int-jp\":\"https://sca-int.trive.com/jp/register/open-trading-account\",\"/int/\":\"https://sca-int.trive.com/register/open-trading-account\",\"/afr/\":\"https://sca-int.trive.com/register/open-trading-account\"};Object.keys(regionMap).forEach(region=>{if(href.includes(region)){redirectUrl=regionMap[region];}});const langMatch=pathname.match(/^\\/(it|fr|de|es)/);if(langMatch){redirectUrl=`https://sca.trive.com/${langMatch[1]}/register/open-trading-account`;}currentParams.forEach((value,key)=>{if(key!==\"refCode\"&&key!==\"partner\"){paramString+=`${key}=${value}&`;}});if(refCode){paramString+=`refCode=${refCode}&`;}if(paramString){redirectUrl+=`?${paramString.slice(0,-1)}`;}if(pathname.includes(\"/partnership\")){redirectUrl=\"https://go.trivepartners.com/signup/\";}}setFullUrl(redirectUrl);}},[]);const handleClick=()=>{window.location.href=fullUrl;};return{fullUrl,handleClick};};const{fullUrl,handleClick}=useRedirectUrl();function updateRegisterParams(){const newParams=new URLSearchParams(window.location.search).toString();if(newParams){localStorage.setItem(\"registerParams\",newParams);}else if(!localStorage.getItem(\"registerParams\")){localStorage.removeItem(\"registerParams\");}}return /*#__PURE__*/_jsx(Component,{...props,className:\"registerTagManager\",style:{width:\"100%\"},onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRefCode\":{\"type\":\"reactHoc\",\"name\":\"withRefCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./International_Button.map"],
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IN,EAAK,SAASM,CAAM,IAAGF,EAAYC,EAAUC,CAAM,EAAG,CAAC,EAAE,IAAMG,EAAUX,EAAS,MAAM,kBAAkB,EAAKW,IAAWL,EAAY,yBAAyBK,EAAU,CAAC,mCAAmCR,EAAc,QAAQ,CAACS,EAAMC,IAAM,CAAIA,IAAM,WAAWA,IAAM,YAAWR,GAAa,GAAGQ,KAAOD,KAAU,CAAC,EAAKR,IAASC,GAAa,WAAWD,MAAeC,IAAaC,GAAa,IAAID,EAAY,MAAM,EAAE,EAAE,KAAQL,EAAS,SAAS,cAAc,IAAGM,EAAY,wCAAyCV,EAAWU,CAAW,EAAG,EAAE,CAAC,CAAC,EAA8D,CAAC,QAAAX,EAAQ,YAAnD,IAAI,CAACI,EAAO,SAAS,KAAKJ,CAAQ,CAA4B,CAAE,EAAO,CAAC,QAAAA,EAAQ,YAAAmB,CAAW,EAAEpB,EAAe,EAAE,SAASqB,GAAsB,CAAC,IAAMC,EAAU,IAAI,gBAAgBjB,EAAO,SAAS,MAAM,EAAE,SAAS,EAAKiB,EAAW,aAAa,QAAQ,iBAAiBA,CAAS,EAAY,aAAa,QAAQ,gBAAgB,GAAG,aAAa,WAAW,gBAAgB,CAAG,CAAC,OAAoBC,EAAKzB,EAAU,CAAC,GAAGC,EAAM,UAAU,qBAAqB,MAAM,CAAC,MAAM,MAAM,EAAE,QAAQqB,CAAW,CAAC,CAAE,CAAE",
  "names": ["withRefCode", "Component", "props", "useRedirectUrl", "fullUrl", "setFullUrl", "ye", "ue", "window", "pathname", "search", "href", "currentParams", "refCode", "paramString", "redirectUrl", "regionMap", "region", "urlParams", "languageMatch", "langMatch", "value", "key", "handleClick", "updateRegisterParams", "newParams", "p"]
}
