mozrest-sdk-react-dev 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mozrest-sdk.es.js +221 -120
- package/package.json +1 -1
- package/style.css +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -3435,11 +3435,11 @@ const Container = ({
|
|
|
3435
3435
|
};
|
|
3436
3436
|
const container$t = "_container_zaez7_1";
|
|
3437
3437
|
const header$7 = "_header_zaez7_5";
|
|
3438
|
-
const content$
|
|
3438
|
+
const content$9 = "_content_zaez7_10";
|
|
3439
3439
|
var styles$1w = {
|
|
3440
3440
|
container: container$t,
|
|
3441
3441
|
header: header$7,
|
|
3442
|
-
content: content$
|
|
3442
|
+
content: content$9
|
|
3443
3443
|
};
|
|
3444
3444
|
const LayoutPage$1 = ({
|
|
3445
3445
|
children,
|
|
@@ -7803,18 +7803,18 @@ function createMemoryHistory(options2) {
|
|
|
7803
7803
|
}
|
|
7804
7804
|
var _options3 = options2, _options3$initialEntr = _options3.initialEntries, initialEntries = _options3$initialEntr === void 0 ? ["/"] : _options3$initialEntr, initialIndex = _options3.initialIndex;
|
|
7805
7805
|
var entries = initialEntries.map(function(entry) {
|
|
7806
|
-
var
|
|
7806
|
+
var location3 = readOnly(_extends$P({
|
|
7807
7807
|
pathname: "/",
|
|
7808
7808
|
search: "",
|
|
7809
7809
|
hash: "",
|
|
7810
7810
|
state: null,
|
|
7811
7811
|
key: createKey()
|
|
7812
7812
|
}, typeof entry === "string" ? parsePath(entry) : entry));
|
|
7813
|
-
return
|
|
7813
|
+
return location3;
|
|
7814
7814
|
});
|
|
7815
7815
|
var index2 = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);
|
|
7816
7816
|
var action = Action.Pop;
|
|
7817
|
-
var
|
|
7817
|
+
var location2 = entries[index2];
|
|
7818
7818
|
var listeners = createEvents();
|
|
7819
7819
|
var blockers = createEvents();
|
|
7820
7820
|
function createHref(to2) {
|
|
@@ -7825,7 +7825,7 @@ function createMemoryHistory(options2) {
|
|
|
7825
7825
|
state = null;
|
|
7826
7826
|
}
|
|
7827
7827
|
return readOnly(_extends$P({
|
|
7828
|
-
pathname:
|
|
7828
|
+
pathname: location2.pathname,
|
|
7829
7829
|
search: "",
|
|
7830
7830
|
hash: ""
|
|
7831
7831
|
}, typeof to2 === "string" ? parsePath(to2) : to2, {
|
|
@@ -7833,19 +7833,19 @@ function createMemoryHistory(options2) {
|
|
|
7833
7833
|
key: createKey()
|
|
7834
7834
|
}));
|
|
7835
7835
|
}
|
|
7836
|
-
function allowTx(action2,
|
|
7836
|
+
function allowTx(action2, location3, retry) {
|
|
7837
7837
|
return !blockers.length || (blockers.call({
|
|
7838
7838
|
action: action2,
|
|
7839
|
-
location:
|
|
7839
|
+
location: location3,
|
|
7840
7840
|
retry
|
|
7841
7841
|
}), false);
|
|
7842
7842
|
}
|
|
7843
7843
|
function applyTx(nextAction, nextLocation) {
|
|
7844
7844
|
action = nextAction;
|
|
7845
|
-
|
|
7845
|
+
location2 = nextLocation;
|
|
7846
7846
|
listeners.call({
|
|
7847
7847
|
action,
|
|
7848
|
-
location
|
|
7848
|
+
location: location2
|
|
7849
7849
|
});
|
|
7850
7850
|
}
|
|
7851
7851
|
function push2(to2, state) {
|
|
@@ -7891,7 +7891,7 @@ function createMemoryHistory(options2) {
|
|
|
7891
7891
|
return action;
|
|
7892
7892
|
},
|
|
7893
7893
|
get location() {
|
|
7894
|
-
return
|
|
7894
|
+
return location2;
|
|
7895
7895
|
},
|
|
7896
7896
|
createHref,
|
|
7897
7897
|
push: push2,
|
|
@@ -7990,8 +7990,8 @@ function matchRoutes(routes2, locationArg, basename) {
|
|
|
7990
7990
|
if (basename === void 0) {
|
|
7991
7991
|
basename = "/";
|
|
7992
7992
|
}
|
|
7993
|
-
let
|
|
7994
|
-
let pathname = stripBasename(
|
|
7993
|
+
let location2 = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
7994
|
+
let pathname = stripBasename(location2.pathname || "/", basename);
|
|
7995
7995
|
if (pathname == null) {
|
|
7996
7996
|
return null;
|
|
7997
7997
|
}
|
|
@@ -8285,16 +8285,16 @@ function useRoutes(routes2, locationArg) {
|
|
|
8285
8285
|
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
|
|
8286
8286
|
routeMatch && routeMatch.route;
|
|
8287
8287
|
let locationFromContext = useLocation();
|
|
8288
|
-
let
|
|
8288
|
+
let location2;
|
|
8289
8289
|
if (locationArg) {
|
|
8290
8290
|
var _parsedLocationArg$pa;
|
|
8291
8291
|
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
8292
8292
|
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? invariant$1(false) : void 0;
|
|
8293
|
-
|
|
8293
|
+
location2 = parsedLocationArg;
|
|
8294
8294
|
} else {
|
|
8295
|
-
|
|
8295
|
+
location2 = locationFromContext;
|
|
8296
8296
|
}
|
|
8297
|
-
let pathname =
|
|
8297
|
+
let pathname = location2.pathname || "/";
|
|
8298
8298
|
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
|
|
8299
8299
|
let matches = matchRoutes(routes2, {
|
|
8300
8300
|
pathname: remainingPathname
|
|
@@ -8378,7 +8378,7 @@ function Router(_ref3) {
|
|
|
8378
8378
|
state = null,
|
|
8379
8379
|
key: key2 = "default"
|
|
8380
8380
|
} = locationProp;
|
|
8381
|
-
let
|
|
8381
|
+
let location2 = useMemo$1(() => {
|
|
8382
8382
|
let trailingPathname = stripBasename(pathname, basename);
|
|
8383
8383
|
if (trailingPathname == null) {
|
|
8384
8384
|
return null;
|
|
@@ -8391,7 +8391,7 @@ function Router(_ref3) {
|
|
|
8391
8391
|
key: key2
|
|
8392
8392
|
};
|
|
8393
8393
|
}, [basename, pathname, search2, hash2, state, key2]);
|
|
8394
|
-
if (
|
|
8394
|
+
if (location2 == null) {
|
|
8395
8395
|
return null;
|
|
8396
8396
|
}
|
|
8397
8397
|
return /* @__PURE__ */ createElement(NavigationContext.Provider, {
|
|
@@ -8399,7 +8399,7 @@ function Router(_ref3) {
|
|
|
8399
8399
|
}, /* @__PURE__ */ createElement(LocationContext.Provider, {
|
|
8400
8400
|
children,
|
|
8401
8401
|
value: {
|
|
8402
|
-
location,
|
|
8402
|
+
location: location2,
|
|
8403
8403
|
navigationType
|
|
8404
8404
|
}
|
|
8405
8405
|
}));
|
|
@@ -8407,9 +8407,9 @@ function Router(_ref3) {
|
|
|
8407
8407
|
function Routes(_ref4) {
|
|
8408
8408
|
let {
|
|
8409
8409
|
children,
|
|
8410
|
-
location
|
|
8410
|
+
location: location2
|
|
8411
8411
|
} = _ref4;
|
|
8412
|
-
return useRoutes(createRoutesFromChildren(children),
|
|
8412
|
+
return useRoutes(createRoutesFromChildren(children), location2);
|
|
8413
8413
|
}
|
|
8414
8414
|
function createRoutesFromChildren(children) {
|
|
8415
8415
|
let routes2 = [];
|
|
@@ -8447,9 +8447,9 @@ function createRoutesFromChildren(children) {
|
|
|
8447
8447
|
*/
|
|
8448
8448
|
function useSearchParams(defaultInit) {
|
|
8449
8449
|
let defaultSearchParamsRef = useRef(createSearchParams(defaultInit));
|
|
8450
|
-
let
|
|
8450
|
+
let location2 = useLocation();
|
|
8451
8451
|
let searchParams = useMemo$1(() => {
|
|
8452
|
-
let searchParams2 = createSearchParams(
|
|
8452
|
+
let searchParams2 = createSearchParams(location2.search);
|
|
8453
8453
|
for (let key2 of defaultSearchParamsRef.current.keys()) {
|
|
8454
8454
|
if (!searchParams2.has(key2)) {
|
|
8455
8455
|
defaultSearchParamsRef.current.getAll(key2).forEach((value2) => {
|
|
@@ -8458,7 +8458,7 @@ function useSearchParams(defaultInit) {
|
|
|
8458
8458
|
}
|
|
8459
8459
|
}
|
|
8460
8460
|
return searchParams2;
|
|
8461
|
-
}, [
|
|
8461
|
+
}, [location2.search]);
|
|
8462
8462
|
let navigate = useNavigate();
|
|
8463
8463
|
let setSearchParams = useCallback((nextInit, navigateOptions) => {
|
|
8464
8464
|
navigate("?" + createSearchParams(nextInit), navigateOptions);
|
|
@@ -8557,11 +8557,9 @@ const Header$6 = ({ header: header2 }) => {
|
|
|
8557
8557
|
className: styles$1u.icon
|
|
8558
8558
|
}), typeof header2.icon !== "string" && header2.icon && header2.icon);
|
|
8559
8559
|
};
|
|
8560
|
-
const container$s = "
|
|
8561
|
-
const content$9 = "_content_n9y0e_8";
|
|
8560
|
+
const container$s = "_container_pd6ji_1";
|
|
8562
8561
|
var styles$1t = {
|
|
8563
|
-
container: container$s
|
|
8564
|
-
content: content$9
|
|
8562
|
+
container: container$s
|
|
8565
8563
|
};
|
|
8566
8564
|
const Card = ({
|
|
8567
8565
|
header: header2,
|
|
@@ -8569,13 +8567,13 @@ const Card = ({
|
|
|
8569
8567
|
className,
|
|
8570
8568
|
classNameContent
|
|
8571
8569
|
}) => {
|
|
8572
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
8570
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
8573
8571
|
className: classNames$3(styles$1t.container, className, "mz-card")
|
|
8574
8572
|
}, /* @__PURE__ */ React__default.createElement(Header$6, {
|
|
8575
8573
|
header: header2
|
|
8576
8574
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
8577
8575
|
className: classNames$3(styles$1t.content, classNameContent)
|
|
8578
|
-
}, children));
|
|
8576
|
+
}, children)));
|
|
8579
8577
|
};
|
|
8580
8578
|
var styles$1s = {
|
|
8581
8579
|
"ui-list": "_ui-list_4zr5h_1",
|
|
@@ -8598,7 +8596,7 @@ function emptyFunctionWithReset() {
|
|
|
8598
8596
|
}
|
|
8599
8597
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
8600
8598
|
var factoryWithThrowingShims = function() {
|
|
8601
|
-
function shim(props, propName, componentName,
|
|
8599
|
+
function shim(props, propName, componentName, location2, propFullName, secret) {
|
|
8602
8600
|
if (secret === ReactPropTypesSecret) {
|
|
8603
8601
|
return;
|
|
8604
8602
|
}
|
|
@@ -41181,7 +41179,7 @@ const formarResult = (result) => {
|
|
|
41181
41179
|
const id = result.place_id;
|
|
41182
41180
|
const address = result.formatted_address;
|
|
41183
41181
|
const components2 = result.address_components;
|
|
41184
|
-
const
|
|
41182
|
+
const location2 = result.geometry.location;
|
|
41185
41183
|
const city = ((_a2 = components2.find(({ types: types2 }) => types2.includes("locality"))) == null ? void 0 : _a2.long_name) || "";
|
|
41186
41184
|
const state = ((_b = components2.find(({ types: types2 }) => types2.includes("administrative_area_level_1"))) == null ? void 0 : _b.long_name) || "";
|
|
41187
41185
|
const countryId = ((_c = components2.find(({ types: types2 }) => types2.includes("country"))) == null ? void 0 : _c.short_name) || "";
|
|
@@ -41194,7 +41192,7 @@ const formarResult = (result) => {
|
|
|
41194
41192
|
country,
|
|
41195
41193
|
zipCode,
|
|
41196
41194
|
address,
|
|
41197
|
-
location
|
|
41195
|
+
location: location2
|
|
41198
41196
|
};
|
|
41199
41197
|
};
|
|
41200
41198
|
const GetVenueListing = async ({
|
|
@@ -41230,7 +41228,7 @@ const formatData$c = async (values = {}) => {
|
|
|
41230
41228
|
id: mainCategory == null ? void 0 : mainCategory.id,
|
|
41231
41229
|
label: mainCategory == null ? void 0 : mainCategory.name
|
|
41232
41230
|
} : void 0;
|
|
41233
|
-
const
|
|
41231
|
+
const location2 = await formatLocation(rest.address, latitude, longitude);
|
|
41234
41232
|
return {
|
|
41235
41233
|
...rest,
|
|
41236
41234
|
mainCategory: _mainCategory,
|
|
@@ -41241,7 +41239,7 @@ const formatData$c = async (values = {}) => {
|
|
|
41241
41239
|
regularHours: formarRegularHours$1(regularHours),
|
|
41242
41240
|
specialHours: formarSpecialHours$1(specialHours),
|
|
41243
41241
|
attributes: formatAttributes$1(attributes2),
|
|
41244
|
-
...
|
|
41242
|
+
...location2,
|
|
41245
41243
|
country: countryAux
|
|
41246
41244
|
};
|
|
41247
41245
|
};
|
|
@@ -41917,7 +41915,9 @@ const FormToolBar = ({
|
|
|
41917
41915
|
className: styles$1c.toolbar
|
|
41918
41916
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
41919
41917
|
className: styles$1c.buttonGroup
|
|
41920
|
-
},
|
|
41918
|
+
}, showBack && /* @__PURE__ */ React__default.createElement("div", {
|
|
41919
|
+
style: { paddingTop: ".5rem" }
|
|
41920
|
+
}, /* @__PURE__ */ React__default.createElement(BackButton, null)), (GoogleConnected || FacebookConnected) && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(GoogleButtonContainer$1, {
|
|
41921
41921
|
onSuccess: setGoogleResponse,
|
|
41922
41922
|
venueId,
|
|
41923
41923
|
platform: platform2,
|
|
@@ -41947,9 +41947,7 @@ const FormToolBar = ({
|
|
|
41947
41947
|
isLoading: isPublishingGoogle && isPublishingFacebook,
|
|
41948
41948
|
disabled: data2.status === "published",
|
|
41949
41949
|
type: "button"
|
|
41950
|
-
}, t2("PUBLISH")))))
|
|
41951
|
-
style: { paddingTop: "1rem", marginBottom: -24 }
|
|
41952
|
-
}, /* @__PURE__ */ React__default.createElement(BackButton, null))));
|
|
41950
|
+
}, t2("PUBLISH"))))));
|
|
41953
41951
|
};
|
|
41954
41952
|
const mapcontainer = "_mapcontainer_1eyjs_1";
|
|
41955
41953
|
var styles$1a = {
|
|
@@ -42196,17 +42194,17 @@ function urlBuilder(property2, value2, separator) {
|
|
|
42196
42194
|
}
|
|
42197
42195
|
return null;
|
|
42198
42196
|
}
|
|
42199
|
-
function locationBuilder(
|
|
42197
|
+
function locationBuilder(location2) {
|
|
42200
42198
|
const urlParts = [];
|
|
42201
|
-
if (Array.isArray(
|
|
42202
|
-
const arrParts =
|
|
42199
|
+
if (Array.isArray(location2)) {
|
|
42200
|
+
const arrParts = location2.map((val) => locationBuilder(val));
|
|
42203
42201
|
urlParts.push(...arrParts);
|
|
42204
42202
|
}
|
|
42205
|
-
if (typeof
|
|
42206
|
-
urlParts.push(
|
|
42203
|
+
if (typeof location2 === "string" || typeof location2 === "number") {
|
|
42204
|
+
urlParts.push(location2);
|
|
42207
42205
|
}
|
|
42208
|
-
if (typeof
|
|
42209
|
-
urlParts.push(`${
|
|
42206
|
+
if (typeof location2 === "object" && location2.lat && location2.lng) {
|
|
42207
|
+
urlParts.push(`${location2.lat},${location2.lng}`);
|
|
42210
42208
|
}
|
|
42211
42209
|
return urlParts.join("%7C");
|
|
42212
42210
|
}
|
|
@@ -42234,10 +42232,10 @@ const markerStrategy = ({
|
|
|
42234
42232
|
label: label2,
|
|
42235
42233
|
anchor,
|
|
42236
42234
|
iconURL,
|
|
42237
|
-
location,
|
|
42235
|
+
location: location2,
|
|
42238
42236
|
scale
|
|
42239
42237
|
} = props;
|
|
42240
|
-
browser(
|
|
42238
|
+
browser(location2, "Marker expects a valid location prop");
|
|
42241
42239
|
let urlParts = [];
|
|
42242
42240
|
urlParts.push(urlBuilder("size", size, ":"));
|
|
42243
42241
|
urlParts.push(urlBuilder("color", color2, ":"));
|
|
@@ -42245,7 +42243,7 @@ const markerStrategy = ({
|
|
|
42245
42243
|
urlParts.push(urlBuilder("anchor", anchor, ":"));
|
|
42246
42244
|
urlParts.push(urlBuilder("scale", scale, ":"));
|
|
42247
42245
|
urlParts.push(urlBuilder("icon", iconURL, ":"));
|
|
42248
|
-
urlParts.push(urlBuilder("", locationBuilder(
|
|
42246
|
+
urlParts.push(urlBuilder("", locationBuilder(location2), ""));
|
|
42249
42247
|
const url2 = urlParts.filter((x2) => x2).join("%7C");
|
|
42250
42248
|
return `markers=${url2}`;
|
|
42251
42249
|
};
|
|
@@ -42287,7 +42285,7 @@ const markerGroupStrategy = ({
|
|
|
42287
42285
|
children,
|
|
42288
42286
|
scale
|
|
42289
42287
|
} = props;
|
|
42290
|
-
const
|
|
42288
|
+
const location2 = Children.map(children, (child) => child.props.location);
|
|
42291
42289
|
return markerStrategy({
|
|
42292
42290
|
props: {
|
|
42293
42291
|
size,
|
|
@@ -42295,7 +42293,7 @@ const markerGroupStrategy = ({
|
|
|
42295
42293
|
label: label2,
|
|
42296
42294
|
anchor,
|
|
42297
42295
|
iconURL,
|
|
42298
|
-
location,
|
|
42296
|
+
location: location2,
|
|
42299
42297
|
scale
|
|
42300
42298
|
},
|
|
42301
42299
|
type: {
|
|
@@ -56431,17 +56429,18 @@ const DetailDesktop = ({
|
|
|
56431
56429
|
onSucess: onReload
|
|
56432
56430
|
})));
|
|
56433
56431
|
};
|
|
56434
|
-
const container$c = "
|
|
56435
|
-
const light = "
|
|
56436
|
-
const active = "
|
|
56437
|
-
const resume = "
|
|
56438
|
-
const resume__container = "
|
|
56439
|
-
const left$1 = "
|
|
56440
|
-
const right = "
|
|
56441
|
-
const image = "
|
|
56442
|
-
const comment = "
|
|
56443
|
-
const reviewer = "
|
|
56444
|
-
const
|
|
56432
|
+
const container$c = "_container_1rvtj_1";
|
|
56433
|
+
const light = "_light_1rvtj_4";
|
|
56434
|
+
const active = "_active_1rvtj_7";
|
|
56435
|
+
const resume = "_resume_1rvtj_11";
|
|
56436
|
+
const resume__container = "_resume__container_1rvtj_14";
|
|
56437
|
+
const left$1 = "_left_1rvtj_20";
|
|
56438
|
+
const right = "_right_1rvtj_26";
|
|
56439
|
+
const image = "_image_1rvtj_29";
|
|
56440
|
+
const comment = "_comment_1rvtj_35";
|
|
56441
|
+
const reviewer = "_reviewer_1rvtj_43";
|
|
56442
|
+
const location = "_location_1rvtj_48";
|
|
56443
|
+
const time$1 = "_time_1rvtj_53";
|
|
56445
56444
|
var styles$x = {
|
|
56446
56445
|
container: container$c,
|
|
56447
56446
|
light,
|
|
@@ -56453,8 +56452,9 @@ var styles$x = {
|
|
|
56453
56452
|
image,
|
|
56454
56453
|
comment,
|
|
56455
56454
|
reviewer,
|
|
56456
|
-
|
|
56457
|
-
time: time$1
|
|
56455
|
+
location,
|
|
56456
|
+
time: time$1,
|
|
56457
|
+
"icon--center": "_icon--center_1rvtj_60"
|
|
56458
56458
|
};
|
|
56459
56459
|
const Review = ({
|
|
56460
56460
|
id,
|
|
@@ -56469,7 +56469,8 @@ const Review = ({
|
|
|
56469
56469
|
onReload,
|
|
56470
56470
|
openForm,
|
|
56471
56471
|
onClick,
|
|
56472
|
-
light: light2
|
|
56472
|
+
light: light2,
|
|
56473
|
+
multiVenue
|
|
56473
56474
|
}) => {
|
|
56474
56475
|
return /* @__PURE__ */ React__default.createElement("article", {
|
|
56475
56476
|
className: classNames$3(styles$x.container, {
|
|
@@ -56505,11 +56506,13 @@ const Review = ({
|
|
|
56505
56506
|
sm: 0
|
|
56506
56507
|
}, /* @__PURE__ */ React__default.createElement(StartScore, {
|
|
56507
56508
|
score: rating
|
|
56508
|
-
}))))), /* @__PURE__ */ React__default.createElement("div", {
|
|
56509
|
+
}))))), multiVenue && /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
|
|
56510
|
+
className: styles$x.location
|
|
56511
|
+
}, locationName)), /* @__PURE__ */ React__default.createElement("div", {
|
|
56509
56512
|
className: styles$x.right
|
|
56510
|
-
}, /* @__PURE__ */ React__default.createElement("time", {
|
|
56513
|
+
}, /* @__PURE__ */ React__default.createElement("time", null, createdAt.substring(0, 10)), /* @__PURE__ */ React__default.createElement("time", {
|
|
56511
56514
|
className: styles$x.time
|
|
56512
|
-
}, createdAt.substring(
|
|
56515
|
+
}, createdAt.substring(10))))), /* @__PURE__ */ React__default.createElement(DetailMobile, {
|
|
56513
56516
|
id,
|
|
56514
56517
|
reply: reply2,
|
|
56515
56518
|
reviewer: reviewer2,
|
|
@@ -56575,7 +56578,7 @@ const ContextReview = React__default.createContext([
|
|
|
56575
56578
|
(value2) => {
|
|
56576
56579
|
}
|
|
56577
56580
|
]);
|
|
56578
|
-
const Reviews = ({ reviews, isEmpty, onReload }) => {
|
|
56581
|
+
const Reviews = ({ reviews, isEmpty, onReload, multiVenue }) => {
|
|
56579
56582
|
const { t: t2 } = useTranslation();
|
|
56580
56583
|
const [, setReview] = useContext(ContextReview);
|
|
56581
56584
|
const [reviewSelected, setReviewSelected] = useState();
|
|
@@ -56606,7 +56609,8 @@ const Reviews = ({ reviews, isEmpty, onReload }) => {
|
|
|
56606
56609
|
onReload,
|
|
56607
56610
|
openForm: id === reviewSelected,
|
|
56608
56611
|
onClick: handleToggleForm(id),
|
|
56609
|
-
light: index2 % 2 === 1
|
|
56612
|
+
light: index2 % 2 === 1,
|
|
56613
|
+
multiVenue
|
|
56610
56614
|
})));
|
|
56611
56615
|
};
|
|
56612
56616
|
const TemplateContent = ({ children }) => {
|
|
@@ -62243,13 +62247,14 @@ const formatData$7 = (data2) => {
|
|
|
62243
62247
|
};
|
|
62244
62248
|
};
|
|
62245
62249
|
const SelectVenueListing = ({
|
|
62246
|
-
onChange: onChange3
|
|
62250
|
+
onChange: onChange3,
|
|
62251
|
+
multiVenue
|
|
62247
62252
|
}) => {
|
|
62248
62253
|
const { t: t2 } = useTranslation();
|
|
62249
62254
|
const { data: data2, isLoading } = useFetch(GetVenueListingsOptions, {
|
|
62250
62255
|
cacheId: `venueListing-options`
|
|
62251
62256
|
});
|
|
62252
|
-
if (
|
|
62257
|
+
if (!multiVenue) {
|
|
62253
62258
|
return null;
|
|
62254
62259
|
}
|
|
62255
62260
|
const options2 = [{ id: "", label: t2("ALL") }, ...(data2 == null ? void 0 : data2.data) || []];
|
|
@@ -62350,7 +62355,7 @@ const DatePicker = ({
|
|
|
62350
62355
|
allowClear: false
|
|
62351
62356
|
}));
|
|
62352
62357
|
};
|
|
62353
|
-
const Header$2 = ({ onChangeFilter, filters: filters2 }) => {
|
|
62358
|
+
const Header$2 = ({ onChangeFilter, filters: filters2, multiVenue }) => {
|
|
62354
62359
|
const { t: t2 } = useTranslation();
|
|
62355
62360
|
const handleChangeFilter = (id) => (value2) => {
|
|
62356
62361
|
onChangeFilter({
|
|
@@ -62421,6 +62426,7 @@ const Header$2 = ({ onChangeFilter, filters: filters2 }) => {
|
|
|
62421
62426
|
md: 6,
|
|
62422
62427
|
lg: 4
|
|
62423
62428
|
}, /* @__PURE__ */ React__default.createElement(SelectVenueListing, {
|
|
62429
|
+
multiVenue,
|
|
62424
62430
|
onChange: handleChangeVenueListing
|
|
62425
62431
|
})))));
|
|
62426
62432
|
};
|
|
@@ -62445,6 +62451,10 @@ const ReviewsPage = () => {
|
|
|
62445
62451
|
rating: "",
|
|
62446
62452
|
reply: ""
|
|
62447
62453
|
});
|
|
62454
|
+
const { data: data2 } = useFetch(GetVenueListingsOptions, {
|
|
62455
|
+
cacheId: `venueListing-options`
|
|
62456
|
+
});
|
|
62457
|
+
const multiVenue = (data2 == null ? void 0 : data2.total) > 1;
|
|
62448
62458
|
const {
|
|
62449
62459
|
issues,
|
|
62450
62460
|
isLoadingInitialData,
|
|
@@ -62467,7 +62477,8 @@ const ReviewsPage = () => {
|
|
|
62467
62477
|
contentClassName: styles$p.content,
|
|
62468
62478
|
header: /* @__PURE__ */ React__default.createElement(Header$2, {
|
|
62469
62479
|
onChangeFilter: setFilters,
|
|
62470
|
-
filters: filter
|
|
62480
|
+
filters: filter,
|
|
62481
|
+
multiVenue
|
|
62471
62482
|
})
|
|
62472
62483
|
}, /* @__PURE__ */ React__default.createElement(ContextTemplate.Provider, {
|
|
62473
62484
|
value: [context, setContext]
|
|
@@ -62480,7 +62491,8 @@ const ReviewsPage = () => {
|
|
|
62480
62491
|
}, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Reviews, {
|
|
62481
62492
|
reviews: issues,
|
|
62482
62493
|
isEmpty,
|
|
62483
|
-
onReload: reload
|
|
62494
|
+
onReload: reload,
|
|
62495
|
+
multiVenue
|
|
62484
62496
|
}), !isReachingEnd && /* @__PURE__ */ React__default.createElement("div", {
|
|
62485
62497
|
className: styles$p.footer
|
|
62486
62498
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
@@ -64676,7 +64688,7 @@ const getCompareRange = (current, compareType) => {
|
|
|
64676
64688
|
return handleCompareRangeYear(current);
|
|
64677
64689
|
}
|
|
64678
64690
|
};
|
|
64679
|
-
const Header$1 = ({ value: value2, onChangeFilter }) => {
|
|
64691
|
+
const Header$1 = ({ value: value2, onChangeFilter, multiVenue }) => {
|
|
64680
64692
|
const { t: t2 } = useTranslation();
|
|
64681
64693
|
const handleChangePlatform = (change) => {
|
|
64682
64694
|
onChangeFilter({
|
|
@@ -64740,7 +64752,8 @@ const Header$1 = ({ value: value2, onChangeFilter }) => {
|
|
|
64740
64752
|
sm: 8,
|
|
64741
64753
|
lg: 6
|
|
64742
64754
|
}, /* @__PURE__ */ React__default.createElement(SelectVenueListing, {
|
|
64743
|
-
onChange: handleChangeVenueListing
|
|
64755
|
+
onChange: handleChangeVenueListing,
|
|
64756
|
+
multiVenue
|
|
64744
64757
|
})))));
|
|
64745
64758
|
};
|
|
64746
64759
|
const formatData$4 = (dataToFormat) => {
|
|
@@ -87532,6 +87545,10 @@ const Analytics$1 = ({ venueListingId }) => {
|
|
|
87532
87545
|
cacheId: `reviews-analytics-${venueListingId}`,
|
|
87533
87546
|
params: filter
|
|
87534
87547
|
}, { formatData: formatData$4 });
|
|
87548
|
+
const { data: venues } = useFetch(GetVenueListingsOptions, {
|
|
87549
|
+
cacheId: `venueListing-options`
|
|
87550
|
+
});
|
|
87551
|
+
const multiVenue = (venues == null ? void 0 : venues.total) > 1;
|
|
87535
87552
|
const comparedPeriod = formatComparedPeriod(filter.compare);
|
|
87536
87553
|
const period = formatComparedPeriod(filter.range);
|
|
87537
87554
|
if (error3) {
|
|
@@ -87542,7 +87559,8 @@ const Analytics$1 = ({ venueListingId }) => {
|
|
|
87542
87559
|
return /* @__PURE__ */ React__default.createElement(LayoutPage$1, {
|
|
87543
87560
|
header: /* @__PURE__ */ React__default.createElement(Header$1, {
|
|
87544
87561
|
onChangeFilter: setFilters,
|
|
87545
|
-
value: filter
|
|
87562
|
+
value: filter,
|
|
87563
|
+
multiVenue
|
|
87546
87564
|
})
|
|
87547
87565
|
}, /* @__PURE__ */ React__default.createElement("div", null, isLoading && /* @__PURE__ */ React__default.createElement(SkeletonPage, null), !isLoading && /* @__PURE__ */ React__default.createElement(Row$1, {
|
|
87548
87566
|
gutter: [28, 28]
|
|
@@ -88024,6 +88042,113 @@ const MetricCard = ({ value: value2, title: title2 }) => /* @__PURE__ */ React__
|
|
|
88024
88042
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
88025
88043
|
className: styles$6.value
|
|
88026
88044
|
}, value2));
|
|
88045
|
+
const GetVenuesSummary = async ({
|
|
88046
|
+
filters: filters2,
|
|
88047
|
+
page = 1,
|
|
88048
|
+
limit = 10
|
|
88049
|
+
}) => {
|
|
88050
|
+
const data2 = await instance$1.get(`listing/venue-listing-summary/venues`, {
|
|
88051
|
+
params: {
|
|
88052
|
+
...formatParams(filters2),
|
|
88053
|
+
limit,
|
|
88054
|
+
offset: (page - 1) * limit
|
|
88055
|
+
}
|
|
88056
|
+
});
|
|
88057
|
+
return formatData(data2);
|
|
88058
|
+
};
|
|
88059
|
+
const formatParams = (filters2 = {}) => {
|
|
88060
|
+
let all2 = {};
|
|
88061
|
+
if (filters2.connected) {
|
|
88062
|
+
Object.assign(all2, {
|
|
88063
|
+
"filters[platform]": filters2.platform
|
|
88064
|
+
});
|
|
88065
|
+
} else {
|
|
88066
|
+
Object.assign(all2, {
|
|
88067
|
+
"filters[notPlatform]": filters2.platform
|
|
88068
|
+
});
|
|
88069
|
+
}
|
|
88070
|
+
if (filters2.search) {
|
|
88071
|
+
Object.assign(all2, {
|
|
88072
|
+
"filters[name]": filters2.search
|
|
88073
|
+
});
|
|
88074
|
+
}
|
|
88075
|
+
return all2;
|
|
88076
|
+
};
|
|
88077
|
+
const formatData = (values) => {
|
|
88078
|
+
return values;
|
|
88079
|
+
};
|
|
88080
|
+
const ModalVenues = ({ onClose: onClose2, open, platform: platform2, connected: connected2 }) => {
|
|
88081
|
+
useTranslation();
|
|
88082
|
+
const [search2, setSearch] = useState("");
|
|
88083
|
+
const [page, updatePage] = useState(1);
|
|
88084
|
+
const navigate = useNavigate();
|
|
88085
|
+
const { data: data2, isLoading, error: error3, isValidating, reload } = useFetch(GetVenuesSummary, {
|
|
88086
|
+
cacheId: "venues-summary",
|
|
88087
|
+
filters: { platform: platform2, connected: connected2, search: search2 },
|
|
88088
|
+
page
|
|
88089
|
+
});
|
|
88090
|
+
if (error3) {
|
|
88091
|
+
return /* @__PURE__ */ React__default.createElement("div", null, error3);
|
|
88092
|
+
}
|
|
88093
|
+
const handleSearch = debounce_1((e3) => setSearch(e3.target.value || ""), 500);
|
|
88094
|
+
const handleNavigate = (id) => {
|
|
88095
|
+
navigate(`/venues/${id}?showBack='true'`);
|
|
88096
|
+
};
|
|
88097
|
+
return /* @__PURE__ */ React__default.createElement(ModalAntd, {
|
|
88098
|
+
title: `Select your venue ${connected2 ? "connected" : "to connect"} to ${platform2}`,
|
|
88099
|
+
open,
|
|
88100
|
+
onCancel: onClose2,
|
|
88101
|
+
width: 1e3,
|
|
88102
|
+
footer: null,
|
|
88103
|
+
closeIcon: /* @__PURE__ */ React__default.createElement(Icon$1, {
|
|
88104
|
+
icon: "close",
|
|
88105
|
+
size: "small"
|
|
88106
|
+
}),
|
|
88107
|
+
centered: true
|
|
88108
|
+
}, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
|
|
88109
|
+
style: { display: "flex" }
|
|
88110
|
+
}, /* @__PURE__ */ React__default.createElement(Table, {
|
|
88111
|
+
isLoading: isLoading || isValidating,
|
|
88112
|
+
Header: /* @__PURE__ */ React__default.createElement("div", {
|
|
88113
|
+
style: { display: "flex", justifyContent: "flex-end", marginBottom: "20px" }
|
|
88114
|
+
}, /* @__PURE__ */ React__default.createElement(Input$1, {
|
|
88115
|
+
id: "search",
|
|
88116
|
+
placeholder: "Search",
|
|
88117
|
+
label: "",
|
|
88118
|
+
onChange: handleSearch
|
|
88119
|
+
})),
|
|
88120
|
+
header: [
|
|
88121
|
+
{
|
|
88122
|
+
label: `Name`,
|
|
88123
|
+
id: "name",
|
|
88124
|
+
render: (value2, item2) => {
|
|
88125
|
+
if (platform2) {
|
|
88126
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
88127
|
+
style: {
|
|
88128
|
+
cursor: "pointer",
|
|
88129
|
+
textDecorationLine: "underline"
|
|
88130
|
+
},
|
|
88131
|
+
onClick: () => handleNavigate(item2 == null ? void 0 : item2.id)
|
|
88132
|
+
}, value2);
|
|
88133
|
+
}
|
|
88134
|
+
return /* @__PURE__ */ React__default.createElement("div", null, value2);
|
|
88135
|
+
}
|
|
88136
|
+
},
|
|
88137
|
+
{
|
|
88138
|
+
label: `Address`,
|
|
88139
|
+
id: "address"
|
|
88140
|
+
},
|
|
88141
|
+
{
|
|
88142
|
+
label: `City`,
|
|
88143
|
+
id: "city"
|
|
88144
|
+
}
|
|
88145
|
+
],
|
|
88146
|
+
page,
|
|
88147
|
+
data: (data2 == null ? void 0 : data2.data) || [],
|
|
88148
|
+
totalElements: data2 == null ? void 0 : data2.total,
|
|
88149
|
+
onChangePage: updatePage
|
|
88150
|
+
}))));
|
|
88151
|
+
};
|
|
88027
88152
|
const singleVenue = async () => {
|
|
88028
88153
|
return await instance$1.get(`listing/venue-listing-summary/venues`, {
|
|
88029
88154
|
params: {
|
|
@@ -88035,6 +88160,9 @@ const singleVenue = async () => {
|
|
|
88035
88160
|
const Summary = () => {
|
|
88036
88161
|
const { t: t2 } = useTranslation();
|
|
88037
88162
|
const navigate = useNavigate();
|
|
88163
|
+
const [openModal, setOpenModal] = useState(false);
|
|
88164
|
+
const [platform2, setPlatform] = useState("");
|
|
88165
|
+
const [showConnected, setShowConnected] = useState(false);
|
|
88038
88166
|
const { data: data2, isLoading, error: error3 } = useFetch(GetVenueListingSummary, {
|
|
88039
88167
|
cacheId: "sumary"
|
|
88040
88168
|
});
|
|
@@ -88050,11 +88178,15 @@ const Summary = () => {
|
|
|
88050
88178
|
if (error3) {
|
|
88051
88179
|
return /* @__PURE__ */ React__default.createElement("div", null, error3);
|
|
88052
88180
|
}
|
|
88053
|
-
const handleNavigateConnected = (value2,
|
|
88054
|
-
|
|
88181
|
+
const handleNavigateConnected = (value2, platform22) => {
|
|
88182
|
+
setShowConnected(true);
|
|
88183
|
+
setPlatform(platform22);
|
|
88184
|
+
setOpenModal(true);
|
|
88055
88185
|
};
|
|
88056
|
-
const handleNavigateToConnect = (value2,
|
|
88057
|
-
|
|
88186
|
+
const handleNavigateToConnect = (value2, platform22) => {
|
|
88187
|
+
setShowConnected(false);
|
|
88188
|
+
setPlatform(platform22);
|
|
88189
|
+
setOpenModal(true);
|
|
88058
88190
|
};
|
|
88059
88191
|
return /* @__PURE__ */ React__default.createElement(LayoutPage$1, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
88060
88192
|
style: { marginTop: "2rem" }
|
|
@@ -88135,43 +88267,12 @@ const Summary = () => {
|
|
|
88135
88267
|
}
|
|
88136
88268
|
],
|
|
88137
88269
|
data: (data2 == null ? void 0 : data2.data) || []
|
|
88138
|
-
}))
|
|
88139
|
-
|
|
88140
|
-
|
|
88141
|
-
|
|
88142
|
-
|
|
88143
|
-
|
|
88144
|
-
}) => {
|
|
88145
|
-
const data2 = await instance$1.get(`listing/venue-listing-summary/venues`, {
|
|
88146
|
-
params: {
|
|
88147
|
-
...formatParams(filters2),
|
|
88148
|
-
limit,
|
|
88149
|
-
offset: (page - 1) * limit
|
|
88150
|
-
}
|
|
88151
|
-
});
|
|
88152
|
-
return formatData(data2);
|
|
88153
|
-
};
|
|
88154
|
-
const formatParams = (filters2 = {}) => {
|
|
88155
|
-
let all2 = {};
|
|
88156
|
-
if (filters2.platform) {
|
|
88157
|
-
Object.assign(all2, {
|
|
88158
|
-
"filters[platform]": filters2.platform
|
|
88159
|
-
});
|
|
88160
|
-
}
|
|
88161
|
-
if (filters2.noPlatform) {
|
|
88162
|
-
Object.assign(all2, {
|
|
88163
|
-
"filters[notPlatform]": filters2.noPlatform
|
|
88164
|
-
});
|
|
88165
|
-
}
|
|
88166
|
-
if (filters2.search) {
|
|
88167
|
-
Object.assign(all2, {
|
|
88168
|
-
"filters[name]": filters2.search
|
|
88169
|
-
});
|
|
88170
|
-
}
|
|
88171
|
-
return all2;
|
|
88172
|
-
};
|
|
88173
|
-
const formatData = (values) => {
|
|
88174
|
-
return values;
|
|
88270
|
+
})), /* @__PURE__ */ React__default.createElement(ModalVenues, {
|
|
88271
|
+
open: openModal,
|
|
88272
|
+
onClose: () => setOpenModal(false),
|
|
88273
|
+
platform: platform2,
|
|
88274
|
+
connected: showConnected
|
|
88275
|
+
})));
|
|
88175
88276
|
};
|
|
88176
88277
|
const CreatetVenueListing = async ({ venueId }) => {
|
|
88177
88278
|
const data2 = await instance$1.post(`/listing/venue-listing`, {
|