@wix/form-public 0.184.0 → 0.185.0
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/index.cjs +491 -446
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +491 -446
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -22442,6 +22442,218 @@ var require_messages_en = __commonJS({
|
|
|
22442
22442
|
}
|
|
22443
22443
|
});
|
|
22444
22444
|
|
|
22445
|
+
// ../../node_modules/@wix/sdk-runtime/build/constants.js
|
|
22446
|
+
var SDKRequestToRESTRequestRenameMap, RESTResponseToSDKResponseRenameMap;
|
|
22447
|
+
var init_constants3 = __esm({
|
|
22448
|
+
"../../node_modules/@wix/sdk-runtime/build/constants.js"() {
|
|
22449
|
+
SDKRequestToRESTRequestRenameMap = {
|
|
22450
|
+
_id: "id",
|
|
22451
|
+
_createdDate: "createdDate",
|
|
22452
|
+
_updatedDate: "updatedDate"
|
|
22453
|
+
};
|
|
22454
|
+
RESTResponseToSDKResponseRenameMap = {
|
|
22455
|
+
id: "_id",
|
|
22456
|
+
createdDate: "_createdDate",
|
|
22457
|
+
updatedDate: "_updatedDate"
|
|
22458
|
+
};
|
|
22459
|
+
}
|
|
22460
|
+
});
|
|
22461
|
+
|
|
22462
|
+
// ../../node_modules/@wix/sdk-runtime/build/utils.js
|
|
22463
|
+
function removeUndefinedKeys(obj) {
|
|
22464
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
22465
|
+
}
|
|
22466
|
+
function constantCase(input) {
|
|
22467
|
+
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
22468
|
+
}
|
|
22469
|
+
function split(value) {
|
|
22470
|
+
let result2 = value.trim();
|
|
22471
|
+
result2 = result2.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
22472
|
+
result2 = result2.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
22473
|
+
let start = 0;
|
|
22474
|
+
let end = result2.length;
|
|
22475
|
+
while (result2.charAt(start) === "\0") {
|
|
22476
|
+
start++;
|
|
22477
|
+
}
|
|
22478
|
+
if (start === end) {
|
|
22479
|
+
return [];
|
|
22480
|
+
}
|
|
22481
|
+
while (result2.charAt(end - 1) === "\0") {
|
|
22482
|
+
end--;
|
|
22483
|
+
}
|
|
22484
|
+
return result2.slice(start, end).split(/\0/g);
|
|
22485
|
+
}
|
|
22486
|
+
var SPLIT_LOWER_UPPER_RE, SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE, DEFAULT_STRIP_REGEXP;
|
|
22487
|
+
var init_utils2 = __esm({
|
|
22488
|
+
"../../node_modules/@wix/sdk-runtime/build/utils.js"() {
|
|
22489
|
+
SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
22490
|
+
SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
22491
|
+
SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
22492
|
+
DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
22493
|
+
}
|
|
22494
|
+
});
|
|
22495
|
+
|
|
22496
|
+
// ../../node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
22497
|
+
function transformError(httpClientError, pathsToArguments = {
|
|
22498
|
+
explicitPathsToArguments: {},
|
|
22499
|
+
spreadPathsToArguments: {},
|
|
22500
|
+
singleArgumentUnchanged: false
|
|
22501
|
+
}, argumentNames = []) {
|
|
22502
|
+
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
22503
|
+
throw httpClientError;
|
|
22504
|
+
}
|
|
22505
|
+
if (isValidationError(httpClientError)) {
|
|
22506
|
+
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
22507
|
+
}
|
|
22508
|
+
if (isApplicationError(httpClientError)) {
|
|
22509
|
+
return buildApplicationError(httpClientError);
|
|
22510
|
+
}
|
|
22511
|
+
if (isClientError(httpClientError)) {
|
|
22512
|
+
const status = httpClientError.response?.status;
|
|
22513
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
22514
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
22515
|
+
const details = {
|
|
22516
|
+
applicationError: {
|
|
22517
|
+
description: statusText,
|
|
22518
|
+
code: constantCase(statusText),
|
|
22519
|
+
data: {}
|
|
22520
|
+
},
|
|
22521
|
+
requestId: httpClientError.requestId
|
|
22522
|
+
};
|
|
22523
|
+
return wrapError(httpClientError, {
|
|
22524
|
+
message: JSON.stringify({
|
|
22525
|
+
message,
|
|
22526
|
+
details
|
|
22527
|
+
}, null, 2),
|
|
22528
|
+
extraProperties: {
|
|
22529
|
+
details,
|
|
22530
|
+
status
|
|
22531
|
+
}
|
|
22532
|
+
});
|
|
22533
|
+
}
|
|
22534
|
+
return buildSystemError(httpClientError);
|
|
22535
|
+
}
|
|
22536
|
+
var isValidationError, isApplicationError, isClientError, buildValidationError, wrapError, buildApplicationError, buildSystemError, violationsWithRenamedFields, withRenamedArgument, getArgumentIndex;
|
|
22537
|
+
var init_transform_error = __esm({
|
|
22538
|
+
"../../node_modules/@wix/sdk-runtime/build/transform-error.js"() {
|
|
22539
|
+
init_utils2();
|
|
22540
|
+
isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
22541
|
+
isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
22542
|
+
isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
22543
|
+
buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
22544
|
+
const validationErrorResponse = httpClientError.response?.data;
|
|
22545
|
+
const requestId = httpClientError.requestId;
|
|
22546
|
+
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
22547
|
+
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
22548
|
+
const message = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
22549
|
+
const details = {
|
|
22550
|
+
validationError: { fieldViolations: transformedFieldViolations },
|
|
22551
|
+
requestId
|
|
22552
|
+
};
|
|
22553
|
+
return wrapError(httpClientError, {
|
|
22554
|
+
message: JSON.stringify({ message, details }, null, 2),
|
|
22555
|
+
extraProperties: {
|
|
22556
|
+
details,
|
|
22557
|
+
status: httpClientError.response?.status,
|
|
22558
|
+
requestId
|
|
22559
|
+
}
|
|
22560
|
+
});
|
|
22561
|
+
};
|
|
22562
|
+
wrapError = (baseError, { message, extraProperties }) => {
|
|
22563
|
+
return Object.assign(baseError, {
|
|
22564
|
+
...extraProperties,
|
|
22565
|
+
message
|
|
22566
|
+
});
|
|
22567
|
+
};
|
|
22568
|
+
buildApplicationError = (httpClientError) => {
|
|
22569
|
+
const status = httpClientError.response?.status;
|
|
22570
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
22571
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
22572
|
+
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
22573
|
+
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
22574
|
+
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
22575
|
+
const combinedMessage = message === description ? message : `${message}: ${description}`;
|
|
22576
|
+
const details = {
|
|
22577
|
+
applicationError: {
|
|
22578
|
+
description,
|
|
22579
|
+
code,
|
|
22580
|
+
data
|
|
22581
|
+
},
|
|
22582
|
+
requestId: httpClientError.requestId
|
|
22583
|
+
};
|
|
22584
|
+
return wrapError(httpClientError, {
|
|
22585
|
+
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
22586
|
+
extraProperties: {
|
|
22587
|
+
details,
|
|
22588
|
+
status,
|
|
22589
|
+
requestId: httpClientError.requestId
|
|
22590
|
+
}
|
|
22591
|
+
});
|
|
22592
|
+
};
|
|
22593
|
+
buildSystemError = (httpClientError) => {
|
|
22594
|
+
const message = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
22595
|
+
return wrapError(httpClientError, {
|
|
22596
|
+
message,
|
|
22597
|
+
extraProperties: {
|
|
22598
|
+
requestId: httpClientError.requestId,
|
|
22599
|
+
status: httpClientError.response?.status,
|
|
22600
|
+
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
22601
|
+
...!httpClientError.response && {
|
|
22602
|
+
runtimeError: httpClientError
|
|
22603
|
+
}
|
|
22604
|
+
}
|
|
22605
|
+
});
|
|
22606
|
+
};
|
|
22607
|
+
violationsWithRenamedFields = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
22608
|
+
const allPathsToArguments = {
|
|
22609
|
+
...spreadPathsToArguments,
|
|
22610
|
+
...explicitPathsToArguments
|
|
22611
|
+
};
|
|
22612
|
+
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
22613
|
+
return fieldViolations?.filter((fieldViolation) => {
|
|
22614
|
+
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
22615
|
+
return !containedInAMoreSpecificViolationField;
|
|
22616
|
+
}).map((fieldViolation) => {
|
|
22617
|
+
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
22618
|
+
if (exactMatchArgumentExpression) {
|
|
22619
|
+
return {
|
|
22620
|
+
...fieldViolation,
|
|
22621
|
+
field: withRenamedArgument(exactMatchArgumentExpression, argumentNames)
|
|
22622
|
+
};
|
|
22623
|
+
}
|
|
22624
|
+
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path) => fieldViolation.field.startsWith(path));
|
|
22625
|
+
if (longestPartialPathMatch) {
|
|
22626
|
+
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
22627
|
+
if (partialMatchArgumentExpression) {
|
|
22628
|
+
return {
|
|
22629
|
+
...fieldViolation,
|
|
22630
|
+
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
22631
|
+
};
|
|
22632
|
+
}
|
|
22633
|
+
}
|
|
22634
|
+
if (singleArgumentUnchanged) {
|
|
22635
|
+
return {
|
|
22636
|
+
...fieldViolation,
|
|
22637
|
+
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
22638
|
+
};
|
|
22639
|
+
}
|
|
22640
|
+
return fieldViolation;
|
|
22641
|
+
});
|
|
22642
|
+
};
|
|
22643
|
+
withRenamedArgument = (fieldValue, argumentNames) => {
|
|
22644
|
+
const argIndex = getArgumentIndex(fieldValue);
|
|
22645
|
+
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
22646
|
+
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
22647
|
+
}
|
|
22648
|
+
return fieldValue;
|
|
22649
|
+
};
|
|
22650
|
+
getArgumentIndex = (s) => {
|
|
22651
|
+
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
22652
|
+
return match && match.groups && Number(match.groups.argIndex);
|
|
22653
|
+
};
|
|
22654
|
+
}
|
|
22655
|
+
});
|
|
22656
|
+
|
|
22445
22657
|
// ../../node_modules/@wix/sdk-context/build/browser/index.mjs
|
|
22446
22658
|
var wixContext;
|
|
22447
22659
|
var init_browser = __esm({
|
|
@@ -22450,6 +22662,231 @@ var init_browser = __esm({
|
|
|
22450
22662
|
}
|
|
22451
22663
|
});
|
|
22452
22664
|
|
|
22665
|
+
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
22666
|
+
function resolveContext() {
|
|
22667
|
+
const oldContext = typeof $wixContext !== "undefined" && $wixContext.initWixModules ? $wixContext.initWixModules : typeof globalThis.__wix_context__ !== "undefined" && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
22668
|
+
if (oldContext) {
|
|
22669
|
+
return {
|
|
22670
|
+
// @ts-expect-error
|
|
22671
|
+
initWixModules(modules, elevated) {
|
|
22672
|
+
return runWithoutContext(() => oldContext(modules, elevated));
|
|
22673
|
+
},
|
|
22674
|
+
fetchWithAuth() {
|
|
22675
|
+
throw new Error("fetchWithAuth is not available in this context");
|
|
22676
|
+
},
|
|
22677
|
+
graphql() {
|
|
22678
|
+
throw new Error("graphql is not available in this context");
|
|
22679
|
+
}
|
|
22680
|
+
};
|
|
22681
|
+
}
|
|
22682
|
+
const contextualClient = typeof $wixContext !== "undefined" ? $wixContext.client : typeof wixContext.client !== "undefined" ? wixContext.client : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.client : void 0;
|
|
22683
|
+
const elevatedClient = typeof $wixContext !== "undefined" ? $wixContext.elevatedClient : typeof wixContext.elevatedClient !== "undefined" ? wixContext.elevatedClient : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.elevatedClient : void 0;
|
|
22684
|
+
if (!contextualClient && !elevatedClient) {
|
|
22685
|
+
return;
|
|
22686
|
+
}
|
|
22687
|
+
return {
|
|
22688
|
+
initWixModules(wixModules, elevated) {
|
|
22689
|
+
if (elevated) {
|
|
22690
|
+
if (!elevatedClient) {
|
|
22691
|
+
throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");
|
|
22692
|
+
}
|
|
22693
|
+
return runWithoutContext(() => elevatedClient.use(wixModules));
|
|
22694
|
+
}
|
|
22695
|
+
if (!contextualClient) {
|
|
22696
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22697
|
+
}
|
|
22698
|
+
return runWithoutContext(() => contextualClient.use(wixModules));
|
|
22699
|
+
},
|
|
22700
|
+
fetchWithAuth: (urlOrRequest, requestInit) => {
|
|
22701
|
+
if (!contextualClient) {
|
|
22702
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22703
|
+
}
|
|
22704
|
+
return contextualClient.fetchWithAuth(urlOrRequest, requestInit);
|
|
22705
|
+
},
|
|
22706
|
+
getAuth() {
|
|
22707
|
+
if (!contextualClient) {
|
|
22708
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22709
|
+
}
|
|
22710
|
+
return contextualClient.auth;
|
|
22711
|
+
},
|
|
22712
|
+
async graphql(query, variables, opts) {
|
|
22713
|
+
if (!contextualClient) {
|
|
22714
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22715
|
+
}
|
|
22716
|
+
return contextualClient.graphql(query, variables, opts);
|
|
22717
|
+
}
|
|
22718
|
+
};
|
|
22719
|
+
}
|
|
22720
|
+
function runWithoutContext(fn) {
|
|
22721
|
+
const globalContext = globalThis.__wix_context__;
|
|
22722
|
+
const moduleContext = {
|
|
22723
|
+
client: wixContext.client,
|
|
22724
|
+
elevatedClient: wixContext.elevatedClient
|
|
22725
|
+
};
|
|
22726
|
+
let closureContext;
|
|
22727
|
+
globalThis.__wix_context__ = void 0;
|
|
22728
|
+
wixContext.client = void 0;
|
|
22729
|
+
wixContext.elevatedClient = void 0;
|
|
22730
|
+
if (typeof $wixContext !== "undefined") {
|
|
22731
|
+
closureContext = {
|
|
22732
|
+
client: $wixContext?.client,
|
|
22733
|
+
elevatedClient: $wixContext?.elevatedClient
|
|
22734
|
+
};
|
|
22735
|
+
delete $wixContext.client;
|
|
22736
|
+
delete $wixContext.elevatedClient;
|
|
22737
|
+
}
|
|
22738
|
+
try {
|
|
22739
|
+
return fn();
|
|
22740
|
+
} finally {
|
|
22741
|
+
globalThis.__wix_context__ = globalContext;
|
|
22742
|
+
wixContext.client = moduleContext.client;
|
|
22743
|
+
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
22744
|
+
if (typeof $wixContext !== "undefined") {
|
|
22745
|
+
$wixContext.client = closureContext.client;
|
|
22746
|
+
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
22747
|
+
}
|
|
22748
|
+
}
|
|
22749
|
+
}
|
|
22750
|
+
var init_context = __esm({
|
|
22751
|
+
"../../node_modules/@wix/sdk-runtime/build/context.js"() {
|
|
22752
|
+
init_browser();
|
|
22753
|
+
init_context_v2();
|
|
22754
|
+
}
|
|
22755
|
+
});
|
|
22756
|
+
|
|
22757
|
+
// ../../node_modules/@wix/sdk-runtime/build/context-v2.js
|
|
22758
|
+
function contextualizeRESTModuleV2(restModule, elevated) {
|
|
22759
|
+
return ((...args) => {
|
|
22760
|
+
const context = resolveContext();
|
|
22761
|
+
if (!context) {
|
|
22762
|
+
return restModule.apply(void 0, args);
|
|
22763
|
+
}
|
|
22764
|
+
return context.initWixModules(restModule, elevated).apply(void 0, args);
|
|
22765
|
+
});
|
|
22766
|
+
}
|
|
22767
|
+
var init_context_v2 = __esm({
|
|
22768
|
+
"../../node_modules/@wix/sdk-runtime/build/context-v2.js"() {
|
|
22769
|
+
init_context();
|
|
22770
|
+
}
|
|
22771
|
+
});
|
|
22772
|
+
|
|
22773
|
+
// ../../node_modules/@wix/sdk-runtime/build/rest-modules.js
|
|
22774
|
+
function createRESTModule(descriptor, elevated = false) {
|
|
22775
|
+
return contextualizeRESTModuleV2(descriptor, elevated);
|
|
22776
|
+
}
|
|
22777
|
+
function toURLSearchParams(params, isComplexRequest) {
|
|
22778
|
+
const flatten = flattenParams(params);
|
|
22779
|
+
Object.entries(flatten).some(([key, value]) => key.includes(".") || Array.isArray(value) && value.some((v) => typeof v === "object"));
|
|
22780
|
+
{
|
|
22781
|
+
return Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {
|
|
22782
|
+
const keyParams = Array.isArray(value) ? value : [value];
|
|
22783
|
+
keyParams.forEach((param) => {
|
|
22784
|
+
if (param === void 0 || param === null || Array.isArray(value) && typeof param === "object") {
|
|
22785
|
+
return;
|
|
22786
|
+
}
|
|
22787
|
+
urlSearchParams.append(key, param);
|
|
22788
|
+
});
|
|
22789
|
+
return urlSearchParams;
|
|
22790
|
+
}, new URLSearchParams());
|
|
22791
|
+
}
|
|
22792
|
+
}
|
|
22793
|
+
function resolveUrl(opts) {
|
|
22794
|
+
const domain = resolveDomain(opts.host);
|
|
22795
|
+
const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);
|
|
22796
|
+
const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});
|
|
22797
|
+
return resolvePathFromMappings(path, mappings);
|
|
22798
|
+
}
|
|
22799
|
+
function flattenParams(data, path = "") {
|
|
22800
|
+
const params = {};
|
|
22801
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
22802
|
+
const isObject5 = value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22803
|
+
const fieldPath = resolvePath(path, key);
|
|
22804
|
+
if (isObject5) {
|
|
22805
|
+
const serializedObject = flattenParams(value, fieldPath);
|
|
22806
|
+
Object.assign(params, serializedObject);
|
|
22807
|
+
} else {
|
|
22808
|
+
params[fieldPath] = value;
|
|
22809
|
+
}
|
|
22810
|
+
});
|
|
22811
|
+
return params;
|
|
22812
|
+
}
|
|
22813
|
+
function resolvePath(path, key) {
|
|
22814
|
+
return `${path}${path ? "." : ""}${key}`;
|
|
22815
|
+
}
|
|
22816
|
+
function resolveDomain(host) {
|
|
22817
|
+
const resolvedHost = fixHostExceptions(host);
|
|
22818
|
+
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, "._base_domain_").replace(REGEX_CAPTURE_API_DOMAINS, "._api_base_domain_").replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, "*.dev.wix-code.com");
|
|
22819
|
+
}
|
|
22820
|
+
function fixHostExceptions(host) {
|
|
22821
|
+
return host.replace("create.editorx.com", "editor.editorx.com");
|
|
22822
|
+
}
|
|
22823
|
+
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
22824
|
+
const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];
|
|
22825
|
+
if (mappings) {
|
|
22826
|
+
return mappings;
|
|
22827
|
+
}
|
|
22828
|
+
const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
|
|
22829
|
+
if (!rootDomainMappings) {
|
|
22830
|
+
if (isBaseDomain(domain)) {
|
|
22831
|
+
return domainToMappings[wwwBaseDomain];
|
|
22832
|
+
}
|
|
22833
|
+
}
|
|
22834
|
+
return rootDomainMappings ?? [];
|
|
22835
|
+
}
|
|
22836
|
+
function resolveRootDomain(domain, domainToMappings) {
|
|
22837
|
+
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
22838
|
+
const [, ...rooDomainSegments] = domain.split(".");
|
|
22839
|
+
return rooDomainSegments.join(".") === entryDomain;
|
|
22840
|
+
})?.[1];
|
|
22841
|
+
}
|
|
22842
|
+
function isBaseDomain(domain) {
|
|
22843
|
+
return !!domain.match(/\._base_domain_$/);
|
|
22844
|
+
}
|
|
22845
|
+
function injectDataIntoProtoPath(protoPath, data) {
|
|
22846
|
+
return protoPath.split("/").map((path) => maybeProtoPathToData(path, data)).join("/");
|
|
22847
|
+
}
|
|
22848
|
+
function maybeProtoPathToData(protoPath, data) {
|
|
22849
|
+
const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];
|
|
22850
|
+
const field = protoRegExpMatch[1];
|
|
22851
|
+
if (field) {
|
|
22852
|
+
const suffix = protoPath.replace(protoRegExpMatch[0], "");
|
|
22853
|
+
return findByPath(data, field, protoPath, suffix);
|
|
22854
|
+
}
|
|
22855
|
+
return protoPath;
|
|
22856
|
+
}
|
|
22857
|
+
function findByPath(obj, path, defaultValue, suffix) {
|
|
22858
|
+
let result2 = obj;
|
|
22859
|
+
for (const field of path.split(".")) {
|
|
22860
|
+
if (!result2) {
|
|
22861
|
+
return defaultValue;
|
|
22862
|
+
}
|
|
22863
|
+
result2 = result2[field];
|
|
22864
|
+
}
|
|
22865
|
+
return `${result2}${suffix}`;
|
|
22866
|
+
}
|
|
22867
|
+
function resolvePathFromMappings(protoPath, mappings) {
|
|
22868
|
+
const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
|
|
22869
|
+
if (!mapping) {
|
|
22870
|
+
return protoPath;
|
|
22871
|
+
}
|
|
22872
|
+
return mapping.srcPath + protoPath.slice(mapping.destPath.length);
|
|
22873
|
+
}
|
|
22874
|
+
var DOMAINS, USER_DOMAIN, REGEX_CAPTURE_DOMAINS, WIX_API_DOMAINS, DEV_WIX_CODE_DOMAIN, REGEX_CAPTURE_PROTO_FIELD, REGEX_CAPTURE_API_DOMAINS, REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, wwwBaseDomain;
|
|
22875
|
+
var init_rest_modules = __esm({
|
|
22876
|
+
"../../node_modules/@wix/sdk-runtime/build/rest-modules.js"() {
|
|
22877
|
+
init_context_v2();
|
|
22878
|
+
DOMAINS = ["wix.com", "editorx.com"];
|
|
22879
|
+
USER_DOMAIN = "_";
|
|
22880
|
+
REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
22881
|
+
WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
|
|
22882
|
+
DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
22883
|
+
REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
22884
|
+
REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
22885
|
+
REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
22886
|
+
wwwBaseDomain = "www._base_domain_";
|
|
22887
|
+
}
|
|
22888
|
+
});
|
|
22889
|
+
|
|
22453
22890
|
// ../../node_modules/@wix/json-proto-serializer/node_modules/long/src/long.js
|
|
22454
22891
|
var require_long = __commonJS({
|
|
22455
22892
|
"../../node_modules/@wix/json-proto-serializer/node_modules/long/src/long.js"(exports, module) {
|
|
@@ -24230,7 +24667,7 @@ function isCI() {
|
|
|
24230
24667
|
function isNode() {
|
|
24231
24668
|
return typeof process !== "undefined" && process.versions?.node != null;
|
|
24232
24669
|
}
|
|
24233
|
-
var
|
|
24670
|
+
var init_utils3 = __esm({
|
|
24234
24671
|
"../../node_modules/@wix/headers/dist/esm/utils.js"() {
|
|
24235
24672
|
}
|
|
24236
24673
|
});
|
|
@@ -24244,7 +24681,7 @@ function artifactId(override) {
|
|
|
24244
24681
|
}
|
|
24245
24682
|
var init_artifact_id = __esm({
|
|
24246
24683
|
"../../node_modules/@wix/headers/dist/esm/headers/artifact-id.js"() {
|
|
24247
|
-
|
|
24684
|
+
init_utils3();
|
|
24248
24685
|
}
|
|
24249
24686
|
});
|
|
24250
24687
|
|
|
@@ -36905,248 +37342,54 @@ var City = (_ref) => {
|
|
|
36905
37342
|
}),
|
|
36906
37343
|
renderInput: () => /* @__PURE__ */ React42__namespace.default.createElement(reactAriaComponents.TextField, {
|
|
36907
37344
|
value: value ?? "",
|
|
36908
|
-
onChange,
|
|
36909
|
-
isDisabled: disabled,
|
|
36910
|
-
isRequired: required,
|
|
36911
|
-
isInvalid: hasError,
|
|
36912
|
-
onBlur,
|
|
36913
|
-
onFocus
|
|
36914
|
-
}, inputElement),
|
|
36915
|
-
renderDescription: () => /* @__PURE__ */ React42__namespace.default.createElement(React42__namespace.default.Fragment, null, descriptionElement, errorElement)
|
|
36916
|
-
});
|
|
36917
|
-
};
|
|
36918
|
-
var Input4 = (_ref2) => {
|
|
36919
|
-
let {
|
|
36920
|
-
className
|
|
36921
|
-
} = _ref2;
|
|
36922
|
-
const {
|
|
36923
|
-
id
|
|
36924
|
-
} = useFieldPropsV2();
|
|
36925
|
-
const {
|
|
36926
|
-
inputId,
|
|
36927
|
-
ariaDescribedBy
|
|
36928
|
-
} = useFieldAttributes2();
|
|
36929
|
-
const inputRef = React42.useRef(null);
|
|
36930
|
-
useFocusFieldEvent(() => {
|
|
36931
|
-
var _inputRef$current;
|
|
36932
|
-
(_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
|
|
36933
|
-
}, id);
|
|
36934
|
-
return /* @__PURE__ */ React42__namespace.default.createElement(reactAriaComponents.Input, {
|
|
36935
|
-
ref: inputRef,
|
|
36936
|
-
id: inputId,
|
|
36937
|
-
"aria-describedby": ariaDescribedBy,
|
|
36938
|
-
className
|
|
36939
|
-
});
|
|
36940
|
-
};
|
|
36941
|
-
City.Label = Label;
|
|
36942
|
-
City.Input = Input4;
|
|
36943
|
-
City.Description = Description;
|
|
36944
|
-
City.Error = Error2;
|
|
36945
|
-
|
|
36946
|
-
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
36947
|
-
var es_exports = {};
|
|
36948
|
-
__export(es_exports, {
|
|
36949
|
-
SubdivisionType: () => SubdivisionType,
|
|
36950
|
-
getPlace: () => getPlace4
|
|
36951
|
-
});
|
|
36952
|
-
|
|
36953
|
-
// ../../node_modules/@wix/sdk-runtime/build/constants.js
|
|
36954
|
-
var SDKRequestToRESTRequestRenameMap = {
|
|
36955
|
-
_id: "id",
|
|
36956
|
-
_createdDate: "createdDate",
|
|
36957
|
-
_updatedDate: "updatedDate"
|
|
36958
|
-
};
|
|
36959
|
-
var RESTResponseToSDKResponseRenameMap = {
|
|
36960
|
-
id: "_id",
|
|
36961
|
-
createdDate: "_createdDate",
|
|
36962
|
-
updatedDate: "_updatedDate"
|
|
36963
|
-
};
|
|
36964
|
-
|
|
36965
|
-
// ../../node_modules/@wix/sdk-runtime/build/utils.js
|
|
36966
|
-
function removeUndefinedKeys(obj) {
|
|
36967
|
-
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
36968
|
-
}
|
|
36969
|
-
function constantCase(input) {
|
|
36970
|
-
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
36971
|
-
}
|
|
36972
|
-
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
36973
|
-
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
36974
|
-
var SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
36975
|
-
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
36976
|
-
function split(value) {
|
|
36977
|
-
let result2 = value.trim();
|
|
36978
|
-
result2 = result2.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
36979
|
-
result2 = result2.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
36980
|
-
let start = 0;
|
|
36981
|
-
let end = result2.length;
|
|
36982
|
-
while (result2.charAt(start) === "\0") {
|
|
36983
|
-
start++;
|
|
36984
|
-
}
|
|
36985
|
-
if (start === end) {
|
|
36986
|
-
return [];
|
|
36987
|
-
}
|
|
36988
|
-
while (result2.charAt(end - 1) === "\0") {
|
|
36989
|
-
end--;
|
|
36990
|
-
}
|
|
36991
|
-
return result2.slice(start, end).split(/\0/g);
|
|
36992
|
-
}
|
|
36993
|
-
|
|
36994
|
-
// ../../node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
36995
|
-
var isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
36996
|
-
var isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
36997
|
-
var isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
36998
|
-
function transformError(httpClientError, pathsToArguments = {
|
|
36999
|
-
explicitPathsToArguments: {},
|
|
37000
|
-
spreadPathsToArguments: {},
|
|
37001
|
-
singleArgumentUnchanged: false
|
|
37002
|
-
}, argumentNames = []) {
|
|
37003
|
-
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
37004
|
-
throw httpClientError;
|
|
37005
|
-
}
|
|
37006
|
-
if (isValidationError(httpClientError)) {
|
|
37007
|
-
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
37008
|
-
}
|
|
37009
|
-
if (isApplicationError(httpClientError)) {
|
|
37010
|
-
return buildApplicationError(httpClientError);
|
|
37011
|
-
}
|
|
37012
|
-
if (isClientError(httpClientError)) {
|
|
37013
|
-
const status = httpClientError.response?.status;
|
|
37014
|
-
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
37015
|
-
const message = httpClientError.response?.data?.message ?? statusText;
|
|
37016
|
-
const details = {
|
|
37017
|
-
applicationError: {
|
|
37018
|
-
description: statusText,
|
|
37019
|
-
code: constantCase(statusText),
|
|
37020
|
-
data: {}
|
|
37021
|
-
},
|
|
37022
|
-
requestId: httpClientError.requestId
|
|
37023
|
-
};
|
|
37024
|
-
return wrapError(httpClientError, {
|
|
37025
|
-
message: JSON.stringify({
|
|
37026
|
-
message,
|
|
37027
|
-
details
|
|
37028
|
-
}, null, 2),
|
|
37029
|
-
extraProperties: {
|
|
37030
|
-
details,
|
|
37031
|
-
status
|
|
37032
|
-
}
|
|
37033
|
-
});
|
|
37034
|
-
}
|
|
37035
|
-
return buildSystemError(httpClientError);
|
|
37036
|
-
}
|
|
37037
|
-
var buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
37038
|
-
const validationErrorResponse = httpClientError.response?.data;
|
|
37039
|
-
const requestId = httpClientError.requestId;
|
|
37040
|
-
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
37041
|
-
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
37042
|
-
const message = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
37043
|
-
const details = {
|
|
37044
|
-
validationError: { fieldViolations: transformedFieldViolations },
|
|
37045
|
-
requestId
|
|
37046
|
-
};
|
|
37047
|
-
return wrapError(httpClientError, {
|
|
37048
|
-
message: JSON.stringify({ message, details }, null, 2),
|
|
37049
|
-
extraProperties: {
|
|
37050
|
-
details,
|
|
37051
|
-
status: httpClientError.response?.status,
|
|
37052
|
-
requestId
|
|
37053
|
-
}
|
|
37054
|
-
});
|
|
37055
|
-
};
|
|
37056
|
-
var wrapError = (baseError, { message, extraProperties }) => {
|
|
37057
|
-
return Object.assign(baseError, {
|
|
37058
|
-
...extraProperties,
|
|
37059
|
-
message
|
|
37060
|
-
});
|
|
37061
|
-
};
|
|
37062
|
-
var buildApplicationError = (httpClientError) => {
|
|
37063
|
-
const status = httpClientError.response?.status;
|
|
37064
|
-
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
37065
|
-
const message = httpClientError.response?.data?.message ?? statusText;
|
|
37066
|
-
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
37067
|
-
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
37068
|
-
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
37069
|
-
const combinedMessage = message === description ? message : `${message}: ${description}`;
|
|
37070
|
-
const details = {
|
|
37071
|
-
applicationError: {
|
|
37072
|
-
description,
|
|
37073
|
-
code,
|
|
37074
|
-
data
|
|
37075
|
-
},
|
|
37076
|
-
requestId: httpClientError.requestId
|
|
37077
|
-
};
|
|
37078
|
-
return wrapError(httpClientError, {
|
|
37079
|
-
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
37080
|
-
extraProperties: {
|
|
37081
|
-
details,
|
|
37082
|
-
status,
|
|
37083
|
-
requestId: httpClientError.requestId
|
|
37084
|
-
}
|
|
37085
|
-
});
|
|
37086
|
-
};
|
|
37087
|
-
var buildSystemError = (httpClientError) => {
|
|
37088
|
-
const message = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
37089
|
-
return wrapError(httpClientError, {
|
|
37090
|
-
message,
|
|
37091
|
-
extraProperties: {
|
|
37092
|
-
requestId: httpClientError.requestId,
|
|
37093
|
-
status: httpClientError.response?.status,
|
|
37094
|
-
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
37095
|
-
...!httpClientError.response && {
|
|
37096
|
-
runtimeError: httpClientError
|
|
37097
|
-
}
|
|
37098
|
-
}
|
|
37345
|
+
onChange,
|
|
37346
|
+
isDisabled: disabled,
|
|
37347
|
+
isRequired: required,
|
|
37348
|
+
isInvalid: hasError,
|
|
37349
|
+
onBlur,
|
|
37350
|
+
onFocus
|
|
37351
|
+
}, inputElement),
|
|
37352
|
+
renderDescription: () => /* @__PURE__ */ React42__namespace.default.createElement(React42__namespace.default.Fragment, null, descriptionElement, errorElement)
|
|
37099
37353
|
});
|
|
37100
37354
|
};
|
|
37101
|
-
var
|
|
37102
|
-
|
|
37103
|
-
|
|
37104
|
-
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
|
|
37112
|
-
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
|
|
37116
|
-
|
|
37117
|
-
|
|
37118
|
-
|
|
37119
|
-
|
|
37120
|
-
|
|
37121
|
-
|
|
37122
|
-
return {
|
|
37123
|
-
...fieldViolation,
|
|
37124
|
-
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
37125
|
-
};
|
|
37126
|
-
}
|
|
37127
|
-
}
|
|
37128
|
-
if (singleArgumentUnchanged) {
|
|
37129
|
-
return {
|
|
37130
|
-
...fieldViolation,
|
|
37131
|
-
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
37132
|
-
};
|
|
37133
|
-
}
|
|
37134
|
-
return fieldViolation;
|
|
37355
|
+
var Input4 = (_ref2) => {
|
|
37356
|
+
let {
|
|
37357
|
+
className
|
|
37358
|
+
} = _ref2;
|
|
37359
|
+
const {
|
|
37360
|
+
id
|
|
37361
|
+
} = useFieldPropsV2();
|
|
37362
|
+
const {
|
|
37363
|
+
inputId,
|
|
37364
|
+
ariaDescribedBy
|
|
37365
|
+
} = useFieldAttributes2();
|
|
37366
|
+
const inputRef = React42.useRef(null);
|
|
37367
|
+
useFocusFieldEvent(() => {
|
|
37368
|
+
var _inputRef$current;
|
|
37369
|
+
(_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
|
|
37370
|
+
}, id);
|
|
37371
|
+
return /* @__PURE__ */ React42__namespace.default.createElement(reactAriaComponents.Input, {
|
|
37372
|
+
ref: inputRef,
|
|
37373
|
+
id: inputId,
|
|
37374
|
+
"aria-describedby": ariaDescribedBy,
|
|
37375
|
+
className
|
|
37135
37376
|
});
|
|
37136
37377
|
};
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
|
|
37141
|
-
|
|
37142
|
-
|
|
37143
|
-
};
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
};
|
|
37378
|
+
City.Label = Label;
|
|
37379
|
+
City.Input = Input4;
|
|
37380
|
+
City.Description = Description;
|
|
37381
|
+
City.Error = Error2;
|
|
37382
|
+
|
|
37383
|
+
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37384
|
+
var es_exports = {};
|
|
37385
|
+
__export(es_exports, {
|
|
37386
|
+
SubdivisionType: () => SubdivisionType,
|
|
37387
|
+
getPlace: () => getPlace4
|
|
37388
|
+
});
|
|
37389
|
+
init_transform_error();
|
|
37148
37390
|
|
|
37149
37391
|
// ../../node_modules/@wix/sdk-runtime/build/rename-all-nested-keys.js
|
|
37392
|
+
init_constants3();
|
|
37150
37393
|
function renameAllNestedKeys(payload, renameMap, ignorePaths) {
|
|
37151
37394
|
const isIgnored = (path) => ignorePaths.includes(path);
|
|
37152
37395
|
const traverse = (obj, path) => {
|
|
@@ -37191,214 +37434,8 @@ function renameKeysFromRESTResponseToSDKResponse(payload, ignorePaths = []) {
|
|
|
37191
37434
|
return renameAllNestedKeys(payload, RESTResponseToSDKResponseRenameMap, ignorePaths);
|
|
37192
37435
|
}
|
|
37193
37436
|
|
|
37194
|
-
// ../../node_modules/@wix/
|
|
37195
|
-
|
|
37196
|
-
function resolveContext() {
|
|
37197
|
-
const oldContext = typeof $wixContext !== "undefined" && $wixContext.initWixModules ? $wixContext.initWixModules : typeof globalThis.__wix_context__ !== "undefined" && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
37198
|
-
if (oldContext) {
|
|
37199
|
-
return {
|
|
37200
|
-
// @ts-expect-error
|
|
37201
|
-
initWixModules(modules, elevated) {
|
|
37202
|
-
return runWithoutContext(() => oldContext(modules, elevated));
|
|
37203
|
-
},
|
|
37204
|
-
fetchWithAuth() {
|
|
37205
|
-
throw new Error("fetchWithAuth is not available in this context");
|
|
37206
|
-
},
|
|
37207
|
-
graphql() {
|
|
37208
|
-
throw new Error("graphql is not available in this context");
|
|
37209
|
-
}
|
|
37210
|
-
};
|
|
37211
|
-
}
|
|
37212
|
-
const contextualClient = typeof $wixContext !== "undefined" ? $wixContext.client : typeof wixContext.client !== "undefined" ? wixContext.client : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.client : void 0;
|
|
37213
|
-
const elevatedClient = typeof $wixContext !== "undefined" ? $wixContext.elevatedClient : typeof wixContext.elevatedClient !== "undefined" ? wixContext.elevatedClient : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.elevatedClient : void 0;
|
|
37214
|
-
if (!contextualClient && !elevatedClient) {
|
|
37215
|
-
return;
|
|
37216
|
-
}
|
|
37217
|
-
return {
|
|
37218
|
-
initWixModules(wixModules, elevated) {
|
|
37219
|
-
if (elevated) {
|
|
37220
|
-
if (!elevatedClient) {
|
|
37221
|
-
throw new Error("An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules");
|
|
37222
|
-
}
|
|
37223
|
-
return runWithoutContext(() => elevatedClient.use(wixModules));
|
|
37224
|
-
}
|
|
37225
|
-
if (!contextualClient) {
|
|
37226
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
37227
|
-
}
|
|
37228
|
-
return runWithoutContext(() => contextualClient.use(wixModules));
|
|
37229
|
-
},
|
|
37230
|
-
fetchWithAuth: (urlOrRequest, requestInit) => {
|
|
37231
|
-
if (!contextualClient) {
|
|
37232
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
37233
|
-
}
|
|
37234
|
-
return contextualClient.fetchWithAuth(urlOrRequest, requestInit);
|
|
37235
|
-
},
|
|
37236
|
-
getAuth() {
|
|
37237
|
-
if (!contextualClient) {
|
|
37238
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
37239
|
-
}
|
|
37240
|
-
return contextualClient.auth;
|
|
37241
|
-
},
|
|
37242
|
-
async graphql(query, variables, opts) {
|
|
37243
|
-
if (!contextualClient) {
|
|
37244
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
37245
|
-
}
|
|
37246
|
-
return contextualClient.graphql(query, variables, opts);
|
|
37247
|
-
}
|
|
37248
|
-
};
|
|
37249
|
-
}
|
|
37250
|
-
function runWithoutContext(fn) {
|
|
37251
|
-
const globalContext = globalThis.__wix_context__;
|
|
37252
|
-
const moduleContext = {
|
|
37253
|
-
client: wixContext.client,
|
|
37254
|
-
elevatedClient: wixContext.elevatedClient
|
|
37255
|
-
};
|
|
37256
|
-
let closureContext;
|
|
37257
|
-
globalThis.__wix_context__ = void 0;
|
|
37258
|
-
wixContext.client = void 0;
|
|
37259
|
-
wixContext.elevatedClient = void 0;
|
|
37260
|
-
if (typeof $wixContext !== "undefined") {
|
|
37261
|
-
closureContext = {
|
|
37262
|
-
client: $wixContext?.client,
|
|
37263
|
-
elevatedClient: $wixContext?.elevatedClient
|
|
37264
|
-
};
|
|
37265
|
-
delete $wixContext.client;
|
|
37266
|
-
delete $wixContext.elevatedClient;
|
|
37267
|
-
}
|
|
37268
|
-
try {
|
|
37269
|
-
return fn();
|
|
37270
|
-
} finally {
|
|
37271
|
-
globalThis.__wix_context__ = globalContext;
|
|
37272
|
-
wixContext.client = moduleContext.client;
|
|
37273
|
-
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
37274
|
-
if (typeof $wixContext !== "undefined") {
|
|
37275
|
-
$wixContext.client = closureContext.client;
|
|
37276
|
-
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
37277
|
-
}
|
|
37278
|
-
}
|
|
37279
|
-
}
|
|
37280
|
-
|
|
37281
|
-
// ../../node_modules/@wix/sdk-runtime/build/context-v2.js
|
|
37282
|
-
function contextualizeRESTModuleV2(restModule, elevated) {
|
|
37283
|
-
return ((...args) => {
|
|
37284
|
-
const context = resolveContext();
|
|
37285
|
-
if (!context) {
|
|
37286
|
-
return restModule.apply(void 0, args);
|
|
37287
|
-
}
|
|
37288
|
-
return context.initWixModules(restModule, elevated).apply(void 0, args);
|
|
37289
|
-
});
|
|
37290
|
-
}
|
|
37291
|
-
|
|
37292
|
-
// ../../node_modules/@wix/sdk-runtime/build/rest-modules.js
|
|
37293
|
-
function createRESTModule(descriptor, elevated = false) {
|
|
37294
|
-
return contextualizeRESTModuleV2(descriptor, elevated);
|
|
37295
|
-
}
|
|
37296
|
-
function toURLSearchParams(params, isComplexRequest) {
|
|
37297
|
-
const flatten = flattenParams(params);
|
|
37298
|
-
Object.entries(flatten).some(([key, value]) => key.includes(".") || Array.isArray(value) && value.some((v) => typeof v === "object"));
|
|
37299
|
-
{
|
|
37300
|
-
return Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {
|
|
37301
|
-
const keyParams = Array.isArray(value) ? value : [value];
|
|
37302
|
-
keyParams.forEach((param) => {
|
|
37303
|
-
if (param === void 0 || param === null || Array.isArray(value) && typeof param === "object") {
|
|
37304
|
-
return;
|
|
37305
|
-
}
|
|
37306
|
-
urlSearchParams.append(key, param);
|
|
37307
|
-
});
|
|
37308
|
-
return urlSearchParams;
|
|
37309
|
-
}, new URLSearchParams());
|
|
37310
|
-
}
|
|
37311
|
-
}
|
|
37312
|
-
function resolveUrl(opts) {
|
|
37313
|
-
const domain = resolveDomain(opts.host);
|
|
37314
|
-
const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);
|
|
37315
|
-
const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});
|
|
37316
|
-
return resolvePathFromMappings(path, mappings);
|
|
37317
|
-
}
|
|
37318
|
-
function flattenParams(data, path = "") {
|
|
37319
|
-
const params = {};
|
|
37320
|
-
Object.entries(data).forEach(([key, value]) => {
|
|
37321
|
-
const isObject5 = value !== null && typeof value === "object" && !Array.isArray(value);
|
|
37322
|
-
const fieldPath = resolvePath(path, key);
|
|
37323
|
-
if (isObject5) {
|
|
37324
|
-
const serializedObject = flattenParams(value, fieldPath);
|
|
37325
|
-
Object.assign(params, serializedObject);
|
|
37326
|
-
} else {
|
|
37327
|
-
params[fieldPath] = value;
|
|
37328
|
-
}
|
|
37329
|
-
});
|
|
37330
|
-
return params;
|
|
37331
|
-
}
|
|
37332
|
-
function resolvePath(path, key) {
|
|
37333
|
-
return `${path}${path ? "." : ""}${key}`;
|
|
37334
|
-
}
|
|
37335
|
-
var DOMAINS = ["wix.com", "editorx.com"];
|
|
37336
|
-
var USER_DOMAIN = "_";
|
|
37337
|
-
var REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
37338
|
-
var WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
|
|
37339
|
-
var DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
37340
|
-
var REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
37341
|
-
var REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
37342
|
-
var REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
37343
|
-
function resolveDomain(host) {
|
|
37344
|
-
const resolvedHost = fixHostExceptions(host);
|
|
37345
|
-
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, "._base_domain_").replace(REGEX_CAPTURE_API_DOMAINS, "._api_base_domain_").replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, "*.dev.wix-code.com");
|
|
37346
|
-
}
|
|
37347
|
-
function fixHostExceptions(host) {
|
|
37348
|
-
return host.replace("create.editorx.com", "editor.editorx.com");
|
|
37349
|
-
}
|
|
37350
|
-
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
37351
|
-
const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];
|
|
37352
|
-
if (mappings) {
|
|
37353
|
-
return mappings;
|
|
37354
|
-
}
|
|
37355
|
-
const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
|
|
37356
|
-
if (!rootDomainMappings) {
|
|
37357
|
-
if (isBaseDomain(domain)) {
|
|
37358
|
-
return domainToMappings[wwwBaseDomain];
|
|
37359
|
-
}
|
|
37360
|
-
}
|
|
37361
|
-
return rootDomainMappings ?? [];
|
|
37362
|
-
}
|
|
37363
|
-
function resolveRootDomain(domain, domainToMappings) {
|
|
37364
|
-
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
37365
|
-
const [, ...rooDomainSegments] = domain.split(".");
|
|
37366
|
-
return rooDomainSegments.join(".") === entryDomain;
|
|
37367
|
-
})?.[1];
|
|
37368
|
-
}
|
|
37369
|
-
function isBaseDomain(domain) {
|
|
37370
|
-
return !!domain.match(/\._base_domain_$/);
|
|
37371
|
-
}
|
|
37372
|
-
var wwwBaseDomain = "www._base_domain_";
|
|
37373
|
-
function injectDataIntoProtoPath(protoPath, data) {
|
|
37374
|
-
return protoPath.split("/").map((path) => maybeProtoPathToData(path, data)).join("/");
|
|
37375
|
-
}
|
|
37376
|
-
function maybeProtoPathToData(protoPath, data) {
|
|
37377
|
-
const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];
|
|
37378
|
-
const field = protoRegExpMatch[1];
|
|
37379
|
-
if (field) {
|
|
37380
|
-
const suffix = protoPath.replace(protoRegExpMatch[0], "");
|
|
37381
|
-
return findByPath(data, field, protoPath, suffix);
|
|
37382
|
-
}
|
|
37383
|
-
return protoPath;
|
|
37384
|
-
}
|
|
37385
|
-
function findByPath(obj, path, defaultValue, suffix) {
|
|
37386
|
-
let result2 = obj;
|
|
37387
|
-
for (const field of path.split(".")) {
|
|
37388
|
-
if (!result2) {
|
|
37389
|
-
return defaultValue;
|
|
37390
|
-
}
|
|
37391
|
-
result2 = result2[field];
|
|
37392
|
-
}
|
|
37393
|
-
return `${result2}${suffix}`;
|
|
37394
|
-
}
|
|
37395
|
-
function resolvePathFromMappings(protoPath, mappings) {
|
|
37396
|
-
const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
|
|
37397
|
-
if (!mapping) {
|
|
37398
|
-
return protoPath;
|
|
37399
|
-
}
|
|
37400
|
-
return mapping.srcPath + protoPath.slice(mapping.destPath.length);
|
|
37401
|
-
}
|
|
37437
|
+
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37438
|
+
init_rest_modules();
|
|
37402
37439
|
|
|
37403
37440
|
// ../../node_modules/@wix/sdk-runtime/build/transformations/float.js
|
|
37404
37441
|
function transformSDKFloatToRESTFloat(val) {
|
|
@@ -37447,7 +37484,11 @@ function transformPaths(obj, transformations) {
|
|
|
37447
37484
|
return transformations.reduce((acc, { paths, transformFn }) => paths.reduce((transformerAcc, path) => transformPath(transformerAcc, path, transformFn), acc), obj);
|
|
37448
37485
|
}
|
|
37449
37486
|
|
|
37487
|
+
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37488
|
+
init_rest_modules();
|
|
37489
|
+
|
|
37450
37490
|
// ../../node_modules/@wix/sdk-runtime/build/transformations/address.js
|
|
37491
|
+
init_utils2();
|
|
37451
37492
|
function transformRESTAddressToSDKAddress(payload) {
|
|
37452
37493
|
return payload && removeUndefinedKeys({
|
|
37453
37494
|
formatted: payload.formattedAddress,
|
|
@@ -37471,6 +37512,7 @@ function transformRESTAddressToSDKAddress(payload) {
|
|
|
37471
37512
|
}
|
|
37472
37513
|
|
|
37473
37514
|
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37515
|
+
init_rest_modules();
|
|
37474
37516
|
function resolveComWixpressViAtlasServiceV2PlacesServiceV2Url(opts) {
|
|
37475
37517
|
const domainToMappings = {
|
|
37476
37518
|
"api._api_base_domain_": [
|
|
@@ -37681,6 +37723,9 @@ __export(es_exports2, {
|
|
|
37681
37723
|
FilterType: () => FilterType2,
|
|
37682
37724
|
predict: () => predict4
|
|
37683
37725
|
});
|
|
37726
|
+
init_transform_error();
|
|
37727
|
+
init_rest_modules();
|
|
37728
|
+
init_rest_modules();
|
|
37684
37729
|
function resolveComWixpressViAtlasServiceV2AutocompleteServiceV2Url(opts) {
|
|
37685
37730
|
const domainToMappings = {
|
|
37686
37731
|
"api._api_base_domain_": [
|