diff --git a/README.md b/README.md index 67f5786..5241d74 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Try out the Li Runtime Dependencies: * Angular: `^4.0.0 || ^5.0.0 || ^6.0.0` * RxJs: `^5.0.0 || ^6.0.0` -* App must be served on secure context (https or localhost) +* App must be served on a secure context (https or localhost) Client: * [Current Browser](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Browser_compatibility) w/ HTML5 and WebRTC/UserMedia support (Chrome >53, Safari >11, Firefox >38, Edge) @@ -64,6 +64,7 @@ This section describes the basic Inputs/Outputs of the component. * `width: number`: The maximal video width of the webcam live view. * `height: number`: The maximal video height of the webcam live view. The actual view will be placed within these boundaries, respecting the aspect ratio of the video stream. * `videoOptions: MediaTrackConstraints`: Defines constraints ([MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints)) to apply when requesting the video track. +* `mirrorImage: string | WebcamMirrorProperties`: Flag to control image mirroring. Default: If a webcam claims to be user-facing, the image will be mirrored (x-axis) to provide a better user experience. A value of `never` will prevent mirroring, whereas a value of `always` will mirror every webcam stream, even if the webcam cannot be detected as user-facing. For future extensions, the `WebcamMirrorProperties` object can also be used to set these properties. * `allowCameraSwitch: boolean`: Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras are found. * `switchCamera: Observable`: Can be used to cycle through available cameras (true=forward, false=backwards), or to switch to a specific device by deviceId (string). diff --git a/docs/index.html b/docs/index.html index 6510db0..12acddf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,5 +9,5 @@ - + diff --git a/docs/main.15e19bcb6ef46f19ec17.js b/docs/main.4a9bc930d379c3f4ea24.js similarity index 52% rename from docs/main.15e19bcb6ef46f19ec17.js rename to docs/main.4a9bc930d379c3f4ea24.js index 11f0f4a..2e7cdd2 100644 --- a/docs/main.15e19bcb6ef46f19ec17.js +++ b/docs/main.4a9bc930d379c3f4ea24.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{3:function(e,t,n){e.exports=n("zUnb")},crnd:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error('Cannot find module "'+e+'".');throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="crnd"},zUnb:function(e,t,n){"use strict";n.r(t);var r=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])};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(B);function J(e){return e}var Y=function(e){function t(){var n=e.call(this,"object unsubscribed")||this;return n.name="ObjectUnsubscribedError",Object.setPrototypeOf(n,t.prototype),n}return c(t,e),t}(Error),K=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return c(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(E),X=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return c(t,e),t}(A),$=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return c(t,e),t.prototype[S]=function(){return new X(this)},t.prototype.lift=function(e){var t=new ee(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new Y;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(A),oe=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return c(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new E).add(this.source.subscribe(new ae(this.getSubject(),this))),e.closed?(this._connection=null,e=E.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return te()(this)},t}(O).prototype,ie={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:oe._subscribe},_isComplete:{value:oe._isComplete,writable:!0},getSubject:{value:oe.getSubject},connect:{value:oe.connect},refCount:{value:oe.refCount}},ae=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return c(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(X);function ue(){return new $}function se(e){return{providedIn:e.providedIn||null,factory:e.factory,value:void 0}}var le=function(){function e(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==t?se({providedIn:t.providedIn||"root",factory:t.factory}):void 0}return e.prototype.toString=function(){return"InjectionToken "+this._desc},e}(),ce="__parameters__";function de(e,t,n){var r=function(e){return function(){for(var t=[],n=0;n ");else if("object"==typeof t){var o=[];for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];o.push(i+":"+("string"==typeof a?JSON.stringify(a):Ee(a)))}r="{"+o.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+e.replace(Ue,"\n ")}function Qe(e,t){return new Error(We(e,t))}var qe=void 0;function Je(e){var t=qe;return qe=e,t}String;var Ye=function(e){return e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None",e}(Ye||(Ye={})),Ke=new function(e){this.full="6.0.2",this.major="6.0.2".split(".")[0],this.minor="6.0.2".split(".")[1],this.patch="6.0.2".split(".").slice(2).join(".")}("6.0.2"),Xe="ngDebugContext",$e="ngOriginalError",et="ngErrorLogger";function tt(e){return e[Xe]}function nt(e){return e[$e]}function rt(e){for(var t=[],n=1;n0&&(o=setTimeout(function(){r._callbacks=r._callbacks.filter(function(e){return e.timeoutId!==o}),e(r._didWork,r.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:o,updateCb:n})},e.prototype.whenStable=function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.findProviders=function(e,t,n){return[]},e}(),zt=function(){function e(){this._applications=new Map,Zt.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.unregisterApplication=function(e){this._applications.delete(e)},e.prototype.unregisterAllApplications=function(){this._applications.clear()},e.prototype.getTestability=function(e){return this._applications.get(e)||null},e.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},e.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),Zt.findTestabilityInTree(this,e,t)},e.ctorParameters=function(){return[]},e}(),Zt=new(function(){function e(){}return e.prototype.addToWindow=function(e){},e.prototype.findTestabilityInTree=function(e,t,n){return null},e}()),Gt=!0,Wt=!1,Qt=new le("AllowMultipleToken");function qt(){return Wt=!0,Gt}var Jt=function(e,t){this.name=e,this.token=t};function Yt(e,t,n){void 0===n&&(n=[]);var r="Platform: "+t,o=new le(r);return function(t){void 0===t&&(t=[]);var i=Kt();if(!i||i.injector.get(Qt,!1))if(e)e(n.concat(t).concat({provide:o,useValue:!0}));else{var a=n.concat(t).concat({provide:o,useValue:!0});!function(e){if(Lt&&!Lt.destroyed&&!Lt.injector.get(Qt,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lt=e.get(Xt);var t=e.get(pt,null);t&&t.forEach(function(e){return e()})}(De.create({providers:a,name:r}))}return function(e){var t=Kt();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(o)}}function Kt(){return Lt&&!Lt.destroyed?Lt:null}var Xt=function(){function e(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return e.prototype.bootstrapModuleFactory=function(e,t){var n,r=this,o="noop"===(n=t?t.ngZone:void 0)?new Bt:("zone.js"===n?void 0:n)||new Dt({enableLongStackTrace:qt()}),i=[{provide:Dt,useValue:o}];return o.run(function(){var t=De.create({providers:i,parent:r.injector,name:e.moduleType.name}),n=e.create(t),a=n.injector.get(ot,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return tn(r._modules,n)}),o.runOutsideAngular(function(){return o.onError.subscribe({next:function(e){a.handleError(e)}})}),function(e,t,o){try{var i=((a=n.injector.get(st)).runInitializers(),a.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return at(i)?i.catch(function(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}):i}catch(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}var a}(a,o)})},e.prototype.bootstrapModule=function(e,t){var n=this;void 0===t&&(t=[]);var r=this.injector.get(mt),o=$t({},t);return r.createCompiler([o]).compileModuleAsync(e).then(function(e){return n.bootstrapModuleFactory(e,o)})},e.prototype._moduleDoBootstrap=function(e){var t=e.injector.get(en);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+Ee(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}this._modules.push(e)},e.prototype.onDestroy=function(e){this._destroyListeners.push(e)},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),e}();function $t(e,t){return Array.isArray(t)?t.reduce($t,e):i({},e,t)}var en=function(){function e(e,t,n,r,o,i){var a=this;this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=o,this._initStatus=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=qt(),this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var u=new O(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),s=new O(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Dt.assertNotInAngularZone(),we(function(){a._stable||a._zone.hasPendingMacrotasks||a._zone.hasPendingMicrotasks||(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Dt.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=function(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof i&&(r=e.pop()),null===o&&1===e.length&&e[0]instanceof O?e[0]:function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),function e(t,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(o){return o.pipe(e(function(e,r){return W(t(e,r)).pipe(U(function(t,o){return n(e,t,r,o)}))},r))}:("number"==typeof n&&(r=n),function(e){return e.lift(new Q(t,r))})}(J,e)}(r)(G(e,o))}(u,s.pipe(function(e){return te()((t=ue,function(e){var n;n="function"==typeof t?t:function(){return t};var r=Object.create(e,ie);return r.source=e,r.subjectFactory=n,r})(e));var t}))}return e.prototype.bootstrap=function(e,t){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof _t?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var o=n instanceof Tt?null:this._injector.get(It),i=n.create(De.NULL,[],t||n.selector,o);i.onDestroy(function(){r._unloadComponent(i)});var a=i.injector.get(Ut,null);return a&&i.injector.get(zt).registerApplication(i.location.nativeElement,a),this._loadComponent(i),qt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),i},e.prototype.tick=function(){var t=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=e._tickScope();try{this._runningTick=!0,this._views.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(e){return e.checkNoChanges()})}catch(e){this._zone.runOutsideAngular(function(){return t._exceptionHandler.handleError(e)})}finally{this._runningTick=!1,Pt(n)}},e.prototype.attachView=function(e){var t=e;this._views.push(t),t.attachToAppRef(this)},e.prototype.detachView=function(e){var t=e;tn(this._views,t),t.detachFromAppRef()},e.prototype._loadComponent=function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(ht,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})},e.prototype._unloadComponent=function(e){this.detachView(e.hostView),tn(this.components,e)},e.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(e.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),e._tickScope=Vt("ApplicationRef#tick()"),e}();function tn(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var nn=function(){},rn=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(rn||(rn={})),on=function(){},an=function(e){this.nativeElement=e},un=function(){function e(){this.dirty=!0,this._results=[],this.changes=new Nt,this.length=0}return e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.find=function(e){return this._results.find(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.forEach=function(e){this._results.forEach(e)},e.prototype.some=function(e){return this._results.some(e)},e.prototype.toArray=function(){return this._results.slice()},e.prototype[be()]=function(){return this._results[be()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=function e(t){return t.reduce(function(t,n){var r=Array.isArray(n)?e(n):n;return t.concat(r)},[])}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},e.prototype.notifyOnChanges=function(){this.changes.emit(this)},e.prototype.setDirty=function(){this.dirty=!0},e.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},e}(),sn=function(){},ln=function(){},cn=function(){function e(e,t,n){this._debugContext=n,this.nativeNode=e,t&&t instanceof dn?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),e}(),dn=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.properties={},o.attributes={},o.classes={},o.styles={},o.childNodes=[],o.nativeElement=t,o}return o(t,e),t.prototype.addChild=function(e){e&&(this.childNodes.push(e),e.parent=this)},t.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))},t.prototype.insertChildrenAfter=function(e,t){var n,r=this,o=this.childNodes.indexOf(e);-1!==o&&((n=this.childNodes).splice.apply(n,s([o+1,0],t)),t.forEach(function(e){e.parent&&e.parent.removeChild(e),e.parent=r}))},t.prototype.insertBefore=function(e,t){var n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))},t.prototype.query=function(e){return this.queryAll(e)[0]||null},t.prototype.queryAll=function(e){var t=[];return function e(t,n,r){t.childNodes.forEach(function(t){t instanceof dn&&(n(t)&&r.push(t),e(t,n,r))})}(this,e,t),t},t.prototype.queryAllNodes=function(e){var t=[];return function e(t,n,r){t instanceof dn&&t.childNodes.forEach(function(t){n(t)&&r.push(t),t instanceof dn&&e(t,n,r)})}(this,e,t),t},Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes.filter(function(e){return e instanceof t})},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(n){n.name==e&&n.callback(t)})},t}(cn),pn=new Map;function fn(e){return pn.get(e)||null}function hn(e){pn.set(e.nativeNode,e)}function yn(e,t){var n=mn(e),r=mn(t);return n&&r?function(e,t,n){for(var r=e[be()](),o=t[be()]();;){var i=r.next(),a=o.next();if(i.done&&a.done)return!0;if(i.done||a.done)return!1;if(!n(i.value,a.value))return!1}}(e,t,yn):!(n||!e||"object"!=typeof e&&"function"!=typeof e||r||!t||"object"!=typeof t&&"function"!=typeof t)||Ce(e,t)}var vn=function(){function e(e){this.wrapped=e}return e.wrap=function(t){return new e(t)},e.unwrap=function(t){return e.isWrapped(t)?t.wrapped:t},e.isWrapped=function(t){return t instanceof e},e}(),gn=function(){function e(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}return e.prototype.isFirstChange=function(){return this.firstChange},e}();function mn(e){return!!_n(e)&&(Array.isArray(e)||!(e instanceof Map)&&be()in e)}function _n(e){return null!==e&&("function"==typeof e||"object"==typeof e)}var bn=function(){function e(){}return e.prototype.supports=function(e){return mn(e)},e.prototype.create=function(e){return new Cn(e)},e}(),wn=function(e,t){return t},Cn=function(){function e(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||wn}return e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachOperation=function(e){for(var t=this._itHead,n=this._removalsHead,r=0,o=null;t||n;){var i=!n||t&&t.currentIndex',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='

',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return e.prototype.getInertBodyElement_XHR=function(e){e=""+e+"";try{e=encodeURI(e)}catch(e){return null}var t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(null);var n=t.response.body;return n.removeChild(n.firstChild),n},e.prototype.getInertBodyElement_DOMParser=function(e){e=""+e+"";try{var t=(new window.DOMParser).parseFromString(e,"text/html").body;return t.removeChild(t.firstChild),t}catch(e){return null}},e.prototype.getInertBodyElement_InertDocument=function(e){var t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},e.prototype.stripCustomNsAttrs=function(e){for(var t=e.attributes,n=t.length-1;0")}else this.sanitizedSomething=!0},e.prototype.endElement=function(e){var t=e.nodeName.toLowerCase();$n.hasOwnProperty(t)&&!Jn.hasOwnProperty(t)&&(this.buf.push(""))},e.prototype.chars=function(e){this.buf.push(ar(e))},e.prototype.checkClobberedElement=function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t},e}(),or=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ir=/([^\#-~ |!])/g;function ar(e){return e.replace(/&/g,"&").replace(or,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ir,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function ur(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var sr=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),lr=/^url\(([^)]+)\)$/,cr=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(cr||(cr={})),dr=function(){};function pr(e,t,n){var r=e.state,o=1792&r;return o===t?(e.state=-1793&r|n,e.initIndex=-1,!0):o===n}function fr(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function hr(e,t){return e.nodes[t]}function yr(e,t){return e.nodes[t]}function vr(e,t){return e.nodes[t]}function gr(e,t){return e.nodes[t]}function mr(e,t){return e.nodes[t]}var _r={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function br(e,t,n,r){var o="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+t+"'. Current value: '"+n+"'.";return r&&(o+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(e,t){var n=new Error(e);return wr(n,t),n}(o,e)}function wr(e,t){e[Xe]=t,e[et]=t.logError.bind(t)}function Cr(e){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+e)}var Er=function(){},xr=new Map;function Sr(e){var t=xr.get(e);return t||(t=Ee(e)+"_"+xr.size,xr.set(e,t)),t}var Ar="$$undefined",Tr="$$empty";function Ir(e){return{id:Ar,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}var Or=0;function kr(e,t,n,r){return!(!(2&e.state)&&Ce(e.oldValues[t.bindingIndex+n],r))}function Vr(e,t,n,r){return!!kr(e,t,n,r)&&(e.oldValues[t.bindingIndex+n]=r,!0)}function Pr(e,t,n,r){var o=e.oldValues[t.bindingIndex+n];if(1&e.state||!yn(o,r)){var i=t.bindings[n].name;throw br(_r.createDebugContext(e,t.nodeIndex),i+": "+o,i+": "+r,0!=(1&e.state))}}function Nr(e){for(var t=e;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function Dr(e,t){for(var n=e;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function Mr(e,t,n,r){try{return Nr(33554432&e.def.nodes[t].flags?yr(e,t).componentView:e),_r.handleEvent(e,t,n,r)}catch(t){e.root.errorHandler.handleError(t)}}function jr(e){return e.parent?yr(e.parent,e.parentNodeDef.nodeIndex):null}function Rr(e){return e.parent?e.parentNodeDef.parent:null}function Fr(e,t){switch(201347067&t.flags){case 1:return yr(e,t.nodeIndex).renderElement;case 2:return hr(e,t.nodeIndex).renderText}}function Hr(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function Lr(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function Br(e){return 1<-1}(r)||"root"===o.providedIn&&r._def.isRoot))){var l=e._providers.length;return e._def.providersByKey[t.tokenKey]={flags:5120,value:t.token.ngInjectableDef.factory,deps:[],index:l,token:t.token},e._providers[l]=uo,e._providers[l]=ho(e,e._def.providersByKey[t.tokenKey])}return e._parent.get(t.token,n)}finally{Je(i)}}function ho(e,t){var n;switch(201347067&t.flags){case 512:n=function(e,t,n){var r=n.length;switch(r){case 0:return new t;case 1:return new t(fo(e,n[0]));case 2:return new t(fo(e,n[0]),fo(e,n[1]));case 3:return new t(fo(e,n[0]),fo(e,n[1]),fo(e,n[2]));default:for(var o=new Array(r),i=0;i=n.length)&&(t=n.length-1),t<0)return null;var r=n[t];return r.viewContainerParent=null,_o(n,t),_r.dirtyParentQueries(r),go(r),r}function vo(e,t,n){var r=t?Fr(t,t.def.lastRenderRootNode):e.renderElement;Qr(n,2,n.renderer.parentNode(r),n.renderer.nextSibling(r),void 0)}function go(e){Qr(e,3,null,null,void 0)}function mo(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function _o(e,t){t>=e.length-1?e.pop():e.splice(t,1)}var bo=new Object,wo=function(e){function t(t,n,r,o,i,a){var u=e.call(this)||this;return u.selector=t,u.componentType=n,u._inputs=o,u._outputs=i,u.ngContentSelectors=a,u.viewDefFactory=r,u}return o(t,e),Object.defineProperty(t.prototype,"inputs",{get:function(){var e=[],t=this._inputs;for(var n in t)e.push({propName:n,templateName:t[n]});return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){var e=[];for(var t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e},enumerable:!0,configurable:!0}),t.prototype.create=function(e,t,n,r){if(!r)throw new Error("ngModule should be provided");var o=Wr(this.viewDefFactory),i=o.nodes[0].element.componentProvider.nodeIndex,a=_r.createRootView(e,t||[],n,o,r,bo),u=vr(a,i).instance;return n&&a.renderer.setAttribute(yr(a,0).renderElement,"ng-version",Ke.full),new Co(a,new Ao(a),u)},t}(_t),Co=function(e){function t(t,n,r){var o=e.call(this)||this;return o._view=t,o._viewRef=n,o._component=r,o._elDef=o._view.def.nodes[0],o.hostView=n,o.changeDetectorRef=n,o.instance=r,o}return o(t,e),Object.defineProperty(t.prototype,"location",{get:function(){return new an(yr(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new ko(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this._viewRef.destroy()},t.prototype.onDestroy=function(e){this._viewRef.onDestroy(e)},t}(function(){});function Eo(e,t,n){return new xo(e,t,n)}var xo=function(){function e(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}return Object.defineProperty(e.prototype,"element",{get:function(){return new an(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new ko(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentInjector",{get:function(){for(var e=this._view,t=this._elDef.parent;!t&&e;)t=Rr(e),e=e.parent;return e?new ko(e,t):new ko(this._view,null)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){for(var e=this._embeddedViews.length-1;e>=0;e--){var t=yo(this._data,e);_r.destroyView(t)}},e.prototype.get=function(e){var t=this._embeddedViews[e];if(t){var n=new Ao(t);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(e.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t,n){var r=e.createEmbeddedView(t||{});return this.insert(r,n),r},e.prototype.createComponent=function(e,t,n,r,o){var i=n||this.parentInjector;o||e instanceof Tt||(o=i.get(It));var a=e.create(i,r,void 0,o);return this.insert(a.hostView,t),a},e.prototype.insert=function(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,o,i,a=e;return o=a._view,i=(n=this._data).viewContainer._embeddedViews,null!==(r=t)&&void 0!==r||(r=i.length),o.viewContainerParent=this._view,mo(i,r,o),function(e,t){var n=jr(t);if(n&&n!==e&&!(16&t.state)){t.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),function(e,n){if(!(4&n.flags)){t.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,t.parentNodeDef)}}(n,o),_r.dirtyParentQueries(o),vo(n,r>0?i[r-1]:null,o),a.attachToViewContainerRef(this),e},e.prototype.move=function(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,o,i,a,u=this._embeddedViews.indexOf(e._view);return o=t,a=(i=(n=this._data).viewContainer._embeddedViews)[r=u],_o(i,r),null==o&&(o=i.length),mo(i,o,a),_r.dirtyParentQueries(a),go(a),vo(n,o>0?i[o-1]:null,a),e},e.prototype.indexOf=function(e){return this._embeddedViews.indexOf(e._view)},e.prototype.remove=function(e){var t=yo(this._data,e);t&&_r.destroyView(t)},e.prototype.detach=function(e){var t=yo(this._data,e);return t?new Ao(t):null},e}();function So(e){return new Ao(e)}var Ao=function(){function e(e){this._view=e,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(e.prototype,"rootNodes",{get:function(){return Qr(this._view,0,void 0,void 0,e=[]),e;var e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){Nr(this._view)},e.prototype.detach=function(){this._view.state&=-5},e.prototype.detectChanges=function(){var e=this._view.root.rendererFactory;e.begin&&e.begin();try{_r.checkAndUpdateView(this._view)}finally{e.end&&e.end()}},e.prototype.checkNoChanges=function(){_r.checkNoChangesView(this._view)},e.prototype.reattach=function(){this._view.state|=4},e.prototype.onDestroy=function(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)},e.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),_r.destroyView(this._view)},e.prototype.detachFromAppRef=function(){this._appRef=null,go(this._view),_r.dirtyParentQueries(this._view)},e.prototype.attachToAppRef=function(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e},e.prototype.attachToViewContainerRef=function(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e},e}();function To(e,t){return new Io(e,t)}var Io=function(e){function t(t,n){var r=e.call(this)||this;return r._parentView=t,r._def=n,r}return o(t,e),t.prototype.createEmbeddedView=function(e){return new Ao(_r.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))},Object.defineProperty(t.prototype,"elementRef",{get:function(){return new an(yr(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),t}(sn);function Oo(e,t){return new ko(e,t)}var ko=function(){function e(e,t){this.view=e,this.elDef=t}return e.prototype.get=function(e,t){return void 0===t&&(t=De.THROW_IF_NOT_FOUND),_r.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:Sr(e)},t)},e}();function Vo(e,t){var n=e.def.nodes[t];if(1&n.flags){var r=yr(e,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return hr(e,n.nodeIndex).renderText;if(20240&n.flags)return vr(e,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+t)}function Po(e){return new No(e.renderer)}var No=function(){function e(e){this.delegate=e}return e.prototype.selectRootElement=function(e){return this.delegate.selectRootElement(e)},e.prototype.createElement=function(e,t){var n=u($r(t),2),r=this.delegate.createElement(n[1],n[0]);return e&&this.delegate.appendChild(e,r),r},e.prototype.createViewRoot=function(e){return e},e.prototype.createTemplateAnchor=function(e){var t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t},e.prototype.createText=function(e,t){var n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n},e.prototype.projectNodes=function(e,t){for(var n=0;n0,t.provider.value,t.provider.deps);if(t.outputs.length)for(var r=0;r0,r=t.provider;switch(201347067&t.flags){case 512:return Xo(e,t.parent,n,r.value,r.deps);case 1024:return function(e,t,n,r,o){var i=o.length;switch(i){case 0:return r();case 1:return r(ei(e,t,n,o[0]));case 2:return r(ei(e,t,n,o[0]),ei(e,t,n,o[1]));case 3:return r(ei(e,t,n,o[0]),ei(e,t,n,o[1]),ei(e,t,n,o[2]));default:for(var a=Array(i),u=0;u0)l=y,vi(y)||(c=y);else for(;l&&h===l.nodeIndex+l.childCount;){var m=l.parent;m&&(m.childFlags|=l.childFlags,m.childMatchedQueries|=l.childMatchedQueries),c=(l=m)&&vi(l)?l.renderParent:l}}return{factory:null,nodeFlags:a,rootNodeFlags:u,nodeMatchedQueries:s,flags:e,nodes:t,updateDirectives:n||Er,updateRenderer:r||Er,handleEvent:function(e,n,r,o){return t[n].element.handleEvent(e,r,o)},bindingCount:o,outputCount:i,lastRenderRootNode:f}}function vi(e){return 0!=(1&e.flags)&&null===e.element.name}function gi(e,t,n){var r=t.element&&t.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+t.nodeIndex+"!")}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+t.nodeIndex+"!");if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+t.nodeIndex+"!");if(134217728&t.flags&&e)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+t.nodeIndex+"!")}if(t.childCount){var o=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=o&&t.nodeIndex+t.childCount>o)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+t.nodeIndex+"!")}}function mi(e,t,n,r){var o=wi(e.root,e.renderer,e,t,n);return Ci(o,e.component,r),Ei(o),o}function _i(e,t,n){var r=wi(e,e.renderer,null,null,t);return Ci(r,n,n),Ei(r),r}function bi(e,t,n,r){var o,i=t.element.componentRendererType;return o=i?e.root.rendererFactory.createRenderer(r,i):e.root.renderer,wi(e.root,o,e,t.element.componentProvider,n)}function wi(e,t,n,r,o){var i=new Array(o.nodes.length),a=o.outputCount?new Array(o.outputCount):null;return{def:o,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:i,state:13,root:e,renderer:t,oldValues:new Array(o.bindingCount),disposables:a,initIndex:-1}}function Ci(e,t,n){e.component=t,e.context=n}function Ei(e){var t;Hr(e)&&(t=yr(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);for(var n=e.def,r=e.nodes,o=0;o0&&ao(e,t,0,n)&&(f=!0),p>1&&ao(e,t,1,r)&&(f=!0),p>2&&ao(e,t,2,o)&&(f=!0),p>3&&ao(e,t,3,i)&&(f=!0),p>4&&ao(e,t,4,a)&&(f=!0),p>5&&ao(e,t,5,u)&&(f=!0),p>6&&ao(e,t,6,s)&&(f=!0),p>7&&ao(e,t,7,l)&&(f=!0),p>8&&ao(e,t,8,c)&&(f=!0),p>9&&ao(e,t,9,d)&&(f=!0),f}(e,t,n,r,o,i,a,u,s,l,c,d);case 2:return function(e,t,n,r,o,i,a,u,s,l,c,d){var p=!1,f=t.bindings,h=f.length;if(h>0&&Vr(e,t,0,n)&&(p=!0),h>1&&Vr(e,t,1,r)&&(p=!0),h>2&&Vr(e,t,2,o)&&(p=!0),h>3&&Vr(e,t,3,i)&&(p=!0),h>4&&Vr(e,t,4,a)&&(p=!0),h>5&&Vr(e,t,5,u)&&(p=!0),h>6&&Vr(e,t,6,s)&&(p=!0),h>7&&Vr(e,t,7,l)&&(p=!0),h>8&&Vr(e,t,8,c)&&(p=!0),h>9&&Vr(e,t,9,d)&&(p=!0),p){var y=t.text.prefix;h>0&&(y+=hi(n,f[0])),h>1&&(y+=hi(r,f[1])),h>2&&(y+=hi(o,f[2])),h>3&&(y+=hi(i,f[3])),h>4&&(y+=hi(a,f[4])),h>5&&(y+=hi(u,f[5])),h>6&&(y+=hi(s,f[6])),h>7&&(y+=hi(l,f[7])),h>8&&(y+=hi(c,f[8])),h>9&&(y+=hi(d,f[9]));var v=hr(e,t.nodeIndex).renderText;e.renderer.setValue(v,y)}return p}(e,t,n,r,o,i,a,u,s,l,c,d);case 16384:return function(e,t,n,r,o,i,a,u,s,l,c,d){var p=vr(e,t.nodeIndex),f=p.instance,h=!1,y=void 0,v=t.bindings.length;return v>0&&kr(e,t,0,n)&&(h=!0,y=ni(e,p,t,0,n,y)),v>1&&kr(e,t,1,r)&&(h=!0,y=ni(e,p,t,1,r,y)),v>2&&kr(e,t,2,o)&&(h=!0,y=ni(e,p,t,2,o,y)),v>3&&kr(e,t,3,i)&&(h=!0,y=ni(e,p,t,3,i,y)),v>4&&kr(e,t,4,a)&&(h=!0,y=ni(e,p,t,4,a,y)),v>5&&kr(e,t,5,u)&&(h=!0,y=ni(e,p,t,5,u,y)),v>6&&kr(e,t,6,s)&&(h=!0,y=ni(e,p,t,6,s,y)),v>7&&kr(e,t,7,l)&&(h=!0,y=ni(e,p,t,7,l,y)),v>8&&kr(e,t,8,c)&&(h=!0,y=ni(e,p,t,8,c,y)),v>9&&kr(e,t,9,d)&&(h=!0,y=ni(e,p,t,9,d,y)),y&&f.ngOnChanges(y),65536&t.flags&&fr(e,256,t.nodeIndex)&&f.ngOnInit(),262144&t.flags&&f.ngDoCheck(),h}(e,t,n,r,o,i,a,u,s,l,c,d);case 32:case 64:case 128:return function(e,t,n,r,o,i,a,u,s,l,c,d){var p=t.bindings,f=!1,h=p.length;if(h>0&&Vr(e,t,0,n)&&(f=!0),h>1&&Vr(e,t,1,r)&&(f=!0),h>2&&Vr(e,t,2,o)&&(f=!0),h>3&&Vr(e,t,3,i)&&(f=!0),h>4&&Vr(e,t,4,a)&&(f=!0),h>5&&Vr(e,t,5,u)&&(f=!0),h>6&&Vr(e,t,6,s)&&(f=!0),h>7&&Vr(e,t,7,l)&&(f=!0),h>8&&Vr(e,t,8,c)&&(f=!0),h>9&&Vr(e,t,9,d)&&(f=!0),f){var y=gr(e,t.nodeIndex),v=void 0;switch(201347067&t.flags){case 32:v=new Array(p.length),h>0&&(v[0]=n),h>1&&(v[1]=r),h>2&&(v[2]=o),h>3&&(v[3]=i),h>4&&(v[4]=a),h>5&&(v[5]=u),h>6&&(v[6]=s),h>7&&(v[7]=l),h>8&&(v[8]=c),h>9&&(v[9]=d);break;case 64:v={},h>0&&(v[p[0].name]=n),h>1&&(v[p[1].name]=r),h>2&&(v[p[2].name]=o),h>3&&(v[p[3].name]=i),h>4&&(v[p[4].name]=a),h>5&&(v[p[5].name]=u),h>6&&(v[p[6].name]=s),h>7&&(v[p[7].name]=l),h>8&&(v[p[8].name]=c),h>9&&(v[p[9].name]=d);break;case 128:var g=n;switch(h){case 1:v=g.transform(n);break;case 2:v=g.transform(r);break;case 3:v=g.transform(r,o);break;case 4:v=g.transform(r,o,i);break;case 5:v=g.transform(r,o,i,a);break;case 6:v=g.transform(r,o,i,a,u);break;case 7:v=g.transform(r,o,i,a,u,s);break;case 8:v=g.transform(r,o,i,a,u,s,l);break;case 9:v=g.transform(r,o,i,a,u,s,l,c);break;case 10:v=g.transform(r,o,i,a,u,s,l,c,d)}}y.value=v}return f}(e,t,n,r,o,i,a,u,s,l,c,d);default:throw"unreachable"}}(e,t,r,o,i,a,u,l,c,d,p,f):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){for(var r=!1,o=0;o0&&Pr(e,t,0,n),p>1&&Pr(e,t,1,r),p>2&&Pr(e,t,2,o),p>3&&Pr(e,t,3,i),p>4&&Pr(e,t,4,a),p>5&&Pr(e,t,5,u),p>6&&Pr(e,t,6,s),p>7&&Pr(e,t,7,l),p>8&&Pr(e,t,8,c),p>9&&Pr(e,t,9,d)}(e,t,r,o,i,a,u,s,l,c,d,p):function(e,t,n){for(var r=0;r0){var i=new Set(e.modules);Gi.forEach(function(t,r){if(i.has(r.ngInjectableDef.providedIn)){var o={token:r,flags:t.flags|(n?4096:0),deps:zr(t.deps),value:t.value,index:e.providers.length};e.providers.push(o),e.providersByKey[Sr(r)]=o}})}}(e=e.factory(function(){return Er})),e):e}(r))}var Zi=new Map,Gi=new Map,Wi=new Map;function Qi(e){Zi.set(e.token,e),"function"==typeof e.token&&e.token.ngInjectableDef&&"function"==typeof e.token.ngInjectableDef.providedIn&&Gi.set(e.token,e)}function qi(e,t){var n=Wr(Wr(t.viewDefFactory).nodes[0].element.componentView);Wi.set(e,n)}function Ji(){Zi.clear(),Gi.clear(),Wi.clear()}function Yi(e){if(0===Zi.size)return e;var t=function(e){for(var t=[],n=null,r=0;r1})},e.prototype.triggerSnapshot=function(){this.trigger.next()},e.prototype.toggleWebcam=function(){this.showWebcam=!this.showWebcam},e.prototype.handleInitError=function(e){this.errors.push(e)},e.prototype.showNextWebcam=function(e){this.nextWebcam.next(e)},e.prototype.handleImage=function(e){console.info("received webcam image",e),this.webcamImage=e},e.prototype.cameraWasSwitched=function(e){console.log("active device: "+e),this.deviceId=e},Object.defineProperty(e.prototype,"triggerObservable",{get:function(){return this.trigger.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextWebcamObservable",{get:function(){return this.nextWebcam.asObservable()},enumerable:!0,configurable:!0}),e}(),Ta=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])};function Ia(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object;var Oa=function(){},ka=void 0,Va=["en",[["a","p"],["AM","PM"],ka],[["AM","PM"],ka,ka],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ka,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ka,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ka,"{1} 'at' {0}",ka],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],Pa={},Na=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}(Na||(Na={})),Da=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}(Da||(Da={})),Ma=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}(Ma||(Ma={})),ja=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}(ja||(ja={})),Ra=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}(Ra||(Ra={})),Fa=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}(Fa||(Fa={})),Ha=function(e){return e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday",e}(Ha||(Ha={})),La=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}(La||(La={})),Ba=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.Milliseconds=6]="Milliseconds",e[e.Day=7]="Day",e}(Ba||(Ba={})),Ua=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}(Ua||(Ua={})),za=new le("UseV4Plurals"),Za=function(){},Ga=function(e){function t(t,n){var r=e.call(this)||this;return r.locale=t,r.deprecatedPluralFn=n,r}return function(e,t){function n(){this.constructor=e}Ta(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.getPluralCategory=function(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):function(e){return function(e){var t=e.toLowerCase().replace(/_/g,"-"),n=Pa[t];if(n)return n;var r=t.split("-")[0];if(n=Pa[r])return n;if("en"===r)return Va;throw new Error('Missing locale data for the locale "'+e+'".')}(e)[18]}(t||this.locale)(e)){case Da.Zero:return"zero";case Da.One:return"one";case Da.Two:return"two";case Da.Few:return"few";case Da.Many:return"many";default:return"other"}},t}(Za),Wa=function(){function e(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}return Object.defineProperty(e.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),e}(),Qa=function(){function e(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._differ=null}return Object.defineProperty(e.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(e){qt()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){if("ngForOf"in e){var t=e.ngForOf.currentValue;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(e){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((n=t).name||typeof n)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var n},e.prototype.ngDoCheck=function(){if(this._differ){var e=this._differ.diff(this.ngForOf);e&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=this,n=[];e.forEachOperation(function(e,r,o){if(null==e.previousIndex){var i=t._viewContainer.createEmbeddedView(t._template,new Wa(null,t.ngForOf,-1,-1),o),a=new qa(e,i);n.push(a)}else null==o?t._viewContainer.remove(r):(i=t._viewContainer.get(r),t._viewContainer.move(i,o),a=new qa(e,i),n.push(a))});for(var r=0;r0?t[0].deviceId:null)}).catch(function(t){e.initError.next({message:t}),e.switchToVideoInput(null)})},e.prototype.ngOnDestroy=function(){this.stopMediaTracks(),this.unsubscribeFromSubscriptions()},Object.defineProperty(e.prototype,"trigger",{set:function(e){var t=this;this.triggerSubscription&&this.triggerSubscription.unsubscribe(),this.triggerSubscription=e.subscribe(function(){t.takeSnapshot()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"switchCamera",{set:function(e){var t=this;this.switchCameraSubscription&&this.switchCameraSubscription.unsubscribe(),this.switchCameraSubscription=e.subscribe(function(e){"string"==typeof e?t.switchToVideoInput(e):t.rotateVideoInput(!1!==e)})},enumerable:!0,configurable:!0}),e.getMediaConstraintsForDevice=function(e,t){var n=t||this.DEFAULT_VIDEO_OPTIONS;return e&&(n.deviceId={exact:e}),n},e.getDeviceIdFromMediaStreamTrack=function(e){if(e.getSettings()&&e.getSettings().deviceId)return e.getSettings().deviceId;if(e.getConstraints()&&e.getConstraints().deviceId){var t=e.getConstraints().deviceId;if(t instanceof String)return String(t);if(Array.isArray(t)&&Array(t).length>0)return t[0];if("object"==typeof t){if(t.exact)return t.exact;if(t.ideal)return t.ideal}}},e.prototype.takeSnapshot=function(){var e=this.video.nativeElement,t={width:this.width,height:this.height};e.videoWidth&&(t.width=e.videoWidth,t.height=e.videoHeight);var n=this.canvas.nativeElement;n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(this.video.nativeElement,0,0);var r=n.toDataURL("image/jpeg");this.imageCapture.next(new tu(r,"image/jpeg"))},e.prototype.rotateVideoInput=function(e){this.availableVideoInputs&&this.availableVideoInputs.length>1&&this.switchToVideoInput(this.availableVideoInputs[(this.activeVideoInputIndex+(e?1:this.availableVideoInputs.length-1))%this.availableVideoInputs.length].deviceId)},e.prototype.switchToVideoInput=function(e){this.videoInitialized=!1,this.stopMediaTracks(),this.initWebcam(e,this.videoOptions)},Object.defineProperty(e.prototype,"videoWidth",{get:function(){var e=this.getVideoAspectRatio(this.activeVideoSettings);return Math.min(this.width,this.height*e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"videoHeight",{get:function(){var e=this.getVideoAspectRatio(this.activeVideoSettings);return Math.min(this.height,this.width/e)},enumerable:!0,configurable:!0}),e.prototype.getVideoAspectRatio=function(e){if(e){if(e.aspectRatio)return e.aspectRatio;if(e.width&&e.width>0&&e.height&&e.height>0)return e.width/e.height}return this.width/this.height},e.prototype.initWebcam=function(t,n){var r=this,o=this.video.nativeElement;if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){var i=e.getMediaConstraintsForDevice(t,n);navigator.mediaDevices.getUserMedia({video:i}).then(function(t){r.mediaStream=t,o.srcObject=t,o.play(),r.activeVideoSettings=t.getVideoTracks()[0].getSettings();var n=e.getDeviceIdFromMediaStreamTrack(t.getVideoTracks()[0]);r.activeVideoInputIndex=n?r.availableVideoInputs.findIndex(function(e){return e.deviceId===n}):-1,r.videoInitialized=!0,r.cameraSwitched.next(n)}).catch(function(e){r.initError.next({message:e.message,mediaStreamError:e})})}else this.initError.next({message:"Cannot read UserMedia from MediaDevices."})},e.prototype.stopMediaTracks=function(){this.mediaStream&&this.mediaStream.getTracks&&this.mediaStream.getTracks().forEach(function(e){return e.stop()})},e.prototype.unsubscribeFromSubscriptions=function(){this.triggerSubscription&&this.triggerSubscription.unsubscribe(),this.switchCameraSubscription&&this.switchCameraSubscription.unsubscribe()},e.prototype.detectAvailableDevices=function(){var e=this;return new Promise(function(t,n){Sa.getAvailableVideoInputs().then(function(n){e.availableVideoInputs=n,t(n)}).catch(function(t){e.availableVideoInputs=[],n(t)})})},e.DEFAULT_VIDEO_OPTIONS={facingMode:"environment"},e}(),ru=Ir({encapsulation:0,styles:[[".webcam-wrapper[_ngcontent-%COMP%]{display:inline-block;position:relative;line-height:0}.webcam-wrapper[_ngcontent-%COMP%] canvas[_ngcontent-%COMP%]{display:none}.webcam-wrapper[_ngcontent-%COMP%] .camera-switch[_ngcontent-%COMP%]{background-color:rgba(0,0,0,.1);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAE9UlEQVR42u2aT2hdRRTGf+cRQqghSqihdBFDkRISK2KDfzDWxHaRQHEhaINKqa1gKQhd6EZLN+IidCH+Q0oWIkVRC21BQxXRitVaSbKoJSGtYGoK2tQ/tU1jY5v0c5F54Xl7b/KSO/PyEt+3e5f75p7zzZwzZ74zUEIJJfyfYaEGllQGVAGZlENdBy6Z2cSiYFTSKkkfS/pH/nBF0kFJdUW9AiRVASeAukD8DgNrzOySrwEzng18KaDzALXuG8W3AiStAvqBisBRNg40mtlPxbYCOgvgPO4bncWW+JpVeDQXRQhIygDfA00F5r0XuNfMrgclQFI98DDQCNQA5ZFXqoCWBVp8XwHRHeEqcN7loy/NbHBesyqpQ1KfFj/6nC+ZvFaApFrgPaCZpYVvgCfNbDiRAElNwGFg+RIt/X8H2s2s9wYCJDUAR4HqJX7++RN40MwGpgmQVAH0AQ2BPz4AHHPl8nBOAqtyFWQjsA6oL4Ada81sPDv7uwImod8kvSJp9RyS8O2SXnb/DYVd2Y9VSroQ4ANXJO2WVJmixqh0kzMWwL4LkiqRtDnA4D1zmfE8j9g9AezcnAHaPcfXdbfdnPZ2Yps6+DwAvO/Z1naTdApY7Xng48BDZnY1MpMVQBuw3iXc5Tnb0wBwBPjUzP6eoezuArZ6svM0geJLkvZEYnl3nkntoqROSbckSW2Suj3ZOIangc7GPJuUtNGdFIfmMeavktoSSKiW9LMPw30Q8JqkekmjCbOZRhuclLQjgYSNxUBAj6RyZ9ATgUJpUtJTCSR8vpAEXHAyWK5BXYFIGHOlepSAloUk4NEYgyoknQhEwhFJ0e8h6VSaQeerCb5uZgdi9utxYBNwOUD93hIVXswM4INCi6K9wAszFC2DwLOBDjHbYp59karIUnRdzYy/3ClqVklaUhfwTICj7K25OqA7a4wWagVsm4Me/xzwg2cCqqONFzO7DPxSCAJi436GUBgHHguQD2oTlJ55oSzP9ybccsttSJw1szdjFOSnI/8dTCGZHwcORp4Nx7y3B1iZ8/sm4MW8/Euxg5wIsS/HaAp3zeP4/G7obRDXI4jiTIA22H7Xdc7X+S3A5lC7QBQ357aq3VAjCeSkwUfAJrfvz+R8A9ADLAtZB+TinpjC5JMA+//jwPZZnF8G7J+L8z4IWB/zbG+gIujVWfLBW/NStVMmqaG4POJRsIjix7h8IGnLQuoBbQki5sVAJHyYm7YkNaRRtXwQ8G1cHpX0iKRrgUjYno17Sf0LrQhJUkdCeHWkVITGJI0k1QeS3ikGSUzOyJUJJNznYneuOCnpTldcxa2kP3xJYqOeSDjqZG8ShJLnE8TTuMS6Iyu1BW7djZqkfo9N0QOuYJmYQddfB7RG+gLTNzqAY9FrL+5/nwEbvDdJJe3zzOrhNP3AWRqmk55t3ZcBuj3b2gb0Sbrbo/NNzk7fFzu7s/E5EiC+rrmeQU0Kx2skvRFoOx2ZzlmSdgbsw49JetvtBpk8nM64d/cGbNtJ0s7cGyJlwHeEv+t3nqnLSgPAUOSGyG3AHUxdzqoJbEcvcL+ZTeTeEapzJKxgaeOcc/7Mf06D7kFrguS0VDAMtGadv+E47DT9tcChJej8ISfpD+abgTe45uOkFi8mnQ+JBVQ+d4VXuOptjavcyot8pq86mfwk8LWZnaOEEkoooYQSSojDv8AhQNeGfe0jAAAAAElFTkSuQmCC);background-repeat:no-repeat;border-radius:5px;position:absolute;right:13px;top:10px;height:48px;width:48px;background-size:80%;cursor:pointer;background-position:center;transition:background-color .2s ease}.webcam-wrapper[_ngcontent-%COMP%] .camera-switch[_ngcontent-%COMP%]:hover{background-color:rgba(0,0,0,.18)}"]],data:{}});function ou(e){return yi(0,[(e()(),no(0,0,null,null,0,"div",[["class","camera-switch"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.rotateVideoInput(!0)&&r),r},null,null))],null,null)}function iu(e){return yi(0,[ai(402653184,1,{video:0}),ai(402653184,2,{canvas:0}),(e()(),no(2,0,null,null,4,"div",[["class","webcam-wrapper"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.imageClick.next()&&r),r},null,null)),(e()(),no(3,0,[[1,0],["video",1]],null,0,"video",[["autoplay",""],["muted",""],["playsinline",""]],[[8,"width",0],[8,"height",0]],null,null,null,null)),(e()(),to(16777216,null,null,1,null,ou)),Zo(5,16384,null,0,Ja,[ln,sn],{ngIf:[0,"ngIf"]},null),(e()(),no(6,0,[[2,0],["canvas",1]],null,0,"canvas",[],[[8,"width",0],[8,"height",0]],null,null,null,null))],function(e,t){var n=t.component;e(t,5,0,n.allowCameraSwitch&&n.availableVideoInputs.length>1&&n.videoInitialized)},function(e,t){var n=t.component;e(t,3,0,n.videoWidth,n.videoHeight),e(t,6,0,n.width,n.height)})}var au=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])};function uu(e,t){function n(){this.constructor=e}au(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var su=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function cu(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var du=new O(function(e){return e.complete()}),pu=function(e){function t(t,n){var r=e.call(this,t)||this;r.sources=n,r.completed=0,r.haveValues=0;var o=n.length;r.values=new Array(o);for(var i=0;i0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var gu=null;function mu(){return gu}var _u,bu={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},wu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Cu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"};ge.Node&&(_u=ge.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))});var Eu,xu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hu(t,e),t.prototype.parse=function(e){throw new Error("parse not implemented")},t.makeCurrent=function(){var e;e=new t,gu||(gu=e)},t.prototype.hasProperty=function(e,t){return t in e},t.prototype.setProperty=function(e,t,n){e[t]=n},t.prototype.getProperty=function(e,t){return e[t]},t.prototype.invoke=function(e,t,n){var r;(r=e)[t].apply(r,function(){for(var e=[],t=0;t0},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,n=e.attributes,r=0;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(e.split(";")),r=n.next();!r.done;r=n.next()){var o=r.value,i=o.indexOf("="),a=Ia(-1==i?[o,""]:[o.slice(0,i),o.slice(i+1)],2),u=a[1];if(a[0].trim()===t)return decodeURIComponent(u)}}catch(e){s={error:e}}finally{try{r&&!r.done&&(l=n.return)&&l.call(n)}finally{if(s)throw s.error}}return null;var s,l}(document.cookie,e)},t.prototype.setCookie=function(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)},t}(function(e){function t(){var t=e.call(this)||this;t._animationPrefix=null,t._transitionEnd=null;try{var n=t.createElement("div",document);if(null!=t.getStyle(n,"animationName"))t._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],o=0;o0;a||(a=e[i]=[]);var s=as(t)?Zone.root:Zone.current;if(0===a.length)a.push({zone:s,handler:o});else{for(var l=!1,c=0;c-1},t}(Hu),fs=["alt","control","meta","shift"],hs={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},ys=function(e){function t(t){return e.call(this,t)||this}return hu(t,e),t.prototype.supports=function(e){return null!=t.parseEventName(e)},t.prototype.addEventListener=function(e,n,r){var o=t.parseEventName(n),i=t.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return mu().onAndCancel(e,o.domEventName,i)})},t.parseEventName=function(e){var n=e.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;var o=t._normalizeKey(n.pop()),i="";if(fs.forEach(function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),i+=e+".")}),i+=o,0!=n.length||0===o.length)return null;var a={};return a.domEventName=r,a.fullKey=i,a},t.getEventFullKey=function(e){var t="",n=mu().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),fs.forEach(function(r){r!=n&&(0,hs[r])(e)&&(t+=r+".")}),t+=n},t.eventCallback=function(e,n,r){return function(o){t.getEventFullKey(o)===e&&r.runGuarded(function(){return n(o)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t}(Hu),vs=function(){},gs=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n}return hu(t,e),t.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case cr.NONE:return t;case cr.HTML:return t instanceof _s?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),function(e,t){var n=null;try{qn=qn||new Un(e);var r=t?String(t):"";n=qn.getInertBodyElement(r);var o=5,i=r;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,r=i,i=n.innerHTML,n=qn.getInertBodyElement(r)}while(r!==i);var a=new rr,u=a.sanitizeChildren(ur(n)||n);return qt()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),u}finally{if(n)for(var s=ur(n)||n;s.firstChild;)s.removeChild(s.firstChild)}}(this._doc,String(t)));case cr.STYLE:return t instanceof bs?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),function(e){if(!(e=String(e).trim()))return"";var t=e.match(lr);return t&&Gn(t[1])===t[1]||e.match(sr)&&function(e){for(var t=!0,n=!0,r=0;re?{max:{max:e,actual:t.value}}:null}},e.required=function(e){return Os(e.value)?{required:!0}:null},e.requiredTrue=function(e){return!0===e.value?null:{required:!0}},e.email=function(e){return Os(e.value)?null:ks.test(e.value)?null:{email:!0}},e.minLength=function(e){return function(t){if(Os(t.value))return null;var n=t.value?t.value.length:0;return ne?{maxlength:{requiredLength:e,actualLength:n}}:null}},e.pattern=function(t){return t?("string"==typeof t?(r="","^"!==t.charAt(0)&&(r+="^"),r+=t,"$"!==t.charAt(t.length-1)&&(r+="$"),n=new RegExp(r)):(r=t.toString(),n=t),function(e){if(Os(e.value))return null;var t=e.value;return n.test(t)?null:{pattern:{requiredPattern:r,actualValue:t}}}):e.nullValidator;var n,r},e.nullValidator=function(e){return null},e.compose=function(e){if(!e)return null;var t=e.filter(Ps);return 0==t.length?null:function(e){return Ds(function(e,n){return t.map(function(t){return t(e)})}(e))}},e.composeAsync=function(e){if(!e)return null;var t=e.filter(Ps);return 0==t.length?null:function(e){return function e(){for(var t,n=[],r=0;r=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)},e.prototype.select=function(e){var t=this;this._accessors.forEach(function(n){t._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})},e.prototype._isSameGroup=function(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name},e}(),Gs=function(){function e(e,t,n,r){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){this._control=this._injector.get(zs),this._checkName(),this._registry.add(this._control,this)},e.prototype.ngOnDestroy=function(){this._registry.remove(this)},e.prototype.writeValue=function(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},e.prototype.registerOnChange=function(e){var t=this;this._fn=e,this.onChange=function(){e(t.value),t._registry.select(t)}},e.prototype.fireUncheck=function(e){this.writeValue(e)},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},e.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},e}(),Ws='\n

\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',Qs='\n
\n
\n \n
\n
';function qs(e,t){return function(){for(var e=[],t=0;t1?"path: '"+e.path.join(" -> ")+"'":e.path[0]?"name: '"+e.path+"'":"unspecified name attribute",new Error(t+" "+n)}function Xs(e){return null!=e?Vs.compose(e.map(Hs)):null}function $s(e){return null!=e?Vs.composeAsync(e.map(Ls)):null}var el=[js,function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))},e.prototype.registerOnChange=function(e){this.onChange=function(t){e(""==t?null:parseFloat(t))}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e}(),Bs,function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ce}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){this.value=e;var t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),(e+": "+t).slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){t.value=t._getOptionValue(n),e(t.value)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._registerOption=function(){return(this._idCounter++).toString()},e.prototype._getOptionId=function(e){try{for(var t=lu(Array.from(this._optionMap.keys())),n=t.next();!n.done;n=t.next()){var r=n.value;if(this._compareWith(this._optionMap.get(r),e))return r}}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=t.return)&&i.call(t)}finally{if(o)throw o.error}}return null;var o,i},e.prototype._getOptionValue=function(e){var t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e},e}(),function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ce}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){var t,n=this;if(this.value=e,Array.isArray(e)){var r=e.map(function(e){return n._getOptionId(e)});t=function(e,t){e._setSelected(r.indexOf(t.toString())>-1)}}else t=function(e,t){e._setSelected(!1)};this._optionMap.forEach(t)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var o=n.selectedOptions,i=0;i0||this.disabled;var n,r},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},t}(al),ll=function(e){function t(t,n,r){var o=e.call(this,rl(n),ol(r,n))||this;return o.controls=t,o._initObservables(),o._setUpdateStrategy(n),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),o}return uu(t,e),t.prototype.at=function(e){return this.controls[e]},t.prototype.push=function(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},t.prototype.insert=function(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()},t.prototype.removeAt=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity()},t.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(t.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t={}),this._checkAllValuesPresent(e),e.forEach(function(e,r){n._throwIfControlMissing(r),n.at(r).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.patchValue=function(e,t){var n=this;void 0===t&&(t={}),e.forEach(function(e,r){n.at(r)&&n.at(r).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.reset=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={}),this._forEachChild(function(n,r){n.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t),this._updatePristine(t),this._updateTouched(t)},t.prototype.getRawValue=function(){return this.controls.map(function(e){return e instanceof ul?e.value:e.getRawValue()})},t.prototype._syncPendingControls=function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e},t.prototype._throwIfControlMissing=function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)},t.prototype._forEachChild=function(e){this.controls.forEach(function(t,n){e(t,n)})},t.prototype._updateValue=function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})},t.prototype._anyControls=function(e){return this.controls.some(function(t){return t.enabled&&e(t)})},t.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: "+n+".")})},t.prototype._allControlsDisabled=function(){try{for(var e=lu(this.controls),t=e.next();!t.done;t=e.next())if(t.value.enabled)return!1}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return this.controls.length>0||this.disabled;var n,r},t.prototype._registerControl=function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)},t}(al),cl=Promise.resolve(null),dl=function(e){function t(t,n){var r=e.call(this)||this;return r.submitted=!1,r._directives=[],r.ngSubmit=new Nt,r.form=new sl({},Xs(t),$s(n)),r}return uu(t,e),t.prototype.ngAfterViewInit=function(){this._setUpdateStrategy()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),Js(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})},t.prototype.getControl=function(e){return this.form.get(e.path)},t.prototype.removeControl=function(e){var t=this;cl.then(function(){var n,r,o=t._findContainer(e.path);o&&o.removeControl(e.name),(r=(n=t._directives).indexOf(e))>-1&&n.splice(r,1)})},t.prototype.addFormGroup=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path),r=new sl({});(function(e,t){null==e&&Ks(t,"Cannot find control with"),e.validator=Vs.compose([e.validator,t.validator]),e.asyncValidator=Vs.composeAsync([e.asyncValidator,t.asyncValidator])})(r,e),n.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})},t.prototype.removeFormGroup=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})},t.prototype.getFormGroup=function(e){return this.form.get(e.path)},t.prototype.updateModel=function(e,t){var n=this;cl.then(function(){n.form.get(e.path).setValue(t)})},t.prototype.setValue=function(e){this.control.setValue(e)},t.prototype.onSubmit=function(e){return this.submitted=!0,t=this._directives,this.form._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)}),this.ngSubmit.emit(e),!1;var t},t.prototype.onReset=function(){this.resetForm()},t.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this.submitted=!1},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)},t.prototype._findContainer=function(e){return e.pop(),e.length?this.form.get(e):this.form},t}(Is),pl=function(){function e(){}return e.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n \n
\n \n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });\n\n Or, if you\'d like to avoid registering this form control, indicate that it\'s standalone in ngModelOptions:\n\n Example:\n\n \n
\n \n \n
\n ')},e.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+Ws+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+Qs)},e.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},e.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+Ws+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+Qs)},e}(),fl=function(e){function t(t,n,r){var o=e.call(this)||this;return o._parent=t,o._validators=n,o._asyncValidators=r,o}return uu(t,e),t.prototype._checkParentType=function(){this._parent instanceof t||this._parent instanceof dl||pl.modelGroupParentException()},t}(tl),hl=Promise.resolve(null),yl=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.control=new ul,i._registered=!1,i.update=new Nt,i._parent=t,i._rawValidators=n||[],i._rawAsyncValidators=r||[],i.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t)||Ks(e,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,o=void 0;return t.forEach(function(t){var i;t.constructor===Fs?n=t:(i=t,el.some(function(e){return i.constructor===e})?(r&&Ks(e,"More than one built-in value accessor matches form control with"),r=t):(o&&Ks(e,"More than one custom value accessor matches form control with"),o=t))}),o||r||n||(Ks(e,"No valid value accessor for form control with"),null)}(i,o),i}return uu(t,e),t.prototype.ngOnChanges=function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Ce(t,n.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},t.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(t.prototype,"path",{get:function(){return this._parent?qs(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return Xs(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return $s(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},t.prototype._setUpControl=function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)},t.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},t.prototype._setUpStandalone=function(){Js(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})},t.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},t.prototype._checkParentType=function(){!(this._parent instanceof fl)&&this._parent instanceof tl?pl.formGroupNameException():this._parent instanceof fl||this._parent instanceof dl||pl.modelParentException()},t.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||pl.missingNameException()},t.prototype._updateValue=function(e){var t=this;hl.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})},t.prototype._updateDisabled=function(e){var t=this,n=e.isDisabled.currentValue,r=""===n||n&&"false"!==n;hl.then(function(){r&&!t.control.disabled?t.control.disable():!r&&t.control.disabled&&t.control.enable()})},t}(zs),vl=function(){},gl=function(){},ml=Ir({encapsulation:0,styles:[[".actionBtn[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:2px;font-size:1.2em}.snapshot[_ngcontent-%COMP%]{text-align:center}.snapshot[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:800px;max-height:800px}ul.links[_ngcontent-%COMP%]{padding-bottom:20px}"]],data:{}});function _l(e){return yi(0,[(e()(),no(0,0,null,null,1,"webcam",[],null,[[null,"imageCapture"],[null,"cameraSwitched"],[null,"initError"]],function(e,t,n){var r=!0,o=e.component;return"imageCapture"===t&&(r=!1!==o.handleImage(n)&&r),"cameraSwitched"===t&&(r=!1!==o.cameraWasSwitched(n)&&r),"initError"===t&&(r=!1!==o.handleInitError(n)&&r),r},iu,ru)),Zo(1,4374528,null,0,nu,[],{width:[0,"width"],height:[1,"height"],videoOptions:[2,"videoOptions"],allowCameraSwitch:[3,"allowCameraSwitch"],trigger:[4,"trigger"],switchCamera:[5,"switchCamera"]},{imageCapture:"imageCapture",initError:"initError",cameraSwitched:"cameraSwitched"})],function(e,t){var n=t.component;e(t,1,0,500,500,n.videoOptions,n.allowCameraSwitch,n.triggerObservable,n.nextWebcamObservable)},null)}function bl(e){return yi(0,[(e()(),no(0,0,null,null,3,"div",[["class","snapshot"]],null,null,null,null,null)),(e()(),no(1,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),pi(-1,null,["Nice one!"])),(e()(),no(3,0,null,null,0,"img",[],[[8,"src",4]],null,null,null,null))],null,function(e,t){e(t,3,0,t.component.webcamImage.imageAsDataUrl)})}function wl(e){return yi(0,[(e()(),no(0,0,null,null,1,"h4",[],null,null,null,null,null)),(e()(),pi(-1,null,["Messages:"]))],null,null)}function Cl(e){return yi(0,[(e()(),no(0,0,null,null,3,"ul",[],null,null,null,null,null)),(e()(),no(1,0,null,null,2,"li",[],null,null,null,null,null)),(e()(),pi(2,null,["",""])),(t=0,n=Xa,r=[],Wo(-1,t|=16,null,0,n,n,r))],null,function(e,t){e(t,2,0,function(e,t,n,r){if(vn.isWrapped(r)){r=vn.unwrap(r);var o=e.def.nodes[2].bindingIndex+0,i=vn.unwrap(e.oldValues[o]);e.oldValues[o]=new vn(i)}return r}(t,0,0,Vo(t,3).transform(t.context.$implicit)))});var t,n,r}function El(e){return yi(0,[(e()(),no(0,0,null,null,31,"div",[["style","text-align:center"]],null,null,null,null,null)),(e()(),no(1,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),pi(-1,null,[" Ngx-Webcam Demo "])),(e()(),no(3,0,null,null,28,"div",[],null,null,null,null,null)),(e()(),to(16777216,null,null,1,null,_l)),Zo(5,16384,null,0,Ja,[ln,sn],{ngIf:[0,"ngIf"]},null),(e()(),no(6,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),no(7,0,null,null,1,"button",[["class","actionBtn"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.triggerSnapshot()&&r),r},null,null)),(e()(),pi(-1,null,["Take A Snapshot"])),(e()(),no(9,0,null,null,1,"button",[["class","actionBtn"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.toggleWebcam()&&r),r},null,null)),(e()(),pi(-1,null,["Toggle Webcam"])),(e()(),no(11,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),no(12,0,null,null,1,"button",[["class","actionBtn"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.showNextWebcam(!0)&&r),r},null,null)),(e()(),pi(-1,null,["Next Webcam"])),(e()(),no(14,0,null,null,5,"input",[["id","cameraSwitchCheckbox"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(e,t,n){var r=!0,o=e.component;return"change"===t&&(r=!1!==Vo(e,15).onChange(n.target.checked)&&r),"blur"===t&&(r=!1!==Vo(e,15).onTouched()&&r),"ngModelChange"===t&&(r=!1!==(o.allowCameraSwitch=n)&&r),r},null,null)),Zo(15,16384,null,0,js,[on,an],null,null),Go(1024,null,Ms,function(e){return[e]},[js]),Zo(17,671744,null,0,yl,[[8,null],[8,null],[8,null],[6,Ms]],{model:[0,"model"]},{update:"ngModelChange"}),Go(2048,null,zs,null,[yl]),Zo(19,16384,null,0,nl,[[4,zs]],null,null),(e()(),no(20,0,null,null,1,"label",[["for","cameraSwitchCheckbox"]],null,null,null,null,null)),(e()(),pi(-1,null,["Allow Camera Switch"])),(e()(),no(22,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),pi(-1,null,[" DeviceId: "])),(e()(),no(24,0,null,null,5,"input",[["id","deviceId"],["style","width: 500px"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,o=e.component;return"input"===t&&(r=!1!==Vo(e,25)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==Vo(e,25).onTouched()&&r),"compositionstart"===t&&(r=!1!==Vo(e,25)._compositionStart()&&r),"compositionend"===t&&(r=!1!==Vo(e,25)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(o.deviceId=n)&&r),r},null,null)),Zo(25,16384,null,0,Fs,[on,an,[2,Rs]],null,null),Go(1024,null,Ms,function(e){return[e]},[Fs]),Zo(27,671744,null,0,yl,[[8,null],[8,null],[8,null],[6,Ms]],{model:[0,"model"]},{update:"ngModelChange"}),Go(2048,null,zs,null,[yl]),Zo(29,16384,null,0,nl,[[4,zs]],null,null),(e()(),no(30,0,null,null,1,"button",[],null,[[null,"click"]],function(e,t,n){var r=!0,o=e.component;return"click"===t&&(r=!1!==o.showNextWebcam(o.deviceId)&&r),r},null,null)),(e()(),pi(-1,null,["Activate"])),(e()(),to(16777216,null,null,1,null,bl)),Zo(33,16384,null,0,Ja,[ln,sn],{ngIf:[0,"ngIf"]},null),(e()(),to(16777216,null,null,1,null,wl)),Zo(35,16384,null,0,Ja,[ln,sn],{ngIf:[0,"ngIf"]},null),(e()(),to(16777216,null,null,1,null,Cl)),Zo(37,802816,null,0,Qa,[ln,sn,kn],{ngForOf:[0,"ngForOf"]},null),(e()(),no(38,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),pi(-1,null,["Like this project on GitHub:"])),(e()(),no(40,0,null,null,4,"ul",[["class","links"]],null,null,null,null,null)),(e()(),no(41,0,null,null,3,"li",[],null,null,null,null,null)),(e()(),no(42,0,null,null,2,"h2",[],null,null,null,null,null)),(e()(),no(43,0,null,null,1,"a",[["href","https://github.com/basst314/ngx-webcam"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(e()(),pi(-1,null,["Ngx-Webcam / GitHub"]))],function(e,t){var n=t.component;e(t,5,0,n.showWebcam),e(t,17,0,n.allowCameraSwitch),e(t,27,0,n.deviceId),e(t,33,0,n.webcamImage),e(t,35,0,n.errors.length>0),e(t,37,0,n.errors)},function(e,t){e(t,12,0,!t.component.multipleWebcamsAvailable),e(t,14,0,Vo(t,19).ngClassUntouched,Vo(t,19).ngClassTouched,Vo(t,19).ngClassPristine,Vo(t,19).ngClassDirty,Vo(t,19).ngClassValid,Vo(t,19).ngClassInvalid,Vo(t,19).ngClassPending),e(t,24,0,Vo(t,29).ngClassUntouched,Vo(t,29).ngClassTouched,Vo(t,29).ngClassPristine,Vo(t,29).ngClassDirty,Vo(t,29).ngClassValid,Vo(t,29).ngClassInvalid,Vo(t,29).ngClassPending)})}var xl=function(e,t,n,r,o,i){return new wo("app-root",Aa,function(e){return yi(0,[(e()(),no(0,0,null,null,1,"app-root",[],null,null,null,El,ml)),Zo(1,114688,null,0,Aa,[],null,null)],function(e,t){e(t,1,0)},null)},{},{},[])}(),Sl=function(){},Al=function(e,t,n){return new Ca(xa,[Aa],function(e){return function(e){for(var t={},n=[],r=!1,o=0;o=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function u(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(B);function J(e){return e}var Y=function(e){function t(){var n=e.call(this,"object unsubscribed")||this;return n.name="ObjectUnsubscribedError",Object.setPrototypeOf(n,t.prototype),n}return c(t,e),t}(Error),K=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return c(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(E),X=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return c(t,e),t}(A),$=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return c(t,e),t.prototype[S]=function(){return new X(this)},t.prototype.lift=function(e){var t=new ee(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new Y;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(A),oe=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return c(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new E).add(this.source.subscribe(new ae(this.getSubject(),this))),e.closed?(this._connection=null,e=E.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return te()(this)},t}(O).prototype,ie={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:oe._subscribe},_isComplete:{value:oe._isComplete,writable:!0},getSubject:{value:oe.getSubject},connect:{value:oe.connect},refCount:{value:oe.refCount}},ae=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return c(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(X);function se(){return new $}function ue(e){return{providedIn:e.providedIn||null,factory:e.factory,value:void 0}}var le=function(){function e(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==t?ue({providedIn:t.providedIn||"root",factory:t.factory}):void 0}return e.prototype.toString=function(){return"InjectionToken "+this._desc},e}(),ce="__parameters__";function de(e,t,n){var r=function(e){return function(){for(var t=[],n=0;n ");else if("object"==typeof t){var o=[];for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];o.push(i+":"+("string"==typeof a?JSON.stringify(a):Ee(a)))}r="{"+o.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+e.replace(Ue,"\n ")}function Qe(e,t){return new Error(We(e,t))}var qe=void 0;function Je(e){var t=qe;return qe=e,t}String;var Ye=function(e){return e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None",e}(Ye||(Ye={})),Ke=new function(e){this.full="6.0.2",this.major="6.0.2".split(".")[0],this.minor="6.0.2".split(".")[1],this.patch="6.0.2".split(".").slice(2).join(".")}("6.0.2"),Xe="ngDebugContext",$e="ngOriginalError",et="ngErrorLogger";function tt(e){return e[Xe]}function nt(e){return e[$e]}function rt(e){for(var t=[],n=1;n0&&(o=setTimeout(function(){r._callbacks=r._callbacks.filter(function(e){return e.timeoutId!==o}),e(r._didWork,r.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:o,updateCb:n})},e.prototype.whenStable=function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.findProviders=function(e,t,n){return[]},e}(),zt=function(){function e(){this._applications=new Map,Zt.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.unregisterApplication=function(e){this._applications.delete(e)},e.prototype.unregisterAllApplications=function(){this._applications.clear()},e.prototype.getTestability=function(e){return this._applications.get(e)||null},e.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},e.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),Zt.findTestabilityInTree(this,e,t)},e.ctorParameters=function(){return[]},e}(),Zt=new(function(){function e(){}return e.prototype.addToWindow=function(e){},e.prototype.findTestabilityInTree=function(e,t,n){return null},e}()),Gt=!0,Wt=!1,Qt=new le("AllowMultipleToken");function qt(){return Wt=!0,Gt}var Jt=function(e,t){this.name=e,this.token=t};function Yt(e,t,n){void 0===n&&(n=[]);var r="Platform: "+t,o=new le(r);return function(t){void 0===t&&(t=[]);var i=Kt();if(!i||i.injector.get(Qt,!1))if(e)e(n.concat(t).concat({provide:o,useValue:!0}));else{var a=n.concat(t).concat({provide:o,useValue:!0});!function(e){if(Lt&&!Lt.destroyed&&!Lt.injector.get(Qt,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Lt=e.get(Xt);var t=e.get(pt,null);t&&t.forEach(function(e){return e()})}(De.create({providers:a,name:r}))}return function(e){var t=Kt();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(o)}}function Kt(){return Lt&&!Lt.destroyed?Lt:null}var Xt=function(){function e(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return e.prototype.bootstrapModuleFactory=function(e,t){var n,r=this,o="noop"===(n=t?t.ngZone:void 0)?new Bt:("zone.js"===n?void 0:n)||new Dt({enableLongStackTrace:qt()}),i=[{provide:Dt,useValue:o}];return o.run(function(){var t=De.create({providers:i,parent:r.injector,name:e.moduleType.name}),n=e.create(t),a=n.injector.get(ot,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return tn(r._modules,n)}),o.runOutsideAngular(function(){return o.onError.subscribe({next:function(e){a.handleError(e)}})}),function(e,t,o){try{var i=((a=n.injector.get(ut)).runInitializers(),a.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return at(i)?i.catch(function(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}):i}catch(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}var a}(a,o)})},e.prototype.bootstrapModule=function(e,t){var n=this;void 0===t&&(t=[]);var r=this.injector.get(mt),o=$t({},t);return r.createCompiler([o]).compileModuleAsync(e).then(function(e){return n.bootstrapModuleFactory(e,o)})},e.prototype._moduleDoBootstrap=function(e){var t=e.injector.get(en);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+Ee(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}this._modules.push(e)},e.prototype.onDestroy=function(e){this._destroyListeners.push(e)},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),e}();function $t(e,t){return Array.isArray(t)?t.reduce($t,e):i({},e,t)}var en=function(){function e(e,t,n,r,o,i){var a=this;this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=o,this._initStatus=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=qt(),this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var s=new O(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),u=new O(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Dt.assertNotInAngularZone(),we(function(){a._stable||a._zone.hasPendingMacrotasks||a._zone.hasPendingMicrotasks||(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Dt.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=function(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof i&&(r=e.pop()),null===o&&1===e.length&&e[0]instanceof O?e[0]:function(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),function e(t,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(o){return o.pipe(e(function(e,r){return W(t(e,r)).pipe(U(function(t,o){return n(e,t,r,o)}))},r))}:("number"==typeof n&&(r=n),function(e){return e.lift(new Q(t,r))})}(J,e)}(r)(G(e,o))}(s,u.pipe(function(e){return te()((t=se,function(e){var n;n="function"==typeof t?t:function(){return t};var r=Object.create(e,ie);return r.source=e,r.subjectFactory=n,r})(e));var t}))}return e.prototype.bootstrap=function(e,t){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof _t?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var o=n instanceof Tt?null:this._injector.get(It),i=n.create(De.NULL,[],t||n.selector,o);i.onDestroy(function(){r._unloadComponent(i)});var a=i.injector.get(Ut,null);return a&&i.injector.get(zt).registerApplication(i.location.nativeElement,a),this._loadComponent(i),qt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),i},e.prototype.tick=function(){var t=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=e._tickScope();try{this._runningTick=!0,this._views.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(e){return e.checkNoChanges()})}catch(e){this._zone.runOutsideAngular(function(){return t._exceptionHandler.handleError(e)})}finally{this._runningTick=!1,Pt(n)}},e.prototype.attachView=function(e){var t=e;this._views.push(t),t.attachToAppRef(this)},e.prototype.detachView=function(e){var t=e;tn(this._views,t),t.detachFromAppRef()},e.prototype._loadComponent=function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(ht,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})},e.prototype._unloadComponent=function(e){this.detachView(e.hostView),tn(this.components,e)},e.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(e.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),e._tickScope=Vt("ApplicationRef#tick()"),e}();function tn(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var nn=function(){},rn=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(rn||(rn={})),on=function(){},an=function(e){this.nativeElement=e},sn=function(){function e(){this.dirty=!0,this._results=[],this.changes=new Nt,this.length=0}return e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.find=function(e){return this._results.find(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.forEach=function(e){this._results.forEach(e)},e.prototype.some=function(e){return this._results.some(e)},e.prototype.toArray=function(){return this._results.slice()},e.prototype[be()]=function(){return this._results[be()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=function e(t){return t.reduce(function(t,n){var r=Array.isArray(n)?e(n):n;return t.concat(r)},[])}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},e.prototype.notifyOnChanges=function(){this.changes.emit(this)},e.prototype.setDirty=function(){this.dirty=!0},e.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},e}(),un=function(){},ln=function(){},cn=function(){function e(e,t,n){this._debugContext=n,this.nativeNode=e,t&&t instanceof dn?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),e}(),dn=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.properties={},o.attributes={},o.classes={},o.styles={},o.childNodes=[],o.nativeElement=t,o}return o(t,e),t.prototype.addChild=function(e){e&&(this.childNodes.push(e),e.parent=this)},t.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))},t.prototype.insertChildrenAfter=function(e,t){var n,r=this,o=this.childNodes.indexOf(e);-1!==o&&((n=this.childNodes).splice.apply(n,u([o+1,0],t)),t.forEach(function(e){e.parent&&e.parent.removeChild(e),e.parent=r}))},t.prototype.insertBefore=function(e,t){var n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))},t.prototype.query=function(e){return this.queryAll(e)[0]||null},t.prototype.queryAll=function(e){var t=[];return function e(t,n,r){t.childNodes.forEach(function(t){t instanceof dn&&(n(t)&&r.push(t),e(t,n,r))})}(this,e,t),t},t.prototype.queryAllNodes=function(e){var t=[];return function e(t,n,r){t instanceof dn&&t.childNodes.forEach(function(t){n(t)&&r.push(t),t instanceof dn&&e(t,n,r)})}(this,e,t),t},Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes.filter(function(e){return e instanceof t})},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(n){n.name==e&&n.callback(t)})},t}(cn),pn=new Map;function fn(e){return pn.get(e)||null}function hn(e){pn.set(e.nativeNode,e)}function yn(e,t){var n=mn(e),r=mn(t);return n&&r?function(e,t,n){for(var r=e[be()](),o=t[be()]();;){var i=r.next(),a=o.next();if(i.done&&a.done)return!0;if(i.done||a.done)return!1;if(!n(i.value,a.value))return!1}}(e,t,yn):!(n||!e||"object"!=typeof e&&"function"!=typeof e||r||!t||"object"!=typeof t&&"function"!=typeof t)||Ce(e,t)}var gn=function(){function e(e){this.wrapped=e}return e.wrap=function(t){return new e(t)},e.unwrap=function(t){return e.isWrapped(t)?t.wrapped:t},e.isWrapped=function(t){return t instanceof e},e}(),vn=function(){function e(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}return e.prototype.isFirstChange=function(){return this.firstChange},e}();function mn(e){return!!_n(e)&&(Array.isArray(e)||!(e instanceof Map)&&be()in e)}function _n(e){return null!==e&&("function"==typeof e||"object"==typeof e)}var bn=function(){function e(){}return e.prototype.supports=function(e){return mn(e)},e.prototype.create=function(e){return new Cn(e)},e}(),wn=function(e,t){return t},Cn=function(){function e(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||wn}return e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachOperation=function(e){for(var t=this._itHead,n=this._removalsHead,r=0,o=null;t||n;){var i=!n||t&&t.currentIndex',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='

',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return e.prototype.getInertBodyElement_XHR=function(e){e=""+e+"";try{e=encodeURI(e)}catch(e){return null}var t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(null);var n=t.response.body;return n.removeChild(n.firstChild),n},e.prototype.getInertBodyElement_DOMParser=function(e){e=""+e+"";try{var t=(new window.DOMParser).parseFromString(e,"text/html").body;return t.removeChild(t.firstChild),t}catch(e){return null}},e.prototype.getInertBodyElement_InertDocument=function(e){var t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},e.prototype.stripCustomNsAttrs=function(e){for(var t=e.attributes,n=t.length-1;0")}else this.sanitizedSomething=!0},e.prototype.endElement=function(e){var t=e.nodeName.toLowerCase();$n.hasOwnProperty(t)&&!Jn.hasOwnProperty(t)&&(this.buf.push(""))},e.prototype.chars=function(e){this.buf.push(ar(e))},e.prototype.checkClobberedElement=function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t},e}(),or=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ir=/([^\#-~ |!])/g;function ar(e){return e.replace(/&/g,"&").replace(or,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(ir,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function sr(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var ur=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),lr=/^url\(([^)]+)\)$/,cr=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(cr||(cr={})),dr=function(){};function pr(e,t,n){var r=e.state,o=1792&r;return o===t?(e.state=-1793&r|n,e.initIndex=-1,!0):o===n}function fr(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function hr(e,t){return e.nodes[t]}function yr(e,t){return e.nodes[t]}function gr(e,t){return e.nodes[t]}function vr(e,t){return e.nodes[t]}function mr(e,t){return e.nodes[t]}var _r={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function br(e,t,n,r){var o="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+t+"'. Current value: '"+n+"'.";return r&&(o+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(e,t){var n=new Error(e);return wr(n,t),n}(o,e)}function wr(e,t){e[Xe]=t,e[et]=t.logError.bind(t)}function Cr(e){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+e)}var Er=function(){},xr=new Map;function Sr(e){var t=xr.get(e);return t||(t=Ee(e)+"_"+xr.size,xr.set(e,t)),t}var Ar="$$undefined",Tr="$$empty";function Ir(e){return{id:Ar,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}var Or=0;function kr(e,t,n,r){return!(!(2&e.state)&&Ce(e.oldValues[t.bindingIndex+n],r))}function Vr(e,t,n,r){return!!kr(e,t,n,r)&&(e.oldValues[t.bindingIndex+n]=r,!0)}function Pr(e,t,n,r){var o=e.oldValues[t.bindingIndex+n];if(1&e.state||!yn(o,r)){var i=t.bindings[n].name;throw br(_r.createDebugContext(e,t.nodeIndex),i+": "+o,i+": "+r,0!=(1&e.state))}}function Nr(e){for(var t=e;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function Dr(e,t){for(var n=e;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function Mr(e,t,n,r){try{return Nr(33554432&e.def.nodes[t].flags?yr(e,t).componentView:e),_r.handleEvent(e,t,n,r)}catch(t){e.root.errorHandler.handleError(t)}}function jr(e){return e.parent?yr(e.parent,e.parentNodeDef.nodeIndex):null}function Rr(e){return e.parent?e.parentNodeDef.parent:null}function Fr(e,t){switch(201347067&t.flags){case 1:return yr(e,t.nodeIndex).renderElement;case 2:return hr(e,t.nodeIndex).renderText}}function Hr(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function Lr(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function Br(e){return 1<-1}(r)||"root"===o.providedIn&&r._def.isRoot))){var l=e._providers.length;return e._def.providersByKey[t.tokenKey]={flags:5120,value:t.token.ngInjectableDef.factory,deps:[],index:l,token:t.token},e._providers[l]=so,e._providers[l]=ho(e,e._def.providersByKey[t.tokenKey])}return e._parent.get(t.token,n)}finally{Je(i)}}function ho(e,t){var n;switch(201347067&t.flags){case 512:n=function(e,t,n){var r=n.length;switch(r){case 0:return new t;case 1:return new t(fo(e,n[0]));case 2:return new t(fo(e,n[0]),fo(e,n[1]));case 3:return new t(fo(e,n[0]),fo(e,n[1]),fo(e,n[2]));default:for(var o=new Array(r),i=0;i=n.length)&&(t=n.length-1),t<0)return null;var r=n[t];return r.viewContainerParent=null,_o(n,t),_r.dirtyParentQueries(r),vo(r),r}function go(e,t,n){var r=t?Fr(t,t.def.lastRenderRootNode):e.renderElement;Qr(n,2,n.renderer.parentNode(r),n.renderer.nextSibling(r),void 0)}function vo(e){Qr(e,3,null,null,void 0)}function mo(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function _o(e,t){t>=e.length-1?e.pop():e.splice(t,1)}var bo=new Object,wo=function(e){function t(t,n,r,o,i,a){var s=e.call(this)||this;return s.selector=t,s.componentType=n,s._inputs=o,s._outputs=i,s.ngContentSelectors=a,s.viewDefFactory=r,s}return o(t,e),Object.defineProperty(t.prototype,"inputs",{get:function(){var e=[],t=this._inputs;for(var n in t)e.push({propName:n,templateName:t[n]});return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){var e=[];for(var t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e},enumerable:!0,configurable:!0}),t.prototype.create=function(e,t,n,r){if(!r)throw new Error("ngModule should be provided");var o=Wr(this.viewDefFactory),i=o.nodes[0].element.componentProvider.nodeIndex,a=_r.createRootView(e,t||[],n,o,r,bo),s=gr(a,i).instance;return n&&a.renderer.setAttribute(yr(a,0).renderElement,"ng-version",Ke.full),new Co(a,new Ao(a),s)},t}(_t),Co=function(e){function t(t,n,r){var o=e.call(this)||this;return o._view=t,o._viewRef=n,o._component=r,o._elDef=o._view.def.nodes[0],o.hostView=n,o.changeDetectorRef=n,o.instance=r,o}return o(t,e),Object.defineProperty(t.prototype,"location",{get:function(){return new an(yr(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new ko(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this._viewRef.destroy()},t.prototype.onDestroy=function(e){this._viewRef.onDestroy(e)},t}(function(){});function Eo(e,t,n){return new xo(e,t,n)}var xo=function(){function e(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}return Object.defineProperty(e.prototype,"element",{get:function(){return new an(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new ko(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentInjector",{get:function(){for(var e=this._view,t=this._elDef.parent;!t&&e;)t=Rr(e),e=e.parent;return e?new ko(e,t):new ko(this._view,null)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){for(var e=this._embeddedViews.length-1;e>=0;e--){var t=yo(this._data,e);_r.destroyView(t)}},e.prototype.get=function(e){var t=this._embeddedViews[e];if(t){var n=new Ao(t);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(e.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t,n){var r=e.createEmbeddedView(t||{});return this.insert(r,n),r},e.prototype.createComponent=function(e,t,n,r,o){var i=n||this.parentInjector;o||e instanceof Tt||(o=i.get(It));var a=e.create(i,r,void 0,o);return this.insert(a.hostView,t),a},e.prototype.insert=function(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,o,i,a=e;return o=a._view,i=(n=this._data).viewContainer._embeddedViews,null!==(r=t)&&void 0!==r||(r=i.length),o.viewContainerParent=this._view,mo(i,r,o),function(e,t){var n=jr(t);if(n&&n!==e&&!(16&t.state)){t.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),function(e,n){if(!(4&n.flags)){t.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,t.parentNodeDef)}}(n,o),_r.dirtyParentQueries(o),go(n,r>0?i[r-1]:null,o),a.attachToViewContainerRef(this),e},e.prototype.move=function(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,o,i,a,s=this._embeddedViews.indexOf(e._view);return o=t,a=(i=(n=this._data).viewContainer._embeddedViews)[r=s],_o(i,r),null==o&&(o=i.length),mo(i,o,a),_r.dirtyParentQueries(a),vo(a),go(n,o>0?i[o-1]:null,a),e},e.prototype.indexOf=function(e){return this._embeddedViews.indexOf(e._view)},e.prototype.remove=function(e){var t=yo(this._data,e);t&&_r.destroyView(t)},e.prototype.detach=function(e){var t=yo(this._data,e);return t?new Ao(t):null},e}();function So(e){return new Ao(e)}var Ao=function(){function e(e){this._view=e,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(e.prototype,"rootNodes",{get:function(){return Qr(this._view,0,void 0,void 0,e=[]),e;var e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){Nr(this._view)},e.prototype.detach=function(){this._view.state&=-5},e.prototype.detectChanges=function(){var e=this._view.root.rendererFactory;e.begin&&e.begin();try{_r.checkAndUpdateView(this._view)}finally{e.end&&e.end()}},e.prototype.checkNoChanges=function(){_r.checkNoChangesView(this._view)},e.prototype.reattach=function(){this._view.state|=4},e.prototype.onDestroy=function(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)},e.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),_r.destroyView(this._view)},e.prototype.detachFromAppRef=function(){this._appRef=null,vo(this._view),_r.dirtyParentQueries(this._view)},e.prototype.attachToAppRef=function(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e},e.prototype.attachToViewContainerRef=function(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e},e}();function To(e,t){return new Io(e,t)}var Io=function(e){function t(t,n){var r=e.call(this)||this;return r._parentView=t,r._def=n,r}return o(t,e),t.prototype.createEmbeddedView=function(e){return new Ao(_r.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))},Object.defineProperty(t.prototype,"elementRef",{get:function(){return new an(yr(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),t}(un);function Oo(e,t){return new ko(e,t)}var ko=function(){function e(e,t){this.view=e,this.elDef=t}return e.prototype.get=function(e,t){return void 0===t&&(t=De.THROW_IF_NOT_FOUND),_r.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:Sr(e)},t)},e}();function Vo(e,t){var n=e.def.nodes[t];if(1&n.flags){var r=yr(e,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return hr(e,n.nodeIndex).renderText;if(20240&n.flags)return gr(e,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+t)}function Po(e){return new No(e.renderer)}var No=function(){function e(e){this.delegate=e}return e.prototype.selectRootElement=function(e){return this.delegate.selectRootElement(e)},e.prototype.createElement=function(e,t){var n=s($r(t),2),r=this.delegate.createElement(n[1],n[0]);return e&&this.delegate.appendChild(e,r),r},e.prototype.createViewRoot=function(e){return e},e.prototype.createTemplateAnchor=function(e){var t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t},e.prototype.createText=function(e,t){var n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n},e.prototype.projectNodes=function(e,t){for(var n=0;n0,t.provider.value,t.provider.deps);if(t.outputs.length)for(var r=0;r0,r=t.provider;switch(201347067&t.flags){case 512:return Xo(e,t.parent,n,r.value,r.deps);case 1024:return function(e,t,n,r,o){var i=o.length;switch(i){case 0:return r();case 1:return r(ei(e,t,n,o[0]));case 2:return r(ei(e,t,n,o[0]),ei(e,t,n,o[1]));case 3:return r(ei(e,t,n,o[0]),ei(e,t,n,o[1]),ei(e,t,n,o[2]));default:for(var a=Array(i),s=0;s0)l=y,gi(y)||(c=y);else for(;l&&h===l.nodeIndex+l.childCount;){var m=l.parent;m&&(m.childFlags|=l.childFlags,m.childMatchedQueries|=l.childMatchedQueries),c=(l=m)&&gi(l)?l.renderParent:l}}return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:u,flags:e,nodes:t,updateDirectives:n||Er,updateRenderer:r||Er,handleEvent:function(e,n,r,o){return t[n].element.handleEvent(e,r,o)},bindingCount:o,outputCount:i,lastRenderRootNode:f}}function gi(e){return 0!=(1&e.flags)&&null===e.element.name}function vi(e,t,n){var r=t.element&&t.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+t.nodeIndex+"!")}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+t.nodeIndex+"!");if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+t.nodeIndex+"!");if(134217728&t.flags&&e)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+t.nodeIndex+"!")}if(t.childCount){var o=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=o&&t.nodeIndex+t.childCount>o)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+t.nodeIndex+"!")}}function mi(e,t,n,r){var o=wi(e.root,e.renderer,e,t,n);return Ci(o,e.component,r),Ei(o),o}function _i(e,t,n){var r=wi(e,e.renderer,null,null,t);return Ci(r,n,n),Ei(r),r}function bi(e,t,n,r){var o,i=t.element.componentRendererType;return o=i?e.root.rendererFactory.createRenderer(r,i):e.root.renderer,wi(e.root,o,e,t.element.componentProvider,n)}function wi(e,t,n,r,o){var i=new Array(o.nodes.length),a=o.outputCount?new Array(o.outputCount):null;return{def:o,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:i,state:13,root:e,renderer:t,oldValues:new Array(o.bindingCount),disposables:a,initIndex:-1}}function Ci(e,t,n){e.component=t,e.context=n}function Ei(e){var t;Hr(e)&&(t=yr(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);for(var n=e.def,r=e.nodes,o=0;o0&&ao(e,t,0,n)&&(f=!0),p>1&&ao(e,t,1,r)&&(f=!0),p>2&&ao(e,t,2,o)&&(f=!0),p>3&&ao(e,t,3,i)&&(f=!0),p>4&&ao(e,t,4,a)&&(f=!0),p>5&&ao(e,t,5,s)&&(f=!0),p>6&&ao(e,t,6,u)&&(f=!0),p>7&&ao(e,t,7,l)&&(f=!0),p>8&&ao(e,t,8,c)&&(f=!0),p>9&&ao(e,t,9,d)&&(f=!0),f}(e,t,n,r,o,i,a,s,u,l,c,d);case 2:return function(e,t,n,r,o,i,a,s,u,l,c,d){var p=!1,f=t.bindings,h=f.length;if(h>0&&Vr(e,t,0,n)&&(p=!0),h>1&&Vr(e,t,1,r)&&(p=!0),h>2&&Vr(e,t,2,o)&&(p=!0),h>3&&Vr(e,t,3,i)&&(p=!0),h>4&&Vr(e,t,4,a)&&(p=!0),h>5&&Vr(e,t,5,s)&&(p=!0),h>6&&Vr(e,t,6,u)&&(p=!0),h>7&&Vr(e,t,7,l)&&(p=!0),h>8&&Vr(e,t,8,c)&&(p=!0),h>9&&Vr(e,t,9,d)&&(p=!0),p){var y=t.text.prefix;h>0&&(y+=hi(n,f[0])),h>1&&(y+=hi(r,f[1])),h>2&&(y+=hi(o,f[2])),h>3&&(y+=hi(i,f[3])),h>4&&(y+=hi(a,f[4])),h>5&&(y+=hi(s,f[5])),h>6&&(y+=hi(u,f[6])),h>7&&(y+=hi(l,f[7])),h>8&&(y+=hi(c,f[8])),h>9&&(y+=hi(d,f[9]));var g=hr(e,t.nodeIndex).renderText;e.renderer.setValue(g,y)}return p}(e,t,n,r,o,i,a,s,u,l,c,d);case 16384:return function(e,t,n,r,o,i,a,s,u,l,c,d){var p=gr(e,t.nodeIndex),f=p.instance,h=!1,y=void 0,g=t.bindings.length;return g>0&&kr(e,t,0,n)&&(h=!0,y=ni(e,p,t,0,n,y)),g>1&&kr(e,t,1,r)&&(h=!0,y=ni(e,p,t,1,r,y)),g>2&&kr(e,t,2,o)&&(h=!0,y=ni(e,p,t,2,o,y)),g>3&&kr(e,t,3,i)&&(h=!0,y=ni(e,p,t,3,i,y)),g>4&&kr(e,t,4,a)&&(h=!0,y=ni(e,p,t,4,a,y)),g>5&&kr(e,t,5,s)&&(h=!0,y=ni(e,p,t,5,s,y)),g>6&&kr(e,t,6,u)&&(h=!0,y=ni(e,p,t,6,u,y)),g>7&&kr(e,t,7,l)&&(h=!0,y=ni(e,p,t,7,l,y)),g>8&&kr(e,t,8,c)&&(h=!0,y=ni(e,p,t,8,c,y)),g>9&&kr(e,t,9,d)&&(h=!0,y=ni(e,p,t,9,d,y)),y&&f.ngOnChanges(y),65536&t.flags&&fr(e,256,t.nodeIndex)&&f.ngOnInit(),262144&t.flags&&f.ngDoCheck(),h}(e,t,n,r,o,i,a,s,u,l,c,d);case 32:case 64:case 128:return function(e,t,n,r,o,i,a,s,u,l,c,d){var p=t.bindings,f=!1,h=p.length;if(h>0&&Vr(e,t,0,n)&&(f=!0),h>1&&Vr(e,t,1,r)&&(f=!0),h>2&&Vr(e,t,2,o)&&(f=!0),h>3&&Vr(e,t,3,i)&&(f=!0),h>4&&Vr(e,t,4,a)&&(f=!0),h>5&&Vr(e,t,5,s)&&(f=!0),h>6&&Vr(e,t,6,u)&&(f=!0),h>7&&Vr(e,t,7,l)&&(f=!0),h>8&&Vr(e,t,8,c)&&(f=!0),h>9&&Vr(e,t,9,d)&&(f=!0),f){var y=vr(e,t.nodeIndex),g=void 0;switch(201347067&t.flags){case 32:g=new Array(p.length),h>0&&(g[0]=n),h>1&&(g[1]=r),h>2&&(g[2]=o),h>3&&(g[3]=i),h>4&&(g[4]=a),h>5&&(g[5]=s),h>6&&(g[6]=u),h>7&&(g[7]=l),h>8&&(g[8]=c),h>9&&(g[9]=d);break;case 64:g={},h>0&&(g[p[0].name]=n),h>1&&(g[p[1].name]=r),h>2&&(g[p[2].name]=o),h>3&&(g[p[3].name]=i),h>4&&(g[p[4].name]=a),h>5&&(g[p[5].name]=s),h>6&&(g[p[6].name]=u),h>7&&(g[p[7].name]=l),h>8&&(g[p[8].name]=c),h>9&&(g[p[9].name]=d);break;case 128:var v=n;switch(h){case 1:g=v.transform(n);break;case 2:g=v.transform(r);break;case 3:g=v.transform(r,o);break;case 4:g=v.transform(r,o,i);break;case 5:g=v.transform(r,o,i,a);break;case 6:g=v.transform(r,o,i,a,s);break;case 7:g=v.transform(r,o,i,a,s,u);break;case 8:g=v.transform(r,o,i,a,s,u,l);break;case 9:g=v.transform(r,o,i,a,s,u,l,c);break;case 10:g=v.transform(r,o,i,a,s,u,l,c,d)}}y.value=g}return f}(e,t,n,r,o,i,a,s,u,l,c,d);default:throw"unreachable"}}(e,t,r,o,i,a,s,l,c,d,p,f):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){for(var r=!1,o=0;o0&&Pr(e,t,0,n),p>1&&Pr(e,t,1,r),p>2&&Pr(e,t,2,o),p>3&&Pr(e,t,3,i),p>4&&Pr(e,t,4,a),p>5&&Pr(e,t,5,s),p>6&&Pr(e,t,6,u),p>7&&Pr(e,t,7,l),p>8&&Pr(e,t,8,c),p>9&&Pr(e,t,9,d)}(e,t,r,o,i,a,s,u,l,c,d,p):function(e,t,n){for(var r=0;r0){var i=new Set(e.modules);Gi.forEach(function(t,r){if(i.has(r.ngInjectableDef.providedIn)){var o={token:r,flags:t.flags|(n?4096:0),deps:zr(t.deps),value:t.value,index:e.providers.length};e.providers.push(o),e.providersByKey[Sr(r)]=o}})}}(e=e.factory(function(){return Er})),e):e}(r))}var Zi=new Map,Gi=new Map,Wi=new Map;function Qi(e){Zi.set(e.token,e),"function"==typeof e.token&&e.token.ngInjectableDef&&"function"==typeof e.token.ngInjectableDef.providedIn&&Gi.set(e.token,e)}function qi(e,t){var n=Wr(Wr(t.viewDefFactory).nodes[0].element.componentView);Wi.set(e,n)}function Ji(){Zi.clear(),Gi.clear(),Wi.clear()}function Yi(e){if(0===Zi.size)return e;var t=function(e){for(var t=[],n=null,r=0;r1})},e.prototype.triggerSnapshot=function(){this.trigger.next()},e.prototype.toggleWebcam=function(){this.showWebcam=!this.showWebcam},e.prototype.handleInitError=function(e){this.errors.push(e)},e.prototype.showNextWebcam=function(e){this.nextWebcam.next(e)},e.prototype.handleImage=function(e){console.info("received webcam image",e),this.webcamImage=e},e.prototype.cameraWasSwitched=function(e){console.log("active device: "+e),this.deviceId=e},Object.defineProperty(e.prototype,"triggerObservable",{get:function(){return this.trigger.asObservable()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextWebcamObservable",{get:function(){return this.nextWebcam.asObservable()},enumerable:!0,configurable:!0}),e}(),Ta=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])};function Ia(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object;var Oa=function(){},ka=void 0,Va=["en",[["a","p"],["AM","PM"],ka],[["AM","PM"],ka,ka],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ka,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ka,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ka,"{1} 'at' {0}",ka],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],Pa={},Na=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}(Na||(Na={})),Da=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}(Da||(Da={})),Ma=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}(Ma||(Ma={})),ja=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}(ja||(ja={})),Ra=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}(Ra||(Ra={})),Fa=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}(Fa||(Fa={})),Ha=function(e){return e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday",e}(Ha||(Ha={})),La=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}(La||(La={})),Ba=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.Milliseconds=6]="Milliseconds",e[e.Day=7]="Day",e}(Ba||(Ba={})),Ua=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}(Ua||(Ua={})),za=new le("UseV4Plurals"),Za=function(){},Ga=function(e){function t(t,n){var r=e.call(this)||this;return r.locale=t,r.deprecatedPluralFn=n,r}return function(e,t){function n(){this.constructor=e}Ta(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.getPluralCategory=function(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):function(e){return function(e){var t=e.toLowerCase().replace(/_/g,"-"),n=Pa[t];if(n)return n;var r=t.split("-")[0];if(n=Pa[r])return n;if("en"===r)return Va;throw new Error('Missing locale data for the locale "'+e+'".')}(e)[18]}(t||this.locale)(e)){case Da.Zero:return"zero";case Da.One:return"one";case Da.Two:return"two";case Da.Few:return"few";case Da.Many:return"many";default:return"other"}},t}(Za),Wa=function(){function e(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}return Object.defineProperty(e.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),e}(),Qa=function(){function e(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._differ=null}return Object.defineProperty(e.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(e){qt()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){if("ngForOf"in e){var t=e.ngForOf.currentValue;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(e){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((n=t).name||typeof n)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var n},e.prototype.ngDoCheck=function(){if(this._differ){var e=this._differ.diff(this.ngForOf);e&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=this,n=[];e.forEachOperation(function(e,r,o){if(null==e.previousIndex){var i=t._viewContainer.createEmbeddedView(t._template,new Wa(null,t.ngForOf,-1,-1),o),a=new qa(e,i);n.push(a)}else null==o?t._viewContainer.remove(r):(i=t._viewContainer.get(r),t._viewContainer.move(i,o),a=new qa(e,i),n.push(a))});for(var r=0;r0?t[0].deviceId:null)}).catch(function(t){e.initError.next({message:t}),e.switchToVideoInput(null)})},e.prototype.ngOnDestroy=function(){this.stopMediaTracks(),this.unsubscribeFromSubscriptions()},Object.defineProperty(e.prototype,"trigger",{set:function(e){var t=this;this.triggerSubscription&&this.triggerSubscription.unsubscribe(),this.triggerSubscription=e.subscribe(function(){t.takeSnapshot()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"switchCamera",{set:function(e){var t=this;this.switchCameraSubscription&&this.switchCameraSubscription.unsubscribe(),this.switchCameraSubscription=e.subscribe(function(e){"string"==typeof e?t.switchToVideoInput(e):t.rotateVideoInput(!1!==e)})},enumerable:!0,configurable:!0}),e.getMediaConstraintsForDevice=function(e,t){var n=t||this.DEFAULT_VIDEO_OPTIONS;return e&&(n.deviceId={exact:e}),n},e.getDeviceIdFromMediaStreamTrack=function(t){if(t.getSettings&&t.getSettings()&&t.getSettings().deviceId)return t.getSettings().deviceId;if(t.getConstraints&&t.getConstraints()&&t.getConstraints().deviceId){var n=t.getConstraints().deviceId;return e.getValueFromConstrainDOMString(n)}},e.getFacingModeFromMediaStreamTrack=function(t){if(t){if(t.getSettings&&t.getSettings()&&t.getSettings().facingMode)return t.getSettings().facingMode;if(t.getConstraints&&t.getConstraints()&&t.getConstraints().facingMode){var n=t.getConstraints().facingMode;return e.getValueFromConstrainDOMString(n)}}},e.isUserFacing=function(t){var n=e.getFacingModeFromMediaStreamTrack(t);return!!n&&"user"===n.toLowerCase()},e.getValueFromConstrainDOMString=function(e){if(e){if(e instanceof String)return String(e);if(Array.isArray(e)&&Array(e).length>0)return String(e[0]);if("object"==typeof e){if(e.exact)return String(e.exact);if(e.ideal)return String(e.ideal)}}return null},e.prototype.takeSnapshot=function(){var e=this.video.nativeElement,t={width:this.width,height:this.height};e.videoWidth&&(t.width=e.videoWidth,t.height=e.videoHeight);var n=this.canvas.nativeElement;n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(this.video.nativeElement,0,0);var r=n.toDataURL("image/jpeg");this.imageCapture.next(new ts(r,"image/jpeg"))},e.prototype.rotateVideoInput=function(e){this.availableVideoInputs&&this.availableVideoInputs.length>1&&this.switchToVideoInput(this.availableVideoInputs[(this.activeVideoInputIndex+(e?1:this.availableVideoInputs.length-1))%this.availableVideoInputs.length].deviceId)},e.prototype.switchToVideoInput=function(e){this.videoInitialized=!1,this.stopMediaTracks(),this.initWebcam(e,this.videoOptions)},Object.defineProperty(e.prototype,"videoWidth",{get:function(){var e=this.getVideoAspectRatio(this.activeVideoSettings);return Math.min(this.width,this.height*e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"videoHeight",{get:function(){var e=this.getVideoAspectRatio(this.activeVideoSettings);return Math.min(this.height,this.width/e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"videoStyleClasses",{get:function(){var e="";return this.isMirrorImage()&&(e+="mirrored "),e.trim()},enumerable:!0,configurable:!0}),e.prototype.getVideoAspectRatio=function(e){if(e){if(e.aspectRatio)return e.aspectRatio;if(e.width&&e.width>0&&e.height&&e.height>0)return e.width/e.height}return this.width/this.height},e.prototype.initWebcam=function(t,n){var r=this,o=this.video.nativeElement;if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){var i=e.getMediaConstraintsForDevice(t,n);navigator.mediaDevices.getUserMedia({video:i}).then(function(t){r.mediaStream=t,o.srcObject=t,o.play(),r.activeVideoSettings=t.getVideoTracks()[0].getSettings();var n=e.getDeviceIdFromMediaStreamTrack(t.getVideoTracks()[0]);r.activeVideoInputIndex=n?r.availableVideoInputs.findIndex(function(e){return e.deviceId===n}):-1,r.videoInitialized=!0,r.cameraSwitched.next(n)}).catch(function(e){r.initError.next({message:e.message,mediaStreamError:e})})}else this.initError.next({message:"Cannot read UserMedia from MediaDevices."})},e.prototype.getActiveVideoTrack=function(){return this.mediaStream?this.mediaStream.getVideoTracks()[0]:null},e.prototype.isMirrorImage=function(){if(!this.getActiveVideoTrack())return!1;var t="auto";switch(this.mirrorImage&&("string"==typeof this.mirrorImage?t=String(this.mirrorImage).toLowerCase():this.mirrorImage.x&&(t=this.mirrorImage.x.toLowerCase())),t){case"always":return!0;case"never":return!1}return e.isUserFacing(this.getActiveVideoTrack())},e.prototype.stopMediaTracks=function(){this.mediaStream&&this.mediaStream.getTracks&&this.mediaStream.getTracks().forEach(function(e){return e.stop()})},e.prototype.unsubscribeFromSubscriptions=function(){this.triggerSubscription&&this.triggerSubscription.unsubscribe(),this.switchCameraSubscription&&this.switchCameraSubscription.unsubscribe()},e.prototype.detectAvailableDevices=function(){var e=this;return new Promise(function(t,n){Sa.getAvailableVideoInputs().then(function(n){e.availableVideoInputs=n,t(n)}).catch(function(t){e.availableVideoInputs=[],n(t)})})},e.DEFAULT_VIDEO_OPTIONS={facingMode:"environment"},e}(),rs=Ir({encapsulation:0,styles:[[".webcam-wrapper[_ngcontent-%COMP%]{display:inline-block;position:relative;line-height:0}.webcam-wrapper[_ngcontent-%COMP%] video.mirrored[_ngcontent-%COMP%]{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.webcam-wrapper[_ngcontent-%COMP%] canvas[_ngcontent-%COMP%]{display:none}.webcam-wrapper[_ngcontent-%COMP%] .camera-switch[_ngcontent-%COMP%]{background-color:rgba(0,0,0,.1);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAE9UlEQVR42u2aT2hdRRTGf+cRQqghSqihdBFDkRISK2KDfzDWxHaRQHEhaINKqa1gKQhd6EZLN+IidCH+Q0oWIkVRC21BQxXRitVaSbKoJSGtYGoK2tQ/tU1jY5v0c5F54Xl7b/KSO/PyEt+3e5f75p7zzZwzZ74zUEIJJfyfYaEGllQGVAGZlENdBy6Z2cSiYFTSKkkfS/pH/nBF0kFJdUW9AiRVASeAukD8DgNrzOySrwEzng18KaDzALXuG8W3AiStAvqBisBRNg40mtlPxbYCOgvgPO4bncWW+JpVeDQXRQhIygDfA00F5r0XuNfMrgclQFI98DDQCNQA5ZFXqoCWBVp8XwHRHeEqcN7loy/NbHBesyqpQ1KfFj/6nC+ZvFaApFrgPaCZpYVvgCfNbDiRAElNwGFg+RIt/X8H2s2s9wYCJDUAR4HqJX7++RN40MwGpgmQVAH0AQ2BPz4AHHPl8nBOAqtyFWQjsA6oL4Ada81sPDv7uwImod8kvSJp9RyS8O2SXnb/DYVd2Y9VSroQ4ANXJO2WVJmixqh0kzMWwL4LkiqRtDnA4D1zmfE8j9g9AezcnAHaPcfXdbfdnPZ2Yps6+DwAvO/Z1naTdApY7Xng48BDZnY1MpMVQBuw3iXc5Tnb0wBwBPjUzP6eoezuArZ6svM0geJLkvZEYnl3nkntoqROSbckSW2Suj3ZOIangc7GPJuUtNGdFIfmMeavktoSSKiW9LMPw30Q8JqkekmjCbOZRhuclLQjgYSNxUBAj6RyZ9ATgUJpUtJTCSR8vpAEXHAyWK5BXYFIGHOlepSAloUk4NEYgyoknQhEwhFJ0e8h6VSaQeerCb5uZgdi9utxYBNwOUD93hIVXswM4INCi6K9wAszFC2DwLOBDjHbYp59karIUnRdzYy/3ClqVklaUhfwTICj7K25OqA7a4wWagVsm4Me/xzwg2cCqqONFzO7DPxSCAJi436GUBgHHguQD2oTlJ55oSzP9ybccsttSJw1szdjFOSnI/8dTCGZHwcORp4Nx7y3B1iZ8/sm4MW8/Euxg5wIsS/HaAp3zeP4/G7obRDXI4jiTIA22H7Xdc7X+S3A5lC7QBQ357aq3VAjCeSkwUfAJrfvz+R8A9ADLAtZB+TinpjC5JMA+//jwPZZnF8G7J+L8z4IWB/zbG+gIujVWfLBW/NStVMmqaG4POJRsIjix7h8IGnLQuoBbQki5sVAJHyYm7YkNaRRtXwQ8G1cHpX0iKRrgUjYno17Sf0LrQhJUkdCeHWkVITGJI0k1QeS3ikGSUzOyJUJJNznYneuOCnpTldcxa2kP3xJYqOeSDjqZG8ShJLnE8TTuMS6Iyu1BW7djZqkfo9N0QOuYJmYQddfB7RG+gLTNzqAY9FrL+5/nwEbvDdJJe3zzOrhNP3AWRqmk55t3ZcBuj3b2gb0Sbrbo/NNzk7fFzu7s/E5EiC+rrmeQU0Kx2skvRFoOx2ZzlmSdgbsw49JetvtBpk8nM64d/cGbNtJ0s7cGyJlwHeEv+t3nqnLSgPAUOSGyG3AHUxdzqoJbEcvcL+ZTeTeEapzJKxgaeOcc/7Mf06D7kFrguS0VDAMtGadv+E47DT9tcChJej8ISfpD+abgTe45uOkFi8mnQ+JBVQ+d4VXuOptjavcyot8pq86mfwk8LWZnaOEEkoooYQSSojDv8AhQNeGfe0jAAAAAElFTkSuQmCC);background-repeat:no-repeat;border-radius:5px;position:absolute;right:13px;top:10px;height:48px;width:48px;background-size:80%;cursor:pointer;background-position:center;transition:background-color .2s ease}.webcam-wrapper[_ngcontent-%COMP%] .camera-switch[_ngcontent-%COMP%]:hover{background-color:rgba(0,0,0,.18)}"]],data:{}});function os(e){return yi(0,[(e()(),no(0,0,null,null,0,"div",[["class","camera-switch"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.rotateVideoInput(!0)&&r),r},null,null))],null,null)}function is(e){return yi(0,[ai(402653184,1,{video:0}),ai(402653184,2,{canvas:0}),(e()(),no(2,0,null,null,4,"div",[["class","webcam-wrapper"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.imageClick.next()&&r),r},null,null)),(e()(),no(3,0,[[1,0],["video",1]],null,0,"video",[["autoplay",""],["muted",""],["playsinline",""]],[[8,"width",0],[8,"height",0],[8,"className",0]],null,null,null,null)),(e()(),to(16777216,null,null,1,null,os)),Zo(5,16384,null,0,Ja,[ln,un],{ngIf:[0,"ngIf"]},null),(e()(),no(6,0,[[2,0],["canvas",1]],null,0,"canvas",[],[[8,"width",0],[8,"height",0]],null,null,null,null))],function(e,t){var n=t.component;e(t,5,0,n.allowCameraSwitch&&n.availableVideoInputs.length>1&&n.videoInitialized)},function(e,t){var n=t.component;e(t,3,0,n.videoWidth,n.videoHeight,n.videoStyleClasses),e(t,6,0,n.width,n.height)})}var as=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])};function ss(e,t){function n(){this.constructor=e}as(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var us=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function cs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var ds=new O(function(e){return e.complete()}),ps=function(e){function t(t,n){var r=e.call(this,t)||this;r.sources=n,r.completed=0,r.haveValues=0;var o=n.length;r.values=new Array(o);for(var i=0;i0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var vs=null;function ms(){return vs}var _s,bs={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},ws={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Cs={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"};ve.Node&&(_s=ve.Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))});var Es,xs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hs(t,e),t.prototype.parse=function(e){throw new Error("parse not implemented")},t.makeCurrent=function(){var e;e=new t,vs||(vs=e)},t.prototype.hasProperty=function(e,t){return t in e},t.prototype.setProperty=function(e,t,n){e[t]=n},t.prototype.getProperty=function(e,t){return e[t]},t.prototype.invoke=function(e,t,n){var r;(r=e)[t].apply(r,function(){for(var e=[],t=0;t0},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,n=e.attributes,r=0;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(e.split(";")),r=n.next();!r.done;r=n.next()){var o=r.value,i=o.indexOf("="),a=Ia(-1==i?[o,""]:[o.slice(0,i),o.slice(i+1)],2),s=a[1];if(a[0].trim()===t)return decodeURIComponent(s)}}catch(e){u={error:e}}finally{try{r&&!r.done&&(l=n.return)&&l.call(n)}finally{if(u)throw u.error}}return null;var u,l}(document.cookie,e)},t.prototype.setCookie=function(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)},t}(function(e){function t(){var t=e.call(this)||this;t._animationPrefix=null,t._transitionEnd=null;try{var n=t.createElement("div",document);if(null!=t.getStyle(n,"animationName"))t._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],o=0;o0;a||(a=e[i]=[]);var u=au(t)?Zone.root:Zone.current;if(0===a.length)a.push({zone:u,handler:o});else{for(var l=!1,c=0;c-1},t}(Hs),fu=["alt","control","meta","shift"],hu={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},yu=function(e){function t(t){return e.call(this,t)||this}return hs(t,e),t.prototype.supports=function(e){return null!=t.parseEventName(e)},t.prototype.addEventListener=function(e,n,r){var o=t.parseEventName(n),i=t.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return ms().onAndCancel(e,o.domEventName,i)})},t.parseEventName=function(e){var n=e.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;var o=t._normalizeKey(n.pop()),i="";if(fu.forEach(function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),i+=e+".")}),i+=o,0!=n.length||0===o.length)return null;var a={};return a.domEventName=r,a.fullKey=i,a},t.getEventFullKey=function(e){var t="",n=ms().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),fu.forEach(function(r){r!=n&&(0,hu[r])(e)&&(t+=r+".")}),t+=n},t.eventCallback=function(e,n,r){return function(o){t.getEventFullKey(o)===e&&r.runGuarded(function(){return n(o)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t}(Hs),gu=function(){},vu=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n}return hs(t,e),t.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case cr.NONE:return t;case cr.HTML:return t instanceof _u?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),function(e,t){var n=null;try{qn=qn||new Un(e);var r=t?String(t):"";n=qn.getInertBodyElement(r);var o=5,i=r;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,r=i,i=n.innerHTML,n=qn.getInertBodyElement(r)}while(r!==i);var a=new rr,s=a.sanitizeChildren(sr(n)||n);return qt()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),s}finally{if(n)for(var u=sr(n)||n;u.firstChild;)u.removeChild(u.firstChild)}}(this._doc,String(t)));case cr.STYLE:return t instanceof bu?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),function(e){if(!(e=String(e).trim()))return"";var t=e.match(lr);return t&&Gn(t[1])===t[1]||e.match(ur)&&function(e){for(var t=!0,n=!0,r=0;re?{max:{max:e,actual:t.value}}:null}},e.required=function(e){return Ou(e.value)?{required:!0}:null},e.requiredTrue=function(e){return!0===e.value?null:{required:!0}},e.email=function(e){return Ou(e.value)?null:ku.test(e.value)?null:{email:!0}},e.minLength=function(e){return function(t){if(Ou(t.value))return null;var n=t.value?t.value.length:0;return ne?{maxlength:{requiredLength:e,actualLength:n}}:null}},e.pattern=function(t){return t?("string"==typeof t?(r="","^"!==t.charAt(0)&&(r+="^"),r+=t,"$"!==t.charAt(t.length-1)&&(r+="$"),n=new RegExp(r)):(r=t.toString(),n=t),function(e){if(Ou(e.value))return null;var t=e.value;return n.test(t)?null:{pattern:{requiredPattern:r,actualValue:t}}}):e.nullValidator;var n,r},e.nullValidator=function(e){return null},e.compose=function(e){if(!e)return null;var t=e.filter(Pu);return 0==t.length?null:function(e){return Du(function(e,n){return t.map(function(t){return t(e)})}(e))}},e.composeAsync=function(e){if(!e)return null;var t=e.filter(Pu);return 0==t.length?null:function(e){return function e(){for(var t,n=[],r=0;r=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)},e.prototype.select=function(e){var t=this;this._accessors.forEach(function(n){t._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})},e.prototype._isSameGroup=function(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name},e}(),Gu=function(){function e(e,t,n,r){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){this._control=this._injector.get(zu),this._checkName(),this._registry.add(this._control,this)},e.prototype.ngOnDestroy=function(){this._registry.remove(this)},e.prototype.writeValue=function(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},e.prototype.registerOnChange=function(e){var t=this;this._fn=e,this.onChange=function(){e(t.value),t._registry.select(t)}},e.prototype.fireUncheck=function(e){this.writeValue(e)},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},e.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},e}(),Wu='\n

\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',Qu='\n
\n
\n \n
\n
';function qu(e,t){return function(){for(var e=[],t=0;t1?"path: '"+e.path.join(" -> ")+"'":e.path[0]?"name: '"+e.path+"'":"unspecified name attribute",new Error(t+" "+n)}function Xu(e){return null!=e?Vu.compose(e.map(Hu)):null}function $u(e){return null!=e?Vu.composeAsync(e.map(Lu)):null}var el=[ju,function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))},e.prototype.registerOnChange=function(e){this.onChange=function(t){e(""==t?null:parseFloat(t))}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e}(),Bu,function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ce}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){this.value=e;var t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),(e+": "+t).slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){t.value=t._getOptionValue(n),e(t.value)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._registerOption=function(){return(this._idCounter++).toString()},e.prototype._getOptionId=function(e){try{for(var t=ls(Array.from(this._optionMap.keys())),n=t.next();!n.done;n=t.next()){var r=n.value;if(this._compareWith(this._optionMap.get(r),e))return r}}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=t.return)&&i.call(t)}finally{if(o)throw o.error}}return null;var o,i},e.prototype._getOptionValue=function(e){var t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e},e}(),function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ce}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){var t,n=this;if(this.value=e,Array.isArray(e)){var r=e.map(function(e){return n._getOptionId(e)});t=function(e,t){e._setSelected(r.indexOf(t.toString())>-1)}}else t=function(e,t){e._setSelected(!1)};this._optionMap.forEach(t)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var o=n.selectedOptions,i=0;i0||this.disabled;var n,r},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},t}(al),ll=function(e){function t(t,n,r){var o=e.call(this,rl(n),ol(r,n))||this;return o.controls=t,o._initObservables(),o._setUpdateStrategy(n),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),o}return ss(t,e),t.prototype.at=function(e){return this.controls[e]},t.prototype.push=function(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},t.prototype.insert=function(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()},t.prototype.removeAt=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity()},t.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(t.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t={}),this._checkAllValuesPresent(e),e.forEach(function(e,r){n._throwIfControlMissing(r),n.at(r).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.patchValue=function(e,t){var n=this;void 0===t&&(t={}),e.forEach(function(e,r){n.at(r)&&n.at(r).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.reset=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={}),this._forEachChild(function(n,r){n.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t),this._updatePristine(t),this._updateTouched(t)},t.prototype.getRawValue=function(){return this.controls.map(function(e){return e instanceof sl?e.value:e.getRawValue()})},t.prototype._syncPendingControls=function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e},t.prototype._throwIfControlMissing=function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)},t.prototype._forEachChild=function(e){this.controls.forEach(function(t,n){e(t,n)})},t.prototype._updateValue=function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})},t.prototype._anyControls=function(e){return this.controls.some(function(t){return t.enabled&&e(t)})},t.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: "+n+".")})},t.prototype._allControlsDisabled=function(){try{for(var e=ls(this.controls),t=e.next();!t.done;t=e.next())if(t.value.enabled)return!1}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return this.controls.length>0||this.disabled;var n,r},t.prototype._registerControl=function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)},t}(al),cl=Promise.resolve(null),dl=function(e){function t(t,n){var r=e.call(this)||this;return r.submitted=!1,r._directives=[],r.ngSubmit=new Nt,r.form=new ul({},Xu(t),$u(n)),r}return ss(t,e),t.prototype.ngAfterViewInit=function(){this._setUpdateStrategy()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),Ju(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})},t.prototype.getControl=function(e){return this.form.get(e.path)},t.prototype.removeControl=function(e){var t=this;cl.then(function(){var n,r,o=t._findContainer(e.path);o&&o.removeControl(e.name),(r=(n=t._directives).indexOf(e))>-1&&n.splice(r,1)})},t.prototype.addFormGroup=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path),r=new ul({});(function(e,t){null==e&&Ku(t,"Cannot find control with"),e.validator=Vu.compose([e.validator,t.validator]),e.asyncValidator=Vu.composeAsync([e.asyncValidator,t.asyncValidator])})(r,e),n.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})},t.prototype.removeFormGroup=function(e){var t=this;cl.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})},t.prototype.getFormGroup=function(e){return this.form.get(e.path)},t.prototype.updateModel=function(e,t){var n=this;cl.then(function(){n.form.get(e.path).setValue(t)})},t.prototype.setValue=function(e){this.control.setValue(e)},t.prototype.onSubmit=function(e){return this.submitted=!0,t=this._directives,this.form._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)}),this.ngSubmit.emit(e),!1;var t},t.prototype.onReset=function(){this.resetForm()},t.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this.submitted=!1},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)},t.prototype._findContainer=function(e){return e.pop(),e.length?this.form.get(e):this.form},t}(Iu),pl=function(){function e(){}return e.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n \n
\n \n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });\n\n Or, if you\'d like to avoid registering this form control, indicate that it\'s standalone in ngModelOptions:\n\n Example:\n\n \n
\n \n \n
\n ')},e.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+Wu+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+Qu)},e.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},e.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+Wu+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+Qu)},e}(),fl=function(e){function t(t,n,r){var o=e.call(this)||this;return o._parent=t,o._validators=n,o._asyncValidators=r,o}return ss(t,e),t.prototype._checkParentType=function(){this._parent instanceof t||this._parent instanceof dl||pl.modelGroupParentException()},t}(tl),hl=Promise.resolve(null),yl=function(e){function t(t,n,r,o){var i=e.call(this)||this;return i.control=new sl,i._registered=!1,i.update=new Nt,i._parent=t,i._rawValidators=n||[],i._rawAsyncValidators=r||[],i.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t)||Ku(e,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,o=void 0;return t.forEach(function(t){var i;t.constructor===Fu?n=t:(i=t,el.some(function(e){return i.constructor===e})?(r&&Ku(e,"More than one built-in value accessor matches form control with"),r=t):(o&&Ku(e,"More than one custom value accessor matches form control with"),o=t))}),o||r||n||(Ku(e,"No valid value accessor for form control with"),null)}(i,o),i}return ss(t,e),t.prototype.ngOnChanges=function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Ce(t,n.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},t.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(t.prototype,"path",{get:function(){return this._parent?qu(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return Xu(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return $u(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},t.prototype._setUpControl=function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)},t.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},t.prototype._setUpStandalone=function(){Ju(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})},t.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},t.prototype._checkParentType=function(){!(this._parent instanceof fl)&&this._parent instanceof tl?pl.formGroupNameException():this._parent instanceof fl||this._parent instanceof dl||pl.modelParentException()},t.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||pl.missingNameException()},t.prototype._updateValue=function(e){var t=this;hl.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})},t.prototype._updateDisabled=function(e){var t=this,n=e.isDisabled.currentValue,r=""===n||n&&"false"!==n;hl.then(function(){r&&!t.control.disabled?t.control.disable():!r&&t.control.disabled&&t.control.enable()})},t}(zu),gl=function(){},vl=function(){},ml=Ir({encapsulation:0,styles:[[".actionBtn[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:2px;font-size:1.2em}.snapshot[_ngcontent-%COMP%]{text-align:center}.snapshot[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:800px;max-height:800px}ul.links[_ngcontent-%COMP%]{padding-bottom:20px}"]],data:{}});function _l(e){return yi(0,[(e()(),no(0,0,null,null,1,"webcam",[],null,[[null,"imageCapture"],[null,"cameraSwitched"],[null,"initError"]],function(e,t,n){var r=!0,o=e.component;return"imageCapture"===t&&(r=!1!==o.handleImage(n)&&r),"cameraSwitched"===t&&(r=!1!==o.cameraWasSwitched(n)&&r),"initError"===t&&(r=!1!==o.handleInitError(n)&&r),r},is,rs)),Zo(1,4374528,null,0,ns,[],{width:[0,"width"],height:[1,"height"],videoOptions:[2,"videoOptions"],allowCameraSwitch:[3,"allowCameraSwitch"],trigger:[4,"trigger"],switchCamera:[5,"switchCamera"]},{imageCapture:"imageCapture",initError:"initError",cameraSwitched:"cameraSwitched"})],function(e,t){var n=t.component;e(t,1,0,500,500,n.videoOptions,n.allowCameraSwitch,n.triggerObservable,n.nextWebcamObservable)},null)}function bl(e){return yi(0,[(e()(),no(0,0,null,null,3,"div",[["class","snapshot"]],null,null,null,null,null)),(e()(),no(1,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),pi(-1,null,["Nice one!"])),(e()(),no(3,0,null,null,0,"img",[],[[8,"src",4]],null,null,null,null))],null,function(e,t){e(t,3,0,t.component.webcamImage.imageAsDataUrl)})}function wl(e){return yi(0,[(e()(),no(0,0,null,null,1,"h4",[],null,null,null,null,null)),(e()(),pi(-1,null,["Messages:"]))],null,null)}function Cl(e){return yi(0,[(e()(),no(0,0,null,null,3,"ul",[],null,null,null,null,null)),(e()(),no(1,0,null,null,2,"li",[],null,null,null,null,null)),(e()(),pi(2,null,["",""])),(t=0,n=Xa,r=[],Wo(-1,t|=16,null,0,n,n,r))],null,function(e,t){e(t,2,0,function(e,t,n,r){if(gn.isWrapped(r)){r=gn.unwrap(r);var o=e.def.nodes[2].bindingIndex+0,i=gn.unwrap(e.oldValues[o]);e.oldValues[o]=new gn(i)}return r}(t,0,0,Vo(t,3).transform(t.context.$implicit)))});var t,n,r}function El(e){return yi(0,[(e()(),no(0,0,null,null,31,"div",[["style","text-align:center"]],null,null,null,null,null)),(e()(),no(1,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),pi(-1,null,[" Ngx-Webcam Demo "])),(e()(),no(3,0,null,null,28,"div",[],null,null,null,null,null)),(e()(),to(16777216,null,null,1,null,_l)),Zo(5,16384,null,0,Ja,[ln,un],{ngIf:[0,"ngIf"]},null),(e()(),no(6,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),no(7,0,null,null,1,"button",[["class","actionBtn"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.triggerSnapshot()&&r),r},null,null)),(e()(),pi(-1,null,["Take A Snapshot"])),(e()(),no(9,0,null,null,1,"button",[["class","actionBtn"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.toggleWebcam()&&r),r},null,null)),(e()(),pi(-1,null,["Toggle Webcam"])),(e()(),no(11,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),no(12,0,null,null,1,"button",[["class","actionBtn"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.showNextWebcam(!0)&&r),r},null,null)),(e()(),pi(-1,null,["Next Webcam"])),(e()(),no(14,0,null,null,5,"input",[["id","cameraSwitchCheckbox"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(e,t,n){var r=!0,o=e.component;return"change"===t&&(r=!1!==Vo(e,15).onChange(n.target.checked)&&r),"blur"===t&&(r=!1!==Vo(e,15).onTouched()&&r),"ngModelChange"===t&&(r=!1!==(o.allowCameraSwitch=n)&&r),r},null,null)),Zo(15,16384,null,0,ju,[on,an],null,null),Go(1024,null,Mu,function(e){return[e]},[ju]),Zo(17,671744,null,0,yl,[[8,null],[8,null],[8,null],[6,Mu]],{model:[0,"model"]},{update:"ngModelChange"}),Go(2048,null,zu,null,[yl]),Zo(19,16384,null,0,nl,[[4,zu]],null,null),(e()(),no(20,0,null,null,1,"label",[["for","cameraSwitchCheckbox"]],null,null,null,null,null)),(e()(),pi(-1,null,["Allow Camera Switch"])),(e()(),no(22,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),pi(-1,null,[" DeviceId: "])),(e()(),no(24,0,null,null,5,"input",[["id","deviceId"],["style","width: 500px"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,o=e.component;return"input"===t&&(r=!1!==Vo(e,25)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==Vo(e,25).onTouched()&&r),"compositionstart"===t&&(r=!1!==Vo(e,25)._compositionStart()&&r),"compositionend"===t&&(r=!1!==Vo(e,25)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(o.deviceId=n)&&r),r},null,null)),Zo(25,16384,null,0,Fu,[on,an,[2,Ru]],null,null),Go(1024,null,Mu,function(e){return[e]},[Fu]),Zo(27,671744,null,0,yl,[[8,null],[8,null],[8,null],[6,Mu]],{model:[0,"model"]},{update:"ngModelChange"}),Go(2048,null,zu,null,[yl]),Zo(29,16384,null,0,nl,[[4,zu]],null,null),(e()(),no(30,0,null,null,1,"button",[],null,[[null,"click"]],function(e,t,n){var r=!0,o=e.component;return"click"===t&&(r=!1!==o.showNextWebcam(o.deviceId)&&r),r},null,null)),(e()(),pi(-1,null,["Activate"])),(e()(),to(16777216,null,null,1,null,bl)),Zo(33,16384,null,0,Ja,[ln,un],{ngIf:[0,"ngIf"]},null),(e()(),to(16777216,null,null,1,null,wl)),Zo(35,16384,null,0,Ja,[ln,un],{ngIf:[0,"ngIf"]},null),(e()(),to(16777216,null,null,1,null,Cl)),Zo(37,802816,null,0,Qa,[ln,un,kn],{ngForOf:[0,"ngForOf"]},null),(e()(),no(38,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),pi(-1,null,["Like this project on GitHub:"])),(e()(),no(40,0,null,null,4,"ul",[["class","links"]],null,null,null,null,null)),(e()(),no(41,0,null,null,3,"li",[],null,null,null,null,null)),(e()(),no(42,0,null,null,2,"h2",[],null,null,null,null,null)),(e()(),no(43,0,null,null,1,"a",[["href","https://github.com/basst314/ngx-webcam"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(e()(),pi(-1,null,["Ngx-Webcam / GitHub"]))],function(e,t){var n=t.component;e(t,5,0,n.showWebcam),e(t,17,0,n.allowCameraSwitch),e(t,27,0,n.deviceId),e(t,33,0,n.webcamImage),e(t,35,0,n.errors.length>0),e(t,37,0,n.errors)},function(e,t){e(t,12,0,!t.component.multipleWebcamsAvailable),e(t,14,0,Vo(t,19).ngClassUntouched,Vo(t,19).ngClassTouched,Vo(t,19).ngClassPristine,Vo(t,19).ngClassDirty,Vo(t,19).ngClassValid,Vo(t,19).ngClassInvalid,Vo(t,19).ngClassPending),e(t,24,0,Vo(t,29).ngClassUntouched,Vo(t,29).ngClassTouched,Vo(t,29).ngClassPristine,Vo(t,29).ngClassDirty,Vo(t,29).ngClassValid,Vo(t,29).ngClassInvalid,Vo(t,29).ngClassPending)})}var xl=function(e,t,n,r,o,i){return new wo("app-root",Aa,function(e){return yi(0,[(e()(),no(0,0,null,null,1,"app-root",[],null,null,null,El,ml)),Zo(1,114688,null,0,Aa,[],null,null)],function(e,t){e(t,1,0)},null)},{},{},[])}(),Sl=function(){},Al=function(e,t,n){return new Ca(xa,[Aa],function(e){return function(e){for(var t={},n=[],r=!1,o=0;o - +
diff --git a/src/app/modules/webcam/webcam/webcam.component.scss b/src/app/modules/webcam/webcam/webcam.component.scss index 41b6734..865a95a 100644 --- a/src/app/modules/webcam/webcam/webcam.component.scss +++ b/src/app/modules/webcam/webcam/webcam.component.scss @@ -3,6 +3,10 @@ position: relative; line-height: 0; + video.mirrored { + transform: scale(-1, 1); + } + canvas { display: none; } diff --git a/src/app/modules/webcam/webcam/webcam.component.ts b/src/app/modules/webcam/webcam/webcam.component.ts index a1cf9e2..beee93c 100644 --- a/src/app/modules/webcam/webcam/webcam.component.ts +++ b/src/app/modules/webcam/webcam/webcam.component.ts @@ -3,6 +3,7 @@ import {WebcamInitError} from "../domain/webcam-init-error"; import {WebcamImage} from "../domain/webcam-image"; import {Observable, Subscription} from "rxjs"; import {WebcamUtil} from "../util/webcam.util"; +import {WebcamMirrorProperties} from "../domain/webcam-mirror-properties"; @Component({ selector: 'webcam', @@ -23,6 +24,8 @@ export class WebcamComponent implements AfterViewInit, OnDestroy { @Input() public videoOptions: MediaTrackConstraints = WebcamComponent.DEFAULT_VIDEO_OPTIONS; /** Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras were found */ @Input() public allowCameraSwitch: boolean = true; + /** Parameter to control image mirroring (i.e. for user-facing camera). ["auto", "always", "never"] */ + @Input() public mirrorImage: string | WebcamMirrorProperties; /** Subscription to switchCamera events */ private switchCameraSubscription: Subscription; @@ -127,22 +130,61 @@ export class WebcamComponent implements AfterViewInit, OnDestroy { * @returns {string} deviceId if found in the mediaStreamTrack */ private static getDeviceIdFromMediaStreamTrack(mediaStreamTrack: MediaStreamTrack): string { - if (mediaStreamTrack.getSettings() && mediaStreamTrack.getSettings().deviceId) { + if (mediaStreamTrack.getSettings && mediaStreamTrack.getSettings() && mediaStreamTrack.getSettings().deviceId) { return mediaStreamTrack.getSettings().deviceId; - } else if (mediaStreamTrack.getConstraints() && mediaStreamTrack.getConstraints().deviceId) { + } else if (mediaStreamTrack.getConstraints && mediaStreamTrack.getConstraints() && mediaStreamTrack.getConstraints().deviceId) { let deviceIdObj: ConstrainDOMString = mediaStreamTrack.getConstraints().deviceId; - if (deviceIdObj instanceof String) { - return String(deviceIdObj); - } else if (Array.isArray(deviceIdObj) && Array(deviceIdObj).length > 0) { - return deviceIdObj[0]; - } else if (typeof deviceIdObj === "object") { - if (deviceIdObj["exact"]) { - return deviceIdObj["exact"]; - } else if (deviceIdObj["ideal"]) { - return deviceIdObj["ideal"]; + return WebcamComponent.getValueFromConstrainDOMString(deviceIdObj); + } + } + + /** + * Tries to harvest the facingMode from the given mediaStreamTrack object. + * Browsers populate this object differently; this method tries some different approaches + * to read the value. + * @param {MediaStreamTrack} mediaStreamTrack + * @returns {string} facingMode if found in the mediaStreamTrack + */ + private static getFacingModeFromMediaStreamTrack(mediaStreamTrack: MediaStreamTrack): string { + if (mediaStreamTrack) { + if (mediaStreamTrack.getSettings && mediaStreamTrack.getSettings() && mediaStreamTrack.getSettings().facingMode) { + return mediaStreamTrack.getSettings().facingMode; + } else if (mediaStreamTrack.getConstraints && mediaStreamTrack.getConstraints() && mediaStreamTrack.getConstraints().facingMode) { + let facingModeConstraint: ConstrainDOMString = mediaStreamTrack.getConstraints().facingMode; + return WebcamComponent.getValueFromConstrainDOMString(facingModeConstraint); + } + } + } + + /** + * Determines whether the given mediaStreamTrack claims itself as user facing + * @param mediaStreamTrack + */ + private static isUserFacing(mediaStreamTrack: MediaStreamTrack): boolean { + let facingMode: string = WebcamComponent.getFacingModeFromMediaStreamTrack(mediaStreamTrack); + return facingMode ? "user" === facingMode.toLowerCase() : false; + } + + /** + * Extracts the value from the given ConstrainDOMString + * @param constrainDOMString + */ + private static getValueFromConstrainDOMString(constrainDOMString: ConstrainDOMString): string { + if (constrainDOMString) { + if (constrainDOMString instanceof String) { + return String(constrainDOMString); + } else if (Array.isArray(constrainDOMString) && Array(constrainDOMString).length > 0) { + return String(constrainDOMString[0]); + } else if (typeof constrainDOMString === "object") { + if (constrainDOMString["exact"]) { + return String(constrainDOMString["exact"]); + } else if (constrainDOMString["ideal"]) { + return String(constrainDOMString["ideal"]); } } } + + return null; } /** @@ -202,6 +244,16 @@ export class WebcamComponent implements AfterViewInit, OnDestroy { return Math.min(this.height, this.width / videoRatio); } + public get videoStyleClasses() { + let classes: string = ""; + + if (this.isMirrorImage()) { + classes += "mirrored "; + } + + return classes.trim(); + } + /** * Return the video aspect ratio from the given mediaTrackSettings, if possible; * Otherwise, calculate given the width/height parameters only @@ -256,6 +308,42 @@ export class WebcamComponent implements AfterViewInit, OnDestroy { } } + private getActiveVideoTrack(): MediaStreamTrack { + return this.mediaStream ? this.mediaStream.getVideoTracks()[0] : null; + } + + private isMirrorImage(): boolean { + if (!this.getActiveVideoTrack()) { + return false; + } + + // check for explicit mirror override parameter + { + let mirror: string = "auto"; + if (this.mirrorImage) { + if (typeof this.mirrorImage === "string") { + mirror = String(this.mirrorImage).toLowerCase(); + } else { + // WebcamMirrorProperties + if (this.mirrorImage.x) { + mirror = this.mirrorImage.x.toLowerCase(); + } + } + } + + switch (mirror) { + case "always": + return true; + case "never": + return false; + } + } + + // default: enable mirroring if webcam is user facing + return WebcamComponent.isUserFacing(this.getActiveVideoTrack()); + } + + /** * Stops all active media tracks. * This prevents the webcam from being indicated as active,