@saasquatch/mint-components 2.1.8-0 → 2.1.8-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ShadowViewAddon-1d15cdf7.js → ShadowViewAddon-5ce32291.js} +89 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +2 -16
- package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +329 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +158 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +143 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +90 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +462 -0
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +180 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +2 -16
- package/dist/esm/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +89 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +2 -16
- package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +333 -6
- package/dist/esm/sqm-stencilbook.entry.js +158 -1
- package/dist/esm-es5/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0f036907.system.js +1 -0
- package/dist/mint-components/{p-0e6c90b1.entry.js → p-22e39d2c.entry.js} +90 -21
- package/dist/mint-components/p-499885aa.entry.js +9 -0
- package/dist/mint-components/p-a6621899.system.entry.js +1 -0
- package/dist/mint-components/{p-e980472a.js → p-adc4e263.js} +25 -25
- package/dist/mint-components/{p-7d16ee0e.entry.js → p-b0253f4c.entry.js} +2 -2
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/p-d93e19e9.system.entry.js +1 -0
- package/dist/mint-components/p-e45a9966.system.entry.js +1 -0
- package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +13 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +41 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +80 -0
- package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +16 -0
- package/dist/types/components.d.ts +138 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +0 -1
- package/dist/mint-components/p-17b32de7.system.entry.js +0 -1
- package/dist/mint-components/p-54ea8b9b.system.entry.js +0 -1
- package/dist/mint-components/p-807ed3bf.system.js +0 -1
- package/dist/mint-components/p-de7bb373.entry.js +0 -9
- package/dist/mint-components/p-e9258d20.system.entry.js +0 -1
|
@@ -23,11 +23,11 @@ import { u as useInstantAccessRegistration } from './useInstantAccessRegistratio
|
|
|
23
23
|
import { R as RequiredPropsError, L as LEAD_FORM_STATE_CONTEXT, u as useLeadFormState } from './useLeadFormState-dd4e8b08.js';
|
|
24
24
|
import { i as isEmpty } from './utilities-77b1e0cc.js';
|
|
25
25
|
import { E as ErrorView } from './ErrorView-74cb3af8.js';
|
|
26
|
-
import { u as useDemoBigStat,
|
|
26
|
+
import { u as useDemoBigStat, W as useBigStat, B as BigStatView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, Q as LeadDropdownFieldView, O as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, U as PartnerInfoModalView, f as ChangeMarktingView, P as PortalChangePasswordView, g as PortalFooterView, h as PortalFrameView, c as BaseRegistrationFormView, R as ReferralIframeView, i as RewardExchangeView, Y as demoRewardExchange, G as useShareButton, a as ShareButtonView, J as useShareLink, S as StatContainerView, T as TaskCardView } from './ShadowViewAddon-9d97b5d5.js';
|
|
27
27
|
import './sqm-portal-container-view-a8c708cd.js';
|
|
28
|
-
import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, b as COUNTRIES_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, g as getCountryObj, c as USER_QUERY_NAMESPACE, G as GET_USER$2, d as COUNTRIES_QUERY_NAMESPACE, e as GET_COUNTRIES, h as FINANCE_NETWORK_SETTINGS_NAMESPACE, i as GET_FINANCE_NETWORK_SETTINGS, j as CURRENCIES_QUERY_NAMESPACE, k as GET_CURRENCIES, L as LoadingView } from './data-12e6aae1.js';
|
|
28
|
+
import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, U as USER_FORM_CONTEXT_NAMESPACE, C as CURRENCIES_NAMESPACE, b as COUNTRIES_NAMESPACE, S as SORTED_COUNTRIES_NAMESPACE, g as getCountryObj, c as USER_QUERY_NAMESPACE, G as GET_USER$2, d as COUNTRIES_QUERY_NAMESPACE, e as GET_COUNTRIES$1, h as FINANCE_NETWORK_SETTINGS_NAMESPACE, i as GET_FINANCE_NETWORK_SETTINGS, j as CURRENCIES_QUERY_NAMESPACE, k as GET_CURRENCIES$1, L as LoadingView } from './data-12e6aae1.js';
|
|
29
29
|
import { p as parseStates, e as extractProps } from './extractProps-54064fb0.js';
|
|
30
|
-
import { u as usePayoutStatus } from './usePayoutStatus-46c0c289.js';
|
|
30
|
+
import { T as TAX_FORM_UPDATED_EVENT_KEY, u as usePayoutStatus } from './usePayoutStatus-46c0c289.js';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
*
|
|
@@ -2833,6 +2833,333 @@ function useNavigationMenuDemo(props) {
|
|
|
2833
2833
|
}
|
|
2834
2834
|
NavigationMenu.style = sqmNavigationMenuCss;
|
|
2835
2835
|
|
|
2836
|
+
const GET_USER_PARTNER_INFO = dist.gql `
|
|
2837
|
+
query getUserPartnerInfo {
|
|
2838
|
+
user: viewer {
|
|
2839
|
+
... on User {
|
|
2840
|
+
id
|
|
2841
|
+
firstName
|
|
2842
|
+
lastName
|
|
2843
|
+
email
|
|
2844
|
+
countryCode
|
|
2845
|
+
customFields
|
|
2846
|
+
impactConnection {
|
|
2847
|
+
connected
|
|
2848
|
+
publisher {
|
|
2849
|
+
countryCode
|
|
2850
|
+
currency
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
`;
|
|
2857
|
+
const GET_COUNTRIES = dist.gql `
|
|
2858
|
+
query getCountries {
|
|
2859
|
+
impactPayoutCountries(limit: 1000) {
|
|
2860
|
+
data {
|
|
2861
|
+
countryCode
|
|
2862
|
+
displayName
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
`;
|
|
2867
|
+
const GET_CURRENCIES = dist.gql `
|
|
2868
|
+
query currencies($locale: RSLocale) {
|
|
2869
|
+
currencies(limit: 300) {
|
|
2870
|
+
data {
|
|
2871
|
+
displayName(locale: $locale)
|
|
2872
|
+
currencyCode
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
`;
|
|
2877
|
+
const CONNECT_PARTNER = dist.gql `
|
|
2878
|
+
mutation createImpactConnection($vars: ImpactConnectionInput!) {
|
|
2879
|
+
createImpactConnection(impactConnectionInput: $vars) {
|
|
2880
|
+
success
|
|
2881
|
+
validationErrors {
|
|
2882
|
+
field
|
|
2883
|
+
message
|
|
2884
|
+
}
|
|
2885
|
+
user {
|
|
2886
|
+
id
|
|
2887
|
+
accountId
|
|
2888
|
+
impactConnection {
|
|
2889
|
+
connected
|
|
2890
|
+
publisher {
|
|
2891
|
+
brandedSignup
|
|
2892
|
+
requiredTaxDocumentType
|
|
2893
|
+
currentTaxDocument {
|
|
2894
|
+
type
|
|
2895
|
+
status
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
`;
|
|
2903
|
+
const GET_BRAND_NAME = dist.gql `
|
|
2904
|
+
query getTenantSettings {
|
|
2905
|
+
tenantSettings {
|
|
2906
|
+
companyName
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
`;
|
|
2910
|
+
function usePartnerInfoModal(props) {
|
|
2911
|
+
var _a, _b, _c, _d;
|
|
2912
|
+
const user = J();
|
|
2913
|
+
const locale = L();
|
|
2914
|
+
const { data: userData, loading: userLoading, refetch, } = wn(GET_USER_PARTNER_INFO, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2915
|
+
const { data: currenciesData } = wn(GET_CURRENCIES, { variables: { locale } }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2916
|
+
const { data: countriesData } = wn(GET_COUNTRIES, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
2917
|
+
const { data: tenantSettingsData } = wn(GET_BRAND_NAME, {});
|
|
2918
|
+
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
2919
|
+
const [countryCode, setCountryCode] = useState("");
|
|
2920
|
+
const [currency, setCurrency] = useState("");
|
|
2921
|
+
const [error, setError] = useState("");
|
|
2922
|
+
const [success, setSuccess] = useState(false);
|
|
2923
|
+
console.log(user, "user identity in create partner modal"); // TEMP
|
|
2924
|
+
console.log(userData, "user data from partner info query"); // TEMP
|
|
2925
|
+
const impactConnection = (_a = userData === null || userData === void 0 ? void 0 : userData.user) === null || _a === void 0 ? void 0 : _a.impactConnection;
|
|
2926
|
+
function onCountryChange(e) {
|
|
2927
|
+
var _a, _b;
|
|
2928
|
+
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
2929
|
+
if (!value)
|
|
2930
|
+
return;
|
|
2931
|
+
setCountryCode(value);
|
|
2932
|
+
setCurrency("");
|
|
2933
|
+
setError("");
|
|
2934
|
+
}
|
|
2935
|
+
function onCurrencyChange(e) {
|
|
2936
|
+
var _a, _b;
|
|
2937
|
+
const value = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
2938
|
+
if (!value)
|
|
2939
|
+
return;
|
|
2940
|
+
setCurrency(value);
|
|
2941
|
+
setError("");
|
|
2942
|
+
}
|
|
2943
|
+
async function onSubmit() {
|
|
2944
|
+
var _a, _b;
|
|
2945
|
+
if (!countryCode || !currency) {
|
|
2946
|
+
setError(props.missingFieldsErrorText);
|
|
2947
|
+
return;
|
|
2948
|
+
}
|
|
2949
|
+
setError("");
|
|
2950
|
+
// AL TODO: How to create impact connection if we dont have address, postalCode, and city?
|
|
2951
|
+
try {
|
|
2952
|
+
const vars = {
|
|
2953
|
+
user: {
|
|
2954
|
+
id: user.id,
|
|
2955
|
+
accountId: user.accountId,
|
|
2956
|
+
},
|
|
2957
|
+
firstName: userData.user.firstName,
|
|
2958
|
+
lastName: userData.user.lastName,
|
|
2959
|
+
countryCode,
|
|
2960
|
+
currency,
|
|
2961
|
+
};
|
|
2962
|
+
const result = await connectImpactPartner({ vars });
|
|
2963
|
+
if (!result || ((_a = result) === null || _a === void 0 ? void 0 : _a.message)) {
|
|
2964
|
+
setError(props.networkErrorText);
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
const connectionResult = result
|
|
2968
|
+
.createImpactConnection;
|
|
2969
|
+
console.log(result, connectionResult, "result and connectionResult from creating partner from modal");
|
|
2970
|
+
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.success)) {
|
|
2971
|
+
const validationMsg = (_b = connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors) === null || _b === void 0 ? void 0 : _b.map((e) => e.message).join(". ");
|
|
2972
|
+
setError(validationMsg || props.networkErrorText);
|
|
2973
|
+
console.error("Failed to create Impact connection:", connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.validationErrors);
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
// Success
|
|
2977
|
+
window.dispatchEvent(new Event(TAX_FORM_UPDATED_EVENT_KEY));
|
|
2978
|
+
await refetch();
|
|
2979
|
+
setSuccess(true);
|
|
2980
|
+
}
|
|
2981
|
+
catch (e) {
|
|
2982
|
+
console.error("Partner creation error:", e);
|
|
2983
|
+
setError(props.networkErrorText);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
const shouldShow = !success && !userLoading && !(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected);
|
|
2987
|
+
return {
|
|
2988
|
+
states: {
|
|
2989
|
+
open: shouldShow,
|
|
2990
|
+
loading: userLoading,
|
|
2991
|
+
submitting: connectLoading,
|
|
2992
|
+
isExistingPartner: !!(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected),
|
|
2993
|
+
countryCode,
|
|
2994
|
+
currency,
|
|
2995
|
+
error,
|
|
2996
|
+
success,
|
|
2997
|
+
brandName: ((_b = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _b === void 0 ? void 0 : _b.companyName) || "",
|
|
2998
|
+
filteredCountries: ((_c = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _c === void 0 ? void 0 : _c.data) || [],
|
|
2999
|
+
filteredCurrencies: ((_d = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _d === void 0 ? void 0 : _d.data) || [],
|
|
3000
|
+
},
|
|
3001
|
+
callbacks: {
|
|
3002
|
+
onCountryChange,
|
|
3003
|
+
onCurrencyChange,
|
|
3004
|
+
onCountrySearch: () => { },
|
|
3005
|
+
onCurrencySearch: () => { },
|
|
3006
|
+
onSubmit,
|
|
3007
|
+
onClose: () => setSuccess(true),
|
|
3008
|
+
},
|
|
3009
|
+
text: props.getTextProps(),
|
|
3010
|
+
};
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
const PartnerInfoModal = class {
|
|
3014
|
+
constructor(hostRef) {
|
|
3015
|
+
registerInstance(this, hostRef);
|
|
3016
|
+
/**
|
|
3017
|
+
* Brand name shown in the modal header
|
|
3018
|
+
*
|
|
3019
|
+
* @uiName Brand name
|
|
3020
|
+
*/
|
|
3021
|
+
this.brandName = "";
|
|
3022
|
+
/**
|
|
3023
|
+
* Header text when user has no existing partner
|
|
3024
|
+
*
|
|
3025
|
+
* @uiName New partner header
|
|
3026
|
+
* @uiWidget textArea
|
|
3027
|
+
*/
|
|
3028
|
+
this.modalBrandHeader = "Welcome to {brandName} Program!";
|
|
3029
|
+
/**
|
|
3030
|
+
* Description for new partner setup
|
|
3031
|
+
*
|
|
3032
|
+
* @uiName New partner description
|
|
3033
|
+
* @uiWidget textArea
|
|
3034
|
+
*/
|
|
3035
|
+
this.descriptionNewPartner = "We just need a bit more information about you before you start earning cash!";
|
|
3036
|
+
/**
|
|
3037
|
+
* Description for existing partner confirmation
|
|
3038
|
+
*
|
|
3039
|
+
* @uiName Existing partner description
|
|
3040
|
+
* @uiWidget textArea
|
|
3041
|
+
*/
|
|
3042
|
+
this.descriptionExistingPartner = "We noticed you are already an Impact.com partner, please confirm your information.";
|
|
3043
|
+
/**
|
|
3044
|
+
* @uiName Country label
|
|
3045
|
+
*/
|
|
3046
|
+
this.countryLabel = "Country";
|
|
3047
|
+
/**
|
|
3048
|
+
* @uiName Currency label
|
|
3049
|
+
*/
|
|
3050
|
+
this.currencyLabel = "Currency";
|
|
3051
|
+
/**
|
|
3052
|
+
* @uiName Submit button label
|
|
3053
|
+
*/
|
|
3054
|
+
this.submitButtonLabel = "Submit";
|
|
3055
|
+
/**
|
|
3056
|
+
* @uiName Confirm button label
|
|
3057
|
+
*/
|
|
3058
|
+
this.confirmButtonLabel = "Confirm";
|
|
3059
|
+
/**
|
|
3060
|
+
* @uiName Search country placeholder
|
|
3061
|
+
*/
|
|
3062
|
+
this.searchCountryPlaceholder = "Search for a country";
|
|
3063
|
+
/**
|
|
3064
|
+
* @uiName Search currency placeholder
|
|
3065
|
+
*/
|
|
3066
|
+
this.searchCurrencyPlaceholder = "Search for a currency";
|
|
3067
|
+
/**
|
|
3068
|
+
* @uiName Network error text
|
|
3069
|
+
* @uiWidget textArea
|
|
3070
|
+
*/
|
|
3071
|
+
this.networkErrorText = "An error occurred. Please try again.";
|
|
3072
|
+
/**
|
|
3073
|
+
* @uiName Missing fields error text
|
|
3074
|
+
* @uiWidget textArea
|
|
3075
|
+
*/
|
|
3076
|
+
this.missingFieldsErrorText = "Please select both a country and currency.";
|
|
3077
|
+
h(this);
|
|
3078
|
+
}
|
|
3079
|
+
disconnectedCallback() { }
|
|
3080
|
+
getTextProps() {
|
|
3081
|
+
return getProps(this);
|
|
3082
|
+
}
|
|
3083
|
+
render() {
|
|
3084
|
+
// AL: TODO add usePartnerInfoModal
|
|
3085
|
+
const props = isDemo()
|
|
3086
|
+
? useDemoPartnerInfoModal(this)
|
|
3087
|
+
: usePartnerInfoModal(this);
|
|
3088
|
+
return h$1(PartnerInfoModalView, Object.assign({}, props));
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
function useDemoPartnerInfoModal(props) {
|
|
3092
|
+
const [countryCode, setCountryCode] = useState("US");
|
|
3093
|
+
const [currency, setCurrency] = useState("");
|
|
3094
|
+
const [error, setError] = useState("");
|
|
3095
|
+
const demoCountries = [
|
|
3096
|
+
{ countryCode: "US", displayName: "United States" },
|
|
3097
|
+
{ countryCode: "CA", displayName: "Canada" },
|
|
3098
|
+
{ countryCode: "GB", displayName: "United Kingdom" },
|
|
3099
|
+
{ countryCode: "AU", displayName: "Australia" },
|
|
3100
|
+
{ countryCode: "DE", displayName: "Germany" },
|
|
3101
|
+
];
|
|
3102
|
+
const demoCurrencies = [
|
|
3103
|
+
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
3104
|
+
{ currencyCode: "CAD", displayName: "Canadian Dollar" },
|
|
3105
|
+
{ currencyCode: "GBP", displayName: "British Pound" },
|
|
3106
|
+
{ currencyCode: "EUR", displayName: "Euro" },
|
|
3107
|
+
{ currencyCode: "AUD", displayName: "Australian Dollar" },
|
|
3108
|
+
];
|
|
3109
|
+
return cjs({
|
|
3110
|
+
states: {
|
|
3111
|
+
brandName: "Test Brand",
|
|
3112
|
+
open: true,
|
|
3113
|
+
loading: false,
|
|
3114
|
+
submitting: false,
|
|
3115
|
+
isExistingPartner: false,
|
|
3116
|
+
countryCode,
|
|
3117
|
+
currency,
|
|
3118
|
+
error,
|
|
3119
|
+
success: false,
|
|
3120
|
+
filteredCountries: demoCountries,
|
|
3121
|
+
filteredCurrencies: demoCurrencies,
|
|
3122
|
+
},
|
|
3123
|
+
callbacks: {
|
|
3124
|
+
onCountryChange: (e) => {
|
|
3125
|
+
var _a, _b;
|
|
3126
|
+
const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
3127
|
+
if (value) {
|
|
3128
|
+
setCountryCode(value);
|
|
3129
|
+
setCurrency("");
|
|
3130
|
+
}
|
|
3131
|
+
},
|
|
3132
|
+
onCurrencyChange: (e) => {
|
|
3133
|
+
var _a, _b;
|
|
3134
|
+
const value = (_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.__value;
|
|
3135
|
+
if (value)
|
|
3136
|
+
setCurrency(value);
|
|
3137
|
+
},
|
|
3138
|
+
onCountrySearch: () => { },
|
|
3139
|
+
onCurrencySearch: () => { },
|
|
3140
|
+
onSubmit: () => {
|
|
3141
|
+
if (!countryCode || !currency) {
|
|
3142
|
+
setError(props.missingFieldsErrorText);
|
|
3143
|
+
return;
|
|
3144
|
+
}
|
|
3145
|
+
setError("");
|
|
3146
|
+
},
|
|
3147
|
+
onClose: () => { },
|
|
3148
|
+
},
|
|
3149
|
+
text: {
|
|
3150
|
+
modalBrandHeader: props.modalBrandHeader,
|
|
3151
|
+
descriptionNewPartner: props.descriptionNewPartner,
|
|
3152
|
+
descriptionExistingPartner: props.descriptionExistingPartner,
|
|
3153
|
+
countryLabel: props.countryLabel,
|
|
3154
|
+
currencyLabel: props.currencyLabel,
|
|
3155
|
+
submitButtonLabel: props.submitButtonLabel,
|
|
3156
|
+
confirmButtonLabel: props.confirmButtonLabel,
|
|
3157
|
+
searchCountryPlaceholder: props.searchCountryPlaceholder,
|
|
3158
|
+
searchCurrencyPlaceholder: props.searchCurrencyPlaceholder,
|
|
3159
|
+
},
|
|
3160
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
3161
|
+
}
|
|
3162
|
+
|
|
2836
3163
|
const style$1 = {
|
|
2837
3164
|
Wrapper: {
|
|
2838
3165
|
maxWidth: "200px",
|
|
@@ -6456,7 +6783,7 @@ function useTaxAndCash() {
|
|
|
6456
6783
|
userFormContext.countryCode;
|
|
6457
6784
|
Sn({
|
|
6458
6785
|
namespace: COUNTRIES_QUERY_NAMESPACE,
|
|
6459
|
-
query: GET_COUNTRIES,
|
|
6786
|
+
query: GET_COUNTRIES$1,
|
|
6460
6787
|
skip: !user,
|
|
6461
6788
|
});
|
|
6462
6789
|
const { data: financeNetworkData, refetch } = Sn({
|
|
@@ -6469,7 +6796,7 @@ function useTaxAndCash() {
|
|
|
6469
6796
|
});
|
|
6470
6797
|
const { data: currenciesData } = Sn({
|
|
6471
6798
|
namespace: CURRENCIES_QUERY_NAMESPACE,
|
|
6472
|
-
query: GET_CURRENCIES,
|
|
6799
|
+
query: GET_CURRENCIES$1,
|
|
6473
6800
|
skip: !user,
|
|
6474
6801
|
variables: {
|
|
6475
6802
|
locale,
|
|
@@ -7926,4 +8253,4 @@ function useUserNameDemo(props) {
|
|
|
7926
8253
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
7927
8254
|
}
|
|
7928
8255
|
|
|
7929
|
-
export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, SqmBrandSelector as sqm_brand_selector, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, LeadDropdownField as sqm_lead_dropdown_field, LeadForm as sqm_lead_form, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalGoogleRegistrationForm as sqm_portal_google_registration_form, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, ReferredRegistration as sqm_referred_registration, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, TaxAndCashMonolith as sqm_tax_and_cash, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
|
|
8256
|
+
export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, SqmBrandSelector as sqm_brand_selector, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, LeadDropdownField as sqm_lead_dropdown_field, LeadForm as sqm_lead_form, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PartnerInfoModal as sqm_partner_info_modal, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalGoogleRegistrationForm as sqm_portal_google_registration_form, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, ReferredRegistration as sqm_referred_registration, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, TaxAndCashMonolith as sqm_tax_and_cash, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
|
|
@@ -29,7 +29,7 @@ import './utilities-77b1e0cc.js';
|
|
|
29
29
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-cfbc0eb0.js';
|
|
30
30
|
import './ErrorView-74cb3af8.js';
|
|
31
31
|
import { Q as QrCodeView } from './sqm-qr-code-view-ce476721.js';
|
|
32
|
-
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, c as BaseRegistrationFormView, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as useShareLink, K as ProgressBarView, M as ProgressBar$2, O as LeadFormView, Q as LeadDropdownFieldView, U as ShadowViewAddon } from './ShadowViewAddon-
|
|
32
|
+
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, c as BaseRegistrationFormView, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, d as CheckboxFieldView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalFrameView, R as ReferralIframeView, i as RewardExchangeView, r as rewardExchangeCustomErrorMsg, j as rewardExchangeLongText, k as rewardExchangeSelected, l as chooseAmountFixed, m as chooseAmountFixedNoDescription, n as chooseAmountVariable, o as chooseAmountVariableNoDescription, p as chooseAmountVariableDisabled, q as chooseAmountVariableUnavailable, s as confirmFixed, t as confirmVariable, v as redemptionError, w as queryError, x as success, y as successVariable, z as loading, A as empty$1, F as rewardExchange, G as useShareButton, J as useShareLink, K as ProgressBarView, M as ProgressBar$2, O as LeadFormView, Q as LeadDropdownFieldView, U as PartnerInfoModalView, V as ShadowViewAddon } from './ShadowViewAddon-9d97b5d5.js';
|
|
33
33
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-a8c708cd.js';
|
|
34
34
|
import { I as InvoiceTableView, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView, U as UserInfoFormView$1 } from './sqm-user-info-form-view-19d81a2b.js';
|
|
35
35
|
import { t as taxTypeToName, L as LoadingView } from './data-12e6aae1.js';
|
|
@@ -18696,6 +18696,162 @@ const UserInfoFormView = /*#__PURE__*/Object.freeze({
|
|
|
18696
18696
|
DisabledForm: DisabledForm
|
|
18697
18697
|
});
|
|
18698
18698
|
|
|
18699
|
+
const PartnerInfoModal_stories = {
|
|
18700
|
+
title: "Components/Partner Info Modal",
|
|
18701
|
+
};
|
|
18702
|
+
const demoCountries = [
|
|
18703
|
+
{ countryCode: "US", displayName: "United States" },
|
|
18704
|
+
{ countryCode: "CA", displayName: "Canada" },
|
|
18705
|
+
{ countryCode: "GB", displayName: "United Kingdom" },
|
|
18706
|
+
{ countryCode: "AU", displayName: "Australia" },
|
|
18707
|
+
{ countryCode: "DE", displayName: "Germany" },
|
|
18708
|
+
{ countryCode: "FR", displayName: "France" },
|
|
18709
|
+
{ countryCode: "JP", displayName: "Japan" },
|
|
18710
|
+
];
|
|
18711
|
+
const demoCurrencies = [
|
|
18712
|
+
{ currencyCode: "USD", displayName: "US Dollar" },
|
|
18713
|
+
{ currencyCode: "CAD", displayName: "Canadian Dollar" },
|
|
18714
|
+
{ currencyCode: "GBP", displayName: "British Pound" },
|
|
18715
|
+
{ currencyCode: "EUR", displayName: "Euro" },
|
|
18716
|
+
{ currencyCode: "AUD", displayName: "Australian Dollar" },
|
|
18717
|
+
];
|
|
18718
|
+
const noopCallbacks = {
|
|
18719
|
+
onCountryChange: (e) => console.log("Country changed:", e),
|
|
18720
|
+
onCurrencyChange: (e) => console.log("Currency changed:", e),
|
|
18721
|
+
onCountrySearch: (v) => console.log("Country search:", v),
|
|
18722
|
+
onCurrencySearch: (v) => console.log("Currency search:", v),
|
|
18723
|
+
onSubmit: () => console.log("Submit"),
|
|
18724
|
+
onClose: () => console.log("Close"),
|
|
18725
|
+
};
|
|
18726
|
+
const defaultText$1 = {
|
|
18727
|
+
modalBrandHeader: "Welcome to {brandName} Program!",
|
|
18728
|
+
descriptionNewPartner: "We just need a bit more information about you before you start earning cash!",
|
|
18729
|
+
descriptionExistingPartner: "We noticed you are already an Impact.com partner, please confirm your information.",
|
|
18730
|
+
countryLabel: "Country",
|
|
18731
|
+
currencyLabel: "Currency",
|
|
18732
|
+
submitButtonLabel: "Submit",
|
|
18733
|
+
confirmButtonLabel: "Confirm",
|
|
18734
|
+
searchCountryPlaceholder: "Search for a country",
|
|
18735
|
+
searchCurrencyPlaceholder: "Search for a currency",
|
|
18736
|
+
};
|
|
18737
|
+
const defaultProps$y = {
|
|
18738
|
+
states: {
|
|
18739
|
+
open: true,
|
|
18740
|
+
loading: false,
|
|
18741
|
+
submitting: false,
|
|
18742
|
+
isExistingPartner: false,
|
|
18743
|
+
countryCode: "",
|
|
18744
|
+
currency: "",
|
|
18745
|
+
error: "",
|
|
18746
|
+
success: false,
|
|
18747
|
+
brandName: "Test Brand",
|
|
18748
|
+
filteredCountries: demoCountries,
|
|
18749
|
+
filteredCurrencies: demoCurrencies,
|
|
18750
|
+
},
|
|
18751
|
+
callbacks: noopCallbacks,
|
|
18752
|
+
text: defaultText$1,
|
|
18753
|
+
};
|
|
18754
|
+
const NewPartnerEmpty = () => {
|
|
18755
|
+
return h(PartnerInfoModalView, Object.assign({}, defaultProps$y));
|
|
18756
|
+
};
|
|
18757
|
+
const NewPartnerPrefilled = () => {
|
|
18758
|
+
const props = {
|
|
18759
|
+
...defaultProps$y,
|
|
18760
|
+
states: {
|
|
18761
|
+
...defaultProps$y.states,
|
|
18762
|
+
countryCode: "US",
|
|
18763
|
+
currency: "",
|
|
18764
|
+
},
|
|
18765
|
+
};
|
|
18766
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18767
|
+
};
|
|
18768
|
+
const NewPartnerFullySelected = () => {
|
|
18769
|
+
const props = {
|
|
18770
|
+
...defaultProps$y,
|
|
18771
|
+
states: {
|
|
18772
|
+
...defaultProps$y.states,
|
|
18773
|
+
countryCode: "US",
|
|
18774
|
+
currency: "USD",
|
|
18775
|
+
},
|
|
18776
|
+
};
|
|
18777
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18778
|
+
};
|
|
18779
|
+
const ExistingPartnerConfirm = () => {
|
|
18780
|
+
const props = {
|
|
18781
|
+
...defaultProps$y,
|
|
18782
|
+
states: {
|
|
18783
|
+
...defaultProps$y.states,
|
|
18784
|
+
isExistingPartner: true,
|
|
18785
|
+
countryCode: "CA",
|
|
18786
|
+
currency: "CAD",
|
|
18787
|
+
},
|
|
18788
|
+
};
|
|
18789
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18790
|
+
};
|
|
18791
|
+
const Submitting = () => {
|
|
18792
|
+
const props = {
|
|
18793
|
+
...defaultProps$y,
|
|
18794
|
+
states: {
|
|
18795
|
+
...defaultProps$y.states,
|
|
18796
|
+
countryCode: "GB",
|
|
18797
|
+
currency: "GBP",
|
|
18798
|
+
submitting: true,
|
|
18799
|
+
},
|
|
18800
|
+
};
|
|
18801
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18802
|
+
};
|
|
18803
|
+
const WithError$3 = () => {
|
|
18804
|
+
const props = {
|
|
18805
|
+
...defaultProps$y,
|
|
18806
|
+
states: {
|
|
18807
|
+
...defaultProps$y.states,
|
|
18808
|
+
countryCode: "US",
|
|
18809
|
+
currency: "USD",
|
|
18810
|
+
error: "An error occurred while creating your partner account. Please try again.",
|
|
18811
|
+
},
|
|
18812
|
+
};
|
|
18813
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18814
|
+
};
|
|
18815
|
+
const ValidationError$1 = () => {
|
|
18816
|
+
const props = {
|
|
18817
|
+
...defaultProps$y,
|
|
18818
|
+
states: {
|
|
18819
|
+
...defaultProps$y.states,
|
|
18820
|
+
countryCode: "",
|
|
18821
|
+
currency: "",
|
|
18822
|
+
error: "Please select both a country and currency.",
|
|
18823
|
+
},
|
|
18824
|
+
};
|
|
18825
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18826
|
+
};
|
|
18827
|
+
const Closed = () => {
|
|
18828
|
+
const props = {
|
|
18829
|
+
...defaultProps$y,
|
|
18830
|
+
states: {
|
|
18831
|
+
...defaultProps$y.states,
|
|
18832
|
+
open: false,
|
|
18833
|
+
},
|
|
18834
|
+
};
|
|
18835
|
+
return h(PartnerInfoModalView, Object.assign({}, props));
|
|
18836
|
+
};
|
|
18837
|
+
const FullStackDemo = () => {
|
|
18838
|
+
return (h("sqm-partner-info-modal", { "brand-name": "Acme", "header-new-partner": "Welcome to {brandName} Program!", "description-new-partner": "We just need a bit more information about you before you start earning cash!", "submit-button-label": "Submit" }));
|
|
18839
|
+
};
|
|
18840
|
+
|
|
18841
|
+
const PartnerInfoModal = /*#__PURE__*/Object.freeze({
|
|
18842
|
+
__proto__: null,
|
|
18843
|
+
'default': PartnerInfoModal_stories,
|
|
18844
|
+
NewPartnerEmpty: NewPartnerEmpty,
|
|
18845
|
+
NewPartnerPrefilled: NewPartnerPrefilled,
|
|
18846
|
+
NewPartnerFullySelected: NewPartnerFullySelected,
|
|
18847
|
+
ExistingPartnerConfirm: ExistingPartnerConfirm,
|
|
18848
|
+
Submitting: Submitting,
|
|
18849
|
+
WithError: WithError$3,
|
|
18850
|
+
ValidationError: ValidationError$1,
|
|
18851
|
+
Closed: Closed,
|
|
18852
|
+
FullStackDemo: FullStackDemo
|
|
18853
|
+
});
|
|
18854
|
+
|
|
18699
18855
|
function deepFreeze(obj) {
|
|
18700
18856
|
if (obj instanceof Map) {
|
|
18701
18857
|
obj.clear = obj.delete = obj.set = function () {
|
|
@@ -21389,6 +21545,7 @@ const stories = [
|
|
|
21389
21545
|
TaxAndCashRewardsTable,
|
|
21390
21546
|
TaxAndCashReferralTableRewardsCell,
|
|
21391
21547
|
TaxAndCashReferralTable$1,
|
|
21548
|
+
PartnerInfoModal,
|
|
21392
21549
|
];
|
|
21393
21550
|
const StencilStorybook = class {
|
|
21394
21551
|
constructor(hostRef) {
|