-
Notifications
You must be signed in to change notification settings - Fork 2
/
amazon-q-connectjs-min.js
1 lines (1 loc) · 27 KB
/
amazon-q-connectjs-min.js
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.QConnectJS=t():e.QConnectJS=t()}(self,(()=>(()=>{"use strict";var e={571:(e,t,n)=>{const o=n(607);(()=>{const e=n.g.connect||{},t=e.qconnectjs||{};e.qconnectjs=t,n.g.connect=e,t.Client=o.Client,t.QConnectClient=o.QConnectClient,t.commands={GetAuthorizedWidgetsForUser:o.GetAuthorizedWidgetsForUser,ListIntegrationAssociations:o.ListIntegrationAssociations,SearchSessions:o.SearchSessions,QueryAssistant:o.QueryAssistant,GetContent:o.GetContent,GetRecommendations:o.GetRecommendations,NotifyRecommendationsReceived:o.NotifyRecommendationsReceived,GetContact:o.GetContact}})()},934:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Client=void 0;const o=n(673),r=n(710);t.Client=class{constructor(e){const t=(0,o.getRuntimeConfig)(e);this.config=t,"complete"===document.readyState?this.initFrameConduit():document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&this.initFrameConduit()})),this.config.requestHandler.setRuntimeConfig(this.config)}initFrameConduit(){var e,t;if(this.config.frameWindow||this.config.instanceUrl.includes(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.origin))return;const n=document.querySelector('iframe[src*="wisdom-v2"]');if(n&&n.contentWindow)this.config.frameWindow=n;else try{let e=document.querySelector("q-connect-container");e||(e=document.createElement("div"),e.id="q-connect-container",document.body.appendChild(e)),null===(t=null===window||void 0===window?void 0:window.connect)||void 0===t||t.agentApp.initApp(r.ServiceIds.AmazonQConnect,"q-connect-container",`${this.config.instanceUrl}/wisdom-v2/?theme=hidden_page`,{style:"display: none"}),this.config.frameWindow=document.getElementById(r.ServiceIds.AmazonQConnect)}catch(e){console.error("There was an error initializing Amazon Q Connect")}}async call(e,t){return e.resolveRequestHandler(this.config,t)().then((e=>e))}}},849:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Command=void 0;const o=n(180),r=n(315),s=n(517);t.Command=class{serialize(e){return new o.HttpRequest({...(0,r.parseUrl)(e.endpoint),headers:{...e.headers,...(0,s.buildAmzTarget)(this.clientMethod,e)},body:JSON.stringify(this.clientInput),frameWindow:e.frameWindow})}}},378:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetAuthorizedWidgetsForUser=void 0;const o=n(849),r=n(294),s=n(710);class i extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.GetAuthorizedWidgetsForUser}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){return super.serialize({...e,serviceId:s.ServiceIds.AgentApp})}}t.GetAuthorizedWidgetsForUser=i},93:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetContact=void 0;const o=n(849),r=n(294),s=n(710);class i extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.GetContact}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{awsAccountId:t,instanceId:n,contactId:o}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid awsAccountId.");if(void 0===n||!n.length)throw new Error("Invalid instanceId.");if(void 0===o||!o.length)throw new Error("Invalid contactId.");return super.serialize({...e,serviceId:s.ServiceIds.Lcms})}}t.GetContact=i},869:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetContent=void 0;const o=n(849),r=n(294);class s extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.GetContent}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{contentId:t,knowledgeBaseId:n}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid contentId.");if(void 0===n||!n.length)throw new Error("Invalid knowledgeBaseId.");return super.serialize(e)}}t.GetContent=s},185:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GetRecommendations=void 0;const o=n(849),r=n(294);class s extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.GetRecommendations}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{assistantId:t,sessionId:n}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid assistantId.");if(void 0===n||!n.length)throw new Error("Invalid sessionId.");return super.serialize(e)}}t.GetRecommendations=s},885:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=n(582);o.__exportStar(n(378),t),o.__exportStar(n(869),t),o.__exportStar(n(185),t),o.__exportStar(n(901),t),o.__exportStar(n(359),t),o.__exportStar(n(314),t),o.__exportStar(n(801),t),o.__exportStar(n(93),t)},901:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ListIntegrationAssociations=void 0;const o=n(849),r=n(294),s=n(710);class i extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.ListIntegrationAssociations}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{InstanceId:t}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid InstanceId.");return super.serialize({...e,serviceId:s.ServiceIds.Acs})}}t.ListIntegrationAssociations=i},359:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotifyRecommendationsReceived=void 0;const o=n(849),r=n(294);class s extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.NotifyRecommendationsReceived}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{assistantId:t,sessionId:n,recommendationIds:o}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid assistantId.");if(void 0===n||!n.length)throw new Error("Invalid sessionId.");if(void 0===o||!o.length)throw new Error("Invalid recommendationIds.");return super.serialize(e)}}t.NotifyRecommendationsReceived=s},314:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QueryAssistant=void 0;const o=n(849),r=n(294);class s extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.QueryAssistant}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){const{assistantId:t,queryText:n}=this.clientInput;if(void 0===t||!t.length)throw new Error("Invalid assistantId.");if(void 0===n||!n.length)throw new Error("Invalid queryText.");return super.serialize(e)}}t.QueryAssistant=s},801:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SearchSessions=void 0;const o=n(849),r=n(294);class s extends o.Command{constructor(e){super(),this.clientInput=e,this.clientMethod=r.ClientMethods.SearchSessions}resolveRequestHandler(e,t){const{requestHandler:n}=e;return()=>n.handle(this.serialize(e),t||{})}serialize(e){var t;const{assistantId:n,searchExpression:o}=this.clientInput;if(void 0===n||!n.length)throw new Error("Invalid assistantId.");if(void 0===o||!(null==o?void 0:o.filters)||!(null===(t=null==o?void 0:o.filters)||void 0===t?void 0:t.length))throw new Error("Invalid searchExpression.");return super.serialize(e)}}t.SearchSessions=s},419:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FetchHttpHandler=void 0;const o=n(477),r=n(770),s=n(517);t.FetchHttpHandler=class{constructor(e){this.config=null!=e?e:{},(0,o.subscribeToChannel)(this.channelRequestHandler.bind(this))}setRuntimeConfig(e){this.runtimeConfig=e}async responseHandler(e){const{status:t,statusText:n,ok:o,headers:r,body:s}=e,i=r,a={};for(const e of i.entries())a[e[0]]=e[1];if(!(void 0!==s))return e.blob().then((()=>({status:t,statusText:n,ok:o,headers:a,body:e.json()})));const c=s.getReader();let l=new Uint8Array(0),d=!1;for(;!d;){const{done:e,value:t}=await c.read();if(t){const e=l;l=new Uint8Array(e.length+t.length),l.set(e),l.set(t,e.length)}d=e}return{status:t,statusText:n,ok:o,headers:a,body:JSON.parse(new TextDecoder("utf8").decode(l))}}async channelRequestHandler(e,t){try{const{headers:e,body:n}=t,o=null==e?void 0:e["x-amz-target"],i=(0,s.parseAmzTarget)(o),a=new(0,r.Commands[i])(JSON.parse(n));return this.handle(a.serialize(this.runtimeConfig),{})}catch(e){return console.log("Something went wrong during request.",e),Promise.reject(e)}}async fetchRequestHandler(e,t){try{const n=await fetch(e,t);return this.responseHandler(n)}catch(e){return console.log("Something went wrong during request.",e),Promise.reject(e)}}async fetchRequest(e,t,n){try{if(n){const r=await(0,o.fetchWithChannel)(n.contentWindow,n.src,{url:e,options:t});return Promise.resolve(r)}return this.fetchRequestHandler(e,t)}catch(e){return console.log("Something went wrong during request.",e),Promise.reject(e)}}requestTimeout(e){return new Promise(((t,n)=>{e&&setTimeout((()=>{const t=new Error(`Request did not complete within ${e} ms.`);t.name="TimeoutError",n(t)}),e)}))}abortRequest(e){return new Promise(((t,n)=>{e&&(e.onabort=()=>{const e=new Error("Request aborted.");e.name="AbortError",n(e)})}))}handle(e,t){const{abortSignal:n}=t||{},{requestTimeout:o}=this.config||{};if(null==n?void 0:n.aborted){const e=new Error("Request aborted");return e.name="AbortError",Promise.reject(e)}const{protocol:r,hostname:s,port:i,path:a,method:c,headers:l,body:d,frameWindow:u}=e,p=`${r}//${s}${i?`:${i}`:""}${a}`,f={method:c,headers:l,body:d,...!u&&AbortController&&n&&{signal:n}};return Promise.race([this.fetchRequest(p,f,u),this.requestTimeout(o),this.abortRequest(n)])}}},180:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequest=void 0;t.HttpRequest=class{constructor(e){this.method=e.method||"POST",this.protocol=e.protocol?":"!==e.protocol.charAt(e.protocol.length-1)?`${e.protocol}:`:e.protocol:"https:",this.hostname=e.hostname||"localhost",this.port=e.port,this.path=e.path&&"/"!==e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/agent-app/api",this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.frameWindow=e.frameWindow}}},607:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=n(582);o.__exportStar(n(934),t),o.__exportStar(n(891),t),o.__exportStar(n(885),t)},891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QConnectClient=void 0;const o=n(934),r=n(885);class s extends o.Client{constructor(e){super(e)}getAuthorizedWidgetsForUser(e,t){const n=new r.GetAuthorizedWidgetsForUser(e);return this.call(n,t)}getContent(e,t){const n=new r.GetContent(e);return this.call(n,t)}getRecommendations(e,t){const n=new r.GetRecommendations(e);return this.call(n,t)}listIntegrationAssociations(e,t){const n=new r.ListIntegrationAssociations(e);return this.call(n,t)}notifyRecommendationsReceived(e,t){const n=new r.NotifyRecommendationsReceived(e);return this.call(n,t)}queryAssistant(e,t){const n=new r.QueryAssistant(e);return this.call(n,t)}searchSessions(e,t){const n=new r.SearchSessions(e);return this.call(n,t)}getContact(e,t){const n=new r.GetContact(e);return this.call(n,t)}}t.QConnectClient=s},253:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AppNames=void 0,function(e){e.QConnectJS="wisdom-js",e.WisdomUI="wisdom-ui"}(t.AppNames||(t.AppNames={}))},416:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CallSources=void 0,function(e){e.AgentApp="agent-app"}(t.CallSources||(t.CallSources={}))},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LcmsMethods=t.AcsMethods=t.AgentAppMethods=t.QConnectMethods=t.ClientMethods=void 0,function(e){e.GetAuthorizedWidgetsForUser="getAuthorizedWidgetsForUser",e.GetContent="getContent",e.GetRecommendations="getRecommendations",e.ListIntegrationAssociations="listIntegrationAssociations",e.NotifyRecommendationsReceived="notifyRecommendationsReceived",e.QueryAssistant="queryAssistant",e.SearchSessions="searchSessions",e.GetContact="getContact"}(t.ClientMethods||(t.ClientMethods={})),function(e){e.GetContent="getContent",e.GetRecommendations="getRecommendations",e.NotifyRecommendationsReceived="notifyRecommendationsReceived",e.QueryAssistant="queryAssistant",e.SearchSessions="searchSessions"}(t.QConnectMethods||(t.QConnectMethods={})),function(e){e.GetAuthorizedWidgetsForUser="getAuthorizedWidgetsForUser"}(t.AgentAppMethods||(t.AgentAppMethods={})),function(e){e.ListIntegrationAssociations="listIntegrationAssociations"}(t.AcsMethods||(t.AcsMethods={})),function(e){e.GetContact="getContact"}(t.LcmsMethods||(t.LcmsMethods={}))},770:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Commands=void 0;const o=n(885);t.Commands={getAuthorizedWidgetsForUser:o.GetAuthorizedWidgetsForUser,getContent:o.GetContent,getRecommendations:o.GetRecommendations,listIntegrationAssociations:o.ListIntegrationAssociations,notifyRecommendationsReceived:o.NotifyRecommendationsReceived,queryAssistant:o.QueryAssistant,searchSessions:o.SearchSessions,getContact:o.GetContact}},710:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceIds=void 0,function(e){e.AmazonQConnect="AmazonQConnect",e.AgentApp="AgentApp",e.Acs="Acs",e.Lcms="Lcms"}(t.ServiceIds||(t.ServiceIds={}))},924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetServices=void 0,function(e){e.AmazonQConnect="WisdomV2",e.AgentApp="AgentApp",e.Acs="Acs",e.Lcms="Lcms"}(t.WidgetServices||(t.WidgetServices={}))},600:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generateEndpoint=void 0;const o=n(315);t.generateEndpoint=e=>{const{hostname:t,port:n,protocol:r,path:s}=(0,o.parseUrl)(e);return`${r}//${t}${n?`:${n}`:""}${s.replace(/\/$/,"")}/agent-app/api`}},517:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseAmzTarget=t.buildAmzTarget=void 0;const o=n(294),r=n(924);t.buildAmzTarget=(e,{serviceId:t})=>({"x-amz-target":`AgentAppService.${r.WidgetServices[t]}.${e}`});t.parseAmzTarget=e=>{const[t,n,s]=(null==e?void 0:e.split("."))||[];if(!t||"AgentAppService"!==t)throw new Error("Unsupported service prefix.");if(!n||!Object.values(r.WidgetServices).includes(n))throw new Error("Unsupported service.");let i;switch(n){case r.WidgetServices.AmazonQConnect:i=o.QConnectMethods;break;case r.WidgetServices.AgentApp:i=o.AgentAppMethods;break;case r.WidgetServices.Acs:i=o.AcsMethods;break;case r.WidgetServices.Lcms:i=o.LcmsMethods}if(!s||!Object.values(i).includes(s))throw new Error("Unsupported client method.");return s}},477:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToChannel=t.fetchWithChannel=void 0;const o=n(253);t.fetchWithChannel=(e,t,n)=>new Promise(((r,s)=>{try{const s=new MessageChannel,{port1:i,port2:a}=s;i.onmessage=e=>{i.close(),r(e.data.data)},e.postMessage({source:o.AppNames.QConnectJS,data:n},t,[a])}catch(e){s(e)}}));t.subscribeToChannel=e=>{window.self!=window.top&&window.addEventListener("message",(async t=>{var n;if(t.data.source!==o.AppNames.QConnectJS)return;if((null===(n=t.source)||void 0===n?void 0:n.location)!==(window.top||window.parent).location)return;const r=t.ports[0],{url:s,options:i}=t.data.data,a=await e(s,i);r.postMessage({source:o.AppNames.WisdomUI,data:a})}))}},842:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultHeaders=void 0;const n={Accept:"application/json","Content-Type":"application/json"};t.getDefaultHeaders=({callSource:e,serviceId:t})=>({...n,"x-amazon-call-source":e,"x-amz-access-section":t})},673:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRuntimeConfig=void 0;const o=n(157),r=n(419),s=n(842);t.getRuntimeConfig=e=>{var t,n,i;const a=(0,o.getRuntimeConfig)(e);return{...a,...e,headers:null!==(t=e.headers)&&void 0!==t?t:(0,s.getDefaultHeaders)(a),maxAttempts:null!==(n=e.maxAttempts)&&void 0!==n?n:3,requestHandler:null!==(i=e.requestHandler)&&void 0!==i?i:new r.FetchHttpHandler}}},157:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRuntimeConfig=void 0;const o=n(315),r=n(416),s=n(710),i=n(600);t.getRuntimeConfig=e=>{var t,n,a,c;return{logger:null!==(t=null==e?void 0:e.logger)&&void 0!==t?t:{},serviceId:null!==(n=null==e?void 0:e.serviceId)&&void 0!==n?n:s.ServiceIds.AmazonQConnect,callSource:null!==(a=null==e?void 0:e.callSource)&&void 0!==a?a:r.CallSources.AgentApp,instanceUrl:null!==(c=null==e?void 0:e.instanceUrl)&&void 0!==c?c:(0,o.getBaseUrl)(),endpoint:(null==e?void 0:e.endpoint)||(0,i.generateEndpoint)((null==e?void 0:e.instanceUrl)||(0,o.getBaseUrl)())}}},315:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUrl=t.getBaseUrl=void 0;t.getBaseUrl=()=>n.g.location.href;t.parseUrl=e=>{const{hostname:t,pathname:n,port:o,protocol:r}=new URL(e);return{hostname:t,port:o?parseInt(o):void 0,protocol:r,path:n}}},582:(e,t,n)=>{n.r(t),n.d(t,{__addDisposableResource:()=>q,__assign:()=>s,__asyncDelegator:()=>I,__asyncGenerator:()=>C,__asyncValues:()=>j,__await:()=>S,__awaiter:()=>h,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>E,__classPrivateFieldSet:()=>z,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>G,__esDecorate:()=>l,__exportStar:()=>y,__extends:()=>r,__generator:()=>v,__importDefault:()=>M,__importStar:()=>P,__makeTemplateObject:()=>R,__metadata:()=>f,__param:()=>c,__propKey:()=>u,__read:()=>_,__rest:()=>i,__runInitializers:()=>d,__setFunctionName:()=>p,__spread:()=>w,__spreadArray:()=>A,__spreadArrays:()=>b,__values:()=>g,default:()=>H});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},s.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){var r,s=arguments.length,i=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(s<3?r(i):s>3?r(t,n,i):r(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!t&&e?o.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var v in o)h[v]="access"===v?{}:o[v];for(var v in o.access)h.access[v]=o.access[v];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var m=(0,n[f])("accessor"===c?{get:u.get,set:u.set}:u[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=i(m.get))&&(u.get=a),(a=i(m.set))&&(u.set=a),(a=i(m.init))&&r.unshift(a)}else(a=i(m))&&("field"===c?r.unshift(a):u[l]=a)}d&&Object.defineProperty(d,o.name,u),p=!0}function d(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,n,o){return new(n||(n=Promise))((function(r,s){function i(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((o=o.apply(e,t||[])).next())}))}function v(e,t){var n,o,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var m=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function y(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||m(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],i=0,a=s.length;i<a;i++,r++)o[r]=s[i];return o}function A(e,t,n){if(n||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function C(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),s=[];return o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o;function i(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){s.push([e,t,n,o])>1||a(e,t)}))})}function a(e,t){try{(n=r[e](t)).value instanceof S?Promise.resolve(n.value.v).then(c,l):d(s[0][2],n)}catch(e){d(s[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function d(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function I(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:S(e[o](t)),done:!1}:r?r(t):t}:r}}function j(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function R(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var O=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&m(t,e,n);return O(t,e),t}function M(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function z(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function E(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function q(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var T="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function G(e){function t(t){e.error=e.hasError?new T(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const H={__extends:r,__assign:s,__rest:i,__decorate:a,__param:c,__metadata:f,__awaiter:h,__generator:v,__createBinding:m,__exportStar:y,__values:g,__read:_,__spread:w,__spreadArrays:b,__spreadArray:A,__await:S,__asyncGenerator:C,__asyncDelegator:I,__asyncValues:j,__makeTemplateObject:R,__importStar:P,__importDefault:M,__classPrivateFieldGet:x,__classPrivateFieldSet:z,__classPrivateFieldIn:E,__addDisposableResource:q,__disposeResources:G}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(571),n(607)})()));