UNPKG

react-powerbi

Version:

Easily embed your PowerBI Dashboard to your React App

5 lines 184 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define("react-powerbi",["react"],e):"object"==typeof exports?exports["react-powerbi"]=e(require("react")):t["react-powerbi"]=e(t.react)}(window,(function(t){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(a,i,function(e){return t[e]}.bind(null,i));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a,i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],a=!0,i=!1,o=void 0;try{for(var n,l=t[Symbol.iterator]();!(a=(n=l.next()).done)&&(r.push(n.value),!e||r.length!==e);a=!0);}catch(t){i=!0,o=t}finally{try{!a&&l.return&&l.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=r(1),n=(a=o)&&a.__esModule?a:{default:a},l=r(2),d=r(3);var s=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(r[a[i]]=t[a[i]])}return r},u=new l.service.Service(l.factories.hpmFactory,l.factories.wpmpFactory,l.factories.routerFactory),p=function(t){var e=t.embedType,r=(0,o.useRef)(),a=(0,o.useRef)(),p=(0,o.useState)(),c=i(p,2),f=c[0],v=c[1];function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"report",e=arguments[1],r={report:l.models.validateReportLoad,dashboard:l.models.validateDashboardLoad,tile:l.models.validateTileLoad},a=r[t](e);return console.error("PowerBI Embed Config Error, See Error Array -> ",a),void 0===a}function V(t,e){var r=t.embedType,a=t.mobile,i=t.tokenType,o=t.permissions,n=t.filterPaneEnabled,u=t.navContentPaneEnabled,p=t.settings,c=s(t,["embedType","mobile","tokenType","permissions","filterPaneEnabled","navContentPaneEnabled","settings"]);return Object.assign(Object.assign(Object.assign({},e),c),{settings:Object.assign(Object.assign({},p),{filterPaneEnabled:n,navContentPaneEnabled:u,layoutType:a?l.models.LayoutType.MobilePortrait:void 0}),permissions:o||d.Permissions.All,tokenType:i||d.TokenType.Embed,type:r||"report"})}return(0,o.useEffect)((function(){return function(){var t=a.current;u.reset(t),r.current=null}}),[t.mobile]),(0,o.useEffect)((function(){console.log("tried to run");var i=V(t);if(h(e,i)){console.log("validated");var o=u.embed(a.current,i);v(o)}return function(){var t=a.current;u.reset(t),r.current=null}}),[]),(0,o.useEffect)((function(){if(f){var r=V(t);h(e,r)&&u.embed(a.current,r)}}),[t]),n.default.createElement("div",{className:"powerbi-container",style:{width:t.width,height:t.height},ref:function(t){a.current=t}})};p.defaultProps={embedType:"report"},e.default=p},function(e,r){e.exports=t},function(t,e,r){ /*! powerbi-client v2.11.0 | (c) 2016 Microsoft Corporation MIT */ var a;a=function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var i=e[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.m=t,r.c=e,r.p="",r(0)}([function(t,e,r){var a=r(1);e.service=a;var i=r(17);e.factories=i;var o=r(5);e.models=o;var n=r(7);e.Report=n.Report;var l=r(13);e.Dashboard=l.Dashboard;var d=r(14);e.Tile=d.Tile;var s=r(2);e.Embed=s.Embed;var u=r(8);e.Page=u.Page;var p=r(15);e.Qna=p.Qna;var c=r(16);e.Visual=c.Visual;var f=r(9);e.VisualDescriptor=f.VisualDescriptor;var v=new a.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=v},function(t,e,r){var a=r(2),i=r(7),o=r(12),n=r(13),l=r(14),d=r(8),s=r(15),u=r(16),p=r(3),c=function(){function t(e,r,a,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=e(this.wpmp,null,i.version,i.type),this.router=a(this.wpmp),this.uniqueSessionId=p.generateUUID(),this.router.post("/reports/:uniqueId/events/:eventName",(function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",(function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/reports/:uniqueId/pages/:pageName/visuals/:visualName/events/:eventName",(function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/dashboards/:uniqueId/events/:eventName",(function(t,e){var r={type:"dashboard",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/tile/:uniqueId/events/:eventName",(function(t,e){var r={type:"tile",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/qna/:uniqueId/events/:eventName",(function(t,e){var r={type:"qna",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)})),this.router.post("/ready/:uniqueId",(function(t,e){var r={type:"report",id:t.params.uniqueId,name:"ready",value:t.body};o.handleEvent(r)})),this.embeds=[],this.config=p.assign({},t.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return t.prototype.createReport=function(t,e){e.type="create";var r=t,a=new o.Create(this,r,e);return r.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},t.prototype.init=function(t,e){var r=this;return void 0===e&&(e=void 0),t=t&&t instanceof HTMLElement?t:document.body,Array.prototype.slice.call(t.querySelectorAll("["+a.Embed.embedUrlAttribute+"]")).map((function(t){return r.embed(t,e)}))},t.prototype.embed=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e)},t.prototype.load=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e,!0,!1)},t.prototype.bootstrap=function(t,e){return this.embedInternal(t,e,!1,!0)},t.prototype.embedInternal=function(t,e,r,a){var i;void 0===e&&(e={});var o=t;if(o.powerBiEmbed){if(a)throw new Error("Attempted to bootstrap element "+t.outerHTML+", but the element is already a powerbi element.");i=this.embedExisting(o,e,r)}else i=this.embedNew(o,e,r,a);return i},t.prototype.getNumberOfComponents=function(){return this.embeds?this.embeds.length:0},t.prototype.getSdkSessionId=function(){return this.uniqueSessionId},t.prototype.embedNew=function(e,r,o,n){var l=r.type||e.getAttribute(a.Embed.typeAttribute);if(!l)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+e.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+a.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=l;var d=p.find((function(t){return l===t.type.toLowerCase()}),t.components);if(!d)throw new Error("Attempted to embed component of type: "+l+" but did not find any matching component. Please verify the type you specified is intended.");var s=new d(this,e,r,o,n);return e.powerBiEmbed=s,this.addOrOverwriteEmbed(s,e),s},t.prototype.embedExisting=function(t,e,r){var a=p.find((function(e){return e.element===t}),this.embeds);if(!a)throw new Error("Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if(e.type&&"qna"===e.type.toLowerCase())return this.embedNew(t,e);if("string"==typeof e.type&&e.type!==a.config.type){if("report"===e.type&&"create"===a.config.type){var o=new i.Report(this,t,e,!1,!1,t.powerBiEmbed.iframe);return o.load(e),t.powerBiEmbed=o,this.addOrOverwriteEmbed(a,t),o}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+e.type)}return a.populateConfig(e,!1),a.load(a.config,r),a},t.prototype.enableAutoEmbed=function(){var t=this;window.addEventListener("DOMContentLoaded",(function(e){return t.init(document.body)}),!1)},t.prototype.get=function(t){var e=t;if(!e.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+t.outerHTML+" but there was no associated instance.");return e.powerBiEmbed},t.prototype.find=function(t){return p.find((function(e){return e.config.uniqueId===t}),this.embeds)},t.prototype.addOrOverwriteEmbed=function(t,e){this.embeds=this.embeds.filter((function(t){return t.element.id!==e.id})),this.embeds.push(t)},t.prototype.reset=function(t){var e=t;if(e.powerBiEmbed){var r=e.powerBiEmbed;r.frontLoadHandler&&r.element.removeEventListener("ready",r.frontLoadHandler,!1),p.remove((function(t){return t===e.powerBiEmbed}),this.embeds),delete e.powerBiEmbed;var a=t.querySelector("iframe");a&&(void 0!==a.remove?a.remove():a.parentElement.removeChild(a))}},t.prototype.handleTileEvents=function(t){"tile"===t.type&&this.handleEvent(t)},t.prototype.handleEvent=function(t){var e=p.find((function(e){return e.config.uniqueId===t.id}),this.embeds);if(e){var r=t.value;if("pageChanged"===t.name){var a=r.newPage;if(!a)throw new Error("Page model not found at 'event.value.newPage'.");r.newPage=new d.Page(e,a.name,a.displayName,!0)}p.raiseCustomEvent(e.element,t.name,r)}},t.prototype.preload=function(t,e){var r=document.createElement("iframe");r.setAttribute("style","display:none;"),r.setAttribute("src",t.embedUrl),r.setAttribute("scrolling","no"),r.setAttribute("allowfullscreen","false");var a=e;return a||(a=document.getElementsByTagName("body")[0]),a.appendChild(r),r.onload=function(){p.raiseCustomEvent(r,"preloaded",{})},r},t.components=[l.Tile,i.Report,n.Dashboard,s.Qna,u.Visual],t.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return console.log(t[0],t.slice(1))}},t}();e.Service=c},function(t,e,r){var a=r(3),i=r(4),o=r(5),n=r(6),l=function(){function t(e,r,i,o,l,d){if(this.allowedEvents=[],a.autoAuthInEmbedUrl(i.embedUrl))throw new Error(n.EmbedUrlNotSupported);Array.prototype.push.apply(this.allowedEvents,t.allowedEvents),this.eventHandlers=[],this.service=e,this.element=r,this.iframe=o,this.embedtype=i.type.toLowerCase(),this.populateConfig(i,d),"create"===this.embedtype?this.setIframe(!1,l,d):this.setIframe(!0,l,d)}return t.prototype.createReport=function(t){var e=o.validateCreateReport(t);if(e)throw e;return this.service.hpm.post("/report/create",t,{uid:this.config.uniqueId,sdkSessionId:this.service.getSdkSessionId()},this.iframe.contentWindow).then((function(t){return t.body}),(function(t){throw t.body}))},t.prototype.save=function(){return this.service.hpm.post("/report/save",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then((function(t){return t.body})).catch((function(t){throw t.body}))},t.prototype.saveAs=function(t){return this.service.hpm.post("/report/saveAs",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then((function(t){return t.body})).catch((function(t){throw t.body}))},t.prototype.load=function(t,e){var r=this;if(t.accessToken){var o=e&&"report"===t.type?this.phasedLoadPath:this.loadPath,n={uid:this.config.uniqueId,sdkSessionId:this.service.getSdkSessionId(),bootstrapped:this.config.bootstrapped,sdkVersion:i.default.version};return this.service.hpm.post(o,t,n,this.iframe.contentWindow).then((function(e){return a.assign(r.config,t),e.body}),(function(t){throw t.body}))}},t.prototype.off=function(t,e){var r=this,i={name:t,type:null,id:null,value:null};e?(a.remove((function(t){return t.test(i)&&t.handle===e}),this.eventHandlers),this.element.removeEventListener(t,e)):this.eventHandlers.filter((function(t){return t.test(i)})).forEach((function(e){a.remove((function(t){return t===e}),r.eventHandlers),r.element.removeEventListener(t,e.handle)}))},t.prototype.on=function(t,e){if(-1===this.allowedEvents.indexOf(t))throw new Error("eventName must be one of "+this.allowedEvents+". You passed: "+t);this.eventHandlers.push({test:function(e){return e.name===t},handle:e}),this.element.addEventListener(t,e)},t.prototype.reload=function(){return this.load(this.config)},t.prototype.setAccessToken=function(e){var r=this,a=this.config.type;return a="create"===a||"visual"===a||"qna"===a?"report":a,this.service.hpm.post("/"+a+"/token",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then((function(a){return r.config.accessToken=e,r.element.setAttribute(t.accessTokenAttribute,e),r.service.accessToken=e,a.body})).catch((function(t){throw t.body}))},t.prototype.getAccessToken=function(e){var r=this.config.accessToken||this.element.getAttribute(t.accessTokenAttribute)||e;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+t.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},t.prototype.populateConfig=function(t,e){this.bootstrapConfig?(this.config=a.assign({},this.bootstrapConfig,t),this.bootstrapConfig=null):this.config=a.assign({},t),this.config.embedUrl=this.getEmbedUrl(e),this.config.groupId=this.getGroupId(),this.addLocaleToEmbedUrl(t),this.config.uniqueId=this.getUniqueId(),e?(this.bootstrapConfig=this.config,this.bootstrapConfig.bootstrapped=!0):this.config.accessToken=this.getAccessToken(this.service.accessToken),this.configChanged(e)},t.prototype.addLocaleToEmbedUrl=function(t){if(t.settings){var e=t.settings.localeSettings;e&&e.language&&(this.config.embedUrl=a.addParamToUrl(this.config.embedUrl,"language",e.language)),e&&e.formatLocale&&(this.config.embedUrl=a.addParamToUrl(this.config.embedUrl,"formatLocale",e.formatLocale))}},t.prototype.getEmbedUrl=function(e){var r=this.config.embedUrl||this.element.getAttribute(t.embedUrlAttribute);if(e&&!r&&(r=this.getDefaultEmbedUrl(this.config.hostname)),"string"!=typeof r||0===r.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+t.embedUrlAttribute+"'.");return r},t.prototype.getDefaultEmbedUrl=function(e){e||(e=t.defaultEmbedHostName);var r=this.getDefaultEmbedUrlEndpoint();if(0===(e=e.toLowerCase().trim()).indexOf("http://"))throw new Error("HTTP is not allowed. HTTPS is required");return 0===e.indexOf("https://")?e+"/"+r:"https://"+e+"/"+r},t.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(t.nameAttribute)||a.createRandomString()},t.prototype.getGroupId=function(){return this.config.groupId||t.findGroupIdFromEmbedUrl(this.config.embedUrl)},t.prototype.fullscreen=function(){(this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen).call(this.iframe)},t.prototype.exitFullscreen=function(){this.isFullscreen(this.iframe)&&(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},t.prototype.isFullscreen=function(t){return["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"].some((function(e){return document[e]===t}))},t.prototype.setIframe=function(e,r,i){var o=this;if(!this.iframe){var n=document.createElement("iframe"),l=this.config.uniqueId?a.addParamToUrl(this.config.embedUrl,"uid",this.config.uniqueId):this.config.embedUrl;n.style.width="100%",n.style.height="100%",n.setAttribute("src",l),n.setAttribute("scrolling","no"),n.setAttribute("allowfullscreen","true");for(var d=this.element;d.firstChild;)d.removeChild(d.firstChild);d.appendChild(n),this.iframe=d.firstChild}if(e){if(!i){var s=this.validate(this.config);if(s)throw s}this.iframe.addEventListener("load",(function(){return o.load(o.config,r)}),!1),this.service.getNumberOfComponents()<=t.maxFrontLoadTimes&&(this.frontLoadHandler=function(){return o.frontLoadSendConfig(o.config)},this.element.addEventListener("ready",this.frontLoadHandler,!1))}else this.iframe.addEventListener("load",(function(){return o.createReport(o.createConfig)}),!1)},t.prototype.setComponentTitle=function(t){this.iframe&&(null==t?this.iframe.removeAttribute("title"):this.iframe.setAttribute("title",t))},t.prototype.setComponentTabIndex=function(t){this.element&&this.element.setAttribute("tabindex",null==t?"0":t.toString())},t.prototype.removeComponentTabIndex=function(t){this.element&&this.element.removeAttribute("tabindex")},t.findGroupIdFromEmbedUrl=function(t){var e,r=t.match(/groupId="?([^&]+)"?/);return r&&(e=r[1]),e},t.prototype.frontLoadSendConfig=function(t){if(t.accessToken){var e=this.validate(t);if(e)throw e;if(null!=this.iframe.contentWindow)return this.service.hpm.post("/frontload/config",t,{uid:this.config.uniqueId},this.iframe.contentWindow).then((function(t){return t.body}),(function(t){throw t.body}))}},t.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected","buttonClicked"],t.accessTokenAttribute="powerbi-access-token",t.embedUrlAttribute="powerbi-embed-url",t.nameAttribute="powerbi-name",t.typeAttribute="powerbi-type",t.defaultEmbedHostName="https://app.powerbi.com",t.maxFrontLoadTimes=2,t}();e.Embed=l},function(t,e){function r(t,e){if(!Array.isArray(e))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+e);var r;return e.some((function(e,a){if(t(e))return r=a,!0})),r}function a(){var t=window.crypto||window.msCrypto,e=new Uint32Array(1);return t.getRandomValues(e),e[0]}e.raiseCustomEvent=function(t,e,r){var a;"function"==typeof CustomEvent?a=new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,r),t.dispatchEvent(a)},e.findIndex=r,e.find=function(t,e){return e[r(t,e)]},e.remove=function(t,e){var a=r(t,e);e.splice(a,1)},e.assign=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=t[0];if(null==r)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(r),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var n in o)o.hasOwnProperty(n)&&(a[n]=o[n])}return a},e.createRandomString=function(){return a().toString(36).substring(1)},e.generateUUID=function(){return(new Date).getTime(),"undefined"!=typeof performance&&"function"==typeof performance.now&&performance.now(),"xxxxxxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=a()%16;return e.toString(16)}))},e.addParamToUrl=function(t,e,r){var a=t.indexOf("?")>0?"&":"?";return t+=a+e+"="+r},e.isSavedInternal=function(t,e,r){return t.get("/report/hasUnsavedChanges",{uid:e},r).then((function(t){return!t.body}),(function(t){throw t.body}))},e.isRDLEmbed=function(t){return t.toLowerCase().indexOf("/rdlembed?")>=0},e.autoAuthInEmbedUrl=function(t){return t&&decodeURIComponent(t).toLowerCase().indexOf("autoauth=true")>=0},e.getRandomValue=a},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={version:"2.11.0",type:"js"}},function(t,e,r){ /*! powerbi-models v1.3.3 | (c) 2016 Microsoft Corporation MIT */ var a;window,a=function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(a,i,function(e){return t[e]}.bind(null,i));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){var a,i,o=this&&this.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Validators=r(1).Validators,function(t){t[t.Information=0]="Information",t[t.Verbose=1]="Verbose",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.ExpectedError=4]="ExpectedError",t[t.UnexpectedError=5]="UnexpectedError",t[t.Fatal=6]="Fatal"}(e.TraceType||(e.TraceType={})),function(t){t[t.Widescreen=0]="Widescreen",t[t.Standard=1]="Standard",t[t.Cortana=2]="Cortana",t[t.Letter=3]="Letter",t[t.Custom=4]="Custom"}(e.PageSizeType||(e.PageSizeType={})),function(t){t[t.FitToPage=0]="FitToPage",t[t.FitToWidth=1]="FitToWidth",t[t.ActualSize=2]="ActualSize"}(e.DisplayOption||(e.DisplayOption={})),function(t){t[t.Default=0]="Default",t[t.Transparent=1]="Transparent"}(e.BackgroundType||(e.BackgroundType={})),function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden"}(e.VisualContainerDisplayMode||(e.VisualContainerDisplayMode={})),function(t){t[t.Master=0]="Master",t[t.Custom=1]="Custom",t[t.MobilePortrait=2]="MobilePortrait",t[t.MobileLandscape=3]="MobileLandscape"}(e.LayoutType||(e.LayoutType={})),function(t){t[t.Navigate=0]="Navigate",t[t.NavigateAndRaiseEvent=1]="NavigateAndRaiseEvent",t[t.RaiseEvent=2]="RaiseEvent"}(e.HyperlinkClickBehavior||(e.HyperlinkClickBehavior={})),function(t){t[t.AlwaysVisible=0]="AlwaysVisible",t[t.HiddenInViewMode=1]="HiddenInViewMode"}(e.SectionVisibility||(e.SectionVisibility={})),function(t){t[t.Read=0]="Read",t[t.ReadWrite=1]="ReadWrite",t[t.Copy=2]="Copy",t[t.Create=4]="Create",t[t.All=7]="All"}(e.Permissions||(e.Permissions={})),function(t){t[t.View=0]="View",t[t.Edit=1]="Edit"}(e.ViewMode||(e.ViewMode={})),function(t){t[t.Aad=0]="Aad",t[t.Embed=1]="Embed"}(e.TokenType||(e.TokenType={})),function(t){t[t.None=0]="None",t[t.HighContrast1=1]="HighContrast1",t[t.HighContrast2=2]="HighContrast2",t[t.HighContrastBlack=3]="HighContrastBlack",t[t.HighContrastWhite=4]="HighContrastWhite"}(e.ContrastMode||(e.ContrastMode={})),function(t){t[t.Bottom=0]="Bottom",t[t.Top=1]="Top"}(e.MenuLocation||(e.MenuLocation={})),function(t){t[t.Report=0]="Report",t[t.Page=1]="Page",t[t.Visual=2]="Visual"}(e.FiltersLevel||(e.FiltersLevel={})),function(t){t[t.Advanced=0]="Advanced",t[t.Basic=1]="Basic",t[t.Unknown=2]="Unknown",t[t.IncludeExclude=3]="IncludeExclude",t[t.RelativeDate=4]="RelativeDate",t[t.TopN=5]="TopN",t[t.Tuple=6]="Tuple"}(i=e.FilterType||(e.FilterType={})),function(t){t[t.Days=0]="Days",t[t.Weeks=1]="Weeks",t[t.CalendarWeeks=2]="CalendarWeeks",t[t.Months=3]="Months",t[t.CalendarMonths=4]="CalendarMonths",t[t.Years=5]="Years",t[t.CalendarYears=6]="CalendarYears"}(e.RelativeDateFilterTimeUnit||(e.RelativeDateFilterTimeUnit={})),function(t){t[t.InLast=0]="InLast",t[t.InThis=1]="InThis",t[t.InNext=2]="InNext"}(e.RelativeDateOperators||(e.RelativeDateOperators={}));var n=function(){function t(t,e){this.target=t,this.filterType=e}return t.prototype.toJSON=function(){var t={$schema:this.schemaUrl,target:this.target,filterType:this.filterType};return void 0!==this.displaySettings&&(t.displaySettings=this.displaySettings),t},t}();e.Filter=n;var l=function(t){function e(r,a,o){var n=t.call(this,r,i.Unknown)||this;return n.message=a,n.notSupportedTypeName=o,n.schemaUrl=e.schemaUrl,n}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.message=this.message,e.notSupportedTypeName=this.notSupportedTypeName,e},e.schemaUrl="http://powerbi.com/product/schema#notSupported",e}(n);e.NotSupportedFilter=l;var d=function(t){function e(r,a,o){var n=t.call(this,r,i.IncludeExclude)||this;return n.values=o,n.isExclude=a,n.schemaUrl=e.schemaUrl,n}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.isExclude=this.isExclude,e.values=this.values,e},e.schemaUrl="http://powerbi.com/product/schema#includeExclude",e}(n);e.IncludeExcludeFilter=d;var s=function(t){function e(r,a,o,n){var l=t.call(this,r,i.TopN)||this;return l.operator=a,l.itemCount=o,l.schemaUrl=e.schemaUrl,l.orderBy=n,l}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.itemCount=this.itemCount,e.orderBy=this.orderBy,e},e.schemaUrl="http://powerbi.com/product/schema#topN",e}(n);e.TopNFilter=s;var u=function(t){function e(r,a,o,n,l){var d=t.call(this,r,i.RelativeDate)||this;return d.operator=a,d.timeUnitsCount=o,d.timeUnitType=n,d.includeToday=l,d.schemaUrl=e.schemaUrl,d}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.timeUnitsCount=this.timeUnitsCount,e.timeUnitType=this.timeUnitType,e.includeToday=this.includeToday,e},e.schemaUrl="http://powerbi.com/product/schema#relativeDate",e}(n);e.RelativeDateFilter=u;var p=function(t){function e(r,a){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];var l=t.call(this,r,i.Basic)||this;if(l.operator=a,l.schemaUrl=e.schemaUrl,0===o.length&&"All"!==a)throw new Error('values must be a non-empty array unless your operator is "All".');return Array.isArray(o[0])?l.values=o[0]:l.values=o,l}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.values=this.values,e.requireSingleSelection=!!this.requireSingleSelection,e},e.schemaUrl="http://powerbi.com/product/schema#basic",e}(n);e.BasicFilter=p;var c=function(t){function e(e,r,a,i){var o=t.call(this,e,r,a)||this;o.keyValues=i,o.target=e;var n=e.keys?e.keys.length:0;if(n>0&&!i)throw new Error("You should pass the values to be filtered for each key. You passed: no values and "+n+" keys");if(0===n&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var l=0;l<o.keyValues.length;l++)if(o.keyValues[l]){var d=o.keyValues[l].length;if(d!==n)throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: "+d+" values and "+n+" keys")}return o}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.keyValues=this.keyValues,e},e}(p);e.BasicFilterWithKeys=c;var f=function(t){function e(r,a,o){var n=t.call(this,r,i.Tuple)||this;return n.operator=a,n.schemaUrl=e.schemaUrl,n.values=o,n}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.values=this.values,e.target=this.target,e},e.schemaUrl="http://powerbi.com/product/schema#tuple",e}(n);e.TupleFilter=f;var v=function(t){function e(r,a){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];var l,d=t.call(this,r,i.Advanced)||this;if(d.schemaUrl=e.schemaUrl,"string"!=typeof a||0===a.length)throw new Error("logicalOperator must be a valid operator, You passed: "+a);if(d.logicalOperator=a,0===(l=Array.isArray(o[0])?o[0]:o).length)throw new Error("conditions must be a non-empty array. You passed: "+o);if(l.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+o.length);if(1===l.length&&"And"!==a)throw new Error('Logical Operator must be "And" when there is only one condition provided');return d.conditions=l,d}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.logicalOperator=this.logicalOperator,e.conditions=this.conditions,e},e.schemaUrl="http://powerbi.com/product/schema#advanced",e}(n);function h(t){if(t.filterType)return t.filterType;var e=t,r=t;return"string"==typeof e.operator&&Array.isArray(e.values)?i.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?i.Advanced:i.Unknown}function V(t){return!(!t.table||!t.column||t.aggregationFunction)}e.AdvancedFilter=v,e.isFilterKeyColumnsTarget=function(t){return V(t)&&!!t.keys},e.isBasicFilterWithKeys=function(t){return h(t)===i.Basic&&!!t.keyValues},e.getFilterType=h,e.isMeasure=function(t){return void 0!==t.table&&void 0!==t.measure},e.isColumn=V,e.isHierarchyLevel=function(t){return!(!(t.table&&t.hierarchy&&t.hierarchyLevel)||t.aggregationFunction)},e.isHierarchyLevelAggr=function(t){return!!(t.table&&t.hierarchy&&t.hierarchyLevel&&t.aggregationFunction)},e.isColumnAggr=function(t){return!!(t.table&&t.column&&t.aggregationFunction)},function(t){t[t.Interactive=0]="Interactive",t[t.ResultOnly=1]="ResultOnly"}(e.QnaMode||(e.QnaMode={})),function(t){t[t.Summarized=0]="Summarized",t[t.Underlying=1]="Underlying"}(e.ExportDataType||(e.ExportDataType={})),function(t){t[t.Off=0]="Off",t[t.Presentation=1]="Presentation"}(e.BookmarksPlayMode||(e.BookmarksPlayMode={})),e.CommonErrorCodes={TokenExpired:"TokenExpired",NotFound:"PowerBIEntityNotFound",InvalidParameters:"Invalid parameters",LoadReportFailed:"LoadReportFailed",NotAuthorized:"PowerBINotAuthorizedException",FailedToLoadModel:"ExplorationContainer_FailedToLoadModel_DefaultDetails"},e.TextAlignment={Left:"left",Center:"center",Right:"right"},e.LegendPosition={Top:"Top",Bottom:"Bottom",Right:"Right",Left:"Left",TopCenter:"TopCenter",BottomCenter:"BottomCenter",RightCenter:"RightCenter",LeftCenter:"LeftCenter"},function(t){t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"}(e.SortDirection||(e.SortDirection={}));var y=function(){function t(t){this.$schema=t}return t.prototype.toJSON=function(){return{$schema:this.$schema}},t}();e.Selector=y;var m=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.pageName=r,a}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.pageName=this.pageName,e},e.schemaUrl="http://powerbi.com/product/schema#pageSelector",e}(y);e.PageSelector=m;var g=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.visualName=r,a}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualName=this.visualName,e},e.schemaUrl="http://powerbi.com/product/schema#visualSelector",e}(y);e.VisualSelector=g;var w=function(t){function e(e){var r=t.call(this,g.schemaUrl)||this;return r.visualType=e,r}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualType=this.visualType,e},e.schemaUrl="http://powerbi.com/product/schema#visualTypeSelector",e}(y);e.VisualTypeSelector=w;var b=function(t){function e(e){var r=t.call(this,g.schemaUrl)||this;return r.target=e,r}return o(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.target=this.target,e},e.schemaUrl="http://powerbi.com/product/schema#slicerTargetSelector",e}(y);function _(t){var e=t.message;return e||(e=t.path+" is invalid. Not meeting "+t.keyword+" constraint"),{message:e}}e.SlicerTargetSelector=b,function(t){t[t.Enabled=0]="Enabled",t[t.Disabled=1]="Disabled",t[t.Hidden=2]="Hidden"}(e.CommandDisplayOption||(e.CommandDisplayOption={})),function(t){t[t.Grouping=0]="Grouping",t[t.Measure=1]="Measure",t[t.GroupingOrMeasure=2]="GroupingOrMeasure"}(e.VisualDataRoleKind||(e.VisualDataRoleKind={})),function(t){t[t.Measure=0]="Measure",t[t.Grouping=1]="Grouping"}(e.VisualDataRoleKindPreference||(e.VisualDataRoleKindPreference={})),e.validateVisualSelector=function(t){var r=e.Validators.visualSelectorValidator.validate(t);return r?r.map(_):void 0},e.validateSlicer=function(t){var r=e.Validators.slicerValidator.validate(t);return r?r.map(_):void 0},e.validateSlicerState=function(t){var r=e.Validators.slicerStateValidator.validate(t);return r?r.map(_):void 0},e.validatePlayBookmarkRequest=function(t){var r=e.Validators.playBookmarkRequestValidator.validate(t);return r?r.map(_):void 0},e.validateAddBookmarkRequest=function(t){var r=e.Validators.addBookmarkRequestValidator.validate(t);return r?r.map(_):void 0},e.validateApplyBookmarkByNameRequest=function(t){var r=e.Validators.applyBookmarkByNameRequestValidator.validate(t);return r?r.map(_):void 0},e.validateApplyBookmarkStateRequest=function(t){var r=e.Validators.applyBookmarkStateRequestValidator.validate(t);return r?r.map(_):void 0},e.validateSettings=function(t){var r=e.Validators.settingsValidator.validate(t);return r?r.map(_):void 0},e.validateCustomPageSize=function(t){var r=e.Validators.customPageSizeValidator.validate(t);return r?r.map(_):void 0},e.validateExtension=function(t){var r=e.Validators.extensionValidator.validate(t);return r?r.map(_):void 0},e.validateReportLoad=function(t){var r=e.Validators.reportLoadValidator.validate(t);return r?r.map(_):void 0},e.validateCreateReport=function(t){var r=e.Validators.reportCreateValidator.validate(t);return r?r.map(_):void 0},e.validateDashboardLoad=function(t){var r=e.Validators.dashboardLoadValidator.validate(t);return r?r.map(_):void 0},e.validateTileLoad=function(t){var r=e.Validators.tileLoadValidator.validate(t);return r?r.map(_):void 0},e.validatePage=function(t){var r=e.Validators.pageValidator.validate(t);return r?r.map(_):void 0},e.validateFilter=function(t){var r=e.Validators.filtersValidator.validate(t);return r?r.map(_):void 0},e.validateSaveAsParameters=function(t){var r=e.Validators.saveAsParametersValidator.validate(t);return r?r.map(_):void 0},e.validateLoadQnaConfiguration=function(t){var r=e.Validators.loadQnaValidator.validate(t);return r?r.map(_):void 0},e.validateQnaInterpretInputData=function(t){var r=e.Validators.qnaInterpretInputDataValidator.validate(t);return r?r.map(_):void 0},e.validateExportDataRequest=function(t){var r=e.Validators.exportDataRequestValidator.validate(t);return r?r.map(_):void 0},e.validateVisualHeader=function(t){var r=e.Validators.visualHeaderValidator.validate(t);return r?r.map(_):void 0},e.validateVisualSettings=function(t){var r=e.Validators.visualSettingsValidator.validate(t);return r?r.map(_):void 0},e.validateCommandsSettings=function(t){var r=e.Validators.commandsSettingsValidator.validate(t);return r?r.map(_):void 0},e.validateCustomTheme=function(t){var r=e.Validators.customThemeValidator.validate(t);return r?r.map(_):void 0}},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),i=r(3),o=r(5),n=r(6),l=r(7),d=r(8),s=r(9),u=r(10),p=r(11),c=r(12),f=r(13),v=r(14),h=r(15),V=r(16),y=r(17),m=r(18),g=r(19),w=r(20),b=r(21),_=r(22),O=r(23),S=r(24),T=r(25);e.Validators={addBookmarkRequestValidator:new n.AddBookmarkRequestValidator,advancedFilterTypeValidator:new a.EnumValidator([0]),advancedFilterValidator:new l.AdvancedFilterValidator,anyArrayValidator:new a.ArrayValidator([new s.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator])]),anyFilterValidator:new s.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.IncludeExcludeFilterValidator,new l.NotSupportedFilterValidator,new l.RelativeDateFilterValidator,new l.TopNFilterValidator]),anyValueValidator:new s.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator]),applyBookmarkByNameRequestValidator:new n.ApplyBookmarkByNameRequestValidator,applyBookmarkStateRequestValidator:new n.ApplyBookmarkStateRequestValidator,applyBookmarkValidator:new s.AnyOfValidator([new n.ApplyBookmarkByNameRequestValidator,new n.ApplyBookmarkStateRequestValidator]),backgroundValidator:new a.EnumValidator([0,1]),basicFilterTypeValidator:new a.EnumValidator([1]),basicFilterValidator:new l.BasicFilterValidator,booleanArrayValidator:new a.BooleanArrayValidator,booleanValidator:new a.BooleanValidator,commandDisplayOptionValidator:new a.EnumValidator([0,1,2]),commandExtensionSelectorValidator:new s.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),commandExtensionValidator:new i.CommandExtensionValidator,commandsSettingsArrayValidator:new a.ArrayValidator([new O.CommandsSettingsValidator]),commandsSettingsValidator:new O.CommandsSettingsValidator,conditionItemValidator:new l.ConditionItemValidator,contrastModeValidator:new a.EnumValidator([0,1,2,3,4]),customLayoutDisplayOptionValidator:new a.EnumValidator([0,1,2]),customLayoutValidator:new m.CustomLayoutValidator,customPageSizeValidator:new v.CustomPageSizeValidator,customThemeValidator:new S.CustomThemeValidator,dashboardLoadValidator:new c.DashboardLoadValidator,datasetBindingValidator:new T.DatasetBindingValidator,displayStateModeValidator:new a.EnumValidator([0,1]),displayStateValidator:new m.DisplayStateValidator,exportDataRequestValidator:new g.ExportDataRequestValidator,extensionArrayValidator:new a.ArrayValidator([new i.ExtensionValidator]),extensionPointsValidator:new i.ExtensionPointsValidator,extensionValidator:new i.ExtensionValidator,fieldRequiredValidator:new d.FieldRequiredValidator,filterColumnTargetValidator:new l.FilterColumnTargetValidator,filterConditionsValidator:new a.ArrayValidator([new l.ConditionItemValidator]),filterHierarchyTargetValidator:new l.FilterHierarchyTargetValidator,filterMeasureTargetValidator:new l.FilterMeasureTargetValidator,filterTargetValidator:new s.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator]),filtersArrayValidator:new a.ArrayValidator([new s.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.RelativeDateFilterValidator])]),filtersValidator:new l.FilterValidator,hyperlinkClickBehaviorValidator:new a.EnumValidator([0,1,2]),includeExcludeFilterValidator:new l.IncludeExcludeFilterValidator,includeExludeFilterTypeValidator:new a.EnumValidator([3]),layoutTypeValidator:new a.EnumValidator([0,1,2,3]),loadQnaValidator:new h.LoadQnaValidator,menuExtensionValidator:new i.MenuExtensionValidator,menuLocationValidator:new a.EnumValidator([0,1]),notSupportedFilterTypeValidator:new a.EnumValidator([2]),notSupportedFilterValidator:new l.NotSupportedFilterValidator,numberArrayValidator:new a.NumberArrayValidator,numberValidator:new a.NumberValidator,pageLayoutValidator:new y.MapValidator([new a.StringValidator],[new m.VisualLayoutValidator]),pageSizeTypeValidator:new a.EnumValidator([0,1,2,3,4,5]),pageSizeValidator:new v.PageSizeValidator,pageValidator:new v.PageValidator,pageViewFieldValidator:new v.PageViewFieldValidator,pagesLayoutValidator:new y.MapValidator([new a.StringValidator],[new m.PageLayoutValidator]),permissionsValidator:new a.EnumValidator([0,1,2,4,7]),playBookmarkRequestValidator:new n.PlayBookmarkRequestValidator,qnaInterpretInputDataValidator:new h.QnaInterpretInputDataValidator,qnaSettingValidator:new h.QnaSettingsValidator,relativeDateFilterOperatorValidator:new a.EnumValidator([0,1,2]),relativeDateFilterTimeUnitTypeValidator:new a.EnumValidator([0,1,2,3,4,5,6]),relativeDateFilterTypeValidator:new a.EnumValidator([4]),relativeDateFilterValidator:new l.RelativeDateFilterValidator,reportCreateValidator:new p.ReportCreateValidator,reportLoadValidator:new u.ReportLoadValidator,saveAsParametersValidator:new V.SaveAsParametersValidator,settingsValidator:new o.SettingsValidator,singleCommandSettingsValidator:new O.SingleCommandSettingsValidator,slicerSelectorValidator:new s.AnyOfValidator([new w.VisualSelectorValidator,new w.SlicerTargetSelectorValidator]),slicerStateValidator:new b.SlicerStateValidator,slicerTargetValidator:new s.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator,new l.FilterKeyColumnsTargetValidator,new l.FilterKeyHierarchyTargetValidator]),slicerValidator:new b.SlicerValidator,stringArrayValidator:new a.StringArrayValidator,stringValidator:new a.StringValidator,tileLoadValidator:new f.TileLoadValidator,tokenTypeValidator:new a.EnumValidator([0,1]),topNFilterTypeValidator:new a.EnumValidator([5]),topNFilterValidator:new l.TopNFilterValidator,viewModeValidator:new a.EnumValidator([0,1]),visualCommandSelectorValidator:new s.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSelectorValidator:new s.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSettingsValidator:new _.VisualHeaderSettingsValidator,visualHeaderValidator:new _.VisualHeaderValidator,visualHeadersValidator:new a.ArrayValidator([new _.VisualHeaderValidator]),visualLayoutValidator:new m.VisualLayoutValidator,visualSelectorValidator:new w.VisualSelectorValidator,visualSettingsValidator:new _.VisualSettingsValidator,visualTypeSelectorValidator:new w.VisualTypeSelectorValidator}},function(t,e){var r,a=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?null:"object"!=typeof t||Array.isArray(t)?[{message:void 0!==r?r+" must be an object":"input must be an object",path:e,keyword:"type"}]:null},t}();e.ObjectValidator=i;var o=function(){function t(t){this.itemValidators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;if(!Array.isArray(t))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];for(var a=0;a<t.length;a++)for(var i=(e?e+".":"")+r+"."+a,o=0,n=this.itemValidators;o<n.length;o++)if(n[o].validate(t[a],i,r))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];return null},t}();e.ArrayValidator=o;var n=function(){function t(t){this.expectedType=t}return t.prototype.validate=function(t,e,r){return null==t?null:typeof t!==this.expectedType?[{message:r+" must be a "+this.expectedType,path:(e?e+".":"")+r,keyword:"type"}]:null},t}();e.TypeValidator=n;var l=function(t){function e(){return t.call(this,"string")||this}return a(e,t),e}(n);e.StringValidator=l;var d=function(t){function e(){return t.call(this,"boolean")||this}return a(e,t),e}(n);e.BooleanValidator=d;var s=function(t){function e(){return t.call(this,"number")||this}return a(e,t),e}(n);e.NumberValidator=s;var u=function(){function t(t){this.possibleValues=t}return t.prototype.validate=function(t,e,r){return null==t?null:this.possibleValues.indexOf(t)<0?[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"invalid"}]:null},t}();e.ValueValidator=u;var p=function(t){function e(e){var r=t.call(this,[e])||this;return r.schemaValue=e,r}return a(e,t),e.prototype.validate=function(e,r,a){return t.prototype.validate.call(this,e,r,a)},e}(u);e.SchemaValidator=p;var c=function(t){function e(e){var r=t.call(this)||this;return r.possibleValues=e,r}return a(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);return i||new u(this.possibleValues).validate(e,r,a)},e}(s);e.EnumValidator=c;var f=function(t){function e(){return t.call(this,[new l])||this}return a(e,t),e.prototype.validate=function(e,r,a){return t.prototype.validate.call(this,e,r,a)?[{message:a+" must be an array of strings",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(o);e.StringArrayValidator=f;var v=function(t){function e(){return t.call(this,[new d])||this}return a(e,t),e.prototype.validate=function(e,r,a){return t.prototype.validate.call(this,e,r,a)?[{message:a+" must be an array of booleans",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(o);e.BooleanArrayValidator=v;var h=function(t){function e(){return t.call(this,[new s])||this}return a(e,t),e.prototype.validate=function(e,r,a){return t.prototype.validate.call(this,e,r,a)?[{message:a+" must be an array of numbers",path:(r?r+".":"")+a,keyword:"type"}]:null},e}(o);e.NumberArrayValidator=h},function(t,e,r){var a,i=this&&this.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),n=r(4),l=r(2),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"title",validators:[o.Validators.stringValidator]},{field:"icon",validators:[o.Validators.stringValidator]},{field:"menuLocation",validators:[o.Validators.menuLocationValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(l.ObjectValidator);e.MenuExtensionValidator=d;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"visualContextMenu",validators:[o.Validators.menuExtensionValidator]},{field:"visualOptionsMenu",validators:[o.Validators.menuExtensionValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(l.ObjectValidator);e.ExtensionPointsValidator=s;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"name",validators:[o.Validators.fieldRequiredValidator,o.Validators.stringValidator]},{field:"extend",validators:[o.Validators.fieldRequiredValidator,o.Validators.extensionPointsValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(l.ObjectValidator);e.ExtensionItemValidator=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"title",validators:[o.Validators.fieldRequiredValidator,o.Validators.stringValidator]},{field:"icon",validators:[o.Validators.stringValidator]},{field:"selector",validators:[o.Validators.commandExtensionSelectorValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(u);e.CommandExtensionValidator=p;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"command",validators:[o.Validators.commandExtensionValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(l.ObjectValidator);e.ExtensionValidator=c},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.fieldValidatorsPairs=t}return t.prototype.validate=function(t,e,r){if(!this.fieldValidatorsPairs)return null;for(var a=e?e+"."+r:r,i=0,o=this.fieldValidatorsPairs;i<o.length;i++)for(var n=o[i],l=0,d=n.validators;l<d.length;l++){var s=d[l].validate(t[n.field],a,n.field);if(s)return s}return null},t}();e.MultipleFieldsValidator=r},function(t,e,r){var a,i=this&&this.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),n=r(4),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.validate=function(e,r,a){if(null==e)return null;var i=t.prototype.validate.call(this,e,r,a);if(i)return i;var l=[{field:"filterPaneEnabled",validators:[o.Validators.booleanValidator]},{field:"navContentPaneEnabled",validators:[o.Validators.booleanValidator]},{field:"bookmarksPaneEnabled",validators:[o.Validators.booleanValidator]},{field:"useCustomSaveAsDialog",validators:[o.Validators.booleanValidator]},{field:"extensions",validators:[o.Validators.extensionArrayValidator]},{field:"layoutType",validators:[o.Validators.layoutTypeValidator]},{field:"customLayout",validators:[o.Validators.customLayoutValidator]},{field:"background",validators:[o.Validators.backgroundValidator]},{field:"visualSettings",validators:[o.Validators.visualSettingsValidator]},{field:"hideErrors",validators:[o.Validators.booleanValidator]},{field:"commands",validators:[o.Validators.commandsSettingsArrayValidator]},{field:"hyperlinkClickBehavior",validators:[o.Validators.hyperlinkClickBehaviorValidator]}];return new n.MultipleFieldsValidator(l).validate(e,r,a)},e}(r(2).ObjectValidator);e.SettingsValidator=l},function(t,e,r){var a,i=this&&this.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null