PageSourceSearch

https://exhibitors.iaa-transportation.com/static/js/7355.a1c7aae7.js

js iaa-transportation.com collected 2026-09-24 09:04:05 UTC 90,019 bytes, 1 lines download raw bytes

1(self.webpackChunkvirtual_guide=self.webpackChunkvirtual_guide||[]).push([[7355],{7638:(e,t,n)=>{"use strict";n.d(t,{G:()=>fe});var r,o,i=n(48386),s=n(33267),a=n(46614),c=n(34303),u=n(79906),l=n(38826),p=n(82875),d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)},f=new a.C("AbstractPubSubProvider"),h=function(){function e(e){void 0===e&&(e={}),this._config=e}return e.prototype.configure=function(e){return void 0===e&&(e={}),this._config=d(d({},e),this._config),f.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"PubSub"},Object.defineProperty(e.prototype,"options",{get:function(){return d({},this._config)},enumerable:!0,configurable:!0}),e}(),y=n(71977);!function(e){e.CONNECTION_CLOSED="Connection closed",e.CONNECTION_FAILED="Connection failed",e.REALTIME_SUBSCRIPTION_INIT_ERROR="AppSync Realtime subscription init error",e.SUBSCRIPTION_ACK="Subscription ack",e.TIMEOUT_DISCONNECT="Timeout disconnect"}(r||(r={})),function(e){e.Connected="Connected",e.ConnectedPendingNetwork="ConnectedPendingNetwork",e.ConnectionDisrupted="ConnectionDisrupted",e.ConnectionDisruptedPendingNetwork="ConnectionDisruptedPendingNetwork",e.Connecting="Connecting",e.ConnectedPendingDisconnect="ConnectedPendingDisconnect",e.Disconnected="Disconnected",e.ConnectedPendingKeepAlive="ConnectedPendingKeepAlive"}(o||(o={}));var b,v,_,g=n(11128),m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},m.apply(this,arguments)},S={KEEP_ALIVE_MISSED:{keepAliveState:"unhealthy"},KEEP_ALIVE:{keepAliveState:"healthy"},CONNECTION_ESTABLISHED:{connectionState:"connected"},CONNECTION_FAILED:{intendedConnectionState:"disconnected",connectionState:"disconnected"},CLOSING_CONNECTION:{intendedConnectionState:"disconnected"},OPENING_CONNECTION:{intendedConnectionState:"connected",connectionState:"connecting"},CLOSED:{connectionState:"disconnected"},ONLINE:{networkState:"connected"},OFFLINE:{networkState:"disconnected"}},w=function(){function e(){var e=this;this._networkMonitoringSubscription=void 0,this._linkedConnectionState={networkState:"connected",connectionState:"disconnected",intendedConnectionState:"disconnected",keepAliveState:"healthy"},this._linkedConnectionStateObservable=new i.A(function(t){t.next(e._linkedConnectionState),e._linkedConnectionStateObserver=t})}return e.prototype.enableNetworkMonitoring=function(){var e=this;void 0===this._networkMonitoringSubscription&&(this._networkMonitoringSubscription=(new g.A).networkMonitor().subscribe(function(t){var n=t.online;e.record(n?S.ONLINE:S.OFFLINE)}))},e.prototype.disableNetworkMonitoring=function(){var e;null===(e=this._networkMonitoringSubscription)||void 0===e||e.unsubscribe(),this._networkMonitoringSubscription=void 0},Object.defineProperty(e.prototype,"connectionStateObservable",{get:function(){var e,t=this;return this._linkedConnectionStateObservable.map(function(e){return t.connectionStatesTranslator(e)}).filter(function(t){var n=t!==e;return e=t,n})},enumerable:!0,configurable:!0}),e.prototype.record=function(e){"connected"===e.intendedConnectionState?this.enableNetworkMonitoring():"disconnected"===e.intendedConnectionState&&this.disableNetworkMonitoring();var t=m(m({},this._linkedConnectionState),e);this._linkedConnectionState=m({},t),this._linkedConnectionStateObserver.next(this._linkedConnectionState)},e.prototype.connectionStatesTranslator=function(e){var t=e.connectionState,n=e.networkState,r=e.intendedConnectionState,i=e.keepAliveState;return"connected"===t&&"disconnected"===n?o.ConnectedPendingNetwork:"connected"===t&&"disconnected"===r?o.ConnectedPendingDisconnect:"disconnected"===t&&"connected"===r&&"disconnected"===n?o.ConnectionDisruptedPendingNetwork:"disconnected"===t&&"connected"===r?o.ConnectionDisrupted:"connected"===t&&"unhealthy"===i?o.ConnectedPendingKeepAlive:"connecting"===t?o.Connecting:"disconnected"===t?o.Disconnected:o.Connected},e}(),C=[400,401,403],E="ConnectionStateChange";!function(e){e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_START="start",e.GQL_START_ACK="start_ack",e.GQL_DATA="data",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_STOP="stop",e.GQL_COMPLETE="complete",e.GQL_ERROR="error"}(b||(b={}
1)),function(e){e[e.PENDING=0]="PENDING",e[e.CONNECTED=1]="CONNECTED",e[e.FAILED=2]="FAILED"}(v||(v={})),function(e){e[e.CLOSED=0]="CLOSED",e[e.READY=1]="READY",e[e.CONNECTING=2]="CONNECTING"}(_||(_={}));var O="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",k={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},P=3e5,T=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},N.apply(this,arguments)},I=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},A=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},D=new a.C("MqttOverWSProvider");var L=function(){function e(){this.promises=new Map}return e.prototype.get=function(e,t){return I(this,void 0,void 0,function(){var n,r;return A(this,function(o){return(n=this.promises.get(e))?[2,n]:t?(r=t(e),this.promises.set(e,r),[2,r]):[2,void 0]})})},Object.defineProperty(e.prototype,"allClients",{get:function(){return Array.from(this.promises.keys())},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){this.promises.delete(e)},e}(),M="undefined"!==typeof Symbol?Symbol("topic"):"@@topic",x=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,N(N({},t),{clientId:t.clientId||(0,p.v4)()}))||this;return n._clientsQueue=new L,n.connectionStateMonitor=new w,n._topicObservers=new Map,n._clientIdObservers=new Map,n.connectionStateMonitor.connectionStateObservable.subscribe(function(e){var t,r,o;t=E,r={provider:n,connectionState:e},o="Connection state is "+e,y.YZ.dispatch("pubsub",{event:t,data:r,message:o},"PubSub",O)}),n}return T(t,e),Object.defineProperty(t.prototype,"clientId",{get:function(){return this.options.clientId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endpoint",{get:function(){return this.options.aws_pubsub_endpoint},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientsQueue",{get:function(){return this._clientsQueue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype.getTopicForValue=function(e){return"object"===typeof e&&e[M]},t.prototype.getProviderName=function(){return"MqttOverWSProvider"},t.prototype.onDisconnect=function(e){var t=this,n=e.clientId,r=e.errorCode,o=R(e,["clientId","errorCode"]);if(0!==r){D.warn(n,JSON.stringify(N({errorCode:r},o),null,2));var i=[];if(!n)return;var s=this._clientIdObservers.get(n);if(!s)return;
1s.forEach(function(e){e.error("Disconnected, error code: "+r),t._topicObservers.forEach(function(t,n){t.delete(e),0===t.size&&i.push(n)})}),this._clientIdObservers.delete(n),i.forEach(function(e){t._topicObservers.delete(e)})}},t.prototype.newClient=function(e){var t=e.url,n=e.clientId;return I(this,void 0,void 0,function(){var e,r=this;return A(this,function(o){switch(o.label){case 0:return D.debug("Creating new MQTT client",n),this.connectionStateMonitor.record(S.OPENING_CONNECTION),(e=new l.Client(t,n)).onMessageArrived=function(e){var t=e.destinationName,n=e.payloadString;r._onMessage(t,n)},e.onConnectionLost=function(e){var t=e.errorCode,o=R(e,["errorCode"]);r.onDisconnect(N({clientId:n,errorCode:t},o)),r.connectionStateMonitor.record(S.CLOSED)},[4,new Promise(function(t,n){e.connect({useSSL:r.isSSLEnabled,mqttVersion:3,onSuccess:function(){return t(e)},onFailure:function(){n(),r.connectionStateMonitor.record(S.CONNECTION_FAILED)}})})];case 1:return o.sent(),this.connectionStateMonitor.record(S.CONNECTION_ESTABLISHED),[2,e]}})})},t.prototype.connect=function(e,t){return void 0===t&&(t={}),I(this,void 0,void 0,function(){var n=this;return A(this,function(r){switch(r.label){case 0:return[4,this.clientsQueue.get(e,function(e){return n.newClient(N(N({},t),{clientId:e}))})];case 1:return[2,r.sent()]}})})},t.prototype.disconnect=function(e){return I(this,void 0,void 0,function(){var t;return A(this,function(n){switch(n.label){case 0:return[4,this.clientsQueue.get(e)];case 1:return(t=n.sent())&&t.isConnected()&&(t.disconnect(),this.connectionStateMonitor.record(S.CLOSED)),this.clientsQueue.remove(e),[2]}})})},t.prototype.publish=function(e,t){return I(this,void 0,void 0,function(){var n,r,o,i;return A(this,function(s){switch(s.label){case 0:return n=[].concat(e),r=JSON.stringify(t),[4,this.endpoint];case 1:return o=s.sent(),[4,this.connect(this.clientId,{url:o})];case 2:return i=s.sent(),D.debug("Publishing to topic(s)",n.join(","),r),n.forEach(function(e){return i.send(e,r)}),[2]}})})},t.prototype._onMessage=function(e,t){try{var n=[];this._topicObservers.forEach(function(t,r){(function(e,t){for(var n=e.split("/"),r=n.length,o=t.split("/"),i=0;i<r;++i){var s=n[i],a=o[i];if("#"===s)return o.length>=r;if("+"!==s&&s!==a)return!1}return r===o.length})(r,e)&&n.push(t)});var r=JSON.parse(t);"object"===typeof r&&(r[M]=e),n.forEach(function(e){e.forEach(function(e){return e.next(r)})})}catch(o){D.warn("Error handling message",o,t)}},t.prototype.subscribe=function(e,t){var n=this;void 0===t&&(t={});var r=[].concat(e);return D.debug("Subscribing to topic(s)",r.join(",")),new i.A(function(e){var o;r.forEach(function(t){var r=n._topicObservers.get(t);r||(r=new Set,n._topicObservers.set(t,r)),r.add(e)});var i=t.clientId,s=void 0===i?n.clientId:i,a=n._clientIdObservers.get(s);return a||(a=new Set),a.add(e),n._clientIdObservers.set(s,a),I(n,void 0,void 0,function(){var n,i,a,c;return A(this,function(u){switch(u.label){case 0:return void 0!==(n=t.url)?[3,2]:[4,this.endpoint];case 1:return a=u.sent(),[3,3];case 2:a=n,u.label=3;case 3:i=a,u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.connect(s,{url:i})];case 5:return o=u.sent(),r.forEach(function(e){o.subscribe(e)}),[3,7];case 6:return c=u.sent(),e.error(c),[3,7];case 7:return[2]}})}),function(){var t,i;return D.debug("Unsubscribing from topic(s)",r.join(",")),o&&(null===(t=n._clientIdObservers.get(s))||void 0===t||t.delete(e),0===(null===(i=n._clientIdObservers.get(s))||void 0===i?void 0:i.size)&&(n.connectionStateMonitor.record(S.CLOSING_CONNECTION),n.disconnect(s),n._clientIdObservers.delete(s)),r.forEach(function(t){var r=n._topicObservers.get(t)||new Set;r.delete(e),0===r.size&&(n._topicObservers.delete(t),o.isConnected()&&o.unsubscribe(t))})),null}})},t}(h),U=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}
1(),B=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},j=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},K=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},q=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},G=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(q(arguments[t]));return e},z=new a.C("AWSAppSyncProvider"),F=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._topicClient=new Map,t._topicAlias=new Map,t}return U(t,e),Object.defineProperty(t.prototype,"endpoint",{get:function(){throw new Error("Not supported")},enumerable:!0,configurable:!0}),t.prototype.getProviderName=function(){return"AWSAppSyncProvider"},t.prototype.publish=function(e,t,n){return B(this,void 0,void 0,function(){return j(this,function(e){throw new Error("Operation not supported")})})},t.prototype._cleanUp=function(e){var t=this;Array.from(this._topicClient.entries()).filter(function(t){return q(t,2)[1].clientId===e}).map(function(e){return q(e,1)[0]}).forEach(function(e){return t._cleanUpForTopic(e)})},t.prototype._cleanUpForTopic=function(e){this._topicClient.delete(e),this._topicAlias.delete(e)},t.prototype.onDisconnect=function(e){var t=this,n=e.clientId,r=e.errorCode,o=K(e,["clientId","errorCode"]);if(0!==r){var i=Array.from(this._topicClient.entries()).filter(function(e){return q(e,2)[1].clientId===n}).map(function(e){return q(e,1)[0]});i.forEach(function(e){t._topicObservers.has(e)&&(t._topicObservers.get(e).forEach(function(e){e.closed||e.error(o)}),t._topicObservers.delete(e))}),this._cleanUp(n)}},t.prototype.disconnect=function(t){return B(this,void 0,void 0,function(){return j(this,function(n){switch(n.label){case 0:return[4,this.clientsQueue.get(t,function(){return null})];case 1:return n.sent(),[4,e.prototype.disconnect.call(this,t)];case 2:return n.sent(),this._cleanUp(t),[2]}})})},t.prototype.subscribe=function(e,t){var n=this;void 0===t&&(t={});var r=new i.A(function(r){var o=[].concat(e);return z.debug("Subscribing to topic(s)",o.join(",")),B(n,void 0,void 0,function(){var e,n,i,s,a,c=this;return j(this,function(u){switch(u.label){case 0:return o.forEach(function(e){c._topicObservers.has(e)||c._topicObservers.set(e,new Set),c._topicObservers.get(e).add(r)}),e=t.mqttConnections,n=void 0===e?[]:e,i=t.newSubscriptions,s=Object.entries(i).map(function(e){var t=q(e,2),n=t[0];return[t[1].topic,n]}),this._topicAlias=new Map(G(Array.from(this._topicAlias.entries()),s)),a=Object.entries(o.reduce(function(e,t){var r=n.find(function(e){return e.topics.indexOf(t)>-1});if(r){var o=r.client,i=r.url;e[o]||(e[o]={url:i,topics:new Set}),e[o].topics.add(t)}return e},{})),[4,Promise.all(a.map(function(e){var t=q(e,2),n=t[0],o=t[1],i=o.url,s=o.topics;return B(c,void 0,void 0,function(){var e,t,o=this;return j(this,function(a){switch(a.label){case 0:e=null,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.connect(n,{clientId:n,url:i})];case 2:return e=a.sent(),[3,4];case 3:return t=a.sent(),r.error({message:"Failed to connect",error:t}),r.complete(),[2,void 0];
1case 4:return s.forEach(function(t){e.isConnected()&&(e.subscribe(t),o._topicClient.set(t,e))}),[2,e]}})})}))];case 1:return u.sent(),[2]}})}),function(){z.debug("Unsubscribing from topic(s)",o.join(",")),o.forEach(function(e){var t=n._topicClient.get(e);t&&t.isConnected()&&(t.unsubscribe(e),n._topicClient.delete(e),Array.from(n._topicClient.values()).some(function(e){return e===t})||n.disconnect(t.clientId)),n._topicObservers.delete(e)})}});return i.A.from(r).map(function(e){var t=n.getTopicForValue(e),r=n._topicAlias.get(t);return e.data=Object.entries(e.data).reduce(function(e,t){var n=q(t,2),o=n[0],i=n[1];return e[r||o]=i,e},{}),e})},t}(x),H=n(50137),W=n(9270),J=n(32812),Q=n(56947),X=n(60921),Y=n(15902),V=n(51070),Z=n(23588),$=n(10807),ee=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(){return te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},te.apply(this,arguments)},ne=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},re=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},oe=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},ie=new a.C("AWSAppSyncRealTimeProvider"),se=function(e,t,n){y.YZ.dispatch("api",{event:e,data:t,message:n},"PubSub",O)},ae=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com\/graphql$/i,ce=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.socketStatus=_.CLOSED,n.keepAliveTimeout=P,n.subscriptionObserverMap=new Map,n.promiseArray=[],n.connectionStateMonitor=new w,n.connectionStateMonitor.connectionStateObservable.subscribe(function(e){se(E,{provider:n,connectionState:e},"Connection state is "+e)}),n}return ee(t,e),t.prototype.getNewWebSocket=function(e,t){return new WebSocket(e,t)},t.prototype.getProviderName=function(){return"AWSAppSyncRealTimeProvider"},t.prototype.newClient=function(){throw new Error("Not used here")},t.prototype.publish=function(e,t,n){return ne(this,void 0,void 0,function(){return re(this,function(e){throw new Error("Operation not supported")})})},t.prototype.isCustomDomain=function(e){return null===e.match(ae)},t.prototype.subscribe=function(e,t){var n=this,o=null===t||void 0===t?void 0:t.appSyncGraphqlEndpoint;return new i.A(function(e){if(t&&o){var i=(0,p.v4)();return n._startSubscriptionWithAWSAppSyncRealTime({options:t,observer:e,subscriptionId:i}).catch(function(t){e.error({errors:[te({},new H.e(r.REALTIME_SUBSCRIPTION_INIT_ERROR+": "+t))]}),n.connectionStateMonitor.record(S.CLOSED),e.complete()}),function(){return ne(n,void 0,void 0,function(){var e,t;return re(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),[4,this._waitForSubscriptionToBeConnected(i)];case 1:if(n.sent(),!(e=(this.subscriptionObserverMap.get(i)||{}).subscriptionState))return[2];if(e!==v.CONNECTED)throw new Error("Subscription never connected");return this._sendUnsubscriptionMessage(i),[3,4];case 2:return t=n.sent(),ie.debug("Error while unsubscribing "+t),[3,4];case 3:return this._removeSubscriptionObserver(i),[7];case 4:return[2]}})})}}e.error({errors:[te({},new H.e("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()})},Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t,n,o=e.options,i=e.observer,s=e.subscriptionId;return ne(this,void 0,void 0,function(){var e,a,u,l,p,d,f,h,y,_,g,m,w,C,E,O,k,P,T,N,I,A,R,D,L,M=this;return re(this,function(x){switch(x.label){case 0:return e=o.appSyncGraphqlEndpoint,a=o.authenticationType,u=o.query,l=o.variables,p=o.apiKey,d=o.region,f=o.graphql_headers,h=void 0===f?function(){return{}}:f,y=o.additionalHeaders,_=void 0===y?{}:y,g=v.PENDING,m={query:u,variables:l},this.subscriptionObserverMap.set(s,{observer:i,query:null!==u&&void 0!==u?u:"",variables:null!==l&&void 0!==l?l:{},subscriptionState:g,startAckTimeoutId:void 0}),w=JSON.stringify(m),E=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:p,appSyncGraphqlEndpoint:e,authenticationType:a,payload:w,canonicalUri:"",region:d,additionalHeaders:_})];case 1:return O=[te.apply(void 0,E.concat([x.sent()]))],[4,h()];case 2:C=te.apply(void 0,[te.apply(void 0,[te.apply(void 0,O.concat([x.sent()])),_]),(L={},L[c.YJ]=Q.YM.userAgent,L)]),k={id:s,payload:{data:w,extensions:{authorization:te({},C)}},type:b.GQL_START},P=JSON.stringify(k),x.label=3;case 3:return x.trys.push([3,5,,6]),this.connectionStateMonitor.record(S.OPENING_CONNECTION),[4,this._initializeWebSocketConnection({apiKey:p,appSyncGraphqlEndpoint:e,authenticationType:a,region:d,additionalHeaders:_})];case 4:return x.sent(),[3,6];case 5:return T=x.sent(),ie.debug({err:T}),N=null!==(t=T.message)&&void 0!==t?t:"",this.connectionStateMonitor.record(S.CLOSED),i.error({errors:[te({},new H.e(r.CONNECTION_FAILED+": "+N))]}),i.complete(),"function"===typeof(I=(this.subscriptionObserverMap.get(s)||{}).subscriptionFailedCallback)&&I(),[2];case 6:return A=null!==(n=this.subscriptionObserverMap.get(s))&&void 0!==n?n:{},R=A.subscriptionFailedCallback,D=A.subscriptionReadyCallback,this.subscriptionObserverMap.set(s,{observer:i,subscriptionState:g,query:null!==u&&void 0!==u?u:"",variables:null!==l&&void 0!==l?l:{},subscriptionReadyCallback:D,subscriptionFailedCallback:R,startAckTimeoutId:setTimeout(function(){M._timeoutStartSubscriptionAck.call(M,s)},15e3)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(P),[2]}})})},t.prototype._waitForSubscriptionToBeConnected=function(e){return ne(this,void 0,void 0,function(){var t,n=this;return re(this,function(r){return(t=this.subscriptionObserverMap.get(e))&&t.subscriptionState===v.PENDING?[2,new Promise(function(r,o){var i=t.observer,s=t.subscriptionState,a=t.variables,c=t.query;n.subscriptionObserverMap.set(e,{observer:i,subscriptionState:s,variables:a,query:c,subscriptionReadyCallback:r,subscriptionFailedCallback:o})})]:[2]})})},t.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===_.READY){var t={id:e,type:b.GQL_STOP},n=JSON.stringify(t);this.awsRealTimeSocket.send(n)}}catch(r){ie.debug({err:r})}},t.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},t.prototype._closeSocketIfRequired=function(){if(!(this.subscriptionObserverMap.size>0))if(this.awsRealTimeSocket)if(this.connectionStateMonitor.record(S.CLOSING_CONNECTION),this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{ie.debug("closing WebSocket..."),this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId);var e=this.awsRealTimeSocket;e.onclose=null,e.onerror=null,e.close(1e3),this.awsRealTimeSocket=void 0,this.socketStatus=_.CLOSED,this.connectionStateMonitor.record(S.CLOSED)}else this.socketStatus=_.CLOSED},t.prototype._handleIncomingSubscriptionMessage=function(e){var t=this;ie.debug("subscription message from AWS AppSync RealTime: "+e.data);var n=JSON.parse(e.data),o=n.id,i=void 0===o?"":o,s=n.payload,a=n.type,c=this.subscriptionObserverMap.get(i)||{},u=c.observer,l=void 0===u?null:u,p=c.query,d=void 0===p?"":p,f=c.variables,h=void 0===f?{}:f,y=c.startAckTimeoutId,_=c.subscriptionReadyCallback,g=c.subscriptionFailedCallback;if(ie.debug({id:i,observer:l,query:d,variables:h}),a===b.GQL_DATA&&s&&s.data)l?l.next(s):ie.debug("observer not found for id: "+i);else{if(a===b.GQL_START_ACK){ie.debug("subscription ready for "+JSON.stringify({query:d,variables:h})),"function"===typeof _&&_(),y&&clearTimeout(y),se(r.SUBSCRIPTION_ACK,{query:d,variables:h},"Connection established for subscription");var m=v.CONNECTED;return l&&this.subscriptionObserverMap.set(i,{observer:l,query:d,variables:h,startAckTimeoutId:void 0,subscriptionState:m,subscriptionReadyCallback:_,subscriptionFailedCallback:g}),void this.connectionStateMonitor.record(S.CONNECTION_ESTABLISHED)}if(a===b.GQL_CONNECTION_KEEP_ALIVE)return this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId),this.keepAliveTimeoutId=setTimeout(function(){return t._errorDisconnect(r.TIMEOUT_DISCONNECT)},this.keepAliveTimeout),this.keepAliveAlertTimeoutId=setTimeout(function(){t.connectionStateMonitor.record(S.KEEP_ALIVE_MISSED)},65e3),void this.connectionStateMonitor.record(S.KEEP_ALIVE);if(a===b.GQL_ERROR){m=v.FAILED;l&&(this.subscriptionObserverMap.set(i,{observer:l,query:d,variables:h,startAckTimeoutId:y,subscriptionReadyCallback:_,subscriptionFailedCallback:g,subscriptionState:m}),l.error({errors:[te({},new H.e(r.CONNECTION_FAILED+": "+JSON.stringify(s)))]}),y&&clearTimeout(y),l.complete(),"function"===typeof g&&g())}}},t.prototype._errorDisconnect=function(e){ie.debug("Disconnect error: "+e),this.subscriptionObserverMap.forEac
1h(function(t){var n=t.observer;n&&!n.closed&&n.error({errors:[te({},new H.e(e))]})}),this.subscriptionObserverMap.clear(),this.awsRealTimeSocket&&(this.connectionStateMonitor.record(S.CLOSED),this.awsRealTimeSocket.close()),this.socketStatus=_.CLOSED},t.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e);if(t){var n=t.observer,r=t.query,o=t.variables;if(!n)return;this.subscriptionObserverMap.set(e,{observer:n,query:r,variables:o,subscriptionState:v.FAILED}),n&&!n.closed&&(n.error({errors:[te({},new H.e("Subscription timeout "+JSON.stringify({query:r,variables:o})))]}),n.complete()),ie.debug("timeoutStartSubscription",JSON.stringify({query:r,variables:o}))}},t.prototype._initializeWebSocketConnection=function(e){var t=this,n=e.appSyncGraphqlEndpoint,r=e.authenticationType,o=e.apiKey,i=e.region,s=e.additionalHeaders;if(this.socketStatus!==_.READY)return new Promise(function(e,a){return ne(t,void 0,void 0,function(){var t,c,u,l,p,d,f,h,y,b;return re(this,function(v){switch(v.label){case 0:if(this.promiseArray.push({res:e,rej:a}),this.socketStatus!==_.CLOSED)return[3,5];v.label=1;case 1:return v.trys.push([1,4,,5]),this.socketStatus=_.CONNECTING,t="{}",l=(u=JSON).stringify,[4,this._awsRealTimeHeaderBasedAuth({authenticationType:r,payload:t,canonicalUri:"/connect",apiKey:o,appSyncGraphqlEndpoint:n,region:i,additionalHeaders:s})];case 2:return c=l.apply(u,[v.sent()]),p=J.Buffer.from(c).toString("base64"),d=J.Buffer.from(t).toString("base64"),f=null!==n&&void 0!==n?n:"",f=this.isCustomDomain(f)?f.concat("/realtime"):f.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta"),h=this.isSSLEnabled?"wss://":"ws://",f=f.replace("https://",h).replace("http://",h),y=f+"?header="+p+"&payload="+d,[4,this._initializeRetryableHandshake(y)];case 3:return v.sent(),this.promiseArray.forEach(function(e){var t=e.res;ie.debug("Notifying connection successful"),t()}),this.socketStatus=_.READY,this.promiseArray=[],[3,5];case 4:return b=v.sent(),this.promiseArray.forEach(function(e){return(0,e.rej)(b)}),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=void 0,this.socketStatus=_.CLOSED,[3,5];case 5:return[2]}})})})},t.prototype._initializeRetryableHandshake=function(e){return ne(this,void 0,void 0,function(){return re(this,function(t){switch(t.label){case 0:return ie.debug("Initializaling retryable Handshake"),[4,(0,X.hu)(this._initializeHandshake.bind(this),[e],5e3)];case 1:return t.sent(),[2]}})})},t.prototype._initializeHandshake=function(e){return ne(this,void 0,void 0,function(){var t,n,o,i,s=this;return re(this,function(a){switch(a.label){case 0:ie.debug("Initializing handshake "+e),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,new Promise(function(t,n){var r=s.getNewWebSocket(e,"graphql-ws");r.onerror=function(){ie.debug("WebSocket connection error")},r.onclose=function(){s.connectionStateMonitor.record(S.CONNECTION_FAILED),n(new Error("Connection handshake error"))},r.onopen=function(){return s.awsRealTimeSocket=r,t()}})];case 2:return a.sent(),[4,new Promise(function(e,t){if(s.awsRealTimeSocket){var n=!1;s.awsRealTimeSocket.onerror=function(e){ie.debug("WebSocket error "+JSON.stringify(e))},s.awsRealTimeSocket.onclose=function(e){ie.debug("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},s.awsRealTimeSocket.onmessage=function(o){ie.debug("subscription message from AWS AppSyncRealTime: "+o.data+" ");var i=JSON.parse(o.data),a=i.type,c=i.payload,u=(void 0===c?{}:c).connectionTimeoutMs,l=void 0===u?P:u;if(a===b.GQL_CONNECTION_ACK)return n=!0,s.awsRealTimeSocket&&(s.keepAliveTimeout=l,s.awsRealTimeSocket.onmessage=s._handleIncomingSubscriptionMessage.bind(s),s.awsRealTimeSocket.onerror=function(e){ie.debug(e),s._errorDisconnect(r.CONNECTION_CLOSED)},s.awsRealTimeSocket.onclose=function(e){ie.debug("WebSocket closed "+e.reason),s._errorDisconnect(r.CONNECTION_CLOSED)}),void e("Cool, connected to AWS AppSyncRealTime");if(a===b.GQL_CONNECTION_ERROR){var p=i.payload,d=(void 0===p?{}:p).errors,f=oe(void 0===d?[]:d,1)[0],h=void 0===f?{}
1:f,y=h.errorType,v=void 0===y?"":y,_=h.errorCode;t({errorType:v,errorCode:void 0===_?0:_})}};var o={type:b.GQL_CONNECTION_INIT};s.awsRealTimeSocket.send(JSON.stringify(o)),setTimeout(function(){n||(s.connectionStateMonitor.record(S.CONNECTION_FAILED),t(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after 15000 ms")))},15e3)}})];case 3:return a.sent(),[3,5];case 4:throw t=a.sent(),o=(n=t).errorType,i=n.errorCode,C.includes(i)?new X.OI(o):o?new Error(o):t;case 5:return[2]}})})},t.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,n=e.payload,r=e.canonicalUri,o=e.appSyncGraphqlEndpoint,i=e.apiKey,s=e.region,a=e.additionalHeaders;return ne(this,void 0,void 0,function(){var e,c,u;return re(this,function(l){switch(l.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeOPENIDHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeCUPHeader.bind(this),AWS_LAMBDA:this._customAuthHeader},t&&e[t]?[3,1]:(ie.debug("Authentication type "+t+" not supported"),[2,""]);case 1:return c=e[t],u=W.parse(null!==o&&void 0!==o?o:"").host,ie.debug("Authenticating with "+t),[4,c({payload:n,canonicalUri:r,appSyncGraphqlEndpoint:o,apiKey:i,region:s,host:u,additionalHeaders:a})];case 2:return[2,l.sent()]}})})},t.prototype._awsRealTimeCUPHeader=function(e){var t=e.host;return ne(this,void 0,void 0,function(){return re(this,function(e){switch(e.label){case 0:return[4,$.Ay.currentSession()];case 1:return[2,{Authorization:e.sent().getAccessToken().getJwtToken(),host:t}]}})})},t.prototype._awsRealTimeOPENIDHeader=function(e){var t=e.host;return ne(this,void 0,void 0,function(){var e,n,r;return re(this,function(o){switch(o.label){case 0:return[4,Z.Ay.getItem("federatedInfo")];case 1:return(n=o.sent())?(e=n.token,[3,4]):[3,2];case 2:return[4,$.Ay.currentAuthenticatedUser()];case 3:(r=o.sent())&&(e=r.token),o.label=4;case 4:if(!e)throw new Error("No federated jwt");return[2,{Authorization:e,host:t}]}})})},t.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,n=e.host;return ne(this,void 0,void 0,function(){var e,r;return re(this,function(o){return e=new Date,r=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),[2,{host:n,"x-amz-date":r,"x-api-key":t}]})})},t.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,n=e.canonicalUri,r=e.appSyncGraphqlEndpoint,o=e.region;return ne(this,void 0,void 0,function(){var e,i,s;return re(this,function(a){switch(a.label){case 0:return e={region:o,service:"appsync"},[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error("No credentials");return[4,Y.Ji.get().then(function(e){var t=e;return{secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken}})];case 2:return i=a.sent(),s={url:""+r+n,data:t,method:"POST",headers:te({},k)},[2,V.l.sign(s,i,e).headers]}})})},t.prototype._customAuthHeader=function(e){var t=e.host,n=e.additionalHeaders;if(!n||!n.Authorization)throw new Error("No auth token specified");return{Authorization:n.Authorization,host:t}},t.prototype._ensureCredentials=function(){return Y.Ji.get().then(function(e){if(!e)return!1;var t=Y.Ji.shear(e);return ie.debug("set credentials for AWSAppSyncRealTimeProvider",t),!0}).catch(function(e){return ie.warn("ensure credentials error",e),!1})},t}(h),ue=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},le=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},pe=(0,s.gy)().isNode,de=new a.C("PubSub"),fe=new(function(){function e(e){this._options=null!==e&&void 0!==e?e:{},de.debug("PubSub Options",this._options),this._pluggables=[],this.subscribe=this.subscribe.bind(this)}return Object.defineProperty(e.prototype,"awsAppSyncProvider",{get:function(){return this._awsAppSyncProvider||(this._awsAppSyncProvider=new F(this._options)),this._awsAppSyncProvider},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"awsAppSyncRealTimeProvider",{get:function(){return this._awsAppSyncRealTimeProvider||(this._awsAppSyncRealTimeProvider=new ce(this._options)),this._awsAppSyncRealTimeProvider},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"PubSub"},e.prototype.configure=function(e){var t=this,n=e?e.PubSub||e:{};return de.debug("configure PubSub",{opt:n}),this._options=Object.assign({},this._options,n),this._pluggables.map(function(e){return e.configure(t._options)}),this._options},e.prototype.addPluggable=function(e){return ue(this,void 0,void 0,function(){return le(this,function(t){return e&&"PubSub"===e.getCategory()?(this._pluggables.push(e),[2,e.configure(this._options)]):[2]})})},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter(function(t){return t.getProviderName()!==e})},e.prototype.getProviderByName=function(e){return e===c.Hm?this.awsAppSyncProvider:e===c.bB?this.awsAppSyncRealTimeProvider:this._pluggables.find(function(t){return t.getProviderName()===e})},e.prototype.getProviders=function(e){void 0===e&&(e={});var t=e.provider;if(!t)return this._pluggables;var n=this.getProviderByName(t);if(!n)throw new Error("Could not find provider named "+t);return[n]},e.prototype.publish=function(e,t,n){return ue(this,void 0,void 0,function(){return le(this,function(r){return[2,Promise.all(this.getProviders(n).map(function(r){return r.publish(e,t,n)}))]})})},e.prototype.subscribe=function(e,t){if(pe&&this._options&&this._options.ssr)throw new Error("Subscriptions are not supported for Server-Side Rendering (SSR)");de.debug("subscribe options",t);var n=this.getProviders(t);return new i.A(function(r){var o=n.map(function(n){return{provider:n,observable:n.subscribe(e,t)}}).map(function(e){var t=e.provider;return e.observable.subscribe({start:console.error,next:function(e){return r.next({provider:t,value:e})},error:function(e){return r.error({provider:t,error:e})}})});return function(){return o.forEach(function(e){return e.unsubscribe()})}})},e}());u.HA.register(fe)},40458:(e,t,n)=>{"use strict";var r,o,i,s=n(46614),a=n(92719),c=n(7444),u=n(71977),l=n(15902),p=n(747
17),d=n(23860),f=n(14855),h=n(36585),y=n(5833),b=n(21613),v=n(95240),_=n(44726),g=n(25172),m=n(97928),S=n.n(m),w=n(88218);!function(e){e.NO_CREDENTIALS="No credentials",e.NO_SRC_KEY='source param should be an object with the property "key" with value of type string',e.NO_DEST_KEY='destination param should be an object with the property "key" with value of type string',e.INVALID_BLOB="Object must be an instance of Blob"}(r||(r={})),function(e){e.CLEANUP_FAILED="Multipart copy clean up failed",e.NO_OBJECT_FOUND="Object does not exist",e.INVALID_QUEUESIZE="Queue size must be a positive number",e.NO_COPYSOURCE="You must specify a copy source",e.MAX_NUM_PARTS_EXCEEDED="Only a maximum of 10000 parts are allowed"}(o||(o={})),function(e){e.UPLOAD_PAUSED_MESSAGE="paused"}(i||(i={}));var C=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},O=new s.C("axios-http-handler"),k="sendUploadProgress",P="sendDownloadProgress";var T=function(e,t){var n,r;try{for(var o=C(Object.entries(e)),i=o.next();!i.done;i=o.next()){var s=E(i.value,2),a=s[0],c=s[1];a!==t&&a.toUpperCase()===t.toUpperCase()&&(e[t]=c,delete e[a])}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},N=[function(e,t){return n=e,"undefined"!==typeof Blob&&n instanceof Blob?(T(t,"Content-Type"),T(t,"Accept"),e):S().defaults.transformRequest[0].call(null,e,t);var n}],I=function(){function e(e,t,n){void 0===e&&(e={}),this.httpOptions=e,this.emitter=t,this.cancelTokenSource=n}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=this.httpOptions.requestTimeout,r=t.emitter||this.emitter,o=e.path;if(e.query){var s=(0,g.G)(e.query);s&&(o+="?"+s)}var a=e.port,c=e.protocol+"//"+e.hostname+(a?":"+a:"")+o,u={};u.url=c,u.method=e.method,u.headers=e.headers,delete u.headers.host,e.body?u.data=e.body:u.headers[Object.keys(u.headers).find(function(e){return"content-type"===e.toLowerCase()})]&&(u.data=null),r&&(u.onUploadProgress=function(e){r.emit(k,e),O.debug(e)},u.onDownloadProgress=function(e){r.emit(P,e),O.debug(e)}),this.cancelTokenSource&&(u.cancelToken=this.cancelTokenSource.token),t.cancelTokenSource&&(u.cancelToken=t.cancelTokenSource.token),u.responseType="blob",w.OD.isReactNative&&(u.transformRequest=N);var l=[S().request(u).then(function(e){return{response:new _.cS({headers:e.headers,statusCode:e.status,body:e.data})}}).catch(function(e){var t,n;if(e.message!==i.UPLOAD_PAUSED_MESSAGE&&O.error(e.message),S().isCancel(e)||!function(e){return"undefined"!==typeof e&&Object.prototype.hasOwnProperty.call(e,"response")&&"undefined"!==typeof e.response&&Object.prototype.hasOwnProperty.call(e.response,"status")&&"number"===typeof e.response.status}(e))throw e;return{response:new _.cS({statusCode:e.response.status,body:null===(t=e.response)||void 0===t?void 0:t.data,headers:null===(n=e.response)||void 0===n?void 0:n.headers})}}),A(n)];return Promise.race(l)},e}();function A(e){return void 0===e&&(e=0),new Promise(function(t,n){e&&setTimeout(function(){var t=new Error("Request did not complete within "+e+" ms");t.name="TimeoutError",n(t)},e)})}var R,D,L="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",M="contentLengthMiddleware",x="__uploadInProgress",U=function(e,t,n,r,o){if(e){var i={attrs:n};r&&(i.metrics=r),u.YZ.dispatch("storage",{event:t,data:i,message:o},"Storage",L)}},B=function(e){return"undefined"!==typeof e&&e instanceof Blob},j=function(e){return"undefined"!==typeof e&&e instanceof ArrayBuffer},K=n(11901),q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},q.apply(this,arguments)}
1,G=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},z=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},F=new s.C("S3ClientUtils"),H={accessKeyId:"",secretAccessKey:""},W=function(e){var t=e.credentials,n=e.level,r=e.customPrefix||{},o=e.identityId||t.identityId,i=(void 0!==r.private?r.private:"private/")+o+"/",s=(void 0!==r.protected?r.protected:"protected/")+o+"/",a=void 0!==r.public?r.public:"public/";switch(n){case"private":return i;case"protected":return s;default:return a}},J=function(e,t){return function(n,r){return function(r){return G(void 0,void 0,void 0,function(){var o,i,s,a;return z(this,function(c){switch(c.label){case 0:return[4,l.Ji.get()];case 1:return o=c.sent(),i=l.Ji.shear(o),s=W(q(q({},e),{credentials:i})),a=Object.assign({},r.input),Object.prototype.hasOwnProperty.call(r.input,"Key")?(a.Key=s+t,r.input=a):Object.prototype.hasOwnProperty.call(r.input,"Prefix")&&(a.Prefix=s+t,r.input=a),[2,n(r)]}})})}}},Q=function(e){return function(t,n){return function(n){return G(void 0,void 0,void 0,function(){var r,o;return z(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t(n)];case 1:return[2,i.sent()];case 2:throw r=i.sent(),(s=r).ServerTime&&"string"===typeof s.Code&&"RequestTimeTooSkewed"===s.Code&&(o=new Date(r.ServerTime),e.systemClockOffset=o.getTime()-Date.now()),r;case 3:return[2]}var s})})}}},X={step:"finalizeRequest",name:"autoAdjustClockskewMiddleware"},Y={step:"initialize",name:"addPrefixMiddleware"},V=function(){return G(void 0,void 0,void 0,function(){var e,t,n;return z(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,l.Ji.get()];case 1:return(e=r.sent())?(t=l.Ji.shear(e),F.debug("credentials provider get credentials",t),[2,t]):[2,H];case 2:return n=r.sent(),F.warn("credentials provider error",n),[2,H];case 3:return[2]}})})},Z=function(e,t){var n=e.region,r=e.cancelTokenSource,o=e.dangerouslyConnectToHttpEndpointForTesting,i=e.useAccelerateEndpoint,s={};o&&(s={endpoint:"http://localhost:20005",tls:!1,bucketEndpoint:!1,forcePathStyle:!0});var a=new K.Y(q(q({region:n,credentials:V,customUserAgent:(0,w.fE)()},s),{requestHandler:new I({},t,r),useAccelerateEndpoint:i}));return a.middlewareStack.remove(M),a},$=n(79751),ee=n(84230),te=n(62379),ne=n(95665),re=n(7594),oe=n(34895),ie=n(77714),se=function(){return se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},se.apply(this,arguments)},ae=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},ce=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ue=new s.C("AWSS3ProviderManagedUpload"),le=function(){function e(e,t,n){this.minPartSize=5242880,this.queueSize=4,this.body=null,this.params=null,this.opts=null,this.completedParts=[],this.uploadId=null,this.bytesUploaded=0,this.totalBytesToUpload=0,this.emitter=null,this.params=e,this.opts=t,this.emitter=n,this.s3client=this._createNewS3Client(t,n)}return e.prototype.upload=function(){return ae(this,void 0,void 0,function(){var e,t,n,r,o,i,s,a=this;return ce(this,function(c){switch(c.label){case 0:return c.trys.push([0,10,,12]),e=this,[4,this.validateAndSanitizeBody(this.params.Body)];case 1:return e.body=c.sent(),this.totalBytesToUpload=this.byteLength(this.body),this.totalBytesToUpload<=this.minPartSize?(this.params.Body=this.body,t=new $.w(this.params),[2,this.s3client.send(t)]):[3,2];case 2:return n=this,[4,this.createMultiPartUpload()];case 3:n.uploadId=c.sent(),r=Math.ceil(this.totalBytesToUpload/this.minPartSize),o=this.createParts(),i=0,c.label=4;case 4:return i<r?[4,this.uploadParts(this.uploadId,o.slice(i,i+this.queueSize))]:[3,7];case 5:c.sent(),c.label=6;case 6:return i+=this.queueSize,[3,4];case 7:return o.map(function(e){a.removeEventListener(e)}),[4,this.finishMultiPartUpload(this.uploadId)];case 8:return[2,c.sent()];case 9:return[3,12];case 10:return s=c.sent(),[4,this.cleanup(this.uploadId)];case 11:throw c.sent(),ue.error("Error. Cancelling the multipart upload."),s;case 12:return[2]}})})},e.prototype.createParts=function(){try{for(var e=[],t=0;t<this.totalBytesToUpload;){var n=Math.min(t+this.minPartSize,this.totalBytesToUpload);e.push({bodyPart:this.body.slice(t,n),partNumber:e.length+1,emitter:new ie.EventEmitter,_lastUploadedBytes:0}),t+=this.minPartSize}return e}catch(r){throw ue.error(r),r}},e.prototype.createMultiPartUpload=function(){return ae(this,void 0,void 0,function(){var e,t,n;return ce(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=new ee.n(this.params),[4,this.s3client.send(e)];case 1:return t=r.sent(),ue.debug(t.UploadId),[2,t.UploadId];case 2:throw n=r.sent(),ue.error(n),n;case 3:return[2]}})})},e.prototype.uploadParts=function(e,t){return ae(this,void 0,void 0,function(){var n,r,o,i=this;return ce(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,Promise.all(t.map(function(t){return ae(i,void 0,void 0,function(){var n,r,o,i,s,a,c;return ce(this,function(u){switch(u.label){case 0:return this.setupEventListener(t),n={emitter:t.emitter},r=this.params,o=r.Key,i=r.Bucket,s=r.SSECustomerAlgorithm,a=r.SSECustomerKey,c=r.SSECustomerKeyMD5,[4,this.s3client.send(new te.i(se(se(se({PartNumber:t.partNumber,Body:t.bodyPart,UploadId:e,Key:o,Bucket:i},s&&{SSECustomerAlgorithm:s}
1),a&&{SSECustomerKey:a}),c&&{SSECustomerKeyMD5:c})),n)];case 1:return[2,u.sent()]}})})}))];case 1:for(n=s.sent(),r=0;r<n.length;r++)this.completedParts.push({PartNumber:t[r].partNumber,ETag:n[r].ETag});return[3,3];case 2:throw o=s.sent(),ue.error("Error happened while uploading a part. Cancelling the multipart upload"),o;case 3:return[2]}})})},e.prototype.finishMultiPartUpload=function(e){return ae(this,void 0,void 0,function(){var t,n,r;return ce(this,function(o){switch(o.label){case 0:t={Bucket:this.params.Bucket,Key:this.params.Key,UploadId:e,MultipartUpload:{Parts:this.completedParts}},n=new ne.G(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.s3client.send(n)];case 2:return[2,o.sent().Key];case 3:throw r=o.sent(),ue.error("Error happened while finishing the upload."),r;case 4:return[2]}})})},e.prototype.cleanup=function(e){return ae(this,void 0,void 0,function(){var t,n;return ce(this,function(r){switch(r.label){case 0:return this.body=null,this.completedParts=[],this.bytesUploaded=0,this.totalBytesToUpload=0,t={Bucket:this.params.Bucket,Key:this.params.Key,UploadId:e},[4,this.s3client.send(new re.t(t))];case 1:return r.sent(),[4,this.s3client.send(new oe.m(t))];case 2:if((n=r.sent())&&n.Parts&&n.Parts.length>0)throw new Error("Multipart upload clean up failed.");return[2]}})})},e.prototype.removeEventListener=function(e){e.emitter.removeAllListeners(k),e.emitter.removeAllListeners(P)},e.prototype.setupEventListener=function(e){var t=this;e.emitter.on(k,function(n){t.progressChanged(e.partNumber,n.loaded-e._lastUploadedBytes),e._lastUploadedBytes=n.loaded})},e.prototype.progressChanged=function(e,t){this.bytesUploaded+=t,this.emitter.emit(k,{loaded:this.bytesUploaded,total:this.totalBytesToUpload,part:e,key:this.params.Key})},e.prototype.byteLength=function(e){if(null===e||void 0===e)return 0;if("number"===typeof e.byteLength)return e.byteLength;if("number"===typeof e.length)return e.length;if("number"===typeof e.size)return e.size;if("string"!==typeof e.path)throw new Error("Cannot determine length of "+e)},e.prototype.validateAndSanitizeBody=function(e){return ae(this,void 0,void 0,function(){return ce(this,function(t){return this.isGenericObject(e)?[2,JSON.stringify(e)]:[2,e]})})},e.prototype.isGenericObject=function(e){if(null!==e&&"object"===typeof e)try{return!(this.byteLength(e)>=0)}catch(t){return!0}return!1},e.prototype._createNewS3Client=function(e,t){var n=Z(e,t);return n.middlewareStack.add(J(this.opts,this.params.Key),Y),n.middlewareStack.add(Q(n.config),X),n},e}(),pe=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},de=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},fe=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},he=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(fe(arguments[t]));return e},ye=new s.C("AWSS3UploadTask");!function(e){e[e.INIT=0]="INIT",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.PAUSED=2]="PAUSED",e[e.CANCELLED=3]="CANCELLED",e[e.COMPLETED=4]="COMPLETED"}(R||(R={})),function(e){e.CANCEL="cancel",e.UPLOAD_COMPLETE="uploadComplete",e.UPLOAD_PROGRESS="uploadPartProgress",e.ERROR="error"}(D||(D={}));function be(e,t){return e.PartNumber-t.PartNumber}var ve=function(){function e(e){var t=e.s3Client,n=e.file,r=e.emitter,o=e.storage,i=e.params,s=e.level,a=e.prefixPromise;this.partSize=5242880,this.queueSize=4,this.inProgress=[],this.completedParts=[],this.queued=[],this.bytesUploaded=0,this.totalBytes=0,this.state=R.INIT,this.prefixPromise=a,this.s3client=t,this.s3client.middlewareStack.remove(M),this.storage=o,this.storageSync=Promise.resolve(),"function"===typeof this.storage.sync&&(this.storageSync=this.storage.sync()),this.params=i,this.file=n,this.totalBytes=this.file.size,this.bytesUploaded=0,this.emitter=r,this.queued=[],this.fileId=this._getFileId(s),this._val
1idateParams(),this.emitter.on(D.ERROR,function(){})}return Object.defineProperty(e.prototype,"percent",{get:function(){return this.bytesUploaded/this.totalBytes*100},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInProgress",{get:function(){return this.state===R.IN_PROGRESS},enumerable:!0,configurable:!0}),e.prototype._listSingleFile=function(e){var t=e.key,n=e.bucket;return pe(this,void 0,void 0,function(){var e,r,o,i;return de(this,function(s){switch(s.label){case 0:return[4,this.s3client.send(new h.u({Bucket:n,Prefix:t}))];case 1:return e=s.sent(),r=e.Contents,o=void 0===r?[]:r,[4,this.prefixPromise];case 2:return i=s.sent(),[2,o.find(function(e){return e.Key===""+i+t})]}})})},e.prototype._getFileId=function(e){return"undefined"!==typeof(t=this.file)&&t instanceof File?[this.file.name,this.file.lastModified,this.file.size,this.file.type,this.params.Bucket,e,this.params.Key].join("-"):[this.file.size,this.file.type,this.params.Bucket,e,this.params.Key].join("-");var t},e.prototype._findCachedUploadParts=function(){return pe(this,void 0,void 0,function(){var e,t;return de(this,function(n){switch(n.label){case 0:return[4,this._listCachedUploadTasks()];case 1:return e=n.sent(),0!==Object.keys(e).length&&Object.prototype.hasOwnProperty.call(e,this.fileId)?((t=e[this.fileId]).lastTouched=Date.now(),this.storage.setItem(x,JSON.stringify(e)),[4,this.s3client.send(new oe.m({Bucket:this.params.Bucket,Key:this.params.Key,UploadId:t.uploadId}))]):[2,{parts:[],uploadId:null}];case 2:return[2,{parts:n.sent().Parts||[],uploadId:t.uploadId}]}})})},e.prototype._emitEvent=function(e,t){this.emitter.emit(e,t)},e.prototype._validateParams=function(){if(this.file.size/this.partSize>1e4)throw new Error("Too many parts. Number of parts is "+this.file.size/this.partSize+", maximum is 10000.")},e.prototype._listCachedUploadTasks=function(){return pe(this,void 0,void 0,function(){var e;return de(this,function(t){switch(t.label){case 0:return[4,this.storageSync];case 1:return t.sent(),e=this.storage.getItem(x)||"{}",[2,JSON.parse(e)]}})})},e.prototype._cache=function(e){return pe(this,void 0,void 0,function(){var t;return de(this,function(n){switch(n.label){case 0:return[4,this._listCachedUploadTasks()];case 1:return(t=n.sent())[this.fileId]=e,this.storage.setItem(x,JSON.stringify(t)),[2]}})})},e.prototype._isCached=function(){return pe(this,void 0,void 0,function(){var e,t;return de(this,function(n){switch(n.label){case 0:return t=(e=Object.prototype.hasOwnProperty).call,[4,this._listCachedUploadTasks()];case 1:return[2,t.apply(e,[n.sent(),this.fileId])]}})})},e.prototype._removeFromCache=function(){return pe(this,void 0,void 0,function(){var e;return de(this,function(t){switch(t.label){case 0:return[4,this._listCachedUploadTasks()];case 1:return delete(e=t.sent())[this.fileId],this.storage.setItem(x,JSON.stringify(e)),[2]}})})},e.prototype._onPartUploadCompletion=function(e){var t=e.eTag,n=e.partNumber,r=e.chunk;return pe(this,void 0,void 0,function(){return de(this,function(e){return this.completedParts.push({ETag:t,PartNumber:n}),this.bytesUploaded+=function(e){if("string"===typeof e)return e.length;if(j(e))return e.byteLength;if(B(e))return e.size;throw new Error("Cannot determine byte length of "+e)}(r),this._emitEvent(D.UPLOAD_PROGRESS,{loaded:this.bytesUploaded,total:this.totalBytes}),this.inProgress=this.inProgress.filter(function(e){return e.uploadPartInput.PartNumber!==n}),this.queued.length&&this.state!==R.PAUSED&&this._startNextPart(),this._isDone()&&this._completeUpload(),[2]})})},e.prototype._completeUpload=function(){return pe(this,void 0,void 0,function(){var e;return de(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.s3client.send(new ne.G({Bucket:this.params.Bucket,Key:this.params.Key,UploadId:this.uploadId,MultipartUpload:{Parts:this.completedParts.sort(be)}}))];case 1:return t.sent(),this._verifyFileSize(),this._emitEvent(D.UPLOAD_COMPLETE,{key:this.params.Bucket+"/"+this.params.Key}),this._removeFromCache(),this.state=R.COMPLETED,[3,3];case 2:return e=t.sent(),ye.error("error completing upload",e),this._emitEvent(D.ERROR,e),[3,3];case 3:return[2]}})})},e.prototype._makeUploadPartRequest=function(e,t){return pe(this,void 0,void 0,function(){var n,r;return de(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.s3client.send(new te.i(e),{cancelTokenSource:t})];case 1:return n=o.sent(),[4,this._onPartUploadCompletion({eTag:n.ETag,partNumber:e.PartNumber,chunk:e.Body})];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),this.state===R.PAUSED?ye.log("upload paused"):this.state===R.CANCELLED?ye.log("upload aborted"):ye.error("error starting next part of upload: ",r),S().isCancel(r)||r.message===i.UPLOAD_PAUSED_MESSAGE||(this._emitEvent(D.ERROR,r),this.pause()),[3,4];case 4:return[2]}})})},e.prototype._startNextPart=function(){if(this.queued.length>0&&this.state!==R.PAUSED){var e=S().CancelToken.source(),t=this.queued.shift();this.inProgress.push({uploadPartInput:t,s3Request:this._makeUploadPartRequest
1(t,e),cancel:e.cancel})}},e.prototype._verifyFileSize=function(){return pe(this,void 0,void 0,function(){var e,t;return de(this,function(n){switch(n.label){case 0:return[4,this._listSingleFile({key:this.params.Key,bucket:this.params.Bucket})];case 1:if(e=n.sent(),!(t=Boolean(e&&e.Size===this.file.size)))throw new Error("File size does not match between local file and file on s3");return[2,t]}})})},e.prototype._isDone=function(){return!this.queued.length&&!this.inProgress.length&&this.bytesUploaded===this.totalBytes},e.prototype._createParts=function(){for(var e=this.file.size,t=[],n=0;n<e;){var r=Math.min(n+this.partSize,e);t.push({Body:this.file.slice(n,r),Key:this.params.Key,Bucket:this.params.Bucket,PartNumber:t.length+1,UploadId:this.uploadId}),n+=this.partSize}return t},e.prototype._initCachedUploadParts=function(e){this.bytesUploaded+=e.reduce(function(e,t){return e+t.Size},0);var t=new Set(e.map(function(e){return e.PartNumber}));this.queued=this.queued.filter(function(e){return!t.has(e.PartNumber)}),this.completedParts=e.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}),this._emitEvent(D.UPLOAD_PROGRESS,{loaded:this.bytesUploaded,total:this.totalBytes})},e.prototype._initMultipartUpload=function(){return pe(this,void 0,void 0,function(){var e;return de(this,function(t){switch(t.label){case 0:return[4,this.s3client.send(new ee.n(this.params))];case 1:return e=t.sent(),this._cache({uploadId:e.UploadId,lastTouched:Date.now(),bucket:this.params.Bucket,key:this.params.Key,fileName:this.file instanceof File?this.file.name:""}),[2,e.UploadId]}})})},e.prototype._initializeUploadTask=function(){return pe(this,void 0,void 0,function(){var e,t,n,r;return de(this,function(o){switch(o.label){case 0:this.state=R.IN_PROGRESS,o.label=1;case 1:return o.trys.push([1,7,,8]),[4,this._isCached()];case 2:return o.sent()?[4,this._findCachedUploadParts()]:[3,4];case 3:return e=o.sent(),t=e.parts,n=e.uploadId,this.uploadId=n,this.queued=this._createParts(),this._initCachedUploadParts(t),this._startUpload(),[3,6];case 4:return this.uploadId?[3,6]:[4,this._initMultipartUpload()];case 5:n=o.sent(),this.uploadId=n,this.queued=this._createParts(),this._startUpload(),o.label=6;case 6:return[3,8];case 7:return r=o.sent(),S().isCancel(r)||ye.error("Error initializing the upload task",r),[3,8];case 8:return[2]}})})},e.prototype.resume=function(){this.state===R.CANCELLED?ye.warn("This task has already been cancelled"):this.state===R.COMPLETED?ye.warn("This task has already been completed"):this.state===R.IN_PROGRESS?ye.warn("Upload task already in progress"):this.uploadId?this._startUpload():this._initializeUploadTask()},e.prototype._startUpload=function(){this.state=R.IN_PROGRESS;for(var e=0;e<this.queueSize;e++)this._startNextPart()},e.prototype._cancel=function(){return pe(this,void 0,void 0,function(){var e;return de(this,function(t){switch(t.label){case 0:return this.state!==R.CANCELLED?[3,1]:(ye.warn("This task has already been cancelled"),[2,!1]);case 1:return this.state!==R.COMPLETED?[3,2]:(ye.warn("This task has already been completed"),[2,!1]);case 2:this.pause(),this.queued=[],this.completedParts=[],this.bytesUploaded=0,this.state=R.CANCELLED,t.label=3;case 3:return t.trys.push([3,6,,7]),[4,this.s3client.send(new re.t({Bucket:this.params.Bucket,Key:this.params.Key,UploadId:this.uploadId}))];case 4:return t.sent(),[4,this._removeFromCache()];case 5:return t.sent(),[2,!0];case 6:return e=t.sent(),ye.error("Error cancelling upload task",e),[2,!1];case 7:return[2]}})})},e.prototype.pause=function(){var e;this.state===R.CANCELLED?ye.warn("This task has already been cancelled"):this.state===R.COMPLETED?ye.warn("This task has already been completed"):this.state===R.PAUSED&&ye.warn("This task is already paused"),this.state=R.PAUSED;var t=this.inProgress.splice(0,this.inProgress.length);t.forEach(function(e){e.cancel(i.UPLOAD_PAUSED_MESSAGE)}),(e=this.queued).unshift.apply(e,he(t.map(function(e){return e.uploadPartInput})))},e}(),_e=function(){return _e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_e.apply(this,arguments)}
1,ge=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(t){i(t)}}function a(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},me=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Se=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},we=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Se(arguments[t]));return e},Ce=new s.C("AWSS3Provider"),Ee="public",Oe=function(){function e(e){var t=this;this._config=e||{},this._storage=(new c.i1).getStorage(),u.YZ.listen("auth",function(e){var n=e.payload;"signOut"!==n.event&&"signIn"!==n.event||t._storage.removeItem(x)}),Ce.debug("Storage Options",this._config)}return e.prototype.getCategory=function(){return e.CATEGORY},e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.configure=function(e){if(Ce.debug("configure Storage",e),!e)return this._config;var t=a.iX.parseMobilehubConfig(e);return this._config=Object.assign({},this._config,t.Storage),this._config.bucket||Ce.debug("Do not have bucket yet"),this._config},e.prototype.startResumableUpload=function(e,t){var n=e.s3Client,o=e.emitter,i=e.key,s=e.file,a=e.params,c=t.progressCallback,u=t.completeCallback,p=t.errorCallback,d=t.track,f=void 0!==d&&d;if(!(s instanceof Blob))throw new Error(r.INVALID_BLOB);o.on(D.UPLOAD_PROGRESS,function(e){c&&("function"===typeof c?c(e):Ce.warn("progressCallback should be a function, not a "+typeof c))}),o.on(D.UPLOAD_COMPLETE,function(e){u&&("function"===typeof u?u(e):Ce.warn("completeCallback should be a function, not a "+typeof u))}),o.on(D.ERROR,function(e){p&&("function"===typeof p?p(e):Ce.warn("errorCallback should be a function, not a "+typeof p))});var h=l.Ji.get().then(function(e){var n=l.Ji.shear(e);return W(_e(_e({},t),{credentials:n}))}),y=new ve({s3Client:n,file:s,emitter:o,level:t.level,storage:this._storage,params:a,prefixPromise:h});return U(f,"upload",{method:"put",result:"success"},null,"Upload Task created successfully for "+i),y.resume(),y},e.prototype.copy=function(e,t,n){return ge(this,void 0,void 0,function(){var o,i,s,a,c,u,l,d,f,h,y,b,v,_,g,m,S,w,C,E,O,k,P,T,N;return me(this,function(I){switch(I.label){case 0:return[4,this._ensureCredentials()];case 1:if(!I.sent()||!this._isWithCredentials(this._config))throw new Error(r.NO_CREDENTIALS);if(o=Object.assign({},this._config,n),i=o.acl,s=o.bucket,a=o.cacheControl,c=o.expires,u=o.track,l=o.serverSideEncryption,d=o.SSECustomerAlgorithm,f=o.SSECustomerKey,h=o.SSECustomerKeyMD5,y=o.SSEKMSKeyId,b=e.level,v=void 0===b?Ee:b,_=e.identityId,g=e.key,m=t.level,S=void 0===m?Ee:m,w=t.key,!g||"string"!==typeof g)throw new Error(r.NO_SRC_KEY);if(!w||"string"!==typeof w)throw new Error(r.NO_DEST_KEY);"protected"!==v&&_&&Ce.warn('You may copy files from another user if the source level is "protected", currently it\'s '+v),C=this._prefix(_e(_e(_e({},o),{level:v}),_&&{identityId:_})),E=this._prefix(_e(_e({},o),{level:S})),O=s+"/"+C+g,k=""+E+w,Ce.debug("copying "+O+" to "+k),P={Bucket:s,CopySource:O,Key:k,MetadataDirective:"COPY"}
1,a&&(P.CacheControl=a),c&&(P.Expires=c),l&&(P.ServerSideEncryption=l),d&&(P.SSECustomerAlgorithm=d),f&&(P.SSECustomerKey=f),h&&(P.SSECustomerKeyMD5=h),y&&(P.SSEKMSKeyId=y),i&&(P.ACL=i),T=this._createNewS3Client(o),I.label=2;case 2:return I.trys.push([2,4,,5]),[4,T.send(new p.s(P))];case 3:return I.sent(),U(u,"copy",{method:"copy",result:"success"},null,"Copy success from "+g+" to "+w),[2,{key:w}];case 4:throw N=I.sent(),U(u,"copy",{method:"copy",result:"failed"},null,"Copy failed from "+g+" to "+w),N;case 5:return[2]}})})},e.prototype.get=function(e,t){return ge(this,void 0,void 0,function(){var n,o,i,s,a,c,u,l,p,f,h,_,g,m,S,w,C,E,O,k,T,N,I,A,R,D,L;return me(this,function(M){switch(M.label){case 0:return[4,this._ensureCredentials()];case 1:if(!M.sent()||!this._isWithCredentials(this._config))throw new Error(r.NO_CREDENTIALS);if(n=Object.assign({},this._config,t),o=n.bucket,i=n.download,s=n.cacheControl,a=n.contentDisposition,c=n.contentEncoding,u=n.contentLanguage,l=n.contentType,p=n.expires,f=n.track,h=n.SSECustomerAlgorithm,_=n.SSECustomerKey,g=n.SSECustomerKeyMD5,m=n.progressCallback,S=this._prefix(n),w=S+e,C=new ie.EventEmitter,E=this._createNewS3Client(n,C),Ce.debug("get "+e+" from "+w),O={Bucket:o,Key:w},s&&(O.ResponseCacheControl=s),a&&(O.ResponseContentDisposition=a),c&&(O.ResponseContentEncoding=c),u&&(O.ResponseContentLanguage=u),l&&(O.ResponseContentType=l),h&&(O.SSECustomerAlgorithm=h),_&&(O.SSECustomerKey=_),g&&(O.SSECustomerKeyMD5=g),!0!==i)return[3,5];k=new d.j(O),M.label=2;case 2:return M.trys.push([2,4,,5]),m&&("function"===typeof m?C.on(P,function(e){m(e)}):Ce.warn("progressCallback should be a function, not a "+typeof m)),[4,E.send(k)];case 3:return T=M.sent(),C.removeAllListeners(P),U(f,"download",{method:"get",result:"success"},{fileSize:Number(T.Body.size||T.Body.length)},"Download success for "+e),[2,T];case 4:throw N=M.sent(),U(f,"download",{method:"get",result:"failed"},null,"Download failed with "+N.message),N;case 5:return M.trys.push([5,8,,9]),I=new v.n(_e({},E.config)),[4,(0,b.W)(E,new d.j(O))];case 6:return A=M.sent(),D=y.J,[4,I.presign(A,{expiresIn:p||900})];case 7:return R=D.apply(void 0,[M.sent()]),U(f,"getSignedUrl",{method:"get",result:"success"},null,"Signed URL: "+R),[2,R];case 8:throw L=M.sent(),Ce.warn("get signed url error",L),U(f,"getSignedUrl",{method:"get",result:"failed"},null,"Could not get a signed URL for "+e),L;case 9:return[2]}})})},e.prototype.put=function(e,t,n){var r=Object.assign({},this._config,n),o=r.bucket,i=r.track,s=r.progressCallback,a=r.level,c=r.resumable,u=r.contentType,l=r.contentDisposition,p=r.contentEncoding,d=r.cacheControl,f=r.expires,h=r.metadata,y=r.tagging,b=r.acl,v=r.serverSideEncryption,_=r.SSECustomerAlgorithm,g=r.SSECustomerKey,m=r.SSECustomerKeyMD5,S=r.SSEKMSKeyId,w={Bucket:o,Key:e,Body:t,ContentType:u||"binary/octet-stream"};d&&(w.CacheControl=d),l&&(w.ContentDisposition=l),p&&(w.ContentEncoding=p),f&&(w.Expires=f),h&&(w.Metadata=h),y&&(w.Tagging=y),v&&(w.ServerSideEncryption=v),_&&(w.SSECustomerAlgorithm=_),g&&(w.SSECustomerKey=g),m&&(w.SSECustomerKeyMD5=m),S&&(w.SSEKMSKeyId=S);var C=new ie.EventEmitter,E=new le(w,r,C);if(b&&(w.ACL=b),!0===c){var O=this._createNewS3Client(r);O.middlewareStack.add(J(r,e),Y);var P={bucket:o,key:e,s3Client:O,file:t,emitter:C,accessLevel:a,params:w};return this.startResumableUpload(P,n)}try{return s&&("function"===typeof s?C.on(k,function(e){s(e)}):Ce.warn("progressCallback should be a function, not a "+typeof s)),E.upload().then(function(t){return Ce.debug("upload result",t),U(i,"upload",{method:"put",result:"success"},null,"Upload success for "+e),{key:e}})}catch(T){throw Ce.warn("error uploading",T),U(i,"upload",{method:"put",result:"failed"},null,"Error uploading "+e),T}},e.prototype.remove=function(e,t){return ge(this,void 0,void 0,function(){var n,o,i,s,a,c,u,l,p,d;return me(this,function(h){switch(h.label){case 0:return[4,this._ensureCredentials()];case 1:if(!h.sent()||!this._isWithCredentials(this._config))throw new Error(r.NO_CREDENTIALS);n=Object.assign({},this._config,t),o=n.bucket,i=n.track,s=this._prefix(n),a=s+e,c=this._createNewS3Client(n),Ce.debug("remove "+e+" from "+a),u={Bucket:o,Key:a},l=new f.k(u),h.label=2;case 2:return h.trys.push([2,4,,5]),[4,c.send(l)];case 3:return p=h.sent(),U(i,"delete",{method:"remove",result:"success"},null,"Deleted "+e+" successfully"),[2,p];case 4:throw d=h.sent(),U(i,"delete",{method:"remove",result:"failed"}
1,null,"Deletion of "+e+" failed with "+d),d;case 5:return[2]}})})},e.prototype._list=function(e,t,n){return ge(this,void 0,void 0,function(){var r,o,i,s;return me(this,function(a){switch(a.label){case 0:return r={contents:[],nextToken:""},o=this._createNewS3Client(t),i=new h.u(_e({},e)),[4,o.send(i)];case 1:return(s=a.sent())&&s.Contents&&(r.contents=s.Contents.map(function(e){return{key:e.Key.substr(n.length),eTag:e.ETag,lastModified:e.LastModified,size:e.Size}}),r.nextToken=s.NextContinuationToken),[2,r]}})})},e.prototype.list=function(e,t){return ge(this,void 0,void 0,function(){var n,o,i,s,a,c,u,l,p,d,f;return me(this,function(h){switch(h.label){case 0:return[4,this._ensureCredentials()];case 1:if(!h.sent()||!this._isWithCredentials(this._config))throw new Error(r.NO_CREDENTIALS);n=Object.assign({},this._config,t),o=n.bucket,i=n.track,s=n.maxKeys,a=this._prefix(n),c=a+e,Ce.debug("list "+e+" from "+c),h.label=2;case 2:if(h.trys.push([2,10,,11]),u=[],l=void 0,p=void 0,d={Bucket:o,Prefix:c,MaxKeys:1e3},"ALL"!==s)return[3,7];h.label=3;case 3:return d.ContinuationToken=l,d.MaxKeys=1e3,[4,this._list(d,n,a)];case 4:p=h.sent(),u.push.apply(u,we(p.contents)),p.nextToken&&(l=p.nextToken),h.label=5;case 5:if(p.nextToken)return[3,3];h.label=6;case 6:return[3,9];case 7:return d.MaxKeys=s<1e3||"string"===typeof s?s:1e3,[4,this._list(d,n,a)];case 8:p=h.sent(),u.push.apply(u,we(p.contents)),s>1e3&&Ce.warn("maxkeys can be from 0 - 1000 or 'ALL'. To list all files you can set maxKeys to 'ALL'."),h.label=9;case 9:return U(i,"list",{method:"list",result:"success"},null,u.length+" items returned from list operation"),Ce.debug("list",u),[2,u];case 10:throw f=h.sent(),Ce.warn("list error",f),U(i,"list",{method:"list",result:"failed"},null,"Listing items failed: "+f.message),f;case 11:return[2]}})})},e.prototype._ensureCredentials=function(){return ge(this,void 0,void 0,function(){var e,t,n;return me(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,l.Ji.get()];case 1:return(e=r.sent())?(t=l.Ji.shear(e),Ce.debug("set credentials for storage",t),this._config.credentials=t,[2,!0]):[2,!1];case 2:return n=r.sent(),Ce.warn("ensure credentials error",n),[2,!1];case 3:return[2]}})})},e.prototype._isWithCredentials=function(e){return"object"===typeof e&&e.hasOwnProperty("credentials")},e.prototype._prefix=function(e){var t=e.credentials,n=e.level,r=e.customPrefix||{},o=e.identityId||t.identityId,i=(void 0!==r.private?r.private:"private/")+o+"/",s=(void 0!==r.protected?r.protected:"protected/")+o+"/",a=void 0!==r.public?r.public:"public/";switch(n){case"private":return i;case"protected":return s;default:return a}},e.prototype._createNewS3Client=function(e,t){var n=Z(e,t);return n.middlewareStack.add(Q(n.config),X),n},e.CATEGORY="Storage",e.PROVIDER_NAME="AWSS3",e}();var ke=function(){return ke=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ke.apply(this,arguments)},Pe=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},Te=new s.C("StorageClass"),Ne="AWSS3",Ie=function(){function e(){this._config={},this._pluggables=[],this._cancelTokenSourceMap=new WeakMap,Te.debug("Storage Options",this._config),this.get=this.get.bind(this),this.put=this.put.bind(this),this.remove=this.remove.bind(this),this.list=this.list.bind(this)}return e.prototype.getModuleName=function(){return"Storage"},e.prototype.addPluggable=function(e){if(e&&"Storage"===e.getCategory()){this._pluggables.push(e);return e.configure(this._config[e.getProviderName()])}},e.prototype.getPluggable=function(e){var t=this._pluggables.find(function(t){return t.getProviderName()===e});return void 0===t?(Te.debug("No plugin found with providerName",e),null):t},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter(function(t){return t.getProviderName()!==e})},e.prototype.configure=function(e){var t=this;if(Te.debug("configure Storage"),!e)return this._config;var n=a.iX.parseMobilehubConfig(e),r=Object.keys(n.Storage),o=["bucket","region","level","track","customPrefix","serverSideEncryption","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId"],i=function(e){return o.some(function(t){return t===e})};return r&&r.find(function(e){return i(e)})&&!n.Storage[Ne]&&(n.Storage[Ne]={}),Object.entries(n.Storage).map(function(e){var t=Pe(e,2),r=t[0],o=t[1];r&&i(r)&&void 0!==o&&(n.Storage[Ne][r]=o,delete n.Storage[r])}),Object.keys(n.Storage).forEach(function(e){"string"!==typeof n.Storage[e]&&(t._config[e]=ke(ke({},t._config[e]),n.Storage[e]))}
1),this._pluggables.forEach(function(e){e.configure(t._config[e.getProviderName()])}),0===this._pluggables.length&&this.addPluggable(new Oe),this._config},e.prototype.getCancellableTokenSource=function(){return S().CancelToken.source()},e.prototype.updateRequestToBeCancellable=function(e,t){this._cancelTokenSourceMap.set(e,t)},e.prototype.isUploadTask=function(e){return"undefined"!==typeof e&&"function"===typeof e.pause&&"function"===typeof e.resume},e.prototype.cancel=function(e,t){if(e instanceof ve)return e._cancel();var n=this._cancelTokenSourceMap.get(e);n?n.cancel(t):Te.debug("The request does not map to any cancel token")},e.prototype.copy=function(e,t,n){var r=(null===n||void 0===n?void 0:n.provider)||Ne,o=this._pluggables.find(function(e){return e.getProviderName()===r});if(void 0===o)return Te.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider");var i=this.getCancellableTokenSource();if("function"!==typeof o.copy)return Promise.reject(".copy is not implemented on provider "+o.getProviderName());var s=o.copy(e,t,ke(ke({},n),{cancelTokenSource:i}));return this.updateRequestToBeCancellable(s,i),s},e.prototype.get=function(e,t){var n=(null===t||void 0===t?void 0:t.provider)||Ne,r=this._pluggables.find(function(e){return e.getProviderName()===n});if(void 0===r)return Te.debug("No plugin found with providerName",n),Promise.reject("No plugin found in Storage for the provider");var o=this.getCancellableTokenSource(),i=r.get(e,ke(ke({},t),{cancelTokenSource:o}));return this.updateRequestToBeCancellable(i,o),i},e.prototype.isCancelError=function(e){return S().isCancel(e)},e.prototype.put=function(e,t,n){var r=(null===n||void 0===n?void 0:n.provider)||Ne,o=this._pluggables.find(function(e){return e.getProviderName()===r});if(void 0===o)return Te.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider");var i=this.getCancellableTokenSource(),s=o.put(e,t,ke(ke({},n),{cancelTokenSource:i}));return this.isUploadTask(s)||this.updateRequestToBeCancellable(s,i),s},e.prototype.remove=function(e,t){var n=(null===t||void 0===t?void 0:t.provider)||Ne,r=this._pluggables.find(function(e){return e.getProviderName()===n});return void 0===r?(Te.debug("No plugin found with providerName",n),Promise.reject("No plugin found in Storage for the provider")):r.remove(e,t)},e.prototype.list=function(e,t){var n=(null===t||void 0===t?void 0:t.provider)||Ne,r=this._pluggables.find(function(e){return e.getProviderName()===n});return void 0===r?(Te.debug("No plugin found with providerName",n),Promise.reject("No plugin found in Storage for the provider")):r.list(e,t)},e}();var Ae=n(79906),Re=function(){return Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Re.apply(this,arguments)},De=new s.C("Storage"),Le=null,Me=function(){if(Le)return Le;De.debug("Create Storage Instance, debug"),(Le=new Ie).vault=new Ie;var e=Le.configure;return Le.configure=function(t){De.debug("storage configure called");var n=Re({},e.call(Le,t));Object.keys(n).forEach(function(e){"string"!==typeof n[e]&&(n[e]=Re(Re({},n[e]),{level:"private"}))}),De.debug("storage vault configure called"),Le.vault.configure(n)},Le}();Ae.HA.register(Me)},42225:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r}
1,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1)),r(n(2)),r(n(3)),r(n(4)),r(n(5)),r(n(6)),r(n(7)),r(n(8)),r(n(9)),r(n(10)),r(n(11)),r(n(12)),r(n(13))},function(e,t,n){e.exports={a:"Anchor__a___1_Iz8"}},function(e,t,n){e.exports={button:"Button__button___vS7Mv",signInButton:"Button__signInButton___3bUH-",googleSignInButton:"Button__googleSignInButton___1YiCu",signInButtonIcon:"Button__signInButtonIcon___ihN75",auth0SignInButton:"Button__auth0SignInButton___znnCj",facebookSignInButton:"Button__facebookSignInButton___34Txh",amazonSignInButton:"Button__amazonSignInButton___2EMtl",oAuthSignInButton:"Button__oAuthSignInButton___3UGOl",signInButtonContent:"Button__signInButtonContent___xqTXJ"}},function(e,t,n){e.exports={formContainer:"Form__formContainer___1GA3x",formSection:"Form__formSection___1PPvW",formField:"Form__formField___38Ikl",formRow:"Form__formRow___2mwRs"}},function(e,t,n){e.exports={hint:"Hint__hint___2XngB"}},function(e,t,n){e.exports={input:"Input__input___3e_bf",inputLabel:"Input__inputLabel___3VF0S",label:"Input__label___23sO8",radio:"Input__radio___2hllK"}},function(e,t,n){e.exports={navBar:"Nav__navBar___xtCFA",navRight:"Nav__navRight___1QG2J",nav:"Nav__nav___2Dx2Y",navItem:"Nav__navItem___1LtFQ"}},function(e,t,n){e.exports={photoPickerButton:"PhotoPicker__photoPickerButton___2XdVn",photoPlaceholder:"PhotoPicker__photoPlaceholder___2JXO4",photoPlaceholderIcon:"PhotoPicker__photoPlaceholderIcon___3Et71"}},function(e,t,n){e.exports={container:"Section__container___3YYTG",actionRow:"Section__actionRow___2LWSU",sectionHeader:"Section__sectionHeader___2djyg",sectionHeaderHint:"Section__sectionHeaderHint___3Wxdc",sectionBody:"Section__sectionBody___ihqqd",sectionHeaderContent:"Section__sectionHeaderContent___1UCqa",sectionFooter:"Section__sectionFooter___1T54C",sectionFooterPrimaryContent:"Section__sectionFooterPrimaryContent___2r9ZX",sectionFooterSecondaryContent:"Section__sectionFooterSecondaryContent___Nj41Q"}},function(e,t,n){e.exports={selectInput:"SelectInput__selectInput___3efO4"}},function(e,t,n){e.exports={strike:"Strike__strike___1XV1b",strikeContent:"Strike__strikeContent___10gLb"}},function(e,t,n){e.exports={toast:"Toast__toast___XXr3v",toastClose:"Toast__toastClose___18lU4"}},function(e,t,n){e.exports={totpQrcode:"Totp__totpQrcode___1crLx"}},function(e,t,n){e.exports={sumerianSceneContainer:"XR__sumerianSceneContainer___3nVMt",sumerianScene:"XR__sumerianScene___2Tt7-",loadingOverlay:"XR__loadingOverlay___IbqcI",loadingContainer:"XR__loadingContainer___2Itxb",loadingLogo:"XR__loadingLogo___Ub7xQ",loadingSceneName:"XR__loadingSceneName___3__ne",loadingBar:"XR__loadingBar___2vcke",loadingBarFill:"XR__loadingBarFill___3M-D9",sceneErrorText:"XR__sceneErrorText___2y0tp",sceneBar:"XR__sceneBar___2ShrP",sceneName:"XR__sceneName___1ApHr",sceneActions:"XR__sceneActions___7plGs",actionButton:"XR__actionButton___2poIM",tooltip:"XR__tooltip___UYyhn",actionIcon:"XR__actionIcon___2qnd2",autoShowTooltip:"XR__autoShowTooltip___V1QH7"}}])},44754:(e,t,n)=>{var r,o,i=n(70663),s=n(67946),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,l=t||[],p=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==p||null==d){var f=i();null==p&&(p=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==d&&(d=o=16383&(f[6]<<8|f[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,b=h-a+(y-c)/1e4;if(b<0&&void 0===e.clockseq&&(d=d+1&16383),(b<0||h>a)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,c=y,o=d;var v=(1e4*(268435455&(h+=122192928e5))+y)%4294967296;l[u++]=v>>>24&255,l[u++]=v>>>16&255,l[u++]=v>>>8&255,l[u++]=255&v;var _=h/4294967296*1e4&268435455;l[u++]=_>>>8&255,l[u++]=255&_,l[u++]=_>>>24&15|16,l[u++]=_>>>16&255,l[u++]=d>>>8|128,l[u++]=255&d;for(var g=0;g<6;++g)l[u+g]=p[g];return t||s(l)}}
vendor: 1,093 bytes, line 1
1,48733:(e,t,n)=>{var r=n(70663),o=n(67946);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||o(s)}},67946:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,o=t;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},70663:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},82875:(e,t,n)=>{var r=n(44754),o=n(48733),i=o;i.v1=r,i.v4=o,e.exports=i}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.