scanbot-web-sdk 7.0.0-dev.1 → 7.0.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/@types/core/bridge/compiled/BarcodeDocumentModel.d.ts +1421 -0
  2. package/@types/core/bridge/compiled/CheckDocumentModel.d.ts +130 -0
  3. package/@types/core/bridge/compiled/CreditCardDocumentModel.d.ts +16 -0
  4. package/@types/core/bridge/compiled/DocumentsModel.d.ts +489 -0
  5. package/@types/core/bridge/compiled/TextPatternScannerTypes.d.ts +1 -21
  6. package/@types/core/bridge/compiled/VinScannerTypes.d.ts +79 -0
  7. package/@types/core/bridge/worker-bridge.d.ts +26 -12
  8. package/@types/core/worker/ScanbotSDK.Core.d.ts +8 -2
  9. package/@types/core-types.d.ts +5 -0
  10. package/@types/index.d.ts +1 -1
  11. package/@types/model/configuration/vin-scanner-configuration.d.ts +4 -4
  12. package/@types/scanbot-sdk.d.ts +14 -12
  13. package/@types/service/vin-scanner.d.ts +16 -0
  14. package/@types/text-pattern-scanner-view.d.ts +7 -7
  15. package/@types/ui2/document/views/acknowledgement-screen/acknowledgement-image.d.ts +0 -1
  16. package/@types/ui2/scanbot-sdk-ui.d.ts +1 -1
  17. package/@types/utils/image-utils.d.ts +1 -0
  18. package/@types/worker/worker-bridge.d.ts +26 -12
  19. package/bundle/ScanbotSDK.min.js +5 -5
  20. package/bundle/ScanbotSDK.ui2.min.js +17 -17
  21. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  22. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  23. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  24. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  25. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  26. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  27. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  28. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  29. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  30. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  31. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  32. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  33. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  34. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  35. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  36. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  37. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  38. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  39. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  40. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  41. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  42. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see ScanbotSDK.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=52)}([function(e,t,n){"use strict";n.r(t),n.d(t,"Component",(function(){return A})),n.d(t,"Fragment",(function(){return y})),n.d(t,"createContext",(function(){return Z})),n.d(t,"createElement",(function(){return v})),n.d(t,"createRef",(function(){return b})),n.d(t,"useCallback",(function(){return fe})),n.d(t,"useContext",(function(){return pe})),n.d(t,"useDebugValue",(function(){return ge})),n.d(t,"useEffect",(function(){return ce})),n.d(t,"useErrorBoundary",(function(){return ve})),n.d(t,"useId",(function(){return Ce})),n.d(t,"useImperativeHandle",(function(){return he})),n.d(t,"useLayoutEffect",(function(){return ue})),n.d(t,"useMemo",(function(){return me})),n.d(t,"useReducer",(function(){return le})),n.d(t,"useRef",(function(){return de})),n.d(t,"useState",(function(){return se})),n.d(t,"Children",(function(){return _e})),n.d(t,"PureComponent",(function(){return Te})),n.d(t,"StrictMode",(function(){return yt})),n.d(t,"Suspense",(function(){return Ne})),n.d(t,"SuspenseList",(function(){return je})),n.d(t,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ut})),n.d(t,"cloneElement",(function(){return pt})),n.d(t,"createFactory",(function(){return ht})),n.d(t,"createPortal",(function(){return Ge})),n.d(t,"default",(function(){return Tt})),n.d(t,"findDOMNode",(function(){return vt})),n.d(t,"flushSync",(function(){return bt})),n.d(t,"forwardRef",(function(){return Le})),n.d(t,"hydrate",(function(){return et})),n.d(t,"isElement",(function(){return xt})),n.d(t,"isFragment",(function(){return ft})),n.d(t,"isValidElement",(function(){return mt})),n.d(t,"lazy",(function(){return ze})),n.d(t,"memo",(function(){return ke})),n.d(t,"render",(function(){return $e})),n.d(t,"startTransition",(function(){return At})),n.d(t,"unmountComponentAtNode",(function(){return gt})),n.d(t,"unstable_batchedUpdates",(function(){return Ct})),n.d(t,"useDeferredValue",(function(){return St})),n.d(t,"useInsertionEffect",(function(){return Et})),n.d(t,"useSyncExternalStore",(function(){return Bt})),n.d(t,"useTransition",(function(){return wt})),n.d(t,"version",(function(){return dt}));var o,i,r,a,s,l,c,u,d={},h=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function p(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var i,r,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?r=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return C(e,s,i,r,null)}function C(e,t,n,o,a){var s={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(e){return e.children}function A(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function w(e,t,n){var o,r=e.__v,a=r.__e,s=e.__P;if(s)return(o=p({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),F(s,o,r,e.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,t,null==a?S(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&E(o),o}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function x(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!B.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(B)}function B(){var e,t,n,o=[],r=[];for(a.sort(c);e=a.shift();)e.__d&&(n=a.length,t=w(e,o,r)||t,0===n||a.length>n?(M(o,t,r),r.length=o.length=0,t=void 0,a.sort(c)):t&&i.__c&&i.__c(t,h));t&&M(o,t,r),B.__r=0}function I(e,t,n,o,i,r,a,s,l,c,u){var m,f,p,g,v,C=o&&o.__k||h,b=t.length;for(n.__d=l,T(n,t,C),l=n.__d,m=0;m<b;m++)null!=(p=n.__k[m])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?d:C[p.__i]||d,p.__i=m,F(e,p,f,i,r,a,s,l,c,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&N(f.ref,null,p),u.push(p.ref,p.__c||g,p)),null==v&&null!=g&&(v=g),65536&p.__u||f.__k===p.__k?l=k(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=v}function T(e,t,n){var o,i,r,a,s,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],o=0;o<l;o++)null!=(i=e.__k[o]=null==(i=t[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?C(null,i,null,null,i):f(i)?C(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?C(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=D(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),V(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),V(r,r))}function k(e,t,n){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=k(o[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function O(e,t){return t=t||[],null==e||"boolean"==typeof e||(f(e)?e.some((function(e){O(e,t)})):t.push(e)),t}function D(e,t,n,o){var i=e.key,r=e.type,a=n-1,s=n+1,l=t[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<t.length){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function L(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function P(e,t,n,o,i){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||L(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||L(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=Date.now(),e.addEventListener(t,r?R:_,r)):e.removeEventListener(t,r?R:_,r);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function _(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(i.event?i.event(e):e)}}function R(e){if(this.l)return this.l[e.type+!0](i.event?i.event(e):e)}function F(e,t,n,o,r,a,s,l,c,u){var d,h,m,g,v,C,b,S,w,E,x,B,T,k,O,D=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=i.__b)&&d(t);e:if("function"==typeof D)try{if(S=t.props,w=(d=D.contextType)&&o[d.__c],E=d?w?w.props.value:d.__:o,n.__c?b=(h=t.__c=n.__c).__=h.__E:("prototype"in D&&D.prototype.render?t.__c=h=new D(S,E):(t.__c=h=new A(S,E),h.constructor=D,h.render=z),w&&w.sub(h),h.props=S,h.state||(h.state={}),h.context=E,h.__n=o,m=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=p({},h.__s)),p(h.__s,D.getDerivedStateFromProps(S,h.__s))),g=h.props,v=h.state,h.__v=t,m)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&S!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,E),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,E),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,C)}))}if(h.context=E,h.props=S,h.__P=e,h.__e=!1,B=i.__r,T=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,B&&B(t),d=h.render(h.props,h.state,h.context),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[]}else do{h.__d=!1,B&&B(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++T<25);h.state=h.__s,null!=h.getChildContext&&(o=p(p({},o),h.getChildContext())),m||null==h.getSnapshotBeforeUpdate||(C=h.getSnapshotBeforeUpdate(g,v)),I(e,f(O=null!=d&&d.type===y&&null==d.key?d.props.children:d)?O:[O],t,n,o,r,a,s,l,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(e){t.__v=null,c||null!=a?(t.__e=l,t.__u|=c?160:32,a[a.indexOf(l)]=null):(t.__e=n.__e,t.__k=n.__k),i.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=W(n.__e,t,n,o,r,a,s,c,u);(d=i.diffed)&&d(t)}function M(e,t,n){for(var o=0;o<n.length;o++)N(n[o],n[++o],n[++o]);i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function W(e,t,n,i,r,a,s,l,c){var u,h,m,p,v,C,b,y=n.props,A=t.props,w=t.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){e=v,a[u]=null;break}if(null==e){if(null===w)return document.createTextNode(A);e=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,A.is&&A),a=null,l=!1}if(null===w)y===A||l&&e.data===A||(e.data=A);else{if(a=a&&o.call(e.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<e.attributes.length;u++)y[(v=e.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?m=v:"key"===u||u in A||P(e,u,null,v,r));for(u in A)v=A[u],"children"==u?p=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?C=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||P(e,u,v,y[u],r);if(h)l||m&&(h.__html===m.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(m&&(e.innerHTML=""),I(e,f(p)?p:[p],t,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==C&&(C!==e[u]||"progress"===w&&!C||"option"===w&&C!==y[u])&&P(e,u,C,y[u],!1),u="checked",void 0!==b&&b!==e[u]&&P(e,u,b,y[u],!1))}return e}function N(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,n)}}function V(e,t,n){var o,r;if(i.unmount&&i.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||N(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){i.__e(e,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&V(o[r],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__=e.__e=e.__d=void 0}function z(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,a,s,l;i.__&&i.__(e,t),a=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],F(t,e=(!r&&n||t).__k=v(y,null,[e]),a||d,d,void 0!==t.ownerSVGElement,!r&&n?[n]:a?null:t.firstChild?o.call(t.childNodes):null,s,!r&&n?n:a?a.__e:t.firstChild,r,l),e.__d=void 0,M(s,e,l)}function H(e,t){j(e,t,H)}function U(e,t,n){var i,r,a,s,l=p({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?r=t[a]:l[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),C(e.type,l,i||e.key,r||e.ref,null)}function Z(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,x(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}o=h.slice,i={__e:function(e,t,n,o){for(var i,r,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,o||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},r=0,A.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},n),this.props)),e&&p(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},A.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},B.__r=0,u=0;var G,Q,Y,X,K=0,q=[],J=[],$=i,ee=$.__b,te=$.__r,ne=$.diffed,oe=$.__c,ie=$.unmount,re=$.__;function ae(e,t){$.__h&&$.__h(Q,e,K||t),K=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:J}),n.__[e]}function se(e){return K=1,le(xe,e)}function le(e,t,n){var o=ae(G++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):xe(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=Q,!Q.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!r||r.call(this,e,t,n))};Q.u=!0;var r=Q.shouldComponentUpdate,a=Q.componentWillUpdate;Q.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}a&&a.call(this,e,t,n)},Q.shouldComponentUpdate=i}return o.__N||o.__}function ce(e,t){var n=ae(G++,3);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Q.__H.__h.push(n))}function ue(e,t){var n=ae(G++,4);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Q.__h.push(n))}function de(e){return K=5,me((function(){return{current:e}}),[])}function he(e,t,n){K=6,ue((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function me(e,t){var n=ae(G++,7);return Ee(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return K=8,me((function(){return e}),t)}function pe(e){var t=Q.context[e.__c],n=ae(G++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Q)),t.props.value):e.__}function ge(e,t){$.useDebugValue&&$.useDebugValue(t?t(e):e)}function ve(e){var t=ae(G++,10),n=se();return t.__=e,Q.componentDidCatch||(Q.componentDidCatch=function(e,o){t.__&&t.__(e,o),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Ce(){var e=ae(G++,11);if(!e.__){for(var t=Q.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function be(){for(var e;e=q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Se),e.__H.__h.forEach(we),e.__H.__h=[]}catch(t){e.__H.__h=[],$.__e(t,e.__v)}}$.__b=function(e){Q=null,ee&&ee(e)},$.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),re&&re(e,t)},$.__r=function(e){te&&te(e),G=0;var t=(Q=e.__c).__H;t&&(Y===Q?(t.__h=[],Q.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=J,e.__N=e.i=void 0}))):(t.__h.forEach(Se),t.__h.forEach(we),t.__h=[],G=0)),Y=Q},$.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==q.push(t)&&X===$.requestAnimationFrame||((X=$.requestAnimationFrame)||Ae)(be)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==J&&(e.__=e.__V),e.i=void 0,e.__V=J}))),Y=Q=null},$.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Se),e.__h=e.__h.filter((function(e){return!e.__||we(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],$.__e(n,e.__v)}})),oe&&oe(e,t)},$.unmount=function(e){ie&&ie(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Se(e)}catch(e){t=e}})),n.__H=void 0,t&&$.__e(t,n.__v))};var ye="function"==typeof requestAnimationFrame;function Ae(e){var t,n=function(){clearTimeout(o),ye&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ye&&(t=requestAnimationFrame(n))}function Se(e){var t=Q,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Q=t}function we(e){var t=Q;e.__c=e.__(),Q=t}function Ee(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function xe(e,t){return"function"==typeof t?t(e):t}function Be(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Te(e,t){this.props=e,this.context=t}function ke(e,t){function n(e){var n=this.props.ref,o=n==e.ref;return!o&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!o:Ie(this.props,e)}function o(t){return this.shouldComponentUpdate=n,v(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Te.prototype=new A).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var Oe=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Oe&&Oe(e)};var De="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Le(e){function t(t){var n=Be({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=De,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Pe=function(e,t){return null==e?null:O(O(e).map(t))},_e={map:Pe,forEach:Pe,count:function(e){return e?O(e).length:0},only:function(e){var t=O(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:O},Re=i.__e;i.__e=function(e,t,n,o){if(e.then)for(var i,r=t;r=r.__;)if((i=r.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);Re(e,t,n,o)};var Fe=i.unmount;function Me(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Be({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Me(e,t,n)}))),e}function We(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return We(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ne(){this.__u=0,this.t=null,this.__b=null}function Ve(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function je(){this.u=null,this.o=null}i.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fe&&Fe(e)},(Ne.prototype=new A).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=Ve(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=We(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.t.pop();)t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},Ne.prototype.componentWillUnmount=function(){this.t=[]},Ne.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Me(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&v(y,null,e.fallback);return i&&(i.__u&=-33),[v(y,null,t.__a?null:e.children),i]};var He=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Ue(e){return this.getChildContext=function(){return e.context},e.children}function Ze(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),j(v(Ue,{context:t.context},e.__v),t.l)}function Ge(e,t){var n=v(Ze,{__v:e,i:t});return n.containerInfo=t,n}(je.prototype=new A).__a=function(e){var t=this,n=Ve(t.__v),o=t.o.get(e);return o[0]++,function(i){var r=function(){t.props.revealOrder?(o.push(i),He(t,e,o)):i()};n?n(r):r()}},je.prototype.render=function(e){this.u=null,this.o=new Map;var t=O(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},je.prototype.componentDidUpdate=je.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){He(e,n,t)}))};var Qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ye=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Xe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ke=/[A-Z0-9]/g,qe="undefined"!=typeof document,Je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function $e(e,t,n){return null==t.__k&&(t.textContent=""),j(e,t),"function"==typeof n&&n(),e?e.__c:null}function et(e,t,n){return H(e,t),"function"==typeof n&&n(),e?e.__c:null}A.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(A.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var tt=i.event;function nt(){}function ot(){return this.cancelBubble}function it(){return this.defaultPrevented}i.event=function(e){return tt&&(e=tt(e)),e.persist=nt,e.isPropagationStopped=ot,e.isDefaultPrevented=it,e.nativeEvent=e};var rt,at={enumerable:!1,configurable:!0,get:function(){return this.class}},st=i.vnode;i.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var i in t){var r=t[i];if(!("value"===i&&"defaultValue"in t&&null==r||qe&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Je(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Xe.test(i)?i=a:-1===n.indexOf("-")&&Ye.test(i)?i=i.replace(Ke,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=O(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=O(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",at)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Qe,st&&st(e)};var lt=i.__r;i.__r=function(e){lt&&lt(e),rt=e.__c};var ct=i.diffed;i.diffed=function(e){ct&&ct(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),rt=null};var ut={ReactCurrentDispatcher:{current:{readContext:function(e){return rt.__n[e.__c].props.value}}}},dt="17.0.2";function ht(e){return v.bind(null,e)}function mt(e){return!!e&&e.$$typeof===Qe}function ft(e){return mt(e)&&e.type===y}function pt(e){return mt(e)?U.apply(null,arguments):e}function gt(e){return!!e.__k&&(j(null,e),!0)}function vt(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ct=function(e,t){return e(t)},bt=function(e,t){return e(t)},yt=y;function At(e){e()}function St(e){return e}function wt(){return[!1,At]}var Et=ue,xt=mt;function Bt(e,t){var n=t(),o=se({h:{__:n,v:t}}),i=o[0].h,r=o[1];return ue((function(){i.__=n,i.v=t,It(i)&&r({h:i})}),[e,n,t]),ce((function(){return It(i)&&r({h:i}),e((function(){It(i)&&r({h:i})}))}),[e]),n}function It(e){var t,n,o=e.v,i=e.__;try{var r=o();return!((t=i)===(n=r)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var Tt={useState:se,useId:Ce,useReducer:le,useEffect:ce,useLayoutEffect:ue,useInsertionEffect:ue,useTransition:wt,useDeferredValue:St,useSyncExternalStore:Bt,startTransition:At,useRef:de,useImperativeHandle:he,useMemo:me,useCallback:fe,useContext:pe,useDebugValue:ge,version:"17.0.2",Children:_e,render:$e,hydrate:et,unmountComponentAtNode:gt,createPortal:Ge,createElement:v,createContext:Z,createFactory:ht,cloneElement:pt,createRef:b,Fragment:y,isValidElement:mt,isElement:mt,isFragment:ft,findDOMNode:vt,Component:A,PureComponent:Te,memo:ke,forwardRef:Le,flushSync:bt,unstable_batchedUpdates:Ct,StrictMode:y,Suspense:Ne,SuspenseList:je,lazy:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ut}},function(e,t){e.exports=window["@mui"]},function(e,t,n){"use strict";n.r(t),n.d(t,"Palette",(function(){return i})),n.d(t,"StyledText",(function(){return r})),n.d(t,"IconStyle",(function(){return a})),n.d(t,"IconButton",(function(){return s})),n.d(t,"PolygonStyle",(function(){return l})),n.d(t,"BackgroundStyle",(function(){return c})),n.d(t,"ForegroundStyle",(function(){return u})),n.d(t,"BadgeStyle",(function(){return d})),n.d(t,"RoundButton",(function(){return h})),n.d(t,"BadgedButton",(function(){return m})),n.d(t,"ButtonConfiguration",(function(){return f})),n.d(t,"PopupMenuItem",(function(){return p})),n.d(t,"BarButtonConfiguration",(function(){return g})),n.d(t,"Sound",(function(){return v})),n.d(t,"Vibration",(function(){return C})),n.d(t,"Timeouts",(function(){return b}));var o=n(6);class i extends o.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",this.accessibilityDescription="",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription)}}class l extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class c extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class u extends o.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class d extends o.a{constructor(e={}){super(),this.visible=!0,this.background=new c({}),this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class h extends o.a{constructor(e={}){super(),this.visible=!0,this.accessibilityDescription="",this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class m extends o.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class f extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.accessibilityDescription="",this.background=new c({}),this.foreground=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.foreground&&(this.foreground=new u(e.foreground))}}class p extends o.a{constructor(e={}){super(),this.title=new r({}),this.accessibilityDescription="",this.icon=new a({}),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.icon&&(this.icon=new a(e.icon))}}class g extends o.a{constructor(e={}){super(),this.visible=!0,this.title=new r({}),this.accessibilityDescription="",this.background=new c({}),this.icon=new a({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.icon&&(this.icon=new a(e.icon))}}class v extends o.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class C extends o.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class b extends o.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"j",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"g",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"l",(function(){return f})),n.d(t,"k",(function(){return p}));var o=n(6);class i extends o.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class l extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class c extends o.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class u extends o.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class d extends o.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class h extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.background=new l({}),this.foreground=new c({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.background&&(this.background=new l(e.background)),void 0!==e.foreground&&(this.foreground=new c(e.foreground))}}class m extends o.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class f extends o.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class p extends o.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return l}));var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function a(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}Object.create;function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}Object.create},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return u}));var o=n(0),i=n(15),r=n(17);const a=Object(o.createContext)(null);function s(e){return{getColorValue:t=>c(t,e)}}class l{static setPalette(e){this.palette=e}static setLocalization(e){this.localization=e}static getColorValue(e){return c(e,this.palette)}static getPolygonColorValues(e,t){return new i.PolygonStyle({fillColor:t?l.getColorValue(e.fillColor):"transparent",strokeColor:t?l.getColorValue(e.strokeColor):"transparent",strokeWidth:e.strokeWidth,cornerRadius:e.cornerRadius})}static getLocalizedText(e,t=[]){return u(e,t,this.localization)}}function c(e,t){if(e){if(e.startsWith("?")){if(!t)throw new Error("Palette is not set");const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}function u(e,t=[],n){if(e.startsWith("?")){if(!n)throw new Error("Localization is not set");const t=e.slice(1);t in n?e=n[t]:r.a.debugWarn(`Text localization key ${t} was not found in the localization table`)}for(let n of t)e=e.replace("%d",n);return e}l.palette=null,l.localization=null},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{_marker(){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(33);class i{constructor(e,t){this.x=e,this.y=t}static toPolygon(e,t){return[i.scaleDownTo(e[0],t),i.scaleDownTo(e[1],t),i.scaleDownTo(e[2],t),i.scaleDownTo(e[3],t)]}static scaleToPoint(e,t,n,o){return new i(o*(e.x-t),o*(e.y-n))}static scaleListToHtmlElement(e,t,n){return e.map((e=>i.scaleToHtmlElement(e,t,n)))}static scaleToHtmlElement(e,t,n){return new i(e.x*(n.clientWidth/t.width),e.y*(n.clientHeight/t.height))}static scaleUpTo(e,t){return new i(e.x*t.width,e.y*t.height)}static scaleDownTo(e,t){return new i(e.x/t.width,e.y/t.height)}static fromHtmlElement(e){return new i(e.offsetLeft,e.offsetTop)}static withScale(e,t,n){return new i(e/n,t/n)}static fromCoordinates(e,t,n,o){if(!e||!t)return new i(0,0);const r=new i(e,t);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(e){const t=e.reduce(((e,t)=>e+t.x),0)/e.length,n=e.reduce(((e,t)=>e+t.y),0)/e.length;return new i(t,n)}static smallerSizeOfQuad(e){const t=Math.max(...e.map((e=>e.x)))-Math.min(...e.map((e=>e.x))),n=Math.max(...e.map((e=>e.y)))-Math.min(...e.map((e=>e.y)));return Math.min(t,n)}static empty(){return new i(0,0)}static centerX(e){if(e)return(i.highestX(e)+i.lowestX(e))/2}static highestX(e){if(e)return Math.max(...e.map((e=>e.x)))}static lowestX(e){if(e)return Math.min(...e.map((e=>e.x)))}static lowestY(e){if(e)return Math.min(...e.map((e=>e.y)))}static highestY(e){if(e)return Math.max(...e.map((e=>e.y)))}static width(e){if(e)return i.highestX(e)-i.lowestX(e)}static left(e){if(e)return e.reduce(((e,t)=>e.x<t.x?e:t))}static right(e){if(e)return e.reduce(((e,t)=>e.x>t.x?e:t))}static toSvgString(e){if(void 0!==e)return e.map((e=>`${e.x.toFixed(2)},${e.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(e,t=0){if(void 0===e)return;function n(e,t,n){const o=Math.atan2(e.y-t.y,e.x-t.x);return{x:e.x-n*Math.cos(o),y:e.y-n*Math.sin(o)}}let o="";const r=n(e[0],e[1],i.distance(e[0],e[1])/2);o+=`M ${r.x} ${r.y}`;for(let r=0;r<e.length;r++){const a=e[r],s=e[(r+1)%e.length],l=e[(r+2)%e.length],c=n(s,l,i.distance(s,l)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-l.y,s.x-l.x)),d=u>Math.PI?2*Math.PI-u:u,h=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))),m=Math.min(t,h*Math.tan(d/2)/2),f=Math.abs(m/Math.tan(d/2)),p=(s.x-a.x)*(s.y-l.y)-(s.x-l.x)*(s.y-a.y)<0?1:0,g=n(s,a,f),v=n(s,l,f);o+=` L${g.x} ${g.y}`,o+=` A${m} ${m} 0 0 ${p} ${v.x} ${v.y}`,o+=` L${c.x} ${c.y}`}return o+" Z"}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return new i(e.x-t.x,e.y-t.y)}static add(e,t){return new i(e.x+t.x,e.y+t.y)}static multiply(e,t){return new i(e.x*t,e.y*t)}static cross(e,t){return e.x*t.y-e.y*t.x}static clamp(e,t){return new i(Object(o.a)(e.x,0,t.width),Object(o.a)(e.y,0,t.height))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var o=n(0),i=n(5);function r(e){return{color:i.b.getColorValue(e.color),textShadow:e.useShadow?"1px 1px 2px":""}}function a(e){return e.config.visible?o.default.createElement("span",{ref:e.innerRef,style:Object.assign(Object.assign({},e.style),r(e.config))},i.b.getLocalizedText(e.config.text,e.replacementArgs)):null}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"a",(function(){return d}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.visible=!0,this.deselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.deselected&&(this.deselected=new o.g(e.deselected)),void 0!==e.selected&&(this.selected=new o.g(e.selected))}}class a extends i.a{constructor(e={}){super(),this.imageVisible=!0,this.titleSelected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==e.imageVisible&&(this.imageVisible=e.imageVisible),void 0!==e.titleSelected&&(this.titleSelected=new o.j(e.titleSelected)),void 0!==e.subtitleSelected&&(this.subtitleSelected=new o.j(e.subtitleSelected)),void 0!==e.titleDeselected&&(this.titleDeselected=new o.j(e.titleDeselected)),void 0!==e.subtitleDeselected&&(this.subtitleDeselected=new o.j(e.subtitleDeselected)),void 0!==e.backgroundSelected&&(this.backgroundSelected=new o.g(e.backgroundSelected)),void 0!==e.backgroundDeselected&&(this.backgroundDeselected=new o.g(e.backgroundDeselected))}}class s extends i.a{constructor(e={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0===e.background)throw new Error("background must be present in constructor argument");this.background=new o.a(e.background),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class l extends i.a{constructor(e={}){super(),this.visible=!1,this.counterBadge=new s({background:new o.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new o.g({}),selected:new o.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.counterBadge&&(this.counterBadge=new s(e.counterBadge)),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=e.barcodeItemInfoPosition),void 0!==e.polygon&&(this.polygon=new r(e.polygon)),void 0!==e.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(e.barcodeItemConfiguration))}}class c extends i.a{constructor(e={}){super(),this.visible=!0,this.partiallyScanned=new o.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.partiallyScanned&&(this.partiallyScanned=new o.g(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new o.g(e.rejected)),void 0!==e.completed&&(this.completed=new o.g(e.completed))}}class u extends i.a{constructor(e={}){super(),this.partiallyScanned=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==e.partiallyScanned&&(this.partiallyScanned=new s(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new s(e.rejected)),void 0!==e.completed&&(this.completed=new s(e.completed))}}class d extends i.a{constructor(e={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new c({}),this.badge=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.polygon&&(this.polygon=new c(e.polygon)),void 0!==e.badge&&(this.badge=new u(e.badge))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(8);class i{constructor(e,t){this.width=e,this.height=t}isPortrait(){return this.height>this.width}ratio(e){return e?this.height/this.width:this.width/this.height}ratioDiff(e,t){return this.ratio(t)/e.ratio(t)}static isEmpty(e){return!e||(0===e.width||0===e.height)}static toPolygon(e){return[new o.a(0,0),new o.a(e.width,0),new o.a(e.width,e.height),new o.a(0,e.height)]}static fromHtmlElement(e){return e?new i(e.clientWidth,e.clientHeight):new i(0,0)}static fromJson(e){return new i(e.width,e.height)}static subtractFrom(e,t){return new i(e.width-t,e.height-t)}static empty(){return new i(0,0)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d}));var o=n(0),i=n(44);const r=n(26).a.svg`
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=52)}([function(e,t,n){"use strict";n.r(t),n.d(t,"Component",(function(){return A})),n.d(t,"Fragment",(function(){return b})),n.d(t,"createContext",(function(){return Z})),n.d(t,"createElement",(function(){return v})),n.d(t,"createRef",(function(){return y})),n.d(t,"useCallback",(function(){return fe})),n.d(t,"useContext",(function(){return pe})),n.d(t,"useDebugValue",(function(){return ge})),n.d(t,"useEffect",(function(){return le})),n.d(t,"useErrorBoundary",(function(){return ve})),n.d(t,"useId",(function(){return Ce})),n.d(t,"useImperativeHandle",(function(){return me})),n.d(t,"useLayoutEffect",(function(){return ue})),n.d(t,"useMemo",(function(){return he})),n.d(t,"useReducer",(function(){return ce})),n.d(t,"useRef",(function(){return de})),n.d(t,"useState",(function(){return se})),n.d(t,"Children",(function(){return _e})),n.d(t,"PureComponent",(function(){return Te})),n.d(t,"StrictMode",(function(){return bt})),n.d(t,"Suspense",(function(){return Ve})),n.d(t,"SuspenseList",(function(){return je})),n.d(t,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ut})),n.d(t,"cloneElement",(function(){return pt})),n.d(t,"createFactory",(function(){return mt})),n.d(t,"createPortal",(function(){return Ge})),n.d(t,"default",(function(){return Tt})),n.d(t,"findDOMNode",(function(){return vt})),n.d(t,"flushSync",(function(){return yt})),n.d(t,"forwardRef",(function(){return Le})),n.d(t,"hydrate",(function(){return et})),n.d(t,"isElement",(function(){return xt})),n.d(t,"isFragment",(function(){return ft})),n.d(t,"isValidElement",(function(){return ht})),n.d(t,"lazy",(function(){return ze})),n.d(t,"memo",(function(){return Ie})),n.d(t,"render",(function(){return $e})),n.d(t,"startTransition",(function(){return At})),n.d(t,"unmountComponentAtNode",(function(){return gt})),n.d(t,"unstable_batchedUpdates",(function(){return Ct})),n.d(t,"useDeferredValue",(function(){return St})),n.d(t,"useInsertionEffect",(function(){return Et})),n.d(t,"useSyncExternalStore",(function(){return Dt})),n.d(t,"useTransition",(function(){return wt})),n.d(t,"version",(function(){return dt}));var i,o,r,a,s,c,l,u,d={},m=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function p(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var o,r,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?r=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return C(e,s,o,r,null)}function C(e,t,n,i,a){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function y(){return{current:null}}function b(e){return e.children}function A(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function w(e,t,n){var i,r=e.__v,a=r.__e,s=e.__P;if(s)return(i=p({},r)).__v=r.__v+1,o.vnode&&o.vnode(i),F(s,i,r,e.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,t,null==a?S(r):a,!!(32&r.__u),n),i.__v=r.__v,i.__.__k[i.__i]=i,i.__d=void 0,i.__e!=a&&E(i),i}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function x(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!D.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||c)(D)}function D(){var e,t,n,i=[],r=[];for(a.sort(l);e=a.shift();)e.__d&&(n=a.length,t=w(e,i,r)||t,0===n||a.length>n?(M(i,t,r),r.length=i.length=0,t=void 0,a.sort(l)):t&&o.__c&&o.__c(t,m));t&&M(i,t,r),D.__r=0}function B(e,t,n,i,o,r,a,s,c,l,u){var h,f,p,g,v,C=i&&i.__k||m,y=t.length;for(n.__d=c,T(n,t,C),c=n.__d,h=0;h<y;h++)null!=(p=n.__k[h])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?d:C[p.__i]||d,p.__i=h,F(e,p,f,o,r,a,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&V(f.ref,null,p),u.push(p.ref,p.__c||g,p)),null==v&&null!=g&&(v=g),65536&p.__u||f.__k===p.__k?c=I(p,c,e):"function"==typeof p.type&&void 0!==p.__d?c=p.__d:g&&(c=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=v}function T(e,t,n){var i,o,r,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],i=0;i<c;i++)null!=(o=e.__k[i]=null==(o=t[i])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?C(null,o,null,null,o):f(o)?C(b,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?C(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=O(o,n,a=i+d,u),o.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>c-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==i+d&&(o.__u|=65536))):(r=n[i])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),W(r,r,!1),n[i]=null,u--);if(u)for(i=0;i<l;i++)null!=(r=n[i])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),W(r,r))}function I(e,t,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=I(i[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function k(e,t){return t=t||[],null==e||"boolean"==typeof e||(f(e)?e.some((function(e){k(e,t)})):t.push(e)),t}function O(e,t,n,i){var o=e.key,r=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&r===c.type)return n;if(i>(null!=c&&0==(131072&c.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&0==(131072&c.__u)&&o==c.key&&r===c.type)return a;a--}if(s<t.length){if((c=t[s])&&0==(131072&c.__u)&&o==c.key&&r===c.type)return s;s++}}return-1}function L(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function P(e,t,n,i,o){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||L(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||L(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,r?R:_,r)):e.removeEventListener(t,r?R:_,r);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function _(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(o.event?o.event(e):e)}}function R(e){if(this.l)return this.l[e.type+!0](o.event?o.event(e):e)}function F(e,t,n,i,r,a,s,c,l,u){var d,m,h,g,v,C,y,S,w,E,x,D,T,I,k,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof O)try{if(S=t.props,w=(d=O.contextType)&&i[d.__c],E=d?w?w.props.value:d.__:i,n.__c?y=(m=t.__c=n.__c).__=m.__E:("prototype"in O&&O.prototype.render?t.__c=m=new O(S,E):(t.__c=m=new A(S,E),m.constructor=O,m.render=z),w&&w.sub(m),m.props=S,m.state||(m.state={}),m.context=E,m.__n=i,h=m.__d=!0,m.__h=[],m._sb=[]),null==m.__s&&(m.__s=m.state),null!=O.getDerivedStateFromProps&&(m.__s==m.state&&(m.__s=p({},m.__s)),p(m.__s,O.getDerivedStateFromProps(S,m.__s))),g=m.props,v=m.state,m.__v=t,h)null==O.getDerivedStateFromProps&&null!=m.componentWillMount&&m.componentWillMount(),null!=m.componentDidMount&&m.__h.push(m.componentDidMount);else{if(null==O.getDerivedStateFromProps&&S!==g&&null!=m.componentWillReceiveProps&&m.componentWillReceiveProps(S,E),!m.__e&&(null!=m.shouldComponentUpdate&&!1===m.shouldComponentUpdate(S,m.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(m.props=S,m.state=m.__s,m.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<m._sb.length;x++)m.__h.push(m._sb[x]);m._sb=[],m.__h.length&&s.push(m);break e}null!=m.componentWillUpdate&&m.componentWillUpdate(S,m.__s,E),null!=m.componentDidUpdate&&m.__h.push((function(){m.componentDidUpdate(g,v,C)}))}if(m.context=E,m.props=S,m.__P=e,m.__e=!1,D=o.__r,T=0,"prototype"in O&&O.prototype.render){for(m.state=m.__s,m.__d=!1,D&&D(t),d=m.render(m.props,m.state,m.context),I=0;I<m._sb.length;I++)m.__h.push(m._sb[I]);m._sb=[]}else do{m.__d=!1,D&&D(t),d=m.render(m.props,m.state,m.context),m.state=m.__s}while(m.__d&&++T<25);m.state=m.__s,null!=m.getChildContext&&(i=p(p({},i),m.getChildContext())),h||null==m.getSnapshotBeforeUpdate||(C=m.getSnapshotBeforeUpdate(g,v)),B(e,f(k=null!=d&&d.type===b&&null==d.key?d.props.children:d)?k:[k],t,n,i,r,a,s,c,l,u),m.base=t.__e,t.__u&=-161,m.__h.length&&s.push(m),y&&(m.__E=m.__=null)}catch(e){t.__v=null,l||null!=a?(t.__e=c,t.__u|=l?160:32,a[a.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=N(n.__e,t,n,i,r,a,s,l,u);(d=o.diffed)&&d(t)}function M(e,t,n){for(var i=0;i<n.length;i++)V(n[i],n[++i],n[++i]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function N(e,t,n,o,r,a,s,c,l){var u,m,h,p,v,C,y,b=n.props,A=t.props,w=t.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){e=v,a[u]=null;break}if(null==e){if(null===w)return document.createTextNode(A);e=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,A.is&&A),a=null,c=!1}if(null===w)b===A||c&&e.data===A||(e.data=A);else{if(a=a&&i.call(e.childNodes),b=n.props||d,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(v=e.attributes[u]).name]=v.value;for(u in b)v=b[u],"children"==u||("dangerouslySetInnerHTML"==u?h=v:"key"===u||u in A||P(e,u,null,v,r));for(u in A)v=A[u],"children"==u?p=v:"dangerouslySetInnerHTML"==u?m=v:"value"==u?C=v:"checked"==u?y=v:"key"===u||c&&"function"!=typeof v||b[u]===v||P(e,u,v,b[u],r);if(m)c||h&&(m.__html===h.__html||m.__html===e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(h&&(e.innerHTML=""),B(e,f(p)?p:[p],t,n,o,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);c||(u="value",void 0!==C&&(C!==e[u]||"progress"===w&&!C||"option"===w&&C!==b[u])&&P(e,u,C,b[u],!1),u="checked",void 0!==y&&y!==e[u]&&P(e,u,y,b[u],!1))}return e}function V(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function W(e,t,n){var i,r;if(o.unmount&&o.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||V(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){o.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&W(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__=e.__e=e.__d=void 0}function z(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,a,s,c;o.__&&o.__(e,t),a=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],F(t,e=(!r&&n||t).__k=v(b,null,[e]),a||d,d,void 0!==t.ownerSVGElement,!r&&n?[n]:a?null:t.firstChild?i.call(t.childNodes):null,s,!r&&n?n:a?a.__e:t.firstChild,r,c),e.__d=void 0,M(s,e,c)}function H(e,t){j(e,t,H)}function U(e,t,n){var o,r,a,s,c=p({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?r=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?i.call(arguments,2):n),C(e.type,c,o||e.key,r||e.ref,null)}function Z(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,x(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}i=m.slice,o={__e:function(e,t,n,i){for(var o,r,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,i||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},r=0,A.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},n),this.props)),e&&p(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},A.prototype.render=b,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},D.__r=0,u=0;var G,Y,Q,q,X=0,K=[],J=[],$=o,ee=$.__b,te=$.__r,ne=$.diffed,ie=$.__c,oe=$.unmount,re=$.__;function ae(e,t){$.__h&&$.__h(Y,e,X||t),X=0;var n=Y.__H||(Y.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:J}),n.__[e]}function se(e){return X=1,ce(xe,e)}function ce(e,t,n){var i=ae(G++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):xe(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Y,!Y.u)){var o=function(e,t,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var a=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!r||r.call(this,e,t,n))};Y.u=!0;var r=Y.shouldComponentUpdate,a=Y.componentWillUpdate;Y.componentWillUpdate=function(e,t,n){if(this.__e){var i=r;r=void 0,o(e,t,n),r=i}a&&a.call(this,e,t,n)},Y.shouldComponentUpdate=o}return i.__N||i.__}function le(e,t){var n=ae(G++,3);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Y.__H.__h.push(n))}function ue(e,t){var n=ae(G++,4);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Y.__h.push(n))}function de(e){return X=5,he((function(){return{current:e}}),[])}function me(e,t,n){X=6,ue((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function he(e,t){var n=ae(G++,7);return Ee(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return X=8,he((function(){return e}),t)}function pe(e){var t=Y.context[e.__c],n=ae(G++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Y)),t.props.value):e.__}function ge(e,t){$.useDebugValue&&$.useDebugValue(t?t(e):e)}function ve(e){var t=ae(G++,10),n=se();return t.__=e,Y.componentDidCatch||(Y.componentDidCatch=function(e,i){t.__&&t.__(e,i),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Ce(){var e=ae(G++,11);if(!e.__){for(var t=Y.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ye(){for(var e;e=K.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Se),e.__H.__h.forEach(we),e.__H.__h=[]}catch(t){e.__H.__h=[],$.__e(t,e.__v)}}$.__b=function(e){Y=null,ee&&ee(e)},$.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),re&&re(e,t)},$.__r=function(e){te&&te(e),G=0;var t=(Y=e.__c).__H;t&&(Q===Y?(t.__h=[],Y.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=J,e.__N=e.i=void 0}))):(t.__h.forEach(Se),t.__h.forEach(we),t.__h=[],G=0)),Q=Y},$.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==K.push(t)&&q===$.requestAnimationFrame||((q=$.requestAnimationFrame)||Ae)(ye)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==J&&(e.__=e.__V),e.i=void 0,e.__V=J}))),Q=Y=null},$.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Se),e.__h=e.__h.filter((function(e){return!e.__||we(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],$.__e(n,e.__v)}})),ie&&ie(e,t)},$.unmount=function(e){oe&&oe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Se(e)}catch(e){t=e}})),n.__H=void 0,t&&$.__e(t,n.__v))};var be="function"==typeof requestAnimationFrame;function Ae(e){var t,n=function(){clearTimeout(i),be&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);be&&(t=requestAnimationFrame(n))}function Se(e){var t=Y,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Y=t}function we(e){var t=Y;e.__c=e.__(),Y=t}function Ee(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function xe(e,t){return"function"==typeof t?t(e):t}function De(e,t){for(var n in t)e[n]=t[n];return e}function Be(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function Te(e,t){this.props=e,this.context=t}function Ie(e,t){function n(e){var n=this.props.ref,i=n==e.ref;return!i&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!i:Be(this.props,e)}function i(t){return this.shouldComponentUpdate=n,v(e,t)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(Te.prototype=new A).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(e,t){return Be(this.props,e)||Be(this.state,t)};var ke=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ke&&ke(e)};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Le(e){function t(t){var n=De({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Oe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Pe=function(e,t){return null==e?null:k(k(e).map(t))},_e={map:Pe,forEach:Pe,count:function(e){return e?k(e).length:0},only:function(e){var t=k(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:k},Re=o.__e;o.__e=function(e,t,n,i){if(e.then)for(var o,r=t;r=r.__;)if((o=r.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Re(e,t,n,i)};var Fe=o.unmount;function Me(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=De({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Me(e,t,n)}))),e}function Ne(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Ne(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ve(){this.__u=0,this.t=null,this.__b=null}function We(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(e){var t,n,i;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){i=e})),i)throw i;if(!n)throw t;return v(n,o)}return o.displayName="Lazy",o.__f=!0,o}function je(){this.u=null,this.o=null}o.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fe&&Fe(e)},(Ve.prototype=new A).__c=function(e,t){var n=t.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=We(i.__v),r=!1,a=function(){r||(r=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=Ne(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.t.pop();)t.forceUpdate()}};i.__u++||32&t.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(a,a)},Ve.prototype.componentWillUnmount=function(){this.t=[]},Ve.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Me(this.__b,n,i.__O=i.__P)}this.__b=null}var o=t.__a&&v(b,null,e.fallback);return o&&(o.__u&=-33),[v(b,null,t.__a?null:e.children),o]};var He=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Ue(e){return this.getChildContext=function(){return e.context},e.children}function Ze(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),j(v(Ue,{context:t.context},e.__v),t.l)}function Ge(e,t){var n=v(Ze,{__v:e,i:t});return n.containerInfo=t,n}(je.prototype=new A).__a=function(e){var t=this,n=We(t.__v),i=t.o.get(e);return i[0]++,function(o){var r=function(){t.props.revealOrder?(i.push(o),He(t,e,i)):o()};n?n(r):r()}},je.prototype.render=function(e){this.u=null,this.o=new Map;var t=k(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},je.prototype.componentDidUpdate=je.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){He(e,n,t)}))};var Ye="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Qe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xe=/[A-Z0-9]/g,Ke="undefined"!=typeof document,Je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function $e(e,t,n){return null==t.__k&&(t.textContent=""),j(e,t),"function"==typeof n&&n(),e?e.__c:null}function et(e,t,n){return H(e,t),"function"==typeof n&&n(),e?e.__c:null}A.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(A.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var tt=o.event;function nt(){}function it(){return this.cancelBubble}function ot(){return this.defaultPrevented}o.event=function(e){return tt&&(e=tt(e)),e.persist=nt,e.isPropagationStopped=it,e.isDefaultPrevented=ot,e.nativeEvent=e};var rt,at={enumerable:!1,configurable:!0,get:function(){return this.class}},st=o.vnode;o.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var o in t){var r=t[o];if(!("value"===o&&"defaultValue"in t&&null==r||Ke&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Je(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":qe.test(o)?o=a:-1===n.indexOf("-")&&Qe.test(o)?o=o.replace(Xe,"-$&").toLowerCase():null===r&&(r=void 0):a=o="oninput","oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=r}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=k(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=k(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",at)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=Ye,st&&st(e)};var ct=o.__r;o.__r=function(e){ct&&ct(e),rt=e.__c};var lt=o.diffed;o.diffed=function(e){lt&&lt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),rt=null};var ut={ReactCurrentDispatcher:{current:{readContext:function(e){return rt.__n[e.__c].props.value}}}},dt="17.0.2";function mt(e){return v.bind(null,e)}function ht(e){return!!e&&e.$$typeof===Ye}function ft(e){return ht(e)&&e.type===b}function pt(e){return ht(e)?U.apply(null,arguments):e}function gt(e){return!!e.__k&&(j(null,e),!0)}function vt(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ct=function(e,t){return e(t)},yt=function(e,t){return e(t)},bt=b;function At(e){e()}function St(e){return e}function wt(){return[!1,At]}var Et=ue,xt=ht;function Dt(e,t){var n=t(),i=se({h:{__:n,v:t}}),o=i[0].h,r=i[1];return ue((function(){o.__=n,o.v=t,Bt(o)&&r({h:o})}),[e,n,t]),le((function(){return Bt(o)&&r({h:o}),e((function(){Bt(o)&&r({h:o})}))}),[e]),n}function Bt(e){var t,n,i=e.v,o=e.__;try{var r=i();return!((t=o)===(n=r)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var Tt={useState:se,useId:Ce,useReducer:ce,useEffect:le,useLayoutEffect:ue,useInsertionEffect:ue,useTransition:wt,useDeferredValue:St,useSyncExternalStore:Dt,startTransition:At,useRef:de,useImperativeHandle:me,useMemo:he,useCallback:fe,useContext:pe,useDebugValue:ge,version:"17.0.2",Children:_e,render:$e,hydrate:et,unmountComponentAtNode:gt,createPortal:Ge,createElement:v,createContext:Z,createFactory:mt,cloneElement:pt,createRef:y,Fragment:b,isValidElement:ht,isElement:ht,isFragment:ft,findDOMNode:vt,Component:A,PureComponent:Te,memo:Ie,forwardRef:Le,flushSync:yt,unstable_batchedUpdates:Ct,StrictMode:b,Suspense:Ve,SuspenseList:je,lazy:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ut}},function(e,t){e.exports=window["@mui"]},function(e,t,n){"use strict";n.r(t),n.d(t,"Palette",(function(){return o})),n.d(t,"StyledText",(function(){return r})),n.d(t,"IconStyle",(function(){return a})),n.d(t,"IconButton",(function(){return s})),n.d(t,"PolygonStyle",(function(){return c})),n.d(t,"BackgroundStyle",(function(){return l})),n.d(t,"ForegroundStyle",(function(){return u})),n.d(t,"BadgeStyle",(function(){return d})),n.d(t,"RoundButton",(function(){return m})),n.d(t,"BadgedButton",(function(){return h})),n.d(t,"ButtonConfiguration",(function(){return f})),n.d(t,"PopupMenuItem",(function(){return p})),n.d(t,"BarButtonConfiguration",(function(){return g})),n.d(t,"Sound",(function(){return v})),n.d(t,"Vibration",(function(){return C})),n.d(t,"Timeouts",(function(){return y}));var i=n(6);class o extends i.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends i.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends i.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends i.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",this.accessibilityDescription="",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription)}}class c extends i.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class l extends i.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class u extends i.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class d extends i.a{constructor(e={}){super(),this.visible=!0,this.background=new l({}),this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.background&&(this.background=new l(e.background)),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class m extends i.a{constructor(e={}){super(),this.visible=!0,this.accessibilityDescription="",this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class h extends i.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class f extends i.a{constructor(e={}){super(),this.visible=!0,this.text="",this.accessibilityDescription="",this.background=new l({}),this.foreground=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new l(e.background)),void 0!==e.foreground&&(this.foreground=new u(e.foreground))}}class p extends i.a{constructor(e={}){super(),this.title=new r({}),this.accessibilityDescription="",this.icon=new a({}),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.icon&&(this.icon=new a(e.icon))}}class g extends i.a{constructor(e={}){super(),this.visible=!0,this.title=new r({}),this.accessibilityDescription="",this.background=new l({}),this.icon=new a({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new l(e.background)),void 0!==e.icon&&(this.icon=new a(e.icon))}}class v extends i.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class C extends i.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class y extends i.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"f",(function(){return o})),n.d(t,"j",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"g",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"h",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"i",(function(){return h})),n.d(t,"l",(function(){return f})),n.d(t,"k",(function(){return p}));var i=n(6);class o extends i.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends i.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends i.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends i.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class c extends i.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class l extends i.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class u extends i.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class d extends i.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class m extends i.a{constructor(e={}){super(),this.visible=!0,this.text="",this.background=new c({}),this.foreground=new l({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.foreground&&(this.foreground=new l(e.foreground))}}class h extends i.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class f extends i.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class p extends i.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return c}));var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function a(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}Object.create;function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return u}));var i=n(0),o=n(15),r=n(17);const a=Object(i.createContext)(null);function s(e){return{getColorValue:t=>l(t,e)}}class c{static setPalette(e){this.palette=e}static setLocalization(e){this.localization=e}static getColorValue(e){return l(e,this.palette)}static getPolygonColorValues(e,t){return new o.PolygonStyle({fillColor:t?c.getColorValue(e.fillColor):"transparent",strokeColor:t?c.getColorValue(e.strokeColor):"transparent",strokeWidth:e.strokeWidth,cornerRadius:e.cornerRadius})}static getLocalizedText(e,t=[]){return u(e,t,this.localization)}}function l(e,t){if(e){if(e.startsWith("?")){if(!t)throw new Error("Palette is not set");const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}function u(e,t=[],n){if(e.startsWith("?")){if(!n)throw new Error("Localization is not set");const t=e.slice(1);t in n?e=n[t]:r.a.debugWarn(`Text localization key ${t} was not found in the localization table`)}for(let n of t)e=e.replace("%d",n);return e}c.palette=null,c.localization=null},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{_marker(){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(33);class o{constructor(e,t){this.x=e,this.y=t}static toPolygon(e,t){return[o.scaleDownTo(e[0],t),o.scaleDownTo(e[1],t),o.scaleDownTo(e[2],t),o.scaleDownTo(e[3],t)]}static scaleToPoint(e,t,n,i){return new o(i*(e.x-t),i*(e.y-n))}static scaleListToHtmlElement(e,t,n){return e.map((e=>o.scaleToHtmlElement(e,t,n)))}static scaleToHtmlElement(e,t,n){return new o(e.x*(n.clientWidth/t.width),e.y*(n.clientHeight/t.height))}static scaleUpTo(e,t){return new o(e.x*t.width,e.y*t.height)}static scaleDownTo(e,t){return new o(e.x/t.width,e.y/t.height)}static fromHtmlElement(e){return new o(e.offsetLeft,e.offsetTop)}static withScale(e,t,n){return new o(e/n,t/n)}static fromCoordinates(e,t,n,i){if(!e||!t)return new o(0,0);const r=new o(e,t);return i=null!=i?i:1,1===(n=n?n%4:0)?o.withScale(r.y,-r.x,i):2===n?o.withScale(-r.x,-r.y,i):3===n?o.withScale(-r.y,r.x,i):o.withScale(r.x,r.y,i)}static centerOf(e){const t=e.reduce(((e,t)=>e+t.x),0)/e.length,n=e.reduce(((e,t)=>e+t.y),0)/e.length;return new o(t,n)}static smallerSizeOfQuad(e){const t=Math.max(...e.map((e=>e.x)))-Math.min(...e.map((e=>e.x))),n=Math.max(...e.map((e=>e.y)))-Math.min(...e.map((e=>e.y)));return Math.min(t,n)}static empty(){return new o(0,0)}static centerX(e){if(e)return(o.highestX(e)+o.lowestX(e))/2}static highestX(e){if(e)return Math.max(...e.map((e=>e.x)))}static lowestX(e){if(e)return Math.min(...e.map((e=>e.x)))}static lowestY(e){if(e)return Math.min(...e.map((e=>e.y)))}static highestY(e){if(e)return Math.max(...e.map((e=>e.y)))}static width(e){if(e)return o.highestX(e)-o.lowestX(e)}static left(e){if(e)return e.reduce(((e,t)=>e.x<t.x?e:t))}static right(e){if(e)return e.reduce(((e,t)=>e.x>t.x?e:t))}static toSvgString(e){if(void 0!==e)return e.map((e=>`${e.x.toFixed(2)},${e.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(e,t=0){if(void 0===e)return;function n(e,t,n){const i=Math.atan2(e.y-t.y,e.x-t.x);return{x:e.x-n*Math.cos(i),y:e.y-n*Math.sin(i)}}let i="";const r=n(e[0],e[1],o.distance(e[0],e[1])/2);i+=`M ${r.x} ${r.y}`;for(let r=0;r<e.length;r++){const a=e[r],s=e[(r+1)%e.length],c=e[(r+2)%e.length],l=n(s,c,o.distance(s,c)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-c.y,s.x-c.x)),d=u>Math.PI?2*Math.PI-u:u,m=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-c.x,2)+Math.pow(s.y-c.y,2))),h=Math.min(t,m*Math.tan(d/2)/2),f=Math.abs(h/Math.tan(d/2)),p=(s.x-a.x)*(s.y-c.y)-(s.x-c.x)*(s.y-a.y)<0?1:0,g=n(s,a,f),v=n(s,c,f);i+=` L${g.x} ${g.y}`,i+=` A${h} ${h} 0 0 ${p} ${v.x} ${v.y}`,i+=` L${l.x} ${l.y}`}return i+" Z"}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return new o(e.x-t.x,e.y-t.y)}static add(e,t){return new o(e.x+t.x,e.y+t.y)}static multiply(e,t){return new o(e.x*t,e.y*t)}static cross(e,t){return e.x*t.y-e.y*t.x}static clamp(e,t){return new o(Object(i.a)(e.x,0,t.width),Object(i.a)(e.y,0,t.height))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(0),o=n(5);function r(e){return{color:o.b.getColorValue(e.color),textShadow:e.useShadow?"1px 1px 2px":""}}function a(e){return e.config.visible?i.default.createElement("span",{ref:e.innerRef,style:Object.assign(Object.assign({},e.style),r(e.config))},o.b.getLocalizedText(e.config.text,e.replacementArgs)):null}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return u})),n.d(t,"a",(function(){return d}));var i=n(3),o=n(6);class r extends o.a{constructor(e={}){super(),this.visible=!0,this.deselected=new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.deselected&&(this.deselected=new i.g(e.deselected)),void 0!==e.selected&&(this.selected=new i.g(e.selected))}}class a extends o.a{constructor(e={}){super(),this.imageVisible=!0,this.titleSelected=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==e.imageVisible&&(this.imageVisible=e.imageVisible),void 0!==e.titleSelected&&(this.titleSelected=new i.j(e.titleSelected)),void 0!==e.subtitleSelected&&(this.subtitleSelected=new i.j(e.subtitleSelected)),void 0!==e.titleDeselected&&(this.titleDeselected=new i.j(e.titleDeselected)),void 0!==e.subtitleDeselected&&(this.subtitleDeselected=new i.j(e.subtitleDeselected)),void 0!==e.backgroundSelected&&(this.backgroundSelected=new i.g(e.backgroundSelected)),void 0!==e.backgroundDeselected&&(this.backgroundDeselected=new i.g(e.backgroundDeselected))}}class s extends o.a{constructor(e={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0===e.background)throw new Error("background must be present in constructor argument");this.background=new i.a(e.background),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class c extends o.a{constructor(e={}){super(),this.visible=!1,this.counterBadge=new s({background:new i.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new i.g({}),selected:new i.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.counterBadge&&(this.counterBadge=new s(e.counterBadge)),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=e.barcodeItemInfoPosition),void 0!==e.polygon&&(this.polygon=new r(e.polygon)),void 0!==e.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(e.barcodeItemConfiguration))}}class l extends o.a{constructor(e={}){super(),this.visible=!0,this.partiallyScanned=new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.partiallyScanned&&(this.partiallyScanned=new i.g(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new i.g(e.rejected)),void 0!==e.completed&&(this.completed=new i.g(e.completed))}}class u extends o.a{constructor(e={}){super(),this.partiallyScanned=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new i.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==e.partiallyScanned&&(this.partiallyScanned=new s(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new s(e.rejected)),void 0!==e.completed&&(this.completed=new s(e.completed))}}class d extends o.a{constructor(e={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new l({}),this.badge=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.polygon&&(this.polygon=new l(e.polygon)),void 0!==e.badge&&(this.badge=new u(e.badge))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(8);class o{constructor(e,t){this.width=e,this.height=t}isPortrait(){return this.height>this.width}ratio(e){return e?this.height/this.width:this.width/this.height}ratioDiff(e,t){return this.ratio(t)/e.ratio(t)}static isEmpty(e){return!e||(0===e.width||0===e.height)}static toPolygon(e){return[new i.a(0,0),new i.a(e.width,0),new i.a(e.width,e.height),new i.a(0,e.height)]}static fromHtmlElement(e){return e?new o(e.clientWidth,e.clientHeight):new o(0,0)}static fromJson(e){return new o(e.width,e.height)}static subtractFrom(e,t){return new o(e.width-t,e.height-t)}static empty(){return new o(0,0)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d}));var i=n(0),o=n(44);const r=n(26).a.svg`
3
3
  animation: rotate 2s linear infinite;
4
4
  width: 50px;
5
5
  height: 50px;
@@ -28,10 +28,10 @@
28
28
  stroke-dashoffset: -120;
29
29
  }
30
30
  }
31
- `;var a=e=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:e.color||"black"})),s=n(27),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.default.Component{constructor(e){super(e),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:e}=this.props;e&&e(this)}))},this.onVideoError=e=>{if(!0===this.state.videoReady){const{onError:t}=this.props.configuration;t?t(e):console.error(e)}else{const{onFailure:t}=this.props;t&&t(e),this.dispose()}},this.state=new u}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:i.a.instance).bridge}dispose(){const{container:e}=this.props;e&&Object(o.render)(null,e)}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(e,t)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(e){return this.state.videoReady&&this.state.sdkReady?null:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.default.createElement(a,{color:e}))}setTorchState(e){return this.camera.setTorchState(e)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class i extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(e){return new i(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",e)}static permissionDenied(e){return new i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new i(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",e)}static tryCheckPermission(){return o(this,void 0,void 0,(function*(){if(!this.permissionState)try{const e=yield navigator.permissions.query({name:"camera"});this.permissionState=e.state}catch(e){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(e){return e instanceof DOMException?"NotAllowedError"===e.name?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==e?void 0:e.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(40);class i extends o.a{constructor(e){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:e.width},height:{ideal:e.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(e,t){e.videoConstraints&&this.mapValues(e.videoConstraints,t.videoConstraints)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return v})),n.d(t,"Resolution",(function(){return C})),n.d(t,"CameraConfiguration",(function(){return b})),n.d(t,"TopBarConfiguration",(function(){return A.a})),n.d(t,"ActionBarConfiguration",(function(){return S})),n.d(t,"BarcodeUseCase",(function(){return y})),n.d(t,"Palette",(function(){return h.f})),n.d(t,"StyledText",(function(){return h.j})),n.d(t,"IconStyle",(function(){return h.e})),n.d(t,"PolygonStyle",(function(){return h.g})),n.d(t,"BackgroundStyle",(function(){return h.a})),n.d(t,"ForegroundStyle",(function(){return h.d})),n.d(t,"RoundButton",(function(){return h.h})),n.d(t,"BadgedButton",(function(){return h.b})),n.d(t,"ButtonConfiguration",(function(){return h.c})),n.d(t,"Sound",(function(){return h.i})),n.d(t,"Vibration",(function(){return h.l})),n.d(t,"Timeouts",(function(){return h.k})),n.d(t,"ViewFinderConfiguration",(function(){return P})),n.d(t,"FinderStyle",(function(){return D})),n.d(t,"FinderCorneredStyle",(function(){return _})),n.d(t,"FinderStrokedStyle",(function(){return R})),n.d(t,"UserGuidanceConfiguration",(function(){return F.a})),n.d(t,"BarcodeItemErrorState",(function(){return f})),n.d(t,"BarcodeMappedData",(function(){return p})),n.d(t,"BarcodeInfoMapping",(function(){return g})),n.d(t,"ExpectedBarcode",(function(){return k})),n.d(t,"FindAndPickScanningMode",(function(){return O})),n.d(t,"BarcodeTextLocalization",(function(){return M})),n.d(t,"BarcodeRecognizerConfiguration",(function(){return W})),n.d(t,"ArOverlayPolygonConfiguration",(function(){return d.c})),n.d(t,"BarcodeItemConfiguration",(function(){return d.e})),n.d(t,"BadgeStyle",(function(){return d.d})),n.d(t,"ArOverlayGeneralConfiguration",(function(){return d.b})),n.d(t,"FindAndPickArOverlayPolygonConfiguration",(function(){return d.f})),n.d(t,"FindAndPickBadgeConfiguration",(function(){return d.g})),n.d(t,"ArOverlayFindAndPickConfiguration",(function(){return d.a})),n.d(t,"BarcodeScannerConfiguration",(function(){return V})),n.d(t,"BarcodeScannerUIItem",(function(){return j})),n.d(t,"BarcodeScannerUIResult",(function(){return H})),n.d(t,"OcrResult",(function(){return U.OcrResult})),n.d(t,"FieldValidationStatusValues",(function(){return U.FieldValidationStatusValues})),n.d(t,"FieldDataFormatValues",(function(){return U.FieldDataFormatValues})),n.d(t,"FieldParsedData",(function(){return U.FieldParsedData})),n.d(t,"FieldType",(function(){return U.FieldType})),n.d(t,"Field",(function(){return U.Field})),n.d(t,"GenericDocumentType",(function(){return U.GenericDocumentType})),n.d(t,"GenericDocument",(function(){return U.GenericDocument})),n.d(t,"Sheet",(function(){return w})),n.d(t,"SwipeToDelete",(function(){return E})),n.d(t,"ManualCountEditDialog",(function(){return x})),n.d(t,"SheetContent",(function(){return B})),n.d(t,"MultipleScanningMode",(function(){return I})),n.d(t,"ScanbotAlertDialog",(function(){return T})),n.d(t,"CameraPermissionScreen",(function(){return N})),n.d(t,"BarcodeItem",(function(){return z.BarcodeItem})),n.d(t,"AcknowledgementBottomBar",(function(){return Y})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return X})),n.d(t,"ShutterButton",(function(){return le})),n.d(t,"PreviewButton",(function(){return te})),n.d(t,"ScanAssistanceOverlay",(function(){return ce})),n.d(t,"PagePreviewMode",(function(){return ue})),n.d(t,"TextButtonMode",(function(){return de})),n.d(t,"NoButtonMode",(function(){return he})),n.d(t,"CameraBottomBar",(function(){return me})),n.d(t,"PageSnapFeedbackMode",(function(){return ne})),n.d(t,"PageSnapFunnelAnimation",(function(){return fe})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return pe})),n.d(t,"PageSnapFeedbackNone",(function(){return ge})),n.d(t,"CaptureFeedback",(function(){return ve})),n.d(t,"DocumentPolygonConfiguration",(function(){return Ce})),n.d(t,"SelectCameraMenu",(function(){return be})),n.d(t,"CameraScreenConfiguration",(function(){return ye})),n.d(t,"CroppingBottomBar",(function(){return Ae})),n.d(t,"CroppingScreenConfiguration",(function(){return Se})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return q})),n.d(t,"DocumentScannerOutputSettings",(function(){return Ee})),n.d(t,"DocumentScannerScreens",(function(){return ke})),n.d(t,"DocumentScannerTextLocalization",(function(){return Oe})),n.d(t,"UserGuidanceStates",(function(){return J})),n.d(t,"DocumentScannerUserGuidance",(function(){return $})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return De})),n.d(t,"DocumentScanningFlow",(function(){return Le})),n.d(t,"IntroListEntry",(function(){return oe.g})),n.d(t,"IntroImage",(function(){return oe.f})),n.d(t,"NoIntroImage",(function(){return oe.j})),n.d(t,"ReceiptsIntroImage",(function(){return oe.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return oe.i})),n.d(t,"DocumentIntroImage",(function(){return oe.d})),n.d(t,"CheckIntroImage",(function(){return oe.a})),n.d(t,"IdCardIntroImage",(function(){return oe.e})),n.d(t,"CreditCardIntroImage",(function(){return oe.b})),n.d(t,"CustomImage",(function(){return oe.c})),n.d(t,"IntroductionScreenConfiguration",(function(){return oe.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return xe})),n.d(t,"ReviewMorePopupMenu",(function(){return Be})),n.d(t,"ZoomOverlay",(function(){return Ie})),n.d(t,"ReviewScreenConfiguration",(function(){return Te})),n.d(t,"CommonActionBarConfiguration",(function(){return s})),n.d(t,"CommonCameraConfiguration",(function(){return l})),n.d(t,"CommonCameraPermission",(function(){return i})),n.d(t,"CommonCommon",(function(){return Z})),n.d(t,"CommonNavigationBarConfiguration",(function(){return c})),n.d(t,"CommonScanbotAlertDialog",(function(){return r})),n.d(t,"CommonTopBarConfiguration",(function(){return u})),n.d(t,"CommonUserGuidanceConfiguration",(function(){return o})),n.d(t,"CommonViewFinderConfiguration",(function(){return a}));var o={};n.r(o),n.d(o,"UserGuidanceConfiguration",(function(){return G})),n.d(o,"IconUserGuidanceConfiguration",(function(){return Q}));var i={};n.r(i),n.d(i,"CameraPermissionScreen",(function(){return K}));var r={};n.r(r),n.d(r,"ScanbotAlertDialog",(function(){return ie}));var a={};n.r(a),n.d(a,"ViewFinderConfiguration",(function(){return re})),n.d(a,"FinderStyle",(function(){return ee})),n.d(a,"FinderCorneredStyle",(function(){return ae})),n.d(a,"FinderStrokedStyle",(function(){return se}));var s={};n.r(s),n.d(s,"ActionBarConfiguration",(function(){return Pe}));var l={};n.r(l),n.d(l,"Resolution",(function(){return _e})),n.d(l,"CameraConfiguration",(function(){return Re}));var c={};n.r(c);var u={};n.r(u),n.d(u,"TopBarConfiguration",(function(){return Fe}));var d=n(10),h=n(3),m=n(6);class f extends m.a{constructor(e={}){super(),this.title=new h.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new h.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new h.c({}),this.cancelButton=new h.c({}),void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new h.j(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new h.c(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton))}}class p extends m.a{constructor(e={}){if(super(),void 0===e.title)throw new Error("title must be present in constructor argument");if(this.title=e.title,void 0===e.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=e.subtitle,void 0===e.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=e.barcodeImage}}class g extends m.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new h.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new f({}),void 0!==e.barcodeItemMapper&&(this.barcodeItemMapper=null!=e.barcodeItemMapper?e.barcodeItemMapper:null),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.loadingMessage&&(this.loadingMessage=new h.j(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new f(e.errorState))}}class v extends m.a{constructor(e={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new h.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new h.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new h.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new h.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new h.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.confirmationSheetEnabled&&(this.confirmationSheetEnabled=e.confirmationSheetEnabled),void 0!==e.barcodeImageVisible&&(this.barcodeImageVisible=e.barcodeImageVisible),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.barcodeTitle&&(this.barcodeTitle=new h.j(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new h.j(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new h.c(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class C extends m.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}class b extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new C({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new C(e.idealPreviewResolution))}}var y,A=n(31);class S extends m.a{constructor(e={}){super(),this.flashButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new h.h(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new h.h(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new h.h(e.flipCameraButton))}}class w extends m.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new h.b({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new h.b(e.listButton))}}class E extends m.a{constructor(e={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.iconColor&&(this.iconColor=e.iconColor)}}class x extends m.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new h.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new h.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new h.c({visible:!0,text:"Update",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new h.c({visible:!0,text:"Cancel",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new h.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.info&&(this.info=new h.j(e.info)),void 0!==e.updateButton&&(this.updateButton=new h.c(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new h.e(e.clearTextButton))}}class B extends m.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new h.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new h.c({visible:!0,text:"Clear all",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new h.c({visible:!0,text:"Submit",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new h.c({visible:!0,text:"Start scanning",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new h.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new h.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new h.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new E({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.manualCountChangeEnabled&&(this.manualCountChangeEnabled=e.manualCountChangeEnabled),void 0!==e.manualCountOutlineColor&&(this.manualCountOutlineColor=e.manualCountOutlineColor),void 0!==e.manualCountChangeColor&&(this.manualCountChangeColor=e.manualCountChangeColor),void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new h.c(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new h.j(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new h.j(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new h.c(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new h.c(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new h.j(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new h.j(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new h.e(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new E(e.swipeToDelete))}}class I extends m.a{constructor(e={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new h.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new B({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new h.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new h.c({visible:!0,text:"?sheetClearAllButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new h.c({visible:!0,text:"?sheetStartScanningButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new h.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new h.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new h.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new h.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new h.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new h.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new h.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new h.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new h.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new h.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new h.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new B(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class T extends m.a{constructor(e={}){if(super(),this.title=new h.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new h.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new h.j(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0===e.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new h.c(e.okButton),void 0===e.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new h.c(e.cancelButton)}}class k extends m.a{constructor(e={}){if(super(),this.count=1,void 0===e.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=e.barcodeValue,void 0!==e.title&&(this.title=null!=e.title?e.title:null),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0!==e.count&&(this.count=e.count)}}class O extends m.a{constructor(e={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new h.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new B({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new h.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new h.c({visible:!0,text:"?sheetResetButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new h.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new h.c({visible:!0,text:"?sheetStartScanningButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new h.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new h.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new h.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new h.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new h.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new h.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new h.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new d.a({visible:!1,automaticSelectionEnabled:!0,polygon:new d.f({partiallyScanned:new h.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new d.g({partiallyScanned:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new T({title:new h.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new h.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new T({title:new h.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new h.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==e.scanningCompletedColor&&(this.scanningCompletedColor=e.scanningCompletedColor),void 0!==e.scanningPartiallyColor&&(this.scanningPartiallyColor=e.scanningPartiallyColor),void 0!==e.scanningNotScannedColor&&(this.scanningNotScannedColor=e.scanningNotScannedColor),void 0!==e.allowPartialScan&&(this.allowPartialScan=e.allowPartialScan),void 0!==e.expectedBarcodes&&(this.expectedBarcodes=e.expectedBarcodes.map((e=>new k(e)))),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new B(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.arOverlay&&(this.arOverlay=new d.a(e.arOverlay)),void 0!==e.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=e.partialScannedAlertDialogEnabled),void 0!==e.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new T(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new T(e.confirmationAlertDialog))}}(y||(y={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new v(e);case"MultipleScanningMode":return new I(e);case"FindAndPickScanningMode":return new O(e);default:throw`Unknown child class name: ${t}`}};var D,L=n(21);class P extends m.a{constructor(e={}){super(),this.visible=!0,this.style=new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=D.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new _(e);case"FinderStrokedStyle":return new R(e);default:throw`Unknown child class name: ${t}`}}}(D||(D={}));class _ extends m.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class R extends m.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}var F=n(32);class M extends m.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.findAndPickCompleteAlertSubmitButton="Submit",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.userGuidance&&(this.userGuidance=e.userGuidance),void 0!==e.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=e.barcodeInfoMappingLoadingMessage),void 0!==e.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=e.barcodeInfoMappingErrorStateTitle),void 0!==e.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=e.barcodeInfoMappingErrorStateSubtitle),void 0!==e.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=e.barcodeInfoMappingErrorStateRetryButton),void 0!==e.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=e.barcodeInfoMappingErrorStateCancelButton),void 0!==e.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=e.manualCountEditDialogTitle),void 0!==e.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=e.manualCountEditDialogInfo),void 0!==e.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=e.manualCountEditDialogUpdateButton),void 0!==e.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=e.manualCountEditDialogCancelButton),void 0!==e.sheetResetButton&&(this.sheetResetButton=e.sheetResetButton),void 0!==e.sheetClearAllButton&&(this.sheetClearAllButton=e.sheetClearAllButton),void 0!==e.sheetSubmitButton&&(this.sheetSubmitButton=e.sheetSubmitButton),void 0!==e.sheetStartScanningButton&&(this.sheetStartScanningButton=e.sheetStartScanningButton),void 0!==e.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=e.sheetPlaceholderTitle),void 0!==e.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=e.sheetPlaceholderSubtitle),void 0!==e.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=e.singleModeConfirmationCancelButton),void 0!==e.multipleModeSheetTitle&&(this.multipleModeSheetTitle=e.multipleModeSheetTitle),void 0!==e.findAndPickSheetTitle&&(this.findAndPickSheetTitle=e.findAndPickSheetTitle),void 0!==e.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=e.findAndPickSheetBarcodeItemSubtitle),void 0!==e.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=e.findAndPickPartialAlertTitle),void 0!==e.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=e.findAndPickPartialAlertSubtitle),void 0!==e.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=e.findAndPickPartialAlertCancelButton),void 0!==e.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=e.findAndPickPartialAlertSubmitButton),void 0!==e.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=e.findAndPickCompleteAlertTitle),void 0!==e.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=e.findAndPickCompleteAlertSubtitle),void 0!==e.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=e.findAndPickCompleteAlertCancelButton),void 0!==e.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=e.findAndPickCompleteAlertSubmitButton)}}class W extends m.a{constructor(e={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==e.barcodesRegexFilter&&(this.barcodesRegexFilter=e.barcodesRegexFilter),void 0!==e.barcodeFormats&&(this.barcodeFormats=e.barcodeFormats.map((e=>e))),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.maximumRecognizerResolution&&(this.maximumRecognizerResolution=e.maximumRecognizerResolution)}}class N extends m.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new h.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new h.c({text:"Close",background:new h.a({}),foreground:new h.d({})}),this.enableCameraTitle=new h.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new h.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new h.e(e.icon)),void 0!==e.closeButton&&(this.closeButton=new h.c(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new h.j(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new h.j(e.enableCameraExplanation))}}class V extends m.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new h.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new M({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new A.a({title:new h.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new h.c({visible:!0,text:"?topBarCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new S({flashButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new P({visible:!0,style:new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new L.AspectRatio({width:1,height:1})}),this.userGuidance=new F.a({visible:!0,title:new h.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new h.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new N({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new h.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new h.c({visible:!0,text:"?cameraPermissionCloseButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new h.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new h.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new b({}),this.recognizerConfiguration=new W({}),this.useCase=new v({}),this.sound=new h.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new h.l({enabled:!0}),this.timeouts=new h.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new h.f(e.palette)),void 0!==e.localization&&(this.localization=new M(e.localization)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.topBar&&(this.topBar=new A.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new S(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new P(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new F.a(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new N(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new b(e.cameraConfiguration)),void 0!==e.recognizerConfiguration&&(this.recognizerConfiguration=new W(e.recognizerConfiguration)),void 0!==e.useCase&&(this.useCase=y.From(e.useCase)),void 0!==e.sound&&(this.sound=new h.i(e.sound)),void 0!==e.vibration&&(this.vibration=new h.l(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new h.k(e.timeouts))}}var z=n(38);class j extends m.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new z.BarcodeItem(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class H extends m.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new j(e))))}}var U=n(20),Z=n(2);class G extends m.a{constructor(e={}){super(),this.visible=!0,this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Q extends m.a{constructor(e={}){super(),this.visible=!0,this.icon=new Z.IconStyle({color:"?sbColorOnPrimary"}),this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.icon&&(this.icon=new Z.IconStyle(e.icon)),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Y extends m.a{constructor(e={}){super(),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new Z.BarButtonConfiguration(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new Z.BarButtonConfiguration(e.acceptWhenNotOkButton))}}class X extends m.a{constructor(e={}){super(),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new Q({visible:!0,icon:new Z.IconStyle({color:"?sbColorOnPrimary"}),title:new Z.StyledText({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new Y({}),void 0!==e.minimumQuality&&(this.minimumQuality=e.minimumQuality),void 0!==e.acknowledgementMode&&(this.acknowledgementMode=e.acknowledgementMode),void 0!==e.badImageHint&&(this.badImageHint=new Q(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new Y(e.bottomBar))}}class K extends m.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new Z.ButtonConfiguration({text:"Close",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.enableCameraTitle=new Z.StyledText({text:"Camera permission denied!",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new Z.StyledText({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new Z.IconStyle(e.icon)),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new Z.StyledText(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new Z.StyledText(e.enableCameraExplanation))}}class q extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.flashEnabled=!1,this.acceptedAngleScore=.75,this.acceptedSizeScore=.75,this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.acceptedBrightnessThreshold=50,this.autoSnappingEnabled=!0,this.requiredAspectRatios=[],this.ignoreBadAspectRatio=!0,void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new L.AspectRatio(e)))),void 0!==e.ignoreBadAspectRatio&&(this.ignoreBadAspectRatio=e.ignoreBadAspectRatio)}}class J extends m.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",this.textHintOffCenter="?cameraUserGuidanceTextHintOffCenter",this.tooSmall="?cameraUserGuidanceTooSmall",this.tooNoisy="?cameraUserGuidanceTooNoisy",this.tooDark="?cameraUserGuidanceTooDark",this.energySaveMode="?cameraUserGuidanceEnergySaveMode",this.readyToCapture="?cameraUserGuidanceReadyToCapture",this.capturing="?cameraUserGuidanceReadyToCapture",this.captureManual="?cameraUserGuidanceReadyToCaptureManual",void 0!==e.noDocumentFound&&(this.noDocumentFound=e.noDocumentFound),void 0!==e.badAspectRatio&&(this.badAspectRatio=e.badAspectRatio),void 0!==e.badAngles&&(this.badAngles=e.badAngles),void 0!==e.textHintOffCenter&&(this.textHintOffCenter=e.textHintOffCenter),void 0!==e.tooSmall&&(this.tooSmall=e.tooSmall),void 0!==e.tooNoisy&&(this.tooNoisy=e.tooNoisy),void 0!==e.tooDark&&(this.tooDark=e.tooDark),void 0!==e.energySaveMode&&(this.energySaveMode=e.energySaveMode),void 0!==e.readyToCapture&&(this.readyToCapture=e.readyToCapture),void 0!==e.capturing&&(this.capturing=e.capturing),void 0!==e.captureManual&&(this.captureManual=e.captureManual)}}class $ extends m.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new Z.StyledText({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new J({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new J(e.statesTitles))}}var ee,te,ne,oe=n(16);class ie extends m.a{constructor(e={}){super(),this.title=new Z.StyledText({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new Z.StyledText({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new Z.ButtonConfiguration({background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary"})}),this.actionButton=new Z.ButtonConfiguration({visible:!1,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new Z.ButtonConfiguration({visible:!0,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new Z.StyledText(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.okButton&&(this.okButton=new Z.ButtonConfiguration(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new Z.ButtonConfiguration(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new Z.ButtonConfiguration(e.cancelButton))}}class re extends m.a{constructor(e={}){super(),this.visible=!0,this.style=new ae({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=ee.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new ae(e);case"FinderStrokedStyle":return new se(e);default:throw`Unknown child class name: ${t}`}}}(ee||(ee={}));class ae extends m.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class se extends m.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class le extends m.a{constructor(e={}){super(),this.enabledInAutoSnappingMode=!0,this.accessibilityDescription="?accessibilityDescriptionCameraShutterButton",this.outerColor="?sbColorOnPrimary",this.innerColor="?sbColorOnPrimary",void 0!==e.enabledInAutoSnappingMode&&(this.enabledInAutoSnappingMode=e.enabledInAutoSnappingMode),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.outerColor&&(this.outerColor=e.outerColor),void 0!==e.innerColor&&(this.innerColor=e.innerColor)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PagePreviewMode":return new ue(e);case"TextButtonMode":return new de(e);case"NoButtonMode":return new he(e);default:throw`Unknown child class name: ${t}`}}}(te||(te={}));class ce extends m.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="?sbColorModalOverlay",this.foregroundColor="?sbColorSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class ue extends m.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new Z.BadgeStyle({visible:!0,background:new Z.BackgroundStyle({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface"}),foregroundColor:"?sbColorPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.imagePlaceholderColor&&(this.imagePlaceholderColor=e.imagePlaceholderColor),void 0!==e.pageCounter&&(this.pageCounter=new Z.BadgeStyle(e.pageCounter))}}class de extends m.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new Z.StyledText({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new Z.StyledText(e.style))}}class he extends m.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class me extends m.a{constructor(e={}){super(),this.importButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.shutterButton=new le({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.torchOffButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.previewButton=new ue({}),void 0!==e.importButton&&(this.importButton=new Z.BarButtonConfiguration(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new Z.BarButtonConfiguration(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new Z.BarButtonConfiguration(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new le(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new Z.BarButtonConfiguration(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new Z.BarButtonConfiguration(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=te.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new fe(e);case"PageSnapCheckMarkAnimation":return new pe(e);case"PageSnapFeedbackNone":return new ge(e);default:throw`Unknown child class name: ${t}`}}}(ne||(ne={}));class fe extends m.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class pe extends m.a{constructor(e={}){super(),this._type="PageSnapCheckMarkAnimation",this.overlayColor="?sbColorModalOverlay",this.checkMarkBackgroundColor="?sbColorOutline",this.checkMarkColor="#00000000",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.checkMarkBackgroundColor&&(this.checkMarkBackgroundColor=e.checkMarkBackgroundColor),void 0!==e.checkMarkColor&&(this.checkMarkColor=e.checkMarkColor)}}class ge extends m.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class ve extends m.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new fe({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=ne.From(e.snapFeedbackMode))}}class Ce extends m.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new Z.PolygonStyle({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new Z.PolygonStyle({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new Z.PolygonStyle({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new Z.PolygonStyle(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new Z.PolygonStyle(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new Z.PolygonStyle(e.autoSnapProgress))}}class be extends m.a{constructor(e={}){super(),this.button=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new Z.StyledText({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorOnSurface"})}),this.menuEntryActive=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new Z.IconButton(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new Z.PopupMenuItem(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new Z.PopupMenuItem(e.menuEntryActive))}}class ye extends m.a{constructor(e={}){super(),this.acknowledgement=new X({}),this.introduction=new oe.h({}),this.scanAssistanceOverlay=new ce({}),this.cameraPermission=new K({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),closeButton:new Z.ButtonConfiguration({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new Z.StyledText({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new Z.StyledText({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new Z.StyledText({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new be({}),this.topUserGuidance=new G({title:new Z.StyledText({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new $({}),this.backgroundColor="#000000FF",this.cameraConfiguration=new q({}),this.polygon=new Ce({}),this.bottomBar=new me({}),this.viewFinder=new re({visible:!1,aspectRatio:new L.AspectRatio({width:21,height:29})}),this.captureFeedback=new ve({}),this.vibration=new Z.Vibration({enabled:!0}),this.timeouts=new Z.Timeouts({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new ie({title:new Z.StyledText({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({visible:!1})}),this.cancelAlertDialog=new ie({title:new Z.StyledText({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new X(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new oe.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new ce(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new K(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new Z.IconButton(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new be(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new G(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new $(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new q(e.cameraConfiguration)),void 0!==e.polygon&&(this.polygon=new Ce(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new me(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new re(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new ve(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new Z.Vibration(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new Z.Timeouts(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new ie(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new ie(e.cancelAlertDialog))}}class Ae extends m.a{constructor(e={}){super(),this.detectButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.resetButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new Z.BarButtonConfiguration(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new Z.BarButtonConfiguration(e.resetButton))}}class Se extends m.a{constructor(e={}){super(),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new Z.StyledText({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.bottomBar=new Ae({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new Z.ButtonConfiguration(e.topBarConfirmButton)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.croppingHandlerColor&&(this.croppingHandlerColor=e.croppingHandlerColor),void 0!==e.croppingPolygonColor&&(this.croppingPolygonColor=e.croppingPolygonColor),void 0!==e.bottomBar&&(this.bottomBar=new Ae(e.bottomBar))}}var we=n(41);class Ee extends m.a{constructor(e={}){super(),this.pagesScanLimit=0,this.documentImageSizeLimit=0,this.documentAnalysisMode="UNFILTERED_DOCUMENT",this.defaultFilter=null,void 0!==e.pagesScanLimit&&(this.pagesScanLimit=e.pagesScanLimit),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.documentAnalysisMode&&(this.documentAnalysisMode=e.documentAnalysisMode),void 0!==e.defaultFilter&&(this.defaultFilter=null!=e.defaultFilter?we.a.From(e.defaultFilter):null)}}class xe extends m.a{constructor(e={}){super(),this.addButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.cropButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.deleteButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.submitButton=new Z.ButtonConfiguration({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new Z.BarButtonConfiguration(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new Z.BarButtonConfiguration(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new Z.BarButtonConfiguration(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new Z.ButtonConfiguration(e.submitButton))}}class Be extends m.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new Z.PopupMenuItem({title:new Z.StyledText({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new Z.IconStyle({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new Z.PopupMenuItem(e.deleteAll))}}class Ie extends m.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new Z.ButtonConfiguration({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton))}}class Te extends m.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new Z.StyledText({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new Be({}),this.zoomButton=new Z.RoundButton({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new Ie({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new xe({}),this.switchNextPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new G({title:new Z.StyledText({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new ie({title:new Z.StyledText({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({visible:!1}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new ie({title:new Z.StyledText({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new Z.IconButton(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new Be(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new Ie(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new xe(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new Z.IconButton(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new Z.IconButton(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new G(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new ie(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new ie(e.deletePageAlertDialog))}}class ke extends m.a{constructor(e={}){super(),this.camera=new ye({}),this.review=new Te({}),this.cropping=new Se({}),void 0!==e.camera&&(this.camera=new ye(e.camera)),void 0!==e.review&&(this.review=new Te(e.review)),void 0!==e.cropping&&(this.cropping=new Se(e.cropping))}}class Oe extends m.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.cameraTopBarCancelButtonTitle="Cancel",this.cameraTopBarTitle="Scan Document",this.cameraTopGuidance="Scan each page of your document.",this.cameraUserGuidanceStart="Please hold your device over a document.",this.cameraUserGuidanceNoDocumentFound="No document found",this.cameraUserGuidanceBadAspectRatio="Bad aspect ratio",this.cameraUserGuidanceBadAngles="Bad angles",this.cameraUserGuidanceTooNoisy="Its too noisy. Try another background for the document",this.cameraUserGuidanceTextHintOffCenter="Document is off center",this.cameraUserGuidanceTooSmall="Document is too small. Move camera closer.",this.cameraUserGuidanceTooDark="Its too dark. Add more light.",this.cameraUserGuidanceEnergySaveMode="Energy save mode is on",this.cameraUserGuidanceReadyToCapture="Hold still capturing...",this.cameraUserGuidanceReadyToCaptureManual="Ready to capture!",this.cameraImportButtonTitle="Import",this.cameraTorchOnButtonTitle="On",this.cameraTorchOffButtonTitle="Off",this.cameraAutoSnapButtonTitle="Auto",this.cameraManualSnapButtonTitle="Manual",this.cameraPreviewButtonTitle="%d Pages",this.cameraIntroDoneButton="Done",this.cameraIntroTitle="How to scan a document",this.cameraIntroSubtitle="Follow the steps below to create a high-quality document scan",this.cameraIntroItem1="1. Place your document on a flat surface.",this.cameraIntroItem2="2. Hold your phone above the document.",this.cameraIntroItem3="3. Follow the on-screen guidance to find the optimal position.",this.cameraIntroItem4="4. Once you reach the optimal position, you can manually scan the document or let the app scan it automatically.",this.cameraProgressOverlayTitle="Please wait...",this.cameraCancelAlertTitle="Cancel?",this.cameraCancelAlertSubtitle="Canceling will delete all the pages scanned so far. Are you sure you want to cancel?",this.cameraCancelNoButtonTitle="No",this.cameraCancelYesButtonTitle="Yes, Cancel",this.cameraLimitReachedAlertTitle="You reached the limit!",this.cameraLimitReachedAlertSubtitle="You have scanned the maximum number of pages and cannot add any more. Please delete at least one page to perform a new scan.",this.cameraLimitReachedOkButtonTitle="Ok",this.cameraSelectCameraMenuTitle="Select camera",this.acknowledgementScreenBadDocumentHint="The quality of your scan does not seem sufficient.",this.acknowledgementRetakeButtonTitle="Retake",this.acknowledgementAcceptButtonTitle="Use Scan",this.reviewScreenTitle="Review (%d)",this.reviewTopBarBackButtonTitle="Back",this.reviewScreenPageCount="Page %d/%d",this.reviewScreenAddButtonTitle="Add",this.reviewScreenRetakeButtonTitle="Retake",this.reviewScreenCropButtonTitle="Crop",this.reviewScreenRotateButtonTitle="Rotate",this.reviewScreenDeleteButtonTitle="Delete",this.reviewScreenSubmitButtonTitle="Submit",this.reviewScreenDeleteAllButtonTitle="Delete all",this.reviewScreenReorderPagesButtonTitle="Reorder pages",this.zoomOverlayCancelButtonText="Close",this.reviewDeletePageAlertTitle="Delete page?",this.reviewDeleteAllPagesAlertTitle="Delete all?",this.reviewDeletePageAlertSubTitle="Are you sure you want to delete the page?",this.reviewDeleteAllPagesAlertSubtitle="Are you sure you want to delete all pages?",this.reviewDeletePageAlertConfirmButtonTitle="Yes, Delete",this.reviewDeleteAllPagesAlertDeleteButtonTitle="Yes, Delete all",this.reviewDeletePageAlertDeleteRetakeButtonTitle="Delete and Retake",this.reviewDeletePageAlertCancelButtonTitle="Cancel",this.reviewDeleteAllPagesAlertCancelButtonTitle="Cancel",this.reorderPageTitle="Reorder Pages",this.reorderPageGuidanceTitle="Drag pages to reorder",this.reorderPageText="%d",this.reorderTopBarConfirmButtonTitle="Done",this.reorderTopBarCancelButtonTitle="Cancel",this.croppingTopBarConfirmButtonTitle="Done",this.croppingTopBarCancelButtonTitle="Cancel",this.croppingDetectButtonTitle="Detect",this.croppingRotateButtonTitle="Rotate",this.croppingResetButtonTitle="Reset",this.croppingScreenTitle="Crop",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",this.accessibilityDescriptionCameraTopBarIntroButton="Tap to open introduction screen",this.accessibilityDescriptionCameraTopBarCancelButton="Tap to close scanner screen",this.accessibilityDescriptionCameraImportButton="Tap to import image",this.accessibilityDescriptionCameraTorchOnButton="Tap to disable torch",this.accessibilityDescriptionCameraTorchOffButton="Tap to enable torch",this.accessibilityDescriptionCameraShutterButton="Tap to take image",this.accessibilityDescriptionCameraAutoSnapButton="Tap to enable manual snapping mode",this.accessibilityDescriptionCameraManualSnapButton="Tap to enable auto snapping mode",this.accessibilityDescriptionCameraPreviewButton="Tap to preview scanned pages",this.accessibilityDescriptionCameraIntroDoneButton="Tap to close introduction screen",this.accessibilityDescriptionCameraSelectButton="Tap to open camera selection menu",this.accessibilityDescriptionCameraSelectMenuItem="Tap to select camera",this.accessibilityDescriptionAcknowledgementRetakeButton="Tap to retake the image",this.accessibilityDescriptionAcknowledgementAcceptButton="Tap to accept the image regarding the quality",this.accessibilityDescriptionCroppingTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionCroppingTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionCroppingDetectButton="Tap to detect document on the image",this.accessibilityDescriptionCroppingRotateButton="Tap to rotate document",this.accessibilityDescriptionCroppingResetButton="Tap to reset document contour to whole image",this.accessibilityDescriptionReorderTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionReorderTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionReviewNextPageButton="Tap to switch to the new page",this.accessibilityDescriptionReviewPreviousPageButton="Tap to switch to the previous page",this.accessibilityDescriptionReviewAddButton="Tap to Add new page",this.accessibilityDescriptionReviewRetakeButton="Tap to Retake current selected page",this.accessibilityDescriptionReviewCropButton="Tap to Crop selected page",this.accessibilityDescriptionReviewRotateButton="Tap to Rotate selected page clockwise",this.accessibilityDescriptionReviewDeleteButton="Tap to Delete selected page",this.accessibilityDescriptionReviewSubmitButton="Tap to Submit document",this.accessibilityDescriptionReviewMoreButton="Tap to show additional options",this.accessibilityDescriptionReviewDeleteAllButton="Tap to Delete all pages",this.accessibilityDescriptionReviewReorderPagesButton="Tap to Reorder pages",this.accessibilityDescriptionZoomOverlayCancelButton="Tap to Close zoom overlay",this.accessibilityDescriptionReviewZoomButton="Tap to open zoom overlay for selected page",this.accessibilityDescriptionReviewTopBarBackButton="Tap to Close review screen",this.accessibilityDescriptionReviewDeletePageAlertConfirmButton="Tap to Delete page",this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton="Tap to Delete all pages",this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton="Tap to Delete page and Retake it",this.accessibilityDescriptionReviewDeletePageAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionCameraLimitReachedOkButton="Tap to close alert dialog",this.accessibilityDescriptionCameraCancelYesButton="Tap to cancel document",this.accessibilityDescriptionCameraCancelNoButton="Tap to close alert dialog",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.cameraTopBarCancelButtonTitle&&(this.cameraTopBarCancelButtonTitle=e.cameraTopBarCancelButtonTitle),void 0!==e.cameraTopBarTitle&&(this.cameraTopBarTitle=e.cameraTopBarTitle),void 0!==e.cameraTopGuidance&&(this.cameraTopGuidance=e.cameraTopGuidance),void 0!==e.cameraUserGuidanceStart&&(this.cameraUserGuidanceStart=e.cameraUserGuidanceStart),void 0!==e.cameraUserGuidanceNoDocumentFound&&(this.cameraUserGuidanceNoDocumentFound=e.cameraUserGuidanceNoDocumentFound),void 0!==e.cameraUserGuidanceBadAspectRatio&&(this.cameraUserGuidanceBadAspectRatio=e.cameraUserGuidanceBadAspectRatio),void 0!==e.cameraUserGuidanceBadAngles&&(this.cameraUserGuidanceBadAngles=e.cameraUserGuidanceBadAngles),void 0!==e.cameraUserGuidanceTooNoisy&&(this.cameraUserGuidanceTooNoisy=e.cameraUserGuidanceTooNoisy),void 0!==e.cameraUserGuidanceTextHintOffCenter&&(this.cameraUserGuidanceTextHintOffCenter=e.cameraUserGuidanceTextHintOffCenter),void 0!==e.cameraUserGuidanceTooSmall&&(this.cameraUserGuidanceTooSmall=e.cameraUserGuidanceTooSmall),void 0!==e.cameraUserGuidanceTooDark&&(this.cameraUserGuidanceTooDark=e.cameraUserGuidanceTooDark),void 0!==e.cameraUserGuidanceEnergySaveMode&&(this.cameraUserGuidanceEnergySaveMode=e.cameraUserGuidanceEnergySaveMode),void 0!==e.cameraUserGuidanceReadyToCapture&&(this.cameraUserGuidanceReadyToCapture=e.cameraUserGuidanceReadyToCapture),void 0!==e.cameraUserGuidanceReadyToCaptureManual&&(this.cameraUserGuidanceReadyToCaptureManual=e.cameraUserGuidanceReadyToCaptureManual),void 0!==e.cameraImportButtonTitle&&(this.cameraImportButtonTitle=e.cameraImportButtonTitle),void 0!==e.cameraTorchOnButtonTitle&&(this.cameraTorchOnButtonTitle=e.cameraTorchOnButtonTitle),void 0!==e.cameraTorchOffButtonTitle&&(this.cameraTorchOffButtonTitle=e.cameraTorchOffButtonTitle),void 0!==e.cameraAutoSnapButtonTitle&&(this.cameraAutoSnapButtonTitle=e.cameraAutoSnapButtonTitle),void 0!==e.cameraManualSnapButtonTitle&&(this.cameraManualSnapButtonTitle=e.cameraManualSnapButtonTitle),void 0!==e.cameraPreviewButtonTitle&&(this.cameraPreviewButtonTitle=e.cameraPreviewButtonTitle),void 0!==e.cameraIntroDoneButton&&(this.cameraIntroDoneButton=e.cameraIntroDoneButton),void 0!==e.cameraIntroTitle&&(this.cameraIntroTitle=e.cameraIntroTitle),void 0!==e.cameraIntroSubtitle&&(this.cameraIntroSubtitle=e.cameraIntroSubtitle),void 0!==e.cameraIntroItem1&&(this.cameraIntroItem1=e.cameraIntroItem1),void 0!==e.cameraIntroItem2&&(this.cameraIntroItem2=e.cameraIntroItem2),void 0!==e.cameraIntroItem3&&(this.cameraIntroItem3=e.cameraIntroItem3),void 0!==e.cameraIntroItem4&&(this.cameraIntroItem4=e.cameraIntroItem4),void 0!==e.cameraProgressOverlayTitle&&(this.cameraProgressOverlayTitle=e.cameraProgressOverlayTitle),void 0!==e.cameraCancelAlertTitle&&(this.cameraCancelAlertTitle=e.cameraCancelAlertTitle),void 0!==e.cameraCancelAlertSubtitle&&(this.cameraCancelAlertSubtitle=e.cameraCancelAlertSubtitle),void 0!==e.cameraCancelNoButtonTitle&&(this.cameraCancelNoButtonTitle=e.cameraCancelNoButtonTitle),void 0!==e.cameraCancelYesButtonTitle&&(this.cameraCancelYesButtonTitle=e.cameraCancelYesButtonTitle),void 0!==e.cameraLimitReachedAlertTitle&&(this.cameraLimitReachedAlertTitle=e.cameraLimitReachedAlertTitle),void 0!==e.cameraLimitReachedAlertSubtitle&&(this.cameraLimitReachedAlertSubtitle=e.cameraLimitReachedAlertSubtitle),void 0!==e.cameraLimitReachedOkButtonTitle&&(this.cameraLimitReachedOkButtonTitle=e.cameraLimitReachedOkButtonTitle),void 0!==e.cameraSelectCameraMenuTitle&&(this.cameraSelectCameraMenuTitle=e.cameraSelectCameraMenuTitle),void 0!==e.acknowledgementScreenBadDocumentHint&&(this.acknowledgementScreenBadDocumentHint=e.acknowledgementScreenBadDocumentHint),void 0!==e.acknowledgementRetakeButtonTitle&&(this.acknowledgementRetakeButtonTitle=e.acknowledgementRetakeButtonTitle),void 0!==e.acknowledgementAcceptButtonTitle&&(this.acknowledgementAcceptButtonTitle=e.acknowledgementAcceptButtonTitle),void 0!==e.reviewScreenTitle&&(this.reviewScreenTitle=e.reviewScreenTitle),void 0!==e.reviewTopBarBackButtonTitle&&(this.reviewTopBarBackButtonTitle=e.reviewTopBarBackButtonTitle),void 0!==e.reviewScreenPageCount&&(this.reviewScreenPageCount=e.reviewScreenPageCount),void 0!==e.reviewScreenAddButtonTitle&&(this.reviewScreenAddButtonTitle=e.reviewScreenAddButtonTitle),void 0!==e.reviewScreenRetakeButtonTitle&&(this.reviewScreenRetakeButtonTitle=e.reviewScreenRetakeButtonTitle),void 0!==e.reviewScreenCropButtonTitle&&(this.reviewScreenCropButtonTitle=e.reviewScreenCropButtonTitle),void 0!==e.reviewScreenRotateButtonTitle&&(this.reviewScreenRotateButtonTitle=e.reviewScreenRotateButtonTitle),void 0!==e.reviewScreenDeleteButtonTitle&&(this.reviewScreenDeleteButtonTitle=e.reviewScreenDeleteButtonTitle),void 0!==e.reviewScreenSubmitButtonTitle&&(this.reviewScreenSubmitButtonTitle=e.reviewScreenSubmitButtonTitle),void 0!==e.reviewScreenDeleteAllButtonTitle&&(this.reviewScreenDeleteAllButtonTitle=e.reviewScreenDeleteAllButtonTitle),void 0!==e.reviewScreenReorderPagesButtonTitle&&(this.reviewScreenReorderPagesButtonTitle=e.reviewScreenReorderPagesButtonTitle),void 0!==e.zoomOverlayCancelButtonText&&(this.zoomOverlayCancelButtonText=e.zoomOverlayCancelButtonText),void 0!==e.reviewDeletePageAlertTitle&&(this.reviewDeletePageAlertTitle=e.reviewDeletePageAlertTitle),void 0!==e.reviewDeleteAllPagesAlertTitle&&(this.reviewDeleteAllPagesAlertTitle=e.reviewDeleteAllPagesAlertTitle),void 0!==e.reviewDeletePageAlertSubTitle&&(this.reviewDeletePageAlertSubTitle=e.reviewDeletePageAlertSubTitle),void 0!==e.reviewDeleteAllPagesAlertSubtitle&&(this.reviewDeleteAllPagesAlertSubtitle=e.reviewDeleteAllPagesAlertSubtitle),void 0!==e.reviewDeletePageAlertConfirmButtonTitle&&(this.reviewDeletePageAlertConfirmButtonTitle=e.reviewDeletePageAlertConfirmButtonTitle),void 0!==e.reviewDeleteAllPagesAlertDeleteButtonTitle&&(this.reviewDeleteAllPagesAlertDeleteButtonTitle=e.reviewDeleteAllPagesAlertDeleteButtonTitle),void 0!==e.reviewDeletePageAlertDeleteRetakeButtonTitle&&(this.reviewDeletePageAlertDeleteRetakeButtonTitle=e.reviewDeletePageAlertDeleteRetakeButtonTitle),void 0!==e.reviewDeletePageAlertCancelButtonTitle&&(this.reviewDeletePageAlertCancelButtonTitle=e.reviewDeletePageAlertCancelButtonTitle),void 0!==e.reviewDeleteAllPagesAlertCancelButtonTitle&&(this.reviewDeleteAllPagesAlertCancelButtonTitle=e.reviewDeleteAllPagesAlertCancelButtonTitle),void 0!==e.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.reorderPageGuidanceTitle&&(this.reorderPageGuidanceTitle=e.reorderPageGuidanceTitle),void 0!==e.reorderPageText&&(this.reorderPageText=e.reorderPageText),void 0!==e.reorderTopBarConfirmButtonTitle&&(this.reorderTopBarConfirmButtonTitle=e.reorderTopBarConfirmButtonTitle),void 0!==e.reorderTopBarCancelButtonTitle&&(this.reorderTopBarCancelButtonTitle=e.reorderTopBarCancelButtonTitle),void 0!==e.croppingTopBarConfirmButtonTitle&&(this.croppingTopBarConfirmButtonTitle=e.croppingTopBarConfirmButtonTitle),void 0!==e.croppingTopBarCancelButtonTitle&&(this.croppingTopBarCancelButtonTitle=e.croppingTopBarCancelButtonTitle),void 0!==e.croppingDetectButtonTitle&&(this.croppingDetectButtonTitle=e.croppingDetectButtonTitle),void 0!==e.croppingRotateButtonTitle&&(this.croppingRotateButtonTitle=e.croppingRotateButtonTitle),void 0!==e.croppingResetButtonTitle&&(this.croppingResetButtonTitle=e.croppingResetButtonTitle),void 0!==e.croppingScreenTitle&&(this.croppingScreenTitle=e.croppingScreenTitle),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraTopBarIntroButton&&(this.accessibilityDescriptionCameraTopBarIntroButton=e.accessibilityDescriptionCameraTopBarIntroButton),void 0!==e.accessibilityDescriptionCameraTopBarCancelButton&&(this.accessibilityDescriptionCameraTopBarCancelButton=e.accessibilityDescriptionCameraTopBarCancelButton),void 0!==e.accessibilityDescriptionCameraImportButton&&(this.accessibilityDescriptionCameraImportButton=e.accessibilityDescriptionCameraImportButton),void 0!==e.accessibilityDescriptionCameraTorchOnButton&&(this.accessibilityDescriptionCameraTorchOnButton=e.accessibilityDescriptionCameraTorchOnButton),void 0!==e.accessibilityDescriptionCameraTorchOffButton&&(this.accessibilityDescriptionCameraTorchOffButton=e.accessibilityDescriptionCameraTorchOffButton),void 0!==e.accessibilityDescriptionCameraShutterButton&&(this.accessibilityDescriptionCameraShutterButton=e.accessibilityDescriptionCameraShutterButton),void 0!==e.accessibilityDescriptionCameraAutoSnapButton&&(this.accessibilityDescriptionCameraAutoSnapButton=e.accessibilityDescriptionCameraAutoSnapButton),void 0!==e.accessibilityDescriptionCameraManualSnapButton&&(this.accessibilityDescriptionCameraManualSnapButton=e.accessibilityDescriptionCameraManualSnapButton),void 0!==e.accessibilityDescriptionCameraPreviewButton&&(this.accessibilityDescriptionCameraPreviewButton=e.accessibilityDescriptionCameraPreviewButton),void 0!==e.accessibilityDescriptionCameraIntroDoneButton&&(this.accessibilityDescriptionCameraIntroDoneButton=e.accessibilityDescriptionCameraIntroDoneButton),void 0!==e.accessibilityDescriptionCameraSelectButton&&(this.accessibilityDescriptionCameraSelectButton=e.accessibilityDescriptionCameraSelectButton),void 0!==e.accessibilityDescriptionCameraSelectMenuItem&&(this.accessibilityDescriptionCameraSelectMenuItem=e.accessibilityDescriptionCameraSelectMenuItem),void 0!==e.accessibilityDescriptionAcknowledgementRetakeButton&&(this.accessibilityDescriptionAcknowledgementRetakeButton=e.accessibilityDescriptionAcknowledgementRetakeButton),void 0!==e.accessibilityDescriptionAcknowledgementAcceptButton&&(this.accessibilityDescriptionAcknowledgementAcceptButton=e.accessibilityDescriptionAcknowledgementAcceptButton),void 0!==e.accessibilityDescriptionCroppingTopBarConfirmButton&&(this.accessibilityDescriptionCroppingTopBarConfirmButton=e.accessibilityDescriptionCroppingTopBarConfirmButton),void 0!==e.accessibilityDescriptionCroppingTopBarCancelButton&&(this.accessibilityDescriptionCroppingTopBarCancelButton=e.accessibilityDescriptionCroppingTopBarCancelButton),void 0!==e.accessibilityDescriptionCroppingDetectButton&&(this.accessibilityDescriptionCroppingDetectButton=e.accessibilityDescriptionCroppingDetectButton),void 0!==e.accessibilityDescriptionCroppingRotateButton&&(this.accessibilityDescriptionCroppingRotateButton=e.accessibilityDescriptionCroppingRotateButton),void 0!==e.accessibilityDescriptionCroppingResetButton&&(this.accessibilityDescriptionCroppingResetButton=e.accessibilityDescriptionCroppingResetButton),void 0!==e.accessibilityDescriptionReorderTopBarConfirmButton&&(this.accessibilityDescriptionReorderTopBarConfirmButton=e.accessibilityDescriptionReorderTopBarConfirmButton),void 0!==e.accessibilityDescriptionReorderTopBarCancelButton&&(this.accessibilityDescriptionReorderTopBarCancelButton=e.accessibilityDescriptionReorderTopBarCancelButton),void 0!==e.accessibilityDescriptionReviewNextPageButton&&(this.accessibilityDescriptionReviewNextPageButton=e.accessibilityDescriptionReviewNextPageButton),void 0!==e.accessibilityDescriptionReviewPreviousPageButton&&(this.accessibilityDescriptionReviewPreviousPageButton=e.accessibilityDescriptionReviewPreviousPageButton),void 0!==e.accessibilityDescriptionReviewAddButton&&(this.accessibilityDescriptionReviewAddButton=e.accessibilityDescriptionReviewAddButton),void 0!==e.accessibilityDescriptionReviewRetakeButton&&(this.accessibilityDescriptionReviewRetakeButton=e.accessibilityDescriptionReviewRetakeButton),void 0!==e.accessibilityDescriptionReviewCropButton&&(this.accessibilityDescriptionReviewCropButton=e.accessibilityDescriptionReviewCropButton),void 0!==e.accessibilityDescriptionReviewRotateButton&&(this.accessibilityDescriptionReviewRotateButton=e.accessibilityDescriptionReviewRotateButton),void 0!==e.accessibilityDescriptionReviewDeleteButton&&(this.accessibilityDescriptionReviewDeleteButton=e.accessibilityDescriptionReviewDeleteButton),void 0!==e.accessibilityDescriptionReviewSubmitButton&&(this.accessibilityDescriptionReviewSubmitButton=e.accessibilityDescriptionReviewSubmitButton),void 0!==e.accessibilityDescriptionReviewMoreButton&&(this.accessibilityDescriptionReviewMoreButton=e.accessibilityDescriptionReviewMoreButton),void 0!==e.accessibilityDescriptionReviewDeleteAllButton&&(this.accessibilityDescriptionReviewDeleteAllButton=e.accessibilityDescriptionReviewDeleteAllButton),void 0!==e.accessibilityDescriptionReviewReorderPagesButton&&(this.accessibilityDescriptionReviewReorderPagesButton=e.accessibilityDescriptionReviewReorderPagesButton),void 0!==e.accessibilityDescriptionZoomOverlayCancelButton&&(this.accessibilityDescriptionZoomOverlayCancelButton=e.accessibilityDescriptionZoomOverlayCancelButton),void 0!==e.accessibilityDescriptionReviewZoomButton&&(this.accessibilityDescriptionReviewZoomButton=e.accessibilityDescriptionReviewZoomButton),void 0!==e.accessibilityDescriptionReviewTopBarBackButton&&(this.accessibilityDescriptionReviewTopBarBackButton=e.accessibilityDescriptionReviewTopBarBackButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertConfirmButton&&(this.accessibilityDescriptionReviewDeletePageAlertConfirmButton=e.accessibilityDescriptionReviewDeletePageAlertConfirmButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton&&(this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton=e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertCancelButton&&(this.accessibilityDescriptionReviewDeletePageAlertCancelButton=e.accessibilityDescriptionReviewDeletePageAlertCancelButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton),void 0!==e.accessibilityDescriptionCameraLimitReachedOkButton&&(this.accessibilityDescriptionCameraLimitReachedOkButton=e.accessibilityDescriptionCameraLimitReachedOkButton),void 0!==e.accessibilityDescriptionCameraCancelYesButton&&(this.accessibilityDescriptionCameraCancelYesButton=e.accessibilityDescriptionCameraCancelYesButton),void 0!==e.accessibilityDescriptionCameraCancelNoButton&&(this.accessibilityDescriptionCameraCancelNoButton=e.accessibilityDescriptionCameraCancelNoButton)}}class De extends m.a{constructor(e={}){super(),this.topBarBackgroundColor="?sbColorPrimary",this.bottomBarBackgroundColor="?sbColorPrimary",void 0!==e.topBarBackgroundColor&&(this.topBarBackgroundColor=e.topBarBackgroundColor),void 0!==e.bottomBarBackgroundColor&&(this.bottomBarBackgroundColor=e.bottomBarBackgroundColor)}}class Le extends m.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new Z.Palette({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new Oe({}),this.appearance=new De({}),this.outputSettings=new Ee({}),this.screens=new ke({}),this.documentUuid=null,this.cleanScanningSession=!0,void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new Z.Palette(e.palette)),void 0!==e.localization&&(this.localization=new Oe(e.localization)),void 0!==e.appearance&&(this.appearance=new De(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new Ee(e.outputSettings)),void 0!==e.screens&&(this.screens=new ke(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}class Pe extends m.a{constructor(e={}){super(),this.flashButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new Z.RoundButton(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new Z.RoundButton(e.flipCameraButton))}}class _e extends m.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}class Re extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new _e({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new _e(e.idealPreviewResolution))}}class Fe extends m.a{constructor(e={}){super(),this.title=new Z.StyledText({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new Z.ButtonConfiguration({text:"Cancel",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new Z.ButtonConfiguration(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"j",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"i",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return f})),n.d(t,"h",(function(){return p}));var o,i=n(2),r=n(6);class a extends r.a{constructor(e={}){super(),this.image=new s({}),this.text=new i.StyledText({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=o.From(e.image)),void 0!==e.text&&(this.text=new i.StyledText(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"ReceiptsIntroImage":return new l(e);case"MedicalCertificateIntroImage":return new c(e);case"DocumentIntroImage":return new u(e);case"CheckIntroImage":return new d(e);case"IdCardIntroImage":return new h(e);case"CreditCardIntroImage":return new m(e);case"CustomImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class s extends r.a{constructor(e={}){super(),this._type="NoIntroImage"}}class l extends r.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class c extends r.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class u extends r.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class d extends r.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class h extends r.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class m extends r.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class f extends r.a{constructor(e={}){if(super(),this._type="CustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class p extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new i.ButtonConfiguration({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new i.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.ForegroundStyle({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new i.StyledText({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new i.StyledText({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new u({}),text:new i.StyledText({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({text:"?cameraIntroItem4",color:"?sbColorOnSurface"})})],void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.topBarDoneButton&&(this.topBarDoneButton=new i.ButtonConfiguration(e.topBarDoneButton)),void 0!==e.title&&(this.title=new i.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new i.StyledText(e.subtitle)),void 0!==e.items&&(this.items=e.items.map((e=>new a(e))))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{static initialize(e=!1){this.verbose=e}static debug(e){this.verbose&&console.log("ScanbotSDK:",e)}static debugWarn(e){this.verbose&&console.warn("ScanbotSDK:",e)}}},,,function(e,t,n){"use strict";n.r(t),n.d(t,"OcrResult",(function(){return r})),n.d(t,"FieldValidationStatusValues",(function(){return a})),n.d(t,"FieldDataFormatValues",(function(){return s})),n.d(t,"FieldParsedData",(function(){return l})),n.d(t,"FieldType",(function(){return c})),n.d(t,"Field",(function(){return u})),n.d(t,"GenericDocumentType",(function(){return d})),n.d(t,"GenericDocument",(function(){return h}));var o=n(39),i=n(7);class r extends i.a{constructor(e={}){if(super(),void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence}}const a=["INVALID","NONE","CONFIRMED","INFERRED","VALID","IGNORED"],s=["ISO_DATE","ISO_COUNTRY_ALPHA_2","ISO_COUNTRY_ALPHA_3","ISO_COUNTRY_NUMERIC","ISO_COUNTRY_NAME","GENDER"];class l extends i.a{constructor(e={}){if(super(),void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class c extends i.a{constructor(e={}){if(super(),this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=e.normalizedName,void 0===e.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=e.commonType&&o.CommonFieldTypeValues.includes(e.commonType)?e.commonType:null,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class u extends i.a{constructor(e={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new c(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new r(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0===e.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=e.polygonInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus),void 0!==e.parsedData&&(this.parsedData=e.parsedData.map((e=>new l(e))))}}class d extends i.a{constructor(e={}){if(super(),this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=e.normalizedName,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class h extends i.a{constructor(e={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new d(e.type),void 0===e.fields)throw new Error("fields must be present in constructor argument");if(this.fields=e.fields.map((e=>new u(e))),void 0===e.children)throw new Error("children must be present in constructor argument");if(this.children=e.children.map((e=>new h(e))),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=e.quadInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.crop&&(this.crop=null!=e.crop?e.crop:null),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LineSegmentInt",(function(){return i})),n.d(t,"LineSegmentFloat",(function(){return r})),n.d(t,"AspectRatio",(function(){return a}));var o=n(7);class i extends o.a{constructor(e={}){if(super(),void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class r extends o.a{constructor(e={}){if(super(),void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class a extends o.a{constructor(e={}){super(),this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var o=n(14),i=n(15),r=n(5);function a(){const e=new i.BarcodeScannerConfiguration;return e.viewFinder.overlayColor=Object(r.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(r.d)(e.viewFinder.style.strokeColor,e.palette),e.viewFinder}class s extends o.a{constructor(e){super(e),this.finder=a(),this.userGuidance=function(){const e=new i.BarcodeScannerConfiguration;return e.userGuidance.background.fillColor=Object(r.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(r.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(r.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,i;o.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),o.a.mapValuesDeep(null!==(i=t.userGuidance)&&void 0!==i?i:{},e.userGuidance)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(11);class i{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o}scaleDown(e){return new i(this.x/e,this.y/e,this.width/e,this.height/e)}bottom(){return this.y+this.height}size(){return new o.a(this.width,this.height)}static withSize(e,t){return new i(0,0,e,t)}static empty(){return new i(0,0,0,0)}static fromRect(e){return e?new i(e.x,e.y,e.width,e.height):i.empty()}static fromPoint(e,t){return new i(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new i(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),i=n(23),r=n(5),a=n(9);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,o,i;(null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)===(null===(n=e.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=e.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===e.configuration&&this.props.guidanceConfiguration===e.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var e;return null!==(e=this.holeCanvas.getBoundingClientRect())&&void 0!==e?e:new DOMRect},this.scaleForRetinaDisplay=e=>{if(window.devicePixelRatio>1){var t=e.width,n=e.height;e.width=t*window.devicePixelRatio,e.height=n*window.devicePixelRatio,e.style.width=t+"px",e.style.height=n+"px",e.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var e,t,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)&&void 0!==n?n:0),m=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>m?(this.holePosition.height=m,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(m-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const p=this.crosshairCanvas.getContext("2d");p.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),p.restore()},this.drawBackground=e=>{const{width:t,height:n}=this.getVideoSize();e.clearRect(0,0,t,n),e.beginPath(),e.rect(0,0,t,n),e.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),e.fill()},this.drawHole=()=>{const e=this.holeCanvas.getContext("2d"),t=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,o),e.arcTo(n+i,o,n+i,o+r,t),e.arcTo(n+i,o+r,n,o+r,t),e.arcTo(n,o+r,n,o,t),e.arcTo(n,o,n+i,o,t),e.closePath(),e.fill()},this.drawCrosshair=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;e.beginPath(),e.moveTo(t-10,n),e.lineTo(t+10,n),e.moveTo(t,n-10),e.lineTo(t,n+10),e.strokeStyle="white",e.fillStyle="white",e.lineWidth=1,e.stroke()},this.drawHoleCorners=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+o,n,l),e.lineTo(t+a,n),e.moveTo(t+o-a,n),e.arcTo(t+o,n,t+o,n+i,l),e.lineTo(t+o,n+a),e.moveTo(t+o,n+i-a),e.arcTo(t+o,n+i,t,n+i,l),e.lineTo(t+o-a,n+i),e.moveTo(t,n+i-a),e.arcTo(t,n+i,t+o,n+i,l),e.lineTo(t+a,n+i),e.strokeStyle=r.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.drawHoleOutline=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+o,n,t+o,n+i,a),e.moveTo(t+o,n+a),e.arcTo(t+o,n+i,t,n+i,a),e.moveTo(t+o-a,n+i),e.arcTo(t,n+i,t,n,a),e.moveTo(t,n+i-a),e.arcTo(t,n,t+o,n,a),e.strokeStyle=r.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:e=>{const t=this.holePosition;e.clientX>this.holePosition.x&&e.clientX<t.x+t.width&&e.clientY>t.y&&e.clientY<t.y+t.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},o.default.createElement("canvas",{ref:e=>{this.holeCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:e=>{this.crosshairCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.default.createElement("div",{ref:e=>{this.guidanceText=e},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},o.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var e,t;return this.holeRect.bottom()+(null!==(t=null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(0),i=n(13),r=n(27),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class s extends o.default.Component{constructor(e){super(e),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(e){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(e){var t,n;return a(this,void 0,void 0,(function*(){const o=this.props.preferredCamera;if(o)try{const t=(yield navigator.mediaDevices.enumerateDevices()).find((e=>e.deviceId===o||e.label===o));if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}catch(e){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(null===(t=null==e?void 0:e.facingMode)||void 0===t?void 0:t.ideal)||(null===(n=null==e?void 0:e.facingMode)||void 0===n?void 0:n.exact)||(null==e?void 0:e.facingMode);if("string"==typeof i&&i in o){yield r.a.INSTANCE.load();const t=r.a.INSTANCE.getMainCamera(o[i]);if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}}return e}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var e,t,n,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,i.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,e),void console.log(e)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(e);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(e){const t=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,t),void console.error(t)}}catch(e){const t=i.a.createFromDOMException(e);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,t),void console.error(t)}}))}stopCurrentStreams(){const e=this.state.stream,t=null==e?void 0:e.getTracks();t&&t.forEach((e=>{e.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((e=>e.stop())),this.state.stream.getAudioTracks().forEach((e=>e.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(e){return a(this,void 0,void 0,(function*(){const t=[{torch:e}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:t})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const e=this.getVideoTrack();return s.getMediaTrackCapabilities(e)}}static getMediaTrackCapabilities(e){if(e&&e.getCapabilities)return e.getCapabilities()}getVideoTrack(){const e=this.state.stream.getVideoTracks();if(e.length>0)return e[0]}}var l=n(11),c=n(23),u=n(17),d=n(37);class h{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const e=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),t=e.createTexture();e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);const n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),e.compileShader(n);const o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),e.compileShader(o);const i=this.program=e.createProgram();e.attachShader(i,n),e.attachShader(i,o),e.linkProgram(i),e.useProgram(i),e.uniform1i(e.getUniformLocation(i,"texture"),0),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0)}getImageData(e,t,n,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),e instanceof HTMLVideoElement)[c,l]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[e.width,e.height]}(c<t+o||l<n+i)&&u.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const m=[o/(r*c),i/(a*l)],f=[t/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),m),h.uniform2fv(h.getUniformLocation(this.program,"offset"),f),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,e),h.drawArrays(h.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class m{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(e,t,n,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(e,t,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var f=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class p extends o.default.Component{constructor(e){super(e),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=e=>{this.video.srcObject=e,this.updateCameraInfo(e),this.video.addEventListener("resize",(e=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(e=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:e,clientVideoHeight:t}=this.calculateClientVideoConstraints();return new l.a(e,t)}saveExtractedData(){this.save=!0}zoom(){var e;return null!==(e=this.props.zoom)&&void 0!==e?e:1}imageCapture(){if(this.capture)return this.capture;const e=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(e),this.capture}set reusableImageBuffer(e){this._reusableImageBuffer=e}createImageData(e=0,t){return f(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(t){const e=yield this.imageCapture().takePhoto(),t=yield createImageBitmap(e);u.a.debug("Bitmap size: "+t.width*t.height);const o=this.windowSize(),i=t.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=t.width/2-r/2,l=o.y*i,d=new c.a(s,l,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,t.width,t.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a);if(l.width<=0||l.height<=0)return;const d=this.zoom(),h=(o-r/d)/2,m=(i-a/d)/2,f=l.x/s+h,p=l.y/s+m,g=this.finderFrame?s:d,v=l.width/g,C=l.height/g,b=this.calculateFrameSize(e,v,C);return n.getImageData(this.video,f,p,v,C,b.width,b.height,this._reusableImageBuffer)}))}windowSize(){var e;const t=this.props.configuration,n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),o=e,i=t,r=1;return n.width/n.height<=e/t?(r=n.height/t,r>0&&(o=n.width/r)):(r=n.width/e,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(e,t,n){let o=t,i=n;if(e>0&&0!=t&&0!=n){const r=t/n;t>n?(o=t>e?e:t,i=o/r):(i=n>e?e:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new m,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var e;const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(e=this.props.configuration)||void 0===e?void 0:e.backgroundColor};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const e=this.zoom();return 1===e?0:(1-e)/2*100}render(){const{videoConstraints:e,onReady:t,onError:n}=this.props;return o.default.createElement(s,{videoConstraints:e,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:t,onStreamChanged:this.onStreamChanged,onError:n,ref:e=>{this.videoStream=e}},o.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:e=>{this.video=e},style:this.style()}))}setDirection(e){this.props.videoConstraints.facingMode={ideal:e},this.setState({facingModeBack:"environment"===e,mirrored:"user"===e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(e){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const t=!this.state.facingModeBack,n=t?"environment":"user";this.props.videoConstraints.facingMode=!0===e?{exact:n}:{ideal:n},this.setState({facingModeBack:t,mirrored:!t},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(e,t){return f(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=t?t:this.state.mirrored,deviceId:e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(e){this.activeCamera=r.a.getCameraInfoFromStream(e)}getActiveCameraInfo(){return this.activeCamera}setTorchState(e){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:e}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Qe}));var o=n(4),i=(n(51),n(0)),r=n(49),a=n.n(r),s=n(29),l=n(50),c="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",m="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,p=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function C(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var b=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A=/(^-|-$)/g;function S(e){return e.replace(y,"-").replace(A,"")}var w=/(a)(d)/gi,E=function(e){return String.fromCharCode(e+(e>25?39:97))};function x(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=E(t%52)+n;return(E(t%52)+n).replace(w,"$1-$2")}var B,I=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},T=function(e){return I(5381,e)};function k(e){return x(T(e)>>>0)}function O(e){return e.displayName||e.name||"Component"}function D(e){return"string"==typeof e&&!0}var L="function"==typeof Symbol&&Symbol.for,P=L?Symbol.for("react.memo"):60115,_=L?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},F={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},W=((B={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},B[P]=M,B);function N(e){return("type"in(t=e)&&t.type.$$typeof)===P?M:"$$typeof"in e?W[e.$$typeof]:R;var t}var V=Object.defineProperty,z=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,H=Object.getOwnPropertyDescriptor,U=Object.getPrototypeOf,Z=Object.prototype;function G(e,t,n){if("string"!=typeof t){if(Z){var o=U(t);o&&o!==Z&&G(e,o,n)}var i=z(t);j&&(i=i.concat(j(t)));for(var r=N(e),a=N(t),s=0;s<i.length;++s){var l=i[s];if(!(l in F||n&&n[l]||a&&l in a||r&&l in r)){var c=H(t,l);try{V(e,l,c)}catch(e){}}}}return e}function Q(e){return"function"==typeof e}function Y(e){return"object"==typeof e&&"styledComponentId"in e}function X(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function K(e,t){if(0===e.length)return"";for(var n=e[0],o=1;o<e.length;o++)n+=t?t+e[o]:e[o];return n}function q(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function J(e,t,n){if(void 0===n&&(n=!1),!n&&!q(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var o=0;o<t.length;o++)e[o]=J(e[o],t[o]);else if(q(t))for(var o in t)e[o]=J(e[o],t[o]);return e}function $(e,t){Object.defineProperty(e,"toString",{value:t})}function ee(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var te=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;e>=i;)if((i<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(e+1),s=(r=0,t.length);r<s;r++)this.tag.insertRule(a,t[r])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],o=this.indexOfGroup(e),i=o+n,r=o;r<i;r++)t+="".concat(this.tag.getRule(r)).concat(m);return t},e}(),ne=new Map,oe=new Map,ie=1,re=function(e){if(ne.has(e))return ne.get(e);for(;oe.has(ie);)ie++;var t=ie++;return ne.set(e,t),oe.set(t,e),t},ae=function(e,t){ie=t+1,ne.set(e,t),oe.set(t,e)},se="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),le=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ce=function(e,t,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&e.registerName(t,o)},ue=function(e,t){for(var n,o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(m),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(le);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(ae(u,c),ce(e,u,l[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function de(){return n.nc}var he=function(e){var t=document.head,n=e||t,o=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(c,"]")));return t[t.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=de();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},me=function(){function e(e){this.element=he(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,o=t.length;n<o;n++){var i=t[n];if(i.ownerNode===e)return i}throw ee(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),fe=function(){function e(e){this.element=he(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),pe=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ge=f,ve={isServer:!f,useCSSOMInjection:!p},Ce=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var i=this;this.options=Object(o.a)(Object(o.a)({},ve),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&f&&ge&&(ge=!1,function(e){for(var t=document.querySelectorAll(se),n=0,o=t.length;n<o;n++){var i=t[n];i&&i.getAttribute(c)!==u&&(ue(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,o="",i=function(n){var i=function(e){return oe.get(e)}(n);if(void 0===i)return"continue";var r=e.names.get(i),a=t.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(m)},r=0;r<n;r++)i(r);return o}(i)}))}return e.registerId=function(e){return re(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Object(o.a)(Object(o.a)({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new pe(n):t?new me(n):new fe(n)}(this.options),new te(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(re(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(re(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(re(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),be=/&/g,ye=/^\s*\/\/.*$/gm;function Ae(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ae(e.children,t)),e}))}function Se(e){var t,n,o,i=void 0===e?v:e,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(e,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},d=c.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(be,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(e,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),t=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(ye,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ae(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(e){return h.push(e)}))))),h};return h.hash=c.length?c.reduce((function(e,t){return t.name||ee(15),I(e,t.name)}),5381).toString():"",h}var we=new Ce,Ee=Se(),xe=i.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),Be=(xe.Consumer,i.default.createContext(void 0));function Ie(){return Object(i.useContext)(xe)}function Te(e){var t=Object(i.useState)(e.stylisPlugins),n=t[0],o=t[1],r=Ie().styleSheet,s=Object(i.useMemo)((function(){var t=r;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,r]),l=Object(i.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(i.useEffect)((function(){a()(n,e.stylisPlugins)||o(e.stylisPlugins)}),[e.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:l}}),[e.shouldForwardProp,s,l]);return i.default.createElement(xe.Provider,{value:c},i.default.createElement(Be.Provider,{value:l},e.children))}var ke=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ee);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$(this,(function(){throw ee(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Ee),this.name+e.hash},e}(),Oe=function(e){return e>="A"&&e<="Z"};function De(e){for(var t="",n=0;n<e.length;n++){var o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;Oe(o)?t+="-"+o.toLowerCase():t+=o}return t.startsWith("ms-")?"-"+t:t}var Le=function(e){return null==e||!1===e||""===e},Pe=function(e){var t,n,i=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Le(a)&&(Array.isArray(a)&&a.isCss||Q(a)?i.push("".concat(De(r),":"),a,";"):q(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Pe(a),!1),["}"],!1)):i.push("".concat(De(r),": ").concat((t=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in l.a||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function _e(e,t,n,o){return Le(e)?[]:Y(e)?[".".concat(e.styledComponentId)]:Q(e)?!Q(i=e)||i.prototype&&i.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,o):e instanceof ke?n?(e.inject(n,o),[e.getName(o)]):[e]:q(e)?Pe(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,o)}))):[e.toString()];var i}function Re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Q(n)&&!Y(n))return!1}return!0}var Fe=T(h),Me=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Re(e),this.componentId=t,this.baseHash=I(Fe,t),this.baseStyle=n,Ce.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=X(o,this.staticRulesId);else{var i=K(_e(this.rules,e,t,n)),r=x(I(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);t.insertRules(this.componentId,r,a)}o=X(o,r),this.staticRulesId=r}else{for(var s=I(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=K(_e(u,e,t,n));s=I(s,d+c),l+=d}}if(l){var h=x(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=X(o,h)}}return o},e}(),We=i.default.createContext(void 0);We.Consumer;var Ne={};new Set;function Ve(e,t,n){var r=Y(e),a=e,s=!D(e),l=t.attrs,c=void 0===l?g:l,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":S(e);Ne[n]=(Ne[n]||0)+1;var o="".concat(n,"-").concat(k(h+n+Ne[n]));return t?"".concat(t,"-").concat(o):o}(t.displayName,t.parentComponentId):u,m=t.displayName,f=void 0===m?function(e){return D(e)?"styled.".concat(e):"Styled(".concat(O(e),")")}(e):m,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,A=t.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;A=function(e,t){return w(e,t)&&E(e,t)}}else A=w}var x=new Me(n,p,r?a.componentStyle:void 0);function B(e,t){return function(e,t,n){var r=e.attrs,a=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,d=i.default.useContext(We),h=Ie(),m=e.shouldForwardProp||h.shouldForwardProp,f=C(t,d,s)||v,p=function(e,t,n){for(var i,r=Object(o.a)(Object(o.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Q(i=e[a])?i(r):i;for(var l in s)r[l]="className"===l?X(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return t.className&&(r.className=X(r.className,t.className)),r}(r,t,f),g=p.as||u,y={};for(var A in p)void 0===p[A]||"$"===A[0]||"as"===A||"theme"===A&&p.theme===f||("forwardedAs"===A?y.as=p.forwardedAs:m&&!m(A,g)||(y[A]=p[A]));var S=function(e,t){var n=Ie();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=X(l,c);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(I,e,t)}B.displayName=f;var I=i.default.forwardRef(B);return I.attrs=y,I.componentStyle=x,I.displayName=f,I.shouldForwardProp=A,I.foldedComponentIds=r?X(a.foldedComponentIds,a.styledComponentId):"",I.styledComponentId=p,I.target=r?a.target:e,Object.defineProperty(I,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var o=0,i=t;o<i.length;o++)J(e,i[o],!0);return e}({},a.defaultProps,e):e}}),$(I,(function(){return".".concat(I.styledComponentId)})),s&&G(I,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),I}function ze(e,t){for(var n=[e[0]],o=0,i=t.length;o<i;o+=1)n.push(t[o],e[o+1]);return n}var je=function(e){return Object.assign(e,{isCss:!0})};function He(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Q(e)||q(e))return je(_e(ze(g,Object(o.e)([e],t,!0))));var i=e;return 0===t.length&&1===i.length&&"string"==typeof i[0]?_e(i):je(_e(ze(i,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ue(e,t,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ue(e,t,Object(o.a)(Object(o.a)({},n),i))},i}var Ze=function(e){return Ue(Ve,e)},Ge=Ze;b.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),Ce.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,o){var i=o(K(_e(this.rules,t,n,o)),""),r=this.componentId+e;n.insertRules(r,r,i)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,o){e>2&&Ce.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,o)}}();function Qe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=K(He.apply(void 0,Object(o.e)([e],t,!1))),r=k(i);return new ke(r,i)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),o=K([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw ee(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw ee(2);var n=((t={})[c]="",t[d]=h,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=de();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ce({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return i.default.createElement(Te,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(c,"__")}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(13),i=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(e){if(e&&(this.strategy=e),"SLOW"===e||"FAST"===e){const t=e;this.load(t)}}load(e){return i(this,void 0,void 0,(function*(){if(!e)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)e="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)e="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let t;if("SLOW"===e)t=this.loadSlow();else{if("FAST"!==e)throw new Error(`Unknown mode ${e}`);t=this.loadFast()}try{return this.listOfCameras=yield t,this.listOfCameras}catch(e){throw this.loadSlowResult=void 0,o.a.createFromDOMException(e)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:t.deviceId}}),e.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(t.label),o=r.guessparseCameraLabelMaxNumPixels(t.label);e.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:t.deviceId,label:t.label})}return e})))(),this.loadFastResult}getMainCamera(e){var t,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=null===(n=null===(t=this.listOfCameras)||void 0===t?void 0:t.filter((t=>t.facingMode===e)))||void 0===n?void 0:n.map(((e,t)=>({camera:e,index:t}))))||void 0===o?void 0:o.sort(((e,t)=>{var n;return-(+e.camera.supportsTorchControl||0)-(+t.camera.supportsTorchControl||0)||-((e.camera.maxNumPixels||0)-(t.camera.maxNumPixels||0))||(null===(n=e.camera.label)||void 0===n?void 0:n.localeCompare(t.camera.label))||e.index-t.index})))||void 0===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(this,void 0,void 0,(function*(){let e=yield navigator.mediaDevices.enumerateDevices();if(e=e.filter((e=>"videoinput"===e.kind)),e.some((e=>""===e.label))){let t;try{t=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),e=yield navigator.mediaDevices.enumerateDevices(),e=e.filter((e=>"videoinput"===e.kind))}finally{this.stopStream(t)}}return e}))}stopStream(e){null==e||e.getTracks().forEach((e=>e.stop()))}static guessparseCameraLabelFacingMode(e){return function(e){const t=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of t)if(e.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(e)?"back":"front"}static guessparseCameraLabelMaxNumPixels(e){const t=RegExp(/\b([0-9]+)mp?\b/).exec(e.toLowerCase()),n=t?1e6*parseInt(t[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(e){var t;return null===(t=e.getVideoTracks().map((e=>{var t,n,o,i,r,a;const s=null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e),l=null===(n=e.getSettings)||void 0===n?void 0:n.call(e),c=e.label;let u=function(e){if("user"===(null==e?void 0:e.toLowerCase()))return"front";if("environment"===(null==e?void 0:e.toLowerCase()))return"back";return"unknown"}(null!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(e){var t,n;let o=(null===(t=null==e?void 0:e.width)||void 0===t?void 0:t.max)*(null===(n=null==e?void 0:e.height)||void 0===n?void 0:n.max);if(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(e)}catch(e){throw o.a.mediaDeviceNotFound()}}))}}},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&e.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(o=function(){return i}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return G})),n.d(t,"c",(function(){return ee})),n.d(t,"d",(function(){return ne})),n.d(t,"e",(function(){return te})),n.d(t,"f",(function(){return J})),n.d(t,"g",(function(){return $}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function m(e){return e.trim()}function f(e,t){return(e=t.exec(e))?e[0]:e}function p(e,t,n){return e.replace(t,n)}function g(e,t,n){return e.indexOf(t,n)}function v(e,t){return 0|e.charCodeAt(t)}function C(e,t,n){return e.slice(t,n)}function b(e){return e.length}function y(e){return e.length}function A(e,t){return t.push(e),e}function S(e,t){return e.map(t).join("")}function w(e,t){return e.filter((function(e){return!f(e,t)}))}var E=1,x=1,B=0,I=0,T=0,k="";function O(e,t,n,o,i,r,a,s){return{value:e,root:t,parent:n,type:o,props:i,children:r,line:E,column:x,length:a,return:"",siblings:s}}function D(e,t){return h(O("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=D(e.root,{children:[e]});A(e,e.siblings)}function P(){return T=I<B?v(k,I++):0,x++,10===T&&(x=1,E++),T}function _(){return v(k,I)}function R(){return I}function F(e,t){return C(k,e,t)}function M(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function W(e){return E=x=1,B=b(k=e),I=0,[]}function N(e){return k="",e}function V(e){return m(F(I-1,H(91===e?e+2:40===e?e+1:e)))}function z(e){for(;(T=_())&&T<33;)P();return M(e)>2||M(T)>3?"":" "}function j(e,t){for(;--t&&P()&&!(T<48||T>102||T>57&&T<65||T>70&&T<97););return F(e,R()+(t<6&&32==_()&&32==P()))}function H(e){for(;P();)switch(T){case e:return I;case 34:case 39:34!==e&&39!==e&&H(T);break;case 40:41===e&&H(e);break;case 92:P()}return I}function U(e,t){for(;P()&&e+T!==57&&(e+T!==84||47!==_()););return"/*"+F(t,I-1)+"*"+d(47===e?e:P())}function Z(e){for(;!M(_());)P();return F(e,I)}function G(e){return N(Q("",null,null,null,[""],e=W(e),0,[0],e))}function Q(e,t,n,o,i,r,a,s,l){for(var c=0,h=0,m=a,f=0,C=0,y=0,S=1,w=1,B=1,O=0,D="",L=i,F=r,M=o,W=D;w;)switch(y=O,O=P()){case 40:if(108!=y&&58==v(W,m-1)){-1!=g(W+=p(V(O),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(B=-1);break}case 34:case 39:case 91:W+=V(O);break;case 9:case 10:case 13:case 32:W+=z(y);break;case 92:W+=j(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(X(U(P(),R()),t,n,l),l);break;default:W+="/"}break;case 123*S:s[c++]=b(W)*B;case 125*S:case 59:case 0:switch(O){case 0:case 125:w=0;case 59+h:-1==B&&(W=p(W,/\f/g,"")),C>0&&b(W)-m&&A(C>32?K(W+";",o,n,m-1,l):K(p(W," ","")+";",o,n,m-2,l),l);break;case 59:W+=";";default:if(A(M=Y(W,t,n,c,h,i,s,D,L=[],F=[],m,r),r),123===O)if(0===h)Q(W,t,M,M,L,r,m,s,F);else switch(99===f&&110===v(W,3)?100:f){case 100:case 108:case 109:case 115:Q(e,M,M,o&&A(Y(e,M,M,0,0,i,s,D,i,L=[],m,F),F),i,F,m,s,o?L:F);break;default:Q(W,M,M,M,[""],F,0,s,F)}}c=h=C=0,S=B=1,D=W="",m=a;break;case 58:m=1+b(W),C=y;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==(T=I>0?v(k,--I):0,x--,10===T&&(x=1,E--),T))continue;switch(W+=d(O),O*S){case 38:B=h>0?1:(W+="\f",-1);break;case 44:s[c++]=(b(W)-1)*B,B=1;break;case 64:45===_()&&(W+=V(P())),f=_(),h=m=b(D=W+=Z(R())),O++;break;case 45:45===y&&2==b(W)&&(S=0)}}return r}function Y(e,t,n,o,i,r,a,l,c,d,h,f){for(var g=i-1,v=0===i?r:[""],b=y(v),A=0,S=0,w=0;A<o;++A)for(var E=0,x=C(e,g+1,g=u(S=a[A])),B=e;E<b;++E)(B=m(S>0?v[E]+" "+x:p(x,/&\f/g,v[E])))&&(c[w++]=B);return O(e,t,n,0===i?s:l,c,d,h,f)}function X(e,t,n,o){return O(e,t,n,a,d(T),C(e,2,-2),0,o)}function K(e,t,n,o,i){return O(e,t,n,l,C(e,0,o),C(e,o+1,-1),o,i)}function q(e,t,n){switch(function(e,t){return 45^v(e,0)?(((t<<2^v(e,0))<<2^v(e,1))<<2^v(e,2))<<2^v(e,3):0}(e,t)){case 5103:return r+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+e+e;case 4789:return i+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r+e+i+e+o+e+e;case 5936:switch(v(e,t+11)){case 114:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return r+e+o+e+e;case 6165:return r+e+o+"flex-"+e+e;case 5187:return r+e+p(e,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+e;case 5443:return r+e+o+"flex-item-"+p(e,/flex-|-self/g,"")+(f(e,/flex-|baseline/)?"":o+"grid-row-"+p(e,/flex-|-self/g,""))+e;case 4675:return r+e+o+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return r+e+o+p(e,"shrink","negative")+e;case 5292:return r+e+o+p(e,"basis","preferred-size")+e;case 6060:return r+"box-"+p(e,"-grow","")+r+e+o+p(e,"grow","positive")+e;case 4554:return r+p(e,/([^-])(transform)/g,"$1"+r+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+e+e;case 4200:if(!f(e,/flex-|baseline/))return o+"grid-column-align"+C(e,t)+e;break;case 2592:case 3360:return o+p(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,f(e.props,/grid-\w+-end/)}))?~g(e+(n=n[t].value),"span",0)?e:o+p(e,"-start","")+e+o+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(e,/\d+/))+";":o+p(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return f(e.props,/grid-\w+-start/)}))?e:o+p(p(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,r+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch",0)?q(p(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return p(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+r)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(e,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+e;case 100:return p(e,":",":"+o)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return p(e,"scroll-","scroll-snap-")+e}return e}function J(e,t){for(var n="",o=0;o<e.length;o++)n+=t(e[o],o,e,t)||"";return n}function $(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case l:return e.return=e.return||e.value;case a:return"";case c:return e.return=e.value+"{"+J(e.children,o)+"}";case s:if(!b(e.value=e.props.join(",")))return""}return b(n=J(e.children,o))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=y(e);return function(n,o,i,r){for(var a="",s=0;s<t;s++)a+=e[s](n,o,i,r)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case l:return void(e.return=q(e.value,e.length,n));case c:return J([D(e,{value:p(e.value,"@","@"+r)})],i);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(D(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),L(D(e,{props:[t]})),h(e,{props:w(n,i)});break;case"::placeholder":L(D(e,{props:[p(t,/:(plac\w+)/,":"+r+"input-$1")]})),L(D(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),L(D(e,{props:[p(t,/:(plac\w+)/,o+"input-$1")]})),L(D(e,{props:[t]})),h(e,{props:w(n,i)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new o.j(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new o.c(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.visible=!0,this.title=new o.j({color:"?sbColorOnPrimary"}),this.background=new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new o.j(e.title)),void 0!==e.background&&(this.background=new o.a(e.background))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var o=n(8);function i(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t,n){return new o.a(i(e.x,-t/2,n.width-t/2),i(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";n.r(t),n.d(t,"OutputModeValues",(function(){return i})),n.d(t,"BinarizationFilterPresetValues",(function(){return r})),n.d(t,"ParametricFilter",(function(){return a})),n.d(t,"ScanbotBinarizationFilter",(function(){return s})),n.d(t,"CustomBinarizationFilter",(function(){return l})),n.d(t,"ColorDocumentFilter",(function(){return c})),n.d(t,"BrightnessFilter",(function(){return u})),n.d(t,"ContrastFilter",(function(){return d})),n.d(t,"GrayscaleFilter",(function(){return h})),n.d(t,"LegacyFilter",(function(){return m})),n.d(t,"WhiteBlackPointFilter",(function(){return f}));var o=n(7);const i=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new s(e);case"CustomBinarizationFilter":return new l(e);case"ColorDocumentFilter":return new c(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new d(e);case"GrayscaleFilter":return new h(e);case"LegacyFilter":return new m(e);case"WhiteBlackPointFilter":return new f(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s extends o.a{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class l extends o.a{constructor(e={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class c extends o.a{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class u extends o.a{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class d extends o.a{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class h extends o.a{constructor(e={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class m extends o.a{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class f extends o.a{constructor(e={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(t,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(t,"BarcodeFormatCodabarConfiguration",(function(){return a})),n.d(t,"BarcodeFormatCode11Configuration",(function(){return s})),n.d(t,"BarcodeFormatCode39Configuration",(function(){return l})),n.d(t,"BarcodeFormatCode93Configuration",(function(){return c})),n.d(t,"BarcodeFormatCode128Configuration",(function(){return u})),n.d(t,"BarcodeFormatCode2Of5Configuration",(function(){return d})),n.d(t,"BarcodeFormatDataBarConfiguration",(function(){return h})),n.d(t,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(t,"BarcodeFormatDataBarLimitedConfiguration",(function(){return f})),n.d(t,"BarcodeFormatItfConfiguration",(function(){return p})),n.d(t,"MsiPlesseyChecksumAlgorithmValues",(function(){return g})),n.d(t,"BarcodeFormatMsiPlesseyConfiguration",(function(){return v})),n.d(t,"BarcodeFormatUpcEanConfiguration",(function(){return C})),n.d(t,"BarcodeFormatPharmaCodeConfiguration",(function(){return b})),n.d(t,"BarcodeFormatTwoDConfigurationBase",(function(){return y})),n.d(t,"BarcodeFormatAztecConfiguration",(function(){return S})),n.d(t,"BarcodeFormatQrCodeConfiguration",(function(){return w})),n.d(t,"BarcodeFormatPdf417Configuration",(function(){return E})),n.d(t,"BarcodeFormatMicroPdf417Configuration",(function(){return x})),n.d(t,"BarcodeFormatDataMatrixConfiguration",(function(){return B})),n.d(t,"BarcodeFormatMaxiCodeConfiguration",(function(){return I})),n.d(t,"BarcodeFormatFourStateConfigurationBase",(function(){return A})),n.d(t,"AustraliaPostCustomerFormatValues",(function(){return T})),n.d(t,"BarcodeFormatAustraliaPostConfiguration",(function(){return k})),n.d(t,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(t,"BarcodeFormatRoyalMailConfiguration",(function(){return D})),n.d(t,"BarcodeFormatRoyalTntPostConfiguration",(function(){return L})),n.d(t,"BarcodeFormatUspsIntelligentMailConfiguration",(function(){return P})),n.d(t,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return _})),n.d(t,"BarcodeFormatGs1CompositeConfiguration",(function(){return R})),n.d(t,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(t,"BarcodeFormatCommonTwoDConfiguration",(function(){return M})),n.d(t,"BarcodeFormatCommonFourStateConfiguration",(function(){return W})),n.d(t,"BarcodeFormatCommonConfiguration",(function(){return N}));var o,i,r=n(7);!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new l(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new h(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new b(e);case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new B(e);case"BarcodeFormatMaxiCodeConfiguration":return new I(e);case"BarcodeFormatAustraliaPostConfiguration":return new k(e);case"BarcodeFormatJapanPostConfiguration":return new O(e);case"BarcodeFormatRoyalMailConfiguration":return new D(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);case"BarcodeFormatGS1CompositeConfiguration":return new R(e);case"BarcodeFormatCommonOneDConfiguration":return new F(e);case"BarcodeFormatCommonTwoDConfiguration":return new M(e);case"BarcodeFormatCommonFourStateConfiguration":return new W(e);case"BarcodeFormatCommonConfiguration":return new N(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new l(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new h(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new b(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class a extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class s extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class l extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn&&(this.pzn=e.pzn),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class c extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class u extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class d extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class h extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class m extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class f extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class p extends r.a{constructor(e={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}const g=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class v extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class C extends r.a{constructor(e={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="ALLOW_ANY",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class b extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}var y,A;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new B(e);case"BarcodeFormatMaxiCodeConfiguration":return new I(e);default:throw`Unknown child class name: ${t}`}}}(y||(y={}));class S extends r.a{constructor(e={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class w extends r.a{constructor(e={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class E extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class x extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class B extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class I extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAustraliaPostConfiguration":return new k(e);case"BarcodeFormatJapanPostConfiguration":return new O(e);case"BarcodeFormatRoyalMailConfiguration":return new D(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);default:throw`Unknown child class name: ${t}`}}}(A||(A={}));const T=["NUMERIC","ALPHA_NUMERIC"];class k extends r.a{constructor(e={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class O extends r.a{constructor(e={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class D extends r.a{constructor(e={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class L extends r.a{constructor(e={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class P extends r.a{constructor(e={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class _ extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class R extends r.a{constructor(e={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class F extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class M extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class W extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}},function(e,t,n){"use strict";(function(e){function o(e,t=!1){const n=[];if(t)return n;return function e(t){if(t)if(t.constructor===ImageData)n.push(t.data.buffer);else if(t.constructor===ArrayBuffer)n.push(t);else if(ArrayBuffer.isView(t))n.push(t.buffer);else if(Array.isArray(t))for(let n=0;n<t.length;++n)e(t[n]);else if(t.constructor===Object)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function i(e){return e.startsWith("http:")||e.startsWith("https:")}function r(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}function a(e){const{allowSimd:t=!0,allowThreads:n=!0}=e||{};let o="";if(t&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a}))}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeItem",(function(){return a})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return s})),n.d(t,"BarcodeScannerConfiguration",(function(){return l})),n.d(t,"BarcodeScannerResult",(function(){return c}));var o=n(35),i=n(7),r=n(20);class a extends i.a{constructor(e={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0!==e.format&&(this.format=e.format),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");if(this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y}))),void 0!==e.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?e.sourceImage:null),void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,void 0===e.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=e.upcEanExtension,void 0!==e.isGS1Message&&(this.isGS1Message=e.isGS1Message),void 0!==e.isGS1CompositePart&&(this.isGS1CompositePart=e.isGS1CompositePart),void 0!==e.dataBarStackSize&&(this.dataBarStackSize=e.dataBarStackSize),void 0!==e.sizeScore&&(this.sizeScore=e.sizeScore),void 0===e.extractedDocument)throw new Error("extractedDocument must be present in constructor argument");this.extractedDocument=null!=e.extractedDocument?new r.GenericDocument(e.extractedDocument):null}}const s=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_AR","NEXT_GEN_AR"];class l extends i.a{constructor(e={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,void 0!==e.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=e.barcodeFormatConfigurations.map((e=>o.BarcodeFormatConfigurationBase.From(e)))),void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.live&&(this.live=e.live)}}class c extends i.a{constructor(e={}){if(super(),void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new a(e))),void 0===e.success)throw new Error("success must be present in constructor argument");this.success=e.success}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CommonFieldTypeValues",(function(){return o}));const o=["ID","SURNAME","MAIDEN_NAME","GIVEN_NAMES","BIRTH_DATE","NATIONALITY","BIRTHPLACE","EXPIRY_DATE","EYE_COLOR","HEIGHT","ISSUE_DATE","ISSUING_AUTHORITY","ADDRESS","PSEUDONYM","MRZ","COUNTRY_CODE","GENDER","SIGNATURE","PHOTO","VALID_FROM_DATE","ROUTING_NUMBER","ACCOUNT_NUMBER","PLACE_OF_ISSUE","TITLE_TYPE","REMARKS","NAME","CARD_ACCESS_NUMBER"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(e,t,n){Object.keys(e).forEach((o=>{(null==n?void 0:n.includes(o))||(t[o]=e[o])}))}static mapValuesDeep(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e);Object.keys(e).forEach((i=>{i in t&&n(e[i])&&n(t[i])?o.mapValuesDeep(e[i],t[i]):t[i]=e[i]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var o=n(34);n.d(t,"a",(function(){return o.ParametricFilter}))},function(e,t,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var e={};return function(t){if("undefined"==typeof e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},o=[],i=0;i<e.length;i++){var r=e[i],l=t.base?r[0]+t.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,t),references:1}),o.push(u)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var a=r(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function h(e,t,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function m(e,t,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var f=null,p=0;function g(e,t){var n,o,i;if(t.singleton){var r=p++;n=f||(f=c(t)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(t),o=m.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(e,t),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){"use strict";var o={};n.r(o),n.d(o,"BarcodeFormatValues",(function(){return X})),n.d(o,"BarcodeFormats",(function(){return K})),n.d(o,"Gs1HandlingValues",(function(){return J})),n.d(o,"UpcEanExtensionBehaviorValues",(function(){return $}));var i={};n.r(i),n.d(i,"BarcodeDocumentFormatValues",(function(){return ee})),n.d(i,"BarcodeDocumentFormats",(function(){return te}));var r={};n.r(r),n.d(r,"DocumentScannerEngineModeValues",(function(){return ie})),n.d(r,"DocumentScannerParameters",(function(){return re})),n.d(r,"DocumentScannerConfiguration",(function(){return ae})),n.d(r,"DocumentDetectionStatusValues",(function(){return se})),n.d(r,"DocumentDetectionScores",(function(){return le})),n.d(r,"DocumentDetectionResult",(function(){return ce}));var a={};n.r(a),n.d(a,"CheckDocumentDetectionModeValues",(function(){return de})),n.d(a,"CheckRecognitionStatusValues",(function(){return he})),n.d(a,"CheckScanningResult",(function(){return me})),n.d(a,"CheckScannerConfiguration",(function(){return fe}));var s={};n.r(s),n.d(s,"DocumentQualityValues",(function(){return ge})),n.d(s,"DocumentQualityThreshold",(function(){return ve})),n.d(s,"DocumentQualityAnalyzerConfiguration",(function(){return Ce})),n.d(s,"DocumentQualityAnalyzerResult",(function(){return be}));var l={};n.r(l),n.d(l,"EuropeanHealthInsuranceCardRecognitionResult",(function(){return ye})),n.d(l,"EuropeanHealthInsuranceCardRecognizerConfiguration",(function(){return Ae}));var c={};n.r(c),n.d(c,"DocumentDataExtractorConfigurationElement",(function(){return Se})),n.d(c,"DateValidationConfiguration",(function(){return we})),n.d(c,"EuropeanHealthInsuranceCardIssuingCountryValues",(function(){return Ee})),n.d(c,"EuropeanHealthInsuranceCardConfiguration",(function(){return xe})),n.d(c,"MrzFallbackConfiguration",(function(){return Be})),n.d(c,"DocumentDataExtractorCommonConfiguration",(function(){return Ie}));var u={};n.r(u),n.d(u,"ConfirmationMethodValues",(function(){return Te})),n.d(u,"ResultAccumulationConfiguration",(function(){return ke})),n.d(u,"AccumulatedResultsVerifierConfiguration",(function(){return Oe}));var d={};n.r(d),n.d(d,"DocumentDataExtractionStatusValues",(function(){return De})),n.d(d,"DocumentDataExtractionResult",(function(){return Le})),n.d(d,"DocumentDataExtractionModeValues",(function(){return Pe})),n.d(d,"DocumentDataFrameExtractionParameters",(function(){return _e})),n.d(d,"DocumentDataExtractorConfiguration",(function(){return Re}));var h={};n.r(h),n.d(h,"WordBox",(function(){return Fe})),n.d(h,"SymbolBox",(function(){return Me})),n.d(h,"TextPatternScannerResult",(function(){return We})),n.d(h,"ValidatorPresetValues",(function(){return Ne})),n.d(h,"ContentValidator",(function(){return Ve})),n.d(h,"DefaultContentValidator",(function(){return ze})),n.d(h,"PresetContentValidator",(function(){return je})),n.d(h,"PatternContentValidator",(function(){return He})),n.d(h,"TextPatternScannerConfiguration",(function(){return Ue}));var m={};n.r(m),n.d(m,"LicensePlateScannerStrategyValues",(function(){return Ze})),n.d(m,"LicensePlateScannerConfiguration",(function(){return Ge})),n.d(m,"LicensePlateScannerResult",(function(){return Qe}));var f={};n.r(f),n.d(f,"MedicalCertificateScanningParameters",(function(){return Ye})),n.d(f,"MedicalCertificateCheckBoxTypeValues",(function(){return Xe})),n.d(f,"MedicalCertificateCheckBox",(function(){return Ke})),n.d(f,"MedicalCertificateDateRecordTypeValues",(function(){return qe})),n.d(f,"MedicalCertificateDateRecord",(function(){return Je})),n.d(f,"MedicalCertificatePatientInfoFieldTypeValues",(function(){return $e})),n.d(f,"MedicalCertificatePatientInfoField",(function(){return et})),n.d(f,"MedicalCertificatePatientInfoBox",(function(){return tt})),n.d(f,"MedicalCertificateFormTypeValues",(function(){return nt})),n.d(f,"MedicalCertificateScanningResult",(function(){return ot}));var p={};n.r(p),n.d(p,"MrzDocumentTypeValues",(function(){return it})),n.d(p,"MrzScannerResult",(function(){return rt})),n.d(p,"MrzIncompleteResultHandlingValues",(function(){return at})),n.d(p,"MrzScannerConfiguration",(function(){return st}));var g={};n.r(g),n.d(g,"OcrElement",(function(){return lt})),n.d(g,"Glyph",(function(){return ct})),n.d(g,"Word",(function(){return ut})),n.d(g,"Line",(function(){return dt})),n.d(g,"Block",(function(){return ht})),n.d(g,"Page",(function(){return mt}));var v={};n.r(v),n.d(v,"PdfAttributes",(function(){return pt})),n.d(v,"PageSizeValues",(function(){return gt})),n.d(v,"PageDirectionValues",(function(){return vt})),n.d(v,"PageFitValues",(function(){return Ct})),n.d(v,"ResamplingMethodValues",(function(){return bt})),n.d(v,"PdfConfiguration",(function(){return yt}));var C={};n.r(C),n.d(C,"CompressionModeValues",(function(){return At})),n.d(C,"BinarizationValues",(function(){return St})),n.d(C,"UserFieldValue",(function(){return wt})),n.d(C,"UserFieldDoubleValue",(function(){return xt})),n.d(C,"UserFieldStringValue",(function(){return Bt})),n.d(C,"UserFieldIntValue",(function(){return It})),n.d(C,"UserField",(function(){return Tt})),n.d(C,"TiffWriterParameters",(function(){return kt}));var b={};n.r(b),n.d(b,"ImageRotationValues",(function(){return Ot}));var y={};n.r(y),n.d(y,"BarcodeConfigurationTypes",(function(){return G})),n.d(y,"BarcodeScannerTypes",(function(){return Q})),n.d(y,"BarcodeTypes",(function(){return o})),n.d(y,"BarcodeDocumentTypes",(function(){return i})),n.d(y,"CheckScannerTypes",(function(){return a})),n.d(y,"CommonFieldType",(function(){return pe})),n.d(y,"DocumentScannerTypes",(function(){return r})),n.d(y,"DocumentQualityAnalyzerTypes",(function(){return s})),n.d(y,"EuropeanHealthInsuranceCardTypes",(function(){return l})),n.d(y,"GenericDocument",(function(){return ue})),n.d(y,"DocumentDataExtractorConfigurationTypes",(function(){return c})),n.d(y,"DocumentDataExtractorTypes",(function(){return d})),n.d(y,"TextPatternScannerTypes",(function(){return h})),n.d(y,"Geometry",(function(){return oe})),n.d(y,"LicensePlateScannerTypes",(function(){return m})),n.d(y,"MedicalCertificateTypes",(function(){return f})),n.d(y,"MrzTypes",(function(){return p})),n.d(y,"OcrTypes",(function(){return g})),n.d(y,"ParametricFilters",(function(){return ft})),n.d(y,"PdfConfigurationTypes",(function(){return v})),n.d(y,"TiffTypes",(function(){return C})),n.d(y,"FrameAccumulationTypes",(function(){return u})),n.d(y,"ImageTypes",(function(){return b})),n.d(y,"PartiallyConstructible",(function(){return Y.a}));class A{}A.VERSION="7.0.0-dev.1",A.BUILD_WITH_UI=!1;var S=n(36);class w{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,o)=>(...t)=>this.post(n,t,e)}),this.handleUnrecoverableError=e=>{this.errorInWorker=e;for(const t in this.continuations)this.continuations[t].reject(e),delete this.continuations[t]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=t||{},o=Object(S.c)(t),i=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(S.d)(i)){const e=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(i);this.continuations={},this.nextTicketId=1,this.instance.onmessage=e=>{const{log:t,logError:n}=e.data;if(t)return void console.log(...t);if(n)return void console.error(...n);const{ticket:o,result:i,recoverableError:r,unrecoverableError:a}=e.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const r=Object(S.b)(t,"copy"==n),a=this.nextTicketId++;this.continuations[a]={resolve:o,reject:i},this.instance.postMessage({command:e,args:t,ticket:a},r)}))}destroy(){this.instance.terminate()}}var E=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class x extends Error{}class B extends Error{}class I{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new w(e,t),this.coreInitializationSuccessful=(()=>E(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const n=A.VERSION;return t!==n?new B(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${t}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`):"OK"}return new x("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return E(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,o)=>(...t)=>E(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===e?o.copyArgs:o.transferArgs;return yield i[n](...t)}))})}getCoreForCommand(e=""){return E(this,void 0,void 0,(function*(){const t=yield this.coreInitializationSuccessful;if("OK"===t||"getLicenseInfo"===e&&t instanceof x)return this.core;throw t}))}destroy(){this.core.destroy(),this.core=void 0}}class T{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(e){const t=new T;return t.status=e.licenseStatus,t.description=e.description,t}}var k=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class O{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return k(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE"}=t,o=this._sdk.getBridge(n);yield o.addPageToPdf(this._pdfOperation,e)}))}addPages(e){return k(this,void 0,void 0,(function*(){for(const t of e.pages){const e=yield t.finalRawImage();yield this.addPage(e)}}))}complete(){return k(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var D=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class L{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return D(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=t,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return D(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return D(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var P=n(23);class _{static toPixelSize(e){return e+"px"}static containsString(e,t){return!!e&&-1!==e.indexOf(t)}static copy(e){return JSON.parse(JSON.stringify(e))}static getProperty(e,t){if(e&&e.hasOwnProperty(t))return e[t]}static uuid(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let o=0;o<5;o++)e+=t.charAt(Math.floor(Math.random()*n));return e}}var R=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class F{static toDataUrl(e){return new Promise(((t,n)=>{const o=new Blob([e],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>t(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(e,t,n=!0){const o=t.width/t.height,i=e.width/e.height;let r=0,a=0;(n?o>i:o<i)?(r=e.width,a=r/o):(a=e.height,r=a*o);const s=(e.width-r)/2,l=(e.height-a)/2;return new P.a(s,l,r,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const o=document.createElement("img");o.src=e,o.onload=()=>R(this,void 0,void 0,(function*(){const e=document.createElement("canvas");e.width=o.width,e.height=o.height;const n=e.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);t(i)})),o.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,_.uuid()+n+".png")))}static createImageDataCanvas(e){const t=document.createElement("canvas");return t.className="scanbot-sdk-canvas-element",t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}static saveBlob(e,t){let n=document.createElement("a");n.setAttribute("download",t);let o=URL.createObjectURL(e);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(e){if(e)return new ImageData(e.data,e.width,e.height)}static wrapperToBase64(e){return F.createImageDataCanvas(F.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return R(this,void 0,void 0,(function*(){const n=yield new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsDataURL(new Blob([e]))}));return t?n.slice(n.indexOf(",")+1):n}))}}class M{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=_.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});F.saveBlob(n,t)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let e=this.findFlashElement();e.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{e.style.opacity="1.0",e.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(e,t){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=e,t()}),150)}getOrCreateElement(e,t){let n=this.getElementByClassName(e);return n||(this.createElement(e,t),n=this.getElementByClassName(e)),n}createElement(e,t){let n=document.createElement("div");n.className=e,n.style.cssText=this.cssToString(t),document.body.append(n)}cssToString(e){let t="";return Object.keys(e).forEach((n=>{t+=n+":"+e[n]+";"})),t}getElementByClassName(e){const t=document.getElementsByClassName(e);if(0!==t.length)return t[0]}}var W=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class N{constructor(e,t){this._sdk=e,this._mrzRecognizerToken=t}recognize(e,t="COPY_IMAGE"){return W(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanMRZ(yield this._mrzRecognizerToken,e)}))}recognizeURL(e){return W(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>W(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);t(r||void 0)}))}))}))}release(){return W(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var V=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class z{constructor(e,t){this._sdk=e,this._OcrEngineToken=t}performOcr(e,t="COPY_IMAGE"){return V(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.performOcr(this._OcrEngineToken,e)}))}recognizeURL(e){return V(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>V(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);t(r)}))}))}))}release(){return V(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var j=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class H{constructor(e,t){this._sdk=e,this._textPatternScannerToken=t}recognize(e,t="COPY_IMAGE"){return j(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanTextLine(yield this._textPatternScannerToken,e)}))}cleanRecognitionQueue(){return j(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineScanningQueue(yield this._textPatternScannerToken)}))}recognizeURL(e){return j(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>j(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&t(r)}))}))}))}release(){return j(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textPatternScannerToken)}))}}var U=n(14),Z=n(22),G=n(35),Q=n(38),Y=n(7);const X=["NONE","AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","EAN_8","EAN_13","ITF","MAXI_CODE","PDF_417","QR_CODE","DATABAR","DATABAR_EXPANDED","UPC_A","UPC_E","MSI_PLESSEY","IATA_2_OF_5","INDUSTRIAL_2_OF_5","CODE_25","MICRO_QR_CODE","USPS_INTELLIGENT_MAIL","ROYAL_MAIL","JAPAN_POST","ROYAL_TNT_POST","AUSTRALIA_POST","DATABAR_LIMITED","MICRO_PDF_417","GS1_COMPOSITE","RMQR_CODE","CODE_11","CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"];class K extends Y.a{constructor(e={}){super()}}var q;(q=K||(K={})).oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],q.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],q.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],q.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],q.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],q.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXI_CODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];const J=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],$=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"],ee=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class te extends Y.a{constructor(e={}){super()}}var ne;(ne=te||(te={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],ne.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]};var oe=n(21);const ie=["ML","LEGACY"];class re extends Y.a{constructor(e={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.isLive&&(this.isLive=e.isLive),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=e.acceptedAspectRatioScore),void 0!==e.aspectRatios&&(this.aspectRatios=e.aspectRatios.map((e=>new oe.AspectRatio(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class ae extends Y.a{constructor(e={}){super(),this.engineMode="ML",this.parameters=new re({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.parameters&&(this.parameters=new re(e.parameters))}}const se=["NOT_ACQUIRED","OK","OK_BUT_TOO_SMALL","OK_BUT_BAD_ANGLES","OK_BUT_BAD_ASPECT_RATIO","OK_BUT_ORIENTATION_MISMATCH","OK_BUT_OFF_CENTER","OK_BUT_TOO_DARK","ERROR_NOTHING_DETECTED","ERROR_TOO_DARK","ERROR_TOO_NOISY"];class le extends Y.a{constructor(e={}){if(super(),void 0===e.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=e.totalScore,void 0===e.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=e.distanceScore,void 0===e.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=e.angleScore,void 0===e.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=e.sizeScore,void 0===e.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=e.aspectRatioScore,void 0===e.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=e.lineCoverageScore,void 0===e.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=e.widthScore,void 0===e.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=e.heightScore}}class ce extends Y.a{constructor(e={}){if(super(),this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==e.status&&(this.status=e.status),void 0===e.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new le(e.detectionScores),void 0===e.points)throw new Error("points must be present in constructor argument");if(this.points=e.points.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=e.horizontalLines.map((e=>new oe.LineSegmentInt(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new oe.LineSegmentInt(e))),void 0===e.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=e.pointsNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=e.horizontalLinesNormalized.map((e=>new oe.LineSegmentFloat(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new oe.LineSegmentFloat(e))),void 0===e.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=e.aspectRatio,void 0!==e.averageBrightness&&(this.averageBrightness=e.averageBrightness)}}var ue=n(20);const de=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],he=["SUCCESS","VALIDATION_FAILED","FAIL"];class me extends Y.a{constructor(e={}){if(super(),this.status="FAIL",void 0!==e.status&&(this.status=e.status),void 0===e.check)throw new Error("check must be present in constructor argument");if(this.check=null!=e.check?new ue.GenericDocument(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=null!=e.documentDetectionResult?new ce(e.documentDetectionResult):null,void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}class fe extends Y.a{constructor(e={}){super(),this.documentDetectionMode="DISABLED",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode)}}var pe=n(39);const ge=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class ve extends Y.a{constructor(e={}){if(super(),void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class Ce extends Y.a{constructor(e={}){super(),this.qualityThresholds=[new ve({symbolQuality:.5,symbolRatio:.5}),new ve({symbolQuality:.7,symbolRatio:.3}),new ve({symbolQuality:.85,symbolRatio:.3}),new ve({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new ve(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize)}}class be extends Y.a{constructor(e={}){if(super(),void 0===e.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=e.documentFound,void 0===e.quality)throw new Error("quality must be present in constructor argument");if(this.quality=null!=e.quality&&ge.includes(e.quality)?e.quality:null,void 0===e.orientation)throw new Error("orientation must be present in constructor argument");if(this.orientation=null!=e.orientation?e.orientation:null,void 0===e.cumulativeQualityHistogram)throw new Error("cumulativeQualityHistogram must be present in constructor argument");this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e))}}class ye extends Y.a{constructor(e={}){if(super(),this.status="FAILED_DETECTION",void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new ye.Field(e))),void 0!==e.status&&(this.status=e.status)}}!function(e){e.RecognitionStatusValues=["SUCCESS","FAILED_DETECTION","INCOMPLETE_VALIDATION"];class t extends Y.a{constructor(e={}){if(super(),this.validationStatus="NOT_VALIDATED",void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence,void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus)}}e.Field=t,function(e){e.ValidationStatusValues=["NOT_VALIDATED","FAILURE","SUCCESS","CONFIRMED"],e.FieldTypeValues=["SURNAME","GIVEN_NAME","DATE_OF_BIRTH","PERSONAL_IDENTIFICATION_NUMBER","INSTITUTION_NUMBER","INSTITUTION_NAME","CARD_NUMBER","CARD_EXPIRATION_DATE","COUNTRY"]}(t=e.Field||(e.Field={}))}(ye||(ye={}));class Ae extends Y.a{constructor(e={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==e.allowedCountries&&(this.allowedCountries=e.allowedCountries.map((e=>e))),void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=e.maxCountryDetectionAttempts),void 0!==e.minEqualFrameCount&&(this.minEqualFrameCount=e.minEqualFrameCount),void 0!==e.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=e.maxAccumulatedFrameCount)}}var Se;!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new we(e);case"EuropeanHealthInsuranceCardConfiguration":return new xe(e);case"MRZFallbackConfiguration":return new Be(e);case"DocumentDataExtractorCommonConfiguration":return new Ie(e);default:throw`Unknown child class name: ${t}`}}}(Se||(Se={}));class we extends Y.a{constructor(e={}){if(super(),this._type="DateValidationConfiguration",this.minYear=0,this.maxYear=2999,void 0!==e.minYear&&(this.minYear=e.minYear),void 0!==e.maxYear&&(this.maxYear=e.maxYear),void 0===e.fieldTypeName)throw new Error("fieldTypeName must be present in constructor argument");this.fieldTypeName=e.fieldTypeName}}const Ee=["AUSTRIA","BELGIUM","BULGARIA","CROATIA","CYPRUS","CZECH_REPUBLIC","DENMARK","ESTONIA","FINLAND","FRANCE","GERMANY","GREECE","HUNGARY","IRELAND","ITALY","LATVIA","LITHUANIA","LUXEMBOURG","MALTA","NETHERLANDS","POLAND","PORTUGAL","ROMANIA","SLOVAKIA","SLOVENIA","SPAIN","SWEDEN","SWITZERLAND"];class xe extends Y.a{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&Ee.includes(e.expectedCountry)?e.expectedCountry:null)}}class Be extends Y.a{constructor(e={}){super(),this._type="MRZFallbackConfiguration",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==e.acceptedCountries&&(this.acceptedCountries=e.acceptedCountries.map((e=>e))),void 0!==e.acceptedMRZTypes&&(this.acceptedMRZTypes=e.acceptedMRZTypes.map((e=>e)))}}class Ie extends Y.a{constructor(e={}){if(super(),this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}const Te=["EXACT","INTERPOLATE"];class ke extends Y.a{constructor(e={}){super(),this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.confirmationMethod&&(this.confirmationMethod=e.confirmationMethod),void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class Oe extends Y.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}const De=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","INCOMPLETE_VALIDATION"];class Le extends Y.a{constructor(e={}){if(super(),void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.document)throw new Error("document must be present in constructor argument");if(this.document=null!=e.document?new ue.GenericDocument(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=new ce(e.documentDetectionResult),void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}const Pe=["LIVE","SINGLE_SHOT"];class _e extends Y.a{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class Re extends Y.a{constructor(e={}){if(super(),this.resultAccumulationConfig=new ke({}),this.fieldExcludeList=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new ke(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0===e.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=e.configurations.map((e=>Se.From(e)))}}class Fe extends Y.a{constructor(e={}){if(super(),this.recognitionConfidence=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}class Me extends Y.a{constructor(e={}){if(super(),void 0===e.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=e.symbol,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class We extends Y.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=e.rawText,void 0===e.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=e.wordBoxes.map((e=>new Fe(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new Me(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}const Ne=["VEHICLE_IDENTIFICATION_NUMBER"];var Ve;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new ze(e);case"PresetContentValidator":return new je(e);case"PatternContentValidator":return new He(e);default:throw`Unknown child class name: ${t}`}}}(Ve||(Ve={}));class ze extends Y.a{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class je extends Y.a{constructor(e={}){if(super(),this._type="PresetContentValidator",void 0===e.preset)throw new Error("preset must be present in constructor argument");this.preset=e.preset}}class He extends Y.a{constructor(e={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class Ue extends Y.a{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new ze({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==e.validator&&(this.validator=Ve.From(e.validator))}}const Ze=["CLASSIC","ML"];class Ge extends Y.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.scannerStrategy&&(this.scannerStrategy=e.scannerStrategy)}}class Qe extends Y.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===e.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=e.countryCode,void 0===e.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=e.licensePlate,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=e.rawText,void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null)}}class Ye extends Y.a{constructor(e={}){super(),this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==e.shouldCropDocument&&(this.shouldCropDocument=e.shouldCropDocument),void 0!==e.recognizePatientInfoBox&&(this.recognizePatientInfoBox=e.recognizePatientInfoBox),void 0!==e.recognizeBarcode&&(this.recognizeBarcode=e.recognizeBarcode),void 0!==e.extractCroppedImage&&(this.extractCroppedImage=e.extractCroppedImage),void 0!==e.preprocessInput&&(this.preprocessInput=e.preprocessInput)}}const Xe=["UNKNOWN","WORK_ACCIDENT","ASSIGNED_TO_ACCIDENT_INSURANCE_DOCTOR","INITIAL_CERTIFICATE","RENEWED_CERTIFICATE","INSURED_PAY_CASE","FINAL_CERTIFICATE","REQUIRES_CARE_YES","REQUIRES_CARE_NO","ACCIDENT_YES","ACCIDENT_NO","OTHER_ACCIDENT","ENTITLEMENT_TO_CONTINUED_PAYMENT_YES","ENTITLEMENT_TO_CONTINUED_PAYMENT_NO","SICK_PAY_WAS_CLAIMED_NO","SICK_PAY_WAS_CLAIMED_YES","SINGLE_PARENT_NO","SINGLE_PARENT_YES"];class Ke extends Y.a{constructor(e={}){if(super(),this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==e.type&&(this.type=e.type),void 0!==e.checked&&(this.checked=e.checked),void 0!==e.checkedConfidence&&(this.checkedConfidence=e.checkedConfidence),void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y})))}}const qe=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class Je extends Y.a{constructor(e={}){if(super(),this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0!==e.value&&(this.value=e.value),void 0!==e.rawString&&(this.rawString=e.rawString),void 0!==e.type&&(this.type=e.type),void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}const $e=["INSURANCE_PROVIDER","FIRST_NAME","LAST_NAME","ADDRESS_STRING1","ADDRESS_STRING2","DIAGNOSE","HEALTH_INSURANCE_NUMBER","INSURED_PERSON_NUMBER","STATUS","PLACE_OF_OPERATION_NUMBER","DOCTOR_NUMBER","UNDEFINED"];class et extends Y.a{constructor(e={}){if(super(),void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class tt extends Y.a{constructor(e={}){if(super(),this.hasContents=!1,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new et(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const nt=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class ot extends Y.a{constructor(e={}){if(super(),this.scanningSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==e.scanningSuccessful&&(this.scanningSuccessful=e.scanningSuccessful),void 0===e.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new tt(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new Ke(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new Je(e))),void 0!==e.formType&&(this.formType=e.formType),void 0!==e.clockwiseRotations&&(this.clockwiseRotations=e.clockwiseRotations),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new ce(e.documentDetectionResult):null}}const it=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class rt extends Y.a{constructor(e={}){if(super(),this.success=!1,void 0!==e.success&&(this.success=e.success),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.document)throw new Error("document must be present in constructor argument");this.document=null!=e.document?new ue.GenericDocument(e.document):null}}const at=["ACCEPT","REJECT"];class st extends Y.a{constructor(e={}){super(),this.frameAccumulationConfiguration=new Oe({}),this.enableDetection=!0,this.incompleteResultHandling="ACCEPT",void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new Oe(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}var lt;!function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new ct(e);case"Word":return new ut(e);case"Line":return new dt(e);case"Block":return new ht(e);case"Page":return new mt(e);default:throw`Unknown child class name: ${t}`}}}(lt||(lt={}));class ct extends Y.a{constructor(e={}){if(super(),this._type="Glyph",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");this.roi=e.roi.map((e=>({x:e.x,y:e.y})))}}class ut extends Y.a{constructor(e={}){if(super(),this._type="Word",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=e.glyphs.map((e=>new ct(e)))}}class dt extends Y.a{constructor(e={}){if(super(),this._type="Line",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.words)throw new Error("words must be present in constructor argument");this.words=e.words.map((e=>new ut(e)))}}class ht extends Y.a{constructor(e={}){if(super(),this._type="Block",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.lines)throw new Error("lines must be present in constructor argument");this.lines=e.lines.map((e=>new dt(e)))}}class mt extends Y.a{constructor(e={}){if(super(),this._type="Page",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=e.blocks.map((e=>new ht(e)))}}var ft=n(34);class pt extends Y.a{constructor(e={}){super(),this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}const gt=["LETTER","LEGAL","A3","A4","A5","B4","B5","EXECUTIVE","US4x6","US4x8","US5x7","COMM10","CUSTOM"],vt=["PORTRAIT","LANDSCAPE","AUTO"],Ct=["FIT_IN","FILL_IN","STRETCH","NONE"],bt=["NONE","NEAREST","LINEAR","CUBIC","LANCZOS4","AREA"];class yt extends Y.a{constructor(e={}){super(),this.attributes=new pt({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new pt(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}const At=["NONE","CCITTRLE","CCITT_T4","CCITT_T6","LZW","OJPEG","JPEG","T85","T43","NEXT","CCITTRLEW","PACKBITS","THUNDERSCAN","IT8CTPAD","IT8LW","IT8MP","IT8BL","PIXARFILM","PIXARLOG","DEFLATE","ADOBE_DEFLATE"],St=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"];var wt,Et;!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new xt(e);case"UserFieldStringValue":return new Bt(e);case"UserFieldIntValue":return new It(e);default:throw`Unknown child class name: ${t}`}}}(wt||(wt={}));class xt extends Y.a{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Bt extends Y.a{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class It extends Y.a{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Tt extends Y.a{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=wt.From(e.value)}}class kt extends Y.a{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new Tt(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?ft.ParametricFilter.From(e.binarizationFilter):null)}}(Et=kt||(kt={})).defaultCompression="LZW",Et.binaryDocumentOptimizedCompression="CCITT_T6";const Ot=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"];class Dt extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new h.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new Dt;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class Lt extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new h.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(e){const t=new Lt;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class Pt extends Error{constructor(e){super(e.description),this.name="LicenseError"}}class _t{static throwIfMissingBuffer(e){_t.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var Rt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Ft{constructor(e,t){this._sdk=e,this._token=t}analyze(e,t="COPY_IMAGE"){return Rt(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const n=this._sdk.getBridge(t);return yield n.documentQualityAnalyzerAnalyze(this._token,e)}))}release(){return Rt(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var Mt=n(17),Wt=n(0),Nt=n(48),Vt=n(15),zt=n(1),jt=n.n(zt),Ht=n(5);const Ut="var(--1-sb-dvh, 1vh)";function Zt(){const e=Object(Wt.useMemo)((()=>{var e,t;return null===(t=null===(e=null===window||void 0===window?void 0:window.CSS)||void 0===e?void 0:e.supports)||void 0===t?void 0:t.call(e,"height: 100dvh")}),[]),t=()=>{var t=e?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",t)};return Object(Wt.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var Gt=n(31),Qt=n(9),Yt=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Xt(e){const{styleConfig:t}=e,n=Yt(e,["styleConfig"]),o=Object.assign(Object.assign({},e.style),{backgroundColor:Ht.b.getColorValue(t.fillColor),borderColor:Ht.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return Wt.default.createElement(zt.Box,Object.assign({},n,{style:o}))}function Kt(e){return e=Ht.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=Ht.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),qt(e))}function qt(e){return{"&:focus-visible":{outlineColor:`${e=Ht.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function Jt(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return Wt.default.createElement(Wt.default.Fragment,null,e.config.visible&&Wt.default.createElement(zt.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:Ht.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:Ht.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},Kt(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&Wt.default.createElement(e.icon,{color:Ht.b.getColorValue(e.config.icon.color)}),e.children,Wt.default.createElement(Qt.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const $t=new Map;function en(e){const t=function(e){if(!$t.has(e)){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.clearRect(0,0,1,1),n.fillStyle="#000",n.fillStyle=e;const o=n.fillStyle;if(n.fillStyle="#fff",n.fillStyle=e,o!==n.fillStyle)return $t.set(e,null),null;n.fillRect(0,0,1,1);const i=[...n.getImageData(0,0,1,1).data];$t.set(e,{r:i[0],g:i[1],b:i[2],a:i[3]})}return $t.get(e)}(e);return 0===(null==t?void 0:t.a)}function tn(e){var t,n;if(!e.visible)return Wt.default.createElement("div",{style:{display:"flex",flex:1}});const o=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},i="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let r={};return en(Ht.b.getColorValue(e.background.fillColor))&&(r={textDecoration:"underline"}),Wt.default.createElement(zt.Button,Object.assign({id:e.id,"aria-label":e.ariaLabel,disabled:null!==(n=e.disabled)&&void 0!==n&&n,variant:"text",onClick:e.onClick,style:Object(Qt.b)(e.foreground),sx:Object.assign({opacity:e.disabled?.5:1,flex:1,textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},"&:hover":r,"&:focus-visible > div":{outlineColor:Ht.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0},e.buttonWidth?{width:`${e.buttonWidth}px`,minWidth:0}:{}),disableRipple:!0},o),Wt.default.createElement(Xt,{styleConfig:Object.assign(Object.assign({},e.background),{cornerRadius:4}),sx:Object.assign({borderStyle:"solid",mx:"4px",px:"4px",display:"flex",alignItems:"center"},e.styleOverrides)},e.foreground.iconVisible&&!i&&e.icon,Ht.b.getLocalizedText(e.text),e.foreground.iconVisible&&i&&e.icon))}Gt.a;const nn=Wt.default.createContext(null);function on(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(Wt.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=Ht.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const o="SOLID"===t?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${Ut} - ${n}px)`:`calc(100 * ${Ut})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===t?{backgroundColor:Ht.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${Ht.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return Wt.default.createElement(Wt.default.Fragment,null,"HIDDEN"!==t&&Wt.default.createElement(zt.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},Wt.default.createElement(zt.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},Wt.default.createElement(zt.Box,{sx:{flex:1}},e.cancelButton.visible&&Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&Wt.default.createElement(jt.a,{sx:{fontSize:12,mr:"5px"}})},e.cancelButton)))),Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},Wt.default.createElement(Qt.a,{config:e.title}))),Wt.default.createElement(zt.Box,{sx:{flex:1}}))),Wt.default.createElement(nn.Provider,{value:i},e.children))}function rn(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function an(e){if(e.loading)return Wt.default.createElement(zt.Skeleton,{variant:"rounded",width:e.imageSize,height:e.imageSize,style:{borderRadius:8}});if(null===e.data.barcodeImage){const t={width:e.imageSize,height:e.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return Wt.default.createElement(zt.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return Wt.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function sn(e){var t,n;const o=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",i=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!e||"LOADED"!==o,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,l=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:Ht.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return Wt.default.createElement(zt.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&Wt.default.createElement(zt.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(an,{data:i,imageSize:a,loading:r})),s&&Wt.default.createElement(zt.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&Wt.default.createElement(zt.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},rn(e.maxNumberOfTitleLines)),Object(Qt.b)(e.barcodeTitle))},r?Wt.default.createElement(zt.Skeleton,{variant:"text"}):i.title),e.displayRightArrow&&!r&&Wt.default.createElement(jt.a,{sx:{fontSize:16,fontWeight:"bold",color:Ht.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&Wt.default.createElement(zt.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},rn(e.maxNumberOfSubtitleLines)),Object(Qt.b)(e.barcodeSubtitle))},r?Wt.default.createElement(zt.Skeleton,{variant:"text"}):i.subtitle),e.counterForm&&Wt.default.createElement(zt.ButtonGroup,{variant:"outlined"},Wt.default.createElement(zt.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:l,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor)}})),Wt.default.createElement(zt.Button,{sx:Object.assign(Object.assign({},l),{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),Wt.default.createElement(zt.Button,{disabled:!e.counterForm.addButtonEnabled,sx:l,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}Vt.ButtonConfiguration;function ln(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return Wt.default.createElement(zt.Button,Object.assign({disabled:null!==(t=e.disabled)&&void 0!==t&&t,onClick:e.onClick,type:e.type,"aria-label":e.ariaLabel,sx:Object.assign(Object.assign({},e.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:Ht.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:Ht.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&Wt.default.createElement(e.icon,{sx:{color:Ht.b.getColorValue(e.foreground.color),pr:2}}),Wt.default.createElement(Qt.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var cn=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function un(e){var t,{modalOverlayColor:n}=e,o=cn(e,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:Ht.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(t=o.PaperProps)||void 0===t?void 0:t.sx),o.width?{width:o.width}:{maxWidth:400})});return Wt.default.createElement(zt.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function dn(e){const t=Object(Wt.useContext)(Ht.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,o={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[i,r]=Wt.default.useState(),a=Object(Wt.useRef)((()=>{}));Object(Wt.useEffect)((()=>{e.open&&r(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,r(!0)};return Wt.default.createElement(un,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},Wt.default.createElement(zt.DialogContent,{style:o},Wt.default.createElement(sn,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),Wt.default.createElement(zt.DialogActions,{style:o},Wt.default.createElement(jt.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:t(e.dividerColor)})),n?Wt.default.createElement(jt.a,{item:!0,xs:12,sx:{textAlign:"center"}},Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),Wt.default.createElement(Qt.a,{config:e.loadingMessage}))):Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,r(!0)}},e.submitButton)))))))}var hn=n(3);hn.h;function mn(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?Ht.b.getColorValue(e.activeBackgroundColor):Ht.b.getColorValue(e.backgroundColor),color:e.active?Ht.b.getColorValue(e.activeForegroundColor):Ht.b.getColorValue(e.foregroundColor)};return Wt.default.createElement(zt.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&Wt.default.createElement("span",{style:{fontSize:15}},Ht.b.getLocalizedText(e.text)),e.icon&&Wt.default.createElement(e.icon,{style:{padding:7}}))}var fn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class pn{constructor(){this.audioFile=new Audio}initialize(e){return fn(this,void 0,void 0,(function*(){e.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(e){e.successBeepEnabled&&this.play()}play(){return fn(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}pn.INSTANCE=new pn;var gn=pn;class vn{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}vn.INSTANCE=new vn;var Cn=vn,bn=n(12),yn=n(25),An=n(24),Sn=n(26);class wn extends Wt.default.Component{constructor(e){super(e),this.state={base64Image:void 0}}render(){const e="x"+this.props.barcode.count;return Wt.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},Wt.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},Wt.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},Wt.default.createElement("div",{style:{flex:1}},this.props.barcode.text),Wt.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},e)),Wt.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function En(e,t){return e.format===t.format&&e.text===t.text}function xn(e){return e.text+e.format}class Bn extends Wt.default.Component{constructor(e){super(e),this.state={barcodes:this.toUniqueListWithDuplicateCounter(e.barcodes)}}toUniqueListWithDuplicateCounter(e){const t=[];return e.forEach((e=>{const n=t.findIndex((t=>En(t,e)));-1===n?(e.count=1,t.push(e)):t[n].count++})),t}update(e){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(e)})}render(){return Wt.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((e,t)=>Wt.default.createElement(wn,{key:t,barcode:e,onClick:this.props.onClick}))))}}class In{}In.ScanbotPrimary="#c8193c",In.LightGray="#F5F5F5",In.Gray="#808080",In.DarkGray="#333333",In.Orange="#FF5533",In.White="#FFFFFF",In.TransparentGreen="rgba(0, 255, 0, 0.5)",In.TransparentGray="rgba(50, 50, 50, 0.5)",In.TransparentBlack="rgba(0, 0, 0, 0.3)",In.SBNegative="#FF3737";var Tn,kn=In;!function(e){e[e.None=0]="None",e[e.PushRight=1]="PushRight",e[e.PushBottom=2]="PushBottom",e[e.Pop=3]="Pop"}(Tn||(Tn={}));class On extends Wt.default.Component{constructor(e){super(e),this._isVisible=!1,this.state={animation:{type:Tn.None},elements:[]}}containerStyle(e){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:e,overflow:"scroll"}}render(){var e,t,n;if(this.state.animation.type===Tn.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return Wt.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:e=>{this.reset()}},Wt.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:e=>{e.stopPropagation()}},Wt.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:kn.ScanbotPrimary}},Wt.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},Wt.default.createElement("div",{style:{backgroundColor:kn.White,height:3,width:33,borderRadius:5}})),Wt.default.createElement("div",{style:{display:"flex",height:50}},Wt.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:kn.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),Wt.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:kn.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(t=null===(e=this.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)+" Codes"),Wt.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:kn.White,justifyContent:"right",alignItems:"center",paddingRight:10}},Wt.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:e=>{e.stopPropagation(),this.reset()}},"×")))),Wt.default.createElement(Bn,{ref:e=>{null!==e&&(this.list=e)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(e,t){this._isVisible=!0,this.barcodes=t,this.updateAnimationType(e)}update(e){this.barcodes=e,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Tn.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Tn.Pop&&this.updateAnimationType(Tn.None)}updateAnimationType(e,t){this.setState({animation:{type:e}},t)}animation(e){let t=this.from(e),n=this.to(e);this.previousDestination===n&&(t=this.previousDestination,n=this.previousDestination);const o=Sn.b`from {transform: ${t};} to {transform: ${n};}`;return Sn.a.div`animation: ${o} 0.5s;`}from(e){if(e===Tn.PushRight)return this.translate("X",100);if(e===Tn.PushBottom)return this.translate("Y",100);if(e===Tn.Pop){const e=this.pushType===Tn.PushRight?"X":"Y";return this.translate(e,0)}}to(e){if(e===Tn.PushRight)return this.translate("X",0);if(e===Tn.PushBottom)return this.translate("Y",0);if(e===Tn.Pop){const e=this.pushType===Tn.PushRight?"X":"Y";return this.translate(e,100)}}translate(e,t){return"translate"+e+"("+t+"%)"}componentWillUnmount(){this._isVisible=!1}}var Dn=n(4),Ln=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},Pn={measureLayout:Ln(["layout","layoutId","drag","_layoutResetTransform"]),animation:Ln(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Ln(["exit"]),drag:Ln(["drag","dragControls"]),focus:Ln(["whileFocus"]),hover:Ln(["whileHover","onHoverStart","onHoverEnd"]),tap:Ln(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Ln(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Ln(["layout","layoutId"])};var _n=Object(Wt.createContext)({strict:!1}),Rn=Object.keys(Pn),Fn=Rn.length;var Mn=Object(Wt.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),Wn=Object(Wt.createContext)({});var Nn=Object(Wt.createContext)(null);function Vn(e){var t=Object(Wt.useRef)(null);return null===t.current&&(t.current=e()),t.current}function zn(){var e=Object(Wt.useContext)(Nn);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,o=e.register,i=Zn();Object(Wt.useEffect)((function(){return o(i)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function jn(e){return null===e||e.isPresent}var Hn=0,Un=function(){return Hn++},Zn=function(){return Vn(Un)},Gn=Object(Wt.createContext)(null),Qn="undefined"!=typeof window,Yn=Qn?Wt.useLayoutEffect:Wt.useEffect;function Xn(e,t,n,o){var i=Object(Wt.useContext)(Mn),r=Object(Wt.useContext)(_n),a=Object(Wt.useContext)(Wn).visualElement,s=Object(Wt.useContext)(Nn),l=function(e){var t=e.layoutId,n=Object(Wt.useContext)(Gn);return n&&void 0!==t?n+"-"+t:t}(n),c=Object(Wt.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(e,{visualState:t,parent:a,props:Object(Dn.a)(Object(Dn.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Yn((function(){u&&(u.setProps(Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},i),n),{layoutId:l})),u.isPresent=jn(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(Wt.useEffect)((function(){var e;u&&(null===(e=u.animationState)||void 0===e||e.animateChanges())})),Yn((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Kn(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function qn(e){return Array.isArray(e)}function Jn(e){return"string"==typeof e||qn(e)}function $n(e,t,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof t&&(t=null===(r=e.variants)||void 0===r?void 0:r[t]),"function"==typeof t?t(null!=n?n:e.custom,o,i):t}function eo(e,t,n){var o=e.getProps();return $n(o,t,null!=n?n:o.custom,function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function to(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||Jn(e.initial)||Jn(e.animate)||Jn(e.whileHover)||Jn(e.whileDrag)||Jn(e.whileTap)||Jn(e.whileFocus)||Jn(e.exit)}function no(e){return Boolean(to(e)||e.variants)}function oo(e,t){var n=function(e,t){if(to(e)){var n=e.initial,o=e.animate;return{initial:!1===n||Jn(n)?n:void 0,animate:Jn(o)?o:void 0}}return!1!==e.inherit?t:{}}(e,Object(Wt.useContext)(Wn)),o=n.initial,i=n.animate;return Object(Wt.useMemo)((function(){return{initial:o,animate:i}}),t?[io(o),io(i)]:[])}function io(e){return Array.isArray(e)?e.join(" "):e}function ro(e){var t=e.preloadedFeatures,n=e.createVisualElement,o=e.useRender,i=e.useVisualState,r=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(Pn[t].Component=n)}}(t),Object(Wt.forwardRef)((function(e,t){var a=Object(Wt.useContext)(Mn).isStatic,s=null,l=oo(e,a),c=i(e,a);return!a&&Qn&&(l.visualElement=Xn(r,c,e,n),s=function(e,t,n){var o=[];if(Object(Wt.useContext)(_n),!t)return null;for(var i=0;i<Fn;i++){var r=Rn[i],a=Pn[r],s=a.isEnabled,l=a.Component;s(e)&&l&&o.push(Wt.createElement(l,Object(Dn.a)({key:r},e,{visualElement:t})))}return o}(e,l.visualElement)),Wt.createElement(Wt.Fragment,null,Wt.createElement(Wn.Provider,{value:l},o(r,e,function(e,t,n){return Object(Wt.useCallback)((function(o){var i;o&&(null===(i=e.mount)||void 0===i||i.call(e,o)),t&&(o?t.mount(o):t.unmount()),n&&("function"==typeof n?n(o):Kn(n)&&(n.current=o))}),[t])}(c,l.visualElement,t),c,a)),s)}))}function ao(e){function t(t,n){return void 0===n&&(n={}),ro(e(t,n))}var n=new Map;return new Proxy(t,{get:function(e,o){return n.has(o)||n.set(o,t(o)),n.get(o)}})}var so=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function lo(e){return"string"==typeof e&&!e.includes("-")&&!!(so.indexOf(e)>-1||/[A-Z]/.test(e))}var co={};var uo=["","X","Y","Z"],ho=["transformPerspective","x","y","z"];function mo(e,t){return ho.indexOf(e)-ho.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return uo.forEach((function(t){return ho.push(e+t)}))}));var fo=new Set(ho);function po(e){return fo.has(e)}var go=new Set(["originX","originY","originZ"]);function vo(e){return go.has(e)}function Co(e,t){var n=t.layout,o=t.layoutId;return po(e)||vo(e)||(n||void 0!==o)&&(!!co[e]||"opacity"===e)}var bo=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},yo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Ao(e){return e.startsWith("--")}var So=function(e,t){return t&&"number"==typeof e?t.transform(e):e},wo=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Eo=function(e){return e%1?Number(e.toFixed(5)):e},xo=/(-)?([\d]*\.?[\d])+/g,Bo=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,Io=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function To(e){return"string"==typeof e}var ko=function(e){return{test:function(t){return To(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Oo=ko("deg"),Do=ko("%"),Lo=ko("px"),Po=ko("vh"),_o=ko("vw"),Ro=Object(Dn.a)(Object(Dn.a)({},Do),{parse:function(e){return Do.parse(e)/100},transform:function(e){return Do.transform(100*e)}}),Fo={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Mo=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:wo(0,1)}),Wo=Object(Dn.a)(Object(Dn.a)({},Fo),{default:1}),No=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:Math.round}),Vo={borderWidth:Lo,borderTopWidth:Lo,borderRightWidth:Lo,borderBottomWidth:Lo,borderLeftWidth:Lo,borderRadius:Lo,radius:Lo,borderTopLeftRadius:Lo,borderTopRightRadius:Lo,borderBottomRightRadius:Lo,borderBottomLeftRadius:Lo,width:Lo,maxWidth:Lo,height:Lo,maxHeight:Lo,size:Lo,top:Lo,right:Lo,bottom:Lo,left:Lo,padding:Lo,paddingTop:Lo,paddingRight:Lo,paddingBottom:Lo,paddingLeft:Lo,margin:Lo,marginTop:Lo,marginRight:Lo,marginBottom:Lo,marginLeft:Lo,rotate:Oo,rotateX:Oo,rotateY:Oo,rotateZ:Oo,scale:Wo,scaleX:Wo,scaleY:Wo,scaleZ:Wo,skew:Oo,skewX:Oo,skewY:Oo,distance:Lo,translateX:Lo,translateY:Lo,translateZ:Lo,x:Lo,y:Lo,z:Lo,perspective:Lo,transformPerspective:Lo,opacity:Mo,originX:Ro,originY:Ro,originZ:Lo,zIndex:No,fillOpacity:Mo,strokeOpacity:Mo,numOctaves:No};function zo(e,t,n,o,i,r,a,s){var l,c=e.style,u=e.vars,d=e.transform,h=e.transformKeys,m=e.transformOrigin;h.length=0;var f=!1,p=!1,g=!0;for(var v in t){var C=t[v];if(Ao(v))u[v]=C;else{var b=Vo[v],y=So(C,b);if(po(v)){if(f=!0,d[v]=y,h.push(v),!g)continue;C!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(vo(v))m[v]=y,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&co[v]){var A=co[v].process(C,o,n),S=co[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)c[S[E]]=A;else c[v]=A}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,f?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(f&&(c.transform=function(e,t,n,o){var i=e.transform,r=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,l=t.allowTransformNone,c=void 0===l||l,u="";r.sort(mo);for(var d=!1,h=r.length,m=0;m<h;m++){var f=r[m];u+=(yo[f]||f)+"("+i[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(e,i,g,r)),p&&(c.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,o=e.originY,i=void 0===o?"50%":o,r=e.originZ;return n+" "+i+" "+(void 0===r?0:r)}(m)))}var jo=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Ho(e,t,n){for(var o in t)bo(t[o])||Co(o,n)||(e[o]=t[o])}function Uo(e,t,n){var o={};return Ho(o,e.style||{},e),Object.assign(o,function(e,t,n){var o=e.transformTemplate;return Object(Wt.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};zo(e,t,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=e.vars,r=e.style;return Object(Dn.a)(Object(Dn.a)({},i),r)}),[t])}(e,t,n)),e.transformValues&&(o=e.transformValues(o)),o}function Zo(e,t,n){var o={},i=Uo(e,t,n);return Boolean(e.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),o.style=i,o}var Go=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function Qo(e){return Go.has(e)}var Yo=function(e){return!Qo(e)};try{var Xo=n(55).default;Yo=function(e){return e.startsWith("on")?!Qo(e):Xo(e)}}catch(e){}function Ko(e,t,n){return"string"==typeof e?e:Lo.transform(t+n*e)}var qo=function(e,t){return Lo.transform(e*t)},Jo={offset:"stroke-dashoffset",array:"stroke-dasharray"},$o={offset:"strokeDashoffset",array:"strokeDasharray"};function ei(e,t,n,o,i,r,a,s){var l=t.attrX,c=t.attrY,u=t.originX,d=t.originY,h=t.pathLength,m=t.pathSpacing,f=void 0===m?1:m,p=t.pathOffset,g=void 0===p?0:p;zo(e,Object(Dn.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),e.attrs=e.style,e.style={};var v=e.attrs,C=e.style,b=e.dimensions,y=e.totalPathLength;v.transform&&(b&&(C.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||C.transform)&&(C.transformOrigin=function(e,t,n){return Ko(t,e.x,e.width)+" "+Ko(n,e.y,e.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(e,t,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?Jo:$o;e[a.offset]=qo(-i,t);var s=qo(n,t),l=qo(o,t);e[a.array]=s+" "+l}(v,y,h,f,g,!1)}var ti=function(){return Object(Dn.a)(Object(Dn.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function ni(e,t){var n=Object(Wt.useMemo)((function(){var n=ti();return ei(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(Dn.a)(Object(Dn.a)({},n.attrs),{style:Object(Dn.a)({},n.style)})}),[t]);if(e.style){var o={};Ho(o,e.style,e),n.style=Object(Dn.a)(Object(Dn.a)({},o),n.style)}return n}function oi(e){void 0===e&&(e=!1);return function(t,n,o,i,r){var a=i.latestValues,s=(lo(t)?ni:Zo)(n,a,r),l=function(e,t,n){var o={};for(var i in e)(Yo(i)||!0===n&&Qo(i)||!t&&!Qo(i))&&(o[i]=e[i]);return o}(n,"string"==typeof t,e),c=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},l),s),{ref:o});return Object(Wt.createElement)(t,c)}}var ii=/([a-z])([A-Z])/g,ri=function(e){return e.replace(ii,"$1-$2").toLowerCase()};function ai(e,t){var n=t.style,o=t.vars;for(var i in Object.assign(e.style,n),o)e.style.setProperty(i,o[i])}var si=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function li(e,t){for(var n in ai(e,t),t.attrs)e.setAttribute(si.has(n)?n:ri(n),t.attrs[n])}function ci(e){var t=e.style,n={};for(var o in t)(bo(t[o])||Co(o,e))&&(n[o]=t[o]);return n}function ui(e){var t=ci(e);for(var n in e){if(bo(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function di(e){return"object"==typeof e&&"function"==typeof e.start}var hi=function(e){return Array.isArray(e)};function mi(e){var t,n=bo(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function fi(e,t,n,o){var i=e.scrapeMotionValuesFromProps,r=e.createRenderState,a=e.onMount,s={latestValues:gi(t,n,o,i),renderState:r()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var pi=function(e){return function(t,n){var o=Object(Wt.useContext)(Wn),i=Object(Wt.useContext)(Nn);return n?fi(e,t,o,i):Vn((function(){return fi(e,t,o,i)}))}};function gi(e,t,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(e);for(var s in a)i[s]=mi(a[s]);var l=e.initial,c=e.animate,u=to(e),d=no(e);t&&d&&!u&&!1!==e.inherit&&(null!=l||(l=t.initial),null!=c||(c=t.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!di(h)&&(Array.isArray(h)?h:[h]).forEach((function(t){var n=$n(e,t);if(n){var o=n.transitionEnd;n.transition;var r=Object(Dn.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var vi={useVisualState:pi({scrapeMotionValuesFromProps:ui,createRenderState:ti,onMount:function(e,t,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){o.dimensions={x:0,y:0,width:0,height:0}}"path"===t.tagName&&(o.totalPathLength=t.getTotalLength()),ei(o,i,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),li(t,o)}})};var Ci,bi={useVisualState:pi({scrapeMotionValuesFromProps:ci,createRenderState:jo})};function yi(e,t,n,o){var i=t.forwardMotionProps,r=void 0!==i&&i,a=lo(e)?vi:bi;return Object(Dn.a)(Object(Dn.a)({},a),{preloadedFeatures:n,useRender:oi(r),createVisualElement:o,Component:e})}function Ai(e,t,n,o){return e.addEventListener(t,n,o),function(){return e.removeEventListener(t,n,o)}}function Si(e,t,n,o){Object(Wt.useEffect)((function(){var i=e.current;if(n&&i)return Ai(i,t,n,o)}),[e,t,n,o])}function wi(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function Ei(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Ci||(Ci={}));var xi={pageX:0,pageY:0};function Bi(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||xi;return{x:n[t+"X"],y:n[t+"Y"]}}function Ii(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function Ti(e,t){return void 0===t&&(t="page"),{point:Ei(e)?Bi(e,t):Ii(e,t)}}var ki=function(e,t){void 0===t&&(t=!1);var n,o=function(t){return e(t,Ti(t))};return t?(n=o,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):o},Oi={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Di={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Li(e){return Qn&&null===window.onpointerdown?e:Qn&&null===window.ontouchstart?Di[e]:Qn&&null===window.onmousedown?Oi[e]:e}function Pi(e,t,n,o){return Ai(e,Li(t),ki(n,"pointerdown"===t),o)}function _i(e,t,n,o){return Si(e,Li(t),n&&ki(n,"pointerdown"===t),o)}function Ri(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var Fi=Ri("dragHorizontal"),Mi=Ri("dragVertical");function Wi(e){var t=!1;if("y"===e)t=Mi();else if("x"===e)t=Fi();else{var n=Fi(),o=Mi();n&&o?t=function(){n(),o()}:(n&&n(),o&&o())}return t}function Ni(){var e=Wi(!0);return!e||(e(),!1)}function Vi(e,t,n){return function(o,i){var r;wi(o)&&!Ni()&&(null==n||n(o,i),null===(r=e.animationState)||void 0===r||r.setActive(Ci.Hover,t))}}var zi=function(e,t){return!!t&&(e===t||zi(e,t.parentElement))};function ji(e){return Object(Wt.useEffect)((function(){return function(){return e()}}),[])}var Hi=function(e,t){return function(n){return t(e(n))}},Ui=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(Hi)};var Zi=function(e){return function(t){return e(t),null}},Gi={tap:Zi((function(e){var t=e.onTap,n=e.onTapStart,o=e.onTapCancel,i=e.whileTap,r=e.visualElement,a=t||n||o||i,s=Object(Wt.useRef)(!1),l=Object(Wt.useRef)(null);function c(){var e;null===(e=l.current)||void 0===e||e.call(l),l.current=null}function u(){var e;return c(),s.current=!1,null===(e=r.animationState)||void 0===e||e.setActive(Ci.Tap,!1),!Ni()}function d(e,n){u()&&(zi(r.getInstance(),e.target)?null==t||t(e,n):null==o||o(e,n))}function h(e,t){u()&&(null==o||o(e,t))}_i(r,"pointerdown",a?function(e,t){var o;c(),s.current||(s.current=!0,l.current=Ui(Pi(window,"pointerup",d),Pi(window,"pointercancel",h)),null==n||n(e,t),null===(o=r.animationState)||void 0===o||o.setActive(Ci.Tap,!0))}:void 0),ji(c)})),focus:Zi((function(e){var t=e.whileFocus,n=e.visualElement;Si(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ci.Focus,!0)}:void 0),Si(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ci.Focus,!1)}:void 0)})),hover:Zi((function(e){var t=e.onHoverStart,n=e.onHoverEnd,o=e.whileHover,i=e.visualElement;_i(i,"pointerenter",t||o?Vi(i,!0,t):void 0),_i(i,"pointerleave",n||o?Vi(i,!1,n):void 0)}))};function Qi(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}var Yi=function(e,t,n){return Math.min(Math.max(n,e),t)},Xi=.001;function Ki(e){var t,n,o=e.duration,i=void 0===o?800:o,r=e.bounce,a=void 0===r?.25:r,s=e.velocity,l=void 0===s?0:s,c=e.mass,u=void 0===c?1:c,d=1-a;d=Yi(.05,1,d),i=Yi(.01,10,i/1e3),d<1?(t=function(e){var t=e*d,n=t*i,o=t-l,r=qi(e,d),a=Math.exp(-n);return Xi-o/r*a},n=function(e){var n=e*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(e,2)*i,a=Math.exp(-n),s=qi(Math.pow(e,2),d);return(-t(e)+Xi>0?-1:1)*((o-r)*a)/s}):(t=function(e){return Math.exp(-e*i)*((e-l)*i+1)-.001},n=function(e){return Math.exp(-e*i)*(i*i*(l-e))});var h=function(e,t,n){for(var o=n,i=1;i<12;i++)o-=e(o)/t(o);return o}(t,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var m=Math.pow(h,2)*u;return{stiffness:m,damping:2*d*Math.sqrt(u*m),duration:i}}function qi(e,t){return e*Math.sqrt(1-t*t)}var Ji=["duration","bounce"],$i=["stiffness","damping","mass"];function er(e,t){return t.some((function(t){return void 0!==e[t]}))}function tr(e){var t=e.from,n=void 0===t?0:t,o=e.to,i=void 0===o?1:o,r=e.restSpeed,a=void 0===r?2:r,s=e.restDelta,l=Object(Dn.d)(e,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(e){var t=Object(Dn.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!er(e,$i)&&er(e,Ji)){var n=Ki(e);(t=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),d=u.stiffness,h=u.damping,m=u.mass,f=u.velocity,p=u.duration,g=u.isResolvedFromDuration,v=nr,C=nr;function b(){var e=f?-f/1e3:0,t=i-n,o=h/(2*Math.sqrt(d*m)),r=Math.sqrt(d/m)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=qi(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((e+o*r*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},C=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(e+o*r*t)/a+t*Math.cos(a*n))-i*(Math.cos(a*n)*(e+o*r*t)-a*t*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(t+(e+r*t)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((e+o*r*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=v(e);if(g)c.done=e>=p;else{var n=1e3*C(e),o=Math.abs(n)<=a,r=Math.abs(i-t)<=s;c.done=o&&r}return c.value=c.done?i:t,c},flipTarget:function(){var e;f=-f,n=(e=[i,n])[0],i=e[1],b()}}}tr.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var nr=function(e){return 0},or=function(e,t,n){var o=t-e;return 0===o?1:(n-e)/o},ir=function(e,t,n){return-n*e+n*t+e},rr=function(e,t){return function(n){return Boolean(To(n)&&Io.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},ar=function(e,t,n){return function(o){var i;if(!To(o))return o;var r=o.match(xo),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[e]=parseFloat(a),i[t]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},sr=wo(0,255),lr=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:function(e){return Math.round(sr(e))}}),cr={test:rr("rgb","red"),parse:ar("red","green","blue"),transform:function(e){var t=e.red,n=e.green,o=e.blue,i=e.alpha,r=void 0===i?1:i;return"rgba("+lr.transform(t)+", "+lr.transform(n)+", "+lr.transform(o)+", "+Eo(Mo.transform(r))+")"}};var ur={test:rr("#"),parse:function(e){var t="",n="",o="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),o=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),o=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,o+=o,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:cr.transform},dr={test:rr("hsl","hue"),parse:ar("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,o=e.lightness,i=e.alpha,r=void 0===i?1:i;return"hsla("+Math.round(t)+", "+Do.transform(Eo(n))+", "+Do.transform(Eo(o))+", "+Eo(Mo.transform(r))+")"}},hr=function(e,t,n){var o=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-o)+o))},mr=[ur,cr,dr],fr=function(e){return mr.find((function(t){return t.test(e)}))},pr=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},gr=function(e,t){var n=fr(e),o=fr(t);pr(e),pr(t),n.transform,o.transform;var i=n.parse(e),r=o.parse(t),a=Object(Dn.a)({},i),s=n===dr?ir:hr;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(i[t],r[t],e));return a.alpha=ir(i.alpha,r.alpha,e),n.transform(a)}},vr={test:function(e){return cr.test(e)||ur.test(e)||dr.test(e)},parse:function(e){return cr.test(e)?cr.parse(e):dr.test(e)?dr.parse(e):ur.parse(e)},transform:function(e){return To(e)?e:e.hasOwnProperty("red")?cr.transform(e):dr.transform(e)}},Cr="${c}",br="${n}";function yr(e){var t=[],n=0,o=e.match(Bo);o&&(n=o.length,e=e.replace(Bo,Cr),t.push.apply(t,o.map(vr.parse)));var i=e.match(xo);return i&&(e=e.replace(xo,br),t.push.apply(t,i.map(Fo.parse))),{values:t,numColors:n,tokenised:e}}function Ar(e){return yr(e).values}function Sr(e){var t=yr(e),n=t.values,o=t.numColors,i=t.tokenised,r=n.length;return function(e){for(var t=i,n=0;n<r;n++)t=t.replace(n<o?Cr:br,n<o?vr.transform(e[n]):Eo(e[n]));return t}}var wr=function(e){return"number"==typeof e?0:e};var Er={test:function(e){var t,n,o,i;return isNaN(e)&&To(e)&&(null!==(n=null===(t=e.match(xo))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(i=null===(o=e.match(Bo))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:Ar,createTransformer:Sr,getAnimatableNone:function(e){var t=Ar(e);return Sr(e)(t.map(wr))}},xr=function(e){return"number"==typeof e};function Br(e,t){return xr(e)?function(n){return ir(e,t,n)}:vr.test(e)?gr(e,t):Or(e,t)}var Ir=function(e,t){var n=Object(Dn.e)([],e),o=n.length,i=e.map((function(e,n){return Br(e,t[n])}));return function(e){for(var t=0;t<o;t++)n[t]=i[t](e);return n}},Tr=function(e,t){var n=Object(Dn.a)(Object(Dn.a)({},e),t),o={};for(var i in n)void 0!==e[i]&&void 0!==t[i]&&(o[i]=Br(e[i],t[i]));return function(e){for(var t in o)n[t]=o[t](e);return n}};function kr(e){for(var t=Er.parse(e),n=t.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof t[a]?o++:void 0!==t[a].hue?r++:i++;return{parsed:t,numNumbers:o,numRGB:i,numHSL:r}}var Or=function(e,t){var n=Er.createTransformer(t),o=kr(e),i=kr(t);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Ui(Ir(o.parsed,i.parsed),n)},Dr=function(e,t){return function(n){return ir(e,t,n)}};function Lr(e,t,n){for(var o,i=[],r=n||("number"==typeof(o=e[0])?Dr:"string"==typeof o?vr.test(o)?gr:Or:Array.isArray(o)?Ir:"object"==typeof o?Tr:void 0),a=e.length-1,s=0;s<a;s++){var l=r(e[s],e[s+1]);if(t){var c=Array.isArray(t)?t[s]:t;l=Ui(c,l)}i.push(l)}return i}function Pr(e,t,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=e.length;t.length,!a||!Array.isArray(a)||a.length,e[0]>e[l-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var c=Lr(t,a,s),u=2===l?function(e,t){var n=e[0],o=e[1],i=t[0];return function(e){return i(or(n,o,e))}}(e,c):function(e,t){var n=e.length,o=n-1;return function(i){var r=0,a=!1;if(i<=e[0]?a=!0:i>=e[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>i||s===o);s++);r=s-1}var l=or(e[r],e[r+1],i);return t[r](l)}}(e,c);return r?function(t){return u(Yi(e[0],e[l-1],t))}:u}var _r,Rr=function(e){return function(t){return 1-e(1-t)}},Fr=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Mr=function(e){return function(t){return t*t*((e+1)*t-e)}},Wr=function(e){return e},Nr=(_r=2,function(e){return Math.pow(e,_r)}),Vr=Rr(Nr),zr=Fr(Nr),jr=function(e){return 1-Math.sin(Math.acos(e))},Hr=Rr(jr),Ur=Fr(Hr),Zr=Mr(1.525),Gr=Rr(Zr),Qr=Fr(Zr),Yr=function(e){var t=Mr(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),Xr=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},Kr=Rr(Xr);function qr(e,t){return e.map((function(){return t||zr})).splice(0,e.length-1)}function Jr(e){var t=e.from,n=void 0===t?0:t,o=e.to,i=void 0===o?1:o,r=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===u.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(u),l);function h(){return Pr(d,u,{ease:Array.isArray(r)?r:qr(u,r)})}var m=h();return{next:function(e){return c.value=m(e),c.done=e>=l,c},flipTarget:function(){u.reverse(),m=h()}}}var $r={keyframes:Jr,spring:tr,decay:function(e){var t=e.velocity,n=void 0===t?0:t,o=e.from,i=void 0===o?0:o,r=e.power,a=void 0===r?.8:r,s=e.timeConstant,l=void 0===s?350:s,c=e.restDelta,u=void 0===c?.5:c,d=e.modifyTarget,h={done:!1,value:i},m=a*n,f=i+m,p=void 0===d?f:d(f);return p!==f&&(m=p-i),{next:function(e){var t=-m*Math.exp(-e/l);return h.done=!(t>u||t<-u),h.value=h.done?p:p+t,h},flipTarget:function(){}}}};var ea=1/60*1e3,ta="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},na="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(ta())}),ea)};var oa=!0,ia=!1,ra=!1,aa={delta:0,timestamp:0},sa=["read","update","preRender","render","postRender"],la=sa.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?t:n;return a&&r.add(e),-1===c.indexOf(e)&&(c.push(e),l&&i&&(o=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),r.delete(e)},process:function(s){var l;if(i=!0,t=(l=[n,t])[0],(n=l[1]).length=0,o=t.length)for(var c=0;c<o;c++){var u=t[c];u(s),r.has(u)&&(a.schedule(u),e())}i=!1}};return a}((function(){return ia=!0})),e}),{}),ca=sa.reduce((function(e,t){var n=la[t];return e[t]=function(e,t,o){return void 0===t&&(t=!1),void 0===o&&(o=!1),ia||fa(),n.schedule(e,t,o)},e}),{}),ua=sa.reduce((function(e,t){return e[t]=la[t].cancel,e}),{}),da=sa.reduce((function(e,t){return e[t]=function(){return la[t].process(aa)},e}),{}),ha=function(e){return la[e].process(aa)},ma=function(e){ia=!1,aa.delta=oa?ea:Math.max(Math.min(e-aa.timestamp,40),1),aa.timestamp=e,ra=!0,sa.forEach(ha),ra=!1,ia&&(oa=!1,na(ma))},fa=function(){ia=!0,oa=!0,ra||na(ma)},pa=function(){return aa},ga=ca;function va(e,t,n){return void 0===n&&(n=0),e-t-n}var Ca=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return ga.update(t,!0)},stop:function(){return ua.update(t)}}};function ba(e){var t,n,o,i,r,a=e.from,s=e.autoplay,l=void 0===s||s,c=e.driver,u=void 0===c?Ca:c,d=e.elapsed,h=void 0===d?0:d,m=e.repeat,f=void 0===m?0:m,p=e.repeatType,g=void 0===p?"loop":p,v=e.repeatDelay,C=void 0===v?0:v,b=e.onPlay,y=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(Dn.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),x=E.to,B=0,I=E.duration,T=!1,k=!0,O=function(e){if(Array.isArray(e.to))return Jr;if($r[e.type])return $r[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Jr:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?tr:Jr}(E);(null===(n=(t=O).needsInterpolation)||void 0===n?void 0:n.call(t,a,x))&&(r=Pr([0,100],[a,x],{clamp:!1}),a=0,x=100);var D=O(Object(Dn.a)(Object(Dn.a)({},E),{from:a,to:x}));function L(){B++,"reverse"===g?h=function(e,t,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?va(t+-e,t,n):t-(e-t)+n}(h,I,C,k=B%2==0):(h=va(h,I,C),"mirror"===g&&D.flipTarget()),T=!1,S&&S()}function P(e){if(k||(e=-e),h+=e,!T){var t=D.next(Math.max(0,h));i=t.value,r&&(i=r(i)),T=k?t.done:h<=0}null==w||w(i),T&&(0===B&&(null!=I||(I=h)),B<f?function(e,t,n,o){return o?e>=t+n:e<=-n}(h,I,C,k)&&L():(o.stop(),A&&A()))}return l&&(null==b||b(),(o=u(P)).start()),{stop:function(){null==y||y(),o.stop()}}}function ya(e,t){return t?e*(1e3/t):0}var Aa=function(e){return 1e3*e},Sa=function(e,t){return 1-3*t+3*e},wa=function(e,t){return 3*t-6*e},Ea=function(e){return 3*e},xa=function(e,t,n){return((Sa(t,n)*e+wa(t,n))*e+Ea(t))*e},Ba=function(e,t,n){return 3*Sa(t,n)*e*e+2*wa(t,n)*e+Ea(t)};var Ia=.1;function Ta(e,t,n,o){if(e===t&&n===o)return Wr;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=xa(r*Ia,e,n);function a(t){for(var o=0,r=1;10!==r&&i[r]<=t;++r)o+=Ia;--r;var a=o+(t-i[r])/(i[r+1]-i[r])*Ia,s=Ba(a,e,n);return s>=.001?function(e,t,n,o){for(var i=0;i<8;++i){var r=Ba(t,n,o);if(0===r)return t;t-=(xa(t,n,o)-e)/r}return t}(t,a,e,n):0===s?a:function(e,t,n,o,i){var r,a,s=0;do{(r=xa(a=t+(n-t)/2,o,i)-e)>0?n=a:t=a}while(Math.abs(r)>1e-7&&++s<10);return a}(t,o,o+Ia,e,n)}return function(e){return 0===e||1===e?e:xa(a(e),t,o)}}var ka={linear:Wr,easeIn:Nr,easeInOut:zr,easeOut:Vr,circIn:jr,circInOut:Ur,circOut:Hr,backIn:Zr,backInOut:Qr,backOut:Gr,anticipate:Yr,bounceIn:Kr,bounceInOut:function(e){return e<.5?.5*(1-Xr(1-2*e)):.5*Xr(2*e-1)+.5},bounceOut:Xr},Oa=function(e){if(Array.isArray(e)){e.length;var t=Object(Dn.c)(e,4);return Ta(t[0],t[1],t[2],t[3])}return"string"==typeof e?ka[e]:e},Da=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Er.test(t)||t.startsWith("url(")))},La=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Pa=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},_a=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ra=function(e){return{type:"keyframes",duration:.8,values:e}},Fa={x:La,y:La,z:La,rotate:La,rotateX:La,rotateY:La,rotateZ:La,scaleX:Pa,scaleY:Pa,scale:Pa,opacity:_a,backgroundColor:_a,color:_a,default:Pa},Ma=new Set(["brightness","contrast","saturate","opacity"]);function Wa(e){var t=e.slice(0,-1).split("("),n=t[0],o=t[1];if("drop-shadow"===n)return e;var i=(o.match(xo)||[])[0];if(!i)return e;var r=o.replace(i,""),a=Ma.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Na=/([a-z-]*)\(.*?\)/g,Va=Object(Dn.a)(Object(Dn.a)({},Er),{getAnimatableNone:function(e){var t=e.match(Na);return t?t.map(Wa).join(" "):e}}),za=Object(Dn.a)(Object(Dn.a)({},Vo),{color:vr,backgroundColor:vr,outlineColor:vr,fill:vr,stroke:vr,borderColor:vr,borderTopColor:vr,borderRightColor:vr,borderBottomColor:vr,borderLeftColor:vr,filter:Va,WebkitFilter:Va}),ja=function(e){return za[e]};function Ha(e,t){var n,o=ja(e);return o!==Va&&(o=Er),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,t)}function Ua(e){var t=e.ease,n=e.times,o=e.yoyo,i=e.flip,r=e.loop,a=Object(Dn.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(Dn.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=Aa(a.duration)),a.repeatDelay&&(s.repeatDelay=Aa(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(Oa):Oa(t)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function Za(e,t,n){var o,i,r,a;return Array.isArray(t.to)&&(null!==(o=e.duration)&&void 0!==o||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Object(Dn.e)([],Object(Dn.c)(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Object(Dn.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(Dn.a)(Object(Dn.a)({},e),(i=n,r=t.to,a=hi(r)?Ra:Fa[i]||Fa.default,Object(Dn.a)({to:r},a(r))))),Object(Dn.a)(Object(Dn.a)({},t),Ua(e))}function Ga(e,t,n,o,i){var r,a=Xa(o,e),s=null!==(r=a.from)&&void 0!==r?r:t.get(),l=Da(e,n);"none"===s&&l&&"string"==typeof n?s=Ha(e,n):Qa(s)&&"string"==typeof n?s=Ya(n):!Array.isArray(n)&&Qa(n)&&"string"==typeof s&&(n=Ya(s));var c=Da(e,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,o=void 0===n?0:n,i=e.velocity,r=void 0===i?0:i,a=e.min,s=e.max,l=e.power,c=void 0===l?.8:l,u=e.timeConstant,d=void 0===u?750:u,h=e.bounceStiffness,m=void 0===h?500:h,f=e.bounceDamping,p=void 0===f?10:f,g=e.restDelta,v=void 0===g?1:g,C=e.modifyTarget,b=e.driver,y=e.onUpdate,A=e.onComplete;function S(e){return void 0!==a&&e<a||void 0!==s&&e>s}function w(e){return void 0===a?s:void 0===s||Math.abs(a-e)<Math.abs(s-e)?a:s}function E(e){null==t||t.stop(),t=ba(Object(Dn.a)(Object(Dn.a)({},e),{driver:b,onUpdate:function(t){var n;null==y||y(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function x(e){E(Object(Dn.a)({type:"spring",stiffness:m,damping:p,restDelta:v},e))}if(S(o))x({from:o,velocity:r,to:w(o)});else{var B=c*r+o;"undefined"!=typeof C&&(B=C(B));var I,T,k=w(B),O=k===a?-1:1;E({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:C,onUpdate:S(B)?function(e){I=T,T=e,r=ya(e-I,pa().delta),(1===O&&e>k||-1===O&&e<k)&&x({from:e,to:k,velocity:r})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(Dn.a)(Object(Dn.a)({},o),a)):ba(Object(Dn.a)(Object(Dn.a)({},Za(a,o,e)),{onUpdate:function(e){var t;o.onUpdate(e),null===(t=a.onUpdate)||void 0===t||t.call(a,e)},onComplete:function(){var e;o.onComplete(),null===(e=a.onComplete)||void 0===e||e.call(a)}}))}:function(){var e;return t.set(n),i(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function Qa(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Ya(e){return"number"==typeof e?0:Ha("",e)}function Xa(e,t){return e[t]||e.default||e}function Ka(e,t,n,o){return void 0===o&&(o={}),t.start((function(i){var r,a,s=Ga(e,t,n,o,i),l=function(e,t){var n;return null!==(n=(Xa(e,t)||{}).delay)&&void 0!==n?n:0}(o,e),c=function(){return a=s()};return l?r=setTimeout(c,Aa(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function qa(e,t){-1===e.indexOf(t)&&e.push(t)}function Ja(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var $a=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return qa(this.subscriptions,e),function(){return Ja(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](e,t,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),es=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new $a,this.velocityUpdateSubscribers=new $a,this.renderSubscribers=new $a,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var o=pa(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ga.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ga.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t)))}return e.prototype.onChange=function(e){return this.updateSubscribers.add(e)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(e){return e(this.get()),this.renderSubscribers.add(e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?ya(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function ts(e){return new es(e)}var ns=function(e){return function(t){return t.test(e)}},os=[Fo,Lo,Do,Oo,_o,Po,{test:function(e){return"auto"===e},parse:function(e){return e}}],is=function(e){return os.find(ns(e))},rs=Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(os)),[vr,Er]),as=function(e){return rs.find(ns(e))};function ss(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ts(n))}function ls(e,t){var n=eo(e,t),o=n?e.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(Dn.d)(o,["transitionEnd","transition"]);for(var l in s=Object(Dn.a)(Object(Dn.a)({},s),r)){ss(e,l,(a=s[l],hi(a)?a[a.length-1]||0:a))}}function cs(e,t){if(t)return(t[e]||t.default||t).from}function us(e,t,n){var o;void 0===n&&(n={});var i=eo(e,t,n.custom),r=(i||{}).transition,a=void 0===r?e.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return ds(e,i,n)}:function(){return Promise.resolve()},l=(null===(o=e.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(e,t,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(e.variantChildren.size-1)*o,l=1===i?function(e){return void 0===e&&(e=0),e*o}:function(e){return void 0===e&&(e=0),s-e*o};return Array.from(e.variantChildren).sort(hs).forEach((function(e,o){a.push(us(e,t,Object(Dn.a)(Object(Dn.a)({},r),{delay:n+l(o)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(Dn.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function ds(e,t,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=e.makeTargetAnimatable(t),u=c.transition,d=void 0===u?e.getDefaultTransition():u,h=c.transitionEnd,m=Object(Dn.d)(c,["transition","transitionEnd"]);s&&(d=s);var f=[],p=l&&(null===(o=e.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in m){var v=e.getValue(g),C=m[g];if(!(!v||void 0===C||p&&ms(p,g))){var b=Ka(g,v,C,Object(Dn.a)({delay:a},d));f.push(b)}}return Promise.all(f).then((function(){h&&ls(e,h)}))}function hs(e,t){return e.sortNodePosition(t)}function ms(e,t){var n=e.protectedKeys,o=e.needsAnimating,i=n.hasOwnProperty(t)&&!0!==o[t];return o[t]=!1,i}var fs=[Ci.Animate,Ci.Hover,Ci.Tap,Ci.Drag,Ci.Focus,Ci.Exit],ps=Object(Dn.e)([],Object(Dn.c)(fs)).reverse(),gs=fs.length;function vs(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,o=t.options;return function(e,t,n){var o;if(void 0===n&&(n={}),e.notifyAnimationStart(),Array.isArray(t)){var i=t.map((function(t){return us(e,t,n)}));o=Promise.all(i)}else if("string"==typeof t)o=us(e,t,n);else{var r="function"==typeof t?eo(e,t,n.custom):t;o=ds(e,r,n)}return o.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,o)})))}}function Cs(e){var t,n=vs(e),o=((t={})[Ci.Animate]=bs(!0),t[Ci.Hover]=bs(),t[Ci.Tap]=bs(),t[Ci.Drag]=bs(),t[Ci.Focus]=bs(),t[Ci.Exit]=bs(),t),i={},r=!0,a=function(t,n){var o=eo(e,n);if(o){o.transition;var i=o.transitionEnd,r=Object(Dn.d)(o,["transition","transitionEnd"]);t=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},t),r),i)}return t};function s(t,s){for(var l,c=e.getProps(),u=e.getVariantContext(!0)||{},d=[],h=new Set,m={},f=1/0,p=function(n){var i=ps[n],p=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Jn(g),C=i===s?p.isActive:null;!1===C&&(f=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys=Object(Dn.a)({},m),!p.isActive&&null===C||!g&&!p.prevProp||di(g)||"boolean"==typeof g)return"continue";var y=function(e,t){if("string"==typeof t)return t!==e;if(qn(t))return!Qi(t,e);return!1}(p.prevProp,g)||i===s&&p.isActive&&!b&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===C&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,x=Object(Dn.a)(Object(Dn.a)({},E),S),B=function(e){y=!0,h.delete(e),p.needsAnimating[e]=!0};for(var I in x){var T=S[I],k=E[I];m.hasOwnProperty(I)||(T!==k?hi(T)&&hi(k)?Qi(T,k)?p.protectedKeys[I]=!0:B(I):void 0!==T?B(I):h.add(I):void 0!==T&&h.has(I)?B(I):p.protectedKeys[I]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(m=Object(Dn.a)(Object(Dn.a)({},m),S)),r&&e.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(Dn.e)([],Object(Dn.c)(A.map((function(e){return{animation:e,options:Object(Dn.a)({type:i},t)}})))))},g=0;g<gs;g++)p(g);if(i=Object(Dn.a)({},m),h.size){var v={};h.forEach((function(t){var n=e.getBaseTarget(t);void 0!==n&&(v[t]=n)})),d.push({animation:v})}var C=Boolean(d.length);return r&&!1===c.initial&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==i[e]},animateChanges:s,setActive:function(t,n,i){var r;return o[t].isActive===n?Promise.resolve():(null===(r=e.variantChildren)||void 0===r||r.forEach((function(e){var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)})),o[t].isActive=n,s(i,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return o}}}function bs(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var ys={animation:Zi((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=Cs(t)),di(n)&&Object(Wt.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:Zi((function(e){var t=e.custom,n=e.visualElement,o=Object(Dn.c)(zn(),2),i=o[0],r=o[1],a=Object(Wt.useContext)(Nn);Object(Wt.useEffect)((function(){var e,o,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Ci.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:t});!i&&(null==s||s.then(r))}),[i])}))},As=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},Ss=function(e){return As(e)&&e.hasOwnProperty("z")},ws=function(e,t){return Math.abs(e-t)};function Es(e,t){if(xr(e)&&xr(t))return ws(e,t);if(As(e)&&As(t)){var n=ws(e.x,t.x),o=ws(e.y,t.y),i=Ss(e)&&Ss(t)?ws(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var xs=function(){function e(e,t,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var e=Ts(o.lastMoveEventInfo,o.history),t=null!==o.startEvent,n=Es(e.offset,{x:0,y:0})>=3;if(t||n){var i=e.point,r=pa().timestamp;o.history.push(Object(Dn.a)(Object(Dn.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;t||(s&&s(o.lastMoveEvent,e),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){o.lastMoveEvent=e,o.lastMoveEventInfo=Bs(t,o.transformPagePoint),wi(e)&&0===e.buttons?o.handlePointerUp(e,t):ga.update(o.updatePoint,!0)},this.handlePointerUp=function(e,t){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Ts(Bs(t,o.transformPagePoint),o.history);o.startEvent&&i&&i(e,a),r&&r(e,a)},!(Ei(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=i;var r=Bs(Ti(e),this.transformPagePoint),a=r.point,s=pa().timestamp;this.history=[Object(Dn.a)(Object(Dn.a)({},a),{timestamp:s})];var l=t.onSessionStart;l&&l(e,Ts(r,this.history)),this.removeListeners=Ui(Pi(window,"pointermove",this.handlePointerMove),Pi(window,"pointerup",this.handlePointerUp),Pi(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),ua.update(this.updatePoint)},e}();function Bs(e,t){return t?{point:t(e.point)}:e}function Is(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ts(e,t){var n=e.point;return{point:n,delta:Is(n,Os(t)),offset:Is(n,ks(t)),velocity:Ds(t,.1)}}function ks(e){return e[0]}function Os(e){return e[e.length-1]}function Ds(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,o=null,i=Os(e);n>=0&&(o=e[n],!(i.timestamp-o.timestamp>Aa(t)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ls(e){return e}function Ps(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var _s={translate:0,scale:1,origin:0,originPoint:0};function Rs(){return{x:Object(Dn.a)({},_s),y:Object(Dn.a)({},_s)}}function Fs(e){return[e("x"),e("y")]}function Ms(e,t,n){var o=t.min,i=t.max;return void 0!==o&&e<o?e=n?ir(o,e,n.min):Math.max(e,o):void 0!==i&&e>i&&(e=n?ir(i,e,n.max):Math.min(e,i)),e}function Ws(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ns(e,t){var n,o=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&(o=(n=Object(Dn.c)([i,o],2))[0],i=n[1]),{min:e.min+o,max:e.min+i}}function Vs(e,t,n){return{min:zs(e,t),max:zs(e,n)}}function zs(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function js(e,t){return Ps(function(e,t){var n=e.top,o=e.left,i=e.bottom,r=e.right;void 0===t&&(t=Ls);var a=t({x:o,y:n}),s=t({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function Hs(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),Es(e,t)<n}function Us(e){return e.max-e.min}function Zs(e,t){var n=.5,o=Us(e),i=Us(t);return i>o?n=or(t.min,t.max-o,e.min):o>i&&(n=or(e.min,e.max-i,t.min)),Yi(0,1,n)}function Gs(e,t,n,o){void 0===o&&(o=.5),e.origin=o,e.originPoint=ir(t.min,t.max,e.origin),e.scale=Us(n)/Us(t),Hs(e.scale,1,1e-4)&&(e.scale=1),e.translate=ir(n.min,n.max,e.origin)-e.originPoint,Hs(e.translate)&&(e.translate=0)}function Qs(e,t,n,o){Gs(e.x,t.x,n.x,Ys(o.originX)),Gs(e.y,t.y,n.y,Ys(o.originY))}function Ys(e){return"number"==typeof e?e:.5}function Xs(e,t,n){e.min=n.min+t.min,e.max=e.min+Us(t)}var Ks=function(e,t){return e.depth-t.depth};function qs(e){return e.projection.isEnabled||e.shouldResetTransform()}function Js(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Js(n,t),qs(e)&&t.push(e),t}function $s(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Object(Dn.a)({},t.x),y:Object(Dn.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),ga.update((function(){return e.rebaseProjectionTarget()}))}}function el(e,t){return{min:t.min-e.min,max:t.max-e.min}}function tl(e,t){return{x:el(e.x,t.x),y:el(e.y,t.y)}}function nl(e,t){var n=e.getLayoutId(),o=t.getLayoutId();return n!==o||void 0===o&&e!==t}function ol(e){var t=e.getProps(),n=t.drag,o=t._dragX;return n&&!o}function il(e,t){e.min=t.min,e.max=t.max}function rl(e,t,n){return n+t*(e-n)}function al(e,t,n,o,i){return void 0!==i&&(e=rl(e,i,o)),rl(e,n,o)+t}function sl(e,t,n,o,i){void 0===t&&(t=0),void 0===n&&(n=1),e.min=al(e.min,t,n,o,i),e.max=al(e.max,t,n,o,i)}function ll(e,t){var n=t.x,o=t.y;sl(e.x,n.translate,n.scale,n.originPoint),sl(e.y,o.translate,o.scale,o.originPoint)}function cl(e,t,n,o){var i=Object(Dn.c)(o,3),r=i[0],a=i[1],s=i[2];e.min=t.min,e.max=t.max;var l=void 0!==n[s]?n[s]:.5,c=ir(t.min,t.max,l);sl(e,n[r],n[a],c,n.scale)}var ul=["x","scaleX","originX"],dl=["y","scaleY","originY"];function hl(e,t,n){cl(e.x,t.x,n,ul),cl(e.y,t.y,n,dl)}function ml(e,t,n,o,i){return e=rl(e-=t,1/n,o),void 0!==i&&(e=rl(e,1/i,o)),e}function fl(e,t,n){var o=Object(Dn.c)(n,3),i=o[0],r=o[1],a=o[2];!function(e,t,n,o,i){void 0===t&&(t=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=ir(e.min,e.max,o)-t;e.min=ml(e.min,t,n,r,i),e.max=ml(e.max,t,n,r,i)}(e,t[i],t[r],t[a],t.scale)}function pl(e,t){fl(e.x,t,ul),fl(e.y,t,dl)}var gl=new Set;function vl(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function Cl(e){return gl.add(e),function(){return gl.delete(e)}}function bl(){if(gl.size){var e=0,t=[[]],n=[],o=function(n){return vl(t,n,e)},i=function(t){vl(n,t,e),e++};gl.forEach((function(t){t(o,i),e=0})),gl.clear();for(var r=n.length,a=0;a<=r;a++)t[a]&&t[a].forEach(Al),n[a]&&n[a].forEach(Al)}}var yl,Al=function(e){return e()},Sl=new WeakMap,wl=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),Sl.set(t,this)}return e.prototype.start=function(e,t){var n=this,o=void 0===t?{}:t,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new xs(e,{onSessionStart:function(e){var t;n.stopMotion();var o=function(e){return Ti(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=Cl((function(e,t){var i=Js(n.visualElement),s=function(e){var t=[],n=function(e){qs(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(Ks)}(n.visualElement),l=Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(i)),Object(Dn.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){l.forEach((function(e){return e.resetTransform()}))})),e((function(){$s(n.visualElement),s.forEach($s)})),t((function(){l.forEach((function(e){return e.restoreTransform()})),r&&(c=n.snapToCursor(o))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;Fs((function(t){if(!c){var i=e.target[t],r=i.min,s=i.max;n.cursorProgress[t]=a?a[t]:or(r,s,o[t])}var l=n.getAxisMotionValue(t);l&&(n.originPoint[t]=l.get())}))})),t((function(){da.update(),da.preRender(),da.render(),da.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Wi(s),n.openGlobalLock))&&(bl(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,e,t),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Ci.Drag,!0))},onMove:function(e,t){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=t.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",t.point,u),n.updateAxis("y",t.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,e,t),yl=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,o=t.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Kn(n)?this.resolveRefConstraints(i,n):function(e,t){var n=t.top,o=t.left,i=t.bottom,r=t.right;return{x:Ws(e.x,o,r),y:Ws(e.y,n,i)}}(i,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:Vs(e,"left","right"),y:Vs(e,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&Fs((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(i[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=t.current;this.constraintsBox=js(r,i);var a=function(e,t){return{x:Ns(e.x,t.x),y:Ns(e.y,t.y)}}(e,this.constraintsBox);if(o){var s=o(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Ps(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(Ci.Drag,!1)},e.prototype.stop=function(e,t){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=t.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return Fs((function(n){if(El(n,t.props.drag,t.currentDirection)){var o=t.getAxisMotionValue(n);if(!o)return t.cursorProgress[n]=.5,!0;var i=t.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=e[n]-a;t.originPoint[n]=e[n],o.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(El(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var o=this.originPoint[e]+t[e],i=this.constraints?Ms(o,this.constraints[e],this.elastic[e]):o;n.set(i)}},e.prototype.updateVisualElementAxis=function(e,t){var n,o=this.visualElement.getLayoutState().layout[e],i=o.max-o.min,r=this.cursorProgress[e],a=function(e,t,n,o,i){var r=e-t*n;return o?Ms(r,o,i):r}(t[e],i,r,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+i)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,o=e.dragDirectionLock,i=void 0!==o&&o,r=e.dragPropagation,a=void 0!==r&&r,s=e.dragConstraints,l=void 0!==s&&s,c=e.dragElastic,u=void 0===c?.35:c,d=e.dragMomentum,h=void 0===d||d,m=Object(Dn.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(Dn.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},m)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,o=t.layoutId,i="_drag"+e.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,o=e.getProjectionParent();return!!o&&(t?pl(n=tl(o.projection.target,e.projection.target),o.getLatestValues()):n=tl(o.getLayoutState().layout,e.getLayoutState().layout),Fs((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=tl(c.projection.targetFinal,l);Fs((function(e){var t=u[e],n=t.min,o=t.max;l[e]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=Fs((function(n){var c;if(El(n,o,t.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,m=Object(Dn.a)(Object(Dn.a)({type:"inertia",velocity:i?e[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,m):t.visualElement.startLayoutAnimation(n,m,s)}}));return Promise.all(d).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;Fs((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var o=n.get();return n.set(o),n.set(o),Ka(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(Kn(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};Fs((function(t){o[t]=Zs(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){Fs((function(t){if(El(t,n,null)){var i=function(e,t,n){var o=e.max-e.min,i=ir(t.min,t.max-o,n);return{min:i,max:i+o}}(e.visualElement.projection.target[t],e.constraintsBox[t],o[t]),r=i.min,a=i.max;e.visualElement.setProjectionTargetAxis(t,r,a)}}))})),setTimeout(bl,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=Cl((function(n,o){var i=Js(t.visualElement);o((function(){return i.forEach((function(e){return e.resetTransform()}))})),n((function(){return $s(t.visualElement)})),o((function(){return i.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&o(e)}))},e.prototype.mount=function(e){var t=this,n=Pi(e.getInstance(),"pointerdown",(function(e){var n=t.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&t.start(e)})),o=Ai(window,"resize",(function(){t.scalePoint()})),i=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),r=e.prevDragCursor;return r&&this.start(yl,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),t.cancelDrag()}},e}();function El(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var xl,Bl,Il={pan:Zi((function(e){var t=e.onPan,n=e.onPanStart,o=e.onPanEnd,i=e.onPanSessionStart,r=e.visualElement,a=t||n||o||i,s=Object(Wt.useRef)(null),l=Object(Wt.useContext)(Mn).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,o&&o(e,t)}};Object(Wt.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_i(r,"pointerdown",a&&function(e){s.current=new xs(e,c,{transformPagePoint:l})}),ji((function(){return s.current&&s.current.end()}))})),drag:Zi((function(e){var t=e.dragControls,n=e.visualElement,o=Object(Wt.useContext)(Mn).transformPagePoint,i=Vn((function(){return new wl({visualElement:n})}));i.setProps(Object(Dn.a)(Object(Dn.a)({},e),{transformPagePoint:o})),Object(Wt.useEffect)((function(){return t&&t.subscribe(i)}),[i]),Object(Wt.useEffect)((function(){return i.mount(n)}),[])}))};function Tl(e){return"string"==typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(xl||(xl={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Bl||(Bl={}));var kl=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ol(e,t,n){void 0===n&&(n=1);var o=Object(Dn.c)(function(e){var t=kl.exec(e);if(!t)return[,];var n=Object(Dn.c)(t,3);return[n[1],n[2]]}(e),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(t).getPropertyValue(i);return a?a.trim():Tl(r)?Ol(r,t,n+1):r}}function Dl(e,t){return e/(t.max-t.min)*100}var Ll="_$css";var Pl={process:function(e,t,n){var o=n.target;if("string"==typeof e){if(!Lo.test(e))return e;e=parseFloat(e)}return Dl(e,o.x)+"% "+Dl(e,o.y)+"%"}},_l={borderRadius:Object(Dn.a)(Object(Dn.a)({},Pl),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Pl,borderTopRightRadius:Pl,borderBottomLeftRadius:Pl,borderBottomRightRadius:Pl,boxShadow:{process:function(e,t){var n=t.delta,o=t.treeScale,i=e,r=e.includes("var("),a=[];r&&(e=e.replace(kl,(function(e){return a.push(e),Ll})));var s=Er.parse(e);if(s.length>5)return i;var l=Er.createTransformer(e),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=ir(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var m=l(s);if(r){var f=0;m=m.replace(Ll,(function(){var e=a[f];return f++,e}))}return m}}},Rl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(Dn.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,h=d.visualElement,m=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=i||n,e=r||e;var f=!1,p=h.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!nl(c,p)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&zl(c,i,r)&&(f=!0,n=tl(g,n),e=tl(v,e))}var C=Fl(n,e),b=Fs((function(o){var i,r;if("position"===m){var s=e[o].max-e[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?C?t.animateAxis(o,e[o],n[o],Object(Dn.a)(Object(Dn.a)({},u),{isRelative:f})):(null===(r=(i=t.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,e[o].min,e[o].max,f)):void h.setVisibility(a===Bl.Show)}));return h.syncRender(),Promise.all(b).then((function(){t.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},t}return Object(Dn.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=Ka,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)co[t]=e[t]}(_l)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),Fs((function(t){var n,o;return null===(o=(n=e.stopAxisAnimation)[t])||void 0===o?void 0:o.call(n)}))},t.prototype.animateAxis=function(e,t,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[e]||!Nl(t,this.currentAnimationTarget[e])){null===(r=(i=this.stopAxisAnimation)[e])||void 0===r||r.call(i),this.isAnimating[e]=!0;var u=this.props.visualElement,d=this.frameTarget[e],h=u.getProjectionAnimationProgress()[e];h.clearListeners(),h.set(0),h.set(0);var m=function(){var o=h.get()/1e3;!function(e,t,n,o){e.min=ir(t.min,n.min,o),e.max=ir(t.max,n.max,o)}(d,n,t,o),u.setProjectionTargetAxis(e,d.min,d.max,c)};m();var f=h.onChange(m);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,h.stop(),f()},this.currentAnimationTarget[e]=t;var p=l||u.getDefaultTransition()||Vl;return Ka("x"===e?"layoutX":"layoutY",h,1e3,p&&Xa(p,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(Wt.Component);function Fl(e,t){return!(Wl(e)||Wl(t)||Nl(e.x,t.x)&&Nl(e.y,t.y))}var Ml={min:0,max:0};function Wl(e){return Nl(e.x,Ml)&&Nl(e.y,Ml)}function Nl(e,t){return e.min===t.min&&e.max===t.max}var Vl={duration:.45,ease:[.4,0,.1,1]};function zl(e,t,n){return e||!e&&!(t||n)}var jl={layoutReady:function(e){return e.notifyLayoutReady()}};function Hl(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?jl:t,o=n.layoutReady,i=n.parent;Cl((function(t,n){var r=Array.from(e).sort(Ks),a=i?Js(i):[];n((function(){Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(a)),Object(Dn.c)(r)).forEach((function(e){return e.resetTransform()}))})),t((function(){r.forEach($s)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),r.forEach(o)})),t((function(){r.forEach((function(e){e.isPresent&&(e.presence=xl.Present)}))})),n((function(){da.preRender(),da.render()})),t((function(){ga.postRender((function(){return r.forEach(Ul)})),e.clear()}))})),bl()}}}function Ul(e){e.prevViewportBox=e.projection.target}var Zl=Object(Wt.createContext)(Hl()),Gl=Object(Wt.createContext)(Hl());function Ql(e){return!!e.forceUpdate}var Yl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(Dn.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,o=e.visualElement;Ql(t)&&t.register(o),Ql(n)&&n.register(o),o.onUnmount((function(){Ql(t)&&t.remove(o),Ql(n)&&n.remove(o)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Ql(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;Ql(e)||e.flush()},t.prototype.render=function(){return null},t}(Wt.default.Component);var Xl={measureLayout:function(e){var t=Object(Wt.useContext)(Zl),n=Object(Wt.useContext)(Gl);return Wt.default.createElement(Yl,Object(Dn.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(Dn.c)(zn(),2)[1];return Wt.createElement(Rl,Object(Dn.a)({},e,{safeToRemove:t}))}};function Kl(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Rs(),deltaFinal:Rs(),deltaTransform:""}}var ql=Kl();function Jl(e,t,n){var o=e.x,i=e.y,r="translate3d("+o.translate/t.x+"px, "+i.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==ec?r:""}function $l(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var ec=Jl(ql.delta,ql.treeScale,{x:1,y:1}),tc=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function nc(e,t,n,o){var i,r,a=e.delta,s=e.layout,l=e.layoutCorrected,c=e.treeScale,u=t.target;r=s,il((i=l).x,r.x),il(i.y,r.y),function(e,t,n){var o=n.length;if(o){var i,r;t.x=t.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,t.x*=r.x.scale,t.y*=r.y.scale,ll(e,r),ol(i)&&hl(e,e,i.getLatestValues())}}(l,c,n),Qs(a,l,u,o)}var oc=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){qa(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Ja(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(Ks),this.isDirty=!1,this.children.forEach(e)},e}();var ic=function(e){var t=e.treeType,n=void 0===t?"":t,o=e.build,i=e.getBaseTarget,r=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,l=e.readValueFromInstance,c=e.resetTransform,u=e.restoreTransform,d=e.removeValueFromRenderState,h=e.sortNodePosition,m=e.scrapeMotionValuesFromProps;return function(e,t){var f=e.parent,p=e.props,g=e.presenceId,v=e.blockInitialAnimation,C=e.visualState;void 0===t&&(t={});var b,y,A,S,w,E,x=C.latestValues,B=C.renderState,I=function(){var e=tc.map((function(){return new $a})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return tc.forEach((function(o){var i;null===(i=t[o])||void 0===i||i.call(t);var r="on"+o,a=e[r];a&&(t[o]=n[r](a))}))}};return e.forEach((function(e,t){n["on"+tc[t]]=function(t){return e.add(t)},n["notify"+tc[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(Dn.e)([],Object(Dn.c)(t)))}})),n}(),T={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},k=T,O=x,D=Kl(),L=!1,P=new Map,_=new Map,R={},F=Object(Dn.a)({},x);function M(){b&&(G.isProjectionReady()&&(hl(k.targetFinal,k.target,O),Qs(D.deltaFinal,D.layoutCorrected,k.targetFinal,x)),W(),s(b,B))}function W(){var e=x;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}o(G,B,e,k,D,t,p)}function N(){I.notifyUpdate(x)}function V(){G.layoutTree.forEach(ac)}var z=m(p);for(var j in z){var H=z[j];void 0!==x[j]&&bo(H)&&H.set(x[j],!1)}var U=to(p),Z=no(p),G=Object(Dn.a)(Object(Dn.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new oc,presenceId:g,projection:T,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(e){b=G.current=e,G.pointTo(G),Z&&f&&!U&&(E=null==f?void 0:f.addVariantChild(G)),null==f||f.children.add(G)},unmount:function(){ua.update(N),ua.render(M),ua.preRender(G.updateLayoutProjection),_.forEach((function(e){return e()})),G.stopLayoutAnimation(),G.layoutTree.remove(G),null==E||E(),null==f||f.children.delete(G),null==A||A(),I.clearAllListeners()},addVariantChild:function(e){var t,n=G.getClosestVariantNode();if(n)return null===(t=n.variantChildren)||void 0===t||t.add(e),function(){return n.variantChildren.delete(e)}},sortNodePosition:function(e){return h&&n===e.treeType?h(G.getInstance(),e.getInstance()):0},getClosestVariantNode:function(){return Z?G:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return ga.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return b},getStaticValue:function(e){return x[e]},setStaticValue:function(e,t){return x[e]=t},getLatestValues:function(){return x},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),r(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),P.set(e,t),x[e]=t.get(),function(e,t){var n=t.onChange((function(t){x[e]=t,p.onUpdate&&ga.update(N,!1,!0)})),o=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),o()}))}(e,t)},removeValue:function(e){var t;P.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete x[e],d(e,B)},hasValue:function(e){return P.has(e)},getValue:function(e,t){var n=P.get(e);return void 0===n&&void 0!==t&&(n=ts(t),G.addValue(e,n)),n},forEachValue:function(e){return P.forEach(e)},readValue:function(e){var n;return null!==(n=x[e])&&void 0!==n?n:l(b,e,t)},setBaseTarget:function(e,t){F[e]=t},getBaseTarget:function(e){if(i){var t=i(p,e);if(void 0!==t&&!bo(t))return t}return F[e]}},I),{build:function(){return W(),B},scheduleRender:function(){ga.render(M,!1,!0)},syncRender:M,setProps:function(e){p=e,I.updatePropListeners(e),R=function(e,t,n){var o;for(var i in t){var r=t[i],a=n[i];if(bo(r))e.addValue(i,r);else if(bo(a))e.addValue(i,ts(r));else if(a!==r)if(e.hasValue(i)){var s=e.getValue(i);!s.hasAnimated&&s.set(r)}else e.addValue(i,ts(null!==(o=e.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===t[i]&&e.removeValue(i);return t}(G,m(p),R)},getProps:function(){return p},getVariant:function(e){var t;return null===(t=p.variants)||void 0===t?void 0:t[e]},getDefaultTransition:function(){return p.transition},getVariantContext:function(e){if(void 0===e&&(e=!1),e)return null==f?void 0:f.getVariantContext();if(!U){var t=(null==f?void 0:f.getVariantContext())||{};return void 0!==p.initial&&(t.initial=p.initial),t}for(var n={},o=0;o<cc;o++){var i=lc[o],r=p[i];(Jn(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){T.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){T.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),T.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(e){S=e},isProjectionReady:function(){return T.isEnabled&&T.isHydrated&&D.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var o=G.getProjectionAnimationProgress()[e],i=n?T.relativeTarget[e]:T.target[e],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,o,0,t)},stopLayoutAnimation:function(){Fs((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(b,t);return e||pl(n,x),n},getProjectionAnimationProgress:function(){return w||(w={x:ts(0),y:ts(0)}),w},setProjectionTargetAxis:function(e,t,n,o){var i;void 0===o&&(o=!1),o?(T.relativeTarget||(T.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=T.relativeTarget[e]):(T.relativeTarget=void 0,i=T.target[e]),T.isHydrated=!0,i.min=t,i.max=n,L=!0,I.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=D.layout);var n=G.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(T.relativeTarget||T.isTargetLocked||o.isAnimating()||i.isAnimating());(e||r)&&Fs((function(e){var n=t[e],o=n.min,i=n.max;G.setProjectionTargetAxis(e,o,i)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=tl(t.getLayoutState().layout,e.getLayoutState().layout);Fs((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(D.layout,G.prevViewportBox||D.layout,e)},resetTransform:function(){return c(G,b,p)},restoreTransform:function(){return u(b,B)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=D.delta,t=D.treeScale,n=t.x,o=t.y,i=D.deltaTransform;nc(D,k,G.path,x),L&&G.notifyViewportBoxUpdate(k.target,e),L=!1;var r=Jl(e,t);r===i&&n===t.x&&o===t.y||G.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(rc),ga.preRender(V,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var e=!1,t=G.path.length-1;t>=0;t--){var n=G.path[t];if(n.projection.isEnabled){e=n;break}}y=e}return y},resolveRelativeTargetBox:function(){var e=G.getProjectionParent();if(T.relativeTarget&&e&&(function(e,t){Xs(e.target.x,e.relativeTarget.x,t.target.x),Xs(e.target.y,e.relativeTarget.y,t.target.y)}(T,e.projection),ol(e))){var t=T.target;hl(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){k=e.projection,O=e.getLatestValues(),null==A||A(),A=Ui(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=xl.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:xl.Entering});return G}};function rc(e){e.resolveRelativeTargetBox()}function ac(e){e.updateLayoutProjection()}var sc,lc=Object(Dn.e)(["initial"],Object(Dn.c)(fs)),cc=lc.length,uc=new Set(["width","height","top","left","right","bottom","x","y"]),dc=function(e){return uc.has(e)},hc=function(e,t){e.set(t,!1),e.set(t)},mc=function(e){return e===Fo||e===Lo};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(sc||(sc={}));var fc=function(e,t){return parseFloat(e.split(", ")[t])},pc=function(e,t){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return fc(r[1],t);var a=i.match(/^matrix\((.+)\)$/);return a?fc(a[1],e):0}},gc=new Set(["x","y","z"]),vc=ho.filter((function(e){return!gc.has(e)}));var Cc={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,o=t.top;return parseFloat(o)+(n.max-n.min)},right:function(e,t){var n=e.x,o=t.left;return parseFloat(o)+(n.max-n.min)},x:pc(4,13),y:pc(5,14)},bc=function(e,t,n,o){void 0===n&&(n={}),void 0===o&&(o={}),t=Object(Dn.a)({},t),o=Object(Dn.a)({},o);var i=Object.keys(t).filter(dc),r=[],a=!1,s=[];if(i.forEach((function(i){var l=e.getValue(i);if(e.hasValue(i)){var c,u=n[i],d=t[i],h=is(u);if(hi(d))for(var m=d.length,f=null===d[0]?1:0;f<m;f++)c?is(d[f]):(c=is(d[f]))===h||mc(h)&&mc(c);else c=is(d);if(h!==c)if(mc(h)&&mc(c)){var p=l.get();"string"==typeof p&&l.set(parseFloat(p)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&c===Lo&&(t[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):t[i]=h.transform(d):(a||(r=function(e){var t=[];return vc.forEach((function(n){var o=e.getValue(n);void 0!==o&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),t.length&&e.syncRender(),t}(e),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:t[i],hc(l,d))}})),s.length){var l=function(e,t,n){var o=t.measureViewportBox(),i=t.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var l=t.measureViewportBox();return n.forEach((function(n){var i=t.getValue(n);hc(i,Cc[n](o,s)),e[n]=Cc[n](l,r)})),e}(t,e,s);return r.length&&r.forEach((function(t){var n=Object(Dn.c)(t,2),o=n[0],i=n[1];e.getValue(o).set(i)})),e.syncRender(),{target:l,transitionEnd:o}}return{target:t,transitionEnd:o}};function yc(e,t,n,o){return function(e){return Object.keys(e).some(dc)}(t)?bc(e,t,n,o):{target:t,transitionEnd:o}}var Ac=function(e,t,n,o){var i=function(e,t,n){var o,i=Object(Dn.d)(t,[]),r=e.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(Dn.a)({},n)),e.forEachValue((function(e){var t=e.get();if(Tl(t)){var n=Ol(t,r);n&&e.set(n)}})),i){var s=i[a];if(Tl(s)){var l=Ol(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(e,t,o);return yc(e,t=i.target,n,o=i.transitionEnd)};var Sc={treeType:"dom",readValueFromInstance:function(e,t){if(po(t)){var n=ja(t);return n&&n.default||0}var o,i=(o=e,window.getComputedStyle(o));return(Ao(t)?i.getPropertyValue(t):i[t])||0},sortNodePosition:function(e,t){return 2&e.compareDocumentPosition(t)?1:-1},getBaseTarget:function(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]},measureViewportBox:function(e,t){return js(e,t.transformPagePoint)},resetTransform:function(e,t,n){var o=n.transformTemplate;t.style.transform=o?o({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,o=t.style;delete n[e],delete o[e]},makeTargetAnimatable:function(e,t,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=t.transition,a=t.transitionEnd,s=Object(Dn.d)(t,["transition","transitionEnd"]),l=function(e,t,n){var o,i,r={};for(var a in e)r[a]=null!==(o=cs(a,t))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},e);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(e,t,n){var o,i,r,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=t[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:e.readValue(u))&&void 0!==i?i:t[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!as(h)&&Er.test(d)&&(h=Ha(u,d)),e.addValue(u,ts(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),e.setBaseTarget(u,h))}}(e,s,l);var c=Ac(e,s,l,a);a=c.transitionEnd,s=c.target}return Object(Dn.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:ci,build:function(e,t,n,o,i,r,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;zo(t,n,o,i,r,a.transformTemplate,s?Jl:void 0,s?$l:void 0)},render:ai},wc=ic(Sc),Ec=ic(Object(Dn.a)(Object(Dn.a)({},Sc),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return po(t)?(null===(n=ja(t))||void 0===n?void 0:n.default)||0:(t=si.has(t)?t:ri(t),e.getAttribute(t))},scrapeMotionValuesFromProps:ui,build:function(e,t,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;ei(t,n,o,i,r,a.transformTemplate,s?Jl:void 0,s?$l:void 0)},render:li})),xc=function(e,t){return lo(e)?Ec(t,{enableHardwareAcceleration:!1}):wc(t,{enableHardwareAcceleration:!0})},Bc=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},ys),Gi),Il),Xl),Ic=ao((function(e,t){return yi(e,t,Bc,xc)}));class Tc{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var kc=n(8);class Oc{static now(){return Date.now()}}function Dc(e){var t=Vn((function(){return ts(e)}));if(Object(Wt.useContext)(Mn).isStatic){var n=Object(Dn.c)(Object(Wt.useState)(e),2)[1];Object(Wt.useEffect)((function(){return t.onChange(n)}),[])}return t}var Lc=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function Pc(e,t){var n=Dc(t()),o=function(){return n.set(t())};return o(),function(e,t){Object(Wt.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return ga.update(o,!1,!0)})),n}function _c(e,t,n,o){var i="function"==typeof t?t:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!Array.isArray(e[0]),o=n?0:-1,i=e[0+o],r=e[1+o],a=e[2+o],s=e[3+o],l=Pr(r,a,Object(Dn.a)({mixer:Lc(a[0])},s));return n?l(i):l}(t,n,o);return Array.isArray(e)?Rc(e,i):Rc([e],(function(e){var t=Object(Dn.c)(e,1)[0];return i(t)}))}function Rc(e,t){var n=Vn((function(){return[]}));return Pc(e,(function(){n.length=0;for(var o=e.length,i=0;i<o;i++)n[i]=e[i].get();return t(n)}))}function Fc(e,t,n){void 0===n&&(n={});var o=bo(e)?e:ts(e);return Ka("",o,t,n),{stop:function(){return o.stop()}}}var Mc=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class Wc extends Wt.default.Component{constructor(e){super(e),this.state={element:e.element}}update(e){this.setState({element:e})}style(e){this.customStyle=e,this.forceUpdate()}render(){var e,t,n,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,m=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,p=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return Wt.default.createElement(Nc,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:m,cornerRadius:f})}}function Nc(e){var{points:t,cornerRadius:n}=e,o=Mc(e,["points","cornerRadius"]);const i=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],r=i.map(Dc),a=_c(r,(([e,t,o,i,r,a,s,l])=>{const c=[{x:e,y:t},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return kc.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(Wt.useEffect)((()=>{const e=[];for(let t=0;t<i.length;t++)e.push(Fc(r[t],i[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),Wt.default.createElement(Ic.path,Object.assign({d:a},o))}class Vc{constructor(){this.detectedAt=0}update(e,t,n,o,i,r){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=o,this.element=i,this.updatedAt=r}}class zc extends Wt.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=xn(e),o=n.get(t);o?o.push(e):n.set(t,[e])})),n.forEach(((t,o)=>{t.length<2?n.delete(o):t.forEach(((t,n)=>{e.splice(e.indexOf(t),1)}))})),n.forEach(((n,o)=>{const i=e=>{let t={x:0,y:0};return e.forEach((e=>{t.x+=e.x,t.y+=e.y})),t.x/=e.length,t.y/=e.length,t},r=t.width/2,a=n.reduce(((e,t)=>{const n=i(e.quad),o=i(t.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Tc(o);r.points=void 0===e?kc.a.scaleListToHtmlElement(o.quad,n,t.video):o.quad.map((t=>{const o=new kc.a(t.x,t.y);return o.x*=e.width/n.width,o.y*=e.height/n.height,o.y+=e.y,o.x+=e.x,o})),r.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((e=>{const t=i.find((t=>En(t.code,e.element.code)));let n=!1;const o=Oc.now();void 0===t?e.updatedAt+1e3<o&&(n=!0):(e.element=t,e.polygon=Wt.default.createElement(Wc,{key:xn(e.element.code),ref:t=>e.polygonRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)}),e.label=Wt.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:xn(e.element.code),ref:t=>e.labelRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)})),this.props.configuration.automaticSelectionEnabled&&this.props.configuration.countingRepeatDelay>-1&&e.detectedAt>0&&o>this.props.configuration.countingRepeatDelay+e.detectedAt&&(this.props.onPolygonSelected(t.code),e.detectedAt=o),e.updatedAt=o),n||r.push(e)})),i.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>En(t.element.code,e.code)))){let t,n;const o=new Vc,i=Wt.default.createElement(Wc,{key:xn(e.code),ref:o=>{t=o,void 0!==n&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}),a=Wt.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:xn(e.code),ref:o=>{n=o,void 0!==t&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}));o.update(i,t,a,n,e,Oc.now()),r.push(o)}})),this.setState({polygonElements:r})}onPolygonClick(e){var t,n,o,i;let r;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const o=t.labelRef,i=t.label.props.element;En(i.code,e.code)&&(r=t),o&&En(i.code,e.code)&&(o.update(e),null===(n=t.polygonRef)||void 0===n||n.update(e))})),e.highlighted&&(null===(n=(t=this.props).onPolygonSelected)||void 0===n||n.call(t,e.code),r&&(r.detectedAt=Oc.now())),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,e.code)}render(){var e,t;return Wt.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},Wt.default.createElement(Ic.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((e=>e.polygon))),null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((e=>e.label)))}}var jc=n(42),Hc=n.n(jc),Uc=n(45),Zc={insert:"head",singleton:!1},Gc=(Hc()(Uc.a,Zc),Uc.a.locals,n(28)),Qc=n.n(Gc);class Yc{constructor(e){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=e}setDuration(e){const t=Date.now()/1e3,n=t-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const o=-e*this.t;this.element&&(this.element.style.animationDuration=`${e}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=t,this.lastDuration=e}}class Xc extends Wt.default.Component{constructor(){super(...arguments),this.inner1=new Yc("scanbot-shutter-rotate"),this.inner2=new Yc("scanbot-shutter-rotate")}render(){return Wt.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(e){"searching"==e?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,Wt.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==e||"manual"==e,"scanbot-shutter-fade-out":"searching"==e||"capturing"==e,"scanbot-shutter-pulse-fast":"processing"==e},Wt.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},Wt.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},Wt.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(e=>{this.inner1.element=e}))}captureSearchingInner2(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},Wt.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(e=>{this.inner2.element=e}))}path(e){return Wt.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return Wt.default.createElement("div",{className:Qc()(e),ref:n},Wt.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class Kc extends Wt.default.Component{render(){return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_919_23088)"},Wt.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class qc extends Wt.default.Component{render(){return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_919_23102)"},Wt.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Jc extends Wt.default.Component{constructor(e){super(e),this.state={barcodes:void 0}}update(e){this.setState({barcodes:e})}didScan(){return void 0!==this.state.barcodes}render(){var e,t;return Wt.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:kn.ScanbotPrimary}},Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},Wt.default.createElement(Kc,null),Wt.default.createElement("div",{style:{backgroundColor:kn.Orange,color:kn.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(t=null===(e=this.state.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)),Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},Wt.default.createElement(Xc,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},Wt.default.createElement("div",{style:{fontSize:13,color:kn.White,marginRight:10}},"Scan More"),Wt.default.createElement(qc,null)))}}class $c extends Wt.default.Component{render(){const e=kc.a.centerOf(this.props.points),t=kc.a.smallerSizeOfQuad(this.props.points)/40;return Wt.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:e.x-20,top:e.y-20,transform:`scale(${t})`}},Wt.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},Wt.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_910_20901)"},Wt.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),Wt.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var eu=n(11);class tu extends Wt.default.Component{constructor(e){super(e),this.state={elements:[],imageSize:eu.a.empty()}}update(e){const t=[];e.barcodes.forEach((n=>{const o=new Tc(n);o.points=kc.a.scaleListToHtmlElement(n.quad,e.originalImageSize,this.image),t.push(o)})),this.setState({imageSize:eu.a.fromHtmlElement(this.image),elements:t})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:Wt.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},Wt.default.createElement("img",{style:{maxWidth:"100%"},ref:e=>this.image=e,src:`${this.props.image}`}),Wt.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((e,t)=>Wt.default.createElement($c,{key:t,points:e.points})))))}}class nu extends Wt.default.Component{render(){if(!this.props.visible)return null;const e=Sn.a.svg`
31
+ `;var a=e=>i.default.createElement(r,{viewBox:"0 0 50 50"},i.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:e.color||"black"})),s=n(27),c=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class l{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends i.default.Component{constructor(e){super(e),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:e}=this.props;e&&e(this)}))},this.onVideoError=e=>{if(!0===this.state.videoReady){const{onError:t}=this.props.configuration;t?t(e):console.error(e)}else{const{onFailure:t}=this.props;t&&t(e),this.dispose()}},this.state=new u}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:o.a.instance).bridge}dispose(){const{container:e}=this.props;e&&Object(i.render)(null,e)}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return c(this,void 0,void 0,(function*(){this.camera.switchCamera(e,t)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(e){return this.state.videoReady&&this.state.sdkReady?null:i.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},i.default.createElement(a,{color:e}))}setTorchState(e){return this.camera.setTorchState(e)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class o extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new o(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new o(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(e){return new o(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",e)}static permissionDenied(e){return new o(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new o(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",e)}static tryCheckPermission(){return i(this,void 0,void 0,(function*(){if(!this.permissionState)try{const e=yield navigator.permissions.query({name:"camera"});this.permissionState=e.state}catch(e){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(e){return e instanceof DOMException?"NotAllowedError"===e.name?o.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?o.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:o.unknown(null==e?void 0:e.message)}}o.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},o.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(40);class o extends i.a{constructor(e){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:e.width},height:{ideal:e.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(e,t){e.videoConstraints&&this.mapValues(e.videoConstraints,t.videoConstraints)}}o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return v})),n.d(t,"Resolution",(function(){return C})),n.d(t,"CameraConfiguration",(function(){return y})),n.d(t,"TopBarConfiguration",(function(){return A.a})),n.d(t,"ActionBarConfiguration",(function(){return S})),n.d(t,"BarcodeUseCase",(function(){return b})),n.d(t,"Palette",(function(){return m.f})),n.d(t,"StyledText",(function(){return m.j})),n.d(t,"IconStyle",(function(){return m.e})),n.d(t,"PolygonStyle",(function(){return m.g})),n.d(t,"BackgroundStyle",(function(){return m.a})),n.d(t,"ForegroundStyle",(function(){return m.d})),n.d(t,"RoundButton",(function(){return m.h})),n.d(t,"BadgedButton",(function(){return m.b})),n.d(t,"ButtonConfiguration",(function(){return m.c})),n.d(t,"Sound",(function(){return m.i})),n.d(t,"Vibration",(function(){return m.l})),n.d(t,"Timeouts",(function(){return m.k})),n.d(t,"ViewFinderConfiguration",(function(){return P})),n.d(t,"FinderStyle",(function(){return O})),n.d(t,"FinderCorneredStyle",(function(){return _})),n.d(t,"FinderStrokedStyle",(function(){return R})),n.d(t,"UserGuidanceConfiguration",(function(){return F.a})),n.d(t,"BarcodeItemErrorState",(function(){return f})),n.d(t,"BarcodeMappedData",(function(){return p})),n.d(t,"BarcodeInfoMapping",(function(){return g})),n.d(t,"ExpectedBarcode",(function(){return I})),n.d(t,"FindAndPickScanningMode",(function(){return k})),n.d(t,"BarcodeTextLocalization",(function(){return M})),n.d(t,"BarcodeRecognizerConfiguration",(function(){return N})),n.d(t,"ArOverlayPolygonConfiguration",(function(){return d.c})),n.d(t,"BarcodeItemConfiguration",(function(){return d.e})),n.d(t,"BadgeStyle",(function(){return d.d})),n.d(t,"ArOverlayGeneralConfiguration",(function(){return d.b})),n.d(t,"FindAndPickArOverlayPolygonConfiguration",(function(){return d.f})),n.d(t,"FindAndPickBadgeConfiguration",(function(){return d.g})),n.d(t,"ArOverlayFindAndPickConfiguration",(function(){return d.a})),n.d(t,"BarcodeScannerConfiguration",(function(){return W})),n.d(t,"BarcodeScannerUIItem",(function(){return j})),n.d(t,"BarcodeScannerUIResult",(function(){return H})),n.d(t,"OcrResult",(function(){return U.OcrResult})),n.d(t,"FieldValidationStatusValues",(function(){return U.FieldValidationStatusValues})),n.d(t,"FieldDataFormatValues",(function(){return U.FieldDataFormatValues})),n.d(t,"FieldParsedData",(function(){return U.FieldParsedData})),n.d(t,"FieldType",(function(){return U.FieldType})),n.d(t,"Field",(function(){return U.Field})),n.d(t,"GenericDocumentType",(function(){return U.GenericDocumentType})),n.d(t,"GenericDocument",(function(){return U.GenericDocument})),n.d(t,"Sheet",(function(){return w})),n.d(t,"SwipeToDelete",(function(){return E})),n.d(t,"ManualCountEditDialog",(function(){return x})),n.d(t,"SheetContent",(function(){return D})),n.d(t,"MultipleScanningMode",(function(){return B})),n.d(t,"ScanbotAlertDialog",(function(){return T})),n.d(t,"CameraPermissionScreen",(function(){return V})),n.d(t,"BarcodeItem",(function(){return z.BarcodeItem})),n.d(t,"AcknowledgementBottomBar",(function(){return Q})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return q})),n.d(t,"ShutterButton",(function(){return ce})),n.d(t,"PreviewButton",(function(){return te})),n.d(t,"ScanAssistanceOverlay",(function(){return le})),n.d(t,"PagePreviewMode",(function(){return ue})),n.d(t,"TextButtonMode",(function(){return de})),n.d(t,"NoButtonMode",(function(){return me})),n.d(t,"CameraBottomBar",(function(){return he})),n.d(t,"PageSnapFeedbackMode",(function(){return ne})),n.d(t,"PageSnapFunnelAnimation",(function(){return fe})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return pe})),n.d(t,"PageSnapFeedbackNone",(function(){return ge})),n.d(t,"CaptureFeedback",(function(){return ve})),n.d(t,"DocumentPolygonConfiguration",(function(){return Ce})),n.d(t,"SelectCameraMenu",(function(){return ye})),n.d(t,"CameraScreenConfiguration",(function(){return be})),n.d(t,"CroppingBottomBar",(function(){return Ae})),n.d(t,"CroppingScreenConfiguration",(function(){return Se})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return K})),n.d(t,"DocumentScannerOutputSettings",(function(){return Ee})),n.d(t,"DocumentScannerScreens",(function(){return Ie})),n.d(t,"DocumentScannerTextLocalization",(function(){return ke})),n.d(t,"UserGuidanceStates",(function(){return J})),n.d(t,"DocumentScannerUserGuidance",(function(){return $})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return Oe})),n.d(t,"DocumentScanningFlow",(function(){return Le})),n.d(t,"IntroListEntry",(function(){return ie.g})),n.d(t,"IntroImage",(function(){return ie.f})),n.d(t,"NoIntroImage",(function(){return ie.j})),n.d(t,"ReceiptsIntroImage",(function(){return ie.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return ie.i})),n.d(t,"DocumentIntroImage",(function(){return ie.d})),n.d(t,"CheckIntroImage",(function(){return ie.a})),n.d(t,"IdCardIntroImage",(function(){return ie.e})),n.d(t,"CreditCardIntroImage",(function(){return ie.b})),n.d(t,"CustomImage",(function(){return ie.c})),n.d(t,"IntroductionScreenConfiguration",(function(){return ie.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return xe})),n.d(t,"ReviewMorePopupMenu",(function(){return De})),n.d(t,"ZoomOverlay",(function(){return Be})),n.d(t,"ReviewScreenConfiguration",(function(){return Te})),n.d(t,"CommonActionBarConfiguration",(function(){return s})),n.d(t,"CommonCameraConfiguration",(function(){return c})),n.d(t,"CommonCameraPermission",(function(){return o})),n.d(t,"CommonCommon",(function(){return Z})),n.d(t,"CommonNavigationBarConfiguration",(function(){return l})),n.d(t,"CommonScanbotAlertDialog",(function(){return r})),n.d(t,"CommonTopBarConfiguration",(function(){return u})),n.d(t,"CommonUserGuidanceConfiguration",(function(){return i})),n.d(t,"CommonViewFinderConfiguration",(function(){return a}));var i={};n.r(i),n.d(i,"UserGuidanceConfiguration",(function(){return G})),n.d(i,"IconUserGuidanceConfiguration",(function(){return Y}));var o={};n.r(o),n.d(o,"CameraPermissionScreen",(function(){return X}));var r={};n.r(r),n.d(r,"ScanbotAlertDialog",(function(){return oe}));var a={};n.r(a),n.d(a,"ViewFinderConfiguration",(function(){return re})),n.d(a,"FinderStyle",(function(){return ee})),n.d(a,"FinderCorneredStyle",(function(){return ae})),n.d(a,"FinderStrokedStyle",(function(){return se}));var s={};n.r(s),n.d(s,"ActionBarConfiguration",(function(){return Pe}));var c={};n.r(c),n.d(c,"Resolution",(function(){return _e})),n.d(c,"CameraConfiguration",(function(){return Re}));var l={};n.r(l);var u={};n.r(u),n.d(u,"TopBarConfiguration",(function(){return Fe}));var d=n(10),m=n(3),h=n(6);class f extends h.a{constructor(e={}){super(),this.title=new m.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new m.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new m.c({}),this.cancelButton=new m.c({}),void 0!==e.title&&(this.title=new m.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new m.j(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new m.c(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new m.c(e.cancelButton))}}class p extends h.a{constructor(e={}){if(super(),void 0===e.title)throw new Error("title must be present in constructor argument");if(this.title=e.title,void 0===e.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=e.subtitle,void 0===e.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=e.barcodeImage}}class g extends h.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new m.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new f({}),void 0!==e.barcodeItemMapper&&(this.barcodeItemMapper=null!=e.barcodeItemMapper?e.barcodeItemMapper:null),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.loadingMessage&&(this.loadingMessage=new m.j(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new f(e.errorState))}}class v extends h.a{constructor(e={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new m.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new m.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new m.c({visible:!0,text:"?sheetSubmitButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new m.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new m.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new m.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new m.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new m.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new m.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new m.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new m.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new m.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new m.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new m.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new m.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new m.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new m.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new m.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.confirmationSheetEnabled&&(this.confirmationSheetEnabled=e.confirmationSheetEnabled),void 0!==e.barcodeImageVisible&&(this.barcodeImageVisible=e.barcodeImageVisible),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.barcodeTitle&&(this.barcodeTitle=new m.j(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new m.j(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new m.c(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new m.c(e.cancelButton)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class C extends h.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}class y extends h.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new C({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new C(e.idealPreviewResolution))}}var b,A=n(31);class S extends h.a{constructor(e={}){super(),this.flashButton=new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new m.h(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new m.h(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new m.h(e.flipCameraButton))}}class w extends h.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new m.b({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new m.b(e.listButton))}}class E extends h.a{constructor(e={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.iconColor&&(this.iconColor=e.iconColor)}}class x extends h.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new m.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new m.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new m.c({visible:!0,text:"Update",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new m.c({visible:!0,text:"Cancel",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new m.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.title&&(this.title=new m.j(e.title)),void 0!==e.info&&(this.info=new m.j(e.info)),void 0!==e.updateButton&&(this.updateButton=new m.c(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new m.c(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new m.e(e.clearTextButton))}}class D extends h.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new m.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new m.c({visible:!0,text:"Clear all",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new m.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new m.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new m.c({visible:!0,text:"Submit",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new m.c({visible:!0,text:"Start scanning",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new m.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new m.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new m.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new E({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.manualCountChangeEnabled&&(this.manualCountChangeEnabled=e.manualCountChangeEnabled),void 0!==e.manualCountOutlineColor&&(this.manualCountOutlineColor=e.manualCountOutlineColor),void 0!==e.manualCountChangeColor&&(this.manualCountChangeColor=e.manualCountChangeColor),void 0!==e.title&&(this.title=new m.j(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new m.c(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new m.j(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new m.j(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new m.c(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new m.c(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new m.j(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new m.j(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new m.e(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new E(e.swipeToDelete))}}class B extends h.a{constructor(e={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new m.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new D({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new m.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new m.c({visible:!0,text:"?sheetClearAllButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new m.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new m.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new m.c({visible:!0,text:"?sheetSubmitButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new m.c({visible:!0,text:"?sheetStartScanningButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new m.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new m.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new m.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new m.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new m.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new m.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new m.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new m.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new m.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new m.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new m.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new m.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new m.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new m.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new m.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new m.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new m.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new m.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new m.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new m.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new m.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new m.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new D(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class T extends h.a{constructor(e={}){if(super(),this.title=new m.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new m.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==e.title&&(this.title=new m.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new m.j(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0===e.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new m.c(e.okButton),void 0===e.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new m.c(e.cancelButton)}}class I extends h.a{constructor(e={}){if(super(),this.count=1,void 0===e.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=e.barcodeValue,void 0!==e.title&&(this.title=null!=e.title?e.title:null),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0!==e.count&&(this.count=e.count)}}class k extends h.a{constructor(e={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new m.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new D({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new m.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new m.c({visible:!0,text:"?sheetResetButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new m.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new m.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new m.c({visible:!0,text:"?sheetSubmitButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new m.c({visible:!0,text:"?sheetStartScanningButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new m.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new m.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new m.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new m.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new m.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new m.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new m.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new m.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new d.a({visible:!1,automaticSelectionEnabled:!0,polygon:new d.f({partiallyScanned:new m.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new m.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new m.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new d.g({partiallyScanned:new d.d({visible:!0,background:new m.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new d.d({visible:!0,background:new m.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new d.d({visible:!0,background:new m.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new T({title:new m.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new m.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new m.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new m.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new T({title:new m.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new m.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new m.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new m.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new m.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==e.scanningCompletedColor&&(this.scanningCompletedColor=e.scanningCompletedColor),void 0!==e.scanningPartiallyColor&&(this.scanningPartiallyColor=e.scanningPartiallyColor),void 0!==e.scanningNotScannedColor&&(this.scanningNotScannedColor=e.scanningNotScannedColor),void 0!==e.allowPartialScan&&(this.allowPartialScan=e.allowPartialScan),void 0!==e.expectedBarcodes&&(this.expectedBarcodes=e.expectedBarcodes.map((e=>new I(e)))),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new D(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.arOverlay&&(this.arOverlay=new d.a(e.arOverlay)),void 0!==e.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=e.partialScannedAlertDialogEnabled),void 0!==e.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new T(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new T(e.confirmationAlertDialog))}}(b||(b={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new v(e);case"MultipleScanningMode":return new B(e);case"FindAndPickScanningMode":return new k(e);default:throw`Unknown child class name: ${t}`}};var O,L=n(21);class P extends h.a{constructor(e={}){super(),this.visible=!0,this.style=new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=O.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new _(e);case"FinderStrokedStyle":return new R(e);default:throw`Unknown child class name: ${t}`}}}(O||(O={}));class _ extends h.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class R extends h.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}var F=n(32);class M extends h.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.findAndPickCompleteAlertSubmitButton="Submit",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.userGuidance&&(this.userGuidance=e.userGuidance),void 0!==e.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=e.barcodeInfoMappingLoadingMessage),void 0!==e.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=e.barcodeInfoMappingErrorStateTitle),void 0!==e.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=e.barcodeInfoMappingErrorStateSubtitle),void 0!==e.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=e.barcodeInfoMappingErrorStateRetryButton),void 0!==e.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=e.barcodeInfoMappingErrorStateCancelButton),void 0!==e.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=e.manualCountEditDialogTitle),void 0!==e.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=e.manualCountEditDialogInfo),void 0!==e.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=e.manualCountEditDialogUpdateButton),void 0!==e.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=e.manualCountEditDialogCancelButton),void 0!==e.sheetResetButton&&(this.sheetResetButton=e.sheetResetButton),void 0!==e.sheetClearAllButton&&(this.sheetClearAllButton=e.sheetClearAllButton),void 0!==e.sheetSubmitButton&&(this.sheetSubmitButton=e.sheetSubmitButton),void 0!==e.sheetStartScanningButton&&(this.sheetStartScanningButton=e.sheetStartScanningButton),void 0!==e.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=e.sheetPlaceholderTitle),void 0!==e.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=e.sheetPlaceholderSubtitle),void 0!==e.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=e.singleModeConfirmationCancelButton),void 0!==e.multipleModeSheetTitle&&(this.multipleModeSheetTitle=e.multipleModeSheetTitle),void 0!==e.findAndPickSheetTitle&&(this.findAndPickSheetTitle=e.findAndPickSheetTitle),void 0!==e.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=e.findAndPickSheetBarcodeItemSubtitle),void 0!==e.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=e.findAndPickPartialAlertTitle),void 0!==e.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=e.findAndPickPartialAlertSubtitle),void 0!==e.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=e.findAndPickPartialAlertCancelButton),void 0!==e.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=e.findAndPickPartialAlertSubmitButton),void 0!==e.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=e.findAndPickCompleteAlertTitle),void 0!==e.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=e.findAndPickCompleteAlertSubtitle),void 0!==e.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=e.findAndPickCompleteAlertCancelButton),void 0!==e.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=e.findAndPickCompleteAlertSubmitButton)}}class N extends h.a{constructor(e={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==e.barcodesRegexFilter&&(this.barcodesRegexFilter=e.barcodesRegexFilter),void 0!==e.barcodeFormats&&(this.barcodeFormats=e.barcodeFormats.map((e=>e))),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.maximumRecognizerResolution&&(this.maximumRecognizerResolution=e.maximumRecognizerResolution)}}class V extends h.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new m.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new m.c({text:"Close",background:new m.a({}),foreground:new m.d({})}),this.enableCameraTitle=new m.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new m.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new m.e(e.icon)),void 0!==e.closeButton&&(this.closeButton=new m.c(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new m.j(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new m.j(e.enableCameraExplanation))}}class W extends h.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new m.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new M({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new A.a({title:new m.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new m.c({visible:!0,text:"?topBarCancelButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new m.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new S({flashButton:new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new m.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new P({visible:!0,style:new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new L.AspectRatio({width:1,height:1})}),this.userGuidance=new F.a({visible:!0,title:new m.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new m.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new V({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new m.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new m.c({visible:!0,text:"?cameraPermissionCloseButton",background:new m.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new m.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new m.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new m.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new y({}),this.recognizerConfiguration=new N({}),this.useCase=new v({}),this.sound=new m.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new m.l({enabled:!0}),this.timeouts=new m.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new m.f(e.palette)),void 0!==e.localization&&(this.localization=new M(e.localization)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.topBar&&(this.topBar=new A.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new S(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new P(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new F.a(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new V(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new y(e.cameraConfiguration)),void 0!==e.recognizerConfiguration&&(this.recognizerConfiguration=new N(e.recognizerConfiguration)),void 0!==e.useCase&&(this.useCase=b.From(e.useCase)),void 0!==e.sound&&(this.sound=new m.i(e.sound)),void 0!==e.vibration&&(this.vibration=new m.l(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new m.k(e.timeouts))}}var z=n(38);class j extends h.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new z.BarcodeItem(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class H extends h.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new j(e))))}}var U=n(20),Z=n(2);class G extends h.a{constructor(e={}){super(),this.visible=!0,this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Y extends h.a{constructor(e={}){super(),this.visible=!0,this.icon=new Z.IconStyle({color:"?sbColorOnPrimary"}),this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.icon&&(this.icon=new Z.IconStyle(e.icon)),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Q extends h.a{constructor(e={}){super(),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new Z.BarButtonConfiguration(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new Z.BarButtonConfiguration(e.acceptWhenNotOkButton))}}class q extends h.a{constructor(e={}){super(),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new Y({visible:!0,icon:new Z.IconStyle({color:"?sbColorOnPrimary"}),title:new Z.StyledText({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new Q({}),void 0!==e.minimumQuality&&(this.minimumQuality=e.minimumQuality),void 0!==e.acknowledgementMode&&(this.acknowledgementMode=e.acknowledgementMode),void 0!==e.badImageHint&&(this.badImageHint=new Y(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new Q(e.bottomBar))}}class X extends h.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new Z.ButtonConfiguration({text:"Close",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.enableCameraTitle=new Z.StyledText({text:"Camera permission denied!",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new Z.StyledText({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new Z.IconStyle(e.icon)),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new Z.StyledText(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new Z.StyledText(e.enableCameraExplanation))}}class K extends h.a{constructor(e={}){super(),this.cameraModule="BACK",this.flashEnabled=!1,this.acceptedAngleScore=.75,this.acceptedSizeScore=.75,this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.acceptedBrightnessThreshold=50,this.autoSnappingEnabled=!0,this.requiredAspectRatios=[],this.ignoreBadAspectRatio=!0,void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new L.AspectRatio(e)))),void 0!==e.ignoreBadAspectRatio&&(this.ignoreBadAspectRatio=e.ignoreBadAspectRatio)}}class J extends h.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",this.textHintOffCenter="?cameraUserGuidanceTextHintOffCenter",this.tooSmall="?cameraUserGuidanceTooSmall",this.tooNoisy="?cameraUserGuidanceTooNoisy",this.tooDark="?cameraUserGuidanceTooDark",this.energySaveMode="?cameraUserGuidanceEnergySaveMode",this.readyToCapture="?cameraUserGuidanceReadyToCapture",this.capturing="?cameraUserGuidanceReadyToCapture",this.captureManual="?cameraUserGuidanceReadyToCaptureManual",void 0!==e.noDocumentFound&&(this.noDocumentFound=e.noDocumentFound),void 0!==e.badAspectRatio&&(this.badAspectRatio=e.badAspectRatio),void 0!==e.badAngles&&(this.badAngles=e.badAngles),void 0!==e.textHintOffCenter&&(this.textHintOffCenter=e.textHintOffCenter),void 0!==e.tooSmall&&(this.tooSmall=e.tooSmall),void 0!==e.tooNoisy&&(this.tooNoisy=e.tooNoisy),void 0!==e.tooDark&&(this.tooDark=e.tooDark),void 0!==e.energySaveMode&&(this.energySaveMode=e.energySaveMode),void 0!==e.readyToCapture&&(this.readyToCapture=e.readyToCapture),void 0!==e.capturing&&(this.capturing=e.capturing),void 0!==e.captureManual&&(this.captureManual=e.captureManual)}}class $ extends h.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new Z.StyledText({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new J({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new J(e.statesTitles))}}var ee,te,ne,ie=n(16);class oe extends h.a{constructor(e={}){super(),this.title=new Z.StyledText({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new Z.StyledText({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new Z.ButtonConfiguration({background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary"})}),this.actionButton=new Z.ButtonConfiguration({visible:!1,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new Z.ButtonConfiguration({visible:!0,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new Z.StyledText(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.okButton&&(this.okButton=new Z.ButtonConfiguration(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new Z.ButtonConfiguration(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new Z.ButtonConfiguration(e.cancelButton))}}class re extends h.a{constructor(e={}){super(),this.visible=!0,this.style=new ae({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=ee.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new ae(e);case"FinderStrokedStyle":return new se(e);default:throw`Unknown child class name: ${t}`}}}(ee||(ee={}));class ae extends h.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class se extends h.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class ce extends h.a{constructor(e={}){super(),this.enabledInAutoSnappingMode=!0,this.accessibilityDescription="?accessibilityDescriptionCameraShutterButton",this.outerColor="?sbColorOnPrimary",this.innerColor="?sbColorOnPrimary",void 0!==e.enabledInAutoSnappingMode&&(this.enabledInAutoSnappingMode=e.enabledInAutoSnappingMode),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.outerColor&&(this.outerColor=e.outerColor),void 0!==e.innerColor&&(this.innerColor=e.innerColor)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PagePreviewMode":return new ue(e);case"TextButtonMode":return new de(e);case"NoButtonMode":return new me(e);default:throw`Unknown child class name: ${t}`}}}(te||(te={}));class le extends h.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="?sbColorModalOverlay",this.foregroundColor="?sbColorSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class ue extends h.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new Z.BadgeStyle({visible:!0,background:new Z.BackgroundStyle({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface"}),foregroundColor:"?sbColorPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.imagePlaceholderColor&&(this.imagePlaceholderColor=e.imagePlaceholderColor),void 0!==e.pageCounter&&(this.pageCounter=new Z.BadgeStyle(e.pageCounter))}}class de extends h.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new Z.StyledText({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new Z.StyledText(e.style))}}class me extends h.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class he extends h.a{constructor(e={}){super(),this.importButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.shutterButton=new ce({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.torchOffButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.previewButton=new ue({}),void 0!==e.importButton&&(this.importButton=new Z.BarButtonConfiguration(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new Z.BarButtonConfiguration(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new Z.BarButtonConfiguration(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new ce(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new Z.BarButtonConfiguration(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new Z.BarButtonConfiguration(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=te.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new fe(e);case"PageSnapCheckMarkAnimation":return new pe(e);case"PageSnapFeedbackNone":return new ge(e);default:throw`Unknown child class name: ${t}`}}}(ne||(ne={}));class fe extends h.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class pe extends h.a{constructor(e={}){super(),this._type="PageSnapCheckMarkAnimation",this.overlayColor="?sbColorModalOverlay",this.checkMarkBackgroundColor="?sbColorOutline",this.checkMarkColor="#00000000",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.checkMarkBackgroundColor&&(this.checkMarkBackgroundColor=e.checkMarkBackgroundColor),void 0!==e.checkMarkColor&&(this.checkMarkColor=e.checkMarkColor)}}class ge extends h.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class ve extends h.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new fe({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=ne.From(e.snapFeedbackMode))}}class Ce extends h.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new Z.PolygonStyle({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new Z.PolygonStyle({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new Z.PolygonStyle({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new Z.PolygonStyle(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new Z.PolygonStyle(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new Z.PolygonStyle(e.autoSnapProgress))}}class ye extends h.a{constructor(e={}){super(),this.button=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new Z.StyledText({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorOnSurface"})}),this.menuEntryActive=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new Z.IconButton(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new Z.PopupMenuItem(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new Z.PopupMenuItem(e.menuEntryActive))}}class be extends h.a{constructor(e={}){super(),this.acknowledgement=new q({}),this.introduction=new ie.h({}),this.scanAssistanceOverlay=new le({}),this.cameraPermission=new X({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),closeButton:new Z.ButtonConfiguration({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new Z.StyledText({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new Z.StyledText({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new Z.StyledText({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new ye({}),this.topUserGuidance=new G({title:new Z.StyledText({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new $({}),this.backgroundColor="#000000FF",this.cameraConfiguration=new K({}),this.polygon=new Ce({}),this.bottomBar=new he({}),this.viewFinder=new re({visible:!1,aspectRatio:new L.AspectRatio({width:21,height:29})}),this.captureFeedback=new ve({}),this.vibration=new Z.Vibration({enabled:!0}),this.timeouts=new Z.Timeouts({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new oe({title:new Z.StyledText({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({visible:!1})}),this.cancelAlertDialog=new oe({title:new Z.StyledText({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new q(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new ie.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new le(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new X(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new Z.IconButton(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new ye(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new G(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new $(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new K(e.cameraConfiguration)),void 0!==e.polygon&&(this.polygon=new Ce(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new he(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new re(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new ve(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new Z.Vibration(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new Z.Timeouts(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new oe(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new oe(e.cancelAlertDialog))}}class Ae extends h.a{constructor(e={}){super(),this.detectButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.resetButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new Z.BarButtonConfiguration(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new Z.BarButtonConfiguration(e.resetButton))}}class Se extends h.a{constructor(e={}){super(),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new Z.StyledText({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.bottomBar=new Ae({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new Z.ButtonConfiguration(e.topBarConfirmButton)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.croppingHandlerColor&&(this.croppingHandlerColor=e.croppingHandlerColor),void 0!==e.croppingPolygonColor&&(this.croppingPolygonColor=e.croppingPolygonColor),void 0!==e.bottomBar&&(this.bottomBar=new Ae(e.bottomBar))}}var we=n(41);class Ee extends h.a{constructor(e={}){super(),this.pagesScanLimit=0,this.documentImageSizeLimit=0,this.documentAnalysisMode="UNFILTERED_DOCUMENT",this.defaultFilter=null,void 0!==e.pagesScanLimit&&(this.pagesScanLimit=e.pagesScanLimit),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.documentAnalysisMode&&(this.documentAnalysisMode=e.documentAnalysisMode),void 0!==e.defaultFilter&&(this.defaultFilter=null!=e.defaultFilter?we.a.From(e.defaultFilter):null)}}class xe extends h.a{constructor(e={}){super(),this.addButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.cropButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.deleteButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.submitButton=new Z.ButtonConfiguration({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new Z.BarButtonConfiguration(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new Z.BarButtonConfiguration(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new Z.BarButtonConfiguration(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new Z.ButtonConfiguration(e.submitButton))}}class De extends h.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new Z.PopupMenuItem({title:new Z.StyledText({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new Z.IconStyle({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new Z.PopupMenuItem(e.deleteAll))}}class Be extends h.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new Z.ButtonConfiguration({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton))}}class Te extends h.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new Z.StyledText({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new De({}),this.zoomButton=new Z.RoundButton({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new Be({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new xe({}),this.switchNextPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new G({title:new Z.StyledText({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new oe({title:new Z.StyledText({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({visible:!1}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new oe({title:new Z.StyledText({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new Z.IconButton(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new De(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new Be(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new xe(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new Z.IconButton(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new Z.IconButton(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new G(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new oe(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new oe(e.deletePageAlertDialog))}}class Ie extends h.a{constructor(e={}){super(),this.camera=new be({}),this.review=new Te({}),this.cropping=new Se({}),void 0!==e.camera&&(this.camera=new be(e.camera)),void 0!==e.review&&(this.review=new Te(e.review)),void 0!==e.cropping&&(this.cropping=new Se(e.cropping))}}class ke extends h.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.cameraTopBarCancelButtonTitle="Cancel",this.cameraTopBarTitle="Scan Document",this.cameraTopGuidance="Scan each page of your document.",this.cameraUserGuidanceStart="Please hold your device over a document.",this.cameraUserGuidanceNoDocumentFound="No document found",this.cameraUserGuidanceBadAspectRatio="Bad aspect ratio",this.cameraUserGuidanceBadAngles="Bad angles",this.cameraUserGuidanceTooNoisy="Its too noisy. Try another background for the document",this.cameraUserGuidanceTextHintOffCenter="Document is off center",this.cameraUserGuidanceTooSmall="Document is too small. Move camera closer.",this.cameraUserGuidanceTooDark="Its too dark. Add more light.",this.cameraUserGuidanceEnergySaveMode="Energy save mode is on",this.cameraUserGuidanceReadyToCapture="Hold still capturing...",this.cameraUserGuidanceReadyToCaptureManual="Ready to capture!",this.cameraImportButtonTitle="Import",this.cameraTorchOnButtonTitle="On",this.cameraTorchOffButtonTitle="Off",this.cameraAutoSnapButtonTitle="Auto",this.cameraManualSnapButtonTitle="Manual",this.cameraPreviewButtonTitle="%d Pages",this.cameraIntroDoneButton="Done",this.cameraIntroTitle="How to scan a document",this.cameraIntroSubtitle="Follow the steps below to create a high-quality document scan",this.cameraIntroItem1="1. Place your document on a flat surface.",this.cameraIntroItem2="2. Hold your phone above the document.",this.cameraIntroItem3="3. Follow the on-screen guidance to find the optimal position.",this.cameraIntroItem4="4. Once you reach the optimal position, you can manually scan the document or let the app scan it automatically.",this.cameraProgressOverlayTitle="Please wait...",this.cameraCancelAlertTitle="Cancel?",this.cameraCancelAlertSubtitle="Canceling will delete all the pages scanned so far. Are you sure you want to cancel?",this.cameraCancelNoButtonTitle="No",this.cameraCancelYesButtonTitle="Yes, Cancel",this.cameraLimitReachedAlertTitle="You reached the limit!",this.cameraLimitReachedAlertSubtitle="You have scanned the maximum number of pages and cannot add any more. Please delete at least one page to perform a new scan.",this.cameraLimitReachedOkButtonTitle="Ok",this.cameraSelectCameraMenuTitle="Select camera",this.acknowledgementScreenBadDocumentHint="The quality of your scan does not seem sufficient.",this.acknowledgementRetakeButtonTitle="Retake",this.acknowledgementAcceptButtonTitle="Use Scan",this.reviewScreenTitle="Review (%d)",this.reviewTopBarBackButtonTitle="Back",this.reviewScreenPageCount="Page %d/%d",this.reviewScreenAddButtonTitle="Add",this.reviewScreenRetakeButtonTitle="Retake",this.reviewScreenCropButtonTitle="Crop",this.reviewScreenRotateButtonTitle="Rotate",this.reviewScreenDeleteButtonTitle="Delete",this.reviewScreenSubmitButtonTitle="Submit",this.reviewScreenDeleteAllButtonTitle="Delete all",this.reviewScreenReorderPagesButtonTitle="Reorder pages",this.zoomOverlayCancelButtonText="Close",this.reviewDeletePageAlertTitle="Delete page?",this.reviewDeleteAllPagesAlertTitle="Delete all?",this.reviewDeletePageAlertSubTitle="Are you sure you want to delete the page?",this.reviewDeleteAllPagesAlertSubtitle="Are you sure you want to delete all pages?",this.reviewDeletePageAlertConfirmButtonTitle="Yes, Delete",this.reviewDeleteAllPagesAlertDeleteButtonTitle="Yes, Delete all",this.reviewDeletePageAlertDeleteRetakeButtonTitle="Delete and Retake",this.reviewDeletePageAlertCancelButtonTitle="Cancel",this.reviewDeleteAllPagesAlertCancelButtonTitle="Cancel",this.reorderPageTitle="Reorder Pages",this.reorderPageGuidanceTitle="Drag pages to reorder",this.reorderPageText="%d",this.reorderTopBarConfirmButtonTitle="Done",this.reorderTopBarCancelButtonTitle="Cancel",this.croppingTopBarConfirmButtonTitle="Done",this.croppingTopBarCancelButtonTitle="Cancel",this.croppingDetectButtonTitle="Detect",this.croppingRotateButtonTitle="Rotate",this.croppingResetButtonTitle="Reset",this.croppingScreenTitle="Crop",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",this.accessibilityDescriptionCameraTopBarIntroButton="Tap to open introduction screen",this.accessibilityDescriptionCameraTopBarCancelButton="Tap to close scanner screen",this.accessibilityDescriptionCameraImportButton="Tap to import image",this.accessibilityDescriptionCameraTorchOnButton="Tap to disable torch",this.accessibilityDescriptionCameraTorchOffButton="Tap to enable torch",this.accessibilityDescriptionCameraShutterButton="Tap to take image",this.accessibilityDescriptionCameraAutoSnapButton="Tap to enable manual snapping mode",this.accessibilityDescriptionCameraManualSnapButton="Tap to enable auto snapping mode",this.accessibilityDescriptionCameraPreviewButton="Tap to preview scanned pages",this.accessibilityDescriptionCameraIntroDoneButton="Tap to close introduction screen",this.accessibilityDescriptionCameraSelectButton="Tap to open camera selection menu",this.accessibilityDescriptionCameraSelectMenuItem="Tap to select camera",this.accessibilityDescriptionAcknowledgementRetakeButton="Tap to retake the image",this.accessibilityDescriptionAcknowledgementAcceptButton="Tap to accept the image regarding the quality",this.accessibilityDescriptionCroppingTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionCroppingTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionCroppingDetectButton="Tap to detect document on the image",this.accessibilityDescriptionCroppingRotateButton="Tap to rotate document",this.accessibilityDescriptionCroppingResetButton="Tap to reset document contour to whole image",this.accessibilityDescriptionReorderTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionReorderTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionReviewNextPageButton="Tap to switch to the new page",this.accessibilityDescriptionReviewPreviousPageButton="Tap to switch to the previous page",this.accessibilityDescriptionReviewAddButton="Tap to Add new page",this.accessibilityDescriptionReviewRetakeButton="Tap to Retake current selected page",this.accessibilityDescriptionReviewCropButton="Tap to Crop selected page",this.accessibilityDescriptionReviewRotateButton="Tap to Rotate selected page clockwise",this.accessibilityDescriptionReviewDeleteButton="Tap to Delete selected page",this.accessibilityDescriptionReviewSubmitButton="Tap to Submit document",this.accessibilityDescriptionReviewMoreButton="Tap to show additional options",this.accessibilityDescriptionReviewDeleteAllButton="Tap to Delete all pages",this.accessibilityDescriptionReviewReorderPagesButton="Tap to Reorder pages",this.accessibilityDescriptionZoomOverlayCancelButton="Tap to Close zoom overlay",this.accessibilityDescriptionReviewZoomButton="Tap to open zoom overlay for selected page",this.accessibilityDescriptionReviewTopBarBackButton="Tap to Close review screen",this.accessibilityDescriptionReviewDeletePageAlertConfirmButton="Tap to Delete page",this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton="Tap to Delete all pages",this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton="Tap to Delete page and Retake it",this.accessibilityDescriptionReviewDeletePageAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionCameraLimitReachedOkButton="Tap to close alert dialog",this.accessibilityDescriptionCameraCancelYesButton="Tap to cancel document",this.accessibilityDescriptionCameraCancelNoButton="Tap to close alert dialog",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.cameraTopBarCancelButtonTitle&&(this.cameraTopBarCancelButtonTitle=e.cameraTopBarCancelButtonTitle),void 0!==e.cameraTopBarTitle&&(this.cameraTopBarTitle=e.cameraTopBarTitle),void 0!==e.cameraTopGuidance&&(this.cameraTopGuidance=e.cameraTopGuidance),void 0!==e.cameraUserGuidanceStart&&(this.cameraUserGuidanceStart=e.cameraUserGuidanceStart),void 0!==e.cameraUserGuidanceNoDocumentFound&&(this.cameraUserGuidanceNoDocumentFound=e.cameraUserGuidanceNoDocumentFound),void 0!==e.cameraUserGuidanceBadAspectRatio&&(this.cameraUserGuidanceBadAspectRatio=e.cameraUserGuidanceBadAspectRatio),void 0!==e.cameraUserGuidanceBadAngles&&(this.cameraUserGuidanceBadAngles=e.cameraUserGuidanceBadAngles),void 0!==e.cameraUserGuidanceTooNoisy&&(this.cameraUserGuidanceTooNoisy=e.cameraUserGuidanceTooNoisy),void 0!==e.cameraUserGuidanceTextHintOffCenter&&(this.cameraUserGuidanceTextHintOffCenter=e.cameraUserGuidanceTextHintOffCenter),void 0!==e.cameraUserGuidanceTooSmall&&(this.cameraUserGuidanceTooSmall=e.cameraUserGuidanceTooSmall),void 0!==e.cameraUserGuidanceTooDark&&(this.cameraUserGuidanceTooDark=e.cameraUserGuidanceTooDark),void 0!==e.cameraUserGuidanceEnergySaveMode&&(this.cameraUserGuidanceEnergySaveMode=e.cameraUserGuidanceEnergySaveMode),void 0!==e.cameraUserGuidanceReadyToCapture&&(this.cameraUserGuidanceReadyToCapture=e.cameraUserGuidanceReadyToCapture),void 0!==e.cameraUserGuidanceReadyToCaptureManual&&(this.cameraUserGuidanceReadyToCaptureManual=e.cameraUserGuidanceReadyToCaptureManual),void 0!==e.cameraImportButtonTitle&&(this.cameraImportButtonTitle=e.cameraImportButtonTitle),void 0!==e.cameraTorchOnButtonTitle&&(this.cameraTorchOnButtonTitle=e.cameraTorchOnButtonTitle),void 0!==e.cameraTorchOffButtonTitle&&(this.cameraTorchOffButtonTitle=e.cameraTorchOffButtonTitle),void 0!==e.cameraAutoSnapButtonTitle&&(this.cameraAutoSnapButtonTitle=e.cameraAutoSnapButtonTitle),void 0!==e.cameraManualSnapButtonTitle&&(this.cameraManualSnapButtonTitle=e.cameraManualSnapButtonTitle),void 0!==e.cameraPreviewButtonTitle&&(this.cameraPreviewButtonTitle=e.cameraPreviewButtonTitle),void 0!==e.cameraIntroDoneButton&&(this.cameraIntroDoneButton=e.cameraIntroDoneButton),void 0!==e.cameraIntroTitle&&(this.cameraIntroTitle=e.cameraIntroTitle),void 0!==e.cameraIntroSubtitle&&(this.cameraIntroSubtitle=e.cameraIntroSubtitle),void 0!==e.cameraIntroItem1&&(this.cameraIntroItem1=e.cameraIntroItem1),void 0!==e.cameraIntroItem2&&(this.cameraIntroItem2=e.cameraIntroItem2),void 0!==e.cameraIntroItem3&&(this.cameraIntroItem3=e.cameraIntroItem3),void 0!==e.cameraIntroItem4&&(this.cameraIntroItem4=e.cameraIntroItem4),void 0!==e.cameraProgressOverlayTitle&&(this.cameraProgressOverlayTitle=e.cameraProgressOverlayTitle),void 0!==e.cameraCancelAlertTitle&&(this.cameraCancelAlertTitle=e.cameraCancelAlertTitle),void 0!==e.cameraCancelAlertSubtitle&&(this.cameraCancelAlertSubtitle=e.cameraCancelAlertSubtitle),void 0!==e.cameraCancelNoButtonTitle&&(this.cameraCancelNoButtonTitle=e.cameraCancelNoButtonTitle),void 0!==e.cameraCancelYesButtonTitle&&(this.cameraCancelYesButtonTitle=e.cameraCancelYesButtonTitle),void 0!==e.cameraLimitReachedAlertTitle&&(this.cameraLimitReachedAlertTitle=e.cameraLimitReachedAlertTitle),void 0!==e.cameraLimitReachedAlertSubtitle&&(this.cameraLimitReachedAlertSubtitle=e.cameraLimitReachedAlertSubtitle),void 0!==e.cameraLimitReachedOkButtonTitle&&(this.cameraLimitReachedOkButtonTitle=e.cameraLimitReachedOkButtonTitle),void 0!==e.cameraSelectCameraMenuTitle&&(this.cameraSelectCameraMenuTitle=e.cameraSelectCameraMenuTitle),void 0!==e.acknowledgementScreenBadDocumentHint&&(this.acknowledgementScreenBadDocumentHint=e.acknowledgementScreenBadDocumentHint),void 0!==e.acknowledgementRetakeButtonTitle&&(this.acknowledgementRetakeButtonTitle=e.acknowledgementRetakeButtonTitle),void 0!==e.acknowledgementAcceptButtonTitle&&(this.acknowledgementAcceptButtonTitle=e.acknowledgementAcceptButtonTitle),void 0!==e.reviewScreenTitle&&(this.reviewScreenTitle=e.reviewScreenTitle),void 0!==e.reviewTopBarBackButtonTitle&&(this.reviewTopBarBackButtonTitle=e.reviewTopBarBackButtonTitle),void 0!==e.reviewScreenPageCount&&(this.reviewScreenPageCount=e.reviewScreenPageCount),void 0!==e.reviewScreenAddButtonTitle&&(this.reviewScreenAddButtonTitle=e.reviewScreenAddButtonTitle),void 0!==e.reviewScreenRetakeButtonTitle&&(this.reviewScreenRetakeButtonTitle=e.reviewScreenRetakeButtonTitle),void 0!==e.reviewScreenCropButtonTitle&&(this.reviewScreenCropButtonTitle=e.reviewScreenCropButtonTitle),void 0!==e.reviewScreenRotateButtonTitle&&(this.reviewScreenRotateButtonTitle=e.reviewScreenRotateButtonTitle),void 0!==e.reviewScreenDeleteButtonTitle&&(this.reviewScreenDeleteButtonTitle=e.reviewScreenDeleteButtonTitle),void 0!==e.reviewScreenSubmitButtonTitle&&(this.reviewScreenSubmitButtonTitle=e.reviewScreenSubmitButtonTitle),void 0!==e.reviewScreenDeleteAllButtonTitle&&(this.reviewScreenDeleteAllButtonTitle=e.reviewScreenDeleteAllButtonTitle),void 0!==e.reviewScreenReorderPagesButtonTitle&&(this.reviewScreenReorderPagesButtonTitle=e.reviewScreenReorderPagesButtonTitle),void 0!==e.zoomOverlayCancelButtonText&&(this.zoomOverlayCancelButtonText=e.zoomOverlayCancelButtonText),void 0!==e.reviewDeletePageAlertTitle&&(this.reviewDeletePageAlertTitle=e.reviewDeletePageAlertTitle),void 0!==e.reviewDeleteAllPagesAlertTitle&&(this.reviewDeleteAllPagesAlertTitle=e.reviewDeleteAllPagesAlertTitle),void 0!==e.reviewDeletePageAlertSubTitle&&(this.reviewDeletePageAlertSubTitle=e.reviewDeletePageAlertSubTitle),void 0!==e.reviewDeleteAllPagesAlertSubtitle&&(this.reviewDeleteAllPagesAlertSubtitle=e.reviewDeleteAllPagesAlertSubtitle),void 0!==e.reviewDeletePageAlertConfirmButtonTitle&&(this.reviewDeletePageAlertConfirmButtonTitle=e.reviewDeletePageAlertConfirmButtonTitle),void 0!==e.reviewDeleteAllPagesAlertDeleteButtonTitle&&(this.reviewDeleteAllPagesAlertDeleteButtonTitle=e.reviewDeleteAllPagesAlertDeleteButtonTitle),void 0!==e.reviewDeletePageAlertDeleteRetakeButtonTitle&&(this.reviewDeletePageAlertDeleteRetakeButtonTitle=e.reviewDeletePageAlertDeleteRetakeButtonTitle),void 0!==e.reviewDeletePageAlertCancelButtonTitle&&(this.reviewDeletePageAlertCancelButtonTitle=e.reviewDeletePageAlertCancelButtonTitle),void 0!==e.reviewDeleteAllPagesAlertCancelButtonTitle&&(this.reviewDeleteAllPagesAlertCancelButtonTitle=e.reviewDeleteAllPagesAlertCancelButtonTitle),void 0!==e.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.reorderPageGuidanceTitle&&(this.reorderPageGuidanceTitle=e.reorderPageGuidanceTitle),void 0!==e.reorderPageText&&(this.reorderPageText=e.reorderPageText),void 0!==e.reorderTopBarConfirmButtonTitle&&(this.reorderTopBarConfirmButtonTitle=e.reorderTopBarConfirmButtonTitle),void 0!==e.reorderTopBarCancelButtonTitle&&(this.reorderTopBarCancelButtonTitle=e.reorderTopBarCancelButtonTitle),void 0!==e.croppingTopBarConfirmButtonTitle&&(this.croppingTopBarConfirmButtonTitle=e.croppingTopBarConfirmButtonTitle),void 0!==e.croppingTopBarCancelButtonTitle&&(this.croppingTopBarCancelButtonTitle=e.croppingTopBarCancelButtonTitle),void 0!==e.croppingDetectButtonTitle&&(this.croppingDetectButtonTitle=e.croppingDetectButtonTitle),void 0!==e.croppingRotateButtonTitle&&(this.croppingRotateButtonTitle=e.croppingRotateButtonTitle),void 0!==e.croppingResetButtonTitle&&(this.croppingResetButtonTitle=e.croppingResetButtonTitle),void 0!==e.croppingScreenTitle&&(this.croppingScreenTitle=e.croppingScreenTitle),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraTopBarIntroButton&&(this.accessibilityDescriptionCameraTopBarIntroButton=e.accessibilityDescriptionCameraTopBarIntroButton),void 0!==e.accessibilityDescriptionCameraTopBarCancelButton&&(this.accessibilityDescriptionCameraTopBarCancelButton=e.accessibilityDescriptionCameraTopBarCancelButton),void 0!==e.accessibilityDescriptionCameraImportButton&&(this.accessibilityDescriptionCameraImportButton=e.accessibilityDescriptionCameraImportButton),void 0!==e.accessibilityDescriptionCameraTorchOnButton&&(this.accessibilityDescriptionCameraTorchOnButton=e.accessibilityDescriptionCameraTorchOnButton),void 0!==e.accessibilityDescriptionCameraTorchOffButton&&(this.accessibilityDescriptionCameraTorchOffButton=e.accessibilityDescriptionCameraTorchOffButton),void 0!==e.accessibilityDescriptionCameraShutterButton&&(this.accessibilityDescriptionCameraShutterButton=e.accessibilityDescriptionCameraShutterButton),void 0!==e.accessibilityDescriptionCameraAutoSnapButton&&(this.accessibilityDescriptionCameraAutoSnapButton=e.accessibilityDescriptionCameraAutoSnapButton),void 0!==e.accessibilityDescriptionCameraManualSnapButton&&(this.accessibilityDescriptionCameraManualSnapButton=e.accessibilityDescriptionCameraManualSnapButton),void 0!==e.accessibilityDescriptionCameraPreviewButton&&(this.accessibilityDescriptionCameraPreviewButton=e.accessibilityDescriptionCameraPreviewButton),void 0!==e.accessibilityDescriptionCameraIntroDoneButton&&(this.accessibilityDescriptionCameraIntroDoneButton=e.accessibilityDescriptionCameraIntroDoneButton),void 0!==e.accessibilityDescriptionCameraSelectButton&&(this.accessibilityDescriptionCameraSelectButton=e.accessibilityDescriptionCameraSelectButton),void 0!==e.accessibilityDescriptionCameraSelectMenuItem&&(this.accessibilityDescriptionCameraSelectMenuItem=e.accessibilityDescriptionCameraSelectMenuItem),void 0!==e.accessibilityDescriptionAcknowledgementRetakeButton&&(this.accessibilityDescriptionAcknowledgementRetakeButton=e.accessibilityDescriptionAcknowledgementRetakeButton),void 0!==e.accessibilityDescriptionAcknowledgementAcceptButton&&(this.accessibilityDescriptionAcknowledgementAcceptButton=e.accessibilityDescriptionAcknowledgementAcceptButton),void 0!==e.accessibilityDescriptionCroppingTopBarConfirmButton&&(this.accessibilityDescriptionCroppingTopBarConfirmButton=e.accessibilityDescriptionCroppingTopBarConfirmButton),void 0!==e.accessibilityDescriptionCroppingTopBarCancelButton&&(this.accessibilityDescriptionCroppingTopBarCancelButton=e.accessibilityDescriptionCroppingTopBarCancelButton),void 0!==e.accessibilityDescriptionCroppingDetectButton&&(this.accessibilityDescriptionCroppingDetectButton=e.accessibilityDescriptionCroppingDetectButton),void 0!==e.accessibilityDescriptionCroppingRotateButton&&(this.accessibilityDescriptionCroppingRotateButton=e.accessibilityDescriptionCroppingRotateButton),void 0!==e.accessibilityDescriptionCroppingResetButton&&(this.accessibilityDescriptionCroppingResetButton=e.accessibilityDescriptionCroppingResetButton),void 0!==e.accessibilityDescriptionReorderTopBarConfirmButton&&(this.accessibilityDescriptionReorderTopBarConfirmButton=e.accessibilityDescriptionReorderTopBarConfirmButton),void 0!==e.accessibilityDescriptionReorderTopBarCancelButton&&(this.accessibilityDescriptionReorderTopBarCancelButton=e.accessibilityDescriptionReorderTopBarCancelButton),void 0!==e.accessibilityDescriptionReviewNextPageButton&&(this.accessibilityDescriptionReviewNextPageButton=e.accessibilityDescriptionReviewNextPageButton),void 0!==e.accessibilityDescriptionReviewPreviousPageButton&&(this.accessibilityDescriptionReviewPreviousPageButton=e.accessibilityDescriptionReviewPreviousPageButton),void 0!==e.accessibilityDescriptionReviewAddButton&&(this.accessibilityDescriptionReviewAddButton=e.accessibilityDescriptionReviewAddButton),void 0!==e.accessibilityDescriptionReviewRetakeButton&&(this.accessibilityDescriptionReviewRetakeButton=e.accessibilityDescriptionReviewRetakeButton),void 0!==e.accessibilityDescriptionReviewCropButton&&(this.accessibilityDescriptionReviewCropButton=e.accessibilityDescriptionReviewCropButton),void 0!==e.accessibilityDescriptionReviewRotateButton&&(this.accessibilityDescriptionReviewRotateButton=e.accessibilityDescriptionReviewRotateButton),void 0!==e.accessibilityDescriptionReviewDeleteButton&&(this.accessibilityDescriptionReviewDeleteButton=e.accessibilityDescriptionReviewDeleteButton),void 0!==e.accessibilityDescriptionReviewSubmitButton&&(this.accessibilityDescriptionReviewSubmitButton=e.accessibilityDescriptionReviewSubmitButton),void 0!==e.accessibilityDescriptionReviewMoreButton&&(this.accessibilityDescriptionReviewMoreButton=e.accessibilityDescriptionReviewMoreButton),void 0!==e.accessibilityDescriptionReviewDeleteAllButton&&(this.accessibilityDescriptionReviewDeleteAllButton=e.accessibilityDescriptionReviewDeleteAllButton),void 0!==e.accessibilityDescriptionReviewReorderPagesButton&&(this.accessibilityDescriptionReviewReorderPagesButton=e.accessibilityDescriptionReviewReorderPagesButton),void 0!==e.accessibilityDescriptionZoomOverlayCancelButton&&(this.accessibilityDescriptionZoomOverlayCancelButton=e.accessibilityDescriptionZoomOverlayCancelButton),void 0!==e.accessibilityDescriptionReviewZoomButton&&(this.accessibilityDescriptionReviewZoomButton=e.accessibilityDescriptionReviewZoomButton),void 0!==e.accessibilityDescriptionReviewTopBarBackButton&&(this.accessibilityDescriptionReviewTopBarBackButton=e.accessibilityDescriptionReviewTopBarBackButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertConfirmButton&&(this.accessibilityDescriptionReviewDeletePageAlertConfirmButton=e.accessibilityDescriptionReviewDeletePageAlertConfirmButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton&&(this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton=e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertCancelButton&&(this.accessibilityDescriptionReviewDeletePageAlertCancelButton=e.accessibilityDescriptionReviewDeletePageAlertCancelButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton),void 0!==e.accessibilityDescriptionCameraLimitReachedOkButton&&(this.accessibilityDescriptionCameraLimitReachedOkButton=e.accessibilityDescriptionCameraLimitReachedOkButton),void 0!==e.accessibilityDescriptionCameraCancelYesButton&&(this.accessibilityDescriptionCameraCancelYesButton=e.accessibilityDescriptionCameraCancelYesButton),void 0!==e.accessibilityDescriptionCameraCancelNoButton&&(this.accessibilityDescriptionCameraCancelNoButton=e.accessibilityDescriptionCameraCancelNoButton)}}class Oe extends h.a{constructor(e={}){super(),this.topBarBackgroundColor="?sbColorPrimary",this.bottomBarBackgroundColor="?sbColorPrimary",void 0!==e.topBarBackgroundColor&&(this.topBarBackgroundColor=e.topBarBackgroundColor),void 0!==e.bottomBarBackgroundColor&&(this.bottomBarBackgroundColor=e.bottomBarBackgroundColor)}}class Le extends h.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new Z.Palette({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new ke({}),this.appearance=new Oe({}),this.outputSettings=new Ee({}),this.screens=new Ie({}),this.documentUuid=null,this.cleanScanningSession=!0,void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new Z.Palette(e.palette)),void 0!==e.localization&&(this.localization=new ke(e.localization)),void 0!==e.appearance&&(this.appearance=new Oe(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new Ee(e.outputSettings)),void 0!==e.screens&&(this.screens=new Ie(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}class Pe extends h.a{constructor(e={}){super(),this.flashButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new Z.RoundButton(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new Z.RoundButton(e.flipCameraButton))}}class _e extends h.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}class Re extends h.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new _e({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new _e(e.idealPreviewResolution))}}class Fe extends h.a{constructor(e={}){super(),this.title=new Z.StyledText({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new Z.ButtonConfiguration({text:"Cancel",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new Z.ButtonConfiguration(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return i})),n.d(t,"j",(function(){return s})),n.d(t,"k",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return f})),n.d(t,"h",(function(){return p}));var i,o=n(2),r=n(6);class a extends r.a{constructor(e={}){super(),this.image=new s({}),this.text=new o.StyledText({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.text&&(this.text=new o.StyledText(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"ReceiptsIntroImage":return new c(e);case"MedicalCertificateIntroImage":return new l(e);case"DocumentIntroImage":return new u(e);case"CheckIntroImage":return new d(e);case"IdCardIntroImage":return new m(e);case"CreditCardIntroImage":return new h(e);case"CustomImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class s extends r.a{constructor(e={}){super(),this._type="NoIntroImage"}}class c extends r.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class l extends r.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class u extends r.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class d extends r.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class m extends r.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class h extends r.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class f extends r.a{constructor(e={}){if(super(),this._type="CustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class p extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new o.ButtonConfiguration({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new o.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.ForegroundStyle({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new o.StyledText({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new o.StyledText({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new u({}),text:new o.StyledText({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.StyledText({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.StyledText({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.StyledText({text:"?cameraIntroItem4",color:"?sbColorOnSurface"})})],void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.topBarDoneButton&&(this.topBarDoneButton=new o.ButtonConfiguration(e.topBarDoneButton)),void 0!==e.title&&(this.title=new o.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.StyledText(e.subtitle)),void 0!==e.items&&(this.items=e.items.map((e=>new a(e))))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{static initialize(e=!1){this.verbose=e}static debug(e){this.verbose&&console.log("ScanbotSDK:",e)}static debugWarn(e){this.verbose&&console.warn("ScanbotSDK:",e)}}},,,function(e,t,n){"use strict";n.r(t),n.d(t,"OcrResult",(function(){return r})),n.d(t,"FieldValidationStatusValues",(function(){return a})),n.d(t,"FieldDataFormatValues",(function(){return s})),n.d(t,"FieldParsedData",(function(){return c})),n.d(t,"FieldType",(function(){return l})),n.d(t,"Field",(function(){return u})),n.d(t,"GenericDocumentType",(function(){return d})),n.d(t,"GenericDocument",(function(){return m}));var i=n(39),o=n(7);class r extends o.a{constructor(e={}){if(super(),void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence}}const a=["INVALID","NONE","CONFIRMED","INFERRED","VALID","IGNORED"],s=["ISO_DATE","ISO_COUNTRY_ALPHA_2","ISO_COUNTRY_ALPHA_3","ISO_COUNTRY_NUMERIC","ISO_COUNTRY_NAME","GENDER"];class c extends o.a{constructor(e={}){if(super(),void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class l extends o.a{constructor(e={}){if(super(),this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=e.normalizedName,void 0===e.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=e.commonType&&i.CommonFieldTypeValues.includes(e.commonType)?e.commonType:null,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class u extends o.a{constructor(e={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new l(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new r(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0===e.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=e.polygonInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus),void 0!==e.parsedData&&(this.parsedData=e.parsedData.map((e=>new c(e))))}}class d extends o.a{constructor(e={}){if(super(),this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=e.normalizedName,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class m extends o.a{constructor(e={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new d(e.type),void 0===e.fields)throw new Error("fields must be present in constructor argument");if(this.fields=e.fields.map((e=>new u(e))),void 0===e.children)throw new Error("children must be present in constructor argument");if(this.children=e.children.map((e=>new m(e))),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=e.quadInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.crop&&(this.crop=null!=e.crop?e.crop:null),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"LineSegmentInt",(function(){return o})),n.d(t,"LineSegmentFloat",(function(){return r})),n.d(t,"AspectRatio",(function(){return a}));var i=n(7);class o extends i.a{constructor(e={}){if(super(),void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class r extends i.a{constructor(e={}){if(super(),void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class a extends i.a{constructor(e={}){super(),this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(14),o=n(15),r=n(5);function a(){const e=new o.BarcodeScannerConfiguration;return e.viewFinder.overlayColor=Object(r.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(r.d)(e.viewFinder.style.strokeColor,e.palette),e.viewFinder}class s extends i.a{constructor(e){super(e),this.finder=a(),this.userGuidance=function(){const e=new o.BarcodeScannerConfiguration;return e.userGuidance.background.fillColor=Object(r.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(r.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(r.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,o;i.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),i.a.mapValuesDeep(null!==(o=t.userGuidance)&&void 0!==o?o:{},e.userGuidance)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(11);class o{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}scaleDown(e){return new o(this.x/e,this.y/e,this.width/e,this.height/e)}bottom(){return this.y+this.height}size(){return new i.a(this.width,this.height)}static withSize(e,t){return new o(0,0,e,t)}static empty(){return new o(0,0,0,0)}static fromRect(e){return e?new o(e.x,e.y,e.width,e.height):o.empty()}static fromPoint(e,t){return new o(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new o(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(0),o=n(23),r=n(5),a=n(9);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=o.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,i,o;(null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)===(null===(n=e.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)===(null===(o=e.padding)||void 0===o?void 0:o.minBottomPadding)&&this.props.configuration===e.configuration&&this.props.guidanceConfiguration===e.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var e;return null!==(e=this.holeCanvas.getBoundingClientRect())&&void 0!==e?e:new DOMRect},this.scaleForRetinaDisplay=e=>{if(window.devicePixelRatio>1){var t=e.width,n=e.height;e.width=t*window.devicePixelRatio,e.height=n*window.devicePixelRatio,e.style.width=t+"px",e.style.height=n+"px",e.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var e,t,n,i,o;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,c=Math.max(20,(r-s)/2),l=Math.min(s,r-2*c),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=l,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-l/2;const d=(null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)+this.guidanceTextTopPadding||0,m=Math.max(10,null!==(n=null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)&&void 0!==n?n:0),h=a-m-Math.max(10,null!==(o=null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)&&void 0!==o?o:0)-d;this.holePosition.height>h?(this.holePosition.height=h,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=m):this.holePosition.y=m+(h-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const p=this.crosshairCanvas.getContext("2d");p.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),p.restore()},this.drawBackground=e=>{const{width:t,height:n}=this.getVideoSize();e.clearRect(0,0,t,n),e.beginPath(),e.rect(0,0,t,n),e.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),e.fill()},this.drawHole=()=>{const e=this.holeCanvas.getContext("2d"),t=this.cornerRadius(),n=this.holePosition.x,i=this.holePosition.y,o=this.holePosition.width,r=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,i),e.arcTo(n+o,i,n+o,i+r,t),e.arcTo(n+o,i+r,n,i+r,t),e.arcTo(n,i+r,n,i,t),e.arcTo(n,i,n+o,i,t),e.closePath(),e.fill()},this.drawCrosshair=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;e.beginPath(),e.moveTo(t-10,n),e.lineTo(t+10,n),e.moveTo(t,n-10),e.lineTo(t,n+10),e.strokeStyle="white",e.fillStyle="white",e.lineWidth=1,e.stroke()},this.drawHoleCorners=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,o=this.holePosition.height,a=15,s=this.style.strokeWidth,c=this.cornerRadius();e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+i,n,c),e.lineTo(t+a,n),e.moveTo(t+i-a,n),e.arcTo(t+i,n,t+i,n+o,c),e.lineTo(t+i,n+a),e.moveTo(t+i,n+o-a),e.arcTo(t+i,n+o,t,n+o,c),e.lineTo(t+i-a,n+o),e.moveTo(t,n+o-a),e.arcTo(t,n+o,t+i,n+o,c),e.lineTo(t+a,n+o),e.strokeStyle=r.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.drawHoleOutline=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,o=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+i,n,t+i,n+o,a),e.moveTo(t+i,n+a),e.arcTo(t+i,n+o,t,n+o,a),e.moveTo(t+i-a,n+o),e.arcTo(t,n+o,t,n,a),e.moveTo(t,n+o-a),e.arcTo(t,n,t+i,n,a),e.strokeStyle=r.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.guidanceTextTopPadding=20,this.render=()=>i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:e=>{const t=this.holePosition;e.clientX>this.holePosition.x&&e.clientX<t.x+t.width&&e.clientY>t.y&&e.clientY<t.y+t.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},i.default.createElement("canvas",{ref:e=>{this.holeCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),i.default.createElement("canvas",{ref:e=>{this.crosshairCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&i.default.createElement("div",{ref:e=>{this.guidanceText=e},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},i.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var e,t;return this.holeRect.bottom()+(null!==(t=null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(0),o=n(13),r=n(27),a=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class s extends i.default.Component{constructor(e){super(e),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(e){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(e){var t,n;return a(this,void 0,void 0,(function*(){const i=this.props.preferredCamera;if(i)try{const t=(yield navigator.mediaDevices.enumerateDevices()).find((e=>e.deviceId===i||e.label===i));if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}catch(e){throw o.a.enumerateDevicesFailed()}else{const i={user:"front",environment:"back"},o=(null===(t=null==e?void 0:e.facingMode)||void 0===t?void 0:t.ideal)||(null===(n=null==e?void 0:e.facingMode)||void 0===n?void 0:n.exact)||(null==e?void 0:e.facingMode);if("string"==typeof o&&o in i){yield r.a.INSTANCE.load();const t=r.a.INSTANCE.getMainCamera(i[o]);if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}}return e}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var e,t,n,i,r,s,c,l;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,o.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=o.a.unknown();return null===(i=(n=this.props).onError)||void 0===i||i.call(n,e),void console.log(e)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(e);this.setState({stream:t},(()=>{var e,n,i,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(e){const t=o.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,t),void console.error(t)}}catch(e){const t=o.a.createFromDOMException(e);return null===(l=(c=this.props).onError)||void 0===l||l.call(c,t),void console.error(t)}}))}stopCurrentStreams(){const e=this.state.stream,t=null==e?void 0:e.getTracks();t&&t.forEach((e=>{e.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((e=>e.stop())),this.state.stream.getAudioTracks().forEach((e=>e.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(e){return a(this,void 0,void 0,(function*(){const t=[{torch:e}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:t})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const e=this.getVideoTrack();return s.getMediaTrackCapabilities(e)}}static getMediaTrackCapabilities(e){if(e&&e.getCapabilities)return e.getCapabilities()}getVideoTrack(){const e=this.state.stream.getVideoTracks();if(e.length>0)return e[0]}}var c=n(11),l=n(23),u=n(17),d=n(37);class m{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const e=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),t=e.createTexture();e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);const n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),e.compileShader(n);const i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),e.compileShader(i);const o=this.program=e.createProgram();e.attachShader(o,n),e.attachShader(o,i),e.linkProgram(o),e.useProgram(o),e.uniform1i(e.getUniformLocation(o,"texture"),0),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0)}getImageData(e,t,n,i,o,r,a,s){let c,l;if(r=Math.floor(r),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),i=Math.floor(i),o=Math.floor(o),e instanceof HTMLVideoElement)[l,c]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[l,c]=[e.width,e.height]}(l<t+i||c<n+o)&&u.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const m=this.gl;this.canvas.width=r,this.canvas.height=a,m.viewport(0,0,r,a);const h=[i/(r*l),o/(a*c)],f=[t/l,n/c];return m.uniform2fv(m.getUniformLocation(this.program,"scale"),h),m.uniform2fv(m.getUniformLocation(this.program,"offset"),f),m.texImage2D(m.TEXTURE_2D,0,m.RGB,m.RGB,m.UNSIGNED_BYTE,e),m.drawArrays(m.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),m.readPixels(0,0,r,a,m.RGBA,m.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class h{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(e,t,n,i,o,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(e,t,n,i,o,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var f=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class p extends i.default.Component{constructor(e){super(e),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=e=>{this.video.srcObject=e,this.updateCameraInfo(e),this.video.addEventListener("resize",(e=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(e=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:e,clientVideoHeight:t}=this.calculateClientVideoConstraints();return new c.a(e,t)}saveExtractedData(){this.save=!0}zoom(){var e;return null!==(e=this.props.zoom)&&void 0!==e?e:1}imageCapture(){if(this.capture)return this.capture;const e=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(e),this.capture}set reusableImageBuffer(e){this._reusableImageBuffer=e}createImageData(e=0,t){return f(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(t){const e=yield this.imageCapture().takePhoto(),t=yield createImageBitmap(e);u.a.debug("Bitmap size: "+t.width*t.height);const i=this.windowSize(),o=t.height/(i.height+i.y),r=i.width*o,a=i.height*o,s=t.width/2-r/2,c=i.y*o,d=new l.a(s,c,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,t.width,t.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:i,videoHeight:o}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const c=this.finderFrame||new l.a(0,0,r,a);if(c.width<=0||c.height<=0)return;const d=this.zoom(),m=(i-r/d)/2,h=(o-a/d)/2,f=c.x/s+m,p=c.y/s+h,g=this.finderFrame?s:d,v=c.width/g,C=c.height/g,y=this.calculateFrameSize(e,v,C);return n.getImageData(this.video,f,p,v,C,y.width,y.height,this._reusableImageBuffer)}))}windowSize(){var e;const t=this.props.configuration,n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return l.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),i=e,o=t,r=1;return n.width/n.height<=e/t?(r=n.height/t,r>0&&(i=n.width/r)):(r=n.width/e,r>0&&(o=n.height/r)),{clientVideoWidth:i,clientVideoHeight:o,coef:r}}calculateFrameSize(e,t,n){let i=t,o=n;if(e>0&&0!=t&&0!=n){const r=t/n;t>n?(i=t>e?e:t,o=i/r):(o=n>e?e:n,i=o*r)}return new c.a(i,o)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=m.isSupported()?new m:new h,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var e;const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(e=this.props.configuration)||void 0===e?void 0:e.backgroundColor};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const e=this.zoom();return 1===e?0:(1-e)/2*100}render(){const{videoConstraints:e,onReady:t,onError:n}=this.props;return i.default.createElement(s,{videoConstraints:e,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:t,onStreamChanged:this.onStreamChanged,onError:n,ref:e=>{this.videoStream=e}},i.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:e=>{this.video=e},style:this.style()}))}setDirection(e){this.props.videoConstraints.facingMode={ideal:e},this.setState({facingModeBack:"environment"===e,mirrored:"user"===e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(e){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const t=!this.state.facingModeBack,n=t?"environment":"user";this.props.videoConstraints.facingMode=!0===e?{exact:n}:{ideal:n},this.setState({facingModeBack:t,mirrored:!t},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(e,t){return f(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=t?t:this.state.mirrored,deviceId:e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(e){this.activeCamera=r.a.getCameraInfoFromStream(e)}getActiveCameraInfo(){return this.activeCamera}setTorchState(e){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:e}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Ye}));var i=n(4),o=(n(51),n(0)),r=n(49),a=n.n(r),s=n(29),c=n(50),l="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",m="6.1.8",h="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,p=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function C(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var y=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),b=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A=/(^-|-$)/g;function S(e){return e.replace(b,"-").replace(A,"")}var w=/(a)(d)/gi,E=function(e){return String.fromCharCode(e+(e>25?39:97))};function x(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=E(t%52)+n;return(E(t%52)+n).replace(w,"$1-$2")}var D,B=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},T=function(e){return B(5381,e)};function I(e){return x(T(e)>>>0)}function k(e){return e.displayName||e.name||"Component"}function O(e){return"string"==typeof e&&!0}var L="function"==typeof Symbol&&Symbol.for,P=L?Symbol.for("react.memo"):60115,_=L?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},F={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},N=((D={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},D[P]=M,D);function V(e){return("type"in(t=e)&&t.type.$$typeof)===P?M:"$$typeof"in e?N[e.$$typeof]:R;var t}var W=Object.defineProperty,z=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,H=Object.getOwnPropertyDescriptor,U=Object.getPrototypeOf,Z=Object.prototype;function G(e,t,n){if("string"!=typeof t){if(Z){var i=U(t);i&&i!==Z&&G(e,i,n)}var o=z(t);j&&(o=o.concat(j(t)));for(var r=V(e),a=V(t),s=0;s<o.length;++s){var c=o[s];if(!(c in F||n&&n[c]||a&&c in a||r&&c in r)){var l=H(t,c);try{W(e,c,l)}catch(e){}}}}return e}function Y(e){return"function"==typeof e}function Q(e){return"object"==typeof e&&"styledComponentId"in e}function q(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function X(e,t){if(0===e.length)return"";for(var n=e[0],i=1;i<e.length;i++)n+=t?t+e[i]:e[i];return n}function K(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function J(e,t,n){if(void 0===n&&(n=!1),!n&&!K(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var i=0;i<t.length;i++)e[i]=J(e[i],t[i]);else if(K(t))for(var i in t)e[i]=J(e[i],t[i]);return e}function $(e,t){Object.defineProperty(e,"toString",{value:t})}function ee(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var te=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,o=i;e>=o;)if((o<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(e+1),s=(r=0,t.length);r<s;r++)this.tag.insertRule(a,t[r])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),i=n+t;this.groupSizes[e]=0;for(var o=n;o<i;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),o=i+n,r=i;r<o;r++)t+="".concat(this.tag.getRule(r)).concat(h);return t},e}(),ne=new Map,ie=new Map,oe=1,re=function(e){if(ne.has(e))return ne.get(e);for(;ie.has(oe);)oe++;var t=oe++;return ne.set(e,t),ie.set(t,e),t},ae=function(e,t){oe=t+1,ne.set(e,t),ie.set(t,e)},se="style[".concat(l,"][").concat(d,'="').concat(m,'"]'),ce=new RegExp("^".concat(l,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),le=function(e,t,n){for(var i,o=n.split(","),r=0,a=o.length;r<a;r++)(i=o[r])&&e.registerName(t,i)},ue=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),o=[],r=0,a=i.length;r<a;r++){var s=i[r].trim();if(s){var c=s.match(ce);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(ae(u,l),le(e,u,c[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(s)}}};function de(){return n.nc}var me=function(e){var t=document.head,n=e||t,i=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(l,"]")));return t[t.length-1]}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(l,u),i.setAttribute(d,m);var a=de();return a&&i.setAttribute("nonce",a),n.insertBefore(i,r),i},he=function(){function e(e){this.element=me(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n<i;n++){var o=t[n];if(o.ownerNode===e)return o}throw ee(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),fe=function(){function e(e){this.element=me(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),pe=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ge=f,ve={isServer:!f,useCSSOMInjection:!p},Ce=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var o=this;this.options=Object(i.a)(Object(i.a)({},ve),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&f&&ge&&(ge=!1,function(e){for(var t=document.querySelectorAll(se),n=0,i=t.length;n<i;n++){var o=t[n];o&&o.getAttribute(l)!==u&&(ue(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",o=function(n){var o=function(e){return ie.get(e)}(n);if(void 0===o)return"continue";var r=e.names.get(o),a=t.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(l,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==r&&r.forEach((function(e){e.length>0&&(c+="".concat(e,","))})),i+="".concat(a).concat(s,'{content:"').concat(c,'"}').concat(h)},r=0;r<n;r++)o(r);return i}(o)}))}return e.registerId=function(e){return re(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Object(i.a)(Object(i.a)({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new pe(n):t?new he(n):new fe(n)}(this.options),new te(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(re(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(re(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(re(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),ye=/&/g,be=/^\s*\/\/.*$/gm;function Ae(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ae(e.children,t)),e}))}function Se(e){var t,n,i,o=void 0===e?v:e,r=o.options,a=void 0===r?v:r,c=o.plugins,l=void 0===c?g:c,u=function(e,i,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},d=l.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ye,n).replace(i,u))})),a.prefix&&d.push(s.d),d.push(s.g);var m=function(e,o,r,c){void 0===o&&(o=""),void 0===r&&(r=""),void 0===c&&(c="&"),t=c,n=o,i=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(be,""),u=s.b(r||o?"".concat(r," ").concat(o," { ").concat(l," }"):l);a.namespace&&(u=Ae(u,a.namespace));var m=[];return s.f(u,s.c(d.concat(s.e((function(e){return m.push(e)}))))),m};return m.hash=l.length?l.reduce((function(e,t){return t.name||ee(15),B(e,t.name)}),5381).toString():"",m}var we=new Ce,Ee=Se(),xe=o.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),De=(xe.Consumer,o.default.createContext(void 0));function Be(){return Object(o.useContext)(xe)}function Te(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],i=t[1],r=Be().styleSheet,s=Object(o.useMemo)((function(){var t=r;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,r]),c=Object(o.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(o.useEffect)((function(){a()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var l=Object(o.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:c}}),[e.shouldForwardProp,s,c]);return o.default.createElement(xe.Provider,{value:l},o.default.createElement(De.Provider,{value:c},e.children))}var Ie=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ee);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$(this,(function(){throw ee(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Ee),this.name+e.hash},e}(),ke=function(e){return e>="A"&&e<="Z"};function Oe(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;ke(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Le=function(e){return null==e||!1===e||""===e},Pe=function(e){var t,n,o=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Le(a)&&(Array.isArray(a)&&a.isCss||Y(a)?o.push("".concat(Oe(r),":"),a,";"):K(a)?o.push.apply(o,Object(i.e)(Object(i.e)(["".concat(r," {")],Pe(a),!1),["}"],!1)):o.push("".concat(Oe(r),": ").concat((t=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in c.a||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return o};function _e(e,t,n,i){return Le(e)?[]:Q(e)?[".".concat(e.styledComponentId)]:Y(e)?!Y(o=e)||o.prototype&&o.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,i):e instanceof Ie?n?(e.inject(n,i),[e.getName(i)]):[e]:K(e)?Pe(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,i)}))):[e.toString()];var o}function Re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Y(n)&&!Q(n))return!1}return!0}var Fe=T(m),Me=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Re(e),this.componentId=t,this.baseHash=B(Fe,t),this.baseStyle=n,Ce.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=q(i,this.staticRulesId);else{var o=X(_e(this.rules,e,t,n)),r=x(B(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,r)){var a=n(o,".".concat(r),void 0,this.componentId);t.insertRules(this.componentId,r,a)}i=q(i,r),this.staticRulesId=r}else{for(var s=B(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u;else if(u){var d=X(_e(u,e,t,n));s=B(s,d+l),c+=d}}if(c){var m=x(s>>>0);t.hasNameForId(this.componentId,m)||t.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=q(i,m)}}return i},e}(),Ne=o.default.createContext(void 0);Ne.Consumer;var Ve={};new Set;function We(e,t,n){var r=Q(e),a=e,s=!O(e),c=t.attrs,l=void 0===c?g:c,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":S(e);Ve[n]=(Ve[n]||0)+1;var i="".concat(n,"-").concat(I(m+n+Ve[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):u,h=t.displayName,f=void 0===h?function(e){return O(e)?"styled.".concat(e):"Styled(".concat(k(e),")")}(e):h,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,b=r&&a.attrs?a.attrs.concat(l).filter(Boolean):l,A=t.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;A=function(e,t){return w(e,t)&&E(e,t)}}else A=w}var x=new Me(n,p,r?a.componentStyle:void 0);function D(e,t){return function(e,t,n){var r=e.attrs,a=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.styledComponentId,u=e.target,d=o.default.useContext(Ne),m=Be(),h=e.shouldForwardProp||m.shouldForwardProp,f=C(t,d,s)||v,p=function(e,t,n){for(var o,r=Object(i.a)(Object(i.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Y(o=e[a])?o(r):o;for(var c in s)r[c]="className"===c?q(r[c],s[c]):"style"===c?Object(i.a)(Object(i.a)({},r[c]),s[c]):s[c]}return t.className&&(r.className=q(r.className,t.className)),r}(r,t,f),g=p.as||u,b={};for(var A in p)void 0===p[A]||"$"===A[0]||"as"===A||"theme"===A&&p.theme===f||("forwardedAs"===A?b.as=p.forwardedAs:h&&!h(A,g)||(b[A]=p[A]));var S=function(e,t){var n=Be();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=q(c,l);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),b[O(g)&&!y.has(g)?"class":"className"]=w,b.ref=n,Object(o.createElement)(g,b)}(B,e,t)}D.displayName=f;var B=o.default.forwardRef(D);return B.attrs=b,B.componentStyle=x,B.displayName=f,B.shouldForwardProp=A,B.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",B.styledComponentId=p,B.target=r?a.target:e,Object.defineProperty(B,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,o=t;i<o.length;i++)J(e,o[i],!0);return e}({},a.defaultProps,e):e}}),$(B,(function(){return".".concat(B.styledComponentId)})),s&&G(B,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),B}function ze(e,t){for(var n=[e[0]],i=0,o=t.length;i<o;i+=1)n.push(t[i],e[i+1]);return n}var je=function(e){return Object.assign(e,{isCss:!0})};function He(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Y(e)||K(e))return je(_e(ze(g,Object(i.e)([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?_e(o):je(_e(ze(o,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var o=function(o){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(i.e)([o],r,!1)))};return o.attrs=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),o))},o}var Ze=function(e){return Ue(We,e)},Ge=Ze;y.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),Ce.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,i){var o=i(X(_e(this.rules,t,n,i)),""),r=this.componentId+e;n.insertRules(r,r,o)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,i){e>2&&Ce.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,i)}}();function Ye(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=X(He.apply(void 0,Object(i.e)([e],t,!1))),r=I(o);return new Ie(r,o)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),i=X([n&&'nonce="'.concat(n,'"'),"".concat(l,'="true"'),"".concat(d,'="').concat(m,'"')].filter(Boolean)," ");return"<style ".concat(i,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw ee(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw ee(2);var n=((t={})[l]="",t[d]=m,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=de();return r&&(n.nonce=r),[o.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ce({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return o.default.createElement(Te,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(l,"__")}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(13),o=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(e){if(e&&(this.strategy=e),"SLOW"===e||"FAST"===e){const t=e;this.load(t)}}load(e){return o(this,void 0,void 0,(function*(){if(!e)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)e="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)e="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let t;if("SLOW"===e)t=this.loadSlow();else{if("FAST"!==e)throw new Error(`Unknown mode ${e}`);t=this.loadFast()}try{return this.listOfCameras=yield t,this.listOfCameras}catch(e){throw this.loadSlowResult=void 0,i.a.createFromDOMException(e)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>o(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:t.deviceId}}),e.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>o(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(t.label),i=r.guessparseCameraLabelMaxNumPixels(t.label);e.push({maxNumPixels:i,facingMode:n,supportsTorchControl:void 0,deviceId:t.deviceId,label:t.label})}return e})))(),this.loadFastResult}getMainCamera(e){var t,n,i,o,r,a;return null!==(a=null===(r=null===(o=null===(i=null===(n=null===(t=this.listOfCameras)||void 0===t?void 0:t.filter((t=>t.facingMode===e)))||void 0===n?void 0:n.map(((e,t)=>({camera:e,index:t}))))||void 0===i?void 0:i.sort(((e,t)=>{var n;return-(+e.camera.supportsTorchControl||0)-(+t.camera.supportsTorchControl||0)||-((e.camera.maxNumPixels||0)-(t.camera.maxNumPixels||0))||(null===(n=e.camera.label)||void 0===n?void 0:n.localeCompare(t.camera.label))||e.index-t.index})))||void 0===o?void 0:o[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return o(this,void 0,void 0,(function*(){let e=yield navigator.mediaDevices.enumerateDevices();if(e=e.filter((e=>"videoinput"===e.kind)),e.some((e=>""===e.label))){let t;try{t=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),e=yield navigator.mediaDevices.enumerateDevices(),e=e.filter((e=>"videoinput"===e.kind))}finally{this.stopStream(t)}}return e}))}stopStream(e){null==e||e.getTracks().forEach((e=>e.stop()))}static guessparseCameraLabelFacingMode(e){return function(e){const t=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of t)if(e.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(e)?"back":"front"}static guessparseCameraLabelMaxNumPixels(e){const t=RegExp(/\b([0-9]+)mp?\b/).exec(e.toLowerCase()),n=t?1e6*parseInt(t[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return o(this,void 0,void 0,(function*(){if(i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())throw i.a.permissionDenied();if(!navigator.mediaDevices)throw i.a.unknown()}))}static getCameraInfoFromStream(e){var t;return null===(t=e.getVideoTracks().map((e=>{var t,n,i,o,r,a;const s=null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e),c=null===(n=e.getSettings)||void 0===n?void 0:n.call(e),l=e.label;let u=function(e){if("user"===(null==e?void 0:e.toLowerCase()))return"front";if("environment"===(null==e?void 0:e.toLowerCase()))return"back";return"unknown"}(null!==(o=null===(i=null==s?void 0:s.facingMode)||void 0===i?void 0:i[0])&&void 0!==o?o:c.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(l));let d=function(e){var t,n;let i=(null===(t=null==e?void 0:e.width)||void 0===t?void 0:t.max)*(null===(n=null==e?void 0:e.height)||void 0===n?void 0:n.max);if(!i||Number.isNaN(i))return;return i}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(l));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in c)&&void 0!==a&&a,label:l,deviceId:c.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return o(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(e)}catch(e){throw i.a.mediaDeviceNotFound()}}))}}},function(e,t,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var r=typeof i;if("string"===r||"number"===r)e.push(i);else if(Array.isArray(i)){if(i.length){var a=o.apply(null,i);a&&e.push(a)}}else if("object"===r)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&e.push(s);else e.push(i.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return G})),n.d(t,"c",(function(){return ee})),n.d(t,"d",(function(){return ne})),n.d(t,"e",(function(){return te})),n.d(t,"f",(function(){return J})),n.d(t,"g",(function(){return $}));var i="-ms-",o="-moz-",r="-webkit-",a="comm",s="rule",c="decl",l="@keyframes",u=Math.abs,d=String.fromCharCode,m=Object.assign;function h(e){return e.trim()}function f(e,t){return(e=t.exec(e))?e[0]:e}function p(e,t,n){return e.replace(t,n)}function g(e,t,n){return e.indexOf(t,n)}function v(e,t){return 0|e.charCodeAt(t)}function C(e,t,n){return e.slice(t,n)}function y(e){return e.length}function b(e){return e.length}function A(e,t){return t.push(e),e}function S(e,t){return e.map(t).join("")}function w(e,t){return e.filter((function(e){return!f(e,t)}))}var E=1,x=1,D=0,B=0,T=0,I="";function k(e,t,n,i,o,r,a,s){return{value:e,root:t,parent:n,type:i,props:o,children:r,line:E,column:x,length:a,return:"",siblings:s}}function O(e,t){return m(k("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=O(e.root,{children:[e]});A(e,e.siblings)}function P(){return T=B<D?v(I,B++):0,x++,10===T&&(x=1,E++),T}function _(){return v(I,B)}function R(){return B}function F(e,t){return C(I,e,t)}function M(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function N(e){return E=x=1,D=y(I=e),B=0,[]}function V(e){return I="",e}function W(e){return h(F(B-1,H(91===e?e+2:40===e?e+1:e)))}function z(e){for(;(T=_())&&T<33;)P();return M(e)>2||M(T)>3?"":" "}function j(e,t){for(;--t&&P()&&!(T<48||T>102||T>57&&T<65||T>70&&T<97););return F(e,R()+(t<6&&32==_()&&32==P()))}function H(e){for(;P();)switch(T){case e:return B;case 34:case 39:34!==e&&39!==e&&H(T);break;case 40:41===e&&H(e);break;case 92:P()}return B}function U(e,t){for(;P()&&e+T!==57&&(e+T!==84||47!==_()););return"/*"+F(t,B-1)+"*"+d(47===e?e:P())}function Z(e){for(;!M(_());)P();return F(e,B)}function G(e){return V(Y("",null,null,null,[""],e=N(e),0,[0],e))}function Y(e,t,n,i,o,r,a,s,c){for(var l=0,m=0,h=a,f=0,C=0,b=0,S=1,w=1,D=1,k=0,O="",L=o,F=r,M=i,N=O;w;)switch(b=k,k=P()){case 40:if(108!=b&&58==v(N,h-1)){-1!=g(N+=p(W(k),"&","&\f"),"&\f",u(l?s[l-1]:0))&&(D=-1);break}case 34:case 39:case 91:N+=W(k);break;case 9:case 10:case 13:case 32:N+=z(b);break;case 92:N+=j(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(q(U(P(),R()),t,n,c),c);break;default:N+="/"}break;case 123*S:s[l++]=y(N)*D;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+m:-1==D&&(N=p(N,/\f/g,"")),C>0&&y(N)-h&&A(C>32?X(N+";",i,n,h-1,c):X(p(N," ","")+";",i,n,h-2,c),c);break;case 59:N+=";";default:if(A(M=Q(N,t,n,l,m,o,s,O,L=[],F=[],h,r),r),123===k)if(0===m)Y(N,t,M,M,L,r,h,s,F);else switch(99===f&&110===v(N,3)?100:f){case 100:case 108:case 109:case 115:Y(e,M,M,i&&A(Q(e,M,M,0,0,o,s,O,o,L=[],h,F),F),o,F,h,s,i?L:F);break;default:Y(N,M,M,M,[""],F,0,s,F)}}l=m=C=0,S=D=1,O=N="",h=a;break;case 58:h=1+y(N),C=b;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(T=B>0?v(I,--B):0,x--,10===T&&(x=1,E--),T))continue;switch(N+=d(k),k*S){case 38:D=m>0?1:(N+="\f",-1);break;case 44:s[l++]=(y(N)-1)*D,D=1;break;case 64:45===_()&&(N+=W(P())),f=_(),m=h=y(O=N+=Z(R())),k++;break;case 45:45===b&&2==y(N)&&(S=0)}}return r}function Q(e,t,n,i,o,r,a,c,l,d,m,f){for(var g=o-1,v=0===o?r:[""],y=b(v),A=0,S=0,w=0;A<i;++A)for(var E=0,x=C(e,g+1,g=u(S=a[A])),D=e;E<y;++E)(D=h(S>0?v[E]+" "+x:p(x,/&\f/g,v[E])))&&(l[w++]=D);return k(e,t,n,0===o?s:c,l,d,m,f)}function q(e,t,n,i){return k(e,t,n,a,d(T),C(e,2,-2),0,i)}function X(e,t,n,i,o){return k(e,t,n,c,C(e,0,i),C(e,i+1,-1),i,o)}function K(e,t,n){switch(function(e,t){return 45^v(e,0)?(((t<<2^v(e,0))<<2^v(e,1))<<2^v(e,2))<<2^v(e,3):0}(e,t)){case 5103:return r+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+e+e;case 4789:return o+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r+e+o+e+i+e+e;case 5936:switch(v(e,t+11)){case 114:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return r+e+i+e+e;case 6165:return r+e+i+"flex-"+e+e;case 5187:return r+e+p(e,/(\w+).+(:[^]+)/,r+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return r+e+i+"flex-item-"+p(e,/flex-|-self/g,"")+(f(e,/flex-|baseline/)?"":i+"grid-row-"+p(e,/flex-|-self/g,""))+e;case 4675:return r+e+i+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return r+e+i+p(e,"shrink","negative")+e;case 5292:return r+e+i+p(e,"basis","preferred-size")+e;case 6060:return r+"box-"+p(e,"-grow","")+r+e+i+p(e,"grow","positive")+e;case 4554:return r+p(e,/([^-])(transform)/g,"$1"+r+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+e+e;case 4200:if(!f(e,/flex-|baseline/))return i+"grid-column-align"+C(e,t)+e;break;case 2592:case 3360:return i+p(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,f(e.props,/grid-\w+-end/)}))?~g(e+(n=n[t].value),"span",0)?e:i+p(e,"-start","")+e+i+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(e,/\d+/))+";":i+p(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return f(e.props,/grid-\w+-start/)}))?e:i+p(p(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,r+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(y(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+o+(108==v(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch",0)?K(p(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return p(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,o,r,a,s,c){return i+n+":"+o+c+(r?i+n+"-span:"+(a?s:+s-+o)+c:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+r)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(e,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+i+"$2box$3")+e;case 100:return p(e,":",":"+i)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return p(e,"scroll-","scroll-snap-")+e}return e}function J(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function $(e,t,n,i){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case c:return e.return=e.return||e.value;case a:return"";case l:return e.return=e.value+"{"+J(e.children,i)+"}";case s:if(!y(e.value=e.props.join(",")))return""}return y(n=J(e.children,i))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=b(e);return function(n,i,o,r){for(var a="",s=0;s<t;s++)a+=e[s](n,i,o,r)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case c:return void(e.return=K(e.value,e.length,n));case l:return J([O(e,{value:p(e.value,"@","@"+r)})],o);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(O(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)});break;case"::placeholder":L(O(e,{props:[p(t,/:(plac\w+)/,":"+r+"input-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,i+"input-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(3),o=n(6);class r extends o.a{constructor(e={}){super(),this.title=new i.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new i.c({text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new i.j(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new i.c(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(3),o=n(6);class r extends o.a{constructor(e={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new i.j(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));var i=n(8);function o(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t,n){return new i.a(o(e.x,-t/2,n.width-t/2),o(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";n.r(t),n.d(t,"OutputModeValues",(function(){return o})),n.d(t,"BinarizationFilterPresetValues",(function(){return r})),n.d(t,"ParametricFilter",(function(){return a})),n.d(t,"ScanbotBinarizationFilter",(function(){return s})),n.d(t,"CustomBinarizationFilter",(function(){return c})),n.d(t,"ColorDocumentFilter",(function(){return l})),n.d(t,"BrightnessFilter",(function(){return u})),n.d(t,"ContrastFilter",(function(){return d})),n.d(t,"GrayscaleFilter",(function(){return m})),n.d(t,"LegacyFilter",(function(){return h})),n.d(t,"WhiteBlackPointFilter",(function(){return f}));var i=n(7);const o=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new s(e);case"CustomBinarizationFilter":return new c(e);case"ColorDocumentFilter":return new l(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new d(e);case"GrayscaleFilter":return new m(e);case"LegacyFilter":return new h(e);case"WhiteBlackPointFilter":return new f(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s extends i.a{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class c extends i.a{constructor(e={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class l extends i.a{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class u extends i.a{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class d extends i.a{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class m extends i.a{constructor(e={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class h extends i.a{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class f extends i.a{constructor(e={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeFormatConfigurationBase",(function(){return i})),n.d(t,"BarcodeFormatOneDConfigurationBase",(function(){return o})),n.d(t,"BarcodeFormatCodabarConfiguration",(function(){return a})),n.d(t,"BarcodeFormatCode11Configuration",(function(){return s})),n.d(t,"BarcodeFormatCode39Configuration",(function(){return c})),n.d(t,"BarcodeFormatCode93Configuration",(function(){return l})),n.d(t,"BarcodeFormatCode128Configuration",(function(){return u})),n.d(t,"BarcodeFormatCode2Of5Configuration",(function(){return d})),n.d(t,"BarcodeFormatDataBarConfiguration",(function(){return m})),n.d(t,"BarcodeFormatDataBarExpandedConfiguration",(function(){return h})),n.d(t,"BarcodeFormatDataBarLimitedConfiguration",(function(){return f})),n.d(t,"BarcodeFormatItfConfiguration",(function(){return p})),n.d(t,"MsiPlesseyChecksumAlgorithmValues",(function(){return g})),n.d(t,"BarcodeFormatMsiPlesseyConfiguration",(function(){return v})),n.d(t,"BarcodeFormatUpcEanConfiguration",(function(){return C})),n.d(t,"BarcodeFormatPharmaCodeConfiguration",(function(){return y})),n.d(t,"BarcodeFormatTwoDConfigurationBase",(function(){return b})),n.d(t,"BarcodeFormatAztecConfiguration",(function(){return S})),n.d(t,"BarcodeFormatQrCodeConfiguration",(function(){return w})),n.d(t,"BarcodeFormatPdf417Configuration",(function(){return E})),n.d(t,"BarcodeFormatMicroPdf417Configuration",(function(){return x})),n.d(t,"BarcodeFormatDataMatrixConfiguration",(function(){return D})),n.d(t,"BarcodeFormatMaxiCodeConfiguration",(function(){return B})),n.d(t,"BarcodeFormatFourStateConfigurationBase",(function(){return A})),n.d(t,"AustraliaPostCustomerFormatValues",(function(){return T})),n.d(t,"BarcodeFormatAustraliaPostConfiguration",(function(){return I})),n.d(t,"BarcodeFormatJapanPostConfiguration",(function(){return k})),n.d(t,"BarcodeFormatRoyalMailConfiguration",(function(){return O})),n.d(t,"BarcodeFormatRoyalTntPostConfiguration",(function(){return L})),n.d(t,"BarcodeFormatUspsIntelligentMailConfiguration",(function(){return P})),n.d(t,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return _})),n.d(t,"BarcodeFormatGs1CompositeConfiguration",(function(){return R})),n.d(t,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(t,"BarcodeFormatCommonTwoDConfiguration",(function(){return M})),n.d(t,"BarcodeFormatCommonFourStateConfiguration",(function(){return N})),n.d(t,"BarcodeFormatCommonConfiguration",(function(){return V}));var i,o,r=n(7);!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new B(e);case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);case"BarcodeFormatGS1CompositeConfiguration":return new R(e);case"BarcodeFormatCommonOneDConfiguration":return new F(e);case"BarcodeFormatCommonTwoDConfiguration":return new M(e);case"BarcodeFormatCommonFourStateConfiguration":return new N(e);case"BarcodeFormatCommonConfiguration":return new V(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class a extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class s extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class c extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn&&(this.pzn=e.pzn),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class l extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class u extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class d extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class m extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class h extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class f extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class p extends r.a{constructor(e={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}const g=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class v extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class C extends r.a{constructor(e={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="ALLOW_ANY",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class y extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}var b,A;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new B(e);default:throw`Unknown child class name: ${t}`}}}(b||(b={}));class S extends r.a{constructor(e={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class w extends r.a{constructor(e={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class E extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class x extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class D extends r.a{constructor(e={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class B extends r.a{constructor(e={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);default:throw`Unknown child class name: ${t}`}}}(A||(A={}));const T=["NUMERIC","ALPHA_NUMERIC"];class I extends r.a{constructor(e={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class k extends r.a{constructor(e={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class O extends r.a{constructor(e={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class L extends r.a{constructor(e={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class P extends r.a{constructor(e={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class _ extends r.a{constructor(e={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class R extends r.a{constructor(e={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class F extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class M extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class V extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}},function(e,t,n){"use strict";(function(e){function i(e,t=!1){const n=[];if(t)return n;return function e(t){if(t)if(t.constructor===ImageData)n.push(t.data.buffer);else if(t.constructor===ArrayBuffer)n.push(t);else if(ArrayBuffer.isView(t))n.push(t.buffer);else if(Array.isArray(t))for(let n=0;n<t.length;++n)e(t[n]);else if(t.constructor===Object)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function o(e){return e.startsWith("http:")||e.startsWith("https:")}function r(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}function a(e){const{allowSimd:t=!0,allowThreads:n=!0}=e||{};let i="";if(t&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(e){return!1}}()){i+="-simd";n&&r()&&(i+="-threads")}return i}n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a}))}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.values=new Map}}i.INSTANCE=new i},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeItem",(function(){return a})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return s})),n.d(t,"BarcodeScannerConfiguration",(function(){return c})),n.d(t,"BarcodeScannerResult",(function(){return l}));var i=n(35),o=n(7),r=n(20);class a extends o.a{constructor(e={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0!==e.format&&(this.format=e.format),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");if(this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y}))),void 0!==e.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?e.sourceImage:null),void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,void 0===e.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=e.upcEanExtension,void 0!==e.isGS1Message&&(this.isGS1Message=e.isGS1Message),void 0!==e.isGS1CompositePart&&(this.isGS1CompositePart=e.isGS1CompositePart),void 0!==e.dataBarStackSize&&(this.dataBarStackSize=e.dataBarStackSize),void 0!==e.sizeScore&&(this.sizeScore=e.sizeScore),void 0===e.extractedDocument)throw new Error("extractedDocument must be present in constructor argument");this.extractedDocument=null!=e.extractedDocument?new r.GenericDocument(e.extractedDocument):null}}const s=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_AR","NEXT_GEN_AR"];class c extends o.a{constructor(e={}){super(),this.barcodeFormatConfigurations=[new i.BarcodeFormatCommonConfiguration({})],this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,void 0!==e.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=e.barcodeFormatConfigurations.map((e=>i.BarcodeFormatConfigurationBase.From(e)))),void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.live&&(this.live=e.live)}}class l extends o.a{constructor(e={}){if(super(),void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new a(e))),void 0===e.success)throw new Error("success must be present in constructor argument");this.success=e.success}}},function(e,t,n){"use strict";n.r(t),n.d(t,"CommonFieldTypeValues",(function(){return i}));const i=["ID","SURNAME","MAIDEN_NAME","GIVEN_NAMES","BIRTH_DATE","NATIONALITY","BIRTHPLACE","EXPIRY_DATE","EYE_COLOR","HEIGHT","ISSUE_DATE","ISSUING_AUTHORITY","ADDRESS","PSEUDONYM","MRZ","COUNTRY_CODE","GENDER","SIGNATURE","PHOTO","VALID_FROM_DATE","ROUTING_NUMBER","ACCOUNT_NUMBER","PLACE_OF_ISSUE","TITLE_TYPE","REMARKS","NAME","CARD_ACCESS_NUMBER"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(e,t,n){Object.keys(e).forEach((i=>{(null==n?void 0:n.includes(i))||(t[i]=e[i])}))}static mapValuesDeep(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e);Object.keys(e).forEach((o=>{o in t&&n(e[o])&&n(t[o])?i.mapValuesDeep(e[o],t[o]):t[o]=e[o]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var i=n(34);n.d(t,"a",(function(){return i.ParametricFilter}))},function(e,t,n){"use strict";var i,o=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var e={};return function(t){if("undefined"==typeof e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},i=[],o=0;o<e.length;o++){var r=e[o],c=t.base?r[0]+t.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=s(u),m={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:u,updater:g(m,t),references:1}),i.push(u)}return i}function l(e){var t=document.createElement("style"),i=e.attributes||{};if("undefined"==typeof i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var a=r(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var r=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function h(e,t,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,p=0;function g(e,t){var n,i,o;if(t.singleton){var r=p++;n=f||(f=l(t)),i=m.bind(null,n,r,!1),o=m.bind(null,n,r,!0)}else n=l(t),i=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<n.length;i++){var o=s(n[i]);a[o].references--}for(var r=c(e,t),l=0;l<n.length;l++){var u=s(n[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(i)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);i&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},function(e,t,n){"use strict";var i={};n.r(i),n.d(i,"BarcodeFormatValues",(function(){return ee})),n.d(i,"BarcodeFormats",(function(){return te})),n.d(i,"Gs1HandlingValues",(function(){return ie})),n.d(i,"UpcEanExtensionBehaviorValues",(function(){return oe}));var o={};n.r(o),n.d(o,"BarcodeDocumentFormatValues",(function(){return re})),n.d(o,"BarcodeDocumentFormats",(function(){return ae}));var r={};n.r(r),n.d(r,"DocumentScannerEngineModeValues",(function(){return le})),n.d(r,"DocumentScannerParameters",(function(){return ue})),n.d(r,"DocumentScannerConfiguration",(function(){return de})),n.d(r,"DocumentDetectionStatusValues",(function(){return me})),n.d(r,"DocumentDetectionScores",(function(){return he})),n.d(r,"DocumentDetectionResult",(function(){return fe}));var a={};n.r(a),n.d(a,"CheckDocumentDetectionModeValues",(function(){return ge})),n.d(a,"CheckRecognitionStatusValues",(function(){return ve})),n.d(a,"CheckScanningResult",(function(){return Ce})),n.d(a,"CheckScannerConfiguration",(function(){return ye}));var s={};n.r(s),n.d(s,"DocumentQualityValues",(function(){return Ae})),n.d(s,"DocumentQualityThreshold",(function(){return Se})),n.d(s,"DocumentQualityAnalyzerConfiguration",(function(){return we})),n.d(s,"DocumentQualityAnalyzerResult",(function(){return Ee}));var c={};n.r(c),n.d(c,"EuropeanHealthInsuranceCardRecognitionResult",(function(){return xe})),n.d(c,"EuropeanHealthInsuranceCardRecognizerConfiguration",(function(){return De}));var l={};n.r(l),n.d(l,"DocumentDataExtractorConfigurationElement",(function(){return Be})),n.d(l,"DateValidationConfiguration",(function(){return Te})),n.d(l,"EuropeanHealthInsuranceCardIssuingCountryValues",(function(){return Ie})),n.d(l,"EuropeanHealthInsuranceCardConfiguration",(function(){return ke})),n.d(l,"MrzFallbackConfiguration",(function(){return Oe})),n.d(l,"DocumentDataExtractorCommonConfiguration",(function(){return Le}));var u={};n.r(u),n.d(u,"ConfirmationMethodValues",(function(){return Pe})),n.d(u,"ResultAccumulationConfiguration",(function(){return _e})),n.d(u,"AccumulatedResultsVerifierConfiguration",(function(){return Re}));var d={};n.r(d),n.d(d,"DocumentDataExtractionStatusValues",(function(){return Fe})),n.d(d,"DocumentDataExtractionResult",(function(){return Me})),n.d(d,"DocumentDataExtractionModeValues",(function(){return Ne})),n.d(d,"DocumentDataFrameExtractionParameters",(function(){return Ve})),n.d(d,"DocumentDataExtractorConfiguration",(function(){return We}));var m={};n.r(m),n.d(m,"WordBox",(function(){return ze})),n.d(m,"SymbolBox",(function(){return je})),n.d(m,"TextPatternScannerResult",(function(){return He})),n.d(m,"ContentValidator",(function(){return Ue})),n.d(m,"DefaultContentValidator",(function(){return Ze})),n.d(m,"PatternContentValidator",(function(){return Ge})),n.d(m,"TextPatternScannerConfiguration",(function(){return Ye}));var h={};n.r(h),n.d(h,"LicensePlateScannerStrategyValues",(function(){return Qe})),n.d(h,"LicensePlateScannerConfiguration",(function(){return qe})),n.d(h,"LicensePlateScannerResult",(function(){return Xe}));var f={};n.r(f),n.d(f,"MedicalCertificateScanningParameters",(function(){return Ke})),n.d(f,"MedicalCertificateCheckBoxTypeValues",(function(){return Je})),n.d(f,"MedicalCertificateCheckBox",(function(){return $e})),n.d(f,"MedicalCertificateDateRecordTypeValues",(function(){return et})),n.d(f,"MedicalCertificateDateRecord",(function(){return tt})),n.d(f,"MedicalCertificatePatientInfoFieldTypeValues",(function(){return nt})),n.d(f,"MedicalCertificatePatientInfoField",(function(){return it})),n.d(f,"MedicalCertificatePatientInfoBox",(function(){return ot})),n.d(f,"MedicalCertificateFormTypeValues",(function(){return rt})),n.d(f,"MedicalCertificateScanningResult",(function(){return at}));var p={};n.r(p),n.d(p,"MrzDocumentTypeValues",(function(){return st})),n.d(p,"MrzScannerResult",(function(){return ct})),n.d(p,"MrzIncompleteResultHandlingValues",(function(){return lt})),n.d(p,"MrzScannerConfiguration",(function(){return ut}));var g={};n.r(g),n.d(g,"OcrElement",(function(){return dt})),n.d(g,"Glyph",(function(){return mt})),n.d(g,"Word",(function(){return ht})),n.d(g,"Line",(function(){return ft})),n.d(g,"Block",(function(){return pt})),n.d(g,"Page",(function(){return gt}));var v={};n.r(v),n.d(v,"PdfAttributes",(function(){return Ct})),n.d(v,"PageSizeValues",(function(){return yt})),n.d(v,"PageDirectionValues",(function(){return bt})),n.d(v,"PageFitValues",(function(){return At})),n.d(v,"ResamplingMethodValues",(function(){return St})),n.d(v,"PdfConfiguration",(function(){return wt}));var C={};n.r(C),n.d(C,"CompressionModeValues",(function(){return Et})),n.d(C,"BinarizationValues",(function(){return xt})),n.d(C,"UserFieldValue",(function(){return Dt})),n.d(C,"UserFieldDoubleValue",(function(){return Tt})),n.d(C,"UserFieldStringValue",(function(){return It})),n.d(C,"UserFieldIntValue",(function(){return kt})),n.d(C,"UserField",(function(){return Ot})),n.d(C,"TiffWriterParameters",(function(){return Lt}));var y={};n.r(y),n.d(y,"ImageRotationValues",(function(){return Pt}));var b={};n.r(b),n.d(b,"VinBarcodeExtractionStatusValues",(function(){return _t})),n.d(b,"VinBarcodeResult",(function(){return Rt})),n.d(b,"VinScannerResult",(function(){return Ft})),n.d(b,"VinScannerConfiguration",(function(){return Mt}));var A={};n.r(A),n.d(A,"MRZDocumentType",(function(){return Nt})),n.d(A,"DeIdCardFrontDocumentType",(function(){return Vt})),n.d(A,"DeIdCardBackDocumentType",(function(){return Wt})),n.d(A,"DePassportDocumentType",(function(){return zt})),n.d(A,"DeDriverLicenseFrontDocumentType",(function(){return jt})),n.d(A,"DeDriverLicenseBackDocumentType",(function(){return Ht})),n.d(A,"DeDriverLicenseBackCategoryDocumentType",(function(){return Ut})),n.d(A,"DeDriverLicenseBackCategoriesDocumentType",(function(){return Zt})),n.d(A,"DeDriverLicenseBackCategoriesADocumentType",(function(){return Gt})),n.d(A,"DeDriverLicenseBackCategoriesA1DocumentType",(function(){return Yt})),n.d(A,"DeDriverLicenseBackCategoriesA2DocumentType",(function(){return Qt})),n.d(A,"DeDriverLicenseBackCategoriesAMDocumentType",(function(){return qt})),n.d(A,"DeDriverLicenseBackCategoriesBDocumentType",(function(){return Xt})),n.d(A,"DeDriverLicenseBackCategoriesB1DocumentType",(function(){return Kt})),n.d(A,"DeDriverLicenseBackCategoriesBEDocumentType",(function(){return Jt})),n.d(A,"DeDriverLicenseBackCategoriesCDocumentType",(function(){return $t})),n.d(A,"DeDriverLicenseBackCategoriesC1DocumentType",(function(){return en})),n.d(A,"DeDriverLicenseBackCategoriesC1EDocumentType",(function(){return tn})),n.d(A,"DeDriverLicenseBackCategoriesCEDocumentType",(function(){return nn})),n.d(A,"DeDriverLicenseBackCategoriesDDocumentType",(function(){return on})),n.d(A,"DeDriverLicenseBackCategoriesD1DocumentType",(function(){return rn})),n.d(A,"DeDriverLicenseBackCategoriesD1EDocumentType",(function(){return an})),n.d(A,"DeDriverLicenseBackCategoriesDEDocumentType",(function(){return sn})),n.d(A,"DeDriverLicenseBackCategoriesLDocumentType",(function(){return cn})),n.d(A,"DeDriverLicenseBackCategoriesTDocumentType",(function(){return ln})),n.d(A,"DeResidencePermitFrontDocumentType",(function(){return un})),n.d(A,"DeResidencePermitBackDocumentType",(function(){return dn})),n.d(A,"EuropeanHealthInsuranceCardDocumentType",(function(){return mn})),n.d(A,"DeHealthInsuranceCardFrontDocumentType",(function(){return hn})),n.d(A,"MRZ",(function(){return fn})),n.d(A,"DeIdCardFront",(function(){return pn})),n.d(A,"DeIdCardBack",(function(){return gn})),n.d(A,"DePassport",(function(){return vn})),n.d(A,"DeDriverLicenseFront",(function(){return Cn})),n.d(A,"DeDriverLicenseBack",(function(){return yn})),n.d(A,"DeResidencePermitFront",(function(){return bn})),n.d(A,"DeResidencePermitBack",(function(){return An})),n.d(A,"EuropeanHealthInsuranceCard",(function(){return Sn})),n.d(A,"DeHealthInsuranceCardFront",(function(){return wn}));var S={};n.r(S),n.d(S,"BoardingPassDocumentType",(function(){return En})),n.d(S,"BoardingPassLegDocumentType",(function(){return xn})),n.d(S,"SwissQRDocumentType",(function(){return Dn})),n.d(S,"DEMedicalPlanDocumentType",(function(){return Bn})),n.d(S,"DEMedicalPlanPatientDocumentType",(function(){return Tn})),n.d(S,"DEMedicalPlanDoctorDocumentType",(function(){return In})),n.d(S,"DEMedicalPlanSubheadingDocumentType",(function(){return kn})),n.d(S,"DEMedicalPlanSubheadingMedicineDocumentType",(function(){return On})),n.d(S,"DEMedicalPlanSubheadingMedicineSubstanceDocumentType",(function(){return Ln})),n.d(S,"DEMedicalPlanSubheadingPrescriptionDocumentType",(function(){return Pn})),n.d(S,"IDCardPDF417DocumentType",(function(){return _n})),n.d(S,"GS1DocumentType",(function(){return Rn})),n.d(S,"GS1ElementDocumentType",(function(){return Fn})),n.d(S,"GS1ElementValidationErrorDocumentType",(function(){return Mn})),n.d(S,"SEPADocumentType",(function(){return Nn})),n.d(S,"MedicalCertificateDocumentType",(function(){return Vn})),n.d(S,"VCardDocumentType",(function(){return Wn})),n.d(S,"VCardEntryDocumentType",(function(){return zn})),n.d(S,"VCardVersionDocumentType",(function(){return jn})),n.d(S,"VCardSourceDocumentType",(function(){return Hn})),n.d(S,"VCardKindDocumentType",(function(){return Un})),n.d(S,"VCardXMLDocumentType",(function(){return Zn})),n.d(S,"VCardNameDocumentType",(function(){return Gn})),n.d(S,"VCardFirstNameDocumentType",(function(){return Yn})),n.d(S,"VCardNicknameDocumentType",(function(){return Qn})),n.d(S,"VCardBirthdayDocumentType",(function(){return qn})),n.d(S,"VCardAnniversaryDocumentType",(function(){return Xn})),n.d(S,"VCardGenderDocumentType",(function(){return Kn})),n.d(S,"VCardDeliveryAddressDocumentType",(function(){return Jn})),n.d(S,"VCardPhotoDocumentType",(function(){return $n})),n.d(S,"VCardTelephoneNumberDocumentType",(function(){return ei})),n.d(S,"VCardEmailDocumentType",(function(){return ti})),n.d(S,"VCardIMPPDocumentType",(function(){return ni})),n.d(S,"VCardLanguagesDocumentType",(function(){return ii})),n.d(S,"VCardTimeZoneDocumentType",(function(){return oi})),n.d(S,"VCardGeoLocationDocumentType",(function(){return ri})),n.d(S,"VCardTitleDocumentType",(function(){return ai})),n.d(S,"VCardRoleDocumentType",(function(){return si})),n.d(S,"VCardLogoDocumentType",(function(){return ci})),n.d(S,"VCardOrganisationDocumentType",(function(){return li})),n.d(S,"VCardMemberDocumentType",(function(){return ui})),n.d(S,"VCardRelatedDocumentType",(function(){return di})),n.d(S,"VCardCategoriesDocumentType",(function(){return mi})),n.d(S,"VCardNoteDocumentType",(function(){return hi})),n.d(S,"VCardProductIdDocumentType",(function(){return fi})),n.d(S,"VCardRevisionDocumentType",(function(){return pi})),n.d(S,"VCardSoundDocumentType",(function(){return gi})),n.d(S,"VCardUIDDocumentType",(function(){return vi})),n.d(S,"VCardClientPIDMapDocumentType",(function(){return Ci})),n.d(S,"VCardURLDocumentType",(function(){return yi})),n.d(S,"VCardPublicKeyDocumentType",(function(){return bi})),n.d(S,"VCardBusyTimeURLDocumentType",(function(){return Ai})),n.d(S,"VCardCalendarURIForRequestsDocumentType",(function(){return Si})),n.d(S,"VCardCalendarURIDocumentType",(function(){return wi})),n.d(S,"VCardCustomDocumentType",(function(){return Ei})),n.d(S,"AAMVADocumentType",(function(){return xi})),n.d(S,"AAMVATitleDataDocumentType",(function(){return Di})),n.d(S,"AAMVARegistrationDataDocumentType",(function(){return Bi})),n.d(S,"AAMVAMotorCarrierDataDocumentType",(function(){return Ti})),n.d(S,"AAMVARegistrantAndVehicleDataDocumentType",(function(){return Ii})),n.d(S,"AAMVAVehicleOwnerDataDocumentType",(function(){return ki})),n.d(S,"AAMVAVehicleDataDocumentType",(function(){return Oi})),n.d(S,"AAMVAVehicleSafetyInspectionDataDocumentType",(function(){return Li})),n.d(S,"AAMVADLIDDocumentType",(function(){return Pi})),n.d(S,"AAMVADriverLicenseDocumentType",(function(){return _i})),n.d(S,"AAMVAIDCardDocumentType",(function(){return Ri})),n.d(S,"AAMVAEnhancedDriverLicenseDocumentType",(function(){return Fi})),n.d(S,"AAMVARawDocumentDocumentType",(function(){return Mi})),n.d(S,"HIBCDocumentType",(function(){return Ni})),n.d(S,"BoardingPass",(function(){return Vi})),n.d(S,"SwissQR",(function(){return Wi})),n.d(S,"DEMedicalPlan",(function(){return zi})),n.d(S,"IDCardPDF417",(function(){return ji})),n.d(S,"GS1",(function(){return Hi})),n.d(S,"SEPA",(function(){return Ui})),n.d(S,"MedicalCertificate",(function(){return Zi})),n.d(S,"VCard",(function(){return Gi})),n.d(S,"AAMVA",(function(){return Yi})),n.d(S,"HIBC",(function(){return Qi}));var w={};n.r(w),n.d(w,"CheckDocumentType",(function(){return qi})),n.d(w,"USACheckDocumentType",(function(){return Xi})),n.d(w,"UAECheckDocumentType",(function(){return Ki})),n.d(w,"FRACheckDocumentType",(function(){return Ji})),n.d(w,"ISRCheckDocumentType",(function(){return $i})),n.d(w,"KWTCheckDocumentType",(function(){return eo})),n.d(w,"AUSCheckDocumentType",(function(){return to})),n.d(w,"INDCheckDocumentType",(function(){return no})),n.d(w,"CANCheckDocumentType",(function(){return io})),n.d(w,"UnknownCheckDocumentType",(function(){return oo})),n.d(w,"Check",(function(){return ro})),n.d(w,"USACheck",(function(){return ao})),n.d(w,"UAECheck",(function(){return so})),n.d(w,"FRACheck",(function(){return co})),n.d(w,"ISRCheck",(function(){return lo})),n.d(w,"KWTCheck",(function(){return uo})),n.d(w,"AUSCheck",(function(){return mo})),n.d(w,"INDCheck",(function(){return ho})),n.d(w,"CANCheck",(function(){return fo})),n.d(w,"UnknownCheck",(function(){return po}));var E={};n.r(E),n.d(E,"CreditCardDocumentType",(function(){return go})),n.d(E,"CreditCard",(function(){return vo}));var x={};n.r(x),n.d(x,"BarcodeConfigurationTypes",(function(){return K})),n.d(x,"BarcodeScannerTypes",(function(){return J})),n.d(x,"BarcodeTypes",(function(){return i})),n.d(x,"BarcodeDocumentTypes",(function(){return o})),n.d(x,"CheckScannerTypes",(function(){return a})),n.d(x,"CommonFieldType",(function(){return be})),n.d(x,"DocumentScannerTypes",(function(){return r})),n.d(x,"DocumentQualityAnalyzerTypes",(function(){return s})),n.d(x,"EuropeanHealthInsuranceCardTypes",(function(){return c})),n.d(x,"GenericDocument",(function(){return pe})),n.d(x,"DocumentDataExtractorConfigurationTypes",(function(){return l})),n.d(x,"DocumentDataExtractorTypes",(function(){return d})),n.d(x,"TextPatternScannerTypes",(function(){return m})),n.d(x,"Geometry",(function(){return ce})),n.d(x,"LicensePlateScannerTypes",(function(){return h})),n.d(x,"MedicalCertificateTypes",(function(){return f})),n.d(x,"MrzTypes",(function(){return p})),n.d(x,"OcrTypes",(function(){return g})),n.d(x,"ParametricFilters",(function(){return vt})),n.d(x,"PdfConfigurationTypes",(function(){return v})),n.d(x,"TiffTypes",(function(){return C})),n.d(x,"FrameAccumulationTypes",(function(){return u})),n.d(x,"ImageTypes",(function(){return y})),n.d(x,"VinScannerTypes",(function(){return b})),n.d(x,"DocumentsModel",(function(){return A})),n.d(x,"BarcodeDocumentModel",(function(){return S})),n.d(x,"CheckDocumentModel",(function(){return w})),n.d(x,"CreditCardDocumentModel",(function(){return E})),n.d(x,"PartiallyConstructible",(function(){return $.a}));class D{}D.VERSION="7.0.0-dev.2",D.BUILD_WITH_UI=!1;var B=n(36);class T{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,i)=>(...t)=>this.post(n,t,e)}),this.handleUnrecoverableError=e=>{this.errorInWorker=e;for(const t in this.continuations)this.continuations[t].reject(e),delete this.continuations[t]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=t||{},i=Object(B.c)(t),o=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if(Object(B.d)(o)){const e=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(o);this.continuations={},this.nextTicketId=1,this.instance.onmessage=e=>{const{log:t,logError:n}=e.data;if(t)return void console.log(...t);if(n)return void console.error(...n);const{ticket:i,result:o,recoverableError:r,unrecoverableError:a}=e.data,s=this.continuations[i];if(!s)return;const{resolve:c,reject:l}=s;delete this.continuations[i],a?(l(a),this.handleUnrecoverableError(a)):r?l(r):c(o)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((i,o)=>{const r=Object(B.b)(t,"copy"==n),a=this.nextTicketId++;this.continuations[a]={resolve:i,reject:o},this.instance.postMessage({command:e,args:t,ticket:a},r)}))}destroy(){this.instance.terminate()}}var I=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class k extends Error{}class O extends Error{}class L{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new T(e,t),this.coreInitializationSuccessful=(()=>I(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const n=D.VERSION;return t!==n?new O(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${t}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`):"OK"}return new k("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return I(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,i)=>(...t)=>I(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),o="copy"===e?i.copyArgs:i.transferArgs;return yield o[n](...t)}))})}getCoreForCommand(e=""){return I(this,void 0,void 0,(function*(){const t=yield this.coreInitializationSuccessful;if("OK"===t||"getLicenseInfo"===e&&t instanceof k)return this.core;throw t}))}destroy(){this.core.destroy(),this.core=void 0}}class P{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(e){const t=new P;return t.status=e.licenseStatus,t.description=e.description,t}}var _=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class R{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return _(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE"}=t,i=this._sdk.getBridge(n);yield i.addPageToPdf(this._pdfOperation,e)}))}addPages(e){return _(this,void 0,void 0,(function*(){for(const t of e.pages){const e=yield t.finalRawImage();yield this.addPage(e)}}))}complete(){return _(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var F=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class M{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return F(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=t,o=this._sdk.getBridge(i);yield o.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return F(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return F(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var N=n(23);class V{static toPixelSize(e){return e+"px"}static containsString(e,t){return!!e&&-1!==e.indexOf(t)}static copy(e){return JSON.parse(JSON.stringify(e))}static getProperty(e,t){if(e&&e.hasOwnProperty(t))return e[t]}static uuid(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}}var W=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class z{static toDataUrl(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>t(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(e,t,n=!0){const i=t.width/t.height,o=e.width/e.height;let r=0,a=0;(n?i>o:i<o)?(r=e.width,a=r/i):(a=e.height,r=a*i);const s=(e.width-r)/2,c=(e.height-a)/2;return new N.a(s,c,r,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const i=document.createElement("img");i.src=e,i.onload=()=>W(this,void 0,void 0,(function*(){const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const n=e.getContext("2d");n.drawImage(i,0,0);const o=n.getImageData(0,0,i.width,i.height);t(o)})),i.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,V.uuid()+n+".png")))}static createImageDataCanvas(e){const t=document.createElement("canvas");return t.className="scanbot-sdk-canvas-element",t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}static saveBlob(e,t){let n=document.createElement("a");n.setAttribute("download",t);let i=URL.createObjectURL(e);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(e){if(e)return new ImageData(e.data,e.width,e.height)}static wrapperToBase64(e){return z.createImageDataCanvas(z.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return W(this,void 0,void 0,(function*(){const n=yield new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsDataURL(new Blob([e]))}));return t?n.slice(n.indexOf(",")+1):n}))}static imageUrlToImageData(e){return W(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>W(this,void 0,void 0,(function*(){i.width=o.width,i.height=o.height;const e=i.getContext("2d");e.drawImage(o,0,0);const n=e.getImageData(0,0,o.width,o.height);t(n)})),o.onerror=n}))}))}}class j{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=V.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});z.saveBlob(n,t)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let e=this.findFlashElement();e.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{e.style.opacity="1.0",e.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(e,t){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=e,t()}),150)}getOrCreateElement(e,t){let n=this.getElementByClassName(e);return n||(this.createElement(e,t),n=this.getElementByClassName(e)),n}createElement(e,t){let n=document.createElement("div");n.className=e,n.style.cssText=this.cssToString(t),document.body.append(n)}cssToString(e){let t="";return Object.keys(e).forEach((n=>{t+=n+":"+e[n]+";"})),t}getElementByClassName(e){const t=document.getElementsByClassName(e);if(0!==t.length)return t[0]}}var H=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class U{constructor(e,t){this._sdk=e,this._mrzRecognizerToken=t}recognize(e,t="COPY_IMAGE"){return H(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanMRZ(yield this._mrzRecognizerToken,e)}))}recognizeURL(e){return H(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>H(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.recognize(o);t(r||void 0)}))}))}))}release(){return H(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var Z=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class G{constructor(e,t){this._sdk=e,this._OcrEngineToken=t}performOcr(e,t="COPY_IMAGE"){return Z(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.performOcr(this._OcrEngineToken,e)}))}recognizeURL(e){return Z(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>Z(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.performOcr(o);t(r)}))}))}))}release(){return Z(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var Y=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Q{constructor(e,t){this._sdk=e,this._textPatternScannerToken=t}recognize(e,t="COPY_IMAGE"){return Y(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanTextLine(yield this._textPatternScannerToken,e)}))}cleanRecognitionQueue(){return Y(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineScanningQueue(yield this._textPatternScannerToken)}))}recognizeURL(e){return Y(this,void 0,void 0,(function*(){return this.recognize(yield z.imageUrlToImageData(e))}))}release(){return Y(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textPatternScannerToken)}))}}var q=n(14),X=n(22),K=n(35),J=n(38),$=n(7);const ee=["NONE","AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","EAN_8","EAN_13","ITF","MAXI_CODE","PDF_417","QR_CODE","DATABAR","DATABAR_EXPANDED","UPC_A","UPC_E","MSI_PLESSEY","IATA_2_OF_5","INDUSTRIAL_2_OF_5","CODE_25","MICRO_QR_CODE","USPS_INTELLIGENT_MAIL","ROYAL_MAIL","JAPAN_POST","ROYAL_TNT_POST","AUSTRALIA_POST","DATABAR_LIMITED","MICRO_PDF_417","GS1_COMPOSITE","RMQR_CODE","CODE_11","CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"];class te extends $.a{constructor(e={}){super()}}var ne;(ne=te||(te={})).oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],ne.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],ne.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],ne.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],ne.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],ne.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXI_CODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];const ie=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],oe=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"],re=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class ae extends $.a{constructor(e={}){super()}}var se;(se=ae||(ae={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],se.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],VCARD:["QR_CODE"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]};var ce=n(21);const le=["ML","LEGACY"];class ue extends $.a{constructor(e={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.isLive&&(this.isLive=e.isLive),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=e.acceptedAspectRatioScore),void 0!==e.aspectRatios&&(this.aspectRatios=e.aspectRatios.map((e=>new ce.AspectRatio(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class de extends $.a{constructor(e={}){super(),this.engineMode="ML",this.parameters=new ue({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.parameters&&(this.parameters=new ue(e.parameters))}}const me=["NOT_ACQUIRED","OK","OK_BUT_TOO_SMALL","OK_BUT_BAD_ANGLES","OK_BUT_BAD_ASPECT_RATIO","OK_BUT_ORIENTATION_MISMATCH","OK_BUT_OFF_CENTER","OK_BUT_TOO_DARK","ERROR_NOTHING_DETECTED","ERROR_TOO_DARK","ERROR_TOO_NOISY"];class he extends $.a{constructor(e={}){if(super(),void 0===e.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=e.totalScore,void 0===e.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=e.distanceScore,void 0===e.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=e.angleScore,void 0===e.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=e.sizeScore,void 0===e.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=e.aspectRatioScore,void 0===e.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=e.lineCoverageScore,void 0===e.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=e.widthScore,void 0===e.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=e.heightScore}}class fe extends $.a{constructor(e={}){if(super(),this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==e.status&&(this.status=e.status),void 0===e.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new he(e.detectionScores),void 0===e.points)throw new Error("points must be present in constructor argument");if(this.points=e.points.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=e.horizontalLines.map((e=>new ce.LineSegmentInt(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new ce.LineSegmentInt(e))),void 0===e.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=e.pointsNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=e.horizontalLinesNormalized.map((e=>new ce.LineSegmentFloat(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new ce.LineSegmentFloat(e))),void 0===e.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=e.aspectRatio,void 0!==e.averageBrightness&&(this.averageBrightness=e.averageBrightness)}}var pe=n(20);const ge=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],ve=["SUCCESS","VALIDATION_FAILED","FAIL"];class Ce extends $.a{constructor(e={}){if(super(),this.status="FAIL",void 0!==e.status&&(this.status=e.status),void 0===e.check)throw new Error("check must be present in constructor argument");if(this.check=null!=e.check?new pe.GenericDocument(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=null!=e.documentDetectionResult?new fe(e.documentDetectionResult):null,void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}class ye extends $.a{constructor(e={}){super(),this.documentDetectionMode="DISABLED",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode)}}var be=n(39);const Ae=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class Se extends $.a{constructor(e={}){if(super(),void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class we extends $.a{constructor(e={}){super(),this.qualityThresholds=[new Se({symbolQuality:.5,symbolRatio:.5}),new Se({symbolQuality:.7,symbolRatio:.3}),new Se({symbolQuality:.85,symbolRatio:.3}),new Se({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new Se(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize)}}class Ee extends $.a{constructor(e={}){if(super(),void 0===e.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=e.documentFound,void 0===e.quality)throw new Error("quality must be present in constructor argument");if(this.quality=null!=e.quality&&Ae.includes(e.quality)?e.quality:null,void 0===e.orientation)throw new Error("orientation must be present in constructor argument");if(this.orientation=null!=e.orientation?e.orientation:null,void 0===e.cumulativeQualityHistogram)throw new Error("cumulativeQualityHistogram must be present in constructor argument");this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e))}}class xe extends $.a{constructor(e={}){if(super(),this.status="FAILED_DETECTION",void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new xe.Field(e))),void 0!==e.status&&(this.status=e.status)}}!function(e){e.RecognitionStatusValues=["SUCCESS","FAILED_DETECTION","INCOMPLETE_VALIDATION"];class t extends $.a{constructor(e={}){if(super(),this.validationStatus="NOT_VALIDATED",void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence,void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus)}}e.Field=t,function(e){e.ValidationStatusValues=["NOT_VALIDATED","FAILURE","SUCCESS","CONFIRMED"],e.FieldTypeValues=["SURNAME","GIVEN_NAME","DATE_OF_BIRTH","PERSONAL_IDENTIFICATION_NUMBER","INSTITUTION_NUMBER","INSTITUTION_NAME","CARD_NUMBER","CARD_EXPIRATION_DATE","COUNTRY"]}(t=e.Field||(e.Field={}))}(xe||(xe={}));class De extends $.a{constructor(e={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==e.allowedCountries&&(this.allowedCountries=e.allowedCountries.map((e=>e))),void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=e.maxCountryDetectionAttempts),void 0!==e.minEqualFrameCount&&(this.minEqualFrameCount=e.minEqualFrameCount),void 0!==e.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=e.maxAccumulatedFrameCount)}}var Be;!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new Te(e);case"EuropeanHealthInsuranceCardConfiguration":return new ke(e);case"MRZFallbackConfiguration":return new Oe(e);case"DocumentDataExtractorCommonConfiguration":return new Le(e);default:throw`Unknown child class name: ${t}`}}}(Be||(Be={}));class Te extends $.a{constructor(e={}){if(super(),this._type="DateValidationConfiguration",this.minYear=0,this.maxYear=2999,void 0!==e.minYear&&(this.minYear=e.minYear),void 0!==e.maxYear&&(this.maxYear=e.maxYear),void 0===e.fieldTypeName)throw new Error("fieldTypeName must be present in constructor argument");this.fieldTypeName=e.fieldTypeName}}const Ie=["AUSTRIA","BELGIUM","BULGARIA","CROATIA","CYPRUS","CZECH_REPUBLIC","DENMARK","ESTONIA","FINLAND","FRANCE","GERMANY","GREECE","HUNGARY","IRELAND","ITALY","LATVIA","LITHUANIA","LUXEMBOURG","MALTA","NETHERLANDS","POLAND","PORTUGAL","ROMANIA","SLOVAKIA","SLOVENIA","SPAIN","SWEDEN","SWITZERLAND"];class ke extends $.a{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&Ie.includes(e.expectedCountry)?e.expectedCountry:null)}}class Oe extends $.a{constructor(e={}){super(),this._type="MRZFallbackConfiguration",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==e.acceptedCountries&&(this.acceptedCountries=e.acceptedCountries.map((e=>e))),void 0!==e.acceptedMRZTypes&&(this.acceptedMRZTypes=e.acceptedMRZTypes.map((e=>e)))}}class Le extends $.a{constructor(e={}){if(super(),this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}const Pe=["EXACT","INTERPOLATE"];class _e extends $.a{constructor(e={}){super(),this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.confirmationMethod&&(this.confirmationMethod=e.confirmationMethod),void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class Re extends $.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}const Fe=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","INCOMPLETE_VALIDATION"];class Me extends $.a{constructor(e={}){if(super(),void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.document)throw new Error("document must be present in constructor argument");if(this.document=null!=e.document?new pe.GenericDocument(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=new fe(e.documentDetectionResult),void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}const Ne=["LIVE","SINGLE_SHOT"];class Ve extends $.a{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class We extends $.a{constructor(e={}){if(super(),this.resultAccumulationConfig=new _e({}),this.fieldExcludeList=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new _e(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0===e.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=e.configurations.map((e=>Be.From(e)))}}class ze extends $.a{constructor(e={}){if(super(),this.recognitionConfidence=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}class je extends $.a{constructor(e={}){if(super(),void 0===e.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=e.symbol,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class He extends $.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=e.rawText,void 0===e.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=e.wordBoxes.map((e=>new ze(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new je(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}var Ue;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new Ze(e);case"PatternContentValidator":return new Ge(e);default:throw`Unknown child class name: ${t}`}}}(Ue||(Ue={}));class Ze extends $.a{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class Ge extends $.a{constructor(e={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class Ye extends $.a{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new Ze({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==e.validator&&(this.validator=Ue.From(e.validator))}}const Qe=["CLASSIC","ML"];class qe extends $.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.scannerStrategy&&(this.scannerStrategy=e.scannerStrategy)}}class Xe extends $.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===e.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=e.countryCode,void 0===e.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=e.licensePlate,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=e.rawText,void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null)}}class Ke extends $.a{constructor(e={}){super(),this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==e.shouldCropDocument&&(this.shouldCropDocument=e.shouldCropDocument),void 0!==e.recognizePatientInfoBox&&(this.recognizePatientInfoBox=e.recognizePatientInfoBox),void 0!==e.recognizeBarcode&&(this.recognizeBarcode=e.recognizeBarcode),void 0!==e.extractCroppedImage&&(this.extractCroppedImage=e.extractCroppedImage),void 0!==e.preprocessInput&&(this.preprocessInput=e.preprocessInput)}}const Je=["UNKNOWN","WORK_ACCIDENT","ASSIGNED_TO_ACCIDENT_INSURANCE_DOCTOR","INITIAL_CERTIFICATE","RENEWED_CERTIFICATE","INSURED_PAY_CASE","FINAL_CERTIFICATE","REQUIRES_CARE_YES","REQUIRES_CARE_NO","ACCIDENT_YES","ACCIDENT_NO","OTHER_ACCIDENT","ENTITLEMENT_TO_CONTINUED_PAYMENT_YES","ENTITLEMENT_TO_CONTINUED_PAYMENT_NO","SICK_PAY_WAS_CLAIMED_NO","SICK_PAY_WAS_CLAIMED_YES","SINGLE_PARENT_NO","SINGLE_PARENT_YES"];class $e extends $.a{constructor(e={}){if(super(),this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==e.type&&(this.type=e.type),void 0!==e.checked&&(this.checked=e.checked),void 0!==e.checkedConfidence&&(this.checkedConfidence=e.checkedConfidence),void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y})))}}const et=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class tt extends $.a{constructor(e={}){if(super(),this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0!==e.value&&(this.value=e.value),void 0!==e.rawString&&(this.rawString=e.rawString),void 0!==e.type&&(this.type=e.type),void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}const nt=["INSURANCE_PROVIDER","FIRST_NAME","LAST_NAME","ADDRESS_STRING1","ADDRESS_STRING2","DIAGNOSE","HEALTH_INSURANCE_NUMBER","INSURED_PERSON_NUMBER","STATUS","PLACE_OF_OPERATION_NUMBER","DOCTOR_NUMBER","UNDEFINED"];class it extends $.a{constructor(e={}){if(super(),void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class ot extends $.a{constructor(e={}){if(super(),this.hasContents=!1,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new it(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const rt=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class at extends $.a{constructor(e={}){if(super(),this.scanningSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==e.scanningSuccessful&&(this.scanningSuccessful=e.scanningSuccessful),void 0===e.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new ot(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new $e(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new tt(e))),void 0!==e.formType&&(this.formType=e.formType),void 0!==e.clockwiseRotations&&(this.clockwiseRotations=e.clockwiseRotations),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new fe(e.documentDetectionResult):null}}const st=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class ct extends $.a{constructor(e={}){if(super(),this.success=!1,void 0!==e.success&&(this.success=e.success),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.document)throw new Error("document must be present in constructor argument");this.document=null!=e.document?new pe.GenericDocument(e.document):null}}const lt=["ACCEPT","REJECT"];class ut extends $.a{constructor(e={}){super(),this.frameAccumulationConfiguration=new Re({}),this.enableDetection=!0,this.incompleteResultHandling="ACCEPT",void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new Re(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}var dt;!function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new mt(e);case"Word":return new ht(e);case"Line":return new ft(e);case"Block":return new pt(e);case"Page":return new gt(e);default:throw`Unknown child class name: ${t}`}}}(dt||(dt={}));class mt extends $.a{constructor(e={}){if(super(),this._type="Glyph",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");this.roi=e.roi.map((e=>({x:e.x,y:e.y})))}}class ht extends $.a{constructor(e={}){if(super(),this._type="Word",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=e.glyphs.map((e=>new mt(e)))}}class ft extends $.a{constructor(e={}){if(super(),this._type="Line",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.words)throw new Error("words must be present in constructor argument");this.words=e.words.map((e=>new ht(e)))}}class pt extends $.a{constructor(e={}){if(super(),this._type="Block",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.lines)throw new Error("lines must be present in constructor argument");this.lines=e.lines.map((e=>new ft(e)))}}class gt extends $.a{constructor(e={}){if(super(),this._type="Page",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=e.blocks.map((e=>new pt(e)))}}var vt=n(34);class Ct extends $.a{constructor(e={}){super(),this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}const yt=["LETTER","LEGAL","A3","A4","A5","B4","B5","EXECUTIVE","US4x6","US4x8","US5x7","COMM10","CUSTOM"],bt=["PORTRAIT","LANDSCAPE","AUTO"],At=["FIT_IN","FILL_IN","STRETCH","NONE"],St=["NONE","NEAREST","LINEAR","CUBIC","LANCZOS4","AREA"];class wt extends $.a{constructor(e={}){super(),this.attributes=new Ct({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new Ct(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}const Et=["NONE","CCITTRLE","CCITT_T4","CCITT_T6","LZW","OJPEG","JPEG","T85","T43","NEXT","CCITTRLEW","PACKBITS","THUNDERSCAN","IT8CTPAD","IT8LW","IT8MP","IT8BL","PIXARFILM","PIXARLOG","DEFLATE","ADOBE_DEFLATE"],xt=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"];var Dt,Bt;!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new Tt(e);case"UserFieldStringValue":return new It(e);case"UserFieldIntValue":return new kt(e);default:throw`Unknown child class name: ${t}`}}}(Dt||(Dt={}));class Tt extends $.a{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class It extends $.a{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class kt extends $.a{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ot extends $.a{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=Dt.From(e.value)}}class Lt extends $.a{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new Ot(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?vt.ParametricFilter.From(e.binarizationFilter):null)}}(Bt=Lt||(Lt={})).defaultCompression="LZW",Bt.binaryDocumentOptimizedCompression="CCITT_T6";const Pt=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],_t=["SUCCESS","BARCODE_WITHOUT_VIN","NO_BARCODE_FOUND","BARCODE_EXTRACTION_DISABLED"];class Rt extends $.a{constructor(e={}){if(super(),void 0===e.extractedVIN)throw new Error("extractedVIN must be present in constructor argument");if(this.extractedVIN=e.extractedVIN,void 0===e.rectangle)throw new Error("rectangle must be present in constructor argument");if(this.rectangle=e.rectangle.map((e=>({x:e.x,y:e.y}))),void 0===e.status)throw new Error("status must be present in constructor argument");this.status=e.status}}class Ft extends $.a{constructor(e={}){if(super(),void 0===e.textResult)throw new Error("textResult must be present in constructor argument");if(this.textResult=new He(e.textResult),void 0===e.barcodeResult)throw new Error("barcodeResult must be present in constructor argument");this.barcodeResult=new Rt(e.barcodeResult)}}class Mt extends $.a{constructor(e={}){super(),this.extractVINFromBarcode=!1,this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.extractVINFromBarcode&&(this.extractVINFromBarcode=e.extractVINFromBarcode),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}const Nt="MRZ",Vt="DeIdCardFront",Wt="DeIdCardBack",zt="DePassport",jt="DeDriverLicenseFront",Ht="DeDriverLicenseBack",Ut="Category",Zt="Categories",Gt="A",Yt="A1",Qt="A2",qt="AM",Xt="B",Kt="B1",Jt="BE",$t="C",en="C1",tn="C1E",nn="CE",on="D",rn="D1",an="D1E",sn="DE",cn="L",ln="T",un="DeResidencePermitFront",dn="DeResidencePermitBack",mn="EuropeanHealthInsuranceCard",hn="DeHealthInsuranceCardFront";class fn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Nt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get checkDigitBirthDate(){return this.document.fields.find((e=>"CheckDigitBirthDate"===e.type.name))}get checkDigitDocumentNumber(){return this.document.fields.find((e=>"CheckDigitDocumentNumber"===e.type.name))}get checkDigitExpiryDate(){return this.document.fields.find((e=>"CheckDigitExpiryDate"===e.type.name))}get checkDigitGeneral(){return this.document.fields.find((e=>"CheckDigitGeneral"===e.type.name))}get checkDigitPersonalNumber(){return this.document.fields.find((e=>"CheckDigitPersonalNumber"===e.type.name))}get dateOfIssuance(){return this.document.fields.find((e=>"DateOfIssuance"===e.type.name))}get documentNumber(){return this.document.fields.find((e=>"DocumentNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get documentTypeCode(){return this.document.fields.find((e=>"DocumentTypeCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get languageCode(){return this.document.fields.find((e=>"LanguageCode"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get officeOfIssuance(){return this.document.fields.find((e=>"OfficeOfIssuance"===e.type.name))}get optional1(){return this.document.fields.find((e=>"Optional1"===e.type.name))}get optional2(){return this.document.fields.find((e=>"Optional2"===e.type.name))}get pinCode(){return this.document.fields.find((e=>"PINCode"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get travelDocType(){return this.document.fields.find((e=>"TravelDocType"===e.type.name))}get travelDocTypeVariant(){return this.document.fields.find((e=>"TravelDocTypeVariant"===e.type.name))}get unknown(){return this.document.fields.find((e=>"Unknown"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}get visaOptional(){return this.document.fields.find((e=>"VisaOptional"===e.type.name))}}class pn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Vt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class gn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wt}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get pseudonym(){return this.document.fields.find((e=>"Pseudonym"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new fn(e)}}class vn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return zt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get passportType(){return this.document.fields.find((e=>"PassportType"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new fn(e)}}class Cn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return jt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get licenseCategories(){return this.document.fields.find((e=>"LicenseCategories"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class yn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ht}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return new yn.Categories(e)}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}get validUntil(){return this.document.fields.find((e=>"ValidUntil"===e.type.name))}}e.Category=t;class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Zt}get a(){const t=this.document.children.find((e=>"A"===e.type.name));return new e.Categories.A(t)}get a1(){const t=this.document.children.find((e=>"A1"===e.type.name));return new e.Categories.A1(t)}get a2(){const t=this.document.children.find((e=>"A2"===e.type.name));return new e.Categories.A2(t)}get am(){const t=this.document.children.find((e=>"AM"===e.type.name));return new e.Categories.AM(t)}get b(){const t=this.document.children.find((e=>"B"===e.type.name));return new e.Categories.B(t)}get b1(){const t=this.document.children.find((e=>"B1"===e.type.name));return t?new e.Categories.B1(t):void 0}get be(){const t=this.document.children.find((e=>"BE"===e.type.name));return new e.Categories.BE(t)}get c(){const t=this.document.children.find((e=>"C"===e.type.name));return new e.Categories.C(t)}get c1(){const t=this.document.children.find((e=>"C1"===e.type.name));return new e.Categories.C1(t)}get c1E(){const t=this.document.children.find((e=>"C1E"===e.type.name));return new e.Categories.C1E(t)}get ce(){const t=this.document.children.find((e=>"CE"===e.type.name));return new e.Categories.CE(t)}get d(){const t=this.document.children.find((e=>"D"===e.type.name));return new e.Categories.D(t)}get d1(){const t=this.document.children.find((e=>"D1"===e.type.name));return new e.Categories.D1(t)}get d1E(){const t=this.document.children.find((e=>"D1E"===e.type.name));return new e.Categories.D1E(t)}get de(){const t=this.document.children.find((e=>"DE"===e.type.name));return new e.Categories.DE(t)}get l(){const t=this.document.children.find((e=>"L"===e.type.name));return new e.Categories.L(t)}get t(){const t=this.document.children.find((e=>"T"===e.type.name));return new e.Categories.T(t)}}e.Categories=n,function(e){e.A=class extends t{constructor(e){super(e)}requiredDocumentType(){return Gt}};e.A1=class extends t{constructor(e){super(e)}requiredDocumentType(){return Yt}};e.A2=class extends t{constructor(e){super(e)}requiredDocumentType(){return Qt}};e.AM=class extends t{constructor(e){super(e)}requiredDocumentType(){return qt}};e.B=class extends t{constructor(e){super(e)}requiredDocumentType(){return Xt}};e.B1=class extends t{constructor(e){super(e)}requiredDocumentType(){return Kt}};e.BE=class extends t{constructor(e){super(e)}requiredDocumentType(){return Jt}};e.C=class extends t{constructor(e){super(e)}requiredDocumentType(){return $t}};e.C1=class extends t{constructor(e){super(e)}requiredDocumentType(){return en}};e.C1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return tn}};e.CE=class extends t{constructor(e){super(e)}requiredDocumentType(){return nn}};e.D=class extends t{constructor(e){super(e)}requiredDocumentType(){return on}};e.D1=class extends t{constructor(e){super(e)}requiredDocumentType(){return rn}};e.D1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return an}};e.DE=class extends t{constructor(e){super(e)}requiredDocumentType(){return sn}};e.L=class extends t{constructor(e){super(e)}requiredDocumentType(){return cn}};e.T=class extends t{constructor(e){super(e)}requiredDocumentType(){return ln}}}(n=e.Categories||(e.Categories={}))}(yn||(yn={}));class bn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return un}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get placeOfIssue(){return this.document.fields.find((e=>"PlaceOfIssue"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get titleType(){return this.document.fields.find((e=>"TitleType"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}}class An{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return dn}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new fn(e)}}class Sn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return mn}get barcode(){return this.document.fields.find((e=>"Barcode"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class wn{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return hn}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}}const En="BoardingPass",xn="Leg",Dn="SwissQR",Bn="DEMedicalPlan",Tn="Patient",In="Doctor",kn="Subheading",On="Medicine",Ln="Substance",Pn="Prescription",_n="IDCardPDF417",Rn="GS1",Fn="Element",Mn="ValidationError",Nn="SEPA",Vn="MedicalCertificate",Wn="VCard",zn="Entry",jn="Version",Hn="Source",Un="Kind",Zn="XML",Gn="Name",Yn="FirstName",Qn="Nickname",qn="Birthday",Xn="Anniversary",Kn="Gender",Jn="DeliveryAddress",$n="Photo",ei="TelephoneNumber",ti="Email",ni="IMPP",ii="Languages",oi="TimeZone",ri="GeoLocation",ai="Title",si="Role",ci="Logo",li="Organisation",ui="Member",di="Related",mi="Categories",hi="Note",fi="ProductId",pi="Revision",gi="Sound",vi="UID",Ci="ClientPIDMap",yi="URL",bi="PublicKey",Ai="BusyTimeURL",Si="CalendarURIForRequests",wi="CalendarURI",Ei="Custom",xi="AAMVA",Di="TitleData",Bi="RegistrationData",Ti="MotorCarrierData",Ii="RegistrantAndVehicleData",ki="VehicleOwnerData",Oi="VehicleData",Li="VehicleSafetyInspectionData",Pi="DLID",_i="DriverLicense",Ri="IDCard",Fi="EnhancedDriverLicense",Mi="RawDocument",Ni="HIBC";class Vi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return En}get electronicTicket(){return this.document.fields.find((e=>"ElectronicTicket"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get numberOfLegs(){return this.document.fields.find((e=>"NumberOfLegs"===e.type.name))}get securityData(){return this.document.fields.find((e=>"SecurityData"===e.type.name))}get legs(){return this.document.children.filter((e=>"Leg"===e.type.name)).map((e=>new Vi.Leg(e)))}}!function(e){e.Leg=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return xn}get airlineDesignatorOfBoardingPassIssuer(){return this.document.fields.find((e=>"AirlineDesignatorOfBoardingPassIssuer"===e.type.name))}get airlineNumericCode(){return this.document.fields.find((e=>"AirlineNumericCode"===e.type.name))}get baggageTagLicensePlateNumbers(){return this.document.fields.find((e=>"BaggageTagLicensePlateNumbers"===e.type.name))}get checkInSequenceNumber(){return this.document.fields.find((e=>"CheckInSequenceNumber"===e.type.name))}get compartmentCode(){return this.document.fields.find((e=>"CompartmentCode"===e.type.name))}get dateOfBoardingPassIssuanceJulian(){return this.document.fields.find((e=>"DateOfBoardingPassIssuanceJulian"===e.type.name))}get dateOfFlightJulian(){return this.document.fields.find((e=>"DateOfFlightJulian"===e.type.name))}get departureAirportCode(){return this.document.fields.find((e=>"DepartureAirportCode"===e.type.name))}get destinationAirportCode(){return this.document.fields.find((e=>"DestinationAirportCode"===e.type.name))}get documentFormSerialNumber(){return this.document.fields.find((e=>"DocumentFormSerialNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get fastTrack(){return this.document.fields.find((e=>"FastTrack"===e.type.name))}get firstNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"FirstNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get flightNumber(){return this.document.fields.find((e=>"FlightNumber"===e.type.name))}get forIndividualAirlineUse(){return this.document.fields.find((e=>"ForIndividualAirlineUse"===e.type.name))}get freeBaggageAllowance(){return this.document.fields.find((e=>"FreeBaggageAllowance"===e.type.name))}get frequentFlyerAirlineDesignator(){return this.document.fields.find((e=>"FrequentFlyerAirlineDesignator"===e.type.name))}get frequentFlyerNumber(){return this.document.fields.find((e=>"FrequentFlyerNumber"===e.type.name))}get idadIndicator(){return this.document.fields.find((e=>"IDADIndicator"===e.type.name))}get internationalDocumentationVerification(){return this.document.fields.find((e=>"InternationalDocumentationVerification"===e.type.name))}get marketingCarrierDesignator(){return this.document.fields.find((e=>"MarketingCarrierDesignator"===e.type.name))}get operatingCarrierDesignator(){return this.document.fields.find((e=>"OperatingCarrierDesignator"===e.type.name))}get operatingCarrierPNRCode(){return this.document.fields.find((e=>"OperatingCarrierPNRCode"===e.type.name))}get passengerDescription(){return this.document.fields.find((e=>"PassengerDescription"===e.type.name))}get passengerStatus(){return this.document.fields.find((e=>"PassengerStatus"===e.type.name))}get seatNumber(){return this.document.fields.find((e=>"SeatNumber"===e.type.name))}get secondNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"SecondNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get selecteeIndicator(){return this.document.fields.find((e=>"SelecteeIndicator"===e.type.name))}get sourceOfBoardingPassIssuance(){return this.document.fields.find((e=>"SourceOfBoardingPassIssuance"===e.type.name))}get sourceOfCheckIn(){return this.document.fields.find((e=>"SourceOfCheckIn"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}}}(Vi||(Vi={}));class Wi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Dn}get additionalBillingInformation(){return this.document.fields.find((e=>"AdditionalBillingInformation"===e.type.name))}get additionalInfoTrailer(){return this.document.fields.find((e=>"AdditionalInfoTrailer"===e.type.name))}get additionalInfoUnstructured(){return this.document.fields.find((e=>"AdditionalInfoUnstructured"===e.type.name))}get alternativeProcedureParameter(){return this.document.fields.find((e=>"AlternativeProcedureParameter"===e.type.name))}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get currency(){return this.document.fields.find((e=>"Currency"===e.type.name))}get debtorAddressType(){return this.document.fields.find((e=>"DebtorAddressType"===e.type.name))}get debtorBuildingOrAddressLine2(){return this.document.fields.find((e=>"DebtorBuildingOrAddressLine2"===e.type.name))}get debtorCountry(){return this.document.fields.find((e=>"DebtorCountry"===e.type.name))}get debtorName(){return this.document.fields.find((e=>"DebtorName"===e.type.name))}get debtorPlace(){return this.document.fields.find((e=>"DebtorPlace"===e.type.name))}get debtorPostalCode(){return this.document.fields.find((e=>"DebtorPostalCode"===e.type.name))}get debtorStreetOrAddressLine1(){return this.document.fields.find((e=>"DebtorStreetOrAddressLine1"===e.type.name))}get dueDate(){return this.document.fields.find((e=>"DueDate"===e.type.name))}get encoding(){return this.document.fields.find((e=>"Encoding"===e.type.name))}get finalPayeeAddressType(){return this.document.fields.find((e=>"FinalPayeeAddressType"===e.type.name))}get finalPayeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"FinalPayeeBuildingOrAddressLine2"===e.type.name))}get finalPayeeCountry(){return this.document.fields.find((e=>"FinalPayeeCountry"===e.type.name))}get finalPayeeName(){return this.document.fields.find((e=>"FinalPayeeName"===e.type.name))}get finalPayeePlace(){return this.document.fields.find((e=>"FinalPayeePlace"===e.type.name))}get finalPayeePostalCode(){return this.document.fields.find((e=>"FinalPayeePostalCode"===e.type.name))}get finalPayeeStreetOrAddressLine1(){return this.document.fields.find((e=>"FinalPayeeStreetOrAddressLine1"===e.type.name))}get iban(){return this.document.fields.find((e=>"IBAN"===e.type.name))}get majorVersion(){return this.document.fields.find((e=>"MajorVersion"===e.type.name))}get payeeAddressType(){return this.document.fields.find((e=>"PayeeAddressType"===e.type.name))}get payeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"PayeeBuildingOrAddressLine2"===e.type.name))}get payeeCountry(){return this.document.fields.find((e=>"PayeeCountry"===e.type.name))}get payeeName(){return this.document.fields.find((e=>"PayeeName"===e.type.name))}get payeePlace(){return this.document.fields.find((e=>"PayeePlace"===e.type.name))}get payeePostalCode(){return this.document.fields.find((e=>"PayeePostalCode"===e.type.name))}get payeeStreetOrAddressLine1(){return this.document.fields.find((e=>"PayeeStreetOrAddressLine1"===e.type.name))}get paymentReference(){return this.document.fields.find((e=>"PaymentReference"===e.type.name))}get paymentReferenceType(){return this.document.fields.find((e=>"PaymentReferenceType"===e.type.name))}}class zi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Bn}get currentPage(){return this.document.fields.find((e=>"CurrentPage"===e.type.name))}get documentVersionNumber(){return this.document.fields.find((e=>"DocumentVersionNumber"===e.type.name))}get guid(){return this.document.fields.find((e=>"GUID"===e.type.name))}get languageCountryCode(){return this.document.fields.find((e=>"LanguageCountryCode"===e.type.name))}get patchVersionNumber(){return this.document.fields.find((e=>"PatchVersionNumber"===e.type.name))}get totalNumberOfPages(){return this.document.fields.find((e=>"TotalNumberOfPages"===e.type.name))}get patient(){const e=this.document.children.find((e=>"Patient"===e.type.name));return new zi.Patient(e)}get doctor(){const e=this.document.children.find((e=>"Doctor"===e.type.name));return new zi.Doctor(e)}get subheadings(){return this.document.children.filter((e=>"Subheading"===e.type.name)).map((e=>new zi.Subheading(e)))}}!function(e){e.Patient=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Tn}get allergiesAndIntolerances(){return this.document.fields.find((e=>"AllergiesAndIntolerances"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get breastFeeding(){return this.document.fields.find((e=>"BreastFeeding"===e.type.name))}get creatinineValue(){return this.document.fields.find((e=>"CreatinineValue"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get patientFreeText(){return this.document.fields.find((e=>"PatientFreeText"===e.type.name))}get patientID(){return this.document.fields.find((e=>"PatientID"===e.type.name))}get preName(){return this.document.fields.find((e=>"PreName"===e.type.name))}get pregnant(){return this.document.fields.find((e=>"Pregnant"===e.type.name))}get suffix(){return this.document.fields.find((e=>"Suffix"===e.type.name))}get title(){return this.document.fields.find((e=>"Title"===e.type.name))}get weight(){return this.document.fields.find((e=>"Weight"===e.type.name))}};e.Doctor=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return In}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get email(){return this.document.fields.find((e=>"Email"===e.type.name))}get hospitalID(){return this.document.fields.find((e=>"HospitalID"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuingDateAndTime(){return this.document.fields.find((e=>"IssuingDateAndTime"===e.type.name))}get pharmacyID(){return this.document.fields.find((e=>"PharmacyID"===e.type.name))}get place(){return this.document.fields.find((e=>"Place"===e.type.name))}get postalCode(){return this.document.fields.find((e=>"PostalCode"===e.type.name))}get street(){return this.document.fields.find((e=>"Street"===e.type.name))}get telephoneNumber(){return this.document.fields.find((e=>"TelephoneNumber"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return kn}get generalNotes(){return this.document.fields.filter((e=>"GeneralNote"===e.type.name))}get keyWords(){return this.document.fields.find((e=>"KeyWords"===e.type.name))}get subheadingFreeText(){return this.document.fields.find((e=>"SubheadingFreeText"===e.type.name))}get medicines(){return this.document.children.filter((e=>"Medicine"===e.type.name)).map((t=>new e.Subheading.Medicine(t)))}get prescriptions(){return this.document.children.filter((e=>"Prescription"===e.type.name)).map((t=>new e.Subheading.Prescription(t)))}}e.Subheading=t,function(t){class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return On}get dosageForm(){return this.document.fields.find((e=>"DosageForm"===e.type.name))}get dosageFormFreeText(){return this.document.fields.find((e=>"DosageFormFreeText"===e.type.name))}get dosageFreeText(){return this.document.fields.find((e=>"DosageFreeText"===e.type.name))}get dosingUnit(){return this.document.fields.find((e=>"DosingUnit"===e.type.name))}get dosingUnitFreeText(){return this.document.fields.find((e=>"DosingUnitFreeText"===e.type.name))}get drugName(){return this.document.fields.find((e=>"DrugName"===e.type.name))}get evening(){return this.document.fields.find((e=>"Evening"===e.type.name))}get generalNotes(){return this.document.fields.find((e=>"GeneralNotes"===e.type.name))}get midday(){return this.document.fields.find((e=>"Midday"===e.type.name))}get morning(){return this.document.fields.find((e=>"Morning"===e.type.name))}get night(){return this.document.fields.find((e=>"Night"===e.type.name))}get pharmaceuticalNumber(){return this.document.fields.find((e=>"PharmaceuticalNumber"===e.type.name))}get reasonForTreatment(){return this.document.fields.find((e=>"ReasonForTreatment"===e.type.name))}get relevantInfo(){return this.document.fields.find((e=>"RelevantInfo"===e.type.name))}get substances(){return this.document.children.filter((e=>"Substance"===e.type.name)).map((t=>new e.Subheading.Medicine.Substance(t)))}}t.Medicine=n,function(e){e.Substance=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ln}get activeSubstance(){return this.document.fields.find((e=>"ActiveSubstance"===e.type.name))}get potency(){return this.document.fields.find((e=>"Potency"===e.type.name))}}}(n=t.Medicine||(t.Medicine={}));t.Prescription=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Pn}get generalInformation(){return this.document.fields.find((e=>"GeneralInformation"===e.type.name))}get prescriptionFreeText(){return this.document.fields.find((e=>"PrescriptionFreeText"===e.type.name))}}}(t=e.Subheading||(e.Subheading={}))}(zi||(zi={}));class ji{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return _n}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get dateExpired(){return this.document.fields.find((e=>"DateExpired"===e.type.name))}get dateIssued(){return this.document.fields.find((e=>"DateIssued"===e.type.name))}get documentCode(){return this.document.fields.find((e=>"DocumentCode"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get optional(){return this.document.fields.find((e=>"Optional"===e.type.name))}}class Hi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Rn}get elements(){return this.document.children.filter((e=>"Element"===e.type.name)).map((e=>new Hi.Element(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Fn}get applicationIdentifier(){return this.document.fields.find((e=>"ApplicationIdentifier"===e.type.name))}get dataTitle(){return this.document.fields.find((e=>"DataTitle"===e.type.name))}get elementDescription(){return this.document.fields.find((e=>"ElementDescription"===e.type.name))}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get validationErrors(){return this.document.children.filter((e=>"ValidationError"===e.type.name)).map((t=>new e.Element.ValidationError(t)))}}e.Element=t,function(e){e.ValidationError=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Mn}get code(){return this.document.fields.find((e=>"Code"===e.type.name))}get reason(){return this.document.fields.find((e=>"Reason"===e.type.name))}}}(t=e.Element||(e.Element={}))}(Hi||(Hi={}));class Ui{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Nn}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get characterSet(){return this.document.fields.find((e=>"CharacterSet"===e.type.name))}get identification(){return this.document.fields.find((e=>"Identification"===e.type.name))}get information(){return this.document.fields.find((e=>"Information"===e.type.name))}get purpose(){return this.document.fields.find((e=>"Purpose"===e.type.name))}get receiverBIC(){return this.document.fields.find((e=>"ReceiverBIC"===e.type.name))}get receiverIBAN(){return this.document.fields.find((e=>"ReceiverIBAN"===e.type.name))}get receiverName(){return this.document.fields.find((e=>"ReceiverName"===e.type.name))}get remittance(){return this.document.fields.find((e=>"Remittance"===e.type.name))}get serviceTag(){return this.document.fields.find((e=>"ServiceTag"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}}class Zi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Vn}get accident(){return this.document.fields.find((e=>"Accident"===e.type.name))}get assignedToAccidentInsuranceDoctor(){return this.document.fields.find((e=>"AssignedToAccidentInsuranceDoctor"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get childNeedsCareFrom(){return this.document.fields.find((e=>"ChildNeedsCareFrom"===e.type.name))}get childNeedsCareUntil(){return this.document.fields.find((e=>"ChildNeedsCareUntil"===e.type.name))}get diagnose(){return this.document.fields.find((e=>"Diagnose"===e.type.name))}get diagnosedOn(){return this.document.fields.find((e=>"DiagnosedOn"===e.type.name))}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get documentDate(){return this.document.fields.find((e=>"DocumentDate"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get healthInsuranceNumber(){return this.document.fields.find((e=>"HealthInsuranceNumber"===e.type.name))}get incapableOfWorkSince(){return this.document.fields.find((e=>"IncapableOfWorkSince"===e.type.name))}get incapableOfWorkUntil(){return this.document.fields.find((e=>"IncapableOfWorkUntil"===e.type.name))}get initialCertificate(){return this.document.fields.find((e=>"InitialCertificate"===e.type.name))}get insuredPersonNumber(){return this.document.fields.find((e=>"InsuredPersonNumber"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get placeOfOperationNumber(){return this.document.fields.find((e=>"PlaceOfOperationNumber"===e.type.name))}get renewedCertificate(){return this.document.fields.find((e=>"RenewedCertificate"===e.type.name))}get requiresCare(){return this.document.fields.find((e=>"RequiresCare"===e.type.name))}get status(){return this.document.fields.find((e=>"Status"===e.type.name))}get workAccident(){return this.document.fields.find((e=>"WorkAccident"===e.type.name))}}class Gi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wn}get version(){const e=this.document.children.find((e=>"Version"===e.type.name));return new Gi.Version(e)}get source(){const e=this.document.children.find((e=>"Source"===e.type.name));return e?new Gi.Source(e):void 0}get kind(){const e=this.document.children.find((e=>"Kind"===e.type.name));return e?new Gi.Kind(e):void 0}get xml(){const e=this.document.children.find((e=>"XML"===e.type.name));return e?new Gi.XML(e):void 0}get name(){const e=this.document.children.find((e=>"Name"===e.type.name));return e?new Gi.Name(e):void 0}get firstName(){const e=this.document.children.find((e=>"FirstName"===e.type.name));return e?new Gi.FirstName(e):void 0}get nickname(){const e=this.document.children.find((e=>"Nickname"===e.type.name));return e?new Gi.Nickname(e):void 0}get birthday(){const e=this.document.children.find((e=>"Birthday"===e.type.name));return e?new Gi.Birthday(e):void 0}get anniversary(){const e=this.document.children.find((e=>"Anniversary"===e.type.name));return e?new Gi.Anniversary(e):void 0}get gender(){const e=this.document.children.find((e=>"Gender"===e.type.name));return e?new Gi.Gender(e):void 0}get deliveryAddress(){const e=this.document.children.find((e=>"DeliveryAddress"===e.type.name));return e?new Gi.DeliveryAddress(e):void 0}get photo(){const e=this.document.children.find((e=>"Photo"===e.type.name));return e?new Gi.Photo(e):void 0}get telephoneNumber(){const e=this.document.children.find((e=>"TelephoneNumber"===e.type.name));return e?new Gi.TelephoneNumber(e):void 0}get email(){const e=this.document.children.find((e=>"Email"===e.type.name));return e?new Gi.Email(e):void 0}get impp(){const e=this.document.children.find((e=>"IMPP"===e.type.name));return e?new Gi.IMPP(e):void 0}get languages(){const e=this.document.children.find((e=>"Languages"===e.type.name));return e?new Gi.Languages(e):void 0}get timeZone(){const e=this.document.children.find((e=>"TimeZone"===e.type.name));return e?new Gi.TimeZone(e):void 0}get geoLocation(){const e=this.document.children.find((e=>"GeoLocation"===e.type.name));return e?new Gi.GeoLocation(e):void 0}get title(){const e=this.document.children.find((e=>"Title"===e.type.name));return e?new Gi.Title(e):void 0}get role(){const e=this.document.children.find((e=>"Role"===e.type.name));return e?new Gi.Role(e):void 0}get logo(){const e=this.document.children.find((e=>"Logo"===e.type.name));return e?new Gi.Logo(e):void 0}get organisation(){const e=this.document.children.find((e=>"Organisation"===e.type.name));return e?new Gi.Organisation(e):void 0}get member(){const e=this.document.children.find((e=>"Member"===e.type.name));return e?new Gi.Member(e):void 0}get related(){const e=this.document.children.find((e=>"Related"===e.type.name));return e?new Gi.Related(e):void 0}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return e?new Gi.Categories(e):void 0}get note(){const e=this.document.children.find((e=>"Note"===e.type.name));return e?new Gi.Note(e):void 0}get productId(){const e=this.document.children.find((e=>"ProductId"===e.type.name));return e?new Gi.ProductId(e):void 0}get revision(){const e=this.document.children.find((e=>"Revision"===e.type.name));return e?new Gi.Revision(e):void 0}get sound(){const e=this.document.children.find((e=>"Sound"===e.type.name));return e?new Gi.Sound(e):void 0}get uid(){const e=this.document.children.find((e=>"UID"===e.type.name));return e?new Gi.UID(e):void 0}get clientPIDMap(){const e=this.document.children.find((e=>"ClientPIDMap"===e.type.name));return e?new Gi.ClientPIDMap(e):void 0}get url(){const e=this.document.children.find((e=>"URL"===e.type.name));return e?new Gi.URL(e):void 0}get publicKey(){const e=this.document.children.find((e=>"PublicKey"===e.type.name));return e?new Gi.PublicKey(e):void 0}get busyTimeURL(){const e=this.document.children.find((e=>"BusyTimeURL"===e.type.name));return e?new Gi.BusyTimeURL(e):void 0}get calendarURIForRequests(){const e=this.document.children.find((e=>"CalendarURIForRequests"===e.type.name));return e?new Gi.CalendarURIForRequests(e):void 0}get calendarURI(){const e=this.document.children.find((e=>"CalendarURI"===e.type.name));return e?new Gi.CalendarURI(e):void 0}get customs(){return this.document.children.filter((e=>"Custom"===e.type.name)).map((e=>new Gi.Custom(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get typeModifiers(){return this.document.fields.filter((e=>"TypeModifier"===e.type.name))}get values(){return this.document.fields.filter((e=>"Value"===e.type.name))}}e.Entry=t;e.Version=class extends t{constructor(e){super(e)}requiredDocumentType(){return jn}};e.Source=class extends t{constructor(e){super(e)}requiredDocumentType(){return Hn}};e.Kind=class extends t{constructor(e){super(e)}requiredDocumentType(){return Un}};e.XML=class extends t{constructor(e){super(e)}requiredDocumentType(){return Zn}};e.Name=class extends t{constructor(e){super(e)}requiredDocumentType(){return Gn}};e.FirstName=class extends t{constructor(e){super(e)}requiredDocumentType(){return Yn}};e.Nickname=class extends t{constructor(e){super(e)}requiredDocumentType(){return Qn}};e.Birthday=class extends t{constructor(e){super(e)}requiredDocumentType(){return qn}};e.Anniversary=class extends t{constructor(e){super(e)}requiredDocumentType(){return Xn}};e.Gender=class extends t{constructor(e){super(e)}requiredDocumentType(){return Kn}};e.DeliveryAddress=class extends t{constructor(e){super(e)}requiredDocumentType(){return Jn}};e.Photo=class extends t{constructor(e){super(e)}requiredDocumentType(){return $n}};e.TelephoneNumber=class extends t{constructor(e){super(e)}requiredDocumentType(){return ei}};e.Email=class extends t{constructor(e){super(e)}requiredDocumentType(){return ti}};e.IMPP=class extends t{constructor(e){super(e)}requiredDocumentType(){return ni}};e.Languages=class extends t{constructor(e){super(e)}requiredDocumentType(){return ii}};e.TimeZone=class extends t{constructor(e){super(e)}requiredDocumentType(){return oi}};e.GeoLocation=class extends t{constructor(e){super(e)}requiredDocumentType(){return ri}};e.Title=class extends t{constructor(e){super(e)}requiredDocumentType(){return ai}};e.Role=class extends t{constructor(e){super(e)}requiredDocumentType(){return si}};e.Logo=class extends t{constructor(e){super(e)}requiredDocumentType(){return ci}};e.Organisation=class extends t{constructor(e){super(e)}requiredDocumentType(){return li}};e.Member=class extends t{constructor(e){super(e)}requiredDocumentType(){return ui}};e.Related=class extends t{constructor(e){super(e)}requiredDocumentType(){return di}};e.Categories=class extends t{constructor(e){super(e)}requiredDocumentType(){return mi}};e.Note=class extends t{constructor(e){super(e)}requiredDocumentType(){return hi}};e.ProductId=class extends t{constructor(e){super(e)}requiredDocumentType(){return fi}};e.Revision=class extends t{constructor(e){super(e)}requiredDocumentType(){return pi}};e.Sound=class extends t{constructor(e){super(e)}requiredDocumentType(){return gi}};e.UID=class extends t{constructor(e){super(e)}requiredDocumentType(){return vi}};e.ClientPIDMap=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ci}};e.URL=class extends t{constructor(e){super(e)}requiredDocumentType(){return yi}};e.PublicKey=class extends t{constructor(e){super(e)}requiredDocumentType(){return bi}};e.BusyTimeURL=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ai}};e.CalendarURIForRequests=class extends t{constructor(e){super(e)}requiredDocumentType(){return Si}};e.CalendarURI=class extends t{constructor(e){super(e)}requiredDocumentType(){return wi}};e.Custom=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ei}}}(Gi||(Gi={}));class Yi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return xi}get issuerIdentificationNumber(){return this.document.fields.find((e=>"IssuerIdentificationNumber"===e.type.name))}get jurisdictionVersionNumber(){return this.document.fields.find((e=>"JurisdictionVersionNumber"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}get titleData(){const e=this.document.children.find((e=>"TitleData"===e.type.name));return e?new Yi.TitleData(e):void 0}get registrationData(){const e=this.document.children.find((e=>"RegistrationData"===e.type.name));return e?new Yi.RegistrationData(e):void 0}get motorCarrierData(){const e=this.document.children.find((e=>"MotorCarrierData"===e.type.name));return e?new Yi.MotorCarrierData(e):void 0}get registrantAndVehicleData(){const e=this.document.children.find((e=>"RegistrantAndVehicleData"===e.type.name));return e?new Yi.RegistrantAndVehicleData(e):void 0}get vehicleOwnerData(){const e=this.document.children.find((e=>"VehicleOwnerData"===e.type.name));return e?new Yi.VehicleOwnerData(e):void 0}get vehicleData(){const e=this.document.children.find((e=>"VehicleData"===e.type.name));return e?new Yi.VehicleData(e):void 0}get vehicleSafetyInspectionData(){const e=this.document.children.find((e=>"VehicleSafetyInspectionData"===e.type.name));return e?new Yi.VehicleSafetyInspectionData(e):void 0}get driverLicense(){const e=this.document.children.find((e=>"DriverLicense"===e.type.name));return e?new Yi.DriverLicense(e):void 0}get idCard(){const e=this.document.children.find((e=>"IDCard"===e.type.name));return e?new Yi.IDCard(e):void 0}get enhancedDriverLicense(){const e=this.document.children.find((e=>"EnhancedDriverLicense"===e.type.name));return e?new Yi.EnhancedDriverLicense(e):void 0}get rawDocument(){const e=this.document.children.find((e=>"RawDocument"===e.type.name));return new Yi.RawDocument(e)}}!function(e){e.TitleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Di}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get familyName(){return this.document.fields.find((e=>"FamilyName"===e.type.name))}get firstLienHolderId(){return this.document.fields.find((e=>"FirstLienHolderId"===e.type.name))}get firstLienHolderName(){return this.document.fields.find((e=>"FirstLienHolderName"===e.type.name))}get givenName(){return this.document.fields.find((e=>"GivenName"===e.type.name))}get newUsedIndicator(){return this.document.fields.find((e=>"NewUsedIndicator"===e.type.name))}get odometerDate(){return this.document.fields.find((e=>"OdometerDate"===e.type.name))}get odometerDisclosure(){return this.document.fields.find((e=>"OdometerDisclosure"===e.type.name))}get odometerReadingKilometers(){return this.document.fields.find((e=>"OdometerReadingKilometers"===e.type.name))}get odometerReadingMileage(){return this.document.fields.find((e=>"OdometerReadingMileage"===e.type.name))}get previousTitleNumber(){return this.document.fields.find((e=>"PreviousTitleNumber"===e.type.name))}get previousTitlingJurisdiction(){return this.document.fields.find((e=>"PreviousTitlingJurisdiction"===e.type.name))}get titleBrand(){return this.document.fields.find((e=>"TitleBrand"===e.type.name))}get titleIssueDate(){return this.document.fields.find((e=>"TitleIssueDate"===e.type.name))}get titleNumber(){return this.document.fields.find((e=>"TitleNumber"===e.type.name))}get titlingJurisdiction(){return this.document.fields.find((e=>"TitlingJurisdiction"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehiclePurchaseDate(){return this.document.fields.find((e=>"VehiclePurchaseDate"===e.type.name))}};e.RegistrationData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Bi}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get axles(){return this.document.fields.find((e=>"Axles"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get fuel(){return this.document.fields.find((e=>"Fuel"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get registrantFamilyName(){return this.document.fields.find((e=>"RegistrantFamilyName"===e.type.name))}get registrantGivenName(){return this.document.fields.find((e=>"RegistrantGivenName"===e.type.name))}get registrationExpiryDate(){return this.document.fields.find((e=>"RegistrationExpiryDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationWindowStickerDecal(){return this.document.fields.find((e=>"RegistrationWindowStickerDecal"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehicleUse(){return this.document.fields.find((e=>"VehicleUse"===e.type.name))}};e.MotorCarrierData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ti}get carrierName(){return this.document.fields.find((e=>"CarrierName"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get streetAddress(){return this.document.fields.find((e=>"StreetAddress"===e.type.name))}get usdotNumber(){return this.document.fields.find((e=>"USDOTNumber"===e.type.name))}get zip(){return this.document.fields.find((e=>"Zip"===e.type.name))}};e.RegistrantAndVehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ii}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get baseJurisdictionRegisteredWeight(){return this.document.fields.find((e=>"BaseJurisdictionRegisteredWeight"===e.type.name))}get carrierNameRegistrant(){return this.document.fields.find((e=>"CarrierNameRegistrant"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get modelYear(){return this.document.fields.find((e=>"ModelYear"===e.type.name))}get numberOfSeats(){return this.document.fields.find((e=>"NumberOfSeats"===e.type.name))}get registrationDecalNumber(){return this.document.fields.find((e=>"RegistrationDecalNumber"===e.type.name))}get registrationEnforcementDate(){return this.document.fields.find((e=>"RegistrationEnforcementDate"===e.type.name))}get registrationExpirationDate(){return this.document.fields.find((e=>"RegistrationExpirationDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get typeOfVehicle(){return this.document.fields.find((e=>"TypeOfVehicle"===e.type.name))}get unitNumber(){return this.document.fields.find((e=>"UnitNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get zipCode(){return this.document.fields.find((e=>"ZipCode"===e.type.name))}};e.VehicleOwnerData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return ki}get firstOwnerIdNumber(){return this.document.fields.find((e=>"FirstOwnerIdNumber"===e.type.name))}get firstOwnerLastName(){return this.document.fields.find((e=>"FirstOwnerLastName"===e.type.name))}get firstOwnerLegalStatus(){return this.document.fields.find((e=>"FirstOwnerLegalStatus"===e.type.name))}get firstOwnerMiddleName(){return this.document.fields.find((e=>"FirstOwnerMiddleName"===e.type.name))}get firstOwnerName(){return this.document.fields.find((e=>"FirstOwnerName"===e.type.name))}get firstOwnerTotalName(){return this.document.fields.find((e=>"FirstOwnerTotalName"===e.type.name))}get mailingAddress1(){return this.document.fields.find((e=>"MailingAddress1"===e.type.name))}get mailingAddress2(){return this.document.fields.find((e=>"MailingAddress2"===e.type.name))}get mailingCity(){return this.document.fields.find((e=>"MailingCity"===e.type.name))}get mailingJurisdictionCode(){return this.document.fields.find((e=>"MailingJurisdictionCode"===e.type.name))}get mailingZipCode(){return this.document.fields.find((e=>"MailingZipCode"===e.type.name))}get residenceAddress1(){return this.document.fields.find((e=>"ResidenceAddress1"===e.type.name))}get residenceAddress2(){return this.document.fields.find((e=>"ResidenceAddress2"===e.type.name))}get residenceCity(){return this.document.fields.find((e=>"ResidenceCity"===e.type.name))}get residenceJurisdictionCode(){return this.document.fields.find((e=>"ResidenceJurisdictionCode"===e.type.name))}get residenceZipCode(){return this.document.fields.find((e=>"ResidenceZipCode"===e.type.name))}get secondOwnerIdNumber(){return this.document.fields.find((e=>"SecondOwnerIdNumber"===e.type.name))}get secondOwnerLastName(){return this.document.fields.find((e=>"SecondOwnerLastName"===e.type.name))}get secondOwnerLegalStatus(){return this.document.fields.find((e=>"SecondOwnerLegalStatus"===e.type.name))}get secondOwnerMiddleName(){return this.document.fields.find((e=>"SecondOwnerMiddleName"===e.type.name))}get secondOwnerName(){return this.document.fields.find((e=>"SecondOwnerName"===e.type.name))}get secondOwnerTotalName(){return this.document.fields.find((e=>"SecondOwnerTotalName"===e.type.name))}};e.VehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Oi}get bodyStyle(){return this.document.fields.find((e=>"BodyStyle"===e.type.name))}get dateJunked(){return this.document.fields.find((e=>"DateJunked"===e.type.name))}get dateRecovered(){return this.document.fields.find((e=>"DateRecovered"===e.type.name))}get dateStolen(){return this.document.fields.find((e=>"DateStolen"===e.type.name))}get engineDisplacement(){return this.document.fields.find((e=>"EngineDisplacement"===e.type.name))}get engineSize(){return this.document.fields.find((e=>"EngineSize"===e.type.name))}get fuelType(){return this.document.fields.find((e=>"FuelType"===e.type.name))}get horsepower(){return this.document.fields.find((e=>"Horsepower"===e.type.name))}get iftaIndicator(){return this.document.fields.find((e=>"IFTAIndicator"===e.type.name))}get irpIndicator(){return this.document.fields.find((e=>"IRPIndicator"===e.type.name))}get junkedIndicator(){return this.document.fields.find((e=>"JunkedIndicator"===e.type.name))}get msrp(){return this.document.fields.find((e=>"MSRP"===e.type.name))}get majorCode(){return this.document.fields.find((e=>"MajorCode"===e.type.name))}get makeYear(){return this.document.fields.find((e=>"MakeYear"===e.type.name))}get manufactureGrossWeight(){return this.document.fields.find((e=>"ManufactureGrossWeight"===e.type.name))}get minorCode(){return this.document.fields.find((e=>"MinorCode"===e.type.name))}get numberOfAxles(){return this.document.fields.find((e=>"NumberOfAxles"===e.type.name))}get numberOfCylinders(){return this.document.fields.find((e=>"NumberOfCylinders"===e.type.name))}get numberOfDoors(){return this.document.fields.find((e=>"NumberOfDoors"===e.type.name))}get stolenIndicator(){return this.document.fields.find((e=>"StolenIndicator"===e.type.name))}get transmissionCode(){return this.document.fields.find((e=>"TransmissionCode"===e.type.name))}get unladenWeight(){return this.document.fields.find((e=>"UnladenWeight"===e.type.name))}get vltClacFromDate(){return this.document.fields.find((e=>"VLTClacFromDate"===e.type.name))}get vehicleIdNumber(){return this.document.fields.find((e=>"VehicleIdNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleStatusCode(){return this.document.fields.find((e=>"VehicleStatusCode"===e.type.name))}get vehicleTypeCode(){return this.document.fields.find((e=>"VehicleTypeCode"===e.type.name))}};e.VehicleSafetyInspectionData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Li}get inspectionAddress(){return this.document.fields.find((e=>"InspectionAddress"===e.type.name))}get inspectionAirPollutionDeviceConditions(){return this.document.fields.find((e=>"InspectionAirPollutionDeviceConditions"===e.type.name))}get inspectionFacilityIdentifier(){return this.document.fields.find((e=>"InspectionFacilityIdentifier"===e.type.name))}get inspectionFormOrStickerNumberCurrent(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberCurrent"===e.type.name))}get inspectionFormOrStickerNumberPrevious(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberPrevious"===e.type.name))}get inspectionSmogCertificateIndicator(){return this.document.fields.find((e=>"InspectionSmogCertificateIndicator"===e.type.name))}get inspectionStationNumber(){return this.document.fields.find((e=>"InspectionStationNumber"===e.type.name))}get inspectorIdentificationNumber(){return this.document.fields.find((e=>"InspectorIdentificationNumber"===e.type.name))}get odometerReadingAtInspection(){return this.document.fields.find((e=>"OdometerReadingAtInspection"===e.type.name))}get vehicleBodyType(){return this.document.fields.find((e=>"VehicleBodyType"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressPostalCode(){return this.document.fields.find((e=>"AddressPostalCode"===e.type.name))}get addressStreet1(){return this.document.fields.find((e=>"AddressStreet1"===e.type.name))}get addressStreet2(){return this.document.fields.find((e=>"AddressStreet2"===e.type.name))}get adultInformation(){return this.document.fields.find((e=>"AdultInformation"===e.type.name))}get aliasFamilyName(){return this.document.fields.find((e=>"AliasFamilyName"===e.type.name))}get aliasGivenName(){return this.document.fields.find((e=>"AliasGivenName"===e.type.name))}get aliasMiddleName(){return this.document.fields.find((e=>"AliasMiddleName"===e.type.name))}get aliasPrefixName(){return this.document.fields.find((e=>"AliasPrefixName"===e.type.name))}get aliasSuffixName(){return this.document.fields.find((e=>"AliasSuffixName"===e.type.name))}get cardRevisionDate(){return this.document.fields.find((e=>"CardRevisionDate"===e.type.name))}get complianceType(){return this.document.fields.find((e=>"ComplianceType"===e.type.name))}get countryIdentification(){return this.document.fields.find((e=>"CountryIdentification"===e.type.name))}get customerFamilyName(){return this.document.fields.find((e=>"CustomerFamilyName"===e.type.name))}get customerFirstName(){return this.document.fields.find((e=>"CustomerFirstName"===e.type.name))}get customerGivenNames(){return this.document.fields.find((e=>"CustomerGivenNames"===e.type.name))}get customerIdNumber(){return this.document.fields.find((e=>"CustomerIdNumber"===e.type.name))}get customerMiddleName(){return this.document.fields.find((e=>"CustomerMiddleName"===e.type.name))}get dateOfBirth(){return this.document.fields.find((e=>"DateOfBirth"===e.type.name))}get documentDiscriminator(){return this.document.fields.find((e=>"DocumentDiscriminator"===e.type.name))}get documentExpirationDate(){return this.document.fields.find((e=>"DocumentExpirationDate"===e.type.name))}get documentIssueDate(){return this.document.fields.find((e=>"DocumentIssueDate"===e.type.name))}get driverAliasDateOfBirthField(){return this.document.fields.find((e=>"DriverAliasDateOfBirthField"===e.type.name))}get driverAliasFirstName(){return this.document.fields.find((e=>"DriverAliasFirstName"===e.type.name))}get driverAliasLastName(){return this.document.fields.find((e=>"DriverAliasLastName"===e.type.name))}get driverAliasSocialSecurityNumber(){return this.document.fields.find((e=>"DriverAliasSocialSecurityNumber"===e.type.name))}get driverLastName(){return this.document.fields.find((e=>"DriverLastName"===e.type.name))}get driverLicenseClassificationCode(){return this.document.fields.find((e=>"DriverLicenseClassificationCode"===e.type.name))}get driverLicenseEndorsementsCode(){return this.document.fields.find((e=>"DriverLicenseEndorsementsCode"===e.type.name))}get driverLicenseName(){return this.document.fields.find((e=>"DriverLicenseName"===e.type.name))}get driverLicenseRestrictionCode(){return this.document.fields.find((e=>"DriverLicenseRestrictionCode"===e.type.name))}get driverNamePrefix(){return this.document.fields.find((e=>"DriverNamePrefix"===e.type.name))}get driverNameSuffix(){return this.document.fields.find((e=>"DriverNameSuffix"===e.type.name))}get driverPermitClassificationCode(){return this.document.fields.find((e=>"DriverPermitClassificationCode"===e.type.name))}get driverPermitEndorsementCode(){return this.document.fields.find((e=>"DriverPermitEndorsementCode"===e.type.name))}get driverPermitIssueDate(){return this.document.fields.find((e=>"DriverPermitIssueDate"===e.type.name))}get driverPermitRestrictionCode(){return this.document.fields.find((e=>"DriverPermitRestrictionCode"===e.type.name))}get driverResidenceCity(){return this.document.fields.find((e=>"DriverResidenceCity"===e.type.name))}get driverResidenceJurisdictionCode(){return this.document.fields.find((e=>"DriverResidenceJurisdictionCode"===e.type.name))}get driverResidencePostalCode(){return this.document.fields.find((e=>"DriverResidencePostalCode"===e.type.name))}get driverResidenceStreetAddress1(){return this.document.fields.find((e=>"DriverResidenceStreetAddress1"===e.type.name))}get driverResidenceStreetAddress2(){return this.document.fields.find((e=>"DriverResidenceStreetAddress2"===e.type.name))}get familyNameTruncation(){return this.document.fields.find((e=>"FamilyNameTruncation"===e.type.name))}get federalCommercialVehicleCodes(){return this.document.fields.find((e=>"FederalCommercialVehicleCodes"===e.type.name))}get firstNameTruncation(){return this.document.fields.find((e=>"FirstNameTruncation"===e.type.name))}get hazmatEndorsementExpirationDate(){return this.document.fields.find((e=>"HAZMATEndorsementExpirationDate"===e.type.name))}get hairColor(){return this.document.fields.find((e=>"HairColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get inventoryControlNumber(){return this.document.fields.find((e=>"InventoryControlNumber"===e.type.name))}get issueTimeStamp(){return this.document.fields.find((e=>"IssueTimeStamp"===e.type.name))}get jurisdictionSpecificEndorsementCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodeDescription"===e.type.name))}get jurisdictionSpecificEndorsementCodes(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodes"===e.type.name))}get jurisdictionSpecificRestrictionCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodeDescription"===e.type.name))}get jurisdictionSpecificRestrictionCodes(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodes"===e.type.name))}get jurisdictionSpecificVehicleClass(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClass"===e.type.name))}get jurisdictionSpecificVehicleClassificationDescription(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClassificationDescription"===e.type.name))}get limitedDurationDocumentIndicator(){return this.document.fields.find((e=>"LimitedDurationDocumentIndicator"===e.type.name))}get middleNameTruncation(){return this.document.fields.find((e=>"MiddleNameTruncation"===e.type.name))}get nameSuffix(){return this.document.fields.find((e=>"NameSuffix"===e.type.name))}get nonResidentIndicator(){return this.document.fields.find((e=>"NonResidentIndicator"===e.type.name))}get numberOfDuplicates(){return this.document.fields.find((e=>"NumberOfDuplicates"===e.type.name))}get organDonor(){return this.document.fields.find((e=>"OrganDonor"===e.type.name))}get organDonorIndicator(){return this.document.fields.find((e=>"OrganDonorIndicator"===e.type.name))}get permitExpirationDate(){return this.document.fields.find((e=>"PermitExpirationDate"===e.type.name))}get permitIdentifier(){return this.document.fields.find((e=>"PermitIdentifier"===e.type.name))}get physicalDescriptionEyeColor(){return this.document.fields.find((e=>"PhysicalDescriptionEyeColor"===e.type.name))}get physicalDescriptionHeight(){return this.document.fields.find((e=>"PhysicalDescriptionHeight"===e.type.name))}get physicalDescriptionSex(){return this.document.fields.find((e=>"PhysicalDescriptionSex"===e.type.name))}get physicalDescriptionWeightRange(){return this.document.fields.find((e=>"PhysicalDescriptionWeightRange"===e.type.name))}get placeOfBirth(){return this.document.fields.find((e=>"PlaceOfBirth"===e.type.name))}get raceEthnicity(){return this.document.fields.find((e=>"RaceEthnicity"===e.type.name))}get socialSecurityNumber(){return this.document.fields.find((e=>"SocialSecurityNumber"===e.type.name))}get standardEndorsementCode(){return this.document.fields.find((e=>"StandardEndorsementCode"===e.type.name))}get standardRestrictionCode(){return this.document.fields.find((e=>"StandardRestrictionCode"===e.type.name))}get standardVehicleClassification(){return this.document.fields.find((e=>"StandardVehicleClassification"===e.type.name))}get under18Until(){return this.document.fields.find((e=>"Under18Until"===e.type.name))}get under19Until(){return this.document.fields.find((e=>"Under19Until"===e.type.name))}get under21Until(){return this.document.fields.find((e=>"Under21Until"===e.type.name))}get uniqueCustomerIdentifier(){return this.document.fields.find((e=>"UniqueCustomerIdentifier"===e.type.name))}get veteranIndicator(){return this.document.fields.find((e=>"VeteranIndicator"===e.type.name))}get weightKilograms(){return this.document.fields.find((e=>"WeightKilograms"===e.type.name))}get weightPounds(){return this.document.fields.find((e=>"WeightPounds"===e.type.name))}}e.DLID=t;e.DriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return _i}};e.IDCard=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ri}};e.EnhancedDriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return Fi}};e.RawDocument=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Mi}}}(Yi||(Yi={}));class Qi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ni}get dateOfManufacture(){return this.document.fields.find((e=>"DateOfManufacture"===e.type.name))}get expiryDateDay(){return this.document.fields.find((e=>"ExpiryDateDay"===e.type.name))}get expiryDateHour(){return this.document.fields.find((e=>"ExpiryDateHour"===e.type.name))}get expiryDateJulianDay(){return this.document.fields.find((e=>"ExpiryDateJulianDay"===e.type.name))}get expiryDateMonth(){return this.document.fields.find((e=>"ExpiryDateMonth"===e.type.name))}get expiryDateYear(){return this.document.fields.find((e=>"ExpiryDateYear"===e.type.name))}get hasPrimaryData(){return this.document.fields.find((e=>"HasPrimaryData"===e.type.name))}get hasSecondaryData(){return this.document.fields.find((e=>"HasSecondaryData"===e.type.name))}get labelerIdentificationCode(){return this.document.fields.find((e=>"LabelerIdentificationCode"===e.type.name))}get labelersProductOrCatalogNumber(){return this.document.fields.find((e=>"LabelersProductOrCatalogNumber"===e.type.name))}get linkCharacter(){return this.document.fields.find((e=>"LinkCharacter"===e.type.name))}get lotNumber(){return this.document.fields.find((e=>"LotNumber"===e.type.name))}get quantity(){return this.document.fields.find((e=>"Quantity"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get unitOfMeasureID(){return this.document.fields.find((e=>"UnitOfMeasureID"===e.type.name))}}const qi="Check",Xi="USACheck",Ki="UAECheck",Ji="FRACheck",$i="ISRCheck",eo="KWTCheck",to="AUSCheck",no="INDCheck",io="CANCheck",oo="UnknownCheck";class ro{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get fontType(){return this.document.fields.find((e=>"FontType"===e.type.name))}get rawString(){return this.document.fields.find((e=>"RawString"===e.type.name))}}class ao extends ro{constructor(e){super(e)}requiredDocumentType(){return Xi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxiliaryOnUs(){return this.document.fields.find((e=>"AuxiliaryOnUs"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class so extends ro{constructor(e){super(e)}requiredDocumentType(){return Ki}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class co extends ro{constructor(e){super(e)}requiredDocumentType(){return Ji}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class lo extends ro{constructor(e){super(e)}requiredDocumentType(){return $i}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get branchNumber(){return this.document.fields.find((e=>"BranchNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}}class uo extends ro{constructor(e){super(e)}requiredDocumentType(){return eo}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get sortCode(){return this.document.fields.find((e=>"SortCode"===e.type.name))}}class mo extends ro{constructor(e){super(e)}requiredDocumentType(){return to}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxDomestic(){return this.document.fields.find((e=>"AuxDomestic"===e.type.name))}get bsb(){return this.document.fields.find((e=>"BSB"===e.type.name))}get extraAuxDomestic(){return this.document.fields.find((e=>"ExtraAuxDomestic"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class ho extends ro{constructor(e){super(e)}requiredDocumentType(){return no}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get sortNumber(){return this.document.fields.find((e=>"SortNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class fo extends ro{constructor(e){super(e)}requiredDocumentType(){return io}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get designationNumber(){return this.document.fields.find((e=>"DesignationNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class po extends ro{constructor(e){super(e)}requiredDocumentType(){return oo}}const go="CreditCard";class vo{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return go}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get cardholderName(){return this.document.fields.find((e=>"CardholderName"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}}class Co extends X.a{constructor(){super(q.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new m.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new ce.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new Co;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class yo extends X.a{constructor(){super(q.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectionConfiguration=new b.VinScannerConfiguration,this.onVinDetected=function(e){},this.finder.aspectRatio=new ce.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(e){const t=new yo;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class bo extends Error{constructor(e){super(e.description),this.name="LicenseError"}}class Ao{static throwIfMissingBuffer(e){Ao.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var So=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class wo{constructor(e,t){this._sdk=e,this._token=t}analyze(e,t="COPY_IMAGE"){return So(this,void 0,void 0,(function*(){Ao.throwIfMissingBuffer(e);const n=this._sdk.getBridge(t);return yield n.documentQualityAnalyzerAnalyze(this._token,e)}))}release(){return So(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var Eo=n(17),xo=n(0),Do=n(48),Bo=n(15),To=n(1),Io=n.n(To),ko=n(5);const Oo="var(--1-sb-dvh, 1vh)";function Lo(){const e=Object(xo.useMemo)((()=>{var e,t;return null===(t=null===(e=null===window||void 0===window?void 0:window.CSS)||void 0===e?void 0:e.supports)||void 0===t?void 0:t.call(e,"height: 100dvh")}),[]),t=()=>{var t=e?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",t)};return Object(xo.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var Po=n(31),_o=n(9),Ro=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function Fo(e){const{styleConfig:t}=e,n=Ro(e,["styleConfig"]),i=Object.assign(Object.assign({},e.style),{backgroundColor:ko.b.getColorValue(t.fillColor),borderColor:ko.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return xo.default.createElement(To.Box,Object.assign({},n,{style:i}))}function Mo(e){return e=ko.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=ko.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),No(e))}function No(e){return{"&:focus-visible":{outlineColor:`${e=ko.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function Vo(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return xo.default.createElement(xo.default.Fragment,null,e.config.visible&&xo.default.createElement(To.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":ko.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:ko.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:ko.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},Mo(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&xo.default.createElement(e.icon,{color:ko.b.getColorValue(e.config.icon.color)}),e.children,xo.default.createElement(_o.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const Wo=new Map;function zo(e){const t=function(e){if(!Wo.has(e)){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.clearRect(0,0,1,1),n.fillStyle="#000",n.fillStyle=e;const i=n.fillStyle;if(n.fillStyle="#fff",n.fillStyle=e,i!==n.fillStyle)return Wo.set(e,null),null;n.fillRect(0,0,1,1);const o=[...n.getImageData(0,0,1,1).data];Wo.set(e,{r:o[0],g:o[1],b:o[2],a:o[3]})}return Wo.get(e)}(e);return 0===(null==t?void 0:t.a)}function jo(e){var t,n;if(!e.visible)return xo.default.createElement("div",{style:{display:"flex",flex:1}});const i=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},o="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let r={};return zo(ko.b.getColorValue(e.background.fillColor))&&(r={textDecoration:"underline"}),xo.default.createElement(To.Button,Object.assign({id:e.id,"aria-label":e.ariaLabel,disabled:null!==(n=e.disabled)&&void 0!==n&&n,variant:"text",onClick:e.onClick,style:Object(_o.b)(e.foreground),sx:Object.assign({opacity:e.disabled?.5:1,flex:1,textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},"&:hover":r,"&:focus-visible > div":{outlineColor:ko.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0},e.buttonWidth?{width:`${e.buttonWidth}px`,minWidth:0}:{}),disableRipple:!0},i),xo.default.createElement(Fo,{styleConfig:Object.assign(Object.assign({},e.background),{cornerRadius:4}),sx:Object.assign({borderStyle:"solid",mx:"4px",px:"4px",display:"flex",alignItems:"center"},e.styleOverrides)},e.foreground.iconVisible&&!o&&e.icon,ko.b.getLocalizedText(e.text),e.foreground.iconVisible&&o&&e.icon))}Po.a;const Ho=xo.default.createContext(null);function Uo(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(xo.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=ko.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const i="SOLID"===t?0:n,o={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${Oo} - ${n}px)`:`calc(100 * ${Oo})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},r="SOLID"===t?{backgroundColor:ko.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${ko.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return xo.default.createElement(xo.default.Fragment,null,"HIDDEN"!==t&&xo.default.createElement(To.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},xo.default.createElement(To.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},xo.default.createElement(To.Box,{sx:{flex:1}},e.cancelButton.visible&&xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(jo,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&xo.default.createElement(Io.a,{sx:{fontSize:12,mr:"5px"}})},e.cancelButton)))),xo.default.createElement(To.Box,null,xo.default.createElement(To.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},xo.default.createElement(_o.a,{config:e.title}))),xo.default.createElement(To.Box,{sx:{flex:1}}))),xo.default.createElement(Ho.Provider,{value:o},e.children))}function Zo(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function Go(e){if(e.loading)return xo.default.createElement(To.Skeleton,{variant:"rounded",width:e.imageSize,height:e.imageSize,style:{borderRadius:8}});if(null===e.data.barcodeImage){const t={width:e.imageSize,height:e.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return xo.default.createElement(To.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return xo.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function Yo(e){var t,n;const i=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",o=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!e||"LOADED"!==i,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,c=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:ko.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return xo.default.createElement(To.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&xo.default.createElement(To.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},xo.default.createElement(Go,{data:o,imageSize:a,loading:r})),s&&xo.default.createElement(To.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&xo.default.createElement(To.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},xo.default.createElement(To.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},Zo(e.maxNumberOfTitleLines)),Object(_o.b)(e.barcodeTitle))},r?xo.default.createElement(To.Skeleton,{variant:"text"}):o.title),e.displayRightArrow&&!r&&xo.default.createElement(Io.a,{sx:{fontSize:16,fontWeight:"bold",color:ko.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&xo.default.createElement(To.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},Zo(e.maxNumberOfSubtitleLines)),Object(_o.b)(e.barcodeSubtitle))},r?xo.default.createElement(To.Skeleton,{variant:"text"}):o.subtitle),e.counterForm&&xo.default.createElement(To.ButtonGroup,{variant:"outlined"},xo.default.createElement(To.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:c,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},xo.default.createElement(Io.a,{sx:{color:ko.b.getColorValue(e.counterForm.manualCountChangeColor)}})),xo.default.createElement(To.Button,{sx:Object.assign(Object.assign({},c),{color:ko.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),xo.default.createElement(To.Button,{disabled:!e.counterForm.addButtonEnabled,sx:c,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},xo.default.createElement(Io.a,{sx:{color:ko.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}Bo.ButtonConfiguration;function Qo(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return xo.default.createElement(To.Button,Object.assign({disabled:null!==(t=e.disabled)&&void 0!==t&&t,onClick:e.onClick,type:e.type,"aria-label":e.ariaLabel,sx:Object.assign(Object.assign({},e.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:ko.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:ko.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&xo.default.createElement(e.icon,{sx:{color:ko.b.getColorValue(e.foreground.color),pr:2}}),xo.default.createElement(_o.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var qo=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function Xo(e){var t,{modalOverlayColor:n}=e,i=qo(e,["modalOverlayColor"]);const o={backdrop:{style:{backgroundColor:ko.b.getColorValue(n)}}},r=Object.assign(Object.assign({},i.PaperProps),{sx:Object.assign(Object.assign({},null===(t=i.PaperProps)||void 0===t?void 0:t.sx),i.width?{width:i.width}:{maxWidth:400})});return xo.default.createElement(To.Dialog,Object.assign({},i,{componentsProps:o,PaperProps:r}))}function Ko(e){const t=Object(xo.useContext)(ko.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,i={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[o,r]=xo.default.useState(),a=Object(xo.useRef)((()=>{}));Object(xo.useEffect)((()=>{e.open&&r(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,r(!0)};return xo.default.createElement(Xo,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!o,fullWidth:!0,TransitionProps:{onExited:()=>{o&&a.current()}},onClose:()=>{n||s()}},xo.default.createElement(To.DialogContent,{style:i},xo.default.createElement(Yo,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),xo.default.createElement(To.DialogActions,{style:i},xo.default.createElement(Io.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},xo.default.createElement(Io.a,{item:!0,xs:12},xo.default.createElement(Io.a,{color:t(e.dividerColor)})),n?xo.default.createElement(Io.a,{item:!0,xs:12,sx:{textAlign:"center"}},xo.default.createElement(To.Box,null,xo.default.createElement(To.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),xo.default.createElement(_o.a,{config:e.loadingMessage}))):xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,r(!0)}},e.submitButton)))))))}var Jo=n(3);Jo.h;function $o(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?ko.b.getColorValue(e.activeBackgroundColor):ko.b.getColorValue(e.backgroundColor),color:e.active?ko.b.getColorValue(e.activeForegroundColor):ko.b.getColorValue(e.foregroundColor)};return xo.default.createElement(To.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&xo.default.createElement("span",{style:{fontSize:15}},ko.b.getLocalizedText(e.text)),e.icon&&xo.default.createElement(e.icon,{style:{padding:7}}))}var er=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class tr{constructor(){this.audioFile=new Audio}initialize(e){return er(this,void 0,void 0,(function*(){e.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(e){e.successBeepEnabled&&this.play()}play(){return er(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}tr.INSTANCE=new tr;var nr=tr;class ir{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ir.INSTANCE=new ir;var or=ir,rr=n(12),ar=n(25),sr=n(24),cr=n(26);class lr extends xo.default.Component{constructor(e){super(e),this.state={base64Image:void 0}}render(){const e="x"+this.props.barcode.count;return xo.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},xo.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},xo.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},xo.default.createElement("div",{style:{flex:1}},this.props.barcode.text),xo.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},e)),xo.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function ur(e,t){return e.format===t.format&&e.text===t.text}function dr(e){return e.text+e.format}class mr extends xo.default.Component{constructor(e){super(e),this.state={barcodes:this.toUniqueListWithDuplicateCounter(e.barcodes)}}toUniqueListWithDuplicateCounter(e){const t=[];return e.forEach((e=>{const n=t.findIndex((t=>ur(t,e)));-1===n?(e.count=1,t.push(e)):t[n].count++})),t}update(e){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(e)})}render(){return xo.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((e,t)=>xo.default.createElement(lr,{key:t,barcode:e,onClick:this.props.onClick}))))}}class hr{}hr.ScanbotPrimary="#c8193c",hr.LightGray="#F5F5F5",hr.Gray="#808080",hr.DarkGray="#333333",hr.Orange="#FF5533",hr.White="#FFFFFF",hr.TransparentGreen="rgba(0, 255, 0, 0.5)",hr.TransparentGray="rgba(50, 50, 50, 0.5)",hr.TransparentBlack="rgba(0, 0, 0, 0.3)",hr.SBNegative="#FF3737";var fr,pr=hr;!function(e){e[e.None=0]="None",e[e.PushRight=1]="PushRight",e[e.PushBottom=2]="PushBottom",e[e.Pop=3]="Pop"}(fr||(fr={}));class gr extends xo.default.Component{constructor(e){super(e),this._isVisible=!1,this.state={animation:{type:fr.None},elements:[]}}containerStyle(e){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:e,overflow:"scroll"}}render(){var e,t,n;if(this.state.animation.type===fr.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return xo.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:e=>{this.reset()}},xo.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:e=>{e.stopPropagation()}},xo.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:pr.ScanbotPrimary}},xo.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},xo.default.createElement("div",{style:{backgroundColor:pr.White,height:3,width:33,borderRadius:5}})),xo.default.createElement("div",{style:{display:"flex",height:50}},xo.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:pr.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),xo.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:pr.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(t=null===(e=this.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)+" Codes"),xo.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:pr.White,justifyContent:"right",alignItems:"center",paddingRight:10}},xo.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:e=>{e.stopPropagation(),this.reset()}},"×")))),xo.default.createElement(mr,{ref:e=>{null!==e&&(this.list=e)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(e,t){this._isVisible=!0,this.barcodes=t,this.updateAnimationType(e)}update(e){this.barcodes=e,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(fr.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===fr.Pop&&this.updateAnimationType(fr.None)}updateAnimationType(e,t){this.setState({animation:{type:e}},t)}animation(e){let t=this.from(e),n=this.to(e);this.previousDestination===n&&(t=this.previousDestination,n=this.previousDestination);const i=cr.b`from {transform: ${t};} to {transform: ${n};}`;return cr.a.div`animation: ${i} 0.5s;`}from(e){if(e===fr.PushRight)return this.translate("X",100);if(e===fr.PushBottom)return this.translate("Y",100);if(e===fr.Pop){const e=this.pushType===fr.PushRight?"X":"Y";return this.translate(e,0)}}to(e){if(e===fr.PushRight)return this.translate("X",0);if(e===fr.PushBottom)return this.translate("Y",0);if(e===fr.Pop){const e=this.pushType===fr.PushRight?"X":"Y";return this.translate(e,100)}}translate(e,t){return"translate"+e+"("+t+"%)"}componentWillUnmount(){this._isVisible=!1}}var vr=n(4),Cr=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},yr={measureLayout:Cr(["layout","layoutId","drag","_layoutResetTransform"]),animation:Cr(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Cr(["exit"]),drag:Cr(["drag","dragControls"]),focus:Cr(["whileFocus"]),hover:Cr(["whileHover","onHoverStart","onHoverEnd"]),tap:Cr(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Cr(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Cr(["layout","layoutId"])};var br=Object(xo.createContext)({strict:!1}),Ar=Object.keys(yr),Sr=Ar.length;var wr=Object(xo.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),Er=Object(xo.createContext)({});var xr=Object(xo.createContext)(null);function Dr(e){var t=Object(xo.useRef)(null);return null===t.current&&(t.current=e()),t.current}function Br(){var e=Object(xo.useContext)(xr);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,i=e.register,o=Or();Object(xo.useEffect)((function(){return i(o)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(o)}]:[!0]}function Tr(e){return null===e||e.isPresent}var Ir=0,kr=function(){return Ir++},Or=function(){return Dr(kr)},Lr=Object(xo.createContext)(null),Pr="undefined"!=typeof window,_r=Pr?xo.useLayoutEffect:xo.useEffect;function Rr(e,t,n,i){var o=Object(xo.useContext)(wr),r=Object(xo.useContext)(br),a=Object(xo.useContext)(Er).visualElement,s=Object(xo.useContext)(xr),c=function(e){var t=e.layoutId,n=Object(xo.useContext)(Lr);return n&&void 0!==t?n+"-"+t:t}(n),l=Object(xo.useRef)(void 0);i||(i=r.renderer),!l.current&&i&&(l.current=i(e,{visualState:t,parent:a,props:Object(vr.a)(Object(vr.a)({},n),{layoutId:c}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=l.current;return _r((function(){u&&(u.setProps(Object(vr.a)(Object(vr.a)(Object(vr.a)({},o),n),{layoutId:c})),u.isPresent=Tr(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(xo.useEffect)((function(){var e;u&&(null===(e=u.animationState)||void 0===e||e.animateChanges())})),_r((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Fr(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Mr(e){return Array.isArray(e)}function Nr(e){return"string"==typeof e||Mr(e)}function Vr(e,t,n,i,o){var r;return void 0===i&&(i={}),void 0===o&&(o={}),"string"==typeof t&&(t=null===(r=e.variants)||void 0===r?void 0:r[t]),"function"==typeof t?t(null!=n?n:e.custom,i,o):t}function Wr(e,t,n){var i=e.getProps();return Vr(i,t,null!=n?n:i.custom,function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function zr(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||Nr(e.initial)||Nr(e.animate)||Nr(e.whileHover)||Nr(e.whileDrag)||Nr(e.whileTap)||Nr(e.whileFocus)||Nr(e.exit)}function jr(e){return Boolean(zr(e)||e.variants)}function Hr(e,t){var n=function(e,t){if(zr(e)){var n=e.initial,i=e.animate;return{initial:!1===n||Nr(n)?n:void 0,animate:Nr(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,Object(xo.useContext)(Er)),i=n.initial,o=n.animate;return Object(xo.useMemo)((function(){return{initial:i,animate:o}}),t?[Ur(i),Ur(o)]:[])}function Ur(e){return Array.isArray(e)?e.join(" "):e}function Zr(e){var t=e.preloadedFeatures,n=e.createVisualElement,i=e.useRender,o=e.useVisualState,r=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(yr[t].Component=n)}}(t),Object(xo.forwardRef)((function(e,t){var a=Object(xo.useContext)(wr).isStatic,s=null,c=Hr(e,a),l=o(e,a);return!a&&Pr&&(c.visualElement=Rr(r,l,e,n),s=function(e,t,n){var i=[];if(Object(xo.useContext)(br),!t)return null;for(var o=0;o<Sr;o++){var r=Ar[o],a=yr[r],s=a.isEnabled,c=a.Component;s(e)&&c&&i.push(xo.createElement(c,Object(vr.a)({key:r},e,{visualElement:t})))}return i}(e,c.visualElement)),xo.createElement(xo.Fragment,null,xo.createElement(Er.Provider,{value:c},i(r,e,function(e,t,n){return Object(xo.useCallback)((function(i){var o;i&&(null===(o=e.mount)||void 0===o||o.call(e,i)),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):Fr(n)&&(n.current=i))}),[t])}(l,c.visualElement,t),l,a)),s)}))}function Gr(e){function t(t,n){return void 0===n&&(n={}),Zr(e(t,n))}var n=new Map;return new Proxy(t,{get:function(e,i){return n.has(i)||n.set(i,t(i)),n.get(i)}})}var Yr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function Qr(e){return"string"==typeof e&&!e.includes("-")&&!!(Yr.indexOf(e)>-1||/[A-Z]/.test(e))}var qr={};var Xr=["","X","Y","Z"],Kr=["transformPerspective","x","y","z"];function Jr(e,t){return Kr.indexOf(e)-Kr.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return Xr.forEach((function(t){return Kr.push(e+t)}))}));var $r=new Set(Kr);function ea(e){return $r.has(e)}var ta=new Set(["originX","originY","originZ"]);function na(e){return ta.has(e)}function ia(e,t){var n=t.layout,i=t.layoutId;return ea(e)||na(e)||(n||void 0!==i)&&(!!qr[e]||"opacity"===e)}var oa=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},ra={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function aa(e){return e.startsWith("--")}var sa=function(e,t){return t&&"number"==typeof e?t.transform(e):e},ca=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},la=function(e){return e%1?Number(e.toFixed(5)):e},ua=/(-)?([\d]*\.?[\d])+/g,da=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,ma=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ha(e){return"string"==typeof e}var fa=function(e){return{test:function(t){return ha(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},pa=fa("deg"),ga=fa("%"),va=fa("px"),Ca=fa("vh"),ya=fa("vw"),ba=Object(vr.a)(Object(vr.a)({},ga),{parse:function(e){return ga.parse(e)/100},transform:function(e){return ga.transform(100*e)}}),Aa={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Sa=Object(vr.a)(Object(vr.a)({},Aa),{transform:ca(0,1)}),wa=Object(vr.a)(Object(vr.a)({},Aa),{default:1}),Ea=Object(vr.a)(Object(vr.a)({},Aa),{transform:Math.round}),xa={borderWidth:va,borderTopWidth:va,borderRightWidth:va,borderBottomWidth:va,borderLeftWidth:va,borderRadius:va,radius:va,borderTopLeftRadius:va,borderTopRightRadius:va,borderBottomRightRadius:va,borderBottomLeftRadius:va,width:va,maxWidth:va,height:va,maxHeight:va,size:va,top:va,right:va,bottom:va,left:va,padding:va,paddingTop:va,paddingRight:va,paddingBottom:va,paddingLeft:va,margin:va,marginTop:va,marginRight:va,marginBottom:va,marginLeft:va,rotate:pa,rotateX:pa,rotateY:pa,rotateZ:pa,scale:wa,scaleX:wa,scaleY:wa,scaleZ:wa,skew:pa,skewX:pa,skewY:pa,distance:va,translateX:va,translateY:va,translateZ:va,x:va,y:va,z:va,perspective:va,transformPerspective:va,opacity:Sa,originX:ba,originY:ba,originZ:va,zIndex:Ea,fillOpacity:Sa,strokeOpacity:Sa,numOctaves:Ea};function Da(e,t,n,i,o,r,a,s){var c,l=e.style,u=e.vars,d=e.transform,m=e.transformKeys,h=e.transformOrigin;m.length=0;var f=!1,p=!1,g=!0;for(var v in t){var C=t[v];if(aa(v))u[v]=C;else{var y=xa[v],b=sa(C,y);if(ea(v)){if(f=!0,d[v]=b,m.push(v),!g)continue;C!==(null!==(c=y.default)&&void 0!==c?c:0)&&(g=!1)}else if(na(v))h[v]=b,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&qr[v]){var A=qr[v].process(C,i,n),S=qr[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)l[S[E]]=A;else l[v]=A}else l[v]=b}}i&&n&&a&&s?(l.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),r&&(l.transform=r(d,l.transform)),l.transformOrigin=s(i)):(f&&(l.transform=function(e,t,n,i){var o=e.transform,r=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,c=t.allowTransformNone,l=void 0===c||c,u="";r.sort(Jr);for(var d=!1,m=r.length,h=0;h<m;h++){var f=r[h];u+=(ra[f]||f)+"("+o[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),i?u=i(o,n?"":u):l&&n&&(u="none"),u}(e,o,g,r)),p&&(l.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,i=e.originY,o=void 0===i?"50%":i,r=e.originZ;return n+" "+o+" "+(void 0===r?0:r)}(h)))}var Ba=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Ta(e,t,n){for(var i in t)oa(t[i])||ia(i,n)||(e[i]=t[i])}function Ia(e,t,n){var i={};return Ta(i,e.style||{},e),Object.assign(i,function(e,t,n){var i=e.transformTemplate;return Object(xo.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Da(e,t,void 0,void 0,{enableHardwareAcceleration:!n},i);var o=e.vars,r=e.style;return Object(vr.a)(Object(vr.a)({},o),r)}),[t])}(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function ka(e,t,n){var i={},o=Ia(e,t,n);return Boolean(e.drag)&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),i.style=o,i}var Oa=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function La(e){return Oa.has(e)}var Pa=function(e){return!La(e)};try{var _a=n(55).default;Pa=function(e){return e.startsWith("on")?!La(e):_a(e)}}catch(e){}function Ra(e,t,n){return"string"==typeof e?e:va.transform(t+n*e)}var Fa=function(e,t){return va.transform(e*t)},Ma={offset:"stroke-dashoffset",array:"stroke-dasharray"},Na={offset:"strokeDashoffset",array:"strokeDasharray"};function Va(e,t,n,i,o,r,a,s){var c=t.attrX,l=t.attrY,u=t.originX,d=t.originY,m=t.pathLength,h=t.pathSpacing,f=void 0===h?1:h,p=t.pathOffset,g=void 0===p?0:p;Da(e,Object(vr.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,o,r,a,s),e.attrs=e.style,e.style={};var v=e.attrs,C=e.style,y=e.dimensions,b=e.totalPathLength;v.transform&&(y&&(C.transform=v.transform),delete v.transform),y&&(void 0!==u||void 0!==d||C.transform)&&(C.transformOrigin=function(e,t,n){return Ra(t,e.x,e.width)+" "+Ra(n,e.y,e.height)}(y,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==c&&(v.x=c),void 0!==l&&(v.y=l),void 0!==b&&void 0!==m&&function(e,t,n,i,o,r){void 0===i&&(i=1),void 0===o&&(o=0),void 0===r&&(r=!0);var a=r?Ma:Na;e[a.offset]=Fa(-o,t);var s=Fa(n,t),c=Fa(i,t);e[a.array]=s+" "+c}(v,b,m,f,g,!1)}var Wa=function(){return Object(vr.a)(Object(vr.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function za(e,t){var n=Object(xo.useMemo)((function(){var n=Wa();return Va(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(vr.a)(Object(vr.a)({},n.attrs),{style:Object(vr.a)({},n.style)})}),[t]);if(e.style){var i={};Ta(i,e.style,e),n.style=Object(vr.a)(Object(vr.a)({},i),n.style)}return n}function ja(e){void 0===e&&(e=!1);return function(t,n,i,o,r){var a=o.latestValues,s=(Qr(t)?za:ka)(n,a,r),c=function(e,t,n){var i={};for(var o in e)(Pa(o)||!0===n&&La(o)||!t&&!La(o))&&(i[o]=e[o]);return i}(n,"string"==typeof t,e),l=Object(vr.a)(Object(vr.a)(Object(vr.a)({},c),s),{ref:i});return Object(xo.createElement)(t,l)}}var Ha=/([a-z])([A-Z])/g,Ua=function(e){return e.replace(Ha,"$1-$2").toLowerCase()};function Za(e,t){var n=t.style,i=t.vars;for(var o in Object.assign(e.style,n),i)e.style.setProperty(o,i[o])}var Ga=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function Ya(e,t){for(var n in Za(e,t),t.attrs)e.setAttribute(Ga.has(n)?n:Ua(n),t.attrs[n])}function Qa(e){var t=e.style,n={};for(var i in t)(oa(t[i])||ia(i,e))&&(n[i]=t[i]);return n}function qa(e){var t=Qa(e);for(var n in e){if(oa(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function Xa(e){return"object"==typeof e&&"function"==typeof e.start}var Ka=function(e){return Array.isArray(e)};function Ja(e){var t,n=oa(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function $a(e,t,n,i){var o=e.scrapeMotionValuesFromProps,r=e.createRenderState,a=e.onMount,s={latestValues:ts(t,n,i,o),renderState:r()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var es=function(e){return function(t,n){var i=Object(xo.useContext)(Er),o=Object(xo.useContext)(xr);return n?$a(e,t,i,o):Dr((function(){return $a(e,t,i,o)}))}};function ts(e,t,n,i){var o={},r=!1===(null==n?void 0:n.initial),a=i(e);for(var s in a)o[s]=Ja(a[s]);var c=e.initial,l=e.animate,u=zr(e),d=jr(e);t&&d&&!u&&!1!==e.inherit&&(null!=c||(c=t.initial),null!=l||(l=t.animate));var m=r||!1===c?l:c;m&&"boolean"!=typeof m&&!Xa(m)&&(Array.isArray(m)?m:[m]).forEach((function(t){var n=Vr(e,t);if(n){var i=n.transitionEnd;n.transition;var r=Object(vr.d)(n,["transitionEnd","transition"]);for(var a in r)o[a]=r[a];for(var a in i)o[a]=i[a]}}));return o}var ns={useVisualState:es({scrapeMotionValuesFromProps:qa,createRenderState:Wa,onMount:function(e,t,n){var i=n.renderState,o=n.latestValues;try{i.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){i.dimensions={x:0,y:0,width:0,height:0}}"path"===t.tagName&&(i.totalPathLength=t.getTotalLength()),Va(i,o,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Ya(t,i)}})};var is,os={useVisualState:es({scrapeMotionValuesFromProps:Qa,createRenderState:Ba})};function rs(e,t,n,i){var o=t.forwardMotionProps,r=void 0!==o&&o,a=Qr(e)?ns:os;return Object(vr.a)(Object(vr.a)({},a),{preloadedFeatures:n,useRender:ja(r),createVisualElement:i,Component:e})}function as(e,t,n,i){return e.addEventListener(t,n,i),function(){return e.removeEventListener(t,n,i)}}function ss(e,t,n,i){Object(xo.useEffect)((function(){var o=e.current;if(n&&o)return as(o,t,n,i)}),[e,t,n,i])}function cs(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function ls(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(is||(is={}));var us={pageX:0,pageY:0};function ds(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||us;return{x:n[t+"X"],y:n[t+"Y"]}}function ms(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function hs(e,t){return void 0===t&&(t="page"),{point:ls(e)?ds(e,t):ms(e,t)}}var fs=function(e,t){void 0===t&&(t=!1);var n,i=function(t){return e(t,hs(t))};return t?(n=i,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):i},ps={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},gs={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function vs(e){return Pr&&null===window.onpointerdown?e:Pr&&null===window.ontouchstart?gs[e]:Pr&&null===window.onmousedown?ps[e]:e}function Cs(e,t,n,i){return as(e,vs(t),fs(n,"pointerdown"===t),i)}function ys(e,t,n,i){return ss(e,vs(t),n&&fs(n,"pointerdown"===t),i)}function bs(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var As=bs("dragHorizontal"),Ss=bs("dragVertical");function ws(e){var t=!1;if("y"===e)t=Ss();else if("x"===e)t=As();else{var n=As(),i=Ss();n&&i?t=function(){n(),i()}:(n&&n(),i&&i())}return t}function Es(){var e=ws(!0);return!e||(e(),!1)}function xs(e,t,n){return function(i,o){var r;cs(i)&&!Es()&&(null==n||n(i,o),null===(r=e.animationState)||void 0===r||r.setActive(is.Hover,t))}}var Ds=function(e,t){return!!t&&(e===t||Ds(e,t.parentElement))};function Bs(e){return Object(xo.useEffect)((function(){return function(){return e()}}),[])}var Ts=function(e,t){return function(n){return t(e(n))}},Is=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(Ts)};var ks=function(e){return function(t){return e(t),null}},Os={tap:ks((function(e){var t=e.onTap,n=e.onTapStart,i=e.onTapCancel,o=e.whileTap,r=e.visualElement,a=t||n||i||o,s=Object(xo.useRef)(!1),c=Object(xo.useRef)(null);function l(){var e;null===(e=c.current)||void 0===e||e.call(c),c.current=null}function u(){var e;return l(),s.current=!1,null===(e=r.animationState)||void 0===e||e.setActive(is.Tap,!1),!Es()}function d(e,n){u()&&(Ds(r.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function m(e,t){u()&&(null==i||i(e,t))}ys(r,"pointerdown",a?function(e,t){var i;l(),s.current||(s.current=!0,c.current=Is(Cs(window,"pointerup",d),Cs(window,"pointercancel",m)),null==n||n(e,t),null===(i=r.animationState)||void 0===i||i.setActive(is.Tap,!0))}:void 0),Bs(l)})),focus:ks((function(e){var t=e.whileFocus,n=e.visualElement;ss(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(is.Focus,!0)}:void 0),ss(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(is.Focus,!1)}:void 0)})),hover:ks((function(e){var t=e.onHoverStart,n=e.onHoverEnd,i=e.whileHover,o=e.visualElement;ys(o,"pointerenter",t||i?xs(o,!0,t):void 0),ys(o,"pointerleave",n||i?xs(o,!1,n):void 0)}))};function Ls(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}var Ps=function(e,t,n){return Math.min(Math.max(n,e),t)},_s=.001;function Rs(e){var t,n,i=e.duration,o=void 0===i?800:i,r=e.bounce,a=void 0===r?.25:r,s=e.velocity,c=void 0===s?0:s,l=e.mass,u=void 0===l?1:l,d=1-a;d=Ps(.05,1,d),o=Ps(.01,10,o/1e3),d<1?(t=function(e){var t=e*d,n=t*o,i=t-c,r=Fs(e,d),a=Math.exp(-n);return _s-i/r*a},n=function(e){var n=e*d*o,i=n*c+c,r=Math.pow(d,2)*Math.pow(e,2)*o,a=Math.exp(-n),s=Fs(Math.pow(e,2),d);return(-t(e)+_s>0?-1:1)*((i-r)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-c)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(c-e))});var m=function(e,t,n){for(var i=n,o=1;o<12;o++)i-=e(i)/t(i);return i}(t,n,5/o);if(o*=1e3,isNaN(m))return{stiffness:100,damping:10,duration:o};var h=Math.pow(m,2)*u;return{stiffness:h,damping:2*d*Math.sqrt(u*h),duration:o}}function Fs(e,t){return e*Math.sqrt(1-t*t)}var Ms=["duration","bounce"],Ns=["stiffness","damping","mass"];function Vs(e,t){return t.some((function(t){return void 0!==e[t]}))}function Ws(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.restSpeed,a=void 0===r?2:r,s=e.restDelta,c=Object(vr.d)(e,["from","to","restSpeed","restDelta"]),l={done:!1,value:n},u=function(e){var t=Object(vr.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Vs(e,Ns)&&Vs(e,Ms)){var n=Rs(e);(t=Object(vr.a)(Object(vr.a)(Object(vr.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(c),d=u.stiffness,m=u.damping,h=u.mass,f=u.velocity,p=u.duration,g=u.isResolvedFromDuration,v=zs,C=zs;function y(){var e=f?-f/1e3:0,t=o-n,i=m/(2*Math.sqrt(d*h)),r=Math.sqrt(d/h)/1e3;if(null!=s||(s=Math.abs(o-n)<=1?.01:.4),i<1){var a=Fs(r,i);v=function(n){var s=Math.exp(-i*r*n);return o-s*((e+i*r*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},C=function(n){var o=Math.exp(-i*r*n);return i*r*o*(Math.sin(a*n)*(e+i*r*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+i*r*t)-a*t*Math.sin(a*n))}}else if(1===i)v=function(n){return o-Math.exp(-r*n)*(t+(e+r*t)*n)};else{var c=r*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*r*n),s=Math.min(c*n,300);return o-a*((e+i*r*t)*Math.sinh(s)+c*t*Math.cosh(s))/c}}}return y(),{next:function(e){var t=v(e);if(g)l.done=e>=p;else{var n=1e3*C(e),i=Math.abs(n)<=a,r=Math.abs(o-t)<=s;l.done=i&&r}return l.value=l.done?o:t,l},flipTarget:function(){var e;f=-f,n=(e=[o,n])[0],o=e[1],y()}}}Ws.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var zs=function(e){return 0},js=function(e,t,n){var i=t-e;return 0===i?1:(n-e)/i},Hs=function(e,t,n){return-n*e+n*t+e},Us=function(e,t){return function(n){return Boolean(ha(n)&&ma.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},Zs=function(e,t,n){return function(i){var o;if(!ha(i))return i;var r=i.match(ua),a=r[0],s=r[1],c=r[2],l=r[3];return(o={})[e]=parseFloat(a),o[t]=parseFloat(s),o[n]=parseFloat(c),o.alpha=void 0!==l?parseFloat(l):1,o}},Gs=ca(0,255),Ys=Object(vr.a)(Object(vr.a)({},Aa),{transform:function(e){return Math.round(Gs(e))}}),Qs={test:Us("rgb","red"),parse:Zs("red","green","blue"),transform:function(e){var t=e.red,n=e.green,i=e.blue,o=e.alpha,r=void 0===o?1:o;return"rgba("+Ys.transform(t)+", "+Ys.transform(n)+", "+Ys.transform(i)+", "+la(Sa.transform(r))+")"}};var qs={test:Us("#"),parse:function(e){var t="",n="",i="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Qs.transform},Xs={test:Us("hsl","hue"),parse:Zs("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,i=e.lightness,o=e.alpha,r=void 0===o?1:o;return"hsla("+Math.round(t)+", "+ga.transform(la(n))+", "+ga.transform(la(i))+", "+la(Sa.transform(r))+")"}},Ks=function(e,t,n){var i=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-i)+i))},Js=[qs,Qs,Xs],$s=function(e){return Js.find((function(t){return t.test(e)}))},ec=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},tc=function(e,t){var n=$s(e),i=$s(t);ec(e),ec(t),n.transform,i.transform;var o=n.parse(e),r=i.parse(t),a=Object(vr.a)({},o),s=n===Xs?Hs:Ks;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],r[t],e));return a.alpha=Hs(o.alpha,r.alpha,e),n.transform(a)}},nc={test:function(e){return Qs.test(e)||qs.test(e)||Xs.test(e)},parse:function(e){return Qs.test(e)?Qs.parse(e):Xs.test(e)?Xs.parse(e):qs.parse(e)},transform:function(e){return ha(e)?e:e.hasOwnProperty("red")?Qs.transform(e):Xs.transform(e)}},ic="${c}",oc="${n}";function rc(e){var t=[],n=0,i=e.match(da);i&&(n=i.length,e=e.replace(da,ic),t.push.apply(t,i.map(nc.parse)));var o=e.match(ua);return o&&(e=e.replace(ua,oc),t.push.apply(t,o.map(Aa.parse))),{values:t,numColors:n,tokenised:e}}function ac(e){return rc(e).values}function sc(e){var t=rc(e),n=t.values,i=t.numColors,o=t.tokenised,r=n.length;return function(e){for(var t=o,n=0;n<r;n++)t=t.replace(n<i?ic:oc,n<i?nc.transform(e[n]):la(e[n]));return t}}var cc=function(e){return"number"==typeof e?0:e};var lc={test:function(e){var t,n,i,o;return isNaN(e)&&ha(e)&&(null!==(n=null===(t=e.match(ua))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(o=null===(i=e.match(da))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:ac,createTransformer:sc,getAnimatableNone:function(e){var t=ac(e);return sc(e)(t.map(cc))}},uc=function(e){return"number"==typeof e};function dc(e,t){return uc(e)?function(n){return Hs(e,t,n)}:nc.test(e)?tc(e,t):pc(e,t)}var mc=function(e,t){var n=Object(vr.e)([],e),i=n.length,o=e.map((function(e,n){return dc(e,t[n])}));return function(e){for(var t=0;t<i;t++)n[t]=o[t](e);return n}},hc=function(e,t){var n=Object(vr.a)(Object(vr.a)({},e),t),i={};for(var o in n)void 0!==e[o]&&void 0!==t[o]&&(i[o]=dc(e[o],t[o]));return function(e){for(var t in i)n[t]=i[t](e);return n}};function fc(e){for(var t=lc.parse(e),n=t.length,i=0,o=0,r=0,a=0;a<n;a++)i||"number"==typeof t[a]?i++:void 0!==t[a].hue?r++:o++;return{parsed:t,numNumbers:i,numRGB:o,numHSL:r}}var pc=function(e,t){var n=lc.createTransformer(t),i=fc(e),o=fc(t);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&(i.numNumbers,o.numNumbers),Is(mc(i.parsed,o.parsed),n)},gc=function(e,t){return function(n){return Hs(e,t,n)}};function vc(e,t,n){for(var i,o=[],r=n||("number"==typeof(i=e[0])?gc:"string"==typeof i?nc.test(i)?tc:pc:Array.isArray(i)?mc:"object"==typeof i?hc:void 0),a=e.length-1,s=0;s<a;s++){var c=r(e[s],e[s+1]);if(t){var l=Array.isArray(t)?t[s]:t;c=Is(l,c)}o.push(c)}return o}function Cc(e,t,n){var i=void 0===n?{}:n,o=i.clamp,r=void 0===o||o,a=i.ease,s=i.mixer,c=e.length;t.length,!a||!Array.isArray(a)||a.length,e[0]>e[c-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var l=vc(t,a,s),u=2===c?function(e,t){var n=e[0],i=e[1],o=t[0];return function(e){return o(js(n,i,e))}}(e,l):function(e,t){var n=e.length,i=n-1;return function(o){var r=0,a=!1;if(o<=e[0]?a=!0:o>=e[i]&&(r=i-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>o||s===i);s++);r=s-1}var c=js(e[r],e[r+1],o);return t[r](c)}}(e,l);return r?function(t){return u(Ps(e[0],e[c-1],t))}:u}var yc,bc=function(e){return function(t){return 1-e(1-t)}},Ac=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Sc=function(e){return function(t){return t*t*((e+1)*t-e)}},wc=function(e){return e},Ec=(yc=2,function(e){return Math.pow(e,yc)}),xc=bc(Ec),Dc=Ac(Ec),Bc=function(e){return 1-Math.sin(Math.acos(e))},Tc=bc(Bc),Ic=Ac(Tc),kc=Sc(1.525),Oc=bc(kc),Lc=Ac(kc),Pc=function(e){var t=Sc(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),_c=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},Rc=bc(_c);function Fc(e,t){return e.map((function(){return t||Dc})).splice(0,e.length-1)}function Mc(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.ease,a=e.offset,s=e.duration,c=void 0===s?300:s,l={done:!1,value:n},u=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===u.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(u),c);function m(){return Cc(d,u,{ease:Array.isArray(r)?r:Fc(u,r)})}var h=m();return{next:function(e){return l.value=h(e),l.done=e>=c,l},flipTarget:function(){u.reverse(),h=m()}}}var Nc={keyframes:Mc,spring:Ws,decay:function(e){var t=e.velocity,n=void 0===t?0:t,i=e.from,o=void 0===i?0:i,r=e.power,a=void 0===r?.8:r,s=e.timeConstant,c=void 0===s?350:s,l=e.restDelta,u=void 0===l?.5:l,d=e.modifyTarget,m={done:!1,value:o},h=a*n,f=o+h,p=void 0===d?f:d(f);return p!==f&&(h=p-o),{next:function(e){var t=-h*Math.exp(-e/c);return m.done=!(t>u||t<-u),m.value=m.done?p:p+t,m},flipTarget:function(){}}}};var Vc=1/60*1e3,Wc="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},zc="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Wc())}),Vc)};var jc=!0,Hc=!1,Uc=!1,Zc={delta:0,timestamp:0},Gc=["read","update","preRender","render","postRender"],Yc=Gc.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],i=0,o=!1,r=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var c=s&&o,l=c?t:n;return a&&r.add(e),-1===l.indexOf(e)&&(l.push(e),c&&o&&(i=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),r.delete(e)},process:function(s){var c;if(o=!0,t=(c=[n,t])[0],(n=c[1]).length=0,i=t.length)for(var l=0;l<i;l++){var u=t[l];u(s),r.has(u)&&(a.schedule(u),e())}o=!1}};return a}((function(){return Hc=!0})),e}),{}),Qc=Gc.reduce((function(e,t){var n=Yc[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),Hc||$c(),n.schedule(e,t,i)},e}),{}),qc=Gc.reduce((function(e,t){return e[t]=Yc[t].cancel,e}),{}),Xc=Gc.reduce((function(e,t){return e[t]=function(){return Yc[t].process(Zc)},e}),{}),Kc=function(e){return Yc[e].process(Zc)},Jc=function(e){Hc=!1,Zc.delta=jc?Vc:Math.max(Math.min(e-Zc.timestamp,40),1),Zc.timestamp=e,Uc=!0,Gc.forEach(Kc),Uc=!1,Hc&&(jc=!1,zc(Jc))},$c=function(){Hc=!0,jc=!0,Uc||zc(Jc)},el=function(){return Zc},tl=Qc;function nl(e,t,n){return void 0===n&&(n=0),e-t-n}var il=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return tl.update(t,!0)},stop:function(){return qc.update(t)}}};function ol(e){var t,n,i,o,r,a=e.from,s=e.autoplay,c=void 0===s||s,l=e.driver,u=void 0===l?il:l,d=e.elapsed,m=void 0===d?0:d,h=e.repeat,f=void 0===h?0:h,p=e.repeatType,g=void 0===p?"loop":p,v=e.repeatDelay,C=void 0===v?0:v,y=e.onPlay,b=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(vr.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),x=E.to,D=0,B=E.duration,T=!1,I=!0,k=function(e){if(Array.isArray(e.to))return Mc;if(Nc[e.type])return Nc[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Mc:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Ws:Mc}(E);(null===(n=(t=k).needsInterpolation)||void 0===n?void 0:n.call(t,a,x))&&(r=Cc([0,100],[a,x],{clamp:!1}),a=0,x=100);var O=k(Object(vr.a)(Object(vr.a)({},E),{from:a,to:x}));function L(){D++,"reverse"===g?m=function(e,t,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?nl(t+-e,t,n):t-(e-t)+n}(m,B,C,I=D%2==0):(m=nl(m,B,C),"mirror"===g&&O.flipTarget()),T=!1,S&&S()}function P(e){if(I||(e=-e),m+=e,!T){var t=O.next(Math.max(0,m));o=t.value,r&&(o=r(o)),T=I?t.done:m<=0}null==w||w(o),T&&(0===D&&(null!=B||(B=m)),D<f?function(e,t,n,i){return i?e>=t+n:e<=-n}(m,B,C,I)&&L():(i.stop(),A&&A()))}return c&&(null==y||y(),(i=u(P)).start()),{stop:function(){null==b||b(),i.stop()}}}function rl(e,t){return t?e*(1e3/t):0}var al=function(e){return 1e3*e},sl=function(e,t){return 1-3*t+3*e},cl=function(e,t){return 3*t-6*e},ll=function(e){return 3*e},ul=function(e,t,n){return((sl(t,n)*e+cl(t,n))*e+ll(t))*e},dl=function(e,t,n){return 3*sl(t,n)*e*e+2*cl(t,n)*e+ll(t)};var ml=.1;function hl(e,t,n,i){if(e===t&&n===i)return wc;for(var o=new Float32Array(11),r=0;r<11;++r)o[r]=ul(r*ml,e,n);function a(t){for(var i=0,r=1;10!==r&&o[r]<=t;++r)i+=ml;--r;var a=i+(t-o[r])/(o[r+1]-o[r])*ml,s=dl(a,e,n);return s>=.001?function(e,t,n,i){for(var o=0;o<8;++o){var r=dl(t,n,i);if(0===r)return t;t-=(ul(t,n,i)-e)/r}return t}(t,a,e,n):0===s?a:function(e,t,n,i,o){var r,a,s=0;do{(r=ul(a=t+(n-t)/2,i,o)-e)>0?n=a:t=a}while(Math.abs(r)>1e-7&&++s<10);return a}(t,i,i+ml,e,n)}return function(e){return 0===e||1===e?e:ul(a(e),t,i)}}var fl={linear:wc,easeIn:Ec,easeInOut:Dc,easeOut:xc,circIn:Bc,circInOut:Ic,circOut:Tc,backIn:kc,backInOut:Lc,backOut:Oc,anticipate:Pc,bounceIn:Rc,bounceInOut:function(e){return e<.5?.5*(1-_c(1-2*e)):.5*_c(2*e-1)+.5},bounceOut:_c},pl=function(e){if(Array.isArray(e)){e.length;var t=Object(vr.c)(e,4);return hl(t[0],t[1],t[2],t[3])}return"string"==typeof e?fl[e]:e},gl=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!lc.test(t)||t.startsWith("url(")))},vl=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Cl=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},yl=function(){return{type:"keyframes",ease:"linear",duration:.3}},bl=function(e){return{type:"keyframes",duration:.8,values:e}},Al={x:vl,y:vl,z:vl,rotate:vl,rotateX:vl,rotateY:vl,rotateZ:vl,scaleX:Cl,scaleY:Cl,scale:Cl,opacity:yl,backgroundColor:yl,color:yl,default:Cl},Sl=new Set(["brightness","contrast","saturate","opacity"]);function wl(e){var t=e.slice(0,-1).split("("),n=t[0],i=t[1];if("drop-shadow"===n)return e;var o=(i.match(ua)||[])[0];if(!o)return e;var r=i.replace(o,""),a=Sl.has(n)?1:0;return o!==i&&(a*=100),n+"("+a+r+")"}var El=/([a-z-]*)\(.*?\)/g,xl=Object(vr.a)(Object(vr.a)({},lc),{getAnimatableNone:function(e){var t=e.match(El);return t?t.map(wl).join(" "):e}}),Dl=Object(vr.a)(Object(vr.a)({},xa),{color:nc,backgroundColor:nc,outlineColor:nc,fill:nc,stroke:nc,borderColor:nc,borderTopColor:nc,borderRightColor:nc,borderBottomColor:nc,borderLeftColor:nc,filter:xl,WebkitFilter:xl}),Bl=function(e){return Dl[e]};function Tl(e,t){var n,i=Bl(e);return i!==xl&&(i=lc),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,t)}function Il(e){var t=e.ease,n=e.times,i=e.yoyo,o=e.flip,r=e.loop,a=Object(vr.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(vr.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=al(a.duration)),a.repeatDelay&&(s.repeatDelay=al(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(pl):pl(t)),"tween"===a.type&&(s.type="keyframes"),(i||r||o)&&(!0,i?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||i||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function kl(e,t,n){var i,o,r,a;return Array.isArray(t.to)&&(null!==(i=e.duration)&&void 0!==i||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Object(vr.e)([],Object(vr.c)(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Object(vr.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(vr.a)(Object(vr.a)({},e),(o=n,r=t.to,a=Ka(r)?bl:Al[o]||Al.default,Object(vr.a)({to:r},a(r))))),Object(vr.a)(Object(vr.a)({},t),Il(e))}function Ol(e,t,n,i,o){var r,a=_l(i,e),s=null!==(r=a.from)&&void 0!==r?r:t.get(),c=gl(e,n);"none"===s&&c&&"string"==typeof n?s=Tl(e,n):Ll(s)&&"string"==typeof n?s=Pl(n):!Array.isArray(n)&&Ll(n)&&"string"==typeof s&&(n=Pl(s));var l=gl(e,s);return l&&c&&!1!==a.type?function(){var i={from:s,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,i=void 0===n?0:n,o=e.velocity,r=void 0===o?0:o,a=e.min,s=e.max,c=e.power,l=void 0===c?.8:c,u=e.timeConstant,d=void 0===u?750:u,m=e.bounceStiffness,h=void 0===m?500:m,f=e.bounceDamping,p=void 0===f?10:f,g=e.restDelta,v=void 0===g?1:g,C=e.modifyTarget,y=e.driver,b=e.onUpdate,A=e.onComplete;function S(e){return void 0!==a&&e<a||void 0!==s&&e>s}function w(e){return void 0===a?s:void 0===s||Math.abs(a-e)<Math.abs(s-e)?a:s}function E(e){null==t||t.stop(),t=ol(Object(vr.a)(Object(vr.a)({},e),{driver:y,onUpdate:function(t){var n;null==b||b(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function x(e){E(Object(vr.a)({type:"spring",stiffness:h,damping:p,restDelta:v},e))}if(S(i))x({from:i,velocity:r,to:w(i)});else{var D=l*r+i;"undefined"!=typeof C&&(D=C(D));var B,T,I=w(D),k=I===a?-1:1;E({type:"decay",from:i,velocity:r,timeConstant:d,power:l,restDelta:v,modifyTarget:C,onUpdate:S(D)?function(e){B=T,T=e,r=rl(e-B,el().delta),(1===k&&e>I||-1===k&&e<I)&&x({from:e,to:I,velocity:r})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(vr.a)(Object(vr.a)({},i),a)):ol(Object(vr.a)(Object(vr.a)({},kl(a,i,e)),{onUpdate:function(e){var t;i.onUpdate(e),null===(t=a.onUpdate)||void 0===t||t.call(a,e)},onComplete:function(){var e;i.onComplete(),null===(e=a.onComplete)||void 0===e||e.call(a)}}))}:function(){var e;return t.set(n),o(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function Ll(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Pl(e){return"number"==typeof e?0:Tl("",e)}function _l(e,t){return e[t]||e.default||e}function Rl(e,t,n,i){return void 0===i&&(i={}),t.start((function(o){var r,a,s=Ol(e,t,n,i,o),c=function(e,t){var n;return null!==(n=(_l(e,t)||{}).delay)&&void 0!==n?n:0}(i,e),l=function(){return a=s()};return c?r=setTimeout(l,al(c)):l(),function(){clearTimeout(r),null==a||a.stop()}}))}function Fl(e,t){-1===e.indexOf(t)&&e.push(t)}function Ml(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var Nl=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return Fl(this.subscriptions,e),function(){return Ml(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(var o=0;o<i;o++){var r=this.subscriptions[o];r&&r(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),Vl=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Nl,this.velocityUpdateSubscribers=new Nl,this.renderSubscribers=new Nl,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var i=el(),o=i.delta,r=i.timestamp;n.lastUpdated!==r&&(n.timeDelta=o,n.lastUpdated=r,tl.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return tl.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t)))}return e.prototype.onChange=function(e){return this.updateSubscribers.add(e)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(e){return e(this.get()),this.renderSubscribers.add(e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?rl(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function Wl(e){return new Vl(e)}var zl=function(e){return function(t){return t.test(e)}},jl=[Aa,va,ga,pa,ya,Ca,{test:function(e){return"auto"===e},parse:function(e){return e}}],Hl=function(e){return jl.find(zl(e))},Ul=Object(vr.e)(Object(vr.e)([],Object(vr.c)(jl)),[nc,lc]),Zl=function(e){return Ul.find(zl(e))};function Gl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wl(n))}function Yl(e,t){var n=Wr(e,t),i=n?e.makeTargetAnimatable(n,!1):{},o=i.transitionEnd,r=void 0===o?{}:o;i.transition;var a,s=Object(vr.d)(i,["transitionEnd","transition"]);for(var c in s=Object(vr.a)(Object(vr.a)({},s),r)){Gl(e,c,(a=s[c],Ka(a)?a[a.length-1]||0:a))}}function Ql(e,t){if(t)return(t[e]||t.default||t).from}function ql(e,t,n){var i;void 0===n&&(n={});var o=Wr(e,t,n.custom),r=(o||{}).transition,a=void 0===r?e.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=o?function(){return Xl(e,o,n)}:function(){return Promise.resolve()},c=(null===(i=e.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var o=a.delayChildren,r=void 0===o?0:o,s=a.staggerChildren,c=a.staggerDirection;return function(e,t,n,i,o,r){void 0===n&&(n=0);void 0===i&&(i=0);void 0===o&&(o=1);var a=[],s=(e.variantChildren.size-1)*i,c=1===o?function(e){return void 0===e&&(e=0),e*i}:function(e){return void 0===e&&(e=0),s-e*i};return Array.from(e.variantChildren).sort(Kl).forEach((function(e,i){a.push(ql(e,t,Object(vr.a)(Object(vr.a)({},r),{delay:n+c(i)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,r+i,s,c,n)}:function(){return Promise.resolve()},l=a.when;if(l){var u=Object(vr.c)("beforeChildren"===l?[s,c]:[c,s],2),d=u[0],m=u[1];return d().then(m)}return Promise.all([s(),c(n.delay)])}function Xl(e,t,n){var i,o=void 0===n?{}:n,r=o.delay,a=void 0===r?0:r,s=o.transitionOverride,c=o.type,l=e.makeTargetAnimatable(t),u=l.transition,d=void 0===u?e.getDefaultTransition():u,m=l.transitionEnd,h=Object(vr.d)(l,["transition","transitionEnd"]);s&&(d=s);var f=[],p=c&&(null===(i=e.animationState)||void 0===i?void 0:i.getState()[c]);for(var g in h){var v=e.getValue(g),C=h[g];if(!(!v||void 0===C||p&&Jl(p,g))){var y=Rl(g,v,C,Object(vr.a)({delay:a},d));f.push(y)}}return Promise.all(f).then((function(){m&&Yl(e,m)}))}function Kl(e,t){return e.sortNodePosition(t)}function Jl(e,t){var n=e.protectedKeys,i=e.needsAnimating,o=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,o}var $l=[is.Animate,is.Hover,is.Tap,is.Drag,is.Focus,is.Exit],eu=Object(vr.e)([],Object(vr.c)($l)).reverse(),tu=$l.length;function nu(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,i=t.options;return function(e,t,n){var i;if(void 0===n&&(n={}),e.notifyAnimationStart(),Array.isArray(t)){var o=t.map((function(t){return ql(e,t,n)}));i=Promise.all(o)}else if("string"==typeof t)i=ql(e,t,n);else{var r="function"==typeof t?Wr(e,t,n.custom):t;i=Xl(e,r,n)}return i.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,i)})))}}function iu(e){var t,n=nu(e),i=((t={})[is.Animate]=ou(!0),t[is.Hover]=ou(),t[is.Tap]=ou(),t[is.Drag]=ou(),t[is.Focus]=ou(),t[is.Exit]=ou(),t),o={},r=!0,a=function(t,n){var i=Wr(e,n);if(i){i.transition;var o=i.transitionEnd,r=Object(vr.d)(i,["transition","transitionEnd"]);t=Object(vr.a)(Object(vr.a)(Object(vr.a)({},t),r),o)}return t};function s(t,s){for(var c,l=e.getProps(),u=e.getVariantContext(!0)||{},d=[],m=new Set,h={},f=1/0,p=function(n){var o=eu[n],p=i[o],g=null!==(c=l[o])&&void 0!==c?c:u[o],v=Nr(g),C=o===s?p.isActive:null;!1===C&&(f=n);var y=g===u[o]&&g!==l[o]&&v;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys=Object(vr.a)({},h),!p.isActive&&null===C||!g&&!p.prevProp||Xa(g)||"boolean"==typeof g)return"continue";var b=function(e,t){if("string"==typeof t)return t!==e;if(Mr(t))return!Ls(t,e);return!1}(p.prevProp,g)||o===s&&p.isActive&&!y&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===C&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,x=Object(vr.a)(Object(vr.a)({},E),S),D=function(e){b=!0,m.delete(e),p.needsAnimating[e]=!0};for(var B in x){var T=S[B],I=E[B];h.hasOwnProperty(B)||(T!==I?Ka(T)&&Ka(I)?Ls(T,I)?p.protectedKeys[B]=!0:D(B):void 0!==T?D(B):m.add(B):void 0!==T&&m.has(B)?D(B):p.protectedKeys[B]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(h=Object(vr.a)(Object(vr.a)({},h),S)),r&&e.blockInitialAnimation&&(b=!1),b&&!y&&d.push.apply(d,Object(vr.e)([],Object(vr.c)(A.map((function(e){return{animation:e,options:Object(vr.a)({type:o},t)}})))))},g=0;g<tu;g++)p(g);if(o=Object(vr.a)({},h),m.size){var v={};m.forEach((function(t){var n=e.getBaseTarget(t);void 0!==n&&(v[t]=n)})),d.push({animation:v})}var C=Boolean(d.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==o[e]},animateChanges:s,setActive:function(t,n,o){var r;return i[t].isActive===n?Promise.resolve():(null===(r=e.variantChildren)||void 0===r||r.forEach((function(e){var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)})),i[t].isActive=n,s(o,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return i}}}function ou(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var ru={animation:ks((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=iu(t)),Xa(n)&&Object(xo.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:ks((function(e){var t=e.custom,n=e.visualElement,i=Object(vr.c)(Br(),2),o=i[0],r=i[1],a=Object(xo.useContext)(xr);Object(xo.useEffect)((function(){var e,i,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(is.Exit,!o,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:t});!o&&(null==s||s.then(r))}),[o])}))},au=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},su=function(e){return au(e)&&e.hasOwnProperty("z")},cu=function(e,t){return Math.abs(e-t)};function lu(e,t){if(uc(e)&&uc(t))return cu(e,t);if(au(e)&&au(t)){var n=cu(e.x,t.x),i=cu(e.y,t.y),o=su(e)&&su(t)?cu(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}var uu=function(){function e(e,t,n){var i=this,o=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var e=hu(i.lastMoveEventInfo,i.history),t=null!==i.startEvent,n=lu(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,r=el().timestamp;i.history.push(Object(vr.a)(Object(vr.a)({},o),{timestamp:r}));var a=i.handlers,s=a.onStart,c=a.onMove;t||(s&&s(i.lastMoveEvent,e),i.startEvent=i.lastMoveEvent),c&&c(i.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){i.lastMoveEvent=e,i.lastMoveEventInfo=du(t,i.transformPagePoint),cs(e)&&0===e.buttons?i.handlePointerUp(e,t):tl.update(i.updatePoint,!0)},this.handlePointerUp=function(e,t){i.end();var n=i.handlers,o=n.onEnd,r=n.onSessionEnd,a=hu(du(t,i.transformPagePoint),i.history);i.startEvent&&o&&o(e,a),r&&r(e,a)},!(ls(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var r=du(hs(e),this.transformPagePoint),a=r.point,s=el().timestamp;this.history=[Object(vr.a)(Object(vr.a)({},a),{timestamp:s})];var c=t.onSessionStart;c&&c(e,hu(r,this.history)),this.removeListeners=Is(Cs(window,"pointermove",this.handlePointerMove),Cs(window,"pointerup",this.handlePointerUp),Cs(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),qc.update(this.updatePoint)},e}();function du(e,t){return t?{point:t(e.point)}:e}function mu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hu(e,t){var n=e.point;return{point:n,delta:mu(n,pu(t)),offset:mu(n,fu(t)),velocity:gu(t,.1)}}function fu(e){return e[0]}function pu(e){return e[e.length-1]}function gu(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,i=null,o=pu(e);n>=0&&(i=e[n],!(o.timestamp-i.timestamp>al(t)));)n--;if(!i)return{x:0,y:0};var r=(o.timestamp-i.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function vu(e){return e}function Cu(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var yu={translate:0,scale:1,origin:0,originPoint:0};function bu(){return{x:Object(vr.a)({},yu),y:Object(vr.a)({},yu)}}function Au(e){return[e("x"),e("y")]}function Su(e,t,n){var i=t.min,o=t.max;return void 0!==i&&e<i?e=n?Hs(i,e,n.min):Math.max(e,i):void 0!==o&&e>o&&(e=n?Hs(o,e,n.max):Math.min(e,o)),e}function wu(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Eu(e,t){var n,i=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&(i=(n=Object(vr.c)([o,i],2))[0],o=n[1]),{min:e.min+i,max:e.min+o}}function xu(e,t,n){return{min:Du(e,t),max:Du(e,n)}}function Du(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function Bu(e,t){return Cu(function(e,t){var n=e.top,i=e.left,o=e.bottom,r=e.right;void 0===t&&(t=vu);var a=t({x:i,y:n}),s=t({x:r,y:o});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function Tu(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),lu(e,t)<n}function Iu(e){return e.max-e.min}function ku(e,t){var n=.5,i=Iu(e),o=Iu(t);return o>i?n=js(t.min,t.max-i,e.min):i>o&&(n=js(e.min,e.max-o,t.min)),Ps(0,1,n)}function Ou(e,t,n,i){void 0===i&&(i=.5),e.origin=i,e.originPoint=Hs(t.min,t.max,e.origin),e.scale=Iu(n)/Iu(t),Tu(e.scale,1,1e-4)&&(e.scale=1),e.translate=Hs(n.min,n.max,e.origin)-e.originPoint,Tu(e.translate)&&(e.translate=0)}function Lu(e,t,n,i){Ou(e.x,t.x,n.x,Pu(i.originX)),Ou(e.y,t.y,n.y,Pu(i.originY))}function Pu(e){return"number"==typeof e?e:.5}function _u(e,t,n){e.min=n.min+t.min,e.max=e.min+Iu(t)}var Ru=function(e,t){return e.depth-t.depth};function Fu(e){return e.projection.isEnabled||e.shouldResetTransform()}function Mu(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Mu(n,t),Fu(e)&&t.push(e),t}function Nu(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Object(vr.a)({},t.x),y:Object(vr.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),tl.update((function(){return e.rebaseProjectionTarget()}))}}function Vu(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Wu(e,t){return{x:Vu(e.x,t.x),y:Vu(e.y,t.y)}}function zu(e,t){var n=e.getLayoutId(),i=t.getLayoutId();return n!==i||void 0===i&&e!==t}function ju(e){var t=e.getProps(),n=t.drag,i=t._dragX;return n&&!i}function Hu(e,t){e.min=t.min,e.max=t.max}function Uu(e,t,n){return n+t*(e-n)}function Zu(e,t,n,i,o){return void 0!==o&&(e=Uu(e,o,i)),Uu(e,n,i)+t}function Gu(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),e.min=Zu(e.min,t,n,i,o),e.max=Zu(e.max,t,n,i,o)}function Yu(e,t){var n=t.x,i=t.y;Gu(e.x,n.translate,n.scale,n.originPoint),Gu(e.y,i.translate,i.scale,i.originPoint)}function Qu(e,t,n,i){var o=Object(vr.c)(i,3),r=o[0],a=o[1],s=o[2];e.min=t.min,e.max=t.max;var c=void 0!==n[s]?n[s]:.5,l=Hs(t.min,t.max,c);Gu(e,n[r],n[a],l,n.scale)}var qu=["x","scaleX","originX"],Xu=["y","scaleY","originY"];function Ku(e,t,n){Qu(e.x,t.x,n,qu),Qu(e.y,t.y,n,Xu)}function Ju(e,t,n,i,o){return e=Uu(e-=t,1/n,i),void 0!==o&&(e=Uu(e,1/o,i)),e}function $u(e,t,n){var i=Object(vr.c)(n,3),o=i[0],r=i[1],a=i[2];!function(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),void 0===i&&(i=.5);var r=Hs(e.min,e.max,i)-t;e.min=Ju(e.min,t,n,r,o),e.max=Ju(e.max,t,n,r,o)}(e,t[o],t[r],t[a],t.scale)}function ed(e,t){$u(e.x,t,qu),$u(e.y,t,Xu)}var td=new Set;function nd(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function id(e){return td.add(e),function(){return td.delete(e)}}function od(){if(td.size){var e=0,t=[[]],n=[],i=function(n){return nd(t,n,e)},o=function(t){nd(n,t,e),e++};td.forEach((function(t){t(i,o),e=0})),td.clear();for(var r=n.length,a=0;a<=r;a++)t[a]&&t[a].forEach(ad),n[a]&&n[a].forEach(ad)}}var rd,ad=function(e){return e()},sd=new WeakMap,cd=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),sd.set(t,this)}return e.prototype.start=function(e,t){var n=this,i=void 0===t?{}:t,o=i.snapToCursor,r=void 0!==o&&o,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new uu(e,{onSessionStart:function(e){var t;n.stopMotion();var i=function(e){return hs(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=id((function(e,t){var o=Mu(n.visualElement),s=function(e){var t=[],n=function(e){Fu(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(Ru)}(n.visualElement),c=Object(vr.e)(Object(vr.e)([],Object(vr.c)(o)),Object(vr.c)(s)),l=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){c.forEach((function(e){return e.resetTransform()}))})),e((function(){Nu(n.visualElement),s.forEach(Nu)})),t((function(){c.forEach((function(e){return e.restoreTransform()})),r&&(l=n.snapToCursor(i))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;Au((function(t){if(!l){var o=e.target[t],r=o.min,s=o.max;n.cursorProgress[t]=a?a[t]:js(r,s,i[t])}var c=n.getAxisMotionValue(t);c&&(n.originPoint[t]=c.get())}))})),t((function(){Xc.update(),Xc.preRender(),Xc.render(),Xc.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var i,o,r,a=n.props,s=a.drag,c=a.dragPropagation;(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=ws(s),n.openGlobalLock))&&(od(),n.isDragging=!0,n.currentDirection=null,null===(o=(i=n.props).onDragStart)||void 0===o||o.call(i,e,t),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(is.Drag,!0))},onMove:function(e,t){var i,o,r,a,s=n.props,c=s.dragPropagation,l=s.dragDirectionLock;if(c||n.openGlobalLock){var u=t.offset;if(l&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(o=(i=n.props).onDirectionLock)||void 0===o||o.call(i,n.currentDirection)));n.updateAxis("x",t.point,u),n.updateAxis("y",t.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,e,t),rd=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,i=t.dragElastic,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Fr(n)?this.resolveRefConstraints(o,n):function(e,t){var n=t.top,i=t.left,o=t.bottom,r=t.right;return{x:wu(e.x,i,r),y:wu(e.y,n,o)}}(o,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:xu(e,"left","right"),y:xu(e,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&Au((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(o[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,i=n.onMeasureDragConstraints,o=n.transformPagePoint,r=t.current;this.constraintsBox=Bu(r,o);var a=function(e,t){return{x:Eu(e.x,t.x),y:Eu(e.y,t.y)}}(e,this.constraintsBox);if(i){var s=i(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Cu(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(is.Drag,!1)},e.prototype.stop=function(e,t){var n,i,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=t.velocity;this.animateDragEnd(a),null===(o=(i=this.props).onDragEnd)||void 0===o||o.call(i,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return Au((function(n){if(ld(n,t.props.drag,t.currentDirection)){var i=t.getAxisMotionValue(n);if(!i)return t.cursorProgress[n]=.5,!0;var o=t.visualElement.getLayoutState().layout,r=o[n].max-o[n].min,a=o[n].min+r/2,s=e[n]-a;t.originPoint[n]=e[n],i.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(ld(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var i=this.originPoint[e]+t[e],o=this.constraints?Su(i,this.constraints[e],this.elastic[e]):i;n.set(o)}},e.prototype.updateVisualElementAxis=function(e,t){var n,i=this.visualElement.getLayoutState().layout[e],o=i.max-i.min,r=this.cursorProgress[e],a=function(e,t,n,i,o){var r=e-t*n;return i?Su(r,i,o):r}(t[e],o,r,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+o)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,i=e.dragDirectionLock,o=void 0!==i&&i,r=e.dragPropagation,a=void 0!==r&&r,s=e.dragConstraints,c=void 0!==s&&s,l=e.dragElastic,u=void 0===l?.35:l,d=e.dragMomentum,m=void 0===d||d,h=Object(vr.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(vr.a)({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:c,dragElastic:u,dragMomentum:m},h)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,i=t.layoutId,o="_drag"+e.toUpperCase();return this.props[o]?this.props[o]:n||void 0!==i?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,i=n.drag,o=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,i=e.getProjectionParent();return!!i&&(t?ed(n=Wu(i.projection.target,e.projection.target),i.getLatestValues()):n=Wu(i.getLayoutState().layout,e.getLayoutState().layout),Au((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),c=this.constraints||{};if(s&&Object.keys(c).length&&this.isLayoutDrag()){var l=this.visualElement.getProjectionParent();if(l){var u=Wu(l.projection.targetFinal,c);Au((function(e){var t=u[e],n=t.min,i=t.max;c[e]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=Au((function(n){var l;if(ld(n,i,t.currentDirection)){var u=null!==(l=null==c?void 0:c[n])&&void 0!==l?l:{},d=r?200:1e6,m=r?40:1e7,h=Object(vr.a)(Object(vr.a)({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),u);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,h):t.visualElement.startLayoutAnimation(n,h,s)}}));return Promise.all(d).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;Au((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var i=n.get();return n.set(i),n.set(i),Rl(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(Fr(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};Au((function(t){i[t]=ku(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){Au((function(t){if(ld(t,n,null)){var o=function(e,t,n){var i=e.max-e.min,o=Hs(t.min,t.max-i,n);return{min:o,max:o+i}}(e.visualElement.projection.target[t],e.constraintsBox[t],i[t]),r=o.min,a=o.max;e.visualElement.setProjectionTargetAxis(t,r,a)}}))})),setTimeout(od,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=id((function(n,i){var o=Mu(t.visualElement);i((function(){return o.forEach((function(e){return e.resetTransform()}))})),n((function(){return Nu(t.visualElement)})),i((function(){return o.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&i(e)}))},e.prototype.mount=function(e){var t=this,n=Cs(e.getInstance(),"pointerdown",(function(e){var n=t.props,i=n.drag,o=n.dragListener;i&&(void 0===o||o)&&t.start(e)})),i=as(window,"resize",(function(){t.scalePoint()})),o=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),r=e.prevDragCursor;return r&&this.start(rd,{cursorProgress:r}),function(){null==n||n(),null==i||i(),null==o||o(),t.cancelDrag()}},e}();function ld(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var ud,dd,md={pan:ks((function(e){var t=e.onPan,n=e.onPanStart,i=e.onPanEnd,o=e.onPanSessionStart,r=e.visualElement,a=t||n||i||o,s=Object(xo.useRef)(null),c=Object(xo.useContext)(wr).transformPagePoint,l={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,i&&i(e,t)}};Object(xo.useEffect)((function(){null!==s.current&&s.current.updateHandlers(l)})),ys(r,"pointerdown",a&&function(e){s.current=new uu(e,l,{transformPagePoint:c})}),Bs((function(){return s.current&&s.current.end()}))})),drag:ks((function(e){var t=e.dragControls,n=e.visualElement,i=Object(xo.useContext)(wr).transformPagePoint,o=Dr((function(){return new cd({visualElement:n})}));o.setProps(Object(vr.a)(Object(vr.a)({},e),{transformPagePoint:i})),Object(xo.useEffect)((function(){return t&&t.subscribe(o)}),[o]),Object(xo.useEffect)((function(){return o.mount(n)}),[])}))};function hd(e){return"string"==typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(ud||(ud={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(dd||(dd={}));var fd=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function pd(e,t,n){void 0===n&&(n=1);var i=Object(vr.c)(function(e){var t=fd.exec(e);if(!t)return[,];var n=Object(vr.c)(t,3);return[n[1],n[2]]}(e),2),o=i[0],r=i[1];if(o){var a=window.getComputedStyle(t).getPropertyValue(o);return a?a.trim():hd(r)?pd(r,t,n+1):r}}function gd(e,t){return e/(t.max-t.min)*100}var vd="_$css";var Cd={process:function(e,t,n){var i=n.target;if("string"==typeof e){if(!va.test(e))return e;e=parseFloat(e)}return gd(e,i.x)+"% "+gd(e,i.y)+"%"}},yd={borderRadius:Object(vr.a)(Object(vr.a)({},Cd),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Cd,borderTopRightRadius:Cd,borderBottomLeftRadius:Cd,borderBottomRightRadius:Cd,boxShadow:{process:function(e,t){var n=t.delta,i=t.treeScale,o=e,r=e.includes("var("),a=[];r&&(e=e.replace(fd,(function(e){return a.push(e),vd})));var s=lc.parse(e);if(s.length>5)return o;var c=lc.createTransformer(e),l="number"!=typeof s[0]?1:0,u=n.x.scale*i.x,d=n.y.scale*i.y;s[0+l]/=u,s[1+l]/=d;var m=Hs(u,d,.5);"number"==typeof s[2+l]&&(s[2+l]/=m),"number"==typeof s[3+l]&&(s[3+l]/=m);var h=c(s);if(r){var f=0;h=h.replace(vd,(function(){var e=a[f];return f++,e}))}return h}}},bd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,i){void 0===i&&(i={});var o=i.originBox,r=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,c=i.onComplete,l=i.prevParent,u=Object(vr.d)(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,m=d.visualElement,h=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=o||n,e=r||e;var f=!1,p=m.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;l&&(r&&(v=l.getLayoutState().layout),o&&!zu(l,p)&&l.prevViewportBox&&(g=l.prevViewportBox)),g&&Dd(l,o,r)&&(f=!0,n=Wu(g,n),e=Wu(v,e))}var C=Ad(n,e),y=Au((function(i){var o,r;if("position"===h){var s=e[i].max-e[i].min;n[i].max=n[i].min+s}if(!m.projection.isTargetLocked)return void 0===a?C?t.animateAxis(i,e[i],n[i],Object(vr.a)(Object(vr.a)({},u),{isRelative:f})):(null===(r=(o=t.stopAxisAnimation)[i])||void 0===r||r.call(o),m.setProjectionTargetAxis(i,e[i].min,e[i].max,f)):void m.setVisibility(a===dd.Show)}));return m.syncRender(),Promise.all(y).then((function(){t.isAnimatingTree=!1,c&&c(),m.notifyLayoutAnimationComplete()}))}},t}return Object(vr.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=Rl,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)qr[t]=e[t]}(yd)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),Au((function(t){var n,i;return null===(i=(n=e.stopAxisAnimation)[t])||void 0===i?void 0:i.call(n)}))},t.prototype.animateAxis=function(e,t,n,i){var o,r,a=this,s=void 0===i?{}:i,c=s.transition,l=s.isRelative;if(!this.isAnimating[e]||!Ed(t,this.currentAnimationTarget[e])){null===(r=(o=this.stopAxisAnimation)[e])||void 0===r||r.call(o),this.isAnimating[e]=!0;var u=this.props.visualElement,d=this.frameTarget[e],m=u.getProjectionAnimationProgress()[e];m.clearListeners(),m.set(0),m.set(0);var h=function(){var i=m.get()/1e3;!function(e,t,n,i){e.min=Hs(t.min,n.min,i),e.max=Hs(t.max,n.max,i)}(d,n,t,i),u.setProjectionTargetAxis(e,d.min,d.max,l)};h();var f=m.onChange(h);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,m.stop(),f()},this.currentAnimationTarget[e]=t;var p=c||u.getDefaultTransition()||xd;return Rl("x"===e?"layoutX":"layoutY",m,1e3,p&&_l(p,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(xo.Component);function Ad(e,t){return!(wd(e)||wd(t)||Ed(e.x,t.x)&&Ed(e.y,t.y))}var Sd={min:0,max:0};function wd(e){return Ed(e.x,Sd)&&Ed(e.y,Sd)}function Ed(e,t){return e.min===t.min&&e.max===t.max}var xd={duration:.45,ease:[.4,0,.1,1]};function Dd(e,t,n){return e||!e&&!(t||n)}var Bd={layoutReady:function(e){return e.notifyLayoutReady()}};function Td(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?Bd:t,i=n.layoutReady,o=n.parent;id((function(t,n){var r=Array.from(e).sort(Ru),a=o?Mu(o):[];n((function(){Object(vr.e)(Object(vr.e)([],Object(vr.c)(a)),Object(vr.c)(r)).forEach((function(e){return e.resetTransform()}))})),t((function(){r.forEach(Nu)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),r.forEach(i)})),t((function(){r.forEach((function(e){e.isPresent&&(e.presence=ud.Present)}))})),n((function(){Xc.preRender(),Xc.render()})),t((function(){tl.postRender((function(){return r.forEach(Id)})),e.clear()}))})),od()}}}function Id(e){e.prevViewportBox=e.projection.target}var kd=Object(xo.createContext)(Td()),Od=Object(xo.createContext)(Td());function Ld(e){return!!e.forceUpdate}var Pd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(vr.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,i=e.visualElement;Ld(t)&&t.register(i),Ld(n)&&n.register(i),i.onUnmount((function(){Ld(t)&&t.remove(i),Ld(n)&&n.remove(i)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Ld(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;Ld(e)||e.flush()},t.prototype.render=function(){return null},t}(xo.default.Component);var _d={measureLayout:function(e){var t=Object(xo.useContext)(kd),n=Object(xo.useContext)(Od);return xo.default.createElement(Pd,Object(vr.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(vr.c)(Br(),2)[1];return xo.createElement(bd,Object(vr.a)({},e,{safeToRemove:t}))}};function Rd(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:bu(),deltaFinal:bu(),deltaTransform:""}}var Fd=Rd();function Md(e,t,n){var i=e.x,o=e.y,r="translate3d("+i.translate/t.x+"px, "+o.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,c=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),c&&(r+="rotateY("+c+") ")}return r+="scale("+i.scale+", "+o.scale+")",n||r!==Vd?r:""}function Nd(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var Vd=Md(Fd.delta,Fd.treeScale,{x:1,y:1}),Wd=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function zd(e,t,n,i){var o,r,a=e.delta,s=e.layout,c=e.layoutCorrected,l=e.treeScale,u=t.target;r=s,Hu((o=c).x,r.x),Hu(o.y,r.y),function(e,t,n){var i=n.length;if(i){var o,r;t.x=t.y=1;for(var a=0;a<i;a++)r=(o=n[a]).getLayoutState().delta,t.x*=r.x.scale,t.y*=r.y.scale,Yu(e,r),ju(o)&&Ku(e,e,o.getLatestValues())}}(c,l,n),Lu(a,c,u,i)}var jd=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){Fl(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Ml(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(Ru),this.isDirty=!1,this.children.forEach(e)},e}();var Hd=function(e){var t=e.treeType,n=void 0===t?"":t,i=e.build,o=e.getBaseTarget,r=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,l=e.resetTransform,u=e.restoreTransform,d=e.removeValueFromRenderState,m=e.sortNodePosition,h=e.scrapeMotionValuesFromProps;return function(e,t){var f=e.parent,p=e.props,g=e.presenceId,v=e.blockInitialAnimation,C=e.visualState;void 0===t&&(t={});var y,b,A,S,w,E,x=C.latestValues,D=C.renderState,B=function(){var e=Wd.map((function(){return new Nl})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return Wd.forEach((function(i){var o;null===(o=t[i])||void 0===o||o.call(t);var r="on"+i,a=e[r];a&&(t[i]=n[r](a))}))}};return e.forEach((function(e,t){n["on"+Wd[t]]=function(t){return e.add(t)},n["notify"+Wd[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(vr.e)([],Object(vr.c)(t)))}})),n}(),T={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},I=T,k=x,O=Rd(),L=!1,P=new Map,_=new Map,R={},F=Object(vr.a)({},x);function M(){y&&(G.isProjectionReady()&&(Ku(I.targetFinal,I.target,k),Lu(O.deltaFinal,O.layoutCorrected,I.targetFinal,x)),N(),s(y,D))}function N(){var e=x;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}i(G,D,e,I,O,t,p)}function V(){B.notifyUpdate(x)}function W(){G.layoutTree.forEach(Zd)}var z=h(p);for(var j in z){var H=z[j];void 0!==x[j]&&oa(H)&&H.set(x[j],!1)}var U=zr(p),Z=jr(p),G=Object(vr.a)(Object(vr.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(vr.e)(Object(vr.e)([],Object(vr.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new jd,presenceId:g,projection:T,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(y)},mount:function(e){y=G.current=e,G.pointTo(G),Z&&f&&!U&&(E=null==f?void 0:f.addVariantChild(G)),null==f||f.children.add(G)},unmount:function(){qc.update(V),qc.render(M),qc.preRender(G.updateLayoutProjection),_.forEach((function(e){return e()})),G.stopLayoutAnimation(),G.layoutTree.remove(G),null==E||E(),null==f||f.children.delete(G),null==A||A(),B.clearAllListeners()},addVariantChild:function(e){var t,n=G.getClosestVariantNode();if(n)return null===(t=n.variantChildren)||void 0===t||t.add(e),function(){return n.variantChildren.delete(e)}},sortNodePosition:function(e){return m&&n===e.treeType?m(G.getInstance(),e.getInstance()):0},getClosestVariantNode:function(){return Z?G:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return tl.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return y},getStaticValue:function(e){return x[e]},setStaticValue:function(e,t){return x[e]=t},getLatestValues:function(){return x},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),r(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),P.set(e,t),x[e]=t.get(),function(e,t){var n=t.onChange((function(t){x[e]=t,p.onUpdate&&tl.update(V,!1,!0)})),i=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),i()}))}(e,t)},removeValue:function(e){var t;P.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete x[e],d(e,D)},hasValue:function(e){return P.has(e)},getValue:function(e,t){var n=P.get(e);return void 0===n&&void 0!==t&&(n=Wl(t),G.addValue(e,n)),n},forEachValue:function(e){return P.forEach(e)},readValue:function(e){var n;return null!==(n=x[e])&&void 0!==n?n:c(y,e,t)},setBaseTarget:function(e,t){F[e]=t},getBaseTarget:function(e){if(o){var t=o(p,e);if(void 0!==t&&!oa(t))return t}return F[e]}},B),{build:function(){return N(),D},scheduleRender:function(){tl.render(M,!1,!0)},syncRender:M,setProps:function(e){p=e,B.updatePropListeners(e),R=function(e,t,n){var i;for(var o in t){var r=t[o],a=n[o];if(oa(r))e.addValue(o,r);else if(oa(a))e.addValue(o,Wl(r));else if(a!==r)if(e.hasValue(o)){var s=e.getValue(o);!s.hasAnimated&&s.set(r)}else e.addValue(o,Wl(null!==(i=e.getStaticValue(o))&&void 0!==i?i:r))}for(var o in n)void 0===t[o]&&e.removeValue(o);return t}(G,h(p),R)},getProps:function(){return p},getVariant:function(e){var t;return null===(t=p.variants)||void 0===t?void 0:t[e]},getDefaultTransition:function(){return p.transition},getVariantContext:function(e){if(void 0===e&&(e=!1),e)return null==f?void 0:f.getVariantContext();if(!U){var t=(null==f?void 0:f.getVariantContext())||{};return void 0!==p.initial&&(t.initial=p.initial),t}for(var n={},i=0;i<Qd;i++){var o=Yd[i],r=p[o];(Nr(r)||!1===r)&&(n[o]=r)}return n},enableLayoutProjection:function(){T.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){T.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),T.isTargetLocked=!1},getLayoutState:function(){return O},setCrossfader:function(e){S=e},isProjectionReady:function(){return T.isEnabled&&T.isHydrated&&O.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var i=G.getProjectionAnimationProgress()[e],o=n?T.relativeTarget[e]:T.target[e],r=o.min,a=o.max-r;return i.clearListeners(),i.set(r),i.set(r),i.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,i,0,t)},stopLayoutAnimation:function(){Au((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(y,t);return e||ed(n,x),n},getProjectionAnimationProgress:function(){return w||(w={x:Wl(0),y:Wl(0)}),w},setProjectionTargetAxis:function(e,t,n,i){var o;void 0===i&&(i=!1),i?(T.relativeTarget||(T.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),o=T.relativeTarget[e]):(T.relativeTarget=void 0,o=T.target[e]),T.isHydrated=!0,o.min=t,o.max=n,L=!0,B.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=O.layout);var n=G.getProjectionAnimationProgress(),i=n.x,o=n.y,r=!(T.relativeTarget||T.isTargetLocked||i.isAnimating()||o.isAnimating());(e||r)&&Au((function(e){var n=t[e],i=n.min,o=n.max;G.setProjectionTargetAxis(e,i,o)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=Wu(t.getLayoutState().layout,e.getLayoutState().layout);Au((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(O.layout,G.prevViewportBox||O.layout,e)},resetTransform:function(){return l(G,y,p)},restoreTransform:function(){return u(y,D)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=O.delta,t=O.treeScale,n=t.x,i=t.y,o=O.deltaTransform;zd(O,I,G.path,x),L&&G.notifyViewportBoxUpdate(I.target,e),L=!1;var r=Md(e,t);r===o&&n===t.x&&i===t.y||G.scheduleRender(),O.deltaTransform=r}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(Ud),tl.preRender(W,!1,!0)},getProjectionParent:function(){if(void 0===b){for(var e=!1,t=G.path.length-1;t>=0;t--){var n=G.path[t];if(n.projection.isEnabled){e=n;break}}b=e}return b},resolveRelativeTargetBox:function(){var e=G.getProjectionParent();if(T.relativeTarget&&e&&(function(e,t){_u(e.target.x,e.relativeTarget.x,t.target.x),_u(e.target.y,e.relativeTarget.y,t.target.y)}(T,e.projection),ju(e))){var t=T.target;Ku(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){I=e.projection,k=e.getLatestValues(),null==A||A(),A=Is(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=ud.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:ud.Entering});return G}};function Ud(e){e.resolveRelativeTargetBox()}function Zd(e){e.updateLayoutProjection()}var Gd,Yd=Object(vr.e)(["initial"],Object(vr.c)($l)),Qd=Yd.length,qd=new Set(["width","height","top","left","right","bottom","x","y"]),Xd=function(e){return qd.has(e)},Kd=function(e,t){e.set(t,!1),e.set(t)},Jd=function(e){return e===Aa||e===va};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Gd||(Gd={}));var $d=function(e,t){return parseFloat(e.split(", ")[t])},em=function(e,t){return function(n,i){var o=i.transform;if("none"===o||!o)return 0;var r=o.match(/^matrix3d\((.+)\)$/);if(r)return $d(r[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?$d(a[1],e):0}},tm=new Set(["x","y","z"]),nm=Kr.filter((function(e){return!tm.has(e)}));var im={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,i=t.top;return parseFloat(i)+(n.max-n.min)},right:function(e,t){var n=e.x,i=t.left;return parseFloat(i)+(n.max-n.min)},x:em(4,13),y:em(5,14)},om=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={}),t=Object(vr.a)({},t),i=Object(vr.a)({},i);var o=Object.keys(t).filter(Xd),r=[],a=!1,s=[];if(o.forEach((function(o){var c=e.getValue(o);if(e.hasValue(o)){var l,u=n[o],d=t[o],m=Hl(u);if(Ka(d))for(var h=d.length,f=null===d[0]?1:0;f<h;f++)l?Hl(d[f]):(l=Hl(d[f]))===m||Jd(m)&&Jd(l);else l=Hl(d);if(m!==l)if(Jd(m)&&Jd(l)){var p=c.get();"string"==typeof p&&c.set(parseFloat(p)),"string"==typeof d?t[o]=parseFloat(d):Array.isArray(d)&&l===va&&(t[o]=d.map(parseFloat))}else(null==m?void 0:m.transform)&&(null==l?void 0:l.transform)&&(0===u||0===d)?0===u?c.set(l.transform(u)):t[o]=m.transform(d):(a||(r=function(e){var t=[];return nm.forEach((function(n){var i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),t.length&&e.syncRender(),t}(e),a=!0),s.push(o),i[o]=void 0!==i[o]?i[o]:t[o],Kd(c,d))}})),s.length){var c=function(e,t,n){var i=t.measureViewportBox(),o=t.getInstance(),r=getComputedStyle(o),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var c=t.measureViewportBox();return n.forEach((function(n){var o=t.getValue(n);Kd(o,im[n](i,s)),e[n]=im[n](c,r)})),e}(t,e,s);return r.length&&r.forEach((function(t){var n=Object(vr.c)(t,2),i=n[0],o=n[1];e.getValue(i).set(o)})),e.syncRender(),{target:c,transitionEnd:i}}return{target:t,transitionEnd:i}};function rm(e,t,n,i){return function(e){return Object.keys(e).some(Xd)}(t)?om(e,t,n,i):{target:t,transitionEnd:i}}var am=function(e,t,n,i){var o=function(e,t,n){var i,o=Object(vr.d)(t,[]),r=e.getInstance();if(!(r instanceof HTMLElement))return{target:o,transitionEnd:n};for(var a in n&&(n=Object(vr.a)({},n)),e.forEachValue((function(e){var t=e.get();if(hd(t)){var n=pd(t,r);n&&e.set(n)}})),o){var s=o[a];if(hd(s)){var c=pd(s,r);c&&(o[a]=c,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:o,transitionEnd:n}}(e,t,i);return rm(e,t=o.target,n,i=o.transitionEnd)};var sm={treeType:"dom",readValueFromInstance:function(e,t){if(ea(t)){var n=Bl(t);return n&&n.default||0}var i,o=(i=e,window.getComputedStyle(i));return(aa(t)?o.getPropertyValue(t):o[t])||0},sortNodePosition:function(e,t){return 2&e.compareDocumentPosition(t)?1:-1},getBaseTarget:function(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]},measureViewportBox:function(e,t){return Bu(e,t.transformPagePoint)},resetTransform:function(e,t,n){var i=n.transformTemplate;t.style.transform=i?i({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,i=t.style;delete n[e],delete i[e]},makeTargetAnimatable:function(e,t,n,i){var o=n.transformValues;void 0===i&&(i=!0);var r=t.transition,a=t.transitionEnd,s=Object(vr.d)(t,["transition","transitionEnd"]),c=function(e,t,n){var i,o,r={};for(var a in e)r[a]=null!==(i=Ql(a,t))&&void 0!==i?i:null===(o=n.getValue(a))||void 0===o?void 0:o.get();return r}(s,r||{},e);if(o&&(a&&(a=o(a)),s&&(s=o(s)),c&&(c=o(c))),i){!function(e,t,n){var i,o,r,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),c=s.length;if(c)for(var l=0;l<c;l++){var u=s[l],d=t[u],m=null;Array.isArray(d)&&(m=d[0]),null===m&&(m=null!==(o=null!==(i=n[u])&&void 0!==i?i:e.readValue(u))&&void 0!==o?o:t[u]),null!=m&&("string"==typeof m&&/^\-?\d*\.?\d+$/.test(m)?m=parseFloat(m):!Zl(m)&&lc.test(d)&&(m=Tl(u,d)),e.addValue(u,Wl(m)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=m),e.setBaseTarget(u,m))}}(e,s,c);var l=am(e,s,c,a);a=l.transitionEnd,s=l.target}return Object(vr.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:Qa,build:function(e,t,n,i,o,r,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=i.isEnabled&&o.isHydrated;Da(t,n,i,o,r,a.transformTemplate,s?Md:void 0,s?Nd:void 0)},render:Za},cm=Hd(sm),lm=Hd(Object(vr.a)(Object(vr.a)({},sm),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return ea(t)?(null===(n=Bl(t))||void 0===n?void 0:n.default)||0:(t=Ga.has(t)?t:Ua(t),e.getAttribute(t))},scrapeMotionValuesFromProps:qa,build:function(e,t,n,i,o,r,a){var s=i.isEnabled&&o.isHydrated;Va(t,n,i,o,r,a.transformTemplate,s?Md:void 0,s?Nd:void 0)},render:Ya})),um=function(e,t){return Qr(e)?lm(t,{enableHardwareAcceleration:!1}):cm(t,{enableHardwareAcceleration:!0})},dm=Object(vr.a)(Object(vr.a)(Object(vr.a)(Object(vr.a)({},ru),Os),md),_d),mm=Gr((function(e,t){return rs(e,t,dm,um)}));class hm{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var fm=n(8);class pm{static now(){return Date.now()}}function gm(e){var t=Dr((function(){return Wl(e)}));if(Object(xo.useContext)(wr).isStatic){var n=Object(vr.c)(Object(xo.useState)(e),2)[1];Object(xo.useEffect)((function(){return t.onChange(n)}),[])}return t}var vm=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function Cm(e,t){var n=gm(t()),i=function(){return n.set(t())};return i(),function(e,t){Object(xo.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return tl.update(i,!1,!0)})),n}function ym(e,t,n,i){var o="function"==typeof t?t:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!Array.isArray(e[0]),i=n?0:-1,o=e[0+i],r=e[1+i],a=e[2+i],s=e[3+i],c=Cc(r,a,Object(vr.a)({mixer:vm(a[0])},s));return n?c(o):c}(t,n,i);return Array.isArray(e)?bm(e,o):bm([e],(function(e){var t=Object(vr.c)(e,1)[0];return o(t)}))}function bm(e,t){var n=Dr((function(){return[]}));return Cm(e,(function(){n.length=0;for(var i=e.length,o=0;o<i;o++)n[o]=e[o].get();return t(n)}))}function Am(e,t,n){void 0===n&&(n={});var i=oa(e)?e:Wl(e);return Rl("",i,t,n),{stop:function(){return i.stop()}}}var Sm=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class wm extends xo.default.Component{constructor(e){super(e),this.state={element:e.element}}update(e){this.setState({element:e})}style(e){this.customStyle=e,this.forceUpdate()}render(){var e,t,n,i,o,r,a,s,c;const l=this.state.element,u=this.props.configuration.style;!l.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(l);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:l.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,m=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==i?i:l.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,h=null!==(r=null===(o=this.customStyle)||void 0===o?void 0:o.strokeWidth)&&void 0!==r?r:l.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:l.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,p=null!==(c=this.props.animateToPoints)&&void 0!==c?c:l.points;return xo.default.createElement(Em,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(l)},fill:d,stroke:m,strokeWidth:h,cornerRadius:f})}}function Em(e){var{points:t,cornerRadius:n}=e,i=Sm(e,["points","cornerRadius"]);const o=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],r=o.map(gm),a=ym(r,(([e,t,i,o,r,a,s,c])=>{const l=[{x:e,y:t},{x:i,y:o},{x:r,y:a},{x:s,y:c}];return fm.a.toSvgPathStringWithRoundedCorners(l,n)}));return Object(xo.useEffect)((()=>{const e=[];for(let t=0;t<o.length;t++)e.push(Am(r[t],o[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),xo.default.createElement(mm.path,Object.assign({d:a},i))}class xm{constructor(){this.detectedAt=0}update(e,t,n,i,o,r){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=i,this.element=o,this.updatedAt=r}}class Dm extends xo.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,i){const o=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=dr(e),i=n.get(t);i?i.push(e):n.set(t,[e])})),n.forEach(((t,i)=>{t.length<2?n.delete(i):t.forEach(((t,n)=>{e.splice(e.indexOf(t),1)}))})),n.forEach(((n,i)=>{const o=e=>{let t={x:0,y:0};return e.forEach((e=>{t.x+=e.x,t.y+=e.y})),t.x/=e.length,t.y/=e.length,t},r=t.width/2,a=n.reduce(((e,t)=>{const n=o(e.quad),i=o(t.quad);return Math.abs(r-n.x)<Math.abs(r-i.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(i,n),i.forEach((i=>{const r=new hm(i);r.points=void 0===e?fm.a.scaleListToHtmlElement(i.quad,n,t.video):i.quad.map((t=>{const i=new fm.a(t.x,t.y);return i.x*=e.width/n.width,i.y*=e.height/n.height,i.y+=e.y,i.x+=e.x,i})),r.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),o.push(r)}));const r=[];this.state.polygonElements.forEach((e=>{const t=o.find((t=>ur(t.code,e.element.code)));let n=!1;const i=pm.now();void 0===t?e.updatedAt+1e3<i&&(n=!0):(e.element=t,e.polygon=xo.default.createElement(wm,{key:dr(e.element.code),ref:t=>e.polygonRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)}),e.label=xo.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:dr(e.element.code),ref:t=>e.labelRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)})),this.props.configuration.automaticSelectionEnabled&&this.props.configuration.countingRepeatDelay>-1&&e.detectedAt>0&&i>this.props.configuration.countingRepeatDelay+e.detectedAt&&(this.props.onPolygonSelected(t.code),e.detectedAt=i),e.updatedAt=i),n||r.push(e)})),o.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>ur(t.element.code,e.code)))){let t,n;const i=new xm,o=xo.default.createElement(wm,{key:dr(e.code),ref:i=>{t=i,void 0!==n&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}),a=xo.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:dr(e.code),ref:i=>{n=i,void 0!==t&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}));i.update(o,t,a,n,e,pm.now()),r.push(i)}})),this.setState({polygonElements:r})}onPolygonClick(e){var t,n,i,o;let r;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const i=t.labelRef,o=t.label.props.element;ur(o.code,e.code)&&(r=t),i&&ur(o.code,e.code)&&(i.update(e),null===(n=t.polygonRef)||void 0===n||n.update(e))})),e.highlighted&&(null===(n=(t=this.props).onPolygonSelected)||void 0===n||n.call(t,e.code),r&&(r.detectedAt=pm.now())),null===(o=(i=this.props).onPolygonClick)||void 0===o||o.call(i,e.code)}render(){var e,t;return xo.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},xo.default.createElement(mm.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((e=>e.polygon))),null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((e=>e.label)))}}var Bm=n(42),Tm=n.n(Bm),Im=n(45),km={insert:"head",singleton:!1},Om=(Tm()(Im.a,km),Im.a.locals,n(28)),Lm=n.n(Om);class Pm{constructor(e){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=e}setDuration(e){const t=Date.now()/1e3,n=t-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-e*this.t;this.element&&(this.element.style.animationDuration=`${e}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=t,this.lastDuration=e}}class _m extends xo.default.Component{constructor(){super(...arguments),this.inner1=new Pm("scanbot-shutter-rotate"),this.inner2=new Pm("scanbot-shutter-rotate")}render(){return xo.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(e){"searching"==e?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,xo.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==e||"manual"==e,"scanbot-shutter-fade-out":"searching"==e||"capturing"==e,"scanbot-shutter-pulse-fast":"processing"==e},xo.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},xo.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},xo.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(e=>{this.inner1.element=e}))}captureSearchingInner2(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},xo.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(e=>{this.inner2.element=e}))}path(e){return xo.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return xo.default.createElement("div",{className:Lm()(e),ref:n},xo.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class Rm extends xo.default.Component{render(){return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},xo.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_919_23088)"},xo.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class Fm extends xo.default.Component{render(){return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},xo.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_919_23102)"},xo.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Mm extends xo.default.Component{constructor(e){super(e),this.state={barcodes:void 0}}update(e){this.setState({barcodes:e})}didScan(){return void 0!==this.state.barcodes}render(){var e,t;return xo.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:pr.ScanbotPrimary}},xo.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},xo.default.createElement(Rm,null),xo.default.createElement("div",{style:{backgroundColor:pr.Orange,color:pr.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(t=null===(e=this.state.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)),xo.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},xo.default.createElement(_m,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),xo.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},xo.default.createElement("div",{style:{fontSize:13,color:pr.White,marginRight:10}},"Scan More"),xo.default.createElement(Fm,null)))}}class Nm extends xo.default.Component{render(){const e=fm.a.centerOf(this.props.points),t=fm.a.smallerSizeOfQuad(this.props.points)/40;return xo.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:e.x-20,top:e.y-20,transform:`scale(${t})`}},xo.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},xo.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_910_20901)"},xo.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),xo.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var Vm=n(11);class Wm extends xo.default.Component{constructor(e){super(e),this.state={elements:[],imageSize:Vm.a.empty()}}update(e){const t=[];e.barcodes.forEach((n=>{const i=new hm(n);i.points=fm.a.scaleListToHtmlElement(n.quad,e.originalImageSize,this.image),t.push(i)})),this.setState({imageSize:Vm.a.fromHtmlElement(this.image),elements:t})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:xo.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},xo.default.createElement("img",{style:{maxWidth:"100%"},ref:e=>this.image=e,src:`${this.props.image}`}),xo.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((e,t)=>xo.default.createElement(Nm,{key:t,points:e.points})))))}}class zm extends xo.default.Component{render(){if(!this.props.visible)return null;const e=cr.a.svg`
32
32
  animation: rotate 2s linear infinite;
33
33
  @keyframes rotate { 100% { transform: rotate(360deg); } }
34
- `;return Wt.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},Wt.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),Wt.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),Wt.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),Wt.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class ou extends Wt.default.Component{render(){return this.props.text?Wt.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},Wt.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:kn.TransparentGray,color:kn.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class iu extends Wt.default.Component{constructor(e){super(e),this.state={element:e.element}}style(e){this.customStyle=e,this.forceUpdate()}update(e){this.setState({element:e})}formatText(e,t){if("None"!==t)return"Text"===t?e.text:e.format+" ("+e.text+")"}render(){var e,t,n,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=kc.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return Wt.default.createElement(Ic.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:kc.a.lowestX(r.points),y:kc.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:kc.a.lowestX(this.props.animateToPoints),y:kc.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class ru{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class au{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new ru}}class su{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class lu{constructor(){this.enabled=!1,this.style=new su}}class cu extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new au,this.detectionParameters=new Q.BarcodeScannerConfiguration,this.scanAndCount=new lu,this.onBarcodesDetected=function(e){}}static fromJson(e){const t=new cu;return this.mapValues(e,t,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(t,e),e.overlay&&(this.mapValues(e.overlay,t.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,t.overlay.style)),e.scanAndCount&&(this.mapValues(e.scanAndCount,t.scanAndCount,["style"]),e.scanAndCount.style&&this.mapValues(e.scanAndCount.style,t.scanAndCount.style)),this.mapVideoConstraints(e,t),t}}class uu{constructor(e){this.coreResult=e,this.barcodes=[],this.originalImageSize=null,this.barcodes=e.barcodes,e.originalImage&&(this.originalImageSize=new eu.a(e.originalImage.width,e.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class du{static warn(e){console.warn("[ScanbotSDK]",e)}}class hu{static convertLinesToViewportLines(e,t){if(t&&e)return t.map((t=>({start:new kc.a(t.start.x*e.width,t.start.y*e.height),end:new kc.a(t.end.x*e.width,t.end.y*e.height)})))}static convertToViewportPointsFromParentSize(e,t){return t?eu.a.isEmpty(e)?void 0:t.map((t=>kc.a.scaleUpTo(t,e))):eu.a.toPolygon(e)}static calculateScale(e){let t,n=0,o=0;return 1>e.width/e.height?(t=e.height/1,n=(1-e.width/t)/2):(t=e.width/1,o=(1-e.height/t)/2),{x:n,y:o,containerScale:t}}static findScale(e,t){let n,o=0,i=0;return t.ratio(!0)>e.ratio(!0)?(n=e.width/t.width,i=(t.height-e.height/n)/2):(n=e.height/t.height,o=(t.width-e.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(e){e.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",hu.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",hu.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(e){var t;const n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var mu=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class fu extends bn.c{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.paused=!1,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(t=this.configuration.finder.visible)||void 0===t||t,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=cu.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return mu(this,void 0,void 0,(function*(){const t=hu.findContainerOrThrow(e);return new Promise(((n,o)=>{Object(Wt.render)(Wt.default.createElement(fu,{container:t,configuration:e,onSuccess:n,onFailure:o}),t)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return mu(this,void 0,void 0,(function*(){du.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Barcode detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return mu(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeScannerHandle).catch((e=>{var t,n;return null===(n=(t=this.props.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}updateDimensions(){return mu(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return mu(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,o,i;return mu(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const e=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!e)return;const a=new uu(e);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(e.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(o=this.finder)||void 0===o?void 0:o.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}setUseBackendService(e){console.log("Now using backend service for recognition: ",e),this.backendurl=e}recognizeBarcodes(e,t){var n,o,i,r,a,s,l,c;return mu(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const l=e?bn.c.DEFAULT_DETECTION_RESOLUTION:bn.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(o=this.finder)||void 0===o?void 0:o.holeRect;const u=yield null===(i=this.camera)||void 0===i?void 0:i.createImageData(c,!1);if(!u)return;t&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:F.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",bn.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new eu.a(u.width,u.height);this.barcodeScannerHandle||(this.barcodeScannerHandle=yield this.bridge.copyArgs.createBarcodeScanner(new Q.BarcodeScannerConfiguration(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:e}))));const d=yield this.bridge.transferArgs.scanBarcodes(this.barcodeScannerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(e){return void(null===(c=(l=this.props.configuration).onError)||void 0===c||c.call(l,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return mu(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(eu.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(eu.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}updateTorch(e){this.camera.videoStream.updateTorch(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var e,t,n,o,i,r,a;const s=(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)?"Tap the shutter button to scan":void 0;return Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),Wt.default.createElement(ou,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),Wt.default.createElement(tu,{ref:e=>this.scannedImage=e,image:this.state.image}),this.state.isFinderVisible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),Wt.default.createElement(ou,{bottom:100,text:this.state.bottomHintText}),Wt.default.createElement(nu,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&Wt.default.createElement(zc,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=new uu({barcodes:[e]});this.configuration.onBarcodesDetected(t)},onBarcodeFound:(e,t,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(e,t,n)},LabelComponent:iu,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&Wt.default.createElement(Jc,{ref:e=>this.bottomActionBar=e,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Tn.PushBottom,this.barcodes)},onShutterButtonClick:()=>mu(this,void 0,void 0,(function*(){(new M).flash(),this.setState({action:"processing"});const e=(new Date).getTime();let t=yield this.recognizeBarcodes(!1,!1);const n=new uu(null!=t?t:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-e)/1e3);const o=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:o}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),Wt.default.createElement(On,{ref:e=>this.popup=e,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(e){return 0==e.length?"No codes scanned. Try again?":1==e.length?"1 Code Scanned":`${e.length} Codes Scanned`}}function pu(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function gu(e){const t=e.zoomSteps.findIndex((t=>t==e.defaultZoomFactor)),[n,o]=Object(Wt.useState)(e.torchEnabledInitially),[i,r]=Object(Wt.useState)(t),a=e.zoomSteps[i],[s,l]=Object(Wt.useState)("BACK"==e.initialCameraModule?"environment":"user"),c=function(e){var t,n;const o=null===(n=null===(t=null==e?void 0:e.camera)||void 0===t?void 0:t.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(Wt.useState)(i());return Object(Wt.useEffect)((()=>{if(o){const e=()=>a(i());e();const t=new ResizeObserver(e);return t.observe(o),()=>{t.disconnect()}}}),[o]),r}(e.scanner),u=!!c;if(Object(Wt.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&u&&e.scanner.setTorchState(n)}),[e.capabilities,u,n]),Object(Wt.useEffect)((()=>{var t;u&&(null===(t=e.scanner)||void 0===t||t.setZoom(a))}),[u,a]),!e.capabilities||!c)return null;if(!pu(e.capabilities,e.config))return null;const d=c.height-e.bottomPadding-48;return Wt.default.createElement(zt.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},Wt.default.createElement(mn,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:n?zt.FlashlightOn:zt.FlashlightOff,active:n,onClick:()=>o(!n)})),Wt.default.createElement("div",{style:{width:20}}),Wt.default.createElement(mn,Object.assign({},e.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==t,onClick:()=>r((i+1)%e.zoomSteps.length)})),Wt.default.createElement("div",{style:{width:20}}),Wt.default.createElement(mn,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===s,icon:zt.FlipCameraIos,onClick:()=>{var t;const n="environment"===s?"user":"environment";l(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const vu=Object(Wt.createContext)(null);class Cu{static compute(e,t,n){const o=(kc.a.lowestY(e)+kc.a.highestY(e))/2,i={badgeY:o,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},i),{labelY:Math.max(kc.a.highestY(e)+Cu.LABEL_AND_BADGE_PADDING,t?o-Cu.AR_BADGE_SIZE/2-Cu.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},i),{labelY:Math.min(kc.a.lowestY(e)-Cu.LABEL_AND_BADGE_PADDING,t.visible?o+Cu.AR_BADGE_SIZE/2+Cu.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:o,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Cu.LABEL_AND_BADGE_PADDING/2}px))`},labelY:o,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Cu.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},i),{labelY:0,labelStyle:{display:"none"}}):void 0}}Cu.AR_BADGE_SIZE=48,Cu.LABEL_AND_BADGE_PADDING=10;var bu=Cu;function yu(e){return e.style.visible?""==e.content?null:Wt.default.createElement(Ic.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},Wt.default.createElement(Xt,{styleConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:bu.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:bu.AR_BADGE_SIZE,height:bu.AR_BADGE_SIZE,color:Ht.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var Au=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class Su extends iu{constructor(){super(...arguments),this.count=0,this.setCount=e=>{this.count=e,this.forceUpdate()}}styleBadge(e,t){this.customBadgeStyle=e,this.customBadgeContent=t,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var e,t;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:o,counterBadge:i}=this.props;const r=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,l=a.code,c=a.highlighted,u=(kc.a.lowestX(s)+kc.a.highestX(s))/2;void 0===o&&(o="BELOW");const d=bu.compute(s,i,o),h=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,m={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return Wt.default.createElement(Wt.default.Fragment,null,r&&Wt.default.createElement(Ic.div,{ref:e=>this.label=e,style:Object.assign(Object.assign({},m),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?m:{},transition:p},Wt.default.createElement(Xt,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:c?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},Wt.default.createElement(wu,{barcode:l,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:c?r.titleSelected:r.titleDeselected,barcodeSubtitle:c?r.subtitleSelected:r.subtitleDeselected}))),Wt.default.createElement(yu,{onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)},style:null!==(t=this.customBadgeStyle)&&void 0!==t?t:i,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function wu(e){var{barcode:t}=e,n=Au(e,["barcode"]);const o=Object(Wt.useContext)(vu).useBarcodeMappedData(t);return Wt.default.createElement(sn,Object.assign({barcodeMappedData:o},n))}var Eu=n(10);function xu(e){const t=Object(Wt.useRef)(),n=Object(Wt.useRef)(null),[o,i]=(Object(Wt.useContext)(nn),Object(Wt.useState)(void 0)),[r,a]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{var n,o;e.scanningPaused?null===(n=t.current)||void 0===n||n.pause():null===(o=t.current)||void 0===o||o.resume()}),[e.scanningPaused]);const s=function(e){const t=new au;t.visible=e.visible;const n=e.polygon instanceof Eu.c,o=e.polygon,i=e,r=n?o.selected:i.polygon.partiallyScanned,a=n?o.deselected:i.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=Ht.b.getColorValue(r.fillColor),t.style.highlightedPolygonStrokeColor=Ht.b.getColorValue(r.strokeColor),t.style.highlightedPolygonStrokeWidth=r.strokeWidth,t.style.highlightedPolygonCornerRadius=r.cornerRadius,t.style.polygonFillColor=Ht.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=Ht.b.getColorValue(a.strokeColor),t.style.polygonStrokeWidth=a.strokeWidth,t.style.polygonCornerRadius=a.cornerRadius):(t.style.highlightedPolygonFillColor="transparent",t.style.highlightedPolygonStrokeColor="transparent",t.style.polygonFillColor="transparent",t.style.polygonStrokeColor="transparent"),t.automaticSelectionEnabled=!1,t}(e.arOverlay),l=Object.assign(Object.assign({},e.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,o.originalImageSize,o.barcodes),null===(c=(l=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new eu.a(o.width,o.height),[]),null===(c=(l=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(Wt.useEffect)((()=>{const t=pu(o,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[o,e.actionBarConfig]),Wt.default.createElement(Wt.default.Fragment,null,e.arOverlay.visible&&Wt.default.createElement(zc,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:Su,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),Wt.default.createElement(gu,{config:e.actionBarConfig,scanner:t.current,capabilities:o,bottomPadding:e.actionBarBottomPadding,torchEnabledInitially:e.cameraConfiguration.flashEnabled,zoomSteps:e.cameraConfiguration.zoomSteps,defaultZoomFactor:e.cameraConfiguration.defaultZoomFactor,initialCameraModule:e.cameraConfiguration.cameraModule}),Wt.default.createElement(fu,{ref:t,viewFinderPadding:e.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(e,t){var n;if(!e.current)return;const o=e.current.getCapabilities();t({hasFacingOptions:(null==o?void 0:o.facingMode)&&o.facingMode.length>0,isTorchAvailable:null!==(n=e.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(t,i),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Bu(e){return Object(Wt.useMemo)((()=>{const t=(new cu).videoConstraints;return t.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,t.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,t.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:t,backgroundColor:Ht.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,detectionParameters:new Q.BarcodeScannerConfiguration({live:!0,engineMode:e.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new G.BarcodeFormatCommonConfiguration({formats:e.recognizerConfiguration.barcodeFormats.length>0?e.recognizerConfiguration.barcodeFormats:void 0,regexFilter:e.recognizerConfiguration.barcodesRegexFilter,gs1Handling:e.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:e.recognizerConfiguration.maximumRecognizerResolution}}),[e])}var Iu=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Tu(e){const[t,n]=Object(Wt.useState)(null),[o,i]=Object(Wt.useState)(!0),r=Object(Wt.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,l=Object.assign(Object.assign({},Bu(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:r,captureDelay:0}),c=n=>Iu(this,void 0,void 0,(function*(){let o;o=null===t?[]:[new Vt.BarcodeScannerUIItem({count:1,barcode:n})];const i={items:o};e.onSubmit(i)}));Object(Wt.useEffect)((()=>{t&&(gn.INSTANCE.beep(e.configuration.sound),Cn.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(Wt.useEffect)((()=>{null===t||s.confirmationSheetEnabled||c(t)}),[t,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(t);Object(Wt.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(Wt.useContext)(nn);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(vu.Provider,{value:e.barcodeMapper},Wt.default.createElement(dn,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(t)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),Wt.default.createElement(zt.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},Wt.default.createElement(xu,{cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:e=>n(e),arOnBarcodeEnter:t=>{s.arOverlay.automaticSelectionEnabled&&e.scanningEnabled.current&&n(t)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var h}function ku(e){const t=Object.assign(Object.assign({},e.title),{text:Ht.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,Object.assign({},e.leftButton)),Wt.default.createElement(zt.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},Wt.default.createElement(Qt.a,{config:t})),Wt.default.createElement(tn,Object.assign({},e.rightButton)))}function Ou(){return Wt.default.createElement("div",{style:{width:30,height:6,backgroundColor:zt.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function Du(e){return Wt.default.createElement(zt.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),Wt.default.createElement(Ou,null),Wt.default.createElement(ku,Object.assign({},e.drawerHeaderContentProps)))}function Lu(e){return Wt.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},Wt.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:e.color}))}function Pu(e){return e.isVisible?Wt.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&Wt.default.createElement(zt.Avatar,{style:{backgroundColor:Ht.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},Wt.default.createElement(Lu,{color:Ht.b.getColorValue(e.style.placeholderIcon.color)})),Wt.default.createElement(zt.Typography,{style:{marginTop:20},variant:"h6"},Wt.default.createElement(Qt.a,{config:e.style.placeholderTitle})),Wt.default.createElement(zt.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},Wt.default.createElement(Qt.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&Wt.default.createElement(ln,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function _u(e,t,n){const o=Object(Wt.useRef)(),i=Object(Wt.useRef)(null),[r,a]=Object(Wt.useState)(),[s,l]=Object(Wt.useState)(!1),c=Object(Wt.useRef)([]),u=e=>{let n="none";if(c.current.length>0){const t=200,o=((e,t)=>{let n=e[0],o=Math.abs(n.time-t);for(let i=1;i<e.length;i++){const r=Math.abs(e[i].time-t);r<o&&(n=e[i],o=r)}return n})(c.current,e.timeStamp-t),i=o.y-e.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),t(new kc.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),l(!0),i.current=new kc.a(e.clientX,e.clientY),a(kc.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new kc.a(t.clientX,t.clientY);o.current=t,a(n),e(n),c.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),l(!1),u(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}var Ru=n(33);function Fu(e){const[t,n]=Object(Wt.useState)(0),[o,i]=Object(Wt.useState)(!1),r=Object(Wt.useRef)(null),a=Object(Wt.useContext)(nn).height,s=e=>{n(e),i(!0),setTimeout((()=>{i(!1)}),500)},l=t=>{const n=t-c.startPoint.current.y;return Object(Ru.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},c=_u((e=>{n(l(e.y))}),((t,n)=>{if(t.y===c.startPoint.current.y)return;let o;o=l(t.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),e.onSwipe(o)}),(()=>{}));return Object(Wt.useEffect)((()=>{o||c.dragOngoing||!r||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,c.dragOngoing]),Wt.createElement("div",null,Wt.createElement(jt.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${Ut} - ${a}px - ${e.closedSheetVisibleHeight}px) * ${t} / 100 + ${e.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:Ht.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},Wt.createElement(Du,{innerRef:e=>{r.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:c.props}),e.children,Wt.createElement(Pu,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var Mu=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Wu(e){var{inputRef:t}=e,n=Mu(e,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return Wt.default.createElement("input",Object.assign({},o,{ref:t}))}function Nu(e){const t=!!e.barcode,[n,o]=Wt.default.useState(""),i=Wt.default.useRef(null),r={backgroundColor:Ht.b.getColorValue(e.dialogStyling.sheetColor)};return Object(Wt.useEffect)((()=>{t&&o(String(e.barcode.count))}),[t]),Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}},onClose:e.onCancel,PaperProps:{component:"form",onSubmit:t=>{t.preventDefault(),e.setCounter(e.barcode.barcode,parseInt(n)||0)}}},Wt.default.createElement(zt.DialogContent,{style:r},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},Wt.default.createElement(Qt.a,{config:e.dialogStyling.title})),Wt.default.createElement(zt.Typography,{fontSize:14,textAlign:"center"},Wt.default.createElement(Qt.a,{config:e.dialogStyling.info})),Wt.default.createElement(zt.Box,{sx:{display:"flex",border:"2px solid",borderColor:Ht.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},Wt.default.createElement(Wu,{inputRef:i,value:n,onChange:e=>{const t=parseInt(e.target.value.replaceAll(/[^0-9]/g,""));o(t>=0?t.toString():"")},type:"text",pattern:"[0-9]*"}),e.dialogStyling.clearTextButton.visible&&Wt.default.createElement(jt.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:Ht.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:Ht.b.getColorValue(e.dialogStyling.dividerColor)})),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({icon:zt.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function Vu(e){return Wt.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:Ht.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},Wt.default.createElement(jt.a,{style:{height:"100%",color:Ht.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}const zu=0,ju=800,Hu=1200;function Uu(e){switch(e){case"mobile":return Object(zt.useMediaQuery)("(min-width:"+zu+"px) and (max-width:"+(ju-1)+"px)");case"tablet":return Object(zt.useMediaQuery)("(min-width:"+ju+"px) and (max-width:"+(Hu-1)+"px)");case"desktop":return Object(zt.useMediaQuery)("(min-width:"+Hu+"px)")}}function Zu(e){switch(e){case"mobile":return Object(zt.useMediaQuery)("(min-width:"+zu+"px)");case"tablet":return Object(zt.useMediaQuery)("(min-width:"+ju+"px)");case"desktop":return Object(zt.useMediaQuery)("(min-width:"+Hu+"px)")}}const Gu=150;function Qu(e){const[t,n]=Object(Wt.useState)(0),[o,i]=Object(Wt.useState)(!1);let r;const a=_u((e=>{let t=a.startPoint.current.x-e.x;t<0?a.stop():n(-t)}),(t=>{if(t.x===a.startPoint.current.x)return;if(a.startPoint.current.x-t.x>75){const t=e.animateBackAfterDelete?()=>{c(0)}:void 0;c(Gu,t)}else c(0)}),(()=>{c(0)})),s=Object(Wt.useContext)(vu),l=s.useBarcodeMappedData(e.barcode);Object(Wt.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const c=(t,o)=>{const a=t>=Gu,s=-r.getBoundingClientRect().width;n(a?s:0),i(!0),setTimeout((()=>{i(!1),a&&e.onDelete(e.barcode),o&&o()}),200)},u=Uu("desktop")&&e.swipeToDeleteConfig.enabled,d=!u&&e.swipeToDeleteConfig.enabled;return Object(Wt.useEffect)((()=>{d||c(0)}),[d]),Wt.default.createElement(zt.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(r=e)}},Wt.default.createElement(Vu,{config:e.swipeToDeleteConfig,visibleOffset:Gu}),Wt.default.createElement(zt.Box,Object.assign({sx:{width:"100%",backgroundColor:Ht.b.getColorValue(e.sheetColor),transform:`translateX(${t}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),Wt.default.createElement(sn,Object.assign({barcodeMappedData:l},e)),null!==e.readonlyCount&&Wt.default.createElement(zt.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:Ht.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),u&&Wt.default.createElement(jt.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:Ht.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),Wt.default.createElement(zt.Box,{sx:{width:"0px"}})))}function Yu(e){const t=Ht.b.getColorValue(e.sheetContent.dividerColor),n=e.sheetContent.manualCountChangeEnabled&&"COUNTING"===e.mode,o=(t,n)=>{let o=e.indicatorColor.partial;return n===t.count?o=e.indicatorColor.complete:0===n&&(o=e.indicatorColor.notScanned),Ht.b.getColorValue(o)};return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&Wt.default.createElement(jt.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},Wt.default.createElement(jt.a,{sx:{p:0}},e.barcodes.map((({barcode:i,count:r},a)=>{const s=e.expectedBarcodes.find((e=>e.barcodeValue===i.text));return Wt.default.createElement(jt.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&Wt.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:o(s,r),position:"absolute"}}),Wt.default.createElement(Qu,{barcode:i,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:i}),counterForm:n&&{counter:r,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[i],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:i,count:r})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:r,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:e.sheetContent.barcodeItemImageVisible,barcodeTitle:e.sheetContent.barcodeItemTitle,barcodeSubtitle:e.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:e.sheetContent.swipeToDelete,sheetColor:e.sheetContent.sheetColor}))})))))}function Xu(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return Wt.default.createElement(zt.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:e.text,showZero:!0,color:"primary",overlap:n,slotProps:{badge:{style:Object.assign(Object.assign({},t),{backgroundColor:e.backgroundColor,color:e.foregroundColor,fontWeight:"bold"})}}},e.children)}function Ku(e){if(!e.buttonStyling.visible)return null;return Wt.default.createElement(zt.Box,{style:e.style},Wt.default.createElement(Xu,{text:e.text,backgroundColor:Ht.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:Ht.b.getColorValue(e.buttonStyling.badgeForegroundColor)},Wt.default.createElement(zt.IconButton,{sx:{backgroundColor:Ht.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:Ht.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:Ht.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const qu=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,Ju=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class $u{constructor(e,t){this.expectedCount=e,this.foundCount=t}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function ed(e){const t=Object(Wt.useContext)(Ht.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return Wt.default.createElement(un,{modalOverlayColor:e.modalOverlayColor,open:e.open},Wt.default.createElement(zt.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},Wt.default.createElement(zt.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},Wt.default.createElement(Qt.a,{config:e.title})),Wt.default.createElement(zt.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},Wt.default.createElement(Qt.a,{config:e.subtitle}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:t(e.dividerColor)})),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function td(e){return e.open?Wt.default.createElement(ed,{open:e.open,dividerColor:e.style.dividerColor,modalOverlayColor:e.style.modalOverlayColor,sheetColor:e.style.sheetColor,title:e.style.title,subtitle:e.style.subtitle,cancelButton:{style:e.style.cancelButton,onClick:e.onDismiss},okButton:{style:e.style.okButton,onClick:e.onSubmit}}):null}class nd{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,o;const i=null!==(n=null===(t=this.foundBarcodes.find((t=>qu(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",r=Ju(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(o=r.title)&&void 0!==o?o:e.text}`,subtitle:Ht.b.getLocalizedText(this.barcodeItemSubtitleText,[i,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function od(e){const t=Object(Wt.useContext)(nn);return Wt.default.createElement(jt.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:Ht.b.getColorValue(e.sheetContent.sheetColor)}},Wt.default.createElement(jt.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},Wt.default.createElement(ku,Object.assign({},e.headerProps))),e.barcodeList,Wt.default.createElement(Pu,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var id=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function rd(e){const t=Object(Wt.useRef)(),n=Object(Wt.useRef)(new Date("2001-01-01")),[o,i]=Object(Wt.useReducer)(function(e,t,n,o){return(i,r)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,l=s?"COUNTING":a.mode,c=s?a.expectedBarcodes:[],u=e=>{let t=[...i];const n=r.barcodes||[r.barcode];for(const o of n){const n=t.findIndex((e=>qu(e.barcode,o)));if(-1===n)t.push({barcode:o,count:e(0)});else{const o=t[n];t[n]=Object.assign(Object.assign({},o),{count:e(o.count,o)})}}return t},d=(e,n)=>{var i;if(t.current=new Date,!n)return e;const r=null===(i=Ju(c,n.barcode))||void 0===i?void 0:i.count;return void 0===r||r===e?e:(o(),e+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...i];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...i];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return u((n=>{let i="COUNTING"===l?n+1:1;return i===n||e||(t.current=new Date,o()),i}))}return u((e=>e))}case"onARCodeClick":return u(((e,t)=>{if(s)return d(e,t);const n="UNIQUE"===l?1-e:e+1;return n>0&&o(),n}));case"onCountEditDialogChange":{let e=()=>r.count||0;if(s){const t=Ju(c,r.barcode);r.count>t.count&&(e=()=>t.count)}return u(e)}case"setCount":return u(r.computeNewCount);case"remove":return i.map((e=>Object.assign(Object.assign({},e),{count:qu(e.barcode,r.barcode)?0:e.count})));case"clear":return i.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const h=i.map((t=>qu(t.barcode,r.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:r.polygonElement,labelElement:r.labelElement})):t));return e||h.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),h}}}(e.configuration,n,e.scanningEnabled,(()=>{gn.INSTANCE.beep(e.configuration.sound),Cn.INSTANCE.vibrate(e.configuration.vibration)})),[]),[r,a]=Wt.default.useState(null),[s,l]=Object(Wt.useState)(!1),c=Object(Wt.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(Wt.useState)(!0),h=e.barcodeMapper,[m,f]=Object(Wt.useState)(null),p="FindAndPickScanningMode"===e.configuration.useCase._type,g=e.configuration.useCase,v=p?"COUNTING":g.mode,C=Object(Wt.useRef)(Object.assign(Object.assign({},Bu(e.configuration)),{onBarcodesDetected:e=>{i({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(Wt.useEffect)((()=>{if(p){const t=A();for(const n of t){const t=[(e=n.barcodeValue,new Q.BarcodeItem({text:e,format:null,quad:[],quadNormalized:[],sourceImage:null,rawBytes:null,upcEanExtension:null,extractedDocument:null}))];i({type:"setCount",barcodes:t,computeNewCount:()=>0})}}var e}),[]),Object(Wt.useEffect)((()=>{C.current.container=t.current}),[t]),Object(Wt.useEffect)((()=>{if(p)for(const e of o){const t=g.arOverlay,n=e.polygonElement,o=e.labelElement;if(w(e.barcode)){const i=_(e.barcode);let r=e.count+"/"+i.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==e.count||(r=Wt.default.createElement(zt.TouchApp,null)),i.isFulFilled()?(null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==o||o.styleBadge(t.badge.completed,Wt.default.createElement(zt.Check,null))):(null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==o||o.styleBadge(t.badge.partiallyScanned,r))}else null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==o||o.styleBadge(t.badge.rejected,Wt.default.createElement(zt.Close,null))}else for(const e of o){if(e.polygonElement){const t=g.arOverlay.polygon,n=e.count>0?t.selected:t.deselected;e.polygonElement.style(Ht.b.getPolygonColorValues(n,t.visible))}e.labelElement&&(e.labelElement.update(Object.assign(Object.assign({},e.labelElement.state.element),{highlighted:e.count>0})),e.labelElement.setCount(e.count))}}),[o]);const b=o.reduce(((e,t)=>e+t.count),0),y=()=>A().every((e=>o.some((t=>t.barcode.text===e.barcodeValue&&t.count===e.count)))),A=()=>p?g.expectedBarcodes:[],S=e=>Ju(A(),e),w=e=>!!S(e),E=()=>p?o.filter((e=>w(e.barcode))):o.filter((e=>e.count>0)),x=()=>id(this,void 0,void 0,(function*(){const t=E().map((e=>new Vt.BarcodeScannerUIItem({count:"COUNTING"===v?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),B=Wt.default.createElement(Yu,{expectedBarcodes:A(),barcodes:E(),animateBackAfterDelete:p,onBarcodeChange:i,sheetContent:g.sheetContent,onNumberClick:e=>a(e),mode:v,indicatorColor:p&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),I={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>id(this,void 0,void 0,(function*(){if(p){const e=g;let t=null;e.partialScannedAlertDialogEnabled&&!y()&&(t=e.partialScannedAlertDialog),e.confirmationAlertDialogEnabled&&y()&&(t=e.confirmationAlertDialog),t?f(t):yield x()}else yield x()}))}),title:g.sheetContent.title},T=Uu("mobile"),k="BUTTON"!==g.sheet.mode&&T?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,O=T&&"BUTTON"===g.sheet.mode,D=O?76:0,L=(u?80:0)+D,P=Object(Wt.useContext)(nn),_=e=>{const t=o.find((t=>t.barcode.text===e.text)),n=S(e);return new $u(null==n?void 0:n.count,null==t?void 0:t.count)},R=A().reduce(((e,t)=>e+t.count),0);p&&I.textReplacementArgs.push(R.toString());const F=p?new nd(g.sheetContent.barcodeItemSubtitle.text,o,A()):h,M=!p&&0===b;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(vu.Provider,{value:F},Wt.default.createElement(jt.a,{container:!0,sx:{display:"flex",flexDirection:T?"column":"row",height:`calc(${P.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},Wt.default.createElement(jt.a,{id:c,item:!0,ref:t,component:"div",xs:T?12:7,zIndex:100},O&&Wt.default.createElement(Ku,{style:{position:"absolute",marginTop:`calc(${P.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:p?`${b}/${R}`:b.toString(),onClick:()=>l(!s),buttonStyling:g.sheet.listButton}),Wt.default.createElement(xu,{viewFinderPadding:{minTopPadding:P.minTopPaddingForContent,minBottomPadding:L},arOverlay:(()=>{if(p){const e=g.arOverlay;return Object.assign(Object.assign({},e),{counterBadge:Object.assign({},e.badge.partiallyScanned)})}const e=g.arOverlay,t=e.counterBadge;return Object.assign(Object.assign({},e),{counterBadge:Object.assign(Object.assign({},t),{visible:t.visible&&"COUNTING"===v})})})(),containerId:c,barcodeScannerViewConfig:C.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+D,setActionButtonsVisible:d,arOnBarcodeClick:e=>{i({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;i({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&T,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),T&&Wt.default.createElement(Fu,{closedSheetVisibleHeight:k,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:M,onBarcodeChange:e=>i(e),drawerHeaderContentProps:I,isOpen:s,onSwipe:e=>{l("swipe-to-open"===e)}},B)),Zu("tablet")&&Wt.default.createElement(od,{headerProps:I,sheetContent:g.sheetContent,isEmptyStateVisible:M,barcodeList:B})),Wt.default.createElement(Nu,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{i({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),Wt.default.createElement(td,{open:null!==m,style:m,onDismiss:()=>f(null),onSubmit:x})))}const ad=Object(Wt.createContext)(null),sd={didCatch:!1,error:null};class ld extends Wt.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=sd}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(sd)}}componentDidCatch(e,t){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,r;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(sd))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=e;if(i){const e={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(Wt.createElement)(n,e);else{if(null!==o&&!Object(Wt.isValidElement)(o))throw r;a=o}}return Object(Wt.createElement)(ad.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function cd(){const e=Object(Wt.useRef)(!0);return Object(Wt.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function ud(e){const t=cd(),[,n]=Object(Wt.useReducer)((e=>e+1),0),o=Object(Wt.useRef)();return Object(Wt.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(Wt.useMemo)((()=>{e&&e.then((e=>{t({loading:!1,error:null,value:e})})).catch((e=>{t({loading:!1,error:{reason:e},value:void 0})}))}),[e])}(e,(e=>{o.current=e,t.current&&n()})),e?o.current:null}var dd=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class hd{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>xn(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>dd(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new Vt.BarcodeScannerUIItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield F.toDataUrl(yield eg.instance.imageToJpeg(e.sourceImage));return{title:e.text,subtitle:e.format,barcodeImage:t}}})))();this.cache.set(t,n)}return this.cache.get(t)}useBarcodeMappedData(e){const t=Object(Wt.useRef)(!1),n=ud(e&&this.getBarcodeMappedData(e));if(Object(Wt.useEffect)((()=>{n&&n.error&&(t.current=!1,this.cacheEntryPendingRetries.push({barcode:e,retry:()=>{this.cache.delete(this.hash(e)),t.current=!0}}),this.onError((()=>{for(const e of this.cacheEntryPendingRetries)e.retry();this.cacheEntryPendingRetries.length=0}),(()=>{t.current=!0;for(const e of this.cacheEntryPendingRetries)for(const t of this.onEvictionListeners)this.hash(t.barcode)==this.hash(e.barcode)&&t.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!t.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(e){this.onEvictionListeners.add(e)}removeOnEvictionListener(e){this.onEvictionListeners.delete(e)}}Vt.BarcodeItemErrorState;function md(e){return Wt.default.createElement(ed,{open:e.open,dividerColor:e.dividerColor,modalOverlayColor:e.modalOverlayColor,sheetColor:e.sheetColor,title:e.title,subtitle:e.subtitle,cancelButton:{style:e.cancelButton,onClick:e.handleCancel},okButton:{style:e.retryButton,icon:zt.Replay,onClick:e.handleRetry}})}function fd(e){const t=Object(Wt.useContext)(nn);return Wt.default.createElement(zt.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:Ht.b.getColorValue(e.config.background)}},Wt.default.createElement(zt.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.Avatar,{sx:{width:100,height:100,backgroundColor:Ht.b.getColorValue(e.config.iconBackground),margin:"24px"}},Wt.default.createElement(jt.a,{sx:{fontSize:50,color:Ht.b.getColorValue(e.config.icon.color)}}))),Wt.default.createElement(zt.Typography,{sx:{fontSize:20,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:e.config.enableCameraTitle})),Wt.default.createElement(zt.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},Wt.default.createElement(Qt.a,{config:e.config.enableCameraExplanation})),Wt.default.createElement(zt.Box,{sx:{paddingTop:"16px"}},Wt.default.createElement(tn,Object.assign({},e.config.closeButton,{onClick:e.onAppClose})))))}function pd(e){const t=Object(Wt.useRef)(Object(zt.createTheme)({palette:{primary:{main:kn.ScanbotPrimary},secondary:{main:kn.DarkGray}}})),[n,o]=Object(Wt.useState)(!1),[i,r]=Object(Wt.useState)(!1),[a,s]=Object(Wt.useState)(e.configuration.timeouts.initialScanDelay<=0),l=Object(Wt.useRef)(!1),c=Object(Wt.useRef)(),u=Object(Wt.useRef)(),d=e.configuration.useCase,h="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,m=Object(Wt.useMemo)((()=>new hd(null==h?void 0:h.barcodeItemMapper,((e,t)=>{o(!0),c.current=()=>{o(!1),e()},u.current=()=>{o(!1),t()}}))),[]);let f;if(Object(Wt.useMemo)((()=>{Ht.b.setPalette(e.configuration.palette),Ht.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(Wt.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(Wt.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(Wt.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=Wt.default.createElement(Tu,{configuration:e.configuration,barcodeMapper:m,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=Wt.default.createElement(rd,{configuration:e.configuration,barcodeMapper:m,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Zt,null),Wt.default.createElement(ld,{onError:e.onError,fallback:Wt.default.createElement("div",null,"Error")},Wt.default.createElement(Ht.a.Provider,{value:Object(Ht.c)(e.configuration.palette)},Wt.default.createElement(zt.ThemeProvider,{theme:t.current},h&&Wt.default.createElement(md,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:h.modalOverlayColor,dividerColor:h.dividerColor,sheetColor:h.sheetColor},h.errorState)),Wt.default.createElement(jt.a,{sx:{height:`100 * ${Ut}`,width:"100vw",backgroundColor:Ht.b.getColorValue(e.configuration.backgroundColor)}},Wt.default.createElement(on,Object.assign({onBackPress:e.onClose},e.configuration.topBar),!i&&f,i&&Wt.default.createElement(fd,{onAppClose:e.onClose,config:e.configuration.cameraPermission})))))))}class gd{constructor(e){this.document=e}}var vd=n(16);function Cd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),Wt.default.createElement("path",{d:"M173.211 205.398H94.7913C93.9699 205.398 93.3054 204.733 93.3054 203.912V80.0909C93.3054 79.2695 93.9699 78.605 94.7913 78.605H173.211C174.033 78.605 174.697 79.2695 174.697 80.0909V203.912C174.697 204.733 174.033 205.398 173.211 205.398ZM96.2771 202.426H171.726V81.5767H96.2771V202.426ZM160.829 184.761H152.575V181.789H160.829V184.761ZM160.829 168.252H107.173V165.28H160.829V168.252ZM160.829 151.742H152.575V148.77H160.829V151.742ZM136.065 151.742H107.173V148.77H136.065V151.742ZM160.829 135.233H152.575V132.261H160.829V135.233ZM136.065 135.233H107.173V132.261H136.065V135.233ZM160.829 118.723H152.575V115.751H160.829V118.723ZM136.065 118.723H107.173V115.751H136.065V118.723ZM160.829 102.214H152.575V99.2419H160.829V102.214ZM136.065 102.214H107.173V99.2419H136.065V102.214Z",fill:t}),Wt.default.createElement("path",{d:"M178.826 66.5525H170.571V63.5808H178.826V66.5525ZM154.062 66.5525H125.17V63.5808H154.062V66.5525ZM178.826 50.043H170.571V47.0713H178.826V50.043ZM154.062 50.043H125.17V47.0713H154.062V50.043Z",fill:t}),Wt.default.createElement("path",{d:"M111.302 35.8152C111.302 34.9939 111.967 34.3293 112.788 34.3293H191.208C192.03 34.3293 192.694 34.9939 192.694 35.8152V135.232C192.694 136.053 192.03 136.718 191.208 136.718H173.213V133.746H189.722V37.3011H114.274V80.0903H111.302V35.8152Z",fill:t}),Wt.default.createElement("path",{d:"M174.46 79.6618C174.202 78.8819 173.363 78.4596 172.583 78.7174L172.105 82.0053L188.88 134.381L191.134 136.258C191.134 136.258 191.134 134.195 192.079 134.381L174.46 79.6618Z",fill:t}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function bd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.3575 73.6228C84.5124 73.6228 83.8287 74.3065 83.8287 75.1516V189.81C83.8287 190.655 84.5124 191.339 85.3575 191.339H174.536C175.381 191.339 176.065 190.655 176.065 189.81V100.631C176.065 100.224 175.904 99.8371 175.619 99.5526L150.139 74.073C149.851 73.7842 149.464 73.6228 149.057 73.6228H85.3575ZM86.8863 76.6804V188.281H173.007V102.16H149.057C148.212 102.16 147.528 101.476 147.528 100.631V76.6804H86.8863ZM170.846 99.1025L150.585 78.8419V99.1025H170.846Z",fill:t}),Wt.default.createElement("path",{d:"M147.528 177.665H96.5686V174.607H147.528V177.665ZM164.514 167.048H96.5686V163.991H164.514V167.048ZM164.514 156.432H96.5686V153.374H164.514V156.432ZM133.149 105.956L130.987 103.795L119.33 115.456L109.767 105.893C113.742 104.559 116.613 100.801 116.613 96.3846C116.613 90.8598 112.115 86.3626 106.591 86.3626H96.5686V121.864H99.6261V106.407H105.958L117.169 117.618L105.508 129.279L107.669 131.44L119.33 119.779L130.992 131.44L133.153 129.279L121.492 117.618L133.149 105.956ZM99.6261 103.349V89.4202H106.591C110.429 89.4202 113.555 92.5457 113.555 96.3846C113.555 100.224 110.429 103.349 106.591 103.349H99.6261Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M98.0973 60.883C97.2523 60.883 96.5686 61.5667 96.5686 62.4118V73.6228H99.6261V63.9406H160.268V87.8914C160.268 88.7365 160.951 89.4202 161.796 89.4202H185.747V175.541H176.076V178.599H187.276C188.121 178.599 188.805 177.915 188.805 177.07V87.8914C188.805 87.4838 188.643 87.0973 188.359 86.8128L162.879 61.3331C162.591 61.0444 162.204 60.883 161.796 60.883H98.0973ZM183.586 86.3626L163.325 66.1021V86.3626H183.586Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.837 48.1432C109.992 48.1432 109.308 48.8269 109.308 49.672V60.883H112.366V51.2007H173.007V75.1516C173.007 75.9967 173.691 76.6804 174.536 76.6804H198.487V162.802H188.816V165.859H200.016C200.861 165.859 201.545 165.175 201.545 164.33V75.1516C201.545 74.7439 201.383 74.3575 201.099 74.073L175.619 48.5933C175.33 48.3046 174.944 48.1432 174.536 48.1432H110.837ZM196.326 73.6228L176.065 53.3623V73.6228H196.326Z",fill:t}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function yd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.2563 72.9183C84.4112 72.9183 83.7275 73.607 83.7275 74.4583V189.956C83.7275 190.807 84.4112 191.496 85.2563 191.496H174.435C175.28 191.496 175.964 190.807 175.964 189.956V100.124C175.964 99.7137 175.802 99.3244 175.518 99.0378L150.038 73.3717C149.75 73.0808 149.363 72.9183 148.955 72.9183H85.2563ZM86.7851 75.9982V188.416H172.906V101.664H148.955C148.11 101.664 147.427 100.976 147.427 100.124V75.9982H86.7851ZM170.745 98.5844L150.484 78.1756V98.5844H170.745Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M161.695 124.25H97.9961V127.33H161.695V124.25ZM161.695 137.084H97.9961V140.168H161.695V137.084ZM161.695 149.917H97.9961V153.001H161.695V149.917ZM161.695 162.75H97.9961V165.834H161.695V162.75Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M97.9961 60.0852C97.1511 60.0852 96.4674 60.774 96.4674 61.6252V72.9183H99.5249V63.1652H160.166V87.2913C160.166 88.1426 160.85 88.8313 161.695 88.8313H185.646V175.583H175.975V178.663H187.175C188.02 178.663 188.704 177.974 188.704 177.123V87.2913C188.704 86.8807 188.542 86.4914 188.258 86.2048L162.778 60.5387C162.489 60.2478 162.103 60.0852 161.695 60.0852H97.9961ZM183.485 85.7513L163.224 65.3425V85.7513H183.485Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.736 47.2522C109.891 47.2522 109.207 47.9409 109.207 48.7922V60.0852H112.265V50.3321H172.906V74.4583C172.906 75.3095 173.59 75.9982 174.435 75.9982H198.386V162.75H188.715V165.83H199.915C200.76 165.83 201.443 165.141 201.443 164.29V74.4583C201.443 74.0476 201.282 73.6583 200.998 73.3717L175.518 47.7056C175.229 47.4147 174.843 47.2522 174.435 47.2522H110.736ZM196.224 72.9183L175.964 52.5095V72.9183H196.224Z",fill:t}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Ad(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8858 67.2461H206.331C207.315 67.2461 208.112 68.0427 208.112 69.0274V148.198C208.112 149.183 207.315 149.979 206.331 149.979H57.8858C56.9011 149.979 56.1045 149.183 56.1045 148.198V69.0274C56.1045 68.0427 56.9011 67.2461 57.8858 67.2461ZM204.549 70.8088H188.502L184.935 70.8038H79.2767L75.719 70.8088H59.6672V146.417H204.549V70.8088Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M154.834 91.8126C156.378 91.2748 157.875 91.8812 159.135 93.0581C159.912 93.7836 160.383 94.9148 160.697 96.2223C161.89 101.192 158.931 105.086 155.401 107.747C154.487 108.436 153.507 109.065 152.504 109.634C152.629 111.883 152.971 113.886 153.518 115.307C153.958 116.449 154.414 116.91 154.695 117.045C154.824 117.106 155.197 117.245 156.082 116.593C157.154 115.804 158.48 114.339 160.054 111.889C162.325 108.353 163.811 105.745 164.733 103.853C164.871 103.57 164.994 103.305 165.105 103.06C164.618 101.743 165.065 100.362 165.498 99.625C165.624 99.4115 165.788 99.1797 165.997 98.9797C166.151 98.8316 166.576 98.4573 167.217 98.4428C167.593 98.4343 167.97 98.5556 168.278 98.8062C168.562 99.0368 168.712 99.3145 168.792 99.5191C168.942 99.9021 168.95 100.295 168.937 100.573C168.909 101.173 168.741 101.894 168.437 102.749C168.829 103.064 169.379 103.266 170.06 103.302C171.173 103.362 172.298 102.941 172.954 102.213C174.863 100.095 177.418 98.185 180.536 97.8253C181.365 97.7297 182.224 97.6408 183.098 97.5504C186.089 97.241 189.256 96.9135 191.961 96.2372C193.699 95.8027 195.099 95.2557 196.067 94.5713C196.998 93.9135 197.455 93.1906 197.539 92.3236L200.494 92.6118C200.305 94.546 199.225 95.9753 197.781 96.9957C196.375 97.9894 194.564 98.6466 192.681 99.1174C189.748 99.8507 186.282 100.208 183.263 100.519C182.426 100.606 181.624 100.688 180.876 100.775C178.776 101.017 176.834 102.343 175.159 104.201C173.808 105.699 171.758 106.366 169.903 106.267C168.995 106.219 168.054 105.978 167.227 105.507C166.23 107.501 164.725 110.11 162.552 113.493C160.889 116.083 159.331 117.887 157.843 118.984C156.448 120.011 154.889 120.429 153.414 119.723C152.091 119.09 151.273 117.738 150.747 116.374C150.182 114.907 149.821 113.068 149.634 111.082C147.662 111.967 145.746 112.619 144.193 113.033L143.427 110.165C145.145 109.706 147.328 108.933 149.482 107.874C149.478 107.086 149.496 106.294 149.536 105.509C149.738 101.57 150.496 97.4995 151.843 94.8477C152.501 93.5543 153.451 92.2939 154.834 91.8126ZM152.479 106.174C152.868 105.918 153.248 105.652 153.614 105.376C156.807 102.969 158.585 100.145 157.81 96.9152C157.538 95.781 157.238 95.349 157.108 95.2275C156.299 94.4715 155.923 94.577 155.81 94.6164C155.534 94.7123 155.042 95.107 154.49 96.1927C153.42 98.2992 152.695 101.883 152.501 105.661C152.493 105.832 152.485 106.003 152.479 106.174ZM165.971 100.375C165.971 100.375 165.972 100.379 165.972 100.388L165.971 100.375Z",fill:t}),Wt.default.createElement("path",{d:"M74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.851 89.0878H74.5831C73.5888 89.0878 72.7797 89.8969 72.7797 90.8912C72.7797 91.8856 73.5888 92.6947 74.5831 92.6947H81.7651C84.7317 92.6947 87.1437 95.1067 87.1437 98.0732C87.1437 101.04 84.7317 103.452 81.7651 103.452H79.9653V107.546H76.3866V103.452H70.4973V99.8767H81.7651C82.7595 99.8767 83.5686 99.0676 83.5686 98.0732C83.5686 97.0789 82.7595 96.2698 81.7651 96.2698H74.5831C71.6166 96.2698 69.2046 93.8578 69.2046 90.8912C69.2046 87.9247 71.6166 85.5126 74.5831 85.5126H76.3866V81.4189H79.9617V85.5126H85.851V89.0878ZM85.3542 86.0079V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542Z",fill:t}),Wt.default.createElement("path",{d:"M77.888 170.225C77.888 171.209 78.6847 172.006 79.6694 172.006H228.114C229.099 172.006 229.895 171.209 229.895 170.225V91.0542C229.895 90.0696 229.099 89.2729 228.114 89.2729H206.718V92.8306L210.286 92.8356H226.333V168.443H81.4507V148.197H77.888V170.225Z",fill:t}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function Sd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),Wt.default.createElement("path",{d:"M130.218 153.186H68.4406C63.9202 153.186 60.516 149.782 60.516 145.272V72.9456C60.516 68.4316 63.9202 65.0322 68.4406 65.0322H183.475C187.996 65.0322 191.4 68.4316 191.4 72.9456V126.127H188.332V72.9456C188.332 70.1334 186.291 68.0955 183.475 68.0955H68.4406C65.6244 68.0955 63.5836 70.1334 63.5836 72.9456V145.272C63.5836 148.08 65.6244 150.122 68.4406 150.122H130.218V153.186ZM167.041 114.518H128.493V111.455H167.041V114.518Z",fill:t}),Wt.default.createElement("path",{d:"M121.698 153.186H183.476C187.997 153.186 191.401 149.782 191.401 145.272L191.4 72.9456C191.4 68.4316 187.996 65.0322 183.475 65.0322H68.4406C63.9202 65.0322 60.516 68.4316 60.516 72.9456L60.5169 126.127H63.5845L63.5836 72.9456C63.5836 70.1334 65.6244 68.0955 68.4406 68.0955H183.475C186.291 68.0955 188.332 70.1334 188.332 72.9456L188.333 145.272C188.333 148.08 186.292 150.122 183.476 150.122H121.698V153.186Z",fill:t}),Wt.default.createElement("path",{d:"M215.429 174.458H104.655C99.1122 174.458 94.6003 169.953 94.6003 164.418V152.25H97.6679V164.418C97.6679 168.264 100.804 171.395 104.655 171.395H215.429C219.281 171.395 222.417 168.268 222.417 164.418V96.3454C222.417 92.4994 219.285 89.368 215.429 89.368H190.462V86.3048H215.429C220.976 86.3048 225.484 90.8103 225.484 96.3454V164.418C225.484 169.957 220.976 174.458 215.429 174.458Z",fill:t}),Wt.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M112.159 121.403H115.229V119.282C115.229 111.233 110.38 103.947 103.123 100.631C106.044 98.1624 107.766 94.5534 107.766 90.656C107.766 83.3827 101.818 77.4666 94.5044 77.4666C87.1911 77.4666 81.2423 83.3827 81.2423 90.656C81.2423 94.5534 82.9651 98.1624 85.8862 100.631C78.6283 103.947 73.7798 111.233 73.7798 119.282V121.403H76.8501V119.282C76.8501 111.551 82.1165 104.643 89.6559 102.488C90.2614 102.314 90.7006 101.788 90.7603 101.165C90.82 100.542 90.4917 99.9436 89.9288 99.6595C86.4619 97.908 84.3127 94.4601 84.3127 90.656C84.3127 85.0664 88.884 80.5201 94.5044 80.5201C100.125 80.5201 104.696 85.0664 104.696 90.656C104.696 94.4601 102.543 97.908 99.08 99.6595C98.5171 99.9436 98.1888 100.542 98.2485 101.165C98.3082 101.788 98.7474 102.314 99.3529 102.488C106.892 104.643 112.159 111.551 112.159 119.282V121.403Z",fill:"#A5A5A5"}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function wd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),Wt.default.createElement("path",{d:"M130.218 152.933H68.4406C63.9202 152.933 60.516 149.53 60.516 145.02V72.6932C60.516 68.1791 63.9202 64.7798 68.4406 64.7798H183.475C187.996 64.7798 191.4 68.1791 191.4 72.6932V125.875H188.332V72.6932C188.332 69.8809 186.291 67.843 183.475 67.843H68.4406C65.6244 67.843 63.5836 69.8809 63.5836 72.6932V145.02C63.5836 147.828 65.6244 149.87 68.4406 149.87H130.218V152.933ZM113.176 135.915H74.8314V132.852H113.176V135.915ZM100.395 101.879H74.8314C73.9836 101.879 73.2976 101.194 73.2976 100.348V79.075C73.2976 78.2283 73.9836 77.5433 74.8314 77.5433H100.395C101.242 77.5433 101.928 78.2283 101.928 79.075V100.348C101.928 101.194 101.242 101.879 100.395 101.879ZM93.4074 98.8159H98.8609V89.1156H93.4074V98.8159ZM84.8863 98.8159H90.344V87.584C90.344 86.7373 91.03 86.0524 91.8778 86.0524H98.8651V80.6066H84.8863V98.8159ZM76.3652 98.8159H81.8187V93.3701H76.3652V98.8159ZM76.3652 90.3069H81.8187V80.6066H76.3652V90.3069Z",fill:t}),Wt.default.createElement("path",{d:"M121.698 152.933H183.476C187.997 152.933 191.401 149.53 191.401 145.02L191.4 72.6932C191.4 68.1791 187.996 64.7798 183.475 64.7798H68.4406C63.9202 64.7798 60.516 68.1791 60.516 72.6932L60.5169 125.875H63.5845L63.5836 72.6932C63.5836 69.8809 65.6244 67.843 68.4406 67.843H183.475C186.291 67.843 188.332 69.8809 188.332 72.6932L188.333 145.02C188.333 147.828 186.292 149.87 183.476 149.87H121.698V152.933Z",fill:t}),Wt.default.createElement("path",{d:"M215.429 174.206H104.655C99.1122 174.206 94.6003 169.7 94.6003 164.165V151.997H97.6679V164.165C97.6679 168.011 100.804 171.143 104.655 171.143H215.429C219.281 171.143 222.417 168.016 222.417 164.165V118.897H190.462V115.834H222.417V106.134H190.462V103.07H222.417V96.093C222.417 92.2469 219.285 89.1156 215.429 89.1156H190.462V86.0524H215.429C220.976 86.0524 225.484 90.5579 225.484 96.093V164.165C225.484 169.705 220.976 174.206 215.429 174.206Z",fill:t}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function Ed(e){if(e.source instanceof vd.j)return null;const t="#FFFFFF";return Wt.default.createElement(zt.Box,{sx:{backgroundColor:"rgb(191, 191, 191)",borderRadius:1,width:"100%",height:250}},Wt.default.createElement(zt.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof vd.k)return Wt.default.createElement(Cd,{color:t});if(e.source instanceof vd.i)return Wt.default.createElement(bd,{color:t});if(e.source instanceof vd.d)return Wt.default.createElement(yd,{color:t});if(e.source instanceof vd.a)return Wt.default.createElement(Ad,{color:t});if(e.source instanceof vd.e)return Wt.default.createElement(Sd,{color:t});if(e.source instanceof vd.b)return Wt.default.createElement(wd,{color:t});if(e.source instanceof vd.c){const n=e.source;return Wt.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:"rgb(191, 191, 191)",maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function xd(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{modalOverlayColor:"rgba(0, 0, 0, 0.64)",open:e.isOpen,onClose:e.onClose,width:"min(calc(100% - 2 * 24px), 500px)",PaperProps:{sx:{m:"10px",p:"10px",maxHeight:`calc(100 * ${Ut} - 2 * 24px)`,backgroundColor:Ht.b.getColorValue(e.config.backgroundColor)}}},Wt.default.createElement(zt.Typography,{component:"div"},Wt.default.createElement(zt.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},Wt.default.createElement(Qt.a,{style:Object.assign({fontWeight:600,fontSize:16},rn(1)),config:e.config.title}),Wt.default.createElement(zt.Box,null,Wt.default.createElement(tn,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),Wt.default.createElement(zt.Box,{sx:{width:"100%",border:`1px solid ${Ht.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),Wt.default.createElement(Qt.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof vd.j;return Wt.default.createElement(zt.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},Wt.default.createElement(zt.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px"}},Wt.default.createElement(Ed,{source:e.image})),Wt.default.createElement(Qt.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))))}function Bd(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{sx:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},Wt.default.createElement(zt.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),Wt.default.createElement(zt.Box,null,Wt.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),Wt.default.createElement(zt.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function Id(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function Td(e){const t=Ht.b.getColorValue(e.textColor);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":Ht.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},Kt(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function kd(e){const[t,n]=Wt.default.useState(!1),[o,i]=Wt.default.useState(null),r=Boolean(o),a=e.config.screens.camera.topBarCameraSelect;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,{id:"sb-button-camera-select",ariaLabel:Ht.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>i(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(jt.a,null),!r&&Wt.default.createElement(jt.a,{sx:{marginX:"-4px"}}),r&&Wt.default.createElement(jt.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),Wt.default.createElement(Id,{anchor:o,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>i(null),minWidth:"calc(min(100% - 40px, 323px))"},Wt.default.createElement(zt.MenuItem,{disabled:!0,sx:{borderBottomColor:Ht.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},Wt.default.createElement(Qt.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((o=>{const r=o.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=r?a.menuEntryActive:a.menuEntry;return Wt.default.createElement(Td,{disabled:t,key:o.deviceId,autoFocus:r,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{i(null),n(!0),e.cameraSelectConfig.onSelect(o).finally((()=>n(!1)))}},s.icon.visible&&Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(s.icon.color),marginRight:"8px"}}),Wt.default.createElement(zt.Typography,{variant:"inherit",noWrap:!0},Wt.default.createElement(Qt.a,{config:Object.assign(Object.assign({},s.title),{text:o.label})})),r&&Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function Od(e){const t=e.config.screens.camera;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:Wt.default.createElement(tn,{ariaLabel:Ht.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},Wt.default.createElement(kd,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),Wt.default.createElement(tn,{ariaLabel:Ht.b.getLocalizedText(t.topBarIntroButton.accessibilityDescription),visible:t.topBarIntroButton.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:t.topBarIntroButton.color,iconVisible:!0,useShadow:!1},debugName:"show-introduction",icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function Dd(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L9 3H15L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4ZM4 19H20V7H15.95L14.125 5H9.875L8.05 7H4V19Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.80078 16.5L11.0008 7.5H13.0008L16.2008 16.5H14.3008L13.6008 14.5H10.4008L9.70078 16.5H7.80078ZM13.1508 13.15H10.8508L12.0008 9.5L13.1508 13.15Z",fill:t})))}function Ld(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{paddingTop:2,paddingRight:1}},Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.018 15.145L22.018 17.145V5.01997C22.018 4.46997 21.8222 3.99914 21.4305 3.60747C21.0388 3.2158 20.568 3.01997 20.018 3.01997H16.868L15.018 1.01997H9.01799L7.51799 2.64497L8.94299 4.06997L9.89299 3.01997H14.143L15.968 5.01997H20.018V15.145ZM2.60549 18.4325C2.99716 18.8241 3.46799 19.02 4.01799 19.02H18.193L20.493 21.32L21.918 19.895L21.043 19.02L19.043 17.02L15.668 13.645L14.218 12.195L10.843 8.81997L9.39299 7.36997L7.04299 5.01997L5.04299 3.01997L2.11799 0.0949707L0.692993 1.51997L2.69533 3.52231C2.66494 3.54959 2.63499 3.57797 2.60549 3.60747C2.21383 3.99914 2.01799 4.46997 2.01799 5.01997V17.02C2.01799 17.57 2.21383 18.0408 2.60549 18.4325ZM4.19299 5.01997H4.01799V17.02H16.193L14.1538 14.9807L12.6236 13.4506L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H10.418L9.71799 14.5325H7.81799L9.36226 10.1892L8.05722 8.8842L4.19299 5.01997ZM14.4768 9.63538L10.8494 6.00662L11.018 5.53247H13.018L14.4768 9.63538Z",fill:t}),Wt.default.createElement("path",{d:"M9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997Z",fill:t})))}function Pd(e){return"NoButtonMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null):"PagePreviewMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{"data-sb-button-preview":!0,"arial-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},Kt(e.config.pageCounter.background.fillColor)),onClick:e.onClick},Wt.default.createElement(Xu,{text:`${e.count}`,backgroundColor:Ht.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:Ht.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:Ht.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&Wt.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},Kt(e.config.style.color)),{textTransform:"none"})},Wt.default.createElement(Qt.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function _d(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint0_linear_779_506)"},Wt.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint1_linear_779_506)"},Wt.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t}),Wt.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),Wt.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t}),Wt.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function Rd(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},Wt.default.createElement("path",{d:"M22.5127 8.09418C24.6704 8.09418 26.4195 6.34504 26.4195 4.18735C26.4195 2.02967 24.6704 0.280518 22.5127 0.280518C20.355 0.280518 18.6058 2.02967 18.6058 4.18735C18.6058 6.34504 20.355 8.09418 22.5127 8.09418Z",fill:t,fillOpacity:"0.2"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M9.93003 13.2714C12.0877 13.2714 13.8369 11.5223 13.8369 9.3646C13.8369 7.20691 12.0877 5.45776 9.93003 5.45776C7.77234 5.45776 6.02319 7.20691 6.02319 9.3646C6.02319 11.5223 7.77234 13.2714 9.93003 13.2714Z",fill:t,fillOpacity:"0.4"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M4.80063 25.8922C6.95832 25.8922 8.70747 24.143 8.70747 21.9853C8.70747 19.8276 6.95832 18.0785 4.80063 18.0785C2.64295 18.0785 0.893799 19.8276 0.893799 21.9853C0.893799 24.143 2.64295 25.8922 4.80063 25.8922Z",fill:t,fillOpacity:"0.6"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M9.9282 38.4743C12.0859 38.4743 13.835 36.7252 13.835 34.5675C13.835 32.4098 12.0859 30.6606 9.9282 30.6606C7.77051 30.6606 6.02136 32.4098 6.02136 34.5675C6.02136 36.7252 7.77051 38.4743 9.9282 38.4743Z",fill:t,fillOpacity:"0.8"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M22.5127 43.7196C24.6704 43.7196 26.4195 41.9704 26.4195 39.8127C26.4195 37.655 24.6704 35.9059 22.5127 35.9059C20.355 35.9059 18.6058 37.655 18.6058 39.8127C18.6058 41.9704 20.355 43.7196 22.5127 43.7196Z",fill:t,fillOpacity:"1"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M35.0819 38.4743C37.2396 38.4743 38.9887 36.7252 38.9887 34.5675C38.9887 32.4098 37.2396 30.6606 35.0819 30.6606C32.9242 30.6606 31.175 32.4098 31.175 34.5675C31.175 36.7252 32.9242 38.4743 35.0819 38.4743Z",fill:t,fillOpacity:"0.7"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M40.1988 25.8922C42.3565 25.8922 44.1057 24.143 44.1057 21.9853C44.1057 19.8276 42.3565 18.0785 40.1988 18.0785C38.0411 18.0785 36.292 19.8276 36.292 21.9853C36.292 24.143 38.0411 25.8922 40.1988 25.8922Z",fill:t,fillOpacity:"0.5"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M35.0819 13.31C37.2396 13.31 38.9887 11.5609 38.9887 9.40317C38.9887 7.24549 37.2396 5.49634 35.0819 5.49634C32.9242 5.49634 31.175 7.24549 31.175 9.40317C31.175 11.5609 32.9242 13.31 35.0819 13.31Z",fill:t,fillOpacity:"0.3"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),Wt.default.createElement("defs",null,Wt.default.createElement("clipPath",{id:"clip0_780_4723"},Wt.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function Fd(e){const t=Ht.b.getColorValue(e.innerColor),n=Ht.b.getColorValue(e.outerColor);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5 2.66666C16.2996 2.66666 3.16666 15.7996 3.16666 32C3.16666 48.2004 16.2996 61.3333 32.5 61.3333C48.7004 61.3333 61.8333 48.2004 61.8333 32C61.8333 15.7996 48.7004 2.66666 32.5 2.66666ZM0.5 32C0.5 14.3269 14.8269 0 32.5 0C50.1731 0 64.5 14.3269 64.5 32C64.5 49.6731 50.1731 64 32.5 64C14.8269 64 0.5 49.6731 0.5 32Z",fill:n}),Wt.default.createElement("path",{d:"M56.7425 32C56.7425 45.3885 45.8889 56.242 32.5004 56.242C19.1119 56.242 8.2584 45.3885 8.2584 32C8.2584 18.6115 19.1119 7.75793 32.5004 7.75793C45.8889 7.75793 56.7425 18.6115 56.7425 32Z",fill:t})))}function Md(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{disabled:!t,onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},Kt(e.config.innerColor))},"auto"===e.state&&Wt.default.createElement(_d,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&Wt.default.createElement(Rd,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&Wt.default.createElement(Fd,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function Wd(e){const t={backgroundColor:Ht.b.getColorValue(e.config.sheetColor)};let n=[{config:e.config.okButton,onClick:e.onOkClick,debugName:"ok"},{config:e.config.actionButton,onClick:e.onActionClick,debugName:"action"},{config:e.config.cancelButton,onClick:e.onCancelClick,debugName:"cancel"}].filter((e=>e.config.visible));2===n.length&&(n=n.reverse());const o=2===n.length?6:12,[i,r]=Wt.default.useState(!0);Object(Wt.useEffect)((()=>{r(e.open)}),[e.open]);const a=i?1:.5;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},Wt.default.createElement(zt.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},Wt.default.createElement(zt.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},Wt.default.createElement(Qt.a,{config:e.config.title})),Wt.default.createElement(zt.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},Wt.default.createElement(Qt.a,{config:e.config.subtitle}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:Ht.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return Wt.default.createElement(jt.a,{item:!0,xs:o,key:t},Wt.default.createElement(ln,{disabled:!i,style:Object.assign({width:"100%",opacity:a},(n=e.config,en(Ht.b.getColorValue(n.background.fillColor))?Kt(n.foreground.color):Object.assign(Object.assign({},qt(n.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}}))),onClick:()=>{r(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,ariaLabel:Ht.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const Nd=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var Vd=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function zd(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,o="auto"===e.buttonStates.snappingModeState?Dd:Ld,i="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,r=Wt.default.createRef();Object(Wt.useEffect)((()=>{r.current&&(r.current.oncancel=e.onFileSelectDialogClosed)}),[r.current]);const[a,s]=Wt.default.useState(!1),l=()=>s(!0);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(zt.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},Wt.default.createElement("div",null,Wt.default.createElement(Jt,{onClick:e.scanLimitReached?l:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>Wt.default.createElement(jt.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&Wt.default.createElement("input",{hidden:!0,type:"file",accept:Nd.join(", "),ref:r,onChange:t=>{var n,o;e.onFileSelectDialogClosed();const i=null===(o=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===o?void 0:o[0];i&&(()=>{Vd(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(yield i.arrayBuffer(),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),Wt.default.createElement("div",null,Wt.default.createElement(Jt,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:o,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),Wt.default.createElement(Md,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?l:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),Wt.default.createElement("div",null,Wt.default.createElement(Jt,{enabled:e.buttonStates.torchButtonEnabled,config:i,icon:t=>(e.buttonStates.torchState,Wt.default.createElement(jt.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),Wt.default.createElement("div",null,Wt.default.createElement(Pd,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),Wt.default.createElement(Wd,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function jd(e){const t=Ht.b.getColorValue(e.color),n=221/376,o=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,i=e.maxWidth,r=`min(${`calc(${o} * ${n})`}, ${i})`,a=`min(${o}, ${`calc(${i} / ${n})`})`;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{style:{width:r,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M25.2696 149.527V20.2272C25.2696 9.60794 33.8814 1 44.5006 1H147.398C158.018 1 166.629 9.60794 166.629 20.2272V267.036C166.629 277.655 158.018 286.263 147.398 286.263H44.5006C33.8814 286.263 25.2696 277.655 25.2696 267.036V262.47M25.2696 200.917V183.453M27.5913 182.88V202.205M27.5913 224.958V239.567M27.5913 259.894V267.036C27.5913 267.902 27.6573 268.757 27.781 269.593L27.7889 269.64C27.8213 269.83 27.8538 270.021 27.8898 270.208C28.0875 271.246 28.3818 272.25 28.7617 273.212C28.8353 273.411 28.9166 273.609 29.0021 273.8C29.5369 275.014 30.211 276.159 31.0016 277.209C31.0791 277.304 31.157 277.411 31.2345 277.506C31.7807 278.205 32.3892 278.85 33.0366 279.457C33.3 279.701 33.5714 279.934 33.8505 280.159C33.9474 280.243 34.0482 280.32 34.149 280.392C34.4471 280.625 34.7532 280.847 35.0674 281.06L35.0712 281.063C35.0891 281.077 35.1074 281.092 35.1254 281.102C35.3193 281.228 35.5129 281.35 35.7068 281.473C35.924 281.602 36.1446 281.732 36.3656 281.854C36.5905 281.976 36.8153 282.095 37.044 282.209C37.1562 282.263 37.2726 282.32 37.3848 282.37L37.3905 282.372C37.5049 282.429 37.6194 282.485 37.7337 282.53C38.0865 282.683 38.443 282.824 38.8072 282.958C39.0477 283.045 39.2916 283.125 39.5359 283.202C39.6599 283.24 39.784 283.278 39.9081 283.313C40.2841 283.412 40.6639 283.511 41.0475 283.587C41.1716 283.614 41.2995 283.641 41.4311 283.664C41.5628 283.687 41.6907 283.713 41.8186 283.732C42.0782 283.774 42.3419 283.813 42.6053 283.839C42.7912 283.866 42.9775 283.877 43.1634 283.893C43.3184 283.904 43.4734 283.912 43.6284 283.919C43.9192 283.935 44.2059 283.942 44.5006 283.942H147.395C147.693 283.942 147.984 283.935 148.274 283.919C148.43 283.912 148.584 283.904 148.739 283.893C149.042 283.87 149.34 283.843 149.642 283.809C149.526 283.82 149.414 283.828 149.298 283.839C157.731 282.889 164.308 275.716 164.308 267.036V20.2272C164.308 11.2009 157.196 3.80228 148.274 3.34114H148.263C147.976 3.32548 147.689 3.31784 147.395 3.31784H44.5006C44.2059 3.31784 43.9231 3.32548 43.6326 3.34114H43.6284C43.4734 3.34878 43.3184 3.3568 43.1634 3.36825C43.0161 3.37969 42.8611 3.39535 42.7099 3.40679C34.2265 4.30614 27.5913 11.507 27.5913 20.2272V151.388M25.2696 238.278V226.254M34.1941 158.545V20.2306C34.1941 14.7975 38.4134 10.2996 43.8178 9.94611H43.9106L44.0499 9.93198C44.2141 9.92475 44.3641 9.92472 44.5034 9.92472H59.3495C60.1993 9.96748 60.8848 10.6244 60.9704 11.4631L60.9713 11.4779C60.9744 11.5301 60.9776 11.5829 60.9776 11.6383V11.6597C61.1811 16.011 64.772 19.4736 69.1698 19.4736H122.73C127.127 19.4736 130.718 16.011 130.922 11.6597V11.6383C130.922 11.5829 130.925 11.5304 130.928 11.4782L130.929 11.4631C131.015 10.6244 131.7 9.96748 132.549 9.92472H147.396C147.535 9.92472 147.685 9.92475 147.849 9.93198L147.988 9.94611H148.082C153.486 10.2996 157.705 14.7975 157.705 20.2306V267.036C157.705 272.376 153.536 276.892 148.217 277.308C148.165 277.312 148.123 277.315 148.081 277.319L148.078 277.319H148.042L148.014 277.323H147.953L147.932 277.327L147.93 277.327L147.929 277.327C147.751 277.335 147.574 277.342 147.396 277.342H44.5034C44.3255 277.342 44.148 277.335 43.9701 277.327L43.969 277.327L43.9679 277.327L43.9465 277.323H43.8858L43.8572 277.319H43.8217L43.8187 277.319C43.7769 277.315 43.7345 277.312 43.6823 277.308C38.3633 276.892 34.1941 272.376 34.1941 267.036V178.586M23.6521 148.301C23.6147 148.268 23.5193 148.222 23.3693 148.163C23.0612 148.043 22.636 148.008 22.2253 147.974C22.0313 147.958 21.8432 147.942 21.6714 147.919L20.8934 147.811C17.5128 147.337 13.6811 146.802 10.5597 147.83C10.3058 147.914 9.97642 148.033 9.68745 148.214C7.45931 149.607 2.80262 154.442 1.61011 159.826C0.977204 162.683 1.41084 165.294 2.89957 167.585C5.96789 172.306 10.5074 175.841 14.5438 178.676C15.524 179.364 16.6101 180.101 17.9614 180.995C18.1866 181.144 18.3939 181.293 18.5924 181.434C19.294 181.936 19.8482 182.332 20.7503 182.431C23.522 182.735 26.401 182.373 29.0765 181.383L29.3048 181.299C30.427 180.886 31.8238 180.373 32.4861 179.432C34.1031 177.136 36.2369 173.538 37.2172 169.433C37.6402 167.662 37.7405 166.251 37.5325 164.993C37.0481 162.071 34.9474 159.796 32.4452 157.346C32.1406 157.237 31.7749 156.862 31.0886 156.066C30.9542 155.91 30.8446 155.781 30.782 155.72L25.3035 150.365C24.763 149.837 24.3217 149.364 23.9259 148.769C23.8278 148.623 23.7709 148.512 23.7247 148.422M23.6521 148.301C23.6682 148.314 23.6819 148.338 23.7247 148.422M23.6521 148.301L23.6529 148.301C23.669 148.315 23.6819 148.338 23.7247 148.422M166.63 213.913L173.334 220.343M173.334 220.343L173.38 220.386C172.942 224.452 172.916 225.028 173.235 230.114M173.334 220.343C173.026 223.089 172.754 226.806 173.072 229.253M173.334 220.343C173.495 218.899 173.667 217.723 173.767 217.141M173.235 230.114C173.252 230.386 173.27 230.67 173.289 230.969L173.289 230.971M173.235 230.114L173.294 230.423C173.335 230.581 173.322 230.772 173.289 230.971M173.235 230.114L173.073 229.263M173.289 230.971L173.172 232.02M173.289 230.971C173.252 231.196 173.191 231.431 173.157 231.641M173.172 232.02L173.163 232.103M173.172 232.02C173.168 231.93 173.163 231.799 173.157 231.641M173.172 232.02C173.176 232.096 173.179 232.142 173.182 232.146M173.163 232.103L172.448 238.511M173.163 232.103C173.168 232.118 173.175 232.132 173.182 232.146M173.163 232.103C173.119 231.984 173.128 231.822 173.157 231.641M172.448 238.511L172.388 238.594C172.361 238.632 170.173 241.232 166.854 246.152M172.448 238.511L173.072 229.253M173.072 229.253C173.072 229.253 173.073 229.257 173.073 229.263M173.072 229.253L173.073 229.263M173.073 229.263C173.089 229.397 173.129 230.85 173.157 231.641M173.182 232.146C173.687 232.904 174.584 233.798 175.666 234.725M173.182 232.146C173.535 232.81 174.468 233.726 175.666 234.725M175.666 234.725C179.226 237.776 184.8 241.195 185.104 241.381C185.033 241.338 179.198 237.671 175.666 234.725ZM173.767 217.141C174.564 217.463 176.281 218.113 178.633 218.417M173.767 217.141C174.18 217.329 175.973 218.088 178.633 218.417M173.767 217.141L166.558 206.5M178.633 218.417C181.548 218.793 185.438 218.636 189.756 216.658M178.633 218.417C181.534 218.776 185.465 218.623 189.756 216.658M189.756 216.658C189.827 216.626 189.898 216.593 189.969 216.559M67.4683 323.631C70.4328 329.189 74.192 335.823 77.6768 341.522C92.8799 366.399 95.2 373.141 95.5527 374.664V375.7M67.4683 323.631C72.9296 307.707 97.7699 290.507 98.2854 290.15L98.2916 290.146C98.04 290.321 73.495 307.571 67.4683 323.631ZM67.4683 323.631C62.152 313.572 58.8077 305.831 56.9292 301.071C55.0301 296.265 52.4092 291.749 49.1397 287.657L47.9153 286.137M28.8505 204.209C31.3841 207.632 32.9003 212.464 31.6452 217.3C30.4889 221.756 27.8489 225.222 24.3855 226.861V237.921C27.7065 239.088 29.7911 241.302 30.5828 244.508C31.9643 250.084 29.9423 257.645 25.9796 261.726C24.1702 263.585 22.1669 264.543 20.1136 264.543C19.8662 264.543 19.6185 264.528 19.37 264.501L24.9855 268.636M34.147 152.964L26.212 149.313C25.8452 149.145 25.5564 149.529 25.8452 149.811L31.3237 155.166C31.3955 155.236 31.5222 155.382 31.6757 155.56L31.6786 155.563C31.9222 155.846 32.4736 156.485 32.6873 156.606H32.7968L32.9098 156.716C34.9429 158.703 37.7268 161.424 38.2968 164.867C38.5227 166.23 38.4193 167.738 37.9711 169.614C36.9622 173.838 34.7761 177.527 33.1198 179.879C32.3187 181.017 30.7957 181.577 29.5724 182.027L29.3457 182.11C27.1996 182.905 24.9271 183.312 22.6761 183.312C22.3249 183.312 21.9749 183.301 21.6252 183.281C22.2994 184.192 23.7392 186.664 25.2718 190.467M211.09 375.7V374.664L213.502 342.095L215.94 316.496L219.792 274.632C220.431 267.696 219.597 260.833 217.316 254.235C214.986 247.501 213.473 241.094 212.817 235.192C212.268 230.25 212.46 225.348 212.646 220.608C212.995 211.71 213.297 204.026 208.158 200.602C200.156 195.267 175.98 167.503 173.151 161.277C172.263 159.324 171 158.464 169.497 158.79C168.553 158.994 167.372 159.481 166.702 160.263M146.375 286.09C145.308 288.615 143.615 292.089 142.556 294.787M130.056 113.003H63.0631M130.056 84.3738H100.854M130.056 147.359H63.0631M130.056 181.714H63.0631M130.056 121.592H63.0631M130.056 92.9627H100.854M130.056 155.948H63.0631M130.056 190.303H63.0631M130.056 130.181H63.0631M130.056 164.537H63.0631M130.056 198.892H63.0631M130.056 138.77H63.0631M130.056 173.125H63.0631M130.056 207.481H63.0631M30.8954 217.105C29.7728 221.431 27.2014 224.769 23.8407 226.264C22.4226 226.896 20.8755 227.194 19.2463 227.145C13.854 226.987 9.84776 225.057 7.66123 221.564C5.3411 217.859 5.23957 212.578 7.39594 207.783C10.7883 200.246 23.0215 200.651 23.9228 200.691C25.9616 201.409 27.6374 202.632 28.9043 204.325C31.3378 207.564 32.1005 212.461 30.8954 217.105ZM23.8772 238.567C27.0829 239.619 29.0858 241.68 29.8306 244.695C31.154 250.036 29.2183 257.279 25.4236 261.184C24.0047 262.646 21.7086 264.253 18.833 263.627C16.7477 263.173 14.7108 261.619 12.78 259.001C5.82762 249.577 5.68905 247.795 8.07293 242.887C10.5545 237.78 14.2157 237.19 20.5306 237.867C21.6693 237.988 22.7263 238.2 23.6764 238.498L23.8772 238.567ZM135.782 224.965H56.7644C52.4952 224.965 49.0344 221.505 49.0344 217.235V79.8139C49.0344 75.5447 52.4952 72.0839 56.7644 72.0839H135.782C140.051 72.0839 143.512 75.5447 143.512 79.8139V217.235C143.512 221.505 140.051 224.965 135.782 224.965Z",stroke:t,strokeWidth:"1.75936"}),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function Hd(e){return Wt.default.createElement(Wt.default.Fragment,null,e.config.visible&&Wt.default.createElement(Xt,{styleConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{height:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},Wt.default.createElement(Qt.a,{config:e.config.title})))}function Ud(e){const t=e.config.screens.camera.userGuidance.statesTitles,n="auto"===e.snappingMode?t.readyToCapture:t.captureManual,o={NOT_ACQUIRED:t.noDocumentFound,OK:n,OK_BUT_TOO_SMALL:t.tooSmall,OK_BUT_BAD_ANGLES:t.badAngles,OK_BUT_BAD_ASPECT_RATIO:t.badAspectRatio,OK_BUT_OFF_CENTER:t.textHintOffCenter,OK_BUT_ORIENTATION_MISMATCH:t.badAspectRatio,OK_BUT_TOO_DARK:t.tooDark,ERROR_NOTHING_DETECTED:t.noDocumentFound,ERROR_TOO_DARK:t.tooDark,ERROR_TOO_NOISY:t.tooNoisy,START:e.config.screens.camera.userGuidance.title.text};return Wt.default.createElement(Qt.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:Ht.b.getLocalizedText(o[e.text])})})}const Zd=`calc(100 * ${Ut} - 50px - 112px)`,Gd="0.5s";function Qd(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:Zd}},e.documentScannerView),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:Zd,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),Wt.default.createElement(zt.Box,{sx:{height:Zd,position:"relative"}},Wt.default.createElement(Hd,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&Wt.default.createElement(zt.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${Zd} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},Wt.default.createElement(Xt,{styleConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},Wt.default.createElement(Ud,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&Wt.default.createElement(zt.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:Ht.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},Wt.default.createElement(jd,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${Zd} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const Yd={OK:"Capturing your document... Please do not move the camera.",OK_BUT_TOO_SMALL:"The document is too small. Try moving closer.",OK_BUT_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BUT_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_BUT_OFF_CENTER:"Try holding the device at the center of the document.",OK_BUT_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_BUT_ORIENTATION_MISMATCH:"The document seems to be upside down. Please rotate the device or document",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_TOO_NOISY:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class Xd{constructor(e){this.hint=e}}class Kd{constructor(){this.outline=new qd,this.captureButton=new th}}class qd{constructor(){this.polygon=new Jd,this.path=new $d,this.label=new eh}}class Jd{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class $d{constructor(){this.stroke="green",this.strokeWidth=4}}class eh{}class th{constructor(){this.color="#FFF"}}class nh extends U.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new r.DocumentScannerParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new Xd(Yd),this.style=new Kd,this.onDocumentDetected=function(e){},this.finder=Object(Z.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const o=new nh;if(U.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},o.finder),this.mapValues(e,o,["text","style","videoConstraints","detectionParameters"]),o.detectionParameters=new r.DocumentScannerParameters(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),e.text&&e.text.hint&&this.mapValues(e.text.hint,o.text.hint),e.style){this.mapValues(e.style,o.style,["outline","captureButton"]);const t=e.style.outline;if(t){this.mapValues(t,o.style.outline,["polygon","path","label"]);const e=t.polygon;e&&this.mapValues(e,o.style.outline.polygon);const n=t.path;n&&this.mapValues(n,o.style.outline.path);const i=t.label;i&&this.mapValues(i,o.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,o.style.captureButton)}return this.mapVideoConstraints(e,o),o}}var oh=n(46),ih={insert:"head",singleton:!1};Hc()(oh.a,ih),oh.a.locals;class rh extends Wt.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return Wt.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const e=[];for(let t=0;t<this.LINE_COUNT;t++){const n=this.props.points[t],o=this.props.points[(t+1)%this.LINE_COUNT];e.push(Wt.default.createElement("line",{key:t,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return e}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}rh.CLASSNAME="scanbot-document-outline";class ah extends Wt.default.Component{constructor(e){super(e),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(e,t,n,o){if(t&&t.some((e=>Number.isNaN(e.x)||Number.isNaN(e.y))))return;const i={points:e,animatedPoints:t,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(e){return e&&e.length>0?kc.a.toSvgString(e):kc.a.toSvgString(this.latestValidPoints)}render(){var e;this.state.points&&(this.latestValidPoints=this.state.points);const t=null!==(e=this.props.style)&&void 0!==e?e:{},n=Qc()(rh.CLASSNAME,{[`${rh.CLASSNAME}-ok`]:this.state.isOk},{[`${rh.CLASSNAME}-visible`]:this.state.isVisible},{[`${rh.CLASSNAME}-hidden`]:!this.state.isVisible});return Wt.default.createElement(Ic.polygon,{ref:e=>this.polygon=e,transition:{duration:.1},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?t.strokeCapturing:t.strokeSearching,fill:this.state.isOk?t.fillCapturing:t.fillSearching,strokeWidth:this.state.isOk?t.strokeWidthCapturing:t.strokeWidthSearching},onClick:()=>{},className:n})}}var sh=ah;class lh extends Wt.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?Wt.default.createElement(Ic.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0,d:this.state.path},transition:{strokeDashoffset:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},d:{duration:.1}},stroke:(null===(e=this.props.style)||void 0===e?void 0:e.stroke)||"white",strokeWidth:(null===(t=this.props.style)||void 0===t?void 0:t.strokeWidth)||2,fill:"none",d:this.state.path,className:`${rh.CLASSNAME}-path`}):null}animate(e){const t="M"+kc.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class ch extends Wt.default.Component{render(){return Wt.default.createElement(Ic.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},Wt.default.createElement(sh,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),Wt.default.createElement(lh,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var o;const i="processing"!==n&&!!e,r=null!==(o=this.previous)&&void 0!==o?o:e,a=this.previous?e:void 0;this.polygon.update(r,a,t,i),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class uh extends Wt.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:e,text:t,validPoints:n}=this.state,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=Qc()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},Wt.default.createElement(ch,{ref:e=>{this.polygon=e},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:e,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),o&&Wt.default.createElement("label",{ref:e=>this.label=e,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:t}}))}update(e,t,n){this.polygon.update(t,e,this.props.action),this.label&&(this.label.innerHTML=n)}}class dh{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let o=0;o<n;o++){const i=e[(o+2)%n].x-e[(o+1)%n].x,r=e[(o+2)%n].y-e[(o+1)%n].y,a=e[o].x-e[(o+1)%n].x,s=i*(e[o].y-e[(o+1)%n].y)-r*a;if(0==o)t=s>0;else if(t!=s>0)return!1}return!0}static distanceBetweenPoints(e,t){return Math.pow(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2),.5)}static intersection(e,t){const n=e[0],o=kc.a.subtract(e[1],n),i=t[0],r=kc.a.subtract(t[1],i);if(0===kc.a.cross(o,r))return;const a=kc.a.cross(kc.a.subtract(i,n),o)/kc.a.cross(o,r);return kc.a.add(i,kc.a.multiply(r,a))}}class hh{constructor(e,t=hh.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(e),this.sensitivity=t}check(e){let t=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(e[n],this.lastPolygon[n])){t=!0;break}}else t=!0;return t}reset(){this.lastPolygon=void 0}update(e){this.lastPolygon=e}isPointMoved(e,t){return dh.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new kc.a(0,0),n=new kc.a(e.width,e.height);return dh.distanceBetweenPoints(t,n)}}hh.DEFAULT_SENSITIVITY=.5;var mh=n(32),fh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.b;bn.a;class ph extends bn.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>fh(this,void 0,void 0,(function*(){const e=yield this.detectAndCrop();this.configuration.onDocumentDetected(e)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!e.sdk)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return!("searching"!=this.state.action&&"capturing"!=this.state.action&&"manual"!=this.state.action||this.disposed||this.props.pauseAR)}get configuration(){return this._configuration||(this._configuration=nh.fromJson(this.props.configuration)),this._configuration}componentDidUpdate(e){e.configuration!==this.props.configuration&&(this._configuration=void 0)}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(e,t){return fh(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(Wt.render)(Wt.default.createElement(ph,{container:n,configuration:e,onSuccess:o,onFailure:i,sdk:t}),n)}))}))}detectAndCrop(){var e,t,n,o;return fh(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"}),this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ph.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return n?(Mt.a.debug("Detect & Crop document of size: "+n.height*n.width),yield this.bridge.transferArgs.detectAndCropDocument(n)):null}}catch(e){return null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,e),null}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(e){this._configuration?this._configuration.autoCaptureEnabled=e:this.props.configuration.autoCaptureEnabled=e,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return fh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect(),this.scannerToken=this.bridge.copyArgs.createDocumentScanner(new r.DocumentScannerParameters(this.configuration.detectionParameters)),this.scannerToken.catch((e=>{var t,n;return null===(n=(t=this.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return fh(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield this.props.sdk.release(yield this.scannerToken,"Document Scanner")}))}detect(){var e,t,n,o;return fh(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const n=yield this.detectInWebWorker();if(!n||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=n.originalImage.data;const o=this.getStatusString(n),i="OK"===o,r=o.startsWith("OK")?this.scalePolygonPointsToPixels(n.pointsNormalized):void 0;this.outline.update(i,r,_.getProperty(this.configuration.text.hint,o)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,o),yield this.handleAutoCapture(i,r)}catch(e){null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,e)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(e){return this.configuration.ignoreBadAspectRatio&&"OK_BUT_BAD_ASPECT_RATIO"===e.status?"OK":e.status}detectInWebWorker(){var e,t,n,o;return fh(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(bn.c.DEFAULT_DETECTION_RESOLUTION,!1);return n&&this.enabled?yield this.bridge.transferArgs.documentScannerDetect(yield this.scannerToken,n):null}catch(e){return null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,e),null}}))}handleAutoCapture(e,t){return fh(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(e&&!this.autoCaptureToken&&t){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const e=this.getCameraFrameSize();this.polygonMovementPredicate=new hh(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>fh(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop();if(null==e?void 0:e.pointsNormalized){const t=this.scalePolygonPointsToPixels(e.pointsNormalized);if(this.runMovementPredicate(t))return}(null==e?void 0:e.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(e),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!e&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(e){this.setState({action:e})}render(){var e,t,n,o;const{action:i}=this.state,{configuration:r}=this,a=null===(e=r.style)||void 0===e?void 0:e.captureButton;return Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.a,{configuration:this.configuration,videoConstraints:r.videoConstraints,mirrored:r.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:new mh.a({visible:!1}),configuration:this.configuration.finder}),Wt.default.createElement(uh,{ref:e=>{this.outline=e},style:null===(n=r.style)||void 0===n?void 0:n.outline,action:i,autoCaptureSensitivity:this.autoCaptureSensitivity}),!(null!==(o=this.props.hideShutterButton)&&void 0!==o&&o)&&Wt.default.createElement(Xc,{color:(null==a?void 0:a.color)?a.color:"FFF",action:i,onClick:this.enabled?r.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),o=eu.a.fromHtmlElement(this.camera.video),i=hu.findScale(o,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new kc.a((e.x*this.finder.holeRect.width+this.finder.holeRect.x)/o.width,(e.y*this.finder.holeRect.height+this.finder.holeRect.y)/o.height)))),e=null==(e=hu.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>kc.a.scaleToPoint(e,i.x,i.y,i.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(bn.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}ph.DETECT_AND_CROP_RESOLUTION=0;var gh=ph;function vh(e){const[t,n]=Object(Wt.useState)(!1);return Object(Wt.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var Ch=n(13);function bh(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),Wt.default.createElement(zt.Box,{style:{height:`calc(100 * ${Ut} - 50px)`,backgroundColor:Ht.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),Wt.default.createElement("h4",{style:{margin:12}},Wt.default.createElement(Qt.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),Wt.default.createElement(zt.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:t.enableCameraExplanation})),Wt.default.createElement(zt.Box,null,Wt.default.createElement(tn,{icon:Wt.default.createElement(zt.Close,{style:{fontSize:18}}),iconPosition:"right",onClick:e.onCloseClick,visible:t.closeButton.visible,text:t.closeButton.text,background:t.closeButton.background,foreground:t.closeButton.foreground,ariaLabel:t.closeButton.accessibilityDescription,styleOverrides:{fontSize:14,padding:"8px 20px",gap:"6px"}})))))}class yh{constructor(){}static get(e,t){const n=localStorage.getItem(this.getKey(e));return null===n?t:JSON.parse(n)}static set(e,t){localStorage.setItem(this.getKey(e),JSON.stringify(t))}static clear(){localStorage.clear()}static getKey(e){return`sb_document_rtu_ui_${e}`}}var Ah=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Sh(e,t){return Ah(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var wh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Eh(e){var t;const n=e.configuration.screens.camera,[o,i]=Object(Wt.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[r,a]=Object(Wt.useState)(n.cameraConfiguration.flashEnabled),[s,l]=Wt.default.useState(!1),c=Object(Wt.useRef)(null);const[u,d]=Object(Wt.useState)((()=>!yh.get("hasSeenIntroduction",!1)||n.introduction.showAutomatically));Object(Wt.useEffect)((()=>{e.scanLimitReached&&i("manual")}),[e.scanLimitReached]);const h=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[m,f]=Object(Wt.useState)(null),p=ud(null==h?void 0:h.finalImageUrl());Object(Wt.useEffect)((()=>{0===e.pages.length?f(null):p.value&&f(p.value)}),[p,e.pages.length]);const g="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===o,v={minTopPadding:20+(n.topUserGuidance.visible?40:0),minBottomPadding:20+(g?56:0)},[C,b]=Object(Wt.useState)(!1),y=0===n.timeouts.initialScanDelay||vh(n.timeouts.initialScanDelay),[A,S]=Object(Wt.useState)("START"),[w,E]=Object(Wt.useState)(!0),{documentScannerView:x,documentScannerViewRef:B,torchSupported:I,scannerInitialized:T,activeCamera:k,availableCameras:O,setActiveCamera:D}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,o=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),i=e=>o?Ht.b.getColorValue(e):"#00000000",r=(new nh).videoConstraints;r.facingMode="FRONT"===n.cameraModule?"user":"environment";const a=!e.scanningPaused&&"auto"===e.snappingMode,s={videoConstraints:r,onError:e.onError,backgroundColor:Ht.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:a,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,ignoreBadAspectRatio:n.ignoreBadAspectRatio,detectionParameters:{aspectRatios:n.requiredAspectRatios,acceptedAngleScore:n.acceptedAngleScore,acceptedBrightnessThreshold:n.acceptedBrightnessThreshold,acceptedSizeScore:n.acceptedSizeScore},spinnerColor:"transparent",style:{outline:{label:{backgroundColor:"transparent",color:"transparent"},path:{stroke:i(t.polygon.autoSnapProgress.strokeColor),strokeWidth:t.polygon.autoSnapProgress.strokeWidth},polygon:{strokeWidthSearching:t.polygon.documentNotOk.strokeWidth,strokeSearching:i(t.polygon.documentNotOk.strokeColor),fillSearching:i(t.polygon.documentNotOk.fillColor),strokeWidthCapturing:t.polygon.documentOk.strokeWidth,fillCapturing:i(t.polygon.documentOk.fillColor),strokeCapturing:i(t.polygon.documentOk.strokeColor)}}},finder:t.viewFinder},l=Object(Wt.useRef)(null);Object(Wt.useEffect)((()=>()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.dispose()}),[]),Object(Wt.useEffect)((()=>{l.current&&(a?l.current.enableAutoCapture():l.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,l.current]);const[c,u]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{l.current&&c&&l.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,l.current,c]);const[d,h]=Object(Wt.useState)(!1),[m,f]=Object(Wt.useState)(null),[p,g]=Object(Wt.useState)([]);Object(Wt.useEffect)((()=>{l.current||h(!1)}),[l.current]);const v=Wt.default.createElement(gh,{sdk:e.sdk,ref:l,configuration:s,onSuccess:function(){var e,t,n;u(null===(e=l.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),h(!0);const o=null===(t=l.current)||void 0===t?void 0:t.getActiveCameraInfo();f(null!=o?o:null),g(o?[o]:[]),null===(n=l.current)||void 0===n||n.fetchAvailableCameras().then(g)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,viewFinderPadding:e.viewFinderPadding,pauseAR:e.pauseAR});return{documentScannerView:v,documentScannerViewRef:l,torchSupported:c,scannerInitialized:d,activeCamera:m,availableCameras:p,setActiveCamera:function(e){var t;return f(e),null===(t=l.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{R(Sh(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!w||"ERROR_NOTHING_DETECTED"!==e&&L)&&(S(e),E(!1))},snappingMode:o,scanningPaused:e.scanningPaused||!y,torchEnabled:r,onError:t=>{t instanceof Ch.a?b(!0):e.onError(t)},viewFinderPadding:v,pauseAR:!e.visible||e.scanningPaused||!y}),L=vh(1e3),[P,_]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{requestAnimationFrame((()=>_(!1)))}),[P]);function R(t){_(n.captureFeedback.cameraBlinkEnabled),Cn.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},Wt.default.createElement(xd,{config:n.introduction,isOpen:u,onClose:()=>{d(!1),yh.set("hasSeenIntroduction",!0)}}),Wt.default.createElement(Od,{cameraSelectConfig:{availableCameras:O,activeCamera:k,onSelect:e=>wh(this,void 0,void 0,(function*(){yield D(e),a(!1)}))},onCloseButtonClick:()=>{var t;0===e.pages.length?null===(t=e.onClose)||void 0===t||t.call(e):l(!0)},config:e.configuration,onShowIntroButtonClick:()=>d(!0)}),Wt.default.createElement(Qd,{config:e.configuration,sdk:e.sdk,documentScannerView:x,showHand:w,userGuidanceText:A,bottomUserGuidanceVisible:g,snappingMode:o,showCameraBlink:P}),Wt.default.createElement(zd,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:o,snappingModeButtonEnabled:!e.scanLimitReached,torchState:r&&I?"on":"off",torchButtonEnabled:I,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:m,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!T?"loading":o},sdk:e.sdk,onFileSelectDialogOpened:function(){c.current=o,i("manual")},onFileSelectDialogClosed:function(){c.current&&(i(c.current),c.current=null)},onFileUploaded:t=>e.onImageCaptured(Sh(t,"IMPORTED")),snappingModeButtonClick:()=>i((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return wh(this,void 0,void 0,(function*(){E(!1),R(Sh(null===(e=B.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),Wt.default.createElement(Wd,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>l(!1),onActionClick:()=>{},onOkClick:e.onClose}),Wt.default.createElement(bh,{visible:C,onCloseClick:e.onClose,config:e.configuration})))}function xh(e){const t=Object(Wt.useMemo)((()=>Object(zt.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.ThemeProvider,{theme:t},Wt.default.createElement(zt.Typography,{component:"div"},e.children)))}function Bh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_856_1211)"},Wt.default.createElement("path",{d:"M3 9V3H5V6.35C5.83333 5.31667 6.85417 4.5 8.0625 3.9C9.27083 3.3 10.5833 3 12 3C13.9667 3 15.7208 3.55833 17.2625 4.675C18.8042 5.79167 19.8833 7.23333 20.5 9H18.325C17.7583 7.8 16.9167 6.83333 15.8 6.1C14.6833 5.36667 13.4167 5 12 5C11.05 5 10.1542 5.175 9.3125 5.525C8.47083 5.875 7.73333 6.36667 7.1 7H9V9H3ZM6 18H18L14.25 13L11.25 17L9 14L6 18ZM5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V12H5V20H19V12H21V20C21 20.55 20.8042 21.0208 20.4125 21.4125C20.0208 21.8042 19.55 22 19 22H5Z",fill:t})))}function Ih(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return Wt.default.createElement(zt.Box,{sx:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},Wt.default.createElement(zt.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},Wt.default.createElement(Jt,{config:e.config.retakeButton,icon:Bh,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),Wt.default.createElement(Jt,{config:n,icon:e=>Wt.default.createElement(zt.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function Th(e){if(!e.config.visible)return null;const t=Ht.b.getColorValue(e.config.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_447_6066)"},Wt.default.createElement("path",{d:"M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H13V5H5V19H19V11H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM6 17H18L14.25 12L11.25 16L9 13L6 17Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.17 8.83C15.95 9.61 16.8933 10 18 10C19.1067 10 20.05 9.61 20.83 8.83C21.61 8.05 22 7.10667 22 6C22 4.89333 21.61 3.95 20.83 3.17C20.05 2.39 19.1067 2 18 2C16.8933 2 15.95 2.39 15.17 3.17C14.39 3.95 14 4.89333 14 6C14 7.10667 14.39 8.05 15.17 8.83ZM18.4 6.8V3.6H17.6V6.8H18.4ZM18.28 8.28C18.2 8.36 18.1067 8.4 18 8.4C17.8933 8.4 17.8 8.36 17.72 8.28C17.64 8.2 17.6 8.10667 17.6 8C17.6 7.89333 17.64 7.8 17.72 7.72C17.8 7.64 17.8933 7.6 18 7.6C18.1067 7.6 18.2 7.64 18.28 7.72C18.36 7.8 18.4 7.89333 18.4 8C18.4 8.10667 18.36 8.2 18.28 8.28Z",fill:t})))}function kh(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return Wt.default.createElement(zt.Box,{style:Object.assign({backgroundColor:Ht.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:Ht.b.getColorValue(t.strokeColor),display:"flex",alignItems:"center",flexDirection:"row",padding:"10px",borderRadius:"5px",alignSelf:"center",width:"calc(100% - 40px)",margin:10,maxWidth:"438px"},e.style)},Wt.default.createElement(Th,{config:e.config.icon}),Wt.default.createElement(Qt.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function Oh(e){return Wt.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${Ut} - 78px - 52px - 20px)`},src:e.image,alt:""})}function Dh(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return Wt.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%"}},Wt.default.createElement(Oh,{image:e.base64Image}),Wt.default.createElement(kh,{visible:!t,config:e.banner.config}),Wt.default.createElement(Ih,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function Lh(e){const t=Ht.b.getColorValue(e.config.checkMarkColor),n=Ht.b.getColorValue(e.config.checkMarkBackgroundColor);return Wt.default.createElement("svg",{"data-sb-acknowledgment-checkmark":!0,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M71.2135 31.8234C72.376 32.9859 72.376 34.8984 71.2135 36.0609L43.0885 64.1859C42.5073 64.7672 41.7385 65.0672 40.9698 65.0672C40.201 65.0672 39.4323 64.7672 38.851 64.1859L24.7885 50.1234C23.626 48.9609 23.626 47.0484 24.7885 45.8859C25.951 44.7234 27.8635 44.7234 29.026 45.8859L40.9698 57.8297L66.976 31.8234C68.1385 30.6422 70.051 30.6422 71.2135 31.8234Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48 0C21.525 0 0 21.525 0 48C0 74.475 21.525 96 48 96C74.475 96 96 74.475 96 48C96 21.525 74.475 0 48 0ZM71.2135 36.0609C72.376 34.8984 72.376 32.9859 71.2135 31.8234C70.051 30.6422 68.1385 30.6422 66.976 31.8234L40.9698 57.8297L29.026 45.8859C27.8635 44.7234 25.951 44.7234 24.7885 45.8859C23.626 47.0484 23.626 48.9609 24.7885 50.1234L38.851 64.1859C39.4323 64.7672 40.201 65.0672 40.9698 65.0672C41.7385 65.0672 42.5073 64.7672 43.0885 64.1859L71.2135 36.0609Z",fill:n}))}function Ph(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return Wt.default.createElement(Oh,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return Wt.default.createElement(Lh,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var _h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Rh(e){const t=ud(e.croppedDetectionResult);Object(Wt.useEffect)((()=>{(null===(null==t?void 0:t.value)||(null==t?void 0:t.error))&&e.onReject()}),[null==t?void 0:t.value,null==t?void 0:t.error]);const n=e.configuration.screens.camera.acknowledgement,o=e.configuration.screens.camera.captureFeedback,i=e.configuration.outputSettings,r=n.acknowledgementMode,[a,s]=Wt.default.useState(null),[l,c]=Wt.default.useState(null),u=Wt.default.useRef(null),d=null!==l,h=()=>"ALWAYS"===r||"NONE"!==r&&(!!d&&("BAD_QUALITY"===r&&!l)),m=t=>{setTimeout((()=>{f(),e.onAccept(t,u.current)}),1500)},f=()=>{s(null),c(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(Wt.useEffect)((()=>{var a;if(null==t?void 0:t.value){const l=t.value.value;let d=null!==(a=l.croppedImage)&&void 0!==a?a:l.originalImage;function h(){return _h(this,void 0,void 0,(function*(){null!==i.defaultFilter&&"FILTERED_DOCUMENT"===i.documentAnalysisMode&&(d=yield e.sdk.imageFilter(d,i.defaultFilter,"COPY_IMAGE"));if("PageSnapFunnelAnimation"===o.snapFeedbackMode._type||"ALWAYS"===r||"BAD_QUALITY"===r){const t=yield e.sdk.imageToJpeg(d),n=yield F.toBase64(t,!1);s(n)}if("NONE"===r)return c(!0),void m(t.value);if(null===l.croppedImage)return void c(!1);const a=yield e.sdk.createDocumentQualityAnalyzer(),h=yield a.analyze(d);u.current=h.quality,yield a.release();const f=p[h.quality]>=p[n.minimumQuality];c(f),f&&"BAD_QUALITY"===r&&m(t.value)}))}return h(),()=>{f()}}}),[null==t?void 0:t.value]),g=h()?n.backgroundColor:"PageSnapFeedbackNone"===o.snapFeedbackMode._type?"transparent":o.snapFeedbackMode.overlayColor,g=Ht.b.getColorValue(g);const v=o.cameraBlinkEnabled?Gd:"0s";return Wt.default.createElement(jt.a,{open:e.visible},Wt.default.createElement(zt.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${Ut})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},Wt.default.createElement(zt.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},Wt.default.createElement(Ph,{visible:!h()&&d,base64Image:a,mode:o.snapFeedbackMode}),Wt.default.createElement(Dh,{visible:h(),isQualityAcceptable:l,base64Image:a,banner:{config:n.badImageHint},bottomBar:{backgroundColor:e.configuration.appearance.bottomBarBackgroundColor,config:n.bottomBar,onRetake:()=>{f(),e.onReject()},onAccept:()=>{f(),e.onAccept(null==t?void 0:t.value,u.current)}}}))))}var Fh=n(2);function Mh(e){const t=e.config.screens.review,[n,o]=Wt.default.useState(null);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Bd,{backgroundColor:Ht.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:Wt.default.createElement(tn,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,{disabled:!e.buttonsEnabled,onClick:e=>o(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new Fh.BackgroundStyle({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new Fh.ForegroundStyle({color:t.topBarMoreButton.color,iconVisible:!0}),icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:Ht.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),Wt.default.createElement(zt.Menu,{anchorEl:n,open:null!==n,onClose:()=>o(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:Ht.b.getColorValue(t.morePopup.backgroundColor)}}}},Wt.default.createElement(Td,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{o(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),Wt.default.createElement(Qt.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function Wh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M6 22C5.45 22 4.97917 21.8042 4.5875 21.4125C4.19583 21.0208 4 20.55 4 20V4C4 3.45 4.19583 2.97917 4.5875 2.5875C4.97917 2.19583 5.45 2 6 2H14L20 8V12.35C19.6833 12.2333 19.3583 12.1458 19.025 12.0875C18.6917 12.0292 18.35 12 18 12V9H13V4H6V20H12.35C12.4833 20.3833 12.65 20.7417 12.85 21.075C13.05 21.4083 13.2833 21.7167 13.55 22H6Z",fill:t}),Wt.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function Nh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_856_1229)"},Wt.default.createElement("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:t})))}function Vh(){return Zu("tablet")?80:160}function zh(e){const t=Zu("tablet"),n=e.config.screens.review,o=Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Xt,{style:{height:42,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,textTransform:"none",padding:"0 20px",width:"100%"},styleConfig:Object.assign(Object.assign({},n.bottomBar.submitButton.background),{cornerRadius:4})},Wt.default.createElement(Qt.a,{config:{text:Ht.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),i=Object.assign(Object.assign({padding:"4px"},qt(n.bottomBar.submitButton.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}});return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:Vh(),width:"100%"}},Wt.default.createElement(zt.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&Wt.default.createElement(zt.Box,{visibility:"hidden"}),Wt.default.createElement(zt.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:Wh,onClick:e.onAddPageClick,debugName:"add-page"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:Bh,onClick:e.onRetakeClick,debugName:"retake"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>Wt.default.createElement(jt.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>Wt.default.createElement(jt.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:Nh,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&Wt.default.createElement(zt.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":Ht.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},i),onClick:e.onSubmitClick},o)),!t&&Wt.default.createElement(zt.Box,{style:{padding:"12px",display:"flex"}},Wt.default.createElement(zt.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":Ht.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},i),onClick:e.onSubmitClick},o))))}function jh(e){return Wt.default.createElement(zt.Box,{style:{display:"flex",width:"100%",backgroundColor:Ht.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},Wt.default.createElement(zt.Box,{style:{width:72,height:20}}),Wt.default.createElement(zt.Box,null,Wt.default.createElement(Xt,{styleConfig:{strokeColor:e.config.pageCounter.background.strokeColor,fillColor:e.config.pageCounter.background.fillColor,strokeWidth:e.config.pageCounter.background.strokeWidth,cornerRadius:4}},Wt.default.createElement(Qt.a,{config:e.config.pageCounter.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.IconButton,{onClick:e.onZoomButtonClick,"aria-label":Ht.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:Ht.b.getColorValue(e.config.zoomButton.backgroundColor),color:Ht.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:Ht.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:Ht.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},qt(e.config.zoomButton.foregroundColor))},Wt.default.createElement(jt.a,null))))}function Hh(){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("path",{d:"M5.6236 27.7347C2.97532 25.2802 1.23517 22.0019 0.686077 18.4331C0.136983 14.8642 0.811227 11.2145 2.59919 8.0774C4.38716 4.94028 7.1837 2.50018 10.5342 1.15382C13.8847 -0.192539 17.592 -0.365996 21.0536 0.661651L20.0518 4.03609C17.3518 3.23452 14.46 3.36982 11.8467 4.41998C9.23329 5.47014 7.05198 7.37342 5.65737 9.82037C4.26276 12.2673 3.73685 15.1141 4.16514 17.8978C4.59343 20.6815 5.95075 23.2385 8.01641 25.1531L5.6236 27.7347Z",fill:"black",fillOpacity:"0.15"},Wt.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"})),Wt.default.createElement("path",{d:"M16.5 1.76C16.5 0.787979 17.2903 -0.0100083 18.2565 0.0967004C20.3808 0.331329 22.4428 0.989952 24.3179 2.04006C26.7065 3.37771 28.7119 5.30584 30.1422 7.64002C31.5726 9.9742 32.3802 12.6364 32.4877 15.3718C32.5951 18.1073 31.9989 20.8246 30.7561 23.2638C29.5133 25.7031 27.6654 27.7826 25.3891 29.3035C23.1129 30.8244 20.4845 31.7359 17.7553 31.9507C15.0262 32.1655 12.2876 31.6764 9.80145 30.5303C7.84973 29.6305 6.10487 28.3495 4.6664 26.7687C4.01218 26.0498 4.19322 24.9414 4.9796 24.3701C5.76598 23.7987 6.85859 23.9836 7.5348 24.6819C8.60362 25.7856 9.87071 26.6862 11.2751 27.3336C13.2143 28.2276 15.3504 28.6091 17.4792 28.4415C19.6079 28.274 21.6581 27.5631 23.4335 26.3767C25.209 25.1904 26.6503 23.5684 27.6198 21.6658C28.5892 19.7632 29.0542 17.6437 28.9704 15.51C28.8865 13.3764 28.2567 11.2999 27.1409 9.47922C26.0252 7.65856 24.4611 6.15461 22.598 5.11125C21.2487 4.35561 19.7753 3.85986 18.2542 3.6439C17.2918 3.50727 16.5 2.73202 16.5 1.76Z",fill:"black"},Wt.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"}))))}function Uh(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},Wt.default.createElement(zt.Box,{"data-sb-loading-spinner":!0,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-busy":open?"true":"false",style:{backgroundColor:"#EFEFEF",border:"1px solid #CCC",borderRadius:"4px",height:65,width:65,display:"flex",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(Hh,null))))}function Zh(e){const t=e.config.visible&&e.active;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("div",{style:{width:"40px"}},Wt.default.createElement(zt.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:Ht.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},Kt(e.config.color)),onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription)},Wt.default.createElement(e.icon,null))))}var Gh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Qh(e){var t,n;const o=ud(e.page.finalImageUrl()),[i,r]=Wt.default.useState(null),[a,s]=Wt.default.useState(!1);Object(Wt.useEffect)((()=>{(()=>{Gh(this,void 0,void 0,(function*(){!e.animateRotation&&o.value&&(yield new Promise((e=>{const t=document.createElement("img");t.onload=e,t.src=o.value})),r(o.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[o.value,e.animateRotation]);const l=Wt.default.useRef(null),c=(()=>{const e=l.current;if(a&&e){const t=e.parentElement;let n;if([e.clientHeight,e.clientWidth,t.clientHeight,e.clientHeight].some((e=>0===e)))n=1;else{const o=1/(e.clientWidth/e.clientHeight),i=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):o<i?t.clientHeight/e.clientWidth:t.clientWidth/e.clientHeight}return{transform:`rotate(90deg) scale(${n})`,transition:"transform 0.5s"}}return{transform:"none",transition:"none"}})();return null===i&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):Wt.default.createElement(Wt.default.Fragment,null,i&&Wt.default.createElement("img",{"data-sb-carousel-page":!0,ref:l,onTransitionEnd:()=>{var t,n;return null===(n=(t=e.onAnimateRotationDone).current)||void 0===n?void 0:n.call(t)},style:Object.assign(Object.assign({},e.style),c),src:i,alt:`Page ${e.index}`}))}function Yh(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Xh(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every((n=>{const o=e[n],i=t[n];return"function"==typeof o?`${o}`==`${i}`:Yh(o)&&Yh(i)?Xh(o,i):o===i}))}function Kh(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function qh(e){return"number"==typeof e}function Jh(e){return"string"==typeof e}function $h(e){return"boolean"==typeof e}function em(e){return"[object Object]"===Object.prototype.toString.call(e)}function tm(e){return Math.abs(e)}function nm(e){return Math.sign(e)}function om(e,t){return tm(e-t)}function im(e){return cm(e).map(Number)}function rm(e){return e[am(e)]}function am(e){return Math.max(0,e.length-1)}function sm(e,t){return t===am(e)}function lm(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function cm(e){return Object.keys(e)}function um(e,t){return[e,t].reduce(((e,t)=>(cm(t).forEach((n=>{const o=e[n],i=t[n],r=em(o)&&em(i);e[n]=r?um(o,i):i})),e)),{})}function dm(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function hm(){let e=[];const t={add:function(n,o,i,r={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(o,i,r),a=()=>n.removeEventListener(o,i,r);else{const e=n;e.addListener(i),a=()=>e.removeListener(i)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function mm(e,t,n,o){const i=hm(),r=1e3/60;let a=null,s=0,l=0;function c(e){if(!l)return;a||(a=e);const i=e-a;for(a=e,s+=i;s>=r;)n(r),s-=r;o(s/r),l&&t.requestAnimationFrame(c)}function u(){t.cancelAnimationFrame(l),a=null,s=0,l=0}return{init:function(){i.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){u(),i.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:()=>n(r),render:o}}function fm(e=0,t=0){const n=tm(e-t);function o(t){return t<e}function i(e){return e>t}function r(e){return o(e)||i(e)}return{length:n,max:t,min:e,constrain:function(n){return r(n)?o(n)?e:t:n},reachedAny:r,reachedMax:i,reachedMin:o,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function pm(e,t,n){const{constrain:o}=fm(0,e),i=e+1;let r=a(t);function a(e){return n?tm((i+e)%i):o(e)}function s(){return r}function l(){return pm(e,s(),n)}const c={get:s,set:function(e){return r=a(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function gm(e,t,n,o,i,r,a,s,l,c,u,d,h,m,f,p,g,v,C){const{cross:b,direction:y}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=hm(),E=hm(),x=fm(50,225).constrain(m.measure(20)),B={mouse:300,touch:400},I={mouse:500,touch:600},T=f?43:25;let k=!1,O=0,D=0,L=!1,P=!1,_=!1,R=!1;function F(e){if(!dm(e,o)&&e.touches.length>=2)return M(e);const t=r.readPoint(e),n=r.readPoint(e,b),a=om(t,O),l=om(n,D);if(!P&&!R){if(!e.cancelable)return M(e);if(P=a>l,!P)return M(e)}const u=r.pointerMove(e);a>p&&(_=!0),c.useFriction(.3).useDuration(.75),s.start(),i.add(y(u)),e.preventDefault()}function M(e){const t=u.byDistance(0,!1).index!==d.get(),n=r.pointerUp(e)*(f?I:B)[R?"mouse":"touch"],o=function(e,t){const n=d.add(-1*nm(e)),o=u.byDistance(e,!f).distance;return f||tm(e)<x?o:g&&t?.5*o:u.byIndex(n.get(),0).distance}(y(n),t),i=function(e,t){if(0===e||0===t)return 0;if(tm(e)<=tm(t))return 0;const n=om(tm(e),tm(t));return tm(n/e)}(n,o),a=T-10*i,s=v+i/50;P=!1,L=!1,E.clear(),c.useDuration(a).useFriction(s),l.distance(o,!f),R=!1,h.emit("pointerUp")}function W(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!C)return;function s(s){($h(C)||C(e,s))&&function(e){const s=dm(e,o);if(R=s,_=f&&s&&!e.buttons&&k,k=om(i.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;L=!0,r.pointerDown(e),c.useFriction(0).useDuration(0),i.set(a),function(){const e=R?n:t;E.add(e,"touchmove",F,S).add(e,"touchend",M).add(e,"mousemove",F,S).add(e,"mouseup",M)}(),O=r.readPoint(e),D=r.readPoint(e,b),h.emit("pointerDown")}(s)}const l=t;w.add(l,"dragstart",(e=>e.preventDefault()),S).add(l,"touchmove",(()=>{}),S).add(l,"touchend",(()=>{})).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",M).add(l,"contextmenu",M).add(l,"click",W,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return L}}}function vm(e,t){let n,o;function i(e){return e.timeStamp}function r(n,o){const i="client"+("x"===(o||e.scroll)?"X":"Y");return(dm(n,t)?n:n.touches[0])[i]}return{pointerDown:function(e){return n=e,o=e,r(e)},pointerMove:function(e){const t=r(e)-r(o),a=i(e)-i(n)>170;return o=e,a&&(n=e),t},pointerUp:function(e){if(!n||!o)return 0;const t=r(o)-r(n),a=i(e)-i(n),s=i(e)-i(o)>170,l=t/a;return a&&!s&&tm(l)>.1?l:0},readPoint:r}}function Cm(e,t,n,o,i,r,a){const s=[e].concat(o);let l,c,u=[],d=!1;function h(e){return i.measureSize(a.measure(e))}return{init:function(i){r&&(c=h(e),u=o.map(h),l=new ResizeObserver((n=>{($h(r)||r(i,n))&&function(n){for(const r of n){if(d)return;const n=r.target===e,a=o.indexOf(r.target),s=n?c:u[a];if(tm(h(n?e:o[a])-s)>=.5){i.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>l.observe(e)))})))},destroy:function(){d=!0,l&&l.disconnect()}}}function bm(e,t,n,o,i){const r=i.measure(10),a=i.measure(50),s=fm(.1,.99);let l=!1;function c(){return!l&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(i){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=tm(e[l]-t.get()),d=n.get()-t.get(),h=s.constrain(u/a);n.subtract(d*h),!i&&tm(d)<r&&(n.set(e.constrain(n.get())),o.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function ym(e,t,n,o){const i=t.min+.1,r=t.max+.1,{reachedMin:a,reachedMax:s}=fm(i,r);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const i=e*(-1*t);o.forEach((e=>e.add(i)))}}}function Am(e,t,n,o,i){const{reachedAny:r,removeOffset:a,constrain:s}=o;function l(e){return e.concat().sort(((e,t)=>tm(e)-tm(t)))[0]}function c(t,o){const i=[t,t+n,t-n];if(!e)return t;if(!o)return l(i);const r=i.filter((e=>nm(e)===o));return r.length?l(r):rm(i)-n}const u={byDistance:function(n,o){const l=i.get()+n,{index:u,distance:d}=function(n){const o=e?a(n):s(n),i=t.map(((e,t)=>({diff:c(e-o,0),index:t}))).sort(((e,t)=>tm(e.diff)-tm(t.diff))),{index:r}=i[0];return{index:r,distance:o}}(l),h=!e&&r(l);return!o||h?{index:u,distance:n}:{index:u,distance:n+c(t[u]-d,0)}},byIndex:function(e,n){return{index:e,distance:c(t[e]-i.get(),n)}},shortcut:c};return u}function Sm(e,t,n,o,i,r,a,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(r.add(document,"keydown",u,!1),t.forEach(((t,u)=>{r.add(t,"focus",(t=>{($h(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));qh(r)&&(i.useDuration(0),o.index(r,0),a.emit("slideFocus"))}(u)}),l)})))}}}function wm(e){let t=e;function n(e){return qh(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function Em(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},o=t.style;let i=!1;return{clear:function(){i||(o.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){i||(o.transform=n(e.direction(t)))},toggleActive:function(e){i=!e}}}function xm(e,t,n,o,i,r,a,s,l){const c=im(i),u=im(i).reverse(),d=function(){const e=a[0];return f(m(u,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(m(c,e),-n,!0)}());function h(e,t){return e.reduce(((e,t)=>e-i[t]),t)}function m(e,t){return e.reduce(((e,n)=>h(e,t)>0?e.concat([n]):e),[])}function f(i,a,c){const u=function(e){return r.map(((n,i)=>({start:n-o[i]+.5+e,end:n+t-.5+e})))}(a);return i.map((t=>{const o=c?0:-n,i=c?n:0,r=c?"end":"start",a=u[t][r];return{index:t,loopPoint:a,slideLocation:wm(-1),translate:Em(e,l[t]),target:()=>s.get()>a?o:i}}))}return{canLoop:function(){return d.every((({index:e})=>h(c.filter((t=>t!==e)),t)<=.1))},clear:function(){d.forEach((e=>e.translate.clear()))},loop:function(){d.forEach((e=>{const{target:t,translate:n,slideLocation:o}=e,i=t();i!==o.get()&&(n.to(i),o.set(i))}))},loopPoints:d}}function Bm(e,t,n){let o,i=!1;return{init:function(r){n&&(o=new MutationObserver((e=>{i||($h(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),o.observe(e,{childList:!0}))},destroy:function(){o&&o.disconnect(),i=!0}}}function Im(e,t,n,o){const i={};let r,a=null,s=null,l=!1;return{init:function(){r=new IntersectionObserver((e=>{l||(e.forEach((e=>{const n=t.indexOf(e.target);i[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:o}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),l=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return cm(i).reduce(((t,n)=>{const o=parseInt(n),{isIntersecting:r}=i[o];return(e&&r||!e&&!r)&&t.push(o),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function Tm(e,t,n,o,i,r,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,h=qh(n);return{groupSlides:function(e){return h?function(e,t){return im(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?im(e).reduce(((n,h,m)=>{const f=rm(n)||0,p=0===f,g=h===am(e),v=i[c]-r[f][c],C=i[c]-r[h][u],b=!o&&p?d(a):0,y=tm(C-(!o&&g?d(s):0)-(v+b));return m&&y>t+l&&n.push(h),g&&n.push(e.length),n}),[]).map(((t,n,o)=>{const i=Math.max(o[n-1]||0);return e.slice(i,t)})):[]}(e)}}}function km(e,t,n,o,i,r,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:h,dragFree:m,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:C,watchResize:b,watchSlides:y,watchDrag:A,watchFocus:S}=r,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:o,offsetHeight:i}=e;return{top:t,right:n+o,bottom:t+i,left:n,width:o,height:i}}},E=w.measure(t),x=n.map(w.measure),B=function(e,t){const n="rtl"===t,o="y"===e,i=!o&&n?-1:1;return{scroll:o?"y":"x",cross:o?"x":"y",startEdge:o?"top":n?"right":"left",endEdge:o?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return o?t:n},direction:function(e){return e*i}}}(l,c),I=B.measureSize(E),T=function(e){return{measure:function(t){return e*(t/100)}}}(I),k=function(e,t){const n={start:function(){return 0},center:function(e){return o(e)/2},end:o};function o(e){return t-e}return{measure:function(o,i){return Jh(e)?n[e](o):e(t,o,i)}}}(s,I),O=!d&&!!C,D=d||!!C,{slideSizes:L,slideSizesWithGaps:P,startGap:_,endGap:R}=function(e,t,n,o,i,r){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&i,u=function(){if(!c)return 0;const e=n[0];return tm(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=r.getComputedStyle(rm(o));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),h=n.map(a),m=n.map(((e,t,n)=>{const o=!t,i=sm(n,t);return o?h[t]+u:i?h[t]+d:n[t+1][s]-e[s]})).map(tm);return{slideSizes:h,slideSizesWithGaps:m,startGap:u,endGap:d}}(B,E,x,n,D,i),F=Tm(B,I,g,d,E,x,_,R,2),{snaps:M,snapsAligned:W}=function(e,t,n,o,i){const{startEdge:r,endEdge:a}=e,{groupSlides:s}=i,l=s(o).map((e=>rm(e)[a]-e[0][r])).map(tm).map(t.measure),c=o.map((e=>n[r]-e[r])).map((e=>-tm(e))),u=s(c).map((e=>e[0])).map(((e,t)=>e+l[t]));return{snaps:c,snapsAligned:u}}(B,k,E,x,F),N=-rm(M)+rm(P),{snapsContained:V,scrollContainLimit:z}=function(e,t,n,o,i){const r=fm(-t+e,0),a=n.map(((e,t)=>{const{min:o,max:i}=r,a=r.constrain(e),s=!t,c=sm(n,t);return s?i:c||l(o,a)?o:l(i,a)?i:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=rm(a);return fm(a.lastIndexOf(e),a.indexOf(t)+1)}();function l(e,t){return om(e,t)<1}return{snapsContained:function(){if(t<=e+i)return[r.max];if("keepSnaps"===o)return a;const{min:n,max:l}=s;return a.slice(n,l)}(),scrollContainLimit:s}}(I,N,W,C,2),j=O?V:W,{limit:H}=function(e,t,n){const o=t[0];return{limit:fm(n?o-e:rm(t),o)}}(N,j,d),U=pm(am(j),u,d),Z=U.clone(),G=im(n),Q=mm(o,i,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:o}},i)=>{o||n.constrain(e.pointerDown()),t.seek(i)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:o,scrollLooper:i,slideLooper:r,dragHandler:a,animation:s,eventHandler:l,scrollBounds:c,options:{loop:u}},d)=>{const h=e.settled(),m=!c.shouldConstrain(),f=u?h:h&&m;f&&!a.pointerDown()&&(s.stop(),l.emit("settle")),f||l.emit("scroll");const p=n.get()*d+K.get()*(1-d);o.set(p),u&&(i.loop(e.direction()),r.loop()),t.to(o.get())})(se,e))),Y=j[U.get()],X=wm(Y),K=wm(Y),q=wm(Y),J=wm(Y),$=function(e,t,n,o,i,r){let a=0,s=0,l=i,c=r,u=e.get(),d=0;function h(e){return l=e,f}function m(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return a},seek:function(t){const i=t/1e3,r=l*i,h=o.get()-e.get();let m=0;return l?(n.set(e),a+=h/r,a*=c,u+=a,e.add(a*i),m=u-d):(a=0,n.set(o),e.set(o),m=h),s=nm(m),d=u,f},settled:function(){return tm(o.get()-t.get())<.001},useBaseFriction:function(){return m(r)},useBaseDuration:function(){return h(i)},useFriction:m,useDuration:h};return f}(X,q,K,J,h,.68),ee=Am(d,j,N,H,J),te=function(e,t,n,o,i,r,a){function s(i){const s=i.distance,l=i.index!==t.get();r.add(s),s&&(o.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(n.set(t.get()),t.set(i.index),a.emit("select"))}return{distance:function(e,t){s(i.byDistance(e,t))},index:function(e,n){const o=t.clone().set(e);s(i.byIndex(o.get(),n))}}}(Q,U,Z,$,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(H),oe=hm(),ie=Im(t,n,a,p),{slideRegistry:re}=function(e,t,n,o,i,r){const{groupSlides:a}=i,{min:s,max:l}=o;return{slideRegistry:function(){const o=a(r),i=!e||"keepSnaps"===t;return 1===n.length?[r]:i?o:o.slice(s,l).map(((e,t,n)=>{const o=!t,i=sm(n,t);return o?lm(rm(n[0])+1):i?lm(am(r)-rm(n)[0]+1,rm(n)[0]):e}))}()}}(O,C,j,z,F,G),ae=Sm(e,n,re,te,$,oe,a,S),se={ownerDocument:o,ownerWindow:i,eventHandler:a,containerRect:E,slideRects:x,animation:Q,axis:B,dragHandler:gm(B,e,o,i,J,vm(B,i),X,Q,te,$,ee,U,a,T,m,f,v,.68,A),eventStore:oe,percentOfView:T,index:U,indexPrevious:Z,limit:H,location:X,offsetLocation:q,previousLocation:K,options:r,resizeHandler:Cm(t,a,i,n,B,b,w),scrollBody:$,scrollBounds:bm(H,q,J,$,T),scrollLooper:ym(N,H,q,[X,q,K,J]),scrollProgress:ne,scrollSnapList:j.map(ne.get),scrollSnaps:j,scrollTarget:ee,scrollTo:te,slideLooper:xm(B,I,N,L,P,M,j,q,n),slideFocus:ae,slidesHandler:Bm(t,a,y),slidesInView:ie,slideIndexes:G,slideRegistry:re,slidesToScroll:F,target:J,translate:Em(B,t)};return se}const Om={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Dm(e){function t(e,t){return um(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const o=n.breakpoints||{},i=cm(o).filter((t=>e.matchMedia(t).matches)).map((e=>o[e])).reduce(((e,n)=>t(e,n)),{});return t(n,i)},optionsMediaQueries:function(t){return t.map((e=>cm(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function Lm(e,t,n){const o=e.ownerDocument,i=o.defaultView,r=Dm(i),a=function(e){let t=[];return{init:function(n,o){return t=o.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),o.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}}}(r),s=hm(),l=function(){let e,t={};function n(e){return t[e]||[]}const o={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),o},off:function(e,i){return t[e]=n(e).filter((e=>e!==i)),o},on:function(e,i){return t[e]=n(e).concat([i]),o},clear:function(){t={}}};return o}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=r,{on:h,off:m,emit:f}=l,p=B;let g,v,C,b,y=!1,A=c(Om,Lm.globalOptions),S=c(A),w=[];function E(t){const n=km(e,C,b,o,i,t,l);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function x(t,n){y||(A=c(A,t),S=u(A),w=n||w,function(){const{container:t,slides:n}=S,o=Jh(t)?e.querySelector(t):t;C=o||e.children[0];const i=Jh(n)?C.querySelectorAll(n):n;b=[].slice.call(i||C.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",B))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(O),g.eventHandler.init(O),g.resizeHandler.init(O),g.slidesHandler.init(O),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&b.length&&g.dragHandler.init(O),v=a.init(O,w)))}function B(e,t){const n=k();I(),x(c({startIndex:n},e),t),l.emit("reInit")}function I(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),a.destroy(),s.clear()}function T(e,t,n){S.active&&!y&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function k(){return g.index.get()}const O={canScrollNext:function(){return g.index.add(1).get()!==k()},canScrollPrev:function(){return g.index.add(-1).get()!==k()},containerNode:function(){return C},internalEngine:function(){return g},destroy:function(){y||(y=!0,s.clear(),I(),l.emit("destroy"),l.clear())},off:m,on:h,emit:f,plugins:function(){return v},previousScrollSnap:function(){return g.indexPrevious.get()},reInit:p,rootNode:function(){return e},scrollNext:function(e){T(g.index.add(1).get(),e,-1)},scrollPrev:function(e){T(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return b},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return x(t,n),setTimeout((()=>l.emit("init")),0),O}function Pm(e={},t=[]){const n=Object(Wt.useRef)(e),o=Object(Wt.useRef)(t),[i,r]=Object(Wt.useState)(),[a,s]=Object(Wt.useState)(),l=Object(Wt.useCallback)((()=>{i&&i.reInit(n.current,o.current)}),[i]);return Object(Wt.useEffect)((()=>{Xh(n.current,e)||(n.current=e,l())}),[e,l]),Object(Wt.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Kh(e),o=Kh(t);return n.every(((e,t)=>Xh(e,o[t])))})(o.current,t)||(o.current=t,l())}),[t,l]),Object(Wt.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){Lm.globalOptions=Pm.globalOptions;const e=Lm(a,n.current,o.current);return r(e),()=>e.destroy()}r(void 0)}),[a,r]),[s,i]}Lm.globalOptions=void 0,Pm.globalOptions=void 0;function _m(e){var t,n,o;const i=Object(Wt.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),r={duration:20,startIndex:i},[a,s]=Pm(r);Object(Wt.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(Wt.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const l=Vh();return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{sx:{flexGrow:1,backgroundColor:Ht.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},Wt.default.createElement(Zh,{config:e.configuration.screens.review.switchPreviousPageButton,icon:jt.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),Wt.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},Wt.default.createElement("div",{className:"embla__container",style:{display:"flex",height:"100%"}},null===(t=e.document)||void 0===t?void 0:t.pages.map(((t,n)=>Wt.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},Wt.default.createElement(Qh,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${Ut} - ${50+l+72+32}px)`,maxWidth:"100%"}})))))),Wt.default.createElement(Zh,{config:e.configuration.screens.review.switchNextPageButton,icon:jt.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition+1),active:e.currentPosition<(null===(o=null===(n=e.document)||void 0===n?void 0:n.pages)||void 0===o?void 0:o.length)-1,debugName:"carousel-forward"})))}var Rm=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Fm(e){var t,n,o,i,r,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[l,c]=Wt.default.useState(!1);Object(Wt.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(Wt.useEffect)((()=>{var t,n;0===(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)&&e.visible&&!l&&e.onClose()}),[null===(n=e.document)||void 0===n?void 0:n.pages,e.visible,l]);const[u,d]=Object(Wt.useState)(!0),[h,m]=Object(Wt.useState)(null),f=Object(Wt.useRef)(null),[p,g]=Object(Wt.useState)(!1),[v,C]=Object(Wt.useState)(!1);return Object(Wt.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Uh,{open:l}),Wt.default.createElement(Wd,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>Rm(this,void 0,void 0,(function*(){var t,n,o;c(!0),(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)>1&&e.onGoToPage(Math.max(e.currentPosition-1,0)),yield null===(o=e.document)||void 0===o?void 0:o.deletePage(s),c(!1),g(!1)}))}),Wt.default.createElement(Wd,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>C(!1),onOkClick:()=>Rm(this,void 0,void 0,(function*(){var t;c(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),c(!1),C(!1)}))}),Wt.default.createElement(zt.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${Ut})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(Mh,{config:e.configuration,numPages:null===(i=null===(o=e.document)||void 0===o?void 0:o.pages)||void 0===i?void 0:i.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>C(!0),buttonsEnabled:u}),Wt.default.createElement(_m,{buttonsEnabled:u,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:h}),Wt.default.createElement(jh,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(r=e.document)||void 0===r?void 0:r.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),Wt.default.createElement(zh,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>Rm(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),c(!0);const o=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),i=new Promise((e=>{f.current=e,m(o.id)})),r=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(o,null,1);yield Promise.all([i,r]),yield o.finalImageUrl(),f.current=null,m(null),d(!0),c(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:u}))):null}var Mm=function(e,t){return Number(e.toFixed(t))},Wm=function(e,t,n){n&&"function"==typeof n&&n(e,t)},Nm={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},Vm=function(e){"number"==typeof e&&cancelAnimationFrame(e)},zm=function(e){e.mounted&&(Vm(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function jm(e,t,n,o){if(e.mounted){var i=(new Date).getTime();zm(e),e.animation=function(){if(!e.mounted)return Vm(e.animation);var r=(new Date).getTime()-i,a=(0,Nm[t])(r/n);r>=n?(o(1),e.animation=null):e.animation&&(o(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Hm(e,t,n,o){var i=function(e){var t=e.scale,n=e.positionX,o=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(o))}(t);if(e.mounted&&i){var r=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?r(t.scale,t.positionX,t.positionY):jm(e,o,n,(function(e){r(s+u*e,l+d*e,c+h*e)}))}}var Um=function(e,t){var n=e.wrapperComponent,o=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!o)throw new Error("Components are not mounted");var r=function(e,t,n){var o=e.offsetWidth,i=e.offsetHeight,r=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:o,wrapperHeight:i,newContentWidth:r,newDiffWidth:o-r,newContentHeight:a,newDiffHeight:i-a}}(n,o,t),a=r.wrapperWidth,s=r.wrapperHeight,l=function(e,t,n,o,i,r,a){var s=e>t?n*(a?1:.5):0,l=o>i?r*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:o-i-l,maxPositionY:l}}(a,r.newContentWidth,r.newDiffWidth,s,r.newContentHeight,r.newDiffHeight,Boolean(i));return l},Zm=function(e,t,n,o){return Mm(o?e<t?t:e>n?n:e:e,2)},Gm=function(e,t){var n=Um(e,t);return e.bounds=n,n};function Qm(e,t,n,o,i,r,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=i,h=r),{x:Zm(e,s-d,c+d,o),y:Zm(t,l-h,u+h,o)}}function Ym(e,t,n,o,i,r){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=o-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):Qm(l-t*u,c-n*u,i,r,0,0,null)}function Xm(e,t,n,o,i){var r=t-(i?o:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=r?r:e}var Km=function(e,t){var n=e.setup.panning.excluded,o=e.isInitialized,i=e.wrapperComponent,r=t.target,a="shadowRoot"in r&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==i?void 0:i.contains(e))})):null==i?void 0:i.contains(r);return!!(o&&r&&a)&&!Of(r,n)},qm=function(e){var t=e.isInitialized,n=e.isPanning,o=e.setup.panning.disabled;return!(!t||!n||o)};function Jm(e,t,n,o,i){var r=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(null!==a&&null!==s&&(t!==u||n!==d)){var h=Qm(t,n,s,r,o,i,a),m=h.x,f=h.y;e.setTransformState(c,m,f)}}var $m=function(e,t){var n=e.setup,o=e.transformState.scale,i=n.minScale,r=n.disablePadding;return t>0&&o>=i&&!r?t:0};function ef(e,t,n,o,i,r,a,s,l,c){if(i){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:u<a?a:u;if(t<r&&n<r)return(u=r+(e-r)*c)<s?s:u>r?r:u}return o?t:Zm(e,r,a,i)}function tf(e,t){var n=function(e){var t=e.mounted,n=e.setup,o=n.disabled,i=n.velocityAnimation,r=e.transformState.scale;return!(i.disabled&&!(r>1)&&o&&!t)}(e);if(n){var o=e.lastMousePosition,i=e.velocityTime,r=e.setup,a=e.wrapperComponent,s=r.velocityAnimation.equalToMove,l=Date.now();if(o&&i&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-o.x,d=t.y-o.y,h=u/c,m=d/c,f=l-i,p=u*u+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:h,velocityY:m,total:g}}e.lastMousePosition=t,e.velocityTime=l}}function nf(e,t){var n=e.transformState.scale;zm(e),Gm(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,o=e.transformState,i=o.positionX,r=o.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-i,y:s-r}}}(e,t):function(e,t){var n=e.transformState,o=n.positionX,i=n.positionY;e.isPanning=!0;var r=t.clientX,a=t.clientY;e.startCoords={x:r-o,y:a-i}}(e,t)}function of(e){var t=e.transformState.scale,n=e.setup,o=n.minScale,i=n.alignmentAnimation,r=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,c=i.animationType;if(!(r||t<o||!a&&!s)){var u=function(e){var t=e.transformState,n=t.positionX,o=t.positionY,i=t.scale,r=e.setup,a=r.disabled,s=r.limitToBounds,l=r.centerZoomedOut,c=e.wrapperComponent;if(!a&&c&&e.bounds){var u=e.bounds,d=u.maxPositionX,h=u.minPositionX,m=u.maxPositionY,f=u.minPositionY,p=n>d||n<h,g=o>m||o<f,v=Ym(e,n>d?c.offsetWidth:e.setup.minPositionX||0,o>m?c.offsetHeight:e.setup.minPositionY||0,i,e.bounds,s||l),C=v.x,b=v.y;return{scale:i,positionX:p?C:n,positionY:g?b:o}}}(e);u&&Hm(e,u,l,c)}}function rf(e,t,n){var o=e.startCoords,i=e.setup.alignmentAnimation,r=i.sizeX,a=i.sizeY;if(o){var s=function(e,t,n){var o=e.startCoords,i=e.transformState,r=e.setup.panning,a=r.lockAxisX,s=r.lockAxisY,l=i.positionX,c=i.positionY;if(!o)return{x:l,y:c};var u=t-o.x,d=n-o.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=$m(e,r),d=$m(e,a);tf(e,{x:l,y:c}),Jm(e,l,c,u,d)}}function af(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,o=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var r=null==o?void 0:o.getBoundingClientRect(),a=null==i?void 0:i.getBoundingClientRect(),s=(null==r?void 0:r.width)||0,l=(null==r?void 0:r.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s<c||l<u;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,o=e.setup,i=e.wrapperComponent,r=function(e){var t=e.mounted,n=e.velocity,o=e.bounds,i=e.setup,r=i.disabled,a=i.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&r&&!t||!n||!o)}(e);if(r&&t&&n&&i){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,m=o.limitToBounds,f=o.alignmentAnimation,p=o.zoomAnimation,g=o.panning,v=g.lockAxisY,C=g.lockAxisX,b=p.animationType,y=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,o=n.equalToMove,i=n.animationTime,r=n.sensitivity;return o?i*t*r:i}(e,l),E=Math.max(w,S),x=$m(e,y),B=$m(e,A),I=x*i.offsetWidth/100,T=B*i.offsetHeight/100,k=c+I,O=u-I,D=d+T,L=h-T,P=e.transformState,_=(new Date).getTime();jm(e,b,E,(function(t){var n=e.transformState,o=n.scale,i=n.positionX,r=n.positionY,l=((new Date).getTime()-_)/S,p=1-(0,Nm[f.animationType])(Math.min(1,l)),g=1-t,b=i+a*g,y=r+s*g,A=ef(b,P.positionX,i,C,m,u,c,O,k,p),w=ef(y,P.positionY,r,v,m,h,d,L,D,p);i===b&&r===y||e.setTransformState(o,A,w)}))}}(e):of(e)}}function sf(e,t,n,o){var i=e.setup,r=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Xm(Mm(t,2),r,a,0,!1),c=Ym(e,n,o,l,Gm(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}function lf(e,t,n){var o=e.transformState.scale,i=e.wrapperComponent,r=e.setup,a=r.minScale,s=r.limitToBounds,l=r.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||o>=a;if((o>=1||s)&&of(e),!h&&i&&e.mounted){var m=sf(e,a,t||i.offsetWidth/2,n||i.offsetHeight/2);m&&Hm(e,m,u,d)}}var cf=function(){return cf=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cf.apply(this,arguments)};function uf(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var df=1,hf=0,mf=0,ff={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,wheelPanning:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},pf=function(e){var t,n,o,i;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:df,scale:null!==(n=e.initialScale)&&void 0!==n?n:df,positionX:null!==(o=e.initialPositionX)&&void 0!==o?o:hf,positionY:null!==(i=e.initialPositionY)&&void 0!==i?i:mf}},gf=function(e){var t=cf({},ff);return Object.keys(e).forEach((function(n){var o="undefined"!=typeof e[n];if("undefined"!=typeof ff[n]&&o){var i=Object.prototype.toString.call(ff[n]),r="[object Object]"===i,a="[object Array]"===i;t[n]=r?cf(cf({},ff[n]),e[n]):a?uf(uf([],ff[n],!0),e[n],!0):e[n]}})),t},vf=function(e,t,n){var o=e.transformState.scale,i=e.wrapperComponent,r=e.setup,a=r.maxScale,s=r.minScale,l=r.zoomAnimation,c=r.smooth,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=c?o*Math.exp(t*n):o+t*n;return Xm(Mm(d,3),s,a,u,!1)};function Cf(e,t,n,o,i){var r=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!r)return console.error("No WrapperComponent found");var u=(r.offsetWidth/2-l)/s,d=(r.offsetHeight/2-c)/s,h=sf(e,vf(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Hm(e,h,o,i)}function bf(e,t,n,o){var i=e.setup,r=e.wrapperComponent,a=i.limitToBounds,s=pf(e.props),l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(r){var h=Um(e,s.scale),m=Qm(s.positionX,s.positionY,h,a,0,0,r),f={scale:s.scale,positionX:m.x,positionY:m.y};c===s.scale&&u===s.positionX&&d===s.positionY||(null==o||o(),Hm(e,f,t,n))}}var yf=function(e){return function(t,n,o){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===o&&(o="easeOut"),Cf(e,1,t,n,o)}},Af=function(e){return function(t,n,o){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===o&&(o="easeOut"),Cf(e,-1,t,n,o)}},Sf=function(e){return function(t,n,o,i,r){void 0===i&&(i=300),void 0===r&&(r="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?l:n,scale:Number.isNaN(o)?c:o};Hm(e,h,i,r)}}},wf=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),bf(e,t,n)}},Ef=function(e){return function(t,n,o){void 0===n&&(n=200),void 0===o&&(o="easeOut");var i=e.transformState,r=e.wrapperComponent,a=e.contentComponent;if(r&&a){var s=Lf(t||i.scale,r,a);Hm(e,s,n,o)}}},xf=function(e){return function(t,n,o,i){void 0===o&&(o=600),void 0===i&&(i="easeOut"),zm(e);var r=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(r&&a&&r.contains(a)){var s=function(e,t,n){var o=e.wrapperComponent,i=e.contentComponent,r=e.transformState,a=e.setup,s=a.limitToBounds,l=a.minScale,c=a.maxScale;if(!o||!i)return r;var u,d,h,m,f,p,g,v,C=o.getBoundingClientRect(),b=t.getBoundingClientRect(),y=(u=o,d=i,h=r,m=t.getBoundingClientRect(),f=u.getBoundingClientRect(),p=d.getBoundingClientRect(),g=f.x*h.scale,v=f.y*h.scale,{x:(m.x-p.x+g)/h.scale,y:(m.y-p.y+v)/h.scale}),A=y.x,S=y.y,w=b.width/r.scale,E=b.height/r.scale,x=o.offsetWidth/w,B=o.offsetHeight/E,I=Xm(n||Math.min(x,B),l,c,0,!1),T=(C.width-w*I)/2,k=(C.height-E*I)/2,O=Qm((C.left-A)*I+T,(C.top-S)*I+k,Um(e,I),s,0,0,o);return{positionX:O.x,positionY:O.y,scale:I}}(e,a,n);Hm(e,s,o,i)}}},Bf=function(e){return{instance:e,zoomIn:yf(e),zoomOut:Af(e),setTransform:Sf(e),resetTransform:wf(e),centerView:Ef(e),zoomToElement:xf(e)}},If=function(e){return{instance:e,state:e.transformState}},Tf=function(e){var t={};return Object.assign(t,If(e)),Object.assign(t,Bf(e)),t};function kf(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var Of=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},Df=function(e){e&&clearTimeout(e)},Lf=function(e,t,n){var o=n.offsetWidth*e,i=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-o)/2,positionY:(t.offsetHeight-i)/2}};function Pf(e,t,n){var o=t.getBoundingClientRect(),i=0,r=0;if("clientX"in e)i=(e.clientX-o.left)/n,r=(e.clientY-o.top)/n;else{var a=e.touches[0];i=(a.clientX-o.left)/n,r=(a.clientY-o.top)/n}return(Number.isNaN(i)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:i,y:r}}var _f=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Rf=function(e,t){var n=e.props,o=n.onWheel,i=n.onZoom,r=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=a.disablePadding,m=a.smooth,f=u.size,p=u.disabled,g=d.step,v=d.smoothStep;if(!r)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=function(e,t){var n,o,i=function(e){return e?e.deltaY<0?1:-1:0}(e);return o=i,"number"==typeof(n=t)?n:o}(t,null),b=function(e,t,n,o,i){var r=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=s.disablePadding,h=u.size,m=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=r+t*n;if(i)return f;var p=!o&&!m;return Xm(Mm(f,3),c,l,h,p&&!d)}(e,C,m?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==b){var y=Gm(e,b),A=Pf(t,r,s),S=l&&(p||0===f||c||h),w=Ym(e,A.x,A.y,b,y,S),E=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(b,E,x),Wm(Tf(e),t,o),Wm(Tf(e),t,i)}},Ff=function(e,t){var n=e.props,o=n.onWheelStop,i=n.onZoomStop;Df(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(lf(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var r=function(e,t){var n=e.previousWheelEvent,o=e.transformState.scale,i=e.setup,r=i.maxScale,a=i.minScale;return!!n&&(o<r||o>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);r&&(Df(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Wm(Tf(e),t,o),Wm(Tf(e),t,i))}),160))},Mf=function(e){for(var t=0,n=0,o=0;o<2;o+=1)t+=e.touches[o].clientX,n+=e.touches[o].clientY;return{x:t/2,y:n/2}},Wf=function(e,t){var n=e.contentComponent,o=e.pinchStartDistance,i=e.wrapperComponent,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,l=a.centerZoomedOut,c=a.zoomAnimation,u=a.alignmentAnimation,d=c.disabled,h=c.size;if(null!==o&&n){var m=function(e,t,n){var o=n.getBoundingClientRect(),i=e.touches,r=Mm(i[0].clientX-o.left,5),a=Mm(i[0].clientY-o.top,5);return{x:(r+Mm(i[1].clientX-o.left,5))/2/t,y:(a+Mm(i[1].clientY-o.top,5))/2/t}}(t,r,n);if(Number.isFinite(m.x)&&Number.isFinite(m.y)){var f=_f(t),p=function(e,t){var n=e.pinchStartScale,o=e.pinchStartDistance,i=e.setup,r=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=i.disablePadding,c=s.size,u=s.disabled;if(!n||null===o||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Xm(Mm(t/o*n,2),a,r,c,!u&&!l)}(e,f),g=Mf(t),v=g.x-(e.pinchLastCenterX||0),C=g.y-(e.pinchLastCenterY||0);if(p!==r||0!==v||0!==C){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var b=Gm(e,p),y=s&&(d||0===h||l),A=Ym(e,m.x,m.y,p,b,y),S=A.x,w=A.y;e.pinchMidpoint=m,e.lastDistance=f;var E=u.sizeX,x=u.sizeY,B=Qm(S+v,w+C,b,s,$m(e,E),$m(e,x),i),I=B.x,T=B.y;e.setTransformState(p,I,T)}}}},Nf=function(e,t){var n=e.props.onZoomStop,o=e.setup.doubleClick.animationTime;Df(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,Wm(Tf(e),t,n)}),o)};function Vf(e,t){var n=e.setup,o=e.doubleClickStopEventTimer,i=e.transformState,r=e.contentComponent,a=i.scale,s=e.props,l=s.onZoomStart,c=s.onZoom,u=n.doubleClick,d=u.disabled,h=u.mode,m=u.step,f=u.animationTime,p=u.animationType;if(!d&&!o){if("reset"===h)return function(e,t){var n=e.props,o=n.onZoomStart,i=n.onZoom,r=e.setup.doubleClick,a=r.animationTime,s=r.animationType;Wm(Tf(e),t,o),bf(e,a,s,(function(){return Wm(Tf(e),t,i)})),Nf(e,t)}(e,t);if(!r)return console.error("No ContentComponent found");var g=function(e,t){return"toggle"===e?1===t?1:-1:"zoomOut"===e?-1:1}(h,e.transformState.scale),v=vf(e,g,m);if(a!==v){Wm(Tf(e),t,l);var C=Pf(t,r,a),b=sf(e,v,C.x,C.y);if(!b)return console.error("Error during zoom event. New transformation state was not calculated.");Wm(Tf(e),t,c),Hm(e,b,f,p),Nf(e,t)}}}var zf=function(e){var t=this;this.mounted=!0,this.pinchLastCenterX=null,this.pinchLastCenterY=null,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){t.initializeWindowEvents()},this.unmount=function(){t.cleanupWindowEvents()},this.update=function(e){t.props=e,Gm(t,t.transformState.scale),t.setup=gf(e)},this.initializeWindowEvents=function(){var e,n,o=kf(),i=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==i?void 0:i.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,o),null==r||r.addEventListener("mousedown",t.onPanningStart,o),null==r||r.addEventListener("mousemove",t.onPanning,o),null==r||r.addEventListener("mouseup",t.onPanningStop,o),null==i||i.addEventListener("mouseleave",t.clearPanning,o),null==r||r.addEventListener("keyup",t.setKeyUnPressed,o),null==r||r.addEventListener("keydown",t.setKeyPressed,o)},this.cleanupWindowEvents=function(){var e,n,o=kf(),i=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==i?void 0:i.defaultView;null==r||r.removeEventListener("mousedown",t.onPanningStart,o),null==r||r.removeEventListener("mousemove",t.onPanning,o),null==r||r.removeEventListener("mouseup",t.onPanningStop,o),null==i||i.removeEventListener("mouseleave",t.clearPanning,o),null==r||r.removeEventListener("keyup",t.setKeyUnPressed,o),null==r||r.removeEventListener("keydown",t.setKeyPressed,o),document.removeEventListener("mouseleave",t.clearPanning,o),zm(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=kf();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},this.handleInitialize=function(e){var n=t.setup.centerOnInit;t.applyTransformation(),t.onInitCallbacks.forEach((function(e){return e(Tf(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,o=e.offsetWidth,i=e.offsetHeight;(o>0||i>0)&&(t.onInitCallbacks.forEach((function(e){return e(Tf(t))})),t.setCenter(),null===(n=t.observer)||void 0===n||n.disconnect())})),setTimeout((function(){var e;null===(e=t.observer)||void 0===e||e.disconnect()}),5e3),t.observer.observe(e))},this.onWheelZoom=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.setup.wheel,o=n.disabled,i=n.wheelDisabled,r=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||o||!c||i&&!t.ctrlKey||r&&t.ctrlKey||Of(c,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,o=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(zm(e),Wm(Tf(e),t,o),Wm(Tf(e),t,i))}(t,e),Rf(t,e),Ff(t,e))}},this.onWheelPanning=function(e){var n=t.setup,o=n.disabled,i=n.wheel,r=n.panning;if(t.wrapperComponent&&t.contentComponent&&!o&&i.wheelDisabled&&!r.disabled&&r.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,l=a.positionY,c=s-e.deltaX,u=l-e.deltaY,d=r.lockAxisX?s:c,h=r.lockAxisY?l:u,m=t.setup.alignmentAnimation,f=m.sizeX,p=m.sizeY,g=$m(t,f),v=$m(t,p);d===s&&h===l||Jm(t,d,h,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,o=t.props.onPanningStart;n||Km(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(0!==e.button||t.setup.panning.allowLeftClickPan)&&(1!==e.button||t.setup.panning.allowMiddleClickPan)&&(2!==e.button||t.setup.panning.allowRightClickPan)&&(e.preventDefault(),e.stopPropagation(),zm(t),nf(t,e),Wm(Tf(t),e,o))},this.onPanning=function(e){var n=t.setup.disabled,o=t.props.onPanning;n||qm(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),rf(t,e.clientX,e.clientY),Wm(Tf(t),e,o))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(af(t),Wm(Tf(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,o=t.props,i=o.onPinchingStart,r=o.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,o=n.disabled,i=n.excluded,r=e.isInitialized,a=t.target;return!(!r||o||!a||Of(a,i))}(t,e);a&&(function(e,t){var n=_f(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var o=Mf(t);e.pinchLastCenterX=o.x,e.pinchLastCenterY=o.y,zm(e)}(t,e),zm(t),Wm(Tf(t),e,i),Wm(Tf(t),e,r))}},this.onPinch=function(e){var n=t.setup.disabled,o=t.props,i=o.onPinching,r=o.onZoom;if(!n){var a=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,o=e.pinchStartDistance;return!(!n||t||!o)}(t);a&&(e.preventDefault(),e.stopPropagation(),Wf(t,e),Wm(Tf(t),e,i),Wm(Tf(t),e,r))}},this.onPinchStop=function(e){var n,o,i=t.props,r=i.onPinchingStop,a=i.onZoomStop;t.pinchStartScale&&(o=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,lf(n,null==o?void 0:o.x,null==o?void 0:o.y),Wm(Tf(t),e,r),Wm(Tf(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,o=t.props.onPanningStart;if(!n&&Km(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,zm(t);var i=e.touches,r=1===i.length,a=2===i.length;r&&(zm(t),nf(t,e),Wm(Tf(t),e,o)),a&&t.onPinchStart(e)}},this.onTouchPanning=function(e){var n=t.setup.disabled,o=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!qm(t))return;e.preventDefault(),e.stopPropagation();var i=e.touches[0];rf(t,i.clientX,i.clientY),Wm(Tf(t),e,o)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.isInitialized,o=e.setup,i=e.wrapperComponent,r=o.doubleClick,a=r.disabled,s=r.excluded,l=t.target,c=null==i?void 0:i.contains(l);return!(!(n&&l&&c)||a||Of(l,s))}(t,e);n&&Vf(t,e)}},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},this.setTransformState=function(e,n,o){var i=t.props.onTransformed;if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(o))console.error("Detected NaN set state values");else{e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=o,t.applyTransformation();var r=Tf(t);t.onChangeCallbacks.forEach((function(e){return e(r)})),Wm(r,{scale:e,positionX:n,positionY:o},i)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Lf(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,o){return t.props.customTransform?t.props.customTransform(e,n,o):function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")}(e,n,o)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,o=e.positionX,i=e.positionY,r=t.handleTransformStyles(o,i,n);t.contentComponent.style.transform=r}},this.getContext=function(){return Tf(t)},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,Gm(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var o=Tf(t);Wm(o,void 0,t.props.onInit)},this.props=e,this.setup=gf(this.props),this.transformState=pf(this.props)},jf=Wt.default.createContext(null),Hf=Wt.default.forwardRef((function(e,t){var n,o,i=Object(Wt.useRef)(new zf(e)).current,r=(n=e.children,o=Bf(i),"function"==typeof n?n(o):n);return Object(Wt.useImperativeHandle)(t,(function(){return Bf(i)}),[i]),Object(Wt.useEffect)((function(){i.update(e)}),[i,e]),Wt.default.createElement(jf.Provider,{value:i},r)}));Wt.default.forwardRef((function(e,t){var n,o=Object(Wt.useRef)(null),i=Object(Wt.useContext)(jf);return Object(Wt.useEffect)((function(){return i.onChange((function(e){if(o.current){o.current.style.transform=i.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[i]),Wt.default.createElement("div",cf({},e,{ref:(n=[o,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var Uf="transform-component-module_wrapper__SPB86",Zf="transform-component-module_content__FBWxo";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__SPB86 {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__FBWxo {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__FBWxo img {\n pointer-events: none;\n}\n");var Gf=function(e){var t=e.children,n=e.wrapperClass,o=void 0===n?"":n,i=e.contentClass,r=void 0===i?"":i,a=e.wrapperStyle,s=e.contentStyle,l=e.wrapperProps,c=void 0===l?{}:l,u=e.contentProps,d=void 0===u?{}:u,h=Object(Wt.useContext)(jf),m=h.init,f=h.cleanupWindowEvents,p=Object(Wt.useRef)(null),g=Object(Wt.useRef)(null);return Object(Wt.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&m&&(null==m||m(e,t)),function(){null==f||f()}}),[]),Wt.default.createElement("div",cf({},c,{ref:p,className:"react-transform-wrapper ".concat(Uf," ").concat(o),style:a}),Wt.default.createElement("div",cf({},d,{ref:g,className:"react-transform-component ".concat(Zf," ").concat(r),style:s}),t))};function Qf(e){var t;const n=ud(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const o=e.config.closeButton;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{touchAction:"none",backgroundColor:Ht.b.getColorValue(e.config.overlayColor)}},Wt.default.createElement(zt.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},Wt.default.createElement(tn,{onClick:e.onCloseButtonClick,visible:o.visible,text:o.text,background:o.background,foreground:o.foreground,ariaLabel:Ht.b.getLocalizedText(o.accessibilityDescription),iconPosition:"right",icon:Wt.default.createElement(jt.a,{style:{paddingLeft:4}})})),Wt.default.createElement(Hf,{centerOnInit:!0},Wt.default.createElement(Gf,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},Wt.default.createElement(zt.Box,{style:{width:"100%",height:`calc(100 *${Ut} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},Wt.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var Yf=n(40);class Xf{constructor(){this.disabled=!1,this.color="transparent"}}class Kf{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class qf{constructor(){this.color="#1ec31e",this.width=4}}class Jf{constructor(){this.padding=10}}class $f{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class ep{constructor(){this.width=2,this.color="white"}}class tp{constructor(){this.size=20,this.color="white"}}class np extends Yf.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Jf,this.style.magneticLines=new Xf,this.style.polygon=new qf,this.style.polygon.handles=new Kf,this.style.magnifier=new $f,this.style.magnifier.border=new ep,this.style.magnifier.crosshair=new tp}static fromJson(e){const t=new np;return this.mapValues(e,t,["style"]),e.style&&(this.mapValues(e.style,t.style,["polygon","magneticLines","magnifier"]),e.style.polygon&&(this.mapValues(e.style.polygon,t.style.polygon,["handles"]),e.style.polygon.handles&&this.mapValues(e.style.polygon.handles,t.style.polygon.handles)),e.style.magneticLines&&this.mapValues(e.style.magneticLines,t.style.magneticLines,[]),e.style.magnifier&&(this.mapValues(e.style.magnifier,t.style.magnifier,["border","crosshair"]),e.style.magnifier.border&&this.mapValues(e.style.magnifier.border,t.style.magnifier.border,[]),e.style.magnifier.crosshair&&this.mapValues(e.style.magnifier.crosshair,t.style.magnifier.crosshair,[]))),t}}class op extends Wt.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return Wt.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},Wt.default.createElement("line",{x1:e.start.x.toString(),y1:e.start.y.toString(),x2:e.end.x.toString(),y2:e.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(e,t,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var e,t,n,o,i,r;return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.horizontal)||void 0===t?void 0:t.scaled)||void 0===n?void 0:n.map((e=>this.fromPoint(e))),null===(r=null===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,o;const i=this.props.movingLine;let r=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r||0===r.length)return;const a=this.midPoint(i.points[0].coordinates,i.points[1].coordinates),s=r.map((e=>({distance:this.distanceToLine(e,a),mLine:e})));s.sort(((e,t)=>e.distance-t.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:i})}distanceToLine(e,t){const n=t.x-e.start.x,o=t.y-e.start.y,i=e.end.x-e.start.x,r=e.end.y-e.start.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?e.start:s>=1?e.end:new kc.a(e.start.x+s*i,e.start.y+s*r),kc.a.distance(t,l)}midPoint(e,t){return new kc.a((e.x+t.x)/2,(e.y+t.y)/2)}}class ip extends Wt.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var e,t;return(null===(e=this.props.style)||void 0===e?void 0:e.size)?(null===(t=this.props)||void 0===t?void 0:t.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var e,t,n;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(e=this.props.style)||void 0===e?void 0:e.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(t=this.props.style)||void 0===t?void 0:t.color,position:"absolute",cursor:"pointer",zIndex:500,filter:null===(n=this.props.style)||void 0===n?void 0:n.filter}}nextIndex(e){return(e+1)%this.POINT_COUNT}previousIndex(e){return(e-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(e){return e%2==0}isOutOfBounds(e,t){return e<-this.DRAG_BUFFER||e>t+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class rp extends ip{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t],o=Wt.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.cornerTouchStart(e,t),onPointerUp:e=>this.cornerTouchEnd(e),onPointerMove:e=>this.cornerTouchMove(e,t),"data-sb-cropping-corner":t},Wt.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(o)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.items[t],i=kc.a.fromHtmlElement(o);this.parentOffset=new kc.a(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=Object(Ru.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new kc.a(o+r,i+r),dh.isConvex(this.props.points)?this.props.cornerMoved({index:t,point:this.props.points[t]}):this.props.points[t]=a}cornerTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class ap extends ip{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t];let o=this.props.points[this.nextIndex(t)];const i=Wt.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.y-n.y)/2-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.lineTouchStart(e,t),onPointerMove:e=>this.lineTouchMove(e,t),onPointerUp:e=>this.lineTouchEnd(e),"data-sb-cropping-side":t},Wt.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(i)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.items[t],i=kc.a.fromHtmlElement(o),r=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=_.copy(this.props.points[this.previousIndex(t)]),this.point1Start=_.copy(r),this.point2Start=_.copy(a),this.point3Start=_.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new kc.a(r.x-i.x,r.y-i.y),this.point2Offset=new kc.a(a.x-i.x,a.y-i.y),this.parentOffset=new kc.a(n.x-i.x,n.y-i.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(t)];let i=new kc.a(null,null),r=new kc.a(null,null);const a=this.props.points[this.nextIndex(t+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(t)){const e=l+this.point1Offset.y,t=l+this.point2Offset.y,n=e-this.point1Start.y;i.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),i.y=e,r.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;i.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),i.x=e,r.x=t}i=kc.a.clamp(i,this.props.containerSize),r=kc.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||dh.isConvex([o,i,r,a])&&(this.props.points[t].x=i.x,this.props.points[t].y=i.y,this.props.points[this.nextIndex(t)].x=r.x,this.props.points[this.nextIndex(t)].y=r.y,this.props.lineMoved({points:[{index:t,coordinates:i},{index:this.nextIndex(t),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(t)}))}lineTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null}isNearOpposingPoint(e,t,n,o){if(e[o]>n[o]){if(t[o]-10<n[o])return!0}else if(t[o]>n[o]-10)return!0;return!1}areEdgesCrossing(e,t,n,o){const i=e.x,r=e.y,a=t.x,s=t.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class sp extends Wt.default.Component{render(){return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},Wt.default.createElement(rp,{ref:e=>this.corners=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),Wt.default.createElement(ap,{ref:e=>this.lines=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let e=0;e<this.corners.POINT_COUNT;e++){const t=this.props.coordinatePoints[e];this.corners.items[e]&&(this.corners.items[e].style.left=t.x-this.corners.pointSize/2+"px",this.corners.items[e].style.top=t.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(e)];this.lines.items[e]&&(this.lines.items[e].style.left=t.x+(n.x-t.x)/2-this.corners.pointSize/2+"px",this.lines.items[e].style.top=t.y+(n.y-t.y)/2-this.corners.pointSize/2+"px")}}snapTo(e){const t=[e.polygonLine.previousPoint,e.polygonLine.points[0].coordinates],n=[e.polygonLine.points[1].coordinates,e.polygonLine.nextPoint],o=[e.magneticLine.start,e.magneticLine.end];this.props.coordinatePoints[e.polygonLine.points[0].index]=dh.intersection(t,o),this.props.coordinatePoints[e.polygonLine.points[1].index]=dh.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class lp extends Wt.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return Wt.default.createElement("div",null,Wt.default.createElement(sp,{ref:e=>this.handles=e,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:e=>{this.setFrame(),this.props.cornerMoved(e)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:e=>{this.setFrame(),this.setState({movingLine:e})}}),Wt.default.createElement(op,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:e=>{var t,n;null===(t=this.handles)||void 0===t||t.snapTo(e),null===(n=this.polygon)||void 0===n||n.setFrame()}}),Wt.default.createElement(rh,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:e=>this.polygon=e}))}setFrame(){var e,t;null===(e=this.polygon)||void 0===e||e.setFrame(),null===(t=this.handles)||void 0===t||t.setFrame()}}class cp extends Wt.default.Component{render(){return Wt.default.createElement("img",{ref:e=>this.image=e,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:e=>{e.target&&this.props.onImageLoaded(e.target)}})}}class up extends Wt.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:e,imageMargin:t,rotations:n,scale:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=Sn.b`
34
+ `;return xo.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},xo.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),xo.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),xo.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),xo.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class jm extends xo.default.Component{render(){return this.props.text?xo.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},xo.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:pr.TransparentGray,color:pr.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class Hm extends xo.default.Component{constructor(e){super(e),this.state={element:e.element}}style(e){this.customStyle=e,this.forceUpdate()}update(e){this.setState({element:e})}formatText(e,t){if("None"!==t)return"Text"===t?e.text:e.format+" ("+e.text+")"}render(){var e,t,n,i,o;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),c=fm.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:r.points);if(!s)return null;if(!r.points)return null;const l=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(o=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==o?o:r.highlighted?a.highlightedTextColor:a.textColor;return xo.default.createElement(mm.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:fm.a.lowestX(r.points),y:fm.a.highestY(r.points)+3,backgroundColor:l,fontSize:12,width:c,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:fm.a.lowestX(this.props.animateToPoints),y:fm.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Um{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Zm{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new Um}}class Gm{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class Ym{constructor(){this.enabled=!1,this.style=new Gm}}class Qm extends X.a{constructor(){super(q.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Zm,this.detectionParameters=new J.BarcodeScannerConfiguration,this.scanAndCount=new Ym,this.onBarcodesDetected=function(e){}}static fromJson(e){const t=new Qm;return this.mapValues(e,t,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(t,e),e.overlay&&(this.mapValues(e.overlay,t.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,t.overlay.style)),e.scanAndCount&&(this.mapValues(e.scanAndCount,t.scanAndCount,["style"]),e.scanAndCount.style&&this.mapValues(e.scanAndCount.style,t.scanAndCount.style)),this.mapVideoConstraints(e,t),t}}class qm{constructor(e){this.coreResult=e,this.barcodes=[],this.originalImageSize=null,this.barcodes=e.barcodes,e.originalImage&&(this.originalImageSize=new Vm.a(e.originalImage.width,e.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class Xm{static warn(e){console.warn("[ScanbotSDK]",e)}}class Km{static convertLinesToViewportLines(e,t){if(t&&e)return t.map((t=>({start:new fm.a(t.start.x*e.width,t.start.y*e.height),end:new fm.a(t.end.x*e.width,t.end.y*e.height)})))}static convertToViewportPointsFromParentSize(e,t){return t?Vm.a.isEmpty(e)?void 0:t.map((t=>fm.a.scaleUpTo(t,e))):Vm.a.toPolygon(e)}static calculateScale(e){let t,n=0,i=0;return 1>e.width/e.height?(t=e.height/1,n=(1-e.width/t)/2):(t=e.width/1,i=(1-e.height/t)/2),{x:n,y:i,containerScale:t}}static findScale(e,t){let n,i=0,o=0;return t.ratio(!0)>e.ratio(!0)?(n=e.width/t.width,o=(t.height-e.height/n)/2):(n=e.height/t.height,i=(t.width-e.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(e){e.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",Km.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",Km.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(e){var t;const n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var Jm=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};rr.a;rr.b;class $m extends rr.c{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.paused=!1,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(t=this.configuration.finder.visible)||void 0===t||t,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=Qm.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return Jm(this,void 0,void 0,(function*(){const t=Km.findContainerOrThrow(e);return new Promise(((n,i)=>{Object(xo.render)(xo.default.createElement($m,{container:t,configuration:e,onSuccess:n,onFailure:i}),t)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Jm(this,void 0,void 0,(function*(){Xm.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){Xm.warn("Barcode detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Jm(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeScannerHandle).catch((e=>{var t,n;return null===(n=(t=this.props.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}updateDimensions(){return Jm(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Jm(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return Jm(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const e=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!e)return;const a=new qm(e);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(e.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(i=this.finder)||void 0===i?void 0:i.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}setUseBackendService(e){console.log("Now using backend service for recognition: ",e),this.backendurl=e}recognizeBarcodes(e,t){var n,i,o,r,a,s,c,l;return Jm(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const c=e?rr.c.DEFAULT_DETECTION_RESOLUTION:rr.c.DETECTION_RESULTION_4K,l=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const u=yield null===(o=this.camera)||void 0===o?void 0:o.createImageData(l,!1);if(!u)return;t&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:z.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",rr.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new Vm.a(u.width,u.height);this.barcodeScannerHandle||(this.barcodeScannerHandle=yield this.bridge.copyArgs.createBarcodeScanner(new J.BarcodeScannerConfiguration(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:e}))));const d=yield this.bridge.transferArgs.scanBarcodes(this.barcodeScannerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(e){return void(null===(l=(c=this.props.configuration).onError)||void 0===l||l.call(c,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return Jm(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(Vm.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(Vm.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}updateTorch(e){this.camera.videoStream.updateTorch(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var e,t,n,i,o,r,a;const s=(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)?"Tap the shutter button to scan":void 0;return xo.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},xo.default.createElement(ar.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),xo.default.createElement(jm,{top:null===(i=this.configuration.scanAndCount)||void 0===i?void 0:i.style.topLabelTop,text:s}),xo.default.createElement(Wm,{ref:e=>this.scannedImage=e,image:this.state.image}),this.state.isFinderVisible&&xo.default.createElement(sr.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),xo.default.createElement(jm,{bottom:100,text:this.state.bottomHintText}),xo.default.createElement(zm,{visible:"processing"===this.state.action}),(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)&&xo.default.createElement(Dm,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=new qm({barcodes:[e]});this.configuration.onBarcodesDetected(t)},onBarcodeFound:(e,t,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(e,t,n)},LabelComponent:Hm,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&xo.default.createElement(Mm,{ref:e=>this.bottomActionBar=e,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(fr.PushBottom,this.barcodes)},onShutterButtonClick:()=>Jm(this,void 0,void 0,(function*(){(new j).flash(),this.setState({action:"processing"});const e=(new Date).getTime();let t=yield this.recognizeBarcodes(!1,!1);const n=new qm(null!=t?t:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-e)/1e3);const i=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:i}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),xo.default.createElement(gr,{ref:e=>this.popup=e,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(e){return 0==e.length?"No codes scanned. Try again?":1==e.length?"1 Code Scanned":`${e.length} Codes Scanned`}}function eh(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function th(e){const t=e.zoomSteps.findIndex((t=>t==e.defaultZoomFactor)),[n,i]=Object(xo.useState)(e.torchEnabledInitially),[o,r]=Object(xo.useState)(t),a=e.zoomSteps[o],[s,c]=Object(xo.useState)("BACK"==e.initialCameraModule?"environment":"user"),l=function(e){var t,n;const i=null===(n=null===(t=null==e?void 0:e.camera)||void 0===t?void 0:t.video)||void 0===n?void 0:n.parentElement,o=()=>i?i.getBoundingClientRect():null,[r,a]=Object(xo.useState)(o());return Object(xo.useEffect)((()=>{if(i){const e=()=>a(o());e();const t=new ResizeObserver(e);return t.observe(i),()=>{t.disconnect()}}}),[i]),r}(e.scanner),u=!!l;if(Object(xo.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&u&&e.scanner.setTorchState(n)}),[e.capabilities,u,n]),Object(xo.useEffect)((()=>{var t;u&&(null===(t=e.scanner)||void 0===t||t.setZoom(a))}),[u,a]),!e.capabilities||!l)return null;if(!eh(e.capabilities,e.config))return null;const d=l.height-e.bottomPadding-48;return xo.default.createElement(To.Box,{style:{position:"absolute",marginTop:d,marginLeft:l.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},xo.default.createElement($o,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:n?To.FlashlightOn:To.FlashlightOff,active:n,onClick:()=>i(!n)})),xo.default.createElement("div",{style:{width:20}}),xo.default.createElement($o,Object.assign({},e.config.zoomButton,{text:`${a.toFixed(1)}x`,active:o!==t,onClick:()=>r((o+1)%e.zoomSteps.length)})),xo.default.createElement("div",{style:{width:20}}),xo.default.createElement($o,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===s,icon:To.FlipCameraIos,onClick:()=>{var t;const n="environment"===s?"user":"environment";c(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const nh=Object(xo.createContext)(null);class ih{static compute(e,t,n){const i=(fm.a.lowestY(e)+fm.a.highestY(e))/2,o={badgeY:i,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},o),{labelY:Math.max(fm.a.highestY(e)+ih.LABEL_AND_BADGE_PADDING,t?i-ih.AR_BADGE_SIZE/2-ih.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},o),{labelY:Math.min(fm.a.lowestY(e)-ih.LABEL_AND_BADGE_PADDING,t.visible?i+ih.AR_BADGE_SIZE/2+ih.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:i,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${ih.LABEL_AND_BADGE_PADDING/2}px))`},labelY:i,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${ih.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},o),{labelY:0,labelStyle:{display:"none"}}):void 0}}ih.AR_BADGE_SIZE=48,ih.LABEL_AND_BADGE_PADDING=10;var oh=ih;function rh(e){return e.style.visible?""==e.content?null:xo.default.createElement(mm.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},xo.default.createElement(Fo,{styleConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:oh.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:oh.AR_BADGE_SIZE,height:oh.AR_BADGE_SIZE,color:ko.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},xo.default.createElement(To.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var ah=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class sh extends Hm{constructor(){super(...arguments),this.count=0,this.setCount=e=>{this.count=e,this.forceUpdate()}}styleBadge(e,t){this.customBadgeStyle=e,this.customBadgeContent=t,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var e,t;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:i,counterBadge:o}=this.props;const r=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,c=a.code,l=a.highlighted,u=(fm.a.lowestX(s)+fm.a.highestX(s))/2;void 0===i&&(i="BELOW");const d=oh.compute(s,o,i),m=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,h={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return xo.default.createElement(xo.default.Fragment,null,r&&xo.default.createElement(mm.div,{ref:e=>this.label=e,style:Object.assign(Object.assign({},h),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?h:{},transition:p},xo.default.createElement(Fo,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:m?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:l?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},xo.default.createElement(ch,{barcode:c,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:l?r.titleSelected:r.titleDeselected,barcodeSubtitle:l?r.subtitleSelected:r.subtitleDeselected}))),xo.default.createElement(rh,{onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)},style:null!==(t=this.customBadgeStyle)&&void 0!==t?t:o,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function ch(e){var{barcode:t}=e,n=ah(e,["barcode"]);const i=Object(xo.useContext)(nh).useBarcodeMappedData(t);return xo.default.createElement(Yo,Object.assign({barcodeMappedData:i},n))}var lh=n(10);function uh(e){const t=Object(xo.useRef)(),n=Object(xo.useRef)(null),[i,o]=(Object(xo.useContext)(Ho),Object(xo.useState)(void 0)),[r,a]=Object(xo.useState)(!1);Object(xo.useEffect)((()=>{var n,i;e.scanningPaused?null===(n=t.current)||void 0===n||n.pause():null===(i=t.current)||void 0===i||i.resume()}),[e.scanningPaused]);const s=function(e){const t=new Zm;t.visible=e.visible;const n=e.polygon instanceof lh.c,i=e.polygon,o=e,r=n?i.selected:o.polygon.partiallyScanned,a=n?i.deselected:o.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=ko.b.getColorValue(r.fillColor),t.style.highlightedPolygonStrokeColor=ko.b.getColorValue(r.strokeColor),t.style.highlightedPolygonStrokeWidth=r.strokeWidth,t.style.highlightedPolygonCornerRadius=r.cornerRadius,t.style.polygonFillColor=ko.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=ko.b.getColorValue(a.strokeColor),t.style.polygonStrokeWidth=a.strokeWidth,t.style.polygonCornerRadius=a.cornerRadius):(t.style.highlightedPolygonFillColor="transparent",t.style.highlightedPolygonStrokeColor="transparent",t.style.polygonFillColor="transparent",t.style.polygonStrokeColor="transparent"),t.automaticSelectionEnabled=!1,t}(e.arOverlay),c=Object.assign(Object.assign({},e.barcodeScannerViewConfig),{onBarcodesDetected:i=>{var o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(l=(c=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===l||l.call(c,i)},_onDetectionFailed:i=>{var o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new Vm.a(i.width,i.height),[]),null===(l=(c=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===l||l.call(c,i)}});return Object(xo.useEffect)((()=>{const t=eh(i,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[i,e.actionBarConfig]),xo.default.createElement(xo.default.Fragment,null,e.arOverlay.visible&&xo.default.createElement(Dm,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:sh,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),xo.default.createElement(th,{config:e.actionBarConfig,scanner:t.current,capabilities:i,bottomPadding:e.actionBarBottomPadding,torchEnabledInitially:e.cameraConfiguration.flashEnabled,zoomSteps:e.cameraConfiguration.zoomSteps,defaultZoomFactor:e.cameraConfiguration.defaultZoomFactor,initialCameraModule:e.cameraConfiguration.cameraModule}),xo.default.createElement($m,{ref:t,viewFinderPadding:e.viewFinderPadding,configuration:c,onSuccess:()=>class{static setFromScanner(e,t){var n;if(!e.current)return;const i=e.current.getCapabilities();t({hasFacingOptions:(null==i?void 0:i.facingMode)&&i.facingMode.length>0,isTorchAvailable:null!==(n=e.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(t,o),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function dh(e){return Object(xo.useMemo)((()=>{const t=(new Qm).videoConstraints;return t.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,t.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,t.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:t,backgroundColor:ko.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,detectionParameters:new J.BarcodeScannerConfiguration({live:!0,engineMode:e.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new K.BarcodeFormatCommonConfiguration({formats:e.recognizerConfiguration.barcodeFormats.length>0?e.recognizerConfiguration.barcodeFormats:void 0,regexFilter:e.recognizerConfiguration.barcodesRegexFilter,gs1Handling:e.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:e.recognizerConfiguration.maximumRecognizerResolution}}),[e])}var mh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function hh(e){const[t,n]=Object(xo.useState)(null),[i,o]=Object(xo.useState)(!0),r=Object(xo.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,c=Object.assign(Object.assign({},dh(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:r,captureDelay:0}),l=n=>mh(this,void 0,void 0,(function*(){let i;i=null===t?[]:[new Bo.BarcodeScannerUIItem({count:1,barcode:n})];const o={items:i};e.onSubmit(o)}));Object(xo.useEffect)((()=>{t&&(nr.INSTANCE.beep(e.configuration.sound),or.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(xo.useEffect)((()=>{null===t||s.confirmationSheetEnabled||l(t)}),[t,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(t);Object(xo.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(xo.useContext)(Ho);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(nh.Provider,{value:e.barcodeMapper},xo.default.createElement(Ko,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{l(t)},barcodeMappedData:u},{sheetColorLoaded:(m=s).sheetColor,sheetColorLoading:m.barcodeInfoMapping.sheetColor,barcodeImageVisible:m.barcodeImageVisible,barcodeTitle:m.barcodeTitle,barcodeSubtitle:m.barcodeSubtitle,cancelButton:m.cancelButton,submitButton:m.submitButton,dividerColor:m.dividerColor,loadingMessage:m.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),xo.default.createElement(To.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},xo.default.createElement(uh,{cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:o,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:i?80:0},barcodeScannerViewConfig:c,arOnBarcodeClick:e=>n(e),arOnBarcodeEnter:t=>{s.arOverlay.automaticSelectionEnabled&&e.scanningEnabled.current&&n(t)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var m}function fh(e){const t=Object.assign(Object.assign({},e.title),{text:ko.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(jo,Object.assign({},e.leftButton)),xo.default.createElement(To.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},xo.default.createElement(_o.a,{config:t})),xo.default.createElement(jo,Object.assign({},e.rightButton)))}function ph(){return xo.default.createElement("div",{style:{width:30,height:6,backgroundColor:To.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function gh(e){return xo.default.createElement(To.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),xo.default.createElement(ph,null),xo.default.createElement(fh,Object.assign({},e.drawerHeaderContentProps)))}function vh(e){return xo.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},xo.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:e.color}))}function Ch(e){return e.isVisible?xo.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&xo.default.createElement(To.Avatar,{style:{backgroundColor:ko.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},xo.default.createElement(vh,{color:ko.b.getColorValue(e.style.placeholderIcon.color)})),xo.default.createElement(To.Typography,{style:{marginTop:20},variant:"h6"},xo.default.createElement(_o.a,{config:e.style.placeholderTitle})),xo.default.createElement(To.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},xo.default.createElement(_o.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&xo.default.createElement(Qo,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function yh(e,t,n){const i=Object(xo.useRef)(),o=Object(xo.useRef)(null),[r,a]=Object(xo.useState)(),[s,c]=Object(xo.useState)(!1),l=Object(xo.useRef)([]),u=e=>{let n="none";if(l.current.length>0){const t=200,i=((e,t)=>{let n=e[0],i=Math.abs(n.time-t);for(let o=1;o<e.length;o++){const r=Math.abs(e[o].time-t);r<i&&(n=e[o],i=r)}return n})(l.current,e.timeStamp-t),o=i.y-e.clientY,r=100;o>r?n="up":o<-r&&(n="down")}l.current.splice(0,l.current.length),t(new fm.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),c(!0),o.current=new fm.a(e.clientX,e.clientY),a(fm.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new fm.a(t.clientX,t.clientY);i.current=t,a(n),e(n),l.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),u(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),n()}};return{startPoint:o,currentPoint:r,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var bh=n(33);function Ah(e){const[t,n]=Object(xo.useState)(0),[i,o]=Object(xo.useState)(!1),r=Object(xo.useRef)(null),a=Object(xo.useContext)(Ho).height,s=e=>{n(e),o(!0),setTimeout((()=>{o(!1)}),500)},c=t=>{const n=t-l.startPoint.current.y;return Object(bh.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},l=yh((e=>{n(c(e.y))}),((t,n)=>{if(t.y===l.startPoint.current.y)return;let i;i=c(t.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(i="swipe-to-open"),"down"===n&&(i="swipe-to-close"),e.onSwipe(i)}),(()=>{}));return Object(xo.useEffect)((()=>{i||l.dragOngoing||!r||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,l.dragOngoing]),xo.createElement("div",null,xo.createElement(Io.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${Oo} - ${a}px - ${e.closedSheetVisibleHeight}px) * ${t} / 100 + ${e.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:i?"height 500ms":void 0,backgroundColor:ko.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},xo.createElement(gh,{innerRef:e=>{r.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:l.props}),e.children,xo.createElement(Ch,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var Sh=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function wh(e){var{inputRef:t}=e,n=Sh(e,["inputRef"]);const i=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return xo.default.createElement("input",Object.assign({},i,{ref:t}))}function Eh(e){const t=!!e.barcode,[n,i]=xo.default.useState(""),o=xo.default.useRef(null),r={backgroundColor:ko.b.getColorValue(e.dialogStyling.sheetColor)};return Object(xo.useEffect)((()=>{t&&i(String(e.barcode.count))}),[t]),xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Xo,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}},onClose:e.onCancel,PaperProps:{component:"form",onSubmit:t=>{t.preventDefault(),e.setCounter(e.barcode.barcode,parseInt(n)||0)}}},xo.default.createElement(To.DialogContent,{style:r},xo.default.createElement(To.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},xo.default.createElement(_o.a,{config:e.dialogStyling.title})),xo.default.createElement(To.Typography,{fontSize:14,textAlign:"center"},xo.default.createElement(_o.a,{config:e.dialogStyling.info})),xo.default.createElement(To.Box,{sx:{display:"flex",border:"2px solid",borderColor:ko.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},xo.default.createElement(wh,{inputRef:o,value:n,onChange:e=>{const t=parseInt(e.target.value.replaceAll(/[^0-9]/g,""));i(t>=0?t.toString():"")},type:"text",pattern:"[0-9]*"}),e.dialogStyling.clearTextButton.visible&&xo.default.createElement(Io.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:ko.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),xo.default.createElement(To.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},xo.default.createElement(Io.a,{container:!0,spacing:2},xo.default.createElement(Io.a,{item:!0,xs:12},xo.default.createElement(Io.a,{color:ko.b.getColorValue(e.dialogStyling.dividerColor)})),xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({icon:To.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function xh(e){return xo.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:ko.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},xo.default.createElement(Io.a,{style:{height:"100%",color:ko.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}const Dh=0,Bh=800,Th=1200;function Ih(e){switch(e){case"mobile":return Object(To.useMediaQuery)("(min-width:"+Dh+"px) and (max-width:"+(Bh-1)+"px)");case"tablet":return Object(To.useMediaQuery)("(min-width:"+Bh+"px) and (max-width:"+(Th-1)+"px)");case"desktop":return Object(To.useMediaQuery)("(min-width:"+Th+"px)")}}function kh(e){switch(e){case"mobile":return Object(To.useMediaQuery)("(min-width:"+Dh+"px)");case"tablet":return Object(To.useMediaQuery)("(min-width:"+Bh+"px)");case"desktop":return Object(To.useMediaQuery)("(min-width:"+Th+"px)")}}const Oh=150;function Lh(e){const[t,n]=Object(xo.useState)(0),[i,o]=Object(xo.useState)(!1);let r;const a=yh((e=>{let t=a.startPoint.current.x-e.x;t<0?a.stop():n(-t)}),(t=>{if(t.x===a.startPoint.current.x)return;if(a.startPoint.current.x-t.x>75){const t=e.animateBackAfterDelete?()=>{l(0)}:void 0;l(Oh,t)}else l(0)}),(()=>{l(0)})),s=Object(xo.useContext)(nh),c=s.useBarcodeMappedData(e.barcode);Object(xo.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const l=(t,i)=>{const a=t>=Oh,s=-r.getBoundingClientRect().width;n(a?s:0),o(!0),setTimeout((()=>{o(!1),a&&e.onDelete(e.barcode),i&&i()}),200)},u=Ih("desktop")&&e.swipeToDeleteConfig.enabled,d=!u&&e.swipeToDeleteConfig.enabled;return Object(xo.useEffect)((()=>{d||l(0)}),[d]),xo.default.createElement(To.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(r=e)}},xo.default.createElement(xh,{config:e.swipeToDeleteConfig,visibleOffset:Oh}),xo.default.createElement(To.Box,Object.assign({sx:{width:"100%",backgroundColor:ko.b.getColorValue(e.sheetColor),transform:`translateX(${t}px)`,transition:i?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),xo.default.createElement(Yo,Object.assign({barcodeMappedData:c},e)),null!==e.readonlyCount&&xo.default.createElement(To.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:ko.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),u&&xo.default.createElement(Io.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:ko.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),xo.default.createElement(To.Box,{sx:{width:"0px"}})))}function Ph(e){const t=ko.b.getColorValue(e.sheetContent.dividerColor),n=e.sheetContent.manualCountChangeEnabled&&"COUNTING"===e.mode,i=(t,n)=>{let i=e.indicatorColor.partial;return n===t.count?i=e.indicatorColor.complete:0===n&&(i=e.indicatorColor.notScanned),ko.b.getColorValue(i)};return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&xo.default.createElement(Io.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},xo.default.createElement(Io.a,{sx:{p:0}},e.barcodes.map((({barcode:o,count:r},a)=>{const s=e.expectedBarcodes.find((e=>e.barcodeValue===o.text));return xo.default.createElement(Io.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&xo.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:i(s,r),position:"absolute"}}),xo.default.createElement(Lh,{barcode:o,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:o}),counterForm:n&&{counter:r,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[o],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:o,count:r})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:r,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:e.sheetContent.barcodeItemImageVisible,barcodeTitle:e.sheetContent.barcodeItemTitle,barcodeSubtitle:e.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:e.sheetContent.swipeToDelete,sheetColor:e.sheetContent.sheetColor}))})))))}function _h(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return xo.default.createElement(To.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:e.text,showZero:!0,color:"primary",overlap:n,slotProps:{badge:{style:Object.assign(Object.assign({},t),{backgroundColor:e.backgroundColor,color:e.foregroundColor,fontWeight:"bold"})}}},e.children)}function Rh(e){if(!e.buttonStyling.visible)return null;return xo.default.createElement(To.Box,{style:e.style},xo.default.createElement(_h,{text:e.text,backgroundColor:ko.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:ko.b.getColorValue(e.buttonStyling.badgeForegroundColor)},xo.default.createElement(To.IconButton,{sx:{backgroundColor:ko.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:ko.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},xo.default.createElement(Io.a,{sx:{color:ko.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:ko.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const Fh=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,Mh=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class Nh{constructor(e,t){this.expectedCount=e,this.foundCount=t}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Vh(e){const t=Object(xo.useContext)(ko.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return xo.default.createElement(Xo,{modalOverlayColor:e.modalOverlayColor,open:e.open},xo.default.createElement(To.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},xo.default.createElement(To.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},xo.default.createElement(_o.a,{config:e.title})),xo.default.createElement(To.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},xo.default.createElement(_o.a,{config:e.subtitle}))),xo.default.createElement(To.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},xo.default.createElement(Io.a,{container:!0,spacing:2},xo.default.createElement(Io.a,{item:!0,xs:12},xo.default.createElement(Io.a,{color:t(e.dividerColor)})),xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),xo.default.createElement(Io.a,{item:!0,xs:6},xo.default.createElement(Qo,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function Wh(e){return e.open?xo.default.createElement(Vh,{open:e.open,dividerColor:e.style.dividerColor,modalOverlayColor:e.style.modalOverlayColor,sheetColor:e.style.sheetColor,title:e.style.title,subtitle:e.style.subtitle,cancelButton:{style:e.style.cancelButton,onClick:e.onDismiss},okButton:{style:e.style.okButton,onClick:e.onSubmit}}):null}class zh{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,i;const o=null!==(n=null===(t=this.foundBarcodes.find((t=>Fh(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",r=Mh(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(i=r.title)&&void 0!==i?i:e.text}`,subtitle:ko.b.getLocalizedText(this.barcodeItemSubtitleText,[o,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function jh(e){const t=Object(xo.useContext)(Ho);return xo.default.createElement(Io.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:ko.b.getColorValue(e.sheetContent.sheetColor)}},xo.default.createElement(Io.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},xo.default.createElement(fh,Object.assign({},e.headerProps))),e.barcodeList,xo.default.createElement(Ch,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var Hh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Uh(e){const t=Object(xo.useRef)(),n=Object(xo.useRef)(new Date("2001-01-01")),[i,o]=Object(xo.useReducer)(function(e,t,n,i){return(o,r)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,c=s?"COUNTING":a.mode,l=s?a.expectedBarcodes:[],u=e=>{let t=[...o];const n=r.barcodes||[r.barcode];for(const i of n){const n=t.findIndex((e=>Fh(e.barcode,i)));if(-1===n)t.push({barcode:i,count:e(0)});else{const i=t[n];t[n]=Object.assign(Object.assign({},i),{count:e(i.count,i)})}}return t},d=(e,n)=>{var o;if(t.current=new Date,!n)return e;const r=null===(o=Mh(l,n.barcode))||void 0===o?void 0:o.count;return void 0===r||r===e?e:(i(),e+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...o];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...o];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return u((n=>{let o="COUNTING"===c?n+1:1;return o===n||e||(t.current=new Date,i()),o}))}return u((e=>e))}case"onARCodeClick":return u(((e,t)=>{if(s)return d(e,t);const n="UNIQUE"===c?1-e:e+1;return n>0&&i(),n}));case"onCountEditDialogChange":{let e=()=>r.count||0;if(s){const t=Mh(l,r.barcode);r.count>t.count&&(e=()=>t.count)}return u(e)}case"setCount":return u(r.computeNewCount);case"remove":return o.map((e=>Object.assign(Object.assign({},e),{count:Fh(e.barcode,r.barcode)?0:e.count})));case"clear":return o.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const m=o.map((t=>Fh(t.barcode,r.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:r.polygonElement,labelElement:r.labelElement})):t));return e||m.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),m}}}(e.configuration,n,e.scanningEnabled,(()=>{nr.INSTANCE.beep(e.configuration.sound),or.INSTANCE.vibrate(e.configuration.vibration)})),[]),[r,a]=xo.default.useState(null),[s,c]=Object(xo.useState)(!1),l=Object(xo.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(xo.useState)(!0),m=e.barcodeMapper,[h,f]=Object(xo.useState)(null),p="FindAndPickScanningMode"===e.configuration.useCase._type,g=e.configuration.useCase,v=p?"COUNTING":g.mode,C=Object(xo.useRef)(Object.assign(Object.assign({},dh(e.configuration)),{onBarcodesDetected:e=>{o({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(xo.useEffect)((()=>{if(p){const t=A();for(const n of t){const t=[(e=n.barcodeValue,new J.BarcodeItem({text:e,format:null,quad:[],quadNormalized:[],sourceImage:null,rawBytes:null,upcEanExtension:null,extractedDocument:null}))];o({type:"setCount",barcodes:t,computeNewCount:()=>0})}}var e}),[]),Object(xo.useEffect)((()=>{C.current.container=t.current}),[t]),Object(xo.useEffect)((()=>{if(p)for(const e of i){const t=g.arOverlay,n=e.polygonElement,i=e.labelElement;if(w(e.barcode)){const o=_(e.barcode);let r=e.count+"/"+o.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==e.count||(r=xo.default.createElement(To.TouchApp,null)),o.isFulFilled()?(null==n||n.style(ko.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==i||i.styleBadge(t.badge.completed,xo.default.createElement(To.Check,null))):(null==n||n.style(ko.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==i||i.styleBadge(t.badge.partiallyScanned,r))}else null==n||n.style(ko.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==i||i.styleBadge(t.badge.rejected,xo.default.createElement(To.Close,null))}else for(const e of i){if(e.polygonElement){const t=g.arOverlay.polygon,n=e.count>0?t.selected:t.deselected;e.polygonElement.style(ko.b.getPolygonColorValues(n,t.visible))}e.labelElement&&(e.labelElement.update(Object.assign(Object.assign({},e.labelElement.state.element),{highlighted:e.count>0})),e.labelElement.setCount(e.count))}}),[i]);const y=i.reduce(((e,t)=>e+t.count),0),b=()=>A().every((e=>i.some((t=>t.barcode.text===e.barcodeValue&&t.count===e.count)))),A=()=>p?g.expectedBarcodes:[],S=e=>Mh(A(),e),w=e=>!!S(e),E=()=>p?i.filter((e=>w(e.barcode))):i.filter((e=>e.count>0)),x=()=>Hh(this,void 0,void 0,(function*(){const t=E().map((e=>new Bo.BarcodeScannerUIItem({count:"COUNTING"===v?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),D=xo.default.createElement(Ph,{expectedBarcodes:A(),barcodes:E(),animateBackAfterDelete:p,onBarcodeChange:o,sheetContent:g.sheetContent,onNumberClick:e=>a(e),mode:v,indicatorColor:p&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),B={textReplacementArgs:[y.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>o({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>Hh(this,void 0,void 0,(function*(){if(p){const e=g;let t=null;e.partialScannedAlertDialogEnabled&&!b()&&(t=e.partialScannedAlertDialog),e.confirmationAlertDialogEnabled&&b()&&(t=e.confirmationAlertDialog),t?f(t):yield x()}else yield x()}))}),title:g.sheetContent.title},T=Ih("mobile"),I="BUTTON"!==g.sheet.mode&&T?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,k=T&&"BUTTON"===g.sheet.mode,O=k?76:0,L=(u?80:0)+O,P=Object(xo.useContext)(Ho),_=e=>{const t=i.find((t=>t.barcode.text===e.text)),n=S(e);return new Nh(null==n?void 0:n.count,null==t?void 0:t.count)},R=A().reduce(((e,t)=>e+t.count),0);p&&B.textReplacementArgs.push(R.toString());const F=p?new zh(g.sheetContent.barcodeItemSubtitle.text,i,A()):m,M=!p&&0===y;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(nh.Provider,{value:F},xo.default.createElement(Io.a,{container:!0,sx:{display:"flex",flexDirection:T?"column":"row",height:`calc(${P.remainingVisibleBodyHeight} - ${I}px)`},alignItems:"stretch"},xo.default.createElement(Io.a,{id:l,item:!0,ref:t,component:"div",xs:T?12:7,zIndex:100},k&&xo.default.createElement(Rh,{style:{position:"absolute",marginTop:`calc(${P.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:p?`${y}/${R}`:y.toString(),onClick:()=>c(!s),buttonStyling:g.sheet.listButton}),xo.default.createElement(uh,{viewFinderPadding:{minTopPadding:P.minTopPaddingForContent,minBottomPadding:L},arOverlay:(()=>{if(p){const e=g.arOverlay;return Object.assign(Object.assign({},e),{counterBadge:Object.assign({},e.badge.partiallyScanned)})}const e=g.arOverlay,t=e.counterBadge;return Object.assign(Object.assign({},e),{counterBadge:Object.assign(Object.assign({},t),{visible:t.visible&&"COUNTING"===v})})})(),containerId:l,barcodeScannerViewConfig:C.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+O,setActionButtonsVisible:d,arOnBarcodeClick:e=>{o({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;o({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&T,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),T&&xo.default.createElement(Ah,{closedSheetVisibleHeight:I,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:M,onBarcodeChange:e=>o(e),drawerHeaderContentProps:B,isOpen:s,onSwipe:e=>{c("swipe-to-open"===e)}},D)),kh("tablet")&&xo.default.createElement(jh,{headerProps:B,sheetContent:g.sheetContent,isEmptyStateVisible:M,barcodeList:D})),xo.default.createElement(Eh,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{o({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),xo.default.createElement(Wh,{open:null!==h,style:h,onDismiss:()=>f(null),onSubmit:x})))}const Zh=Object(xo.createContext)(null),Gh={didCatch:!1,error:null};class Yh extends xo.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Gh}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:o,reason:"imperative-api"}),this.setState(Gh)}}componentDidCatch(e,t){var n,i;null===(n=(i=this.props).onError)||void 0===n||n.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:i}=this.props;var o,r;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,i)&&(null===(o=(r=this.props).onReset)||void 0===o||o.call(r,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Gh))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:r}=this.state;let a=e;if(o){const e={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(xo.createElement)(n,e);else{if(null!==i&&!Object(xo.isValidElement)(i))throw r;a=i}}return Object(xo.createElement)(Zh.Provider,{value:{didCatch:o,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Qh(){const e=Object(xo.useRef)(!0);return Object(xo.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function qh(e){const t=Qh(),[,n]=Object(xo.useReducer)((e=>e+1),0),i=Object(xo.useRef)();return Object(xo.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(xo.useMemo)((()=>{e&&e.then((e=>{t({loading:!1,error:null,value:e})})).catch((e=>{t({loading:!1,error:{reason:e},value:void 0})}))}),[e])}(e,(e=>{i.current=e,t.current&&n()})),e?i.current:null}var Xh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Kh{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>dr(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>Xh(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new Bo.BarcodeScannerUIItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield z.toDataUrl(yield zC.instance.imageToJpeg(e.sourceImage));return{title:e.text,subtitle:e.format,barcodeImage:t}}})))();this.cache.set(t,n)}return this.cache.get(t)}useBarcodeMappedData(e){const t=Object(xo.useRef)(!1),n=qh(e&&this.getBarcodeMappedData(e));if(Object(xo.useEffect)((()=>{n&&n.error&&(t.current=!1,this.cacheEntryPendingRetries.push({barcode:e,retry:()=>{this.cache.delete(this.hash(e)),t.current=!0}}),this.onError((()=>{for(const e of this.cacheEntryPendingRetries)e.retry();this.cacheEntryPendingRetries.length=0}),(()=>{t.current=!0;for(const e of this.cacheEntryPendingRetries)for(const t of this.onEvictionListeners)this.hash(t.barcode)==this.hash(e.barcode)&&t.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let i;return i=n.value?"LOADED":n.error&&!t.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:i}}addOnEvictionListener(e){this.onEvictionListeners.add(e)}removeOnEvictionListener(e){this.onEvictionListeners.delete(e)}}Bo.BarcodeItemErrorState;function Jh(e){return xo.default.createElement(Vh,{open:e.open,dividerColor:e.dividerColor,modalOverlayColor:e.modalOverlayColor,sheetColor:e.sheetColor,title:e.title,subtitle:e.subtitle,cancelButton:{style:e.cancelButton,onClick:e.handleCancel},okButton:{style:e.retryButton,icon:To.Replay,onClick:e.handleRetry}})}function $h(e){const t=Object(xo.useContext)(Ho);return xo.default.createElement(To.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:ko.b.getColorValue(e.config.background)}},xo.default.createElement(To.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&xo.default.createElement(To.Box,null,xo.default.createElement(To.Avatar,{sx:{width:100,height:100,backgroundColor:ko.b.getColorValue(e.config.iconBackground),margin:"24px"}},xo.default.createElement(Io.a,{sx:{fontSize:50,color:ko.b.getColorValue(e.config.icon.color)}}))),xo.default.createElement(To.Typography,{sx:{fontSize:20,textAlign:"center"}},xo.default.createElement(_o.a,{config:e.config.enableCameraTitle})),xo.default.createElement(To.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},xo.default.createElement(_o.a,{config:e.config.enableCameraExplanation})),xo.default.createElement(To.Box,{sx:{paddingTop:"16px"}},xo.default.createElement(jo,Object.assign({},e.config.closeButton,{onClick:e.onAppClose})))))}function ef(e){const t=Object(xo.useRef)(Object(To.createTheme)({palette:{primary:{main:pr.ScanbotPrimary},secondary:{main:pr.DarkGray}}})),[n,i]=Object(xo.useState)(!1),[o,r]=Object(xo.useState)(!1),[a,s]=Object(xo.useState)(e.configuration.timeouts.initialScanDelay<=0),c=Object(xo.useRef)(!1),l=Object(xo.useRef)(),u=Object(xo.useRef)(),d=e.configuration.useCase,m="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,h=Object(xo.useMemo)((()=>new Kh(null==m?void 0:m.barcodeItemMapper,((e,t)=>{i(!0),l.current=()=>{i(!1),e()},u.current=()=>{i(!1),t()}}))),[]);let f;if(Object(xo.useMemo)((()=>{ko.b.setPalette(e.configuration.palette),ko.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(xo.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(xo.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(xo.useEffect)((()=>{c.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=xo.default.createElement(hh,{configuration:e.configuration,barcodeMapper:h,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=xo.default.createElement(Uh,{configuration:e.configuration,barcodeMapper:h,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c})}return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Lo,null),xo.default.createElement(Yh,{onError:e.onError,fallback:xo.default.createElement("div",null,"Error")},xo.default.createElement(ko.a.Provider,{value:Object(ko.c)(e.configuration.palette)},xo.default.createElement(To.ThemeProvider,{theme:t.current},m&&xo.default.createElement(Jh,Object.assign({open:n,handleCancel:u.current,handleRetry:l.current,modalOverlayColor:m.modalOverlayColor,dividerColor:m.dividerColor,sheetColor:m.sheetColor},m.errorState)),xo.default.createElement(Io.a,{sx:{height:`100 * ${Oo}`,width:"100vw",backgroundColor:ko.b.getColorValue(e.configuration.backgroundColor)}},xo.default.createElement(Uo,Object.assign({onBackPress:e.onClose},e.configuration.topBar),!o&&f,o&&xo.default.createElement($h,{onAppClose:e.onClose,config:e.configuration.cameraPermission})))))))}class tf{constructor(e){this.document=e}}var nf=n(16);function of(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),xo.default.createElement("path",{d:"M173.211 205.398H94.7913C93.9699 205.398 93.3054 204.733 93.3054 203.912V80.0909C93.3054 79.2695 93.9699 78.605 94.7913 78.605H173.211C174.033 78.605 174.697 79.2695 174.697 80.0909V203.912C174.697 204.733 174.033 205.398 173.211 205.398ZM96.2771 202.426H171.726V81.5767H96.2771V202.426ZM160.829 184.761H152.575V181.789H160.829V184.761ZM160.829 168.252H107.173V165.28H160.829V168.252ZM160.829 151.742H152.575V148.77H160.829V151.742ZM136.065 151.742H107.173V148.77H136.065V151.742ZM160.829 135.233H152.575V132.261H160.829V135.233ZM136.065 135.233H107.173V132.261H136.065V135.233ZM160.829 118.723H152.575V115.751H160.829V118.723ZM136.065 118.723H107.173V115.751H136.065V118.723ZM160.829 102.214H152.575V99.2419H160.829V102.214ZM136.065 102.214H107.173V99.2419H136.065V102.214Z",fill:t}),xo.default.createElement("path",{d:"M178.826 66.5525H170.571V63.5808H178.826V66.5525ZM154.062 66.5525H125.17V63.5808H154.062V66.5525ZM178.826 50.043H170.571V47.0713H178.826V50.043ZM154.062 50.043H125.17V47.0713H154.062V50.043Z",fill:t}),xo.default.createElement("path",{d:"M111.302 35.8152C111.302 34.9939 111.967 34.3293 112.788 34.3293H191.208C192.03 34.3293 192.694 34.9939 192.694 35.8152V135.232C192.694 136.053 192.03 136.718 191.208 136.718H173.213V133.746H189.722V37.3011H114.274V80.0903H111.302V35.8152Z",fill:t}),xo.default.createElement("path",{d:"M174.46 79.6618C174.202 78.8819 173.363 78.4596 172.583 78.7174L172.105 82.0053L188.88 134.381L191.134 136.258C191.134 136.258 191.134 134.195 192.079 134.381L174.46 79.6618Z",fill:t}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function rf(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.3575 73.6228C84.5124 73.6228 83.8287 74.3065 83.8287 75.1516V189.81C83.8287 190.655 84.5124 191.339 85.3575 191.339H174.536C175.381 191.339 176.065 190.655 176.065 189.81V100.631C176.065 100.224 175.904 99.8371 175.619 99.5526L150.139 74.073C149.851 73.7842 149.464 73.6228 149.057 73.6228H85.3575ZM86.8863 76.6804V188.281H173.007V102.16H149.057C148.212 102.16 147.528 101.476 147.528 100.631V76.6804H86.8863ZM170.846 99.1025L150.585 78.8419V99.1025H170.846Z",fill:t}),xo.default.createElement("path",{d:"M147.528 177.665H96.5686V174.607H147.528V177.665ZM164.514 167.048H96.5686V163.991H164.514V167.048ZM164.514 156.432H96.5686V153.374H164.514V156.432ZM133.149 105.956L130.987 103.795L119.33 115.456L109.767 105.893C113.742 104.559 116.613 100.801 116.613 96.3846C116.613 90.8598 112.115 86.3626 106.591 86.3626H96.5686V121.864H99.6261V106.407H105.958L117.169 117.618L105.508 129.279L107.669 131.44L119.33 119.779L130.992 131.44L133.153 129.279L121.492 117.618L133.149 105.956ZM99.6261 103.349V89.4202H106.591C110.429 89.4202 113.555 92.5457 113.555 96.3846C113.555 100.224 110.429 103.349 106.591 103.349H99.6261Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M98.0973 60.883C97.2523 60.883 96.5686 61.5667 96.5686 62.4118V73.6228H99.6261V63.9406H160.268V87.8914C160.268 88.7365 160.951 89.4202 161.796 89.4202H185.747V175.541H176.076V178.599H187.276C188.121 178.599 188.805 177.915 188.805 177.07V87.8914C188.805 87.4838 188.643 87.0973 188.359 86.8128L162.879 61.3331C162.591 61.0444 162.204 60.883 161.796 60.883H98.0973ZM183.586 86.3626L163.325 66.1021V86.3626H183.586Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.837 48.1432C109.992 48.1432 109.308 48.8269 109.308 49.672V60.883H112.366V51.2007H173.007V75.1516C173.007 75.9967 173.691 76.6804 174.536 76.6804H198.487V162.802H188.816V165.859H200.016C200.861 165.859 201.545 165.175 201.545 164.33V75.1516C201.545 74.7439 201.383 74.3575 201.099 74.073L175.619 48.5933C175.33 48.3046 174.944 48.1432 174.536 48.1432H110.837ZM196.326 73.6228L176.065 53.3623V73.6228H196.326Z",fill:t}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),xo.default.createElement("defs",null,xo.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},xo.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),xo.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function af(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.2563 72.9183C84.4112 72.9183 83.7275 73.607 83.7275 74.4583V189.956C83.7275 190.807 84.4112 191.496 85.2563 191.496H174.435C175.28 191.496 175.964 190.807 175.964 189.956V100.124C175.964 99.7137 175.802 99.3244 175.518 99.0378L150.038 73.3717C149.75 73.0808 149.363 72.9183 148.955 72.9183H85.2563ZM86.7851 75.9982V188.416H172.906V101.664H148.955C148.11 101.664 147.427 100.976 147.427 100.124V75.9982H86.7851ZM170.745 98.5844L150.484 78.1756V98.5844H170.745Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M161.695 124.25H97.9961V127.33H161.695V124.25ZM161.695 137.084H97.9961V140.168H161.695V137.084ZM161.695 149.917H97.9961V153.001H161.695V149.917ZM161.695 162.75H97.9961V165.834H161.695V162.75Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M97.9961 60.0852C97.1511 60.0852 96.4674 60.774 96.4674 61.6252V72.9183H99.5249V63.1652H160.166V87.2913C160.166 88.1426 160.85 88.8313 161.695 88.8313H185.646V175.583H175.975V178.663H187.175C188.02 178.663 188.704 177.974 188.704 177.123V87.2913C188.704 86.8807 188.542 86.4914 188.258 86.2048L162.778 60.5387C162.489 60.2478 162.103 60.0852 161.695 60.0852H97.9961ZM183.485 85.7513L163.224 65.3425V85.7513H183.485Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.736 47.2522C109.891 47.2522 109.207 47.9409 109.207 48.7922V60.0852H112.265V50.3321H172.906V74.4583C172.906 75.3095 173.59 75.9982 174.435 75.9982H198.386V162.75H188.715V165.83H199.915C200.76 165.83 201.443 165.141 201.443 164.29V74.4583C201.443 74.0476 201.282 73.6583 200.998 73.3717L175.518 47.7056C175.229 47.4147 174.843 47.2522 174.435 47.2522H110.736ZM196.224 72.9183L175.964 52.5095V72.9183H196.224Z",fill:t}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),xo.default.createElement("defs",null,xo.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},xo.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),xo.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function sf(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8858 67.2461H206.331C207.315 67.2461 208.112 68.0427 208.112 69.0274V148.198C208.112 149.183 207.315 149.979 206.331 149.979H57.8858C56.9011 149.979 56.1045 149.183 56.1045 148.198V69.0274C56.1045 68.0427 56.9011 67.2461 57.8858 67.2461ZM204.549 70.8088H188.502L184.935 70.8038H79.2767L75.719 70.8088H59.6672V146.417H204.549V70.8088Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M154.834 91.8126C156.378 91.2748 157.875 91.8812 159.135 93.0581C159.912 93.7836 160.383 94.9148 160.697 96.2223C161.89 101.192 158.931 105.086 155.401 107.747C154.487 108.436 153.507 109.065 152.504 109.634C152.629 111.883 152.971 113.886 153.518 115.307C153.958 116.449 154.414 116.91 154.695 117.045C154.824 117.106 155.197 117.245 156.082 116.593C157.154 115.804 158.48 114.339 160.054 111.889C162.325 108.353 163.811 105.745 164.733 103.853C164.871 103.57 164.994 103.305 165.105 103.06C164.618 101.743 165.065 100.362 165.498 99.625C165.624 99.4115 165.788 99.1797 165.997 98.9797C166.151 98.8316 166.576 98.4573 167.217 98.4428C167.593 98.4343 167.97 98.5556 168.278 98.8062C168.562 99.0368 168.712 99.3145 168.792 99.5191C168.942 99.9021 168.95 100.295 168.937 100.573C168.909 101.173 168.741 101.894 168.437 102.749C168.829 103.064 169.379 103.266 170.06 103.302C171.173 103.362 172.298 102.941 172.954 102.213C174.863 100.095 177.418 98.185 180.536 97.8253C181.365 97.7297 182.224 97.6408 183.098 97.5504C186.089 97.241 189.256 96.9135 191.961 96.2372C193.699 95.8027 195.099 95.2557 196.067 94.5713C196.998 93.9135 197.455 93.1906 197.539 92.3236L200.494 92.6118C200.305 94.546 199.225 95.9753 197.781 96.9957C196.375 97.9894 194.564 98.6466 192.681 99.1174C189.748 99.8507 186.282 100.208 183.263 100.519C182.426 100.606 181.624 100.688 180.876 100.775C178.776 101.017 176.834 102.343 175.159 104.201C173.808 105.699 171.758 106.366 169.903 106.267C168.995 106.219 168.054 105.978 167.227 105.507C166.23 107.501 164.725 110.11 162.552 113.493C160.889 116.083 159.331 117.887 157.843 118.984C156.448 120.011 154.889 120.429 153.414 119.723C152.091 119.09 151.273 117.738 150.747 116.374C150.182 114.907 149.821 113.068 149.634 111.082C147.662 111.967 145.746 112.619 144.193 113.033L143.427 110.165C145.145 109.706 147.328 108.933 149.482 107.874C149.478 107.086 149.496 106.294 149.536 105.509C149.738 101.57 150.496 97.4995 151.843 94.8477C152.501 93.5543 153.451 92.2939 154.834 91.8126ZM152.479 106.174C152.868 105.918 153.248 105.652 153.614 105.376C156.807 102.969 158.585 100.145 157.81 96.9152C157.538 95.781 157.238 95.349 157.108 95.2275C156.299 94.4715 155.923 94.577 155.81 94.6164C155.534 94.7123 155.042 95.107 154.49 96.1927C153.42 98.2992 152.695 101.883 152.501 105.661C152.493 105.832 152.485 106.003 152.479 106.174ZM165.971 100.375C165.971 100.375 165.972 100.379 165.972 100.388L165.971 100.375Z",fill:t}),xo.default.createElement("path",{d:"M74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.851 89.0878H74.5831C73.5888 89.0878 72.7797 89.8969 72.7797 90.8912C72.7797 91.8856 73.5888 92.6947 74.5831 92.6947H81.7651C84.7317 92.6947 87.1437 95.1067 87.1437 98.0732C87.1437 101.04 84.7317 103.452 81.7651 103.452H79.9653V107.546H76.3866V103.452H70.4973V99.8767H81.7651C82.7595 99.8767 83.5686 99.0676 83.5686 98.0732C83.5686 97.0789 82.7595 96.2698 81.7651 96.2698H74.5831C71.6166 96.2698 69.2046 93.8578 69.2046 90.8912C69.2046 87.9247 71.6166 85.5126 74.5831 85.5126H76.3866V81.4189H79.9617V85.5126H85.851V89.0878ZM85.3542 86.0079V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542Z",fill:t}),xo.default.createElement("path",{d:"M77.888 170.225C77.888 171.209 78.6847 172.006 79.6694 172.006H228.114C229.099 172.006 229.895 171.209 229.895 170.225V91.0542C229.895 90.0696 229.099 89.2729 228.114 89.2729H206.718V92.8306L210.286 92.8356H226.333V168.443H81.4507V148.197H77.888V170.225Z",fill:t}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function cf(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),xo.default.createElement("path",{d:"M130.218 153.186H68.4406C63.9202 153.186 60.516 149.782 60.516 145.272V72.9456C60.516 68.4316 63.9202 65.0322 68.4406 65.0322H183.475C187.996 65.0322 191.4 68.4316 191.4 72.9456V126.127H188.332V72.9456C188.332 70.1334 186.291 68.0955 183.475 68.0955H68.4406C65.6244 68.0955 63.5836 70.1334 63.5836 72.9456V145.272C63.5836 148.08 65.6244 150.122 68.4406 150.122H130.218V153.186ZM167.041 114.518H128.493V111.455H167.041V114.518Z",fill:t}),xo.default.createElement("path",{d:"M121.698 153.186H183.476C187.997 153.186 191.401 149.782 191.401 145.272L191.4 72.9456C191.4 68.4316 187.996 65.0322 183.475 65.0322H68.4406C63.9202 65.0322 60.516 68.4316 60.516 72.9456L60.5169 126.127H63.5845L63.5836 72.9456C63.5836 70.1334 65.6244 68.0955 68.4406 68.0955H183.475C186.291 68.0955 188.332 70.1334 188.332 72.9456L188.333 145.272C188.333 148.08 186.292 150.122 183.476 150.122H121.698V153.186Z",fill:t}),xo.default.createElement("path",{d:"M215.429 174.458H104.655C99.1122 174.458 94.6003 169.953 94.6003 164.418V152.25H97.6679V164.418C97.6679 168.264 100.804 171.395 104.655 171.395H215.429C219.281 171.395 222.417 168.268 222.417 164.418V96.3454C222.417 92.4994 219.285 89.368 215.429 89.368H190.462V86.3048H215.429C220.976 86.3048 225.484 90.8103 225.484 96.3454V164.418C225.484 169.957 220.976 174.458 215.429 174.458Z",fill:t}),xo.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),xo.default.createElement("path",{d:"M112.159 121.403H115.229V119.282C115.229 111.233 110.38 103.947 103.123 100.631C106.044 98.1624 107.766 94.5534 107.766 90.656C107.766 83.3827 101.818 77.4666 94.5044 77.4666C87.1911 77.4666 81.2423 83.3827 81.2423 90.656C81.2423 94.5534 82.9651 98.1624 85.8862 100.631C78.6283 103.947 73.7798 111.233 73.7798 119.282V121.403H76.8501V119.282C76.8501 111.551 82.1165 104.643 89.6559 102.488C90.2614 102.314 90.7006 101.788 90.7603 101.165C90.82 100.542 90.4917 99.9436 89.9288 99.6595C86.4619 97.908 84.3127 94.4601 84.3127 90.656C84.3127 85.0664 88.884 80.5201 94.5044 80.5201C100.125 80.5201 104.696 85.0664 104.696 90.656C104.696 94.4601 102.543 97.908 99.08 99.6595C98.5171 99.9436 98.1888 100.542 98.2485 101.165C98.3082 101.788 98.7474 102.314 99.3529 102.488C106.892 104.643 112.159 111.551 112.159 119.282V121.403Z",fill:"#A5A5A5"}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function lf(e){const{color:t}=e;return xo.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),xo.default.createElement("path",{d:"M130.218 152.933H68.4406C63.9202 152.933 60.516 149.53 60.516 145.02V72.6932C60.516 68.1791 63.9202 64.7798 68.4406 64.7798H183.475C187.996 64.7798 191.4 68.1791 191.4 72.6932V125.875H188.332V72.6932C188.332 69.8809 186.291 67.843 183.475 67.843H68.4406C65.6244 67.843 63.5836 69.8809 63.5836 72.6932V145.02C63.5836 147.828 65.6244 149.87 68.4406 149.87H130.218V152.933ZM113.176 135.915H74.8314V132.852H113.176V135.915ZM100.395 101.879H74.8314C73.9836 101.879 73.2976 101.194 73.2976 100.348V79.075C73.2976 78.2283 73.9836 77.5433 74.8314 77.5433H100.395C101.242 77.5433 101.928 78.2283 101.928 79.075V100.348C101.928 101.194 101.242 101.879 100.395 101.879ZM93.4074 98.8159H98.8609V89.1156H93.4074V98.8159ZM84.8863 98.8159H90.344V87.584C90.344 86.7373 91.03 86.0524 91.8778 86.0524H98.8651V80.6066H84.8863V98.8159ZM76.3652 98.8159H81.8187V93.3701H76.3652V98.8159ZM76.3652 90.3069H81.8187V80.6066H76.3652V90.3069Z",fill:t}),xo.default.createElement("path",{d:"M121.698 152.933H183.476C187.997 152.933 191.401 149.53 191.401 145.02L191.4 72.6932C191.4 68.1791 187.996 64.7798 183.475 64.7798H68.4406C63.9202 64.7798 60.516 68.1791 60.516 72.6932L60.5169 125.875H63.5845L63.5836 72.6932C63.5836 69.8809 65.6244 67.843 68.4406 67.843H183.475C186.291 67.843 188.332 69.8809 188.332 72.6932L188.333 145.02C188.333 147.828 186.292 149.87 183.476 149.87H121.698V152.933Z",fill:t}),xo.default.createElement("path",{d:"M215.429 174.206H104.655C99.1122 174.206 94.6003 169.7 94.6003 164.165V151.997H97.6679V164.165C97.6679 168.011 100.804 171.143 104.655 171.143H215.429C219.281 171.143 222.417 168.016 222.417 164.165V118.897H190.462V115.834H222.417V106.134H190.462V103.07H222.417V96.093C222.417 92.2469 219.285 89.1156 215.429 89.1156H190.462V86.0524H215.429C220.976 86.0524 225.484 90.5579 225.484 96.093V164.165C225.484 169.705 220.976 174.206 215.429 174.206Z",fill:t}),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),xo.default.createElement("g",{style:{mixBlendMode:"soft-light"}},xo.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function uf(e){if(e.source instanceof nf.j)return null;const t="#FFFFFF";return xo.default.createElement(To.Box,{sx:{backgroundColor:"rgb(191, 191, 191)",borderRadius:1,width:"100%",height:250}},xo.default.createElement(To.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof nf.k)return xo.default.createElement(of,{color:t});if(e.source instanceof nf.i)return xo.default.createElement(rf,{color:t});if(e.source instanceof nf.d)return xo.default.createElement(af,{color:t});if(e.source instanceof nf.a)return xo.default.createElement(sf,{color:t});if(e.source instanceof nf.e)return xo.default.createElement(cf,{color:t});if(e.source instanceof nf.b)return xo.default.createElement(lf,{color:t});if(e.source instanceof nf.c){const n=e.source;return xo.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:"rgb(191, 191, 191)",maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function df(e){return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Xo,{modalOverlayColor:"rgba(0, 0, 0, 0.64)",open:e.isOpen,onClose:e.onClose,width:"min(calc(100% - 2 * 24px), 500px)",PaperProps:{sx:{m:"10px",p:"10px",maxHeight:`calc(100 * ${Oo} - 2 * 24px)`,backgroundColor:ko.b.getColorValue(e.config.backgroundColor)}}},xo.default.createElement(To.Typography,{component:"div"},xo.default.createElement(To.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},xo.default.createElement(_o.a,{style:Object.assign({fontWeight:600,fontSize:16},Zo(1)),config:e.config.title}),xo.default.createElement(To.Box,null,xo.default.createElement(jo,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:xo.default.createElement(Io.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),xo.default.createElement(To.Box,{sx:{width:"100%",border:`1px solid ${ko.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),xo.default.createElement(_o.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof nf.j;return xo.default.createElement(To.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},xo.default.createElement(To.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px"}},xo.default.createElement(uf,{source:e.image})),xo.default.createElement(_o.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))))}function mf(e){return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{sx:{backgroundColor:ko.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},xo.default.createElement(To.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),xo.default.createElement(To.Box,null,xo.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},xo.default.createElement(_o.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),xo.default.createElement(To.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function hf(e){return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:ko.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function ff(e){const t=ko.b.getColorValue(e.textColor);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":ko.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},Mo(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function pf(e){const[t,n]=xo.default.useState(!1),[i,o]=xo.default.useState(null),r=Boolean(i),a=e.config.screens.camera.topBarCameraSelect;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(jo,{id:"sb-button-camera-select",ariaLabel:ko.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>o(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Io.a,null),!r&&xo.default.createElement(Io.a,{sx:{marginX:"-4px"}}),r&&xo.default.createElement(Io.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),xo.default.createElement(hf,{anchor:i,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>o(null),minWidth:"calc(min(100% - 40px, 323px))"},xo.default.createElement(To.MenuItem,{disabled:!0,sx:{borderBottomColor:ko.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},xo.default.createElement(_o.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((i=>{const r=i.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=r?a.menuEntryActive:a.menuEntry;return xo.default.createElement(ff,{disabled:t,key:i.deviceId,autoFocus:r,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{o(null),n(!0),e.cameraSelectConfig.onSelect(i).finally((()=>n(!1)))}},s.icon.visible&&xo.default.createElement(Io.a,{style:{color:ko.b.getColorValue(s.icon.color),marginRight:"8px"}}),xo.default.createElement(To.Typography,{variant:"inherit",noWrap:!0},xo.default.createElement(_o.a,{config:Object.assign(Object.assign({},s.title),{text:i.label})})),r&&xo.default.createElement(Io.a,{style:{color:ko.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function gf(e){const t=e.config.screens.camera;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(mf,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:xo.default.createElement(jo,{ariaLabel:ko.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:xo.default.createElement(Io.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},xo.default.createElement(pf,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),xo.default.createElement(jo,{ariaLabel:ko.b.getLocalizedText(t.topBarIntroButton.accessibilityDescription),visible:t.topBarIntroButton.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:t.topBarIntroButton.color,iconVisible:!0,useShadow:!1},debugName:"show-introduction",icon:xo.default.createElement(Io.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function vf(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L9 3H15L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4ZM4 19H20V7H15.95L14.125 5H9.875L8.05 7H4V19Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.80078 16.5L11.0008 7.5H13.0008L16.2008 16.5H14.3008L13.6008 14.5H10.4008L9.70078 16.5H7.80078ZM13.1508 13.15H10.8508L12.0008 9.5L13.1508 13.15Z",fill:t})))}function Cf(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{paddingTop:2,paddingRight:1}},xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.018 15.145L22.018 17.145V5.01997C22.018 4.46997 21.8222 3.99914 21.4305 3.60747C21.0388 3.2158 20.568 3.01997 20.018 3.01997H16.868L15.018 1.01997H9.01799L7.51799 2.64497L8.94299 4.06997L9.89299 3.01997H14.143L15.968 5.01997H20.018V15.145ZM2.60549 18.4325C2.99716 18.8241 3.46799 19.02 4.01799 19.02H18.193L20.493 21.32L21.918 19.895L21.043 19.02L19.043 17.02L15.668 13.645L14.218 12.195L10.843 8.81997L9.39299 7.36997L7.04299 5.01997L5.04299 3.01997L2.11799 0.0949707L0.692993 1.51997L2.69533 3.52231C2.66494 3.54959 2.63499 3.57797 2.60549 3.60747C2.21383 3.99914 2.01799 4.46997 2.01799 5.01997V17.02C2.01799 17.57 2.21383 18.0408 2.60549 18.4325ZM4.19299 5.01997H4.01799V17.02H16.193L14.1538 14.9807L12.6236 13.4506L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H10.418L9.71799 14.5325H7.81799L9.36226 10.1892L8.05722 8.8842L4.19299 5.01997ZM14.4768 9.63538L10.8494 6.00662L11.018 5.53247H13.018L14.4768 9.63538Z",fill:t}),xo.default.createElement("path",{d:"M9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997Z",fill:t})))}function yf(e){return"NoButtonMode"===e.config._type?xo.default.createElement(xo.default.Fragment,null):"PagePreviewMode"===e.config._type?xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Button,{"data-sb-button-preview":!0,"arial-label":ko.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},Mo(e.config.pageCounter.background.fillColor)),onClick:e.onClick},xo.default.createElement(_h,{text:`${e.count}`,backgroundColor:ko.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:ko.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:ko.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&xo.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&xo.default.createElement(To.Box,{style:{backgroundColor:ko.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":ko.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},Mo(e.config.style.color)),{textTransform:"none"})},xo.default.createElement(_o.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function bf(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint0_linear_779_506)"},xo.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint1_linear_779_506)"},xo.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),xo.default.createElement("defs",null,xo.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},xo.default.createElement("stop",{stopColor:t}),xo.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),xo.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},xo.default.createElement("stop",{stopColor:t}),xo.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function Af(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},xo.default.createElement("path",{d:"M22.5127 8.09418C24.6704 8.09418 26.4195 6.34504 26.4195 4.18735C26.4195 2.02967 24.6704 0.280518 22.5127 0.280518C20.355 0.280518 18.6058 2.02967 18.6058 4.18735C18.6058 6.34504 20.355 8.09418 22.5127 8.09418Z",fill:t,fillOpacity:"0.2"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M9.93003 13.2714C12.0877 13.2714 13.8369 11.5223 13.8369 9.3646C13.8369 7.20691 12.0877 5.45776 9.93003 5.45776C7.77234 5.45776 6.02319 7.20691 6.02319 9.3646C6.02319 11.5223 7.77234 13.2714 9.93003 13.2714Z",fill:t,fillOpacity:"0.4"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M4.80063 25.8922C6.95832 25.8922 8.70747 24.143 8.70747 21.9853C8.70747 19.8276 6.95832 18.0785 4.80063 18.0785C2.64295 18.0785 0.893799 19.8276 0.893799 21.9853C0.893799 24.143 2.64295 25.8922 4.80063 25.8922Z",fill:t,fillOpacity:"0.6"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M9.9282 38.4743C12.0859 38.4743 13.835 36.7252 13.835 34.5675C13.835 32.4098 12.0859 30.6606 9.9282 30.6606C7.77051 30.6606 6.02136 32.4098 6.02136 34.5675C6.02136 36.7252 7.77051 38.4743 9.9282 38.4743Z",fill:t,fillOpacity:"0.8"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M22.5127 43.7196C24.6704 43.7196 26.4195 41.9704 26.4195 39.8127C26.4195 37.655 24.6704 35.9059 22.5127 35.9059C20.355 35.9059 18.6058 37.655 18.6058 39.8127C18.6058 41.9704 20.355 43.7196 22.5127 43.7196Z",fill:t,fillOpacity:"1"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M35.0819 38.4743C37.2396 38.4743 38.9887 36.7252 38.9887 34.5675C38.9887 32.4098 37.2396 30.6606 35.0819 30.6606C32.9242 30.6606 31.175 32.4098 31.175 34.5675C31.175 36.7252 32.9242 38.4743 35.0819 38.4743Z",fill:t,fillOpacity:"0.7"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M40.1988 25.8922C42.3565 25.8922 44.1057 24.143 44.1057 21.9853C44.1057 19.8276 42.3565 18.0785 40.1988 18.0785C38.0411 18.0785 36.292 19.8276 36.292 21.9853C36.292 24.143 38.0411 25.8922 40.1988 25.8922Z",fill:t,fillOpacity:"0.5"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M35.0819 13.31C37.2396 13.31 38.9887 11.5609 38.9887 9.40317C38.9887 7.24549 37.2396 5.49634 35.0819 5.49634C32.9242 5.49634 31.175 7.24549 31.175 9.40317C31.175 11.5609 32.9242 13.31 35.0819 13.31Z",fill:t,fillOpacity:"0.3"},xo.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),xo.default.createElement("defs",null,xo.default.createElement("clipPath",{id:"clip0_780_4723"},xo.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function Sf(e){const t=ko.b.getColorValue(e.innerColor),n=ko.b.getColorValue(e.outerColor);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5 2.66666C16.2996 2.66666 3.16666 15.7996 3.16666 32C3.16666 48.2004 16.2996 61.3333 32.5 61.3333C48.7004 61.3333 61.8333 48.2004 61.8333 32C61.8333 15.7996 48.7004 2.66666 32.5 2.66666ZM0.5 32C0.5 14.3269 14.8269 0 32.5 0C50.1731 0 64.5 14.3269 64.5 32C64.5 49.6731 50.1731 64 32.5 64C14.8269 64 0.5 49.6731 0.5 32Z",fill:n}),xo.default.createElement("path",{d:"M56.7425 32C56.7425 45.3885 45.8889 56.242 32.5004 56.242C19.1119 56.242 8.2584 45.3885 8.2584 32C8.2584 18.6115 19.1119 7.75793 32.5004 7.75793C45.8889 7.75793 56.7425 18.6115 56.7425 32Z",fill:t})))}function wf(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Button,{disabled:!t,onClick:e.onClick,"aria-label":ko.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},Mo(e.config.innerColor))},"auto"===e.state&&xo.default.createElement(bf,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&xo.default.createElement(Af,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&xo.default.createElement(Sf,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function Ef(e){const t={backgroundColor:ko.b.getColorValue(e.config.sheetColor)};let n=[{config:e.config.okButton,onClick:e.onOkClick,debugName:"ok"},{config:e.config.actionButton,onClick:e.onActionClick,debugName:"action"},{config:e.config.cancelButton,onClick:e.onCancelClick,debugName:"cancel"}].filter((e=>e.config.visible));2===n.length&&(n=n.reverse());const i=2===n.length?6:12,[o,r]=xo.default.useState(!0);Object(xo.useEffect)((()=>{r(e.open)}),[e.open]);const a=o?1:.5;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Xo,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},xo.default.createElement(To.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},xo.default.createElement(To.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},xo.default.createElement(_o.a,{config:e.config.title})),xo.default.createElement(To.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},xo.default.createElement(_o.a,{config:e.config.subtitle}))),xo.default.createElement(To.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},xo.default.createElement(Io.a,{container:!0,spacing:2},xo.default.createElement(Io.a,{item:!0,xs:12},xo.default.createElement(Io.a,{color:ko.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return xo.default.createElement(Io.a,{item:!0,xs:i,key:t},xo.default.createElement(Qo,{disabled:!o,style:Object.assign({width:"100%",opacity:a},(n=e.config,zo(ko.b.getColorValue(n.background.fillColor))?Mo(n.foreground.color):Object.assign(Object.assign({},No(n.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}}))),onClick:()=>{r(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,ariaLabel:ko.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const xf=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var Df=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Bf(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,i="auto"===e.buttonStates.snappingModeState?vf:Cf,o="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,r=xo.default.createRef();Object(xo.useEffect)((()=>{r.current&&(r.current.oncancel=e.onFileSelectDialogClosed)}),[r.current]);const[a,s]=xo.default.useState(!1),c=()=>s(!0);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:ko.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},xo.default.createElement(To.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},xo.default.createElement("div",null,xo.default.createElement(Vo,{onClick:e.scanLimitReached?c:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>xo.default.createElement(Io.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&xo.default.createElement("input",{hidden:!0,type:"file",accept:xf.join(", "),ref:r,onChange:t=>{var n,i;e.onFileSelectDialogClosed();const o=null===(i=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===i?void 0:i[0];o&&(()=>{Df(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(yield o.arrayBuffer(),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),xo.default.createElement("div",null,xo.default.createElement(Vo,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:i,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),xo.default.createElement(wf,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?c:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),xo.default.createElement("div",null,xo.default.createElement(Vo,{enabled:e.buttonStates.torchButtonEnabled,config:o,icon:t=>(e.buttonStates.torchState,xo.default.createElement(Io.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),xo.default.createElement("div",null,xo.default.createElement(yf,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),xo.default.createElement(Ef,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function Tf(e){const t=ko.b.getColorValue(e.color),n=221/376,i=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,o=e.maxWidth,r=`min(${`calc(${i} * ${n})`}, ${o})`,a=`min(${i}, ${`calc(${o} / ${n})`})`;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{style:{width:r,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M25.2696 149.527V20.2272C25.2696 9.60794 33.8814 1 44.5006 1H147.398C158.018 1 166.629 9.60794 166.629 20.2272V267.036C166.629 277.655 158.018 286.263 147.398 286.263H44.5006C33.8814 286.263 25.2696 277.655 25.2696 267.036V262.47M25.2696 200.917V183.453M27.5913 182.88V202.205M27.5913 224.958V239.567M27.5913 259.894V267.036C27.5913 267.902 27.6573 268.757 27.781 269.593L27.7889 269.64C27.8213 269.83 27.8538 270.021 27.8898 270.208C28.0875 271.246 28.3818 272.25 28.7617 273.212C28.8353 273.411 28.9166 273.609 29.0021 273.8C29.5369 275.014 30.211 276.159 31.0016 277.209C31.0791 277.304 31.157 277.411 31.2345 277.506C31.7807 278.205 32.3892 278.85 33.0366 279.457C33.3 279.701 33.5714 279.934 33.8505 280.159C33.9474 280.243 34.0482 280.32 34.149 280.392C34.4471 280.625 34.7532 280.847 35.0674 281.06L35.0712 281.063C35.0891 281.077 35.1074 281.092 35.1254 281.102C35.3193 281.228 35.5129 281.35 35.7068 281.473C35.924 281.602 36.1446 281.732 36.3656 281.854C36.5905 281.976 36.8153 282.095 37.044 282.209C37.1562 282.263 37.2726 282.32 37.3848 282.37L37.3905 282.372C37.5049 282.429 37.6194 282.485 37.7337 282.53C38.0865 282.683 38.443 282.824 38.8072 282.958C39.0477 283.045 39.2916 283.125 39.5359 283.202C39.6599 283.24 39.784 283.278 39.9081 283.313C40.2841 283.412 40.6639 283.511 41.0475 283.587C41.1716 283.614 41.2995 283.641 41.4311 283.664C41.5628 283.687 41.6907 283.713 41.8186 283.732C42.0782 283.774 42.3419 283.813 42.6053 283.839C42.7912 283.866 42.9775 283.877 43.1634 283.893C43.3184 283.904 43.4734 283.912 43.6284 283.919C43.9192 283.935 44.2059 283.942 44.5006 283.942H147.395C147.693 283.942 147.984 283.935 148.274 283.919C148.43 283.912 148.584 283.904 148.739 283.893C149.042 283.87 149.34 283.843 149.642 283.809C149.526 283.82 149.414 283.828 149.298 283.839C157.731 282.889 164.308 275.716 164.308 267.036V20.2272C164.308 11.2009 157.196 3.80228 148.274 3.34114H148.263C147.976 3.32548 147.689 3.31784 147.395 3.31784H44.5006C44.2059 3.31784 43.9231 3.32548 43.6326 3.34114H43.6284C43.4734 3.34878 43.3184 3.3568 43.1634 3.36825C43.0161 3.37969 42.8611 3.39535 42.7099 3.40679C34.2265 4.30614 27.5913 11.507 27.5913 20.2272V151.388M25.2696 238.278V226.254M34.1941 158.545V20.2306C34.1941 14.7975 38.4134 10.2996 43.8178 9.94611H43.9106L44.0499 9.93198C44.2141 9.92475 44.3641 9.92472 44.5034 9.92472H59.3495C60.1993 9.96748 60.8848 10.6244 60.9704 11.4631L60.9713 11.4779C60.9744 11.5301 60.9776 11.5829 60.9776 11.6383V11.6597C61.1811 16.011 64.772 19.4736 69.1698 19.4736H122.73C127.127 19.4736 130.718 16.011 130.922 11.6597V11.6383C130.922 11.5829 130.925 11.5304 130.928 11.4782L130.929 11.4631C131.015 10.6244 131.7 9.96748 132.549 9.92472H147.396C147.535 9.92472 147.685 9.92475 147.849 9.93198L147.988 9.94611H148.082C153.486 10.2996 157.705 14.7975 157.705 20.2306V267.036C157.705 272.376 153.536 276.892 148.217 277.308C148.165 277.312 148.123 277.315 148.081 277.319L148.078 277.319H148.042L148.014 277.323H147.953L147.932 277.327L147.93 277.327L147.929 277.327C147.751 277.335 147.574 277.342 147.396 277.342H44.5034C44.3255 277.342 44.148 277.335 43.9701 277.327L43.969 277.327L43.9679 277.327L43.9465 277.323H43.8858L43.8572 277.319H43.8217L43.8187 277.319C43.7769 277.315 43.7345 277.312 43.6823 277.308C38.3633 276.892 34.1941 272.376 34.1941 267.036V178.586M23.6521 148.301C23.6147 148.268 23.5193 148.222 23.3693 148.163C23.0612 148.043 22.636 148.008 22.2253 147.974C22.0313 147.958 21.8432 147.942 21.6714 147.919L20.8934 147.811C17.5128 147.337 13.6811 146.802 10.5597 147.83C10.3058 147.914 9.97642 148.033 9.68745 148.214C7.45931 149.607 2.80262 154.442 1.61011 159.826C0.977204 162.683 1.41084 165.294 2.89957 167.585C5.96789 172.306 10.5074 175.841 14.5438 178.676C15.524 179.364 16.6101 180.101 17.9614 180.995C18.1866 181.144 18.3939 181.293 18.5924 181.434C19.294 181.936 19.8482 182.332 20.7503 182.431C23.522 182.735 26.401 182.373 29.0765 181.383L29.3048 181.299C30.427 180.886 31.8238 180.373 32.4861 179.432C34.1031 177.136 36.2369 173.538 37.2172 169.433C37.6402 167.662 37.7405 166.251 37.5325 164.993C37.0481 162.071 34.9474 159.796 32.4452 157.346C32.1406 157.237 31.7749 156.862 31.0886 156.066C30.9542 155.91 30.8446 155.781 30.782 155.72L25.3035 150.365C24.763 149.837 24.3217 149.364 23.9259 148.769C23.8278 148.623 23.7709 148.512 23.7247 148.422M23.6521 148.301C23.6682 148.314 23.6819 148.338 23.7247 148.422M23.6521 148.301L23.6529 148.301C23.669 148.315 23.6819 148.338 23.7247 148.422M166.63 213.913L173.334 220.343M173.334 220.343L173.38 220.386C172.942 224.452 172.916 225.028 173.235 230.114M173.334 220.343C173.026 223.089 172.754 226.806 173.072 229.253M173.334 220.343C173.495 218.899 173.667 217.723 173.767 217.141M173.235 230.114C173.252 230.386 173.27 230.67 173.289 230.969L173.289 230.971M173.235 230.114L173.294 230.423C173.335 230.581 173.322 230.772 173.289 230.971M173.235 230.114L173.073 229.263M173.289 230.971L173.172 232.02M173.289 230.971C173.252 231.196 173.191 231.431 173.157 231.641M173.172 232.02L173.163 232.103M173.172 232.02C173.168 231.93 173.163 231.799 173.157 231.641M173.172 232.02C173.176 232.096 173.179 232.142 173.182 232.146M173.163 232.103L172.448 238.511M173.163 232.103C173.168 232.118 173.175 232.132 173.182 232.146M173.163 232.103C173.119 231.984 173.128 231.822 173.157 231.641M172.448 238.511L172.388 238.594C172.361 238.632 170.173 241.232 166.854 246.152M172.448 238.511L173.072 229.253M173.072 229.253C173.072 229.253 173.073 229.257 173.073 229.263M173.072 229.253L173.073 229.263M173.073 229.263C173.089 229.397 173.129 230.85 173.157 231.641M173.182 232.146C173.687 232.904 174.584 233.798 175.666 234.725M173.182 232.146C173.535 232.81 174.468 233.726 175.666 234.725M175.666 234.725C179.226 237.776 184.8 241.195 185.104 241.381C185.033 241.338 179.198 237.671 175.666 234.725ZM173.767 217.141C174.564 217.463 176.281 218.113 178.633 218.417M173.767 217.141C174.18 217.329 175.973 218.088 178.633 218.417M173.767 217.141L166.558 206.5M178.633 218.417C181.548 218.793 185.438 218.636 189.756 216.658M178.633 218.417C181.534 218.776 185.465 218.623 189.756 216.658M189.756 216.658C189.827 216.626 189.898 216.593 189.969 216.559M67.4683 323.631C70.4328 329.189 74.192 335.823 77.6768 341.522C92.8799 366.399 95.2 373.141 95.5527 374.664V375.7M67.4683 323.631C72.9296 307.707 97.7699 290.507 98.2854 290.15L98.2916 290.146C98.04 290.321 73.495 307.571 67.4683 323.631ZM67.4683 323.631C62.152 313.572 58.8077 305.831 56.9292 301.071C55.0301 296.265 52.4092 291.749 49.1397 287.657L47.9153 286.137M28.8505 204.209C31.3841 207.632 32.9003 212.464 31.6452 217.3C30.4889 221.756 27.8489 225.222 24.3855 226.861V237.921C27.7065 239.088 29.7911 241.302 30.5828 244.508C31.9643 250.084 29.9423 257.645 25.9796 261.726C24.1702 263.585 22.1669 264.543 20.1136 264.543C19.8662 264.543 19.6185 264.528 19.37 264.501L24.9855 268.636M34.147 152.964L26.212 149.313C25.8452 149.145 25.5564 149.529 25.8452 149.811L31.3237 155.166C31.3955 155.236 31.5222 155.382 31.6757 155.56L31.6786 155.563C31.9222 155.846 32.4736 156.485 32.6873 156.606H32.7968L32.9098 156.716C34.9429 158.703 37.7268 161.424 38.2968 164.867C38.5227 166.23 38.4193 167.738 37.9711 169.614C36.9622 173.838 34.7761 177.527 33.1198 179.879C32.3187 181.017 30.7957 181.577 29.5724 182.027L29.3457 182.11C27.1996 182.905 24.9271 183.312 22.6761 183.312C22.3249 183.312 21.9749 183.301 21.6252 183.281C22.2994 184.192 23.7392 186.664 25.2718 190.467M211.09 375.7V374.664L213.502 342.095L215.94 316.496L219.792 274.632C220.431 267.696 219.597 260.833 217.316 254.235C214.986 247.501 213.473 241.094 212.817 235.192C212.268 230.25 212.46 225.348 212.646 220.608C212.995 211.71 213.297 204.026 208.158 200.602C200.156 195.267 175.98 167.503 173.151 161.277C172.263 159.324 171 158.464 169.497 158.79C168.553 158.994 167.372 159.481 166.702 160.263M146.375 286.09C145.308 288.615 143.615 292.089 142.556 294.787M130.056 113.003H63.0631M130.056 84.3738H100.854M130.056 147.359H63.0631M130.056 181.714H63.0631M130.056 121.592H63.0631M130.056 92.9627H100.854M130.056 155.948H63.0631M130.056 190.303H63.0631M130.056 130.181H63.0631M130.056 164.537H63.0631M130.056 198.892H63.0631M130.056 138.77H63.0631M130.056 173.125H63.0631M130.056 207.481H63.0631M30.8954 217.105C29.7728 221.431 27.2014 224.769 23.8407 226.264C22.4226 226.896 20.8755 227.194 19.2463 227.145C13.854 226.987 9.84776 225.057 7.66123 221.564C5.3411 217.859 5.23957 212.578 7.39594 207.783C10.7883 200.246 23.0215 200.651 23.9228 200.691C25.9616 201.409 27.6374 202.632 28.9043 204.325C31.3378 207.564 32.1005 212.461 30.8954 217.105ZM23.8772 238.567C27.0829 239.619 29.0858 241.68 29.8306 244.695C31.154 250.036 29.2183 257.279 25.4236 261.184C24.0047 262.646 21.7086 264.253 18.833 263.627C16.7477 263.173 14.7108 261.619 12.78 259.001C5.82762 249.577 5.68905 247.795 8.07293 242.887C10.5545 237.78 14.2157 237.19 20.5306 237.867C21.6693 237.988 22.7263 238.2 23.6764 238.498L23.8772 238.567ZM135.782 224.965H56.7644C52.4952 224.965 49.0344 221.505 49.0344 217.235V79.8139C49.0344 75.5447 52.4952 72.0839 56.7644 72.0839H135.782C140.051 72.0839 143.512 75.5447 143.512 79.8139V217.235C143.512 221.505 140.051 224.965 135.782 224.965Z",stroke:t,strokeWidth:"1.75936"}),xo.default.createElement("defs",null,xo.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},xo.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),xo.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function If(e){return xo.default.createElement(xo.default.Fragment,null,e.config.visible&&xo.default.createElement(Fo,{styleConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{height:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},xo.default.createElement(_o.a,{config:e.config.title})))}function kf(e){const t=e.config.screens.camera.userGuidance.statesTitles,n="auto"===e.snappingMode?t.readyToCapture:t.captureManual,i={NOT_ACQUIRED:t.noDocumentFound,OK:n,OK_BUT_TOO_SMALL:t.tooSmall,OK_BUT_BAD_ANGLES:t.badAngles,OK_BUT_BAD_ASPECT_RATIO:t.badAspectRatio,OK_BUT_OFF_CENTER:t.textHintOffCenter,OK_BUT_ORIENTATION_MISMATCH:t.badAspectRatio,OK_BUT_TOO_DARK:t.tooDark,ERROR_NOTHING_DETECTED:t.noDocumentFound,ERROR_TOO_DARK:t.tooDark,ERROR_TOO_NOISY:t.tooNoisy,START:e.config.screens.camera.userGuidance.title.text};return xo.default.createElement(_o.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:ko.b.getLocalizedText(i[e.text])})})}const Of=`calc(100 * ${Oo} - 50px - 112px)`,Lf="0.5s";function Pf(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:Of}},e.documentScannerView),xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:Of,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),xo.default.createElement(To.Box,{sx:{height:Of,position:"relative"}},xo.default.createElement(If,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&xo.default.createElement(To.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${Of} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},xo.default.createElement(Fo,{styleConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},xo.default.createElement(kf,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&xo.default.createElement(To.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:ko.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},xo.default.createElement(Tf,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${Of} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const _f={OK:"Capturing your document... Please do not move the camera.",OK_BUT_TOO_SMALL:"The document is too small. Try moving closer.",OK_BUT_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BUT_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_BUT_OFF_CENTER:"Try holding the device at the center of the document.",OK_BUT_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_BUT_ORIENTATION_MISMATCH:"The document seems to be upside down. Please rotate the device or document",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_TOO_NOISY:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class Rf{constructor(e){this.hint=e}}class Ff{constructor(){this.outline=new Mf,this.captureButton=new zf}}class Mf{constructor(){this.polygon=new Nf,this.path=new Vf,this.label=new Wf}}class Nf{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class Vf{constructor(){this.stroke="green",this.strokeWidth=4}}class Wf{}class zf{constructor(){this.color="#FFF"}}class jf extends q.a{constructor(){super(q.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new r.DocumentScannerParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new Rf(_f),this.style=new Ff,this.onDocumentDetected=function(e){},this.finder=Object(X.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const i=new jf;if(q.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},i.finder),this.mapValues(e,i,["text","style","videoConstraints","detectionParameters"]),i.detectionParameters=new r.DocumentScannerParameters(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),e.text&&e.text.hint&&this.mapValues(e.text.hint,i.text.hint),e.style){this.mapValues(e.style,i.style,["outline","captureButton"]);const t=e.style.outline;if(t){this.mapValues(t,i.style.outline,["polygon","path","label"]);const e=t.polygon;e&&this.mapValues(e,i.style.outline.polygon);const n=t.path;n&&this.mapValues(n,i.style.outline.path);const o=t.label;o&&this.mapValues(o,i.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,i.style.captureButton)}return this.mapVideoConstraints(e,i),i}}var Hf=n(46),Uf={insert:"head",singleton:!1};Tm()(Hf.a,Uf),Hf.a.locals;class Zf extends xo.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return xo.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const e=[];for(let t=0;t<this.LINE_COUNT;t++){const n=this.props.points[t],i=this.props.points[(t+1)%this.LINE_COUNT];e.push(xo.default.createElement("line",{key:t,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return e}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}Zf.CLASSNAME="scanbot-document-outline";class Gf extends xo.default.Component{constructor(e){super(e),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(e,t,n,i){if(t&&t.some((e=>Number.isNaN(e.x)||Number.isNaN(e.y))))return;const o={points:e,animatedPoints:t,isOk:n,isVisible:i};this.setState(o)}pointStringOrLatestValidPoints(e){return e&&e.length>0?fm.a.toSvgString(e):fm.a.toSvgString(this.latestValidPoints)}render(){var e;this.state.points&&(this.latestValidPoints=this.state.points);const t=null!==(e=this.props.style)&&void 0!==e?e:{},n=Lm()(Zf.CLASSNAME,{[`${Zf.CLASSNAME}-ok`]:this.state.isOk},{[`${Zf.CLASSNAME}-visible`]:this.state.isVisible},{[`${Zf.CLASSNAME}-hidden`]:!this.state.isVisible});return xo.default.createElement(mm.polygon,{ref:e=>this.polygon=e,transition:{duration:.1},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?t.strokeCapturing:t.strokeSearching,fill:this.state.isOk?t.fillCapturing:t.fillSearching,strokeWidth:this.state.isOk?t.strokeWidthCapturing:t.strokeWidthSearching},onClick:()=>{},className:n})}}var Yf=Gf;class Qf extends xo.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?xo.default.createElement(mm.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0,d:this.state.path},transition:{strokeDashoffset:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},d:{duration:.1}},stroke:(null===(e=this.props.style)||void 0===e?void 0:e.stroke)||"white",strokeWidth:(null===(t=this.props.style)||void 0===t?void 0:t.strokeWidth)||2,fill:"none",d:this.state.path,className:`${Zf.CLASSNAME}-path`}):null}animate(e){const t="M"+fm.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class qf extends xo.default.Component{render(){return xo.default.createElement(mm.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},xo.default.createElement(Yf,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),xo.default.createElement(Qf,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var i;const o="processing"!==n&&!!e,r=null!==(i=this.previous)&&void 0!==i?i:e,a=this.previous?e:void 0;this.polygon.update(r,a,t,o),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Xf extends xo.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:e,text:t,validPoints:n}=this.state,i="searching"===this.props.action||"capturing"===this.props.action,o="processing"!==this.props.action&&n,r=Lm()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:o,[`${this.hintLabelClassName}-hidden`]:!o});return xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},xo.default.createElement(qf,{ref:e=>{this.polygon=e},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:e,isVisible:o,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),i&&xo.default.createElement("label",{ref:e=>this.label=e,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:t}}))}update(e,t,n){this.polygon.update(t,e,this.props.action),this.label&&(this.label.innerHTML=n)}}class Kf{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let i=0;i<n;i++){const o=e[(i+2)%n].x-e[(i+1)%n].x,r=e[(i+2)%n].y-e[(i+1)%n].y,a=e[i].x-e[(i+1)%n].x,s=o*(e[i].y-e[(i+1)%n].y)-r*a;if(0==i)t=s>0;else if(t!=s>0)return!1}return!0}static distanceBetweenPoints(e,t){return Math.pow(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2),.5)}static intersection(e,t){const n=e[0],i=fm.a.subtract(e[1],n),o=t[0],r=fm.a.subtract(t[1],o);if(0===fm.a.cross(i,r))return;const a=fm.a.cross(fm.a.subtract(o,n),i)/fm.a.cross(i,r);return fm.a.add(o,fm.a.multiply(r,a))}}class Jf{constructor(e,t=Jf.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(e),this.sensitivity=t}check(e){let t=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(e[n],this.lastPolygon[n])){t=!0;break}}else t=!0;return t}reset(){this.lastPolygon=void 0}update(e){this.lastPolygon=e}isPointMoved(e,t){return Kf.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new fm.a(0,0),n=new fm.a(e.width,e.height);return Kf.distanceBetweenPoints(t,n)}}Jf.DEFAULT_SENSITIVITY=.5;var $f=n(32),ep=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};rr.b;rr.a;class tp extends rr.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>ep(this,void 0,void 0,(function*(){const e=yield this.detectAndCrop();this.configuration.onDocumentDetected(e)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!e.sdk)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return!("searching"!=this.state.action&&"capturing"!=this.state.action&&"manual"!=this.state.action||this.disposed||this.props.pauseAR)}get configuration(){return this._configuration||(this._configuration=jf.fromJson(this.props.configuration)),this._configuration}componentDidUpdate(e){e.configuration!==this.props.configuration&&(this._configuration=void 0)}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(e,t){return ep(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(xo.render)(xo.default.createElement(tp,{container:n,configuration:e,onSuccess:i,onFailure:o,sdk:t}),n)}))}))}detectAndCrop(){var e,t,n,i;return ep(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"}),this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(tp.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return n?(Eo.a.debug("Detect & Crop document of size: "+n.height*n.width),yield this.bridge.transferArgs.detectAndCropDocument(n)):null}}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e),null}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(e){this._configuration?this._configuration.autoCaptureEnabled=e:this.props.configuration.autoCaptureEnabled=e,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return ep(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect(),this.scannerToken=this.bridge.copyArgs.createDocumentScanner(new r.DocumentScannerParameters(this.configuration.detectionParameters)),this.scannerToken.catch((e=>{var t,n;return null===(n=(t=this.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return ep(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield this.props.sdk.release(yield this.scannerToken,"Document Scanner")}))}detect(){var e,t,n,i;return ep(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const n=yield this.detectInWebWorker();if(!n||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=n.originalImage.data;const i=this.getStatusString(n),o="OK"===i,r=i.startsWith("OK")?this.scalePolygonPointsToPixels(n.pointsNormalized):void 0;this.outline.update(o,r,V.getProperty(this.configuration.text.hint,i)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,i),yield this.handleAutoCapture(o,r)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(e){return this.configuration.ignoreBadAspectRatio&&"OK_BUT_BAD_ASPECT_RATIO"===e.status?"OK":e.status}detectInWebWorker(){var e,t,n,i;return ep(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(rr.c.DEFAULT_DETECTION_RESOLUTION,!1);return n&&this.enabled?yield this.bridge.transferArgs.documentScannerDetect(yield this.scannerToken,n):null}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e),null}}))}handleAutoCapture(e,t){return ep(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(e&&!this.autoCaptureToken&&t){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const e=this.getCameraFrameSize();this.polygonMovementPredicate=new Jf(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>ep(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop();if(null==e?void 0:e.pointsNormalized){const t=this.scalePolygonPointsToPixels(e.pointsNormalized);if(this.runMovementPredicate(t))return}(null==e?void 0:e.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(e),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!e&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(e){this.setState({action:e})}render(){var e,t,n,i;const{action:o}=this.state,{configuration:r}=this,a=null===(e=r.style)||void 0===e?void 0:e.captureButton;return xo.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},xo.default.createElement(ar.a,{configuration:this.configuration,videoConstraints:r.videoConstraints,mirrored:r.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&xo.default.createElement(sr.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:new $f.a({visible:!1}),configuration:this.configuration.finder}),xo.default.createElement(Xf,{ref:e=>{this.outline=e},style:null===(n=r.style)||void 0===n?void 0:n.outline,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}),!(null!==(i=this.props.hideShutterButton)&&void 0!==i&&i)&&xo.default.createElement(_m,{color:(null==a?void 0:a.color)?a.color:"FFF",action:o,onClick:this.enabled?r.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),i=Vm.a.fromHtmlElement(this.camera.video),o=Km.findScale(i,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new fm.a((e.x*this.finder.holeRect.width+this.finder.holeRect.x)/i.width,(e.y*this.finder.holeRect.height+this.finder.holeRect.y)/i.height)))),e=null==(e=Km.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>fm.a.scaleToPoint(e,o.x,o.y,o.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(rr.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}tp.DETECT_AND_CROP_RESOLUTION=0;var np=tp;function ip(e){const[t,n]=Object(xo.useState)(!1);return Object(xo.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var op=n(13);function rp(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},xo.default.createElement(mf,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),xo.default.createElement(To.Box,{style:{height:`calc(100 * ${Oo} - 50px)`,backgroundColor:ko.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},xo.default.createElement(To.Box,{style:{backgroundColor:ko.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},xo.default.createElement(Io.a,{style:{color:ko.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),xo.default.createElement("h4",{style:{margin:12}},xo.default.createElement(_o.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),xo.default.createElement(To.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},xo.default.createElement(_o.a,{config:t.enableCameraExplanation})),xo.default.createElement(To.Box,null,xo.default.createElement(jo,{icon:xo.default.createElement(To.Close,{style:{fontSize:18}}),iconPosition:"right",onClick:e.onCloseClick,visible:t.closeButton.visible,text:t.closeButton.text,background:t.closeButton.background,foreground:t.closeButton.foreground,ariaLabel:t.closeButton.accessibilityDescription,styleOverrides:{fontSize:14,padding:"8px 20px",gap:"6px"}})))))}class ap{constructor(){}static get(e,t){const n=localStorage.getItem(this.getKey(e));return null===n?t:JSON.parse(n)}static set(e,t){localStorage.setItem(this.getKey(e),JSON.stringify(t))}static clear(){localStorage.clear()}static getKey(e){return`sb_document_rtu_ui_${e}`}}var sp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function cp(e,t){return sp(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var lp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function up(e){var t;const n=e.configuration.screens.camera,[i,o]=Object(xo.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[r,a]=Object(xo.useState)(n.cameraConfiguration.flashEnabled),[s,c]=xo.default.useState(!1),l=Object(xo.useRef)(null);const[u,d]=Object(xo.useState)((()=>!ap.get("hasSeenIntroduction",!1)||n.introduction.showAutomatically));Object(xo.useEffect)((()=>{e.scanLimitReached&&o("manual")}),[e.scanLimitReached]);const m=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[h,f]=Object(xo.useState)(null),p=qh(null==m?void 0:m.finalImageUrl());Object(xo.useEffect)((()=>{0===e.pages.length?f(null):p.value&&f(p.value)}),[p,e.pages.length]);const g="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===i,v={minTopPadding:20+(n.topUserGuidance.visible?40:0),minBottomPadding:20+(g?56:0)},[C,y]=Object(xo.useState)(!1),b=0===n.timeouts.initialScanDelay||ip(n.timeouts.initialScanDelay),[A,S]=Object(xo.useState)("START"),[w,E]=Object(xo.useState)(!0),{documentScannerView:x,documentScannerViewRef:D,torchSupported:B,scannerInitialized:T,activeCamera:I,availableCameras:k,setActiveCamera:O}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,i=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),o=e=>i?ko.b.getColorValue(e):"#00000000",r=(new jf).videoConstraints;r.facingMode="FRONT"===n.cameraModule?"user":"environment";const a=!e.scanningPaused&&"auto"===e.snappingMode,s={videoConstraints:r,onError:e.onError,backgroundColor:ko.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:a,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,ignoreBadAspectRatio:n.ignoreBadAspectRatio,detectionParameters:{aspectRatios:n.requiredAspectRatios,acceptedAngleScore:n.acceptedAngleScore,acceptedBrightnessThreshold:n.acceptedBrightnessThreshold,acceptedSizeScore:n.acceptedSizeScore},spinnerColor:"transparent",style:{outline:{label:{backgroundColor:"transparent",color:"transparent"},path:{stroke:o(t.polygon.autoSnapProgress.strokeColor),strokeWidth:t.polygon.autoSnapProgress.strokeWidth},polygon:{strokeWidthSearching:t.polygon.documentNotOk.strokeWidth,strokeSearching:o(t.polygon.documentNotOk.strokeColor),fillSearching:o(t.polygon.documentNotOk.fillColor),strokeWidthCapturing:t.polygon.documentOk.strokeWidth,fillCapturing:o(t.polygon.documentOk.fillColor),strokeCapturing:o(t.polygon.documentOk.strokeColor)}}},finder:t.viewFinder},c=Object(xo.useRef)(null);Object(xo.useEffect)((()=>()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.dispose()}),[]),Object(xo.useEffect)((()=>{c.current&&(a?c.current.enableAutoCapture():c.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,c.current]);const[l,u]=Object(xo.useState)(!1);Object(xo.useEffect)((()=>{c.current&&l&&c.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,c.current,l]);const[d,m]=Object(xo.useState)(!1),[h,f]=Object(xo.useState)(null),[p,g]=Object(xo.useState)([]);Object(xo.useEffect)((()=>{c.current||m(!1)}),[c.current]);const v=xo.default.createElement(np,{sdk:e.sdk,ref:c,configuration:s,onSuccess:function(){var e,t,n;u(null===(e=c.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),m(!0);const i=null===(t=c.current)||void 0===t?void 0:t.getActiveCameraInfo();f(null!=i?i:null),g(i?[i]:[]),null===(n=c.current)||void 0===n||n.fetchAvailableCameras().then(g)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,viewFinderPadding:e.viewFinderPadding,pauseAR:e.pauseAR});return{documentScannerView:v,documentScannerViewRef:c,torchSupported:l,scannerInitialized:d,activeCamera:h,availableCameras:p,setActiveCamera:function(e){var t;return f(e),null===(t=c.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{R(cp(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!w||"ERROR_NOTHING_DETECTED"!==e&&L)&&(S(e),E(!1))},snappingMode:i,scanningPaused:e.scanningPaused||!b,torchEnabled:r,onError:t=>{t instanceof op.a?y(!0):e.onError(t)},viewFinderPadding:v,pauseAR:!e.visible||e.scanningPaused||!b}),L=ip(1e3),[P,_]=Object(xo.useState)(!1);Object(xo.useEffect)((()=>{requestAnimationFrame((()=>_(!1)))}),[P]);function R(t){_(n.captureFeedback.cameraBlinkEnabled),or.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},xo.default.createElement(df,{config:n.introduction,isOpen:u,onClose:()=>{d(!1),ap.set("hasSeenIntroduction",!0)}}),xo.default.createElement(gf,{cameraSelectConfig:{availableCameras:k,activeCamera:I,onSelect:e=>lp(this,void 0,void 0,(function*(){yield O(e),a(!1)}))},onCloseButtonClick:()=>{var t;0===e.pages.length?null===(t=e.onClose)||void 0===t||t.call(e):c(!0)},config:e.configuration,onShowIntroButtonClick:()=>d(!0)}),xo.default.createElement(Pf,{config:e.configuration,sdk:e.sdk,documentScannerView:x,showHand:w,userGuidanceText:A,bottomUserGuidanceVisible:g,snappingMode:i,showCameraBlink:P}),xo.default.createElement(Bf,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:i,snappingModeButtonEnabled:!e.scanLimitReached,torchState:r&&B?"on":"off",torchButtonEnabled:B,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:h,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!T?"loading":i},sdk:e.sdk,onFileSelectDialogOpened:function(){l.current=i,o("manual")},onFileSelectDialogClosed:function(){l.current&&(o(l.current),l.current=null)},onFileUploaded:t=>e.onImageCaptured(cp(t,"IMPORTED")),snappingModeButtonClick:()=>o((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return lp(this,void 0,void 0,(function*(){E(!1),R(cp(null===(e=D.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),xo.default.createElement(Ef,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>c(!1),onActionClick:()=>{},onOkClick:e.onClose}),xo.default.createElement(rp,{visible:C,onCloseClick:e.onClose,config:e.configuration})))}function dp(e){const t=Object(xo.useMemo)((()=>Object(To.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.ThemeProvider,{theme:t},xo.default.createElement(To.Typography,{component:"div"},e.children)))}function mp(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},xo.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_856_1211)"},xo.default.createElement("path",{d:"M3 9V3H5V6.35C5.83333 5.31667 6.85417 4.5 8.0625 3.9C9.27083 3.3 10.5833 3 12 3C13.9667 3 15.7208 3.55833 17.2625 4.675C18.8042 5.79167 19.8833 7.23333 20.5 9H18.325C17.7583 7.8 16.9167 6.83333 15.8 6.1C14.6833 5.36667 13.4167 5 12 5C11.05 5 10.1542 5.175 9.3125 5.525C8.47083 5.875 7.73333 6.36667 7.1 7H9V9H3ZM6 18H18L14.25 13L11.25 17L9 14L6 18ZM5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V12H5V20H19V12H21V20C21 20.55 20.8042 21.0208 20.4125 21.4125C20.0208 21.8042 19.55 22 19 22H5Z",fill:t})))}function hp(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return xo.default.createElement(To.Box,{sx:{backgroundColor:ko.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},xo.default.createElement(To.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},xo.default.createElement(Vo,{config:e.config.retakeButton,icon:mp,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),xo.default.createElement(Vo,{config:n,icon:e=>xo.default.createElement(To.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function fp(e){if(!e.config.visible)return null;const t=ko.b.getColorValue(e.config.color);return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},xo.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_447_6066)"},xo.default.createElement("path",{d:"M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H13V5H5V19H19V11H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM6 17H18L14.25 12L11.25 16L9 13L6 17Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.17 8.83C15.95 9.61 16.8933 10 18 10C19.1067 10 20.05 9.61 20.83 8.83C21.61 8.05 22 7.10667 22 6C22 4.89333 21.61 3.95 20.83 3.17C20.05 2.39 19.1067 2 18 2C16.8933 2 15.95 2.39 15.17 3.17C14.39 3.95 14 4.89333 14 6C14 7.10667 14.39 8.05 15.17 8.83ZM18.4 6.8V3.6H17.6V6.8H18.4ZM18.28 8.28C18.2 8.36 18.1067 8.4 18 8.4C17.8933 8.4 17.8 8.36 17.72 8.28C17.64 8.2 17.6 8.10667 17.6 8C17.6 7.89333 17.64 7.8 17.72 7.72C17.8 7.64 17.8933 7.6 18 7.6C18.1067 7.6 18.2 7.64 18.28 7.72C18.36 7.8 18.4 7.89333 18.4 8C18.4 8.10667 18.36 8.2 18.28 8.28Z",fill:t})))}function pp(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return xo.default.createElement(To.Box,{style:Object.assign({backgroundColor:ko.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:ko.b.getColorValue(t.strokeColor),display:"flex",alignItems:"center",flexDirection:"row",padding:"10px",borderRadius:"5px",alignSelf:"center",width:"calc(100% - 40px)",margin:10,maxWidth:"438px"},e.style)},xo.default.createElement(fp,{config:e.config.icon}),xo.default.createElement(_o.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function gp(e){return xo.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${Oo} - 78px - 52px - 20px)`,paddingTop:10},src:e.image,alt:""})}function vp(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return xo.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%",width:"100%"}},xo.default.createElement(gp,{image:e.base64Image}),xo.default.createElement(pp,{visible:!t,config:e.banner.config}),xo.default.createElement(hp,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function Cp(e){const t=ko.b.getColorValue(e.config.checkMarkColor),n=ko.b.getColorValue(e.config.checkMarkBackgroundColor);return xo.default.createElement("svg",{"data-sb-acknowledgment-checkmark":!0,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M71.2135 31.8234C72.376 32.9859 72.376 34.8984 71.2135 36.0609L43.0885 64.1859C42.5073 64.7672 41.7385 65.0672 40.9698 65.0672C40.201 65.0672 39.4323 64.7672 38.851 64.1859L24.7885 50.1234C23.626 48.9609 23.626 47.0484 24.7885 45.8859C25.951 44.7234 27.8635 44.7234 29.026 45.8859L40.9698 57.8297L66.976 31.8234C68.1385 30.6422 70.051 30.6422 71.2135 31.8234Z",fill:t}),xo.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48 0C21.525 0 0 21.525 0 48C0 74.475 21.525 96 48 96C74.475 96 96 74.475 96 48C96 21.525 74.475 0 48 0ZM71.2135 36.0609C72.376 34.8984 72.376 32.9859 71.2135 31.8234C70.051 30.6422 68.1385 30.6422 66.976 31.8234L40.9698 57.8297L29.026 45.8859C27.8635 44.7234 25.951 44.7234 24.7885 45.8859C23.626 47.0484 23.626 48.9609 24.7885 50.1234L38.851 64.1859C39.4323 64.7672 40.201 65.0672 40.9698 65.0672C41.7385 65.0672 42.5073 64.7672 43.0885 64.1859L71.2135 36.0609Z",fill:n}))}function yp(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return xo.default.createElement(gp,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return xo.default.createElement(Cp,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var bp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Ap(e){const t=qh(e.croppedDetectionResult);Object(xo.useEffect)((()=>{(null===(null==t?void 0:t.value)||(null==t?void 0:t.error))&&e.onReject()}),[null==t?void 0:t.value,null==t?void 0:t.error]);const n=e.configuration.screens.camera.acknowledgement,i=e.configuration.screens.camera.captureFeedback,o=e.configuration.outputSettings,r=n.acknowledgementMode,[a,s]=xo.default.useState(null),[c,l]=xo.default.useState(null),u=xo.default.useRef(null),d=null!==c,m=()=>"ALWAYS"===r||"NONE"!==r&&(!!d&&("BAD_QUALITY"===r&&!c)),h=t=>{setTimeout((()=>{f(),e.onAccept(t,u.current)}),1500)},f=()=>{s(null),l(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(xo.useEffect)((()=>{var a;if(null==t?void 0:t.value){const c=t.value.value;let d=null!==(a=c.croppedImage)&&void 0!==a?a:c.originalImage;function m(){return bp(this,void 0,void 0,(function*(){null!==o.defaultFilter&&"FILTERED_DOCUMENT"===o.documentAnalysisMode&&(d=yield e.sdk.imageFilter(d,o.defaultFilter,"COPY_IMAGE"));if("PageSnapFunnelAnimation"===i.snapFeedbackMode._type||"ALWAYS"===r||"BAD_QUALITY"===r){const t=yield e.sdk.imageToJpeg(d),n=yield z.toBase64(t,!1);s(n)}if("NONE"===r)return l(!0),void h(t.value);if(null===c.croppedImage)return void l(!1);const a=yield e.sdk.createDocumentQualityAnalyzer(),m=yield a.analyze(d);u.current=m.quality,yield a.release();const f=p[m.quality]>=p[n.minimumQuality];l(f),f&&"BAD_QUALITY"===r&&h(t.value)}))}return m(),()=>{f()}}}),[null==t?void 0:t.value]),g=m()?n.backgroundColor:"PageSnapFeedbackNone"===i.snapFeedbackMode._type?"transparent":i.snapFeedbackMode.overlayColor,g=ko.b.getColorValue(g);const v=i.cameraBlinkEnabled?Lf:"0s";return xo.default.createElement(Io.a,{open:e.visible},xo.default.createElement(To.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${Oo})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},xo.default.createElement(To.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},xo.default.createElement(yp,{visible:!m()&&d,base64Image:a,mode:i.snapFeedbackMode}),xo.default.createElement(vp,{visible:m(),isQualityAcceptable:c,base64Image:a,banner:{config:n.badImageHint},bottomBar:{backgroundColor:e.configuration.appearance.bottomBarBackgroundColor,config:n.bottomBar,onRetake:()=>{f(),e.onReject()},onAccept:()=>{f(),e.onAccept(null==t?void 0:t.value,u.current)}}}))))}var Sp=n(2);function wp(e){const t=e.config.screens.review,[n,i]=xo.default.useState(null);return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(mf,{backgroundColor:ko.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:xo.default.createElement(jo,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:xo.default.createElement(Io.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(jo,{disabled:!e.buttonsEnabled,onClick:e=>i(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new Sp.BackgroundStyle({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new Sp.ForegroundStyle({color:t.topBarMoreButton.color,iconVisible:!0}),icon:xo.default.createElement(Io.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:ko.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),xo.default.createElement(To.Menu,{anchorEl:n,open:null!==n,onClose:()=>i(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:ko.b.getColorValue(t.morePopup.backgroundColor)}}}},xo.default.createElement(ff,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{i(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},xo.default.createElement(Io.a,{sx:{color:ko.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),xo.default.createElement(_o.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function Ep(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M6 22C5.45 22 4.97917 21.8042 4.5875 21.4125C4.19583 21.0208 4 20.55 4 20V4C4 3.45 4.19583 2.97917 4.5875 2.5875C4.97917 2.19583 5.45 2 6 2H14L20 8V12.35C19.6833 12.2333 19.3583 12.1458 19.025 12.0875C18.6917 12.0292 18.35 12 18 12V9H13V4H6V20H12.35C12.4833 20.3833 12.65 20.7417 12.85 21.075C13.05 21.4083 13.2833 21.7167 13.55 22H6Z",fill:t}),xo.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function xp(e){const t=ko.b.getColorValue(e.color);return xo.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},xo.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),xo.default.createElement("g",{mask:"url(#mask0_856_1229)"},xo.default.createElement("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:t})))}function Dp(){return kh("tablet")?80:160}function Bp(e){const t=kh("tablet"),n=e.config.screens.review,i=xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Fo,{style:{height:42,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,textTransform:"none",padding:"0 20px",width:"100%"},styleConfig:Object.assign(Object.assign({},n.bottomBar.submitButton.background),{cornerRadius:4})},xo.default.createElement(_o.a,{config:{text:ko.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),o=Object.assign(Object.assign({padding:"4px"},No(n.bottomBar.submitButton.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}});return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{style:{backgroundColor:ko.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:Dp(),width:"100%"}},xo.default.createElement(To.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&xo.default.createElement(To.Box,{visibility:"hidden"}),xo.default.createElement(To.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},xo.default.createElement(Vo,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:Ep,onClick:e.onAddPageClick,debugName:"add-page"}),xo.default.createElement(Vo,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:mp,onClick:e.onRetakeClick,debugName:"retake"}),xo.default.createElement(Vo,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>xo.default.createElement(Io.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),xo.default.createElement(Vo,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>xo.default.createElement(Io.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),xo.default.createElement(Vo,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:xp,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&xo.default.createElement(To.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":ko.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},o),onClick:e.onSubmitClick},i)),!t&&xo.default.createElement(To.Box,{style:{padding:"12px",display:"flex"}},xo.default.createElement(To.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":ko.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},o),onClick:e.onSubmitClick},i))))}function Tp(e){return xo.default.createElement(To.Box,{style:{display:"flex",width:"100%",backgroundColor:ko.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},xo.default.createElement(To.Box,{style:{width:72,height:20}}),xo.default.createElement(To.Box,null,xo.default.createElement(Fo,{styleConfig:{strokeColor:e.config.pageCounter.background.strokeColor,fillColor:e.config.pageCounter.background.fillColor,strokeWidth:e.config.pageCounter.background.strokeWidth,cornerRadius:4}},xo.default.createElement(_o.a,{config:e.config.pageCounter.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),xo.default.createElement(To.Box,null,xo.default.createElement(To.IconButton,{onClick:e.onZoomButtonClick,"aria-label":ko.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:ko.b.getColorValue(e.config.zoomButton.backgroundColor),color:ko.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:ko.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:ko.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},No(e.config.zoomButton.foregroundColor))},xo.default.createElement(Io.a,null))))}function Ip(){return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M5.6236 27.7347C2.97532 25.2802 1.23517 22.0019 0.686077 18.4331C0.136983 14.8642 0.811227 11.2145 2.59919 8.0774C4.38716 4.94028 7.1837 2.50018 10.5342 1.15382C13.8847 -0.192539 17.592 -0.365996 21.0536 0.661651L20.0518 4.03609C17.3518 3.23452 14.46 3.36982 11.8467 4.41998C9.23329 5.47014 7.05198 7.37342 5.65737 9.82037C4.26276 12.2673 3.73685 15.1141 4.16514 17.8978C4.59343 20.6815 5.95075 23.2385 8.01641 25.1531L5.6236 27.7347Z",fill:"black",fillOpacity:"0.15"},xo.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"})),xo.default.createElement("path",{d:"M16.5 1.76C16.5 0.787979 17.2903 -0.0100083 18.2565 0.0967004C20.3808 0.331329 22.4428 0.989952 24.3179 2.04006C26.7065 3.37771 28.7119 5.30584 30.1422 7.64002C31.5726 9.9742 32.3802 12.6364 32.4877 15.3718C32.5951 18.1073 31.9989 20.8246 30.7561 23.2638C29.5133 25.7031 27.6654 27.7826 25.3891 29.3035C23.1129 30.8244 20.4845 31.7359 17.7553 31.9507C15.0262 32.1655 12.2876 31.6764 9.80145 30.5303C7.84973 29.6305 6.10487 28.3495 4.6664 26.7687C4.01218 26.0498 4.19322 24.9414 4.9796 24.3701C5.76598 23.7987 6.85859 23.9836 7.5348 24.6819C8.60362 25.7856 9.87071 26.6862 11.2751 27.3336C13.2143 28.2276 15.3504 28.6091 17.4792 28.4415C19.6079 28.274 21.6581 27.5631 23.4335 26.3767C25.209 25.1904 26.6503 23.5684 27.6198 21.6658C28.5892 19.7632 29.0542 17.6437 28.9704 15.51C28.8865 13.3764 28.2567 11.2999 27.1409 9.47922C26.0252 7.65856 24.4611 6.15461 22.598 5.11125C21.2487 4.35561 19.7753 3.85986 18.2542 3.6439C17.2918 3.50727 16.5 2.73202 16.5 1.76Z",fill:"black"},xo.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"}))))}function kp(e){return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},xo.default.createElement(To.Box,{"data-sb-loading-spinner":!0,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-busy":open?"true":"false",style:{backgroundColor:"#EFEFEF",border:"1px solid #CCC",borderRadius:"4px",height:65,width:65,display:"flex",alignItems:"center",justifyContent:"center"}},xo.default.createElement(Ip,null))))}function Op(e){const t=e.config.visible&&e.active;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement("div",{style:{width:"40px"}},xo.default.createElement(To.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:ko.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},Mo(e.config.color)),onClick:e.onClick,"aria-label":ko.b.getLocalizedText(e.config.accessibilityDescription)},xo.default.createElement(e.icon,null))))}var Lp=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Pp(e){var t,n;const i=qh(e.page.finalImageUrl()),[o,r]=xo.default.useState(null),[a,s]=xo.default.useState(!1);Object(xo.useEffect)((()=>{(()=>{Lp(this,void 0,void 0,(function*(){!e.animateRotation&&i.value&&(yield new Promise((e=>{const t=document.createElement("img");t.onload=e,t.src=i.value})),r(i.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[i.value,e.animateRotation]);const c=xo.default.useRef(null),l=(()=>{const e=c.current;if(a&&e){const t=e.parentElement;let n;if([e.clientHeight,e.clientWidth,t.clientHeight,e.clientHeight].some((e=>0===e)))n=1;else{const i=1/(e.clientWidth/e.clientHeight),o=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):i<o?t.clientHeight/e.clientWidth:t.clientWidth/e.clientHeight}return{transform:`rotate(90deg) scale(${n})`,transition:"transform 0.5s"}}return{transform:"none",transition:"none"}})();return null===o&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):xo.default.createElement(xo.default.Fragment,null,o&&xo.default.createElement("img",{"data-sb-carousel-page":!0,ref:c,onTransitionEnd:()=>{var t,n;return null===(n=(t=e.onAnimateRotationDone).current)||void 0===n?void 0:n.call(t)},style:Object.assign(Object.assign({},e.style),l),src:o,alt:`Page ${e.index}`}))}function _p(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Rp(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every((n=>{const i=e[n],o=t[n];return"function"==typeof i?`${i}`==`${o}`:_p(i)&&_p(o)?Rp(i,o):i===o}))}function Fp(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function Mp(e){return"number"==typeof e}function Np(e){return"string"==typeof e}function Vp(e){return"boolean"==typeof e}function Wp(e){return"[object Object]"===Object.prototype.toString.call(e)}function zp(e){return Math.abs(e)}function jp(e){return Math.sign(e)}function Hp(e,t){return zp(e-t)}function Up(e){return qp(e).map(Number)}function Zp(e){return e[Gp(e)]}function Gp(e){return Math.max(0,e.length-1)}function Yp(e,t){return t===Gp(e)}function Qp(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function qp(e){return Object.keys(e)}function Xp(e,t){return[e,t].reduce(((e,t)=>(qp(t).forEach((n=>{const i=e[n],o=t[n],r=Wp(i)&&Wp(o);e[n]=r?Xp(i,o):o})),e)),{})}function Kp(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function Jp(){let e=[];const t={add:function(n,i,o,r={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(i,o,r),a=()=>n.removeEventListener(i,o,r);else{const e=n;e.addListener(o),a=()=>e.removeListener(o)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function $p(e,t,n,i){const o=Jp(),r=1e3/60;let a=null,s=0,c=0;function l(e){if(!c)return;a||(a=e);const o=e-a;for(a=e,s+=o;s>=r;)n(r),s-=r;i(s/r),c&&t.requestAnimationFrame(l)}function u(){t.cancelAnimationFrame(c),a=null,s=0,c=0}return{init:function(){o.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){u(),o.clear()},start:function(){c||(c=t.requestAnimationFrame(l))},stop:u,update:()=>n(r),render:i}}function eg(e=0,t=0){const n=zp(e-t);function i(t){return t<e}function o(e){return e>t}function r(e){return i(e)||o(e)}return{length:n,max:t,min:e,constrain:function(n){return r(n)?i(n)?e:t:n},reachedAny:r,reachedMax:o,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function tg(e,t,n){const{constrain:i}=eg(0,e),o=e+1;let r=a(t);function a(e){return n?zp((o+e)%o):i(e)}function s(){return r}function c(){return tg(e,s(),n)}const l={get:s,set:function(e){return r=a(e),l},add:function(e){return c().set(s()+e)},clone:c};return l}function ng(e,t,n,i,o,r,a,s,c,l,u,d,m,h,f,p,g,v,C){const{cross:y,direction:b}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=Jp(),E=Jp(),x=eg(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},B={mouse:500,touch:600},T=f?43:25;let I=!1,k=0,O=0,L=!1,P=!1,_=!1,R=!1;function F(e){if(!Kp(e,i)&&e.touches.length>=2)return M(e);const t=r.readPoint(e),n=r.readPoint(e,y),a=Hp(t,k),c=Hp(n,O);if(!P&&!R){if(!e.cancelable)return M(e);if(P=a>c,!P)return M(e)}const u=r.pointerMove(e);a>p&&(_=!0),l.useFriction(.3).useDuration(.75),s.start(),o.add(b(u)),e.preventDefault()}function M(e){const t=u.byDistance(0,!1).index!==d.get(),n=r.pointerUp(e)*(f?B:D)[R?"mouse":"touch"],i=function(e,t){const n=d.add(-1*jp(e)),i=u.byDistance(e,!f).distance;return f||zp(e)<x?i:g&&t?.5*i:u.byIndex(n.get(),0).distance}(b(n),t),o=function(e,t){if(0===e||0===t)return 0;if(zp(e)<=zp(t))return 0;const n=Hp(zp(e),zp(t));return zp(n/e)}(n,i),a=T-10*o,s=v+o/50;P=!1,L=!1,E.clear(),l.useDuration(a).useFriction(s),c.distance(i,!f),R=!1,m.emit("pointerUp")}function N(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!C)return;function s(s){(Vp(C)||C(e,s))&&function(e){const s=Kp(e,i);if(R=s,_=f&&s&&!e.buttons&&I,I=Hp(o.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;L=!0,r.pointerDown(e),l.useFriction(0).useDuration(0),o.set(a),function(){const e=R?n:t;E.add(e,"touchmove",F,S).add(e,"touchend",M).add(e,"mousemove",F,S).add(e,"mouseup",M)}(),k=r.readPoint(e),O=r.readPoint(e,y),m.emit("pointerDown")}(s)}const c=t;w.add(c,"dragstart",(e=>e.preventDefault()),S).add(c,"touchmove",(()=>{}),S).add(c,"touchend",(()=>{})).add(c,"touchstart",s).add(c,"mousedown",s).add(c,"touchcancel",M).add(c,"contextmenu",M).add(c,"click",N,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return L}}}function ig(e,t){let n,i;function o(e){return e.timeStamp}function r(n,i){const o="client"+("x"===(i||e.scroll)?"X":"Y");return(Kp(n,t)?n:n.touches[0])[o]}return{pointerDown:function(e){return n=e,i=e,r(e)},pointerMove:function(e){const t=r(e)-r(i),a=o(e)-o(n)>170;return i=e,a&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=r(i)-r(n),a=o(e)-o(n),s=o(e)-o(i)>170,c=t/a;return a&&!s&&zp(c)>.1?c:0},readPoint:r}}function og(e,t,n,i,o,r,a){const s=[e].concat(i);let c,l,u=[],d=!1;function m(e){return o.measureSize(a.measure(e))}return{init:function(o){r&&(l=m(e),u=i.map(m),c=new ResizeObserver((n=>{(Vp(r)||r(o,n))&&function(n){for(const r of n){if(d)return;const n=r.target===e,a=i.indexOf(r.target),s=n?l:u[a];if(zp(m(n?e:i[a])-s)>=.5){o.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>c.observe(e)))})))},destroy:function(){d=!0,c&&c.disconnect()}}}function rg(e,t,n,i,o){const r=o.measure(10),a=o.measure(50),s=eg(.1,.99);let c=!1;function l(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(o){if(!l())return;const c=e.reachedMin(t.get())?"min":"max",u=zp(e[c]-t.get()),d=n.get()-t.get(),m=s.constrain(u/a);n.subtract(d*m),!o&&zp(d)<r&&(n.set(e.constrain(n.get())),i.useDuration(25).useBaseFriction())},toggleActive:function(e){c=!e}}}function ag(e,t,n,i){const o=t.min+.1,r=t.max+.1,{reachedMin:a,reachedMax:s}=eg(o,r);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const o=e*(-1*t);i.forEach((e=>e.add(o)))}}}function sg(e,t,n,i,o){const{reachedAny:r,removeOffset:a,constrain:s}=i;function c(e){return e.concat().sort(((e,t)=>zp(e)-zp(t)))[0]}function l(t,i){const o=[t,t+n,t-n];if(!e)return t;if(!i)return c(o);const r=o.filter((e=>jp(e)===i));return r.length?c(r):Zp(o)-n}const u={byDistance:function(n,i){const c=o.get()+n,{index:u,distance:d}=function(n){const i=e?a(n):s(n),o=t.map(((e,t)=>({diff:l(e-i,0),index:t}))).sort(((e,t)=>zp(e.diff)-zp(t.diff))),{index:r}=o[0];return{index:r,distance:i}}(c),m=!e&&r(c);return!i||m?{index:u,distance:n}:{index:u,distance:n+l(t[u]-d,0)}},byIndex:function(e,n){return{index:e,distance:l(t[e]-o.get(),n)}},shortcut:l};return u}function cg(e,t,n,i,o,r,a,s){const c={passive:!0,capture:!0};let l=0;function u(e){"Tab"===e.code&&(l=(new Date).getTime())}return{init:function(d){s&&(r.add(document,"keydown",u,!1),t.forEach(((t,u)=>{r.add(t,"focus",(t=>{(Vp(s)||s(d,t))&&function(t){if((new Date).getTime()-l>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));Mp(r)&&(o.useDuration(0),i.index(r,0),a.emit("slideFocus"))}(u)}),c)})))}}}function lg(e){let t=e;function n(e){return Mp(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function ug(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},i=t.style;let o=!1;return{clear:function(){o||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){o||(i.transform=n(e.direction(t)))},toggleActive:function(e){o=!e}}}function dg(e,t,n,i,o,r,a,s,c){const l=Up(o),u=Up(o).reverse(),d=function(){const e=a[0];return f(h(u,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(l,e),-n,!0)}());function m(e,t){return e.reduce(((e,t)=>e-o[t]),t)}function h(e,t){return e.reduce(((e,n)=>m(e,t)>0?e.concat([n]):e),[])}function f(o,a,l){const u=function(e){return r.map(((n,o)=>({start:n-i[o]+.5+e,end:n+t-.5+e})))}(a);return o.map((t=>{const i=l?0:-n,o=l?n:0,r=l?"end":"start",a=u[t][r];return{index:t,loopPoint:a,slideLocation:lg(-1),translate:ug(e,c[t]),target:()=>s.get()>a?i:o}}))}return{canLoop:function(){return d.every((({index:e})=>m(l.filter((t=>t!==e)),t)<=.1))},clear:function(){d.forEach((e=>e.translate.clear()))},loop:function(){d.forEach((e=>{const{target:t,translate:n,slideLocation:i}=e,o=t();o!==i.get()&&(n.to(o),i.set(o))}))},loopPoints:d}}function mg(e,t,n){let i,o=!1;return{init:function(r){n&&(i=new MutationObserver((e=>{o||(Vp(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),o=!0}}}function hg(e,t,n,i){const o={};let r,a=null,s=null,c=!1;return{init:function(){r=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);o[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),c=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return qp(o).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:r}=o[i];return(e&&r||!e&&!r)&&t.push(i),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function fg(e,t,n,i,o,r,a,s,c){const{startEdge:l,endEdge:u,direction:d}=e,m=Mp(n);return{groupSlides:function(e){return m?function(e,t){return Up(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?Up(e).reduce(((n,m,h)=>{const f=Zp(n)||0,p=0===f,g=m===Gp(e),v=o[l]-r[f][l],C=o[l]-r[m][u],y=!i&&p?d(a):0,b=zp(C-(!i&&g?d(s):0)-(v+y));return h&&b>t+c&&n.push(m),g&&n.push(e.length),n}),[]).map(((t,n,i)=>{const o=Math.max(i[n-1]||0);return e.slice(o,t)})):[]}(e)}}}function pg(e,t,n,i,o,r,a){const{align:s,axis:c,direction:l,startIndex:u,loop:d,duration:m,dragFree:h,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:C,watchResize:y,watchSlides:b,watchDrag:A,watchFocus:S}=r,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:o}=e;return{top:t,right:n+i,bottom:t+o,left:n,width:i,height:o}}},E=w.measure(t),x=n.map(w.measure),D=function(e,t){const n="rtl"===t,i="y"===e,o=!i&&n?-1:1;return{scroll:i?"y":"x",cross:i?"x":"y",startEdge:i?"top":n?"right":"left",endEdge:i?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return i?t:n},direction:function(e){return e*o}}}(c,l),B=D.measureSize(E),T=function(e){return{measure:function(t){return e*(t/100)}}}(B),I=function(e,t){const n={start:function(){return 0},center:function(e){return i(e)/2},end:i};function i(e){return t-e}return{measure:function(i,o){return Np(e)?n[e](i):e(t,i,o)}}}(s,B),k=!d&&!!C,O=d||!!C,{slideSizes:L,slideSizesWithGaps:P,startGap:_,endGap:R}=function(e,t,n,i,o,r){const{measureSize:a,startEdge:s,endEdge:c}=e,l=n[0]&&o,u=function(){if(!l)return 0;const e=n[0];return zp(t[s]-e[s])}(),d=function(){if(!l)return 0;const e=r.getComputedStyle(Zp(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),m=n.map(a),h=n.map(((e,t,n)=>{const i=!t,o=Yp(n,t);return i?m[t]+u:o?m[t]+d:n[t+1][s]-e[s]})).map(zp);return{slideSizes:m,slideSizesWithGaps:h,startGap:u,endGap:d}}(D,E,x,n,O,o),F=fg(D,B,g,d,E,x,_,R,2),{snaps:M,snapsAligned:N}=function(e,t,n,i,o){const{startEdge:r,endEdge:a}=e,{groupSlides:s}=o,c=s(i).map((e=>Zp(e)[a]-e[0][r])).map(zp).map(t.measure),l=i.map((e=>n[r]-e[r])).map((e=>-zp(e))),u=s(l).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:l,snapsAligned:u}}(D,I,E,x,F),V=-Zp(M)+Zp(P),{snapsContained:W,scrollContainLimit:z}=function(e,t,n,i,o){const r=eg(-t+e,0),a=n.map(((e,t)=>{const{min:i,max:o}=r,a=r.constrain(e),s=!t,l=Yp(n,t);return s?o:l||c(i,a)?i:c(o,a)?o:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=Zp(a);return eg(a.lastIndexOf(e),a.indexOf(t)+1)}();function c(e,t){return Hp(e,t)<1}return{snapsContained:function(){if(t<=e+o)return[r.max];if("keepSnaps"===i)return a;const{min:n,max:c}=s;return a.slice(n,c)}(),scrollContainLimit:s}}(B,V,N,C,2),j=k?W:N,{limit:H}=function(e,t,n){const i=t[0];return{limit:eg(n?i-e:Zp(t),i)}}(V,j,d),U=tg(Gp(j),u,d),Z=U.clone(),G=Up(n),Y=$p(i,o,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},o)=>{i||n.constrain(e.pointerDown()),t.seek(o)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:o,slideLooper:r,dragHandler:a,animation:s,eventHandler:c,scrollBounds:l,options:{loop:u}},d)=>{const m=e.settled(),h=!l.shouldConstrain(),f=u?m:m&&h;f&&!a.pointerDown()&&(s.stop(),c.emit("settle")),f||c.emit("scroll");const p=n.get()*d+X.get()*(1-d);i.set(p),u&&(o.loop(e.direction()),r.loop()),t.to(i.get())})(se,e))),Q=j[U.get()],q=lg(Q),X=lg(Q),K=lg(Q),J=lg(Q),$=function(e,t,n,i,o,r){let a=0,s=0,c=o,l=r,u=e.get(),d=0;function m(e){return c=e,f}function h(e){return l=e,f}const f={direction:function(){return s},duration:function(){return c},velocity:function(){return a},seek:function(t){const o=t/1e3,r=c*o,m=i.get()-e.get();let h=0;return c?(n.set(e),a+=m/r,a*=l,u+=a,e.add(a*o),h=u-d):(a=0,n.set(i),e.set(i),h=m),s=jp(h),d=u,f},settled:function(){return zp(i.get()-t.get())<.001},useBaseFriction:function(){return h(r)},useBaseDuration:function(){return m(o)},useFriction:h,useDuration:m};return f}(q,K,X,J,m,.68),ee=sg(d,j,V,H,J),te=function(e,t,n,i,o,r,a){function s(o){const s=o.distance,c=o.index!==t.get();r.add(s),s&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(o.index),a.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);s(o.byIndex(i.get(),n))}}}(Y,U,Z,$,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(H),ie=Jp(),oe=hg(t,n,a,p),{slideRegistry:re}=function(e,t,n,i,o,r){const{groupSlides:a}=o,{min:s,max:c}=i;return{slideRegistry:function(){const i=a(r),o=!e||"keepSnaps"===t;return 1===n.length?[r]:o?i:i.slice(s,c).map(((e,t,n)=>{const i=!t,o=Yp(n,t);return i?Qp(Zp(n[0])+1):o?Qp(Gp(r)-Zp(n)[0]+1,Zp(n)[0]):e}))}()}}(k,C,j,z,F,G),ae=cg(e,n,re,te,$,ie,a,S),se={ownerDocument:i,ownerWindow:o,eventHandler:a,containerRect:E,slideRects:x,animation:Y,axis:D,dragHandler:ng(D,e,i,o,J,ig(D,o),q,Y,te,$,ee,U,a,T,h,f,v,.68,A),eventStore:ie,percentOfView:T,index:U,indexPrevious:Z,limit:H,location:q,offsetLocation:K,previousLocation:X,options:r,resizeHandler:og(t,a,o,n,D,y,w),scrollBody:$,scrollBounds:rg(H,K,J,$,T),scrollLooper:ag(V,H,K,[q,K,X,J]),scrollProgress:ne,scrollSnapList:j.map(ne.get),scrollSnaps:j,scrollTarget:ee,scrollTo:te,slideLooper:dg(D,B,V,L,P,M,j,K,n),slideFocus:ae,slidesHandler:mg(t,a,b),slidesInView:oe,slideIndexes:G,slideRegistry:re,slidesToScroll:F,target:J,translate:ug(D,t)};return se}const gg={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function vg(e){function t(e,t){return Xp(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},o=qp(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,o)},optionsMediaQueries:function(t){return t.map((e=>qp(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function Cg(e,t,n){const i=e.ownerDocument,o=i.defaultView,r=vg(o),a=function(e){let t=[];return{init:function(n,i){return t=i.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),i.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}}}(r),s=Jp(),c=function(){let e,t={};function n(e){return t[e]||[]}const i={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),i},off:function(e,o){return t[e]=n(e).filter((e=>e!==o)),i},on:function(e,o){return t[e]=n(e).concat([o]),i},clear:function(){t={}}};return i}(),{mergeOptions:l,optionsAtMedia:u,optionsMediaQueries:d}=r,{on:m,off:h,emit:f}=c,p=D;let g,v,C,y,b=!1,A=l(gg,Cg.globalOptions),S=l(A),w=[];function E(t){const n=pg(e,C,y,i,o,t,c);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function x(t,n){b||(A=l(A,t),S=u(A),w=n||w,function(){const{container:t,slides:n}=S,i=Np(t)?e.querySelector(t):t;C=i||e.children[0];const o=Np(n)?C.querySelectorAll(n):n;y=[].slice.call(o||C.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",D))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(k),g.eventHandler.init(k),g.resizeHandler.init(k),g.slidesHandler.init(k),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&y.length&&g.dragHandler.init(k),v=a.init(k,w)))}function D(e,t){const n=I();B(),x(l({startIndex:n},e),t),c.emit("reInit")}function B(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),a.destroy(),s.clear()}function T(e,t,n){S.active&&!b&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function I(){return g.index.get()}const k={canScrollNext:function(){return g.index.add(1).get()!==I()},canScrollPrev:function(){return g.index.add(-1).get()!==I()},containerNode:function(){return C},internalEngine:function(){return g},destroy:function(){b||(b=!0,s.clear(),B(),c.emit("destroy"),c.clear())},off:h,on:m,emit:f,plugins:function(){return v},previousScrollSnap:function(){return g.indexPrevious.get()},reInit:p,rootNode:function(){return e},scrollNext:function(e){T(g.index.add(1).get(),e,-1)},scrollPrev:function(e){T(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:T,selectedScrollSnap:I,slideNodes:function(){return y},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return x(t,n),setTimeout((()=>c.emit("init")),0),k}function yg(e={},t=[]){const n=Object(xo.useRef)(e),i=Object(xo.useRef)(t),[o,r]=Object(xo.useState)(),[a,s]=Object(xo.useState)(),c=Object(xo.useCallback)((()=>{o&&o.reInit(n.current,i.current)}),[o]);return Object(xo.useEffect)((()=>{Rp(n.current,e)||(n.current=e,c())}),[e,c]),Object(xo.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Fp(e),i=Fp(t);return n.every(((e,t)=>Rp(e,i[t])))})(i.current,t)||(i.current=t,c())}),[t,c]),Object(xo.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){Cg.globalOptions=yg.globalOptions;const e=Cg(a,n.current,i.current);return r(e),()=>e.destroy()}r(void 0)}),[a,r]),[s,o]}Cg.globalOptions=void 0,yg.globalOptions=void 0;function bg(e){var t,n,i;const o=Object(xo.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),r={duration:20,startIndex:o},[a,s]=yg(r);Object(xo.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(xo.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const c=Dp();return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{sx:{flexGrow:1,backgroundColor:ko.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},xo.default.createElement(Op,{config:e.configuration.screens.review.switchPreviousPageButton,icon:Io.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),xo.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},xo.default.createElement("div",{className:"embla__container",style:{display:"flex",height:"100%"}},null===(t=e.document)||void 0===t?void 0:t.pages.map(((t,n)=>xo.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},xo.default.createElement(Pp,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${Oo} - ${50+c+72+32}px)`,maxWidth:"100%"}})))))),xo.default.createElement(Op,{config:e.configuration.screens.review.switchNextPageButton,icon:Io.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition+1),active:e.currentPosition<(null===(i=null===(n=e.document)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.length)-1,debugName:"carousel-forward"})))}var Ag=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Sg(e){var t,n,i,o,r,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[c,l]=xo.default.useState(!1);Object(xo.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(xo.useEffect)((()=>{var t,n;0===(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)&&e.visible&&!c&&e.onClose()}),[null===(n=e.document)||void 0===n?void 0:n.pages,e.visible,c]);const[u,d]=Object(xo.useState)(!0),[m,h]=Object(xo.useState)(null),f=Object(xo.useRef)(null),[p,g]=Object(xo.useState)(!1),[v,C]=Object(xo.useState)(!1);return Object(xo.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(kp,{open:c}),xo.default.createElement(Ef,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>Ag(this,void 0,void 0,(function*(){var t,n,i;l(!0),(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)>1&&e.onGoToPage(Math.max(e.currentPosition-1,0)),yield null===(i=e.document)||void 0===i?void 0:i.deletePage(s),l(!1),g(!1)}))}),xo.default.createElement(Ef,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>C(!1),onOkClick:()=>Ag(this,void 0,void 0,(function*(){var t;l(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),l(!1),C(!1)}))}),xo.default.createElement(To.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${Oo})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},xo.default.createElement(wp,{config:e.configuration,numPages:null===(o=null===(i=e.document)||void 0===i?void 0:i.pages)||void 0===o?void 0:o.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>C(!0),buttonsEnabled:u}),xo.default.createElement(bg,{buttonsEnabled:u,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:m}),xo.default.createElement(Tp,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(r=e.document)||void 0===r?void 0:r.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),xo.default.createElement(Bp,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>Ag(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),l(!0);const i=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),o=new Promise((e=>{f.current=e,h(i.id)})),r=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(i,null,1);yield Promise.all([o,r]),yield i.finalImageUrl(),f.current=null,h(null),d(!0),l(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:u}))):null}var wg=function(e,t){return Number(e.toFixed(t))},Eg=function(e,t,n){n&&"function"==typeof n&&n(e,t)},xg={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},Dg=function(e){"number"==typeof e&&cancelAnimationFrame(e)},Bg=function(e){e.mounted&&(Dg(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function Tg(e,t,n,i){if(e.mounted){var o=(new Date).getTime();Bg(e),e.animation=function(){if(!e.mounted)return Dg(e.animation);var r=(new Date).getTime()-o,a=(0,xg[t])(r/n);r>=n?(i(1),e.animation=null):e.animation&&(i(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Ig(e,t,n,i){var o=function(e){var t=e.scale,n=e.positionX,i=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(i))}(t);if(e.mounted&&o){var r=e.setTransformState,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=t.scale-s,d=t.positionX-c,m=t.positionY-l;0===n?r(t.scale,t.positionX,t.positionY):Tg(e,i,n,(function(e){r(s+u*e,c+d*e,l+m*e)}))}}var kg=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var r=function(e,t,n){var i=e.offsetWidth,o=e.offsetHeight,r=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:o,newContentWidth:r,newDiffWidth:i-r,newContentHeight:a,newDiffHeight:o-a}}(n,i,t),a=r.wrapperWidth,s=r.wrapperHeight,c=function(e,t,n,i,o,r,a){var s=e>t?n*(a?1:.5):0,c=i>o?r*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:i-o-c,maxPositionY:c}}(a,r.newContentWidth,r.newDiffWidth,s,r.newContentHeight,r.newDiffHeight,Boolean(o));return c},Og=function(e,t,n,i){return wg(i?e<t?t:e>n?n:e:e,2)},Lg=function(e,t){var n=kg(e,t);return e.bounds=n,n};function Pg(e,t,n,i,o,r,a){var s=n.minPositionX,c=n.minPositionY,l=n.maxPositionX,u=n.maxPositionY,d=0,m=0;return a&&(d=o,m=r),{x:Og(e,s-d,l+d,i),y:Og(t,c-m,u+m,i)}}function _g(e,t,n,i,o,r){var a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=i-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:c,y:l}):Pg(c-t*u,l-n*u,o,r,0,0,null)}function Rg(e,t,n,i,o){var r=t-(o?i:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=r?r:e}var Fg=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,o=e.wrapperComponent,r=t.target,a="shadowRoot"in r&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==o?void 0:o.contains(e))})):null==o?void 0:o.contains(r);return!!(i&&r&&a)&&!pv(r,n)},Mg=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)};function Ng(e,t,n,i,o){var r=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(null!==a&&null!==s&&(t!==u||n!==d)){var m=Pg(t,n,s,r,i,o,a),h=m.x,f=m.y;e.setTransformState(l,h,f)}}var Vg=function(e,t){var n=e.setup,i=e.transformState.scale,o=n.minScale,r=n.disablePadding;return t>0&&i>=o&&!r?t:0};function Wg(e,t,n,i,o,r,a,s,c,l){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*l)>c?c:u<a?a:u;if(t<r&&n<r)return(u=r+(e-r)*l)<s?s:u>r?r:u}return i?t:Og(e,r,a,o)}function zg(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,o=n.velocityAnimation,r=e.transformState.scale;return!(o.disabled&&!(r>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,o=e.velocityTime,r=e.setup,a=e.wrapperComponent,s=r.velocityAnimation.equalToMove,c=Date.now();if(i&&o&&a){var l=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-i.x,d=t.y-i.y,m=u/l,h=d/l,f=c-o,p=u*u+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:m,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=c}}function jg(e,t){var n=e.transformState.scale;Bg(e),Lg(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,i=e.transformState,o=i.positionX,r=i.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-r}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,o=n.positionY;e.isPanning=!0;var r=t.clientX,a=t.clientY;e.startCoords={x:r-i,y:a-o}}(e,t)}function Hg(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,o=n.alignmentAnimation,r=o.disabled,a=o.sizeX,s=o.sizeY,c=o.animationTime,l=o.animationType;if(!(r||t<i||!a&&!s)){var u=function(e){var t=e.transformState,n=t.positionX,i=t.positionY,o=t.scale,r=e.setup,a=r.disabled,s=r.limitToBounds,c=r.centerZoomedOut,l=e.wrapperComponent;if(!a&&l&&e.bounds){var u=e.bounds,d=u.maxPositionX,m=u.minPositionX,h=u.maxPositionY,f=u.minPositionY,p=n>d||n<m,g=i>h||i<f,v=_g(e,n>d?l.offsetWidth:e.setup.minPositionX||0,i>h?l.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||c),C=v.x,y=v.y;return{scale:o,positionX:p?C:n,positionY:g?y:i}}}(e);u&&Ig(e,u,c,l)}}function Ug(e,t,n){var i=e.startCoords,o=e.setup.alignmentAnimation,r=o.sizeX,a=o.sizeY;if(i){var s=function(e,t,n){var i=e.startCoords,o=e.transformState,r=e.setup.panning,a=r.lockAxisX,s=r.lockAxisY,c=o.positionX,l=o.positionY;if(!i)return{x:c,y:l};var u=t-i.x,d=n-i.y;return{x:a?c:u,y:s?l:d}}(e,t,n),c=s.x,l=s.y,u=Vg(e,r),d=Vg(e,a);zg(e,{x:c,y:l}),Ng(e,c,l,u,d)}}function Zg(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var r=null==i?void 0:i.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==r?void 0:r.width)||0,c=(null==r?void 0:r.height)||0,l=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s<l||c<u;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,o=e.wrapperComponent,r=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,o=e.setup,r=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&r&&!t||!n||!i)}(e);if(r&&t&&n&&o){var a=t.velocityX,s=t.velocityY,c=t.total,l=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,m=n.minPositionY,h=i.limitToBounds,f=i.alignmentAnimation,p=i.zoomAnimation,g=i.panning,v=g.lockAxisY,C=g.lockAxisX,y=p.animationType,b=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,o=n.animationTime,r=n.sensitivity;return i?o*t*r:o}(e,c),E=Math.max(w,S),x=Vg(e,b),D=Vg(e,A),B=x*o.offsetWidth/100,T=D*o.offsetHeight/100,I=l+B,k=u-B,O=d+T,L=m-T,P=e.transformState,_=(new Date).getTime();Tg(e,y,E,(function(t){var n=e.transformState,i=n.scale,o=n.positionX,r=n.positionY,c=((new Date).getTime()-_)/S,p=1-(0,xg[f.animationType])(Math.min(1,c)),g=1-t,y=o+a*g,b=r+s*g,A=Wg(y,P.positionX,o,C,h,u,l,k,I,p),w=Wg(b,P.positionY,r,v,h,m,d,L,O,p);o===y&&r===b||e.setTransformState(i,A,w)}))}}(e):Hg(e)}}function Gg(e,t,n,i){var o=e.setup,r=o.minScale,a=o.maxScale,s=o.limitToBounds,c=Rg(wg(t,2),r,a,0,!1),l=_g(e,n,i,c,Lg(e,c),s);return{scale:c,positionX:l.x,positionY:l.y}}function Yg(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.minScale,s=r.limitToBounds,c=r.zoomAnimation,l=c.disabled,u=c.animationTime,d=c.animationType,m=l||i>=a;if((i>=1||s)&&Hg(e),!m&&o&&e.mounted){var h=Gg(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);h&&Ig(e,h,u,d)}}var Qg=function(){return Qg=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Qg.apply(this,arguments)};function qg(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var Xg=1,Kg=0,Jg=0,$g={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,wheelPanning:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},ev=function(e){var t,n,i,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Xg,scale:null!==(n=e.initialScale)&&void 0!==n?n:Xg,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Kg,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:Jg}},tv=function(e){var t=Qg({},$g);return Object.keys(e).forEach((function(n){var i="undefined"!=typeof e[n];if("undefined"!=typeof $g[n]&&i){var o=Object.prototype.toString.call($g[n]),r="[object Object]"===o,a="[object Array]"===o;t[n]=r?Qg(Qg({},$g[n]),e[n]):a?qg(qg([],$g[n],!0),e[n],!0):e[n]}})),t},nv=function(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.maxScale,s=r.minScale,c=r.zoomAnimation,l=r.smooth,u=c.size;if(!o)throw new Error("Wrapper is not mounted");var d=l?i*Math.exp(t*n):i+t*n;return Rg(wg(d,3),s,a,u,!1)};function iv(e,t,n,i,o){var r=e.wrapperComponent,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY;if(!r)return console.error("No WrapperComponent found");var u=(r.offsetWidth/2-c)/s,d=(r.offsetHeight/2-l)/s,m=Gg(e,nv(e,t,n),u,d);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");Ig(e,m,i,o)}function ov(e,t,n,i){var o=e.setup,r=e.wrapperComponent,a=o.limitToBounds,s=ev(e.props),c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(r){var m=kg(e,s.scale),h=Pg(s.positionX,s.positionY,m,a,0,0,r),f={scale:s.scale,positionX:h.x,positionY:h.y};l===s.scale&&u===s.positionX&&d===s.positionY||(null==i||i(),Ig(e,f,t,n))}}var rv=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),iv(e,1,t,n,i)}},av=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),iv(e,-1,t,n,i)}},sv=function(e){return function(t,n,i,o,r){void 0===o&&(o=300),void 0===r&&(r="easeOut");var a=e.transformState,s=a.positionX,c=a.positionY,l=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var m={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(i)?l:i};Ig(e,m,o,r)}}},cv=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),ov(e,t,n)}},lv=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var o=e.transformState,r=e.wrapperComponent,a=e.contentComponent;if(r&&a){var s=vv(t||o.scale,r,a);Ig(e,s,n,i)}}},uv=function(e){return function(t,n,i,o){void 0===i&&(i=600),void 0===o&&(o="easeOut"),Bg(e);var r=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(r&&a&&r.contains(a)){var s=function(e,t,n){var i=e.wrapperComponent,o=e.contentComponent,r=e.transformState,a=e.setup,s=a.limitToBounds,c=a.minScale,l=a.maxScale;if(!i||!o)return r;var u,d,m,h,f,p,g,v,C=i.getBoundingClientRect(),y=t.getBoundingClientRect(),b=(u=i,d=o,m=r,h=t.getBoundingClientRect(),f=u.getBoundingClientRect(),p=d.getBoundingClientRect(),g=f.x*m.scale,v=f.y*m.scale,{x:(h.x-p.x+g)/m.scale,y:(h.y-p.y+v)/m.scale}),A=b.x,S=b.y,w=y.width/r.scale,E=y.height/r.scale,x=i.offsetWidth/w,D=i.offsetHeight/E,B=Rg(n||Math.min(x,D),c,l,0,!1),T=(C.width-w*B)/2,I=(C.height-E*B)/2,k=Pg((C.left-A)*B+T,(C.top-S)*B+I,kg(e,B),s,0,0,i);return{positionX:k.x,positionY:k.y,scale:B}}(e,a,n);Ig(e,s,i,o)}}},dv=function(e){return{instance:e,zoomIn:rv(e),zoomOut:av(e),setTransform:sv(e),resetTransform:cv(e),centerView:lv(e),zoomToElement:uv(e)}},mv=function(e){return{instance:e,state:e.transformState}},hv=function(e){var t={};return Object.assign(t,mv(e)),Object.assign(t,dv(e)),t};function fv(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var pv=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},gv=function(e){e&&clearTimeout(e)},vv=function(e,t,n){var i=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-o)/2}};function Cv(e,t,n){var i=t.getBoundingClientRect(),o=0,r=0;if("clientX"in e)o=(e.clientX-i.left)/n,r=(e.clientY-i.top)/n;else{var a=e.touches[0];o=(a.clientX-i.left)/n,r=(a.clientY-i.top)/n}return(Number.isNaN(o)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:o,y:r}}var yv=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},bv=function(e,t){var n=e.props,i=n.onWheel,o=n.onZoom,r=e.contentComponent,a=e.setup,s=e.transformState.scale,c=a.limitToBounds,l=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,m=a.disablePadding,h=a.smooth,f=u.size,p=u.disabled,g=d.step,v=d.smoothStep;if(!r)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=function(e,t){var n,i,o=function(e){return e?e.deltaY<0?1:-1:0}(e);return i=o,"number"==typeof(n=t)?n:i}(t,null),y=function(e,t,n,i,o){var r=e.transformState.scale,a=e.wrapperComponent,s=e.setup,c=s.maxScale,l=s.minScale,u=s.zoomAnimation,d=s.disablePadding,m=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=r+t*n;if(o)return f;var p=!i&&!h;return Rg(wg(f,3),l,c,m,p&&!d)}(e,C,h?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==y){var b=Lg(e,y),A=Cv(t,r,s),S=c&&(p||0===f||l||m),w=_g(e,A.x,A.y,y,b,S),E=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(y,E,x),Eg(hv(e),t,i),Eg(hv(e),t,o)}},Av=function(e,t){var n=e.props,i=n.onWheelStop,o=n.onZoomStop;gv(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(Yg(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var r=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,o=e.setup,r=o.maxScale,a=o.minScale;return!!n&&(i<r||i>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);r&&(gv(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Eg(hv(e),t,i),Eg(hv(e),t,o))}),160))},Sv=function(e){for(var t=0,n=0,i=0;i<2;i+=1)t+=e.touches[i].clientX,n+=e.touches[i].clientY;return{x:t/2,y:n/2}},wv=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,o=e.wrapperComponent,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,c=a.centerZoomedOut,l=a.zoomAnimation,u=a.alignmentAnimation,d=l.disabled,m=l.size;if(null!==i&&n){var h=function(e,t,n){var i=n.getBoundingClientRect(),o=e.touches,r=wg(o[0].clientX-i.left,5),a=wg(o[0].clientY-i.top,5);return{x:(r+wg(o[1].clientX-i.left,5))/2/t,y:(a+wg(o[1].clientY-i.top,5))/2/t}}(t,r,n);if(Number.isFinite(h.x)&&Number.isFinite(h.y)){var f=yv(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,o=e.setup,r=o.maxScale,a=o.minScale,s=o.zoomAnimation,c=o.disablePadding,l=s.size,u=s.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Rg(wg(t/i*n,2),a,r,l,!u&&!c)}(e,f),g=Sv(t),v=g.x-(e.pinchLastCenterX||0),C=g.y-(e.pinchLastCenterY||0);if(p!==r||0!==v||0!==C){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var y=Lg(e,p),b=s&&(d||0===m||c),A=_g(e,h.x,h.y,p,y,b),S=A.x,w=A.y;e.pinchMidpoint=h,e.lastDistance=f;var E=u.sizeX,x=u.sizeY,D=Pg(S+v,w+C,y,s,Vg(e,E),Vg(e,x),o),B=D.x,T=D.y;e.setTransformState(p,B,T)}}}},Ev=function(e,t){var n=e.props.onZoomStop,i=e.setup.doubleClick.animationTime;gv(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,Eg(hv(e),t,n)}),i)};function xv(e,t){var n=e.setup,i=e.doubleClickStopEventTimer,o=e.transformState,r=e.contentComponent,a=o.scale,s=e.props,c=s.onZoomStart,l=s.onZoom,u=n.doubleClick,d=u.disabled,m=u.mode,h=u.step,f=u.animationTime,p=u.animationType;if(!d&&!i){if("reset"===m)return function(e,t){var n=e.props,i=n.onZoomStart,o=n.onZoom,r=e.setup.doubleClick,a=r.animationTime,s=r.animationType;Eg(hv(e),t,i),ov(e,a,s,(function(){return Eg(hv(e),t,o)})),Ev(e,t)}(e,t);if(!r)return console.error("No ContentComponent found");var g=function(e,t){return"toggle"===e?1===t?1:-1:"zoomOut"===e?-1:1}(m,e.transformState.scale),v=nv(e,g,h);if(a!==v){Eg(hv(e),t,c);var C=Cv(t,r,a),y=Gg(e,v,C.x,C.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");Eg(hv(e),t,l),Ig(e,y,f,p),Ev(e,t)}}}var Dv=function(e){var t=this;this.mounted=!0,this.pinchLastCenterX=null,this.pinchLastCenterY=null,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){t.initializeWindowEvents()},this.unmount=function(){t.cleanupWindowEvents()},this.update=function(e){t.props=e,Lg(t,t.transformState.scale),t.setup=tv(e)},this.initializeWindowEvents=function(){var e,n,i=fv(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,i),null==r||r.addEventListener("mousedown",t.onPanningStart,i),null==r||r.addEventListener("mousemove",t.onPanning,i),null==r||r.addEventListener("mouseup",t.onPanningStop,i),null==o||o.addEventListener("mouseleave",t.clearPanning,i),null==r||r.addEventListener("keyup",t.setKeyUnPressed,i),null==r||r.addEventListener("keydown",t.setKeyPressed,i)},this.cleanupWindowEvents=function(){var e,n,i=fv(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null==r||r.removeEventListener("mousedown",t.onPanningStart,i),null==r||r.removeEventListener("mousemove",t.onPanning,i),null==r||r.removeEventListener("mouseup",t.onPanningStop,i),null==o||o.removeEventListener("mouseleave",t.clearPanning,i),null==r||r.removeEventListener("keyup",t.setKeyUnPressed,i),null==r||r.removeEventListener("keydown",t.setKeyPressed,i),document.removeEventListener("mouseleave",t.clearPanning,i),Bg(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=fv();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},this.handleInitialize=function(e){var n=t.setup.centerOnInit;t.applyTransformation(),t.onInitCallbacks.forEach((function(e){return e(hv(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,i=e.offsetWidth,o=e.offsetHeight;(i>0||o>0)&&(t.onInitCallbacks.forEach((function(e){return e(hv(t))})),t.setCenter(),null===(n=t.observer)||void 0===n||n.disconnect())})),setTimeout((function(){var e;null===(e=t.observer)||void 0===e||e.disconnect()}),5e3),t.observer.observe(e))},this.onWheelZoom=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.setup.wheel,i=n.disabled,o=n.wheelDisabled,r=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,c=e.isPanning,l=t.target;return!(!s||c||i||!l||o&&!t.ctrlKey||r&&t.ctrlKey||pv(l,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,i=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Bg(e),Eg(hv(e),t,i),Eg(hv(e),t,o))}(t,e),bv(t,e),Av(t,e))}},this.onWheelPanning=function(e){var n=t.setup,i=n.disabled,o=n.wheel,r=n.panning;if(t.wrapperComponent&&t.contentComponent&&!i&&o.wheelDisabled&&!r.disabled&&r.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,c=a.positionY,l=s-e.deltaX,u=c-e.deltaY,d=r.lockAxisX?s:l,m=r.lockAxisY?c:u,h=t.setup.alignmentAnimation,f=h.sizeX,p=h.sizeY,g=Vg(t,f),v=Vg(t,p);d===s&&m===c||Ng(t,d,m,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||Fg(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(0!==e.button||t.setup.panning.allowLeftClickPan)&&(1!==e.button||t.setup.panning.allowMiddleClickPan)&&(2!==e.button||t.setup.panning.allowRightClickPan)&&(e.preventDefault(),e.stopPropagation(),Bg(t),jg(t,e),Eg(hv(t),e,i))},this.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||Mg(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Ug(t,e.clientX,e.clientY),Eg(hv(t),e,i))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(Zg(t),Eg(hv(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinchingStart,r=i.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,i=n.disabled,o=n.excluded,r=e.isInitialized,a=t.target;return!(!r||i||!a||pv(a,o))}(t,e);a&&(function(e,t){var n=yv(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var i=Sv(t);e.pinchLastCenterX=i.x,e.pinchLastCenterY=i.y,Bg(e)}(t,e),Bg(t),Eg(hv(t),e,o),Eg(hv(t),e,r))}},this.onPinch=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinching,r=i.onZoom;if(!n){var a=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,i=e.pinchStartDistance;return!(!n||t||!i)}(t);a&&(e.preventDefault(),e.stopPropagation(),wv(t,e),Eg(hv(t),e,o),Eg(hv(t),e,r))}},this.onPinchStop=function(e){var n,i,o=t.props,r=o.onPinchingStop,a=o.onZoomStop;t.pinchStartScale&&(i=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,Yg(n,null==i?void 0:i.x,null==i?void 0:i.y),Eg(hv(t),e,r),Eg(hv(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&Fg(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Bg(t);var o=e.touches,r=1===o.length,a=2===o.length;r&&(Bg(t),jg(t,e),Eg(hv(t),e,i)),a&&t.onPinchStart(e)}},this.onTouchPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!Mg(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];Ug(t,o.clientX,o.clientY),Eg(hv(t),e,i)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.isInitialized,i=e.setup,o=e.wrapperComponent,r=i.doubleClick,a=r.disabled,s=r.excluded,c=t.target,l=null==o?void 0:o.contains(c);return!(!(n&&c&&l)||a||pv(c,s))}(t,e);n&&xv(t,e)}},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},this.setTransformState=function(e,n,i){var o=t.props.onTransformed;if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(i))console.error("Detected NaN set state values");else{e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=i,t.applyTransformation();var r=hv(t);t.onChangeCallbacks.forEach((function(e){return e(r)})),Eg(r,{scale:e,positionX:n,positionY:i},o)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=vv(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,i){return t.props.customTransform?t.props.customTransform(e,n,i):function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")}(e,n,i)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,i=e.positionX,o=e.positionY,r=t.handleTransformStyles(i,o,n);t.contentComponent.style.transform=r}},this.getContext=function(){return hv(t)},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,Lg(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var i=hv(t);Eg(i,void 0,t.props.onInit)},this.props=e,this.setup=tv(this.props),this.transformState=ev(this.props)},Bv=xo.default.createContext(null),Tv=xo.default.forwardRef((function(e,t){var n,i,o=Object(xo.useRef)(new Dv(e)).current,r=(n=e.children,i=dv(o),"function"==typeof n?n(i):n);return Object(xo.useImperativeHandle)(t,(function(){return dv(o)}),[o]),Object(xo.useEffect)((function(){o.update(e)}),[o,e]),xo.default.createElement(Bv.Provider,{value:o},r)}));xo.default.forwardRef((function(e,t){var n,i=Object(xo.useRef)(null),o=Object(xo.useContext)(Bv);return Object(xo.useEffect)((function(){return o.onChange((function(e){if(i.current){i.current.style.transform=o.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[o]),xo.default.createElement("div",Qg({},e,{ref:(n=[i,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var Iv="transform-component-module_wrapper__SPB86",kv="transform-component-module_content__FBWxo";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__SPB86 {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__FBWxo {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__FBWxo img {\n pointer-events: none;\n}\n");var Ov=function(e){var t=e.children,n=e.wrapperClass,i=void 0===n?"":n,o=e.contentClass,r=void 0===o?"":o,a=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,l=void 0===c?{}:c,u=e.contentProps,d=void 0===u?{}:u,m=Object(xo.useContext)(Bv),h=m.init,f=m.cleanupWindowEvents,p=Object(xo.useRef)(null),g=Object(xo.useRef)(null);return Object(xo.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&h&&(null==h||h(e,t)),function(){null==f||f()}}),[]),xo.default.createElement("div",Qg({},l,{ref:p,className:"react-transform-wrapper ".concat(Iv," ").concat(i),style:a}),xo.default.createElement("div",Qg({},d,{ref:g,className:"react-transform-component ".concat(kv," ").concat(r),style:s}),t))};function Lv(e){var t;const n=qh(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const i=e.config.closeButton;return xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(To.Box,{style:{touchAction:"none",backgroundColor:ko.b.getColorValue(e.config.overlayColor)}},xo.default.createElement(To.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},xo.default.createElement(jo,{onClick:e.onCloseButtonClick,visible:i.visible,text:i.text,background:i.background,foreground:i.foreground,ariaLabel:ko.b.getLocalizedText(i.accessibilityDescription),iconPosition:"right",icon:xo.default.createElement(Io.a,{style:{paddingLeft:4}})})),xo.default.createElement(Tv,{centerOnInit:!0},xo.default.createElement(Ov,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},xo.default.createElement(To.Box,{style:{width:"100%",height:`calc(100 *${Oo} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},xo.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var Pv=n(40);class _v{constructor(){this.disabled=!1,this.color="transparent"}}class Rv{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class Fv{constructor(){this.color="#1ec31e",this.width=4}}class Mv{constructor(){this.padding=10}}class Nv{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Vv{constructor(){this.width=2,this.color="white"}}class Wv{constructor(){this.size=20,this.color="white"}}class zv extends Pv.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Mv,this.style.magneticLines=new _v,this.style.polygon=new Fv,this.style.polygon.handles=new Rv,this.style.magnifier=new Nv,this.style.magnifier.border=new Vv,this.style.magnifier.crosshair=new Wv}static fromJson(e){const t=new zv;return this.mapValues(e,t,["style"]),e.style&&(this.mapValues(e.style,t.style,["polygon","magneticLines","magnifier"]),e.style.polygon&&(this.mapValues(e.style.polygon,t.style.polygon,["handles"]),e.style.polygon.handles&&this.mapValues(e.style.polygon.handles,t.style.polygon.handles)),e.style.magneticLines&&this.mapValues(e.style.magneticLines,t.style.magneticLines,[]),e.style.magnifier&&(this.mapValues(e.style.magnifier,t.style.magnifier,["border","crosshair"]),e.style.magnifier.border&&this.mapValues(e.style.magnifier.border,t.style.magnifier.border,[]),e.style.magnifier.crosshair&&this.mapValues(e.style.magnifier.crosshair,t.style.magnifier.crosshair,[]))),t}}class jv extends xo.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return xo.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},xo.default.createElement("line",{x1:e.start.x.toString(),y1:e.start.y.toString(),x2:e.end.x.toString(),y2:e.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(e,t,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var e,t,n,i,o,r;return xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.horizontal)||void 0===t?void 0:t.scaled)||void 0===n?void 0:n.map((e=>this.fromPoint(e))),null===(r=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===r?void 0:r.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,i;const o=this.props.movingLine;let r=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(o.isHorizontal&&(r=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!r||0===r.length)return;const a=this.midPoint(o.points[0].coordinates,o.points[1].coordinates),s=r.map((e=>({distance:this.distanceToLine(e,a),mLine:e})));s.sort(((e,t)=>e.distance-t.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:o})}distanceToLine(e,t){const n=t.x-e.start.x,i=t.y-e.start.y,o=e.end.x-e.start.x,r=e.end.y-e.start.y,a=o*o+r*r;if(0===a)return 1/0;const s=(n*o+i*r)/a;let c;return c=s<=0?e.start:s>=1?e.end:new fm.a(e.start.x+s*o,e.start.y+s*r),fm.a.distance(t,c)}midPoint(e,t){return new fm.a((e.x+t.x)/2,(e.y+t.y)/2)}}class Hv extends xo.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var e,t;return(null===(e=this.props.style)||void 0===e?void 0:e.size)?(null===(t=this.props)||void 0===t?void 0:t.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var e,t,n;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(e=this.props.style)||void 0===e?void 0:e.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(t=this.props.style)||void 0===t?void 0:t.color,position:"absolute",cursor:"pointer",zIndex:500,filter:null===(n=this.props.style)||void 0===n?void 0:n.filter}}nextIndex(e){return(e+1)%this.POINT_COUNT}previousIndex(e){return(e-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(e){return e%2==0}isOutOfBounds(e,t){return e<-this.DRAG_BUFFER||e>t+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class Uv extends Hv{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t],i=xo.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.cornerTouchStart(e,t),onPointerUp:e=>this.cornerTouchEnd(e),onPointerMove:e=>this.cornerTouchMove(e,t),"data-sb-cropping-corner":t},xo.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(i)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=fm.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=fm.a.fromHtmlElement(i);this.parentOffset=new fm.a(n.x-o.x,n.y-o.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=fm.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:i,y:o}=Object(bh.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new fm.a(i+r,o+r),Kf.isConvex(this.props.points)?this.props.cornerMoved({index:t,point:this.props.points[t]}):this.props.points[t]=a}cornerTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Zv extends Hv{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t];let i=this.props.points[this.nextIndex(t)];const o=xo.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(i.x-n.x)/2-this.pointSize/2+"px",top:n.y+(i.y-n.y)/2-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.lineTouchStart(e,t),onPointerMove:e=>this.lineTouchMove(e,t),onPointerUp:e=>this.lineTouchEnd(e),"data-sb-cropping-side":t},xo.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(o)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=fm.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=fm.a.fromHtmlElement(i),r=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=V.copy(this.props.points[this.previousIndex(t)]),this.point1Start=V.copy(r),this.point2Start=V.copy(a),this.point3Start=V.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new fm.a(r.x-o.x,r.y-o.y),this.point2Offset=new fm.a(a.x-o.x,a.y-o.y),this.parentOffset=new fm.a(n.x-o.x,n.y-o.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=fm.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(t)];let o=new fm.a(null,null),r=new fm.a(null,null);const a=this.props.points[this.nextIndex(t+1)],s=n.x-this.parentOffset.x,c=n.y-this.parentOffset.y;if(this.isHorizontal(t)){const e=c+this.point1Offset.y,t=c+this.point2Offset.y,n=e-this.point1Start.y;o.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),o.y=e,r.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;o.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),o.x=e,r.x=t}o=fm.a.clamp(o,this.props.containerSize),r=fm.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,o,i,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(i,o,r,a)||Kf.isConvex([i,o,r,a])&&(this.props.points[t].x=o.x,this.props.points[t].y=o.y,this.props.points[this.nextIndex(t)].x=r.x,this.props.points[this.nextIndex(t)].y=r.y,this.props.lineMoved({points:[{index:t,coordinates:o},{index:this.nextIndex(t),coordinates:r}],previousPoint:i,nextPoint:a,isHorizontal:this.isHorizontal(t)}))}lineTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null}isNearOpposingPoint(e,t,n,i){if(e[i]>n[i]){if(t[i]-10<n[i])return!0}else if(t[i]>n[i]-10)return!0;return!1}areEdgesCrossing(e,t,n,i){const o=e.x,r=e.y,a=t.x,s=t.y,c=n.x,l=n.y,u=i.x,d=i.y;return((o-c)*(s-l)-(r-l)*(a-c))*((o-u)*(s-d)-(r-d)*(a-u))<0&&((c-o)*(d-r)-(l-r)*(u-o))*((c-a)*(d-s)-(l-s)*(u-a))<0}render(){return xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class Gv extends xo.default.Component{render(){return xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},xo.default.createElement(Uv,{ref:e=>this.corners=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),xo.default.createElement(Zv,{ref:e=>this.lines=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let e=0;e<this.corners.POINT_COUNT;e++){const t=this.props.coordinatePoints[e];this.corners.items[e]&&(this.corners.items[e].style.left=t.x-this.corners.pointSize/2+"px",this.corners.items[e].style.top=t.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(e)];this.lines.items[e]&&(this.lines.items[e].style.left=t.x+(n.x-t.x)/2-this.corners.pointSize/2+"px",this.lines.items[e].style.top=t.y+(n.y-t.y)/2-this.corners.pointSize/2+"px")}}snapTo(e){const t=[e.polygonLine.previousPoint,e.polygonLine.points[0].coordinates],n=[e.polygonLine.points[1].coordinates,e.polygonLine.nextPoint],i=[e.magneticLine.start,e.magneticLine.end];this.props.coordinatePoints[e.polygonLine.points[0].index]=Kf.intersection(t,i),this.props.coordinatePoints[e.polygonLine.points[1].index]=Kf.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class Yv extends xo.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return xo.default.createElement("div",null,xo.default.createElement(Gv,{ref:e=>this.handles=e,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:e=>{this.setFrame(),this.props.cornerMoved(e)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:e=>{this.setFrame(),this.setState({movingLine:e})}}),xo.default.createElement(jv,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:e=>{var t,n;null===(t=this.handles)||void 0===t||t.snapTo(e),null===(n=this.polygon)||void 0===n||n.setFrame()}}),xo.default.createElement(Zf,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:e=>this.polygon=e}))}setFrame(){var e,t;null===(e=this.polygon)||void 0===e||e.setFrame(),null===(t=this.handles)||void 0===t||t.setFrame()}}class Qv extends xo.default.Component{render(){return xo.default.createElement("img",{ref:e=>this.image=e,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:e=>{e.target&&this.props.onImageLoaded(e.target)}})}}class qv extends xo.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:e,imageMargin:t,rotations:n,scale:i,duration:o}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=cr.b`
35
35
  from {transform: rotate(${r}deg) scale(${this.previousScale}); }
36
- to {transform: rotate(${a}deg) scale(${o});
37
- }`,l=Sn.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},Wt.default.createElement(l,{style:{width:this.calculate(e,"width"),height:this.calculate(e,"height"),transform:`rotate(${a}deg) scale(${o})`,marginTop:this.marginWithAspect(t,"y",e),marginLeft:this.marginWithAspect(t,"x",e)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(e,t,n){if(!e||!n)return 0;n.width,n.height;return e[t]}calculate(e,t){return e?e[t]:"100%"}}class dp extends Wt.default.Component{componentDidMount(){hu.disableScreenMovement()}componentWillUnmount(){hu.enableScreenMovement()}render(){return Wt.default.createElement("div",null)}}class hp{constructor(e,t){this.element=e,this.size=t}}class mp{}class fp extends Wt.default.Component{render(){return Wt.default.createElement("div",{style:this.props.style},Wt.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return Wt.default.createElement("line",{x1:e,y1:0,x2:e,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const e=this.half();return Wt.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class pp extends Wt.default.Component{get crosshairSize(){var e,t;return null===(t=null===(e=this.props.style)||void 0===e?void 0:e.crosshair)||void 0===t?void 0:t.size}constructor(e){super(e),this.MAX_ROTATIONS=4,this.state={frame:P.a.empty(),cropImageFitSize:eu.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?Wt.default.createElement("div",{style:this.style().container},Wt.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),Wt.default.createElement(fp,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(e){if(!this.state.visible)return;this.destination.src=e.source.element.src;const t=P.a.fromPoint(kc.a.scaleUpTo(e.origin,new eu.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=e.container.width-(this.props.style.margin+this.props.style.size),o=this.isPointTopLeft(e.origin,e.source.size,e.rotations);this.setState({frame:t,cropImageFitSize:e.source.size,rotation:{count:e.rotations,scale:e.scale},margin:{left:o?n:this.props.style.margin},container:{width:e.container.width},scale:{width:e.source.size.width/e.container.width,height:e.source.size.height/e.container.height}})}isPointTopLeft(e,t,n){const o=e.x,i=e.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>t.height-a:2===r?o>t.width-a&&i>t.height-a:o>t.width-a&&i<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var gp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class vp extends Wt.default.Component{constructor(e){super(e),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.sdk=e.sdk,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:eu.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:kc.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return gp(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(Wt.render)(Wt.default.createElement(vp,{sdk:t,onReady:o,onError:i,container:n,configuration:np.fromJson(e)}),n)}))}))}componentDidMount(){var e,t,n;return gp(this,void 0,void 0,(function*(){const o=null===(e=this.configuration)||void 0===e?void 0:e.image,i=yield this.sdk.detectAndCropDocument(o),r=yield F.toDataUrl(yield this.sdk.imageToJpeg(o));this.setState({documentDetectionResult:i,image:r,polygon:null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:i.pointsNormalized,magneticLines:{vertical:{original:i.verticalLinesNormalized},horizontal:{original:i.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return gp(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return gp(this,void 0,void 0,(function*(){eu.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new kc.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const o=new eu.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new eu.a(this.container.width(),this.container.height()),r=F.getObjectFitSize(i,o),a=new eu.a(r.width,r.height),s=null!=e?e:this.state.polygon,l=hu.convertToViewportPointsFromParentSize(a,s),c=null!=t?t:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=hu.convertLinesToViewportLines(a,c),h=hu.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var e,t,n,o,i,r;const a=rh.CLASSNAME,s=Qc()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return Wt.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&Wt.default.createElement(dp,null),Wt.default.createElement(pp,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),Wt.default.createElement(up,{ref:e=>this.container=e,size:this.state.calculatedSize,rotations:null===(t=this.state.animation)||void 0===t?void 0:t.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},Wt.default.createElement(cp,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),Wt.default.createElement(lp,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!0,(()=>{var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}))}updateMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}magnifierOptions(e){const t=new mp;return t.source=new hp(this.htmlImage,this.state.calculatedSize),t.container=new eu.a(this.container.width(),this.container.height()),t.origin=e.point,t.rotations=this.state.animation.rotations,t.scale=this.state.animation.scale,t}hideMagnifier(){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!1)}apply(){var e;return gp(this,void 0,void 0,(function*(){const t=kc.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),o=yield this.sdk.imageCrop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:yield this.sdk.imageRotate(o,n,"CONSUME_IMAGE"),polygon:t,rotations:this.rotations}}))}toCoreRotations(e){switch(e%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(e){return gp(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const t=this.calculateScale(this.rotations,e,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+e,scale:t,duration:1}})}))}detect(){return gp(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;0===e.pointsNormalized.length?this.resetPolygon():this.initializeSizes(e.pointsNormalized,e.horizontalLinesNormalized,e.verticalLinesNormalized)}))}resetPolygon(){const e=this.state.documentDetectionResult;this.initializeSizes([new kc.a(0,0),new kc.a(1,0),new kc.a(1,1),new kc.a(0,1)],e.horizontalLinesNormalized,e.verticalLinesNormalized)}dispose(){const{container:e}=this.props;if(!e)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(Wt.render)(null,e)}get rotations(){var e,t;const n=null===(e=this.state.animation)||void 0===e?void 0:e.rotations;return n&&0!==n?n:null!==(t=this.configuration.rotations)&&void 0!==t?t:0}get configuration(){return this._configuration||(this._configuration=np.fromJson(this.props.configuration)),this._configuration}calculateScale(e,t,n){return t?(e+t)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(e){return Math.min(this.container.width()/e.height,this.container.height()/e.width)}calculateMargin(e){return e.width>e.height?{x:0,y:this.container.height()/2-e.height/2}:{x:this.container.width()/2-e.width/2,y:0}}}var Cp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function bp(e){const t=e.config.screens.cropping,n=Wt.default.useRef(null),o=Wt.default.useRef(null),[i,r]=Wt.default.useState(!0),a=Object(Wt.useRef)(0),s=Wt.default.useRef(Promise.resolve());return Object(Wt.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>Cp(this,void 0,void 0,(function*(){r(!0);const i=yield e.page.cropData();if(!n.current)return;a.current=i.rotations;const s=yield vp.create({containerId:"sb-cropping-container",image:i.image,polygon:i.crop,rotations:i.rotations,style:{polygon:{color:Ht.b.getColorValue(t.croppingPolygonColor),handles:{color:Ht.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);o.current=s,r(!1)})))),()=>{s.current=s.current.then((()=>Cp(this,void 0,void 0,(function*(){var e;null===(e=o.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Uh,{open:i}),Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${Ut})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:Wt.default.createElement(tn,{ariaLabel:Ht.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,debugName:"cropping-screen-close",disabled:i}),centerTitle:t.topBarTitle,rightContent:Wt.default.createElement(tn,{ariaLabel:Ht.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>Cp(this,void 0,void 0,(function*(){if(!o.current)return void e.onCloseButtonClick();const t=o.current;r(!0);const n=kc.a.toPolygon(t.state.points,t.state.calculatedSize),i=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,i),r(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:i})}),Wt.default.createElement(zt.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},Wt.default.createElement(zt.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.detectButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>Cp(this,void 0,void 0,(function*(){var e;r(!0),yield null===(e=o.current)||void 0===e?void 0:e.detect(),r(!1)})),debugName:"retake"}),Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.rotateButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.resetButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var yp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Ap{get id(){return this.data.id}getData(){return this.data}constructor(e,t){this.document=e,this.data=t,this._finalImageUrl=null,this.data.rotations=t.rotations||0}sdk(){return eg.instance}getOriginalImage(){return yp(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}getPolygon(){var e;return 4===(null===(e=this.data.polygon)||void 0===e?void 0:e.length)?this.data.polygon:Ap.FULL_SIZE_POLYGON}cropData(){return yp(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.getOriginalImage()}}))}finalRawImage(){return yp(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.getOriginalImage();const t=this.document.data.documentImageSizeLimit;0!==t?(e=yield this.sdk().imageResize(e,t,"COPY_IMAGE"),e=yield this.sdk().imageCrop(e,this.getPolygon(),"CONSUME_IMAGE")):e=yield this.sdk().imageCrop(e,this.getPolygon(),"COPY_IMAGE");const n=this.data.filters||[];for(let t of n)e=yield this.sdk().imageFilter(e,t,"CONSUME_IMAGE");const o=Ap.ROTATIONS[this.data.rotations%4];e=yield this.sdk().imageRotate(e,o,"CONSUME_IMAGE");const i=yield this.sdk().storage.insertSBPageImage(e);return Dp._internal_updateProperty(this.data,"documentImageId",i),yield this.document.updateStorageDocument(),e}return yield this.sdk().storage.getSBPageImage(this.data.documentImageId)}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>yp(this,void 0,void 0,(function*(){const e=yield this.finalRawImage(),t=yield this.sdk().imageToJpeg(e,"CONSUME_IMAGE");return URL.createObjectURL(new Blob([t],{type:"image/jpeg"}))})))()),this._finalImageUrl}invalidateImage(){return yp(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),Dp._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}Ap.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Ap.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class Sp{constructor(e){this.name="SBStorageError",this.message=e}}var wp=n(6),Ep=n(41);class xp extends wp.a{constructor(e={}){super(),this.filters=null,this.polygon=[],this.documentDetectionStatus=null,this.documentQuality=null,this.source=null,this.id=null,this.originalImageId=null,this.documentImageId=null,this.unfilteredDocumentImageId=null,void 0!==e.filters&&(this.filters=null!=e.filters?e.filters.map((e=>Ep.a.From(e))):null),void 0!==e.polygon&&(this.polygon=e.polygon.map((e=>({x:e.x,y:e.y})))),void 0!==e.documentDetectionStatus&&(this.documentDetectionStatus=null!=e.documentDetectionStatus?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source?e.source:null),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.originalImageId&&(this.originalImageId=null!=e.originalImageId?e.originalImageId:null),void 0!==e.documentImageId&&(this.documentImageId=null!=e.documentImageId?e.documentImageId:null),void 0!==e.unfilteredDocumentImageId&&(this.unfilteredDocumentImageId=null!=e.unfilteredDocumentImageId?e.unfilteredDocumentImageId:null)}}class Bp extends wp.a{constructor(e={}){if(super(),this.documentImageSizeLimit=0,this.id=null,this.pdfId=null,this.tiffId=null,void 0===e.creationTimestamp)throw new Error("creationTimestamp must be present in constructor argument");if(this.creationTimestamp=e.creationTimestamp,void 0===e.pages)throw new Error("pages must be present in constructor argument");this.pages=e.pages.map((e=>new xp(e))),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.pdfId&&(this.pdfId=null!=e.pdfId?e.pdfId:null),void 0!==e.tiffId&&(this.tiffId=null!=e.tiffId?e.tiffId:null)}}class Ip extends Bp{constructor(){super(...arguments),this.pages=[]}}class Tp extends xp{}var kp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Op{get documentImageSizeLimit(){return this.configuration.outputSettings.documentImageSizeLimit}get cleanSession(){return this.configuration.cleanScanningSession}get filters(){const e=this.configuration.outputSettings;return e.defaultFilter?[e.defaultFilter]:[]}constructor(e){this.configuration=e.config,this.documentId=null==e?void 0:e.documentId}loadFromStorage(){return void 0!==this.documentId}}class Dp{getData(){return this.data}get isDraft(){return this.data.id===Dp.DOCUMENT_DRAFT_ID}constructor(e){var t;this._pages=[],this.data=e;for(let e=0;e<(null===(t=this.data.pages)||void 0===t?void 0:t.length);e++)this.syncPage(e)}syncPage(e){this._pages[e]=new Ap(this,this.data.pages[e])}get pages(){return this._pages}splicePage(e,t,...n){return this.data.pages.splice(e,t,...n),this._pages.splice(e,t,...n.map((e=>new Ap(this,e))))}sdk(){return eg.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}static loadFromStorage(e){return kp(this,void 0,void 0,(function*(){const t=yield eg.instance.storage.getSBDocument(e);if(void 0===t)throw new Sp("Document not found in database.");return new Dp(t)}))}static create(e){return kp(this,void 0,void 0,(function*(){const t=eg.instance;let n;if(e.loadFromStorage())n=yield Dp.loadFromStorage(e.documentId);else{const o=yield t.storage.getSBDocument(Dp.DOCUMENT_DRAFT_ID),i=void 0!==o;if(e.cleanSession&&i){for(const e of o.pages)yield t.storage.deleteImages(e);Dp._internal_updateProperty(o,"pages",[])}const r=i?o:new Ip({id:Dp.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new Dp(r)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return kp(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return kp(this,void 0,void 0,(function*(){yield this.sdk().storage.deleteSBDocument(this);for(const e of this.pages)yield this.sdk().storage.deleteImages(e)}))}addPage(e,t,n,o){return kp(this,void 0,void 0,(function*(){void 0===o&&(o=this.pages.length);const i=new Tp({id:Math.round(1e6*Math.random()),polygon:e.pointsNormalized,documentDetectionStatus:e.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),r=yield this.sdk().storage.insertSBPageImage(e.originalImage);Dp._internal_updateProperty(i,"originalImageId",r),this.splicePage(o,0,i),yield this.updateStorageDocument()}))}deleteFromPosition(e){return kp(this,void 0,void 0,(function*(){const t=this.splicePage(e,1);yield this.sdk().storage.deleteImages(t[0]),yield this.updateStorageDocument()}))}deletePage(e){return kp(this,void 0,void 0,(function*(){const t=this.pages.indexOf(e);if(-1===t)throw new Error("Page not found in document.");yield this.deleteFromPosition(t)}))}deleteAllPages(){return kp(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return kp(this,void 0,void 0,(function*(){const o=this.pageAtIndex(e);yield this.cropAndRotatePage(o,t,n)}))}cropAndRotatePage(e,t,n){return kp(this,void 0,void 0,(function*(){const o=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&Dp._internal_updateProperty(o,"polygon",t),null!=n&&(o.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){Dp._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return kp(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();Dp._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(Dp.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return kp(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertSBPageImage(e);return Dp._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return kp(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return kp(this,void 0,void 0,(function*(){const n=yield this.sdk().beginTiff(e);yield n.addPages(this,t);const o=yield n.complete();return yield this.saveRenderedTiff(o),o}))}loadPdf(){return kp(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return kp(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return kp(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(e)}))}saveRenderedPdf(e){return kp(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return kp(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}}Dp.DOCUMENT_DRAFT_ID=-1;var Lp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Pp(e){var t;Object(Wt.useMemo)((()=>{Ht.b.setPalette(e.configuration.palette),Ht.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=cd(),[o,i]=Object(Wt.useState)(null);Object(Wt.useEffect)((()=>{const t=new Op({config:e.configuration,documentId:e.documentId});Dp.create(t).then((t=>{var n;t instanceof Dp?i(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[r,a]=Wt.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===r.screen?r:null;return Object(Wt.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Zt,null),Wt.default.createElement(xh,null,Wt.default.createElement(Rh,{visible:"acknowledgment"===r.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,i)=>{if(!s)throw new Error("Internal error: Invalid routing state");let r;const l=[];if("insert back"===s.insertMode.name){const n=o.addPage(t.value,i,t.source);l.push(n),r=e.configuration.outputSettings.pagesScanLimit>0&&o.pages.length+1===e.configuration.outputSettings.pagesScanLimit?{screen:"review",position:o.pages.length+1}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=o.addPage(t.value,i,t.source,e);l.push(n),r={screen:"review",position:e},"replace"===s.insertMode.name&&l.push((()=>Lp(this,void 0,void 0,(function*(){yield o.deleteFromPosition(e),yield n})))())}Promise.all(l).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?r:e))}))},onReject:()=>{var e;return a({screen:"camera",insertMode:null!==(e=null==s?void 0:s.insertMode)&&void 0!==e?e:{name:"insert back"}})},onError:e.onError}),Wt.default.createElement(Eh,{visible:["camera","acknowledgment"].includes(r.screen),scanningPaused:"camera"!==r.screen||null===o,configuration:e.configuration,onClose:()=>Lp(this,void 0,void 0,(function*(){(null==o?void 0:o.isDraft)&&(yield o.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==r.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:r.insertMode})},onReviewButtonClick:()=>a({screen:"review",position:Math.max(0,o.pageCount-1)}),sdk:e.sdk,pages:null!==(t=null==o?void 0:o.pages)&&void 0!==t?t:[],scanLimitReached:(()=>{var t;return!(e.configuration.outputSettings.pagesScanLimit<=0)&&(("camera"!==r.screen||"replace"!==r.insertMode.name)&&(null===(t=null==o?void 0:o.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),Wt.default.createElement(Fm,{document:o,currentPosition:"review"===r.screen?r.position:null,visible:"review"===r.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>Lp(this,void 0,void 0,(function*(){const t=yield o.convertToFinalVersion(),n=new gd(t);e.onSubmit(n)})),onGoToPage:e=>{a({screen:"review",position:e})},onRetakeImage:e=>a({screen:"camera",insertMode:{name:"replace",position:e}}),onInsertImage:e=>a({screen:"camera",insertMode:{name:"insert at",position:e}}),onZoomButtonClick:e=>a({screen:"zoom",position:e}),onCropButtonClick:e=>a({screen:"crop",position:e})}),Wt.default.createElement(Qf,{visible:"zoom"===r.screen,page:"zoom"===r.screen?o.pageAtIndex(r.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===r.screen?r.position:0})}),Wt.default.createElement(bp,{sdk:e.sdk,page:"crop"===r.screen?o.pageAtIndex(r.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===r.screen?r.position:0}),onApplyCrop:(e,t)=>Lp(this,void 0,void 0,(function*(){if("crop"!==r.screen)throw new Error("Internal error: Invalid routing state");yield o.cropAndRotateAtIndex(r.position,e,t),a({screen:"review",position:r.position})}))})))}var _p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Rp{static createDocumentScanner(e,t){return new Promise(((n,o)=>{const{root:i,unmount:r}=this.createRoot(),a=e=>_p(this,void 0,void 0,(function*(){yield r(),o(e)}));i.render(Wt.default.createElement(Wt.default.StrictMode,null," ",Wt.default.createElement(Pp,{configuration:e,documentId:t,onClose:()=>_p(this,void 0,void 0,(function*(){yield r(),n(null)})),onSubmit:e=>_p(this,void 0,void 0,(function*(){yield r(),n(e)})),onError:a,sdk:eg.instance}))),this.checkLicense(a)}))}static createBarcodeScanner(e){return new Promise(((t,n)=>{gn.INSTANCE.initialize(e.sound);const{root:o,unmount:i}=this.createRoot(),r=e=>_p(this,void 0,void 0,(function*(){yield i(),n(e)}));o.render(Wt.default.createElement(pd,{configuration:e,onClose:()=>_p(this,void 0,void 0,(function*(){yield i(),t(null)})),onSubmit:e=>_p(this,void 0,void 0,(function*(){yield i(),t(e)})),onError:r})),this.checkLicense(r)}))}static createRoot(){const e=Rp.createContainer("barcode-scanner-controller"),t=Object(Nt.createRoot)(e);return{unmount:()=>_p(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static checkLicense(e){(()=>{_p(this,void 0,void 0,(function*(){try{const t=yield eg.instance.getLicenseInfo();t.isValid()||(yield e(new Pt(t)))}catch(t){yield e(t)}}))})()}static createContainer(e){const t=document.createElement("div");return t.id=e,t.style.position="fixed",t.style.width="100%",t.style.height=`calc(100 * ${Ut})`,t.style.zIndex="1000",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(t),t}}Rp.Config=Vt;var Fp=Rp,Mp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Wp{constructor(e,t){this._sdk=e,this._recognizer=t}recognize(e,t,n="COPY_IMAGE"){return Mp(this,void 0,void 0,(function*(){const o=this._sdk.getBridge(n);return yield o.documentDataExtractorExtract(this._recognizer,e,t)}))}release(){return Mp(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}class Np extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new p.MrzScannerConfiguration,this.onMrzDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){const t=new Np;return this.mapValues(e,t,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var Vp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class zp extends bn.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=Np.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e,t){return Vp(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(Wt.render)(Wt.default.createElement(zp,{container:n,configuration:e,onSuccess:o,onFailure:i,mrzRecognizer:t}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Vp(this,void 0,void 0,(function*(){du.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Mrz detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Vp(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Vp(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Vp(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,o,i;return Vp(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const o=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(zp.FRAME_RESOLUTION);if(!o)return;r&&this.forceUpdate();const i=yield this.props.mrzRecognizer.recognize(o,"CONSUME_IMAGE");if(!this.enabled)return;if(null===i)return;this.camera.reusableImageBuffer=null==i?void 0:i.originalImage.data,i.success?(delete i.originalImage,a=!0,this.configuration.onMrzDetected(i)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(i.originalImage))}catch(e){null===(i=(o=this.configuration).onError)||void 0===i||i.call(o,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){var e;return Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}zp.FRAME_RESOLUTION=1200;var jp=zp,Hp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class Up extends bn.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(e,t,n){return Hp(this,void 0,void 0,(function*(){const o=document.getElementById(e.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(Wt.render)(Wt.default.createElement(Up,{container:o,configuration:e,onTextDetected:t,onSuccess:i,onFailure:r,textPatternScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Hp(this,void 0,void 0,(function*(){du.warn("Text pattern detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Text pattern detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Hp(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textPatternScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Hp(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Hp(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textPatternScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var e,t,n,o;return Hp(this,void 0,void 0,(function*(){const i=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Up.FRAME_RESOLUTION);if(!n)return;i&&this.forceUpdate();const o=yield this.props.textPatternScanner.recognize(n);if(!this.enabled)return;if(null===o)return;o&&(r=!0,this.props.onTextDetected(o),this.camera.reusableImageBuffer=o.originalImage.data)}catch(e){null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,e)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var e;return Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Up.FRAME_RESOLUTION=1200;var Zp=Up,Gp=n(37),Qp=n(27);var Yp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Xp{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(53).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),o=new Blob([t],{type:"application/javascript"}),i=URL.createObjectURL(o);return new Worker(i)}(),this.worker.onmessage=e=>{const t=e.data,n=t.token;if(this.taskMap.has(n)){(0,this.taskMap.get(n).resolve)(t.data),this.taskMap.delete(n)}else console.error("Unknown token:",n)},this.worker.onerror=e=>{if(!e.error)return void console.log("SBSDK: Error event triggered, but no error present",e);if(!e.error.cause)return void console.error("SBSDK: Error event triggered, but no cause present",e.error);const t=e.error.cause.token;if(this.taskMap.has(t)){(0,this.taskMap.get(t).reject)(e.error),this.taskMap.delete(t)}else console.error("Unknown token:",t)}}generateUniqueToken(){return this.tokenCounter++,"token_"+this.tokenCounter+"_"+Math.random().toString(36).substr(2,9)}query(e){return Yp(this,void 0,void 0,(function*(){const t=this.generateUniqueToken();return this.worker.postMessage({token:t,query:e}),new Promise(((e,n)=>{this.taskMap.set(t,{resolve:e,reject:n})}))}))}}var Kp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class qp{constructor(){this.db=new Xp}clear(){return Kp(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return Kp(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return Kp(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResults"});if(!e)return t;const n=t.map((e=>e.id)),o=yield this.getCroppedDetectionResultImages(n);for(const e of t)this.mapImages(e,o);return t}))}getCroppedDetectionResult(e){return Kp(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResult",data:e}),n=yield this.getCroppedDetectionResultImage(e);return this.mapImages(t,n),t}))}mapImages(e,t){var n,o;e.originalImage=null===(n=t.find((t=>t.documentId===e.id&&"original"===t.type)))||void 0===n?void 0:n.data,e.croppedImage=null===(o=t.find((t=>t.documentId===e.id&&"cropped"===t.type)))||void 0===o?void 0:o.data}getCroppedDetectionResultImages(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){return Kp(this,void 0,void 0,(function*(){const t=Object.create(e);t.croppedImage=null,t.originalImage=null;const n=yield this.db.query({type:"storeCroppedDetectionResult",data:t}),o=[{documentId:n,data:e.originalImage,type:"original"},{documentId:n,data:e.croppedImage,type:"cropped"}];return yield this.db.query({type:"storeImages",data:o}),n}))}getSBDocumentIds(){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}insertSBDocument(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return Kp(this,void 0,void 0,(function*(){const t="number"==typeof e?e:e.getData().id;return yield this.db.query({type:"deleteSBDocument",data:t})}))}getSBDocument(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBPageImage(e){return Kp(this,void 0,void 0,(function*(){const t={image:e};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return Kp(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getSBPageImage",data:e})).image}))}deleteImageById(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return Kp(this,void 0,void 0,(function*(){const t=e instanceof Ap?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),t.unfilteredDocumentImageId&&n.push(t.unfilteredDocumentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}}var Jp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class $p{constructor(){this.storage=new qp}static get UI(){if(!A.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return $p._ui2}static initialize(e){var t;return Jp(this,void 0,void 0,(function*(){const n=new $p,o=e.enginePath||$p.defaultEnginePath,i=!!e.allowThreads,r=null!==(t=e.requestSuffix)&&void 0!==t?t:`?${n.version}`;if(!o)throw new Error("To initialize the ScanbotSDK, please specify the enginePath option. This option should specify the location of the accompanying WASM and JS files in the bundle folder. It can either point to your server or a CDN. Please note that this option has been renamed from engine -> enginePath recently. Please see our documentation for more details on how to set up the enginePath correctly.");const a=[e.licenseKey,o,window.location.hostname,"",{captureConsole:!1,allowThreads:i,requestSuffix:r}];return n.bridge=new I(o,{allowSimd:!0,allowThreads:i,requestSuffix:r},a),$p.instance=n,window.scanbotSdk=n,Mt.a.initialize(e.verboseLogging),e.allowThreads&&!Object(S.a)()&&(Mt.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&Mt.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==e?void 0:e.bestCameraDetectionStrategy),n}))}createDocumentScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{return t=yield gh.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){var t;return Jp(this,void 0,void 0,(function*(){let n;try{const o=new N(this,this.bridge.copyArgs.createMRZScanner(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}));return n=yield jp.create(e,o),yield this.licenseCheck(),n}catch(e){throw n&&n.dispose(),e}}))}createBarcodeScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{return t=yield fu.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield vp.create(e,this)}))}createTextPatternScanner(e){return Jp(this,void 0,void 0,(function*(){try{e=Dt.fromJson(e);const t=yield this.createTextPatternScannerView(e,e.onTextDetected,e.ocrConfiguration);return yield this.licenseCheck(),t}catch(e){throw e}}))}createVINScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{e=Lt.fromJson(e);const n=t=>{""!==t.rawText&&e.onTextDetected(t)},o=new h.TextPatternScannerConfiguration(Object.assign(Object.assign({},e.ocrConfiguration),{validator:new h.PresetContentValidator({preset:"VEHICLE_IDENTIFICATION_NUMBER"})}));return t=yield this.createTextPatternScannerView(e,n,o),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentDataExtractorScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{const o=n(54).default;return t=yield o.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return Jp(this,void 0,void 0,(function*(){return _t.throwIfMissingBuffer(e),yield F.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e);const o=yield this.bridge.copyArgs.createDocumentScanner(t),i=this.getBridge(n),r=yield i.documentScannerDetect(o,e);return yield this.release(o,"documentDetector"),r}))}detectAndCropDocument(e,t="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e);const n=this.getBridge(t);return yield n.detectAndCropDocument(e)}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e),"string"==typeof e&&(e=yield F.loadFromUrl(e));const o=Object.assign({},t);o.live=!1;const i=yield this.bridge.copyArgs.createBarcodeScanner(o),r=yield this.getBridge(n).scanBarcodes(i,e);return yield this.release(i,"barcodeRecognizer"),r}))}parseBarcodeDocument(e,t){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(e,t)}))}createSimpleMRZRecognizer(){return Jp(this,void 0,void 0,(function*(){const e=new p.MrzScannerConfiguration({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}});return new N(this,this.bridge.copyArgs.createMRZScanner(e))}))}createOcrEngine(){return Jp(this,void 0,void 0,(function*(){return new z(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(e={}){return Jp(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(e);return new Ft(this,t)}))}imageRotate(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageRotate(e,t)}))}imageFilter(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageApplyFilter(e,t)}))}imageCrop(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageCrop(e,t)}))}imageResize(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageResize(e,t)}))}getLicenseInfo(){return Jp(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.getLicenseInfo();return T.fromJson(e)}))}beginPdf(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new O(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new L(this,yield this.bridge.copyArgs.beginTiff(e))}))}createDocumentDataExtractor(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Wp(this,yield this.bridge.copyArgs.documentDataExtractorCreate(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return A.VERSION}get utils(){return this._utils||(this._utils=new M),this._utils}release(e,t){return Jp(this,void 0,void 0,(function*(){e&&(Mt.a.debug(`Releasing object ${null!=t?t:"unknown"}`),yield this.bridge.copyArgs.releaseObject(e))}))}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return Jp(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new Pt(e)}))}createTextPatternScannerView(e,t,n){return Jp(this,void 0,void 0,(function*(){const o=this.bridge.copyArgs.createTextPatternScanner(n),i=new H(this,o);return yield Zp.create(e,t,i)}))}destroy(){this.bridge.destroy(),$p.instance=void 0}}$p.defaultEnginePath="",$p._ui2=A.BUILD_WITH_UI?Fp:void 0,$p.cameras=Qp.a.INSTANCE,$p.Config=y,$p._stats=Gp.a.INSTANCE;var eg=t.a=$p},function(e,t,n){"use strict";var o=n(43),i=n.n(o)()((function(e){return e[1]}));i.push([e.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),t.a=i},function(e,t,n){"use strict";var o=n(43),i=n.n(o)()((function(e){return e[1]}));i.push([e.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),t.a=i},function(e,t){var n,o,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&m())}function m(){if(!u){var e=s(h);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,u=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||u||s(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(e){return{render(t){o(t,e)},unmount(){r(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return i(t,e),a(e)}},function(e,t){e.exports=function(e,t,n,o){var i=n?n.call(o,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){"use strict";function o(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,"a",(function(){return r}));var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=o((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ScanbotSDK",(function(){return o}));const o=n(44).a},function(e,t,n){"use strict";n.r(t),t.default="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiOwoKY29uc3QgREJfTkFNRSA9ICJTQlNES0Jhc2UiOwoKY29uc3QgU1RPUkVTID0gewogICAgQ1JPUFBFRF9ERVRFQ1RJT05fUkVTVUxUUzogImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIiwKICAgIFNCX0RPQ1VNRU5UUzogIlNCRG9jdW1lbnRzIiwKICAgIElNQUdFUzogImltYWdlcyIKfTsKCmZ1bmN0aW9uIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4gLyo6IHN0cmluZyovLCByZXF1ZXN0IC8qOiBJREJSZXF1ZXN0Ki8pIHsKICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGV2ZW50LnRhcmdldC5yZXN1bHQgfSk7CiAgICB9Owp9CgpmdW5jdGlvbiBvcGVuREIoKSAvKjogUHJvbWlzZTxJREJEYXRhYmFzZT4qL3sKICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CgogICAgICAgIC8qKiBOQiEgVXBkYXRlIHZlcnNpb24gd2hlbiBEQiBtb2RlbCBjaGFuZ2VzICovCiAgICAgICAgY29uc3QgREJfVkVSU0lPTiA9IDU7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IGluZGV4ZWREQi5vcGVuKERCX05BTUUsIERCX1ZFUlNJT04pOwoKICAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVzb2x2ZShldmVudC50YXJnZXRbInJlc3VsdCJdKTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgY29uc3QgY29kZSA9IGV2ZW50LnRhcmdldCA/IGV2ZW50LnRhcmdldFsiZXJyb3JDb2RlIl0gOiAiVW5rbm93biBlcnJvciBjb2RlIjsKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJFcnJvciBvcGVuaW5nIGRhdGFiYXNlOiAiICsgY29kZSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9udXBncmFkZW5lZWRlZCA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgLy8gVE9ETzogJ29udXBncmFkZW5lZWRlZCcgaXMgb25seSBjYWxsZWQgd2hlbiBGSVJTVCBvcGVuaW5nIHRoZSBkYXRhYmFzZQogICAgICAgICAgICAvLyAgQU5EIHdoZW4gdGhlIHZlcnNpb24gbnVtYmVyIGlzIGluY3JlYXNlZC4gV2hhdCBlbHNlIG5lZWRzIHRvIGJlIGRvbmUgaGVyZT8KICAgICAgICAgICAgY29uc3QgZGIgPSBldmVudC50YXJnZXQgLyogYXMgSURCT3BlbkRCUmVxdWVzdCovLnJlc3VsdDsKCiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgICAgICAgICAgY29uc3QgbmFtZSA9IFNUT1JFU1trZXldOwogICAgICAgICAgICAgICAgLy8gVE9ETyBjYW4ndCBqdXN0IGRlbGV0ZSBpbiBwcm9kdWN0aW9uLCBuZWVkIHRvIG1pZ3JhdGUgZGF0YQogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBkYi5kZWxldGVPYmplY3RTdG9yZShuYW1lKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgICAgLy8gQ2FuJ3QgZGVsZXRlIG9iamVjdCBzdG9yZSB0aGF0IGRvZXNuJ3QgZXhpc3QKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygiRXJyb3IgZGVsZXRpbmcgb2JqZWN0IHN0b3JlOiAiLCBuYW1lKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkYi5jcmVhdGVPYmplY3RTdG9yZShuYW1lLCB7IGtleVBhdGg6ICJpZCIsIGF1dG9JbmNyZW1lbnQ6IHRydWUgfSk7CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgfSk7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHN0b3JlTmFtZXMgLyo6IHN0cmluZ1tdKi8pIC8qOiBQcm9taXNlPElEQlRyYW5zYWN0aW9uPiovewogICAgY29uc3QgZGIgPSBhd2FpdCBvcGVuREIoKTsKICAgIC8vIFRPRE8gaXMgaXQgZXZlciBhY3R1YWxseSBuZWNlc3NhcnkgdG8gd2FpdCBmb3IgYSB0cmFuc2FjdGlvbidzICdvbmNvbXBsZXRlJyBldmVudD8KICAgIHJldHVybiBkYi50cmFuc2FjdGlvbihzdG9yZU5hbWVzLCAicmVhZHdyaXRlIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFN0b3JlKG5hbWUgLyo6IHN0cmluZyovKSAvKjogUHJvbWlzZTxJREJPYmplY3RTdG9yZT4qL3sKICAgIGNvbnN0IHRyYW5zYWN0aW9uID0gYXdhaXQgZ2V0VHJhbnNhY3Rpb24oW25hbWVdKTsKICAgIHJldHVybiB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShuYW1lKTsKfQoKYXN5bmMgZnVuY3Rpb24gZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldEltYWdlc1N0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImltYWdlcyIpOwp9Cgphc3luYyBmdW5jdGlvbiBjbGVhcigpIHsKICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgIGNvbnN0IG5hbWUgPSBTVE9SRVNba2V5XTsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKG5hbWUpOwogICAgICAgIHN0b3JlLmNsZWFyKCk7CiAgICB9Cn0KCmFzeW5jIGZ1bmN0aW9uIGRlbGV0ZURCKCkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gaW5kZXhlZERCLmRlbGV0ZURhdGFiYXNlKERCX05BTUUpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICByZXNvbHZlKGV2ZW50KTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVqZWN0KGV2ZW50KTsKICAgICAgICB9OwogICAgfSk7Cn0KCmZ1bmN0aW9uIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgbWVzc2FnZSkgewogICAgdGhyb3cgbmV3IEVycm9yKCJTQkluZGV4ZWREQiB3b3JrZXIgZXJyb3I6ICIgKyBKU09OLnN0cmluZ2lmeSh7CiAgICAgICAgInRva2VuIjogdG9rZW4sCiAgICAgICAgInF1ZXJ5IjogcXVlcnksCiAgICAgICAgIm1lc3NhZ2UiOiBtZXNzYWdlCiAgICB9KSk7Cn0KCnNlbGYub25tZXNzYWdlID0gYXN5bmMgKGV2ZW50IC8qOiBNZXNzYWdlRXZlbnQqLykgPT4gewoKICAgIGNvbnN0IHRva2VuID0gZXZlbnQuZGF0YS50b2tlbjsKICAgIGNvbnN0IHF1ZXJ5ID0gZXZlbnQuZGF0YS5xdWVyeTsKCiAgICB0cnkgewogICAgICAgIGlmIChxdWVyeS50eXBlID09PSAnY2xlYXInKSB7CiAgICAgICAgICAgIGF3YWl0IGNsZWFyKCk7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZGVsZXRlJykgewogICAgICAgICAgICBhd2FpdCBkZWxldGVEQigpOwogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gJ3N0b3JlQ3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmFkZChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdHMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGwoKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnc3RvcmVJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IGltYWdlcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgZm9yIChjb25zdCBpbWFnZSBvZiBpbWFnZXMpIHsKICAgICAgICAgICAgICAgIHN0b3JlLmFkZChpbWFnZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgZG9jdW1lbnRJZHMgPSBxdWVyeS5kYXRhOwogICAgICAgICAgICAvLyBUT0RPIGdldCBmcm9tIHN0b3JlIGJ5IGZvcmVpZ24ga2V5PwogICAgICAgICAgICBzdG9yZS5nZXRBbGwoKS5vbnN1Y2Nlc3MgPSBldmVudCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBpbWFnZXMgPSBldmVudC50YXJnZXQucmVzdWx0OwogICAgICAgICAgICAgICAgY29uc3QgZmlsdGVyZWRJbWFnZXMgPSBpbWFnZXMuZmlsdGVyKGltYWdlID0+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGZpbHRlcmVkSW1hZ2VzIH0pOwogICAgICAgICAgICB9OwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGxLZXlzKCk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShxdWVyeS5kYXRhKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCByZXF1ZXN0KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLnB1dChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JQYWdlSW1hZ2UiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgaWRzID0gcXVlcnkuZGF0YTsKICAgICAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShpZCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJVbmtub3duIHF1ZXJ5IHR5cGUiKTsKICAgICAgICB9CiAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgIGNvbnNvbGUubG9nKCJFcnJvciBpbiBTQkluZGV4ZWREQiB3b3JrZXI6ICIsIGVycm9yKTsKICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksIGVycm9yLm1lc3NhZ2UgfHwgZXJyb3IpOwogICAgfQp9Ow=="},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var o=n(0),i=n(12),r=n(14),a=n(22);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(e){const t=new s;return this.mapValues(e,t,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var l=n(25),c=n(24),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};i.a;class d extends i.c{constructor(e){super(e),this.enabled=!0,this.configuration=e.configuration}static create(e,t){var n;return u(this,void 0,void 0,(function*(){const i=null!==(n=t.container)&&void 0!==n?n:document.getElementById(t.containerId);if(t=s.fromJson(t),!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(o.render)(o.default.createElement(d,{container:i,configuration:t,onSuccess:n,onFailure:r,sdk:e}),i)}))}))}componentDidMount(){var e,t;super.componentDidMount();try{this.documentDataExtractor=this.props.sdk.createDocumentDataExtractor(this.configuration.detectorParameters)}catch(n){null===(t=(e=this.configuration).onError)||void 0===t||t.call(e,n)}this.detect()}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return u(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.documentDataExtractor).release()}))}detect(){var e,t,n,o,r,a;return u(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const r=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(i.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.documentDataExtractor).recognize(r,{mode:"LIVE"},"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(o=(n=this.configuration).onDocumentDetected)||void 0===o||o.call(n,a)}catch(e){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var e;const t=this.configuration;return o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},o.default.createElement(l.a,{key:"camera",configuration:this.configuration,videoConstraints:t.videoConstraints,mirrored:t.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&o.default.createElement(c.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(e,t,n){"use strict";n.r(t);var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=i}])}));
36
+ to {transform: rotate(${a}deg) scale(${i});
37
+ }`,c=cr.a.div`position: absolute; animation: ${s} ${o}s;`;return this.previousScale=i,xo.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},xo.default.createElement(c,{style:{width:this.calculate(e,"width"),height:this.calculate(e,"height"),transform:`rotate(${a}deg) scale(${i})`,marginTop:this.marginWithAspect(t,"y",e),marginLeft:this.marginWithAspect(t,"x",e)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(e,t,n){if(!e||!n)return 0;n.width,n.height;return e[t]}calculate(e,t){return e?e[t]:"100%"}}class Xv extends xo.default.Component{componentDidMount(){Km.disableScreenMovement()}componentWillUnmount(){Km.enableScreenMovement()}render(){return xo.default.createElement("div",null)}}class Kv{constructor(e,t){this.element=e,this.size=t}}class Jv{}class $v extends xo.default.Component{render(){return xo.default.createElement("div",{style:this.props.style},xo.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return xo.default.createElement("line",{x1:e,y1:0,x2:e,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const e=this.half();return xo.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class eC extends xo.default.Component{get crosshairSize(){var e,t;return null===(t=null===(e=this.props.style)||void 0===e?void 0:e.crosshair)||void 0===t?void 0:t.size}constructor(e){super(e),this.MAX_ROTATIONS=4,this.state={frame:N.a.empty(),cropImageFitSize:Vm.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?xo.default.createElement("div",{style:this.style().container},xo.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),xo.default.createElement($v,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(e){if(!this.state.visible)return;this.destination.src=e.source.element.src;const t=N.a.fromPoint(fm.a.scaleUpTo(e.origin,new Vm.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=e.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(e.origin,e.source.size,e.rotations);this.setState({frame:t,cropImageFitSize:e.source.size,rotation:{count:e.rotations,scale:e.scale},margin:{left:i?n:this.props.style.margin},container:{width:e.container.width},scale:{width:e.source.size.width/e.container.width,height:e.source.size.height/e.container.height}})}isPointTopLeft(e,t,n){const i=e.x,o=e.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?i<a&&o<a:1===r?i<a&&o>t.height-a:2===r?i>t.width-a&&o>t.height-a:i>t.width-a&&o<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var tC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class nC extends xo.default.Component{constructor(e){super(e),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.sdk=e.sdk,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:Vm.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:fm.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return tC(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(xo.render)(xo.default.createElement(nC,{sdk:t,onReady:i,onError:o,container:n,configuration:zv.fromJson(e)}),n)}))}))}componentDidMount(){var e,t,n;return tC(this,void 0,void 0,(function*(){const i=null===(e=this.configuration)||void 0===e?void 0:e.image,o=yield this.sdk.detectAndCropDocument(i),r=yield z.toDataUrl(yield this.sdk.imageToJpeg(i));this.setState({documentDetectionResult:o,image:r,polygon:null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:o.pointsNormalized,magneticLines:{vertical:{original:o.verticalLinesNormalized},horizontal:{original:o.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return tC(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return tC(this,void 0,void 0,(function*(){Vm.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new fm.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const i=new Vm.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new Vm.a(this.container.width(),this.container.height()),r=z.getObjectFitSize(o,i),a=new Vm.a(r.width,r.height),s=null!=e?e:this.state.polygon,c=Km.convertToViewportPointsFromParentSize(a,s),l=null!=t?t:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=Km.convertLinesToViewportLines(a,l),m=Km.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:c,magneticLines:{horizontal:{original:l,scaled:d},vertical:{original:u,scaled:m}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var e,t,n,i,o,r;const a=Zf.CLASSNAME,s=Lm()({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,l=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?c/this.state.animation.scale:c,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return xo.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},xo.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&xo.default.createElement(Xv,null),xo.default.createElement(eC,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),xo.default.createElement(qv,{ref:e=>this.container=e,size:this.state.calculatedSize,rotations:null===(t=this.state.animation)||void 0===t?void 0:t.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(i=this.state.animation)||void 0===i?void 0:i.duration,imageMargin:this.state.imageMargin},xo.default.createElement(Qv,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),xo.default.createElement(Yv,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${l}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(o=this.state.animation)||void 0===o?void 0:o.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!0,(()=>{var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}))}updateMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}magnifierOptions(e){const t=new Jv;return t.source=new Kv(this.htmlImage,this.state.calculatedSize),t.container=new Vm.a(this.container.width(),this.container.height()),t.origin=e.point,t.rotations=this.state.animation.rotations,t.scale=this.state.animation.scale,t}hideMagnifier(){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!1)}apply(){var e;return tC(this,void 0,void 0,(function*(){const t=fm.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield this.sdk.imageCrop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:yield this.sdk.imageRotate(i,n,"CONSUME_IMAGE"),polygon:t,rotations:this.rotations}}))}toCoreRotations(e){switch(e%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(e){return tC(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const t=this.calculateScale(this.rotations,e,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+e,scale:t,duration:1}})}))}detect(){return tC(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;0===e.pointsNormalized.length?this.resetPolygon():this.initializeSizes(e.pointsNormalized,e.horizontalLinesNormalized,e.verticalLinesNormalized)}))}resetPolygon(){const e=this.state.documentDetectionResult;this.initializeSizes([new fm.a(0,0),new fm.a(1,0),new fm.a(1,1),new fm.a(0,1)],e.horizontalLinesNormalized,e.verticalLinesNormalized)}dispose(){const{container:e}=this.props;if(!e)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(xo.render)(null,e)}get rotations(){var e,t;const n=null===(e=this.state.animation)||void 0===e?void 0:e.rotations;return n&&0!==n?n:null!==(t=this.configuration.rotations)&&void 0!==t?t:0}get configuration(){return this._configuration||(this._configuration=zv.fromJson(this.props.configuration)),this._configuration}calculateScale(e,t,n){return t?(e+t)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(e){return Math.min(this.container.width()/e.height,this.container.height()/e.width)}calculateMargin(e){return e.width>e.height?{x:0,y:this.container.height()/2-e.height/2}:{x:this.container.width()/2-e.width/2,y:0}}}var iC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function oC(e){const t=e.config.screens.cropping,n=xo.default.useRef(null),i=xo.default.useRef(null),[o,r]=xo.default.useState(!0),a=Object(xo.useRef)(0),s=xo.default.useRef(Promise.resolve());return Object(xo.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>iC(this,void 0,void 0,(function*(){r(!0);const o=yield e.page.cropData();if(!n.current)return;a.current=o.rotations;const s=yield nC.create({containerId:"sb-cropping-container",image:o.image,polygon:o.crop,rotations:o.rotations,style:{polygon:{color:ko.b.getColorValue(t.croppingPolygonColor),handles:{color:ko.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);i.current=s,r(!1)})))),()=>{s.current=s.current.then((()=>iC(this,void 0,void 0,(function*(){var e;null===(e=i.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(kp,{open:o}),xo.default.createElement(To.Box,{style:{backgroundColor:ko.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${Oo})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},xo.default.createElement(mf,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:xo.default.createElement(jo,{ariaLabel:ko.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,debugName:"cropping-screen-close",disabled:o}),centerTitle:t.topBarTitle,rightContent:xo.default.createElement(jo,{ariaLabel:ko.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>iC(this,void 0,void 0,(function*(){if(!i.current)return void e.onCloseButtonClick();const t=i.current;r(!0);const n=fm.a.toPolygon(t.state.points,t.state.calculatedSize),o=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,o),r(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:o})}),xo.default.createElement(To.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),xo.default.createElement(To.Box,{style:{backgroundColor:ko.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},xo.default.createElement(To.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},xo.default.createElement(Vo,{enabled:!o,config:t.bottomBar.detectButton,icon:({color:e})=>xo.default.createElement(Io.a,{style:{color:e}}),onClick:()=>iC(this,void 0,void 0,(function*(){var e;r(!0),yield null===(e=i.current)||void 0===e?void 0:e.detect(),r(!1)})),debugName:"retake"}),xo.default.createElement(Vo,{enabled:!o,config:t.bottomBar.rotateButton,icon:({color:e})=>xo.default.createElement(Io.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),xo.default.createElement(Vo,{enabled:!o,config:t.bottomBar.resetButton,icon:({color:e})=>xo.default.createElement(Io.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var rC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class aC{get id(){return this.data.id}getData(){return this.data}constructor(e,t){this.document=e,this.data=t,this._finalImageUrl=null,this.data.rotations=t.rotations||0}sdk(){return zC.instance}getOriginalImage(){return rC(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}getPolygon(){var e;return 4===(null===(e=this.data.polygon)||void 0===e?void 0:e.length)?this.data.polygon:aC.FULL_SIZE_POLYGON}cropData(){return rC(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.getOriginalImage()}}))}finalRawImage(){return rC(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.getOriginalImage();const t=this.document.data.documentImageSizeLimit;0!==t?(e=yield this.sdk().imageResize(e,t,"COPY_IMAGE"),e=yield this.sdk().imageCrop(e,this.getPolygon(),"CONSUME_IMAGE")):e=yield this.sdk().imageCrop(e,this.getPolygon(),"COPY_IMAGE");const n=this.data.filters||[];for(let t of n)e=yield this.sdk().imageFilter(e,t,"CONSUME_IMAGE");const i=aC.ROTATIONS[this.data.rotations%4];e=yield this.sdk().imageRotate(e,i,"CONSUME_IMAGE");const o=yield this.sdk().storage.insertSBPageImage(e);return gC._internal_updateProperty(this.data,"documentImageId",o),yield this.document.updateStorageDocument(),e}return yield this.sdk().storage.getSBPageImage(this.data.documentImageId)}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>rC(this,void 0,void 0,(function*(){const e=yield this.finalRawImage(),t=yield this.sdk().imageToJpeg(e,"CONSUME_IMAGE");return URL.createObjectURL(new Blob([t],{type:"image/jpeg"}))})))()),this._finalImageUrl}invalidateImage(){return rC(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),gC._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}aC.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],aC.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class sC{constructor(e){this.name="SBStorageError",this.message=e}}var cC=n(6),lC=n(41);class uC extends cC.a{constructor(e={}){super(),this.filters=null,this.polygon=[],this.documentDetectionStatus=null,this.documentQuality=null,this.source=null,this.id=null,this.originalImageId=null,this.documentImageId=null,this.unfilteredDocumentImageId=null,void 0!==e.filters&&(this.filters=null!=e.filters?e.filters.map((e=>lC.a.From(e))):null),void 0!==e.polygon&&(this.polygon=e.polygon.map((e=>({x:e.x,y:e.y})))),void 0!==e.documentDetectionStatus&&(this.documentDetectionStatus=null!=e.documentDetectionStatus?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source?e.source:null),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.originalImageId&&(this.originalImageId=null!=e.originalImageId?e.originalImageId:null),void 0!==e.documentImageId&&(this.documentImageId=null!=e.documentImageId?e.documentImageId:null),void 0!==e.unfilteredDocumentImageId&&(this.unfilteredDocumentImageId=null!=e.unfilteredDocumentImageId?e.unfilteredDocumentImageId:null)}}class dC extends cC.a{constructor(e={}){if(super(),this.documentImageSizeLimit=0,this.id=null,this.pdfId=null,this.tiffId=null,void 0===e.creationTimestamp)throw new Error("creationTimestamp must be present in constructor argument");if(this.creationTimestamp=e.creationTimestamp,void 0===e.pages)throw new Error("pages must be present in constructor argument");this.pages=e.pages.map((e=>new uC(e))),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.pdfId&&(this.pdfId=null!=e.pdfId?e.pdfId:null),void 0!==e.tiffId&&(this.tiffId=null!=e.tiffId?e.tiffId:null)}}class mC extends dC{constructor(){super(...arguments),this.pages=[]}}class hC extends uC{}var fC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class pC{get documentImageSizeLimit(){return this.configuration.outputSettings.documentImageSizeLimit}get cleanSession(){return this.configuration.cleanScanningSession}get filters(){const e=this.configuration.outputSettings;return e.defaultFilter?[e.defaultFilter]:[]}constructor(e){this.configuration=e.config,this.documentId=null==e?void 0:e.documentId}loadFromStorage(){return void 0!==this.documentId}}class gC{getData(){return this.data}get isDraft(){return this.data.id===gC.DOCUMENT_DRAFT_ID}constructor(e){var t;this._pages=[],this.data=e;for(let e=0;e<(null===(t=this.data.pages)||void 0===t?void 0:t.length);e++)this.syncPage(e)}syncPage(e){this._pages[e]=new aC(this,this.data.pages[e])}get pages(){return this._pages}splicePage(e,t,...n){return this.data.pages.splice(e,t,...n),this._pages.splice(e,t,...n.map((e=>new aC(this,e))))}sdk(){return zC.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}static loadFromStorage(e){return fC(this,void 0,void 0,(function*(){const t=yield zC.instance.storage.getSBDocument(e);if(void 0===t)throw new sC("Document not found in database.");return new gC(t)}))}static create(e){return fC(this,void 0,void 0,(function*(){const t=zC.instance;let n;if(e.loadFromStorage())n=yield gC.loadFromStorage(e.documentId);else{const i=yield t.storage.getSBDocument(gC.DOCUMENT_DRAFT_ID),o=void 0!==i;if(e.cleanSession&&o){for(const e of i.pages)yield t.storage.deleteImages(e);gC._internal_updateProperty(i,"pages",[])}const r=o?i:new mC({id:gC.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new gC(r)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return fC(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return fC(this,void 0,void 0,(function*(){yield this.sdk().storage.deleteSBDocument(this);for(const e of this.pages)yield this.sdk().storage.deleteImages(e)}))}addPage(e,t,n,i){return fC(this,void 0,void 0,(function*(){void 0===i&&(i=this.pages.length);const o=new hC({id:Math.round(1e6*Math.random()),polygon:e.pointsNormalized,documentDetectionStatus:e.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),r=yield this.sdk().storage.insertSBPageImage(e.originalImage);gC._internal_updateProperty(o,"originalImageId",r),this.splicePage(i,0,o),yield this.updateStorageDocument()}))}deleteFromPosition(e){return fC(this,void 0,void 0,(function*(){const t=this.splicePage(e,1);yield this.sdk().storage.deleteImages(t[0]),yield this.updateStorageDocument()}))}deletePage(e){return fC(this,void 0,void 0,(function*(){const t=this.pages.indexOf(e);if(-1===t)throw new Error("Page not found in document.");yield this.deleteFromPosition(t)}))}deleteAllPages(){return fC(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return fC(this,void 0,void 0,(function*(){const i=this.pageAtIndex(e);yield this.cropAndRotatePage(i,t,n)}))}cropAndRotatePage(e,t,n){return fC(this,void 0,void 0,(function*(){const i=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&gC._internal_updateProperty(i,"polygon",t),null!=n&&(i.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){gC._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return fC(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();gC._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(gC.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return fC(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertSBPageImage(e);return gC._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return fC(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return fC(this,void 0,void 0,(function*(){const n=yield this.sdk().beginTiff(e);yield n.addPages(this,t);const i=yield n.complete();return yield this.saveRenderedTiff(i),i}))}loadPdf(){return fC(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return fC(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return fC(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(e)}))}saveRenderedPdf(e){return fC(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return fC(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}}gC.DOCUMENT_DRAFT_ID=-1;var vC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function CC(e){var t;Object(xo.useMemo)((()=>{ko.b.setPalette(e.configuration.palette),ko.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=Qh(),[i,o]=Object(xo.useState)(null);Object(xo.useEffect)((()=>{const t=new pC({config:e.configuration,documentId:e.documentId});gC.create(t).then((t=>{var n;t instanceof gC?o(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[r,a]=xo.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===r.screen?r:null;return Object(xo.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),xo.default.createElement(xo.default.Fragment,null,xo.default.createElement(Lo,null),xo.default.createElement(dp,null,xo.default.createElement(Ap,{visible:"acknowledgment"===r.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,o)=>{if(!s)throw new Error("Internal error: Invalid routing state");let r;const c=[];if("insert back"===s.insertMode.name){const n=i.addPage(t.value,o,t.source);c.push(n),r=e.configuration.outputSettings.pagesScanLimit>0&&i.pages.length+1===e.configuration.outputSettings.pagesScanLimit?{screen:"review",position:i.pages.length+1}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=i.addPage(t.value,o,t.source,e);c.push(n),r={screen:"review",position:e},"replace"===s.insertMode.name&&c.push((()=>vC(this,void 0,void 0,(function*(){yield i.deleteFromPosition(e),yield n})))())}Promise.all(c).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?r:e))}))},onReject:()=>{var e;return a({screen:"camera",insertMode:null!==(e=null==s?void 0:s.insertMode)&&void 0!==e?e:{name:"insert back"}})},onError:e.onError}),xo.default.createElement(up,{visible:["camera","acknowledgment"].includes(r.screen),scanningPaused:"camera"!==r.screen||null===i,configuration:e.configuration,onClose:()=>vC(this,void 0,void 0,(function*(){(null==i?void 0:i.isDraft)&&(yield i.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==r.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:r.insertMode})},onReviewButtonClick:()=>a({screen:"review",position:Math.max(0,i.pageCount-1)}),sdk:e.sdk,pages:null!==(t=null==i?void 0:i.pages)&&void 0!==t?t:[],scanLimitReached:(()=>{var t;return!(e.configuration.outputSettings.pagesScanLimit<=0)&&(("camera"!==r.screen||"replace"!==r.insertMode.name)&&(null===(t=null==i?void 0:i.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),xo.default.createElement(Sg,{document:i,currentPosition:"review"===r.screen?r.position:null,visible:"review"===r.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>vC(this,void 0,void 0,(function*(){const t=yield i.convertToFinalVersion(),n=new tf(t);e.onSubmit(n)})),onGoToPage:e=>{a({screen:"review",position:e})},onRetakeImage:e=>a({screen:"camera",insertMode:{name:"replace",position:e}}),onInsertImage:e=>a({screen:"camera",insertMode:{name:"insert at",position:e}}),onZoomButtonClick:e=>a({screen:"zoom",position:e}),onCropButtonClick:e=>a({screen:"crop",position:e})}),xo.default.createElement(Lv,{visible:"zoom"===r.screen,page:"zoom"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===r.screen?r.position:0})}),xo.default.createElement(oC,{sdk:e.sdk,page:"crop"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===r.screen?r.position:0}),onApplyCrop:(e,t)=>vC(this,void 0,void 0,(function*(){if("crop"!==r.screen)throw new Error("Internal error: Invalid routing state");yield i.cropAndRotateAtIndex(r.position,e,t),a({screen:"review",position:r.position})}))})))}var yC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class bC{static createDocumentScanner(e,t){return new Promise(((n,i)=>{const{root:o,unmount:r}=this.createRoot(),a=e=>yC(this,void 0,void 0,(function*(){yield r(),i(e)}));o.render(xo.default.createElement(xo.default.StrictMode,null," ",xo.default.createElement(CC,{configuration:e,documentId:t,onClose:()=>yC(this,void 0,void 0,(function*(){yield r(),n(null)})),onSubmit:e=>yC(this,void 0,void 0,(function*(){yield r(),n(e)})),onError:a,sdk:zC.instance}))),this.checkLicense(a)}))}static createBarcodeScanner(e){return new Promise(((t,n)=>{nr.INSTANCE.initialize(e.sound);const{root:i,unmount:o}=this.createRoot(),r=e=>yC(this,void 0,void 0,(function*(){yield o(),n(e)}));i.render(xo.default.createElement(ef,{configuration:e,onClose:()=>yC(this,void 0,void 0,(function*(){yield o(),t(null)})),onSubmit:e=>yC(this,void 0,void 0,(function*(){yield o(),t(e)})),onError:r})),this.checkLicense(r)}))}static createRoot(){const e=bC.createContainer("barcode-scanner-controller"),t=Object(Do.createRoot)(e);return{unmount:()=>yC(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static checkLicense(e){(()=>{yC(this,void 0,void 0,(function*(){try{const t=yield zC.instance.getLicenseInfo();t.isValid()||(yield e(new bo(t)))}catch(t){yield e(t)}}))})()}static createContainer(e){const t=document.createElement("div");return t.id=e,t.style.position="fixed",t.style.width="100%",t.style.height=`calc(100 * ${Oo})`,t.style.zIndex="1000",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(t),t}}bC.Config=Bo;var AC=bC,SC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class wC{constructor(e,t){this._sdk=e,this._recognizer=t}recognize(e,t,n="COPY_IMAGE"){return SC(this,void 0,void 0,(function*(){const i=this._sdk.getBridge(n);return yield i.documentDataExtractorExtract(this._recognizer,e,t)}))}release(){return SC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}class EC extends X.a{constructor(){super(q.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new p.MrzScannerConfiguration,this.onMrzDetected=function(e){},this.finder.aspectRatio=new ce.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){const t=new EC;return this.mapValues(e,t,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var xC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};rr.a;rr.b;class DC extends rr.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=EC.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e,t){return xC(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(xo.render)(xo.default.createElement(DC,{container:n,configuration:e,onSuccess:i,onFailure:o,mrzRecognizer:t}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return xC(this,void 0,void 0,(function*(){Xm.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){Xm.warn("Mrz detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return xC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return xC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return xC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return xC(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(DC.FRAME_RESOLUTION);if(!i)return;r&&this.forceUpdate();const o=yield this.props.mrzRecognizer.recognize(i,"CONSUME_IMAGE");if(!this.enabled)return;if(null===o)return;this.camera.reusableImageBuffer=null==o?void 0:o.originalImage.data,o.success?(delete o.originalImage,a=!0,this.configuration.onMrzDetected(o)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(o.originalImage))}catch(e){null===(o=(i=this.configuration).onError)||void 0===o||o.call(i,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){var e;return xo.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},xo.default.createElement(ar.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&xo.default.createElement(sr.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}DC.FRAME_RESOLUTION=1200;var BC=DC,TC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};rr.b;class IC extends rr.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(e,t){return TC(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(xo.render)(xo.default.createElement(IC,{container:n,configuration:e,onDetected:t.onDetected,onSuccess:i,onFailure:o,scanner:t.scanner}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return TC(this,void 0,void 0,(function*(){Xm.warn("Text pattern detection resumed"),yield this.resume()}))}pauseDetection(){Xm.warn("Text pattern detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return TC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.scanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return TC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return TC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.scanner.cleanRecognitionQueue(),this.paused=!0}detect(){var e,t,n,i;return TC(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(IC.FRAME_RESOLUTION);if(!n)return;o&&this.forceUpdate();const i=yield this.props.scanner.recognize(n);if(!this.enabled)return;if(null===i)return;i&&(r=!0,this.props.onDetected(i),this.camera.reusableImageBuffer=i.originalImage.data)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var e;return xo.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),xo.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},xo.default.createElement(ar.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&xo.default.createElement(sr.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}IC.FRAME_RESOLUTION=1200;var kC=IC,OC=n(37),LC=n(27);var PC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class _C{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(53).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),i=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(i);return new Worker(o)}(),this.worker.onmessage=e=>{const t=e.data,n=t.token;if(this.taskMap.has(n)){(0,this.taskMap.get(n).resolve)(t.data),this.taskMap.delete(n)}else console.error("Unknown token:",n)},this.worker.onerror=e=>{if(!e.error)return void console.log("SBSDK: Error event triggered, but no error present",e);if(!e.error.cause)return void console.error("SBSDK: Error event triggered, but no cause present",e.error);const t=e.error.cause.token;if(this.taskMap.has(t)){(0,this.taskMap.get(t).reject)(e.error),this.taskMap.delete(t)}else console.error("Unknown token:",t)}}generateUniqueToken(){return this.tokenCounter++,"token_"+this.tokenCounter+"_"+Math.random().toString(36).substr(2,9)}query(e){return PC(this,void 0,void 0,(function*(){const t=this.generateUniqueToken();return this.worker.postMessage({token:t,query:e}),new Promise(((e,n)=>{this.taskMap.set(t,{resolve:e,reject:n})}))}))}}var RC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class FC{constructor(){this.db=new _C}clear(){return RC(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return RC(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return RC(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResults"});if(!e)return t;const n=t.map((e=>e.id)),i=yield this.getCroppedDetectionResultImages(n);for(const e of t)this.mapImages(e,i);return t}))}getCroppedDetectionResult(e){return RC(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResult",data:e}),n=yield this.getCroppedDetectionResultImage(e);return this.mapImages(t,n),t}))}mapImages(e,t){var n,i;e.originalImage=null===(n=t.find((t=>t.documentId===e.id&&"original"===t.type)))||void 0===n?void 0:n.data,e.croppedImage=null===(i=t.find((t=>t.documentId===e.id&&"cropped"===t.type)))||void 0===i?void 0:i.data}getCroppedDetectionResultImages(e){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){return RC(this,void 0,void 0,(function*(){const t=Object.create(e);t.croppedImage=null,t.originalImage=null;const n=yield this.db.query({type:"storeCroppedDetectionResult",data:t}),i=[{documentId:n,data:e.originalImage,type:"original"},{documentId:n,data:e.croppedImage,type:"cropped"}];return yield this.db.query({type:"storeImages",data:i}),n}))}getSBDocumentIds(){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}insertSBDocument(e){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return RC(this,void 0,void 0,(function*(){const t="number"==typeof e?e:e.getData().id;return yield this.db.query({type:"deleteSBDocument",data:t})}))}getSBDocument(e){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBPageImage(e){return RC(this,void 0,void 0,(function*(){const t={image:e};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return RC(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getSBPageImage",data:e})).image}))}deleteImageById(e){return RC(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return RC(this,void 0,void 0,(function*(){const t=e instanceof aC?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),t.unfilteredDocumentImageId&&n.push(t.unfilteredDocumentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}}var MC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class NC{constructor(e,t){this._sdk=e,this._token=t}recognize(e,t="COPY_IMAGE"){return MC(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanVin(yield this._token,e)}))}cleanRecognitionQueue(){return MC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanVinScanningQueue(yield this._token)}))}recognizeURL(e){return MC(this,void 0,void 0,(function*(){return this.recognize(yield z.imageUrlToImageData(e))}))}release(){return MC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._token)}))}}var VC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class WC{constructor(){this.storage=new FC}static get UI(){if(!D.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return WC._ui2}static initialize(e){var t;return VC(this,void 0,void 0,(function*(){const n=new WC,i=e.enginePath||WC.defaultEnginePath,o=!!e.allowThreads,r=null!==(t=e.requestSuffix)&&void 0!==t?t:`?${n.version}`;if(!i)throw new Error("To initialize the ScanbotSDK, please specify the enginePath option. This option should specify the location of the accompanying WASM and JS files in the bundle folder. It can either point to your server or a CDN. Please note that this option has been renamed from engine -> enginePath recently. Please see our documentation for more details on how to set up the enginePath correctly.");const a=[e.licenseKey,i,window.location.hostname,"",{captureConsole:!1,allowThreads:o,requestSuffix:r}];return n.bridge=new L(i,{allowSimd:!0,allowThreads:o,requestSuffix:r},a),WC.instance=n,window.scanbotSdk=n,Eo.a.initialize(e.verboseLogging),e.allowThreads&&!Object(B.a)()&&(Eo.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&Eo.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==e?void 0:e.bestCameraDetectionStrategy),n}))}createDocumentScanner(e){return VC(this,void 0,void 0,(function*(){let t;try{return t=yield np.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){var t;return VC(this,void 0,void 0,(function*(){let n;try{const i=new U(this,this.bridge.copyArgs.createMRZScanner(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}));return n=yield BC.create(e,i),yield this.licenseCheck(),n}catch(e){throw n&&n.dispose(),e}}))}createBarcodeScanner(e){return VC(this,void 0,void 0,(function*(){let t;try{return t=yield $m.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return VC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield nC.create(e,this)}))}createTextPatternScanner(e){return VC(this,void 0,void 0,(function*(){let t;try{e=Co.fromJson(e);const n=this.bridge.copyArgs.createTextPatternScanner(e.ocrConfiguration),i=new Q(this,n);return t=yield kC.create(e,{onDetected:e.onTextDetected,scanner:i}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createVINScanner(e){return VC(this,void 0,void 0,(function*(){let t;try{e=yo.fromJson(e);const n=t=>{""===t.textResult.rawText&&""===t.barcodeResult.extractedVIN||e.onVinDetected(t)},i=this.bridge.copyArgs.createVinScanner(e.detectionConfiguration),o=new NC(this,i);return t=yield kC.create(e,{scanner:o,onDetected:n}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentDataExtractorScanner(e){return VC(this,void 0,void 0,(function*(){let t;try{const i=n(54).default;return t=yield i.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return VC(this,void 0,void 0,(function*(){return Ao.throwIfMissingBuffer(e),yield z.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){yield this.licenseCheck(),Ao.throwIfMissingBuffer(e);const i=yield this.bridge.copyArgs.createDocumentScanner(t),o=this.getBridge(n),r=yield o.documentScannerDetect(i,e);return yield this.release(i,"documentDetector"),r}))}detectAndCropDocument(e,t="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){yield this.licenseCheck(),Ao.throwIfMissingBuffer(e);const n=this.getBridge(t);return yield n.detectAndCropDocument(e)}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){yield this.licenseCheck(),Ao.throwIfMissingBuffer(e),"string"==typeof e&&(e=yield z.loadFromUrl(e));const i=Object.assign({},t);i.live=!1;const o=yield this.bridge.copyArgs.createBarcodeScanner(i),r=yield this.getBridge(n).scanBarcodes(o,e);return yield this.release(o,"barcodeRecognizer"),r}))}parseBarcodeDocument(e,t){return VC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(e,t)}))}createSimpleMRZRecognizer(){return VC(this,void 0,void 0,(function*(){const e=new p.MrzScannerConfiguration({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}});return new U(this,this.bridge.copyArgs.createMRZScanner(e))}))}createOcrEngine(){return VC(this,void 0,void 0,(function*(){return new G(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(e={}){return VC(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(e);return new wo(this,t)}))}imageRotate(e,t,n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){Ao.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageRotate(e,t)}))}imageFilter(e,t,n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){Ao.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageApplyFilter(e,t)}))}imageCrop(e,t,n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){Ao.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageCrop(e,t)}))}imageResize(e,t,n="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){Ao.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageResize(e,t)}))}getLicenseInfo(){return VC(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.getLicenseInfo();return P.fromJson(e)}))}beginPdf(e){return VC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new R(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return VC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new M(this,yield this.bridge.copyArgs.beginTiff(e))}))}createDocumentDataExtractor(e){return VC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new wC(this,yield this.bridge.copyArgs.documentDataExtractorCreate(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return VC(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return D.VERSION}get utils(){return this._utils||(this._utils=new j),this._utils}release(e,t){return VC(this,void 0,void 0,(function*(){e&&(Eo.a.debug(`Releasing object ${null!=t?t:"unknown"}`),yield this.bridge.copyArgs.releaseObject(e))}))}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return VC(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new bo(e)}))}destroy(){this.bridge.destroy(),WC.instance=void 0}}WC.defaultEnginePath="",WC._ui2=D.BUILD_WITH_UI?AC:void 0,WC.cameras=LC.a.INSTANCE,WC.Config=x,WC._stats=OC.a.INSTANCE;var zC=t.a=WC},function(e,t,n){"use strict";var i=n(43),o=n.n(i)()((function(e){return e[1]}));o.push([e.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 12px;\n transform: translate(-50%, -100%);\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),t.a=o},function(e,t,n){"use strict";var i=n(43),o=n.n(i)()((function(e){return e[1]}));o.push([e.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),t.a=o},function(e,t){var n,i,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,l=[],u=!1,d=-1;function m(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!u){var e=s(m);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){const{render:i,hydrate:o,unmountComponentAtNode:r}=n(0);function a(e){return{render(t){i(t,e)},unmount(){r(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return o(t,e),a(e)}},function(e,t){e.exports=function(e,t,n,i){var o=n?n.call(i,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<r.length;c++){var l=r[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=n?n.call(i,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){"use strict";function i(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,"a",(function(){return r}));var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=i((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ScanbotSDK",(function(){return i}));const i=n(44).a},function(e,t,n){"use strict";n.r(t),t.default="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiOwoKY29uc3QgREJfTkFNRSA9ICJTQlNES0Jhc2UiOwoKY29uc3QgU1RPUkVTID0gewogICAgQ1JPUFBFRF9ERVRFQ1RJT05fUkVTVUxUUzogImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIiwKICAgIFNCX0RPQ1VNRU5UUzogIlNCRG9jdW1lbnRzIiwKICAgIElNQUdFUzogImltYWdlcyIKfTsKCmZ1bmN0aW9uIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4gLyo6IHN0cmluZyovLCByZXF1ZXN0IC8qOiBJREJSZXF1ZXN0Ki8pIHsKICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGV2ZW50LnRhcmdldC5yZXN1bHQgfSk7CiAgICB9Owp9CgpmdW5jdGlvbiBvcGVuREIoKSAvKjogUHJvbWlzZTxJREJEYXRhYmFzZT4qL3sKICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CgogICAgICAgIC8qKiBOQiEgVXBkYXRlIHZlcnNpb24gd2hlbiBEQiBtb2RlbCBjaGFuZ2VzICovCiAgICAgICAgY29uc3QgREJfVkVSU0lPTiA9IDU7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IGluZGV4ZWREQi5vcGVuKERCX05BTUUsIERCX1ZFUlNJT04pOwoKICAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVzb2x2ZShldmVudC50YXJnZXRbInJlc3VsdCJdKTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgY29uc3QgY29kZSA9IGV2ZW50LnRhcmdldCA/IGV2ZW50LnRhcmdldFsiZXJyb3JDb2RlIl0gOiAiVW5rbm93biBlcnJvciBjb2RlIjsKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJFcnJvciBvcGVuaW5nIGRhdGFiYXNlOiAiICsgY29kZSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9udXBncmFkZW5lZWRlZCA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgLy8gVE9ETzogJ29udXBncmFkZW5lZWRlZCcgaXMgb25seSBjYWxsZWQgd2hlbiBGSVJTVCBvcGVuaW5nIHRoZSBkYXRhYmFzZQogICAgICAgICAgICAvLyAgQU5EIHdoZW4gdGhlIHZlcnNpb24gbnVtYmVyIGlzIGluY3JlYXNlZC4gV2hhdCBlbHNlIG5lZWRzIHRvIGJlIGRvbmUgaGVyZT8KICAgICAgICAgICAgY29uc3QgZGIgPSBldmVudC50YXJnZXQgLyogYXMgSURCT3BlbkRCUmVxdWVzdCovLnJlc3VsdDsKCiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgICAgICAgICAgY29uc3QgbmFtZSA9IFNUT1JFU1trZXldOwogICAgICAgICAgICAgICAgLy8gVE9ETyBjYW4ndCBqdXN0IGRlbGV0ZSBpbiBwcm9kdWN0aW9uLCBuZWVkIHRvIG1pZ3JhdGUgZGF0YQogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBkYi5kZWxldGVPYmplY3RTdG9yZShuYW1lKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgICAgLy8gQ2FuJ3QgZGVsZXRlIG9iamVjdCBzdG9yZSB0aGF0IGRvZXNuJ3QgZXhpc3QKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygiRXJyb3IgZGVsZXRpbmcgb2JqZWN0IHN0b3JlOiAiLCBuYW1lKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkYi5jcmVhdGVPYmplY3RTdG9yZShuYW1lLCB7IGtleVBhdGg6ICJpZCIsIGF1dG9JbmNyZW1lbnQ6IHRydWUgfSk7CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgfSk7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHN0b3JlTmFtZXMgLyo6IHN0cmluZ1tdKi8pIC8qOiBQcm9taXNlPElEQlRyYW5zYWN0aW9uPiovewogICAgY29uc3QgZGIgPSBhd2FpdCBvcGVuREIoKTsKICAgIC8vIFRPRE8gaXMgaXQgZXZlciBhY3R1YWxseSBuZWNlc3NhcnkgdG8gd2FpdCBmb3IgYSB0cmFuc2FjdGlvbidzICdvbmNvbXBsZXRlJyBldmVudD8KICAgIHJldHVybiBkYi50cmFuc2FjdGlvbihzdG9yZU5hbWVzLCAicmVhZHdyaXRlIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFN0b3JlKG5hbWUgLyo6IHN0cmluZyovKSAvKjogUHJvbWlzZTxJREJPYmplY3RTdG9yZT4qL3sKICAgIGNvbnN0IHRyYW5zYWN0aW9uID0gYXdhaXQgZ2V0VHJhbnNhY3Rpb24oW25hbWVdKTsKICAgIHJldHVybiB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShuYW1lKTsKfQoKYXN5bmMgZnVuY3Rpb24gZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldEltYWdlc1N0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImltYWdlcyIpOwp9Cgphc3luYyBmdW5jdGlvbiBjbGVhcigpIHsKICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgIGNvbnN0IG5hbWUgPSBTVE9SRVNba2V5XTsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKG5hbWUpOwogICAgICAgIHN0b3JlLmNsZWFyKCk7CiAgICB9Cn0KCmFzeW5jIGZ1bmN0aW9uIGRlbGV0ZURCKCkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gaW5kZXhlZERCLmRlbGV0ZURhdGFiYXNlKERCX05BTUUpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICByZXNvbHZlKGV2ZW50KTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVqZWN0KGV2ZW50KTsKICAgICAgICB9OwogICAgfSk7Cn0KCmZ1bmN0aW9uIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgbWVzc2FnZSkgewogICAgdGhyb3cgbmV3IEVycm9yKCJTQkluZGV4ZWREQiB3b3JrZXIgZXJyb3I6ICIgKyBKU09OLnN0cmluZ2lmeSh7CiAgICAgICAgInRva2VuIjogdG9rZW4sCiAgICAgICAgInF1ZXJ5IjogcXVlcnksCiAgICAgICAgIm1lc3NhZ2UiOiBtZXNzYWdlCiAgICB9KSk7Cn0KCnNlbGYub25tZXNzYWdlID0gYXN5bmMgKGV2ZW50IC8qOiBNZXNzYWdlRXZlbnQqLykgPT4gewoKICAgIGNvbnN0IHRva2VuID0gZXZlbnQuZGF0YS50b2tlbjsKICAgIGNvbnN0IHF1ZXJ5ID0gZXZlbnQuZGF0YS5xdWVyeTsKCiAgICB0cnkgewogICAgICAgIGlmIChxdWVyeS50eXBlID09PSAnY2xlYXInKSB7CiAgICAgICAgICAgIGF3YWl0IGNsZWFyKCk7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZGVsZXRlJykgewogICAgICAgICAgICBhd2FpdCBkZWxldGVEQigpOwogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gJ3N0b3JlQ3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmFkZChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdHMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGwoKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnc3RvcmVJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IGltYWdlcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgZm9yIChjb25zdCBpbWFnZSBvZiBpbWFnZXMpIHsKICAgICAgICAgICAgICAgIHN0b3JlLmFkZChpbWFnZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgZG9jdW1lbnRJZHMgPSBxdWVyeS5kYXRhOwogICAgICAgICAgICAvLyBUT0RPIGdldCBmcm9tIHN0b3JlIGJ5IGZvcmVpZ24ga2V5PwogICAgICAgICAgICBzdG9yZS5nZXRBbGwoKS5vbnN1Y2Nlc3MgPSBldmVudCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBpbWFnZXMgPSBldmVudC50YXJnZXQucmVzdWx0OwogICAgICAgICAgICAgICAgY29uc3QgZmlsdGVyZWRJbWFnZXMgPSBpbWFnZXMuZmlsdGVyKGltYWdlID0+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGZpbHRlcmVkSW1hZ2VzIH0pOwogICAgICAgICAgICB9OwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGxLZXlzKCk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShxdWVyeS5kYXRhKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCByZXF1ZXN0KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLnB1dChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JQYWdlSW1hZ2UiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgaWRzID0gcXVlcnkuZGF0YTsKICAgICAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShpZCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJVbmtub3duIHF1ZXJ5IHR5cGUiKTsKICAgICAgICB9CiAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgIGNvbnNvbGUubG9nKCJFcnJvciBpbiBTQkluZGV4ZWREQiB3b3JrZXI6ICIsIGVycm9yKTsKICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksIGVycm9yLm1lc3NhZ2UgfHwgZXJyb3IpOwogICAgfQp9Ow=="},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var i=n(0),o=n(12),r=n(14),a=n(22);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(e){const t=new s;return this.mapValues(e,t,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var c=n(25),l=n(24),u=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};o.a;class d extends o.c{constructor(e){super(e),this.enabled=!0,this.configuration=e.configuration}static create(e,t){var n;return u(this,void 0,void 0,(function*(){const o=null!==(n=t.container)&&void 0!==n?n:document.getElementById(t.containerId);if(t=s.fromJson(t),!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(i.render)(i.default.createElement(d,{container:o,configuration:t,onSuccess:n,onFailure:r,sdk:e}),o)}))}))}componentDidMount(){var e,t;super.componentDidMount();try{this.documentDataExtractor=this.props.sdk.createDocumentDataExtractor(this.configuration.detectorParameters)}catch(n){null===(t=(e=this.configuration).onError)||void 0===t||t.call(e,n)}this.detect()}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return u(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.documentDataExtractor).release()}))}detect(){var e,t,n,i,r,a;return u(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const r=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.documentDataExtractor).recognize(r,{mode:"LIVE"},"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(i=(n=this.configuration).onDocumentDetected)||void 0===i||i.call(n,a)}catch(e){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var e;const t=this.configuration;return i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:t.videoConstraints,mirrored:t.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&i.default.createElement(l.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(e,t,n){"use strict";n.r(t);var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=o}])}));