1 | var jsCommon;
|
2 |
|
3 | !function(jsCommon) {
|
4 | var DOMConstants;
|
5 | !function(DOMConstants) {
|
6 | DOMConstants.escKeyCode = 27, DOMConstants.enterKeyCode = 13, DOMConstants.tabKeyCode = 9,
|
7 | DOMConstants.upArrowKeyCode = 38, DOMConstants.downArrowKeyCode = 40, DOMConstants.leftArrowKeyCode = 37,
|
8 | DOMConstants.rightArrowKeyCode = 39, DOMConstants.homeKeyCode = 36, DOMConstants.endKeyCode = 35,
|
9 | DOMConstants.backSpaceKeyCode = 8, DOMConstants.deleteKeyCode = 46, DOMConstants.spaceKeyCode = 32,
|
10 | DOMConstants.shiftKeyCode = 16, DOMConstants.ctrlKeyCode = 17, DOMConstants.altKeyCode = 18,
|
11 | DOMConstants.aKeyCode = 65, DOMConstants.cKeyCode = 67, DOMConstants.sKeyCode = 83,
|
12 | DOMConstants.vKeyCode = 86, DOMConstants.wKeyCode = 87, DOMConstants.xKeyCode = 88,
|
13 | DOMConstants.yKeyCode = 89, DOMConstants.zKeyCode = 90, DOMConstants.DocumentBody = "body",
|
14 | DOMConstants.Anchor = "a", DOMConstants.EditableTextElements = ":text, textarea",
|
15 | DOMConstants.EditableNumericElements = '[type="number"]', DOMConstants.disabledAttributeOrValue = "disabled",
|
16 | DOMConstants.readonlyAttributeOrValue = "readonly", DOMConstants.idAttribute = "id",
|
17 | DOMConstants.styleAttribute = "style", DOMConstants.hrefAttribute = "href", DOMConstants.targetAttribute = "target",
|
18 | DOMConstants.blankValue = "_blank", DOMConstants.selfValue = "_self", DOMConstants.classAttribute = "class",
|
19 | DOMConstants.titleAttribute = "title", DOMConstants.srcAttribute = "src", DOMConstants.contextmenuEventName = "contextmenu",
|
20 | DOMConstants.blurEventName = "blur", DOMConstants.keyUpEventName = "keyup", DOMConstants.inputEventName = "input",
|
21 | DOMConstants.changeEventName = "change", DOMConstants.cutEventName = "cut", DOMConstants.keyDownEventName = "keydown",
|
22 | DOMConstants.mouseMoveEventName = "mousemove", DOMConstants.mouseDownEventName = "mousedown",
|
23 | DOMConstants.mouseEnterEventName = "mouseenter", DOMConstants.mouseLeaveEventName = "mouseleave",
|
24 | DOMConstants.mouseOverEventName = "mouseover", DOMConstants.mouseOutEventName = "mouseout",
|
25 | DOMConstants.mouseClickEventName = "click", DOMConstants.pasteEventName = "paste",
|
26 | DOMConstants.scrollEventName = "scroll", DOMConstants.dropEventName = "drop", DOMConstants.focusEventName = "focus",
|
27 | DOMConstants.focusInEventName = "focusin", DOMConstants.focusOutEventName = "focusout",
|
28 | DOMConstants.selectEventName = "select", DOMConstants.messageEventName = "message",
|
29 | DOMConstants.loadEventName = "load", DOMConstants.beforeUnload = "beforeunload",
|
30 | DOMConstants.inputAndSelectEventNames = "input, select";
|
31 | }(DOMConstants = jsCommon.DOMConstants || (jsCommon.DOMConstants = {}));
|
32 | }(jsCommon || (jsCommon = {}));
|
33 |
|
34 | var powerbi;
|
35 |
|
36 | !function(powerbi) {
|
37 | !function(PowerBIErrorResourceType) {
|
38 | PowerBIErrorResourceType[PowerBIErrorResourceType.ResourceCodeReference = 0] = "ResourceCodeReference",
|
39 | PowerBIErrorResourceType[PowerBIErrorResourceType.EmbeddedString = 1] = "EmbeddedString";
|
40 | }(powerbi.PowerBIErrorResourceType || (powerbi.PowerBIErrorResourceType = {}));
|
41 | var PowerBIErrorResourceType = powerbi.PowerBIErrorResourceType, ServiceErrorToClientError = function() {
|
42 | function ServiceErrorToClientError(serviceError) {
|
43 | this.m_serviceError = serviceError;
|
44 | }
|
45 | return Object.defineProperty(ServiceErrorToClientError.prototype, "code", {
|
46 | get: function() {
|
47 | return ServiceErrorToClientError.codeName;
|
48 | },
|
49 | enumerable: !0,
|
50 | configurable: !0
|
51 | }), Object.defineProperty(ServiceErrorToClientError.prototype, "ignorable", {
|
52 | get: function() {
|
53 | return !1;
|
54 | },
|
55 | enumerable: !0,
|
56 | configurable: !0
|
57 | }), Object.defineProperty(ServiceErrorToClientError.prototype, "requestId", {
|
58 | get: function() {
|
59 | return this.httpRequestId;
|
60 | },
|
61 | set: function(value) {
|
62 | this.httpRequestId = value;
|
63 | },
|
64 | enumerable: !0,
|
65 | configurable: !0
|
66 | }), ServiceErrorToClientError.prototype.getDetails = function(resourceProvider) {
|
67 | var errorDetails;
|
68 | return errorDetails = 6 === this.m_serviceError.statusCode ? PowerBIErrorDetailHelper.GetDetailsFromTransformError(resourceProvider, this.m_serviceError) : PowerBIErrorDetailHelper.GetDetailsFromServerErrorStatusCode(resourceProvider, this.m_serviceError.statusCode),
|
69 | PowerBIErrorDetailHelper.addAdditionalInfo(errorDetails, this.m_serviceError.errorDetails, resourceProvider),
|
70 | PowerBIErrorDetailHelper.addMessageAndStackTrace(errorDetails, this.m_serviceError.message || null, this.m_serviceError.stackTrace || null, resourceProvider),
|
71 | errorDetails;
|
72 | }, ServiceErrorToClientError.codeName = "ServiceErrorToClientError", ServiceErrorToClientError;
|
73 | }();
|
74 | powerbi.ServiceErrorToClientError = ServiceErrorToClientError;
|
75 | var PowerBIErrorDetailHelper = function() {
|
76 | function PowerBIErrorDetailHelper() {}
|
77 | return PowerBIErrorDetailHelper.addAdditionalInfo = function(errorDetails, pbiErrorDetails, localize) {
|
78 | if (pbiErrorDetails) for (var i = 0; i < pbiErrorDetails.length; i++) {
|
79 | var element = pbiErrorDetails[i], localizedCode = localize.getOptional(PowerBIErrorDetailHelper.serverErrorPrefix + element.code), additionErrorInfoKeyValuePair = {
|
80 | errorInfoKey: localizedCode ? localizedCode : element.code,
|
81 | errorInfoValue: element.detail.type === PowerBIErrorResourceType.ResourceCodeReference ? localize.get(PowerBIErrorDetailHelper.serverErrorPrefix + element.detail.value) : element.detail.value
|
82 | };
|
83 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
84 | }
|
85 | return errorDetails;
|
86 | }, PowerBIErrorDetailHelper.addMessageAndStackTrace = function(errorDetails, message, stackTrace, localize) {
|
87 | if (message) {
|
88 | var additionErrorInfoKeyValuePair = {
|
89 | errorInfoKey: localize.get("AdditionalErrorInfo_ErrorDetailsText"),
|
90 | errorInfoValue: message
|
91 | };
|
92 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
93 | }
|
94 | if (stackTrace) {
|
95 | var additionErrorInfoKeyValuePair = {
|
96 | errorInfoKey: localize.get("AdditionalErrorInfo_StackTraceText"),
|
97 | errorInfoValue: stackTrace
|
98 | };
|
99 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
100 | }
|
101 | return errorDetails;
|
102 | }, PowerBIErrorDetailHelper.GetDetailsFromTransformError = function(localize, serviceError) {
|
103 | var message = localize.get("ServiceError_CannotLoadVisual"), key = localize.get("ServiceError_CannotLoadVisual"), val = serviceError.message, additionalInfo = [];
|
104 | additionalInfo.push({
|
105 | errorInfoKey: key,
|
106 | errorInfoValue: val
|
107 | });
|
108 | var errorDetails = {
|
109 | message: message,
|
110 | additionalErrorInfo: additionalInfo
|
111 | };
|
112 | return errorDetails;
|
113 | }, PowerBIErrorDetailHelper.GetDetailsFromServerErrorStatusCode = function(localize, statusCode) {
|
114 | var message = "", key = "", val = "";
|
115 | switch (statusCode) {
|
116 | case 2:
|
117 | message = localize.get("ServiceError_ModelCannotLoad"), key = localize.get("ServiceError_ModelConvertFailureKey"),
|
118 | val = localize.get("ServiceError_ModelConvertFailureValue");
|
119 | break;
|
120 |
|
121 | case 3:
|
122 | message = localize.get("ServiceError_ModelCannotLoad"), key = localize.get("ServiceError_ModelCreationFailureKey"),
|
123 | val = localize.get("ServiceError_ModelCreationFailureValue");
|
124 | break;
|
125 |
|
126 | case 1:
|
127 | message = localize.get("ServiceError_ModelCannotLoad"), key = localize.get("ServiceError_ModelFetchingFailureKey"),
|
128 | val = localize.get("ServiceError_ModelFetchingFailureValue");
|
129 | break;
|
130 |
|
131 | case 4:
|
132 | message = localize.get("ServiceError_CannotLoadVisual"), key = localize.get("ServiceError_ExecuteSemanticQueryErrorKey"),
|
133 | val = localize.get("ServiceError_ExecuteSemanticQueryErrorValue");
|
134 | break;
|
135 |
|
136 | case 5:
|
137 | message = localize.get("ServiceError_CannotLoadVisual"), key = localize.get("ServiceError_ExecuteSemanticQueryInvalidStreamFormatKey"),
|
138 | val = localize.get("ServiceError_ExecuteSemanticQueryInvalidStreamFormatValue");
|
139 | break;
|
140 |
|
141 | case 0:
|
142 | default:
|
143 | message = localize.get("ServiceError_GeneralError"), key = localize.get("ServiceError_GeneralErrorKey"),
|
144 | val = localize.get("ServiceError_GeneralErrorValue");
|
145 | }
|
146 | var additionalInfo = [];
|
147 | additionalInfo.push({
|
148 | errorInfoKey: key,
|
149 | errorInfoValue: val
|
150 | });
|
151 | var errorDetails = {
|
152 | message: message,
|
153 | additionalErrorInfo: additionalInfo
|
154 | };
|
155 | return errorDetails;
|
156 | }, PowerBIErrorDetailHelper.serverErrorPrefix = "ServerError_", PowerBIErrorDetailHelper;
|
157 | }();
|
158 | powerbi.PowerBIErrorDetailHelper = PowerBIErrorDetailHelper;
|
159 | }(powerbi || (powerbi = {}));
|
160 |
|
161 | var powerbi;
|
162 |
|
163 | !function(powerbi) {}(powerbi || (powerbi = {}));
|
164 |
|
165 | var powerbi;
|
166 |
|
167 | if (function(powerbi) {
|
168 | function createGeoTaggingAnalyzerService(getLocalized) {
|
169 | return new GeoTaggingAnalyzerService(getLocalized);
|
170 | }
|
171 | powerbi.CategoryTypes = {
|
172 | Address: "Address",
|
173 | City: "City",
|
174 | Continent: "Continent",
|
175 | CountryRegion: "Country",
|
176 | County: "County",
|
177 | Longitude: "Longitude",
|
178 | Latitude: "Latitude",
|
179 | Place: "Place",
|
180 | PostalCode: "PostalCode",
|
181 | StateOrProvince: "StateOrProvince"
|
182 | }, powerbi.createGeoTaggingAnalyzerService = createGeoTaggingAnalyzerService;
|
183 | var EnglishBackup = {
|
184 | GeotaggingString_Continent: "continent",
|
185 | GeotaggingString_Continents: "continents",
|
186 | GeotaggingString_Country: "country",
|
187 | GeotaggingString_Countries: "countries",
|
188 | GeotaggingString_State: "state",
|
189 | GeotaggingString_States: "states",
|
190 | GeotaggingString_City: "city",
|
191 | GeotaggingString_Cities: "cities",
|
192 | GeotaggingString_Town: "town",
|
193 | GeotaggingString_Towns: "towns",
|
194 | GeotaggingString_Province: "province",
|
195 | GeotaggingString_Provinces: "provinces",
|
196 | GeotaggingString_County: "county",
|
197 | GeotaggingString_Counties: "counties",
|
198 | GeotaggingString_Village: "village",
|
199 | GeotaggingString_Villages: "villages",
|
200 | GeotaggingString_Post: "post",
|
201 | GeotaggingString_Zip: "zip",
|
202 | GeotaggingString_Code: "code",
|
203 | GeotaggingString_Place: "place",
|
204 | GeotaggingString_Places: "places",
|
205 | GeotaggingString_Address: "address",
|
206 | GeotaggingString_Addresses: "addresses",
|
207 | GeotaggingString_Street: "street",
|
208 | GeotaggingString_Streets: "streets",
|
209 | GeotaggingString_Longitude: "longitude",
|
210 | GeotaggingString_Longitude_Short: "lon",
|
211 | GeotaggingString_Latitude: "latitude",
|
212 | GeotaggingString_Latitude_Short: "lat",
|
213 | GeotaggingString_PostalCode: "postal code",
|
214 | GeotaggingString_PostalCodes: "postal codes",
|
215 | GeotaggingString_ZipCode: "zip code",
|
216 | GeotaggingString_ZipCodes: "zip codes",
|
217 | GeotaggingString_Territory: "territory",
|
218 | GeotaggingString_Territories: "territories",
|
219 | GeotaggingString_VRMBackCompat_CountryRegion: "CountryRegion",
|
220 | GeotaggingString_VRMBackCompat_StateOrProvince: "StateOrProvince"
|
221 | }, GeoTaggingAnalyzerService = function() {
|
222 | function GeoTaggingAnalyzerService(getLocalized) {
|
223 | this.GeotaggingString_VRMBackCompat_CountryRegion = "CountryRegion", this.GeotaggingString_VRMBackCompat_StateOrProvince = "StateOrProvince",
|
224 | this.GeotaggingString_Continent = getLocalized("GeotaggingString_Continent").toLowerCase(),
|
225 | this.GeotaggingString_Continents = getLocalized("GeotaggingString_Continents").toLowerCase(),
|
226 | this.GeotaggingString_Country = getLocalized("GeotaggingString_Country").toLowerCase(),
|
227 | this.GeotaggingString_Countries = getLocalized("GeotaggingString_Countries").toLowerCase(),
|
228 | this.GeotaggingString_State = getLocalized("GeotaggingString_State").toLowerCase(),
|
229 | this.GeotaggingString_States = getLocalized("GeotaggingString_States").toLowerCase(),
|
230 | this.GeotaggingString_City = getLocalized("GeotaggingString_City").toLowerCase(),
|
231 | this.GeotaggingString_Cities = getLocalized("GeotaggingString_Cities").toLowerCase(),
|
232 | this.GeotaggingString_Town = getLocalized("GeotaggingString_Town").toLowerCase(),
|
233 | this.GeotaggingString_Towns = getLocalized("GeotaggingString_Towns").toLowerCase(),
|
234 | this.GeotaggingString_Province = getLocalized("GeotaggingString_Province").toLowerCase(),
|
235 | this.GeotaggingString_Provinces = getLocalized("GeotaggingString_Provinces").toLowerCase(),
|
236 | this.GeotaggingString_County = getLocalized("GeotaggingString_County").toLowerCase(),
|
237 | this.GeotaggingString_Counties = getLocalized("GeotaggingString_Counties").toLowerCase(),
|
238 | this.GeotaggingString_Village = getLocalized("GeotaggingString_Village").toLowerCase(),
|
239 | this.GeotaggingString_Villages = getLocalized("GeotaggingString_Villages").toLowerCase(),
|
240 | this.GeotaggingString_Post = getLocalized("GeotaggingString_Post").toLowerCase(),
|
241 | this.GeotaggingString_Zip = getLocalized("GeotaggingString_Zip").toLowerCase(),
|
242 | this.GeotaggingString_Code = getLocalized("GeotaggingString_Code").toLowerCase(),
|
243 | this.GeotaggingString_Place = getLocalized("GeotaggingString_Place").toLowerCase(),
|
244 | this.GeotaggingString_Places = getLocalized("GeotaggingString_Places").toLowerCase(),
|
245 | this.GeotaggingString_Address = getLocalized("GeotaggingString_Address").toLowerCase(),
|
246 | this.GeotaggingString_Addresses = getLocalized("GeotaggingString_Addresses").toLowerCase(),
|
247 | this.GeotaggingString_Street = getLocalized("GeotaggingString_Street").toLowerCase(),
|
248 | this.GeotaggingString_Streets = getLocalized("GeotaggingString_Streets").toLowerCase(),
|
249 | this.GeotaggingString_Longitude = getLocalized("GeotaggingString_Longitude").toLowerCase(),
|
250 | this.GeotaggingString_Longitude_Short = getLocalized("GeotaggingString_Longitude_Short").toLowerCase(),
|
251 | this.GeotaggingString_Latitude = getLocalized("GeotaggingString_Latitude").toLowerCase(),
|
252 | this.GeotaggingString_Latitude_Short = getLocalized("GeotaggingString_Latitude_Short").toLowerCase(),
|
253 | this.GeotaggingString_PostalCode = getLocalized("GeotaggingString_PostalCode").toLowerCase(),
|
254 | this.GeotaggingString_PostalCodes = getLocalized("GeotaggingString_PostalCodes").toLowerCase(),
|
255 | this.GeotaggingString_ZipCode = getLocalized("GeotaggingString_ZipCode").toLowerCase(),
|
256 | this.GeotaggingString_ZipCodes = getLocalized("GeotaggingString_ZipCodes").toLowerCase(),
|
257 | this.GeotaggingString_Territory = getLocalized("GeotaggingString_Territory").toLowerCase(),
|
258 | this.GeotaggingString_Territories = getLocalized("GeotaggingString_Territories").toLowerCase();
|
259 | }
|
260 | return GeoTaggingAnalyzerService.prototype.isLongitudeOrLatitude = function(fieldRefName) {
|
261 | return this.isLongitude(fieldRefName) || this.isLatitude(fieldRefName);
|
262 | }, GeoTaggingAnalyzerService.prototype.isGeographic = function(fieldRefName) {
|
263 | return this.isLongitudeOrLatitude(fieldRefName) || this.isGeocodable(fieldRefName);
|
264 | }, GeoTaggingAnalyzerService.prototype.isGeocodable = function(fieldRefName) {
|
265 | return this.isAddress(fieldRefName) || this.isCity(fieldRefName) || this.isContinent(fieldRefName) || this.isCountry(fieldRefName) || this.isCounty(fieldRefName) || this.isStateOrProvince(fieldRefName) || this.isPlace(fieldRefName) || this.isPostalCode(fieldRefName) || this.isTerritory(fieldRefName);
|
266 | }, GeoTaggingAnalyzerService.prototype.isGeoshapable = function(fieldRefName) {
|
267 | return this.isCity(fieldRefName) || this.isCountry(fieldRefName) || this.isCounty(fieldRefName) || this.isStateOrProvince(fieldRefName) || this.isPostalCode(fieldRefName) || this.isTerritory(fieldRefName) || this.isGeoshapableEnglish(fieldRefName);
|
268 | }, GeoTaggingAnalyzerService.prototype.isGeoshapableEnglish = function(fieldRefName) {
|
269 | return this.isEnglishCity(fieldRefName) || this.isEnglishCountry(fieldRefName) || this.isEnglishCounty(fieldRefName) || this.isEnglishStateOrProvince(fieldRefName) || this.isEnglishPostalCode(fieldRefName) || this.isEnglishTerritory(fieldRefName);
|
270 | }, GeoTaggingAnalyzerService.prototype.isAddress = function(fieldRefName) {
|
271 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Address, this.GeotaggingString_Addresses, this.GeotaggingString_Street, this.GeotaggingString_Streets ]);
|
272 | }, GeoTaggingAnalyzerService.prototype.isPlace = function(fieldRefName) {
|
273 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Place, this.GeotaggingString_Places ]);
|
274 | }, GeoTaggingAnalyzerService.prototype.isCity = function(fieldRefName) {
|
275 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_City, this.GeotaggingString_Cities, this.GeotaggingString_Town, this.GeotaggingString_Towns, this.GeotaggingString_Village, this.GeotaggingString_Villages ]);
|
276 | }, GeoTaggingAnalyzerService.prototype.isStateOrProvince = function(fieldRefName) {
|
277 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_State, this.GeotaggingString_States, this.GeotaggingString_Province, this.GeotaggingString_Provinces, this.GeotaggingString_VRMBackCompat_StateOrProvince ]);
|
278 | }, GeoTaggingAnalyzerService.prototype.isCountry = function(fieldRefName) {
|
279 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Country, this.GeotaggingString_Countries, this.GeotaggingString_VRMBackCompat_CountryRegion ]);
|
280 | }, GeoTaggingAnalyzerService.prototype.isCounty = function(fieldRefName) {
|
281 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_County, this.GeotaggingString_Counties ]);
|
282 | }, GeoTaggingAnalyzerService.prototype.isContinent = function(fieldRefName) {
|
283 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Continent, this.GeotaggingString_Continents ]);
|
284 | }, GeoTaggingAnalyzerService.prototype.isPostalCode = function(fieldRefName) {
|
285 | var result = GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Post, this.GeotaggingString_Zip ]) && GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Code ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_PostalCode, this.GeotaggingString_PostalCodes, this.GeotaggingString_ZipCode, this.GeotaggingString_ZipCodes ]);
|
286 | if (!result) {
|
287 | var whiteSpaceRegex = /\s+/, fieldNameWithoutWhitespace = fieldRefName.replace(whiteSpaceRegex, "");
|
288 | result = GeoTaggingAnalyzerService.hasMatches(fieldNameWithoutWhitespace, [ this.GeotaggingString_PostalCode.replace(whiteSpaceRegex, ""), this.GeotaggingString_PostalCodes.replace(whiteSpaceRegex, ""), this.GeotaggingString_ZipCode.replace(whiteSpaceRegex, ""), this.GeotaggingString_ZipCodes.replace(whiteSpaceRegex, "") ]);
|
289 | }
|
290 | return result;
|
291 | }, GeoTaggingAnalyzerService.prototype.isLongitude = function(fieldRefName) {
|
292 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Longitude ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Longitude_Short ], !0);
|
293 | }, GeoTaggingAnalyzerService.prototype.isLatitude = function(fieldRefName) {
|
294 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Latitude ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Latitude_Short ], !0);
|
295 | }, GeoTaggingAnalyzerService.prototype.isTerritory = function(fieldRefName) {
|
296 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Territory, this.GeotaggingString_Territories ]);
|
297 | }, GeoTaggingAnalyzerService.hasMatches = function(fieldName, possibleMatches, useStrict) {
|
298 | for (var nonWordRegex = /\W/, value = fieldName.toLowerCase(), i = 0, len = possibleMatches.length; len > i; i++) {
|
299 | var possibleMatch = possibleMatches[i].toLowerCase();
|
300 | if (useStrict) {
|
301 | var indexofpossibleMatch = value.indexOf(possibleMatch);
|
302 | if (indexofpossibleMatch > -1) {
|
303 | var wordEndFlag = void 0, wordBeginFlag = void 0;
|
304 | if (wordEndFlag = wordBeginFlag = !0, indexofpossibleMatch - 1 > 0 && (wordBeginFlag = nonWordRegex.test(value[indexofpossibleMatch - 1])),
|
305 | indexofpossibleMatch + possibleMatch.length < value.length && (wordEndFlag = nonWordRegex.test(value[indexofpossibleMatch + possibleMatch.length])),
|
306 | wordBeginFlag && wordEndFlag) return !0;
|
307 | }
|
308 | } else if (value.indexOf(possibleMatch) > -1) return !0;
|
309 | }
|
310 | return !1;
|
311 | }, GeoTaggingAnalyzerService.prototype.getFieldType = function(fieldName) {
|
312 | return null != fieldName ? this.isLatitude(fieldName) ? powerbi.CategoryTypes.Latitude : this.isLongitude(fieldName) ? powerbi.CategoryTypes.Longitude : this.isPostalCode(fieldName) ? powerbi.CategoryTypes.PostalCode : this.isAddress(fieldName) ? powerbi.CategoryTypes.Address : this.isPlace(fieldName) ? powerbi.CategoryTypes.Place : this.isCity(fieldName) ? powerbi.CategoryTypes.City : this.isCountry(fieldName) ? powerbi.CategoryTypes.CountryRegion : this.isCounty(fieldName) ? powerbi.CategoryTypes.County : this.isStateOrProvince(fieldName) ? powerbi.CategoryTypes.StateOrProvince : this.isContinent(fieldName) ? powerbi.CategoryTypes.Continent : this.getEnglishFieldType(fieldName) : void 0;
|
313 | }, GeoTaggingAnalyzerService.prototype.isEnglishAddress = function(fieldRefName) {
|
314 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Address, EnglishBackup.GeotaggingString_Addresses, EnglishBackup.GeotaggingString_Street, EnglishBackup.GeotaggingString_Streets ]);
|
315 | }, GeoTaggingAnalyzerService.prototype.isEnglishPlace = function(fieldRefName) {
|
316 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Place, EnglishBackup.GeotaggingString_Places ]);
|
317 | }, GeoTaggingAnalyzerService.prototype.isEnglishCity = function(fieldRefName) {
|
318 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_City, EnglishBackup.GeotaggingString_Cities, EnglishBackup.GeotaggingString_Town, EnglishBackup.GeotaggingString_Towns, EnglishBackup.GeotaggingString_Village, EnglishBackup.GeotaggingString_Villages ]);
|
319 | }, GeoTaggingAnalyzerService.prototype.isEnglishStateOrProvince = function(fieldRefName) {
|
320 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_State, EnglishBackup.GeotaggingString_States, EnglishBackup.GeotaggingString_Province, EnglishBackup.GeotaggingString_Provinces, EnglishBackup.GeotaggingString_VRMBackCompat_StateOrProvince ]);
|
321 | }, GeoTaggingAnalyzerService.prototype.isEnglishCountry = function(fieldRefName) {
|
322 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Country, EnglishBackup.GeotaggingString_Countries, EnglishBackup.GeotaggingString_VRMBackCompat_CountryRegion ]);
|
323 | }, GeoTaggingAnalyzerService.prototype.isEnglishCounty = function(fieldRefName) {
|
324 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_County, EnglishBackup.GeotaggingString_Counties ]);
|
325 | }, GeoTaggingAnalyzerService.prototype.isEnglishContinent = function(fieldRefName) {
|
326 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Continent, EnglishBackup.GeotaggingString_Continents ]);
|
327 | }, GeoTaggingAnalyzerService.prototype.isEnglishPostalCode = function(fieldRefName) {
|
328 | var result = GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Post, EnglishBackup.GeotaggingString_Zip ]) && GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ this.GeotaggingString_Code ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_PostalCode, EnglishBackup.GeotaggingString_PostalCodes, EnglishBackup.GeotaggingString_ZipCode, EnglishBackup.GeotaggingString_ZipCodes ]);
|
329 | if (!result) {
|
330 | var whiteSpaceRegexPattern = new RegExp("s");
|
331 | result = GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_PostalCode.replace(whiteSpaceRegexPattern, ""), EnglishBackup.GeotaggingString_PostalCodes.replace(whiteSpaceRegexPattern, ""), EnglishBackup.GeotaggingString_ZipCode.replace(whiteSpaceRegexPattern, ""), EnglishBackup.GeotaggingString_ZipCodes.replace(whiteSpaceRegexPattern, "") ]);
|
332 | }
|
333 | return result;
|
334 | }, GeoTaggingAnalyzerService.prototype.isEnglishLongitude = function(fieldRefName) {
|
335 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Longitude ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Longitude_Short ], !0);
|
336 | }, GeoTaggingAnalyzerService.prototype.isEnglishLatitude = function(fieldRefName) {
|
337 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Latitude ]) || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Latitude_Short ], !0);
|
338 | }, GeoTaggingAnalyzerService.prototype.isEnglishTerritory = function(fieldRefName) {
|
339 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [ EnglishBackup.GeotaggingString_Territory, EnglishBackup.GeotaggingString_Territories ]);
|
340 | }, GeoTaggingAnalyzerService.prototype.getEnglishFieldType = function(fieldName) {
|
341 | return null != fieldName ? this.isEnglishLatitude(fieldName) ? powerbi.CategoryTypes.Latitude : this.isEnglishLongitude(fieldName) ? powerbi.CategoryTypes.Longitude : this.isEnglishPostalCode(fieldName) ? powerbi.CategoryTypes.PostalCode : this.isEnglishAddress(fieldName) ? powerbi.CategoryTypes.Address : this.isEnglishPlace(fieldName) ? powerbi.CategoryTypes.Place : this.isEnglishCity(fieldName) ? powerbi.CategoryTypes.City : this.isEnglishCountry(fieldName) ? powerbi.CategoryTypes.CountryRegion : this.isEnglishCounty(fieldName) ? powerbi.CategoryTypes.County : this.isEnglishStateOrProvince(fieldName) ? powerbi.CategoryTypes.StateOrProvince : this.isEnglishContinent(fieldName) ? powerbi.CategoryTypes.Continent : void 0 : void 0;
|
342 | }, GeoTaggingAnalyzerService;
|
343 | }();
|
344 | powerbi.GeoTaggingAnalyzerService = GeoTaggingAnalyzerService;
|
345 | }(powerbi || (powerbi = {})), "undefined" == typeof DEBUG) var DEBUG = !0;
|
346 |
|
347 | var powerbi;
|
348 |
|
349 | !function(powerbi) {
|
350 | var UnknownClientError = function() {
|
351 | function UnknownClientError(code) {
|
352 | this.errorCode = code;
|
353 | }
|
354 | return Object.defineProperty(UnknownClientError.prototype, "code", {
|
355 | get: function() {
|
356 | return this.errorCode;
|
357 | },
|
358 | enumerable: !0,
|
359 | configurable: !0
|
360 | }), Object.defineProperty(UnknownClientError.prototype, "ignorable", {
|
361 | get: function() {
|
362 | return !1;
|
363 | },
|
364 | enumerable: !0,
|
365 | configurable: !0
|
366 | }), UnknownClientError.prototype.getDetails = function(resourceProvider) {
|
367 | var details = {
|
368 | message: resourceProvider.get("ClientError_UnknownClientErrorValue"),
|
369 | additionalErrorInfo: [ {
|
370 | errorInfoKey: resourceProvider.get("ClientError_UnknownClientErrorKey"),
|
371 | errorInfoValue: resourceProvider.get("ClientError_UnknownClientErrorValue")
|
372 | } ]
|
373 | };
|
374 | return details;
|
375 | }, UnknownClientError;
|
376 | }();
|
377 | powerbi.UnknownClientError = UnknownClientError;
|
378 | var HttpClientError = function() {
|
379 | function HttpClientError(httpStatusCode, requestId) {
|
380 | this.httpStatusCode = httpStatusCode, this.httpRequestId = requestId;
|
381 | }
|
382 | return Object.defineProperty(HttpClientError.prototype, "code", {
|
383 | get: function() {
|
384 | return "HttpClientError";
|
385 | },
|
386 | enumerable: !0,
|
387 | configurable: !0
|
388 | }), Object.defineProperty(HttpClientError.prototype, "ignorable", {
|
389 | get: function() {
|
390 | return !1;
|
391 | },
|
392 | enumerable: !0,
|
393 | configurable: !0
|
394 | }), Object.defineProperty(HttpClientError.prototype, "requestId", {
|
395 | get: function() {
|
396 | return this.httpRequestId;
|
397 | },
|
398 | enumerable: !0,
|
399 | configurable: !0
|
400 | }), HttpClientError.prototype.getDetails = function(resourceProvider) {
|
401 | var details = {
|
402 | message: null,
|
403 | additionalErrorInfo: [ {
|
404 | errorInfoKey: resourceProvider.get("DsrError_Key"),
|
405 | errorInfoValue: resourceProvider.get("DsrError_UnknownErrorValue")
|
406 | }, {
|
407 | errorInfoKey: resourceProvider.get("ClientError_HttpResponseStatusCodeKey"),
|
408 | errorInfoValue: this.httpStatusCode.toString()
|
409 | } ]
|
410 | };
|
411 | return details;
|
412 | }, HttpClientError;
|
413 | }();
|
414 | powerbi.HttpClientError = HttpClientError;
|
415 | var IgnorableClientError = function() {
|
416 | function IgnorableClientError() {}
|
417 | return Object.defineProperty(IgnorableClientError.prototype, "code", {
|
418 | get: function() {
|
419 | return "IgnorableClientError";
|
420 | },
|
421 | enumerable: !0,
|
422 | configurable: !0
|
423 | }), Object.defineProperty(IgnorableClientError.prototype, "ignorable", {
|
424 | get: function() {
|
425 | return !0;
|
426 | },
|
427 | enumerable: !0,
|
428 | configurable: !0
|
429 | }), IgnorableClientError.prototype.getDetails = function(resourceProvider) {
|
430 | var details = {
|
431 | message: "",
|
432 | additionalErrorInfo: []
|
433 | };
|
434 | return details;
|
435 | }, IgnorableClientError;
|
436 | }();
|
437 | powerbi.IgnorableClientError = IgnorableClientError;
|
438 | }(powerbi || (powerbi = {}));
|
439 |
|
440 | var jsCommon;
|
441 |
|
442 | !function(jsCommon) {
|
443 | var ArrayExtensions;
|
444 | !function(ArrayExtensions) {
|
445 | function intersect(target, other) {
|
446 | for (var result = [], i = target.length - 1; i >= 0; --i) -1 !== other.indexOf(target[i]) && result.push(target[i]);
|
447 | return result;
|
448 | }
|
449 | function diff(target, other) {
|
450 | for (var result = [], i = target.length - 1; i >= 0; --i) {
|
451 | var value = target[i];
|
452 | -1 === other.indexOf(value) && result.push(value);
|
453 | }
|
454 | return result;
|
455 | }
|
456 | function distinct(source) {
|
457 | for (var result = [], i = 0, len = source.length; len > i; i++) {
|
458 | var value = source[i];
|
459 | -1 === result.indexOf(value) && result.push(value);
|
460 | }
|
461 | return result;
|
462 | }
|
463 | function union(target, source) {
|
464 | for (var i = 0, len = source.length; len > i; ++i) unionSingle(target, source[i]);
|
465 | }
|
466 | function unionSingle(target, value) {
|
467 | target.indexOf(value) < 0 && target.push(value);
|
468 | }
|
469 | function range(source, startIndex, endIndex) {
|
470 | for (var result = [], i = startIndex; endIndex >= i; ++i) result.push(source[i]);
|
471 | return result;
|
472 | }
|
473 | function take(source, count) {
|
474 | for (var result = [], i = 0; count > i; ++i) result.push(source[i]);
|
475 | return result;
|
476 | }
|
477 | function copy(source) {
|
478 | return take(source, source.length);
|
479 | }
|
480 | function sequenceEqual(left, right, comparison) {
|
481 | if (left === right) return !0;
|
482 | if (!!left != !!right) return !1;
|
483 | var len = left.length;
|
484 | if (len !== right.length) return !1;
|
485 | for (var i = 0; len > i && comparison(left[i], right[i]); ) ++i;
|
486 | return i === len;
|
487 | }
|
488 | function emptyToNull(array) {
|
489 | return array && 0 === array.length ? null : array;
|
490 | }
|
491 | function indexOf(array, predicate) {
|
492 | for (var i = 0, len = array.length; len > i; ++i) if (predicate(array[i])) return i;
|
493 | return -1;
|
494 | }
|
495 | function rotate(array, offset) {
|
496 | if (0 === offset) return array.slice();
|
497 | var rotated = array.slice(offset);
|
498 | return Array.prototype.push.apply(rotated, array.slice(0, offset)), rotated;
|
499 | }
|
500 | function createWithId() {
|
501 | return extendWithId([]);
|
502 | }
|
503 | function extendWithId(array) {
|
504 | var extended = array;
|
505 | return extended.withId = withId, extended;
|
506 | }
|
507 | function findWithId(array, id) {
|
508 | for (var i = 0, len = array.length; len > i; i++) {
|
509 | var item = array[i];
|
510 | if (item.id === id) return item;
|
511 | }
|
512 | }
|
513 | function withId(id) {
|
514 | return ArrayExtensions.findWithId(this, id);
|
515 | }
|
516 | function createWithName() {
|
517 | return extendWithName([]);
|
518 | }
|
519 | function extendWithName(array) {
|
520 | var extended = array;
|
521 | return extended.withName = withName, extended;
|
522 | }
|
523 | function findItemWithName(array, name) {
|
524 | var index = indexWithName(array, name);
|
525 | return index >= 0 ? array[index] : void 0;
|
526 | }
|
527 | function indexWithName(array, name) {
|
528 | for (var i = 0, len = array.length; len > i; i++) {
|
529 | var item = array[i];
|
530 | if (item.name === name) return i;
|
531 | }
|
532 | return -1;
|
533 | }
|
534 | function insertSorted(list, value) {
|
535 | for (var len = list.length, i = len - 1; i >= 0; i--) {
|
536 | var diff_1 = list[i] - value;
|
537 | if (0 === diff_1) return !1;
|
538 | if (!(diff_1 > 0)) return list.splice(i + 1, 0, value), !0;
|
539 | }
|
540 | return list.unshift(value), !0;
|
541 | }
|
542 | function removeFirst(list, value) {
|
543 | var index = list.indexOf(value);
|
544 | return 0 > index ? !1 : (list.splice(index, 1), !0);
|
545 | }
|
546 | function withName(name) {
|
547 | var array = this;
|
548 | return findItemWithName(array, name);
|
549 | }
|
550 | function clear(array) {
|
551 | if (array) for (;array.length > 0; ) array.pop();
|
552 | }
|
553 | function isUndefinedOrEmpty(array) {
|
554 | return !array || 0 === array.length;
|
555 | }
|
556 | function swap(array, firstIndex, secondIndex) {
|
557 | var temp = array[firstIndex];
|
558 | array[firstIndex] = array[secondIndex], array[secondIndex] = temp;
|
559 | }
|
560 | function isInArray(array, lookupItem, compareCallback) {
|
561 | return _.any(array, function(item) {
|
562 | return compareCallback(item, lookupItem);
|
563 | });
|
564 | }
|
565 | function isArrayOrInheritedArray(obj) {
|
566 | for (var nextPrototype = obj; null != nextPrototype; ) {
|
567 | if (_.isArray(nextPrototype)) return !0;
|
568 | nextPrototype = Object.getPrototypeOf(nextPrototype);
|
569 | }
|
570 | return !1;
|
571 | }
|
572 | ArrayExtensions.intersect = intersect, ArrayExtensions.diff = diff, ArrayExtensions.distinct = distinct,
|
573 | ArrayExtensions.union = union, ArrayExtensions.unionSingle = unionSingle, ArrayExtensions.range = range,
|
574 | ArrayExtensions.take = take, ArrayExtensions.copy = copy, ArrayExtensions.sequenceEqual = sequenceEqual,
|
575 | ArrayExtensions.emptyToNull = emptyToNull, ArrayExtensions.indexOf = indexOf, ArrayExtensions.rotate = rotate,
|
576 | ArrayExtensions.createWithId = createWithId, ArrayExtensions.extendWithId = extendWithId,
|
577 | ArrayExtensions.findWithId = findWithId, ArrayExtensions.createWithName = createWithName,
|
578 | ArrayExtensions.extendWithName = extendWithName, ArrayExtensions.findItemWithName = findItemWithName,
|
579 | ArrayExtensions.indexWithName = indexWithName, ArrayExtensions.insertSorted = insertSorted,
|
580 | ArrayExtensions.removeFirst = removeFirst, ArrayExtensions.clear = clear, ArrayExtensions.isUndefinedOrEmpty = isUndefinedOrEmpty,
|
581 | ArrayExtensions.swap = swap, ArrayExtensions.isInArray = isInArray, ArrayExtensions.isArrayOrInheritedArray = isArrayOrInheritedArray;
|
582 | }(ArrayExtensions = jsCommon.ArrayExtensions || (jsCommon.ArrayExtensions = {}));
|
583 | }(jsCommon || (jsCommon = {}));
|
584 |
|
585 | var InJs;
|
586 |
|
587 | !function(InJs) {
|
588 | var DomFactory;
|
589 | !function(DomFactory) {
|
590 | function div() {
|
591 | return $("<div/>");
|
592 | }
|
593 | function span() {
|
594 | return $("<span/>");
|
595 | }
|
596 | function checkbox() {
|
597 | return $('<input type="checkbox"/>');
|
598 | }
|
599 | function ul() {
|
600 | return $("<ul/>");
|
601 | }
|
602 | function li() {
|
603 | return $("<li/>");
|
604 | }
|
605 | function button() {
|
606 | return $('<input type="button"/>');
|
607 | }
|
608 | function select() {
|
609 | return $("<select/>");
|
610 | }
|
611 | function textBox() {
|
612 | return $('<input type="text"/>');
|
613 | }
|
614 | function img() {
|
615 | return $("<img/>");
|
616 | }
|
617 | function iframe() {
|
618 | return $("<iframe/>");
|
619 | }
|
620 | DomFactory.div = div, DomFactory.span = span, DomFactory.checkbox = checkbox, DomFactory.ul = ul,
|
621 | DomFactory.li = li, DomFactory.button = button, DomFactory.select = select, DomFactory.textBox = textBox,
|
622 | DomFactory.img = img, DomFactory.iframe = iframe;
|
623 | }(DomFactory = InJs.DomFactory || (InJs.DomFactory = {}));
|
624 | }(InJs || (InJs = {}));
|
625 |
|
626 | var powerbi;
|
627 |
|
628 | !function(powerbi) {
|
629 | function applyDefault(value, defaultValue) {
|
630 | return void 0 !== value ? value : defaultValue;
|
631 | }
|
632 | var Double;
|
633 | !function(Double) {
|
634 | function pow10(exp) {
|
635 | return exp >= 0 ? exp < Double.POSITIVE_POWERS.length ? Double.POSITIVE_POWERS[exp] : 1 / 0 : (exp = -exp,
|
636 | exp > 0 && exp < Double.NEGATIVE_POWERS.length ? Double.NEGATIVE_POWERS[exp] : 0);
|
637 | }
|
638 | function log10(val) {
|
639 | if (val > 1 && 1e16 > val) return 1e8 > val ? 1e4 > val ? 100 > val ? 10 > val ? 0 : 1 : 1e3 > val ? 2 : 3 : 1e6 > val ? 1e5 > val ? 4 : 5 : 1e7 > val ? 6 : 7 : 1e12 > val ? 1e10 > val ? 1e9 > val ? 8 : 9 : 1e11 > val ? 10 : 11 : 1e14 > val ? 1e13 > val ? 12 : 13 : 1e15 > val ? 14 : 15;
|
640 | if (val > 1e-16 && 1 > val) return 1e-8 > val ? 1e-12 > val ? 1e-14 > val ? 1e-15 > val ? -16 : -15 : 1e-13 > val ? -14 : -13 : 1e-10 > val ? 1e-11 > val ? -12 : -11 : 1e-9 > val ? -10 : -9 : 1e-4 > val ? 1e-6 > val ? 1e-7 > val ? -8 : -7 : 1e-5 > val ? -6 : -5 : .01 > val ? .001 > val ? -4 : -3 : .1 > val ? -2 : -1;
|
641 | var log10 = Math.log(val) / Double.LOG_E_10;
|
642 | return Double.floorWithPrecision(log10);
|
643 | }
|
644 | function getPrecision(x, decimalDigits) {
|
645 | if (void 0 === decimalDigits && (decimalDigits = Double.DEFAULT_PRECISION_IN_DECIMAL_DIGITS),
|
646 | x) {
|
647 | var exp = Double.log10(Math.abs(x));
|
648 | if (exp < Double.MIN_EXP) return 0;
|
649 | var precisionExp = Math.max(exp - decimalDigits, -Double.NEGATIVE_POWERS.length + 1);
|
650 | return Double.pow10(precisionExp);
|
651 | }
|
652 | }
|
653 | function equalWithPrecision(x, y, precision) {
|
654 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), x === y || Math.abs(x - y) < precision;
|
655 | }
|
656 | function lessWithPrecision(x, y, precision) {
|
657 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), y > x && Math.abs(x - y) > precision;
|
658 | }
|
659 | function lessOrEqualWithPrecision(x, y, precision) {
|
660 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), y > x || Math.abs(x - y) < precision;
|
661 | }
|
662 | function greaterWithPrecision(x, y, precision) {
|
663 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), x > y && Math.abs(x - y) > precision;
|
664 | }
|
665 | function greaterOrEqualWithPrecision(x, y, precision) {
|
666 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), x > y || Math.abs(x - y) < precision;
|
667 | }
|
668 | function floorWithPrecision(x, precision) {
|
669 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
670 | var roundX = Math.round(x);
|
671 | return Math.abs(x - roundX) < precision ? roundX : Math.floor(x);
|
672 | }
|
673 | function ceilWithPrecision(x, precision) {
|
674 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
675 | var roundX = Math.round(x);
|
676 | return Math.abs(x - roundX) < precision ? roundX : Math.ceil(x);
|
677 | }
|
678 | function floorToPrecision(x, precision) {
|
679 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), 0 === precision || 0 === x ? x : Math.floor(x / precision) * precision;
|
680 | }
|
681 | function ceilToPrecision(x, precision) {
|
682 | return precision = applyDefault(precision, Double.DEFAULT_PRECISION), 0 === precision || 0 === x ? x : Math.ceil(x / precision) * precision;
|
683 | }
|
684 | function roundToPrecision(x, precision) {
|
685 | if (precision = applyDefault(precision, Double.DEFAULT_PRECISION), 0 === precision || 0 === x) return x;
|
686 | var result = Math.round(x / precision) * precision, decimalDigits = Math.round(Double.log10(Math.abs(x)) - Double.log10(precision)) + 1;
|
687 | return decimalDigits > 0 && 16 > decimalDigits && (result = parseFloat(result.toPrecision(decimalDigits))),
|
688 | result;
|
689 | }
|
690 | function ensureInRange(x, min, max) {
|
691 | return void 0 === x || null === x ? x : min > x ? min : x > max ? max : x;
|
692 | }
|
693 | function round(x) {
|
694 | return .5 + x << 0;
|
695 | }
|
696 | function project(value, fromMin, fromSize, toMin, toSize) {
|
697 | if (0 === fromSize || 0 === toSize) return value >= fromMin && fromMin + fromSize >= value ? toMin : NaN;
|
698 | var relativeX = (value - fromMin) / fromSize, projectedX = toMin + relativeX * toSize;
|
699 | return projectedX;
|
700 | }
|
701 | function removeDecimalNoise(value) {
|
702 | return roundToPrecision(value, getPrecision(value));
|
703 | }
|
704 | function isInteger(value) {
|
705 | return null !== value && value % 1 === 0;
|
706 | }
|
707 | function toIncrement(value, increment) {
|
708 | return Math.round(value / increment) * increment;
|
709 | }
|
710 | Double.MIN_VALUE = -Number.MAX_VALUE, Double.MAX_VALUE = Number.MAX_VALUE, Double.MIN_EXP = -308,
|
711 | Double.MAX_EXP = 308, Double.EPSILON = 1e-323, Double.DEFAULT_PRECISION = 1e-4,
|
712 | Double.DEFAULT_PRECISION_IN_DECIMAL_DIGITS = 12, Double.LOG_E_10 = Math.log(10),
|
713 | Double.POSITIVE_POWERS = [ 1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, 1e23, 1e24, 1e25, 1e26, 1e27, 1e28, 1e29, 1e30, 1e31, 1e32, 1e33, 1e34, 1e35, 1e36, 1e37, 1e38, 1e39, 1e40, 1e41, 1e42, 1e43, 1e44, 1e45, 1e46, 1e47, 1e48, 1e49, 1e50, 1e51, 1e52, 1e53, 1e54, 1e55, 1e56, 1e57, 1e58, 1e59, 1e60, 1e61, 1e62, 1e63, 1e64, 1e65, 1e66, 1e67, 1e68, 1e69, 1e70, 1e71, 1e72, 1e73, 1e74, 1e75, 1e76, 1e77, 1e78, 1e79, 1e80, 1e81, 1e82, 1e83, 1e84, 1e85, 1e86, 1e87, 1e88, 1e89, 1e90, 1e91, 1e92, 1e93, 1e94, 1e95, 1e96, 1e97, 1e98, 1e99, 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109, 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119, 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129, 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139, 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149, 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169, 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179, 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189, 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199, 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209, 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219, 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229, 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239, 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249, 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259, 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269, 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279, 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289, 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299, 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308 ],
|
714 | Double.NEGATIVE_POWERS = [ 1, .1, .01, .001, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9, 1e-10, 1e-11, 1e-12, 1e-13, 1e-14, 1e-15, 1e-16, 1e-17, 1e-18, 1e-19, 1e-20, 1e-21, 1e-22, 1e-23, 1e-24, 1e-25, 1e-26, 1e-27, 1e-28, 1e-29, 1e-30, 1e-31, 1e-32, 1e-33, 1e-34, 1e-35, 1e-36, 1e-37, 1e-38, 1e-39, 1e-40, 1e-41, 1e-42, 1e-43, 1e-44, 1e-45, 1e-46, 1e-47, 1e-48, 1e-49, 1e-50, 1e-51, 1e-52, 1e-53, 1e-54, 1e-55, 1e-56, 1e-57, 1e-58, 1e-59, 1e-60, 1e-61, 1e-62, 1e-63, 1e-64, 1e-65, 1e-66, 1e-67, 1e-68, 1e-69, 1e-70, 1e-71, 1e-72, 1e-73, 1e-74, 1e-75, 1e-76, 1e-77, 1e-78, 1e-79, 1e-80, 1e-81, 1e-82, 1e-83, 1e-84, 1e-85, 1e-86, 1e-87, 1e-88, 1e-89, 1e-90, 1e-91, 1e-92, 1e-93, 1e-94, 1e-95, 1e-96, 1e-97, 1e-98, 1e-99, 1e-100, 1e-101, 1e-102, 1e-103, 1e-104, 1e-105, 1e-106, 1e-107, 1e-108, 1e-109, 1e-110, 1e-111, 1e-112, 1e-113, 1e-114, 1e-115, 1e-116, 1e-117, 1e-118, 1e-119, 1e-120, 1e-121, 1e-122, 1e-123, 1e-124, 1e-125, 1e-126, 1e-127, 1e-128, 1e-129, 1e-130, 1e-131, 1e-132, 1e-133, 1e-134, 1e-135, 1e-136, 1e-137, 1e-138, 1e-139, 1e-140, 1e-141, 1e-142, 1e-143, 1e-144, 1e-145, 1e-146, 1e-147, 1e-148, 1e-149, 1e-150, 1e-151, 1e-152, 1e-153, 1e-154, 1e-155, 1e-156, 1e-157, 1e-158, 1e-159, 1e-160, 1e-161, 1e-162, 1e-163, 1e-164, 1e-165, 1e-166, 1e-167, 1e-168, 1e-169, 1e-170, 1e-171, 1e-172, 1e-173, 1e-174, 1e-175, 1e-176, 1e-177, 1e-178, 1e-179, 1e-180, 1e-181, 1e-182, 1e-183, 1e-184, 1e-185, 1e-186, 1e-187, 1e-188, 1e-189, 1e-190, 1e-191, 1e-192, 1e-193, 1e-194, 1e-195, 1e-196, 1e-197, 1e-198, 1e-199, 1e-200, 1e-201, 1e-202, 1e-203, 1e-204, 1e-205, 1e-206, 1e-207, 1e-208, 1e-209, 1e-210, 1e-211, 1e-212, 1e-213, 1e-214, 1e-215, 1e-216, 1e-217, 1e-218, 1e-219, 1e-220, 1e-221, 1e-222, 1e-223, 1e-224, 1e-225, 1e-226, 1e-227, 1e-228, 1e-229, 1e-230, 1e-231, 1e-232, 1e-233, 1e-234, 1e-235, 1e-236, 1e-237, 1e-238, 1e-239, 1e-240, 1e-241, 1e-242, 1e-243, 1e-244, 1e-245, 1e-246, 1e-247, 1e-248, 1e-249, 1e-250, 1e-251, 1e-252, 1e-253, 1e-254, 1e-255, 1e-256, 1e-257, 1e-258, 1e-259, 1e-260, 1e-261, 1e-262, 1e-263, 1e-264, 1e-265, 1e-266, 1e-267, 1e-268, 1e-269, 1e-270, 1e-271, 1e-272, 1e-273, 1e-274, 1e-275, 1e-276, 1e-277, 1e-278, 1e-279, 1e-280, 1e-281, 1e-282, 1e-283, 1e-284, 1e-285, 1e-286, 1e-287, 1e-288, 1e-289, 1e-290, 1e-291, 1e-292, 1e-293, 1e-294, 1e-295, 1e-296, 1e-297, 1e-298, 1e-299, 1e-300, 1e-301, 1e-302, 1e-303, 1e-304, 1e-305, 1e-306, 1e-307, 1e-308, 1e-309, 1e-310, 1e-311, 1e-312, 1e-313, 1e-314, 1e-315, 1e-316, 1e-317, 1e-318, 1e-319, 1e-320, 1e-321, 1e-322, 1e-323, 0 ],
|
715 | Double.pow10 = pow10, Double.log10 = log10, Double.getPrecision = getPrecision,
|
716 | Double.equalWithPrecision = equalWithPrecision, Double.lessWithPrecision = lessWithPrecision,
|
717 | Double.lessOrEqualWithPrecision = lessOrEqualWithPrecision, Double.greaterWithPrecision = greaterWithPrecision,
|
718 | Double.greaterOrEqualWithPrecision = greaterOrEqualWithPrecision, Double.floorWithPrecision = floorWithPrecision,
|
719 | Double.ceilWithPrecision = ceilWithPrecision, Double.floorToPrecision = floorToPrecision,
|
720 | Double.ceilToPrecision = ceilToPrecision, Double.roundToPrecision = roundToPrecision,
|
721 | Double.ensureInRange = ensureInRange, Double.round = round, Double.project = project,
|
722 | Double.removeDecimalNoise = removeDecimalNoise, Double.isInteger = isInteger, Double.toIncrement = toIncrement;
|
723 | }(Double = powerbi.Double || (powerbi.Double = {}));
|
724 | }(powerbi || (powerbi = {}));
|
725 |
|
726 | var jsCommon;
|
727 |
|
728 | !function(jsCommon) {
|
729 | var Color, Double = powerbi.Double;
|
730 | !function(Color) {
|
731 | function rotate(rgbString, rotateFactor) {
|
732 | if (0 === rotateFactor) return rgbString;
|
733 | var originalRgb = parseColorString(rgbString), originalHsv = rgbToHsv(originalRgb), rotatedHsv = rotateHsv(originalHsv, rotateFactor), rotatedRgb = hsvToRgb(rotatedHsv);
|
734 | return hexString(rotatedRgb);
|
735 | }
|
736 | function normalizeToHexString(color) {
|
737 | var rgb = parseColorString(color);
|
738 | return hexString(rgb);
|
739 | }
|
740 | function parseColorString(color) {
|
741 | if (color.indexOf("#") >= 0) {
|
742 | if (7 === color.length) {
|
743 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
|
744 | if (null == result || result.length < 4) return;
|
745 | return {
|
746 | R: parseInt(result[1], 16),
|
747 | G: parseInt(result[2], 16),
|
748 | B: parseInt(result[3], 16)
|
749 | };
|
750 | }
|
751 | if (4 === color.length) {
|
752 | var result = /^#?([a-f\d])([a-f\d])([a-f\d])$/i.exec(color);
|
753 | if (null == result || result.length < 4) return;
|
754 | return {
|
755 | R: parseInt(result[1] + result[1], 16),
|
756 | G: parseInt(result[2] + result[2], 16),
|
757 | B: parseInt(result[3] + result[3], 16)
|
758 | };
|
759 | }
|
760 | } else {
|
761 | if (color.indexOf("rgb(") >= 0) {
|
762 | var result = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(color);
|
763 | if (null == result || result.length < 4) return;
|
764 | return {
|
765 | R: parseInt(result[1], 10),
|
766 | G: parseInt(result[2], 10),
|
767 | B: parseInt(result[3], 10)
|
768 | };
|
769 | }
|
770 | if (color.indexOf("rgba(") >= 0) {
|
771 | var result = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*(?:\.\d+)?)\)$/.exec(color);
|
772 | if (null == result || result.length < 5) return;
|
773 | return {
|
774 | R: parseInt(result[1], 10),
|
775 | G: parseInt(result[2], 10),
|
776 | B: parseInt(result[3], 10),
|
777 | A: parseFloat(result[4])
|
778 | };
|
779 | }
|
780 | }
|
781 | }
|
782 | function rgbToHsv(rgbColor) {
|
783 | var s, h, r = rgbColor.R / 255, g = rgbColor.G / 255, b = rgbColor.B / 255, min = Math.min(r, Math.min(g, b)), max = Math.max(r, Math.max(g, b)), v = max, delta = max - min;
|
784 | return 0 === max || 0 === delta ? (s = 0, h = 0) : (s = delta / max, h = r === max ? (g - b) / delta : g === max ? 2 + (b - r) / delta : 4 + (r - g) / delta),
|
785 | h /= 6, 0 > h && (h += 1), {
|
786 | H: h,
|
787 | S: s,
|
788 | V: v
|
789 | };
|
790 | }
|
791 | function hsvToRgb(hsvColor) {
|
792 | var r, g, b, h = hsvColor.H, s = hsvColor.S, v = hsvColor.V;
|
793 | if (0 === s) r = v, g = v, b = v; else {
|
794 | var p = void 0, q = void 0, t = void 0, fractionalSector = void 0, sectorNumber = void 0, sectorPos = void 0;
|
795 | switch (sectorPos = 6 * h, sectorNumber = Math.floor(sectorPos), fractionalSector = sectorPos - sectorNumber,
|
796 | p = v * (1 - s), q = v * (1 - s * fractionalSector), t = v * (1 - s * (1 - fractionalSector)),
|
797 | sectorNumber) {
|
798 | case 0:
|
799 | r = v, g = t, b = p;
|
800 | break;
|
801 |
|
802 | case 1:
|
803 | r = q, g = v, b = p;
|
804 | break;
|
805 |
|
806 | case 2:
|
807 | r = p, g = v, b = t;
|
808 | break;
|
809 |
|
810 | case 3:
|
811 | r = p, g = q, b = v;
|
812 | break;
|
813 |
|
814 | case 4:
|
815 | r = t, g = p, b = v;
|
816 | break;
|
817 |
|
818 | case 5:
|
819 | r = v, g = p, b = q;
|
820 | }
|
821 | }
|
822 | return {
|
823 | R: Math.floor(255 * r),
|
824 | G: Math.floor(255 * g),
|
825 | B: Math.floor(255 * b)
|
826 | };
|
827 | }
|
828 | function rotateHsv(hsvColor, rotateFactor) {
|
829 | var newH = hsvColor.H + rotateFactor;
|
830 | return {
|
831 | H: newH > 1 ? newH - 1 : newH,
|
832 | S: hsvColor.S,
|
833 | V: hsvColor.V
|
834 | };
|
835 | }
|
836 | function darken(color, diff) {
|
837 | var flooredNumber = Math.floor(diff);
|
838 | return {
|
839 | R: Math.max(0, color.R - flooredNumber),
|
840 | G: Math.max(0, color.G - flooredNumber),
|
841 | B: Math.max(0, color.B - flooredNumber)
|
842 | };
|
843 | }
|
844 | function rgbString(color) {
|
845 | return null == color.A ? "rgb(" + color.R + "," + color.G + "," + color.B + ")" : "rgba(" + color.R + "," + color.G + "," + color.B + "," + color.A + ")";
|
846 | }
|
847 | function hexString(color) {
|
848 | return "#" + componentToHex(color.R) + componentToHex(color.G) + componentToHex(color.B);
|
849 | }
|
850 | function componentToHex(hexComponent) {
|
851 | var clamped = Double.ensureInRange(hexComponent, 0, 255), hex = clamped.toString(16).toUpperCase();
|
852 | return 1 === hex.length ? "0" + hex : hex;
|
853 | }
|
854 | Color.rotate = rotate, Color.normalizeToHexString = normalizeToHexString, Color.parseColorString = parseColorString,
|
855 | Color.darken = darken, Color.rgbString = rgbString, Color.hexString = hexString;
|
856 | }(Color = jsCommon.Color || (jsCommon.Color = {}));
|
857 | }(jsCommon || (jsCommon = {}));
|
858 |
|
859 | var jsCommon;
|
860 |
|
861 | !function(jsCommon) {
|
862 | var CssConstants;
|
863 | !function(CssConstants) {
|
864 | function createClassAndSelector(className) {
|
865 | return {
|
866 | "class": className,
|
867 | selector: "." + className
|
868 | };
|
869 | }
|
870 | CssConstants.createClassAndSelector = createClassAndSelector, CssConstants.styleAttribute = "style",
|
871 | CssConstants.pixelUnits = "px", CssConstants.heightProperty = "height", CssConstants.widthProperty = "width",
|
872 | CssConstants.topProperty = "top", CssConstants.bottomProperty = "bottom", CssConstants.leftProperty = "left",
|
873 | CssConstants.rightProperty = "right", CssConstants.marginTopProperty = "margin-top",
|
874 | CssConstants.marginLeftProperty = "margin-left", CssConstants.displayProperty = "display",
|
875 | CssConstants.backgroundProperty = "background", CssConstants.backgroundColorProperty = "background-color",
|
876 | CssConstants.backgroundRepeatProperty = "background-repeat", CssConstants.backgroundSizeProperty = "background-size",
|
877 | CssConstants.backgroundImageProperty = "background-image", CssConstants.textShadowProperty = "text-shadow",
|
878 | CssConstants.textAlignProperty = "text-align", CssConstants.borderTopWidthProperty = "border-top-width",
|
879 | CssConstants.borderBottomWidthProperty = "border-bottom-width", CssConstants.borderLeftWidthProperty = "border-left-width",
|
880 | CssConstants.borderRightWidthProperty = "border-right-width", CssConstants.fontSizeProperty = "font-size",
|
881 | CssConstants.fontWeightProperty = "font-weight", CssConstants.colorProperty = "color",
|
882 | CssConstants.opacityProperty = "opacity", CssConstants.paddingLeftProperty = "padding-left",
|
883 | CssConstants.paddingRightProperty = "padding-right", CssConstants.positionProperty = "position",
|
884 | CssConstants.maxWidthProperty = "max-width", CssConstants.minWidthProperty = "min-width",
|
885 | CssConstants.overflowProperty = "overflow", CssConstants.overflowXProperty = "overflow-x",
|
886 | CssConstants.overflowYProperty = "overflow-y", CssConstants.transformProperty = "transform",
|
887 | CssConstants.webkitTransformProperty = "-webkit-transform", CssConstants.cursorProperty = "cursor",
|
888 | CssConstants.visibilityProperty = "visibility", CssConstants.absoluteValue = "absolute",
|
889 | CssConstants.zeroPixelValue = "0px", CssConstants.autoValue = "auto", CssConstants.hiddenValue = "hidden",
|
890 | CssConstants.noneValue = "none", CssConstants.blockValue = "block", CssConstants.inlineBlockValue = "inline-block",
|
891 | CssConstants.transparentValue = "transparent", CssConstants.boldValue = "bold",
|
892 | CssConstants.visibleValue = "visible", CssConstants.tableRowValue = "table-row",
|
893 | CssConstants.coverValue = "cover", CssConstants.pointerValue = "pointer", CssConstants.scrollValue = "scroll";
|
894 | }(CssConstants = jsCommon.CssConstants || (jsCommon.CssConstants = {}));
|
895 | }(jsCommon || (jsCommon = {}));
|
896 |
|
897 | var debug;
|
898 |
|
899 | !function(debug) {
|
900 | function assert(condition, message) {
|
901 | condition !== !0 && assertFail(message || "condition: " + condition);
|
902 | }
|
903 | function assertValue(value, message) {
|
904 | null !== value && void 0 !== value || assertFail(message || "condition: " + value);
|
905 | }
|
906 | function assertNonEmpty(value, message) {
|
907 | null != value && value.length > 0 || assertFail(message || "condition: " + value);
|
908 | }
|
909 | function assertAnyValue(value, message) {}
|
910 | function assertFail(message) {
|
911 | (debug.assertFailFunction || alert)("Debug Assert failed: " + message);
|
912 | }
|
913 | debug.assert = assert, debug.assertValue = assertValue, debug.assertNonEmpty = assertNonEmpty,
|
914 | debug.assertAnyValue = assertAnyValue, debug.assertFail = assertFail;
|
915 | }(debug || (debug = {}));
|
916 |
|
917 | var jsCommon;
|
918 |
|
919 | !function(jsCommon) {
|
920 | function getStackTrace(leadingFramesToRemove) {
|
921 | void 0 === leadingFramesToRemove && (leadingFramesToRemove = 1);
|
922 | var stackTrace, stackSegments;
|
923 | try {
|
924 | throw new Error();
|
925 | } catch (error) {
|
926 | stackTrace = error.stack, null != stackTrace && (stackSegments = stackTrace.split("\n"),
|
927 | stackSegments.splice(1, leadingFramesToRemove), stackTrace = stackSegments.join("\n"));
|
928 | }
|
929 | return stackTrace;
|
930 | }
|
931 | var Errors;
|
932 | !function(Errors) {
|
933 | function infoNavAppAlreadyPresent() {
|
934 | return {
|
935 | name: "infoNavAppAlreadyPresent",
|
936 | message: "Cannot initialize embedded scenario when the InfoNav App is already present in this context",
|
937 | stack: getExceptionStackTrace()
|
938 | };
|
939 | }
|
940 | function invalidOperation(message) {
|
941 | return {
|
942 | name: "invalidOperation",
|
943 | message: message,
|
944 | stack: getExceptionStackTrace()
|
945 | };
|
946 | }
|
947 | function argument(argumentName, message) {
|
948 | return {
|
949 | name: "invalidArgumentError",
|
950 | argument: argumentName,
|
951 | message: message,
|
952 | stack: getExceptionStackTrace()
|
953 | };
|
954 | }
|
955 | function argumentNull(argumentName) {
|
956 | return {
|
957 | name: "argumentNull",
|
958 | argument: argumentName,
|
959 | message: "Argument was null",
|
960 | stack: getExceptionStackTrace()
|
961 | };
|
962 | }
|
963 | function argumentUndefined(argumentName) {
|
964 | return {
|
965 | name: "argumentUndefined",
|
966 | argument: argumentName,
|
967 | message: "Argument was undefined",
|
968 | stack: getExceptionStackTrace()
|
969 | };
|
970 | }
|
971 | function argumentOutOfRange(argumentName) {
|
972 | return {
|
973 | name: "argumentOutOfRange",
|
974 | argument: argumentName,
|
975 | message: "Argument was out of range",
|
976 | stack: getExceptionStackTrace()
|
977 | };
|
978 | }
|
979 | function pureVirtualMethodException(className, methodName) {
|
980 | return {
|
981 | name: "pureVirtualMethodException",
|
982 | message: "This method must be overriden by the derived class:" + className + "." + methodName,
|
983 | stack: getExceptionStackTrace()
|
984 | };
|
985 | }
|
986 | function notImplementedException(message) {
|
987 | return {
|
988 | name: "notImplementedException",
|
989 | message: message,
|
990 | stack: getExceptionStackTrace()
|
991 | };
|
992 | }
|
993 | function getExceptionStackTrace() {
|
994 | return getStackTrace(2);
|
995 | }
|
996 | Errors.infoNavAppAlreadyPresent = infoNavAppAlreadyPresent, Errors.invalidOperation = invalidOperation,
|
997 | Errors.argument = argument, Errors.argumentNull = argumentNull, Errors.argumentUndefined = argumentUndefined,
|
998 | Errors.argumentOutOfRange = argumentOutOfRange, Errors.pureVirtualMethodException = pureVirtualMethodException,
|
999 | Errors.notImplementedException = notImplementedException;
|
1000 | }(Errors = jsCommon.Errors || (jsCommon.Errors = {})), jsCommon.getStackTrace = getStackTrace;
|
1001 | }(jsCommon || (jsCommon = {})), $.fn.multiline = function(text) {
|
1002 | return this.text(text), this.html(this.html().replace(/\n/g, "<br/>")), this;
|
1003 | }, $.fn.togglePanelControl = function() {
|
1004 | return this.each(function() {
|
1005 | $(this).addClass("ui-accordion ui-accordion-icons ui-widget ui-helper-reset").find(".accordionHeader").addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-top ui-corner-bottom").hover(function() {
|
1006 | $(this).toggleClass("ui-state-hover");
|
1007 | }).prepend('<span class="ui-icon ui-icon-triangle-1-e"></span>').click(function() {
|
1008 | return $(this).toggleClass("ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom").find("> .ui-icon").toggleClass("ui-icon-triangle-1-e ui-icon-triangle-1-s").end().next().slideToggle(),
|
1009 | !1;
|
1010 | }).next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide();
|
1011 | });
|
1012 | };
|
1013 |
|
1014 | var jsCommon;
|
1015 |
|
1016 | !function(jsCommon) {
|
1017 | var JQueryConstants;
|
1018 | !function(JQueryConstants) {
|
1019 | JQueryConstants.VisibleSelector = ":visible";
|
1020 | }(JQueryConstants = jsCommon.JQueryConstants || (jsCommon.JQueryConstants = {}));
|
1021 | }(jsCommon || (jsCommon = {}));
|
1022 |
|
1023 | var jsCommon;
|
1024 |
|
1025 | !function(jsCommon) {
|
1026 | var Lazy = function() {
|
1027 | function Lazy(factoryMethod) {
|
1028 | jsCommon.Utility.throwIfNullOrUndefined(factoryMethod, this, "constructor", "factoryMethod"),
|
1029 | this.factoryMethod = factoryMethod;
|
1030 | }
|
1031 | return Lazy.prototype.getValue = function() {
|
1032 | return null !== this.factoryMethod && (this.value = this.factoryMethod(), this.factoryMethod = null),
|
1033 | this.value;
|
1034 | }, Lazy;
|
1035 | }();
|
1036 | jsCommon.Lazy = Lazy;
|
1037 | }(jsCommon || (jsCommon = {}));
|
1038 |
|
1039 | var powerbi;
|
1040 |
|
1041 | !function(powerbi) {
|
1042 | var Prototype;
|
1043 | !function(Prototype) {
|
1044 | function inherit(obj, extension) {
|
1045 | function wrapCtor() {}
|
1046 | wrapCtor.prototype = obj;
|
1047 | var inherited = new wrapCtor();
|
1048 | return extension && extension(inherited), inherited;
|
1049 | }
|
1050 | function inheritSingle(obj) {
|
1051 | var proto = Object.getPrototypeOf(obj);
|
1052 | return proto !== Object.prototype && proto !== Array.prototype || (obj = inherit(obj)),
|
1053 | obj;
|
1054 | }
|
1055 | function overrideArray(prototype, override) {
|
1056 | if (prototype) {
|
1057 | for (var overwritten, i = 0, len = prototype.length; len > i; i++) {
|
1058 | var value = override(prototype[i]);
|
1059 | value && (overwritten || (overwritten = inherit(prototype)), overwritten[i] = value);
|
1060 | }
|
1061 | return overwritten;
|
1062 | }
|
1063 | }
|
1064 | Prototype.inherit = inherit, Prototype.inheritSingle = inheritSingle, Prototype.overrideArray = overrideArray;
|
1065 | }(Prototype = powerbi.Prototype || (powerbi.Prototype = {}));
|
1066 | }(powerbi || (powerbi = {}));
|
1067 |
|
1068 | var jsCommon;
|
1069 |
|
1070 | !function(jsCommon) {
|
1071 | var Formatting;
|
1072 | !function(Formatting) {
|
1073 | function findDateFormat(value, format, cultureName) {
|
1074 | switch (format) {
|
1075 | case "m":
|
1076 | format = "M";
|
1077 | break;
|
1078 |
|
1079 | case "O":
|
1080 | case "o":
|
1081 | format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'0000'";
|
1082 | break;
|
1083 |
|
1084 | case "R":
|
1085 | case "r":
|
1086 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds()),
|
1087 | format = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
|
1088 | break;
|
1089 |
|
1090 | case "s":
|
1091 | format = "S";
|
1092 | break;
|
1093 |
|
1094 | case "u":
|
1095 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds()),
|
1096 | format = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
|
1097 | break;
|
1098 |
|
1099 | case "U":
|
1100 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds()),
|
1101 | format = "F";
|
1102 | break;
|
1103 |
|
1104 | case "y":
|
1105 | case "Y":
|
1106 | switch (cultureName) {
|
1107 | case "default":
|
1108 | case "en":
|
1109 | case "en-US":
|
1110 | format = "MMMM, yyyy";
|
1111 | break;
|
1112 |
|
1113 | default:
|
1114 | format = "Y";
|
1115 | }
|
1116 | }
|
1117 | return {
|
1118 | value: value,
|
1119 | format: format
|
1120 | };
|
1121 | }
|
1122 | function fixDateTimeFormat(format) {
|
1123 | if (format = format.replace(/%K/g, "zzz"), format = format.replace(/K/g, "zzz"),
|
1124 | format = format.replace(/fffffff/g, "fff0000"), format = format.replace(/ffffff/g, "fff000"),
|
1125 | format = format.replace(/fffff/g, "fff00"), format = format.replace(/ffff/g, "fff0"),
|
1126 | format = format.replace(/yyyyy/g, "0yyyy"), format = format.replace(/(^y|^)yyy(^y|$)/g, "yyyy"),
|
1127 | regexCache || (regexCache = [ "d", "f", "F", "g", "h", "H", "K", "m", "M", "s", "t", "y", "z", ":", "/" ].map(function(s) {
|
1128 | return {
|
1129 | r: new RegExp("%" + s + "(?!" + s + ")", "g"),
|
1130 | s: s
|
1131 | };
|
1132 | })), -1 !== format.indexOf("%") && format.length > 2) for (var i = 0; i < regexCache.length; i++) format = format.replace(regexCache[i].r, regexCache[i].s);
|
1133 | return format;
|
1134 | }
|
1135 | var regexCache;
|
1136 | Formatting.findDateFormat = findDateFormat, Formatting.fixDateTimeFormat = fixDateTimeFormat;
|
1137 | }(Formatting = jsCommon.Formatting || (jsCommon.Formatting = {}));
|
1138 | }(jsCommon || (jsCommon = {}));
|
1139 |
|
1140 | var jsCommon;
|
1141 |
|
1142 | !function(jsCommon) {
|
1143 | function requires(dependency, to) {
|
1144 | void 0 === to && (to = $.noop), loadStyleSheets(dependency.cssFiles || []);
|
1145 | var scriptsToRun = dependency.javaScriptFilesWithCallback || [];
|
1146 | if (dependency.javaScriptFiles) for (var i = 0, len = dependency.javaScriptFiles.length; len > i; ++i) scriptsToRun.push({
|
1147 | javascriptFile: dependency.javaScriptFiles[i]
|
1148 | });
|
1149 | loadJavaScriptFiles(scriptsToRun, to);
|
1150 | }
|
1151 | function loadStyleSheets(hrefList) {
|
1152 | hrefList.forEach(function(href) {
|
1153 | -1 === styleSheetLoaded.indexOf(href) && (styleSheetLoaded.push(href), loadStyleSheet(href));
|
1154 | });
|
1155 | }
|
1156 | function loadJavaScriptFiles(scripts, callback) {
|
1157 | function parseIfLoadingComplete() {
|
1158 | --loadingCount || parseJavaScriptSourceCodes(scripts, sourceCodeList);
|
1159 | }
|
1160 | function makeCallbackIfParsingComplete() {
|
1161 | --parsingCount || callback();
|
1162 | }
|
1163 | var loadingCount = scripts.length, parsingCount = loadingCount, sourceCodeList = [];
|
1164 | scripts.forEach(function(script, index) {
|
1165 | var file = script.javascriptFile;
|
1166 | -1 === javaScriptFilesLoaded.indexOf(file) ? file in javaScriptFilesLoading ? javaScriptFilesLoading[file].push(function() {
|
1167 | parseIfLoadingComplete(), makeCallbackIfParsingComplete();
|
1168 | }) : (javaScriptFilesLoading[file] = [ function() {
|
1169 | makeCallbackIfParsingComplete();
|
1170 | } ], isExternalUrl(file) ? (sourceCodeList[index] = script, parseIfLoadingComplete()) : loadJavaScriptSourceCode(file, function(sourceCode) {
|
1171 | sourceCodeList[index] = {
|
1172 | javascriptFile: sourceCode
|
1173 | }, parseIfLoadingComplete();
|
1174 | })) : (parseIfLoadingComplete(), makeCallbackIfParsingComplete());
|
1175 | });
|
1176 | }
|
1177 | function loadStyleSheet(href) {
|
1178 | var link = linkElement.cloneNode();
|
1179 | link.href = href, firstScriptInHeadElement ? headElement.insertBefore(link, firstScriptInHeadElement) : headElement.appendChild(link);
|
1180 | }
|
1181 | function loadJavaScriptSourceCode(src, onload) {
|
1182 | webGet(src, function() {
|
1183 | onload(this.responseText);
|
1184 | });
|
1185 | }
|
1186 | function parseJavaScript(script, onComplete) {
|
1187 | if (void 0 === onComplete && (onComplete = $.noop), !script) return void onComplete();
|
1188 | var sourceCodeOrFileName = script.javascriptFile, targetCallback = onComplete;
|
1189 | if (script.onLoadCallback) {
|
1190 | var promiseAsCallback = function() {
|
1191 | script.onLoadCallback().then(onComplete);
|
1192 | };
|
1193 | targetCallback = promiseAsCallback;
|
1194 | }
|
1195 | isExternalUrl(sourceCodeOrFileName) ? loadExternalJavaScriptFile(sourceCodeOrFileName, targetCallback) : parseInternalJavaScriptCode(sourceCodeOrFileName, targetCallback);
|
1196 | }
|
1197 | function parseInternalJavaScriptCode(sourceCode, onComplete) {
|
1198 | void 0 === onComplete && (onComplete = $.noop);
|
1199 | var script;
|
1200 | sourceCode && (script = scriptElement.cloneNode(), script.setAttribute("type", "text/javascript"),
|
1201 | script.innerHTML = sourceCode, headElement.appendChild(script)), setTimeout(onComplete, 0);
|
1202 | }
|
1203 | function loadExternalJavaScriptFile(src, onload) {
|
1204 | var script;
|
1205 | src && (script = scriptElement.cloneNode(), script.setAttribute("src", src), script.setAttribute("charset", "utf-8"),
|
1206 | script.onload = onload, headElement.appendChild(script));
|
1207 | }
|
1208 | function parseJavaScriptSourceCodes(scripts, sourceCodeList) {
|
1209 | asyncLoop(sourceCodeList, parseJavaScript, function() {
|
1210 | scripts.forEach(function(script) {
|
1211 | var file = script.javascriptFile, listeners = javaScriptFilesLoading[file];
|
1212 | listeners && listeners.forEach(function(listener) {
|
1213 | listener();
|
1214 | }), delete javaScriptFilesLoading[file], -1 === javaScriptFilesLoaded.indexOf(file) && javaScriptFilesLoaded.push(file);
|
1215 | });
|
1216 | });
|
1217 | }
|
1218 | function webGet(src, onload, onerror) {
|
1219 | var xhr = new XMLHttpRequest();
|
1220 | try {
|
1221 | xhr.open("GET", src, !0), xhr.onload = onload, xhr.onerror = onerror, xhr.send(null);
|
1222 | } catch (e) {}
|
1223 | }
|
1224 | function isExternalUrl(url) {
|
1225 | var origin = location.protocol + "//" + location.host + "/";
|
1226 | return /^http[s]?:\/\/.+/i.test(url) && 0 !== url.indexOf(origin);
|
1227 | }
|
1228 | function _() {
|
1229 | for (var args = [], _i = 0; _i < arguments.length; _i++) args[_i - 0] = arguments[_i];
|
1230 | }
|
1231 | function asyncSteps() {
|
1232 | for (var args = [], _i = 0; _i < arguments.length; _i++) args[_i - 0] = arguments[_i];
|
1233 | if (0 !== args.length) {
|
1234 | for (var steps = [], i = args.length; i--; ) !function(j) {
|
1235 | steps[j] = function() {
|
1236 | args[j](steps[j + 1] || _);
|
1237 | };
|
1238 | }(i);
|
1239 | steps[0]();
|
1240 | }
|
1241 | }
|
1242 | function asyncLoop(enumerable, func, callback) {
|
1243 | for (var steps = [], i = 0, len = enumerable.length; len - 1 > i; i++) !function(i) {
|
1244 | steps[i] = function(next) {
|
1245 | func(enumerable[i], next);
|
1246 | };
|
1247 | }(i);
|
1248 | steps[len - 1] = function(next) {
|
1249 | func(enumerable[len - 1], callback);
|
1250 | }, asyncSteps.apply(null, steps);
|
1251 | }
|
1252 | var doc = document, headElement = doc.head, firstScriptInHeadElement = headElement.getElementsByTagName("script")[0], linkElement = doc.createElement("link"), scriptElement = doc.createElement("script"), styleSheetLoaded = [], javaScriptFilesLoaded = [], javaScriptFilesLoading = [];
|
1253 | linkElement.setAttribute("rel", "stylesheet"), jsCommon.requires = requires;
|
1254 | }(jsCommon || (jsCommon = {}));
|
1255 |
|
1256 | var powerbi;
|
1257 |
|
1258 | !function(powerbi) {
|
1259 | function createJQueryPromiseFactory() {
|
1260 | return new JQueryPromiseFactory();
|
1261 | }
|
1262 | powerbi.createJQueryPromiseFactory = createJQueryPromiseFactory;
|
1263 | var JQueryPromiseFactory = function() {
|
1264 | function JQueryPromiseFactory() {}
|
1265 | return JQueryPromiseFactory.prototype.defer = function() {
|
1266 | return new JQueryDeferredWrapper($.Deferred());
|
1267 | }, JQueryPromiseFactory.prototype.reject = function(reason) {
|
1268 | var deferred = this.defer();
|
1269 | return deferred.reject(reason), deferred.promise;
|
1270 | }, JQueryPromiseFactory.prototype.resolve = function(value) {
|
1271 | var deferred = this.defer();
|
1272 | return deferred.resolve(value), deferred.promise;
|
1273 | }, JQueryPromiseFactory.prototype.all = function(promises) {
|
1274 | var unwrappedPromises = jQuery.map(promises, function(value) {
|
1275 | return value && value.promise ? value.promise : value;
|
1276 | });
|
1277 | return new JQueryPromiseWrapper($.when.apply($, unwrappedPromises));
|
1278 | }, JQueryPromiseFactory.prototype.when = function(value) {
|
1279 | var unwrappedPromise = value && value.promise ? value.promise : value;
|
1280 | return new JQueryPromiseWrapper($.when(unwrappedPromise));
|
1281 | }, JQueryPromiseFactory;
|
1282 | }(), JQueryDeferredWrapper = function() {
|
1283 | function JQueryDeferredWrapper(deferred) {
|
1284 | this.deferred = deferred, this.promise = new JQueryPromiseWrapper(deferred.promise());
|
1285 | }
|
1286 | return JQueryDeferredWrapper.prototype.resolve = function(value) {
|
1287 | this.deferred.resolve(value);
|
1288 | }, JQueryDeferredWrapper.prototype.reject = function(reason) {
|
1289 | this.deferred.reject(reason);
|
1290 | }, JQueryDeferredWrapper;
|
1291 | }(), JQueryPromiseWrapper = function() {
|
1292 | function JQueryPromiseWrapper(promise) {
|
1293 | this.promise = promise;
|
1294 | }
|
1295 | return JQueryPromiseWrapper.prototype.then = function(a, b) {
|
1296 | return new JQueryPromiseWrapper(this.promise.then(JQueryPromiseWrapper.wrapCallback(a), JQueryPromiseWrapper.wrapCallback(b)));
|
1297 | }, JQueryPromiseWrapper.prototype["catch"] = function(callback) {
|
1298 | return this.then(null, callback);
|
1299 | }, JQueryPromiseWrapper.prototype["finally"] = function(callback) {
|
1300 | return this.promise.always(JQueryPromiseWrapper.wrapCallback(callback)), this;
|
1301 | }, JQueryPromiseWrapper.wrapCallback = function(callback) {
|
1302 | return callback ? function(arg) {
|
1303 | var value = callback(arg);
|
1304 | return value instanceof JQueryPromiseWrapper ? value.promise : value;
|
1305 | } : callback;
|
1306 | }, JQueryPromiseWrapper;
|
1307 | }();
|
1308 | }(powerbi || (powerbi = {}));
|
1309 |
|
1310 | var powerbi;
|
1311 |
|
1312 | !function(powerbi) {
|
1313 | var LocalStorageService = function() {
|
1314 | function LocalStorageService() {}
|
1315 | return LocalStorageService.prototype.getData = function(key) {
|
1316 | try {
|
1317 | if (localStorage) {
|
1318 | var value = localStorage[key];
|
1319 | if (value) return JSON.parse(value);
|
1320 | }
|
1321 | } catch (exception) {}
|
1322 | return null;
|
1323 | }, LocalStorageService.prototype.setData = function(key, data) {
|
1324 | try {
|
1325 | localStorage && (localStorage[key] = JSON.stringify(data));
|
1326 | } catch (e) {}
|
1327 | }, LocalStorageService;
|
1328 | }(), EphemeralStorageService = function() {
|
1329 | function EphemeralStorageService(clearCacheInterval) {
|
1330 | this.cache = {}, this.clearCacheInterval = null != clearCacheInterval ? clearCacheInterval : EphemeralStorageService.defaultClearCacheInterval,
|
1331 | this.clearCache();
|
1332 | }
|
1333 | return EphemeralStorageService.prototype.getData = function(key) {
|
1334 | return this.cache[key];
|
1335 | }, EphemeralStorageService.prototype.setData = function(key, data) {
|
1336 | var _this = this;
|
1337 | this.cache[key] = data, null == this.clearCacheTimerId && (this.clearCacheTimerId = setTimeout(function() {
|
1338 | return _this.clearCache();
|
1339 | }, this.clearCacheInterval));
|
1340 | }, EphemeralStorageService.prototype.clearCache = function() {
|
1341 | this.cache = {}, this.clearCacheTimerId = void 0;
|
1342 | }, EphemeralStorageService.defaultClearCacheInterval = 864e5, EphemeralStorageService;
|
1343 | }();
|
1344 | powerbi.EphemeralStorageService = EphemeralStorageService, powerbi.localStorageService = new LocalStorageService(),
|
1345 | powerbi.ephemeralStorageService = new EphemeralStorageService();
|
1346 | }(powerbi || (powerbi = {}));
|
1347 |
|
1348 | var jsCommon;
|
1349 |
|
1350 | !function(jsCommon) {
|
1351 | var WordBreaker;
|
1352 | !function(WordBreaker) {
|
1353 | function search(index, content, backward) {
|
1354 | if (backward) {
|
1355 | for (var i = index - 1; i > -1; i--) if (hasBreakers(content[i])) return i + 1;
|
1356 | } else for (var i = index, ilen = content.length; ilen > i; i++) if (hasBreakers(content[i])) return i;
|
1357 | return backward ? 0 : content.length;
|
1358 | }
|
1359 | function find(index, content) {
|
1360 | var result = {
|
1361 | start: 0,
|
1362 | end: 0
|
1363 | };
|
1364 | return 0 === content.length ? result : (result.start = search(index, content, !0),
|
1365 | result.end = search(index, content, !1), result);
|
1366 | }
|
1367 | function hasBreakers(content) {
|
1368 | return BREAKERS_REGEX.lastIndex = 0, BREAKERS_REGEX.test(content);
|
1369 | }
|
1370 | function wordCount(content) {
|
1371 | var count = 1;
|
1372 | for (BREAKERS_REGEX.lastIndex = 0, BREAKERS_REGEX.exec(content); 0 !== BREAKERS_REGEX.lastIndex; ) count++,
|
1373 | BREAKERS_REGEX.exec(content);
|
1374 | return count;
|
1375 | }
|
1376 | function getMaxWordWidth(content, textWidthMeasurer, properties) {
|
1377 | for (var words = split(content), maxWidth = 0, _i = 0, words_1 = words; _i < words_1.length; _i++) {
|
1378 | var w = words_1[_i];
|
1379 | properties.text = w, maxWidth = Math.max(maxWidth, textWidthMeasurer(properties));
|
1380 | }
|
1381 | return maxWidth;
|
1382 | }
|
1383 | function split(content) {
|
1384 | return content.split(BREAKERS_REGEX);
|
1385 | }
|
1386 | function getWidth(content, properties, textWidthMeasurer) {
|
1387 | return properties.text = content, textWidthMeasurer(properties);
|
1388 | }
|
1389 | function truncate(content, properties, truncator, maxWidth) {
|
1390 | return properties.text = content, truncator(properties, maxWidth);
|
1391 | }
|
1392 | function splitByWidth(content, properties, textWidthMeasurer, maxWidth, maxNumLines, truncator) {
|
1393 | truncator = truncator ? truncator : function(properties, maxWidth) {
|
1394 | return properties.text;
|
1395 | };
|
1396 | for (var result = [], words = split(content), usedWidth = 0, wordsInLine = [], _i = 0, words_2 = words; _i < words_2.length; _i++) {
|
1397 | var word = words_2[_i];
|
1398 | if (maxNumLines > 0 && result.length >= maxNumLines - 1) wordsInLine.push(word); else {
|
1399 | var wordWidth = 0 === wordsInLine.length ? getWidth(word, properties, textWidthMeasurer) : getWidth(SPACE + word, properties, textWidthMeasurer);
|
1400 | if (usedWidth + wordWidth > maxWidth) {
|
1401 | if (0 === wordsInLine.length) {
|
1402 | result.push(truncate(word, properties, truncator, maxWidth)), usedWidth = 0, wordsInLine = [];
|
1403 | continue;
|
1404 | }
|
1405 | result.push(truncate(wordsInLine.join(SPACE), properties, truncator, maxWidth)),
|
1406 | usedWidth = 0, wordsInLine = [];
|
1407 | }
|
1408 | wordsInLine.push(word), usedWidth += wordWidth;
|
1409 | }
|
1410 | }
|
1411 | return result.push(truncate(wordsInLine.join(SPACE), properties, truncator, maxWidth)),
|
1412 | result;
|
1413 | }
|
1414 | var SPACE = " ", BREAKERS_REGEX = /[\s\n]+/g;
|
1415 | WordBreaker.find = find, WordBreaker.hasBreakers = hasBreakers, WordBreaker.wordCount = wordCount,
|
1416 | WordBreaker.getMaxWordWidth = getMaxWordWidth, WordBreaker.splitByWidth = splitByWidth;
|
1417 | }(WordBreaker = jsCommon.WordBreaker || (jsCommon.WordBreaker = {}));
|
1418 | }(jsCommon || (jsCommon = {}));
|
1419 |
|
1420 | var powerbi;
|
1421 |
|
1422 | !function(powerbi) {
|
1423 | var TextMeasurementService;
|
1424 | !function(TextMeasurementService) {
|
1425 | function ensureDOM() {
|
1426 | spanElement || (spanElement = $("<span/>"), $("body").append(spanElement), svgTextElement = d3.select($("body").get(0)).append("svg").style({
|
1427 | height: "0px",
|
1428 | width: "0px",
|
1429 | position: "absolute"
|
1430 | }).append("text"), canvasCtx = $("<canvas/>").get(0).getContext("2d"), fallbackFontFamily = window.getComputedStyle(svgTextElement.node()).fontFamily);
|
1431 | }
|
1432 | function removeSpanElement() {
|
1433 | spanElement && spanElement.remove && spanElement.remove(), spanElement = null;
|
1434 | }
|
1435 | function measureSvgTextWidth(textProperties) {
|
1436 | return ensureDOM(), canvasCtx.font = (textProperties.fontStyle || "") + " " + (textProperties.fontVariant || "") + " " + (textProperties.fontWeight || "") + " " + textProperties.fontSize + " " + (textProperties.fontFamily || fallbackFontFamily),
|
1437 | canvasCtx.measureText(textProperties.text).width;
|
1438 | }
|
1439 | function measureSvgTextRect(textProperties) {
|
1440 | return ensureDOM(), svgTextElement.style(null), svgTextElement.text(textProperties.text).attr({
|
1441 | visibility: "hidden",
|
1442 | "font-family": textProperties.fontFamily || fallbackFontFamily,
|
1443 | "font-variant": textProperties.fontVariant,
|
1444 | "font-size": textProperties.fontSize,
|
1445 | "font-weight": textProperties.fontWeight,
|
1446 | "font-style": textProperties.fontStyle,
|
1447 | "white-space": textProperties.whiteSpace || "nowrap"
|
1448 | }), svgTextElement.node().getBBox();
|
1449 | }
|
1450 | function measureSvgTextHeight(textProperties) {
|
1451 | return measureSvgTextRect(textProperties).height;
|
1452 | }
|
1453 | function estimateSvgTextRect(textProperties) {
|
1454 | var propertiesKey = textProperties.fontFamily + textProperties.fontSize, rect = powerbi.ephemeralStorageService.getData(propertiesKey);
|
1455 | if (null == rect) {
|
1456 | var estimatedTextProperties = {
|
1457 | fontFamily: textProperties.fontFamily,
|
1458 | fontSize: textProperties.fontSize,
|
1459 | text: "M"
|
1460 | };
|
1461 | rect = TextMeasurementService.measureSvgTextRect(estimatedTextProperties), rect.height > 0 && powerbi.ephemeralStorageService.setData(propertiesKey, rect);
|
1462 | }
|
1463 | return rect;
|
1464 | }
|
1465 | function estimateSvgTextBaselineDelta(textProperties) {
|
1466 | var rect = estimateSvgTextRect(textProperties);
|
1467 | return rect.y + rect.height;
|
1468 | }
|
1469 | function estimateSvgTextHeight(textProperties, tightFightForNumeric) {
|
1470 | void 0 === tightFightForNumeric && (tightFightForNumeric = !1);
|
1471 | var height = estimateSvgTextRect(textProperties).height;
|
1472 | return tightFightForNumeric && (height *= .7), height;
|
1473 | }
|
1474 | function measureSvgTextElementWidth(svgElement) {
|
1475 | return measureSvgTextWidth(getSvgMeasurementProperties(svgElement));
|
1476 | }
|
1477 | function getMeasurementProperties(element) {
|
1478 | return {
|
1479 | text: element.val() || element.text(),
|
1480 | fontFamily: element.css("font-family"),
|
1481 | fontSize: element.css("font-size"),
|
1482 | fontWeight: element.css("font-weight"),
|
1483 | fontStyle: element.css("font-style"),
|
1484 | fontVariant: element.css("font-variant"),
|
1485 | whiteSpace: element.css("white-space")
|
1486 | };
|
1487 | }
|
1488 | function getSvgMeasurementProperties(svgElement) {
|
1489 | var style = window.getComputedStyle(svgElement, null);
|
1490 | return {
|
1491 | text: svgElement.textContent,
|
1492 | fontFamily: style.fontFamily,
|
1493 | fontSize: style.fontSize,
|
1494 | fontWeight: style.fontWeight,
|
1495 | fontStyle: style.fontStyle,
|
1496 | fontVariant: style.fontVariant,
|
1497 | whiteSpace: style.whiteSpace
|
1498 | };
|
1499 | }
|
1500 | function getDivElementWidth(element) {
|
1501 | return getComputedStyle(element[0]).width;
|
1502 | }
|
1503 | function getTailoredTextOrDefault(textProperties, maxWidth) {
|
1504 | ensureDOM();
|
1505 | var strLength = textProperties.text.length;
|
1506 | if (0 === strLength) return textProperties.text;
|
1507 | var width = measureSvgTextWidth(textProperties);
|
1508 | if (maxWidth > width) return textProperties.text;
|
1509 | for (var copiedTextProperties = powerbi.Prototype.inherit(textProperties), text = copiedTextProperties.text = ellipsis + copiedTextProperties.text, min = 1, max = text.length, i = ellipsis.length; max >= min; ) if (i = (min + max) / 2 | 0,
|
1510 | copiedTextProperties.text = text.substr(0, i), width = measureSvgTextWidth(copiedTextProperties),
|
1511 | maxWidth > width) min = i + 1; else {
|
1512 | if (!(width > maxWidth)) break;
|
1513 | max = i - 1;
|
1514 | }
|
1515 | return copiedTextProperties.text = text.substr(0, i), width = measureSvgTextWidth(copiedTextProperties),
|
1516 | width > maxWidth && i--, text.substr(ellipsis.length, i - ellipsis.length) + ellipsis;
|
1517 | }
|
1518 | function svgEllipsis(textElement, maxWidth) {
|
1519 | var properties = getSvgMeasurementProperties(textElement), originalText = properties.text, tailoredText = getTailoredTextOrDefault(properties, maxWidth);
|
1520 | originalText !== tailoredText && (textElement.textContent = tailoredText);
|
1521 | }
|
1522 | function wordBreak(textElement, maxWidth, maxHeight, linePadding) {
|
1523 | void 0 === linePadding && (linePadding = 0);
|
1524 | var properties = getSvgMeasurementProperties(textElement), height = estimateSvgTextHeight(properties) + linePadding, maxNumLines = Math.max(1, Math.floor(maxHeight / height)), node = d3.select(textElement), firstDY = node.attr("y"), labelText = textElement.textContent;
|
1525 | textElement.textContent = null;
|
1526 | for (var words = jsCommon.WordBreaker.splitByWidth(labelText, properties, measureSvgTextWidth, maxWidth, maxNumLines), i = 0, ilen = words.length; ilen > i; i++) properties.text = words[i],
|
1527 | node.append("tspan").attr({
|
1528 | x: 0,
|
1529 | dy: 0 === i ? firstDY : height
|
1530 | }).text(getTailoredTextOrDefault(properties, maxWidth));
|
1531 | }
|
1532 | function wordBreakOverflowingText(textElement, maxWidth, maxHeight, linePadding) {
|
1533 | void 0 === linePadding && (linePadding = 0);
|
1534 | var properties = getSvgMeasurementProperties(textElement), height = estimateSvgTextHeight(properties) + linePadding, maxNumLines = Math.max(1, Math.floor(maxHeight / height)), labelText = textElement.textContent;
|
1535 | textElement.textContent = null;
|
1536 | var words = jsCommon.WordBreaker.splitByWidth(labelText, properties, measureSvgTextWidth, maxWidth, maxNumLines);
|
1537 | words = _.compact(words);
|
1538 | var spanItem = d3.select(textElement).selectAll(OverflowingText.selector).data(words, function(d) {
|
1539 | return $.inArray(d, words);
|
1540 | });
|
1541 | spanItem.enter().append("span").classed(OverflowingText["class"], !0).text(function(d) {
|
1542 | return d;
|
1543 | }).style("width", jsCommon.PixelConverter.toString(maxWidth));
|
1544 | }
|
1545 | var spanElement, svgTextElement, canvasCtx, fallbackFontFamily, ellipsis = "…", OverflowingText = jsCommon.CssConstants.createClassAndSelector("overflowingText");
|
1546 | TextMeasurementService.removeSpanElement = removeSpanElement, TextMeasurementService.measureSvgTextWidth = measureSvgTextWidth,
|
1547 | TextMeasurementService.measureSvgTextRect = measureSvgTextRect, TextMeasurementService.measureSvgTextHeight = measureSvgTextHeight,
|
1548 | TextMeasurementService.estimateSvgTextBaselineDelta = estimateSvgTextBaselineDelta,
|
1549 | TextMeasurementService.estimateSvgTextHeight = estimateSvgTextHeight, TextMeasurementService.measureSvgTextElementWidth = measureSvgTextElementWidth,
|
1550 | TextMeasurementService.getMeasurementProperties = getMeasurementProperties, TextMeasurementService.getSvgMeasurementProperties = getSvgMeasurementProperties,
|
1551 | TextMeasurementService.getDivElementWidth = getDivElementWidth, TextMeasurementService.getTailoredTextOrDefault = getTailoredTextOrDefault,
|
1552 | TextMeasurementService.svgEllipsis = svgEllipsis, TextMeasurementService.wordBreak = wordBreak,
|
1553 | TextMeasurementService.wordBreakOverflowingText = wordBreakOverflowingText;
|
1554 | }(TextMeasurementService = powerbi.TextMeasurementService || (powerbi.TextMeasurementService = {}));
|
1555 | }(powerbi || (powerbi = {}));
|
1556 |
|
1557 | var jsCommon;
|
1558 |
|
1559 | !function(jsCommon) {
|
1560 | var KeyUtils, DOMConstants = jsCommon.DOMConstants;
|
1561 | !function(KeyUtils) {
|
1562 | function isArrowKey(keyCode) {
|
1563 | return keyCode === DOMConstants.downArrowKeyCode || keyCode === DOMConstants.upArrowKeyCode || keyCode === DOMConstants.leftArrowKeyCode || keyCode === DOMConstants.rightArrowKeyCode;
|
1564 | }
|
1565 | KeyUtils.isArrowKey = isArrowKey;
|
1566 | }(KeyUtils = jsCommon.KeyUtils || (jsCommon.KeyUtils = {}));
|
1567 | }(jsCommon || (jsCommon = {}));
|
1568 |
|
1569 | var jsCommon;
|
1570 |
|
1571 | !function(jsCommon) {
|
1572 | var ThrottleUtility = function() {
|
1573 | function ThrottleUtility(delay) {
|
1574 | this.timerFactory = jsCommon.TimerPromiseFactory.instance, this.delay = 0, delay && (this.delay = delay);
|
1575 | }
|
1576 | return ThrottleUtility.prototype.run = function(fn) {
|
1577 | var _this = this;
|
1578 | this.fn ? this.fn = fn : (this.fn = fn, this.timerFactory.create(this.delay).done(function() {
|
1579 | return _this.timerComplete(_this.fn);
|
1580 | }));
|
1581 | }, ThrottleUtility.prototype.timerComplete = function(fn) {
|
1582 | fn(), this.fn = null;
|
1583 | }, ThrottleUtility;
|
1584 | }();
|
1585 | jsCommon.ThrottleUtility = ThrottleUtility;
|
1586 | }(jsCommon || (jsCommon = {}));
|
1587 |
|
1588 | var jsCommon;
|
1589 |
|
1590 | !function(jsCommon) {
|
1591 | var TimerPromiseFactory = function() {
|
1592 | function TimerPromiseFactory() {}
|
1593 | return TimerPromiseFactory.prototype.create = function(delayInMs) {
|
1594 | var deferred = $.Deferred();
|
1595 | return window.setTimeout(function() {
|
1596 | return deferred.resolve();
|
1597 | }, delayInMs), deferred;
|
1598 | }, TimerPromiseFactory.instance = new TimerPromiseFactory(), TimerPromiseFactory;
|
1599 | }();
|
1600 | jsCommon.TimerPromiseFactory = TimerPromiseFactory;
|
1601 | }(jsCommon || (jsCommon = {}));
|
1602 |
|
1603 | var jsCommon;
|
1604 |
|
1605 | !function(jsCommon) {
|
1606 | !function(HttpStatusCode) {
|
1607 | HttpStatusCode[HttpStatusCode.OK = 200] = "OK", HttpStatusCode[HttpStatusCode.BadRequest = 400] = "BadRequest",
|
1608 | HttpStatusCode[HttpStatusCode.Unauthorized = 401] = "Unauthorized", HttpStatusCode[HttpStatusCode.Forbidden = 403] = "Forbidden",
|
1609 | HttpStatusCode[HttpStatusCode.RequestEntityTooLarge = 413] = "RequestEntityTooLarge";
|
1610 | }(jsCommon.HttpStatusCode || (jsCommon.HttpStatusCode = {}));
|
1611 | var HttpConstants;
|
1612 | jsCommon.HttpStatusCode;
|
1613 | !function(HttpConstants) {
|
1614 | HttpConstants.ApplicationOctetStream = "application/octet-stream", HttpConstants.MultiPartFormData = "multipart/form-data";
|
1615 | }(HttpConstants = jsCommon.HttpConstants || (jsCommon.HttpConstants = {}));
|
1616 | var StringExtensions;
|
1617 | !function(StringExtensions) {
|
1618 | function format() {
|
1619 | for (var args = [], _i = 0; _i < arguments.length; _i++) args[_i - 0] = arguments[_i];
|
1620 | var s = args[0];
|
1621 | if (isNullOrUndefinedOrWhiteSpaceString(s)) return s;
|
1622 | for (var i = 0; i < args.length - 1; i++) {
|
1623 | var reg = new RegExp("\\{" + i + "\\}", "gm");
|
1624 | s = s.replace(reg, args[i + 1]);
|
1625 | }
|
1626 | return s;
|
1627 | }
|
1628 | function equalIgnoreCase(a, b) {
|
1629 | return StringExtensions.normalizeCase(a) === StringExtensions.normalizeCase(b);
|
1630 | }
|
1631 | function startsWithIgnoreCase(a, b) {
|
1632 | var normalizedSearchString = StringExtensions.normalizeCase(b);
|
1633 | return 0 === StringExtensions.normalizeCase(a).indexOf(normalizedSearchString);
|
1634 | }
|
1635 | function startsWith(a, b) {
|
1636 | return 0 === a.indexOf(b);
|
1637 | }
|
1638 | function containsIgnoreCase(source, substring) {
|
1639 | return null == source ? !1 : -1 !== source.toLowerCase().indexOf(substring.toLowerCase().toString());
|
1640 | }
|
1641 | function normalizeCase(value) {
|
1642 | return Utility.throwIfNullOrUndefined(value, StringExtensions, "normalizeCase", "value"),
|
1643 | value.toUpperCase();
|
1644 | }
|
1645 | function isNullOrEmpty(value) {
|
1646 | return null == value || 0 === value.length;
|
1647 | }
|
1648 | function isNullOrUndefinedOrWhiteSpaceString(str) {
|
1649 | return StringExtensions.isNullOrEmpty(str) || StringExtensions.isNullOrEmpty(str.trim());
|
1650 | }
|
1651 | function containsWhitespace(str) {
|
1652 | Utility.throwIfNullOrUndefined(str, this, "containsWhitespace", "str");
|
1653 | var expr = /\s/;
|
1654 | return expr.test(str);
|
1655 | }
|
1656 | function isWhitespace(str) {
|
1657 | return Utility.throwIfNullOrUndefined(str, this, "isWhitespace", "str"), "" === str.trim();
|
1658 | }
|
1659 | function trimTrailingWhitespace(str) {
|
1660 | return Utility.throwIfNullOrUndefined(str, this, "trimTrailingWhitespace", "str"),
|
1661 | str.replace(/\s+$/, "");
|
1662 | }
|
1663 | function trimWhitespace(str) {
|
1664 | return Utility.throwIfNullOrUndefined(str, this, "trimWhitespace", "str"), str.replace(/^\s+/, "").replace(/\s+$/, "");
|
1665 | }
|
1666 | function getLengthDifference(left, right) {
|
1667 | return Utility.throwIfNullOrUndefined(left, this, "getLengthDifference", "left"),
|
1668 | Utility.throwIfNullOrUndefined(right, this, "getLengthDifference", "right"), Math.abs(left.length - right.length);
|
1669 | }
|
1670 | function repeat(char, count) {
|
1671 | for (var result = "", i = 0; count > i; i++) result += char;
|
1672 | return result;
|
1673 | }
|
1674 | function replaceAll(text, textToFind, textToReplace) {
|
1675 | if (!textToFind) return text;
|
1676 | var pattern = escapeStringForRegex(textToFind);
|
1677 | return text.replace(new RegExp(pattern, "gi"), textToReplace);
|
1678 | }
|
1679 | function ensureUniqueNames(names) {
|
1680 | for (var usedNames = {}, _i = 0, names_1 = names; _i < names_1.length; _i++) {
|
1681 | var name_1 = names_1[_i];
|
1682 | usedNames[name_1] = !1;
|
1683 | }
|
1684 | for (var uniqueNames = [], _a = 0, names_2 = names; _a < names_2.length; _a++) {
|
1685 | var name_2 = names_2[_a], uniqueName = name_2;
|
1686 | if (usedNames[uniqueName]) for (var counter = 0; void 0 !== usedNames[uniqueName]; ) uniqueName = name_2 + "." + ++counter;
|
1687 | uniqueNames.push(uniqueName), usedNames[uniqueName] = !0;
|
1688 | }
|
1689 | return uniqueNames;
|
1690 | }
|
1691 | function findUniqueName(usedNames, baseName) {
|
1692 | for (var i = 0, uniqueName = baseName; usedNames[uniqueName]; ) uniqueName = baseName + ++i;
|
1693 | return uniqueName;
|
1694 | }
|
1695 | function constructCommaSeparatedList(list, resourceProvider, maxValue) {
|
1696 | if (!list || 0 === list.length) return "";
|
1697 | null !== maxValue && void 0 !== maxValue || (maxValue = Number.MAX_VALUE);
|
1698 | for (var length = Math.min(maxValue, list.length), replacedList = [], j = 0; 2 > j; j++) for (var targetValue = "{" + j + "}", replaceValue = "_|_<" + j + ">_|_", i = 0; length > i; i++) list[i].indexOf(targetValue) > -1 && (list[i] = list[i].replace(targetValue, replaceValue),
|
1699 | replacedList.push({
|
1700 | targetValue: targetValue,
|
1701 | replaceValue: replaceValue
|
1702 | }));
|
1703 | for (var commaSeparatedList = "", i = 0; length > i; i++) commaSeparatedList = 0 === i ? list[i] : StringExtensions.format(resourceProvider.get("FilterRestatement_Comma"), commaSeparatedList, list[i]);
|
1704 | for (var i = 0; i < replacedList.length; i++) commaSeparatedList = commaSeparatedList.replace(replacedList[i].replaceValue, replacedList[i].targetValue);
|
1705 | return commaSeparatedList;
|
1706 | }
|
1707 | function escapeStringForRegex(s) {
|
1708 | return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1709 | }
|
1710 | function normalizeFileName(fileName) {
|
1711 | return fileName.replace(/[\<\>\:"\/\\\|\?*]/g, "");
|
1712 | }
|
1713 | function stringifyAsPrettyJSON(object) {
|
1714 | return JSON.stringify(object);
|
1715 | }
|
1716 | function deriveClsCompliantName(input, fallback) {
|
1717 | var result = input.replace(/^[^A-Za-z]*/g, "").replace(/[ :\.\/\\\-\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]/g, "_").replace(/[\W]/g, "");
|
1718 | return result.length > 0 ? result : fallback;
|
1719 | }
|
1720 | function stripTagDelimiters(s) {
|
1721 | return s.replace(HtmlTagRegex, "");
|
1722 | }
|
1723 | var HtmlTagRegex = new RegExp("[<>]", "g");
|
1724 | StringExtensions.format = format, StringExtensions.equalIgnoreCase = equalIgnoreCase,
|
1725 | StringExtensions.startsWithIgnoreCase = startsWithIgnoreCase, StringExtensions.startsWith = startsWith,
|
1726 | StringExtensions.containsIgnoreCase = containsIgnoreCase, StringExtensions.normalizeCase = normalizeCase,
|
1727 | StringExtensions.isNullOrEmpty = isNullOrEmpty, StringExtensions.isNullOrUndefinedOrWhiteSpaceString = isNullOrUndefinedOrWhiteSpaceString,
|
1728 | StringExtensions.containsWhitespace = containsWhitespace, StringExtensions.isWhitespace = isWhitespace,
|
1729 | StringExtensions.trimTrailingWhitespace = trimTrailingWhitespace, StringExtensions.trimWhitespace = trimWhitespace,
|
1730 | StringExtensions.getLengthDifference = getLengthDifference, StringExtensions.repeat = repeat,
|
1731 | StringExtensions.replaceAll = replaceAll, StringExtensions.ensureUniqueNames = ensureUniqueNames,
|
1732 | StringExtensions.findUniqueName = findUniqueName, StringExtensions.constructCommaSeparatedList = constructCommaSeparatedList,
|
1733 | StringExtensions.escapeStringForRegex = escapeStringForRegex, StringExtensions.normalizeFileName = normalizeFileName,
|
1734 | StringExtensions.stringifyAsPrettyJSON = stringifyAsPrettyJSON, StringExtensions.deriveClsCompliantName = deriveClsCompliantName,
|
1735 | StringExtensions.stripTagDelimiters = stripTagDelimiters;
|
1736 | }(StringExtensions = jsCommon.StringExtensions || (jsCommon.StringExtensions = {}));
|
1737 | var Utility = function() {
|
1738 | function Utility() {}
|
1739 | return Utility.throwIfNullOrUndefined = function(value, context, methodName, parameterName) {
|
1740 | null === value ? Utility.throwException(jsCommon.Errors.argumentNull(Utility.getComponentName(context) + methodName + "." + parameterName)) : typeof value === Utility.Undefined && Utility.throwException(jsCommon.Errors.argumentUndefined(Utility.getComponentName(context) + methodName + "." + parameterName));
|
1741 | }, Utility.throwIfNullOrEmpty = function(value, context, methodName, parameterName) {
|
1742 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName), value.length || Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + "." + parameterName));
|
1743 | }, Utility.throwIfNullOrEmptyString = function(value, context, methodName, parameterName) {
|
1744 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName), value.length < 1 && Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + "." + parameterName));
|
1745 | }, Utility.throwIfNullEmptyOrWhitespaceString = function(value, context, methodName, parameterName) {
|
1746 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName), StringExtensions.isNullOrUndefinedOrWhiteSpaceString(value) && Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + "." + parameterName));
|
1747 | }, Utility.throwIfNotTrue = function(condition, context, methodName, parameterName) {
|
1748 | condition || Utility.throwException(jsCommon.Errors.argument(parameterName, Utility.getComponentName(context) + methodName + "." + parameterName));
|
1749 | }, Utility.isString = function(value) {
|
1750 | return "string" == typeof value;
|
1751 | }, Utility.isBoolean = function(value) {
|
1752 | return "boolean" == typeof value;
|
1753 | }, Utility.isNumber = function(value) {
|
1754 | return "number" == typeof value;
|
1755 | }, Utility.isDate = function(value) {
|
1756 | return Utility.isObject(value) && value instanceof Date;
|
1757 | }, Utility.isObject = function(value) {
|
1758 | return null != value && "object" == typeof value;
|
1759 | }, Utility.isNullOrUndefined = function(value) {
|
1760 | return null === value || typeof value === Utility.Undefined;
|
1761 | }, Utility.urlCombine = function(baseUrl, path) {
|
1762 | if (Utility.throwIfNullOrUndefined(baseUrl, null, "urlCombine", "baseUrl"), Utility.throwIfNullOrUndefined(path, null, "urlCombine", "path"),
|
1763 | StringExtensions.isNullOrUndefinedOrWhiteSpaceString(path)) return baseUrl;
|
1764 | if (StringExtensions.isNullOrUndefinedOrWhiteSpaceString(baseUrl)) return path;
|
1765 | var finalUrl = baseUrl;
|
1766 | return "/" === finalUrl.charAt(finalUrl.length - 1) ? "/" === path.charAt(0) && (path = path.slice(1)) : "/" !== path.charAt(0) && (path = "/" + path),
|
1767 | finalUrl + path;
|
1768 | }, Utility.getAbsoluteUri = function(path) {
|
1769 | Utility.throwIfNullOrUndefined(path, null, "getAbsoluteUri", "path");
|
1770 | var url = path;
|
1771 | return url && -1 === url.indexOf("http") && (url = Utility.urlCombine(clusterUri, url)),
|
1772 | url;
|
1773 | }, Utility.getStaticResourceUri = function(path) {
|
1774 | Utility.throwIfNullOrUndefined(path, null, "getStaticResourceUri", "path");
|
1775 | var url = path;
|
1776 | return url && -1 === url.indexOf("http") && (url = jsCommon.Utility.urlCombine(Utility.staticContentLocation, url)),
|
1777 | url;
|
1778 | }, Utility.getComponentName = function(context) {
|
1779 | return context ? (typeof context).toString() + "." : "";
|
1780 | }, Utility.throwException = function(e) {
|
1781 | throw jsCommon.Trace.error(StringExtensions.format("Throwing exception: {0}", JSON.stringify(e)), null == e.stack),
|
1782 | e;
|
1783 | }, Utility.createClassSelector = function(className) {
|
1784 | return Utility.throwIfNullOrEmptyString(className, null, "CreateClassSelector", "className"),
|
1785 | "." + className;
|
1786 | }, Utility.createIdSelector = function(id) {
|
1787 | return Utility.throwIfNullOrEmptyString(id, null, "CreateIdSelector", "id"), "#" + id;
|
1788 | }, Utility.generateGuid = function() {
|
1789 | var guid = "", idx = 0;
|
1790 | for (idx = 0; 32 > idx; idx += 1) {
|
1791 | var guidDigitsItem = 16 * Math.random() | 0;
|
1792 | switch (idx) {
|
1793 | case 8:
|
1794 | case 12:
|
1795 | case 16:
|
1796 | case 20:
|
1797 | guid += "-";
|
1798 | }
|
1799 | guid += guidDigitsItem.toString(16);
|
1800 | }
|
1801 | return guid;
|
1802 | }, Utility.getCookieValue = function(key) {
|
1803 | for (var keyValuePairs = document.cookie.split(";"), i = 0; i < keyValuePairs.length; i++) {
|
1804 | var keyValue = keyValuePairs[i], split = keyValue.split("=");
|
1805 | if (split.length > 0 && split[0].trim() === key) return keyValue.substr(keyValue.indexOf("=") + 1);
|
1806 | }
|
1807 | return null;
|
1808 | }, Utility.getDomainForUrl = function(url) {
|
1809 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
1810 | return hrefObject.prop("protocol") + "//" + hrefObject.prop("hostname");
|
1811 | }, Utility.getHostNameForUrl = function(url) {
|
1812 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
1813 | return Utility.urlCombine(hrefObject.prop("hostname"), hrefObject.prop("pathname"));
|
1814 | }, Utility.getUrlWithoutQueryString = function(url) {
|
1815 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
1816 | return hrefObject.prop("protocol") + "//" + Utility.urlCombine(hrefObject.prop("host"), hrefObject.prop("pathname"));
|
1817 | }, Utility.getProtocolFromUrl = function(url) {
|
1818 | return Utility.getHrefObjectFromUrl(url).prop("protocol").replace(":", "");
|
1819 | }, Utility.getHrefObjectFromUrl = function(url) {
|
1820 | var aObject = $("<a>");
|
1821 | return aObject = aObject.prop("href", url);
|
1822 | }, Utility.convertWcfToJsDictionary = function(wcfDictionary) {
|
1823 | for (var result = {}, i = 0; i < wcfDictionary.length; i++) {
|
1824 | var keyValuePair = wcfDictionary[i];
|
1825 | result[keyValuePair.Key] = keyValuePair.Value;
|
1826 | }
|
1827 | return result;
|
1828 | }, Utility.getDateFromWcfJsonString = function(jsonDate, fromUtcMilliseconds) {
|
1829 | if (StringExtensions.isNullOrEmpty(jsonDate)) return null;
|
1830 | var begIndex = jsonDate.indexOf("("), endIndex = jsonDate.indexOf(")");
|
1831 | if (-1 !== begIndex && -1 !== endIndex) {
|
1832 | var milliseconds = parseInt(jsonDate.substring(begIndex + 1, endIndex), 10);
|
1833 | if (fromUtcMilliseconds) return new Date(milliseconds);
|
1834 | var retValue = new Date(0);
|
1835 | return retValue.setUTCMilliseconds(milliseconds), retValue;
|
1836 | }
|
1837 | return null;
|
1838 | }, Utility.getOuterHtml = function(content) {
|
1839 | return $("<div>").append(content).html();
|
1840 | }, Utility.compareInt = function(a, b) {
|
1841 | return a - b;
|
1842 | }, Utility.getIndexOfMinValue = function(a) {
|
1843 | for (var retValue = 0, currentMinValue = a[0], i = 0; i < a.length; i++) a[i] < currentMinValue && (currentMinValue = a[i],
|
1844 | retValue = i);
|
1845 | return retValue;
|
1846 | }, Utility.extractUrlFromCssBackgroundImage = function(input) {
|
1847 | return input.replace(/"/g, "").replace(/url\(|\)$/gi, "");
|
1848 | }, Utility.isValidImageDataUrl = function(url) {
|
1849 | var regex = new RegExp("data:(image/(png|jpg|jpeg|gif|svg))");
|
1850 | return regex.test(url);
|
1851 | }, Utility.isLocalUrl = function(url) {
|
1852 | return _.startsWith(url, "data:") || _.startsWith(url, "blob:");
|
1853 | }, Utility.saveAsFile = function(content, fileName) {
|
1854 | var contentBlob = new Blob([ content ], {
|
1855 | type: HttpConstants.ApplicationOctetStream
|
1856 | }), url = window.webkitURL || URL, urlLink = url.createObjectURL(contentBlob), fileNameLink = fileName || urlLink;
|
1857 | if (window.navigator.msSaveOrOpenBlob) return void window.navigator.msSaveOrOpenBlob(contentBlob, fileNameLink);
|
1858 | var hyperlink = document.createElement("a");
|
1859 | hyperlink.href = urlLink, hyperlink.target = "_blank", hyperlink.download = fileNameLink,
|
1860 | document.body.appendChild(hyperlink), hyperlink.click(), document.body.removeChild(hyperlink);
|
1861 | }, Utility.getType = function(obj) {
|
1862 | Utility.throwIfNullEmptyOrWhitespaceString(obj.__type, this, "getType", "obj");
|
1863 | var parts = obj.__type.split(":");
|
1864 | return 2 !== parts.length && jsCommon.Errors.argument("obj.__type", "Type String not in expected format [Type]#[Namespace]: " + obj.__type),
|
1865 | parts[1] !== Utility.TypeNamespace && jsCommon.Errors.argument("obj.__type", "Type Namespace not expected: " + parts[1]),
|
1866 | parts[0];
|
1867 | }, Utility.isEventSupported = function(eventName, element) {
|
1868 | eventName = "on" + eventName;
|
1869 | var isSupported = eventName in element;
|
1870 | return isSupported || (element.setAttribute || (element = document.createElement("div")),
|
1871 | element.setAttribute && element.removeAttribute && (element.setAttribute(eventName, ""),
|
1872 | isSupported = "function" == typeof element[eventName], "undefined" != typeof element[eventName] && (element[eventName] = null),
|
1873 | element.removeAttribute(eventName))), element = null, isSupported;
|
1874 | }, Utility.toPixel = function(pixelAmount) {
|
1875 | return Utility.throwIfNullOrUndefined(pixelAmount, this, "toPixel", "pixelAmount"),
|
1876 | pixelAmount.toString() + jsCommon.CssConstants.pixelUnits;
|
1877 | }, Utility.getPropertyCount = function(object) {
|
1878 | return Utility.throwIfNullOrUndefined(object, this, "getPropertyCount", "object"),
|
1879 | Object.getOwnPropertyNames(object).length;
|
1880 | }, Utility.getFileExtension = function(filePath) {
|
1881 | if (filePath) {
|
1882 | var index = filePath.lastIndexOf(".");
|
1883 | if (index >= 0) return filePath.substr(index + 1);
|
1884 | }
|
1885 | return "";
|
1886 | }, Utility.extractFileNameFromPath = function(filePath) {
|
1887 | return filePath.replace(/^.*[\\\/]/, "");
|
1888 | }, Utility.canUseClipboard = function() {
|
1889 | return "undefined" == typeof MSApp;
|
1890 | }, Utility.is64BitOperatingSystem = function() {
|
1891 | return -1 !== navigator.userAgent.indexOf("WOW64") || -1 !== navigator.userAgent.indexOf("Win64");
|
1892 | }, Utility.parseNumber = function(value, defaultValue) {
|
1893 | if (null === value) return null;
|
1894 | if (void 0 === value) return defaultValue;
|
1895 | var result = Number(value);
|
1896 | return isFinite(result) ? result : isNaN(result) && "number" != typeof value && "NaN" !== value ? defaultValue : result;
|
1897 | }, Utility.getURLParamValue = function(name) {
|
1898 | var results = new RegExp("[?&]" + name + "=([^&#]*)").exec(window.location.href);
|
1899 | return null == results ? null : results[1] || 0;
|
1900 | }, Utility.getLocalTimeZoneString = function() {
|
1901 | var localTimeZoneString, timeSummer = new Date(Date.UTC(2005, 6, 30, 0, 0, 0, 0)), summerOffset = -1 * timeSummer.getTimezoneOffset(), timeWinter = new Date(Date.UTC(2005, 12, 30, 0, 0, 0, 0)), winterOffset = -1 * timeWinter.getTimezoneOffset();
|
1902 | return localTimeZoneString = -720 === summerOffset && -720 === winterOffset ? "Dateline Standard Time" : -660 === summerOffset && -660 === winterOffset ? "UTC-11" : -660 === summerOffset && -660 === winterOffset ? "Samoa Standard Time" : -600 === summerOffset && -600 === winterOffset ? "Hawaiian Standard Time" : -480 === summerOffset && -540 === winterOffset ? "Alaskan Standard Time" : -420 === summerOffset && -480 === winterOffset ? "Pacific Standard Time" : -420 === summerOffset && -420 === winterOffset ? "US Mountain Standard Time" : -360 === summerOffset && -420 === winterOffset ? "Mountain Standard Time" : -360 === summerOffset && -360 === winterOffset ? "Central America Standard Time" : -300 === summerOffset && -360 === winterOffset ? "Central Standard Time" : -300 === summerOffset && -300 === winterOffset ? "SA Pacific Standard Time" : -240 === summerOffset && -300 === winterOffset ? "Eastern Standard Time" : -270 === summerOffset && -270 === winterOffset ? "Venezuela Standard Time" : -240 === summerOffset && -240 === winterOffset ? "SA Western Standard Time" : -240 === summerOffset && -180 === winterOffset ? "Central Brazilian Standard Time" : -180 === summerOffset && -240 === winterOffset ? "Atlantic Standard Time" : -180 === summerOffset && -180 === winterOffset ? "Montevideo Standard Time" : -180 === summerOffset && -120 === winterOffset ? "E. South America Standard Time" : -150 === summerOffset && -210 === winterOffset ? "Mid-Atlantic Standard Time" : -120 === summerOffset && -120 === winterOffset ? "SA Eastern Standard Time" : 0 === summerOffset && 0 === winterOffset ? "UTC" : 60 === summerOffset && 0 === winterOffset ? "GMT Standard Time" : 60 === summerOffset && 120 === winterOffset ? "Namibia Standard Time" : 120 === summerOffset && 60 === winterOffset ? "Romance Standard Time" : 120 === summerOffset && 120 === winterOffset ? "South Africa Standard Time" : 180 === summerOffset && 120 === winterOffset ? "GTB Standard Time" : 180 === summerOffset && 180 === winterOffset ? "E. Africa Standard Time" : 240 === summerOffset && 180 === winterOffset ? "Russian Standard Time" : 240 === summerOffset && 240 === winterOffset ? "Arabian Standard Time" : 270 === summerOffset && 210 === winterOffset ? "Iran Standard Time" : 270 === summerOffset && 270 === winterOffset ? "Afghanistan Standard Time" : 300 === summerOffset && 240 === winterOffset ? "Pakistan Standard Time" : 300 === summerOffset && 300 === winterOffset ? "West Asia Standard Time" : 330 === summerOffset && 330 === winterOffset ? "India Standard Time" : 345 === summerOffset && 345 === winterOffset ? "Nepal Standard Time" : 360 === summerOffset && 300 === winterOffset ? "N. Central Asia Standard Time" : 360 === summerOffset && 360 === winterOffset ? "Central Asia Standard Time" : 390 === summerOffset && 390 === winterOffset ? "Myanmar Standard Time" : 420 === summerOffset && 360 === winterOffset ? "North Asia Standard Time" : 420 === summerOffset && 420 === winterOffset ? "SE Asia Standard Time" : 480 === summerOffset && 420 === winterOffset ? "North Asia East Standard Time" : 480 === summerOffset && 480 === winterOffset ? "China Standard Time" : 540 === summerOffset && 480 === winterOffset ? "Yakutsk Standard Time" : 540 === summerOffset && 540 === winterOffset ? "Tokyo Standard Time" : 570 === summerOffset && 570 === winterOffset ? "Cen. Australia Standard Time" : 600 === summerOffset && 600 === winterOffset ? "E. Australia Standard Time" : 600 === summerOffset && 660 === winterOffset ? "AUS Eastern Standard Time" : 660 === summerOffset && 600 === winterOffset ? "Tasmania Standard Time" : 660 === summerOffset && 660 === winterOffset ? "West Pacific Standard Time" : 690 === summerOffset && 690 === winterOffset ? "Central Pacific Standard Time" : 720 === summerOffset && 660 === winterOffset ? "Magadan Standard Time" : 720 === summerOffset && 720 === winterOffset ? "Fiji Standard Time" : 720 === summerOffset && 780 === winterOffset ? "New Zealand Standard Time" : 780 === summerOffset && 780 === winterOffset ? "Tonga Standard Time" : "UTC";
|
1903 | }, Utility.TypeNamespace = "http://schemas.microsoft.com/sqlbi/2013/01/NLRuntimeService",
|
1904 | Utility.JsonContentType = "application/json", Utility.JpegContentType = "image/jpeg",
|
1905 | Utility.XJavascriptContentType = "application/x-javascript", Utility.JsonDataType = "json",
|
1906 | Utility.BlobDataType = "blob", Utility.HttpGetMethod = "GET", Utility.HttpPostMethod = "POST",
|
1907 | Utility.HttpPutMethod = "PUT", Utility.HttpDeleteMethod = "DELETE", Utility.HttpContentTypeHeader = "Content-Type",
|
1908 | Utility.HttpAcceptHeader = "Accept", Utility.Undefined = "undefined", Utility.staticContentLocation = window.location.protocol + "//" + window.location.host,
|
1909 | Utility;
|
1910 | }();
|
1911 | jsCommon.Utility = Utility;
|
1912 | var VersionUtility = function() {
|
1913 | function VersionUtility() {}
|
1914 | return VersionUtility.compareVersions = function(versionA, versionB) {
|
1915 | for (var a = versionA.split(".").map(parseFloat), b = versionB.split(".").map(parseFloat), versionParts = Math.max(a.length, b.length), i = 0; versionParts > i; i++) {
|
1916 | var partA = a[i] || 0, partB = b[i] || 0;
|
1917 | if (partA > partB) return 1;
|
1918 | if (partB > partA) return -1;
|
1919 | }
|
1920 | return 0;
|
1921 | }, VersionUtility;
|
1922 | }();
|
1923 | jsCommon.VersionUtility = VersionUtility;
|
1924 | var PerformanceUtil;
|
1925 | !function(PerformanceUtil) {
|
1926 | function create(name) {
|
1927 | return new PerfMarker(name);
|
1928 | }
|
1929 | var PerfMarker = function() {
|
1930 | function PerfMarker(name) {
|
1931 | this._name = name, this._start = PerfMarker.begin(name);
|
1932 | }
|
1933 | return PerfMarker.begin = function(name) {
|
1934 | return void 0 !== window.performance && void 0 !== performance.mark ? (console.time,
|
1935 | name = "Begin " + name, performance.mark(name), name) : void 0;
|
1936 | }, PerfMarker.prototype.end = function() {
|
1937 | if (void 0 !== window.performance && void 0 !== performance.mark && void 0 !== performance.measure) {
|
1938 | var name = this._name, end = "End " + name;
|
1939 | performance.mark(end), performance.measure(name, this._start, end), console.timeEnd;
|
1940 | }
|
1941 | }, PerfMarker;
|
1942 | }();
|
1943 | PerformanceUtil.PerfMarker = PerfMarker, PerformanceUtil.create = create;
|
1944 | }(PerformanceUtil = jsCommon.PerformanceUtil || (jsCommon.PerformanceUtil = {}));
|
1945 | var DeferUtility;
|
1946 | !function(DeferUtility) {
|
1947 | function deferUntilNextFrame(callback) {
|
1948 | var isWaiting, args, context;
|
1949 | return window.requestAnimationFrame || (window.requestAnimationFrame = function(func) {
|
1950 | return setTimeout(func, 20);
|
1951 | }), function() {
|
1952 | isWaiting || (isWaiting = !0, args = arguments, context = this, window.requestAnimationFrame(function() {
|
1953 | isWaiting = !1, callback.apply(context, args);
|
1954 | }));
|
1955 | };
|
1956 | }
|
1957 | DeferUtility.deferUntilNextFrame = deferUntilNextFrame;
|
1958 | }(DeferUtility = jsCommon.DeferUtility || (jsCommon.DeferUtility = {}));
|
1959 | }(jsCommon || (jsCommon = {}));
|
1960 |
|
1961 | var jsCommon;
|
1962 |
|
1963 | !function(jsCommon) {
|
1964 | var TraceItem = function() {
|
1965 | function TraceItem(text, type, sessionId, requestId) {
|
1966 | this.text = text, this.type = type, this.sessionId = sessionId, this.requestId = requestId,
|
1967 | this.timeStamp = new Date();
|
1968 | }
|
1969 | return TraceItem.prototype.toString = function() {
|
1970 | var resultString = "";
|
1971 | return resultString += jsCommon.StringExtensions.format("{0} ({1}): {2}", TraceItem.traceTypeStrings[this.type], this.timeStamp.toUTCString(), this.text),
|
1972 | this.requestId && (resultString += "\n(Request id: " + this.requestId + ")"), resultString;
|
1973 | }, TraceItem.traceTypeStrings = [ "INFORMATION", "VERBOSE", "WARNING", "ERROR", "EXPECTEDERROR", "UNEXPECTEDERROR", "FATAL" ],
|
1974 | TraceItem;
|
1975 | }();
|
1976 | jsCommon.TraceItem = TraceItem;
|
1977 | }(jsCommon || (jsCommon = {}));
|
1978 |
|
1979 | var jsCommon;
|
1980 |
|
1981 | !function(jsCommon) {
|
1982 | var UrlUtils;
|
1983 | !function(UrlUtils) {
|
1984 | function isValidUrl(value) {
|
1985 | if (jsCommon.StringExtensions.isNullOrEmpty(value)) return !1;
|
1986 | var match = jsCommon.RegExpExtensions.run(urlRegex, value);
|
1987 | return !(!match || 0 !== match.index);
|
1988 | }
|
1989 | function isValidImageUrl(url) {
|
1990 | return isValidUrl(url);
|
1991 | }
|
1992 | function findAllValidUrls(text) {
|
1993 | if (jsCommon.StringExtensions.isNullOrEmpty(text)) return [];
|
1994 | for (var matches, urlRanges = [], start = 0; null !== (matches = jsCommon.RegExpExtensions.run(urlRegex, text, start)); ) {
|
1995 | var url = matches[0], end = matches.index + url.length;
|
1996 | urlRanges.push({
|
1997 | start: matches.index,
|
1998 | end: end,
|
1999 | text: url
|
2000 | }), start = end;
|
2001 | }
|
2002 | return urlRanges;
|
2003 | }
|
2004 | function getBase64ContentFromDataUri(uri) {
|
2005 | if (0 !== uri.indexOf("data:")) throw new Error("Expected data uri");
|
2006 | var base64Token = ";base64,", indexBase64TokenStart = uri.indexOf(base64Token);
|
2007 | if (0 > indexBase64TokenStart) throw new Error("Expected base 64 content in data url");
|
2008 | var indexBase64Start = indexBase64TokenStart + base64Token.length;
|
2009 | return uri.substr(indexBase64Start, uri.length - indexBase64Start);
|
2010 | }
|
2011 | var urlRegex = /http[s]?:\/\/(\S)+/gi;
|
2012 | UrlUtils.isValidUrl = isValidUrl, UrlUtils.isValidImageUrl = isValidImageUrl, UrlUtils.findAllValidUrls = findAllValidUrls,
|
2013 | UrlUtils.getBase64ContentFromDataUri = getBase64ContentFromDataUri;
|
2014 | }(UrlUtils = jsCommon.UrlUtils || (jsCommon.UrlUtils = {}));
|
2015 | }(jsCommon || (jsCommon = {}));
|
2016 |
|
2017 | var jsCommon;
|
2018 |
|
2019 | !function(jsCommon) {
|
2020 | var BrowserUtils;
|
2021 | !function(BrowserUtils) {
|
2022 | function isChrome() {
|
2023 | var vendorName = window.navigator.vendor || "", userAgent = window.navigator.userAgent.toLowerCase();
|
2024 | return vendorName.toLowerCase().indexOf("google") > -1 && userAgent.indexOf("chrome") > -1 && -1 === userAgent.indexOf("edge") && -1 === userAgent.indexOf("opr");
|
2025 | }
|
2026 | function isInternetExplorerOrEdge() {
|
2027 | var userAgent = window.navigator.userAgent.toLowerCase();
|
2028 | return userAgent.indexOf("msie") > -1 || userAgent.indexOf("trident") > -1 || userAgent.indexOf("edge") > -1;
|
2029 | }
|
2030 | function getInternetExplorerVersion() {
|
2031 | var retValue = 0;
|
2032 | if ("Microsoft Internet Explorer" === navigator.appName || window.navigator.userAgent.indexOf("MSIE") >= 0) {
|
2033 | var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"), result = re.exec(window.navigator.userAgent);
|
2034 | result && (retValue = parseFloat(result[1]));
|
2035 | }
|
2036 | return retValue;
|
2037 | }
|
2038 | BrowserUtils.isChrome = isChrome, BrowserUtils.isInternetExplorerOrEdge = isInternetExplorerOrEdge,
|
2039 | BrowserUtils.getInternetExplorerVersion = getInternetExplorerVersion;
|
2040 | }(BrowserUtils = jsCommon.BrowserUtils || (jsCommon.BrowserUtils = {}));
|
2041 | }(jsCommon || (jsCommon = {}));
|
2042 |
|
2043 | var jsCommon;
|
2044 |
|
2045 | !function(jsCommon) {
|
2046 | var EnumExtensions;
|
2047 | !function(EnumExtensions) {
|
2048 | function hasFlag(value, flag) {
|
2049 | return (value & flag) === flag;
|
2050 | }
|
2051 | function setFlag(value, flag) {
|
2052 | return value |= flag;
|
2053 | }
|
2054 | function resetFlag(value, flag) {
|
2055 | return value &= ~flag;
|
2056 | }
|
2057 | function toString(enumType, value) {
|
2058 | return enumType[value];
|
2059 | }
|
2060 | EnumExtensions.hasFlag = hasFlag, EnumExtensions.setFlag = setFlag, EnumExtensions.resetFlag = resetFlag,
|
2061 | EnumExtensions.toString = toString;
|
2062 | }(EnumExtensions = jsCommon.EnumExtensions || (jsCommon.EnumExtensions = {}));
|
2063 | var StringExtensions;
|
2064 | !function(StringExtensions) {
|
2065 | function endsWith(str, suffix) {
|
2066 | return -1 !== str.indexOf(suffix, str.length - suffix.length);
|
2067 | }
|
2068 | StringExtensions.endsWith = endsWith;
|
2069 | }(StringExtensions = jsCommon.StringExtensions || (jsCommon.StringExtensions = {}));
|
2070 | var LogicExtensions;
|
2071 | !function(LogicExtensions) {
|
2072 | function XOR(a, b) {
|
2073 | return (a || b) && !(a && b);
|
2074 | }
|
2075 | LogicExtensions.XOR = XOR;
|
2076 | }(LogicExtensions = jsCommon.LogicExtensions || (jsCommon.LogicExtensions = {}));
|
2077 | var JsonComparer;
|
2078 | !function(JsonComparer) {
|
2079 | function equals(x, y) {
|
2080 | return x === y ? !0 : JSON.stringify(x) === JSON.stringify(y);
|
2081 | }
|
2082 | JsonComparer.equals = equals;
|
2083 | }(JsonComparer = jsCommon.JsonComparer || (jsCommon.JsonComparer = {}));
|
2084 | var TextSizeDefaults;
|
2085 | !function(TextSizeDefaults) {
|
2086 | function getScale(textSize) {
|
2087 | return (textSize - TextSizeDefaults.TextSizeMin) / TextSizeRange;
|
2088 | }
|
2089 | TextSizeDefaults.TextSizeMin = 8, TextSizeDefaults.TextSizeMax = 40;
|
2090 | var TextSizeRange = TextSizeDefaults.TextSizeMax - TextSizeDefaults.TextSizeMin;
|
2091 | TextSizeDefaults.getScale = getScale;
|
2092 | }(TextSizeDefaults = jsCommon.TextSizeDefaults || (jsCommon.TextSizeDefaults = {}));
|
2093 | var PixelConverter;
|
2094 | !function(PixelConverter) {
|
2095 | function toString(px) {
|
2096 | return px + PixelString;
|
2097 | }
|
2098 | function fromPoint(pt) {
|
2099 | return toString(fromPointToPixel(pt));
|
2100 | }
|
2101 | function fromPointToPixel(pt) {
|
2102 | return PxPtRatio * pt;
|
2103 | }
|
2104 | function toPoint(px) {
|
2105 | return px / PxPtRatio;
|
2106 | }
|
2107 | var PxPtRatio = 4 / 3, PixelString = "px";
|
2108 | PixelConverter.toString = toString, PixelConverter.fromPoint = fromPoint, PixelConverter.fromPointToPixel = fromPointToPixel,
|
2109 | PixelConverter.toPoint = toPoint;
|
2110 | }(PixelConverter = jsCommon.PixelConverter || (jsCommon.PixelConverter = {}));
|
2111 | var RegExpExtensions;
|
2112 | !function(RegExpExtensions) {
|
2113 | function run(regex, value, start) {
|
2114 | return regex.lastIndex = start || 0, regex.exec(value);
|
2115 | }
|
2116 | RegExpExtensions.run = run;
|
2117 | }(RegExpExtensions = jsCommon.RegExpExtensions || (jsCommon.RegExpExtensions = {}));
|
2118 | }(jsCommon || (jsCommon = {}));
|
2119 |
|
2120 | var powerbi;
|
2121 |
|
2122 | !function(powerbi) {
|
2123 | var visuals;
|
2124 | !function(visuals) {
|
2125 | var utility;
|
2126 | !function(utility) {
|
2127 | var StyleUtils;
|
2128 | !function(StyleUtils) {
|
2129 | function getRotateAngleFromElement(element) {
|
2130 | var rawElemStyle = element.get(0).style, transformString = rawElemStyle.transform || rawElemStyle.webkitTransform;
|
2131 | if (transformString) {
|
2132 | var transform = transformString.match(/rotate\((-?\d+(?:\.\d*)?)deg\)/);
|
2133 | if (transform) return parseFloat(transform[1]);
|
2134 | }
|
2135 | return 0;
|
2136 | }
|
2137 | function getTranslateTransformFromElement(element) {
|
2138 | var rawElemStyle = element.get(0).style, transformString = rawElemStyle.transform || rawElemStyle.webkitTransform, retValue = {
|
2139 | x: 0,
|
2140 | y: 0
|
2141 | };
|
2142 | if (transformString && transformString.length > 0) {
|
2143 | var transform = transformString.match(/translate\((-?\d+(?:\.\d*)?)px, (-?\d+(?:\.\d*)?)px\)/);
|
2144 | transform && (retValue.x = parseFloat(transform[1]), retValue.y = parseFloat(transform[2]));
|
2145 | }
|
2146 | return retValue;
|
2147 | }
|
2148 | function getPadding(element) {
|
2149 | return element ? {
|
2150 | left: parseFloat(element.css("padding-left")) || 0,
|
2151 | right: parseFloat(element.css("padding-right")) || 0,
|
2152 | top: parseFloat(element.css("padding-top")) || 0,
|
2153 | bottom: parseFloat(element.css("padding-bottom")) || 0
|
2154 | } : void 0;
|
2155 | }
|
2156 | StyleUtils.getRotateAngleFromElement = getRotateAngleFromElement, StyleUtils.getTranslateTransformFromElement = getTranslateTransformFromElement,
|
2157 | StyleUtils.getPadding = getPadding;
|
2158 | }(StyleUtils = utility.StyleUtils || (utility.StyleUtils = {}));
|
2159 | }(utility = visuals.utility || (visuals.utility = {}));
|
2160 | }(visuals = powerbi.visuals || (powerbi.visuals = {}));
|
2161 | }(powerbi || (powerbi = {}));
|
2162 |
|
2163 | var jsCommon;
|
2164 |
|
2165 | !function(jsCommon) {
|
2166 | var ConsoleTracer = function() {
|
2167 | function ConsoleTracer() {}
|
2168 | return ConsoleTracer.prototype.logTrace = function(trace) {
|
2169 | if (DEBUG) switch (trace.type) {
|
2170 | case jsCommon.TraceType.Information:
|
2171 | break;
|
2172 |
|
2173 | case jsCommon.TraceType.UnexpectedError:
|
2174 | case jsCommon.TraceType.Error:
|
2175 | case jsCommon.TraceType.Fatal:
|
2176 | break;
|
2177 |
|
2178 | case jsCommon.TraceType.ExpectedError:
|
2179 | case jsCommon.TraceType.Warning:
|
2180 | break;
|
2181 |
|
2182 | case jsCommon.TraceType.Verbose: }
|
2183 | }, ConsoleTracer;
|
2184 | }();
|
2185 | jsCommon.ConsoleTracer = ConsoleTracer;
|
2186 | var Trace;
|
2187 | !function(Trace) {
|
2188 | function warning(text, requestId) {
|
2189 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Warning, requestId));
|
2190 | }
|
2191 | function error(text, includeStackTrace, requestId) {
|
2192 | includeStackTrace && (text = jsCommon.StringExtensions.format("{0}.\nStack:\n{1}", text, jsCommon.getStackTrace())),
|
2193 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Error, requestId));
|
2194 | }
|
2195 | function verbose(text, requestId) {
|
2196 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Verbose, requestId));
|
2197 | }
|
2198 | function addListener(listener) {
|
2199 | listeners.push(listener);
|
2200 | }
|
2201 | function removeListener(listener) {
|
2202 | var index = listeners.indexOf(listener);
|
2203 | index >= 0 && listeners.splice(index, 1);
|
2204 | }
|
2205 | function resetListeners() {
|
2206 | listeners = new Array(defaultListener);
|
2207 | }
|
2208 | function reset() {
|
2209 | lastTraceIndex = -1;
|
2210 | }
|
2211 | function getTraces() {
|
2212 | if (!(0 > lastTraceIndex)) {
|
2213 | for (var result = new Array(lastTraceIndex + 1), i = 0; lastTraceIndex >= i; i++) result[i] = traces[i];
|
2214 | return result;
|
2215 | }
|
2216 | }
|
2217 | function disableDefaultListener() {
|
2218 | removeListener(defaultListener);
|
2219 | }
|
2220 | function enableDefaultListener() {
|
2221 | addListener(defaultListener);
|
2222 | }
|
2223 | function logTraceInternal(trace) {
|
2224 | lastTraceIndex + 1 >= traceMaxCount && reset(), traces[++lastTraceIndex] = trace;
|
2225 | for (var i = 0, len = listeners.length; len > i; i++) listeners[i].logTrace(trace);
|
2226 | }
|
2227 | var traceMaxCount = 1e3, traces = new Array(traceMaxCount), lastTraceIndex = -1, defaultListener = new ConsoleTracer(), listeners = new Array(defaultListener);
|
2228 | Trace.warning = warning, Trace.error = error, Trace.verbose = verbose, Trace.addListener = addListener,
|
2229 | Trace.removeListener = removeListener, Trace.resetListeners = resetListeners, Trace.reset = reset,
|
2230 | Trace.getTraces = getTraces, Trace.disableDefaultListener = disableDefaultListener,
|
2231 | Trace.enableDefaultListener = enableDefaultListener;
|
2232 | }(Trace = jsCommon.Trace || (jsCommon.Trace = {}));
|
2233 | }(jsCommon || (jsCommon = {}));
|
2234 |
|
2235 | var jsCommon;
|
2236 |
|
2237 | !function(jsCommon) {
|
2238 | !function(TraceType) {
|
2239 | TraceType[TraceType.Information = 0] = "Information", TraceType[TraceType.Verbose = 1] = "Verbose",
|
2240 | TraceType[TraceType.Warning = 2] = "Warning", TraceType[TraceType.Error = 3] = "Error",
|
2241 | TraceType[TraceType.ExpectedError = 4] = "ExpectedError", TraceType[TraceType.UnexpectedError = 5] = "UnexpectedError",
|
2242 | TraceType[TraceType.Fatal = 6] = "Fatal";
|
2243 | }(jsCommon.TraceType || (jsCommon.TraceType = {}));
|
2244 | jsCommon.TraceType;
|
2245 | }(jsCommon || (jsCommon = {}));
|
2246 |
|
2247 | var jsCommon;
|
2248 |
|
2249 | !function(jsCommon) {
|
2250 | function ensurePowerView(action) {
|
2251 | void 0 === action && (action = _.noop), jsCommon.requires(PowerViewPackage, action);
|
2252 | }
|
2253 | function ensureMap(locale, action) {
|
2254 | var mapPackageWithLocale = powerbi.Prototype.inherit(MapPackage);
|
2255 | _.isEmpty(locale) || (mapPackageWithLocale.javaScriptFilesWithCallback[0].javascriptFile = MSMapcontrol.concat("&mkt=" + locale)),
|
2256 | jsCommon.requires(mapPackageWithLocale, action);
|
2257 | }
|
2258 | function mapControlLoaded() {
|
2259 | MSMapcontrolLoaded = !0, WaitForMSMapLoad && (WaitForMSMapLoad.resolve(), WaitForMSMapLoad = void 0);
|
2260 | }
|
2261 | function waitForMapControlLoaded() {
|
2262 | var task;
|
2263 | return MSMapcontrolLoaded ? (task = $.Deferred(), task.resolve()) : task = WaitForMSMapLoad = $.Deferred(),
|
2264 | task.promise();
|
2265 | }
|
2266 | var MSMapcontrol = "https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1&onscriptload=globalMapControlLoaded", MSMapcontrolLoaded = !1, WaitForMSMapLoad = null, PowerViewPackage = {
|
2267 | javaScriptFiles: [ powerbi.build + "/externals/pv/webclient.js" ],
|
2268 | cssFiles: [ powerbi.build + "/externals/pv/Styles/_all.css" ],
|
2269 | javaScriptFilesWithCallback: [ {
|
2270 | javascriptFile: MSMapcontrol,
|
2271 | onLoadCallback: waitForMapControlLoaded
|
2272 | } ]
|
2273 | };
|
2274 | jsCommon.ensurePowerView = ensurePowerView;
|
2275 | var MapPackage = {
|
2276 | javaScriptFilesWithCallback: [ {
|
2277 | javascriptFile: MSMapcontrol,
|
2278 | onLoadCallback: waitForMapControlLoaded
|
2279 | } ]
|
2280 | };
|
2281 | jsCommon.ensureMap = ensureMap, jsCommon.mapControlLoaded = mapControlLoaded, jsCommon.waitForMapControlLoaded = waitForMapControlLoaded;
|
2282 | }(jsCommon || (jsCommon = {}));
|
2283 |
|
2284 | var globalMapControlLoaded = function() {
|
2285 | jsCommon.mapControlLoaded();
|
2286 | }, InJs;
|
2287 |
|
2288 | !function(InJs) {
|
2289 | !function(TraceType) {
|
2290 | TraceType[TraceType.information = 0] = "information", TraceType[TraceType.verbose = 1] = "verbose",
|
2291 | TraceType[TraceType.warning = 2] = "warning", TraceType[TraceType.error = 3] = "error",
|
2292 | TraceType[TraceType.expectedError = 4] = "expectedError", TraceType[TraceType.unexpectedError = 5] = "unexpectedError",
|
2293 | TraceType[TraceType.fatal = 6] = "fatal";
|
2294 | }(InJs.TraceType || (InJs.TraceType = {}));
|
2295 | InJs.TraceType;
|
2296 | }(InJs || (InJs = {})); |
\ | No newline at end of file |