@wix/form-public 0.204.0 → 0.206.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 +563 -552
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +563 -552
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -510,6 +510,7 @@ var init_types_impl = __esm({
|
|
|
510
510
|
UploadFileFormat4["AUDIO"] = "AUDIO";
|
|
511
511
|
UploadFileFormat4["DOCUMENT"] = "DOCUMENT";
|
|
512
512
|
UploadFileFormat4["ARCHIVE"] = "ARCHIVE";
|
|
513
|
+
UploadFileFormat4["MODEL_3D"] = "MODEL_3D";
|
|
513
514
|
})(UploadFileFormat || (UploadFileFormat = {}));
|
|
514
515
|
(function(InputFieldPaymentComponentType3) {
|
|
515
516
|
InputFieldPaymentComponentType3["UNKNOWN_COMPONENT_TYPE"] = "UNKNOWN_COMPONENT_TYPE";
|
|
@@ -5068,6 +5069,451 @@ var init_max = __esm({
|
|
|
5068
5069
|
}
|
|
5069
5070
|
});
|
|
5070
5071
|
|
|
5072
|
+
// ../../node_modules/@wix/sdk-context/build/browser/index.mjs
|
|
5073
|
+
var wixContext;
|
|
5074
|
+
var init_browser = __esm({
|
|
5075
|
+
"../../node_modules/@wix/sdk-context/build/browser/index.mjs"() {
|
|
5076
|
+
wixContext = {};
|
|
5077
|
+
}
|
|
5078
|
+
});
|
|
5079
|
+
|
|
5080
|
+
// ../../node_modules/@wix/sdk-runtime/build/context-v2.js
|
|
5081
|
+
function contextualizeRESTModuleV2(restModule, elevated) {
|
|
5082
|
+
return ((...args) => {
|
|
5083
|
+
const context = resolveContext();
|
|
5084
|
+
if (!context) {
|
|
5085
|
+
return restModule.apply(void 0, args);
|
|
5086
|
+
}
|
|
5087
|
+
return context.initWixModules(restModule, elevated).apply(void 0, args);
|
|
5088
|
+
});
|
|
5089
|
+
}
|
|
5090
|
+
var init_context_v2 = __esm({
|
|
5091
|
+
"../../node_modules/@wix/sdk-runtime/build/context-v2.js"() {
|
|
5092
|
+
init_context();
|
|
5093
|
+
}
|
|
5094
|
+
});
|
|
5095
|
+
|
|
5096
|
+
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
5097
|
+
function resolveContext() {
|
|
5098
|
+
const oldContext = typeof $wixContext !== "undefined" && $wixContext.initWixModules ? $wixContext.initWixModules : typeof globalThis.__wix_context__ !== "undefined" && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
5099
|
+
if (oldContext) {
|
|
5100
|
+
return {
|
|
5101
|
+
// @ts-expect-error
|
|
5102
|
+
initWixModules(modules, elevated) {
|
|
5103
|
+
return runWithoutContext(() => oldContext(modules, elevated));
|
|
5104
|
+
},
|
|
5105
|
+
fetchWithAuth() {
|
|
5106
|
+
throw new Error("fetchWithAuth is not available in this context");
|
|
5107
|
+
},
|
|
5108
|
+
graphql() {
|
|
5109
|
+
throw new Error("graphql is not available in this context");
|
|
5110
|
+
}
|
|
5111
|
+
};
|
|
5112
|
+
}
|
|
5113
|
+
const contextualClient = typeof $wixContext !== "undefined" ? $wixContext.client : typeof wixContext.client !== "undefined" ? wixContext.client : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.client : void 0;
|
|
5114
|
+
const elevatedClient = typeof $wixContext !== "undefined" ? $wixContext.elevatedClient : typeof wixContext.elevatedClient !== "undefined" ? wixContext.elevatedClient : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.elevatedClient : void 0;
|
|
5115
|
+
if (!contextualClient && !elevatedClient) {
|
|
5116
|
+
return;
|
|
5117
|
+
}
|
|
5118
|
+
return {
|
|
5119
|
+
initWixModules(wixModules, elevated) {
|
|
5120
|
+
if (elevated) {
|
|
5121
|
+
if (!elevatedClient) {
|
|
5122
|
+
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");
|
|
5123
|
+
}
|
|
5124
|
+
return runWithoutContext(() => elevatedClient.use(wixModules));
|
|
5125
|
+
}
|
|
5126
|
+
if (!contextualClient) {
|
|
5127
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
5128
|
+
}
|
|
5129
|
+
return runWithoutContext(() => contextualClient.use(wixModules));
|
|
5130
|
+
},
|
|
5131
|
+
fetchWithAuth: (urlOrRequest, requestInit) => {
|
|
5132
|
+
if (!contextualClient) {
|
|
5133
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
5134
|
+
}
|
|
5135
|
+
return contextualClient.fetchWithAuth(urlOrRequest, requestInit);
|
|
5136
|
+
},
|
|
5137
|
+
getAuth() {
|
|
5138
|
+
if (!contextualClient) {
|
|
5139
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
5140
|
+
}
|
|
5141
|
+
return contextualClient.auth;
|
|
5142
|
+
},
|
|
5143
|
+
async graphql(query, variables, opts) {
|
|
5144
|
+
if (!contextualClient) {
|
|
5145
|
+
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
5146
|
+
}
|
|
5147
|
+
return contextualClient.graphql(query, variables, opts);
|
|
5148
|
+
}
|
|
5149
|
+
};
|
|
5150
|
+
}
|
|
5151
|
+
function runWithoutContext(fn) {
|
|
5152
|
+
const globalContext = globalThis.__wix_context__;
|
|
5153
|
+
const moduleContext = {
|
|
5154
|
+
client: wixContext.client,
|
|
5155
|
+
elevatedClient: wixContext.elevatedClient
|
|
5156
|
+
};
|
|
5157
|
+
let closureContext;
|
|
5158
|
+
globalThis.__wix_context__ = void 0;
|
|
5159
|
+
wixContext.client = void 0;
|
|
5160
|
+
wixContext.elevatedClient = void 0;
|
|
5161
|
+
if (typeof $wixContext !== "undefined") {
|
|
5162
|
+
closureContext = {
|
|
5163
|
+
client: $wixContext?.client,
|
|
5164
|
+
elevatedClient: $wixContext?.elevatedClient
|
|
5165
|
+
};
|
|
5166
|
+
delete $wixContext.client;
|
|
5167
|
+
delete $wixContext.elevatedClient;
|
|
5168
|
+
}
|
|
5169
|
+
try {
|
|
5170
|
+
return fn();
|
|
5171
|
+
} finally {
|
|
5172
|
+
globalThis.__wix_context__ = globalContext;
|
|
5173
|
+
wixContext.client = moduleContext.client;
|
|
5174
|
+
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
5175
|
+
if (typeof $wixContext !== "undefined") {
|
|
5176
|
+
$wixContext.client = closureContext.client;
|
|
5177
|
+
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
5178
|
+
}
|
|
5179
|
+
}
|
|
5180
|
+
}
|
|
5181
|
+
var init_context = __esm({
|
|
5182
|
+
"../../node_modules/@wix/sdk-runtime/build/context.js"() {
|
|
5183
|
+
init_browser();
|
|
5184
|
+
init_context_v2();
|
|
5185
|
+
}
|
|
5186
|
+
});
|
|
5187
|
+
|
|
5188
|
+
// ../../node_modules/@wix/sdk-runtime/build/constants.js
|
|
5189
|
+
var SDKRequestToRESTRequestRenameMap, RESTResponseToSDKResponseRenameMap;
|
|
5190
|
+
var init_constants = __esm({
|
|
5191
|
+
"../../node_modules/@wix/sdk-runtime/build/constants.js"() {
|
|
5192
|
+
SDKRequestToRESTRequestRenameMap = {
|
|
5193
|
+
_id: "id",
|
|
5194
|
+
_createdDate: "createdDate",
|
|
5195
|
+
_updatedDate: "updatedDate"
|
|
5196
|
+
};
|
|
5197
|
+
RESTResponseToSDKResponseRenameMap = {
|
|
5198
|
+
id: "_id",
|
|
5199
|
+
createdDate: "_createdDate",
|
|
5200
|
+
updatedDate: "_updatedDate"
|
|
5201
|
+
};
|
|
5202
|
+
}
|
|
5203
|
+
});
|
|
5204
|
+
|
|
5205
|
+
// ../../node_modules/@wix/sdk-runtime/build/utils.js
|
|
5206
|
+
function removeUndefinedKeys(obj) {
|
|
5207
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
5208
|
+
}
|
|
5209
|
+
function constantCase(input) {
|
|
5210
|
+
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
5211
|
+
}
|
|
5212
|
+
function split(value) {
|
|
5213
|
+
let result2 = value.trim();
|
|
5214
|
+
result2 = result2.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
5215
|
+
result2 = result2.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
5216
|
+
let start = 0;
|
|
5217
|
+
let end = result2.length;
|
|
5218
|
+
while (result2.charAt(start) === "\0") {
|
|
5219
|
+
start++;
|
|
5220
|
+
}
|
|
5221
|
+
if (start === end) {
|
|
5222
|
+
return [];
|
|
5223
|
+
}
|
|
5224
|
+
while (result2.charAt(end - 1) === "\0") {
|
|
5225
|
+
end--;
|
|
5226
|
+
}
|
|
5227
|
+
return result2.slice(start, end).split(/\0/g);
|
|
5228
|
+
}
|
|
5229
|
+
var SPLIT_LOWER_UPPER_RE, SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE, DEFAULT_STRIP_REGEXP;
|
|
5230
|
+
var init_utils2 = __esm({
|
|
5231
|
+
"../../node_modules/@wix/sdk-runtime/build/utils.js"() {
|
|
5232
|
+
SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
5233
|
+
SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
5234
|
+
SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
5235
|
+
DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
5236
|
+
}
|
|
5237
|
+
});
|
|
5238
|
+
|
|
5239
|
+
// ../../node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
5240
|
+
function transformError(httpClientError, pathsToArguments = {
|
|
5241
|
+
explicitPathsToArguments: {},
|
|
5242
|
+
spreadPathsToArguments: {},
|
|
5243
|
+
singleArgumentUnchanged: false
|
|
5244
|
+
}, argumentNames = []) {
|
|
5245
|
+
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
5246
|
+
throw httpClientError;
|
|
5247
|
+
}
|
|
5248
|
+
if (isValidationError(httpClientError)) {
|
|
5249
|
+
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
5250
|
+
}
|
|
5251
|
+
if (isApplicationError(httpClientError)) {
|
|
5252
|
+
return buildApplicationError(httpClientError);
|
|
5253
|
+
}
|
|
5254
|
+
if (isClientError(httpClientError)) {
|
|
5255
|
+
const status = httpClientError.response?.status;
|
|
5256
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
5257
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
5258
|
+
const details = {
|
|
5259
|
+
applicationError: {
|
|
5260
|
+
description: statusText,
|
|
5261
|
+
code: constantCase(statusText),
|
|
5262
|
+
data: {}
|
|
5263
|
+
},
|
|
5264
|
+
requestId: httpClientError.requestId
|
|
5265
|
+
};
|
|
5266
|
+
return wrapError(httpClientError, {
|
|
5267
|
+
message: JSON.stringify({
|
|
5268
|
+
message,
|
|
5269
|
+
details
|
|
5270
|
+
}, null, 2),
|
|
5271
|
+
extraProperties: {
|
|
5272
|
+
details,
|
|
5273
|
+
status
|
|
5274
|
+
}
|
|
5275
|
+
});
|
|
5276
|
+
}
|
|
5277
|
+
return buildSystemError(httpClientError);
|
|
5278
|
+
}
|
|
5279
|
+
var isValidationError, isApplicationError, isClientError, buildValidationError, wrapError, buildApplicationError, buildSystemError, violationsWithRenamedFields, withRenamedArgument, getArgumentIndex;
|
|
5280
|
+
var init_transform_error = __esm({
|
|
5281
|
+
"../../node_modules/@wix/sdk-runtime/build/transform-error.js"() {
|
|
5282
|
+
init_utils2();
|
|
5283
|
+
isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
5284
|
+
isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
5285
|
+
isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
5286
|
+
buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
5287
|
+
const validationErrorResponse = httpClientError.response?.data;
|
|
5288
|
+
const requestId = httpClientError.requestId;
|
|
5289
|
+
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
5290
|
+
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
5291
|
+
const message = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
5292
|
+
const details = {
|
|
5293
|
+
validationError: { fieldViolations: transformedFieldViolations },
|
|
5294
|
+
requestId
|
|
5295
|
+
};
|
|
5296
|
+
return wrapError(httpClientError, {
|
|
5297
|
+
message: JSON.stringify({ message, details }, null, 2),
|
|
5298
|
+
extraProperties: {
|
|
5299
|
+
details,
|
|
5300
|
+
status: httpClientError.response?.status,
|
|
5301
|
+
requestId
|
|
5302
|
+
}
|
|
5303
|
+
});
|
|
5304
|
+
};
|
|
5305
|
+
wrapError = (baseError, { message, extraProperties }) => {
|
|
5306
|
+
return Object.assign(baseError, {
|
|
5307
|
+
...extraProperties,
|
|
5308
|
+
message
|
|
5309
|
+
});
|
|
5310
|
+
};
|
|
5311
|
+
buildApplicationError = (httpClientError) => {
|
|
5312
|
+
const status = httpClientError.response?.status;
|
|
5313
|
+
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
5314
|
+
const message = httpClientError.response?.data?.message ?? statusText;
|
|
5315
|
+
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
5316
|
+
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
5317
|
+
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
5318
|
+
const combinedMessage = message === description ? message : `${message}: ${description}`;
|
|
5319
|
+
const details = {
|
|
5320
|
+
applicationError: {
|
|
5321
|
+
description,
|
|
5322
|
+
code,
|
|
5323
|
+
data
|
|
5324
|
+
},
|
|
5325
|
+
requestId: httpClientError.requestId
|
|
5326
|
+
};
|
|
5327
|
+
return wrapError(httpClientError, {
|
|
5328
|
+
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
5329
|
+
extraProperties: {
|
|
5330
|
+
details,
|
|
5331
|
+
status,
|
|
5332
|
+
requestId: httpClientError.requestId
|
|
5333
|
+
}
|
|
5334
|
+
});
|
|
5335
|
+
};
|
|
5336
|
+
buildSystemError = (httpClientError) => {
|
|
5337
|
+
const message = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
5338
|
+
return wrapError(httpClientError, {
|
|
5339
|
+
message,
|
|
5340
|
+
extraProperties: {
|
|
5341
|
+
requestId: httpClientError.requestId,
|
|
5342
|
+
status: httpClientError.response?.status,
|
|
5343
|
+
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
5344
|
+
...!httpClientError.response && {
|
|
5345
|
+
runtimeError: httpClientError
|
|
5346
|
+
}
|
|
5347
|
+
}
|
|
5348
|
+
});
|
|
5349
|
+
};
|
|
5350
|
+
violationsWithRenamedFields = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
5351
|
+
const allPathsToArguments = {
|
|
5352
|
+
...spreadPathsToArguments,
|
|
5353
|
+
...explicitPathsToArguments
|
|
5354
|
+
};
|
|
5355
|
+
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
5356
|
+
return fieldViolations?.filter((fieldViolation) => {
|
|
5357
|
+
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
5358
|
+
return !containedInAMoreSpecificViolationField;
|
|
5359
|
+
}).map((fieldViolation) => {
|
|
5360
|
+
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
5361
|
+
if (exactMatchArgumentExpression) {
|
|
5362
|
+
return {
|
|
5363
|
+
...fieldViolation,
|
|
5364
|
+
field: withRenamedArgument(exactMatchArgumentExpression, argumentNames)
|
|
5365
|
+
};
|
|
5366
|
+
}
|
|
5367
|
+
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path) => fieldViolation.field.startsWith(path));
|
|
5368
|
+
if (longestPartialPathMatch) {
|
|
5369
|
+
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
5370
|
+
if (partialMatchArgumentExpression) {
|
|
5371
|
+
return {
|
|
5372
|
+
...fieldViolation,
|
|
5373
|
+
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
5374
|
+
};
|
|
5375
|
+
}
|
|
5376
|
+
}
|
|
5377
|
+
if (singleArgumentUnchanged) {
|
|
5378
|
+
return {
|
|
5379
|
+
...fieldViolation,
|
|
5380
|
+
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
5381
|
+
};
|
|
5382
|
+
}
|
|
5383
|
+
return fieldViolation;
|
|
5384
|
+
});
|
|
5385
|
+
};
|
|
5386
|
+
withRenamedArgument = (fieldValue, argumentNames) => {
|
|
5387
|
+
const argIndex = getArgumentIndex(fieldValue);
|
|
5388
|
+
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
5389
|
+
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
5390
|
+
}
|
|
5391
|
+
return fieldValue;
|
|
5392
|
+
};
|
|
5393
|
+
getArgumentIndex = (s) => {
|
|
5394
|
+
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
5395
|
+
return match && match.groups && Number(match.groups.argIndex);
|
|
5396
|
+
};
|
|
5397
|
+
}
|
|
5398
|
+
});
|
|
5399
|
+
|
|
5400
|
+
// ../../node_modules/@wix/sdk-runtime/build/rest-modules.js
|
|
5401
|
+
function createRESTModule(descriptor, elevated = false) {
|
|
5402
|
+
return contextualizeRESTModuleV2(descriptor, elevated);
|
|
5403
|
+
}
|
|
5404
|
+
function toURLSearchParams(params, isComplexRequest) {
|
|
5405
|
+
const flatten = flattenParams(params);
|
|
5406
|
+
Object.entries(flatten).some(([key, value]) => key.includes(".") || Array.isArray(value) && value.some((v) => typeof v === "object"));
|
|
5407
|
+
{
|
|
5408
|
+
return Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {
|
|
5409
|
+
const keyParams = Array.isArray(value) ? value : [value];
|
|
5410
|
+
keyParams.forEach((param) => {
|
|
5411
|
+
if (param === void 0 || param === null || Array.isArray(value) && typeof param === "object") {
|
|
5412
|
+
return;
|
|
5413
|
+
}
|
|
5414
|
+
urlSearchParams.append(key, param);
|
|
5415
|
+
});
|
|
5416
|
+
return urlSearchParams;
|
|
5417
|
+
}, new URLSearchParams());
|
|
5418
|
+
}
|
|
5419
|
+
}
|
|
5420
|
+
function resolveUrl(opts) {
|
|
5421
|
+
const domain = resolveDomain(opts.host);
|
|
5422
|
+
const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);
|
|
5423
|
+
const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});
|
|
5424
|
+
return resolvePathFromMappings(path, mappings);
|
|
5425
|
+
}
|
|
5426
|
+
function flattenParams(data, path = "") {
|
|
5427
|
+
const params = {};
|
|
5428
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
5429
|
+
const isObject5 = value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5430
|
+
const fieldPath = resolvePath(path, key);
|
|
5431
|
+
if (isObject5) {
|
|
5432
|
+
const serializedObject = flattenParams(value, fieldPath);
|
|
5433
|
+
Object.assign(params, serializedObject);
|
|
5434
|
+
} else {
|
|
5435
|
+
params[fieldPath] = value;
|
|
5436
|
+
}
|
|
5437
|
+
});
|
|
5438
|
+
return params;
|
|
5439
|
+
}
|
|
5440
|
+
function resolvePath(path, key) {
|
|
5441
|
+
return `${path}${path ? "." : ""}${key}`;
|
|
5442
|
+
}
|
|
5443
|
+
function resolveDomain(host) {
|
|
5444
|
+
const resolvedHost = fixHostExceptions(host);
|
|
5445
|
+
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");
|
|
5446
|
+
}
|
|
5447
|
+
function fixHostExceptions(host) {
|
|
5448
|
+
return host.replace("create.editorx.com", "editor.editorx.com");
|
|
5449
|
+
}
|
|
5450
|
+
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
5451
|
+
const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];
|
|
5452
|
+
if (mappings) {
|
|
5453
|
+
return mappings;
|
|
5454
|
+
}
|
|
5455
|
+
const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
|
|
5456
|
+
if (!rootDomainMappings) {
|
|
5457
|
+
if (isBaseDomain(domain)) {
|
|
5458
|
+
return domainToMappings[wwwBaseDomain];
|
|
5459
|
+
}
|
|
5460
|
+
}
|
|
5461
|
+
return rootDomainMappings ?? [];
|
|
5462
|
+
}
|
|
5463
|
+
function resolveRootDomain(domain, domainToMappings) {
|
|
5464
|
+
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
5465
|
+
const [, ...rooDomainSegments] = domain.split(".");
|
|
5466
|
+
return rooDomainSegments.join(".") === entryDomain;
|
|
5467
|
+
})?.[1];
|
|
5468
|
+
}
|
|
5469
|
+
function isBaseDomain(domain) {
|
|
5470
|
+
return !!domain.match(/\._base_domain_$/);
|
|
5471
|
+
}
|
|
5472
|
+
function injectDataIntoProtoPath(protoPath, data) {
|
|
5473
|
+
return protoPath.split("/").map((path) => maybeProtoPathToData(path, data)).join("/");
|
|
5474
|
+
}
|
|
5475
|
+
function maybeProtoPathToData(protoPath, data) {
|
|
5476
|
+
const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];
|
|
5477
|
+
const field = protoRegExpMatch[1];
|
|
5478
|
+
if (field) {
|
|
5479
|
+
const suffix = protoPath.replace(protoRegExpMatch[0], "");
|
|
5480
|
+
return findByPath(data, field, protoPath, suffix);
|
|
5481
|
+
}
|
|
5482
|
+
return protoPath;
|
|
5483
|
+
}
|
|
5484
|
+
function findByPath(obj, path, defaultValue, suffix) {
|
|
5485
|
+
let result2 = obj;
|
|
5486
|
+
for (const field of path.split(".")) {
|
|
5487
|
+
if (!result2) {
|
|
5488
|
+
return defaultValue;
|
|
5489
|
+
}
|
|
5490
|
+
result2 = result2[field];
|
|
5491
|
+
}
|
|
5492
|
+
return `${result2}${suffix}`;
|
|
5493
|
+
}
|
|
5494
|
+
function resolvePathFromMappings(protoPath, mappings) {
|
|
5495
|
+
const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
|
|
5496
|
+
if (!mapping) {
|
|
5497
|
+
return protoPath;
|
|
5498
|
+
}
|
|
5499
|
+
return mapping.srcPath + protoPath.slice(mapping.destPath.length);
|
|
5500
|
+
}
|
|
5501
|
+
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;
|
|
5502
|
+
var init_rest_modules = __esm({
|
|
5503
|
+
"../../node_modules/@wix/sdk-runtime/build/rest-modules.js"() {
|
|
5504
|
+
init_context_v2();
|
|
5505
|
+
DOMAINS = ["wix.com", "editorx.com"];
|
|
5506
|
+
USER_DOMAIN = "_";
|
|
5507
|
+
REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
5508
|
+
WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
|
|
5509
|
+
DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
5510
|
+
REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
5511
|
+
REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
5512
|
+
REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
5513
|
+
wwwBaseDomain = "www._base_domain_";
|
|
5514
|
+
}
|
|
5515
|
+
});
|
|
5516
|
+
|
|
5071
5517
|
// ../../node_modules/@wix/ambassador-forms-v1-validation-result/es/build/types.impl.js
|
|
5072
5518
|
var ErrorType, Format2, DayOfWeek2, ValidationFormat2, ProductType2, PriceType2, FieldFieldType2, StringTypeFormatEnumFormat2, InputFieldStringComponentType2, NodeType2, WidthType2, PluginContainerDataAlignment2, Type2, Target2, TextAlignment2, LineStyle2, Width2, Alignment2, ViewMode2, LayoutType2, Orientation2, Crop2, ThumbnailsAlignment2, GIFType2, Source2, Position2, MapType3, ViewRole2, VoteRole2, PollLayoutType2, PollLayoutDirection2, BackgroundType2, DecorationType2, FontType2, ImageStylesPosition2, AspectRatio2, Resizing2, Placement2, CardStylesType2, CardStylesAlignment2, CardStylesLayout2, AppType2, InitialExpandedItems2, Direction2, VerticalAlignment2, NullValue2, Scaling2, LayoutDataImagePosition2, Origin2, VerticalAlignmentAlignment2, ResponsivenessBehaviour2, DesignTarget2, ImagePosition2, AlignmentEnumAlignment2, ImageFit2, NumberOfColumns2, FirstDayOfWeekEnumFirstDayOfWeek2, InputFieldNumberComponentType2, InputFieldBooleanComponentType2, ArrayItemsItemType2, PropertiesTypePropertiesTypeEnum2, ArrayComponentType2, InputFieldWixFileComponentType2, UploadFileFormat2, InputFieldPaymentComponentType2, AddressComponentType2, DefaultCountryConfigType2, ObjectArrayComponentType2, InputFieldSchedulingComponentType2, AppointmentFormat2, MeetingType2, StaffStrategySelection2, InputFieldInputType2, FormFieldContactInfoEmailInfoTag2, FormFieldContactInfoPhoneInfoTag2, AddressInfoTag2, ConfirmationLevel2, SubscriptionChannel2, FormFieldContactInfoContactField2, DisplayFieldDisplayFieldType2, OverrideEntityType2, Kind2, EmailInfoTag2, PhoneInfoTag2, Tag2, OptInLevel2, ContactField2, SpamFilterProtectionLevel2, RequiredIndicator2, RequiredIndicatorPlacement2, UrlTargetEnumTarget2, SubmitSuccessAction2, ChangeableProperty2, OverrideEntityTypeEnumOverrideEntityType2, Operator2, ResultsDisplay2, ContactAutofill2, ValidationMode, Feature, AscendPlan, ActionType;
|
|
5073
5519
|
var init_types_impl2 = __esm({
|
|
@@ -14144,7 +14590,7 @@ var init_getPossibleCountriesForNumber = __esm({
|
|
|
14144
14590
|
|
|
14145
14591
|
// ../../node_modules/libphonenumber-js/es6/constants.js
|
|
14146
14592
|
var MIN_LENGTH_FOR_NSN, MAX_LENGTH_FOR_NSN, MAX_LENGTH_COUNTRY_CODE, VALID_DIGITS, DASHES, SLASHES, DOTS, WHITESPACE, BRACKETS, TILDES, VALID_PUNCTUATION, PLUS_CHARS;
|
|
14147
|
-
var
|
|
14593
|
+
var init_constants2 = __esm({
|
|
14148
14594
|
"../../node_modules/libphonenumber-js/es6/constants.js"() {
|
|
14149
14595
|
MIN_LENGTH_FOR_NSN = 2;
|
|
14150
14596
|
MAX_LENGTH_FOR_NSN = 17;
|
|
@@ -14185,7 +14631,7 @@ var CAPTURING_DIGIT_PATTERN;
|
|
|
14185
14631
|
var init_stripIddPrefix = __esm({
|
|
14186
14632
|
"../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js"() {
|
|
14187
14633
|
init_metadata();
|
|
14188
|
-
|
|
14634
|
+
init_constants2();
|
|
14189
14635
|
CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
|
|
14190
14636
|
}
|
|
14191
14637
|
});
|
|
@@ -14458,7 +14904,7 @@ var init_extractCountryCallingCode = __esm({
|
|
|
14458
14904
|
init_stripIddPrefix();
|
|
14459
14905
|
init_extractCountryCallingCodeFromInternationalNumberWithoutPlusSign();
|
|
14460
14906
|
init_metadata();
|
|
14461
|
-
|
|
14907
|
+
init_constants2();
|
|
14462
14908
|
}
|
|
14463
14909
|
});
|
|
14464
14910
|
|
|
@@ -14468,7 +14914,7 @@ function applyInternationalSeparatorStyle(formattedNumber) {
|
|
|
14468
14914
|
}
|
|
14469
14915
|
var init_applyInternationalSeparatorStyle = __esm({
|
|
14470
14916
|
"../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js"() {
|
|
14471
|
-
|
|
14917
|
+
init_constants2();
|
|
14472
14918
|
}
|
|
14473
14919
|
});
|
|
14474
14920
|
|
|
@@ -14548,7 +14994,7 @@ function createExtensionPattern(purpose) {
|
|
|
14548
14994
|
var RFC3966_EXTN_PREFIX, getExtensionDigitsPattern;
|
|
14549
14995
|
var init_createExtensionPattern = __esm({
|
|
14550
14996
|
"../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"() {
|
|
14551
|
-
|
|
14997
|
+
init_constants2();
|
|
14552
14998
|
RFC3966_EXTN_PREFIX = ";ext=";
|
|
14553
14999
|
getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
|
|
14554
15000
|
return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
|
|
@@ -14566,7 +15012,7 @@ function isViablePhoneNumberStart(number) {
|
|
|
14566
15012
|
var MIN_LENGTH_PHONE_NUMBER_PATTERN, VALID_PHONE_NUMBER, VALID_PHONE_NUMBER_START_REG_EXP, VALID_PHONE_NUMBER_WITH_EXTENSION, VALID_PHONE_NUMBER_PATTERN;
|
|
14567
15013
|
var init_isViablePhoneNumber = __esm({
|
|
14568
15014
|
"../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"() {
|
|
14569
|
-
|
|
15015
|
+
init_constants2();
|
|
14570
15016
|
init_createExtensionPattern();
|
|
14571
15017
|
MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
|
|
14572
15018
|
VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
|
|
@@ -15278,7 +15724,7 @@ function isPhoneContextValid(phoneContext) {
|
|
|
15278
15724
|
var PLUS_SIGN, RFC3966_VISUAL_SEPARATOR_, RFC3966_PHONE_DIGIT_, RFC3966_GLOBAL_NUMBER_DIGITS_, RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_, ALPHANUM_, RFC3966_DOMAINLABEL_, VALID_ALPHA_, RFC3966_TOPLABEL_, RFC3966_DOMAINNAME_, RFC3966_DOMAINNAME_PATTERN_, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_;
|
|
15279
15725
|
var init_extractPhoneContext = __esm({
|
|
15280
15726
|
"../../node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js"() {
|
|
15281
|
-
|
|
15727
|
+
init_constants2();
|
|
15282
15728
|
PLUS_SIGN = "+";
|
|
15283
15729
|
RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
|
|
15284
15730
|
RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
|
|
@@ -15503,7 +15949,7 @@ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCo
|
|
|
15503
15949
|
var MAX_INPUT_STRING_LENGTH, PHONE_NUMBER_START_PATTERN, AFTER_PHONE_NUMBER_END_PATTERN, USE_NON_GEOGRAPHIC_COUNTRY_CODE3;
|
|
15504
15950
|
var init_parse = __esm({
|
|
15505
15951
|
"../../node_modules/libphonenumber-js/es6/parse.js"() {
|
|
15506
|
-
|
|
15952
|
+
init_constants2();
|
|
15507
15953
|
init_ParseError();
|
|
15508
15954
|
init_metadata();
|
|
15509
15955
|
init_isViablePhoneNumber();
|
|
@@ -16654,7 +17100,7 @@ var init_AsYouTypeFormatter = __esm({
|
|
|
16654
17100
|
init_parseDigits();
|
|
16655
17101
|
init_AsYouTypeFormatter_util();
|
|
16656
17102
|
init_formatNationalNumberUsingFormat();
|
|
16657
|
-
|
|
17103
|
+
init_constants2();
|
|
16658
17104
|
init_applyInternationalSeparatorStyle();
|
|
16659
17105
|
DUMMY_DIGIT = "9";
|
|
16660
17106
|
LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;
|
|
@@ -17098,7 +17544,7 @@ var init_AsYouTypeParser = __esm({
|
|
|
17098
17544
|
init_extractNationalNumberFromPossiblyIncompleteNumber();
|
|
17099
17545
|
init_stripIddPrefix();
|
|
17100
17546
|
init_parseDigits();
|
|
17101
|
-
|
|
17547
|
+
init_constants2();
|
|
17102
17548
|
VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = "[" + VALID_PUNCTUATION + VALID_DIGITS + "]+";
|
|
17103
17549
|
VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp("^" + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + "$", "i");
|
|
17104
17550
|
VALID_FORMATTED_PHONE_NUMBER_PART = "(?:[" + PLUS_CHARS + "][" + VALID_PUNCTUATION + VALID_DIGITS + "]*|[" + VALID_PUNCTUATION + VALID_DIGITS + "]+)";
|
|
@@ -20649,7 +21095,7 @@ var init_esm2 = __esm({
|
|
|
20649
21095
|
|
|
20650
21096
|
// ../form-multiline-address/dist/esm/lib/constants.js
|
|
20651
21097
|
var ADDRESS_FORM_ID_BY_COUNTRY, DEFAULT_COUNTRY;
|
|
20652
|
-
var
|
|
21098
|
+
var init_constants3 = __esm({
|
|
20653
21099
|
"../form-multiline-address/dist/esm/lib/constants.js"() {
|
|
20654
21100
|
ADDRESS_FORM_ID_BY_COUNTRY = {
|
|
20655
21101
|
COMMON: "0d5dcb6d-1403-4b80-b73e-6d90a2245561",
|
|
@@ -21393,7 +21839,7 @@ var init_multiline_address_toolkit = __esm({
|
|
|
21393
21839
|
init_defineProperty();
|
|
21394
21840
|
init_types_impl();
|
|
21395
21841
|
import_locale_dataset_javascript = __toESM(require_index_bundle());
|
|
21396
|
-
|
|
21842
|
+
init_constants3();
|
|
21397
21843
|
init_apply_validation_properties();
|
|
21398
21844
|
init_apply_view_properties();
|
|
21399
21845
|
init_get_country_field();
|
|
@@ -21603,7 +22049,7 @@ __export(esm_exports2, {
|
|
|
21603
22049
|
});
|
|
21604
22050
|
var init_esm3 = __esm({
|
|
21605
22051
|
"../form-multiline-address/dist/esm/index.js"() {
|
|
21606
|
-
|
|
22052
|
+
init_constants3();
|
|
21607
22053
|
init_multiline_address_toolkit();
|
|
21608
22054
|
init_get_country_field();
|
|
21609
22055
|
init_country_codes();
|
|
@@ -22516,451 +22962,6 @@ var require_messages_en = __commonJS({
|
|
|
22516
22962
|
}
|
|
22517
22963
|
});
|
|
22518
22964
|
|
|
22519
|
-
// ../../node_modules/@wix/sdk-runtime/build/constants.js
|
|
22520
|
-
var SDKRequestToRESTRequestRenameMap, RESTResponseToSDKResponseRenameMap;
|
|
22521
|
-
var init_constants3 = __esm({
|
|
22522
|
-
"../../node_modules/@wix/sdk-runtime/build/constants.js"() {
|
|
22523
|
-
SDKRequestToRESTRequestRenameMap = {
|
|
22524
|
-
_id: "id",
|
|
22525
|
-
_createdDate: "createdDate",
|
|
22526
|
-
_updatedDate: "updatedDate"
|
|
22527
|
-
};
|
|
22528
|
-
RESTResponseToSDKResponseRenameMap = {
|
|
22529
|
-
id: "_id",
|
|
22530
|
-
createdDate: "_createdDate",
|
|
22531
|
-
updatedDate: "_updatedDate"
|
|
22532
|
-
};
|
|
22533
|
-
}
|
|
22534
|
-
});
|
|
22535
|
-
|
|
22536
|
-
// ../../node_modules/@wix/sdk-runtime/build/utils.js
|
|
22537
|
-
function removeUndefinedKeys(obj) {
|
|
22538
|
-
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
22539
|
-
}
|
|
22540
|
-
function constantCase(input) {
|
|
22541
|
-
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
22542
|
-
}
|
|
22543
|
-
function split(value) {
|
|
22544
|
-
let result2 = value.trim();
|
|
22545
|
-
result2 = result2.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
22546
|
-
result2 = result2.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
22547
|
-
let start = 0;
|
|
22548
|
-
let end = result2.length;
|
|
22549
|
-
while (result2.charAt(start) === "\0") {
|
|
22550
|
-
start++;
|
|
22551
|
-
}
|
|
22552
|
-
if (start === end) {
|
|
22553
|
-
return [];
|
|
22554
|
-
}
|
|
22555
|
-
while (result2.charAt(end - 1) === "\0") {
|
|
22556
|
-
end--;
|
|
22557
|
-
}
|
|
22558
|
-
return result2.slice(start, end).split(/\0/g);
|
|
22559
|
-
}
|
|
22560
|
-
var SPLIT_LOWER_UPPER_RE, SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE, DEFAULT_STRIP_REGEXP;
|
|
22561
|
-
var init_utils2 = __esm({
|
|
22562
|
-
"../../node_modules/@wix/sdk-runtime/build/utils.js"() {
|
|
22563
|
-
SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
22564
|
-
SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
22565
|
-
SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
22566
|
-
DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
22567
|
-
}
|
|
22568
|
-
});
|
|
22569
|
-
|
|
22570
|
-
// ../../node_modules/@wix/sdk-runtime/build/transform-error.js
|
|
22571
|
-
function transformError(httpClientError, pathsToArguments = {
|
|
22572
|
-
explicitPathsToArguments: {},
|
|
22573
|
-
spreadPathsToArguments: {},
|
|
22574
|
-
singleArgumentUnchanged: false
|
|
22575
|
-
}, argumentNames = []) {
|
|
22576
|
-
if (typeof httpClientError !== "object" || httpClientError === null) {
|
|
22577
|
-
throw httpClientError;
|
|
22578
|
-
}
|
|
22579
|
-
if (isValidationError(httpClientError)) {
|
|
22580
|
-
return buildValidationError(httpClientError, pathsToArguments, argumentNames);
|
|
22581
|
-
}
|
|
22582
|
-
if (isApplicationError(httpClientError)) {
|
|
22583
|
-
return buildApplicationError(httpClientError);
|
|
22584
|
-
}
|
|
22585
|
-
if (isClientError(httpClientError)) {
|
|
22586
|
-
const status = httpClientError.response?.status;
|
|
22587
|
-
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
22588
|
-
const message = httpClientError.response?.data?.message ?? statusText;
|
|
22589
|
-
const details = {
|
|
22590
|
-
applicationError: {
|
|
22591
|
-
description: statusText,
|
|
22592
|
-
code: constantCase(statusText),
|
|
22593
|
-
data: {}
|
|
22594
|
-
},
|
|
22595
|
-
requestId: httpClientError.requestId
|
|
22596
|
-
};
|
|
22597
|
-
return wrapError(httpClientError, {
|
|
22598
|
-
message: JSON.stringify({
|
|
22599
|
-
message,
|
|
22600
|
-
details
|
|
22601
|
-
}, null, 2),
|
|
22602
|
-
extraProperties: {
|
|
22603
|
-
details,
|
|
22604
|
-
status
|
|
22605
|
-
}
|
|
22606
|
-
});
|
|
22607
|
-
}
|
|
22608
|
-
return buildSystemError(httpClientError);
|
|
22609
|
-
}
|
|
22610
|
-
var isValidationError, isApplicationError, isClientError, buildValidationError, wrapError, buildApplicationError, buildSystemError, violationsWithRenamedFields, withRenamedArgument, getArgumentIndex;
|
|
22611
|
-
var init_transform_error = __esm({
|
|
22612
|
-
"../../node_modules/@wix/sdk-runtime/build/transform-error.js"() {
|
|
22613
|
-
init_utils2();
|
|
22614
|
-
isValidationError = (httpClientError) => "validationError" in (httpClientError.response?.data?.details ?? {});
|
|
22615
|
-
isApplicationError = (httpClientError) => "applicationError" in (httpClientError.response?.data?.details ?? {});
|
|
22616
|
-
isClientError = (httpClientError) => (httpClientError.response?.status ?? -1) >= 400 && (httpClientError.response?.status ?? -1) < 500;
|
|
22617
|
-
buildValidationError = (httpClientError, pathsToArguments, argumentNames) => {
|
|
22618
|
-
const validationErrorResponse = httpClientError.response?.data;
|
|
22619
|
-
const requestId = httpClientError.requestId;
|
|
22620
|
-
const { fieldViolations } = validationErrorResponse.details.validationError;
|
|
22621
|
-
const transformedFieldViolations = violationsWithRenamedFields(pathsToArguments, fieldViolations, argumentNames)?.sort((a, b) => a.field < b.field ? -1 : 1);
|
|
22622
|
-
const message = `INVALID_ARGUMENT: ${transformedFieldViolations?.map(({ field, description }) => `"${field}" ${description}`)?.join(", ")}`;
|
|
22623
|
-
const details = {
|
|
22624
|
-
validationError: { fieldViolations: transformedFieldViolations },
|
|
22625
|
-
requestId
|
|
22626
|
-
};
|
|
22627
|
-
return wrapError(httpClientError, {
|
|
22628
|
-
message: JSON.stringify({ message, details }, null, 2),
|
|
22629
|
-
extraProperties: {
|
|
22630
|
-
details,
|
|
22631
|
-
status: httpClientError.response?.status,
|
|
22632
|
-
requestId
|
|
22633
|
-
}
|
|
22634
|
-
});
|
|
22635
|
-
};
|
|
22636
|
-
wrapError = (baseError, { message, extraProperties }) => {
|
|
22637
|
-
return Object.assign(baseError, {
|
|
22638
|
-
...extraProperties,
|
|
22639
|
-
message
|
|
22640
|
-
});
|
|
22641
|
-
};
|
|
22642
|
-
buildApplicationError = (httpClientError) => {
|
|
22643
|
-
const status = httpClientError.response?.status;
|
|
22644
|
-
const statusText = httpClientError.response?.statusText ?? "UNKNOWN";
|
|
22645
|
-
const message = httpClientError.response?.data?.message ?? statusText;
|
|
22646
|
-
const description = httpClientError.response?.data?.details?.applicationError?.description ?? statusText;
|
|
22647
|
-
const code = httpClientError.response?.data?.details?.applicationError?.code ?? constantCase(statusText);
|
|
22648
|
-
const data = httpClientError.response?.data?.details?.applicationError?.data ?? {};
|
|
22649
|
-
const combinedMessage = message === description ? message : `${message}: ${description}`;
|
|
22650
|
-
const details = {
|
|
22651
|
-
applicationError: {
|
|
22652
|
-
description,
|
|
22653
|
-
code,
|
|
22654
|
-
data
|
|
22655
|
-
},
|
|
22656
|
-
requestId: httpClientError.requestId
|
|
22657
|
-
};
|
|
22658
|
-
return wrapError(httpClientError, {
|
|
22659
|
-
message: JSON.stringify({ message: combinedMessage, details }, null, 2),
|
|
22660
|
-
extraProperties: {
|
|
22661
|
-
details,
|
|
22662
|
-
status,
|
|
22663
|
-
requestId: httpClientError.requestId
|
|
22664
|
-
}
|
|
22665
|
-
});
|
|
22666
|
-
};
|
|
22667
|
-
buildSystemError = (httpClientError) => {
|
|
22668
|
-
const message = httpClientError.requestId ? `System error occurred, request-id: ${httpClientError.requestId}` : `System error occurred: ${JSON.stringify(httpClientError)}`;
|
|
22669
|
-
return wrapError(httpClientError, {
|
|
22670
|
-
message,
|
|
22671
|
-
extraProperties: {
|
|
22672
|
-
requestId: httpClientError.requestId,
|
|
22673
|
-
status: httpClientError.response?.status,
|
|
22674
|
-
code: constantCase(httpClientError.response?.statusText ?? "UNKNOWN"),
|
|
22675
|
-
...!httpClientError.response && {
|
|
22676
|
-
runtimeError: httpClientError
|
|
22677
|
-
}
|
|
22678
|
-
}
|
|
22679
|
-
});
|
|
22680
|
-
};
|
|
22681
|
-
violationsWithRenamedFields = ({ spreadPathsToArguments, explicitPathsToArguments, singleArgumentUnchanged }, fieldViolations, argumentNames) => {
|
|
22682
|
-
const allPathsToArguments = {
|
|
22683
|
-
...spreadPathsToArguments,
|
|
22684
|
-
...explicitPathsToArguments
|
|
22685
|
-
};
|
|
22686
|
-
const allPathsToArgumentsKeys = Object.keys(allPathsToArguments);
|
|
22687
|
-
return fieldViolations?.filter((fieldViolation) => {
|
|
22688
|
-
const containedInAMoreSpecificViolationField = fieldViolations.some((anotherViolation) => anotherViolation.field.length > fieldViolation.field.length && anotherViolation.field.startsWith(fieldViolation.field) && allPathsToArgumentsKeys.includes(anotherViolation.field));
|
|
22689
|
-
return !containedInAMoreSpecificViolationField;
|
|
22690
|
-
}).map((fieldViolation) => {
|
|
22691
|
-
const exactMatchArgumentExpression = explicitPathsToArguments[fieldViolation.field];
|
|
22692
|
-
if (exactMatchArgumentExpression) {
|
|
22693
|
-
return {
|
|
22694
|
-
...fieldViolation,
|
|
22695
|
-
field: withRenamedArgument(exactMatchArgumentExpression, argumentNames)
|
|
22696
|
-
};
|
|
22697
|
-
}
|
|
22698
|
-
const longestPartialPathMatch = allPathsToArgumentsKeys?.sort((a, b) => b.length - a.length)?.find((path) => fieldViolation.field.startsWith(path));
|
|
22699
|
-
if (longestPartialPathMatch) {
|
|
22700
|
-
const partialMatchArgumentExpression = allPathsToArguments[longestPartialPathMatch];
|
|
22701
|
-
if (partialMatchArgumentExpression) {
|
|
22702
|
-
return {
|
|
22703
|
-
...fieldViolation,
|
|
22704
|
-
field: fieldViolation.field.replace(longestPartialPathMatch, withRenamedArgument(partialMatchArgumentExpression, argumentNames))
|
|
22705
|
-
};
|
|
22706
|
-
}
|
|
22707
|
-
}
|
|
22708
|
-
if (singleArgumentUnchanged) {
|
|
22709
|
-
return {
|
|
22710
|
-
...fieldViolation,
|
|
22711
|
-
field: `${argumentNames[0]}.${fieldViolation.field}`
|
|
22712
|
-
};
|
|
22713
|
-
}
|
|
22714
|
-
return fieldViolation;
|
|
22715
|
-
});
|
|
22716
|
-
};
|
|
22717
|
-
withRenamedArgument = (fieldValue, argumentNames) => {
|
|
22718
|
-
const argIndex = getArgumentIndex(fieldValue);
|
|
22719
|
-
if (argIndex !== null && typeof argIndex !== "undefined") {
|
|
22720
|
-
return fieldValue.replace(`$[${argIndex}]`, argumentNames[argIndex]);
|
|
22721
|
-
}
|
|
22722
|
-
return fieldValue;
|
|
22723
|
-
};
|
|
22724
|
-
getArgumentIndex = (s) => {
|
|
22725
|
-
const match = s.match(/\$\[(?<argIndex>\d+)\]/);
|
|
22726
|
-
return match && match.groups && Number(match.groups.argIndex);
|
|
22727
|
-
};
|
|
22728
|
-
}
|
|
22729
|
-
});
|
|
22730
|
-
|
|
22731
|
-
// ../../node_modules/@wix/sdk-context/build/browser/index.mjs
|
|
22732
|
-
var wixContext;
|
|
22733
|
-
var init_browser = __esm({
|
|
22734
|
-
"../../node_modules/@wix/sdk-context/build/browser/index.mjs"() {
|
|
22735
|
-
wixContext = {};
|
|
22736
|
-
}
|
|
22737
|
-
});
|
|
22738
|
-
|
|
22739
|
-
// ../../node_modules/@wix/sdk-runtime/build/context.js
|
|
22740
|
-
function resolveContext() {
|
|
22741
|
-
const oldContext = typeof $wixContext !== "undefined" && $wixContext.initWixModules ? $wixContext.initWixModules : typeof globalThis.__wix_context__ !== "undefined" && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
22742
|
-
if (oldContext) {
|
|
22743
|
-
return {
|
|
22744
|
-
// @ts-expect-error
|
|
22745
|
-
initWixModules(modules, elevated) {
|
|
22746
|
-
return runWithoutContext(() => oldContext(modules, elevated));
|
|
22747
|
-
},
|
|
22748
|
-
fetchWithAuth() {
|
|
22749
|
-
throw new Error("fetchWithAuth is not available in this context");
|
|
22750
|
-
},
|
|
22751
|
-
graphql() {
|
|
22752
|
-
throw new Error("graphql is not available in this context");
|
|
22753
|
-
}
|
|
22754
|
-
};
|
|
22755
|
-
}
|
|
22756
|
-
const contextualClient = typeof $wixContext !== "undefined" ? $wixContext.client : typeof wixContext.client !== "undefined" ? wixContext.client : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.client : void 0;
|
|
22757
|
-
const elevatedClient = typeof $wixContext !== "undefined" ? $wixContext.elevatedClient : typeof wixContext.elevatedClient !== "undefined" ? wixContext.elevatedClient : typeof globalThis.__wix_context__ !== "undefined" ? globalThis.__wix_context__.elevatedClient : void 0;
|
|
22758
|
-
if (!contextualClient && !elevatedClient) {
|
|
22759
|
-
return;
|
|
22760
|
-
}
|
|
22761
|
-
return {
|
|
22762
|
-
initWixModules(wixModules, elevated) {
|
|
22763
|
-
if (elevated) {
|
|
22764
|
-
if (!elevatedClient) {
|
|
22765
|
-
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");
|
|
22766
|
-
}
|
|
22767
|
-
return runWithoutContext(() => elevatedClient.use(wixModules));
|
|
22768
|
-
}
|
|
22769
|
-
if (!contextualClient) {
|
|
22770
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22771
|
-
}
|
|
22772
|
-
return runWithoutContext(() => contextualClient.use(wixModules));
|
|
22773
|
-
},
|
|
22774
|
-
fetchWithAuth: (urlOrRequest, requestInit) => {
|
|
22775
|
-
if (!contextualClient) {
|
|
22776
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22777
|
-
}
|
|
22778
|
-
return contextualClient.fetchWithAuth(urlOrRequest, requestInit);
|
|
22779
|
-
},
|
|
22780
|
-
getAuth() {
|
|
22781
|
-
if (!contextualClient) {
|
|
22782
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22783
|
-
}
|
|
22784
|
-
return contextualClient.auth;
|
|
22785
|
-
},
|
|
22786
|
-
async graphql(query, variables, opts) {
|
|
22787
|
-
if (!contextualClient) {
|
|
22788
|
-
throw new Error("Wix context is not available. Make sure to initialize the Wix context before using SDK modules");
|
|
22789
|
-
}
|
|
22790
|
-
return contextualClient.graphql(query, variables, opts);
|
|
22791
|
-
}
|
|
22792
|
-
};
|
|
22793
|
-
}
|
|
22794
|
-
function runWithoutContext(fn) {
|
|
22795
|
-
const globalContext = globalThis.__wix_context__;
|
|
22796
|
-
const moduleContext = {
|
|
22797
|
-
client: wixContext.client,
|
|
22798
|
-
elevatedClient: wixContext.elevatedClient
|
|
22799
|
-
};
|
|
22800
|
-
let closureContext;
|
|
22801
|
-
globalThis.__wix_context__ = void 0;
|
|
22802
|
-
wixContext.client = void 0;
|
|
22803
|
-
wixContext.elevatedClient = void 0;
|
|
22804
|
-
if (typeof $wixContext !== "undefined") {
|
|
22805
|
-
closureContext = {
|
|
22806
|
-
client: $wixContext?.client,
|
|
22807
|
-
elevatedClient: $wixContext?.elevatedClient
|
|
22808
|
-
};
|
|
22809
|
-
delete $wixContext.client;
|
|
22810
|
-
delete $wixContext.elevatedClient;
|
|
22811
|
-
}
|
|
22812
|
-
try {
|
|
22813
|
-
return fn();
|
|
22814
|
-
} finally {
|
|
22815
|
-
globalThis.__wix_context__ = globalContext;
|
|
22816
|
-
wixContext.client = moduleContext.client;
|
|
22817
|
-
wixContext.elevatedClient = moduleContext.elevatedClient;
|
|
22818
|
-
if (typeof $wixContext !== "undefined") {
|
|
22819
|
-
$wixContext.client = closureContext.client;
|
|
22820
|
-
$wixContext.elevatedClient = closureContext.elevatedClient;
|
|
22821
|
-
}
|
|
22822
|
-
}
|
|
22823
|
-
}
|
|
22824
|
-
var init_context = __esm({
|
|
22825
|
-
"../../node_modules/@wix/sdk-runtime/build/context.js"() {
|
|
22826
|
-
init_browser();
|
|
22827
|
-
init_context_v2();
|
|
22828
|
-
}
|
|
22829
|
-
});
|
|
22830
|
-
|
|
22831
|
-
// ../../node_modules/@wix/sdk-runtime/build/context-v2.js
|
|
22832
|
-
function contextualizeRESTModuleV2(restModule, elevated) {
|
|
22833
|
-
return ((...args) => {
|
|
22834
|
-
const context = resolveContext();
|
|
22835
|
-
if (!context) {
|
|
22836
|
-
return restModule.apply(void 0, args);
|
|
22837
|
-
}
|
|
22838
|
-
return context.initWixModules(restModule, elevated).apply(void 0, args);
|
|
22839
|
-
});
|
|
22840
|
-
}
|
|
22841
|
-
var init_context_v2 = __esm({
|
|
22842
|
-
"../../node_modules/@wix/sdk-runtime/build/context-v2.js"() {
|
|
22843
|
-
init_context();
|
|
22844
|
-
}
|
|
22845
|
-
});
|
|
22846
|
-
|
|
22847
|
-
// ../../node_modules/@wix/sdk-runtime/build/rest-modules.js
|
|
22848
|
-
function createRESTModule(descriptor, elevated = false) {
|
|
22849
|
-
return contextualizeRESTModuleV2(descriptor, elevated);
|
|
22850
|
-
}
|
|
22851
|
-
function toURLSearchParams(params, isComplexRequest) {
|
|
22852
|
-
const flatten = flattenParams(params);
|
|
22853
|
-
Object.entries(flatten).some(([key, value]) => key.includes(".") || Array.isArray(value) && value.some((v) => typeof v === "object"));
|
|
22854
|
-
{
|
|
22855
|
-
return Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {
|
|
22856
|
-
const keyParams = Array.isArray(value) ? value : [value];
|
|
22857
|
-
keyParams.forEach((param) => {
|
|
22858
|
-
if (param === void 0 || param === null || Array.isArray(value) && typeof param === "object") {
|
|
22859
|
-
return;
|
|
22860
|
-
}
|
|
22861
|
-
urlSearchParams.append(key, param);
|
|
22862
|
-
});
|
|
22863
|
-
return urlSearchParams;
|
|
22864
|
-
}, new URLSearchParams());
|
|
22865
|
-
}
|
|
22866
|
-
}
|
|
22867
|
-
function resolveUrl(opts) {
|
|
22868
|
-
const domain = resolveDomain(opts.host);
|
|
22869
|
-
const mappings = resolveMappingsByDomain(domain, opts.domainToMappings);
|
|
22870
|
-
const path = injectDataIntoProtoPath(opts.protoPath, opts.data || {});
|
|
22871
|
-
return resolvePathFromMappings(path, mappings);
|
|
22872
|
-
}
|
|
22873
|
-
function flattenParams(data, path = "") {
|
|
22874
|
-
const params = {};
|
|
22875
|
-
Object.entries(data).forEach(([key, value]) => {
|
|
22876
|
-
const isObject5 = value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22877
|
-
const fieldPath = resolvePath(path, key);
|
|
22878
|
-
if (isObject5) {
|
|
22879
|
-
const serializedObject = flattenParams(value, fieldPath);
|
|
22880
|
-
Object.assign(params, serializedObject);
|
|
22881
|
-
} else {
|
|
22882
|
-
params[fieldPath] = value;
|
|
22883
|
-
}
|
|
22884
|
-
});
|
|
22885
|
-
return params;
|
|
22886
|
-
}
|
|
22887
|
-
function resolvePath(path, key) {
|
|
22888
|
-
return `${path}${path ? "." : ""}${key}`;
|
|
22889
|
-
}
|
|
22890
|
-
function resolveDomain(host) {
|
|
22891
|
-
const resolvedHost = fixHostExceptions(host);
|
|
22892
|
-
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");
|
|
22893
|
-
}
|
|
22894
|
-
function fixHostExceptions(host) {
|
|
22895
|
-
return host.replace("create.editorx.com", "editor.editorx.com");
|
|
22896
|
-
}
|
|
22897
|
-
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
22898
|
-
const mappings = domainToMappings[domain] || domainToMappings[USER_DOMAIN];
|
|
22899
|
-
if (mappings) {
|
|
22900
|
-
return mappings;
|
|
22901
|
-
}
|
|
22902
|
-
const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
|
|
22903
|
-
if (!rootDomainMappings) {
|
|
22904
|
-
if (isBaseDomain(domain)) {
|
|
22905
|
-
return domainToMappings[wwwBaseDomain];
|
|
22906
|
-
}
|
|
22907
|
-
}
|
|
22908
|
-
return rootDomainMappings ?? [];
|
|
22909
|
-
}
|
|
22910
|
-
function resolveRootDomain(domain, domainToMappings) {
|
|
22911
|
-
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
22912
|
-
const [, ...rooDomainSegments] = domain.split(".");
|
|
22913
|
-
return rooDomainSegments.join(".") === entryDomain;
|
|
22914
|
-
})?.[1];
|
|
22915
|
-
}
|
|
22916
|
-
function isBaseDomain(domain) {
|
|
22917
|
-
return !!domain.match(/\._base_domain_$/);
|
|
22918
|
-
}
|
|
22919
|
-
function injectDataIntoProtoPath(protoPath, data) {
|
|
22920
|
-
return protoPath.split("/").map((path) => maybeProtoPathToData(path, data)).join("/");
|
|
22921
|
-
}
|
|
22922
|
-
function maybeProtoPathToData(protoPath, data) {
|
|
22923
|
-
const protoRegExpMatch = protoPath.match(REGEX_CAPTURE_PROTO_FIELD) || [];
|
|
22924
|
-
const field = protoRegExpMatch[1];
|
|
22925
|
-
if (field) {
|
|
22926
|
-
const suffix = protoPath.replace(protoRegExpMatch[0], "");
|
|
22927
|
-
return findByPath(data, field, protoPath, suffix);
|
|
22928
|
-
}
|
|
22929
|
-
return protoPath;
|
|
22930
|
-
}
|
|
22931
|
-
function findByPath(obj, path, defaultValue, suffix) {
|
|
22932
|
-
let result2 = obj;
|
|
22933
|
-
for (const field of path.split(".")) {
|
|
22934
|
-
if (!result2) {
|
|
22935
|
-
return defaultValue;
|
|
22936
|
-
}
|
|
22937
|
-
result2 = result2[field];
|
|
22938
|
-
}
|
|
22939
|
-
return `${result2}${suffix}`;
|
|
22940
|
-
}
|
|
22941
|
-
function resolvePathFromMappings(protoPath, mappings) {
|
|
22942
|
-
const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
|
|
22943
|
-
if (!mapping) {
|
|
22944
|
-
return protoPath;
|
|
22945
|
-
}
|
|
22946
|
-
return mapping.srcPath + protoPath.slice(mapping.destPath.length);
|
|
22947
|
-
}
|
|
22948
|
-
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;
|
|
22949
|
-
var init_rest_modules = __esm({
|
|
22950
|
-
"../../node_modules/@wix/sdk-runtime/build/rest-modules.js"() {
|
|
22951
|
-
init_context_v2();
|
|
22952
|
-
DOMAINS = ["wix.com", "editorx.com"];
|
|
22953
|
-
USER_DOMAIN = "_";
|
|
22954
|
-
REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
22955
|
-
WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
|
|
22956
|
-
DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
22957
|
-
REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
22958
|
-
REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
22959
|
-
REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
22960
|
-
wwwBaseDomain = "www._base_domain_";
|
|
22961
|
-
}
|
|
22962
|
-
});
|
|
22963
|
-
|
|
22964
22965
|
// ../../node_modules/@wix/json-proto-serializer/node_modules/long/src/long.js
|
|
22965
22966
|
var require_long = __commonJS({
|
|
22966
22967
|
"../../node_modules/@wix/json-proto-serializer/node_modules/long/src/long.js"(exports, module) {
|
|
@@ -26535,6 +26536,97 @@ function isDateInRange(date, range) {
|
|
|
26535
26536
|
const endDate = startOfDay(new Date(range.end));
|
|
26536
26537
|
return checkDate >= startDate && checkDate <= endDate;
|
|
26537
26538
|
}
|
|
26539
|
+
|
|
26540
|
+
// ../form-fields/dist/esm/services/get-image-url.js
|
|
26541
|
+
init_max();
|
|
26542
|
+
function getImageURL(_ref, targetWidth, targetHeight, fit) {
|
|
26543
|
+
let {
|
|
26544
|
+
id,
|
|
26545
|
+
width,
|
|
26546
|
+
height
|
|
26547
|
+
} = _ref;
|
|
26548
|
+
if (fit === void 0) {
|
|
26549
|
+
fit = "fill";
|
|
26550
|
+
}
|
|
26551
|
+
const urlFunction = fit === "fit" ? sdk.getScaleToFitImageURL : sdk.getScaleToFillImageURL;
|
|
26552
|
+
return urlFunction(id, width, height, targetWidth , targetHeight );
|
|
26553
|
+
}
|
|
26554
|
+
|
|
26555
|
+
// ../../node_modules/@wix/sdk-runtime/build/rename-all-nested-keys.js
|
|
26556
|
+
init_constants();
|
|
26557
|
+
function renameAllNestedKeys(payload, renameMap, ignorePaths) {
|
|
26558
|
+
const isIgnored = (path) => ignorePaths.includes(path);
|
|
26559
|
+
const traverse = (obj, path) => {
|
|
26560
|
+
if (Array.isArray(obj)) {
|
|
26561
|
+
obj.forEach((item) => {
|
|
26562
|
+
traverse(item, path);
|
|
26563
|
+
});
|
|
26564
|
+
} else if (typeof obj === "object" && obj !== null) {
|
|
26565
|
+
const objAsRecord = obj;
|
|
26566
|
+
Object.keys(objAsRecord).forEach((key) => {
|
|
26567
|
+
const newPath = path === "" ? key : `${path}.${key}`;
|
|
26568
|
+
if (isIgnored(newPath)) {
|
|
26569
|
+
return;
|
|
26570
|
+
}
|
|
26571
|
+
const transformedKey = renameKey(key, renameMap);
|
|
26572
|
+
if (transformedKey !== key && !(transformedKey in objAsRecord)) {
|
|
26573
|
+
objAsRecord[transformedKey] = objAsRecord[key];
|
|
26574
|
+
delete objAsRecord[key];
|
|
26575
|
+
}
|
|
26576
|
+
traverse(objAsRecord[transformedKey], newPath);
|
|
26577
|
+
});
|
|
26578
|
+
}
|
|
26579
|
+
};
|
|
26580
|
+
traverse(payload, "");
|
|
26581
|
+
return payload;
|
|
26582
|
+
}
|
|
26583
|
+
function renameKey(key, renameMap) {
|
|
26584
|
+
let transformedKey;
|
|
26585
|
+
if (key.includes(".")) {
|
|
26586
|
+
const parts = key.split(".");
|
|
26587
|
+
const transformedParts = parts.map((part) => renameMap[part] ?? part);
|
|
26588
|
+
transformedKey = transformedParts.join(".");
|
|
26589
|
+
} else {
|
|
26590
|
+
transformedKey = renameMap[key] ?? key;
|
|
26591
|
+
}
|
|
26592
|
+
return transformedKey;
|
|
26593
|
+
}
|
|
26594
|
+
function renameKeysFromSDKRequestToRESTRequest(payload, ignorePaths = []) {
|
|
26595
|
+
return renameAllNestedKeys(payload, SDKRequestToRESTRequestRenameMap, ignorePaths);
|
|
26596
|
+
}
|
|
26597
|
+
function renameKeysFromRESTResponseToSDKResponse(payload, ignorePaths = []) {
|
|
26598
|
+
return renameAllNestedKeys(payload, RESTResponseToSDKResponseRenameMap, ignorePaths);
|
|
26599
|
+
}
|
|
26600
|
+
|
|
26601
|
+
// ../../node_modules/@wix/sdk-runtime/build/transformations/transform-paths.js
|
|
26602
|
+
function transformPath(obj, { path, isRepeated, isMap }, transformFn) {
|
|
26603
|
+
const pathParts = path.split(".");
|
|
26604
|
+
if (pathParts.length === 1 && path in obj) {
|
|
26605
|
+
obj[path] = isRepeated ? obj[path].map(transformFn) : isMap ? Object.fromEntries(Object.entries(obj[path]).map(([key, value]) => [key, transformFn(value)])) : transformFn(obj[path]);
|
|
26606
|
+
return obj;
|
|
26607
|
+
}
|
|
26608
|
+
const [first, ...rest] = pathParts;
|
|
26609
|
+
if (first.endsWith("{}")) {
|
|
26610
|
+
const cleanPath = first.slice(0, -2);
|
|
26611
|
+
obj[cleanPath] = Object.fromEntries(Object.entries(obj[cleanPath]).map(([key, value]) => [
|
|
26612
|
+
key,
|
|
26613
|
+
transformPath(value, { path: rest.join("."), isRepeated, isMap }, transformFn)
|
|
26614
|
+
]));
|
|
26615
|
+
} else if (Array.isArray(obj[first])) {
|
|
26616
|
+
obj[first] = obj[first].map((item) => transformPath(item, { path: rest.join("."), isRepeated, isMap }, transformFn));
|
|
26617
|
+
} else if (first in obj && typeof obj[first] === "object" && obj[first] !== null) {
|
|
26618
|
+
obj[first] = transformPath(obj[first], { path: rest.join("."), isRepeated, isMap }, transformFn);
|
|
26619
|
+
} else if (first === "*") {
|
|
26620
|
+
Object.keys(obj).reduce((acc, curr) => {
|
|
26621
|
+
acc[curr] = transformPath(obj[curr], { path: rest.join("."), isRepeated, isMap }, transformFn);
|
|
26622
|
+
return acc;
|
|
26623
|
+
}, obj);
|
|
26624
|
+
}
|
|
26625
|
+
return obj;
|
|
26626
|
+
}
|
|
26627
|
+
function transformPaths(obj, transformations) {
|
|
26628
|
+
return transformations.reduce((acc, { paths, transformFn }) => paths.reduce((transformerAcc, path) => transformPath(transformerAcc, path, transformFn), acc), obj);
|
|
26629
|
+
}
|
|
26538
26630
|
var HttpClientContext = /* @__PURE__ */ createContext(void 0);
|
|
26539
26631
|
var FormContext = /* @__PURE__ */ createContext(void 0);
|
|
26540
26632
|
function useForm() {
|
|
@@ -28040,21 +28132,6 @@ var Form = (props) => {
|
|
|
28040
28132
|
}, /* @__PURE__ */ React42__default.createElement(FormRoot, props)));
|
|
28041
28133
|
};
|
|
28042
28134
|
|
|
28043
|
-
// ../form-fields/dist/esm/services/get-image-url.js
|
|
28044
|
-
init_max();
|
|
28045
|
-
function getImageURL(_ref, targetWidth, targetHeight, fit) {
|
|
28046
|
-
let {
|
|
28047
|
-
id,
|
|
28048
|
-
width,
|
|
28049
|
-
height
|
|
28050
|
-
} = _ref;
|
|
28051
|
-
if (fit === void 0) {
|
|
28052
|
-
fit = "fill";
|
|
28053
|
-
}
|
|
28054
|
-
const urlFunction = fit === "fit" ? sdk.getScaleToFitImageURL : sdk.getScaleToFillImageURL;
|
|
28055
|
-
return urlFunction(id, width, height, targetWidth , targetHeight );
|
|
28056
|
-
}
|
|
28057
|
-
|
|
28058
28135
|
// ../form-fields/dist/esm/utils/map-by-field.js
|
|
28059
28136
|
function mapByField(collection, field) {
|
|
28060
28137
|
return collection.reduce((acc, item) => {
|
|
@@ -29364,6 +29441,7 @@ var ValueSliderLimitKey = "valueSliderLimit";
|
|
|
29364
29441
|
var UploadFileFormatsKey = "uploadFileFormats";
|
|
29365
29442
|
var ExplanationTextKey = "explanationText";
|
|
29366
29443
|
var MediaKey = "media";
|
|
29444
|
+
var MediaSettingsKey = "mediaSettings";
|
|
29367
29445
|
var UploadEnabledKey = "uploadEnabled";
|
|
29368
29446
|
var FirstDayOfWeekKey = "firstDayOfWeek";
|
|
29369
29447
|
var DefaultCountryCodeKey = "defaultCountry";
|
|
@@ -29699,6 +29777,12 @@ function takeTextInputViewProperties(textInput) {
|
|
|
29699
29777
|
},
|
|
29700
29778
|
...textInput.default && {
|
|
29701
29779
|
[DefaultValueKey]: textInput.default
|
|
29780
|
+
},
|
|
29781
|
+
...textInput.media && {
|
|
29782
|
+
[MediaKey]: textInput.media
|
|
29783
|
+
},
|
|
29784
|
+
...textInput.mediaSettings && {
|
|
29785
|
+
[MediaSettingsKey]: textInput.mediaSettings
|
|
29702
29786
|
}
|
|
29703
29787
|
};
|
|
29704
29788
|
}
|
|
@@ -30444,6 +30528,7 @@ function createLayoutBreakpoints(layout, fieldId) {
|
|
|
30444
30528
|
};
|
|
30445
30529
|
}
|
|
30446
30530
|
function createPropertiesView(field, path, recursive, isMobile2) {
|
|
30531
|
+
var _field$validation;
|
|
30447
30532
|
const {
|
|
30448
30533
|
hidden,
|
|
30449
30534
|
pii,
|
|
@@ -30460,6 +30545,7 @@ function createPropertiesView(field, path, recursive, isMobile2) {
|
|
|
30460
30545
|
const {
|
|
30461
30546
|
required
|
|
30462
30547
|
} = field.validation ?? {};
|
|
30548
|
+
const availability = (_field$validation = field.validation) == null || (_field$validation = _field$validation.string) == null || (_field$validation = _field$validation.dateOptions) == null ? void 0 : _field$validation.availability;
|
|
30463
30549
|
const formView = form && recursive ? createFormView({
|
|
30464
30550
|
form,
|
|
30465
30551
|
path,
|
|
@@ -30479,7 +30565,10 @@ function createPropertiesView(field, path, recursive, isMobile2) {
|
|
|
30479
30565
|
...nestedFormId ? {
|
|
30480
30566
|
nestedFormId
|
|
30481
30567
|
} : {},
|
|
30482
|
-
...rest
|
|
30568
|
+
...rest,
|
|
30569
|
+
...availability ? {
|
|
30570
|
+
availability
|
|
30571
|
+
} : {}
|
|
30483
30572
|
};
|
|
30484
30573
|
}
|
|
30485
30574
|
function createLayoutView(layout) {
|
|
@@ -37672,54 +37761,6 @@ __export(es_exports, {
|
|
|
37672
37761
|
getPlace: () => getPlace4
|
|
37673
37762
|
});
|
|
37674
37763
|
init_transform_error();
|
|
37675
|
-
|
|
37676
|
-
// ../../node_modules/@wix/sdk-runtime/build/rename-all-nested-keys.js
|
|
37677
|
-
init_constants3();
|
|
37678
|
-
function renameAllNestedKeys(payload, renameMap, ignorePaths) {
|
|
37679
|
-
const isIgnored = (path) => ignorePaths.includes(path);
|
|
37680
|
-
const traverse = (obj, path) => {
|
|
37681
|
-
if (Array.isArray(obj)) {
|
|
37682
|
-
obj.forEach((item) => {
|
|
37683
|
-
traverse(item, path);
|
|
37684
|
-
});
|
|
37685
|
-
} else if (typeof obj === "object" && obj !== null) {
|
|
37686
|
-
const objAsRecord = obj;
|
|
37687
|
-
Object.keys(objAsRecord).forEach((key) => {
|
|
37688
|
-
const newPath = path === "" ? key : `${path}.${key}`;
|
|
37689
|
-
if (isIgnored(newPath)) {
|
|
37690
|
-
return;
|
|
37691
|
-
}
|
|
37692
|
-
const transformedKey = renameKey(key, renameMap);
|
|
37693
|
-
if (transformedKey !== key && !(transformedKey in objAsRecord)) {
|
|
37694
|
-
objAsRecord[transformedKey] = objAsRecord[key];
|
|
37695
|
-
delete objAsRecord[key];
|
|
37696
|
-
}
|
|
37697
|
-
traverse(objAsRecord[transformedKey], newPath);
|
|
37698
|
-
});
|
|
37699
|
-
}
|
|
37700
|
-
};
|
|
37701
|
-
traverse(payload, "");
|
|
37702
|
-
return payload;
|
|
37703
|
-
}
|
|
37704
|
-
function renameKey(key, renameMap) {
|
|
37705
|
-
let transformedKey;
|
|
37706
|
-
if (key.includes(".")) {
|
|
37707
|
-
const parts = key.split(".");
|
|
37708
|
-
const transformedParts = parts.map((part) => renameMap[part] ?? part);
|
|
37709
|
-
transformedKey = transformedParts.join(".");
|
|
37710
|
-
} else {
|
|
37711
|
-
transformedKey = renameMap[key] ?? key;
|
|
37712
|
-
}
|
|
37713
|
-
return transformedKey;
|
|
37714
|
-
}
|
|
37715
|
-
function renameKeysFromSDKRequestToRESTRequest(payload, ignorePaths = []) {
|
|
37716
|
-
return renameAllNestedKeys(payload, SDKRequestToRESTRequestRenameMap, ignorePaths);
|
|
37717
|
-
}
|
|
37718
|
-
function renameKeysFromRESTResponseToSDKResponse(payload, ignorePaths = []) {
|
|
37719
|
-
return renameAllNestedKeys(payload, RESTResponseToSDKResponseRenameMap, ignorePaths);
|
|
37720
|
-
}
|
|
37721
|
-
|
|
37722
|
-
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37723
37764
|
init_rest_modules();
|
|
37724
37765
|
|
|
37725
37766
|
// ../../node_modules/@wix/sdk-runtime/build/transformations/float.js
|
|
@@ -37739,36 +37780,6 @@ function transformRESTFloatToSDKFloat(val) {
|
|
|
37739
37780
|
return val;
|
|
37740
37781
|
}
|
|
37741
37782
|
|
|
37742
|
-
// ../../node_modules/@wix/sdk-runtime/build/transformations/transform-paths.js
|
|
37743
|
-
function transformPath(obj, { path, isRepeated, isMap }, transformFn) {
|
|
37744
|
-
const pathParts = path.split(".");
|
|
37745
|
-
if (pathParts.length === 1 && path in obj) {
|
|
37746
|
-
obj[path] = isRepeated ? obj[path].map(transformFn) : isMap ? Object.fromEntries(Object.entries(obj[path]).map(([key, value]) => [key, transformFn(value)])) : transformFn(obj[path]);
|
|
37747
|
-
return obj;
|
|
37748
|
-
}
|
|
37749
|
-
const [first, ...rest] = pathParts;
|
|
37750
|
-
if (first.endsWith("{}")) {
|
|
37751
|
-
const cleanPath = first.slice(0, -2);
|
|
37752
|
-
obj[cleanPath] = Object.fromEntries(Object.entries(obj[cleanPath]).map(([key, value]) => [
|
|
37753
|
-
key,
|
|
37754
|
-
transformPath(value, { path: rest.join("."), isRepeated, isMap }, transformFn)
|
|
37755
|
-
]));
|
|
37756
|
-
} else if (Array.isArray(obj[first])) {
|
|
37757
|
-
obj[first] = obj[first].map((item) => transformPath(item, { path: rest.join("."), isRepeated, isMap }, transformFn));
|
|
37758
|
-
} else if (first in obj && typeof obj[first] === "object" && obj[first] !== null) {
|
|
37759
|
-
obj[first] = transformPath(obj[first], { path: rest.join("."), isRepeated, isMap }, transformFn);
|
|
37760
|
-
} else if (first === "*") {
|
|
37761
|
-
Object.keys(obj).reduce((acc, curr) => {
|
|
37762
|
-
acc[curr] = transformPath(obj[curr], { path: rest.join("."), isRepeated, isMap }, transformFn);
|
|
37763
|
-
return acc;
|
|
37764
|
-
}, obj);
|
|
37765
|
-
}
|
|
37766
|
-
return obj;
|
|
37767
|
-
}
|
|
37768
|
-
function transformPaths(obj, transformations) {
|
|
37769
|
-
return transformations.reduce((acc, { paths, transformFn }) => paths.reduce((transformerAcc, path) => transformPath(transformerAcc, path, transformFn), acc), obj);
|
|
37770
|
-
}
|
|
37771
|
-
|
|
37772
37783
|
// ../../node_modules/@wix/auto_sdk_atlas_places/build/es/index.mjs
|
|
37773
37784
|
init_rest_modules();
|
|
37774
37785
|
|