-
Notifications
You must be signed in to change notification settings - Fork 1
/
queryBusinessProfile.js
186 lines (186 loc) · 14 KB
/
queryBusinessProfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
"use strict";
(self.webpackJsonp = self.webpackJsonp || []).push([
[161],
{
484: function (a, e, n) {
n.d(e, "b", function () {
return i;
}),
n.d(e, "a", function () {
return o;
});
var i = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],
o = {
OPEN_24H: "open_24h",
SPECIFIC_HOURS: "specific_hours",
APPOINTMENT_ONLY: "appointment_only",
CLOSED: "closed",
};
},
535: function (a) {
a.exports = JSON.parse(
'{"//":"@generated","Pacific":{"Niue":-660,"Midway":-660,"Pago_Pago":-660,"Samoa":-660,"Rarotonga":-600,"Honolulu":-600,"Johnston":-600,"Tahiti":-600,"Marquesas":-570,"Gambier":-540,"Pitcairn":-480,"Easter":-360,"Galapagos":-360,"Palau":540,"Guam":600,"Saipan":600,"Chuuk":600,"Truk":600,"Yap":600,"Port_Moresby":600,"Bougainville":660,"Kosrae":660,"Pohnpei":660,"Ponape":660,"Noumea":660,"Norfolk":660,"Guadalcanal":660,"Efate":660,"Fiji":720,"Tarawa":720,"Kwajalein":720,"Majuro":720,"Nauru":720,"Auckland":720,"Funafuti":720,"Wake":720,"Wallis":720,"Chatham":765,"Apia":780,"Fakaofo":780,"Tongatapu":780,"Kiritimati":840},"US":{"Samoa":-660,"Aleutian":-600,"Hawaii":-600,"Alaska":-540,"Pacific":-480,"Mountain":-420,"Arizona":-420,"Central":-360,"Indiana-Starke":-360,"Michigan":-300,"East-Indiana":-300,"Eastern":-300},"America":{"Adak":-600,"Atka":-600,"Anchorage":-540,"Juneau":-540,"Metlakatla":-540,"Nome":-540,"Sitka":-540,"Yakutat":-540,"Los_Angeles":-480,"Tijuana":-480,"Ensenada":-480,"Santa_Isabel":-480,"Vancouver":-480,"Hermosillo":-420,"Cambridge_Bay":-420,"Edmonton":-420,"Inuvik":-420,"Yellowknife":-420,"Chihuahua":-420,"Mazatlan":-420,"Ojinaga":-420,"Boise":-420,"Denver":-420,"Shiprock":-420,"Phoenix":-420,"Creston":-420,"Dawson":-420,"Dawson_Creek":-420,"Fort_Nelson":-420,"Whitehorse":-420,"Belize":-360,"Chicago":-360,"Indiana":{"Knox":-360,"Tell_City":-360,"Indianapolis":-300,"Marengo":-300,"Petersburg":-300,"Vevay":-300,"Vincennes":-300,"Winamac":-300},"Menominee":-360,"North_Dakota":{"Beulah":-360,"Center":-360,"New_Salem":-360},"Knox_IN":-360,"Guatemala":-360,"Managua":-360,"Bahia_Banderas":-360,"Matamoros":-360,"Merida":-360,"Mexico_City":-360,"Monterrey":-360,"Costa_Rica":-360,"El_Salvador":-360,"Regina":-360,"Swift_Current":-360,"Tegucigalpa":-360,"Rainy_River":-360,"Rankin_Inlet":-360,"Resolute":-360,"Winnipeg":-360,"Eirunepe":-300,"Rio_Branco":-300,"Porto_Acre":-300,"Bogota":-300,"Havana":-300,"Atikokan":-300,"Cancun":-300,"Grand_Turk":-300,"Cayman":-300,"Jamaica":-300,"Nassau":-300,"Detroit":-300,"Kentucky":{"Louisville":-300,"Monticello":-300},"New_York":-300,"Fort_Wayne":-300,"Indianapolis":-300,"Louisville":-300,"Panama":-300,"Coral_Harbour":-300,"Port-au-Prince":-300,"Iqaluit":-300,"Nipigon":-300,"Pangnirtung":-300,"Thunder_Bay":-300,"Toronto":-300,"Montreal":-300,"Guayaquil":-300,"Lima":-300,"Boa_Vista":-240,"Campo_Grande":-240,"Cuiaba":-240,"Manaus":-240,"Porto_Velho":-240,"St_Kitts":-240,"Blanc-Sablon":-240,"Montserrat":-240,"Barbados":-240,"St_Lucia":-240,"Port_of_Spain":-240,"Martinique":-240,"St_Barthelemy":-240,"Glace_Bay":-240,"Goose_Bay":-240,"Halifax":-240,"Moncton":-240,"St_Vincent":-240,"Kralendijk":-240,"Guadeloupe":-240,"Marigot":-240,"Aruba":-240,"Lower_Princes":-240,"Tortola":-240,"Dominica":-240,"St_Thomas":-240,"Grenada":-240,"Antigua":-240,"Puerto_Rico":-240,"Virgin":-240,"Santo_Domingo":-240,"Anguilla":-240,"Thule":-240,"Curacao":-240,"La_Paz":-240,"Santiago":-240,"Guyana":-240,"Asuncion":-240,"Caracas":-240,"St_Johns":-210,"Argentina":{"Buenos_Aires":-180,"Catamarca":-180,"Cordoba":-180,"Jujuy":-180,"La_Rioja":-180,"Mendoza":-180,"Rio_Gallegos":-180,"Salta":-180,"San_Juan":-180,"San_Luis":-180,"Tucuman":-180,"Ushuaia":-180,"ComodRivadavia":-180},"Buenos_Aires":-180,"Catamarca":-180,"Cordoba":-180,"Rosario":-180,"Jujuy":-180,"Mendoza":-180,"Araguaina":-180,"Bahia":-180,"Belem":-180,"Fortaleza":-180,"Maceio":-180,"Recife":-180,"Santarem":-180,"Sao_Paulo":-180,"Punta_Arenas":-180,"Cayenne":-180,"Miquelon":-180,"Paramaribo":-180,"Montevideo":-180,"Nuuk":-180,"Godthab":-180,"Noronha":-120,"Scoresbysund":-60,"Danmarkshavn":0},"Mexico":{"BajaNorte":-480,"BajaSur":-420,"General":-360},"Canada":{"Pacific":-480,"Mountain":-420,"Yukon":-420,"Saskatchewan":-360,"Central":-360,"Eastern":-300,"Atlantic":-240,"Newfoundland":-210},"Navajo":-420,"Chile":{"EasterIsland":-360,"Continental":-240},"Brazil":{"Acre":-300,"West":-240,"East":-180,"DeNoronha":-120},"Cuba":-300,"Jamaica":-300,"Atlantic":{"Bermuda":-240,"Stanley":-180,"South_Georgia":-120,"Azores":-60,"Cape_Verde":-60,"St_Helena":0,"Reykjavik":0,"Canary":0,"Madeira":0,"Faroe":0,"Faeroe":0,"Jan_Mayen":60},"Antarctica":{"Palmer":-180,"Rothera":-180,"Troll":0,"Syowa":180,"Mawson":300,"Vostok":360,"Davis":420,"Macquarie":600,"DumontDUrville":600,"Casey":660,"South_Pole":720,"McMurdo":720},"Africa":{"Abidjan":0,"Timbuktu":0,"Accra":0,"Bamako":0,"Bissau":0,"Conakry":0,"Dakar":0,"Freetown":0,"Lome":0,"Monrovia":0,"Nouakchott":0,"Ouagadougou":0,"Banjul":0,"Sao_Tome":0,"Casablanca":0,"El_Aaiun":0,"Windhoek":60,"Algiers":60,"Ceuta":60,"Tunis":60,"Bangui":60,"Malabo":60,"Brazzaville":60,"Porto-Novo":60,"Douala":60,"Kinshasa":60,"Lagos":60,"Libreville":60,"Luanda":60,"Ndjamena":60,"Niamey":60,"Bujumbura":120,"Gaborone":120,"Harare":120,"Juba":120,"Khartoum":120,"Kigali":120,"Blantyre":120,"Lubumbashi":120,"Lusaka":120,"Maputo":120,"Cairo":120,"Tripoli":120,"Johannesburg":120,"Mbabane":120,"Maseru":120,"Addis_Ababa":180,"Asmara":180,"Dar_es_Salaam":180,"Djibouti":180,"Kampala":180,"Mogadishu":180,"Nairobi":180,"Asmera":180},"Europe":{"Isle_of_Man":0,"Dublin":0,"London":0,"Belfast":0,"Jersey":0,"Guernsey":0,"Lisbon":0,"Amsterdam":60,"Andorra":60,"Belgrade":60,"Berlin":60,"Busingen":60,"Malta":60,"Bratislava":60,"Brussels":60,"Budapest":60,"Copenhagen":60,"Gibraltar":60,"Ljubljana":60,"Luxembourg":60,"Madrid":60,"Monaco":60,"Oslo":60,"Paris":60,"Podgorica":60,"Prague":60,"Rome":60,"San_Marino":60,"Sarajevo":60,"Skopje":60,"Stockholm":60,"Tirane":60,"Vaduz":60,"Vatican":60,"Vienna":60,"Warsaw":60,"Zagreb":60,"Zurich":60,"Athens":120,"Bucharest":120,"Chisinau":120,"Tiraspol":120,"Helsinki":120,"Kaliningrad":120,"Kiev":120,"Uzhgorod":120,"Zaporozhye":120,"Mariehamn":120,"Riga":120,"Sofia":120,"Tallinn":120,"Vilnius":120,"Minsk":180,"Kirov":180,"Moscow":180,"Volgograd":180,"Simferopol":180,"Istanbul":180,"Astrakhan":240,"Samara":240,"Saratov":240,"Ulyanovsk":240},"Eire":0,"GB":0,"GB-Eire":0,"Iceland":0,"Portugal":0,"Arctic":{"Longyearbyen":60},"Poland":60,"Asia":{"Damascus":120,"Amman":120,"Beirut":120,"Gaza":120,"Hebron":120,"Famagusta":120,"Nicosia":120,"Jerusalem":120,"Tel_Aviv":120,"Kuwait":180,"Baghdad":180,"Qatar":180,"Bahrain":180,"Riyadh":180,"Aden":180,"Tehran":210,"Yerevan":240,"Baku":240,"Tbilisi":240,"Dubai":240,"Muscat":240,"Kabul":270,"Karachi":300,"Dushanbe":300,"Ashgabat":300,"Ashkhabad":300,"Samarkand":300,"Tashkent":300,"Aqtau":300,"Aqtobe":300,"Atyrau":300,"Oral":300,"Qyzylorda":300,"Yekaterinburg":300,"Colombo":330,"Kolkata":330,"Calcutta":330,"Kathmandu":345,"Katmandu":345,"Dhaka":360,"Dacca":360,"Thimphu":360,"Thimbu":360,"Urumqi":360,"Kashgar":360,"Almaty":360,"Qostanay":360,"Bishkek":360,"Omsk":360,"Yangon":390,"Rangoon":390,"Hovd":420,"Bangkok":420,"Ho_Chi_Minh":420,"Saigon":420,"Phnom_Penh":420,"Vientiane":420,"Barnaul":420,"Krasnoyarsk":420,"Novokuznetsk":420,"Novosibirsk":420,"Tomsk":420,"Jakarta":420,"Pontianak":420,"Brunei":480,"Makassar":480,"Ujung_Pandang":480,"Macau":480,"Macao":480,"Shanghai":480,"Chongqing":480,"Chungking":480,"Harbin":480,"Hong_Kong":480,"Irkutsk":480,"Kuala_Lumpur":480,"Kuching":480,"Manila":480,"Singapore":480,"Taipei":480,"Choibalsan":480,"Ulaanbaatar":480,"Ulan_Bator":480,"Dili":540,"Jayapura":540,"Tokyo":540,"Pyongyang":540,"Seoul":540,"Chita":540,"Khandyga":540,"Yakutsk":540,"Ust-Nera":600,"Vladivostok":600,"Magadan":660,"Sakhalin":660,"Srednekolymsk":660,"Anadyr":720,"Kamchatka":720},"Egypt":120,"Libya":120,"Israel":120,"Indian":{"Antananarivo":180,"Mayotte":180,"Comoro":180,"Mauritius":240,"Reunion":240,"Mahe":240,"Kerguelen":300,"Maldives":300,"Chagos":360,"Cocos":390,"Christmas":420},"W-SU":180,"Turkey":180,"Iran":210,"Australia":{"Perth":480,"West":480,"Eucla":525,"Adelaide":570,"Broken_Hill":570,"South":570,"Yancowinna":570,"Darwin":570,"North":570,"Brisbane":600,"Lindeman":600,"Queensland":600,"Hobart":600,"Melbourne":600,"Sydney":600,"Currie":600,"Tasmania":600,"Victoria":600,"ACT":600,"Canberra":600,"NSW":600,"Lord_Howe":630,"LHI":630},"PRC":480,"Hongkong":480,"Singapore":480,"ROC":480,"Japan":540,"ROK":540,"Kwajalein":720,"NZ":720,"NZ-CHAT":765}'
);
},
650: function (a, e, n) {
n.r(e),
n.d(e, "default", function () {
return h;
});
var i = n(4),
o = n(46),
r = n(484),
t = n(10),
s = n(535);
function u(a) {
return a >= 0 && a < 1440;
}
var l = new o.a("businessProfile", (a) => {
var e = (function (a) {
var e = null == a ? void 0 : a.maybeChild("structured_address");
if (e) {
var n,
i,
o,
r =
null == (n = e.maybeChild("street_address"))
? void 0
: n.contentString(),
t =
null == e || null == (i = e.maybeChild("zip_code"))
? void 0
: i.contentString(),
s =
null == e ||
null == (o = e.maybeChild("localized_city_name"))
? void 0
: o.contentString();
if (!r && !t && !s) return;
return {
type: "structured_address",
street_address: r,
zip_code: t,
localized_city_name: s,
city_id: void 0,
};
}
var u = a.maybeChild("address"),
l = null == u ? void 0 : u.contentString();
if (l) return { type: "string_address", address: l };
})(a),
n = a.maybeChild("description"),
i = null == n ? void 0 : n.contentString(),
o = a.maybeChild("email"),
l = null == o ? void 0 : o.contentString(),
d = a.maybeChild("latitude"),
c = d ? parseFloat(d.contentString()) : void 0,
h = a.maybeChild("longitude"),
g = h ? parseFloat(h.contentString()) : void 0,
m = [];
a.forEachChildWithTag("website", (a) => {
m.push(a.contentString());
});
var _ = [],
b = a.maybeChild("categories");
b &&
b.forEachChildWithTag("category", (a) => {
var e = a.attrString("id");
_.push({ id: e, localized_display_name: a.contentString() });
});
var k = (function (a) {
var e,
n = a.maybeChild("business_hours");
if (n) {
var i = n.maybeAttrString("timezone"),
o = i
? (function (a) {
var e = new Date(),
n = null,
i = a.includes("/") ? a.split("/") : [],
o = i[0],
r = i[1];
if (o && r) {
var t,
u = null == (t = s[o]) ? void 0 : t[r];
null != u && (n = e.getTimezoneOffset() - u);
}
return n;
})(i)
: null,
l = [];
n.forEachChildWithTag("business_hours_config", (a) => {
var e = a.attrEnumValues("mode", (0, t.x)(r.a)),
n = a.attrEnumValues("day_of_week", r.b);
if ("specific_hours" === e) {
var i = a.hasAttr("open_time")
? a.attrInt("open_time")
: -1,
o = a.hasAttr("close_time")
? a.attrInt("close_time")
: -1;
if (!u(i) || !u(o)) return;
l.push({
day_of_week: n,
mode: "specific_hours",
open_time: i,
close_time: o,
});
} else {
var s = { day_of_week: n, mode: e };
l.push(s);
}
}),
(e = Object.assign(
{ config: l },
o && { timezoneOffset: o }
));
}
return e;
})(a),
y = a.maybeChild("catalog_status"),
v = y ? y.attrString("status") : void 0;
return Object.assign(
{
description: i,
email: l,
latitude: c,
longitude: g,
website: m.length > 0 ? m : void 0,
categories: _,
business_hours: k,
catalog_status: v,
},
e && { address: e }
);
}),
d = n(28),
c = new o.a("businessProfileResponse", (a) => {
a.assertTag("iq"), a.assertFromServer();
var e = a.child("business_profile"),
n = [];
return (
e.forEachChildWithTag("profile", (a) => {
var e = (function (a) {
var e = l.parse(a.getNode());
return e.error ? null : e.success;
})(a);
n.push(e);
}),
n
);
});
function h(a) {
var e = (0, i.v)(
"iq",
{ to: i.k, xmlns: "w:biz", id: (0, i.t)(), type: "get" },
(0, i.v)(
"business_profile",
{ v: (0, i.f)(15) },
(0, i.v)("profile", { jid: (0, i.g)(a) })
)
);
return (0, d.e)(e, c).then((a) => (a.success ? a.result[0] : null));
}
},
},
]);