UNPKG

@commercelayer/react-components

Version:
2 lines 864 B
"use client"; "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getApplicationLink=getApplicationLink;function getApplicationLink({orderId,accessToken,slug,domain,applicationType,modeType,clientId,scope,returnUrl,resetPasswordUrl,customDomain}){var _a;const env=domain==="commercelayer.io"?"":"stg.",t=applicationType==="identity"?modeType==="login"?"":"signup":"",c=clientId?`&clientId=${clientId}`:"",s=scope?`&scope=${scope}`:"",r=returnUrl?`&returnUrl=${returnUrl}`:"",p=resetPasswordUrl?`&resetPasswordUrl=${resetPasswordUrl}`:"",params=applicationType==="identity"?`${c}${s}${r}${p}`:"",domainName=customDomain??`${slug}.${env}commercelayer.app`,application=customDomain?"":`/${applicationType.toString()}`;return`https://${domainName}${application}/${(_a=orderId??t)!==null&&_a!==void 0?_a:""}?accessToken=${accessToken}${params}`}