crm-sdk
Version:
Javasript Software Development Kit for Microsoft Dynamics CE Web API
2 lines • 76.9 kB
JavaScript
/*! CRM SDK 4.0.9 | (c) HSO Innovation */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WebAPI",[],e):"object"==typeof exports?exports.WebAPI=e():t.WebAPI=e()}("undefined"!=typeof window?window:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=153)}([function(t,e,n){var r=n(50)("wks"),o=n(26),i=n(2).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e,n){n(72)("asyncIterator")},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";var r=n(2),o=n(15),i=n(12),u=n(10),c=n(18),a=n(40).KEY,s=n(11),f=n(50),l=n(29),p=n(26),h=n(0),y=n(73),v=n(72),d=n(103),b=n(76),m=n(9),g=n(4),w=n(27),_=n(46),x=n(38),O=n(68),E=n(105),S=n(57),P=n(14),j=n(30),k=S.f,R=P.f,L=E.f,T=r.Symbol,A=r.JSON,M=A&&A.stringify,N=h("_hidden"),C=h("toPrimitive"),D={}.propertyIsEnumerable,q=f("symbol-registry"),I=f("symbols"),W=f("op-symbols"),F=Object.prototype,B="function"==typeof T,U=r.QObject,G=!U||!U.prototype||!U.prototype.findChild,X=i&&s(function(){return 7!=O(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=k(F,e);r&&delete F[e],R(t,e,n),r&&t!==F&&R(F,e,r)}:R,H=function(t){var e=I[t]=O(T.prototype);return e._k=t,e},V=B&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},$=function(t,e,n){return t===F&&$(W,e,n),m(t),e=_(e,!0),m(n),o(I,e)?(n.enumerable?(o(t,N)&&t[N][e]&&(t[N][e]=!1),n=O(n,{enumerable:x(0,!1)})):(o(t,N)||R(t,N,x(1,{})),t[N][e]=!0),X(t,e,n)):R(t,e,n)},J=function(t,e){m(t);for(var n,r=d(e=w(e)),o=0,i=r.length;i>o;)$(t,n=r[o++],e[n]);return t},K=function(t){var e=D.call(this,t=_(t,!0));return!(this===F&&o(I,t)&&!o(W,t))&&(!(e||!o(this,t)||!o(I,t)||o(this,N)&&this[N][t])||e)},z=function(t,e){if(t=w(t),e=_(e,!0),t!==F||!o(I,e)||o(W,e)){var n=k(t,e);return!n||!o(I,e)||o(t,N)&&t[N][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=L(w(t)),r=[],i=0;n.length>i;)o(I,e=n[i++])||e==N||e==a||r.push(e);return r},Y=function(t){for(var e,n=t===F,r=L(n?W:w(t)),i=[],u=0;r.length>u;)!o(I,e=r[u++])||n&&!o(F,e)||i.push(I[e]);return i};B||(c((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(W,n),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),X(this,t,x(1,n))};return i&&G&&X(F,t,{configurable:!0,set:e}),H(t)}).prototype,"toString",function(){return this._k}),S.f=z,P.f=$,n(56).f=E.f=Q,n(41).f=K,n(55).f=Y,i&&!n(25)&&c(F,"propertyIsEnumerable",K,!0),y.f=function(t){return H(h(t))}),u(u.G+u.W+u.F*!B,{Symbol:T});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)h(Z[tt++]);for(var et=j(h.store),nt=0;et.length>nt;)v(et[nt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return o(q,t+="")?q[t]:q[t]=T(t)},keyFor:function(t){if(!V(t))throw TypeError(t+" is not a symbol!");for(var e in q)if(q[e]===t)return e},useSetter:function(){G=!0},useSimple:function(){G=!1}}),u(u.S+u.F*!B,"Object",{create:function(t,e){return void 0===e?O(t):J(O(t),e)},defineProperty:$,defineProperties:J,getOwnPropertyDescriptor:z,getOwnPropertyNames:Q,getOwnPropertySymbols:Y}),A&&u(u.S+u.F*(!B||s(function(){var t=T();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(g(e)||void 0!==t)&&!V(t))return b(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!V(e))return e}),r[1]=e,M.apply(A,r)}}),T.prototype[C]||n(13)(T.prototype,C,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";var r,o,i,u,c=n(25),a=n(2),s=n(24),f=n(47),l=n(10),p=n(4),h=n(39),y=n(42),v=n(58),d=n(69),b=n(79).set,m=n(108)(),g=n(80),w=n(109),_=n(110),x=n(111),O=a.TypeError,E=a.process,S=E&&E.versions,P=S&&S.v8||"",j=a.Promise,k="process"==f(E),R=function(){},L=o=g.f,T=!!function(){try{var t=j.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(R,R)};return(k||"function"==typeof PromiseRejectionEvent)&&t.then(R)instanceof e&&0!==P.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(t){}}(),A=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;m(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u,c=o?e.ok:e.fail,a=e.resolve,s=e.reject,f=e.domain;try{c?(o||(2==t._h&&D(t),t._h=1),!0===c?n=r:(f&&f.enter(),n=c(r),f&&(f.exit(),u=!0)),n===e.promise?s(O("Promise-chain cycle")):(i=A(n))?i.call(n,a,s):a(n)):s(r)}catch(t){f&&!u&&f.exit(),s(t)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&N(t)})}},N=function(t){b.call(a,function(){var e,n,r,o=t._v,i=C(t);if(i&&(e=w(function(){k?E.emit("unhandledRejection",o,t):(n=a.onunhandledrejection)?n({promise:t,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=k||C(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},C=function(t){return 1!==t._h&&0===(t._a||t._c).length},D=function(t){b.call(a,function(){var e;k?E.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},q=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},I=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw O("Promise can't be resolved itself");(e=A(t))?m(function(){var r={_w:n,_d:!1};try{e.call(t,s(I,r,1),s(q,r,1))}catch(t){q.call(r,t)}}):(n._v=t,n._s=1,M(n,!1))}catch(t){q.call({_w:n,_d:!1},t)}}};T||(j=function(t){y(this,j,"Promise","_h"),h(t),r.call(this);try{t(s(I,this,1),s(q,this,1))}catch(t){q.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(43)(j.prototype,{then:function(t,e){var n=L(d(this,j));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=k?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=s(I,t,1),this.reject=s(q,t,1)},g.f=L=function(t){return t===j||t===u?new i(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:j}),n(29)(j,"Promise"),n(96)("Promise"),u=n(23).Promise,l(l.S+l.F*!T,"Promise",{reject:function(t){var e=L(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(c||!T),"Promise",{resolve:function(t){return x(c&&this===u?j:this,t)}}),l(l.S+l.F*!(T&&n(70)(function(t){j.all(t).catch(R)})),"Promise",{all:function(t){var e=this,n=L(e),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,u=1;v(t,!1,function(t){var c=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[c]=t,--u||r(n))},o)}),--u||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=L(e),r=n.reject,o=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e,n){var r=n(10);r(r.S,"Object",{setPrototypeOf:n(78).set})},function(t,e,n){"use strict";n.r(e);n(1),n(3),n(5),n(6),n(86),n(63),n(8),n(33),n(34),n(97),n(98);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var u=t.apply(e,n);function c(t){o(u,r,i,c,a,"next",t)}function a(t){o(u,r,i,c,a,"throw",t)}c(void 0)})}}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),c(this,a(n).apply(this,arguments))}var r,o,f,l,p;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(n,t),r=n,o=null,f=[{key:"executeAction",value:(p=i(regeneratorRuntime.mark(function t(e,n,r,o){var i=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=4;break}return t.abrupt("return",this.executeBoundAction.apply(this,i));case 4:return t.abrupt("return",this.executeUnboundAction.apply(this,i));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return p.apply(this,arguments)})},{key:"executeBoundAction",value:(l=i(regeneratorRuntime.mark(function t(e,n,r,o){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(r);case 2:return i=t.sent,t.abrupt("return",this.requestAndReturnBody("POST","".concat(i,"(").concat(o,")/Microsoft.Dynamics.CRM.").concat(e),n));case 4:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return l.apply(this,arguments)})},{key:"executeUnboundAction",value:function(t,e){return this.requestAndReturnBody("POST","".concat(t),e)}}],o&&u(r.prototype,o),f&&u(r,f),n}()};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function h(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){p(i,r,o,u,c,"next",t)}function c(t){p(i,r,o,u,c,"throw",t)}u(void 0)})}}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var m=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),v(this,d(n).apply(this,arguments))}var r,o,i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(n,t),r=n,o=null,i=[{key:"associateEntities",value:(c=h(regeneratorRuntime.mark(function t(e,n,r,o,i){var u,c,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return u=t.sent,c=this.webAPIPath,a={"@odata.id":"".concat(c,"/").concat(o,"(").concat(i,")")},t.abrupt("return",this.requestAndReturnBody("POST","".concat(u,"(").concat(n,")/").concat(r,"/$ref"),a));case 6:case"end":return t.stop()}},t,this)})),function(t,e,n,r,o){return c.apply(this,arguments)})},{key:"disassociateEntities",value:(u=h(regeneratorRuntime.mark(function t(e,n,r){var o,i,u,c=arguments;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=c.length>3&&void 0!==c[3]?c[3]:"",t.next=3,this.getEntitySetName(e);case 3:return i=t.sent,u="",o&&(u="(".concat(o,")")),t.abrupt("return",this.requestAndReturnBody("DELETE","".concat(i,"(").concat(n,")/").concat(r).concat(u,"/$ref")));case 7:case"end":return t.stop()}},t,this)})),function(t,e,n){return u.apply(this,arguments)})}],o&&y(r.prototype,o),i&&y(r,i),n}()},g=n(65),w=n(35);function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function O(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){x(i,r,o,u,c,"next",t)}function c(t){x(i,r,o,u,c,"throw",t)}u(void 0)})}}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function S(t,e){return!e||"object"!==_(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function P(t){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function j(t,e){return(j=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var k=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),S(this,P(n).apply(this,arguments))}var r,o,i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&j(t,e)}(n,t),r=n,o=null,i=[{key:"createRecord",value:(c=O(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.createRecord(e,n));case 4:return t.next=6,this.getEntitySetName(e);case 6:return r=t.sent,t.next=9,this.requestAndReturnBody("POST","".concat(r),n,{Prefer:"return=representation"});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)})),function(t,e){return c.apply(this,arguments)})},{key:"createEntity",value:(u=O(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.createRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return r=t.sent,t.next=6,this.requestAndReturnBody("POST","".concat(r),n,{Prefer:"return=representation"});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}},t,this)})),function(t,e){return u.apply(this,arguments)})},{key:"getEntityIdFromHeader",value:function(t){return/\(([^)]+)\)/.exec(t)[1]}}],o&&E(r.prototype,o),i&&E(r,i),n}()};function R(t){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function T(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){L(i,r,o,u,c,"next",t)}function c(t){L(i,r,o,u,c,"throw",t)}u(void 0)})}}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function M(t,e){return!e||"object"!==R(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function N(t){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t,e){return(C=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var D=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),M(this,N(n).apply(this,arguments))}var r,o,i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)}(n,t),r=n,o=null,i=[{key:"deleteRecord",value:(c=T(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.deleteRecord(e,n));case 4:return t.next=6,this.getEntitySetName(e);case 6:return r=t.sent,t.abrupt("return",this.request("DELETE","".concat(r,"(").concat(n,")")));case 8:case"end":return t.stop()}},t,this)})),function(t,e){return c.apply(this,arguments)})},{key:"deleteEntity",value:(u=T(regeneratorRuntime.mark(function t(e,n){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.deleteRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return r=t.sent,t.abrupt("return",this.request("DELETE","".concat(r,"(").concat(n,")")));case 5:case"end":return t.stop()}},t,this)})),function(t,e){return u.apply(this,arguments)})}],o&&A(r.prototype,o),i&&A(r,i),n}()};function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function F(t,e){return!e||"object"!==q(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function B(t){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function U(t,e){return(U=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var G=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),F(this,B(n).apply(this,arguments))}var r,o,i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&U(t,e)}(n,t),r=n,o=null,i=[{key:"executeFunction",value:function(t,e,n){return e?this.executeBoundFunction.apply(this,arguments):this.executeUnboundFunction.apply(this,arguments)}},{key:"executeBoundFunction",value:(u=regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(n);case 2:return o=t.sent,t.abrupt("return",this.requestAndReturnBody("GET","".concat(o,"(").concat(r,")/Microsoft.Dynamics.CRM.").concat(e)));case 4:case"end":return t.stop()}},t,this)}),c=function(){var t=this,e=arguments;return new Promise(function(n,r){var o=u.apply(t,e);function i(t){I(o,n,r,i,c,"next",t)}function c(t){I(o,n,r,i,c,"throw",t)}i(void 0)})},function(t,e,n){return c.apply(this,arguments)})},{key:"executeUnboundFunction",value:function(t){return this.requestAndReturnBody("GET","".concat(t))}}],o&&W(r.prototype,o),i&&W(r,i),n}()},X=n(22);n(59),n(60);function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function $(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){V(i,r,o,u,c,"next",t)}function c(t){V(i,r,o,u,c,"throw",t)}u(void 0)})}}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function K(t,e){return!e||"object"!==H(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Q(t,e){return(Q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Y=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),K(this,z(n).apply(this,arguments))}var r,o,i,u,c,a,s,f,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Q(t,e)}(n,t),r=n,o=null,i=[{key:"retrieveRecord",value:(l=$(regeneratorRuntime.mark(function t(e,n,r){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.retrieveRecord(e,n,r));case 4:return t.abrupt("return",this.retrieveEntity(e,n,r.substr(1)));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return l.apply(this,arguments)})},{key:"retrieveEntity",value:(f=$(regeneratorRuntime.mark(function t(e,n,r,o){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return i=t.sent,t.abrupt("return",this.retrieveEntitySet(i,n,r,o));case 4:case"end":return t.stop()}},t,this)})),function(t,e,n,r){return f.apply(this,arguments)})},{key:"retrieveEntitySet",value:function(t,e,n,r){var o=this.buildQueryString(n),i=e?this.parseEntityId(e):null,u="".concat(t);return i&&(u+="(".concat(i,")")),u+="".concat(o),this.requestAndReturnBody("GET",u,null,r)}},{key:"retrieveMultipleRecords",value:(s=$(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.retrieveMultipleRecords(e,n,r));case 4:return o=r?{Prefer:"odata.maxpagesize=".concat(r)}:{},t.abrupt("return",this.retrieveMultiple(e,n.substr(1),o));case 6:case"end":return t.stop()}},t,this)})),function(t,e,n){return s.apply(this,arguments)})},{key:"retrieveMultiple",value:(a=$(regeneratorRuntime.mark(function t(e,n,r){var o,i,u=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return o=t.sent,i=this.buildQueryString(n),t.abrupt("return",this.requestAndReturnBody("GET","".concat(o).concat(i),null,r).then(function(){var t=$(regeneratorRuntime.mark(function t(e){var n,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r&&r.Prefer&&r.Prefer.includes("odata.maxpagesize"),!e["@odata.nextLink"]||n){t.next=7;break}return t.next=4,u.requestNextLinks(e["@odata.nextLink"]);case 4:o=t.sent,e.value=e.value.concat(o),delete e["@odata.nextLink"];case 7:return t.abrupt("return",e);case 8:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return a.apply(this,arguments)})},{key:"requestNextLinks",value:function(t){var e,n=this,r=[];return this.requestAndReturnBody("GET",decodeURI(t)).then((e=$(regeneratorRuntime.mark(function t(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.value,!e["@odata.nextLink"]){t.next=7;break}return t.t0=r,t.next=5,n.requestNextLinks(e["@odata.nextLink"]);case 5:t.t1=t.sent,r=t.t0.concat.call(t.t0,t.t1);case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}},t,this)})),function(t){return e.apply(this,arguments)}))}},{key:"executeFetchXml",value:(c=$(regeneratorRuntime.mark(function t(e,n){var r,o=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return r=t.sent,t.abrupt("return",this.requestAndReturnBody("GET","".concat(r,"?fetchXml=").concat(n)).then(function(){var t=$(regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e["@odata.nextLink"]){t.next=6;break}return t.next=3,o.requestNextLinks(e["@odata.nextLink"]);case 3:n=t.sent,e.value=e.value.concat(n),delete e["@odata.nextLink"];case 6:return t.abrupt("return",e);case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()));case 4:case"end":return t.stop()}},t,this)})),function(t,e){return c.apply(this,arguments)})},{key:"count",value:(u=$(regeneratorRuntime.mark(function t(e){var n,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntitySetName(e);case 2:return n=t.sent,t.next=5,this.requestAndReturnBody("GET","".concat(n,"/$count"));case 5:return r=t.sent,t.abrupt("return",r);case 7:case"end":return t.stop()}},t,this)})),function(t){return u.apply(this,arguments)})}],o&&J(r.prototype,o),i&&J(r,i),n}()},Z=(n(91),n(93));function tt(t){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function nt(t,e){return!e||"object"!==tt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function rt(t){return(rt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ot(t,e){return(ot=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var it=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),nt(this,rt(n).apply(this,arguments))}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ot(t,e)}(n,t),r=n,i=[{key:"request",value:function(t,e,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=this.webAPIPath,u=this.bearer?Object.assign({},o,{Authorization:"Bearer ".concat(this.bearer)}):o;return r=0===e.indexOf("http")?e:"".concat(i,"/").concat(e),Object(Z.a)(r,t,n,u)}},{key:"requestAndReturnBody",value:function(t,e,n,r){return this.request(t,e,n,r).then(function(t){return t.body})}},{key:"requestAndReturnHeader",value:function(t,e,n,r){return this.request(t,e,n).then(function(t){return t.getResponseHeader(r)})}}],(o=null)&&et(r.prototype,o),i&&et(r,i),n}()};function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ct(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function at(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){ct(i,r,o,u,c,"next",t)}function c(t){ct(i,r,o,u,c,"throw",t)}u(void 0)})}}function st(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ft(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function lt(t){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pt(t,e){return(pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ht=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),ft(this,lt(n).apply(this,arguments))}var r,o,i,u,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pt(t,e)}(n,t),r=n,o=null,i=[{key:"updateRecord",value:(c=at(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof window||!window.Xrm||!window.Xrm.WebApi){t.next=4;break}return t.abrupt("return",window.Xrm.WebApi.updateRecord(e,n,r));case 4:return t.next=6,this.getEntitySetName(e);case 6:return o=t.sent,t.abrupt("return",this.request("PATCH","".concat(o,"(").concat(n,")"),r));case 8:case"end":return t.stop()}},t,this)})),function(t,e,n){return c.apply(this,arguments)})},{key:"updateEntity",value:(u=at(regeneratorRuntime.mark(function t(e,n,r){var o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Deprecated: use WebApi.updateRecord instead"),t.next=3,this.getEntitySetName(e);case 3:return o=t.sent,t.abrupt("return",this.request("PATCH","".concat(o,"(").concat(n,")"),r));case 5:case"end":return t.stop()}},t,this)})),function(t,e,n){return u.apply(this,arguments)})}],o&&st(r.prototype,o),i&&st(r,i),n}()};function yt(t){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vt(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bt(t,e){return!e||"object"!==yt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mt(t){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gt(t,e){return(gt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"WebAPI",function(){return _t});var wt=new WeakMap;"undefined"!=typeof window&&void 0===window.Xrm&&void 0!==window.parent.Xrm&&(window.Xrm=window.parent.Xrm);var _t=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),bt(this,mt(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&>(t,e)}(e,f(m(k(D(G(Y(it(ht(g["a"]))))))))),n=e,r=null,o=[{key:"getEntityDefinitions",value:function(t){return X.a.getEntityDefinitions(t)}},{key:"getEntitySetName",value:function(){var t,e=(t=regeneratorRuntime.mark(function t(e){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntityDefinitions(e);case 2:return n=t.sent,t.abrupt("return",n.EntitySetName);case 4:case"end":return t.stop()}},t,this)}),function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){vt(i,r,o,u,c,"next",t)}function c(t){vt(i,r,o,u,c,"throw",t)}u(void 0)})});return function(t){return e.apply(this,arguments)}}()},{key:"getOptionSet",value:function(t,e){return X.a.getOptionSet(t,e)}},{key:"parseEntityId",value:function(t){var e=t;if("object"===yt(t)){var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push("".concat(r,"='").concat(t[r],"'"));e=n.join(",")}else t.startsWith("{")&&t.endsWith("}")&&(e=e.substr(1,e.length-2));return e}},{key:"buildQueryString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[];if("string"==typeof t)e.push(t);else{var n;if(t.select)n="object"===yt(t.select)?t.select.join(","):t.select,e.push("$select=".concat(n));t.top&&e.push("$top=".concat(t.top)),t.count&&e.push("$count=".concat(t.count))}return e.length?"?"+e.join("&"):""}},{key:"webAPIPath",get:function(){var t=w.a.version;return"".concat(w.a.clientUrl,"/api/data/").concat(t)}},{key:"bearer",get:function(){return wt.get(this)},set:function(t){wt.set(this,t)}}],r&&dt(n.prototype,r),o&&dt(n,o),e}();e.default=_t;"function"==typeof define&&define(function(){return _t})},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",s="object"==typeof t,f=e.regeneratorRuntime;if(f)s&&(t.exports=f);else{(f=e.regeneratorRuntime=s?t.exports:{}).wrap=w;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",v={},d={};d[u]=function(){return this};var b=Object.getPrototypeOf,m=b&&b(b(T([])));m&&m!==r&&o.call(m,u)&&(d=m);var g=E.prototype=x.prototype=Object.create(d);O.prototype=g.constructor=E,E.constructor=O,E[a]=O.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===O||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},f.awrap=function(t){return{__await:t}},S(P.prototype),P.prototype[c]=function(){return this},f.AsyncIterator=P,f.async=function(t,e,n,r){var o=new P(w(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(g),g[a]="Generator",g[u]=function(){return this},g.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=T,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return c.type="throw",c.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(a&&s){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function w(t,e,n,r){var o=e&&e.prototype instanceof x?e:x,i=Object.create(o.prototype),u=new L(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===y){if("throw"===o)throw i;return A()}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var a=_(t,e,n);if("normal"===a.type){if(r=n.done?y:p,a.arg===v)continue;return{value:a.arg,done:n.done}}"throw"===a.type&&(r=y,n.method="throw",n.arg=a.arg)}}}(t,n,u),i}function _(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function x(){}function O(){}function E(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function P(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,u){var c=_(t[n],t,r);if("throw"!==c.type){var a=c.arg,s=a.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){e("next",t,i,u)},function(t){e("throw",t,i,u)}):Promise.resolve(s).then(function(t){a.value=t,i(a)},u)}u(c.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function j(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,j(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=_(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}return{next:A}}function A(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(2),o=n(23),i=n(13),u=n(18),c=n(24),a=function(t,e,n){var s,f,l,p,h=t&a.F,y=t&a.G,v=t&a.S,d=t&a.P,b=t&a.B,m=y?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,g=y?o:o[e]||(o[e]={}),w=g.prototype||(g.prototype={});for(s in y&&(n=e),n)l=((f=!h&&m&&void 0!==m[s])?m:n)[s],p=b&&f?c(l,r):d&&"function"==typeof l?c(Function.call,l):l,m&&u(m,s,l,t&a.U),g[s]!=l&&i(g,s,p),d&&w[s]!=l&&(w[s]=l)};r.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(14),o=n(38);t.exports=n(12)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(9),o=n(74),i=n(46),u=Object.defineProperty;e.f=n(12)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(37),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},,function(t,e,n){var r=n(2),o=n(13),i=n(15),u=n(26)("src"),c=Function.toString,a=(""+c).split("toString");n(23).inspectSource=function(t){return c.call(t)},(t.exports=function(t,e,n,c){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(i(n,u)||o(n,u,t[e]?""+t[e]:a.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||c.call(this)})},,,,function(t,e,n){"use strict";n(5),n(1),n(3),n(33),n(8);var r=n(7);function o(t,e,n,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void n(t)}c.done?e(a):Promise.resolve(a).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var u=t.apply(e,n);function c(t){o(u,r,i,c,a,"next",t)}function a(t){o(u,r,i,c,a,"throw",t)}c(void 0)})}}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,n=null,o=[{key:"getEntityDefinitions",value:function(){var t=i(regeneratorRuntime.mark(function t(e){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof e){t.next=2;break}throw Error("Invalid logicalName given");case 2:if(!this.cachedEntityDefinitions[e]){t.next=4;break}return t.abrupt("return",this.cachedEntityDefinitions[e]);case 4:return this.cachedEntityDefinitionsPromises[e]||(this.cachedEntityDefinitionsPromises[e]=r.default.retrieveEntitySet("EntityDefinitions",null,"$filter=LogicalName eq '".concat(e,"'&$expand=Attributes,ManyToOneRelationships")).then(function(t){var r=t.value[0];return n.cachedEntityDefinitions[e]=r,r})),t.abrupt("return",this.cachedEntityDefinitionsPromises[e]);case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"getCachedEntityDefinitions",value:function(t){return this.cachedEntityDefinitions[t]}},{key:"getOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var r,o,i,u,c,a,s,f;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getEntityDefinitions(e);case 2:r=t.sent,o=!0,i=!1,u=void 0,t.prev=6,c=r.Attributes[Symbol.iterator]();case 8:if(o=(a=c.next()).done){t.next=22;break}if((s=a.value).LogicalName!==n){t.next=19;break}if("Picklist"!==(f=s.AttributeType)){t.next=16;break}return t.abrupt("return",this.getPicklistOptionSet(e,n));case 16:if("Boolean"!==f){t.next=18;break}return t.abrupt("return",this.getBooleanOptionSet(e,n));case 18:return t.abrupt("break",22);case 19:o=!0,t.next=8;break;case 22:t.next=28;break;case 24:t.prev=24,t.t0=t.catch(6),i=!0,u=t.t0;case 28:t.prev=28,t.prev=29,o||null==c.return||c.return();case 31:if(t.prev=31,!i){t.next=34;break}throw u;case 34:return t.finish(31);case 35:return t.finish(28);case 36:return t.abrupt("return",[]);case 37:case"end":return t.stop()}},t,this,[[6,24,28,36],[29,,31,35]])}));return function(e,n){return t.apply(this,arguments)}}()},{key:"getPicklistOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var o,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.default.retrieveEntitySet("EntityDefinitions(LogicalName='".concat(e,"')/Attributes(LogicalName='").concat(n,"')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata"),null,"$select=LogicalName&$expand=OptionSet");case 2:return o=t.sent,i=o.OptionSet.Options.map(function(t){return{value:t.Value,externalValue:t.ExternalValue,label:t.Label.UserLocalizedLabel.Label}}),t.abrupt("return",i);case 5:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}()},{key:"getBooleanOptionSet",value:function(){var t=i(regeneratorRuntime.mark(function t(e,n){var o,i,u,c,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.default.retrieveEntitySet("EntityDefinitions(LogicalName='".concat(e,"')/Attributes(LogicalName='").concat(n,"')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata"),null,"$select=LogicalName&$expand=OptionSet");case 2:return o=t.sent,i=o.OptionSet,u=i.FalseOption,c=i.TrueOption,(a=[]).push({value:u.Value,label:u.Label.UserLocalizedLabel.Label}),a.push({value:c.Value,label:c.Label.UserLocalizedLabel.Label}),t.abrupt("return",a);case 10:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}()},{key:"cachedEntityDefinitions",get:function(){return this.entityDef||(this.entityDef={}),this.entityDef}},{key:"cachedEntityDefinitionsPromises",get:function(){return this.entityDefProms||(this.entityDefProms={}),this.entityDefProms}}],n&&u(e.prototype,n),o&&u(e,o),t}();e.a=c},function(t,e){var n=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(39);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(52),o=n(36);t.exports=function(t){return r(o(t))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(14).f,o=n(15),i=n(0)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(75),o=n(54);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports={}},function(t,e,n){var r=n(36);t.exports=function(t){return Object(r(t))}},function(t,e,n){for(var r=n(34),o=n(30),i=n(18),u=n(2),c=n(13),a=n(31),s=n(0),f=s("iterator"),l=s("toStringTag"),p=a.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=o(h),v=0;v<y.length;v++){var d,b=y[v],m=h[b],g=u[b],w=g&&g.prototype;if(w&&(w[f]||c(w,f,p),w[l]||c(w,l,b),a[b]=p,m))for(d in r)w[d]||i(w,d,r[d],!0)}},function(t,e,n){"use strict";var r=n(82),o=n(112),i=n(31),u=n(27);t.exports=n(84)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";n(63);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,o=[{key:"context",get:function(){if("undefined"