diff --git a/src/app/static-resources/static/scripts/yivi.js b/src/app/static-resources/static/scripts/yivi.js index fbf8352c..3dcdf3a4 100644 --- a/src/app/static-resources/static/scripts/yivi.js +++ b/src/app/static-resources/static/scripts/yivi.js @@ -1,2 +1,2 @@ /*! For license information please see yivi.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.yivi=e():t.yivi=e()}(self,(function(){return function(){var t={8681:function(t,e,n){function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e0&&(u=u.slice(e))}))})),g.on("error",(function(t){b.connectionInProgress=!1,m(t.message)})),g.setNoDelay&&g.setNoDelay(!0),g.end()}function O(){b.listeners(arguments[0]).length>0&&b.emit.apply(b,arguments)}function k(e,n,r,o){if(0===o){if(S.length>0){var i=_||"message";O(i,new d(i,{data:S.slice(0,-1),lastEventId:v,origin:y(t)})),S=""}_=void 0}else if(r>0){var a,s=r<0,u=e.slice(n,n+(s?o:r)).toString();n+=a=s?o:32!==e[n+r+1]?r+1:r+2;var c=o-a,f=e.slice(n,n+c).toString();if("data"===u)S+=f+"\n";else if("event"===u)_=f;else if("id"===u)v=f;else if("retry"===u){var l=parseInt(f,10);Number.isNaN(l)||(b.reconnectInterval=l)}}}x(),this._close=function(){n!==p.CLOSED&&(n=p.CLOSED,g.abort&&g.abort(),g.xhr&&g.xhr.abort&&g.xhr.abort())}}function h(t,e){if(Object.defineProperty(this,"type",{writable:!1,value:t,enumerable:!0}),e)for(var n in e)e.hasOwnProperty(n)&&Object.defineProperty(this,n,{writable:!1,value:e[n],enumerable:!0})}function d(t,e){for(var n in Object.defineProperty(this,"type",{writable:!1,value:t,enumerable:!0}),e)e.hasOwnProperty(n)&&Object.defineProperty(this,n,{writable:!1,value:e[n],enumerable:!0})}function y(t){return"string"==typeof t&&(t=i(t)),t.protocol&&t.hostname?(t.protocol+"//"+t.host).toLowerCase():"null"}t.exports=p,c.inherits(p,a.EventEmitter),p.prototype.constructor=p,["open","error","message"].forEach((function(t){Object.defineProperty(p.prototype,"on"+t,{get:function(){var e=this.listeners(t)[0];return e?e._listener?e._listener:e:void 0},set:function(e){this.removeAllListeners(t),this.addEventListener(t,e)}})})),Object.defineProperty(p,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(p,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(p,"CLOSED",{enumerable:!0,value:2}),p.prototype.CONNECTING=0,p.prototype.OPEN=1,p.prototype.CLOSED=2,p.prototype.close=function(){this._close()},p.prototype.addEventListener=function(t,e){"function"==typeof e&&(e._listener=e,this.on(t,e))},p.prototype.dispatchEvent=function(t){if(!t.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(t.type,t.detail)},p.prototype.removeEventListener=function(t,e){"function"==typeof e&&(e._listener=void 0,this.removeListener(t,e))}},7576:function(t,e,n){n(2525),t.exports=self.fetch.bind(self)},2525:function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.r(e),n.d(e,{DOMException:function(){return k},Headers:function(){return y},Request:function(){return _},Response:function(){return x},fetch:function(){return A}});var o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==o&&o,i="URLSearchParams"in o,a="Symbol"in o&&"iterator"in Symbol,s="FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch(t){return!1}}(),u="FormData"in o,c="ArrayBuffer"in o;if(c)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&f.indexOf(Object.prototype.toString.call(t))>-1};function p(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return a&&(e[Symbol.iterator]=function(){return e}),e}function y(t){this.map={},t instanceof y?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function g(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function b(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function m(t){var e=new FileReader,n=b(e);return e.readAsArrayBuffer(t),n}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:s&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:u&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():c&&s&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(m)}),this.text=function(){var t,e,n,r=g(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,n=b(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function E(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function x(t,e){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new y(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},w.call(_.prototype),w.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];x.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})};var k=o.DOMException;try{new k}catch(t){(k=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),k.prototype.constructor=k}function A(t,e){return new Promise((function(n,i){var a=new _(t,e);if(a.signal&&a.signal.aborted)return i(new k("Aborted","AbortError"));var u=new XMLHttpRequest;function f(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new y,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;setTimeout((function(){n(new x(o,r))}),0)},u.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){i(new k("Aborted","AbortError"))}),0)},u.open(a.method,function(t){try{return""===t&&o.location.href?o.location.href:t}catch(e){return t}}(a.url),!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&(s?u.responseType="blob":c&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!e||"object"!==r(e.headers)||e.headers instanceof y?a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){u.setRequestHeader(t,h(e.headers[t]))})),a.signal&&(a.signal.addEventListener("abort",f),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",f)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}A.polyfill=!0,o.fetch||(o.fetch=A,o.Headers=y,o.Request=_,o.Response=x)},2099:function(t){function e(t,e){for(var n=0;nr.minor:n.major>r.major}},{key:"below",value:function(t,e){var n=this._parse(t),r=this._parse(e);return n.major===r.major?n.minor2?"iOS":"Desktop"}},5920:function(t,e,n){var r=n(1086);function o(t,e){for(var n=0;n"}var e,n;return e=t,(n=[{key:"isPopupActive",value:function(){return this._element.classList.contains("yivi-web-popup-active")}},{key:"openPopup",value:function(){var t=this,e=function(e){return t._clickHandler(e)},n=function(e){return t._keyHandler(e)};this._element.addEventListener("click",e),document.addEventListener("keyup",n),this._removeEventListeners=function(){t._element.removeEventListener("click",e),document.removeEventListener("keyup",n)},this._element.classList.add("yivi-web-popup-active"),this._element.focus()}},{key:"closePopup",value:function(){this.isPopupActive()&&(this._removeEventListeners(),this._element.classList.remove("yivi-web-popup-active"))}},{key:"_findElement",value:function(t){if(t){var e=document.querySelector(t);return e||r.error("Could not find element ".concat(t)),e}var n=document.querySelector("div.yivi-web-popup");return n||(n=document.body.appendChild(document.createElement("div"))),n.setAttribute("tabindex","-1"),n}},{key:"_clickHandler",value:function(t){t.target.matches("button.yivi-web-close")&&this._cancel()}},{key:"_keyHandler",value:function(t){"Escape"===t.key&&this._cancel()}},{key:"_cancel",value:function(){this.closePopup(),this._closeCallback()}}])&&o(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},5074:function(t,e,n){function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e\n

').concat(this._translations.header,'

\n
\n

').concat(this._translations.helper,"

\n
\n ").concat(this._showCloseButton?'\n \n ':"",'\n \n
\n
\n ').concat(t,"\n
\n
\n ")}},{key:"_stateUninitialized",value:function(){return'\n \x3c!-- State: Uninitialized --\x3e\n
\n \n
\n

'.concat(this._translations.loading,"

\n ")}},{key:"_stateLoading",value:function(){return'\n \x3c!-- State: Loading --\x3e\n
\n \n
\n

'.concat(this._translations.loading,"

\n ")}},{key:"_stateShowingQRCode",value:function(t){var e=t.payload;return'\n \x3c!-- State: ShowingQRCode --\x3e\n \n '.concat(e.showBackButton?'

'.concat(this._translations.back,"

"):"","\n ")}},{key:"_stateShowingYiviButton",value:function(){return'\n \x3c!-- State: ShowingButton --\x3e\n \n \n \n

').concat(this._translations.qrCode,"

\n ")}},{key:"_stateEnterPairingCode",value:function(t){var e=t.transition,n=t.payload,r=this._element.querySelector(".yivi-web-pairing-form"),o=this._element.querySelectorAll(".yivi-web-pairing-code input");switch(e){case"pairingRejected":var i=r.firstElementChild;return i.innerHTML=this._translations.pairingFailed(n.enteredPairingCode),i.classList.add("yivi-web-error"),r.reset(),o.forEach((function(t){return t.disabled=!1})),r.querySelector(".yivi-web-pairing-loading-animation").style.visibility="hidden",!1;case"codeEntered":return o.forEach((function(t){return t.disabled=!0})),r.querySelector(".yivi-web-pairing-loading-animation").style.visibility="visible",!1;default:return'\n \x3c!-- State: EnterPairingCode --\x3e\n
\n

'.concat(this._translations.pairing,'

\n
\n \n \n \n \n
\n \n \n

').concat(this._translations.cancel,"

\n
\n ")}}},{key:"_stateContinueInYiviApp",value:function(){return'\n \x3c!-- State: WaitingForUser --\x3e\n
\n

'.concat(this._translations.app,'

\n

').concat(this._translations.cancel,"

\n ")}},{key:"_stateCancelled",value:function(){return'\n \x3c!-- State: Cancelled --\x3e\n
\n

'.concat(this._translations.cancelled,'

\n

').concat(this._translations.retry,"

\n ")}},{key:"_stateTimedOut",value:function(){return'\n \x3c!-- State: TimedOut --\x3e\n
\n

'.concat(this._translations.timeout,'

\n

').concat(this._translations.retry,"

\n ")}},{key:"_stateError",value:function(){return'\n \x3c!-- State: Error --\x3e\n
\n

'.concat(this._translations.error,'

\n

').concat(this._translations.retry,"

\n ")}},{key:"_stateBrowserNotSupported",value:function(){return'\n \x3c!-- State: BrowserNotSupported --\x3e\n
\n

'.concat(this._translations.browser,"

\n ")}},{key:"_stateSuccess",value:function(){return'\n \x3c!-- State: Success --\x3e\n
\n

'.concat(this._translations.success,"

\n ")}},{key:"_stateAborted",value:function(){return"\n \x3c!-- State: Aborted --\x3e\n "}}])&&r(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},3740:function(t,e,n){var r=n(1086);function o(t,e){for(var n=0;nl)&&(i[u]=l,h.push(u,l),o[u]=s));if(void 0!==r&&void 0===i[r]){var d=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var o=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,o={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=t.sorter||r.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},879:function(t){"use strict";t.exports=function(t){for(var e=[],n=t.length,r=0;r=55296&&o<=56319&&n>r+1){var i=t.charCodeAt(r+1);i>=56320&&i<=57343&&(o=1024*(o-55296)+i-56320+65536,r+=1)}o<128?e.push(o):o<2048?(e.push(o>>6|192),e.push(63&o|128)):o<55296||o>=57344&&o<65536?(e.push(o>>12|224),e.push(o>>6&63|128),e.push(63&o|128)):o>=65536&&o<=1114111?(e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(63&o|128)):e.push(239,191,189)}return new Uint8Array(e).buffer}},8021:function(t,e,n){var r=n(9791),o=n(6112),i=n(6949),a=n(9426);function s(t,e,n,i,a){var s=[].slice.call(arguments,1),u=s.length,c="function"==typeof s[u-1];if(!c&&!r())throw new Error("Callback required as last argument");if(!c){if(u<1)throw new Error("Too few arguments provided");return 1===u?(n=e,e=i=void 0):2!==u||e.getContext||(i=n,n=e,e=void 0),new Promise((function(r,a){try{var s=o.create(n,i);r(t(s,e,i))}catch(t){a(t)}}))}if(u<2)throw new Error("Too few arguments provided");2===u?(a=n,n=e,e=i=void 0):3===u&&(e.getContext&&void 0===a?(a=i,i=void 0):(a=i,i=n,n=e,e=void 0));try{var f=o.create(n,i);a(null,t(f,e,i))}catch(t){a(t)}}e.create=o.create,e.toCanvas=s.bind(null,i.render),e.toDataURL=s.bind(null,i.renderToDataURL),e.toString=s.bind(null,(function(t,e,n){return a.render(t,n)}))},9791:function(t){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},4399:function(t,e,n){var r=n(909).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,n=r(t),o=145===n?26:2*Math.ceil((n-13)/(2*e-2)),i=[n-7],a=1;a>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},3877:function(t){function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,n,r){var o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},7545:function(t,e,n){var r=n(879),o=n(8710);function i(t){this.mode=o.BYTE,"string"==typeof t&&(t=r(t)),this.data=new Uint8Array(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(var e=0,n=this.data.length;e=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return n}}},3897:function(t,e,n){var r=n(909).getSymbolSize;e.getPositions=function(t){var e=r(t);return[[0,0],[e-7,0],[0,e-7]]}},3312:function(t,e,n){var r=n(909),o=r.getBCHDigit(1335);e.getEncodedBits=function(t,e){for(var n=t.bit<<3|e,i=n<<10;r.getBCHDigit(i)-o>=0;)i^=1335<=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}},t.exports=i},3393:function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){for(var e=t.size,n=0,r=0,o=0,i=null,a=null,s=0;s=5&&(n+=r-5+3),i=c,r=1),(c=t.get(u,s))===a?o++:(o>=5&&(n+=o-5+3),a=c,o=1)}r>=5&&(n+=r-5+3),o>=5&&(n+=o-5+3)}return n},e.getPenaltyN2=function(t){for(var e=t.size,n=0,r=0;r=10&&(1488===r||93===r)&&n++,o=o<<1&2047|t.get(a,i),a>=10&&(1488===o||93===o)&&n++}return 40*n},e.getPenaltyN4=function(t){for(var e=0,n=t.data.length,r=0;r=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return n}}},627:function(t,e,n){var r=n(8710);function o(t){this.mode=r.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);var o=this.data.length-e;o>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*o+1))},t.exports=o},1510:function(t,e,n){var r=n(6359);e.mul=function(t,e){for(var n=new Uint8Array(t.length+e.length-1),o=0;o=0;){for(var o=n[0],i=0;i>r&1),r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function b(t,e,n,o){var h;if(Array.isArray(t))h=y.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var b=e;if(!b){var m=y.rawSplit(t);b=p.getBestVersionForData(m,n)}h=y.fromString(t,b||40)}var v=p.getBestVersionForData(h,n);if(!v)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e=0&&s<=6&&(0===c||6===c)||c>=0&&c<=6&&(0===s||6===s)||s>=2&&s<=4&&c>=2&&c<=4?t.set(i+s,a+c,!0,!0):t.set(i+s,a+c,!1,!0))}(_,e),function(t){for(var e=t.size,n=8;n=7&&function(t,e){for(var n,r,o,i=t.size,a=p.getEncodedBits(e),s=0;s<18;s++)n=Math.floor(s/3),r=s%3+i-8-3,o=1==(a>>s&1),t.set(n,r,o,!0),t.set(r,n,o,!0)}(_,e),function(t,e){for(var n=t.size,r=-1,o=n-1,i=7,a=0,s=n-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(o,s-u)){var c=!1;a>>i&1)),t.set(o,s-u,c),-1==--i&&(a++,i=7)}if((o+=r)<0||n<=o){o-=r,r=-r;break}}}(_,w),isNaN(o)&&(o=c.getBestMask(_,g.bind(null,_,n))),c.applyMask(o,_),g(_,n,o),{modules:_,version:e,errorCorrectionLevel:n,maskPattern:o,segments:h}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var n,i,a=o.M;return void 0!==e&&(a=o.from(e.errorCorrectionLevel,o.M),n=p.from(e.version),i=c.from(e.maskPattern),e.toSJISFunc&&r.setToSJISFunction(e.toSJISFunc)),b(t,n,a,i)}},9124:function(t,e,n){var r=n(1510);function o(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(t){this.degree=t,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new Uint8Array(t.length+this.degree);e.set(t);var n=r.mod(e,this.genPoly),o=this.degree-n.length;if(o>0){var i=new Uint8Array(this.degree);return i.set(n,o),i}return n},t.exports=o},7377:function(t,e){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",r="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(r,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return i.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},2841:function(t,e,n){var r=n(8710),o=n(627),i=n(4492),a=n(7545),s=n(6752),u=n(7377),c=n(909),f=n(1620);function l(t){return unescape(encodeURIComponent(t)).length}function p(t,e,n){for(var r,o=[];null!==(r=t.exec(n));)o.push({data:r[0],index:r.index,mode:e,length:r[0].length});return o}function h(t){var e,n,o=p(u.NUMERIC,r.NUMERIC,t),i=p(u.ALPHANUMERIC,r.ALPHANUMERIC,t);return c.isKanjiModeEnabled()?(e=p(u.BYTE,r.BYTE,t),n=p(u.KANJI,r.KANJI,t)):(e=p(u.BYTE_KANJI,r.BYTE,t),n=[]),o.concat(i,e,n).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function d(t,e){switch(e){case r.NUMERIC:return o.getBitsLength(t);case r.ALPHANUMERIC:return i.getBitsLength(t);case r.KANJI:return s.getBitsLength(t);case r.BYTE:return a.getBitsLength(t)}}function y(t,e){var n,u=r.getBestModeForData(t);if((n=r.from(e,u))!==r.BYTE&&n.bit=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[]))},e.rawSplit=function(t){return e.fromArray(h(t,c.isKanjiModeEnabled()))}},909:function(t,e){var n,r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return r[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(t){return n(t)}},5588:function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},2154:function(t,e,n){var r=n(909),o=n(3010),i=n(9047),a=n(8710),s=n(5588),u=r.getBCHDigit(7973);function c(t,e){return a.getCharCountIndicator(t,e)+4}function f(t,e){var n=0;return t.forEach((function(t){var r=c(t.mode,e);n+=r+t.getBitsLength()})),n}e.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,n){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===n&&(n=a.BYTE);var i=8*(r.getSymbolTotalCodewords(t)-o.getTotalCodewordsCount(t,e));if(n===a.MIXED)return i;var u=i-c(n,t);switch(n){case a.NUMERIC:return Math.floor(u/10*3);case a.ALPHANUMERIC:return Math.floor(u/11*2);case a.KANJI:return Math.floor(u/13);case a.BYTE:default:return Math.floor(u/8)}},e.getBestVersionForData=function(t,n){var r,o=i.from(n,i.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(var r=1;r<=40;r++)if(f(t,r)<=e.getCapacity(r,n,a.MIXED))return r}(t,o);if(0===t.length)return 1;r=t[0]}else r=t;return function(t,n,r){for(var o=1;o<=40;o++)if(n<=e.getCapacity(o,r,t))return o}(r.mode,r.getLength(),o)},e.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;r.getBCHDigit(e)-u>=0;)e^=7973<':"",l="0&&c>0&&t[u-1]||(r+=a?i("M",c+n,.5+f+n):i("m",o,0),o=0,a=!1),c+1',p='viewBox="0 0 '+c+" "+c+'"',h=''+f+l+"\n";return"function"==typeof n&&n(null,h),h}},1912:function(t,e){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");var n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:r,scale:r?4:o,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,n){var r=e.getScale(t,n);return Math.floor((t+2*n.margin)*r)},e.qrToImageData=function(t,n,r){for(var o=n.modules.size,i=n.modules.data,a=e.getScale(o,r),s=Math.floor((o+2*r.margin)*a),u=r.margin*a,c=[r.color.light,r.color.dark],f=0;f=u&&l>=u&&f