@multisynq/client
Version:
Real-time multiplayer framework for web applications
8 lines (7 loc) • 358 kB
JavaScript
// (C) 2025 Croquet Labs
// Multisynq Client v1.0.4
// Using Croquet v2.0.4
// Built on 2025-06-09T15:55:07.724Z
"use strict";var Multisynq=(()=>{var bl=Object.create;var Ys=Object.defineProperty;var yl=Object.getOwnPropertyDescriptor;var gl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,Zl=Object.prototype.hasOwnProperty;var Hs=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),vl=(s,e)=>{for(var t in e)Ys(s,t,{get:e[t],enumerable:!0})},nr=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gl(e))!Zl.call(s,i)&&i!==t&&Ys(s,i,{get:()=>e[i],enumerable:!(n=yl(e,i))||n.enumerable});return s};var Xl=(s,e,t)=>(t=s!=null?bl(wl(s)):{},nr(e||!s||!s.__esModule?Ys(t,"default",{value:s,enumerable:!0}):t,s)),Ll=s=>nr(Ys({},"__esModule",{value:!0}),s);var rr=Hs((ir,Ks)=>{(function(s,e){typeof Ks=="object"&&Ks.exports?Ks.exports=e():s.Toastify=e()})(ir,function(s){var e=function(r){return new e.lib.init(r)},t="1.12.0";e.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},e.lib=e.prototype={toastify:t,constructor:e,init:function(r){return r||(r={}),this.options={},this.toastElement=null,this.options.text=r.text||e.defaults.text,this.options.node=r.node||e.defaults.node,this.options.duration=r.duration===0?0:r.duration||e.defaults.duration,this.options.selector=r.selector||e.defaults.selector,this.options.callback=r.callback||e.defaults.callback,this.options.destination=r.destination||e.defaults.destination,this.options.newWindow=r.newWindow||e.defaults.newWindow,this.options.close=r.close||e.defaults.close,this.options.gravity=r.gravity==="bottom"?"toastify-bottom":e.defaults.gravity,this.options.positionLeft=r.positionLeft||e.defaults.positionLeft,this.options.position=r.position||e.defaults.position,this.options.backgroundColor=r.backgroundColor||e.defaults.backgroundColor,this.options.avatar=r.avatar||e.defaults.avatar,this.options.className=r.className||e.defaults.className,this.options.stopOnFocus=r.stopOnFocus===void 0?e.defaults.stopOnFocus:r.stopOnFocus,this.options.onClick=r.onClick||e.defaults.onClick,this.options.offset=r.offset||e.defaults.offset,this.options.escapeMarkup=r.escapeMarkup!==void 0?r.escapeMarkup:e.defaults.escapeMarkup,this.options.ariaLive=r.ariaLive||e.defaults.ariaLive,this.options.style=r.style||e.defaults.style,r.backgroundColor&&(this.options.style.background=r.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var r=document.createElement("div");r.className="toastify on "+this.options.className,this.options.position?r.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(r.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):r.className+=" toastify-right",r.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var o in this.options.style)r.style[o]=this.options.style[o];if(this.options.ariaLive&&r.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)r.appendChild(this.options.node);else if(this.options.escapeMarkup?r.innerText=this.options.text:r.innerHTML=this.options.text,this.options.avatar!==""){var a=document.createElement("img");a.src=this.options.avatar,a.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?r.appendChild(a):r.insertAdjacentElement("afterbegin",a)}if(this.options.close===!0){var c=document.createElement("button");c.type="button",c.setAttribute("aria-label","Close"),c.className="toast-close",c.innerHTML="✖",c.addEventListener("click",function(G){G.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var l=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&l>360?r.insertAdjacentElement("afterbegin",c):r.appendChild(c)}if(this.options.stopOnFocus&&this.options.duration>0){var d=this;r.addEventListener("mouseover",function(G){window.clearTimeout(r.timeOutValue)}),r.addEventListener("mouseleave",function(){r.timeOutValue=window.setTimeout(function(){d.removeElement(r)},d.options.duration)})}if(typeof this.options.destination<"u"&&r.addEventListener("click",function(G){G.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&r.addEventListener("click",function(G){G.stopPropagation(),this.options.onClick()}.bind(this)),typeof this.options.offset=="object"){var p=n("x",this.options),f=n("y",this.options),h=this.options.position=="left"?p:"-"+p,v=this.options.gravity=="toastify-top"?f:"-"+f;r.style.transform="translate("+h+","+v+")"}return r},showToast:function(){this.toastElement=this.buildToast();var r;if(typeof this.options.selector=="string"?r=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?r=this.options.selector:r=document.body,!r)throw"Root element is not defined";var o=e.defaults.oldestFirst?r.firstChild:r.lastChild;return r.insertBefore(this.toastElement,o),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(r){r.className=r.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),r.parentNode&&r.parentNode.removeChild(r),this.options.callback.call(r),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var r={top:15,bottom:15},o={top:15,bottom:15},a={top:15,bottom:15},c=document.getElementsByClassName("toastify"),l,d=0;d<c.length;d++){i(c[d],"toastify-top")===!0?l="toastify-top":l="toastify-bottom";var p=c[d].offsetHeight;l=l.substr(9,l.length-1);var f=15,h=window.innerWidth>0?window.innerWidth:screen.width;h<=360?(c[d].style[l]=a[l]+"px",a[l]+=p+f):i(c[d],"toastify-left")===!0?(c[d].style[l]=r[l]+"px",r[l]+=p+f):(c[d].style[l]=o[l]+"px",o[l]+=p+f)}return this};function n(r,o){return o.offset[r]?isNaN(o.offset[r])?o.offset[r]:o.offset[r]+"px":"0px"}function i(r,o){return!r||typeof o!="string"?!1:!!(r.className&&r.className.trim().split(/\s+/gi).indexOf(o)>-1)}return e.lib.init.prototype=e.lib,e})});var ar=Hs((ou,or)=>{"use strict";or.exports=function(s,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&function(r){return function(o){return function(a,c){var l={key:a,value:o[a]},d={key:c,value:o[c]};return r(l,d)}}}(e.cmp),i=[];return function r(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var a,c;if(Array.isArray(o)){for(c="[",a=0;a<o.length;a++)a&&(c+=","),c+=r(o[a])||"null";return c+"]"}if(o===null)return"null";if(i.indexOf(o)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var l=i.push(o)-1,d=Object.keys(o).sort(n&&n(o));for(c="",a=0;a<d.length;a++){var p=d[a],f=r(o[p]);f&&(c&&(c+=","),c+=JSON.stringify(p)+":"+f)}return i.splice(l,1),"{"+c+"}"}}(s)}});var cr=Hs((au,lr)=>{"use strict";var xl=function(s,e){return s<e};function q(s){if(!(this instanceof q))return new q(s);this.array=[],this.size=0,this.compare=s||xl}q.prototype.clone=function(){var s=new q(this.compare);return s.size=this.size,s.array=this.array.slice(0,this.size),s};q.prototype.add=function(s){var e=this.size;this.array[this.size]=s,this.size+=1;for(var t,n;e>0&&(t=e-1>>1,n=this.array[t],!!this.compare(s,n));)this.array[e]=n,e=t;this.array[e]=s};q.prototype.heapify=function(s){this.array=s,this.size=s.length;var e;for(e=this.size>>1;e>=0;e--)this._percolateDown(e)};q.prototype._percolateUp=function(s,e){for(var t=this.array[s],n,i;s>0&&(n=s-1>>1,i=this.array[n],!(!e&&!this.compare(t,i)));)this.array[s]=i,s=n;this.array[s]=t};q.prototype._percolateDown=function(s){for(var e=this.size,t=this.size>>>1,n=this.array[s],i,r,o;s<t&&(i=(s<<1)+1,r=i+1,o=this.array[i],r<e&&this.compare(this.array[r],o)&&(i=r,o=this.array[r]),!!this.compare(o,n));)this.array[s]=o,s=i;this.array[s]=n};q.prototype._removeAt=function(s){if(!(s>this.size-1||s<0))return this._percolateUp(s,!0),this.poll()};q.prototype.remove=function(s){for(var e=0;e<this.size;e++)if(!this.compare(this.array[e],s)&&!this.compare(s,this.array[e]))return this._removeAt(e),!0;return!1};q.prototype.removeOne=function(s){if(typeof s=="function"){for(var e=0;e<this.size;e++)if(s(this.array[e]))return this._removeAt(e)}};q.prototype.removeMany=function(s,e){if(typeof s!="function"||this.size<1)return[];e=e?Math.min(e,this.size):this.size;for(var t=0,n=new Array(e),i=0,r=new Array(this.size);t<e&&!this.isEmpty();){var o=this.poll();s(o)?n[t++]=o:r[i++]=o}n.length=t;for(var a=0;a<i;)this.add(r[a++]);return n};q.prototype.peek=function(){if(this.size!=0)return this.array[0]};q.prototype.poll=function(){if(this.size!=0){var s=this.array[0];return this.size>1?(this.array[0]=this.array[--this.size],this._percolateDown(0)):this.size-=1,s}};q.prototype.replaceTop=function(s){if(this.size!=0){var e=this.array[0];return this.array[0]=s,this._percolateDown(0),e}};q.prototype.trim=function(){this.array=this.array.slice(0,this.size)};q.prototype.isEmpty=function(){return this.size===0};q.prototype.forEach=function(s){if(!(this.isEmpty()||typeof s!="function"))for(var e=0,t=this.clone();!t.isEmpty();)s(t.poll(),e++)};q.prototype.kSmallest=function(s){if(this.size==0||s<=0)return[];s=Math.min(this.size,s);let e=Math.min(this.size,2**(s-1)+1);if(e<2)return[this.peek()];let t=new q(this.compare);t.size=e,t.array=this.array.slice(0,e);let n=new Array(s);for(let i=0;i<s;i++)n[i]=t.poll();return n};lr.exports=q});var pl=Hs(je=>{"use strict";var Sl=rr(),Xt=ar(),Gl=cr(),kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Tl(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var i=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return s[n]}})}),t}var dr,Wl={exports:{}};dr||(dr=1,function(s){var e=function(t){var n,i=Object.prototype,r=i.hasOwnProperty,o=Object.defineProperty||function(I,x,T){I[x]=T.value},a=typeof Symbol=="function"?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",d=a.toStringTag||"@@toStringTag";function p(I,x,T){return Object.defineProperty(I,x,{value:T,enumerable:!0,configurable:!0,writable:!0}),I[x]}try{p({},"")}catch{p=function(x,T,k){return x[T]=k}}function f(I,x,T,k){var C=x&&x.prototype instanceof S?x:S,E=Object.create(C.prototype),te=new O(k||[]);return o(E,"_invoke",{value:M(I,T,te)}),E}function h(I,x,T){try{return{type:"normal",arg:I.call(x,T)}}catch(k){return{type:"throw",arg:k}}}t.wrap=f;var v="suspendedStart",G="suspendedYield",y="executing",X="completed",L={};function S(){}function Z(){}function u(){}var m={};p(m,c,function(){return this});var b=Object.getPrototypeOf,g=b&&b(b(A([])));g&&g!==i&&r.call(g,c)&&(m=g);var w=u.prototype=S.prototype=Object.create(m);function W(I){["next","throw","return"].forEach(function(x){p(I,x,function(T){return this._invoke(x,T)})})}function R(I,x){function T(C,E,te,me){var pe=h(I[C],I,E);if(pe.type!=="throw"){var Wt=pe.arg,Ot=Wt.value;return Ot&&typeof Ot=="object"&&r.call(Ot,"__await")?x.resolve(Ot.__await).then(function(ht){T("next",ht,te,me)},function(ht){T("throw",ht,te,me)}):x.resolve(Ot).then(function(ht){Wt.value=ht,te(Wt)},function(ht){return T("throw",ht,te,me)})}me(pe.arg)}var k;o(this,"_invoke",{value:function(C,E){function te(){return new x(function(me,pe){T(C,E,me,pe)})}return k=k?k.then(te,te):te()}})}function M(I,x,T){var k=v;return function(C,E){if(k===y)throw new Error("Generator is already running");if(k===X){if(C==="throw")throw E;return{value:n,done:!0}}for(T.method=C,T.arg=E;;){var te=T.delegate;if(te){var me=K(te,T);if(me){if(me===L)continue;return me}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(k===v)throw k=X,T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);k=y;var pe=h(I,x,T);if(pe.type==="normal"){if(k=T.done?X:G,pe.arg===L)continue;return{value:pe.arg,done:T.done}}pe.type==="throw"&&(k=X,T.method="throw",T.arg=pe.arg)}}}function K(I,x){var T=x.method,k=I.iterator[T];if(k===n)return x.delegate=null,T==="throw"&&I.iterator.return&&(x.method="return",x.arg=n,K(I,x),x.method==="throw")||T!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+T+"' method")),L;var C=h(k,I.iterator,x.arg);if(C.type==="throw")return x.method="throw",x.arg=C.arg,x.delegate=null,L;var E=C.arg;return E?E.done?(x[I.resultName]=E.value,x.next=I.nextLoc,x.method!=="return"&&(x.method="next",x.arg=n),x.delegate=null,L):E:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,L)}function N(I){var x={tryLoc:I[0]};1 in I&&(x.catchLoc=I[1]),2 in I&&(x.finallyLoc=I[2],x.afterLoc=I[3]),this.tryEntries.push(x)}function H(I){var x=I.completion||{};x.type="normal",delete x.arg,I.completion=x}function O(I){this.tryEntries=[{tryLoc:"root"}],I.forEach(N,this),this.reset(!0)}function A(I){if(I!=null){var x=I[c];if(x)return x.call(I);if(typeof I.next=="function")return I;if(!isNaN(I.length)){var T=-1,k=function C(){for(;++T<I.length;)if(r.call(I,T))return C.value=I[T],C.done=!1,C;return C.value=n,C.done=!0,C};return k.next=k}}throw new TypeError(typeof I+" is not iterable")}return Z.prototype=u,o(w,"constructor",{value:u,configurable:!0}),o(u,"constructor",{value:Z,configurable:!0}),Z.displayName=p(u,d,"GeneratorFunction"),t.isGeneratorFunction=function(I){var x=typeof I=="function"&&I.constructor;return!!x&&(x===Z||(x.displayName||x.name)==="GeneratorFunction")},t.mark=function(I){return Object.setPrototypeOf?Object.setPrototypeOf(I,u):(I.__proto__=u,p(I,d,"GeneratorFunction")),I.prototype=Object.create(w),I},t.awrap=function(I){return{__await:I}},W(R.prototype),p(R.prototype,l,function(){return this}),t.AsyncIterator=R,t.async=function(I,x,T,k,C){C===void 0&&(C=Promise);var E=new R(f(I,x,T,k),C);return t.isGeneratorFunction(x)?E:E.next().then(function(te){return te.done?te.value:E.next()})},W(w),p(w,d,"Generator"),p(w,c,function(){return this}),p(w,"toString",function(){return"[object Generator]"}),t.keys=function(I){var x=Object(I),T=[];for(var k in x)T.push(k);return T.reverse(),function C(){for(;T.length;){var E=T.pop();if(E in x)return C.value=E,C.done=!1,C}return C.done=!0,C}},t.values=A,O.prototype={constructor:O,reset:function(I){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(H),!I)for(var x in this)x.charAt(0)==="t"&&r.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=n)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var x=this;function T(pe,Wt){return E.type="throw",E.arg=I,x.next=pe,Wt&&(x.method="next",x.arg=n),!!Wt}for(var k=this.tryEntries.length-1;k>=0;--k){var C=this.tryEntries[k],E=C.completion;if(C.tryLoc==="root")return T("end");if(C.tryLoc<=this.prev){var te=r.call(C,"catchLoc"),me=r.call(C,"finallyLoc");if(te&&me){if(this.prev<C.catchLoc)return T(C.catchLoc,!0);if(this.prev<C.finallyLoc)return T(C.finallyLoc)}else if(te){if(this.prev<C.catchLoc)return T(C.catchLoc,!0)}else{if(!me)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return T(C.finallyLoc)}}}},abrupt:function(I,x){for(var T=this.tryEntries.length-1;T>=0;--T){var k=this.tryEntries[T];if(k.tryLoc<=this.prev&&r.call(k,"finallyLoc")&&this.prev<k.finallyLoc){var C=k;break}}C&&(I==="break"||I==="continue")&&C.tryLoc<=x&&x<=C.finallyLoc&&(C=null);var E=C?C.completion:{};return E.type=I,E.arg=x,C?(this.method="next",this.next=C.finallyLoc,L):this.complete(E)},complete:function(I,x){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&x&&(this.next=x),L},finish:function(I){for(var x=this.tryEntries.length-1;x>=0;--x){var T=this.tryEntries[x];if(T.finallyLoc===I)return this.complete(T.completion,T.afterLoc),H(T),L}},catch:function(I){for(var x=this.tryEntries.length-1;x>=0;--x){var T=this.tryEntries[x];if(T.tryLoc===I){var k=T.completion;if(k.type==="throw"){var C=k.arg;H(T)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(I,x,T){return this.delegate={iterator:A(I),resultName:x,nextLoc:T},this.method==="next"&&(this.arg=n),L}},t}(s.exports);try{globalThis.regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(Wl));var Ln={CROQUET_VERSION:"2.0.4"},Ns=window&&window.location.hostname.endsWith("croquet.studio"),hr="",Ct="";function ur(s,e){if(e)for(let t of e.split("&")){let n=t.split("="),i=n[0],r=!0;if(n.length>1&&(r=decodeURIComponent(n.slice(1).join("=")),r.match(/^(true|false|null|[0-9.]*|["[{].*)$/)))try{r=JSON.parse(r)}catch{r[0]==="["&&(r=r.slice(1,-1).split(","))}s[i]=r}}var Y=new class{constructor(){this.getSession(),ur(this,window.location.search.slice(1)),ur(this,Ns?window.location.hash.slice(1):Ct),window.location.pathname.indexOf("/ar.html")>=0&&(this.ar=!0)}has(s,e){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];typeof t=="string"&&(t=this.isHost(t));let n=this[s];if(typeof n!="string")return t;let i=n.split(",");return t===!0&&(e=`no${e}`),e.endsWith("s")&&(e=e.slice(0,-1)),i.includes(e)||i.includes(`${e}s`)?!t:t}getSession(){if(Ns){let s=/^\/([^/]+)\/(.*)$/,e=window.location.pathname.match(s);if(e)return hr=e[1],e[2]}else{let s=/^#([^&]+)&?(.*)$/,e=window.location.hash.match(s);if(e)return e[1].includes("=")?(Ct=`${e[1]}&${e[2]}`,""):(Ct=e[2],e[1])}return typeof this.session=="string"?(Ct=window.location.hash.slice(1),this.session):""}setSession(s){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];Ns==null&&this.getSession();let{search:t,hash:n}=window.location,i=Ns?`/${hr}/${s}${t}${n}`:`#${s}${Ct?"&"+Ct:""}`;e?window.history.replaceState({},"",i):window.history.pushState({},"",i)}isHost(s){let e=window.location.hostname;return e===s?!0:s!=="localhost"?!1:e.endsWith(".ngrok.io")||e==="croquet.io"&&window.location.pathname.match(/^\/(dev|files)\//)?!0:window.location.protocol==="file:"||["127.0.0.1","[::1]"].includes(e)}isLocalhost(){return this.isHost("localhost")}},It,ft=256,Cl=Math.pow(ft,6),la=Math.pow(2,52),kl=2*la,bt=255;function dn(s,e){var t=[];if((e=e||{}).entropy)throw new Error("this version of seedrandom does not support entropy");if(s==null&&!e.state)throw new Error("this version of seedrandom requires a seed");(function(r,o){for(var a,c=r+"",l=0;l<c.length;)o[bt&l]=bt&(a^=19*o[bt&l])+c.charCodeAt(l++);return d=o,String.fromCharCode.apply(0,d);var d})(ca(s,3),t);var n=new Pl(t),i=function(){for(var r=n.g(6),o=Cl,a=0;r<la;)r=(r+a)*ft,o*=ft,a=n.g(1);for(;r>=kl;)r/=2,o/=2,a>>>=1;return(r+a)/o};return i.int32=function(){return 0|n.g(4)},i.quick=function(){return n.g(4)/4294967296},i.double=i,(e.pass||function(r,o){return o&&(o.S&&mr(o,n),r.state=function(){return mr(n,{})}),r})(i,e.state)}function Pl(s){var e,t=s.length,n=this,i=0,r=n.i=n.j=0,o=n.S=[];for(t||(s=[t++]);i<ft;)o[i]=i++;for(i=0;i<ft;i++)o[i]=o[r=bt&r+s[i%t]+(e=o[i])],o[r]=e;(n.g=function(a){for(var c,l=0,d=n.i,p=n.j,f=n.S;a--;)c=f[d=bt&d+1],l=l*ft+f[bt&(f[d]=f[p=bt&p+c])+(f[p]=c)];return n.i=d,n.j=p,l})(ft)}function mr(s,e){return e.i=s.i,e.j=s.j,e.S=s.S.slice(),e}function ca(s,e){var t,n=[],i=typeof s;if(e&&i=="object")for(t in s)try{n.push(ca(s[t],e-1))}catch{}return n.length?n:i=="string"?s:s+"\0"}(function(){function s(u){this.mode=t.MODE_8BIT_BYTE,this.data=u,this.parsedData=[];for(var m=0,b=this.data.length;m<b;m++){var g=[],w=this.data.charCodeAt(m);w>65536?(g[0]=240|(1835008&w)>>>18,g[1]=128|(258048&w)>>>12,g[2]=128|(4032&w)>>>6,g[3]=128|63&w):w>2048?(g[0]=224|(61440&w)>>>12,g[1]=128|(4032&w)>>>6,g[2]=128|63&w):w>128?(g[0]=192|(1984&w)>>>6,g[1]=128|63&w):g[0]=w,this.parsedData.push(g)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(u,m){this.typeNumber=u,this.errorCorrectLevel=m,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}s.prototype={getLength:function(u){return this.parsedData.length},write:function(u){for(var m=0,b=this.parsedData.length;m<b;m++)u.put(this.parsedData[m],8)}},e.prototype={addData:function(u){var m=new s(u);this.dataList.push(m),this.dataCache=null},isDark:function(u,m){if(u<0||this.moduleCount<=u||m<0||this.moduleCount<=m)throw new Error(u+","+m);return this.modules[u][m]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(u,m){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++){this.modules[b]=new Array(this.moduleCount);for(var g=0;g<this.moduleCount;g++)this.modules[b][g]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(u,m),this.typeNumber>=7&&this.setupTypeNumber(u),this.dataCache==null&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,m)},setupPositionProbePattern:function(u,m){for(var b=-1;b<=7;b++)if(!(u+b<=-1||this.moduleCount<=u+b))for(var g=-1;g<=7;g++)m+g<=-1||this.moduleCount<=m+g||(this.modules[u+b][m+g]=0<=b&&b<=6&&(g==0||g==6)||0<=g&&g<=6&&(b==0||b==6)||2<=b&&b<=4&&2<=g&&g<=4)},getBestMaskPattern:function(){for(var u=0,m=0,b=0;b<8;b++){this.makeImpl(!0,b);var g=f.getLostPoint(this);(b==0||u>g)&&(u=g,m=b)}return m},createMovieClip:function(u,m,b){var g=u.createEmptyMovieClip(m,b);this.make();for(var w=0;w<this.modules.length;w++)for(var W=1*w,R=0;R<this.modules[w].length;R++){var M=1*R;this.modules[w][R]&&(g.beginFill(0,100),g.moveTo(M,W),g.lineTo(M+1,W),g.lineTo(M+1,W+1),g.lineTo(M,W+1),g.endFill())}return g},setupTimingPattern:function(){for(var u=8;u<this.moduleCount-8;u++)this.modules[u][6]==null&&(this.modules[u][6]=u%2==0);for(var m=8;m<this.moduleCount-8;m++)this.modules[6][m]==null&&(this.modules[6][m]=m%2==0)},setupPositionAdjustPattern:function(){for(var u=f.getPatternPosition(this.typeNumber),m=0;m<u.length;m++)for(var b=0;b<u.length;b++){var g=u[m],w=u[b];if(this.modules[g][w]==null)for(var W=-2;W<=2;W++)for(var R=-2;R<=2;R++)this.modules[g+W][w+R]=W==-2||W==2||R==-2||R==2||W==0&&R==0}},setupTypeNumber:function(u){for(var m=f.getBCHTypeNumber(this.typeNumber),b=0;b<18;b++){var g=!u&&(m>>b&1)==1;this.modules[Math.floor(b/3)][b%3+this.moduleCount-8-3]=g}for(b=0;b<18;b++)g=!u&&(m>>b&1)==1,this.modules[b%3+this.moduleCount-8-3][Math.floor(b/3)]=g},setupTypeInfo:function(u,m){for(var b=this.errorCorrectLevel<<3|m,g=f.getBCHTypeInfo(b),w=0;w<15;w++){var W=!u&&(g>>w&1)==1;w<6?this.modules[w][8]=W:w<8?this.modules[w+1][8]=W:this.modules[this.moduleCount-15+w][8]=W}for(w=0;w<15;w++)W=!u&&(g>>w&1)==1,w<8?this.modules[8][this.moduleCount-w-1]=W:w<9?this.modules[8][15-w-1+1]=W:this.modules[8][15-w-1]=W;this.modules[this.moduleCount-8][8]=!u},mapData:function(u,m){for(var b=-1,g=this.moduleCount-1,w=7,W=0,R=this.moduleCount-1;R>0;R-=2)for(R==6&&R--;;){for(var M=0;M<2;M++)if(this.modules[g][R-M]==null){var K=!1;W<u.length&&(K=(u[W]>>>w&1)==1),f.getMask(m,g,R-M)&&(K=!K),this.modules[g][R-M]=K,--w==-1&&(W++,w=7)}if((g+=b)<0||this.moduleCount<=g){g-=b,b=-b;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(u,m,b){for(var g=y.getRSBlocks(u,m),w=new X,W=0;W<b.length;W++){var R=b[W];w.put(R.mode,4),w.put(R.getLength(),f.getLengthInBits(R.mode,u)),R.write(w)}var M=0;for(W=0;W<g.length;W++)M+=g[W].dataCount;if(w.getLengthInBits()>8*M)throw new Error("code length overflow. ("+w.getLengthInBits()+">"+8*M+")");for(w.getLengthInBits()+4<=8*M&&w.put(0,4);w.getLengthInBits()%8!=0;)w.putBit(!1);for(;!(w.getLengthInBits()>=8*M||(w.put(e.PAD0,8),w.getLengthInBits()>=8*M));)w.put(e.PAD1,8);return e.createBytes(w,g)},e.createBytes=function(u,m){for(var b=0,g=0,w=0,W=new Array(m.length),R=new Array(m.length),M=0;M<m.length;M++){var K=m[M].dataCount,N=m[M].totalCount-K;g=Math.max(g,K),w=Math.max(w,N),W[M]=new Array(K);for(var H=0;H<W[M].length;H++)W[M][H]=255&u.buffer[H+b];b+=K;var O=f.getErrorCorrectPolynomial(N),A=new G(W[M],O.getLength()-1).mod(O);for(R[M]=new Array(O.getLength()-1),H=0;H<R[M].length;H++){var I=H+A.getLength()-R[M].length;R[M][H]=I>=0?A.get(I):0}}var x=0;for(H=0;H<m.length;H++)x+=m[H].totalCount;var T=new Array(x),k=0;for(H=0;H<g;H++)for(M=0;M<m.length;M++)H<W[M].length&&(T[k++]=W[M][H]);for(H=0;H<w;H++)for(M=0;M<m.length;M++)H<R[M].length&&(T[k++]=R[M][H]);return T};for(var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},i=0,r=1,o=2,a=3,c=4,l=5,d=6,p=7,f={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(u){for(var m=u<<10;f.getBCHDigit(m)-f.getBCHDigit(f.G15)>=0;)m^=f.G15<<f.getBCHDigit(m)-f.getBCHDigit(f.G15);return(u<<10|m)^f.G15_MASK},getBCHTypeNumber:function(u){for(var m=u<<12;f.getBCHDigit(m)-f.getBCHDigit(f.G18)>=0;)m^=f.G18<<f.getBCHDigit(m)-f.getBCHDigit(f.G18);return u<<12|m},getBCHDigit:function(u){for(var m=0;u!=0;)m++,u>>>=1;return m},getPatternPosition:function(u){return f.PATTERN_POSITION_TABLE[u-1]},getMask:function(u,m,b){switch(u){case i:return(m+b)%2==0;case r:return m%2==0;case o:return b%3==0;case a:return(m+b)%3==0;case c:return(Math.floor(m/2)+Math.floor(b/3))%2==0;case l:return m*b%2+m*b%3==0;case d:return(m*b%2+m*b%3)%2==0;case p:return(m*b%3+(m+b)%2)%2==0;default:throw new Error("bad maskPattern:"+u)}},getErrorCorrectPolynomial:function(u){for(var m=new G([1],0),b=0;b<u;b++)m=m.multiply(new G([1,h.gexp(b)],0));return m},getLengthInBits:function(u,m){if(1<=m&&m<10)switch(u){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:case t.MODE_KANJI:return 8;default:throw new Error("mode:"+u)}else if(m<27)switch(u){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw new Error("mode:"+u)}else{if(!(m<41))throw new Error("type:"+m);switch(u){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw new Error("mode:"+u)}}},getLostPoint:function(u){for(var m=u.getModuleCount(),b=0,g=0;g<m;g++)for(var w=0;w<m;w++){for(var W=0,R=u.isDark(g,w),M=-1;M<=1;M++)if(!(g+M<0||m<=g+M))for(var K=-1;K<=1;K++)w+K<0||m<=w+K||M==0&&K==0||R==u.isDark(g+M,w+K)&&W++;W>5&&(b+=3+W-5)}for(g=0;g<m-1;g++)for(w=0;w<m-1;w++){var N=0;u.isDark(g,w)&&N++,u.isDark(g+1,w)&&N++,u.isDark(g,w+1)&&N++,u.isDark(g+1,w+1)&&N++,N!=0&&N!=4||(b+=3)}for(g=0;g<m;g++)for(w=0;w<m-6;w++)u.isDark(g,w)&&!u.isDark(g,w+1)&&u.isDark(g,w+2)&&u.isDark(g,w+3)&&u.isDark(g,w+4)&&!u.isDark(g,w+5)&&u.isDark(g,w+6)&&(b+=40);for(w=0;w<m;w++)for(g=0;g<m-6;g++)u.isDark(g,w)&&!u.isDark(g+1,w)&&u.isDark(g+2,w)&&u.isDark(g+3,w)&&u.isDark(g+4,w)&&!u.isDark(g+5,w)&&u.isDark(g+6,w)&&(b+=40);var H=0;for(w=0;w<m;w++)for(g=0;g<m;g++)u.isDark(g,w)&&H++;return b+=10*(Math.abs(100*H/m/m-50)/5)}},h={glog:function(u){if(u<1)throw new Error("glog("+u+")");return h.LOG_TABLE[u]},gexp:function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return h.EXP_TABLE[u]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},v=0;v<8;v++)h.EXP_TABLE[v]=1<<v;for(v=8;v<256;v++)h.EXP_TABLE[v]=h.EXP_TABLE[v-4]^h.EXP_TABLE[v-5]^h.EXP_TABLE[v-6]^h.EXP_TABLE[v-8];for(v=0;v<255;v++)h.LOG_TABLE[h.EXP_TABLE[v]]=v;function G(u,m){if(u.length==null)throw new Error(u.length+"/"+m);for(var b=0;b<u.length&&u[b]==0;)b++;this.num=new Array(u.length-b+m);for(var g=0;g<u.length-b;g++)this.num[g]=u[g+b]}function y(u,m){this.totalCount=u,this.dataCount=m}function X(){this.buffer=[],this.length=0}G.prototype={get:function(u){return this.num[u]},getLength:function(){return this.num.length},multiply:function(u){for(var m=new Array(this.getLength()+u.getLength()-1),b=0;b<this.getLength();b++)for(var g=0;g<u.getLength();g++)m[b+g]^=h.gexp(h.glog(this.get(b))+h.glog(u.get(g)));return new G(m,0)},mod:function(u){if(this.getLength()-u.getLength()<0)return this;for(var m=h.glog(this.get(0))-h.glog(u.get(0)),b=new Array(this.getLength()),g=0;g<this.getLength();g++)b[g]=this.get(g);for(g=0;g<u.getLength();g++)b[g]^=h.gexp(h.glog(u.get(g))+m);return new G(b,0).mod(u)}},y.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],y.getRSBlocks=function(u,m){var b=y.getRsBlockTable(u,m);if(b==null)throw new Error("bad rs block @ typeNumber:"+u+"/errorCorrectLevel:"+m);for(var g=b.length/3,w=[],W=0;W<g;W++)for(var R=b[3*W+0],M=b[3*W+1],K=b[3*W+2],N=0;N<R;N++)w.push(new y(M,K));return w},y.getRsBlockTable=function(u,m){switch(m){case n.L:return y.RS_BLOCK_TABLE[4*(u-1)+0];case n.M:return y.RS_BLOCK_TABLE[4*(u-1)+1];case n.Q:return y.RS_BLOCK_TABLE[4*(u-1)+2];case n.H:return y.RS_BLOCK_TABLE[4*(u-1)+3];default:return}},X.prototype={get:function(u){var m=Math.floor(u/8);return(this.buffer[m]>>>7-u%8&1)==1},put:function(u,m){for(var b=0;b<m;b++)this.putBit((u>>>m-b-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(u){var m=Math.floor(this.length/8);this.buffer.length<=m&&this.buffer.push(0),u&&(this.buffer[m]|=128>>>this.length%8),this.length++}};var L=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],S=function(){var u=function(m,b){this._bIsPainted=!1,this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,m.appendChild(this._elCanvas),this._el=m,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._bSupportDataURI=null};return u.prototype.draw=function(m){var b=this._oContext,g=this._htOption,w=m.getModuleCount(),W=g.width/w,R=g.height/w,M=Math.round(W),K=Math.round(R);this.clear();for(var N=0;N<w;N++)for(var H=0;H<w;H++){var O=m.isDark(N,H),A=H*W,I=N*R;b.strokeStyle=O?g.colorDark:g.colorLight,b.lineWidth=1,b.fillStyle=O?g.colorDark:g.colorLight,b.fillRect(A,I,W,R),b.strokeRect(Math.floor(A)+.5,Math.floor(I)+.5,M,K),b.strokeRect(Math.ceil(A)-.5,Math.ceil(I)-.5,M,K)}this._bIsPainted=!0},u.prototype.isPainted=function(){return this._bIsPainted},u.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},u.prototype.round=function(m){return m&&Math.floor(1e3*m)/1e3},u}();function Z(u,m){for(var b=1,g=function(M){var K=encodeURI(M).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return K.length+(K.length!=M?3:0)}(u),w=0,W=L.length;w<=W;w++){var R=0;switch(m){case n.L:R=L[w][0];break;case n.M:R=L[w][1];break;case n.Q:R=L[w][2];break;case n.H:R=L[w][3]}if(g<=R)break;b++}if(b>L.length)throw new Error("Too long data");return b}It=function(u,m){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.H},typeof m=="string"&&(m={text:m}),m)for(var b in m)this._htOption[b]=m[b];typeof u=="string"&&(u=document.getElementById(u)),this._htOption.useSVG&&(S=svgDrawer),this._el=u,this._oQRCode=null,this._oDrawing=new S(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},It.prototype.makeCode=function(u){this._oQRCode=new e(Z(u,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(u),this._oQRCode.make(),this._oDrawing.draw(this._oQRCode)},It.prototype.clear=function(){this._oDrawing.clear()},It.prototype.getCanvas=function(){for(let u=0;u<this._el.children.length;u++){let m=this._el.children[u];if(m.tagName==="CANVAS")return m}return null},It.CorrectLevel=n})();var pr=It,fr={exports:{}},br,yr={exports:{}},Il=Tl(Object.freeze({__proto__:null,default:{}}));function Ze(){return br||(br=1,yr.exports=(s=s||function(e,t){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&kn!==void 0&&kn.crypto&&(n=kn.crypto),!n)try{n=Il}catch{}var i=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function y(){}return function(X){var L;return y.prototype=X,L=new y,y.prototype=null,L}}(),o={},a=o.lib={},c=a.Base={extend:function(y){var X=r(this);return y&&X.mixIn(y),X.hasOwnProperty("init")&&this.init!==X.init||(X.init=function(){X.$super.init.apply(this,arguments)}),X.init.prototype=X,X.$super=this,X},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var X in y)y.hasOwnProperty(X)&&(this[X]=y[X]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(y,X){y=this.words=y||[],this.sigBytes=X!=t?X:4*y.length},toString:function(y){return(y||p).stringify(this)},concat:function(y){var X=this.words,L=y.words,S=this.sigBytes,Z=y.sigBytes;if(this.clamp(),S%4)for(var u=0;u<Z;u++){var m=L[u>>>2]>>>24-u%4*8&255;X[S+u>>>2]|=m<<24-(S+u)%4*8}else for(var b=0;b<Z;b+=4)X[S+b>>>2]=L[b>>>2];return this.sigBytes+=Z,this},clamp:function(){var y=this.words,X=this.sigBytes;y[X>>>2]&=4294967295<<32-X%4*8,y.length=e.ceil(X/4)},clone:function(){var y=c.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var X=[],L=0;L<y;L+=4)X.push(i());return new l.init(X,y)}}),d=o.enc={},p=d.Hex={stringify:function(y){for(var X=y.words,L=y.sigBytes,S=[],Z=0;Z<L;Z++){var u=X[Z>>>2]>>>24-Z%4*8&255;S.push((u>>>4).toString(16)),S.push((15&u).toString(16))}return S.join("")},parse:function(y){for(var X=y.length,L=[],S=0;S<X;S+=2)L[S>>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new l.init(L,X/2)}},f=d.Latin1={stringify:function(y){for(var X=y.words,L=y.sigBytes,S=[],Z=0;Z<L;Z++){var u=X[Z>>>2]>>>24-Z%4*8&255;S.push(String.fromCharCode(u))}return S.join("")},parse:function(y){for(var X=y.length,L=[],S=0;S<X;S++)L[S>>>2]|=(255&y.charCodeAt(S))<<24-S%4*8;return new l.init(L,X)}},h=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(f.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return f.parse(unescape(encodeURIComponent(y)))}},v=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=h.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var X,L=this._data,S=L.words,Z=L.sigBytes,u=this.blockSize,m=Z/(4*u),b=(m=y?e.ceil(m):e.max((0|m)-this._minBufferSize,0))*u,g=e.min(4*b,Z);if(b){for(var w=0;w<b;w+=u)this._doProcessBlock(S,w);X=S.splice(0,b),L.sigBytes-=g}return new l.init(X,g)},clone:function(){var y=c.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});a.Hasher=v.extend({cfg:c.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){return y&&this._append(y),this._doFinalize()},blockSize:16,_createHelper:function(y){return function(X,L){return new y.init(L).finalize(X)}},_createHmacHelper:function(y){return function(X,L){return new G.HMAC.init(y,L).finalize(X)}}});var G=o.algo={};return o}(Math),s)),yr.exports;var s}var gr,Pn,wr,Rl=(gr||(gr=1,fr.exports=(Pn=Ze(),function(){if(typeof ArrayBuffer=="function"){var s=Pn.lib.WordArray,e=s.init,t=s.init=function(n){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),(n instanceof Int8Array||typeof Uint8ClampedArray<"u"&&n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),n instanceof Uint8Array){for(var i=n.byteLength,r=[],o=0;o<i;o++)r[o>>>2]|=n[o]<<24-o%4*8;e.call(this,r,i)}else e.apply(this,arguments)};t.prototype=s}}(),Pn.lib.WordArray)),fr.exports),yt=Tt(Rl),Zr={exports:{}};function Ei(){return wr||(wr=1,Zr.exports=function(s){return function(e){var t=s,n=t.lib,i=n.WordArray,r=n.Hasher,o=t.algo,a=[],c=[];(function(){function p(G){for(var y=e.sqrt(G),X=2;X<=y;X++)if(!(G%X))return!1;return!0}function f(G){return 4294967296*(G-(0|G))|0}for(var h=2,v=0;v<64;)p(h)&&(v<8&&(a[v]=f(e.pow(h,.5))),c[v]=f(e.pow(h,1/3)),v++),h++})();var l=[],d=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(p,f){for(var h=this._hash.words,v=h[0],G=h[1],y=h[2],X=h[3],L=h[4],S=h[5],Z=h[6],u=h[7],m=0;m<64;m++){if(m<16)l[m]=0|p[f+m];else{var b=l[m-15],g=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,w=l[m-2],W=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;l[m]=g+l[m-7]+W+l[m-16]}var R=v&G^v&y^G&y,M=(v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22),K=u+((L<<26|L>>>6)^(L<<21|L>>>11)^(L<<7|L>>>25))+(L&S^~L&Z)+c[m]+l[m];u=Z,Z=S,S=L,L=X+K|0,X=y,y=G,G=v,v=K+(M+R)|0}h[0]=h[0]+v|0,h[1]=h[1]+G|0,h[2]=h[2]+y|0,h[3]=h[3]+X|0,h[4]=h[4]+L|0,h[5]=h[5]+S|0,h[6]=h[6]+Z|0,h[7]=h[7]+u|0},_doFinalize:function(){var p=this._data,f=p.words,h=8*this._nDataBytes,v=8*p.sigBytes;return f[v>>>5]|=128<<24-v%32,f[14+(v+64>>>9<<4)]=e.floor(h/4294967296),f[15+(v+64>>>9<<4)]=h,p.sigBytes=4*f.length,this._process(),this._hash},clone:function(){var p=r.clone.call(this);return p._hash=this._hash.clone(),p}});t.SHA256=r._createHelper(d),t.HmacSHA256=r._createHmacHelper(d)}(Math),s.SHA256}(Ze())),Zr.exports}var da=Tt(Ei()),Vl=Ln.CROQUET_PLATFORM==="node",ha;function ua(s){let e=s.sigBytes,t=s.words,n=new Uint8Array(e),i=0,r=0;for(;i<e;){let o=t[r++];if(n[i++]=(4278190080&o)>>>24,i===e||(n[i++]=(16711680&o)>>>16,i===e)||(n[i++]=(65280&o)>>>8,i===e))break;n[i++]=255&o}return n}function ma(s){function e(n){let i=n.indexOf("{"),r=n.lastIndexOf("}");if(i===-1||r===-1||r<i)return n;let o=n.slice(0,i).replace(/\s+/g," ").replace(/\s\(/,"("),a=n.slice(i+1,r);return`${o.trim()}{${a.trim()}}`}let t=e(""+s);if(!t.startsWith("class")){let n=s.prototype;n&&(t+=Object.getOwnPropertyNames(n).map(i=>`${i}:${e(""+n[i])}`).join(""))}return t}function pa(s){return btoa(String.fromCharCode(...new Uint8Array(s))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function vr(){return Y.has("debug","hashing",!1)}ha=globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest=="function"?globalThis.crypto.subtle.digest.bind(globalThis.crypto.subtle):(s,e)=>{if(s!=="SHA-256")throw Error(`${P.libName}: only SHA-256 available`);let t=yt.create(e);return ua(da(t)).buffer};var Re={},Ml=new TextEncoder;async function Yt(s){let e=Ml.encode(s),t=await async function(n){return n.length===0?"47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU":pa(await ha("SHA-256",n))}(e);return Re[t]={string:s,buffer:e},t}var ji=[],Xr={},Lr=new Set,Yl=Date.now();typeof performance>"u"&&(window.performance={now:()=>Date.now()-Yl});var Hl=["simulate","update","render","snapshot"],on={total:"black",update:"blue",render:"magenta",simulate:"yellow",snapshot:"green",backlog:"red",network:"lightgray"},Ht,Rt,hn=null,le=null,B=null,In=0,Xe=null,Je=null;function Kl(s){for(hn=s;s.firstChild;)s.removeChild(s.firstChild);s.style.background="#faf0dc",Xe=document.createElement("canvas"),Je=Xe.getContext("2d"),Xe.id="text_stats",Xe.width=Math.min(140,window.innerWidth),Xe.height=36,Xe.style.width=Xe.width,Xe.style.height=Xe.height,Je.font="9.5pt sans-serif",s.appendChild(Xe),s.title=Object.entries(on).map(t=>{let[n,i]=t;return`${i}: ${n}`}).join(`
`),le=document.createElement("canvas"),le.width=Math.min(125,window.innerWidth),le.height=125,le.style.width="100%";let e=document.createElement("div");e.id="innerDiv",s.appendChild(e),e.appendChild(le),B=le.getContext("2d")}var Fe=[],xr=0,an=!1,$=fa(0),Ji=1e3/60;function Vt(s){return 20*(1-s/Ji)+60}function Nl(s){Ht=function(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.style.width="100%",t.style.position="absolute",t.style.left="0px",hn.querySelector("#innerDiv").appendChild(t),t}(s),Rt=Ht.getContext("2d"),Rt.strokeStyle="rgba(255, 255, 255, 0.5)";for(let e=0;e<60;e+=Ji){let t=Vt(e);Rt.moveTo(0,t),Rt.lineTo(Ht.width,t),Rt.stroke()}}function fa(s){return{start:s,total:0,items:{},users:0,backlog:0,network:0,latency:0,activity:1e3,connected:an}}function zl(s){$.total=s-$.start;let e=Math.min(120,window.innerWidth);if(Fe.length>=e&&Fe.splice(0,Fe.length-e+1),Fe.push($),Fe.length<=1||!hn||hn.offsetHeight===0)return;let t=Fe.slice(1).filter(o=>o.total),n=t.map(o=>o.total).reduce((o,a)=>o+a,0)/t.length,i=Math.max(...t.map(o=>o.total));Math.max(...t.map(o=>Math.max(o.backlog,o.network))),xr=1e3,function(o,a){Je.globalCompositeOperation="copy",Je.fillStyle="rgb(255, 255, 255, 0)",Je.fillRect(0,0,Xe.width,Xe.height),Je.fillStyle="rgb(0, 0, 0, 1)",Je.globalCompositeOperation="source-over";let c=`${$.users} users, ${Math.round(1e3/o)} fps`;a>70&&(c+=` ${Math.ceil(a).toLocaleString()}ms`),Je.fillText(c,2,15),c=$.backlog<100&&$.activity<1e3?`latency: ${$.latency} ms`:`backlog: ${$.backlog<100?"0.0":($.backlog/1e3).toFixed(1)} s`,Je.fillText(c,2,33)}(n,i),Ht||Nl(le),In===le.width?(B.globalCompositeOperation="copy",B.drawImage(le,1,0,le.width-1,le.height,0,0,le.width-1,le.height),B.globalCompositeOperation="source-over",B.fillStyle="transparent",B.fillRect(le.width-1,0,1,le.height)):In++;let r=o=>Vt(o/xr*-2*Ji)+5;{let o=Fe[Fe.length-1],a=In-.5,c=Vt(0);B.beginPath(),B.moveTo(a,c),B.lineTo(a,Vt(o.total)),B.strokeStyle=on[o.connected?"total":"network"],B.stroke(),B.beginPath(),B.moveTo(a,c),c=Vt(o.total);let l=0;for(let d of Hl)o.items[d]&&(l+=o.items[d],c=Vt(l),B.lineTo(a,c),B.strokeStyle=on[d],B.stroke(),B.beginPath(),B.moveTo(a,c));o.network&&(B.beginPath(),B.moveTo(a,r(0)),B.lineTo(a,r(o.network)),B.strokeStyle=on.network,B.stroke())}}var kt=[],ut={},Pe={},_={frames:Fe,animationFrame(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};zl(s),$=fa(s);for(let[t,n]of Object.entries(e))this[t](n)},begin(s){let e=performance.now();$.items[s]=($.items[s]||0)-e;let t=kt[kt.length-1];return t&&($.items[t]+=e),kt.push(s),e},end(s){let e=performance.now();$.items[s]+=e;let t=kt.pop();if(t!==s)throw Error(`Unmatched stats calls: expected end("${t}"), got end("${s}")`);let n=kt[kt.length-1];return n&&($.items[n]-=e),e},backlog(s){$.backlog=Math.max(s,$.backlog)},starvation(s){$.network=s},latency(s){$.latency=s},activity(s){$.activity=s},users(s){$.users=s},connected(s){let e=an;$.connected=an=s,e&&!an&&Ht&&(Ht.remove(),Rt=null)},networkTraffic:ut,addNetworkTraffic(s,e){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];ut[s]=(ut[s]||0)+e,t&&(ut[`audit_${s}`]=(ut[`audit_${s}`]||0)+e)},resetAuditStats(){for(let s in ut)s.startsWith("audit_")&&(ut[s]=0)},perSecondTally(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(window.logMessageStats)for(let[e,t]of Object.entries(s))Pe[e]=(Pe[e]||0)+t},stepSession(s){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],t=Math.floor(Date.now()/1e3);if(!window.logMessageStats)return Pe={second:t},null;let n=null;if(t!==Pe.second){if(Pe.second&&e&&(Pe.requestedMessages||Pe.sentMessagesTotal)){n={...Pe};let i=t-Pe.second;i!==1&&(n.sampleSeconds=i),n.sentBundles&&(n.averageDelay=Math.round(10*n.sendDelay/n.sentMessagesTotal)/10,n.averageBundlePayload=Math.round(n.sentBundlePayload/n.sentBundles)),delete n.second,delete n.sendDelay,delete n.sentBundlePayload}Pe={second:t}}return n}};globalThis.CROQUETSTATS=_;var Nt="ontouchstart"in document.documentElement,ba=window&&window.parent!==window,yi=Nt?20:12,Sr=Nt?0:15,Gr=!1,Tr=!1,Oe,Wr=!1;function nt(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s&&P.showMessage(s,{...e,level:"warning"})}function ya(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s&&P.showMessage(s,{...e,level:"status"})}function ae(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"error";console.error(`Error during ${s}`,e);let n=(e.stack||"").split(`
`).filter(i=>!i.match(/cr