@saasquatch/mint-components 2.1.9-17 → 2.1.9-19
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/{data-e83f8a41.js → data-34bc7549.js} +0 -90
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +85 -33
- package/dist/cjs/sqm-big-stat_46.cjs.entry.js +39 -36
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +31 -10
- package/dist/cjs/{sqm-partner-info-modal-view-bb64a718.js → sqm-partner-info-modal-view-ac5e3e60.js} +6 -3
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +38 -37
- package/dist/cjs/{sqm-user-info-form-view-923ff8d9.js → sqm-user-info-form-view-d89bdc04.js} +24 -23
- package/dist/cjs/utils-a8e0bd9b.js +93 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +6 -3
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +31 -10
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +29 -28
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +49 -11
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +4 -3
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +27 -14
- package/dist/{mint-components/p-a5912b2f.js → esm/data-2380309a.js} +23 -5
- package/dist/esm/sqm-banking-info-form_10.entry.js +78 -26
- package/dist/esm/sqm-big-stat_46.entry.js +37 -34
- package/dist/esm/sqm-email-verification_2.entry.js +32 -11
- package/dist/esm/{sqm-partner-info-modal-view-b0f31f8a.js → sqm-partner-info-modal-view-68479829.js} +6 -3
- package/dist/esm/sqm-stencilbook.entry.js +4 -3
- package/dist/esm/{sqm-user-info-form-view-f9026468.js → sqm-user-info-form-view-ff8e47ad.js} +2 -1
- package/dist/esm/utils-8267d3d8.js +85 -0
- package/dist/esm-es5/data-2380309a.js +1 -0
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-68479829.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-user-info-form-view-ff8e47ad.js +1 -0
- package/dist/esm-es5/utils-8267d3d8.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0152122e.js +115 -0
- package/dist/mint-components/{p-1b2fcd7f.entry.js → p-0305331c.entry.js} +32 -7
- package/dist/mint-components/p-0e05ab3b.system.js +1 -0
- package/dist/mint-components/p-1bb8ab0e.system.entry.js +1 -0
- package/dist/mint-components/p-1c413a06.system.js +1 -1
- package/dist/mint-components/p-22a4b4a6.system.js +1 -0
- package/dist/mint-components/p-37541f60.js +1 -0
- package/dist/mint-components/{p-66e8c1f6.entry.js → p-4015a90b.entry.js} +8 -8
- package/dist/mint-components/p-79e4ec63.system.entry.js +1 -0
- package/dist/mint-components/p-860541f2.entry.js +9 -0
- package/dist/mint-components/p-8ebd2081.system.js +1 -0
- package/dist/mint-components/p-a8891ebd.js +1 -0
- package/dist/mint-components/p-a9ff6601.system.entry.js +1 -0
- package/dist/mint-components/{p-e5c554da.entry.js → p-de793f38.entry.js} +3 -3
- package/dist/mint-components/p-ee0f1cf1.system.js +1 -0
- package/dist/mint-components/p-f686a911.js +1 -0
- package/dist/mint-components/p-ff91e6fd.system.entry.js +1 -0
- package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.d.ts +4 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm/data-2b0feb3f.js +0 -216
- package/dist/esm-es5/data-2b0feb3f.js +0 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-b0f31f8a.js +0 -1
- package/dist/esm-es5/sqm-user-info-form-view-f9026468.js +0 -1
- package/dist/mint-components/p-014977d7.js +0 -1
- package/dist/mint-components/p-1b3224d9.entry.js +0 -9
- package/dist/mint-components/p-54bf015a.system.js +0 -1
- package/dist/mint-components/p-64b56141.system.entry.js +0 -1
- package/dist/mint-components/p-6f13f388.system.entry.js +0 -1
- package/dist/mint-components/p-7e4a8af3.js +0 -1
- package/dist/mint-components/p-ae0a0031.system.entry.js +0 -1
- package/dist/mint-components/p-c4b7d9a0.system.entry.js +0 -1
- package/dist/mint-components/p-e302579a.system.js +0 -1
- package/dist/mint-components/p-eaf5d0af.system.js +0 -1
|
@@ -25,7 +25,8 @@ import { i as isEmpty } from './utilities-c9e730ed.js';
|
|
|
25
25
|
import { E as ErrorView } from './ErrorView-74cb3af8.js';
|
|
26
26
|
import { u as useDemoBigStat, V 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, W as withShadowView, L as LeaderboardView, N as NameFieldsView, f as ChangeMarktingView, P as PortalChangePasswordView, g as PortalFooterView, h as PortalFrameView, c as BaseRegistrationFormView, R as ReferralIframeView, i as RewardExchangeView, X as demoRewardExchange, G as useShareButton, a as ShareButtonView, J as useShareLink, S as StatContainerView, T as TaskCardView } from './ShadowViewAddon-657d18f0.js';
|
|
27
27
|
import './sqm-portal-container-view-a8c708cd.js';
|
|
28
|
-
import {
|
|
28
|
+
import { g as getCountryObj, L as LoadingView } from './utils-8267d3d8.js';
|
|
29
|
+
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, c as USER_QUERY_NAMESPACE, G as GET_USER$2, d as COUNTRIES_QUERY_NAMESPACE, e as GET_COUNTRIES, f as FINANCE_NETWORK_SETTINGS_NAMESPACE, g as GET_FINANCE_NETWORK_SETTINGS, h as CURRENCIES_QUERY_NAMESPACE, i as GET_CURRENCIES } from './data-2380309a.js';
|
|
29
30
|
import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
|
|
30
31
|
import './eventKeys-f76b6a03.js';
|
|
31
32
|
import { u as usePayoutStatus } from './usePayoutStatus-fa504d49.js';
|
|
@@ -6413,13 +6414,14 @@ function getCurrentStep(user) {
|
|
|
6413
6414
|
if (!((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.connected) || !((_b = user.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher)) {
|
|
6414
6415
|
return "/1";
|
|
6415
6416
|
}
|
|
6416
|
-
const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, billingAddress, phoneNumber, billingCity, billingPostalCode, billingState, } = user.impactConnection.publisher;
|
|
6417
|
-
console.log(
|
|
6417
|
+
const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, payoutsAccount, billingAddress, phoneNumber, billingCity, billingPostalCode, billingState, countryCode, } = user.impactConnection.publisher;
|
|
6418
|
+
console.log(user.impactConnection.publisher, "publisher data in useTaxAndCash to determine step");
|
|
6418
6419
|
// Early partner creation does not collect these fields
|
|
6420
|
+
const stateRequired = ["ES", "AU", "US", "CA"].includes(countryCode);
|
|
6419
6421
|
if (!billingAddress ||
|
|
6420
6422
|
!billingCity ||
|
|
6421
6423
|
!billingPostalCode ||
|
|
6422
|
-
!billingState ||
|
|
6424
|
+
(stateRequired && !billingState) ||
|
|
6423
6425
|
!phoneNumber) {
|
|
6424
6426
|
return "/1";
|
|
6425
6427
|
}
|
|
@@ -8026,6 +8028,34 @@ function useWidgetVerification() {
|
|
|
8026
8028
|
return { showCode, showPartnerModal, onVerification, onPartnerModalComplete, loading };
|
|
8027
8029
|
}
|
|
8028
8030
|
|
|
8031
|
+
const style$3 = {
|
|
8032
|
+
Dialog: {
|
|
8033
|
+
"&::part(panel)": {
|
|
8034
|
+
maxWidth: "480px",
|
|
8035
|
+
},
|
|
8036
|
+
"&::part(body)": {
|
|
8037
|
+
padding: "0 var(--sl-spacing-x-large)",
|
|
8038
|
+
fontSize: "var(--sl-font-size-small)",
|
|
8039
|
+
overflow: "visible",
|
|
8040
|
+
},
|
|
8041
|
+
"&::part(footer)": {
|
|
8042
|
+
display: "flex",
|
|
8043
|
+
flexDirection: "column",
|
|
8044
|
+
gap: "var(--sl-spacing-small)",
|
|
8045
|
+
},
|
|
8046
|
+
"&::part(overlay)": {
|
|
8047
|
+
background: "rgba(0, 0, 0, 0.5)",
|
|
8048
|
+
},
|
|
8049
|
+
},
|
|
8050
|
+
DialogTitle: {
|
|
8051
|
+
fontSize: "var(--sl-font-size-x-large)",
|
|
8052
|
+
fontWeight: "600",
|
|
8053
|
+
padding: "var(--sl-spacing-x-large) 0 0 0",
|
|
8054
|
+
margin: "0",
|
|
8055
|
+
},
|
|
8056
|
+
};
|
|
8057
|
+
const sheet$3 = createStyleSheet(style$3);
|
|
8058
|
+
const styleString$3 = sheet$3.toString();
|
|
8029
8059
|
const WidgetVerification = class {
|
|
8030
8060
|
constructor(hostRef) {
|
|
8031
8061
|
registerInstance(this, hostRef);
|
|
@@ -8225,40 +8255,13 @@ const WidgetVerification = class {
|
|
|
8225
8255
|
: useWidgetVerification();
|
|
8226
8256
|
if (props.loading)
|
|
8227
8257
|
return h$1("sl-spinner", null);
|
|
8258
|
+
// for handling state previews in content editor
|
|
8228
8259
|
const partnerState = typeof props["sqm-partner-info-modal_stateController"] === "string"
|
|
8229
8260
|
? parseStates(props["sqm-partner-info-modal_stateController"])
|
|
8230
8261
|
: props["sqm-partner-info-modal_stateController"];
|
|
8231
8262
|
if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
|
|
8232
8263
|
return h$1("div", null);
|
|
8233
8264
|
}
|
|
8234
|
-
const style = {
|
|
8235
|
-
Dialog: {
|
|
8236
|
-
"&::part(panel)": {
|
|
8237
|
-
maxWidth: "480px",
|
|
8238
|
-
},
|
|
8239
|
-
"&::part(body)": {
|
|
8240
|
-
padding: "0 var(--sl-spacing-x-large)",
|
|
8241
|
-
fontSize: "var(--sl-font-size-small)",
|
|
8242
|
-
overflow: "visible",
|
|
8243
|
-
},
|
|
8244
|
-
"&::part(footer)": {
|
|
8245
|
-
display: "flex",
|
|
8246
|
-
flexDirection: "column",
|
|
8247
|
-
gap: "var(--sl-spacing-small)",
|
|
8248
|
-
},
|
|
8249
|
-
"&::part(overlay)": {
|
|
8250
|
-
background: "rgba(0, 0, 0, 0.5)",
|
|
8251
|
-
},
|
|
8252
|
-
},
|
|
8253
|
-
DialogTitle: {
|
|
8254
|
-
fontSize: "var(--sl-font-size-x-large)",
|
|
8255
|
-
fontWeight: "600",
|
|
8256
|
-
padding: "var(--sl-spacing-x-large) 0 0 0",
|
|
8257
|
-
margin: "0",
|
|
8258
|
-
},
|
|
8259
|
-
};
|
|
8260
|
-
const sheet = createStyleSheet(style);
|
|
8261
|
-
const styleString = sheet.toString();
|
|
8262
8265
|
// const generalText = this.getStepTextProps("general_");
|
|
8263
8266
|
const partnerText = this.getStepTextProps("createPartnerStep_");
|
|
8264
8267
|
const dialogLabel = this.general_widgetHeaderWithPartnerCreation;
|
|
@@ -8271,14 +8274,14 @@ const WidgetVerification = class {
|
|
|
8271
8274
|
}
|
|
8272
8275
|
return (h$1("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"), extractProps(props, "sqm-email-verification_"))));
|
|
8273
8276
|
};
|
|
8274
|
-
return (h$1("div", null, h$1("style", { type: "text/css" }, styleString), h$1("sl-dialog", { class: sheet.classes.Dialog, noHeader: true, open: true, label: dialogLabel, "onSl-request-close": (e) => {
|
|
8277
|
+
return (h$1("div", null, h$1("style", { type: "text/css" }, styleString$3), h$1("sl-dialog", { class: sheet$3.classes.Dialog, noHeader: true, open: true, label: dialogLabel, "onSl-request-close": (e) => {
|
|
8275
8278
|
e.preventDefault();
|
|
8276
8279
|
}, "onSl-hide": (e) => {
|
|
8277
8280
|
var _a;
|
|
8278
8281
|
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
|
|
8279
8282
|
e.preventDefault();
|
|
8280
8283
|
}
|
|
8281
|
-
} }, h$1("h2", { class: sheet.classes.DialogTitle }, dialogLabel), renderStepContent())));
|
|
8284
|
+
} }, h$1("h2", { class: sheet$3.classes.DialogTitle }, dialogLabel), renderStepContent())));
|
|
8282
8285
|
}
|
|
8283
8286
|
};
|
|
8284
8287
|
function useDemoWidgetVerificationInternal(props) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { h, r as registerInstance } from './index-38ad4957.js';
|
|
2
2
|
import { i as intl } from './global-39f55ec2.js';
|
|
3
|
-
import { k as useState, f as useEffect, n as h$1 } from './dom-context-hooks.module-50442785.js';
|
|
3
|
+
import { k as useState, f as useEffect, n as h$1, u as useMemo } from './dom-context-hooks.module-50442785.js';
|
|
4
4
|
import { d as dist, t as Pn, w as wn, J, $ as $e, i as isDemo, r as En, L } from './index.module-cede12c6.js';
|
|
5
5
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
6
6
|
import { g as getProps } from './utils-334c1e34.js';
|
|
7
7
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
8
8
|
import { T as TextSpanView } from './sqm-text-span-view-738acfb3.js';
|
|
9
|
-
import {
|
|
9
|
+
import { g as GET_FINANCE_NETWORK_SETTINGS } from './data-2380309a.js';
|
|
10
|
+
import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-68479829.js';
|
|
10
11
|
import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
|
|
11
12
|
import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
|
|
12
13
|
import { p as parseStates } from './parseStates-ed75e224.js';
|
|
@@ -500,7 +501,7 @@ const GET_BRAND_NAME = dist.gql `
|
|
|
500
501
|
}
|
|
501
502
|
`;
|
|
502
503
|
function usePartnerInfoModal(props) {
|
|
503
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
504
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
504
505
|
const locale = L();
|
|
505
506
|
const setVerificationContext = En(VERIFICATION_PARENT_NAMESPACE);
|
|
506
507
|
const { data: userData, loading: userLoading, refetch, } = wn(GET_USER_PARTNER_INFO, {});
|
|
@@ -508,19 +509,39 @@ function usePartnerInfoModal(props) {
|
|
|
508
509
|
const { data: currenciesData, loading: currenciesLoading } = wn(GET_CURRENCIES, { variables: { locale } });
|
|
509
510
|
const { data: countriesData, loading: countriesLoading } = wn(GET_COUNTRIES, {});
|
|
510
511
|
const { data: tenantSettingsData } = wn(GET_BRAND_NAME, {});
|
|
512
|
+
const { data: financeNetworkData } = wn(GET_FINANCE_NETWORK_SETTINGS, {
|
|
513
|
+
variables: { filter: {} },
|
|
514
|
+
});
|
|
511
515
|
const [connectImpactPartner, { loading: connectLoading, errors: connectErrors },] = $e(CONNECT_PARTNER);
|
|
512
|
-
|
|
516
|
+
// No pre-filled country, use locale to determine countryCode instead
|
|
517
|
+
const [countryCode, setCountryCode] = useState(((_b = (_a = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher) === null || _b === void 0 ? void 0 : _b.countryCode) ||
|
|
518
|
+
locale.replace(/^.*_/, ""));
|
|
513
519
|
const [currency, setCurrency] = useState(((_d = (_c = user === null || user === void 0 ? void 0 : user.impactConnection) === null || _c === void 0 ? void 0 : _c.publisher) === null || _d === void 0 ? void 0 : _d.currency) || "");
|
|
520
|
+
const countries = ((_e = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _e === void 0 ? void 0 : _e.data) || [];
|
|
521
|
+
// copied from useTaxAndCash for displaying currencies based on country - could be in helper?
|
|
522
|
+
const currencies = useMemo(() => {
|
|
523
|
+
var _a, _b;
|
|
524
|
+
const allValidCurrencies = (_b = (_a = financeNetworkData === null || financeNetworkData === void 0 ? void 0 : financeNetworkData.impactFinanceNetworkSettings) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.reduce((agg, settings) => {
|
|
525
|
+
var _a, _b;
|
|
526
|
+
const currency = (_b = (_a = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.find((c) => c.currencyCode === settings.currency);
|
|
527
|
+
if (!currency)
|
|
528
|
+
return agg;
|
|
529
|
+
if (agg.find((c) => c.currencyCode === settings.currency))
|
|
530
|
+
return agg;
|
|
531
|
+
if (countryCode && settings.countryCode !== countryCode)
|
|
532
|
+
return agg;
|
|
533
|
+
return [...agg, currency];
|
|
534
|
+
}, []);
|
|
535
|
+
return (allValidCurrencies || []).sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
536
|
+
}, [financeNetworkData, currenciesData, countryCode]);
|
|
514
537
|
console.log(countryCode, currency, "initial country and currency state"); // TEMP
|
|
515
538
|
const [countrySearch, setCountrySearch] = useState("");
|
|
516
539
|
const [currencySearch, setCurrencySearch] = useState("");
|
|
517
|
-
const [filteredCountries, setFilteredCountries] = useState(((
|
|
518
|
-
const [filteredCurrencies, setFilteredCurrencies] = useState(
|
|
540
|
+
const [filteredCountries, setFilteredCountries] = useState(((_f = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _f === void 0 ? void 0 : _f.data) || []);
|
|
541
|
+
const [filteredCurrencies, setFilteredCurrencies] = useState(currencies || []);
|
|
542
|
+
console.log(userData, "userData partner info modal");
|
|
519
543
|
const [error, setError] = useState("");
|
|
520
544
|
const [success, setSuccess] = useState(false);
|
|
521
|
-
const countries = ((_g = countriesData === null || countriesData === void 0 ? void 0 : countriesData.impactPayoutCountries) === null || _g === void 0 ? void 0 : _g.data) || [];
|
|
522
|
-
const currencies = ((_h = currenciesData === null || currenciesData === void 0 ? void 0 : currenciesData.currencies) === null || _h === void 0 ? void 0 : _h.data) || [];
|
|
523
|
-
console.log(user, "user data from partner info query"); // TEMP
|
|
524
545
|
useEffect(() => {
|
|
525
546
|
var _a;
|
|
526
547
|
if (userData && ((_a = user.impactConnection) === null || _a === void 0 ? void 0 : _a.publisher)) {
|
|
@@ -610,11 +631,11 @@ function usePartnerInfoModal(props) {
|
|
|
610
631
|
setError(props.networkErrorText);
|
|
611
632
|
}
|
|
612
633
|
}
|
|
613
|
-
console.log(success, "success state in partner info modal");
|
|
614
634
|
const showModal = !success &&
|
|
615
635
|
!userLoading &&
|
|
616
636
|
(!(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.connected) || !(impactConnection === null || impactConnection === void 0 ? void 0 : impactConnection.publisher));
|
|
617
637
|
console.log(showModal, "showModal condition in partner info modal"); // TEMP
|
|
638
|
+
console.log(filteredCurrencies, "filtered curricneis");
|
|
618
639
|
return {
|
|
619
640
|
states: {
|
|
620
641
|
open: showModal,
|
|
@@ -625,7 +646,7 @@ function usePartnerInfoModal(props) {
|
|
|
625
646
|
currency,
|
|
626
647
|
error,
|
|
627
648
|
success,
|
|
628
|
-
brandName: ((
|
|
649
|
+
brandName: ((_g = tenantSettingsData === null || tenantSettingsData === void 0 ? void 0 : tenantSettingsData.tenantSettings) === null || _g === void 0 ? void 0 : _g.companyName) || "",
|
|
629
650
|
filteredCountries: filteredCountries || [],
|
|
630
651
|
filteredCurrencies: filteredCurrencies || [],
|
|
631
652
|
},
|
package/dist/esm/{sqm-partner-info-modal-view-b0f31f8a.js → sqm-partner-info-modal-view-68479829.js}
RENAMED
|
@@ -70,15 +70,18 @@ function PartnerInfoModalContentView(props) {
|
|
|
70
70
|
styleString),
|
|
71
71
|
h("div", { class: sheet.classes.FormFields },
|
|
72
72
|
description,
|
|
73
|
-
h("sl-select", {
|
|
73
|
+
h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.countryLabel, value: states.countryCode, disabled: states.submitting || !!states.isExistingPartner, required: true, hoist: true, "onSl-select": callbacks.onCountryChange },
|
|
74
74
|
h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCountryPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => {
|
|
75
75
|
var _a;
|
|
76
76
|
callbacks.setCountrySearch((_a = e.target) === null || _a === void 0 ? void 0 : _a.value);
|
|
77
77
|
} }), (_a = states.filteredCountries) === null || _a === void 0 ? void 0 :
|
|
78
78
|
_a.map((c) => (h("sl-menu-item", { value: c.countryCode }, c.displayName)))),
|
|
79
|
-
h("sl-select", {
|
|
79
|
+
h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.currencyLabel, value: states.currency, disabled: states.submitting || !!states.isExistingPartner, required: true, hoist: true, "onSl-select": callbacks.onCurrencyChange },
|
|
80
80
|
h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCurrencyPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => { var _a; return callbacks.setCurrencySearch((_a = e.target) === null || _a === void 0 ? void 0 : _a.value); } }), (_b = states.filteredCurrencies) === null || _b === void 0 ? void 0 :
|
|
81
|
-
_b.map((c) => (h("sl-menu-item", { value: c.currencyCode },
|
|
81
|
+
_b.map((c) => (h("sl-menu-item", { value: c.currencyCode },
|
|
82
|
+
c.currencyCode,
|
|
83
|
+
" - ",
|
|
84
|
+
c.displayName))))),
|
|
82
85
|
states.error && h("p", { class: sheet.classes.ErrorMessage }, states.error),
|
|
83
86
|
h("sl-button", { slot: "footer", type: "primary", loading: states.submitting, disabled: states.submitting || !states.countryCode || !states.currency, onClick: callbacks.onSubmit, class: sheet.classes.SubmitButton, exportparts: "base: primarybutton-base" }, buttonLabel)));
|
|
84
87
|
}
|
|
@@ -31,10 +31,11 @@ import './ErrorView-74cb3af8.js';
|
|
|
31
31
|
import { Q as QrCodeView } from './sqm-qr-code-view-ce476721.js';
|
|
32
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-657d18f0.js';
|
|
33
33
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-a8c708cd.js';
|
|
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-
|
|
35
|
-
import { t as taxTypeToName, L as LoadingView } from './
|
|
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-ff8e47ad.js';
|
|
35
|
+
import { t as taxTypeToName, L as LoadingView } from './utils-8267d3d8.js';
|
|
36
36
|
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-11a4f9a9.js';
|
|
37
|
-
import
|
|
37
|
+
import './data-2380309a.js';
|
|
38
|
+
import { P as PartnerInfoModalView } from './sqm-partner-info-modal-view-68479829.js';
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* lodash (Custom Build) <https://lodash.com/>
|
package/dist/esm/{sqm-user-info-form-view-f9026468.js → sqm-user-info-form-view-ff8e47ad.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { h } from './index-38ad4957.js';
|
|
2
2
|
import { i as intl } from './global-39f55ec2.js';
|
|
3
3
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
4
|
-
import { f as formatErrorMessage, L as LoadingView,
|
|
4
|
+
import { f as formatErrorMessage, L as LoadingView, v as validateBillingField } from './utils-8267d3d8.js';
|
|
5
|
+
import { F as FORM_STEPS } from './data-2380309a.js';
|
|
5
6
|
|
|
6
7
|
const style = {
|
|
7
8
|
Description: {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { h } from './index-38ad4957.js';
|
|
2
|
+
import { i as intl } from './global-39f55ec2.js';
|
|
3
|
+
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
4
|
+
|
|
5
|
+
const style = {
|
|
6
|
+
Container: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
gap: "35px",
|
|
10
|
+
},
|
|
11
|
+
HeaderContainer: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: "10px",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const sheet = createStyleSheet(style);
|
|
18
|
+
const styleString = sheet.toString();
|
|
19
|
+
const LoadingView = () => {
|
|
20
|
+
return (h("div", { class: sheet.classes.Container },
|
|
21
|
+
h("style", { type: "text/css" }, styleString),
|
|
22
|
+
h("sqm-skeleton", { width: "45%", height: "40px !important" }),
|
|
23
|
+
h("div", { class: sheet.classes.HeaderContainer },
|
|
24
|
+
h("sqm-skeleton", { width: "15%" }),
|
|
25
|
+
h("sqm-skeleton", { width: "25%", height: "30px !important" })),
|
|
26
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
27
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
28
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
29
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
30
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
31
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
32
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
33
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
34
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
35
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
36
|
+
h("sqm-skeleton", { width: "75%", height: "35px" }),
|
|
37
|
+
h("sqm-skeleton", { width: "15%" }),
|
|
38
|
+
h("sqm-skeleton", { width: "80px", height: "30px !important" })));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function validTaxDocument(requiredType) {
|
|
42
|
+
const validTypes = ["W9", "W8BENE", "W8BEN"];
|
|
43
|
+
if (validTypes.includes(requiredType))
|
|
44
|
+
return true;
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const objectIsFull = (obj) => {
|
|
48
|
+
return !Object.keys(obj).find((k) => obj[k] == undefined);
|
|
49
|
+
};
|
|
50
|
+
const taxTypeToName = (taxType) => {
|
|
51
|
+
switch (taxType) {
|
|
52
|
+
case "W9":
|
|
53
|
+
return "W-9";
|
|
54
|
+
case "W8BEN":
|
|
55
|
+
case "W8BENE":
|
|
56
|
+
return "W-8";
|
|
57
|
+
default:
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function validateBillingField(regex, value) {
|
|
62
|
+
const trimmed = value.trim();
|
|
63
|
+
const idx = trimmed.search(regex);
|
|
64
|
+
return idx > -1;
|
|
65
|
+
}
|
|
66
|
+
const formatErrorMessage = (fieldName, errorMessage) => {
|
|
67
|
+
return intl.formatMessage({
|
|
68
|
+
id: fieldName,
|
|
69
|
+
defaultMessage: errorMessage,
|
|
70
|
+
}, {
|
|
71
|
+
fieldName,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
function getCountryObj({ countryCode, locale, }) {
|
|
75
|
+
// @ts-ignore DisplayNames not in Intl type
|
|
76
|
+
const displayName = new Intl.DisplayNames([locale], {
|
|
77
|
+
type: "region",
|
|
78
|
+
}).of(countryCode);
|
|
79
|
+
return {
|
|
80
|
+
countryCode,
|
|
81
|
+
displayName,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { LoadingView as L, validTaxDocument as a, formatErrorMessage as f, getCountryObj as g, objectIsFull as o, taxTypeToName as t, validateBillingField as v };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(n,e){if(Object.defineProperty){Object.defineProperty(n,"raw",{value:e})}else{n.raw=e}return n};import{d as dist}from"./index.module-cede12c6.js";var TAX_CONTEXT_NAMESPACE="sq:tax-and-cash";var TAX_FORM_CONTEXT_NAMESPACE="sq:tax-form-context";var USER_QUERY_NAMESPACE="sq:user-info-query";var USER_FORM_CONTEXT_NAMESPACE="sq:user-form-context";var FINANCE_NETWORK_SETTINGS_NAMESPACE="sq:finance-network-settings";var COUNTRIES_NAMESPACE="sq:countries:list";var SORTED_COUNTRIES_NAMESPACE="sq:countries:sorted";var COUNTRIES_QUERY_NAMESPACE="sq:countries:query";var CURRENCIES_NAMESPACE="sq:currencies:list";var CURRENCIES_QUERY_NAMESPACE="sq:currencies:query";var GET_USER=dist.gql(templateObject_1||(templateObject_1=__makeTemplateObject(["\n query getUserTaxInfo {\n user: viewer {\n ... on User {\n id\n firstName\n lastName\n email\n countryCode\n customFields\n rewards(limit: 1000) {\n data {\n statuses\n partnerFundsTransfer {\n id\n status\n dateScheduled\n dateCreated\n dateTransferred\n }\n }\n }\n managedIdentity {\n uid\n email\n emailVerified\n }\n impactConnection {\n connected\n user {\n firstName\n lastName\n }\n publisher {\n id\n brandedSignup\n countryCode\n currency\n billingAddress\n billingCity\n billingState\n billingCountryCode\n billingPostalCode\n phoneNumberCountryCode\n phoneNumber\n taxInformation {\n indirectTaxId\n indirectTaxCountryCode\n indirectTaxRegion\n additionalTaxId\n withholdingTaxId\n withholdingTaxCountryCode\n }\n requiredTaxDocumentType\n currentTaxDocument {\n status\n type\n dateCreated\n }\n withdrawalSettings {\n paymentMethod\n paypalEmailAddress\n bankCountry\n bankAccountNumber\n paymentSchedulingType\n paymentThreshold\n paymentDay\n }\n payoutsAccount {\n hold\n holdReasons\n balance\n }\n }\n }\n }\n }\n }\n"],["\n query getUserTaxInfo {\n user: viewer {\n ... on User {\n id\n firstName\n lastName\n email\n countryCode\n customFields\n rewards(limit: 1000) {\n data {\n statuses\n partnerFundsTransfer {\n id\n status\n dateScheduled\n dateCreated\n dateTransferred\n }\n }\n }\n managedIdentity {\n uid\n email\n emailVerified\n }\n impactConnection {\n connected\n user {\n firstName\n lastName\n }\n publisher {\n id\n brandedSignup\n countryCode\n currency\n billingAddress\n billingCity\n billingState\n billingCountryCode\n billingPostalCode\n phoneNumberCountryCode\n phoneNumber\n taxInformation {\n indirectTaxId\n indirectTaxCountryCode\n indirectTaxRegion\n additionalTaxId\n withholdingTaxId\n withholdingTaxCountryCode\n }\n requiredTaxDocumentType\n currentTaxDocument {\n status\n type\n dateCreated\n }\n withdrawalSettings {\n paymentMethod\n paypalEmailAddress\n bankCountry\n bankAccountNumber\n paymentSchedulingType\n paymentThreshold\n paymentDay\n }\n payoutsAccount {\n hold\n holdReasons\n balance\n }\n }\n }\n }\n }\n }\n"])));var GET_COUNTRIES=dist.gql(templateObject_2||(templateObject_2=__makeTemplateObject(["\n query getCountries {\n impactPayoutCountries(limit: 1000) {\n data {\n countryCode\n displayName\n }\n }\n }\n"],["\n query getCountries {\n impactPayoutCountries(limit: 1000) {\n data {\n countryCode\n displayName\n }\n }\n }\n"])));var GET_CURRENCIES=dist.gql(templateObject_3||(templateObject_3=__makeTemplateObject(["\n query currencies($locale: RSLocale) {\n currencies(limit: 300) {\n data {\n displayName(locale: $locale)\n currencyCode\n }\n }\n }\n"],["\n query currencies($locale: RSLocale) {\n currencies(limit: 300) {\n data {\n displayName(locale: $locale)\n currencyCode\n }\n }\n }\n"])));var GET_FINANCE_NETWORK_SETTINGS=dist.gql(templateObject_4||(templateObject_4=__makeTemplateObject(["\n query impactFinanceNetworkSettings(\n $filter: ImpactFinanceNetworkSettingsFilterInput\n ) {\n impactFinanceNetworkSettings(filter: $filter, limit: 1000) {\n data {\n countryCode\n currency\n defaultFinancePaymentMethodId\n thresholdOptions\n withdrawalSettingId\n internationalEftFee\n foreignFxFee\n defaultFxFee\n }\n totalCount\n }\n }\n"],["\n query impactFinanceNetworkSettings(\n $filter: ImpactFinanceNetworkSettingsFilterInput\n ) {\n impactFinanceNetworkSettings(filter: $filter, limit: 1000) {\n data {\n countryCode\n currency\n defaultFinancePaymentMethodId\n thresholdOptions\n withdrawalSettingId\n internationalEftFee\n foreignFxFee\n defaultFxFee\n }\n totalCount\n }\n }\n"])));var FORM_STEPS=4;export{CURRENCIES_NAMESPACE as C,FORM_STEPS as F,GET_USER as G,SORTED_COUNTRIES_NAMESPACE as S,TAX_CONTEXT_NAMESPACE as T,USER_FORM_CONTEXT_NAMESPACE as U,TAX_FORM_CONTEXT_NAMESPACE as a,COUNTRIES_NAMESPACE as b,USER_QUERY_NAMESPACE as c,COUNTRIES_QUERY_NAMESPACE as d,GET_COUNTRIES as e,FINANCE_NETWORK_SETTINGS_NAMESPACE as f,GET_FINANCE_NETWORK_SETTINGS as g,CURRENCIES_QUERY_NAMESPACE as h,GET_CURRENCIES as i};var templateObject_1,templateObject_2,templateObject_3,templateObject_4;
|