create-airjam 0.1.0 → 0.1.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.
- package/dist/index.js +11 -3
- package/package.json +6 -3
- package/templates/pong/.env.example +11 -0
- package/templates/pong/.env.local +10 -0
- package/templates/pong/AI_INSTRUCTIONS.md +44 -0
- package/templates/pong/README.md +111 -0
- package/templates/pong/airjam-docs/getting-started/architecture/page.md +165 -0
- package/templates/pong/airjam-docs/getting-started/game-ideas/page.md +114 -0
- package/templates/pong/airjam-docs/getting-started/introduction/page.md +122 -0
- package/templates/pong/airjam-docs/how-it-works/host-system/page.md +241 -0
- package/templates/pong/airjam-docs/sdk/hooks/page.md +403 -0
- package/templates/pong/airjam-docs/sdk/input-system/page.md +336 -0
- package/templates/pong/airjam-docs/sdk/networked-state/page.md +575 -0
- package/templates/pong/dist/assets/index-B9l0NKly.js +269 -0
- package/templates/pong/dist/assets/index-CHKqdIQG.css +1 -0
- package/templates/pong/dist/index.html +14 -0
- package/templates/pong/eslint.config.js +33 -0
- package/templates/pong/index.html +6 -1
- package/templates/pong/node_modules/.bin/air-jam-server +17 -0
- package/templates/pong/node_modules/.bin/eslint +17 -0
- package/templates/pong/node_modules/.bin/eslint-config-prettier +17 -0
- package/templates/pong/node_modules/.bin/jiti +17 -0
- package/templates/pong/node_modules/.bin/tsc +17 -0
- package/templates/pong/node_modules/.bin/tsserver +17 -0
- package/templates/pong/node_modules/.bin/tsx +17 -0
- package/templates/pong/node_modules/.bin/vite +17 -0
- package/templates/pong/node_modules/.vite/deps/@air-jam_sdk.js +66143 -0
- package/templates/pong/node_modules/.vite/deps/@air-jam_sdk.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/_metadata.json +73 -0
- package/templates/pong/node_modules/.vite/deps/chunk-3TUQC5ZT.js +292 -0
- package/templates/pong/node_modules/.vite/deps/chunk-3TUQC5ZT.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/chunk-DC5AMYBS.js +38 -0
- package/templates/pong/node_modules/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/chunk-QUPSG5AV.js +280 -0
- package/templates/pong/node_modules/.vite/deps/chunk-QUPSG5AV.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/chunk-TYOCAO5S.js +13810 -0
- package/templates/pong/node_modules/.vite/deps/chunk-TYOCAO5S.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/chunk-YG4BJP3V.js +1004 -0
- package/templates/pong/node_modules/.vite/deps/chunk-YG4BJP3V.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/package.json +3 -0
- package/templates/pong/node_modules/.vite/deps/react-dom.js +6 -0
- package/templates/pong/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/react-dom_client.js +20217 -0
- package/templates/pong/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/react-router-dom.js +13900 -0
- package/templates/pong/node_modules/.vite/deps/react-router-dom.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/react.js +5 -0
- package/templates/pong/node_modules/.vite/deps/react.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js +278 -0
- package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js +6 -0
- package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/templates/pong/node_modules/.vite/deps/zod.js +476 -0
- package/templates/pong/node_modules/.vite/deps/zod.js.map +7 -0
- package/templates/pong/package.json +12 -1
- package/templates/pong/src/App.tsx +2 -2
- package/templates/pong/src/controller-view.tsx +143 -0
- package/templates/pong/src/host-view.tsx +401 -0
- package/templates/pong/src/main.tsx +2 -1
- package/templates/pong/src/store.ts +80 -0
- package/templates/pong/tsconfig.json +3 -2
- package/templates/pong/vite.config.ts +3 -0
- package/templates/pong/src/ControllerView.tsx +0 -64
- package/templates/pong/src/HostView.tsx +0 -148
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
var Ib=Object.defineProperty;var Mb=(e,r,a)=>r in e?Ib(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a;var qi=(e,r,a)=>Mb(e,typeof r!="symbol"?r+"":r,a);function gx(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const f in s)if(f!=="default"&&!(f in e)){const g=Object.getOwnPropertyDescriptor(s,f);g&&Object.defineProperty(e,f,g.get?g:{enumerable:!0,get:()=>s[f]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))s(f);new MutationObserver(f=>{for(const g of f)if(g.type==="childList")for(const y of g.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&s(y)}).observe(document,{childList:!0,subtree:!0});function a(f){const g={};return f.integrity&&(g.integrity=f.integrity),f.referrerPolicy&&(g.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?g.credentials="include":f.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function s(f){if(f.ep)return;f.ep=!0;const g=a(f);fetch(f.href,g)}})();var Qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},Tl={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var up;function Db(){if(up)return Tl;up=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(s,f,g){var y=null;if(g!==void 0&&(y=""+g),f.key!==void 0&&(y=""+f.key),"key"in f){g={};for(var E in f)E!=="key"&&(g[E]=f[E])}else g=f;return f=g.ref,{$$typeof:e,type:s,key:y,ref:f!==void 0?f:null,props:g}}return Tl.Fragment=r,Tl.jsx=a,Tl.jsxs=a,Tl}var fp;function Bb(){return fp||(fp=1,lh.exports=Db()),lh.exports}var F=Bb(),ch={exports:{}},Je={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var dp;function Lb(){if(dp)return Je;dp=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function R(W){return W===null||typeof W!="object"?null:(W=S&&W[S]||W["@@iterator"],typeof W=="function"?W:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,z={};function L(W,se,Se){this.props=W,this.context=se,this.refs=z,this.updater=Se||k}L.prototype.isReactComponent={},L.prototype.setState=function(W,se){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,se,"setState")},L.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function Z(){}Z.prototype=L.prototype;function H(W,se,Se){this.props=W,this.context=se,this.refs=z,this.updater=Se||k}var j=H.prototype=new Z;j.constructor=H,I(j,L.prototype),j.isPureReactComponent=!0;var ae=Array.isArray;function ee(){}var X={H:null,A:null,T:null,S:null},de=Object.prototype.hasOwnProperty;function Q(W,se,Se){var Ie=Se.ref;return{$$typeof:e,type:W,key:se,ref:Ie!==void 0?Ie:null,props:Se}}function Oe(W,se){return Q(W.type,se,W.props)}function ue(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function $(W){var se={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(Se){return se[Se]})}var pe=/\/+/g;function Ce(W,se){return typeof W=="object"&&W!==null&&W.key!=null?$(""+W.key):se.toString(36)}function re(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status=="string"?W.then(ee,ee):(W.status="pending",W.then(function(se){W.status==="pending"&&(W.status="fulfilled",W.value=se)},function(se){W.status==="pending"&&(W.status="rejected",W.reason=se)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function ne(W,se,Se,Ie,Ue){var Te=typeof W;(Te==="undefined"||Te==="boolean")&&(W=null);var Ke=!1;if(W===null)Ke=!0;else switch(Te){case"bigint":case"string":case"number":Ke=!0;break;case"object":switch(W.$$typeof){case e:case r:Ke=!0;break;case T:return Ke=W._init,ne(Ke(W._payload),se,Se,Ie,Ue)}}if(Ke)return Ue=Ue(W),Ke=Ie===""?"."+Ce(W,0):Ie,ae(Ue)?(Se="",Ke!=null&&(Se=Ke.replace(pe,"$&/")+"/"),ne(Ue,se,Se,"",function(Yn){return Yn})):Ue!=null&&(ue(Ue)&&(Ue=Oe(Ue,Se+(Ue.key==null||W&&W.key===Ue.key?"":(""+Ue.key).replace(pe,"$&/")+"/")+Ke)),se.push(Ue)),1;Ke=0;var Qe=Ie===""?".":Ie+":";if(ae(W))for(var pt=0;pt<W.length;pt++)Ie=W[pt],Te=Qe+Ce(Ie,pt),Ke+=ne(Ie,se,Se,Te,Ue);else if(pt=R(W),typeof pt=="function")for(W=pt.call(W),pt=0;!(Ie=W.next()).done;)Ie=Ie.value,Te=Qe+Ce(Ie,pt++),Ke+=ne(Ie,se,Se,Te,Ue);else if(Te==="object"){if(typeof W.then=="function")return ne(re(W),se,Se,Ie,Ue);throw se=String(W),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return Ke}function xe(W,se,Se){if(W==null)return W;var Ie=[],Ue=0;return ne(W,Ie,"","",function(Te){return se.call(Se,Te,Ue++)}),Ie}function Me(W){if(W._status===-1){var se=W._result;se=se(),se.then(function(Se){(W._status===0||W._status===-1)&&(W._status=1,W._result=Se)},function(Se){(W._status===0||W._status===-1)&&(W._status=2,W._result=Se)}),W._status===-1&&(W._status=0,W._result=se)}if(W._status===1)return W._result.default;throw W._result}var He=typeof reportError=="function"?reportError:function(W){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof W=="object"&&W!==null&&typeof W.message=="string"?String(W.message):String(W),error:W});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",W);return}console.error(W)},Ye={map:xe,forEach:function(W,se,Se){xe(W,function(){se.apply(this,arguments)},Se)},count:function(W){var se=0;return xe(W,function(){se++}),se},toArray:function(W){return xe(W,function(se){return se})||[]},only:function(W){if(!ue(W))throw Error("React.Children.only expected to receive a single React element child.");return W}};return Je.Activity=x,Je.Children=Ye,Je.Component=L,Je.Fragment=a,Je.Profiler=f,Je.PureComponent=H,Je.StrictMode=s,Je.Suspense=A,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Je.__COMPILER_RUNTIME={__proto__:null,c:function(W){return X.H.useMemoCache(W)}},Je.cache=function(W){return function(){return W.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(W,se,Se){if(W==null)throw Error("The argument must be a React element, but you passed "+W+".");var Ie=I({},W.props),Ue=W.key;if(se!=null)for(Te in se.key!==void 0&&(Ue=""+se.key),se)!de.call(se,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&se.ref===void 0||(Ie[Te]=se[Te]);var Te=arguments.length-2;if(Te===1)Ie.children=Se;else if(1<Te){for(var Ke=Array(Te),Qe=0;Qe<Te;Qe++)Ke[Qe]=arguments[Qe+2];Ie.children=Ke}return Q(W.type,Ue,Ie)},Je.createContext=function(W){return W={$$typeof:y,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null},W.Provider=W,W.Consumer={$$typeof:g,_context:W},W},Je.createElement=function(W,se,Se){var Ie,Ue={},Te=null;if(se!=null)for(Ie in se.key!==void 0&&(Te=""+se.key),se)de.call(se,Ie)&&Ie!=="key"&&Ie!=="__self"&&Ie!=="__source"&&(Ue[Ie]=se[Ie]);var Ke=arguments.length-2;if(Ke===1)Ue.children=Se;else if(1<Ke){for(var Qe=Array(Ke),pt=0;pt<Ke;pt++)Qe[pt]=arguments[pt+2];Ue.children=Qe}if(W&&W.defaultProps)for(Ie in Ke=W.defaultProps,Ke)Ue[Ie]===void 0&&(Ue[Ie]=Ke[Ie]);return Q(W,Te,Ue)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(W){return{$$typeof:E,render:W}},Je.isValidElement=ue,Je.lazy=function(W){return{$$typeof:T,_payload:{_status:-1,_result:W},_init:Me}},Je.memo=function(W,se){return{$$typeof:b,type:W,compare:se===void 0?null:se}},Je.startTransition=function(W){var se=X.T,Se={};X.T=Se;try{var Ie=W(),Ue=X.S;Ue!==null&&Ue(Se,Ie),typeof Ie=="object"&&Ie!==null&&typeof Ie.then=="function"&&Ie.then(ee,He)}catch(Te){He(Te)}finally{se!==null&&Se.types!==null&&(se.types=Se.types),X.T=se}},Je.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Je.use=function(W){return X.H.use(W)},Je.useActionState=function(W,se,Se){return X.H.useActionState(W,se,Se)},Je.useCallback=function(W,se){return X.H.useCallback(W,se)},Je.useContext=function(W){return X.H.useContext(W)},Je.useDebugValue=function(){},Je.useDeferredValue=function(W,se){return X.H.useDeferredValue(W,se)},Je.useEffect=function(W,se){return X.H.useEffect(W,se)},Je.useEffectEvent=function(W){return X.H.useEffectEvent(W)},Je.useId=function(){return X.H.useId()},Je.useImperativeHandle=function(W,se,Se){return X.H.useImperativeHandle(W,se,Se)},Je.useInsertionEffect=function(W,se){return X.H.useInsertionEffect(W,se)},Je.useLayoutEffect=function(W,se){return X.H.useLayoutEffect(W,se)},Je.useMemo=function(W,se){return X.H.useMemo(W,se)},Je.useOptimistic=function(W,se){return X.H.useOptimistic(W,se)},Je.useReducer=function(W,se,Se){return X.H.useReducer(W,se,Se)},Je.useRef=function(W){return X.H.useRef(W)},Je.useState=function(W){return X.H.useState(W)},Je.useSyncExternalStore=function(W,se,Se){return X.H.useSyncExternalStore(W,se,Se)},Je.useTransition=function(){return X.H.useTransition()},Je.version="19.2.0",Je}var hp;function O0(){return hp||(hp=1,ch.exports=Lb()),ch.exports}var B=O0();const Nr=Qu(B),I0=gx({__proto__:null,default:Nr},[B]);var uh={exports:{}},Rl={},fh={exports:{}},dh={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var gp;function kb(){return gp||(gp=1,(function(e){function r(ne,xe){var Me=ne.length;ne.push(xe);e:for(;0<Me;){var He=Me-1>>>1,Ye=ne[He];if(0<f(Ye,xe))ne[He]=xe,ne[Me]=Ye,Me=He;else break e}}function a(ne){return ne.length===0?null:ne[0]}function s(ne){if(ne.length===0)return null;var xe=ne[0],Me=ne.pop();if(Me!==xe){ne[0]=Me;e:for(var He=0,Ye=ne.length,W=Ye>>>1;He<W;){var se=2*(He+1)-1,Se=ne[se],Ie=se+1,Ue=ne[Ie];if(0>f(Se,Me))Ie<Ye&&0>f(Ue,Se)?(ne[He]=Ue,ne[Ie]=Me,He=Ie):(ne[He]=Se,ne[se]=Me,He=se);else if(Ie<Ye&&0>f(Ue,Me))ne[He]=Ue,ne[Ie]=Me,He=Ie;else break e}}return xe}function f(ne,xe){var Me=ne.sortIndex-xe.sortIndex;return Me!==0?Me:ne.id-xe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;e.unstable_now=function(){return g.now()}}else{var y=Date,E=y.now();e.unstable_now=function(){return y.now()-E}}var A=[],b=[],T=1,x=null,S=3,R=!1,k=!1,I=!1,z=!1,L=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function j(ne){for(var xe=a(b);xe!==null;){if(xe.callback===null)s(b);else if(xe.startTime<=ne)s(b),xe.sortIndex=xe.expirationTime,r(A,xe);else break;xe=a(b)}}function ae(ne){if(I=!1,j(ne),!k)if(a(A)!==null)k=!0,ee||(ee=!0,$());else{var xe=a(b);xe!==null&&re(ae,xe.startTime-ne)}}var ee=!1,X=-1,de=5,Q=-1;function Oe(){return z?!0:!(e.unstable_now()-Q<de)}function ue(){if(z=!1,ee){var ne=e.unstable_now();Q=ne;var xe=!0;try{e:{k=!1,I&&(I=!1,Z(X),X=-1),R=!0;var Me=S;try{t:{for(j(ne),x=a(A);x!==null&&!(x.expirationTime>ne&&Oe());){var He=x.callback;if(typeof He=="function"){x.callback=null,S=x.priorityLevel;var Ye=He(x.expirationTime<=ne);if(ne=e.unstable_now(),typeof Ye=="function"){x.callback=Ye,j(ne),xe=!0;break t}x===a(A)&&s(A),j(ne)}else s(A);x=a(A)}if(x!==null)xe=!0;else{var W=a(b);W!==null&&re(ae,W.startTime-ne),xe=!1}}break e}finally{x=null,S=Me,R=!1}xe=void 0}}finally{xe?$():ee=!1}}}var $;if(typeof H=="function")$=function(){H(ue)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Ce=pe.port2;pe.port1.onmessage=ue,$=function(){Ce.postMessage(null)}}else $=function(){L(ue,0)};function re(ne,xe){X=L(function(){ne(e.unstable_now())},xe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ne){ne.callback=null},e.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<ne?Math.floor(1e3/ne):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(ne){switch(S){case 1:case 2:case 3:var xe=3;break;default:xe=S}var Me=S;S=xe;try{return ne()}finally{S=Me}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(ne,xe){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var Me=S;S=ne;try{return xe()}finally{S=Me}},e.unstable_scheduleCallback=function(ne,xe,Me){var He=e.unstable_now();switch(typeof Me=="object"&&Me!==null?(Me=Me.delay,Me=typeof Me=="number"&&0<Me?He+Me:He):Me=He,ne){case 1:var Ye=-1;break;case 2:Ye=250;break;case 5:Ye=1073741823;break;case 4:Ye=1e4;break;default:Ye=5e3}return Ye=Me+Ye,ne={id:T++,callback:xe,priorityLevel:ne,startTime:Me,expirationTime:Ye,sortIndex:-1},Me>He?(ne.sortIndex=Me,r(b,ne),a(A)===null&&ne===a(b)&&(I?(Z(X),X=-1):I=!0,re(ae,Me-He))):(ne.sortIndex=Ye,r(A,ne),k||R||(k=!0,ee||(ee=!0,$()))),ne},e.unstable_shouldYield=Oe,e.unstable_wrapCallback=function(ne){var xe=S;return function(){var Me=S;S=xe;try{return ne.apply(this,arguments)}finally{S=Me}}}})(dh)),dh}var mp;function zb(){return mp||(mp=1,fh.exports=kb()),fh.exports}var hh={exports:{}},Gn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var pp;function Pb(){if(pp)return Gn;pp=1;var e=O0();function r(A){var b="https://react.dev/errors/"+A;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)b+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+A+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},f=Symbol.for("react.portal");function g(A,b,T){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:x==null?null:""+x,children:A,containerInfo:b,implementation:T}}var y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function E(A,b){if(A==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Gn.createPortal=function(A,b){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(r(299));return g(A,b,null,T)},Gn.flushSync=function(A){var b=y.T,T=s.p;try{if(y.T=null,s.p=2,A)return A()}finally{y.T=b,s.p=T,s.d.f()}},Gn.preconnect=function(A,b){typeof A=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,s.d.C(A,b))},Gn.prefetchDNS=function(A){typeof A=="string"&&s.d.D(A)},Gn.preinit=function(A,b){if(typeof A=="string"&&b&&typeof b.as=="string"){var T=b.as,x=E(T,b.crossOrigin),S=typeof b.integrity=="string"?b.integrity:void 0,R=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;T==="style"?s.d.S(A,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:R}):T==="script"&&s.d.X(A,{crossOrigin:x,integrity:S,fetchPriority:R,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Gn.preinitModule=function(A,b){if(typeof A=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var T=E(b.as,b.crossOrigin);s.d.M(A,{crossOrigin:T,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&s.d.M(A)},Gn.preload=function(A,b){if(typeof A=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var T=b.as,x=E(T,b.crossOrigin);s.d.L(A,T,{crossOrigin:x,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Gn.preloadModule=function(A,b){if(typeof A=="string")if(b){var T=E(b.as,b.crossOrigin);s.d.m(A,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:T,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else s.d.m(A)},Gn.requestFormReset=function(A){s.d.r(A)},Gn.unstable_batchedUpdates=function(A,b){return A(b)},Gn.useFormState=function(A,b,T){return y.H.useFormState(A,b,T)},Gn.useFormStatus=function(){return y.H.useHostTransitionStatus()},Gn.version="19.2.0",Gn}var xp;function mx(){if(xp)return hh.exports;xp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),hh.exports=Pb(),hh.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var yp;function Ub(){if(yp)return Rl;yp=1;var e=zb(),r=O0(),a=mx();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function g(t){var i=t,c=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(c=i.return),t=i.return;while(t)}return i.tag===3?c:null}function y(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function E(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function A(t){if(g(t)!==t)throw Error(s(188))}function b(t){var i=t.alternate;if(!i){if(i=g(t),i===null)throw Error(s(188));return i!==t?null:t}for(var c=t,h=i;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return A(v),t;if(_===h)return A(v),i;_=_.sibling}throw Error(s(188))}if(c.return!==h.return)c=v,h=_;else{for(var O=!1,U=v.child;U;){if(U===c){O=!0,c=v,h=_;break}if(U===h){O=!0,h=v,c=_;break}U=U.sibling}if(!O){for(U=_.child;U;){if(U===c){O=!0,c=_,h=v;break}if(U===h){O=!0,h=_,c=v;break}U=U.sibling}if(!O)throw Error(s(189))}}if(c.alternate!==h)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?t:i}function T(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=T(t),i!==null)return i;t=t.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),H=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),Oe=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=ue&&t[ue]||t["@@iterator"],typeof t=="function"?t:null)}var pe=Symbol.for("react.client.reference");function Ce(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case L:return"Profiler";case z:return"StrictMode";case ae:return"Suspense";case ee:return"SuspenseList";case Q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case H:return t.displayName||"Context";case Z:return(t._context.displayName||"Context")+".Consumer";case j:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return i=t.displayName||null,i!==null?i:Ce(t.type)||"Memo";case de:i=t._payload,t=t._init;try{return Ce(t(i))}catch{}}return null}var re=Array.isArray,ne=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Me={pending:!1,data:null,method:null,action:null},He=[],Ye=-1;function W(t){return{current:t}}function se(t){0>Ye||(t.current=He[Ye],He[Ye]=null,Ye--)}function Se(t,i){Ye++,He[Ye]=t.current,t.current=i}var Ie=W(null),Ue=W(null),Te=W(null),Ke=W(null);function Qe(t,i){switch(Se(Te,i),Se(Ue,t),Se(Ie,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Dm(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Dm(i),t=Bm(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}se(Ie),Se(Ie,t)}function pt(){se(Ie),se(Ue),se(Te)}function Yn(t){t.memoizedState!==null&&Se(Ke,t);var i=Ie.current,c=Bm(i,t.type);i!==c&&(Se(Ue,t),Se(Ie,c))}function Sn(t){Ue.current===t&&(se(Ie),se(Ue)),Ke.current===t&&(se(Ke),El._currentValue=Me)}var na,xt;function nr(t){if(na===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);na=i&&i[1]||"",xt=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+na+t+xt}var rr=!1;function Ci(t,i){if(!t||rr)return"";rr=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(i){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(me){var fe=me}Reflect.construct(t,[],we)}else{try{we.call()}catch(me){fe=me}t.call(we.prototype)}}else{try{throw Error()}catch(me){fe=me}(we=t())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),O=_[0],U=_[1];if(O&&U){var Y=O.split(`
|
|
44
|
+
`),ce=U.split(`
|
|
45
|
+
`);for(v=h=0;h<Y.length&&!Y[h].includes("DetermineComponentFrameRoot");)h++;for(;v<ce.length&&!ce[v].includes("DetermineComponentFrameRoot");)v++;if(h===Y.length||v===ce.length)for(h=Y.length-1,v=ce.length-1;1<=h&&0<=v&&Y[h]!==ce[v];)v--;for(;1<=h&&0<=v;h--,v--)if(Y[h]!==ce[v]){if(h!==1||v!==1)do if(h--,v--,0>v||Y[h]!==ce[v]){var ye=`
|
|
46
|
+
`+Y[h].replace(" at new "," at ");return t.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",t.displayName)),ye}while(1<=h&&0<=v);break}}}finally{rr=!1,Error.prepareStackTrace=c}return(c=t?t.displayName||t.name:"")?nr(c):""}function Tn(t,i){switch(t.tag){case 26:case 27:case 5:return nr(t.type);case 16:return nr("Lazy");case 13:return t.child!==i&&i!==null?nr("Suspense Fallback"):nr("Suspense");case 19:return nr("SuspenseList");case 0:case 15:return Ci(t.type,!1);case 11:return Ci(t.type.render,!1);case 1:return Ci(t.type,!0);case 31:return nr("Activity");default:return""}}function Nt(t){try{var i="",c=null;do i+=Tn(t,c),c=t,t=t.return;while(t);return i}catch(h){return`
|
|
47
|
+
Error generating stack: `+h.message+`
|
|
48
|
+
`+h.stack}}var ot=Object.prototype.hasOwnProperty,ra=e.unstable_scheduleCallback,Le=e.unstable_cancelCallback,Ro=e.unstable_shouldYield,$l=e.unstable_requestPaint,en=e.unstable_now,Bs=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,Ls=e.unstable_UserBlockingPriority,mr=e.unstable_NormalPriority,zn=e.unstable_LowPriority,ks=e.unstable_IdlePriority,No=e.log,hf=e.unstable_setDisableYieldValue,jt=null,Ne=null;function Dt(t){if(typeof No=="function"&&hf(t),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(jt,t)}catch{}}var et=Math.clz32?Math.clz32:zs,Kt=Math.log,Ka=Math.LN2;function zs(t){return t>>>=0,t===0?32:31-(Kt(t)/Ka|0)|0}var Qa=256,ut=262144,Ir=4194304;function ci(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ja(t,i,c){var h=t.pendingLanes;if(h===0)return 0;var v=0,_=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var U=h&134217727;return U!==0?(h=U&~_,h!==0?v=ci(h):(O&=U,O!==0?v=ci(O):c||(c=U&~t,c!==0&&(v=ci(c))))):(U=h&~_,U!==0?v=ci(U):O!==0?v=ci(O):c||(c=h&~t,c!==0&&(v=ci(c)))),v===0?0:i!==0&&i!==v&&(i&_)===0&&(_=v&-v,c=i&-i,_>=c||_===32&&(c&4194048)!==0)?i:v}function Pn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Ps(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rn(){var t=Ir;return Ir<<=1,(Ir&62914560)===0&&(Ir=4194304),t}function ui(t){for(var i=[],c=0;31>c;c++)i.push(t);return i}function fi(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Mr(t,i,c,h,v,_){var O=t.pendingLanes;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=c,t.entangledLanes&=c,t.errorRecoveryDisabledLanes&=c,t.shellSuspendCounter=0;var U=t.entanglements,Y=t.expirationTimes,ce=t.hiddenUpdates;for(c=O&~c;0<c;){var ye=31-et(c),we=1<<ye;U[ye]=0,Y[ye]=-1;var fe=ce[ye];if(fe!==null)for(ce[ye]=null,ye=0;ye<fe.length;ye++){var me=fe[ye];me!==null&&(me.lane&=-536870913)}c&=~we}h!==0&&ec(t,h,0),_!==0&&v===0&&t.tag!==0&&(t.suspendedLanes|=_&~(O&~i))}function ec(t,i,c){t.pendingLanes|=i,t.suspendedLanes&=~i;var h=31-et(i);t.entangledLanes|=i,t.entanglements[h]=t.entanglements[h]|1073741824|c&261930}function di(t,i){var c=t.entangledLanes|=i;for(t=t.entanglements;c;){var h=31-et(c),v=1<<h;v&i|t[h]&i&&(t[h]|=i),c&=~v}}function Oo(t,i){var c=i&-i;return c=(c&42)!==0?1:Ln(c),(c&(t.suspendedLanes|i))!==0?0:c}function Ln(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Kr(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function qn(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:rp(t.type))}function De(t,i){var c=xe.p;try{return xe.p=t,i()}finally{xe.p=c}}var Wn=Math.random().toString(36).slice(2),dn="__reactFiber$"+Wn,Ot="__reactProps$"+Wn,pr="__reactContainer$"+Wn,ia="__reactEvents$"+Wn,Io="__reactListeners$"+Wn,Dr="__reactHandles$"+Wn,tc="__reactResources$"+Wn,$a="__reactMarker$"+Wn;function ar(t){delete t[dn],delete t[Ot],delete t[ia],delete t[Io],delete t[Dr]}function an(t){var i=t[dn];if(i)return i;for(var c=t.parentNode;c;){if(i=c[pr]||c[dn]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(t=jm(t);t!==null;){if(c=t[dn])return c;t=jm(t)}return i}t=c,c=t.parentNode}return null}function Et(t){if(t=t[dn]||t[pr]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function aa(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function Kn(t){var i=t[tc];return i||(i=t[tc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(t){t[$a]=!0}var _e=new Set,nc={};function St(t,i){xr(t,i),xr(t+"Capture",i)}function xr(t,i){for(nc[t]=i,t=0;t<i.length;t++)_e.add(i[t])}var gf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),vt={},yt={};function st(t){return ot.call(yt,t)?!0:ot.call(vt,t)?!1:gf.test(t)?yt[t]=!0:(vt[t]=!0,!1)}function oa(t,i,c){if(st(i))if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var h=i.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+c)}}function sa(t,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+c)}}function yr(t,i,c,h){if(h===null)t.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(c);return}t.setAttributeNS(i,c,""+h)}}function wt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Qr(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function mf(t,i,c){var h=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,_=h.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return v.call(this)},set:function(O){c=""+O,_.call(this,O)}}),Object.defineProperty(t,i,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(O){c=""+O},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Ht(t){if(!t._valueTracker){var i=Qr(t)?"checked":"value";t._valueTracker=mf(t,i,""+t[i])}}function Jr(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var c=i.getValue(),h="";return t&&(h=Qr(t)?t.checked?"true":"false":t.value),t=h,t!==c?(i.setValue(t),!0):!1}function Mo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var la=/[\n"\\]/g;function at(t){return t.replace(la,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function yn(t,i,c,h,v,_,O,U){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),i!=null?O==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+wt(i)):t.value!==""+wt(i)&&(t.value=""+wt(i)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),i!=null?V(t,O,wt(i)):c!=null?V(t,O,wt(c)):h!=null&&t.removeAttribute("value"),v==null&&_!=null&&(t.defaultChecked=!!_),v!=null&&(t.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+wt(U):t.removeAttribute("name")}function oe(t,i,c,h,v,_,O,U){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(t.type=_),i!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||i!=null)){Ht(t);return}c=c!=null?""+wt(c):"",i=i!=null?""+wt(i):c,U||i===t.value||(t.value=i),t.defaultValue=i}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,t.checked=U?t.checked:!!h,t.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),Ht(t)}function V(t,i,c){i==="number"&&Mo(t.ownerDocument)===t||t.defaultValue===""+c||(t.defaultValue=""+c)}function ze(t,i,c,h){if(t=t.options,i){i={};for(var v=0;v<c.length;v++)i["$"+c[v]]=!0;for(c=0;c<t.length;c++)v=i.hasOwnProperty("$"+t[c].value),t[c].selected!==v&&(t[c].selected=v),v&&h&&(t[c].defaultSelected=!0)}else{for(c=""+wt(c),i=null,v=0;v<t.length;v++){if(t[v].value===c){t[v].selected=!0,h&&(t[v].defaultSelected=!0);return}i!==null||t[v].disabled||(i=t[v])}i!==null&&(i.selected=!0)}}function hn(t,i,c){if(i!=null&&(i=""+wt(i),i!==t.value&&(t.value=i),c==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=c!=null?""+wt(c):""}function Qn(t,i,c,h){if(i==null){if(h!=null){if(c!=null)throw Error(s(92));if(re(h)){if(1<h.length)throw Error(s(93));h=h[0]}c=h}c==null&&(c=""),i=c}c=wt(i),t.defaultValue=c,h=t.textContent,h===c&&h!==""&&h!==null&&(t.value=h),Ht(t)}function ca(t,i){if(i){var c=t.firstChild;if(c&&c===t.lastChild&&c.nodeType===3){c.nodeValue=i;return}}t.textContent=i}var Us=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jn(t,i,c){var h=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":h?t.setProperty(i,c):typeof c!="number"||c===0||Us.has(i)?i==="float"?t.cssFloat=c:t[i]=(""+c).trim():t[i]=c+"px"}function Fe(t,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||i!=null&&i.hasOwnProperty(h)||(h.indexOf("--")===0?t.setProperty(h,""):h==="float"?t.cssFloat="":t[h]="");for(var v in i)h=i[v],i.hasOwnProperty(v)&&c[v]!==h&&Jn(t,v,h)}else for(var _ in i)i.hasOwnProperty(_)&&Jn(t,_,i[_])}function zt(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rc=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),pf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ua(t){return pf.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function or(){}var eo=null;function Fs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Br=null;function $r(t){var i=Et(t);if(i&&(t=i.stateNode)){var c=t[Ot]||null;e:switch(t=i.stateNode,i.type){case"input":if(yn(t,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=t;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+at(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var h=c[i];if(h!==t&&h.form===t.form){var v=h[Ot]||null;if(!v)throw Error(s(90));yn(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(i=0;i<c.length;i++)h=c[i],h.form===t.form&&Jr(h)}break e;case"textarea":hn(t,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&ze(t,!!c.multiple,i,!1)}}}var Ge=!1;function ic(t,i,c){if(Ge)return t(i,c);Ge=!0;try{var h=t(i);return h}finally{if(Ge=!1,(Gt!==null||Br!==null)&&(Wc(),Gt&&(i=Gt,t=Br,Br=Gt=null,$r(i),t)))for(i=0;i<t.length;i++)$r(t[i])}}function qe(t,i){var c=t.stateNode;if(c===null)return null;var h=c[Ot]||null;if(h===null)return null;c=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(t=t.type,h=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!h;break e;default:t=!1}if(t)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var Pt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),js=!1;if(Pt)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){js=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{js=!1}var ei=null,ti=null,Do=null;function fa(){if(Do)return Do;var t,i=ti,c=i.length,h,v="value"in ei?ei.value:ei.textContent,_=v.length;for(t=0;t<c&&i[t]===v[t];t++);var O=c-t;for(h=1;h<=O&&i[c-h]===v[_-h];h++);return Do=v.slice(t,1<h?1-h:void 0)}function hi(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function gi(){return!0}function Vs(){return!1}function vn(t){function i(c,h,v,_,O){this._reactName=c,this._targetInst=v,this.type=h,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(c=t[U],this[U]=c?c(_):_[U]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?gi:Vs,this.isPropagationStopped=Vs,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=gi)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),i}var vr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=vn(vr),da=x({},vr,{view:0,detail:0}),ac=vn(da),Bo,Hs,to,Lo=x({},da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:no,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==to&&(to&&t.type==="mousemove"?(Bo=t.screenX-to.screenX,Hs=t.screenY-to.screenY):Hs=Bo=0,to=t),Bo)},movementY:function(t){return"movementY"in t?t.movementY:Hs}}),At=vn(Lo),oc=x({},Lo,{dataTransfer:0}),ko=vn(oc),mi=x({},da,{relatedTarget:0}),Gs=vn(mi),ge=x({},vr,{animationName:0,elapsedTime:0,pseudoElement:0}),tt=vn(ge),On=x({},vr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),zo=vn(On),sc=x({},vr,{data:0}),lc=vn(sc),xf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Zs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gn(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Zs[t])?!!i[t]:!1}function no(){return gn}var Qt=x({},da,{key:function(t){if(t.key){var i=xf[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=hi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?yf[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:no,charCode:function(t){return t.type==="keypress"?hi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?hi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Po=vn(Qt),Ti=x({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tt=vn(Ti),Ze=x({},da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:no}),vf=vn(Ze),Ut=x({},vr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ri=vn(Ut),ha=x({},Lo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),wf=vn(ha),Lr=x({},vr,{newState:0,oldState:0}),Xs=vn(Lr),cc=[9,13,27,32],ro=Pt&&"CompositionEvent"in window,ga=null;Pt&&"documentMode"in document&&(ga=document.documentMode);var uc=Pt&&"TextEvent"in window&&!ga,fc=Pt&&(!ro||ga&&8<ga&&11>=ga),Ni=" ",Uo=!1;function dc(t,i){switch(t){case"keyup":return cc.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ma(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pa=!1;function pi(t,i){switch(t){case"compositionend":return ma(i);case"keypress":return i.which!==32?null:(Uo=!0,Ni);case"textInput":return t=i.data,t===Ni&&Uo?null:t;default:return null}}function Fo(t,i){if(pa)return t==="compositionend"||!ro&&dc(t,i)?(t=fa(),Do=ti=ei=null,pa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return fc&&i.locale!=="ko"?null:i.data;default:return null}}var sr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ys(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!sr[t.type]:i==="textarea"}function wr(t,i,c,h){Gt?Br?Br.push(h):Br=[h]:Gt=h,i=nu(i,"onChange"),0<i.length&&(c=new Nn("onChange","change",null,c,h),t.push({event:c,listeners:i}))}var io=null,Oi=null;function bf(t){Tm(t,0)}function ao(t){var i=aa(t);if(Jr(i))return t}function br(t,i){if(t==="change")return i}var hc=!1;if(Pt){var oo;if(Pt){var Ii="oninput"in document;if(!Ii){var ft=document.createElement("div");ft.setAttribute("oninput","return;"),Ii=typeof ft.oninput=="function"}oo=Ii}else oo=!1;hc=oo&&(!document.documentMode||9<document.documentMode)}function so(){io&&(io.detachEvent("onpropertychange",M),Oi=io=null)}function M(t){if(t.propertyName==="value"&&ao(Oi)){var i=[];wr(i,Oi,t,Fs(t)),ic(bf,i)}}function n(t,i,c){t==="focusin"?(so(),io=i,Oi=c,io.attachEvent("onpropertychange",M)):t==="focusout"&&so()}function o(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ao(Oi)}function l(t,i){if(t==="click")return ao(i)}function u(t,i){if(t==="input"||t==="change")return ao(i)}function d(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var m=typeof Object.is=="function"?Object.is:d;function p(t,i){if(m(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var c=Object.keys(t),h=Object.keys(i);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var v=c[h];if(!ot.call(i,v)||!m(t[v],i[v]))return!1}return!0}function w(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function C(t,i){var c=w(t);t=0;for(var h;c;){if(c.nodeType===3){if(h=t+c.textContent.length,t<=i&&h>=i)return{node:c,offset:i-t};t=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=w(c)}}function N(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?N(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function D(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Mo(t.document);i instanceof t.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)t=i.contentWindow;else break;i=Mo(t.document)}return i}function P(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var G=Pt&&"documentMode"in document&&11>=document.documentMode,q=null,K=null,ie=null,he=!1;function Re(t,i,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;he||q==null||q!==Mo(h)||(h=q,"selectionStart"in h&&P(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ie&&p(ie,h)||(ie=h,h=nu(K,"onSelect"),0<h.length&&(i=new Nn("onSelect","select",null,i,c),t.push({event:i,listeners:h}),i.target=q)))}function Ae(t,i){var c={};return c[t.toLowerCase()]=i.toLowerCase(),c["Webkit"+t]="webkit"+i,c["Moz"+t]="moz"+i,c}var Ee={animationend:Ae("Animation","AnimationEnd"),animationiteration:Ae("Animation","AnimationIteration"),animationstart:Ae("Animation","AnimationStart"),transitionrun:Ae("Transition","TransitionRun"),transitionstart:Ae("Transition","TransitionStart"),transitioncancel:Ae("Transition","TransitionCancel"),transitionend:Ae("Transition","TransitionEnd")},it={},We={};Pt&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ee.animationend.animation,delete Ee.animationiteration.animation,delete Ee.animationstart.animation),"TransitionEvent"in window||delete Ee.transitionend.transition);function sn(t){if(it[t])return it[t];if(!Ee[t])return t;var i=Ee[t],c;for(c in i)if(i.hasOwnProperty(c)&&c in We)return it[t]=i[c];return t}var lr=sn("animationend"),Un=sn("animationiteration"),Rt=sn("animationstart"),In=sn("transitionrun"),$n=sn("transitionstart"),xa=sn("transitioncancel"),Mi=sn("transitionend"),gc=new Map,qs="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qs.push("scrollEnd");function ni(t,i){gc.set(t,i),St(i,[t])}var mc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},kr=[],jo=0,_f=0;function pc(){for(var t=jo,i=_f=jo=0;i<t;){var c=kr[i];kr[i++]=null;var h=kr[i];kr[i++]=null;var v=kr[i];kr[i++]=null;var _=kr[i];if(kr[i++]=null,h!==null&&v!==null){var O=h.pending;O===null?v.next=v:(v.next=O.next,O.next=v),h.pending=v}_!==0&&l1(c,v,_)}}function xc(t,i,c,h){kr[jo++]=t,kr[jo++]=i,kr[jo++]=c,kr[jo++]=h,_f|=h,t.lanes|=h,t=t.alternate,t!==null&&(t.lanes|=h)}function Ef(t,i,c,h){return xc(t,i,c,h),yc(t)}function lo(t,i){return xc(t,null,null,i),yc(t)}function l1(t,i,c){t.lanes|=c;var h=t.alternate;h!==null&&(h.lanes|=c);for(var v=!1,_=t.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(t=_.stateNode,t===null||t._visibility&1||(v=!0)),t=_,_=_.return;return t.tag===3?(_=t.stateNode,v&&i!==null&&(v=31-et(c),t=_.hiddenUpdates,h=t[v],h===null?t[v]=[i]:h.push(i),i.lane=c|536870912),_):null}function yc(t){if(50<pl)throw pl=0,Md=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Vo={};function gw(t,i,c,h){this.tag=t,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _r(t,i,c,h){return new gw(t,i,c,h)}function Af(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Di(t,i){var c=t.alternate;return c===null?(c=_r(t.tag,i,t.key,t.mode),c.elementType=t.elementType,c.type=t.type,c.stateNode=t.stateNode,c.alternate=t,t.alternate=c):(c.pendingProps=i,c.type=t.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=t.flags&65011712,c.childLanes=t.childLanes,c.lanes=t.lanes,c.child=t.child,c.memoizedProps=t.memoizedProps,c.memoizedState=t.memoizedState,c.updateQueue=t.updateQueue,i=t.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=t.sibling,c.index=t.index,c.ref=t.ref,c.refCleanup=t.refCleanup,c}function c1(t,i){t.flags&=65011714;var c=t.alternate;return c===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=c.childLanes,t.lanes=c.lanes,t.child=c.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=c.memoizedProps,t.memoizedState=c.memoizedState,t.updateQueue=c.updateQueue,t.type=c.type,i=c.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function vc(t,i,c,h,v,_){var O=0;if(h=t,typeof t=="function")Af(t)&&(O=1);else if(typeof t=="string")O=vb(t,c,Ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Q:return t=_r(31,c,i,v),t.elementType=Q,t.lanes=_,t;case I:return co(c.children,v,_,i);case z:O=8,v|=24;break;case L:return t=_r(12,c,i,v|2),t.elementType=L,t.lanes=_,t;case ae:return t=_r(13,c,i,v),t.elementType=ae,t.lanes=_,t;case ee:return t=_r(19,c,i,v),t.elementType=ee,t.lanes=_,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:O=10;break e;case Z:O=9;break e;case j:O=11;break e;case X:O=14;break e;case de:O=16,h=null;break e}O=29,c=Error(s(130,t===null?"null":typeof t,"")),h=null}return i=_r(O,c,i,v),i.elementType=t,i.type=h,i.lanes=_,i}function co(t,i,c,h){return t=_r(7,t,h,i),t.lanes=c,t}function Cf(t,i,c){return t=_r(6,t,null,i),t.lanes=c,t}function u1(t){var i=_r(18,null,null,0);return i.stateNode=t,i}function Sf(t,i,c){return i=_r(4,t.children!==null?t.children:[],t.key,i),i.lanes=c,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var f1=new WeakMap;function zr(t,i){if(typeof t=="object"&&t!==null){var c=f1.get(t);return c!==void 0?c:(i={value:t,source:i,stack:Nt(i)},f1.set(t,i),i)}return{value:t,source:i,stack:Nt(i)}}var Ho=[],Go=0,wc=null,Ws=0,Pr=[],Ur=0,ya=null,xi=1,yi="";function Bi(t,i){Ho[Go++]=Ws,Ho[Go++]=wc,wc=t,Ws=i}function d1(t,i,c){Pr[Ur++]=xi,Pr[Ur++]=yi,Pr[Ur++]=ya,ya=t;var h=xi;t=yi;var v=32-et(h)-1;h&=~(1<<v),c+=1;var _=32-et(i)+v;if(30<_){var O=v-v%5;_=(h&(1<<O)-1).toString(32),h>>=O,v-=O,xi=1<<32-et(i)+v|c<<v|h,yi=_+t}else xi=1<<_|c<<v|h,yi=t}function Tf(t){t.return!==null&&(Bi(t,1),d1(t,1,0))}function Rf(t){for(;t===wc;)wc=Ho[--Go],Ho[Go]=null,Ws=Ho[--Go],Ho[Go]=null;for(;t===ya;)ya=Pr[--Ur],Pr[Ur]=null,yi=Pr[--Ur],Pr[Ur]=null,xi=Pr[--Ur],Pr[Ur]=null}function h1(t,i){Pr[Ur++]=xi,Pr[Ur++]=yi,Pr[Ur++]=ya,xi=i.id,yi=i.overflow,ya=t}var Fn=null,Zt=null,gt=!1,va=null,Fr=!1,Nf=Error(s(519));function wa(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ks(zr(i,t)),Nf}function g1(t){var i=t.stateNode,c=t.type,h=t.memoizedProps;switch(i[dn]=t,i[Ot]=h,c){case"dialog":ct("cancel",i),ct("close",i);break;case"iframe":case"object":case"embed":ct("load",i);break;case"video":case"audio":for(c=0;c<yl.length;c++)ct(yl[c],i);break;case"source":ct("error",i);break;case"img":case"image":case"link":ct("error",i),ct("load",i);break;case"details":ct("toggle",i);break;case"input":ct("invalid",i),oe(i,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ct("invalid",i);break;case"textarea":ct("invalid",i),Qn(i,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||h.suppressHydrationWarning===!0||Im(i.textContent,c)?(h.popover!=null&&(ct("beforetoggle",i),ct("toggle",i)),h.onScroll!=null&&ct("scroll",i),h.onScrollEnd!=null&&ct("scrollend",i),h.onClick!=null&&(i.onclick=or),i=!0):i=!1,i||wa(t,!0)}function m1(t){for(Fn=t.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:Fr=!1;return;case 27:case 3:Fr=!0;return;default:Fn=Fn.return}}function Zo(t){if(t!==Fn)return!1;if(!gt)return m1(t),gt=!0,!1;var i=t.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=t.type,c=!(c!=="form"&&c!=="button")||Yd(t.type,t.memoizedProps)),c=!c),c&&Zt&&wa(t),m1(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Zt=Fm(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Zt=Fm(t)}else i===27?(i=Zt,Ba(t.type)?(t=Jd,Jd=null,Zt=t):Zt=i):Zt=Fn?Vr(t.stateNode.nextSibling):null;return!0}function uo(){Zt=Fn=null,gt=!1}function Of(){var t=va;return t!==null&&(dr===null?dr=t:dr.push.apply(dr,t),va=null),t}function Ks(t){va===null?va=[t]:va.push(t)}var If=W(null),fo=null,Li=null;function ba(t,i,c){Se(If,i._currentValue),i._currentValue=c}function ki(t){t._currentValue=If.current,se(If)}function Mf(t,i,c){for(;t!==null;){var h=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),t===c)break;t=t.return}}function Df(t,i,c,h){var v=t.child;for(v!==null&&(v.return=t);v!==null;){var _=v.dependencies;if(_!==null){var O=v.child;_=_.firstContext;e:for(;_!==null;){var U=_;_=v;for(var Y=0;Y<i.length;Y++)if(U.context===i[Y]){_.lanes|=c,U=_.alternate,U!==null&&(U.lanes|=c),Mf(_.return,c,t),h||(O=null);break e}_=U.next}}else if(v.tag===18){if(O=v.return,O===null)throw Error(s(341));O.lanes|=c,_=O.alternate,_!==null&&(_.lanes|=c),Mf(O,c,t),O=null}else O=v.child;if(O!==null)O.return=v;else for(O=v;O!==null;){if(O===t){O=null;break}if(v=O.sibling,v!==null){v.return=O.return,O=v;break}O=O.return}v=O}}function Xo(t,i,c,h){t=null;for(var v=i,_=!1;v!==null;){if(!_){if((v.flags&524288)!==0)_=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var O=v.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var U=v.type;m(v.pendingProps.value,O.value)||(t!==null?t.push(U):t=[U])}}else if(v===Ke.current){if(O=v.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(t!==null?t.push(El):t=[El])}v=v.return}t!==null&&Df(i,t,c,h),i.flags|=262144}function bc(t){for(t=t.firstContext;t!==null;){if(!m(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ho(t){fo=t,Li=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jn(t){return p1(fo,t)}function _c(t,i){return fo===null&&ho(t),p1(t,i)}function p1(t,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},Li===null){if(t===null)throw Error(s(308));Li=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Li=Li.next=i;return c}var mw=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(c,h){t.push(h)}};this.abort=function(){i.aborted=!0,t.forEach(function(c){return c()})}},pw=e.unstable_scheduleCallback,xw=e.unstable_NormalPriority,wn={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bf(){return{controller:new mw,data:new Map,refCount:0}}function Qs(t){t.refCount--,t.refCount===0&&pw(xw,function(){t.controller.abort()})}var Js=null,Lf=0,Yo=0,qo=null;function yw(t,i){if(Js===null){var c=Js=[];Lf=0,Yo=Pd(),qo={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Lf++,i.then(x1,x1),i}function x1(){if(--Lf===0&&Js!==null){qo!==null&&(qo.status="fulfilled");var t=Js;Js=null,Yo=0,qo=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function vw(t,i){var c=[],h={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return t.then(function(){h.status="fulfilled",h.value=i;for(var v=0;v<c.length;v++)(0,c[v])(i)},function(v){for(h.status="rejected",h.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),h}var y1=ne.S;ne.S=function(t,i){tm=en(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&yw(t,i),y1!==null&&y1(t,i)};var go=W(null);function kf(){var t=go.current;return t!==null?t:Ft.pooledCache}function Ec(t,i){i===null?Se(go,go.current):Se(go,i.pool)}function v1(){var t=kf();return t===null?null:{parent:wn._currentValue,pool:t}}var Wo=Error(s(460)),zf=Error(s(474)),Ac=Error(s(542)),Cc={then:function(){}};function w1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function b1(t,i,c){switch(c=t[c],c===void 0?t.push(i):c!==i&&(i.then(or,or),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,E1(t),t;default:if(typeof i.status=="string")i.then(or,or);else{if(t=Ft,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(h){if(i.status==="pending"){var v=i;v.status="fulfilled",v.value=h}},function(h){if(i.status==="pending"){var v=i;v.status="rejected",v.reason=h}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,E1(t),t}throw po=i,Wo}}function mo(t){try{var i=t._init;return i(t._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(po=c,Wo):c}}var po=null;function _1(){if(po===null)throw Error(s(459));var t=po;return po=null,t}function E1(t){if(t===Wo||t===Ac)throw Error(s(483))}var Ko=null,$s=0;function Sc(t){var i=$s;return $s+=1,Ko===null&&(Ko=[]),b1(Ko,t,i)}function el(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Tc(t,i){throw i.$$typeof===S?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function A1(t){function i(te,J){if(t){var le=te.deletions;le===null?(te.deletions=[J],te.flags|=16):le.push(J)}}function c(te,J){if(!t)return null;for(;J!==null;)i(te,J),J=J.sibling;return null}function h(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function v(te,J){return te=Di(te,J),te.index=0,te.sibling=null,te}function _(te,J,le){return te.index=le,t?(le=te.alternate,le!==null?(le=le.index,le<J?(te.flags|=67108866,J):le):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function O(te){return t&&te.alternate===null&&(te.flags|=67108866),te}function U(te,J,le,ve){return J===null||J.tag!==6?(J=Cf(le,te.mode,ve),J.return=te,J):(J=v(J,le),J.return=te,J)}function Y(te,J,le,ve){var je=le.type;return je===I?ye(te,J,le.props.children,ve,le.key):J!==null&&(J.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===de&&mo(je)===J.type)?(J=v(J,le.props),el(J,le),J.return=te,J):(J=vc(le.type,le.key,le.props,null,te.mode,ve),el(J,le),J.return=te,J)}function ce(te,J,le,ve){return J===null||J.tag!==4||J.stateNode.containerInfo!==le.containerInfo||J.stateNode.implementation!==le.implementation?(J=Sf(le,te.mode,ve),J.return=te,J):(J=v(J,le.children||[]),J.return=te,J)}function ye(te,J,le,ve,je){return J===null||J.tag!==7?(J=co(le,te.mode,ve,je),J.return=te,J):(J=v(J,le),J.return=te,J)}function we(te,J,le){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Cf(""+J,te.mode,le),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return le=vc(J.type,J.key,J.props,null,te.mode,le),el(le,J),le.return=te,le;case k:return J=Sf(J,te.mode,le),J.return=te,J;case de:return J=mo(J),we(te,J,le)}if(re(J)||$(J))return J=co(J,te.mode,le,null),J.return=te,J;if(typeof J.then=="function")return we(te,Sc(J),le);if(J.$$typeof===H)return we(te,_c(te,J),le);Tc(te,J)}return null}function fe(te,J,le,ve){var je=J!==null?J.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return je!==null?null:U(te,J,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case R:return le.key===je?Y(te,J,le,ve):null;case k:return le.key===je?ce(te,J,le,ve):null;case de:return le=mo(le),fe(te,J,le,ve)}if(re(le)||$(le))return je!==null?null:ye(te,J,le,ve,null);if(typeof le.then=="function")return fe(te,J,Sc(le),ve);if(le.$$typeof===H)return fe(te,J,_c(te,le),ve);Tc(te,le)}return null}function me(te,J,le,ve,je){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return te=te.get(le)||null,U(J,te,""+ve,je);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case R:return te=te.get(ve.key===null?le:ve.key)||null,Y(J,te,ve,je);case k:return te=te.get(ve.key===null?le:ve.key)||null,ce(J,te,ve,je);case de:return ve=mo(ve),me(te,J,le,ve,je)}if(re(ve)||$(ve))return te=te.get(le)||null,ye(J,te,ve,je,null);if(typeof ve.then=="function")return me(te,J,le,Sc(ve),je);if(ve.$$typeof===H)return me(te,J,le,_c(J,ve),je);Tc(J,ve)}return null}function ke(te,J,le,ve){for(var je=null,bt=null,Pe=J,nt=J=0,ht=null;Pe!==null&&nt<le.length;nt++){Pe.index>nt?(ht=Pe,Pe=null):ht=Pe.sibling;var _t=fe(te,Pe,le[nt],ve);if(_t===null){Pe===null&&(Pe=ht);break}t&&Pe&&_t.alternate===null&&i(te,Pe),J=_(_t,J,nt),bt===null?je=_t:bt.sibling=_t,bt=_t,Pe=ht}if(nt===le.length)return c(te,Pe),gt&&Bi(te,nt),je;if(Pe===null){for(;nt<le.length;nt++)Pe=we(te,le[nt],ve),Pe!==null&&(J=_(Pe,J,nt),bt===null?je=Pe:bt.sibling=Pe,bt=Pe);return gt&&Bi(te,nt),je}for(Pe=h(Pe);nt<le.length;nt++)ht=me(Pe,te,nt,le[nt],ve),ht!==null&&(t&&ht.alternate!==null&&Pe.delete(ht.key===null?nt:ht.key),J=_(ht,J,nt),bt===null?je=ht:bt.sibling=ht,bt=ht);return t&&Pe.forEach(function(Ua){return i(te,Ua)}),gt&&Bi(te,nt),je}function Xe(te,J,le,ve){if(le==null)throw Error(s(151));for(var je=null,bt=null,Pe=J,nt=J=0,ht=null,_t=le.next();Pe!==null&&!_t.done;nt++,_t=le.next()){Pe.index>nt?(ht=Pe,Pe=null):ht=Pe.sibling;var Ua=fe(te,Pe,_t.value,ve);if(Ua===null){Pe===null&&(Pe=ht);break}t&&Pe&&Ua.alternate===null&&i(te,Pe),J=_(Ua,J,nt),bt===null?je=Ua:bt.sibling=Ua,bt=Ua,Pe=ht}if(_t.done)return c(te,Pe),gt&&Bi(te,nt),je;if(Pe===null){for(;!_t.done;nt++,_t=le.next())_t=we(te,_t.value,ve),_t!==null&&(J=_(_t,J,nt),bt===null?je=_t:bt.sibling=_t,bt=_t);return gt&&Bi(te,nt),je}for(Pe=h(Pe);!_t.done;nt++,_t=le.next())_t=me(Pe,te,nt,_t.value,ve),_t!==null&&(t&&_t.alternate!==null&&Pe.delete(_t.key===null?nt:_t.key),J=_(_t,J,nt),bt===null?je=_t:bt.sibling=_t,bt=_t);return t&&Pe.forEach(function(Ob){return i(te,Ob)}),gt&&Bi(te,nt),je}function kt(te,J,le,ve){if(typeof le=="object"&&le!==null&&le.type===I&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case R:e:{for(var je=le.key;J!==null;){if(J.key===je){if(je=le.type,je===I){if(J.tag===7){c(te,J.sibling),ve=v(J,le.props.children),ve.return=te,te=ve;break e}}else if(J.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===de&&mo(je)===J.type){c(te,J.sibling),ve=v(J,le.props),el(ve,le),ve.return=te,te=ve;break e}c(te,J);break}else i(te,J);J=J.sibling}le.type===I?(ve=co(le.props.children,te.mode,ve,le.key),ve.return=te,te=ve):(ve=vc(le.type,le.key,le.props,null,te.mode,ve),el(ve,le),ve.return=te,te=ve)}return O(te);case k:e:{for(je=le.key;J!==null;){if(J.key===je)if(J.tag===4&&J.stateNode.containerInfo===le.containerInfo&&J.stateNode.implementation===le.implementation){c(te,J.sibling),ve=v(J,le.children||[]),ve.return=te,te=ve;break e}else{c(te,J);break}else i(te,J);J=J.sibling}ve=Sf(le,te.mode,ve),ve.return=te,te=ve}return O(te);case de:return le=mo(le),kt(te,J,le,ve)}if(re(le))return ke(te,J,le,ve);if($(le)){if(je=$(le),typeof je!="function")throw Error(s(150));return le=je.call(le),Xe(te,J,le,ve)}if(typeof le.then=="function")return kt(te,J,Sc(le),ve);if(le.$$typeof===H)return kt(te,J,_c(te,le),ve);Tc(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,J!==null&&J.tag===6?(c(te,J.sibling),ve=v(J,le),ve.return=te,te=ve):(c(te,J),ve=Cf(le,te.mode,ve),ve.return=te,te=ve),O(te)):c(te,J)}return function(te,J,le,ve){try{$s=0;var je=kt(te,J,le,ve);return Ko=null,je}catch(Pe){if(Pe===Wo||Pe===Ac)throw Pe;var bt=_r(29,Pe,null,te.mode);return bt.lanes=ve,bt.return=te,bt}finally{}}}var xo=A1(!0),C1=A1(!1),_a=!1;function Pf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ea(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Aa(t,i,c){var h=t.updateQueue;if(h===null)return null;if(h=h.shared,(Ct&2)!==0){var v=h.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),h.pending=i,i=yc(t),l1(t,null,c),i}return xc(t,h,i,c),yc(t)}function tl(t,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var h=i.lanes;h&=t.pendingLanes,c|=h,i.lanes=c,di(t,c)}}function Ff(t,i){var c=t.updateQueue,h=t.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var v=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var O={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?v=_=O:_=_.next=O,c=c.next}while(c!==null);_===null?v=_=i:_=_.next=i}else v=_=i;c={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},t.updateQueue=c;return}t=c.lastBaseUpdate,t===null?c.firstBaseUpdate=i:t.next=i,c.lastBaseUpdate=i}var jf=!1;function nl(){if(jf){var t=qo;if(t!==null)throw t}}function rl(t,i,c,h){jf=!1;var v=t.updateQueue;_a=!1;var _=v.firstBaseUpdate,O=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var Y=U,ce=Y.next;Y.next=null,O===null?_=ce:O.next=ce,O=Y;var ye=t.alternate;ye!==null&&(ye=ye.updateQueue,U=ye.lastBaseUpdate,U!==O&&(U===null?ye.firstBaseUpdate=ce:U.next=ce,ye.lastBaseUpdate=Y))}if(_!==null){var we=v.baseState;O=0,ye=ce=Y=null,U=_;do{var fe=U.lane&-536870913,me=fe!==U.lane;if(me?(dt&fe)===fe:(h&fe)===fe){fe!==0&&fe===Yo&&(jf=!0),ye!==null&&(ye=ye.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var ke=t,Xe=U;fe=i;var kt=c;switch(Xe.tag){case 1:if(ke=Xe.payload,typeof ke=="function"){we=ke.call(kt,we,fe);break e}we=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Xe.payload,fe=typeof ke=="function"?ke.call(kt,we,fe):ke,fe==null)break e;we=x({},we,fe);break e;case 2:_a=!0}}fe=U.callback,fe!==null&&(t.flags|=64,me&&(t.flags|=8192),me=v.callbacks,me===null?v.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ye===null?(ce=ye=me,Y=we):ye=ye.next=me,O|=fe;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;me=U,U=me.next,me.next=null,v.lastBaseUpdate=me,v.shared.pending=null}}while(!0);ye===null&&(Y=we),v.baseState=Y,v.firstBaseUpdate=ce,v.lastBaseUpdate=ye,_===null&&(v.shared.lanes=0),Na|=O,t.lanes=O,t.memoizedState=we}}function S1(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function T1(t,i){var c=t.callbacks;if(c!==null)for(t.callbacks=null,t=0;t<c.length;t++)S1(c[t],i)}var Qo=W(null),Rc=W(0);function R1(t,i){t=Zi,Se(Rc,t),Se(Qo,i),Zi=t|i.baseLanes}function Vf(){Se(Rc,Zi),Se(Qo,Qo.current)}function Hf(){Zi=Rc.current,se(Qo),se(Rc)}var Er=W(null),jr=null;function Ca(t){var i=t.alternate;Se(mn,mn.current&1),Se(Er,t),jr===null&&(i===null||Qo.current!==null||i.memoizedState!==null)&&(jr=t)}function Gf(t){Se(mn,mn.current),Se(Er,t),jr===null&&(jr=t)}function N1(t){t.tag===22?(Se(mn,mn.current),Se(Er,t),jr===null&&(jr=t)):Sa()}function Sa(){Se(mn,mn.current),Se(Er,Er.current)}function Ar(t){se(Er),jr===t&&(jr=null),se(mn)}var mn=W(0);function Nc(t){for(var i=t;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Kd(c)||Qd(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var zi=0,$e=null,Bt=null,bn=null,Oc=!1,Jo=!1,yo=!1,Ic=0,il=0,$o=null,ww=0;function ln(){throw Error(s(321))}function Zf(t,i){if(i===null)return!1;for(var c=0;c<i.length&&c<t.length;c++)if(!m(t[c],i[c]))return!1;return!0}function Xf(t,i,c,h,v,_){return zi=_,$e=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,ne.H=t===null||t.memoizedState===null?dg:sd,yo=!1,_=c(h,v),yo=!1,Jo&&(_=I1(i,c,h,v)),O1(t),_}function O1(t){ne.H=sl;var i=Bt!==null&&Bt.next!==null;if(zi=0,bn=Bt=$e=null,Oc=!1,il=0,$o=null,i)throw Error(s(300));t===null||_n||(t=t.dependencies,t!==null&&bc(t)&&(_n=!0))}function I1(t,i,c,h){$e=t;var v=0;do{if(Jo&&($o=null),il=0,Jo=!1,25<=v)throw Error(s(301));if(v+=1,bn=Bt=null,t.updateQueue!=null){var _=t.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}ne.H=hg,_=i(c,h)}while(Jo);return _}function bw(){var t=ne.H,i=t.useState()[0];return i=typeof i.then=="function"?al(i):i,t=t.useState()[0],(Bt!==null?Bt.memoizedState:null)!==t&&($e.flags|=1024),i}function Yf(){var t=Ic!==0;return Ic=0,t}function qf(t,i,c){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~c}function Wf(t){if(Oc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Oc=!1}zi=0,bn=Bt=$e=null,Jo=!1,il=Ic=0,$o=null}function er(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bn===null?$e.memoizedState=bn=t:bn=bn.next=t,bn}function pn(){if(Bt===null){var t=$e.alternate;t=t!==null?t.memoizedState:null}else t=Bt.next;var i=bn===null?$e.memoizedState:bn.next;if(i!==null)bn=i,Bt=t;else{if(t===null)throw $e.alternate===null?Error(s(467)):Error(s(310));Bt=t,t={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},bn===null?$e.memoizedState=bn=t:bn=bn.next=t}return bn}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(t){var i=il;return il+=1,$o===null&&($o=[]),t=b1($o,t,i),i=$e,(bn===null?i.memoizedState:bn.next)===null&&(i=i.alternate,ne.H=i===null||i.memoizedState===null?dg:sd),t}function Dc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return al(t);if(t.$$typeof===H)return jn(t)}throw Error(s(438,String(t)))}function Kf(t){var i=null,c=$e.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var h=$e.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(i={data:h.data.map(function(v){return v.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=Mc(),$e.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(t),h=0;h<t;h++)c[h]=Oe;return i.index++,c}function Pi(t,i){return typeof i=="function"?i(t):i}function Bc(t){var i=pn();return Qf(i,Bt,t)}function Qf(t,i,c){var h=t.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=c;var v=t.baseQueue,_=h.pending;if(_!==null){if(v!==null){var O=v.next;v.next=_.next,_.next=O}i.baseQueue=v=_,h.pending=null}if(_=t.baseState,v===null)t.memoizedState=_;else{i=v.next;var U=O=null,Y=null,ce=i,ye=!1;do{var we=ce.lane&-536870913;if(we!==ce.lane?(dt&we)===we:(zi&we)===we){var fe=ce.revertLane;if(fe===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),we===Yo&&(ye=!0);else if((zi&fe)===fe){ce=ce.next,fe===Yo&&(ye=!0);continue}else we={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Y===null?(U=Y=we,O=_):Y=Y.next=we,$e.lanes|=fe,Na|=fe;we=ce.action,yo&&c(_,we),_=ce.hasEagerState?ce.eagerState:c(_,we)}else fe={lane:we,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Y===null?(U=Y=fe,O=_):Y=Y.next=fe,$e.lanes|=we,Na|=we;ce=ce.next}while(ce!==null&&ce!==i);if(Y===null?O=_:Y.next=U,!m(_,t.memoizedState)&&(_n=!0,ye&&(c=qo,c!==null)))throw c;t.memoizedState=_,t.baseState=O,t.baseQueue=Y,h.lastRenderedState=_}return v===null&&(h.lanes=0),[t.memoizedState,h.dispatch]}function Jf(t){var i=pn(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=t;var h=c.dispatch,v=c.pending,_=i.memoizedState;if(v!==null){c.pending=null;var O=v=v.next;do _=t(_,O.action),O=O.next;while(O!==v);m(_,i.memoizedState)||(_n=!0),i.memoizedState=_,i.baseQueue===null&&(i.baseState=_),c.lastRenderedState=_}return[_,h]}function M1(t,i,c){var h=$e,v=pn(),_=gt;if(_){if(c===void 0)throw Error(s(407));c=c()}else c=i();var O=!m((Bt||v).memoizedState,c);if(O&&(v.memoizedState=c,_n=!0),v=v.queue,td(L1.bind(null,h,v,t),[t]),v.getSnapshot!==i||O||bn!==null&&bn.memoizedState.tag&1){if(h.flags|=2048,es(9,{destroy:void 0},B1.bind(null,h,v,c,i),null),Ft===null)throw Error(s(349));_||(zi&127)!==0||D1(h,i,c)}return c}function D1(t,i,c){t.flags|=16384,t={getSnapshot:i,value:c},i=$e.updateQueue,i===null?(i=Mc(),$e.updateQueue=i,i.stores=[t]):(c=i.stores,c===null?i.stores=[t]:c.push(t))}function B1(t,i,c,h){i.value=c,i.getSnapshot=h,k1(i)&&z1(t)}function L1(t,i,c){return c(function(){k1(i)&&z1(t)})}function k1(t){var i=t.getSnapshot;t=t.value;try{var c=i();return!m(t,c)}catch{return!0}}function z1(t){var i=lo(t,2);i!==null&&hr(i,t,2)}function $f(t){var i=er();if(typeof t=="function"){var c=t;if(t=c(),yo){Dt(!0);try{c()}finally{Dt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:t},i}function P1(t,i,c,h){return t.baseState=c,Qf(t,Bt,typeof h=="function"?h:Pi)}function _w(t,i,c,h,v){if(zc(t))throw Error(s(485));if(t=i.action,t!==null){var _={payload:v,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){_.listeners.push(O)}};ne.T!==null?c(!0):_.isTransition=!1,h(_),c=i.pending,c===null?(_.next=i.pending=_,U1(i,_)):(_.next=c.next,i.pending=c.next=_)}}function U1(t,i){var c=i.action,h=i.payload,v=t.state;if(i.isTransition){var _=ne.T,O={};ne.T=O;try{var U=c(v,h),Y=ne.S;Y!==null&&Y(O,U),F1(t,i,U)}catch(ce){ed(t,i,ce)}finally{_!==null&&O.types!==null&&(_.types=O.types),ne.T=_}}else try{_=c(v,h),F1(t,i,_)}catch(ce){ed(t,i,ce)}}function F1(t,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){j1(t,i,h)},function(h){return ed(t,i,h)}):j1(t,i,c)}function j1(t,i,c){i.status="fulfilled",i.value=c,V1(i),t.state=c,i=t.pending,i!==null&&(c=i.next,c===i?t.pending=null:(c=c.next,i.next=c,U1(t,c)))}function ed(t,i,c){var h=t.pending;if(t.pending=null,h!==null){h=h.next;do i.status="rejected",i.reason=c,V1(i),i=i.next;while(i!==h)}t.action=null}function V1(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function H1(t,i){return i}function G1(t,i){if(gt){var c=Ft.formState;if(c!==null){e:{var h=$e;if(gt){if(Zt){t:{for(var v=Zt,_=Fr;v.nodeType!==8;){if(!_){v=null;break t}if(v=Vr(v.nextSibling),v===null){v=null;break t}}_=v.data,v=_==="F!"||_==="F"?v:null}if(v){Zt=Vr(v.nextSibling),h=v.data==="F!";break e}}wa(h)}h=!1}h&&(i=c[0])}}return c=er(),c.memoizedState=c.baseState=i,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H1,lastRenderedState:i},c.queue=h,c=cg.bind(null,$e,h),h.dispatch=c,h=$f(!1),_=od.bind(null,$e,!1,h.queue),h=er(),v={state:i,dispatch:null,action:t,pending:null},h.queue=v,c=_w.bind(null,$e,v,_,c),v.dispatch=c,h.memoizedState=t,[i,c,!1]}function Z1(t){var i=pn();return X1(i,Bt,t)}function X1(t,i,c){if(i=Qf(t,i,H1)[0],t=Bc(Pi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var h=al(i)}catch(O){throw O===Wo?Ac:O}else h=i;i=pn();var v=i.queue,_=v.dispatch;return c!==i.memoizedState&&($e.flags|=2048,es(9,{destroy:void 0},Ew.bind(null,v,c),null)),[h,_,t]}function Ew(t,i){t.action=i}function Y1(t){var i=pn(),c=Bt;if(c!==null)return X1(i,c,t);pn(),i=i.memoizedState,c=pn();var h=c.queue.dispatch;return c.memoizedState=t,[i,h,!1]}function es(t,i,c,h){return t={tag:t,create:c,deps:h,inst:i,next:null},i=$e.updateQueue,i===null&&(i=Mc(),$e.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=t.next=t:(h=c.next,c.next=t,t.next=h,i.lastEffect=t),t}function q1(){return pn().memoizedState}function Lc(t,i,c,h){var v=er();$e.flags|=t,v.memoizedState=es(1|i,{destroy:void 0},c,h===void 0?null:h)}function kc(t,i,c,h){var v=pn();h=h===void 0?null:h;var _=v.memoizedState.inst;Bt!==null&&h!==null&&Zf(h,Bt.memoizedState.deps)?v.memoizedState=es(i,_,c,h):($e.flags|=t,v.memoizedState=es(1|i,_,c,h))}function W1(t,i){Lc(8390656,8,t,i)}function td(t,i){kc(2048,8,t,i)}function Aw(t){$e.flags|=4;var i=$e.updateQueue;if(i===null)i=Mc(),$e.updateQueue=i,i.events=[t];else{var c=i.events;c===null?i.events=[t]:c.push(t)}}function K1(t){var i=pn().memoizedState;return Aw({ref:i,nextImpl:t}),function(){if((Ct&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Q1(t,i){return kc(4,2,t,i)}function J1(t,i){return kc(4,4,t,i)}function $1(t,i){if(typeof i=="function"){t=t();var c=i(t);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function eg(t,i,c){c=c!=null?c.concat([t]):null,kc(4,4,$1.bind(null,i,t),c)}function nd(){}function tg(t,i){var c=pn();i=i===void 0?null:i;var h=c.memoizedState;return i!==null&&Zf(i,h[1])?h[0]:(c.memoizedState=[t,i],t)}function ng(t,i){var c=pn();i=i===void 0?null:i;var h=c.memoizedState;if(i!==null&&Zf(i,h[1]))return h[0];if(h=t(),yo){Dt(!0);try{t()}finally{Dt(!1)}}return c.memoizedState=[h,i],h}function rd(t,i,c){return c===void 0||(zi&1073741824)!==0&&(dt&261930)===0?t.memoizedState=i:(t.memoizedState=c,t=rm(),$e.lanes|=t,Na|=t,c)}function rg(t,i,c,h){return m(c,i)?c:Qo.current!==null?(t=rd(t,c,h),m(t,i)||(_n=!0),t):(zi&42)===0||(zi&1073741824)!==0&&(dt&261930)===0?(_n=!0,t.memoizedState=c):(t=rm(),$e.lanes|=t,Na|=t,i)}function ig(t,i,c,h,v){var _=xe.p;xe.p=_!==0&&8>_?_:8;var O=ne.T,U={};ne.T=U,od(t,!1,i,c);try{var Y=v(),ce=ne.S;if(ce!==null&&ce(U,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ye=vw(Y,h);ol(t,i,ye,Tr(t))}else ol(t,i,h,Tr(t))}catch(we){ol(t,i,{then:function(){},status:"rejected",reason:we},Tr())}finally{xe.p=_,O!==null&&U.types!==null&&(O.types=U.types),ne.T=O}}function Cw(){}function id(t,i,c,h){if(t.tag!==5)throw Error(s(476));var v=ag(t).queue;ig(t,v,i,Me,c===null?Cw:function(){return og(t),c(h)})}function ag(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Me,baseState:Me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:Me},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:c},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function og(t){var i=ag(t);i.next===null&&(i=t.alternate.memoizedState),ol(t,i.next.queue,{},Tr())}function ad(){return jn(El)}function sg(){return pn().memoizedState}function lg(){return pn().memoizedState}function Sw(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var c=Tr();t=Ea(c);var h=Aa(i,t,c);h!==null&&(hr(h,i,c),tl(h,i,c)),i={cache:Bf()},t.payload=i;return}i=i.return}}function Tw(t,i,c){var h=Tr();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},zc(t)?ug(i,c):(c=Ef(t,i,c,h),c!==null&&(hr(c,t,h),fg(c,i,h)))}function cg(t,i,c){var h=Tr();ol(t,i,c,h)}function ol(t,i,c,h){var v={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(zc(t))ug(i,v);else{var _=t.alternate;if(t.lanes===0&&(_===null||_.lanes===0)&&(_=i.lastRenderedReducer,_!==null))try{var O=i.lastRenderedState,U=_(O,c);if(v.hasEagerState=!0,v.eagerState=U,m(U,O))return xc(t,i,v,0),Ft===null&&pc(),!1}catch{}finally{}if(c=Ef(t,i,v,h),c!==null)return hr(c,t,h),fg(c,i,h),!0}return!1}function od(t,i,c,h){if(h={lane:2,revertLane:Pd(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},zc(t)){if(i)throw Error(s(479))}else i=Ef(t,c,h,2),i!==null&&hr(i,t,2)}function zc(t){var i=t.alternate;return t===$e||i!==null&&i===$e}function ug(t,i){Jo=Oc=!0;var c=t.pending;c===null?i.next=i:(i.next=c.next,c.next=i),t.pending=i}function fg(t,i,c){if((c&4194048)!==0){var h=i.lanes;h&=t.pendingLanes,c|=h,i.lanes=c,di(t,c)}}var sl={readContext:jn,use:Dc,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};sl.useEffectEvent=ln;var dg={readContext:jn,use:Dc,useCallback:function(t,i){return er().memoizedState=[t,i===void 0?null:i],t},useContext:jn,useEffect:W1,useImperativeHandle:function(t,i,c){c=c!=null?c.concat([t]):null,Lc(4194308,4,$1.bind(null,i,t),c)},useLayoutEffect:function(t,i){return Lc(4194308,4,t,i)},useInsertionEffect:function(t,i){Lc(4,2,t,i)},useMemo:function(t,i){var c=er();i=i===void 0?null:i;var h=t();if(yo){Dt(!0);try{t()}finally{Dt(!1)}}return c.memoizedState=[h,i],h},useReducer:function(t,i,c){var h=er();if(c!==void 0){var v=c(i);if(yo){Dt(!0);try{c(i)}finally{Dt(!1)}}}else v=i;return h.memoizedState=h.baseState=v,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:v},h.queue=t,t=t.dispatch=Tw.bind(null,$e,t),[h.memoizedState,t]},useRef:function(t){var i=er();return t={current:t},i.memoizedState=t},useState:function(t){t=$f(t);var i=t.queue,c=cg.bind(null,$e,i);return i.dispatch=c,[t.memoizedState,c]},useDebugValue:nd,useDeferredValue:function(t,i){var c=er();return rd(c,t,i)},useTransition:function(){var t=$f(!1);return t=ig.bind(null,$e,t.queue,!0,!1),er().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,c){var h=$e,v=er();if(gt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),Ft===null)throw Error(s(349));(dt&127)!==0||D1(h,i,c)}v.memoizedState=c;var _={value:c,getSnapshot:i};return v.queue=_,W1(L1.bind(null,h,_,t),[t]),h.flags|=2048,es(9,{destroy:void 0},B1.bind(null,h,_,c,i),null),c},useId:function(){var t=er(),i=Ft.identifierPrefix;if(gt){var c=yi,h=xi;c=(h&~(1<<32-et(h)-1)).toString(32)+c,i="_"+i+"R_"+c,c=Ic++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=ww++,i="_"+i+"r_"+c.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:ad,useFormState:G1,useActionState:G1,useOptimistic:function(t){var i=er();i.memoizedState=i.baseState=t;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=od.bind(null,$e,!0,c),c.dispatch=i,[t,i]},useMemoCache:Kf,useCacheRefresh:function(){return er().memoizedState=Sw.bind(null,$e)},useEffectEvent:function(t){var i=er(),c={impl:t};return i.memoizedState=c,function(){if((Ct&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},sd={readContext:jn,use:Dc,useCallback:tg,useContext:jn,useEffect:td,useImperativeHandle:eg,useInsertionEffect:Q1,useLayoutEffect:J1,useMemo:ng,useReducer:Bc,useRef:q1,useState:function(){return Bc(Pi)},useDebugValue:nd,useDeferredValue:function(t,i){var c=pn();return rg(c,Bt.memoizedState,t,i)},useTransition:function(){var t=Bc(Pi)[0],i=pn().memoizedState;return[typeof t=="boolean"?t:al(t),i]},useSyncExternalStore:M1,useId:sg,useHostTransitionStatus:ad,useFormState:Z1,useActionState:Z1,useOptimistic:function(t,i){var c=pn();return P1(c,Bt,t,i)},useMemoCache:Kf,useCacheRefresh:lg};sd.useEffectEvent=K1;var hg={readContext:jn,use:Dc,useCallback:tg,useContext:jn,useEffect:td,useImperativeHandle:eg,useInsertionEffect:Q1,useLayoutEffect:J1,useMemo:ng,useReducer:Jf,useRef:q1,useState:function(){return Jf(Pi)},useDebugValue:nd,useDeferredValue:function(t,i){var c=pn();return Bt===null?rd(c,t,i):rg(c,Bt.memoizedState,t,i)},useTransition:function(){var t=Jf(Pi)[0],i=pn().memoizedState;return[typeof t=="boolean"?t:al(t),i]},useSyncExternalStore:M1,useId:sg,useHostTransitionStatus:ad,useFormState:Y1,useActionState:Y1,useOptimistic:function(t,i){var c=pn();return Bt!==null?P1(c,Bt,t,i):(c.baseState=t,[t,c.queue.dispatch])},useMemoCache:Kf,useCacheRefresh:lg};hg.useEffectEvent=K1;function ld(t,i,c,h){i=t.memoizedState,c=c(h,i),c=c==null?i:x({},i,c),t.memoizedState=c,t.lanes===0&&(t.updateQueue.baseState=c)}var cd={enqueueSetState:function(t,i,c){t=t._reactInternals;var h=Tr(),v=Ea(h);v.payload=i,c!=null&&(v.callback=c),i=Aa(t,v,h),i!==null&&(hr(i,t,h),tl(i,t,h))},enqueueReplaceState:function(t,i,c){t=t._reactInternals;var h=Tr(),v=Ea(h);v.tag=1,v.payload=i,c!=null&&(v.callback=c),i=Aa(t,v,h),i!==null&&(hr(i,t,h),tl(i,t,h))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var c=Tr(),h=Ea(c);h.tag=2,i!=null&&(h.callback=i),i=Aa(t,h,c),i!==null&&(hr(i,t,c),tl(i,t,c))}};function gg(t,i,c,h,v,_,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(h,_,O):i.prototype&&i.prototype.isPureReactComponent?!p(c,h)||!p(v,_):!0}function mg(t,i,c,h){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,h),i.state!==t&&cd.enqueueReplaceState(i,i.state,null)}function vo(t,i){var c=i;if("ref"in i){c={};for(var h in i)h!=="ref"&&(c[h]=i[h])}if(t=t.defaultProps){c===i&&(c=x({},c));for(var v in t)c[v]===void 0&&(c[v]=t[v])}return c}function pg(t){mc(t)}function xg(t){console.error(t)}function yg(t){mc(t)}function Pc(t,i){try{var c=t.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(h){setTimeout(function(){throw h})}}function vg(t,i,c){try{var h=t.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function ud(t,i,c){return c=Ea(c),c.tag=3,c.payload={element:null},c.callback=function(){Pc(t,i)},c}function wg(t){return t=Ea(t),t.tag=3,t}function bg(t,i,c,h){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var _=h.value;t.payload=function(){return v(_)},t.callback=function(){vg(i,c,h)}}var O=c.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){vg(i,c,h),typeof v!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var U=h.stack;this.componentDidCatch(h.value,{componentStack:U!==null?U:""})})}function Rw(t,i,c,h,v){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(i=c.alternate,i!==null&&Xo(i,c,v,!0),c=Er.current,c!==null){switch(c.tag){case 31:case 13:return jr===null?Kc():c.alternate===null&&cn===0&&(cn=3),c.flags&=-257,c.flags|=65536,c.lanes=v,h===Cc?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([h]):i.add(h),Ld(t,h,v)),!1;case 22:return c.flags|=65536,h===Cc?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([h]):c.add(h)),Ld(t,h,v)),!1}throw Error(s(435,c.tag))}return Ld(t,h,v),Kc(),!1}if(gt)return i=Er.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=v,h!==Nf&&(t=Error(s(422),{cause:h}),Ks(zr(t,c)))):(h!==Nf&&(i=Error(s(423),{cause:h}),Ks(zr(i,c))),t=t.current.alternate,t.flags|=65536,v&=-v,t.lanes|=v,h=zr(h,c),v=ud(t.stateNode,h,v),Ff(t,v),cn!==4&&(cn=2)),!1;var _=Error(s(520),{cause:h});if(_=zr(_,c),ml===null?ml=[_]:ml.push(_),cn!==4&&(cn=2),i===null)return!0;h=zr(h,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,t=v&-v,c.lanes|=t,t=ud(c.stateNode,h,t),Ff(c,t),!1;case 1:if(i=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Oa===null||!Oa.has(_))))return c.flags|=65536,v&=-v,c.lanes|=v,v=wg(v),bg(v,t,c,h),Ff(c,v),!1}c=c.return}while(c!==null);return!1}var fd=Error(s(461)),_n=!1;function Vn(t,i,c,h){i.child=t===null?C1(i,null,c,h):xo(i,t.child,c,h)}function _g(t,i,c,h,v){c=c.render;var _=i.ref;if("ref"in h){var O={};for(var U in h)U!=="ref"&&(O[U]=h[U])}else O=h;return ho(i),h=Xf(t,i,c,O,_,v),U=Yf(),t!==null&&!_n?(qf(t,i,v),Ui(t,i,v)):(gt&&U&&Tf(i),i.flags|=1,Vn(t,i,h,v),i.child)}function Eg(t,i,c,h,v){if(t===null){var _=c.type;return typeof _=="function"&&!Af(_)&&_.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=_,Ag(t,i,_,h,v)):(t=vc(c.type,null,h,i,i.mode,v),t.ref=i.ref,t.return=i,i.child=t)}if(_=t.child,!vd(t,v)){var O=_.memoizedProps;if(c=c.compare,c=c!==null?c:p,c(O,h)&&t.ref===i.ref)return Ui(t,i,v)}return i.flags|=1,t=Di(_,h),t.ref=i.ref,t.return=i,i.child=t}function Ag(t,i,c,h,v){if(t!==null){var _=t.memoizedProps;if(p(_,h)&&t.ref===i.ref)if(_n=!1,i.pendingProps=h=_,vd(t,v))(t.flags&131072)!==0&&(_n=!0);else return i.lanes=t.lanes,Ui(t,i,v)}return dd(t,i,c,h,v)}function Cg(t,i,c,h){var v=h.children,_=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((i.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,t!==null){for(h=i.child=t.child,v=0;h!==null;)v=v|h.lanes|h.childLanes,h=h.sibling;h=v&~_}else h=0,i.child=null;return Sg(t,i,_,c,h)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ec(i,_!==null?_.cachePool:null),_!==null?R1(i,_):Vf(),N1(i);else return h=i.lanes=536870912,Sg(t,i,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(Ec(i,_.cachePool),R1(i,_),Sa(),i.memoizedState=null):(t!==null&&Ec(i,null),Vf(),Sa());return Vn(t,i,v,c),i.child}function ll(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Sg(t,i,c,h,v){var _=kf();return _=_===null?null:{parent:wn._currentValue,pool:_},i.memoizedState={baseLanes:c,cachePool:_},t!==null&&Ec(i,null),Vf(),N1(i),t!==null&&Xo(t,i,h,!0),i.childLanes=v,null}function Uc(t,i){return i=jc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Tg(t,i,c){return xo(i,t.child,null,c),t=Uc(i,i.pendingProps),t.flags|=2,Ar(i),i.memoizedState=null,t}function Nw(t,i,c){var h=i.pendingProps,v=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(gt){if(h.mode==="hidden")return t=Uc(i,h),i.lanes=536870912,ll(null,t);if(Gf(i),(t=Zt)?(t=Um(t,Fr),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ya!==null?{id:xi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},c=u1(t),c.return=i,i.child=c,Fn=i,Zt=null)):t=null,t===null)throw wa(i);return i.lanes=536870912,null}return Uc(i,h)}var _=t.memoizedState;if(_!==null){var O=_.dehydrated;if(Gf(i),v)if(i.flags&256)i.flags&=-257,i=Tg(t,i,c);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(_n||Xo(t,i,c,!1),v=(c&t.childLanes)!==0,_n||v){if(h=Ft,h!==null&&(O=Oo(h,c),O!==0&&O!==_.retryLane))throw _.retryLane=O,lo(t,O),hr(h,t,O),fd;Kc(),i=Tg(t,i,c)}else t=_.treeContext,Zt=Vr(O.nextSibling),Fn=i,gt=!0,va=null,Fr=!1,t!==null&&h1(i,t),i=Uc(i,h),i.flags|=4096;return i}return t=Di(t.child,{mode:h.mode,children:h.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Fc(t,i){var c=i.ref;if(c===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(t===null||t.ref!==c)&&(i.flags|=4194816)}}function dd(t,i,c,h,v){return ho(i),c=Xf(t,i,c,h,void 0,v),h=Yf(),t!==null&&!_n?(qf(t,i,v),Ui(t,i,v)):(gt&&h&&Tf(i),i.flags|=1,Vn(t,i,c,v),i.child)}function Rg(t,i,c,h,v,_){return ho(i),i.updateQueue=null,c=I1(i,h,c,v),O1(t),h=Yf(),t!==null&&!_n?(qf(t,i,_),Ui(t,i,_)):(gt&&h&&Tf(i),i.flags|=1,Vn(t,i,c,_),i.child)}function Ng(t,i,c,h,v){if(ho(i),i.stateNode===null){var _=Vo,O=c.contextType;typeof O=="object"&&O!==null&&(_=jn(O)),_=new c(h,_),i.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=cd,i.stateNode=_,_._reactInternals=i,_=i.stateNode,_.props=h,_.state=i.memoizedState,_.refs={},Pf(i),O=c.contextType,_.context=typeof O=="object"&&O!==null?jn(O):Vo,_.state=i.memoizedState,O=c.getDerivedStateFromProps,typeof O=="function"&&(ld(i,c,O,h),_.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(O=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),O!==_.state&&cd.enqueueReplaceState(_,_.state,null),rl(i,h,_,v),nl(),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308),h=!0}else if(t===null){_=i.stateNode;var U=i.memoizedProps,Y=vo(c,U);_.props=Y;var ce=_.context,ye=c.contextType;O=Vo,typeof ye=="object"&&ye!==null&&(O=jn(ye));var we=c.getDerivedStateFromProps;ye=typeof we=="function"||typeof _.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(U||ce!==O)&&mg(i,_,h,O),_a=!1;var fe=i.memoizedState;_.state=fe,rl(i,h,_,v),nl(),ce=i.memoizedState,U||fe!==ce||_a?(typeof we=="function"&&(ld(i,c,we,h),ce=i.memoizedState),(Y=_a||gg(i,c,Y,h,fe,ce,O))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=ce),_.props=h,_.state=ce,_.context=O,h=Y):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{_=i.stateNode,Uf(t,i),O=i.memoizedProps,ye=vo(c,O),_.props=ye,we=i.pendingProps,fe=_.context,ce=c.contextType,Y=Vo,typeof ce=="object"&&ce!==null&&(Y=jn(ce)),U=c.getDerivedStateFromProps,(ce=typeof U=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==we||fe!==Y)&&mg(i,_,h,Y),_a=!1,fe=i.memoizedState,_.state=fe,rl(i,h,_,v),nl();var me=i.memoizedState;O!==we||fe!==me||_a||t!==null&&t.dependencies!==null&&bc(t.dependencies)?(typeof U=="function"&&(ld(i,c,U,h),me=i.memoizedState),(ye=_a||gg(i,c,ye,h,fe,me,Y)||t!==null&&t.dependencies!==null&&bc(t.dependencies))?(ce||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,me,Y),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,me,Y)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=me),_.props=h,_.state=me,_.context=Y,h=ye):(typeof _.componentDidUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=1024),h=!1)}return _=h,Fc(t,i),h=(i.flags&128)!==0,_||h?(_=i.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),i.flags|=1,t!==null&&h?(i.child=xo(i,t.child,null,v),i.child=xo(i,null,c,v)):Vn(t,i,c,v),i.memoizedState=_.state,t=i.child):t=Ui(t,i,v),t}function Og(t,i,c,h){return uo(),i.flags|=256,Vn(t,i,c,h),i.child}var hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gd(t){return{baseLanes:t,cachePool:v1()}}function md(t,i,c){return t=t!==null?t.childLanes&~c:0,i&&(t|=Sr),t}function Ig(t,i,c){var h=i.pendingProps,v=!1,_=(i.flags&128)!==0,O;if((O=_)||(O=t!==null&&t.memoizedState===null?!1:(mn.current&2)!==0),O&&(v=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(gt){if(v?Ca(i):Sa(),(t=Zt)?(t=Um(t,Fr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ya!==null?{id:xi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},c=u1(t),c.return=i,i.child=c,Fn=i,Zt=null)):t=null,t===null)throw wa(i);return Qd(t)?i.lanes=32:i.lanes=536870912,null}var U=h.children;return h=h.fallback,v?(Sa(),v=i.mode,U=jc({mode:"hidden",children:U},v),h=co(h,v,c,null),U.return=i,h.return=i,U.sibling=h,i.child=U,h=i.child,h.memoizedState=gd(c),h.childLanes=md(t,O,c),i.memoizedState=hd,ll(null,h)):(Ca(i),pd(i,U))}var Y=t.memoizedState;if(Y!==null&&(U=Y.dehydrated,U!==null)){if(_)i.flags&256?(Ca(i),i.flags&=-257,i=xd(t,i,c)):i.memoizedState!==null?(Sa(),i.child=t.child,i.flags|=128,i=null):(Sa(),U=h.fallback,v=i.mode,h=jc({mode:"visible",children:h.children},v),U=co(U,v,c,null),U.flags|=2,h.return=i,U.return=i,h.sibling=U,i.child=h,xo(i,t.child,null,c),h=i.child,h.memoizedState=gd(c),h.childLanes=md(t,O,c),i.memoizedState=hd,i=ll(null,h));else if(Ca(i),Qd(U)){if(O=U.nextSibling&&U.nextSibling.dataset,O)var ce=O.dgst;O=ce,h=Error(s(419)),h.stack="",h.digest=O,Ks({value:h,source:null,stack:null}),i=xd(t,i,c)}else if(_n||Xo(t,i,c,!1),O=(c&t.childLanes)!==0,_n||O){if(O=Ft,O!==null&&(h=Oo(O,c),h!==0&&h!==Y.retryLane))throw Y.retryLane=h,lo(t,h),hr(O,t,h),fd;Kd(U)||Kc(),i=xd(t,i,c)}else Kd(U)?(i.flags|=192,i.child=t.child,i=null):(t=Y.treeContext,Zt=Vr(U.nextSibling),Fn=i,gt=!0,va=null,Fr=!1,t!==null&&h1(i,t),i=pd(i,h.children),i.flags|=4096);return i}return v?(Sa(),U=h.fallback,v=i.mode,Y=t.child,ce=Y.sibling,h=Di(Y,{mode:"hidden",children:h.children}),h.subtreeFlags=Y.subtreeFlags&65011712,ce!==null?U=Di(ce,U):(U=co(U,v,c,null),U.flags|=2),U.return=i,h.return=i,h.sibling=U,i.child=h,ll(null,h),h=i.child,U=t.child.memoizedState,U===null?U=gd(c):(v=U.cachePool,v!==null?(Y=wn._currentValue,v=v.parent!==Y?{parent:Y,pool:Y}:v):v=v1(),U={baseLanes:U.baseLanes|c,cachePool:v}),h.memoizedState=U,h.childLanes=md(t,O,c),i.memoizedState=hd,ll(t.child,h)):(Ca(i),c=t.child,t=c.sibling,c=Di(c,{mode:"visible",children:h.children}),c.return=i,c.sibling=null,t!==null&&(O=i.deletions,O===null?(i.deletions=[t],i.flags|=16):O.push(t)),i.child=c,i.memoizedState=null,c)}function pd(t,i){return i=jc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function jc(t,i){return t=_r(22,t,null,i),t.lanes=0,t}function xd(t,i,c){return xo(i,t.child,null,c),t=pd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Mg(t,i,c){t.lanes|=i;var h=t.alternate;h!==null&&(h.lanes|=i),Mf(t.return,i,c)}function yd(t,i,c,h,v,_){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,treeForkCount:_}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=c,O.tailMode=v,O.treeForkCount=_)}function Dg(t,i,c){var h=i.pendingProps,v=h.revealOrder,_=h.tail;h=h.children;var O=mn.current,U=(O&2)!==0;if(U?(O=O&1|2,i.flags|=128):O&=1,Se(mn,O),Vn(t,i,h,c),h=gt?Ws:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Mg(t,c,i);else if(t.tag===19)Mg(t,c,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(v){case"forwards":for(c=i.child,v=null;c!==null;)t=c.alternate,t!==null&&Nc(t)===null&&(v=c),c=c.sibling;c=v,c===null?(v=i.child,i.child=null):(v=c.sibling,c.sibling=null),yd(i,!1,v,c,_,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=i.child,i.child=null;v!==null;){if(t=v.alternate,t!==null&&Nc(t)===null){i.child=v;break}t=v.sibling,v.sibling=c,c=v,v=t}yd(i,!0,c,null,_,h);break;case"together":yd(i,!1,null,null,void 0,h);break;default:i.memoizedState=null}return i.child}function Ui(t,i,c){if(t!==null&&(i.dependencies=t.dependencies),Na|=i.lanes,(c&i.childLanes)===0)if(t!==null){if(Xo(t,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,c=Di(t,t.pendingProps),i.child=c,c.return=i;t.sibling!==null;)t=t.sibling,c=c.sibling=Di(t,t.pendingProps),c.return=i;c.sibling=null}return i.child}function vd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&bc(t)))}function Ow(t,i,c){switch(i.tag){case 3:Qe(i,i.stateNode.containerInfo),ba(i,wn,t.memoizedState.cache),uo();break;case 27:case 5:Yn(i);break;case 4:Qe(i,i.stateNode.containerInfo);break;case 10:ba(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Gf(i),null;break;case 13:var h=i.memoizedState;if(h!==null)return h.dehydrated!==null?(Ca(i),i.flags|=128,null):(c&i.child.childLanes)!==0?Ig(t,i,c):(Ca(i),t=Ui(t,i,c),t!==null?t.sibling:null);Ca(i);break;case 19:var v=(t.flags&128)!==0;if(h=(c&i.childLanes)!==0,h||(Xo(t,i,c,!1),h=(c&i.childLanes)!==0),v){if(h)return Dg(t,i,c);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Se(mn,mn.current),h)break;return null;case 22:return i.lanes=0,Cg(t,i,c,i.pendingProps);case 24:ba(i,wn,t.memoizedState.cache)}return Ui(t,i,c)}function Bg(t,i,c){if(t!==null)if(t.memoizedProps!==i.pendingProps)_n=!0;else{if(!vd(t,c)&&(i.flags&128)===0)return _n=!1,Ow(t,i,c);_n=(t.flags&131072)!==0}else _n=!1,gt&&(i.flags&1048576)!==0&&d1(i,Ws,i.index);switch(i.lanes=0,i.tag){case 16:e:{var h=i.pendingProps;if(t=mo(i.elementType),i.type=t,typeof t=="function")Af(t)?(h=vo(t,h),i.tag=1,i=Ng(null,i,t,h,c)):(i.tag=0,i=dd(null,i,t,h,c));else{if(t!=null){var v=t.$$typeof;if(v===j){i.tag=11,i=_g(null,i,t,h,c);break e}else if(v===X){i.tag=14,i=Eg(null,i,t,h,c);break e}}throw i=Ce(t)||t,Error(s(306,i,""))}}return i;case 0:return dd(t,i,i.type,i.pendingProps,c);case 1:return h=i.type,v=vo(h,i.pendingProps),Ng(t,i,h,v,c);case 3:e:{if(Qe(i,i.stateNode.containerInfo),t===null)throw Error(s(387));h=i.pendingProps;var _=i.memoizedState;v=_.element,Uf(t,i),rl(i,h,null,c);var O=i.memoizedState;if(h=O.cache,ba(i,wn,h),h!==_.cache&&Df(i,[wn],c,!0),nl(),h=O.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:O.cache},i.updateQueue.baseState=_,i.memoizedState=_,i.flags&256){i=Og(t,i,h,c);break e}else if(h!==v){v=zr(Error(s(424)),i),Ks(v),i=Og(t,i,h,c);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Zt=Vr(t.firstChild),Fn=i,gt=!0,va=null,Fr=!0,c=C1(i,null,h,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(uo(),h===v){i=Ui(t,i,c);break e}Vn(t,i,h,c)}i=i.child}return i;case 26:return Fc(t,i),t===null?(c=Zm(i.type,null,i.pendingProps,null))?i.memoizedState=c:gt||(c=i.type,t=i.pendingProps,h=ru(Te.current).createElement(c),h[dn]=i,h[Ot]=t,Hn(h,c,t),on(h),i.stateNode=h):i.memoizedState=Zm(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Yn(i),t===null&>&&(h=i.stateNode=Vm(i.type,i.pendingProps,Te.current),Fn=i,Fr=!0,v=Zt,Ba(i.type)?(Jd=v,Zt=Vr(h.firstChild)):Zt=v),Vn(t,i,i.pendingProps.children,c),Fc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&>&&((v=h=Zt)&&(h=ob(h,i.type,i.pendingProps,Fr),h!==null?(i.stateNode=h,Fn=i,Zt=Vr(h.firstChild),Fr=!1,v=!0):v=!1),v||wa(i)),Yn(i),v=i.type,_=i.pendingProps,O=t!==null?t.memoizedProps:null,h=_.children,Yd(v,_)?h=null:O!==null&&Yd(v,O)&&(i.flags|=32),i.memoizedState!==null&&(v=Xf(t,i,bw,null,null,c),El._currentValue=v),Fc(t,i),Vn(t,i,h,c),i.child;case 6:return t===null&>&&((t=c=Zt)&&(c=sb(c,i.pendingProps,Fr),c!==null?(i.stateNode=c,Fn=i,Zt=null,t=!0):t=!1),t||wa(i)),null;case 13:return Ig(t,i,c);case 4:return Qe(i,i.stateNode.containerInfo),h=i.pendingProps,t===null?i.child=xo(i,null,h,c):Vn(t,i,h,c),i.child;case 11:return _g(t,i,i.type,i.pendingProps,c);case 7:return Vn(t,i,i.pendingProps,c),i.child;case 8:return Vn(t,i,i.pendingProps.children,c),i.child;case 12:return Vn(t,i,i.pendingProps.children,c),i.child;case 10:return h=i.pendingProps,ba(i,i.type,h.value),Vn(t,i,h.children,c),i.child;case 9:return v=i.type._context,h=i.pendingProps.children,ho(i),v=jn(v),h=h(v),i.flags|=1,Vn(t,i,h,c),i.child;case 14:return Eg(t,i,i.type,i.pendingProps,c);case 15:return Ag(t,i,i.type,i.pendingProps,c);case 19:return Dg(t,i,c);case 31:return Nw(t,i,c);case 22:return Cg(t,i,c,i.pendingProps);case 24:return ho(i),h=jn(wn),t===null?(v=kf(),v===null&&(v=Ft,_=Bf(),v.pooledCache=_,_.refCount++,_!==null&&(v.pooledCacheLanes|=c),v=_),i.memoizedState={parent:h,cache:v},Pf(i),ba(i,wn,v)):((t.lanes&c)!==0&&(Uf(t,i),rl(i,null,null,c),nl()),v=t.memoizedState,_=i.memoizedState,v.parent!==h?(v={parent:h,cache:h},i.memoizedState=v,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=v),ba(i,wn,h)):(h=_.cache,ba(i,wn,h),h!==v.cache&&Df(i,[wn],c,!0))),Vn(t,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Fi(t){t.flags|=4}function wd(t,i,c,h,v){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(v&335544128)===v)if(t.stateNode.complete)t.flags|=8192;else if(sm())t.flags|=8192;else throw po=Cc,zf}else t.flags&=-16777217}function Lg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Km(i))if(sm())t.flags|=8192;else throw po=Cc,zf}function Vc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Rn():536870912,t.lanes|=i,is|=i)}function cl(t,i){if(!gt)switch(t.tailMode){case"hidden":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?t.tail=null:c.sibling=null;break;case"collapsed":c=t.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:h.sibling=null}}function Xt(t){var i=t.alternate!==null&&t.alternate.child===t.child,c=0,h=0;if(i)for(var v=t.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=t,v=v.sibling;else for(v=t.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=t,v=v.sibling;return t.subtreeFlags|=h,t.childLanes=c,i}function Iw(t,i,c){var h=i.pendingProps;switch(Rf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(i),null;case 1:return Xt(i),null;case 3:return c=i.stateNode,h=null,t!==null&&(h=t.memoizedState.cache),i.memoizedState.cache!==h&&(i.flags|=2048),ki(wn),pt(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(Zo(i)?Fi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Of())),Xt(i),null;case 26:var v=i.type,_=i.memoizedState;return t===null?(Fi(i),_!==null?(Xt(i),Lg(i,_)):(Xt(i),wd(i,v,null,h,c))):_?_!==t.memoizedState?(Fi(i),Xt(i),Lg(i,_)):(Xt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==h&&Fi(i),Xt(i),wd(i,v,t,h,c)),null;case 27:if(Sn(i),c=Te.current,v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==h&&Fi(i);else{if(!h){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}t=Ie.current,Zo(i)?g1(i):(t=Vm(v,h,c),i.stateNode=t,Fi(i))}return Xt(i),null;case 5:if(Sn(i),v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==h&&Fi(i);else{if(!h){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(_=Ie.current,Zo(i))g1(i);else{var O=ru(Te.current);switch(_){case 1:_=O.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:_=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":_=O.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":_=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":_=O.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?O.createElement(v,{is:h.is}):O.createElement(v)}}_[dn]=i,_[Ot]=h;e:for(O=i.child;O!==null;){if(O.tag===5||O.tag===6)_.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===i)break e;for(;O.sibling===null;){if(O.return===null||O.return===i)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}i.stateNode=_;e:switch(Hn(_,v,h),v){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Fi(i)}}return Xt(i),wd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,c),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==h&&Fi(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(s(166));if(t=Te.current,Zo(i)){if(t=i.stateNode,c=i.memoizedProps,h=null,v=Fn,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}t[dn]=i,t=!!(t.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||Im(t.nodeValue,c)),t||wa(i,!0)}else t=ru(t).createTextNode(h),t[dn]=i,i.stateNode=t}return Xt(i),null;case 31:if(c=i.memoizedState,t===null||t.memoizedState!==null){if(h=Zo(i),c!==null){if(t===null){if(!h)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[dn]=i}else uo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),t=!1}else c=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),t=!0;if(!t)return i.flags&256?(Ar(i),i):(Ar(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Xt(i),null;case 13:if(h=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(v=Zo(i),h!==null&&h.dehydrated!==null){if(t===null){if(!v)throw Error(s(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(s(317));v[dn]=i}else uo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),v=!1}else v=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=v),v=!0;if(!v)return i.flags&256?(Ar(i),i):(Ar(i),null)}return Ar(i),(i.flags&128)!==0?(i.lanes=c,i):(c=h!==null,t=t!==null&&t.memoizedState!==null,c&&(h=i.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==v&&(h.flags|=2048)),c!==t&&c&&(i.child.flags|=8192),Vc(i,i.updateQueue),Xt(i),null);case 4:return pt(),t===null&&Vd(i.stateNode.containerInfo),Xt(i),null;case 10:return ki(i.type),Xt(i),null;case 19:if(se(mn),h=i.memoizedState,h===null)return Xt(i),null;if(v=(i.flags&128)!==0,_=h.rendering,_===null)if(v)cl(h,!1);else{if(cn!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(_=Nc(t),_!==null){for(i.flags|=128,cl(h,!1),t=_.updateQueue,i.updateQueue=t,Vc(i,t),i.subtreeFlags=0,t=c,c=i.child;c!==null;)c1(c,t),c=c.sibling;return Se(mn,mn.current&1|2),gt&&Bi(i,h.treeForkCount),i.child}t=t.sibling}h.tail!==null&&en()>Yc&&(i.flags|=128,v=!0,cl(h,!1),i.lanes=4194304)}else{if(!v)if(t=Nc(_),t!==null){if(i.flags|=128,v=!0,t=t.updateQueue,i.updateQueue=t,Vc(i,t),cl(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!gt)return Xt(i),null}else 2*en()-h.renderingStartTime>Yc&&c!==536870912&&(i.flags|=128,v=!0,cl(h,!1),i.lanes=4194304);h.isBackwards?(_.sibling=i.child,i.child=_):(t=h.last,t!==null?t.sibling=_:i.child=_,h.last=_)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=en(),t.sibling=null,c=mn.current,Se(mn,v?c&1|2:c&1),gt&&Bi(i,h.treeForkCount),t):(Xt(i),null);case 22:case 23:return Ar(i),Hf(),h=i.memoizedState!==null,t!==null?t.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(c&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),c=i.updateQueue,c!==null&&Vc(i,c.retryQueue),c=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==c&&(i.flags|=2048),t!==null&&se(go),null;case 24:return c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),ki(wn),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function Mw(t,i){switch(Rf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return ki(wn),pt(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Sn(i),null;case 31:if(i.memoizedState!==null){if(Ar(i),i.alternate===null)throw Error(s(340));uo()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Ar(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));uo()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return se(mn),null;case 4:return pt(),null;case 10:return ki(i.type),null;case 22:case 23:return Ar(i),Hf(),t!==null&&se(go),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return ki(wn),null;case 25:return null;default:return null}}function kg(t,i){switch(Rf(i),i.tag){case 3:ki(wn),pt();break;case 26:case 27:case 5:Sn(i);break;case 4:pt();break;case 31:i.memoizedState!==null&&Ar(i);break;case 13:Ar(i);break;case 19:se(mn);break;case 10:ki(i.type);break;case 22:case 23:Ar(i),Hf(),t!==null&&se(go);break;case 24:ki(wn)}}function ul(t,i){try{var c=i.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next;c=v;do{if((c.tag&t)===t){h=void 0;var _=c.create,O=c.inst;h=_(),O.destroy=h}c=c.next}while(c!==v)}}catch(U){Mt(i,i.return,U)}}function Ta(t,i,c){try{var h=i.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var _=v.next;h=_;do{if((h.tag&t)===t){var O=h.inst,U=O.destroy;if(U!==void 0){O.destroy=void 0,v=i;var Y=c,ce=U;try{ce()}catch(ye){Mt(v,Y,ye)}}}h=h.next}while(h!==_)}}catch(ye){Mt(i,i.return,ye)}}function zg(t){var i=t.updateQueue;if(i!==null){var c=t.stateNode;try{T1(i,c)}catch(h){Mt(t,t.return,h)}}}function Pg(t,i,c){c.props=vo(t.type,t.memoizedProps),c.state=t.memoizedState;try{c.componentWillUnmount()}catch(h){Mt(t,i,h)}}function fl(t,i){try{var c=t.ref;if(c!==null){switch(t.tag){case 26:case 27:case 5:var h=t.stateNode;break;case 30:h=t.stateNode;break;default:h=t.stateNode}typeof c=="function"?t.refCleanup=c(h):c.current=h}}catch(v){Mt(t,i,v)}}function vi(t,i){var c=t.ref,h=t.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(v){Mt(t,i,v)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){Mt(t,i,v)}else c.current=null}function Ug(t){var i=t.type,c=t.memoizedProps,h=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(v){Mt(t,t.return,v)}}function bd(t,i,c){try{var h=t.stateNode;eb(h,t.type,c,i),h[Ot]=i}catch(v){Mt(t,t.return,v)}}function Fg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ba(t.type)||t.tag===4}function _d(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Fg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ba(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ed(t,i,c){var h=t.tag;if(h===5||h===6)t=t.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(t,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(t),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=or));else if(h!==4&&(h===27&&Ba(t.type)&&(c=t.stateNode,i=null),t=t.child,t!==null))for(Ed(t,i,c),t=t.sibling;t!==null;)Ed(t,i,c),t=t.sibling}function Hc(t,i,c){var h=t.tag;if(h===5||h===6)t=t.stateNode,i?c.insertBefore(t,i):c.appendChild(t);else if(h!==4&&(h===27&&Ba(t.type)&&(c=t.stateNode),t=t.child,t!==null))for(Hc(t,i,c),t=t.sibling;t!==null;)Hc(t,i,c),t=t.sibling}function jg(t){var i=t.stateNode,c=t.memoizedProps;try{for(var h=t.type,v=i.attributes;v.length;)i.removeAttributeNode(v[0]);Hn(i,h,c),i[dn]=t,i[Ot]=c}catch(_){Mt(t,t.return,_)}}var ji=!1,En=!1,Ad=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,kn=null;function Dw(t,i){if(t=t.containerInfo,Zd=uu,t=D(t),P(t)){if("selectionStart"in t)var c={start:t.selectionStart,end:t.selectionEnd};else e:{c=(c=t.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var v=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var O=0,U=-1,Y=-1,ce=0,ye=0,we=t,fe=null;t:for(;;){for(var me;we!==c||v!==0&&we.nodeType!==3||(U=O+v),we!==_||h!==0&&we.nodeType!==3||(Y=O+h),we.nodeType===3&&(O+=we.nodeValue.length),(me=we.firstChild)!==null;)fe=we,we=me;for(;;){if(we===t)break t;if(fe===c&&++ce===v&&(U=O),fe===_&&++ye===h&&(Y=O),(me=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=me}c=U===-1||Y===-1?null:{start:U,end:Y}}else c=null}c=c||{start:0,end:0}}else c=null;for(Xd={focusedElem:t,selectionRange:c},uu=!1,kn=i;kn!==null;)if(i=kn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,kn=t;else for(;kn!==null;){switch(i=kn,_=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(c=0;c<t.length;c++)v=t[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&_!==null){t=void 0,c=i,v=_.memoizedProps,_=_.memoizedState,h=c.stateNode;try{var ke=vo(c.type,v);t=h.getSnapshotBeforeUpdate(ke,_),h.__reactInternalSnapshotBeforeUpdate=t}catch(Xe){Mt(c,c.return,Xe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,c=t.nodeType,c===9)Wd(t);else if(c===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,kn=t;break}kn=i.return}}function Hg(t,i,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Hi(t,c),h&4&&ul(5,c);break;case 1:if(Hi(t,c),h&4)if(t=c.stateNode,i===null)try{t.componentDidMount()}catch(O){Mt(c,c.return,O)}else{var v=vo(c.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(v,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){Mt(c,c.return,O)}}h&64&&zg(c),h&512&&fl(c,c.return);break;case 3:if(Hi(t,c),h&64&&(t=c.updateQueue,t!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{T1(t,i)}catch(O){Mt(c,c.return,O)}}break;case 27:i===null&&h&4&&jg(c);case 26:case 5:Hi(t,c),i===null&&h&4&&Ug(c),h&512&&fl(c,c.return);break;case 12:Hi(t,c);break;case 31:Hi(t,c),h&4&&Xg(t,c);break;case 13:Hi(t,c),h&4&&Yg(t,c),h&64&&(t=c.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(c=Vw.bind(null,c),lb(t,c))));break;case 22:if(h=c.memoizedState!==null||ji,!h){i=i!==null&&i.memoizedState!==null||En,v=ji;var _=En;ji=h,(En=i)&&!_?Gi(t,c,(c.subtreeFlags&8772)!==0):Hi(t,c),ji=v,En=_}break;case 30:break;default:Hi(t,c)}}function Gg(t){var i=t.alternate;i!==null&&(t.alternate=null,Gg(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&ar(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Jt=null,cr=!1;function Vi(t,i,c){for(c=c.child;c!==null;)Zg(t,i,c),c=c.sibling}function Zg(t,i,c){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(jt,c)}catch{}switch(c.tag){case 26:En||vi(c,i),Vi(t,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:En||vi(c,i);var h=Jt,v=cr;Ba(c.type)&&(Jt=c.stateNode,cr=!1),Vi(t,i,c),wl(c.stateNode),Jt=h,cr=v;break;case 5:En||vi(c,i);case 6:if(h=Jt,v=cr,Jt=null,Vi(t,i,c),Jt=h,cr=v,Jt!==null)if(cr)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(c.stateNode)}catch(_){Mt(c,i,_)}else try{Jt.removeChild(c.stateNode)}catch(_){Mt(c,i,_)}break;case 18:Jt!==null&&(cr?(t=Jt,zm(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,c.stateNode),ds(t)):zm(Jt,c.stateNode));break;case 4:h=Jt,v=cr,Jt=c.stateNode.containerInfo,cr=!0,Vi(t,i,c),Jt=h,cr=v;break;case 0:case 11:case 14:case 15:Ta(2,c,i),En||Ta(4,c,i),Vi(t,i,c);break;case 1:En||(vi(c,i),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Pg(c,i,h)),Vi(t,i,c);break;case 21:Vi(t,i,c);break;case 22:En=(h=En)||c.memoizedState!==null,Vi(t,i,c),En=h;break;default:Vi(t,i,c)}}function Xg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ds(t)}catch(c){Mt(i,i.return,c)}}}function Yg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ds(t)}catch(c){Mt(i,i.return,c)}}function Bw(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Vg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Vg),i;default:throw Error(s(435,t.tag))}}function Gc(t,i){var c=Bw(t);i.forEach(function(h){if(!c.has(h)){c.add(h);var v=Hw.bind(null,t,h);h.then(v,v)}})}function ur(t,i){var c=i.deletions;if(c!==null)for(var h=0;h<c.length;h++){var v=c[h],_=t,O=i,U=O;e:for(;U!==null;){switch(U.tag){case 27:if(Ba(U.type)){Jt=U.stateNode,cr=!1;break e}break;case 5:Jt=U.stateNode,cr=!1;break e;case 3:case 4:Jt=U.stateNode.containerInfo,cr=!0;break e}U=U.return}if(Jt===null)throw Error(s(160));Zg(_,O,v),Jt=null,cr=!1,_=v.alternate,_!==null&&(_.return=null),v.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)qg(i,t),i=i.sibling}var ri=null;function qg(t,i){var c=t.alternate,h=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ur(i,t),fr(t),h&4&&(Ta(3,t,t.return),ul(3,t),Ta(5,t,t.return));break;case 1:ur(i,t),fr(t),h&512&&(En||c===null||vi(c,c.return)),h&64&&ji&&(t=t.updateQueue,t!==null&&(h=t.callbacks,h!==null&&(c=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var v=ri;if(ur(i,t),fr(t),h&512&&(En||c===null||vi(c,c.return)),h&4){var _=c!==null?c.memoizedState:null;if(h=t.memoizedState,c===null)if(h===null)if(t.stateNode===null){e:{h=t.type,c=t.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":_=v.getElementsByTagName("title")[0],(!_||_[$a]||_[dn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=v.createElement(h),v.head.insertBefore(_,v.querySelector("head > title"))),Hn(_,h,c),_[dn]=t,on(_),h=_;break e;case"link":var O=qm("link","href",v).get(h+(c.href||""));if(O){for(var U=0;U<O.length;U++)if(_=O[U],_.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&_.getAttribute("rel")===(c.rel==null?null:c.rel)&&_.getAttribute("title")===(c.title==null?null:c.title)&&_.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){O.splice(U,1);break t}}_=v.createElement(h),Hn(_,h,c),v.head.appendChild(_);break;case"meta":if(O=qm("meta","content",v).get(h+(c.content||""))){for(U=0;U<O.length;U++)if(_=O[U],_.getAttribute("content")===(c.content==null?null:""+c.content)&&_.getAttribute("name")===(c.name==null?null:c.name)&&_.getAttribute("property")===(c.property==null?null:c.property)&&_.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&_.getAttribute("charset")===(c.charSet==null?null:c.charSet)){O.splice(U,1);break t}}_=v.createElement(h),Hn(_,h,c),v.head.appendChild(_);break;default:throw Error(s(468,h))}_[dn]=t,on(_),h=_}t.stateNode=h}else Wm(v,t.type,t.stateNode);else t.stateNode=Ym(v,h,t.memoizedProps);else _!==h?(_===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):_.count--,h===null?Wm(v,t.type,t.stateNode):Ym(v,h,t.memoizedProps)):h===null&&t.stateNode!==null&&bd(t,t.memoizedProps,c.memoizedProps)}break;case 27:ur(i,t),fr(t),h&512&&(En||c===null||vi(c,c.return)),c!==null&&h&4&&bd(t,t.memoizedProps,c.memoizedProps);break;case 5:if(ur(i,t),fr(t),h&512&&(En||c===null||vi(c,c.return)),t.flags&32){v=t.stateNode;try{ca(v,"")}catch(ke){Mt(t,t.return,ke)}}h&4&&t.stateNode!=null&&(v=t.memoizedProps,bd(t,v,c!==null?c.memoizedProps:v)),h&1024&&(Ad=!0);break;case 6:if(ur(i,t),fr(t),h&4){if(t.stateNode===null)throw Error(s(162));h=t.memoizedProps,c=t.stateNode;try{c.nodeValue=h}catch(ke){Mt(t,t.return,ke)}}break;case 3:if(ou=null,v=ri,ri=iu(i.containerInfo),ur(i,t),ri=v,fr(t),h&4&&c!==null&&c.memoizedState.isDehydrated)try{ds(i.containerInfo)}catch(ke){Mt(t,t.return,ke)}Ad&&(Ad=!1,Wg(t));break;case 4:h=ri,ri=iu(t.stateNode.containerInfo),ur(i,t),fr(t),ri=h;break;case 12:ur(i,t),fr(t);break;case 31:ur(i,t),fr(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Gc(t,h)));break;case 13:ur(i,t),fr(t),t.child.flags&8192&&t.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Xc=en()),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Gc(t,h)));break;case 22:v=t.memoizedState!==null;var Y=c!==null&&c.memoizedState!==null,ce=ji,ye=En;if(ji=ce||v,En=ye||Y,ur(i,t),En=ye,ji=ce,fr(t),h&8192)e:for(i=t.stateNode,i._visibility=v?i._visibility&-2:i._visibility|1,v&&(c===null||Y||ji||En||wo(t)),c=null,i=t;;){if(i.tag===5||i.tag===26){if(c===null){Y=c=i;try{if(_=Y.stateNode,v)O=_.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{U=Y.stateNode;var we=Y.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;U.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(ke){Mt(Y,Y.return,ke)}}}else if(i.tag===6){if(c===null){Y=i;try{Y.stateNode.nodeValue=v?"":Y.memoizedProps}catch(ke){Mt(Y,Y.return,ke)}}}else if(i.tag===18){if(c===null){Y=i;try{var me=Y.stateNode;v?Pm(me,!0):Pm(Y.stateNode,!1)}catch(ke){Mt(Y,Y.return,ke)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}h&4&&(h=t.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Gc(t,c))));break;case 19:ur(i,t),fr(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Gc(t,h)));break;case 30:break;case 21:break;default:ur(i,t),fr(t)}}function fr(t){var i=t.flags;if(i&2){try{for(var c,h=t.return;h!==null;){if(Fg(h)){c=h;break}h=h.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var v=c.stateNode,_=_d(t);Hc(t,_,v);break;case 5:var O=c.stateNode;c.flags&32&&(ca(O,""),c.flags&=-33);var U=_d(t);Hc(t,U,O);break;case 3:case 4:var Y=c.stateNode.containerInfo,ce=_d(t);Ed(t,ce,Y);break;default:throw Error(s(161))}}catch(ye){Mt(t,t.return,ye)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Wg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Wg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Hi(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Hg(t,i.alternate,i),i=i.sibling}function wo(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Ta(4,i,i.return),wo(i);break;case 1:vi(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&Pg(i,i.return,c),wo(i);break;case 27:wl(i.stateNode);case 26:case 5:vi(i,i.return),wo(i);break;case 22:i.memoizedState===null&&wo(i);break;case 30:wo(i);break;default:wo(i)}t=t.sibling}}function Gi(t,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var h=i.alternate,v=t,_=i,O=_.flags;switch(_.tag){case 0:case 11:case 15:Gi(v,_,c),ul(4,_);break;case 1:if(Gi(v,_,c),h=_,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ce){Mt(h,h.return,ce)}if(h=_,v=h.updateQueue,v!==null){var U=h.stateNode;try{var Y=v.shared.hiddenCallbacks;if(Y!==null)for(v.shared.hiddenCallbacks=null,v=0;v<Y.length;v++)S1(Y[v],U)}catch(ce){Mt(h,h.return,ce)}}c&&O&64&&zg(_),fl(_,_.return);break;case 27:jg(_);case 26:case 5:Gi(v,_,c),c&&h===null&&O&4&&Ug(_),fl(_,_.return);break;case 12:Gi(v,_,c);break;case 31:Gi(v,_,c),c&&O&4&&Xg(v,_);break;case 13:Gi(v,_,c),c&&O&4&&Yg(v,_);break;case 22:_.memoizedState===null&&Gi(v,_,c),fl(_,_.return);break;case 30:break;default:Gi(v,_,c)}i=i.sibling}}function Cd(t,i){var c=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==c&&(t!=null&&t.refCount++,c!=null&&Qs(c))}function Sd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Qs(t))}function ii(t,i,c,h){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Kg(t,i,c,h),i=i.sibling}function Kg(t,i,c,h){var v=i.flags;switch(i.tag){case 0:case 11:case 15:ii(t,i,c,h),v&2048&&ul(9,i);break;case 1:ii(t,i,c,h);break;case 3:ii(t,i,c,h),v&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Qs(t)));break;case 12:if(v&2048){ii(t,i,c,h),t=i.stateNode;try{var _=i.memoizedProps,O=_.id,U=_.onPostCommit;typeof U=="function"&&U(O,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Y){Mt(i,i.return,Y)}}else ii(t,i,c,h);break;case 31:ii(t,i,c,h);break;case 13:ii(t,i,c,h);break;case 23:break;case 22:_=i.stateNode,O=i.alternate,i.memoizedState!==null?_._visibility&2?ii(t,i,c,h):dl(t,i):_._visibility&2?ii(t,i,c,h):(_._visibility|=2,ts(t,i,c,h,(i.subtreeFlags&10256)!==0||!1)),v&2048&&Cd(O,i);break;case 24:ii(t,i,c,h),v&2048&&Sd(i.alternate,i);break;default:ii(t,i,c,h)}}function ts(t,i,c,h,v){for(v=v&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var _=t,O=i,U=c,Y=h,ce=O.flags;switch(O.tag){case 0:case 11:case 15:ts(_,O,U,Y,v),ul(8,O);break;case 23:break;case 22:var ye=O.stateNode;O.memoizedState!==null?ye._visibility&2?ts(_,O,U,Y,v):dl(_,O):(ye._visibility|=2,ts(_,O,U,Y,v)),v&&ce&2048&&Cd(O.alternate,O);break;case 24:ts(_,O,U,Y,v),v&&ce&2048&&Sd(O.alternate,O);break;default:ts(_,O,U,Y,v)}i=i.sibling}}function dl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=t,h=i,v=h.flags;switch(h.tag){case 22:dl(c,h),v&2048&&Cd(h.alternate,h);break;case 24:dl(c,h),v&2048&&Sd(h.alternate,h);break;default:dl(c,h)}i=i.sibling}}var hl=8192;function ns(t,i,c){if(t.subtreeFlags&hl)for(t=t.child;t!==null;)Qg(t,i,c),t=t.sibling}function Qg(t,i,c){switch(t.tag){case 26:ns(t,i,c),t.flags&hl&&t.memoizedState!==null&&wb(c,ri,t.memoizedState,t.memoizedProps);break;case 5:ns(t,i,c);break;case 3:case 4:var h=ri;ri=iu(t.stateNode.containerInfo),ns(t,i,c),ri=h;break;case 22:t.memoizedState===null&&(h=t.alternate,h!==null&&h.memoizedState!==null?(h=hl,hl=16777216,ns(t,i,c),hl=h):ns(t,i,c));break;default:ns(t,i,c)}}function Jg(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function gl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var h=i[c];kn=h,em(h,t)}Jg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)$g(t),t=t.sibling}function $g(t){switch(t.tag){case 0:case 11:case 15:gl(t),t.flags&2048&&Ta(9,t,t.return);break;case 3:gl(t);break;case 12:gl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Zc(t)):gl(t);break;default:gl(t)}}function Zc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var h=i[c];kn=h,em(h,t)}Jg(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Ta(8,i,i.return),Zc(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,Zc(i));break;default:Zc(i)}t=t.sibling}}function em(t,i){for(;kn!==null;){var c=kn;switch(c.tag){case 0:case 11:case 15:Ta(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Qs(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,kn=h;else e:for(c=t;kn!==null;){h=kn;var v=h.sibling,_=h.return;if(Gg(h),h===c){kn=null;break e}if(v!==null){v.return=_,kn=v;break e}kn=_}}}var Lw={getCacheForType:function(t){var i=jn(wn),c=i.data.get(t);return c===void 0&&(c=t(),i.data.set(t,c)),c},cacheSignal:function(){return jn(wn).controller.signal}},kw=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Ft=null,lt=null,dt=0,It=0,Cr=null,Ra=!1,rs=!1,Td=!1,Zi=0,cn=0,Na=0,bo=0,Rd=0,Sr=0,is=0,ml=null,dr=null,Nd=!1,Xc=0,tm=0,Yc=1/0,qc=null,Oa=null,Mn=0,Ia=null,as=null,Xi=0,Od=0,Id=null,nm=null,pl=0,Md=null;function Tr(){return(Ct&2)!==0&&dt!==0?dt&-dt:ne.T!==null?Pd():qn()}function rm(){if(Sr===0)if((dt&536870912)===0||gt){var t=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),Sr=t}else Sr=536870912;return t=Er.current,t!==null&&(t.flags|=32),Sr}function hr(t,i,c){(t===Ft&&(It===2||It===9)||t.cancelPendingCommit!==null)&&(os(t,0),Ma(t,dt,Sr,!1)),fi(t,c),((Ct&2)===0||t!==Ft)&&(t===Ft&&((Ct&2)===0&&(bo|=c),cn===4&&Ma(t,dt,Sr,!1)),wi(t))}function im(t,i,c){if((Ct&6)!==0)throw Error(s(327));var h=!c&&(i&127)===0&&(i&t.expiredLanes)===0||Pn(t,i),v=h?Uw(t,i):Bd(t,i,!0),_=h;do{if(v===0){rs&&!h&&Ma(t,i,0,!1);break}else{if(c=t.current.alternate,_&&!zw(c)){v=Bd(t,i,!1),_=!1;continue}if(v===2){if(_=i,t.errorRecoveryDisabledLanes&_)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){i=O;e:{var U=t;v=ml;var Y=U.current.memoizedState.isDehydrated;if(Y&&(os(U,O).flags|=256),O=Bd(U,O,!1),O!==2){if(Td&&!Y){U.errorRecoveryDisabledLanes|=_,bo|=_,v=4;break e}_=dr,dr=v,_!==null&&(dr===null?dr=_:dr.push.apply(dr,_))}v=O}if(_=!1,v!==2)continue}}if(v===1){os(t,0),Ma(t,i,0,!0);break}e:{switch(h=t,_=v,_){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ma(h,i,Sr,!Ra);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(v=Xc+300-en(),10<v)){if(Ma(h,i,Sr,!Ra),Ja(h,0,!0)!==0)break e;Xi=i,h.timeoutHandle=Lm(am.bind(null,h,c,dr,qc,Nd,i,Sr,bo,is,Ra,_,"Throttled",-0,0),v);break e}am(h,c,dr,qc,Nd,i,Sr,bo,is,Ra,_,null,-0,0)}}break}while(!0);wi(t)}function am(t,i,c,h,v,_,O,U,Y,ce,ye,we,fe,me){if(t.timeoutHandle=-1,we=i.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:or},Qg(i,_,we);var ke=(_&62914560)===_?Xc-en():(_&4194048)===_?tm-en():0;if(ke=bb(we,ke),ke!==null){Xi=_,t.cancelPendingCommit=ke(hm.bind(null,t,i,_,c,h,v,O,U,Y,ye,we,null,fe,me)),Ma(t,_,O,!ce);return}}hm(t,i,_,c,h,v,O,U,Y)}function zw(t){for(var i=t;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var v=c[h],_=v.getSnapshot;v=v.value;try{if(!m(_(),v))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ma(t,i,c,h){i&=~Rd,i&=~bo,t.suspendedLanes|=i,t.pingedLanes&=~i,h&&(t.warmLanes|=i),h=t.expirationTimes;for(var v=i;0<v;){var _=31-et(v),O=1<<_;h[_]=-1,v&=~O}c!==0&&ec(t,c,i)}function Wc(){return(Ct&6)===0?(xl(0),!1):!0}function Dd(){if(lt!==null){if(It===0)var t=lt.return;else t=lt,Li=fo=null,Wf(t),Ko=null,$s=0,t=lt;for(;t!==null;)kg(t.alternate,t),t=t.return;lt=null}}function os(t,i){var c=t.timeoutHandle;c!==-1&&(t.timeoutHandle=-1,rb(c)),c=t.cancelPendingCommit,c!==null&&(t.cancelPendingCommit=null,c()),Xi=0,Dd(),Ft=t,lt=c=Di(t.current,null),dt=i,It=0,Cr=null,Ra=!1,rs=Pn(t,i),Td=!1,is=Sr=Rd=bo=Na=cn=0,dr=ml=null,Nd=!1,(i&8)!==0&&(i|=i&32);var h=t.entangledLanes;if(h!==0)for(t=t.entanglements,h&=i;0<h;){var v=31-et(h),_=1<<v;i|=t[v],h&=~_}return Zi=i,pc(),c}function om(t,i){$e=null,ne.H=sl,i===Wo||i===Ac?(i=_1(),It=3):i===zf?(i=_1(),It=4):It=i===fd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Cr=i,lt===null&&(cn=1,Pc(t,zr(i,t.current)))}function sm(){var t=Er.current;return t===null?!0:(dt&4194048)===dt?jr===null:(dt&62914560)===dt||(dt&536870912)!==0?t===jr:!1}function lm(){var t=ne.H;return ne.H=sl,t===null?sl:t}function cm(){var t=ne.A;return ne.A=Lw,t}function Kc(){cn=4,Ra||(dt&4194048)!==dt&&Er.current!==null||(rs=!0),(Na&134217727)===0&&(bo&134217727)===0||Ft===null||Ma(Ft,dt,Sr,!1)}function Bd(t,i,c){var h=Ct;Ct|=2;var v=lm(),_=cm();(Ft!==t||dt!==i)&&(qc=null,os(t,i)),i=!1;var O=cn;e:do try{if(It!==0&<!==null){var U=lt,Y=Cr;switch(It){case 8:Dd(),O=6;break e;case 3:case 2:case 9:case 6:Er.current===null&&(i=!0);var ce=It;if(It=0,Cr=null,ss(t,U,Y,ce),c&&rs){O=0;break e}break;default:ce=It,It=0,Cr=null,ss(t,U,Y,ce)}}Pw(),O=cn;break}catch(ye){om(t,ye)}while(!0);return i&&t.shellSuspendCounter++,Li=fo=null,Ct=h,ne.H=v,ne.A=_,lt===null&&(Ft=null,dt=0,pc()),O}function Pw(){for(;lt!==null;)um(lt)}function Uw(t,i){var c=Ct;Ct|=2;var h=lm(),v=cm();Ft!==t||dt!==i?(qc=null,Yc=en()+500,os(t,i)):rs=Pn(t,i);e:do try{if(It!==0&<!==null){i=lt;var _=Cr;t:switch(It){case 1:It=0,Cr=null,ss(t,i,_,1);break;case 2:case 9:if(w1(_)){It=0,Cr=null,fm(i);break}i=function(){It!==2&&It!==9||Ft!==t||(It=7),wi(t)},_.then(i,i);break e;case 3:It=7;break e;case 4:It=5;break e;case 7:w1(_)?(It=0,Cr=null,fm(i)):(It=0,Cr=null,ss(t,i,_,7));break;case 5:var O=null;switch(lt.tag){case 26:O=lt.memoizedState;case 5:case 27:var U=lt;if(O?Km(O):U.stateNode.complete){It=0,Cr=null;var Y=U.sibling;if(Y!==null)lt=Y;else{var ce=U.return;ce!==null?(lt=ce,Qc(ce)):lt=null}break t}}It=0,Cr=null,ss(t,i,_,5);break;case 6:It=0,Cr=null,ss(t,i,_,6);break;case 8:Dd(),cn=6;break e;default:throw Error(s(462))}}Fw();break}catch(ye){om(t,ye)}while(!0);return Li=fo=null,ne.H=h,ne.A=v,Ct=c,lt!==null?0:(Ft=null,dt=0,pc(),cn)}function Fw(){for(;lt!==null&&!Ro();)um(lt)}function um(t){var i=Bg(t.alternate,t,Zi);t.memoizedProps=t.pendingProps,i===null?Qc(t):lt=i}function fm(t){var i=t,c=i.alternate;switch(i.tag){case 15:case 0:i=Rg(c,i,i.pendingProps,i.type,void 0,dt);break;case 11:i=Rg(c,i,i.pendingProps,i.type.render,i.ref,dt);break;case 5:Wf(i);default:kg(c,i),i=lt=c1(i,Zi),i=Bg(c,i,Zi)}t.memoizedProps=t.pendingProps,i===null?Qc(t):lt=i}function ss(t,i,c,h){Li=fo=null,Wf(i),Ko=null,$s=0;var v=i.return;try{if(Rw(t,v,i,c,dt)){cn=1,Pc(t,zr(c,t.current)),lt=null;return}}catch(_){if(v!==null)throw lt=v,_;cn=1,Pc(t,zr(c,t.current)),lt=null;return}i.flags&32768?(gt||h===1?t=!0:rs||(dt&536870912)!==0?t=!1:(Ra=t=!0,(h===2||h===9||h===3||h===6)&&(h=Er.current,h!==null&&h.tag===13&&(h.flags|=16384))),dm(i,t)):Qc(i)}function Qc(t){var i=t;do{if((i.flags&32768)!==0){dm(i,Ra);return}t=i.return;var c=Iw(i.alternate,i,Zi);if(c!==null){lt=c;return}if(i=i.sibling,i!==null){lt=i;return}lt=i=t}while(i!==null);cn===0&&(cn=5)}function dm(t,i){do{var c=Mw(t.alternate,t);if(c!==null){c.flags&=32767,lt=c;return}if(c=t.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(t=t.sibling,t!==null)){lt=t;return}lt=t=c}while(t!==null);cn=6,lt=null}function hm(t,i,c,h,v,_,O,U,Y){t.cancelPendingCommit=null;do Jc();while(Mn!==0);if((Ct&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(_=i.lanes|i.childLanes,_|=_f,Mr(t,c,_,O,U,Y),t===Ft&&(lt=Ft=null,dt=0),as=i,Ia=t,Xi=c,Od=_,Id=v,nm=h,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Gw(mr,function(){return ym(),null})):(t.callbackNode=null,t.callbackPriority=0),h=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||h){h=ne.T,ne.T=null,v=xe.p,xe.p=2,O=Ct,Ct|=4;try{Dw(t,i,c)}finally{Ct=O,xe.p=v,ne.T=h}}Mn=1,gm(),mm(),pm()}}function gm(){if(Mn===1){Mn=0;var t=Ia,i=as,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=ne.T,ne.T=null;var h=xe.p;xe.p=2;var v=Ct;Ct|=4;try{qg(i,t);var _=Xd,O=D(t.containerInfo),U=_.focusedElem,Y=_.selectionRange;if(O!==U&&U&&U.ownerDocument&&N(U.ownerDocument.documentElement,U)){if(Y!==null&&P(U)){var ce=Y.start,ye=Y.end;if(ye===void 0&&(ye=ce),"selectionStart"in U)U.selectionStart=ce,U.selectionEnd=Math.min(ye,U.value.length);else{var we=U.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),ke=U.textContent.length,Xe=Math.min(Y.start,ke),kt=Y.end===void 0?Xe:Math.min(Y.end,ke);!me.extend&&Xe>kt&&(O=kt,kt=Xe,Xe=O);var te=C(U,Xe),J=C(U,kt);if(te&&J&&(me.rangeCount!==1||me.anchorNode!==te.node||me.anchorOffset!==te.offset||me.focusNode!==J.node||me.focusOffset!==J.offset)){var le=we.createRange();le.setStart(te.node,te.offset),me.removeAllRanges(),Xe>kt?(me.addRange(le),me.extend(J.node,J.offset)):(le.setEnd(J.node,J.offset),me.addRange(le))}}}}for(we=[],me=U;me=me.parentNode;)me.nodeType===1&&we.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<we.length;U++){var ve=we[U];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}uu=!!Zd,Xd=Zd=null}finally{Ct=v,xe.p=h,ne.T=c}}t.current=i,Mn=2}}function mm(){if(Mn===2){Mn=0;var t=Ia,i=as,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=ne.T,ne.T=null;var h=xe.p;xe.p=2;var v=Ct;Ct|=4;try{Hg(t,i.alternate,i)}finally{Ct=v,xe.p=h,ne.T=c}}Mn=3}}function pm(){if(Mn===4||Mn===3){Mn=0,$l();var t=Ia,i=as,c=Xi,h=nm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Mn=5:(Mn=0,as=Ia=null,xm(t,t.pendingLanes));var v=t.pendingLanes;if(v===0&&(Oa=null),Kr(c),i=i.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(jt,i,void 0,(i.current.flags&128)===128)}catch{}if(h!==null){i=ne.T,v=xe.p,xe.p=2,ne.T=null;try{for(var _=t.onRecoverableError,O=0;O<h.length;O++){var U=h[O];_(U.value,{componentStack:U.stack})}}finally{ne.T=i,xe.p=v}}(Xi&3)!==0&&Jc(),wi(t),v=t.pendingLanes,(c&261930)!==0&&(v&42)!==0?t===Md?pl++:(pl=0,Md=t):pl=0,xl(0)}}function xm(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Qs(i)))}function Jc(){return gm(),mm(),pm(),ym()}function ym(){if(Mn!==5)return!1;var t=Ia,i=Od;Od=0;var c=Kr(Xi),h=ne.T,v=xe.p;try{xe.p=32>c?32:c,ne.T=null,c=Id,Id=null;var _=Ia,O=Xi;if(Mn=0,as=Ia=null,Xi=0,(Ct&6)!==0)throw Error(s(331));var U=Ct;if(Ct|=4,$g(_.current),Kg(_,_.current,O,c),Ct=U,xl(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(jt,_)}catch{}return!0}finally{xe.p=v,ne.T=h,xm(t,i)}}function vm(t,i,c){i=zr(c,i),i=ud(t.stateNode,i,2),t=Aa(t,i,2),t!==null&&(fi(t,2),wi(t))}function Mt(t,i,c){if(t.tag===3)vm(t,t,c);else for(;i!==null;){if(i.tag===3){vm(i,t,c);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Oa===null||!Oa.has(h))){t=zr(c,t),c=wg(2),h=Aa(i,c,2),h!==null&&(bg(c,h,i,t),fi(h,2),wi(h));break}}i=i.return}}function Ld(t,i,c){var h=t.pingCache;if(h===null){h=t.pingCache=new kw;var v=new Set;h.set(i,v)}else v=h.get(i),v===void 0&&(v=new Set,h.set(i,v));v.has(c)||(Td=!0,v.add(c),t=jw.bind(null,t,i,c),i.then(t,t))}function jw(t,i,c){var h=t.pingCache;h!==null&&h.delete(i),t.pingedLanes|=t.suspendedLanes&c,t.warmLanes&=~c,Ft===t&&(dt&c)===c&&(cn===4||cn===3&&(dt&62914560)===dt&&300>en()-Xc?(Ct&2)===0&&os(t,0):Rd|=c,is===dt&&(is=0)),wi(t)}function wm(t,i){i===0&&(i=Rn()),t=lo(t,i),t!==null&&(fi(t,i),wi(t))}function Vw(t){var i=t.memoizedState,c=0;i!==null&&(c=i.retryLane),wm(t,c)}function Hw(t,i){var c=0;switch(t.tag){case 31:case 13:var h=t.stateNode,v=t.memoizedState;v!==null&&(c=v.retryLane);break;case 19:h=t.stateNode;break;case 22:h=t.stateNode._retryCache;break;default:throw Error(s(314))}h!==null&&h.delete(i),wm(t,c)}function Gw(t,i){return ra(t,i)}var $c=null,ls=null,kd=!1,eu=!1,zd=!1,Da=0;function wi(t){t!==ls&&t.next===null&&(ls===null?$c=ls=t:ls=ls.next=t),eu=!0,kd||(kd=!0,Xw())}function xl(t,i){if(!zd&&eu){zd=!0;do for(var c=!1,h=$c;h!==null;){if(t!==0){var v=h.pendingLanes;if(v===0)var _=0;else{var O=h.suspendedLanes,U=h.pingedLanes;_=(1<<31-et(42|t)+1)-1,_&=v&~(O&~U),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,Am(h,_))}else _=dt,_=Ja(h,h===Ft?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||Pn(h,_)||(c=!0,Am(h,_));h=h.next}while(c);zd=!1}}function Zw(){bm()}function bm(){eu=kd=!1;var t=0;Da!==0&&nb()&&(t=Da);for(var i=en(),c=null,h=$c;h!==null;){var v=h.next,_=_m(h,i);_===0?(h.next=null,c===null?$c=v:c.next=v,v===null&&(ls=c)):(c=h,(t!==0||(_&3)!==0)&&(eu=!0)),h=v}Mn!==0&&Mn!==5||xl(t),Da!==0&&(Da=0)}function _m(t,i){for(var c=t.suspendedLanes,h=t.pingedLanes,v=t.expirationTimes,_=t.pendingLanes&-62914561;0<_;){var O=31-et(_),U=1<<O,Y=v[O];Y===-1?((U&c)===0||(U&h)!==0)&&(v[O]=Ps(U,i)):Y<=i&&(t.expiredLanes|=U),_&=~U}if(i=Ft,c=dt,c=Ja(t,t===i?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h=t.callbackNode,c===0||t===i&&(It===2||It===9)||t.cancelPendingCommit!==null)return h!==null&&h!==null&&Le(h),t.callbackNode=null,t.callbackPriority=0;if((c&3)===0||Pn(t,c)){if(i=c&-c,i===t.callbackPriority)return i;switch(h!==null&&Le(h),Kr(c)){case 2:case 8:c=Ls;break;case 32:c=mr;break;case 268435456:c=ks;break;default:c=mr}return h=Em.bind(null,t),c=ra(c,h),t.callbackPriority=i,t.callbackNode=c,i}return h!==null&&h!==null&&Le(h),t.callbackPriority=2,t.callbackNode=null,2}function Em(t,i){if(Mn!==0&&Mn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var c=t.callbackNode;if(Jc()&&t.callbackNode!==c)return null;var h=dt;return h=Ja(t,t===Ft?h:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h===0?null:(im(t,h,i),_m(t,en()),t.callbackNode!=null&&t.callbackNode===c?Em.bind(null,t):null)}function Am(t,i){if(Jc())return null;im(t,i,!0)}function Xw(){ib(function(){(Ct&6)!==0?ra(ir,Zw):bm()})}function Pd(){if(Da===0){var t=Yo;t===0&&(t=Qa,Qa<<=1,(Qa&261888)===0&&(Qa=256)),Da=t}return Da}function Cm(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ua(""+t)}function Sm(t,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,t.id&&c.setAttribute("form",t.id),i.parentNode.insertBefore(c,i),t=new FormData(t),c.parentNode.removeChild(c),t}function Yw(t,i,c,h,v){if(i==="submit"&&c&&c.stateNode===v){var _=Cm((v[Ot]||null).action),O=h.submitter;O&&(i=(i=O[Ot]||null)?Cm(i.formAction):O.getAttribute("formAction"),i!==null&&(_=i,O=null));var U=new Nn("action","action",null,h,v);t.push({event:U,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Da!==0){var Y=O?Sm(v,O):new FormData(v);id(c,{pending:!0,data:Y,method:v.method,action:_},null,Y)}}else typeof _=="function"&&(U.preventDefault(),Y=O?Sm(v,O):new FormData(v),id(c,{pending:!0,data:Y,method:v.method,action:_},_,Y))},currentTarget:v}]})}}for(var Ud=0;Ud<qs.length;Ud++){var Fd=qs[Ud],qw=Fd.toLowerCase(),Ww=Fd[0].toUpperCase()+Fd.slice(1);ni(qw,"on"+Ww)}ni(lr,"onAnimationEnd"),ni(Un,"onAnimationIteration"),ni(Rt,"onAnimationStart"),ni("dblclick","onDoubleClick"),ni("focusin","onFocus"),ni("focusout","onBlur"),ni(In,"onTransitionRun"),ni($n,"onTransitionStart"),ni(xa,"onTransitionCancel"),ni(Mi,"onTransitionEnd"),xr("onMouseEnter",["mouseout","mouseover"]),xr("onMouseLeave",["mouseout","mouseover"]),xr("onPointerEnter",["pointerout","pointerover"]),xr("onPointerLeave",["pointerout","pointerover"]),St("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),St("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),St("onBeforeInput",["compositionend","keypress","textInput","paste"]),St("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Kw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yl));function Tm(t,i){i=(i&4)!==0;for(var c=0;c<t.length;c++){var h=t[c],v=h.event;h=h.listeners;e:{var _=void 0;if(i)for(var O=h.length-1;0<=O;O--){var U=h[O],Y=U.instance,ce=U.currentTarget;if(U=U.listener,Y!==_&&v.isPropagationStopped())break e;_=U,v.currentTarget=ce;try{_(v)}catch(ye){mc(ye)}v.currentTarget=null,_=Y}else for(O=0;O<h.length;O++){if(U=h[O],Y=U.instance,ce=U.currentTarget,U=U.listener,Y!==_&&v.isPropagationStopped())break e;_=U,v.currentTarget=ce;try{_(v)}catch(ye){mc(ye)}v.currentTarget=null,_=Y}}}}function ct(t,i){var c=i[ia];c===void 0&&(c=i[ia]=new Set);var h=t+"__bubble";c.has(h)||(Rm(i,t,2,!1),c.add(h))}function jd(t,i,c){var h=0;i&&(h|=4),Rm(c,t,h,i)}var tu="_reactListening"+Math.random().toString(36).slice(2);function Vd(t){if(!t[tu]){t[tu]=!0,_e.forEach(function(c){c!=="selectionchange"&&(Kw.has(c)||jd(c,!1,t),jd(c,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[tu]||(i[tu]=!0,jd("selectionchange",!1,i))}}function Rm(t,i,c,h){switch(rp(i)){case 2:var v=Ab;break;case 8:v=Cb;break;default:v=rh}c=v.bind(null,i,c,t),v=void 0,!js||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),h?v!==void 0?t.addEventListener(i,c,{capture:!0,passive:v}):t.addEventListener(i,c,!0):v!==void 0?t.addEventListener(i,c,{passive:v}):t.addEventListener(i,c,!1)}function Hd(t,i,c,h,v){var _=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var U=h.stateNode.containerInfo;if(U===v)break;if(O===4)for(O=h.return;O!==null;){var Y=O.tag;if((Y===3||Y===4)&&O.stateNode.containerInfo===v)return;O=O.return}for(;U!==null;){if(O=an(U),O===null)return;if(Y=O.tag,Y===5||Y===6||Y===26||Y===27){h=_=O;continue e}U=U.parentNode}}h=h.return}ic(function(){var ce=_,ye=Fs(c),we=[];e:{var fe=gc.get(t);if(fe!==void 0){var me=Nn,ke=t;switch(t){case"keypress":if(hi(c)===0)break e;case"keydown":case"keyup":me=Po;break;case"focusin":ke="focus",me=Gs;break;case"focusout":ke="blur",me=Gs;break;case"beforeblur":case"afterblur":me=Gs;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=At;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=ko;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=vf;break;case lr:case Un:case Rt:me=tt;break;case Mi:me=Ri;break;case"scroll":case"scrollend":me=ac;break;case"wheel":me=wf;break;case"copy":case"cut":case"paste":me=zo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Tt;break;case"toggle":case"beforetoggle":me=Xs}var Xe=(i&4)!==0,kt=!Xe&&(t==="scroll"||t==="scrollend"),te=Xe?fe!==null?fe+"Capture":null:fe;Xe=[];for(var J=ce,le;J!==null;){var ve=J;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||te===null||(ve=qe(J,te),ve!=null&&Xe.push(vl(J,ve,le))),kt)break;J=J.return}0<Xe.length&&(fe=new me(fe,ke,null,c,ye),we.push({event:fe,listeners:Xe}))}}if((i&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",fe&&c!==eo&&(ke=c.relatedTarget||c.fromElement)&&(an(ke)||ke[pr]))break e;if((me||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(ke=c.relatedTarget||c.toElement,me=ce,ke=ke?an(ke):null,ke!==null&&(kt=g(ke),Xe=ke.tag,ke!==kt||Xe!==5&&Xe!==27&&Xe!==6)&&(ke=null)):(me=null,ke=ce),me!==ke)){if(Xe=At,ve="onMouseLeave",te="onMouseEnter",J="mouse",(t==="pointerout"||t==="pointerover")&&(Xe=Tt,ve="onPointerLeave",te="onPointerEnter",J="pointer"),kt=me==null?fe:aa(me),le=ke==null?fe:aa(ke),fe=new Xe(ve,J+"leave",me,c,ye),fe.target=kt,fe.relatedTarget=le,ve=null,an(ye)===ce&&(Xe=new Xe(te,J+"enter",ke,c,ye),Xe.target=le,Xe.relatedTarget=kt,ve=Xe),kt=ve,me&&ke)t:{for(Xe=Qw,te=me,J=ke,le=0,ve=te;ve;ve=Xe(ve))le++;ve=0;for(var je=J;je;je=Xe(je))ve++;for(;0<le-ve;)te=Xe(te),le--;for(;0<ve-le;)J=Xe(J),ve--;for(;le--;){if(te===J||J!==null&&te===J.alternate){Xe=te;break t}te=Xe(te),J=Xe(J)}Xe=null}else Xe=null;me!==null&&Nm(we,fe,me,Xe,!1),ke!==null&&kt!==null&&Nm(we,kt,ke,Xe,!0)}}e:{if(fe=ce?aa(ce):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var bt=br;else if(Ys(fe))if(hc)bt=u;else{bt=o;var Pe=n}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&zt(ce.elementType)&&(bt=br):bt=l;if(bt&&(bt=bt(t,ce))){wr(we,bt,c,ye);break e}Pe&&Pe(t,fe,ce),t==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&V(fe,"number",fe.value)}switch(Pe=ce?aa(ce):window,t){case"focusin":(Ys(Pe)||Pe.contentEditable==="true")&&(q=Pe,K=ce,ie=null);break;case"focusout":ie=K=q=null;break;case"mousedown":he=!0;break;case"contextmenu":case"mouseup":case"dragend":he=!1,Re(we,c,ye);break;case"selectionchange":if(G)break;case"keydown":case"keyup":Re(we,c,ye)}var nt;if(ro)e:{switch(t){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else pa?dc(t,c)&&(ht="onCompositionEnd"):t==="keydown"&&c.keyCode===229&&(ht="onCompositionStart");ht&&(fc&&c.locale!=="ko"&&(pa||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&pa&&(nt=fa()):(ei=ye,ti="value"in ei?ei.value:ei.textContent,pa=!0)),Pe=nu(ce,ht),0<Pe.length&&(ht=new lc(ht,t,null,c,ye),we.push({event:ht,listeners:Pe}),nt?ht.data=nt:(nt=ma(c),nt!==null&&(ht.data=nt)))),(nt=uc?pi(t,c):Fo(t,c))&&(ht=nu(ce,"onBeforeInput"),0<ht.length&&(Pe=new lc("onBeforeInput","beforeinput",null,c,ye),we.push({event:Pe,listeners:ht}),Pe.data=nt)),Yw(we,t,ce,c,ye)}Tm(we,i)})}function vl(t,i,c){return{instance:t,listener:i,currentTarget:c}}function nu(t,i){for(var c=i+"Capture",h=[];t!==null;){var v=t,_=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||_===null||(v=qe(t,c),v!=null&&h.unshift(vl(t,v,_)),v=qe(t,i),v!=null&&h.push(vl(t,v,_))),t.tag===3)return h;t=t.return}return[]}function Qw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Nm(t,i,c,h,v){for(var _=i._reactName,O=[];c!==null&&c!==h;){var U=c,Y=U.alternate,ce=U.stateNode;if(U=U.tag,Y!==null&&Y===h)break;U!==5&&U!==26&&U!==27||ce===null||(Y=ce,v?(ce=qe(c,_),ce!=null&&O.unshift(vl(c,ce,Y))):v||(ce=qe(c,_),ce!=null&&O.push(vl(c,ce,Y)))),c=c.return}O.length!==0&&t.push({event:i,listeners:O})}var Jw=/\r\n?/g,$w=/\u0000|\uFFFD/g;function Om(t){return(typeof t=="string"?t:""+t).replace(Jw,`
|
|
49
|
+
`).replace($w,"")}function Im(t,i){return i=Om(i),Om(t)===i}function Lt(t,i,c,h,v,_){switch(c){case"children":typeof h=="string"?i==="body"||i==="textarea"&&h===""||ca(t,h):(typeof h=="number"||typeof h=="bigint")&&i!=="body"&&ca(t,""+h);break;case"className":sa(t,"class",h);break;case"tabIndex":sa(t,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":sa(t,c,h);break;case"style":Fe(t,h,_);break;case"data":if(i!=="object"){sa(t,"data",h);break}case"src":case"href":if(h===""&&(i!=="a"||c!=="href")){t.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(c);break}h=ua(""+h),t.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){t.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(c==="formAction"?(i!=="input"&&Lt(t,i,"name",v.name,v,null),Lt(t,i,"formEncType",v.formEncType,v,null),Lt(t,i,"formMethod",v.formMethod,v,null),Lt(t,i,"formTarget",v.formTarget,v,null)):(Lt(t,i,"encType",v.encType,v,null),Lt(t,i,"method",v.method,v,null),Lt(t,i,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(c);break}h=ua(""+h),t.setAttribute(c,h);break;case"onClick":h!=null&&(t.onclick=or);break;case"onScroll":h!=null&&ct("scroll",t);break;case"onScrollEnd":h!=null&&ct("scrollend",t);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"multiple":t.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":t.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){t.removeAttribute("xlink:href");break}c=ua(""+h),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,""+h):t.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,""):t.removeAttribute(c);break;case"capture":case"download":h===!0?t.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,h):t.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?t.setAttribute(c,h):t.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?t.removeAttribute(c):t.setAttribute(c,h);break;case"popover":ct("beforetoggle",t),ct("toggle",t),oa(t,"popover",h);break;case"xlinkActuate":yr(t,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":yr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":yr(t,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":yr(t,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":yr(t,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":yr(t,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":yr(t,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":yr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":yr(t,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":oa(t,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=rc.get(c)||c,oa(t,c,h))}}function Gd(t,i,c,h,v,_){switch(c){case"style":Fe(t,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"children":typeof h=="string"?ca(t,h):(typeof h=="number"||typeof h=="bigint")&&ca(t,""+h);break;case"onScroll":h!=null&&ct("scroll",t);break;case"onScrollEnd":h!=null&&ct("scrollend",t);break;case"onClick":h!=null&&(t.onclick=or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nc.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),i=c.slice(2,v?c.length-7:void 0),_=t[Ot]||null,_=_!=null?_[c]:null,typeof _=="function"&&t.removeEventListener(i,_,v),typeof h=="function")){typeof _!="function"&&_!==null&&(c in t?t[c]=null:t.hasAttribute(c)&&t.removeAttribute(c)),t.addEventListener(i,h,v);break e}c in t?t[c]=h:h===!0?t.setAttribute(c,""):oa(t,c,h)}}}function Hn(t,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",t),ct("load",t);var h=!1,v=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var O=c[_];if(O!=null)switch(_){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Lt(t,i,_,O,c,null)}}v&&Lt(t,i,"srcSet",c.srcSet,c,null),h&&Lt(t,i,"src",c.src,c,null);return;case"input":ct("invalid",t);var U=_=O=v=null,Y=null,ce=null;for(h in c)if(c.hasOwnProperty(h)){var ye=c[h];if(ye!=null)switch(h){case"name":v=ye;break;case"type":O=ye;break;case"checked":Y=ye;break;case"defaultChecked":ce=ye;break;case"value":_=ye;break;case"defaultValue":U=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:Lt(t,i,h,ye,c,null)}}oe(t,_,U,Y,ce,O,v,!1);return;case"select":ct("invalid",t),h=O=_=null;for(v in c)if(c.hasOwnProperty(v)&&(U=c[v],U!=null))switch(v){case"value":_=U;break;case"defaultValue":O=U;break;case"multiple":h=U;default:Lt(t,i,v,U,c,null)}i=_,c=O,t.multiple=!!h,i!=null?ze(t,!!h,i,!1):c!=null&&ze(t,!!h,c,!0);return;case"textarea":ct("invalid",t),_=v=h=null;for(O in c)if(c.hasOwnProperty(O)&&(U=c[O],U!=null))switch(O){case"value":h=U;break;case"defaultValue":v=U;break;case"children":_=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:Lt(t,i,O,U,c,null)}Qn(t,h,v,_);return;case"option":for(Y in c)if(c.hasOwnProperty(Y)&&(h=c[Y],h!=null))switch(Y){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Lt(t,i,Y,h,c,null)}return;case"dialog":ct("beforetoggle",t),ct("toggle",t),ct("cancel",t),ct("close",t);break;case"iframe":case"object":ct("load",t);break;case"video":case"audio":for(h=0;h<yl.length;h++)ct(yl[h],t);break;case"image":ct("error",t),ct("load",t);break;case"details":ct("toggle",t);break;case"embed":case"source":case"link":ct("error",t),ct("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in c)if(c.hasOwnProperty(ce)&&(h=c[ce],h!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Lt(t,i,ce,h,c,null)}return;default:if(zt(i)){for(ye in c)c.hasOwnProperty(ye)&&(h=c[ye],h!==void 0&&Gd(t,i,ye,h,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(h=c[U],h!=null&&Lt(t,i,U,h,c,null))}function eb(t,i,c,h){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,_=null,O=null,U=null,Y=null,ce=null,ye=null;for(me in c){var we=c[me];if(c.hasOwnProperty(me)&&we!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Y=we;default:h.hasOwnProperty(me)||Lt(t,i,me,null,h,we)}}for(var fe in h){var me=h[fe];if(we=c[fe],h.hasOwnProperty(fe)&&(me!=null||we!=null))switch(fe){case"type":_=me;break;case"name":v=me;break;case"checked":ce=me;break;case"defaultChecked":ye=me;break;case"value":O=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,i));break;default:me!==we&&Lt(t,i,fe,me,h,we)}}yn(t,O,U,Y,ce,ye,_,v);return;case"select":me=O=U=fe=null;for(_ in c)if(Y=c[_],c.hasOwnProperty(_)&&Y!=null)switch(_){case"value":break;case"multiple":me=Y;default:h.hasOwnProperty(_)||Lt(t,i,_,null,h,Y)}for(v in h)if(_=h[v],Y=c[v],h.hasOwnProperty(v)&&(_!=null||Y!=null))switch(v){case"value":fe=_;break;case"defaultValue":U=_;break;case"multiple":O=_;default:_!==Y&&Lt(t,i,v,_,h,Y)}i=U,c=O,h=me,fe!=null?ze(t,!!c,fe,!1):!!h!=!!c&&(i!=null?ze(t,!!c,i,!0):ze(t,!!c,c?[]:"",!1));return;case"textarea":me=fe=null;for(U in c)if(v=c[U],c.hasOwnProperty(U)&&v!=null&&!h.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Lt(t,i,U,null,h,v)}for(O in h)if(v=h[O],_=c[O],h.hasOwnProperty(O)&&(v!=null||_!=null))switch(O){case"value":fe=v;break;case"defaultValue":me=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:v!==_&&Lt(t,i,O,v,h,_)}hn(t,fe,me);return;case"option":for(var ke in c)if(fe=c[ke],c.hasOwnProperty(ke)&&fe!=null&&!h.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:Lt(t,i,ke,null,h,fe)}for(Y in h)if(fe=h[Y],me=c[Y],h.hasOwnProperty(Y)&&fe!==me&&(fe!=null||me!=null))switch(Y){case"selected":t.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Lt(t,i,Y,fe,h,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in c)fe=c[Xe],c.hasOwnProperty(Xe)&&fe!=null&&!h.hasOwnProperty(Xe)&&Lt(t,i,Xe,null,h,fe);for(ce in h)if(fe=h[ce],me=c[ce],h.hasOwnProperty(ce)&&fe!==me&&(fe!=null||me!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,i));break;default:Lt(t,i,ce,fe,h,me)}return;default:if(zt(i)){for(var kt in c)fe=c[kt],c.hasOwnProperty(kt)&&fe!==void 0&&!h.hasOwnProperty(kt)&&Gd(t,i,kt,void 0,h,fe);for(ye in h)fe=h[ye],me=c[ye],!h.hasOwnProperty(ye)||fe===me||fe===void 0&&me===void 0||Gd(t,i,ye,fe,h,me);return}}for(var te in c)fe=c[te],c.hasOwnProperty(te)&&fe!=null&&!h.hasOwnProperty(te)&&Lt(t,i,te,null,h,fe);for(we in h)fe=h[we],me=c[we],!h.hasOwnProperty(we)||fe===me||fe==null&&me==null||Lt(t,i,we,fe,h,me)}function Mm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tb(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var v=c[h],_=v.transferSize,O=v.initiatorType,U=v.duration;if(_&&U&&Mm(O)){for(O=0,U=v.responseEnd,h+=1;h<c.length;h++){var Y=c[h],ce=Y.startTime;if(ce>U)break;var ye=Y.transferSize,we=Y.initiatorType;ye&&Mm(we)&&(Y=Y.responseEnd,O+=ye*(Y<U?1:(U-ce)/(Y-ce)))}if(--h,i+=8*(_+O)/(v.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Zd=null,Xd=null;function ru(t){return t.nodeType===9?t:t.ownerDocument}function Dm(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bm(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Yd(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var qd=null;function nb(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var Lm=typeof setTimeout=="function"?setTimeout:void 0,rb=typeof clearTimeout=="function"?clearTimeout:void 0,km=typeof Promise=="function"?Promise:void 0,ib=typeof queueMicrotask=="function"?queueMicrotask:typeof km<"u"?function(t){return km.resolve(null).then(t).catch(ab)}:Lm;function ab(t){setTimeout(function(){throw t})}function Ba(t){return t==="head"}function zm(t,i){var c=i,h=0;do{var v=c.nextSibling;if(t.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(h===0){t.removeChild(v),ds(i);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")wl(t.ownerDocument.documentElement);else if(c==="head"){c=t.ownerDocument.head,wl(c);for(var _=c.firstChild;_;){var O=_.nextSibling,U=_.nodeName;_[$a]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=O}}else c==="body"&&wl(t.ownerDocument.body);c=v}while(c);ds(i)}function Pm(t,i){var c=t;t=0;do{var h=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(t===0)break;t--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||t++;c=h}while(c)}function Wd(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Wd(c),ar(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}t.removeChild(c)}}function ob(t,i,c,h){for(;t.nodeType===1;){var v=c;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!h&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(h){if(!t[$a])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(_=t.getAttribute("rel"),_==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(_!==v.rel||t.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||t.getAttribute("title")!==(v.title==null?null:v.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(_=t.getAttribute("src"),(_!==(v.src==null?null:v.src)||t.getAttribute("type")!==(v.type==null?null:v.type)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&_&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var _=v.name==null?null:""+v.name;if(v.type==="hidden"&&t.getAttribute("name")===_)return t}else return t;if(t=Vr(t.nextSibling),t===null)break}return null}function sb(t,i,c){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!c||(t=Vr(t.nextSibling),t===null))return null;return t}function Um(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Vr(t.nextSibling),t===null))return null;return t}function Kd(t){return t.data==="$?"||t.data==="$~"}function Qd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function lb(t,i){var c=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||c.readyState!=="loading")i();else{var h=function(){i(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),t._reactRetry=h}}function Vr(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Jd=null;function Fm(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="/$"||c==="/&"){if(i===0)return Vr(t.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}t=t.nextSibling}return null}function jm(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return t;i--}else c!=="/$"&&c!=="/&"||i++}t=t.previousSibling}return null}function Vm(t,i,c){switch(i=ru(c),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function wl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ar(t)}var Hr=new Map,Hm=new Set;function iu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Yi=xe.d;xe.d={f:cb,r:ub,D:fb,C:db,L:hb,m:gb,X:pb,S:mb,M:xb};function cb(){var t=Yi.f(),i=Wc();return t||i}function ub(t){var i=Et(t);i!==null&&i.tag===5&&i.type==="form"?og(i):Yi.r(t)}var cs=typeof document>"u"?null:document;function Gm(t,i,c){var h=cs;if(h&&typeof i=="string"&&i){var v=at(i);v='link[rel="'+t+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),Hm.has(v)||(Hm.add(v),t={rel:t,crossOrigin:c,href:i},h.querySelector(v)===null&&(i=h.createElement("link"),Hn(i,"link",t),on(i),h.head.appendChild(i)))}}function fb(t){Yi.D(t),Gm("dns-prefetch",t,null)}function db(t,i){Yi.C(t,i),Gm("preconnect",t,i)}function hb(t,i,c){Yi.L(t,i,c);var h=cs;if(h&&t&&i){var v='link[rel="preload"][as="'+at(i)+'"]';i==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+at(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+at(c.imageSizes)+'"]')):v+='[href="'+at(t)+'"]';var _=v;switch(i){case"style":_=us(t);break;case"script":_=fs(t)}Hr.has(_)||(t=x({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:t,as:i},c),Hr.set(_,t),h.querySelector(v)!==null||i==="style"&&h.querySelector(bl(_))||i==="script"&&h.querySelector(_l(_))||(i=h.createElement("link"),Hn(i,"link",t),on(i),h.head.appendChild(i)))}}function gb(t,i){Yi.m(t,i);var c=cs;if(c&&t){var h=i&&typeof i.as=="string"?i.as:"script",v='link[rel="modulepreload"][as="'+at(h)+'"][href="'+at(t)+'"]',_=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=fs(t)}if(!Hr.has(_)&&(t=x({rel:"modulepreload",href:t},i),Hr.set(_,t),c.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(_l(_)))return}h=c.createElement("link"),Hn(h,"link",t),on(h),c.head.appendChild(h)}}}function mb(t,i,c){Yi.S(t,i,c);var h=cs;if(h&&t){var v=Kn(h).hoistableStyles,_=us(t);i=i||"default";var O=v.get(_);if(!O){var U={loading:0,preload:null};if(O=h.querySelector(bl(_)))U.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":i},c),(c=Hr.get(_))&&$d(t,c);var Y=O=h.createElement("link");on(Y),Hn(Y,"link",t),Y._p=new Promise(function(ce,ye){Y.onload=ce,Y.onerror=ye}),Y.addEventListener("load",function(){U.loading|=1}),Y.addEventListener("error",function(){U.loading|=2}),U.loading|=4,au(O,i,h)}O={type:"stylesheet",instance:O,count:1,state:U},v.set(_,O)}}}function pb(t,i){Yi.X(t,i);var c=cs;if(c&&t){var h=Kn(c).hoistableScripts,v=fs(t),_=h.get(v);_||(_=c.querySelector(_l(v)),_||(t=x({src:t,async:!0},i),(i=Hr.get(v))&&eh(t,i),_=c.createElement("script"),on(_),Hn(_,"link",t),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function xb(t,i){Yi.M(t,i);var c=cs;if(c&&t){var h=Kn(c).hoistableScripts,v=fs(t),_=h.get(v);_||(_=c.querySelector(_l(v)),_||(t=x({src:t,async:!0,type:"module"},i),(i=Hr.get(v))&&eh(t,i),_=c.createElement("script"),on(_),Hn(_,"link",t),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function Zm(t,i,c,h){var v=(v=Te.current)?iu(v):null;if(!v)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=us(c.href),c=Kn(v).hoistableStyles,h=c.get(i),h||(h={type:"style",instance:null,count:0,state:null},c.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){t=us(c.href);var _=Kn(v).hoistableStyles,O=_.get(t);if(O||(v=v.ownerDocument||v,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(t,O),(_=v.querySelector(bl(t)))&&!_._p&&(O.instance=_,O.state.loading=5),Hr.has(t)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Hr.set(t,c),_||yb(v,t,c,O.state))),i&&h===null)throw Error(s(528,""));return O}if(i&&h!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fs(c),c=Kn(v).hoistableScripts,h=c.get(i),h||(h={type:"script",instance:null,count:0,state:null},c.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function us(t){return'href="'+at(t)+'"'}function bl(t){return'link[rel="stylesheet"]['+t+"]"}function Xm(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function yb(t,i,c,h){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=t.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),Hn(i,"link",c),on(i),t.head.appendChild(i))}function fs(t){return'[src="'+at(t)+'"]'}function _l(t){return"script[async]"+t}function Ym(t,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var h=t.querySelector('style[data-href~="'+at(c.href)+'"]');if(h)return i.instance=h,on(h),h;var v=x({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(t.ownerDocument||t).createElement("style"),on(h),Hn(h,"style",v),au(h,c.precedence,t),i.instance=h;case"stylesheet":v=us(c.href);var _=t.querySelector(bl(v));if(_)return i.state.loading|=4,i.instance=_,on(_),_;h=Xm(c),(v=Hr.get(v))&&$d(h,v),_=(t.ownerDocument||t).createElement("link"),on(_);var O=_;return O._p=new Promise(function(U,Y){O.onload=U,O.onerror=Y}),Hn(_,"link",h),i.state.loading|=4,au(_,c.precedence,t),i.instance=_;case"script":return _=fs(c.src),(v=t.querySelector(_l(_)))?(i.instance=v,on(v),v):(h=c,(v=Hr.get(_))&&(h=x({},c),eh(h,v)),t=t.ownerDocument||t,v=t.createElement("script"),on(v),Hn(v,"link",h),t.head.appendChild(v),i.instance=v);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,au(h,c.precedence,t));return i.instance}function au(t,i,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,_=v,O=0;O<h.length;O++){var U=h[O];if(U.dataset.precedence===i)_=U;else if(_!==v)break}_?_.parentNode.insertBefore(t,_.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(t,i.firstChild))}function $d(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function eh(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var ou=null;function qm(t,i,c){if(ou===null){var h=new Map,v=ou=new Map;v.set(c,h)}else v=ou,h=v.get(c),h||(h=new Map,v.set(c,h));if(h.has(t))return h;for(h.set(t,null),c=c.getElementsByTagName(t),v=0;v<c.length;v++){var _=c[v];if(!(_[$a]||_[dn]||t==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var O=_.getAttribute(i)||"";O=t+O;var U=h.get(O);U?U.push(_):h.set(O,[_])}}return h}function Wm(t,i,c){t=t.ownerDocument||t,t.head.insertBefore(c,i==="title"?t.querySelector("head > title"):null)}function vb(t,i,c){if(c===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Km(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function wb(t,i,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=us(h.href),_=i.querySelector(bl(v));if(_){i=_._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=su.bind(t),i.then(t,t)),c.state.loading|=4,c.instance=_,on(_);return}_=i.ownerDocument||i,h=Xm(h),(v=Hr.get(v))&&$d(h,v),_=_.createElement("link"),on(_);var O=_;O._p=new Promise(function(U,Y){O.onload=U,O.onerror=Y}),Hn(_,"link",h),c.instance=_}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(t.count++,c=su.bind(t),i.addEventListener("load",c),i.addEventListener("error",c))}}var th=0;function bb(t,i){return t.stylesheets&&t.count===0&&cu(t,t.stylesheets),0<t.count||0<t.imgCount?function(c){var h=setTimeout(function(){if(t.stylesheets&&cu(t,t.stylesheets),t.unsuspend){var _=t.unsuspend;t.unsuspend=null,_()}},6e4+i);0<t.imgBytes&&th===0&&(th=62500*tb());var v=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&cu(t,t.stylesheets),t.unsuspend)){var _=t.unsuspend;t.unsuspend=null,_()}},(t.imgBytes>th?50:800)+i);return t.unsuspend=c,function(){t.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function su(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var lu=null;function cu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,lu=new Map,i.forEach(_b,t),lu=null,su.call(t))}function _b(t,i){if(!(i.state.loading&4)){var c=lu.get(t);if(c)var h=c.get(null);else{c=new Map,lu.set(t,c);for(var v=t.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<v.length;_++){var O=v[_];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(c.set(O.dataset.precedence,O),h=O)}h&&c.set(null,h)}v=i.instance,O=v.getAttribute("data-precedence"),_=c.get(O)||h,_===h&&c.set(null,v),c.set(O,v),this.count++,h=su.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),_?_.parentNode.insertBefore(v,_.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(v,t.firstChild)),i.state.loading|=4}}var El={$$typeof:H,Provider:null,Consumer:null,_currentValue:Me,_currentValue2:Me,_threadCount:0};function Eb(t,i,c,h,v,_,O,U,Y){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=h,this.onUncaughtError=v,this.onCaughtError=_,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function Qm(t,i,c,h,v,_,O,U,Y,ce,ye,we){return t=new Eb(t,i,c,O,Y,ce,ye,we,U),i=1,_===!0&&(i|=24),_=_r(3,null,null,i),t.current=_,_.stateNode=t,i=Bf(),i.refCount++,t.pooledCache=i,i.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:i},Pf(_),t}function Jm(t){return t?(t=Vo,t):Vo}function $m(t,i,c,h,v,_){v=Jm(v),h.context===null?h.context=v:h.pendingContext=v,h=Ea(i),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=Aa(t,h,i),c!==null&&(hr(c,t,i),tl(c,t,i))}function ep(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var c=t.retryLane;t.retryLane=c!==0&&c<i?c:i}}function nh(t,i){ep(t,i),(t=t.alternate)&&ep(t,i)}function tp(t){if(t.tag===13||t.tag===31){var i=lo(t,67108864);i!==null&&hr(i,t,67108864),nh(t,67108864)}}function np(t){if(t.tag===13||t.tag===31){var i=Tr();i=Ln(i);var c=lo(t,i);c!==null&&hr(c,t,i),nh(t,i)}}var uu=!0;function Ab(t,i,c,h){var v=ne.T;ne.T=null;var _=xe.p;try{xe.p=2,rh(t,i,c,h)}finally{xe.p=_,ne.T=v}}function Cb(t,i,c,h){var v=ne.T;ne.T=null;var _=xe.p;try{xe.p=8,rh(t,i,c,h)}finally{xe.p=_,ne.T=v}}function rh(t,i,c,h){if(uu){var v=ih(h);if(v===null)Hd(t,i,h,fu,c),ip(t,h);else if(Tb(v,t,i,c,h))h.stopPropagation();else if(ip(t,h),i&4&&-1<Sb.indexOf(t)){for(;v!==null;){var _=Et(v);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var O=ci(_.pendingLanes);if(O!==0){var U=_;for(U.pendingLanes|=2,U.entangledLanes|=2;O;){var Y=1<<31-et(O);U.entanglements[1]|=Y,O&=~Y}wi(_),(Ct&6)===0&&(Yc=en()+500,xl(0))}}break;case 31:case 13:U=lo(_,2),U!==null&&hr(U,_,2),Wc(),nh(_,2)}if(_=ih(h),_===null&&Hd(t,i,h,fu,c),_===v)break;v=_}v!==null&&h.stopPropagation()}else Hd(t,i,h,null,c)}}function ih(t){return t=Fs(t),ah(t)}var fu=null;function ah(t){if(fu=null,t=an(t),t!==null){var i=g(t);if(i===null)t=null;else{var c=i.tag;if(c===13){if(t=y(i),t!==null)return t;t=null}else if(c===31){if(t=E(i),t!==null)return t;t=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return fu=t,null}function rp(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Bs()){case ir:return 2;case Ls:return 8;case mr:case zn:return 32;case ks:return 268435456;default:return 32}default:return 32}}var oh=!1,La=null,ka=null,za=null,Al=new Map,Cl=new Map,Pa=[],Sb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ip(t,i){switch(t){case"focusin":case"focusout":La=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":za=null;break;case"pointerover":case"pointerout":Al.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cl.delete(i.pointerId)}}function Sl(t,i,c,h,v,_){return t===null||t.nativeEvent!==_?(t={blockedOn:i,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[v]},i!==null&&(i=Et(i),i!==null&&tp(i)),t):(t.eventSystemFlags|=h,i=t.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),t)}function Tb(t,i,c,h,v){switch(i){case"focusin":return La=Sl(La,t,i,c,h,v),!0;case"dragenter":return ka=Sl(ka,t,i,c,h,v),!0;case"mouseover":return za=Sl(za,t,i,c,h,v),!0;case"pointerover":var _=v.pointerId;return Al.set(_,Sl(Al.get(_)||null,t,i,c,h,v)),!0;case"gotpointercapture":return _=v.pointerId,Cl.set(_,Sl(Cl.get(_)||null,t,i,c,h,v)),!0}return!1}function ap(t){var i=an(t.target);if(i!==null){var c=g(i);if(c!==null){if(i=c.tag,i===13){if(i=y(c),i!==null){t.blockedOn=i,De(t.priority,function(){np(c)});return}}else if(i===31){if(i=E(c),i!==null){t.blockedOn=i,De(t.priority,function(){np(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){t.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}t.blockedOn=null}function du(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var c=ih(t.nativeEvent);if(c===null){c=t.nativeEvent;var h=new c.constructor(c.type,c);eo=h,c.target.dispatchEvent(h),eo=null}else return i=Et(c),i!==null&&tp(i),t.blockedOn=c,!1;i.shift()}return!0}function op(t,i,c){du(t)&&c.delete(i)}function Rb(){oh=!1,La!==null&&du(La)&&(La=null),ka!==null&&du(ka)&&(ka=null),za!==null&&du(za)&&(za=null),Al.forEach(op),Cl.forEach(op)}function hu(t,i){t.blockedOn===i&&(t.blockedOn=null,oh||(oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Rb)))}var gu=null;function sp(t){gu!==t&&(gu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gu===t&&(gu=null);for(var i=0;i<t.length;i+=3){var c=t[i],h=t[i+1],v=t[i+2];if(typeof h!="function"){if(ah(h||c)===null)continue;break}var _=Et(c);_!==null&&(t.splice(i,3),i-=3,id(_,{pending:!0,data:v,method:c.method,action:h},h,v))}}))}function ds(t){function i(Y){return hu(Y,t)}La!==null&&hu(La,t),ka!==null&&hu(ka,t),za!==null&&hu(za,t),Al.forEach(i),Cl.forEach(i);for(var c=0;c<Pa.length;c++){var h=Pa[c];h.blockedOn===t&&(h.blockedOn=null)}for(;0<Pa.length&&(c=Pa[0],c.blockedOn===null);)ap(c),c.blockedOn===null&&Pa.shift();if(c=(t.ownerDocument||t).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var v=c[h],_=c[h+1],O=v[Ot]||null;if(typeof _=="function")O||sp(c);else if(O){var U=null;if(_&&_.hasAttribute("formAction")){if(v=_,O=_[Ot]||null)U=O.formAction;else if(ah(v)!==null)continue}else U=O.action;typeof U=="function"?c[h+1]=U:(c.splice(h,3),h-=3),sp(c)}}}function lp(){function t(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(O){return v=O})},focusReset:"manual",scroll:"manual"})}function i(){v!==null&&(v(),v=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,v=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),v!==null&&(v(),v=null)}}}function sh(t){this._internalRoot=t}mu.prototype.render=sh.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,h=Tr();$m(c,h,t,i,null,null)},mu.prototype.unmount=sh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;$m(t.current,2,null,t,null,null),Wc(),i[pr]=null}};function mu(t){this._internalRoot=t}mu.prototype.unstable_scheduleHydration=function(t){if(t){var i=qn();t={blockedOn:null,target:t,priority:i};for(var c=0;c<Pa.length&&i!==0&&i<Pa[c].priority;c++);Pa.splice(c,0,t),c===0&&ap(t)}};var cp=r.version;if(cp!=="19.2.0")throw Error(s(527,cp,"19.2.0"));xe.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=b(i),t=t!==null?T(t):null,t=t===null?null:t.stateNode,t};var Nb={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:ne,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pu.isDisabled&&pu.supportsFiber)try{jt=pu.inject(Nb),Ne=pu}catch{}}return Rl.createRoot=function(t,i){if(!f(t))throw Error(s(299));var c=!1,h="",v=pg,_=xg,O=yg;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(_=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=Qm(t,1,!1,null,null,c,h,null,v,_,O,lp),t[pr]=i.current,Vd(t),new sh(i)},Rl.hydrateRoot=function(t,i,c){if(!f(t))throw Error(s(299));var h=!1,v="",_=pg,O=xg,U=yg,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),i=Qm(t,1,!0,i,c??null,h,v,Y,_,O,U,lp),i.context=Jm(null),c=i.current,h=Tr(),h=Ln(h),v=Ea(h),v.callback=null,Aa(c,v,h),c=h,i.current.lanes=c,fi(i,c),wi(i),t[pr]=i.current,Vd(t),new mu(i)},Rl.version="19.2.0",Rl}var vp;function Fb(){if(vp)return uh.exports;vp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),uh.exports=Ub(),uh.exports}var jb=Fb();/**
|
|
50
|
+
* react-router v7.11.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var wp="popstate";function Vb(e={}){function r(s,f){let{pathname:g,search:y,hash:E}=s.location;return c0("",{pathname:g,search:y,hash:E},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function a(s,f){return typeof f=="string"?f:Hl(f)}return Gb(r,a,null,e)}function nn(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function oi(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Hb(){return Math.random().toString(36).substring(2,10)}function bp(e,r){return{usr:e.state,key:e.key,idx:r}}function c0(e,r,a=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof r=="string"?Rs(r):r,state:a,key:r&&r.key||s||Hb()}}function Hl({pathname:e="/",search:r="",hash:a=""}){return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Rs(e){let r={};if(e){let a=e.indexOf("#");a>=0&&(r.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(r.search=e.substring(s),e=e.substring(0,s)),e&&(r.pathname=e)}return r}function Gb(e,r,a,s={}){let{window:f=document.defaultView,v5Compat:g=!1}=s,y=f.history,E="POP",A=null,b=T();b==null&&(b=0,y.replaceState({...y.state,idx:b},""));function T(){return(y.state||{idx:null}).idx}function x(){E="POP";let z=T(),L=z==null?null:z-b;b=z,A&&A({action:E,location:I.location,delta:L})}function S(z,L){E="PUSH";let Z=c0(I.location,z,L);b=T()+1;let H=bp(Z,b),j=I.createHref(Z);try{y.pushState(H,"",j)}catch(ae){if(ae instanceof DOMException&&ae.name==="DataCloneError")throw ae;f.location.assign(j)}g&&A&&A({action:E,location:I.location,delta:1})}function R(z,L){E="REPLACE";let Z=c0(I.location,z,L);b=T();let H=bp(Z,b),j=I.createHref(Z);y.replaceState(H,"",j),g&&A&&A({action:E,location:I.location,delta:0})}function k(z){return Zb(z)}let I={get action(){return E},get location(){return e(f,y)},listen(z){if(A)throw new Error("A history only accepts one active listener");return f.addEventListener(wp,x),A=z,()=>{f.removeEventListener(wp,x),A=null}},createHref(z){return r(f,z)},createURL:k,encodeLocation(z){let L=k(z);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:S,replace:R,go(z){return y.go(z)}};return I}function Zb(e,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),nn(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Hl(e);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function px(e,r,a="/"){return Xb(e,r,a,!1)}function Xb(e,r,a,s){let f=typeof r=="string"?Rs(r):r,g=ea(f.pathname||"/",a);if(g==null)return null;let y=xx(e);Yb(y);let E=null;for(let A=0;E==null&&A<y.length;++A){let b=i_(g);E=n_(y[A],b,s)}return E}function xx(e,r=[],a=[],s="",f=!1){let g=(y,E,A=f,b)=>{let T={relativePath:b===void 0?y.path||"":b,caseSensitive:y.caseSensitive===!0,childrenIndex:E,route:y};if(T.relativePath.startsWith("/")){if(!T.relativePath.startsWith(s)&&A)return;nn(T.relativePath.startsWith(s),`Absolute route path "${T.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),T.relativePath=T.relativePath.slice(s.length)}let x=$i([s,T.relativePath]),S=a.concat(T);y.children&&y.children.length>0&&(nn(y.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),xx(y.children,r,S,x,A)),!(y.path==null&&!y.index)&&r.push({path:x,score:e_(x,y.index),routesMeta:S})};return e.forEach((y,E)=>{var A;if(y.path===""||!((A=y.path)!=null&&A.includes("?")))g(y,E);else for(let b of yx(y.path))g(y,E,!0,b)}),r}function yx(e){let r=e.split("/");if(r.length===0)return[];let[a,...s]=r,f=a.endsWith("?"),g=a.replace(/\?$/,"");if(s.length===0)return f?[g,""]:[g];let y=yx(s.join("/")),E=[];return E.push(...y.map(A=>A===""?g:[g,A].join("/"))),f&&E.push(...y),E.map(A=>e.startsWith("/")&&A===""?"/":A)}function Yb(e){e.sort((r,a)=>r.score!==a.score?a.score-r.score:t_(r.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var qb=/^:[\w-]+$/,Wb=3,Kb=2,Qb=1,Jb=10,$b=-2,_p=e=>e==="*";function e_(e,r){let a=e.split("/"),s=a.length;return a.some(_p)&&(s+=$b),r&&(s+=Kb),a.filter(f=>!_p(f)).reduce((f,g)=>f+(qb.test(g)?Wb:g===""?Qb:Jb),s)}function t_(e,r){return e.length===r.length&&e.slice(0,-1).every((s,f)=>s===r[f])?e[e.length-1]-r[r.length-1]:0}function n_(e,r,a=!1){let{routesMeta:s}=e,f={},g="/",y=[];for(let E=0;E<s.length;++E){let A=s[E],b=E===s.length-1,T=g==="/"?r:r.slice(g.length)||"/",x=Uu({path:A.relativePath,caseSensitive:A.caseSensitive,end:b},T),S=A.route;if(!x&&b&&a&&!s[s.length-1].route.index&&(x=Uu({path:A.relativePath,caseSensitive:A.caseSensitive,end:!1},T)),!x)return null;Object.assign(f,x.params),y.push({params:f,pathname:$i([g,x.pathname]),pathnameBase:l_($i([g,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(g=$i([g,x.pathnameBase]))}return y}function Uu(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=r_(e.path,e.caseSensitive,e.end),f=r.match(a);if(!f)return null;let g=f[0],y=g.replace(/(.)\/+$/,"$1"),E=f.slice(1);return{params:s.reduce((b,{paramName:T,isOptional:x},S)=>{if(T==="*"){let k=E[S]||"";y=g.slice(0,g.length-k.length).replace(/(.)\/+$/,"$1")}const R=E[S];return x&&!R?b[T]=void 0:b[T]=(R||"").replace(/%2F/g,"/"),b},{}),pathname:g,pathnameBase:y,pattern:e}}function r_(e,r=!1,a=!0){oi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],f="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(y,E,A)=>(s.push({paramName:E,isOptional:A!=null}),A?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),f+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?f+="\\/*$":e!==""&&e!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),s]}function i_(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return oi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function ea(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var vx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,a_=e=>vx.test(e);function o_(e,r="/"){let{pathname:a,search:s="",hash:f=""}=typeof e=="string"?Rs(e):e,g;if(a)if(a_(a))g=a;else{if(a.includes("//")){let y=a;a=a.replace(/\/\/+/g,"/"),oi(!1,`Pathnames cannot have embedded double slashes - normalizing ${y} -> ${a}`)}a.startsWith("/")?g=Ep(a.substring(1),"/"):g=Ep(a,r)}else g=r;return{pathname:g,search:c_(s),hash:u_(f)}}function Ep(e,r){let a=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(f=>{f===".."?a.length>1&&a.pop():f!=="."&&a.push(f)}),a.length>1?a.join("/"):"/"}function gh(e,r,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function s_(e){return e.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function wx(e){let r=s_(e);return r.map((a,s)=>s===r.length-1?a.pathname:a.pathnameBase)}function bx(e,r,a,s=!1){let f;typeof e=="string"?f=Rs(e):(f={...e},nn(!f.pathname||!f.pathname.includes("?"),gh("?","pathname","search",f)),nn(!f.pathname||!f.pathname.includes("#"),gh("#","pathname","hash",f)),nn(!f.search||!f.search.includes("#"),gh("#","search","hash",f)));let g=e===""||f.pathname==="",y=g?"/":f.pathname,E;if(y==null)E=a;else{let x=r.length-1;if(!s&&y.startsWith("..")){let S=y.split("/");for(;S[0]==="..";)S.shift(),x-=1;f.pathname=S.join("/")}E=x>=0?r[x]:"/"}let A=o_(f,E),b=y&&y!=="/"&&y.endsWith("/"),T=(g||y===".")&&a.endsWith("/");return!A.pathname.endsWith("/")&&(b||T)&&(A.pathname+="/"),A}var $i=e=>e.join("/").replace(/\/\/+/g,"/"),l_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),c_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,f_=class{constructor(e,r,a,s=!1){this.status=e,this.statusText=r||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function d_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function h_(e){return e.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _x=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ex(e,r){let a=e;if(typeof a!="string"||!vx.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,f=!1;if(_x)try{let g=new URL(window.location.href),y=a.startsWith("//")?new URL(g.protocol+a):new URL(a),E=ea(y.pathname,r);y.origin===g.origin&&E!=null?a=E+y.search+y.hash:f=!0}catch{oi(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:f,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ax=["POST","PUT","PATCH","DELETE"];new Set(Ax);var g_=["GET",...Ax];new Set(g_);var Ns=B.createContext(null);Ns.displayName="DataRouter";var Ju=B.createContext(null);Ju.displayName="DataRouterState";var m_=B.createContext(!1),Cx=B.createContext({isTransitioning:!1});Cx.displayName="ViewTransition";var p_=B.createContext(new Map);p_.displayName="Fetchers";var x_=B.createContext(null);x_.displayName="Await";var qr=B.createContext(null);qr.displayName="Navigation";var Xl=B.createContext(null);Xl.displayName="Location";var ta=B.createContext({outlet:null,matches:[],isDataRoute:!1});ta.displayName="Route";var M0=B.createContext(null);M0.displayName="RouteError";var Sx="REACT_ROUTER_ERROR",y_="REDIRECT",v_="ROUTE_ERROR_RESPONSE";function w_(e){if(e.startsWith(`${Sx}:${y_}:{`))try{let r=JSON.parse(e.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function b_(e){if(e.startsWith(`${Sx}:${v_}:{`))try{let r=JSON.parse(e.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new f_(r.status,r.statusText,r.data)}catch{}}function __(e,{relative:r}={}){nn(Yl(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=B.useContext(qr),{hash:f,pathname:g,search:y}=ql(e,{relative:r}),E=g;return a!=="/"&&(E=g==="/"?a:$i([a,g])),s.createHref({pathname:E,search:y,hash:f})}function Yl(){return B.useContext(Xl)!=null}function Eo(){return nn(Yl(),"useLocation() may be used only in the context of a <Router> component."),B.useContext(Xl).location}var Tx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rx(e){B.useContext(qr).static||B.useLayoutEffect(e)}function E_(){let{isDataRoute:e}=B.useContext(ta);return e?k_():A_()}function A_(){nn(Yl(),"useNavigate() may be used only in the context of a <Router> component.");let e=B.useContext(Ns),{basename:r,navigator:a}=B.useContext(qr),{matches:s}=B.useContext(ta),{pathname:f}=Eo(),g=JSON.stringify(wx(s)),y=B.useRef(!1);return Rx(()=>{y.current=!0}),B.useCallback((A,b={})=>{if(oi(y.current,Tx),!y.current)return;if(typeof A=="number"){a.go(A);return}let T=bx(A,JSON.parse(g),f,b.relative==="path");e==null&&r!=="/"&&(T.pathname=T.pathname==="/"?r:$i([r,T.pathname])),(b.replace?a.replace:a.push)(T,b.state,b)},[r,a,g,f,e])}B.createContext(null);function ql(e,{relative:r}={}){let{matches:a}=B.useContext(ta),{pathname:s}=Eo(),f=JSON.stringify(wx(a));return B.useMemo(()=>bx(e,JSON.parse(f),s,r==="path"),[e,f,s,r])}function C_(e,r){return Nx(e,r)}function Nx(e,r,a,s,f){var Z;nn(Yl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:g}=B.useContext(qr),{matches:y}=B.useContext(ta),E=y[y.length-1],A=E?E.params:{},b=E?E.pathname:"/",T=E?E.pathnameBase:"/",x=E&&E.route;{let H=x&&x.path||"";Ix(b,!x||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${H}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let S=Eo(),R;if(r){let H=typeof r=="string"?Rs(r):r;nn(T==="/"||((Z=H.pathname)==null?void 0:Z.startsWith(T)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${T}" but pathname "${H.pathname}" was given in the \`location\` prop.`),R=H}else R=S;let k=R.pathname||"/",I=k;if(T!=="/"){let H=T.replace(/^\//,"").split("/");I="/"+k.replace(/^\//,"").split("/").slice(H.length).join("/")}let z=px(e,{pathname:I});oi(x||z!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),oi(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let L=O_(z&&z.map(H=>Object.assign({},H,{params:Object.assign({},A,H.params),pathname:$i([T,g.encodeLocation?g.encodeLocation(H.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?T:$i([T,g.encodeLocation?g.encodeLocation(H.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),y,a,s,f);return r&&L?B.createElement(Xl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...R},navigationType:"POP"}},L):L}function S_(){let e=L_(),r=d_(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:s},g={padding:"2px 4px",backgroundColor:s},y=null;return console.error("Error handled by React Router default ErrorBoundary:",e),y=B.createElement(B.Fragment,null,B.createElement("p",null,"💿 Hey developer 👋"),B.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",B.createElement("code",{style:g},"ErrorBoundary")," or"," ",B.createElement("code",{style:g},"errorElement")," prop on your route.")),B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},r),a?B.createElement("pre",{style:f},a):null,y)}var T_=B.createElement(S_,null),Ox=class extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){this.props.onError?this.props.onError(e,r):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=b_(e.digest);a&&(e=a)}let r=e!==void 0?B.createElement(ta.Provider,{value:this.props.routeContext},B.createElement(M0.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?B.createElement(R_,{error:e},r):r}};Ox.contextType=m_;var mh=new WeakMap;function R_({children:e,error:r}){let{basename:a}=B.useContext(qr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let s=w_(r.digest);if(s){let f=mh.get(r);if(f)throw f;let g=Ex(s.location,a);if(_x&&!mh.get(r))if(g.isExternal||s.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const y=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:s.replace}));throw mh.set(r,y),y}return B.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return e}function N_({routeContext:e,match:r,children:a}){let s=B.useContext(Ns);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),B.createElement(ta.Provider,{value:e},a)}function O_(e,r=[],a=null,s=null,f=null){if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let g=e,y=a==null?void 0:a.errors;if(y!=null){let T=g.findIndex(x=>x.route.id&&(y==null?void 0:y[x.route.id])!==void 0);nn(T>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(y).join(",")}`),g=g.slice(0,Math.min(g.length,T+1))}let E=!1,A=-1;if(a)for(let T=0;T<g.length;T++){let x=g[T];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(A=T),x.route.id){let{loaderData:S,errors:R}=a,k=x.route.loader&&!S.hasOwnProperty(x.route.id)&&(!R||R[x.route.id]===void 0);if(x.route.lazy||k){E=!0,A>=0?g=g.slice(0,A+1):g=[g[0]];break}}}let b=a&&s?(T,x)=>{var S,R;s(T,{location:a.location,params:((R=(S=a.matches)==null?void 0:S[0])==null?void 0:R.params)??{},unstable_pattern:h_(a.matches),errorInfo:x})}:void 0;return g.reduceRight((T,x,S)=>{let R,k=!1,I=null,z=null;a&&(R=y&&x.route.id?y[x.route.id]:void 0,I=x.route.errorElement||T_,E&&(A<0&&S===0?(Ix("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,z=null):A===S&&(k=!0,z=x.route.hydrateFallbackElement||null)));let L=r.concat(g.slice(0,S+1)),Z=()=>{let H;return R?H=I:k?H=z:x.route.Component?H=B.createElement(x.route.Component,null):x.route.element?H=x.route.element:H=T,B.createElement(N_,{match:x,routeContext:{outlet:T,matches:L,isDataRoute:a!=null},children:H})};return a&&(x.route.ErrorBoundary||x.route.errorElement||S===0)?B.createElement(Ox,{location:a.location,revalidation:a.revalidation,component:I,error:R,children:Z(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:b}):Z()},null)}function D0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I_(e){let r=B.useContext(Ns);return nn(r,D0(e)),r}function M_(e){let r=B.useContext(Ju);return nn(r,D0(e)),r}function D_(e){let r=B.useContext(ta);return nn(r,D0(e)),r}function B0(e){let r=D_(e),a=r.matches[r.matches.length-1];return nn(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function B_(){return B0("useRouteId")}function L_(){var s;let e=B.useContext(M0),r=M_("useRouteError"),a=B0("useRouteError");return e!==void 0?e:(s=r.errors)==null?void 0:s[a]}function k_(){let{router:e}=I_("useNavigate"),r=B0("useNavigate"),a=B.useRef(!1);return Rx(()=>{a.current=!0}),B.useCallback(async(f,g={})=>{oi(a.current,Tx),a.current&&(typeof f=="number"?await e.navigate(f):await e.navigate(f,{fromRouteId:r,...g}))},[e,r])}var Ap={};function Ix(e,r,a){!r&&!Ap[e]&&(Ap[e]=!0,oi(!1,a))}B.memo(z_);function z_({routes:e,future:r,state:a,onError:s}){return Nx(e,void 0,a,s,r)}function u0(e){nn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function P_({basename:e="/",children:r=null,location:a,navigationType:s="POP",navigator:f,static:g=!1,unstable_useTransitions:y}){nn(!Yl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let E=e.replace(/^\/*/,"/"),A=B.useMemo(()=>({basename:E,navigator:f,static:g,unstable_useTransitions:y,future:{}}),[E,f,g,y]);typeof a=="string"&&(a=Rs(a));let{pathname:b="/",search:T="",hash:x="",state:S=null,key:R="default"}=a,k=B.useMemo(()=>{let I=ea(b,E);return I==null?null:{location:{pathname:I,search:T,hash:x,state:S,key:R},navigationType:s}},[E,b,T,x,S,R,s]);return oi(k!=null,`<Router basename="${E}"> is not able to match the URL "${b}${T}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:B.createElement(qr.Provider,{value:A},B.createElement(Xl.Provider,{children:r,value:k}))}function U_({children:e,location:r}){return C_(f0(e),r)}function f0(e,r=[]){let a=[];return B.Children.forEach(e,(s,f)=>{if(!B.isValidElement(s))return;let g=[...r,f];if(s.type===B.Fragment){a.push.apply(a,f0(s.props.children,g));return}nn(s.type===u0,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let y={id:s.props.id||g.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(y.children=f0(s.props.children,g)),a.push(y)}),a}var Ou="get",Iu="application/x-www-form-urlencoded";function $u(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function F_(e){return $u(e)&&e.tagName.toLowerCase()==="button"}function j_(e){return $u(e)&&e.tagName.toLowerCase()==="form"}function V_(e){return $u(e)&&e.tagName.toLowerCase()==="input"}function H_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function G_(e,r){return e.button===0&&(!r||r==="_self")&&!H_(e)}var xu=null;function Z_(){if(xu===null)try{new FormData(document.createElement("form"),0),xu=!1}catch{xu=!0}return xu}var X_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ph(e){return e!=null&&!X_.has(e)?(oi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function Y_(e,r){let a,s,f,g,y;if(j_(e)){let E=e.getAttribute("action");s=E?ea(E,r):null,a=e.getAttribute("method")||Ou,f=ph(e.getAttribute("enctype"))||Iu,g=new FormData(e)}else if(F_(e)||V_(e)&&(e.type==="submit"||e.type==="image")){let E=e.form;if(E==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let A=e.getAttribute("formaction")||E.getAttribute("action");if(s=A?ea(A,r):null,a=e.getAttribute("formmethod")||E.getAttribute("method")||Ou,f=ph(e.getAttribute("formenctype"))||ph(E.getAttribute("enctype"))||Iu,g=new FormData(E,e),!Z_()){let{name:b,type:T,value:x}=e;if(T==="image"){let S=b?`${b}.`:"";g.append(`${S}x`,"0"),g.append(`${S}y`,"0")}else b&&g.append(b,x)}}else{if($u(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Ou,s=null,f=Iu,y=e}return g&&f==="text/plain"&&(y=g,g=void 0),{action:s,method:a.toLowerCase(),encType:f,formData:g,body:y}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function L0(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function q_(e,r,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${a}`:r&&ea(s.pathname,r)==="/"?s.pathname=`${r.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function W_(e,r){if(e.id in r)return r[e.id];try{let a=await import(e.module);return r[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function K_(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Q_(e,r,a){let s=await Promise.all(e.map(async f=>{let g=r.routes[f.route.id];if(g){let y=await W_(g,a);return y.links?y.links():[]}return[]}));return t3(s.flat(1).filter(K_).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Cp(e,r,a,s,f,g){let y=(A,b)=>a[b]?A.route.id!==a[b].route.id:!0,E=(A,b)=>{var T;return a[b].pathname!==A.pathname||((T=a[b].route.path)==null?void 0:T.endsWith("*"))&&a[b].params["*"]!==A.params["*"]};return g==="assets"?r.filter((A,b)=>y(A,b)||E(A,b)):g==="data"?r.filter((A,b)=>{var x;let T=s.routes[A.route.id];if(!T||!T.hasLoader)return!1;if(y(A,b)||E(A,b))return!0;if(A.route.shouldRevalidate){let S=A.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((x=a[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:A.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function J_(e,r,{includeHydrateFallback:a}={}){return $_(e.map(s=>{let f=r.routes[s.route.id];if(!f)return[];let g=[f.module];return f.clientActionModule&&(g=g.concat(f.clientActionModule)),f.clientLoaderModule&&(g=g.concat(f.clientLoaderModule)),a&&f.hydrateFallbackModule&&(g=g.concat(f.hydrateFallbackModule)),f.imports&&(g=g.concat(f.imports)),g}).flat(1))}function $_(e){return[...new Set(e)]}function e3(e){let r={},a=Object.keys(e).sort();for(let s of a)r[s]=e[s];return r}function t3(e,r){let a=new Set;return new Set(r),e.reduce((s,f)=>{let g=JSON.stringify(e3(f));return a.has(g)||(a.add(g),s.push({key:g,link:f})),s},[])}function Mx(){let e=B.useContext(Ns);return L0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function n3(){let e=B.useContext(Ju);return L0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var k0=B.createContext(void 0);k0.displayName="FrameworkContext";function Dx(){let e=B.useContext(k0);return L0(e,"You must render this element inside a <HydratedRouter> element"),e}function r3(e,r){let a=B.useContext(k0),[s,f]=B.useState(!1),[g,y]=B.useState(!1),{onFocus:E,onBlur:A,onMouseEnter:b,onMouseLeave:T,onTouchStart:x}=r,S=B.useRef(null);B.useEffect(()=>{if(e==="render"&&y(!0),e==="viewport"){let I=L=>{L.forEach(Z=>{y(Z.isIntersecting)})},z=new IntersectionObserver(I,{threshold:.5});return S.current&&z.observe(S.current),()=>{z.disconnect()}}},[e]),B.useEffect(()=>{if(s){let I=setTimeout(()=>{y(!0)},100);return()=>{clearTimeout(I)}}},[s]);let R=()=>{f(!0)},k=()=>{f(!1),y(!1)};return a?e!=="intent"?[g,S,{}]:[g,S,{onFocus:Nl(E,R),onBlur:Nl(A,k),onMouseEnter:Nl(b,R),onMouseLeave:Nl(T,k),onTouchStart:Nl(x,R)}]:[!1,S,{}]}function Nl(e,r){return a=>{e&&e(a),a.defaultPrevented||r(a)}}function i3({page:e,...r}){let{router:a}=Mx(),s=B.useMemo(()=>px(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?B.createElement(o3,{page:e,matches:s,...r}):null}function a3(e){let{manifest:r,routeModules:a}=Dx(),[s,f]=B.useState([]);return B.useEffect(()=>{let g=!1;return Q_(e,r,a).then(y=>{g||f(y)}),()=>{g=!0}},[e,r,a]),s}function o3({page:e,matches:r,...a}){let s=Eo(),{manifest:f,routeModules:g}=Dx(),{basename:y}=Mx(),{loaderData:E,matches:A}=n3(),b=B.useMemo(()=>Cp(e,r,A,f,s,"data"),[e,r,A,f,s]),T=B.useMemo(()=>Cp(e,r,A,f,s,"assets"),[e,r,A,f,s]),x=B.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let k=new Set,I=!1;if(r.forEach(L=>{var H;let Z=f.routes[L.route.id];!Z||!Z.hasLoader||(!b.some(j=>j.route.id===L.route.id)&&L.route.id in E&&((H=g[L.route.id])!=null&&H.shouldRevalidate)||Z.hasClientLoader?I=!0:k.add(L.route.id))}),k.size===0)return[];let z=q_(e,y,"data");return I&&k.size>0&&z.searchParams.set("_routes",r.filter(L=>k.has(L.route.id)).map(L=>L.route.id).join(",")),[z.pathname+z.search]},[y,E,s,f,b,r,e,g]),S=B.useMemo(()=>J_(T,f),[T,f]),R=a3(T);return B.createElement(B.Fragment,null,x.map(k=>B.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...a})),S.map(k=>B.createElement("link",{key:k,rel:"modulepreload",href:k,...a})),R.map(({key:k,link:I})=>B.createElement("link",{key:k,nonce:a.nonce,...I})))}function s3(...e){return r=>{e.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var l3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l3&&(window.__reactRouterVersion="7.11.0")}catch{}function c3({basename:e,children:r,unstable_useTransitions:a,window:s}){let f=B.useRef();f.current==null&&(f.current=Vb({window:s,v5Compat:!0}));let g=f.current,[y,E]=B.useState({action:g.action,location:g.location}),A=B.useCallback(b=>{a===!1?E(b):B.startTransition(()=>E(b))},[a]);return B.useLayoutEffect(()=>g.listen(A),[g,A]),B.createElement(P_,{basename:e,children:r,location:y.location,navigationType:y.action,navigator:g,unstable_useTransitions:a})}var Bx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lx=B.forwardRef(function({onClick:r,discover:a="render",prefetch:s="none",relative:f,reloadDocument:g,replace:y,state:E,target:A,to:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},k){let{basename:I,unstable_useTransitions:z}=B.useContext(qr),L=typeof b=="string"&&Bx.test(b),Z=Ex(b,I);b=Z.to;let H=__(b,{relative:f}),[j,ae,ee]=r3(s,R),X=h3(b,{replace:y,state:E,target:A,preventScrollReset:T,relative:f,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:z});function de(Oe){r&&r(Oe),Oe.defaultPrevented||X(Oe)}let Q=B.createElement("a",{...R,...ee,href:Z.absoluteURL||H,onClick:Z.isExternal||g?r:de,ref:s3(k,ae),target:A,"data-discover":!L&&a==="render"?"true":void 0});return j&&!L?B.createElement(B.Fragment,null,Q,B.createElement(i3,{page:H})):Q});Lx.displayName="Link";var u3=B.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:s="",end:f=!1,style:g,to:y,viewTransition:E,children:A,...b},T){let x=ql(y,{relative:b.relative}),S=Eo(),R=B.useContext(Ju),{navigator:k,basename:I}=B.useContext(qr),z=R!=null&&y3(x)&&E===!0,L=k.encodeLocation?k.encodeLocation(x).pathname:x.pathname,Z=S.pathname,H=R&&R.navigation&&R.navigation.location?R.navigation.location.pathname:null;a||(Z=Z.toLowerCase(),H=H?H.toLowerCase():null,L=L.toLowerCase()),H&&I&&(H=ea(H,I)||H);const j=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let ae=Z===L||!f&&Z.startsWith(L)&&Z.charAt(j)==="/",ee=H!=null&&(H===L||!f&&H.startsWith(L)&&H.charAt(L.length)==="/"),X={isActive:ae,isPending:ee,isTransitioning:z},de=ae?r:void 0,Q;typeof s=="function"?Q=s(X):Q=[s,ae?"active":null,ee?"pending":null,z?"transitioning":null].filter(Boolean).join(" ");let Oe=typeof g=="function"?g(X):g;return B.createElement(Lx,{...b,"aria-current":de,className:Q,ref:T,style:Oe,to:y,viewTransition:E},typeof A=="function"?A(X):A)});u3.displayName="NavLink";var f3=B.forwardRef(({discover:e="render",fetcherKey:r,navigate:a,reloadDocument:s,replace:f,state:g,method:y=Ou,action:E,onSubmit:A,relative:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},k)=>{let{unstable_useTransitions:I}=B.useContext(qr),z=p3(),L=x3(E,{relative:b}),Z=y.toLowerCase()==="get"?"get":"post",H=typeof E=="string"&&Bx.test(E),j=ae=>{if(A&&A(ae),ae.defaultPrevented)return;ae.preventDefault();let ee=ae.nativeEvent.submitter,X=(ee==null?void 0:ee.getAttribute("formmethod"))||y,de=()=>z(ee||ae.currentTarget,{fetcherKey:r,method:X,navigate:a,replace:f,state:g,relative:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S});I&&a!==!1?B.startTransition(()=>de()):de()};return B.createElement("form",{ref:k,method:Z,action:L,onSubmit:s?A:j,...R,"data-discover":!H&&e==="render"?"true":void 0})});f3.displayName="Form";function d3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kx(e){let r=B.useContext(Ns);return nn(r,d3(e)),r}function h3(e,{target:r,replace:a,state:s,preventScrollReset:f,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:A}={}){let b=E_(),T=Eo(),x=ql(e,{relative:g});return B.useCallback(S=>{if(G_(S,r)){S.preventDefault();let R=a!==void 0?a:Hl(T)===Hl(x),k=()=>b(e,{replace:R,state:s,preventScrollReset:f,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:E});A?B.startTransition(()=>k()):k()}},[T,b,x,a,s,r,e,f,g,y,E,A])}var g3=0,m3=()=>`__${String(++g3)}__`;function p3(){let{router:e}=kx("useSubmit"),{basename:r}=B.useContext(qr),a=B_(),s=e.fetch,f=e.navigate;return B.useCallback(async(g,y={})=>{let{action:E,method:A,encType:b,formData:T,body:x}=Y_(g,r);if(y.navigate===!1){let S=y.fetcherKey||m3();await s(S,a,y.action||E,{unstable_defaultShouldRevalidate:y.unstable_defaultShouldRevalidate,preventScrollReset:y.preventScrollReset,formData:T,body:x,formMethod:y.method||A,formEncType:y.encType||b,flushSync:y.flushSync})}else await f(y.action||E,{unstable_defaultShouldRevalidate:y.unstable_defaultShouldRevalidate,preventScrollReset:y.preventScrollReset,formData:T,body:x,formMethod:y.method||A,formEncType:y.encType||b,replace:y.replace,state:y.state,fromRouteId:a,flushSync:y.flushSync,viewTransition:y.viewTransition})},[s,f,r,a])}function x3(e,{relative:r}={}){let{basename:a}=B.useContext(qr),s=B.useContext(ta);nn(s,"useFormAction must be used inside a RouteContext");let[f]=s.matches.slice(-1),g={...ql(e||".",{relative:r})},y=Eo();if(e==null){g.search=y.search;let E=new URLSearchParams(g.search),A=E.getAll("index");if(A.some(T=>T==="")){E.delete("index"),A.filter(x=>x).forEach(x=>E.append("index",x));let T=E.toString();g.search=T?`?${T}`:""}}return(!e||e===".")&&f.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(g.pathname=g.pathname==="/"?a:$i([a,g.pathname])),Hl(g)}function y3(e,{relative:r}={}){let a=B.useContext(Cx);nn(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=kx("useViewTransitionState"),f=ql(e,{relative:r});if(!a.isTransitioning)return!1;let g=ea(a.currentLocation.pathname,s)||a.currentLocation.pathname,y=ea(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Uu(f.pathname,y)!=null||Uu(f.pathname,g)!=null}var zx=mx();const v3=Qu(zx),Sp=e=>{let r;const a=new Set,s=(b,T)=>{const x=typeof b=="function"?b(r):b;if(!Object.is(x,r)){const S=r;r=T??(typeof x!="object"||x===null)?x:Object.assign({},r,x),a.forEach(R=>R(r,S))}},f=()=>r,E={setState:s,getState:f,getInitialState:()=>A,subscribe:b=>(a.add(b),()=>a.delete(b))},A=r=e(s,f,E);return E},w3=(e=>e?Sp(e):Sp),b3=e=>e;function As(e,r=b3){const a=Nr.useSyncExternalStore(e.subscribe,Nr.useCallback(()=>r(e.getState()),[e,r]),Nr.useCallback(()=>r(e.getInitialState()),[e,r]));return Nr.useDebugValue(a),a}const Tp=e=>{const r=w3(e),a=s=>As(r,s);return Object.assign(a,r),a},z0=(e=>e?Tp(e):Tp),Rp=e=>Symbol.iterator in e,Np=e=>"entries"in e,Op=(e,r)=>{const a=e instanceof Map?e:new Map(e.entries()),s=r instanceof Map?r:new Map(r.entries());if(a.size!==s.size)return!1;for(const[f,g]of a)if(!s.has(f)||!Object.is(g,s.get(f)))return!1;return!0},_3=(e,r)=>{const a=e[Symbol.iterator](),s=r[Symbol.iterator]();let f=a.next(),g=s.next();for(;!f.done&&!g.done;){if(!Object.is(f.value,g.value))return!1;f=a.next(),g=s.next()}return!!f.done&&!!g.done};function E3(e,r){return Object.is(e,r)?!0:typeof e!="object"||e===null||typeof r!="object"||r===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(r)?!1:Rp(e)&&Rp(r)?Np(e)&&Np(r)?Op(e,r):_3(e,r):Op({entries:()=>Object.entries(e)},{entries:()=>Object.entries(r)})}function ef(e){const r=Nr.useRef(void 0);return a=>{const s=e(a);return E3(r.current,s)?r.current:r.current=s}}const Ul=4e3,Px="/joypad",A3=300,C3=8;class S3{constructor(r={},a){qi(this,"inputBuffer",new Map);qi(this,"latchState",new Map);qi(this,"config");qi(this,"roomId");this.config=r,this.roomId=a}handleInput(r){this.roomId&&r.roomId!==this.roomId||this.inputBuffer.set(r.controllerId,r.input)}getInput(r){const a=this.inputBuffer.get(r);if(!a)return;let s=a;if(this.config.schema){const f=this.config.schema.safeParse(a);if(!f.success){console.warn(`[InputManager] Invalid input for controller ${r}:`,f.error);return}s=f.data}return this.config.latch?this.getLatched(r,s):s}clearInput(r){this.inputBuffer.delete(r),this.latchState.delete(r)}setRoomId(r){this.roomId=r}getLatched(r,a){const{booleanFields:s=[],vectorFields:f=[]}=this.config.latch,g=this.latchState.get(r),y=JSON.stringify(a);if(!(y!==(g==null?void 0:g.lastRawHash))&&g){const R={...a},k=R,I=a;for(const z of s){const L=I[z];k[z]=L??!1}for(const z of f){const L=I[z];if(L&&typeof L=="object"&&!Array.isArray(L)){const Z=L;typeof Z.x=="number"&&typeof Z.y=="number"?k[z]=Z:k[z]={x:0,y:0}}else k[z]={x:0,y:0}}return this.latchState.set(r,{raw:a,latched:R,lastRawHash:y}),R}const A=(g==null?void 0:g.latched)??{},b={...a},T=b,x=a,S=A;for(const R of s){const k=x[R],I=S[R];typeof k=="boolean"&&(T[R]=k||I===!0)}for(const R of f){const k=x[R],I=S[R];if(k&&typeof k=="object"&&!Array.isArray(k)){const z=k,L=I;if(typeof z.x=="number"&&typeof z.y=="number"){const Z=z.x!==0||z.y!==0,H=L&&typeof L.x=="number"&&typeof L.y=="number"&&(L.x!==0||L.y!==0);Z?T[R]=z:H?T[R]=L:T[R]={x:0,y:0}}}}return this.latchState.set(r,{raw:a,latched:b,lastRawHash:y}),b}}const T3=()=>z0(e=>({role:null,roomId:null,controllerId:null,connectionStatus:"idle",mode:"standalone",gameState:"paused",stateMessage:void 0,players:[],lastError:void 0,registeredRoomId:null,setRole:r=>e({role:r}),setRoomId:r=>e({roomId:r}),setControllerId:r=>e({controllerId:r}),setStatus:r=>e({connectionStatus:r}),setMode:r=>e({mode:r}),setGameState:r=>e({gameState:r}),setStateMessage:r=>e({stateMessage:r}),toggleGameState:()=>e(r=>({gameState:r.gameState==="paused"?"playing":"paused"})),setError:r=>e({lastError:r}),upsertPlayer:r=>e(a=>{const s=a.players.findIndex(f=>f.id===r.id);if(s>=0){const f=[...a.players];return f[s]=r,{players:f}}return{players:[...a.players,r]}}),removePlayer:r=>e(a=>({players:a.players.filter(s=>s.id!==r)})),resetPlayers:()=>e({players:[]}),resetGameState:()=>e({gameState:"paused",stateMessage:void 0}),setRegisteredRoomId:r=>e({registeredRoomId:r})})),Ai=Object.create(null);Ai.open="0";Ai.close="1";Ai.ping="2";Ai.pong="3";Ai.message="4";Ai.upgrade="5";Ai.noop="6";const Mu=Object.create(null);Object.keys(Ai).forEach(e=>{Mu[Ai[e]]=e});const d0={type:"error",data:"parser error"},Ux=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fx=typeof ArrayBuffer=="function",jx=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,P0=({type:e,data:r},a,s)=>Ux&&r instanceof Blob?a?s(r):Ip(r,s):Fx&&(r instanceof ArrayBuffer||jx(r))?a?s(r):Ip(new Blob([r]),s):s(Ai[e]+(r||"")),Ip=(e,r)=>{const a=new FileReader;return a.onload=function(){const s=a.result.split(",")[1];r("b"+(s||""))},a.readAsDataURL(e)};function Mp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xh;function R3(e,r){if(Ux&&e.data instanceof Blob)return e.data.arrayBuffer().then(Mp).then(r);if(Fx&&(e.data instanceof ArrayBuffer||jx(e.data)))return r(Mp(e.data));P0(e,!1,a=>{xh||(xh=new TextEncoder),r(xh.encode(a))})}const Dp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Dp.length;e++)kl[Dp.charCodeAt(e)]=e;const N3=e=>{let r=e.length*.75,a=e.length,s,f=0,g,y,E,A;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const b=new ArrayBuffer(r),T=new Uint8Array(b);for(s=0;s<a;s+=4)g=kl[e.charCodeAt(s)],y=kl[e.charCodeAt(s+1)],E=kl[e.charCodeAt(s+2)],A=kl[e.charCodeAt(s+3)],T[f++]=g<<2|y>>4,T[f++]=(y&15)<<4|E>>2,T[f++]=(E&3)<<6|A&63;return b},O3=typeof ArrayBuffer=="function",U0=(e,r)=>{if(typeof e!="string")return{type:"message",data:Vx(e,r)};const a=e.charAt(0);return a==="b"?{type:"message",data:I3(e.substring(1),r)}:Mu[a]?e.length>1?{type:Mu[a],data:e.substring(1)}:{type:Mu[a]}:d0},I3=(e,r)=>{if(O3){const a=N3(e);return Vx(a,r)}else return{base64:!0,data:e}},Vx=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Hx="",M3=(e,r)=>{const a=e.length,s=new Array(a);let f=0;e.forEach((g,y)=>{P0(g,!1,E=>{s[y]=E,++f===a&&r(s.join(Hx))})})},D3=(e,r)=>{const a=e.split(Hx),s=[];for(let f=0;f<a.length;f++){const g=U0(a[f],r);if(s.push(g),g.type==="error")break}return s};function B3(){return new TransformStream({transform(e,r){R3(e,a=>{const s=a.length;let f;if(s<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,s);else if(s<65536){f=new Uint8Array(3);const g=new DataView(f.buffer);g.setUint8(0,126),g.setUint16(1,s)}else{f=new Uint8Array(9);const g=new DataView(f.buffer);g.setUint8(0,127),g.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(f[0]|=128),r.enqueue(f),r.enqueue(a)})}})}let yh;function yu(e){return e.reduce((r,a)=>r+a.length,0)}function vu(e,r){if(e[0].length===r)return e.shift();const a=new Uint8Array(r);let s=0;for(let f=0;f<r;f++)a[f]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),a}function L3(e,r){yh||(yh=new TextDecoder);const a=[];let s=0,f=-1,g=!1;return new TransformStream({transform(y,E){for(a.push(y);;){if(s===0){if(yu(a)<1)break;const A=vu(a,1);g=(A[0]&128)===128,f=A[0]&127,f<126?s=3:f===126?s=1:s=2}else if(s===1){if(yu(a)<2)break;const A=vu(a,2);f=new DataView(A.buffer,A.byteOffset,A.length).getUint16(0),s=3}else if(s===2){if(yu(a)<8)break;const A=vu(a,8),b=new DataView(A.buffer,A.byteOffset,A.length),T=b.getUint32(0);if(T>Math.pow(2,21)-1){E.enqueue(d0);break}f=T*Math.pow(2,32)+b.getUint32(4),s=3}else{if(yu(a)<f)break;const A=vu(a,f);E.enqueue(U0(g?A:yh.decode(A),r)),s=0}if(f===0||f>e){E.enqueue(d0);break}}}})}const Gx=4;function An(e){if(e)return k3(e)}function k3(e){for(var r in An.prototype)e[r]=An.prototype[r];return e}An.prototype.on=An.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};An.prototype.once=function(e,r){function a(){this.off(e,a),r.apply(this,arguments)}return a.fn=r,this.on(e,a),this};An.prototype.off=An.prototype.removeListener=An.prototype.removeAllListeners=An.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+e];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,f=0;f<a.length;f++)if(s=a[f],s===r||s.fn===r){a.splice(f,1);break}return a.length===0&&delete this._callbacks["$"+e],this};An.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),a=this._callbacks["$"+e],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(a){a=a.slice(0);for(var s=0,f=a.length;s<f;++s)a[s].apply(this,r)}return this};An.prototype.emitReserved=An.prototype.emit;An.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};An.prototype.hasListeners=function(e){return!!this.listeners(e).length};const tf=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,a)=>a(r,0),Xr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),z3="arraybuffer";function Zx(e,...r){return r.reduce((a,s)=>(e.hasOwnProperty(s)&&(a[s]=e[s]),a),{})}const P3=Xr.setTimeout,U3=Xr.clearTimeout;function nf(e,r){r.useNativeTimers?(e.setTimeoutFn=P3.bind(Xr),e.clearTimeoutFn=U3.bind(Xr)):(e.setTimeoutFn=Xr.setTimeout.bind(Xr),e.clearTimeoutFn=Xr.clearTimeout.bind(Xr))}const F3=1.33;function j3(e){return typeof e=="string"?V3(e):Math.ceil((e.byteLength||e.size)*F3)}function V3(e){let r=0,a=0;for(let s=0,f=e.length;s<f;s++)r=e.charCodeAt(s),r<128?a+=1:r<2048?a+=2:r<55296||r>=57344?a+=3:(s++,a+=4);return a}function Xx(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function H3(e){let r="";for(let a in e)e.hasOwnProperty(a)&&(r.length&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(e[a]));return r}function G3(e){let r={},a=e.split("&");for(let s=0,f=a.length;s<f;s++){let g=a[s].split("=");r[decodeURIComponent(g[0])]=decodeURIComponent(g[1])}return r}class Z3 extends Error{constructor(r,a,s){super(r),this.description=a,this.context=s,this.type="TransportError"}}class F0 extends An{constructor(r){super(),this.writable=!1,nf(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,a,s){return super.emitReserved("error",new Z3(r,a,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const a=U0(r,this.socket.binaryType);this.onPacket(a)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,a={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const a=H3(r);return a.length?"?"+a:""}}class X3 extends F0{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const a=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||a()})),this.writable||(s++,this.once("drain",function(){--s||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const a=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};D3(r,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,M3(r,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=Xx()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(r,a)}}let Yx=!1;try{Yx=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Y3=Yx;function q3(){}class W3 extends X3{constructor(r){if(super(r),typeof location<"u"){const a=location.protocol==="https:";let s=location.port;s||(s=a?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,a){const s=this.request({method:"POST",data:r});s.on("success",a),s.on("error",(f,g)=>{this.onError("xhr post error",f,g)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(a,s)=>{this.onError("xhr poll error",a,s)}),this.pollXhr=r}}class Ei extends An{constructor(r,a,s){super(),this.createRequest=r,nf(this,s),this._opts=s,this._method=s.method||"GET",this._uri=a,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const a=Zx(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(a);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let f in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(f)&&s.setRequestHeader(f,this._opts.extraHeaders[f])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var f;s.readyState===3&&((f=this._opts.cookieJar)===null||f===void 0||f.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(f){this.setTimeoutFn(()=>{this._onError(f)},0);return}typeof document<"u"&&(this._index=Ei.requestsCount++,Ei.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=q3,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ei.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ei.requestsCount=0;Ei.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Bp);else if(typeof addEventListener=="function"){const e="onpagehide"in Xr?"pagehide":"unload";addEventListener(e,Bp,!1)}}function Bp(){for(let e in Ei.requests)Ei.requests.hasOwnProperty(e)&&Ei.requests[e].abort()}const K3=(function(){const e=qx({xdomain:!1});return e&&e.responseType!==null})();class Q3 extends W3{constructor(r){super(r);const a=r&&r.forceBase64;this.supportsBinary=K3&&!a}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Ei(qx,this.uri(),r)}}function qx(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||Y3))return new XMLHttpRequest}catch{}if(!r)try{return new Xr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Wx=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class J3 extends F0{get name(){return"websocket"}doOpen(){const r=this.uri(),a=this.opts.protocols,s=Wx?{}:Zx(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,a,s)}catch(f){return this.emitReserved("error",f)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let a=0;a<r.length;a++){const s=r[a],f=a===r.length-1;P0(s,this.supportsBinary,g=>{try{this.doWrite(s,g)}catch{}f&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=Xx()),this.supportsBinary||(a.b64=1),this.createUri(r,a)}}const vh=Xr.WebSocket||Xr.MozWebSocket;class $3 extends J3{createSocket(r,a,s){return Wx?new vh(r,a,s):a?new vh(r,a):new vh(r)}doWrite(r,a){this.ws.send(a)}}class eE extends F0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const a=L3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(a).getReader(),f=B3();f.readable.pipeTo(r.writable),this._writer=f.writable.getWriter();const g=()=>{s.read().then(({done:E,value:A})=>{E||(this.onPacket(A),g())}).catch(E=>{})};g();const y={type:"open"};this.query.sid&&(y.data=`{"sid":"${this.query.sid}"}`),this._writer.write(y).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let a=0;a<r.length;a++){const s=r[a],f=a===r.length-1;this._writer.write(s).then(()=>{f&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const tE={websocket:$3,webtransport:eE,polling:Q3},nE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,rE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function h0(e){if(e.length>8e3)throw"URI too long";const r=e,a=e.indexOf("["),s=e.indexOf("]");a!=-1&&s!=-1&&(e=e.substring(0,a)+e.substring(a,s).replace(/:/g,";")+e.substring(s,e.length));let f=nE.exec(e||""),g={},y=14;for(;y--;)g[rE[y]]=f[y]||"";return a!=-1&&s!=-1&&(g.source=r,g.host=g.host.substring(1,g.host.length-1).replace(/;/g,":"),g.authority=g.authority.replace("[","").replace("]","").replace(/;/g,":"),g.ipv6uri=!0),g.pathNames=iE(g,g.path),g.queryKey=aE(g,g.query),g}function iE(e,r){const a=/\/{2,9}/g,s=r.replace(a,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function aE(e,r){const a={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,f,g){f&&(a[f]=g)}),a}const g0=typeof addEventListener=="function"&&typeof removeEventListener=="function",Du=[];g0&&addEventListener("offline",()=>{Du.forEach(e=>e())},!1);class Xa extends An{constructor(r,a){if(super(),this.binaryType=z3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(a=r,r=null),r){const s=h0(r);a.hostname=s.host,a.secure=s.protocol==="https"||s.protocol==="wss",a.port=s.port,s.query&&(a.query=s.query)}else a.host&&(a.hostname=h0(a.host).host);nf(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(s=>{const f=s.prototype.name;this.transports.push(f),this._transportsByName[f]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=G3(this.opts.query)),g0&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Du.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const a=Object.assign({},this.opts.query);a.EIO=Gx,a.transport=r,this.id&&(a.sid=this.id);const s=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Xa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(r);a.open(),this.setTransport(a)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",Xa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=r.data,this._onError(a);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let s=0;s<this.writeBuffer.length;s++){const f=this.writeBuffer[s].data;if(f&&(a+=j3(f)),s>0&&a>this._maxPayload)return this.writeBuffer.slice(0,s);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,tf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,a,s){return this._sendPacket("message",r,a,s),this}send(r,a,s){return this._sendPacket("message",r,a,s),this}_sendPacket(r,a,s,f){if(typeof a=="function"&&(f=a,a=void 0),typeof s=="function"&&(f=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const g={type:r,data:a,options:s};this.emitReserved("packetCreate",g),this.writeBuffer.push(g),f&&this.once("flush",f),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),r()},s=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(Xa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),g0&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Du.indexOf(this._offlineEventListener);s!==-1&&Du.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,a),this.writeBuffer=[],this._prevBufferLen=0}}}Xa.protocol=Gx;class oE extends Xa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let a=this.createTransport(r),s=!1;Xa.priorWebsocketSuccess=!1;const f=()=>{s||(a.send([{type:"ping",data:"probe"}]),a.once("packet",x=>{if(!s)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;Xa.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(T(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=a.name,this.emitReserved("upgradeError",S)}}))};function g(){s||(s=!0,T(),a.close(),a=null)}const y=x=>{const S=new Error("probe error: "+x);S.transport=a.name,g(),this.emitReserved("upgradeError",S)};function E(){y("transport closed")}function A(){y("socket closed")}function b(x){a&&x.name!==a.name&&g()}const T=()=>{a.removeListener("open",f),a.removeListener("error",y),a.removeListener("close",E),this.off("close",A),this.off("upgrading",b)};a.once("open",f),a.once("error",y),a.once("close",E),this.once("close",A),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||a.open()},200):a.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const a=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&a.push(r[s]);return a}}let sE=class extends oE{constructor(r,a={}){const s=typeof r=="object"?r:a;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(f=>tE[f]).filter(f=>!!f)),super(r,s)}};function lE(e,r="",a){let s=e;a=a||typeof location<"u"&&location,e==null&&(e=a.protocol+"//"+a.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=a.protocol+e:e=a.host+e),/^(https?|wss?):\/\//.test(e)||(typeof a<"u"?e=a.protocol+"//"+e:e="https://"+e),s=h0(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const g=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+g+":"+s.port+r,s.href=s.protocol+"://"+g+(a&&a.port===s.port?"":":"+s.port),s}const cE=typeof ArrayBuffer=="function",uE=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Kx=Object.prototype.toString,fE=typeof Blob=="function"||typeof Blob<"u"&&Kx.call(Blob)==="[object BlobConstructor]",dE=typeof File=="function"||typeof File<"u"&&Kx.call(File)==="[object FileConstructor]";function j0(e){return cE&&(e instanceof ArrayBuffer||uE(e))||fE&&e instanceof Blob||dE&&e instanceof File}function Bu(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let a=0,s=e.length;a<s;a++)if(Bu(e[a]))return!0;return!1}if(j0(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Bu(e.toJSON(),!0);for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&Bu(e[a]))return!0;return!1}function hE(e){const r=[],a=e.data,s=e;return s.data=m0(a,r),s.attachments=r.length,{packet:s,buffers:r}}function m0(e,r){if(!e)return e;if(j0(e)){const a={_placeholder:!0,num:r.length};return r.push(e),a}else if(Array.isArray(e)){const a=new Array(e.length);for(let s=0;s<e.length;s++)a[s]=m0(e[s],r);return a}else if(typeof e=="object"&&!(e instanceof Date)){const a={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(a[s]=m0(e[s],r));return a}return e}function gE(e,r){return e.data=p0(e.data,r),delete e.attachments,e}function p0(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let a=0;a<e.length;a++)e[a]=p0(e[a],r);else if(typeof e=="object")for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(e[a]=p0(e[a],r));return e}const mE=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],pE=5;var mt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(mt||(mt={}));class xE{constructor(r){this.replacer=r}encode(r){return(r.type===mt.EVENT||r.type===mt.ACK)&&Bu(r)?this.encodeAsBinary({type:r.type===mt.EVENT?mt.BINARY_EVENT:mt.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let a=""+r.type;return(r.type===mt.BINARY_EVENT||r.type===mt.BINARY_ACK)&&(a+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(a+=r.nsp+","),r.id!=null&&(a+=r.id),r.data!=null&&(a+=JSON.stringify(r.data,this.replacer)),a}encodeAsBinary(r){const a=hE(r),s=this.encodeAsString(a.packet),f=a.buffers;return f.unshift(s),f}}function Lp(e){return Object.prototype.toString.call(e)==="[object Object]"}class V0 extends An{constructor(r){super(),this.reviver=r}add(r){let a;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(r);const s=a.type===mt.BINARY_EVENT;s||a.type===mt.BINARY_ACK?(a.type=s?mt.EVENT:mt.ACK,this.reconstructor=new yE(a),a.attachments===0&&super.emitReserved("decoded",a)):super.emitReserved("decoded",a)}else if(j0(r)||r.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(r),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let a=0;const s={type:Number(r.charAt(0))};if(mt[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===mt.BINARY_EVENT||s.type===mt.BINARY_ACK){const g=a+1;for(;r.charAt(++a)!=="-"&&a!=r.length;);const y=r.substring(g,a);if(y!=Number(y)||r.charAt(a)!=="-")throw new Error("Illegal attachments");s.attachments=Number(y)}if(r.charAt(a+1)==="/"){const g=a+1;for(;++a&&!(r.charAt(a)===","||a===r.length););s.nsp=r.substring(g,a)}else s.nsp="/";const f=r.charAt(a+1);if(f!==""&&Number(f)==f){const g=a+1;for(;++a;){const y=r.charAt(a);if(y==null||Number(y)!=y){--a;break}if(a===r.length)break}s.id=Number(r.substring(g,a+1))}if(r.charAt(++a)){const g=this.tryParse(r.substr(a));if(V0.isPayloadValid(s.type,g))s.data=g;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,a){switch(r){case mt.CONNECT:return Lp(a);case mt.DISCONNECT:return a===void 0;case mt.CONNECT_ERROR:return typeof a=="string"||Lp(a);case mt.EVENT:case mt.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&mE.indexOf(a[0])===-1);case mt.ACK:case mt.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class yE{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const a=gE(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const vE=Object.freeze(Object.defineProperty({__proto__:null,Decoder:V0,Encoder:xE,get PacketType(){return mt},protocol:pE},Symbol.toStringTag,{value:"Module"}));function ai(e,r,a){return e.on(r,a),function(){e.off(r,a)}}const wE=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Qx extends An{constructor(r,a,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=a,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[ai(r,"open",this.onopen.bind(this)),ai(r,"packet",this.onpacket.bind(this)),ai(r,"error",this.onerror.bind(this)),ai(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...a){var s,f,g;if(wE.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(a.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const y={type:mt.EVENT,data:a};if(y.options={},y.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const T=this.ids++,x=a.pop();this._registerAckCallback(T,x),y.id=T}const E=(f=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||f===void 0?void 0:f.writable,A=this.connected&&!(!((g=this.io.engine)===null||g===void 0)&&g._hasPingExpired());return this.flags.volatile&&!E||(A?(this.notifyOutgoingListeners(y),this.packet(y)):this.sendBuffer.push(y)),this.flags={},this}_registerAckCallback(r,a){var s;const f=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(f===void 0){this.acks[r]=a;return}const g=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let E=0;E<this.sendBuffer.length;E++)this.sendBuffer[E].id===r&&this.sendBuffer.splice(E,1);a.call(this,new Error("operation has timed out"))},f),y=(...E)=>{this.io.clearTimeoutFn(g),a.apply(this,E)};y.withError=!0,this.acks[r]=y}emitWithAck(r,...a){return new Promise((s,f)=>{const g=(y,E)=>y?f(y):s(E);g.withError=!0,a.push(g),this.emit(r,...a)})}_addToQueue(r){let a;typeof r[r.length-1]=="function"&&(a=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((f,...g)=>s!==this._queue[0]?void 0:(f!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(f)):(this._queue.shift(),a&&a(null,...g)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!r||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:mt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case mt.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mt.EVENT:case mt.BINARY_EVENT:this.onevent(r);break;case mt.ACK:case mt.BINARY_ACK:this.onack(r);break;case mt.DISCONNECT:this.ondisconnect();break;case mt.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const a=r.data||[];r.id!=null&&a.push(this.ack(r.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const s of a)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const a=this;let s=!1;return function(...f){s||(s=!0,a.packet({type:mt.ACK,id:r,data:f}))}}onack(r){const a=this.acks[r.id];typeof a=="function"&&(delete this.acks[r.id],a.withError&&r.data.unshift(null),a.apply(this,r.data))}onconnect(r,a){this.id=r,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const a=this._anyListeners;for(let s=0;s<a.length;s++)if(r===a[s])return a.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const a=this._anyOutgoingListeners;for(let s=0;s<a.length;s++)if(r===a[s])return a.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const s of a)s.apply(this,r.data)}}}function Os(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Os.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),a=Math.floor(r*this.jitter*e);e=(Math.floor(r*10)&1)==0?e-a:e+a}return Math.min(e,this.max)|0};Os.prototype.reset=function(){this.attempts=0};Os.prototype.setMin=function(e){this.ms=e};Os.prototype.setMax=function(e){this.max=e};Os.prototype.setJitter=function(e){this.jitter=e};class x0 extends An{constructor(r,a){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(a=r,r=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,nf(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((s=a.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Os({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=r;const f=a.parser||vE;this.encoder=new f.Encoder,this.decoder=new f.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var a;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(a=this.backoff)===null||a===void 0||a.setMin(r),this)}randomizationFactor(r){var a;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(a=this.backoff)===null||a===void 0||a.setJitter(r),this)}reconnectionDelayMax(r){var a;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(a=this.backoff)===null||a===void 0||a.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new sE(this.uri,this.opts);const a=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const f=ai(a,"open",function(){s.onopen(),r&&r()}),g=E=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",E),r?r(E):this.maybeReconnectOnOpen()},y=ai(a,"error",g);if(this._timeout!==!1){const E=this._timeout,A=this.setTimeoutFn(()=>{f(),g(new Error("timeout")),a.close()},E);this.opts.autoUnref&&A.unref(),this.subs.push(()=>{this.clearTimeoutFn(A)})}return this.subs.push(f),this.subs.push(y),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(ai(r,"ping",this.onping.bind(this)),ai(r,"data",this.ondata.bind(this)),ai(r,"error",this.onerror.bind(this)),ai(r,"close",this.onclose.bind(this)),ai(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(a){this.onclose("parse error",a)}}ondecoded(r){tf(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,a){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new Qx(this,r,a),this.nsps[r]=s),s}_destroy(r){const a=Object.keys(this.nsps);for(const s of a)if(this.nsps[s].active)return;this._close()}_packet(r){const a=this.encoder.encode(r);for(let s=0;s<a.length;s++)this.engine.write(a[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,a){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(f=>{f?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",f)):r.onreconnect()}))},a);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ol={};function Lu(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const a=lE(e,r.path||"/socket.io"),s=a.source,f=a.id,g=a.path,y=Ol[f]&&g in Ol[f].nsps,E=r.forceNew||r["force new connection"]||r.multiplex===!1||y;let A;return E?A=new x0(s,r):(Ol[f]||(Ol[f]=new x0(s,r)),A=Ol[f]),a.query&&!r.query&&(r.query=a.queryKey),A.socket(a.path,r)}Object.assign(Lu,{Manager:x0,Socket:Qx,io:Lu,connect:Lu});class bE{constructor(r){qi(this,"sockets",{});qi(this,"serverUrl");this.serverUrl=this.resolveServerUrl(r)}getSocket(r){const a=this.sockets[r];if(a)return a;const s=Lu(this.serverUrl,{autoConnect:!1,transports:["websocket"],query:{role:r}});return this.sockets[r]=s,s}disconnect(r){const a=this.sockets[r];a&&a.disconnect()}disconnectAll(){for(const r of Object.keys(this.sockets))this.disconnect(r)}getServerUrl(){return this.serverUrl}resolveServerUrl(r){if(r)return this.normalizeOrigin(r);if(typeof window<"u"){const a=new URL(window.location.href);return a.port=String(Ul),a.origin}return`http://localhost:${Ul}`}normalizeOrigin(r){return r.includes("://")?r:`http://${r}`}}var Fu={};const Jx=B.createContext(null),$x=()=>{try{const e=import.meta;if(e&&typeof e.env=="object")return e.env}catch{}},_E=()=>{const e=$x();if(e!=null&&e.VITE_AIR_JAM_SERVER_URL)return e.VITE_AIR_JAM_SERVER_URL;if(typeof process<"u"&&Fu){const r=Fu.NEXT_PUBLIC_AIR_JAM_SERVER_URL;if(r)return r}},EE=()=>{const e=$x();if(e!=null&&e.VITE_AIR_JAM_API_KEY)return e.VITE_AIR_JAM_API_KEY;if(typeof process<"u"&&Fu){const r=Fu.NEXT_PUBLIC_AIR_JAM_API_KEY;if(r)return r}},AE=({children:e,serverUrl:r,apiKey:a,controllerPath:s=Px,maxPlayers:f=C3,publicHost:g,input:y})=>{const E=B.useMemo(()=>({serverUrl:r??_E(),apiKey:a??EE(),controllerPath:s,maxPlayers:f,publicHost:g}),[r,a,s,f,g]),A=B.useMemo(()=>y?new S3(y):null,[y]),b=B.useMemo(()=>T3(),[]),T=B.useMemo(()=>new bE(E.serverUrl),[E.serverUrl]);B.useEffect(()=>()=>{T.disconnectAll()},[T]);const x=B.useCallback(k=>T.getSocket(k),[T]),S=B.useCallback(k=>T.disconnect(k),[T]),R=B.useMemo(()=>({config:E,store:b,socketManager:T,getSocket:x,disconnectSocket:S,inputManager:A}),[E,b,T,x,S,A]);return F.jsx(Jx.Provider,{value:R,children:e})},Wl=()=>{const e=B.useContext(Jx);if(!e)throw new Error("useAirJamContext must be used within an AirJamProvider. Wrap your app or component tree with <AirJamProvider>.");return e},kp=e=>{const{store:r}=Wl();return As(r,ef(e))};var wh={};/*!
|
|
61
|
+
* howler.js v2.2.4
|
|
62
|
+
* howlerjs.com
|
|
63
|
+
*
|
|
64
|
+
* (c) 2013-2020, James Simpson of GoldFire Studios
|
|
65
|
+
* goldfirestudios.com
|
|
66
|
+
*
|
|
67
|
+
* MIT License
|
|
68
|
+
*/var zp;function CE(){return zp||(zp=1,(function(e){(function(){var r=function(){this.init()};r.prototype={init:function(){var x=this||a;return x._counter=1e3,x._html5AudioPool=[],x.html5PoolSize=10,x._codecs={},x._howls=[],x._muted=!1,x._volume=1,x._canPlayEvent="canplaythrough",x._navigator=typeof window<"u"&&window.navigator?window.navigator:null,x.masterGain=null,x.noAudio=!1,x.usingWebAudio=!0,x.autoSuspend=!0,x.ctx=null,x.autoUnlock=!0,x._setup(),x},volume:function(x){var S=this||a;if(x=parseFloat(x),S.ctx||T(),typeof x<"u"&&x>=0&&x<=1){if(S._volume=x,S._muted)return S;S.usingWebAudio&&S.masterGain.gain.setValueAtTime(x,a.ctx.currentTime);for(var R=0;R<S._howls.length;R++)if(!S._howls[R]._webAudio)for(var k=S._howls[R]._getSoundIds(),I=0;I<k.length;I++){var z=S._howls[R]._soundById(k[I]);z&&z._node&&(z._node.volume=z._volume*x)}return S}return S._volume},mute:function(x){var S=this||a;S.ctx||T(),S._muted=x,S.usingWebAudio&&S.masterGain.gain.setValueAtTime(x?0:S._volume,a.ctx.currentTime);for(var R=0;R<S._howls.length;R++)if(!S._howls[R]._webAudio)for(var k=S._howls[R]._getSoundIds(),I=0;I<k.length;I++){var z=S._howls[R]._soundById(k[I]);z&&z._node&&(z._node.muted=x?!0:z._muted)}return S},stop:function(){for(var x=this||a,S=0;S<x._howls.length;S++)x._howls[S].stop();return x},unload:function(){for(var x=this||a,S=x._howls.length-1;S>=0;S--)x._howls[S].unload();return x.usingWebAudio&&x.ctx&&typeof x.ctx.close<"u"&&(x.ctx.close(),x.ctx=null,T()),x},codecs:function(x){return(this||a)._codecs[x.replace(/^x-/,"")]},_setup:function(){var x=this||a;if(x.state=x.ctx&&x.ctx.state||"suspended",x._autoSuspend(),!x.usingWebAudio)if(typeof Audio<"u")try{var S=new Audio;typeof S.oncanplaythrough>"u"&&(x._canPlayEvent="canplay")}catch{x.noAudio=!0}else x.noAudio=!0;try{var S=new Audio;S.muted&&(x.noAudio=!0)}catch{}return x.noAudio||x._setupCodecs(),x},_setupCodecs:function(){var x=this||a,S=null;try{S=typeof Audio<"u"?new Audio:null}catch{return x}if(!S||typeof S.canPlayType!="function")return x;var R=S.canPlayType("audio/mpeg;").replace(/^no$/,""),k=x._navigator?x._navigator.userAgent:"",I=k.match(/OPR\/(\d+)/g),z=I&&parseInt(I[0].split("/")[1],10)<33,L=k.indexOf("Safari")!==-1&&k.indexOf("Chrome")===-1,Z=k.match(/Version\/(.*?) /),H=L&&Z&&parseInt(Z[1],10)<15;return x._codecs={mp3:!!(!z&&(R||S.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!R,opus:!!S.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!S.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!S.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(S.canPlayType('audio/wav; codecs="1"')||S.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!S.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!S.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(S.canPlayType("audio/x-m4a;")||S.canPlayType("audio/m4a;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(S.canPlayType("audio/x-m4b;")||S.canPlayType("audio/m4b;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(S.canPlayType("audio/x-mp4;")||S.canPlayType("audio/mp4;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!H&&S.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!H&&S.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!S.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(S.canPlayType("audio/x-flac;")||S.canPlayType("audio/flac;")).replace(/^no$/,"")},x},_unlockAudio:function(){var x=this||a;if(!(x._audioUnlocked||!x.ctx)){x._audioUnlocked=!1,x.autoUnlock=!1,!x._mobileUnloaded&&x.ctx.sampleRate!==44100&&(x._mobileUnloaded=!0,x.unload()),x._scratchBuffer=x.ctx.createBuffer(1,1,22050);var S=function(R){for(;x._html5AudioPool.length<x.html5PoolSize;)try{var k=new Audio;k._unlocked=!0,x._releaseHtml5Audio(k)}catch{x.noAudio=!0;break}for(var I=0;I<x._howls.length;I++)if(!x._howls[I]._webAudio)for(var z=x._howls[I]._getSoundIds(),L=0;L<z.length;L++){var Z=x._howls[I]._soundById(z[L]);Z&&Z._node&&!Z._node._unlocked&&(Z._node._unlocked=!0,Z._node.load())}x._autoResume();var H=x.ctx.createBufferSource();H.buffer=x._scratchBuffer,H.connect(x.ctx.destination),typeof H.start>"u"?H.noteOn(0):H.start(0),typeof x.ctx.resume=="function"&&x.ctx.resume(),H.onended=function(){H.disconnect(0),x._audioUnlocked=!0,document.removeEventListener("touchstart",S,!0),document.removeEventListener("touchend",S,!0),document.removeEventListener("click",S,!0),document.removeEventListener("keydown",S,!0);for(var j=0;j<x._howls.length;j++)x._howls[j]._emit("unlock")}};return document.addEventListener("touchstart",S,!0),document.addEventListener("touchend",S,!0),document.addEventListener("click",S,!0),document.addEventListener("keydown",S,!0),x}},_obtainHtml5Audio:function(){var x=this||a;if(x._html5AudioPool.length)return x._html5AudioPool.pop();var S=new Audio().play();return S&&typeof Promise<"u"&&(S instanceof Promise||typeof S.then=="function")&&S.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(x){var S=this||a;return x._unlocked&&S._html5AudioPool.push(x),S},_autoSuspend:function(){var x=this;if(!(!x.autoSuspend||!x.ctx||typeof x.ctx.suspend>"u"||!a.usingWebAudio)){for(var S=0;S<x._howls.length;S++)if(x._howls[S]._webAudio){for(var R=0;R<x._howls[S]._sounds.length;R++)if(!x._howls[S]._sounds[R]._paused)return x}return x._suspendTimer&&clearTimeout(x._suspendTimer),x._suspendTimer=setTimeout(function(){if(x.autoSuspend){x._suspendTimer=null,x.state="suspending";var k=function(){x.state="suspended",x._resumeAfterSuspend&&(delete x._resumeAfterSuspend,x._autoResume())};x.ctx.suspend().then(k,k)}},3e4),x}},_autoResume:function(){var x=this;if(!(!x.ctx||typeof x.ctx.resume>"u"||!a.usingWebAudio))return x.state==="running"&&x.ctx.state!=="interrupted"&&x._suspendTimer?(clearTimeout(x._suspendTimer),x._suspendTimer=null):x.state==="suspended"||x.state==="running"&&x.ctx.state==="interrupted"?(x.ctx.resume().then(function(){x.state="running";for(var S=0;S<x._howls.length;S++)x._howls[S]._emit("resume")}),x._suspendTimer&&(clearTimeout(x._suspendTimer),x._suspendTimer=null)):x.state==="suspending"&&(x._resumeAfterSuspend=!0),x}};var a=new r,s=function(x){var S=this;if(!x.src||x.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}S.init(x)};s.prototype={init:function(x){var S=this;return a.ctx||T(),S._autoplay=x.autoplay||!1,S._format=typeof x.format!="string"?x.format:[x.format],S._html5=x.html5||!1,S._muted=x.mute||!1,S._loop=x.loop||!1,S._pool=x.pool||5,S._preload=typeof x.preload=="boolean"||x.preload==="metadata"?x.preload:!0,S._rate=x.rate||1,S._sprite=x.sprite||{},S._src=typeof x.src!="string"?x.src:[x.src],S._volume=x.volume!==void 0?x.volume:1,S._xhr={method:x.xhr&&x.xhr.method?x.xhr.method:"GET",headers:x.xhr&&x.xhr.headers?x.xhr.headers:null,withCredentials:x.xhr&&x.xhr.withCredentials?x.xhr.withCredentials:!1},S._duration=0,S._state="unloaded",S._sounds=[],S._endTimers={},S._queue=[],S._playLock=!1,S._onend=x.onend?[{fn:x.onend}]:[],S._onfade=x.onfade?[{fn:x.onfade}]:[],S._onload=x.onload?[{fn:x.onload}]:[],S._onloaderror=x.onloaderror?[{fn:x.onloaderror}]:[],S._onplayerror=x.onplayerror?[{fn:x.onplayerror}]:[],S._onpause=x.onpause?[{fn:x.onpause}]:[],S._onplay=x.onplay?[{fn:x.onplay}]:[],S._onstop=x.onstop?[{fn:x.onstop}]:[],S._onmute=x.onmute?[{fn:x.onmute}]:[],S._onvolume=x.onvolume?[{fn:x.onvolume}]:[],S._onrate=x.onrate?[{fn:x.onrate}]:[],S._onseek=x.onseek?[{fn:x.onseek}]:[],S._onunlock=x.onunlock?[{fn:x.onunlock}]:[],S._onresume=[],S._webAudio=a.usingWebAudio&&!S._html5,typeof a.ctx<"u"&&a.ctx&&a.autoUnlock&&a._unlockAudio(),a._howls.push(S),S._autoplay&&S._queue.push({event:"play",action:function(){S.play()}}),S._preload&&S._preload!=="none"&&S.load(),S},load:function(){var x=this,S=null;if(a.noAudio){x._emit("loaderror",null,"No audio support.");return}typeof x._src=="string"&&(x._src=[x._src]);for(var R=0;R<x._src.length;R++){var k,I;if(x._format&&x._format[R])k=x._format[R];else{if(I=x._src[R],typeof I!="string"){x._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}k=/^data:audio\/([^;,]+);/i.exec(I),k||(k=/\.([^.]+)$/.exec(I.split("?",1)[0])),k&&(k=k[1].toLowerCase())}if(k||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),k&&a.codecs(k)){S=x._src[R];break}}if(!S){x._emit("loaderror",null,"No codec support for selected audio sources.");return}return x._src=S,x._state="loading",window.location.protocol==="https:"&&S.slice(0,5)==="http:"&&(x._html5=!0,x._webAudio=!1),new f(x),x._webAudio&&y(x),x},play:function(x,S){var R=this,k=null;if(typeof x=="number")k=x,x=null;else{if(typeof x=="string"&&R._state==="loaded"&&!R._sprite[x])return null;if(typeof x>"u"&&(x="__default",!R._playLock)){for(var I=0,z=0;z<R._sounds.length;z++)R._sounds[z]._paused&&!R._sounds[z]._ended&&(I++,k=R._sounds[z]._id);I===1?x=null:k=null}}var L=k?R._soundById(k):R._inactiveSound();if(!L)return null;if(k&&!x&&(x=L._sprite||"__default"),R._state!=="loaded"){L._sprite=x,L._ended=!1;var Z=L._id;return R._queue.push({event:"play",action:function(){R.play(Z)}}),Z}if(k&&!L._paused)return S||R._loadQueue("play"),L._id;R._webAudio&&a._autoResume();var H=Math.max(0,L._seek>0?L._seek:R._sprite[x][0]/1e3),j=Math.max(0,(R._sprite[x][0]+R._sprite[x][1])/1e3-H),ae=j*1e3/Math.abs(L._rate),ee=R._sprite[x][0]/1e3,X=(R._sprite[x][0]+R._sprite[x][1])/1e3;L._sprite=x,L._ended=!1;var de=function(){L._paused=!1,L._seek=H,L._start=ee,L._stop=X,L._loop=!!(L._loop||R._sprite[x][2])};if(H>=X){R._ended(L);return}var Q=L._node;if(R._webAudio){var Oe=function(){R._playLock=!1,de(),R._refreshBuffer(L);var Ce=L._muted||R._muted?0:L._volume;Q.gain.setValueAtTime(Ce,a.ctx.currentTime),L._playStart=a.ctx.currentTime,typeof Q.bufferSource.start>"u"?L._loop?Q.bufferSource.noteGrainOn(0,H,86400):Q.bufferSource.noteGrainOn(0,H,j):L._loop?Q.bufferSource.start(0,H,86400):Q.bufferSource.start(0,H,j),ae!==1/0&&(R._endTimers[L._id]=setTimeout(R._ended.bind(R,L),ae)),S||setTimeout(function(){R._emit("play",L._id),R._loadQueue()},0)};a.state==="running"&&a.ctx.state!=="interrupted"?Oe():(R._playLock=!0,R.once("resume",Oe),R._clearTimer(L._id))}else{var ue=function(){Q.currentTime=H,Q.muted=L._muted||R._muted||a._muted||Q.muted,Q.volume=L._volume*a.volume(),Q.playbackRate=L._rate;try{var Ce=Q.play();if(Ce&&typeof Promise<"u"&&(Ce instanceof Promise||typeof Ce.then=="function")?(R._playLock=!0,de(),Ce.then(function(){R._playLock=!1,Q._unlocked=!0,S?R._loadQueue():R._emit("play",L._id)}).catch(function(){R._playLock=!1,R._emit("playerror",L._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),L._ended=!0,L._paused=!0})):S||(R._playLock=!1,de(),R._emit("play",L._id)),Q.playbackRate=L._rate,Q.paused){R._emit("playerror",L._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}x!=="__default"||L._loop?R._endTimers[L._id]=setTimeout(R._ended.bind(R,L),ae):(R._endTimers[L._id]=function(){R._ended(L),Q.removeEventListener("ended",R._endTimers[L._id],!1)},Q.addEventListener("ended",R._endTimers[L._id],!1))}catch(re){R._emit("playerror",L._id,re)}};Q.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(Q.src=R._src,Q.load());var $=window&&window.ejecta||!Q.readyState&&a._navigator.isCocoonJS;if(Q.readyState>=3||$)ue();else{R._playLock=!0,R._state="loading";var pe=function(){R._state="loaded",ue(),Q.removeEventListener(a._canPlayEvent,pe,!1)};Q.addEventListener(a._canPlayEvent,pe,!1),R._clearTimer(L._id)}}return L._id},pause:function(x){var S=this;if(S._state!=="loaded"||S._playLock)return S._queue.push({event:"pause",action:function(){S.pause(x)}}),S;for(var R=S._getSoundIds(x),k=0;k<R.length;k++){S._clearTimer(R[k]);var I=S._soundById(R[k]);if(I&&!I._paused&&(I._seek=S.seek(R[k]),I._rateSeek=0,I._paused=!0,S._stopFade(R[k]),I._node))if(S._webAudio){if(!I._node.bufferSource)continue;typeof I._node.bufferSource.stop>"u"?I._node.bufferSource.noteOff(0):I._node.bufferSource.stop(0),S._cleanBuffer(I._node)}else(!isNaN(I._node.duration)||I._node.duration===1/0)&&I._node.pause();arguments[1]||S._emit("pause",I?I._id:null)}return S},stop:function(x,S){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"stop",action:function(){R.stop(x)}}),R;for(var k=R._getSoundIds(x),I=0;I<k.length;I++){R._clearTimer(k[I]);var z=R._soundById(k[I]);z&&(z._seek=z._start||0,z._rateSeek=0,z._paused=!0,z._ended=!0,R._stopFade(k[I]),z._node&&(R._webAudio?z._node.bufferSource&&(typeof z._node.bufferSource.stop>"u"?z._node.bufferSource.noteOff(0):z._node.bufferSource.stop(0),R._cleanBuffer(z._node)):(!isNaN(z._node.duration)||z._node.duration===1/0)&&(z._node.currentTime=z._start||0,z._node.pause(),z._node.duration===1/0&&R._clearSound(z._node))),S||R._emit("stop",z._id))}return R},mute:function(x,S){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"mute",action:function(){R.mute(x,S)}}),R;if(typeof S>"u")if(typeof x=="boolean")R._muted=x;else return R._muted;for(var k=R._getSoundIds(S),I=0;I<k.length;I++){var z=R._soundById(k[I]);z&&(z._muted=x,z._interval&&R._stopFade(z._id),R._webAudio&&z._node?z._node.gain.setValueAtTime(x?0:z._volume,a.ctx.currentTime):z._node&&(z._node.muted=a._muted?!0:x),R._emit("mute",z._id))}return R},volume:function(){var x=this,S=arguments,R,k;if(S.length===0)return x._volume;if(S.length===1||S.length===2&&typeof S[1]>"u"){var I=x._getSoundIds(),z=I.indexOf(S[0]);z>=0?k=parseInt(S[0],10):R=parseFloat(S[0])}else S.length>=2&&(R=parseFloat(S[0]),k=parseInt(S[1],10));var L;if(typeof R<"u"&&R>=0&&R<=1){if(x._state!=="loaded"||x._playLock)return x._queue.push({event:"volume",action:function(){x.volume.apply(x,S)}}),x;typeof k>"u"&&(x._volume=R),k=x._getSoundIds(k);for(var Z=0;Z<k.length;Z++)L=x._soundById(k[Z]),L&&(L._volume=R,S[2]||x._stopFade(k[Z]),x._webAudio&&L._node&&!L._muted?L._node.gain.setValueAtTime(R,a.ctx.currentTime):L._node&&!L._muted&&(L._node.volume=R*a.volume()),x._emit("volume",L._id))}else return L=k?x._soundById(k):x._sounds[0],L?L._volume:0;return x},fade:function(x,S,R,k){var I=this;if(I._state!=="loaded"||I._playLock)return I._queue.push({event:"fade",action:function(){I.fade(x,S,R,k)}}),I;x=Math.min(Math.max(0,parseFloat(x)),1),S=Math.min(Math.max(0,parseFloat(S)),1),R=parseFloat(R),I.volume(x,k);for(var z=I._getSoundIds(k),L=0;L<z.length;L++){var Z=I._soundById(z[L]);if(Z){if(k||I._stopFade(z[L]),I._webAudio&&!Z._muted){var H=a.ctx.currentTime,j=H+R/1e3;Z._volume=x,Z._node.gain.setValueAtTime(x,H),Z._node.gain.linearRampToValueAtTime(S,j)}I._startFadeInterval(Z,x,S,R,z[L],typeof k>"u")}}return I},_startFadeInterval:function(x,S,R,k,I,z){var L=this,Z=S,H=R-S,j=Math.abs(H/.01),ae=Math.max(4,j>0?k/j:k),ee=Date.now();x._fadeTo=R,x._interval=setInterval(function(){var X=(Date.now()-ee)/k;ee=Date.now(),Z+=H*X,Z=Math.round(Z*100)/100,H<0?Z=Math.max(R,Z):Z=Math.min(R,Z),L._webAudio?x._volume=Z:L.volume(Z,x._id,!0),z&&(L._volume=Z),(R<S&&Z<=R||R>S&&Z>=R)&&(clearInterval(x._interval),x._interval=null,x._fadeTo=null,L.volume(R,x._id),L._emit("fade",x._id))},ae)},_stopFade:function(x){var S=this,R=S._soundById(x);return R&&R._interval&&(S._webAudio&&R._node.gain.cancelScheduledValues(a.ctx.currentTime),clearInterval(R._interval),R._interval=null,S.volume(R._fadeTo,x),R._fadeTo=null,S._emit("fade",x)),S},loop:function(){var x=this,S=arguments,R,k,I;if(S.length===0)return x._loop;if(S.length===1)if(typeof S[0]=="boolean")R=S[0],x._loop=R;else return I=x._soundById(parseInt(S[0],10)),I?I._loop:!1;else S.length===2&&(R=S[0],k=parseInt(S[1],10));for(var z=x._getSoundIds(k),L=0;L<z.length;L++)I=x._soundById(z[L]),I&&(I._loop=R,x._webAudio&&I._node&&I._node.bufferSource&&(I._node.bufferSource.loop=R,R&&(I._node.bufferSource.loopStart=I._start||0,I._node.bufferSource.loopEnd=I._stop,x.playing(z[L])&&(x.pause(z[L],!0),x.play(z[L],!0)))));return x},rate:function(){var x=this,S=arguments,R,k;if(S.length===0)k=x._sounds[0]._id;else if(S.length===1){var I=x._getSoundIds(),z=I.indexOf(S[0]);z>=0?k=parseInt(S[0],10):R=parseFloat(S[0])}else S.length===2&&(R=parseFloat(S[0]),k=parseInt(S[1],10));var L;if(typeof R=="number"){if(x._state!=="loaded"||x._playLock)return x._queue.push({event:"rate",action:function(){x.rate.apply(x,S)}}),x;typeof k>"u"&&(x._rate=R),k=x._getSoundIds(k);for(var Z=0;Z<k.length;Z++)if(L=x._soundById(k[Z]),L){x.playing(k[Z])&&(L._rateSeek=x.seek(k[Z]),L._playStart=x._webAudio?a.ctx.currentTime:L._playStart),L._rate=R,x._webAudio&&L._node&&L._node.bufferSource?L._node.bufferSource.playbackRate.setValueAtTime(R,a.ctx.currentTime):L._node&&(L._node.playbackRate=R);var H=x.seek(k[Z]),j=(x._sprite[L._sprite][0]+x._sprite[L._sprite][1])/1e3-H,ae=j*1e3/Math.abs(L._rate);(x._endTimers[k[Z]]||!L._paused)&&(x._clearTimer(k[Z]),x._endTimers[k[Z]]=setTimeout(x._ended.bind(x,L),ae)),x._emit("rate",L._id)}}else return L=x._soundById(k),L?L._rate:x._rate;return x},seek:function(){var x=this,S=arguments,R,k;if(S.length===0)x._sounds.length&&(k=x._sounds[0]._id);else if(S.length===1){var I=x._getSoundIds(),z=I.indexOf(S[0]);z>=0?k=parseInt(S[0],10):x._sounds.length&&(k=x._sounds[0]._id,R=parseFloat(S[0]))}else S.length===2&&(R=parseFloat(S[0]),k=parseInt(S[1],10));if(typeof k>"u")return 0;if(typeof R=="number"&&(x._state!=="loaded"||x._playLock))return x._queue.push({event:"seek",action:function(){x.seek.apply(x,S)}}),x;var L=x._soundById(k);if(L)if(typeof R=="number"&&R>=0){var Z=x.playing(k);Z&&x.pause(k,!0),L._seek=R,L._ended=!1,x._clearTimer(k),!x._webAudio&&L._node&&!isNaN(L._node.duration)&&(L._node.currentTime=R);var H=function(){Z&&x.play(k,!0),x._emit("seek",k)};if(Z&&!x._webAudio){var j=function(){x._playLock?setTimeout(j,0):H()};setTimeout(j,0)}else H()}else if(x._webAudio){var ae=x.playing(k)?a.ctx.currentTime-L._playStart:0,ee=L._rateSeek?L._rateSeek-L._seek:0;return L._seek+(ee+ae*Math.abs(L._rate))}else return L._node.currentTime;return x},playing:function(x){var S=this;if(typeof x=="number"){var R=S._soundById(x);return R?!R._paused:!1}for(var k=0;k<S._sounds.length;k++)if(!S._sounds[k]._paused)return!0;return!1},duration:function(x){var S=this,R=S._duration,k=S._soundById(x);return k&&(R=S._sprite[k._sprite][1]/1e3),R},state:function(){return this._state},unload:function(){for(var x=this,S=x._sounds,R=0;R<S.length;R++)S[R]._paused||x.stop(S[R]._id),x._webAudio||(x._clearSound(S[R]._node),S[R]._node.removeEventListener("error",S[R]._errorFn,!1),S[R]._node.removeEventListener(a._canPlayEvent,S[R]._loadFn,!1),S[R]._node.removeEventListener("ended",S[R]._endFn,!1),a._releaseHtml5Audio(S[R]._node)),delete S[R]._node,x._clearTimer(S[R]._id);var k=a._howls.indexOf(x);k>=0&&a._howls.splice(k,1);var I=!0;for(R=0;R<a._howls.length;R++)if(a._howls[R]._src===x._src||x._src.indexOf(a._howls[R]._src)>=0){I=!1;break}return g&&I&&delete g[x._src],a.noAudio=!1,x._state="unloaded",x._sounds=[],x=null,null},on:function(x,S,R,k){var I=this,z=I["_on"+x];return typeof S=="function"&&z.push(k?{id:R,fn:S,once:k}:{id:R,fn:S}),I},off:function(x,S,R){var k=this,I=k["_on"+x],z=0;if(typeof S=="number"&&(R=S,S=null),S||R)for(z=0;z<I.length;z++){var L=R===I[z].id;if(S===I[z].fn&&L||!S&&L){I.splice(z,1);break}}else if(x)k["_on"+x]=[];else{var Z=Object.keys(k);for(z=0;z<Z.length;z++)Z[z].indexOf("_on")===0&&Array.isArray(k[Z[z]])&&(k[Z[z]]=[])}return k},once:function(x,S,R){var k=this;return k.on(x,S,R,1),k},_emit:function(x,S,R){for(var k=this,I=k["_on"+x],z=I.length-1;z>=0;z--)(!I[z].id||I[z].id===S||x==="load")&&(setTimeout((function(L){L.call(this,S,R)}).bind(k,I[z].fn),0),I[z].once&&k.off(x,I[z].fn,I[z].id));return k._loadQueue(x),k},_loadQueue:function(x){var S=this;if(S._queue.length>0){var R=S._queue[0];R.event===x&&(S._queue.shift(),S._loadQueue()),x||R.action()}return S},_ended:function(x){var S=this,R=x._sprite;if(!S._webAudio&&x._node&&!x._node.paused&&!x._node.ended&&x._node.currentTime<x._stop)return setTimeout(S._ended.bind(S,x),100),S;var k=!!(x._loop||S._sprite[R][2]);if(S._emit("end",x._id),!S._webAudio&&k&&S.stop(x._id,!0).play(x._id),S._webAudio&&k){S._emit("play",x._id),x._seek=x._start||0,x._rateSeek=0,x._playStart=a.ctx.currentTime;var I=(x._stop-x._start)*1e3/Math.abs(x._rate);S._endTimers[x._id]=setTimeout(S._ended.bind(S,x),I)}return S._webAudio&&!k&&(x._paused=!0,x._ended=!0,x._seek=x._start||0,x._rateSeek=0,S._clearTimer(x._id),S._cleanBuffer(x._node),a._autoSuspend()),!S._webAudio&&!k&&S.stop(x._id,!0),S},_clearTimer:function(x){var S=this;if(S._endTimers[x]){if(typeof S._endTimers[x]!="function")clearTimeout(S._endTimers[x]);else{var R=S._soundById(x);R&&R._node&&R._node.removeEventListener("ended",S._endTimers[x],!1)}delete S._endTimers[x]}return S},_soundById:function(x){for(var S=this,R=0;R<S._sounds.length;R++)if(x===S._sounds[R]._id)return S._sounds[R];return null},_inactiveSound:function(){var x=this;x._drain();for(var S=0;S<x._sounds.length;S++)if(x._sounds[S]._ended)return x._sounds[S].reset();return new f(x)},_drain:function(){var x=this,S=x._pool,R=0,k=0;if(!(x._sounds.length<S)){for(k=0;k<x._sounds.length;k++)x._sounds[k]._ended&&R++;for(k=x._sounds.length-1;k>=0;k--){if(R<=S)return;x._sounds[k]._ended&&(x._webAudio&&x._sounds[k]._node&&x._sounds[k]._node.disconnect(0),x._sounds.splice(k,1),R--)}}},_getSoundIds:function(x){var S=this;if(typeof x>"u"){for(var R=[],k=0;k<S._sounds.length;k++)R.push(S._sounds[k]._id);return R}else return[x]},_refreshBuffer:function(x){var S=this;return x._node.bufferSource=a.ctx.createBufferSource(),x._node.bufferSource.buffer=g[S._src],x._panner?x._node.bufferSource.connect(x._panner):x._node.bufferSource.connect(x._node),x._node.bufferSource.loop=x._loop,x._loop&&(x._node.bufferSource.loopStart=x._start||0,x._node.bufferSource.loopEnd=x._stop||0),x._node.bufferSource.playbackRate.setValueAtTime(x._rate,a.ctx.currentTime),S},_cleanBuffer:function(x){var S=this,R=a._navigator&&a._navigator.vendor.indexOf("Apple")>=0;if(!x.bufferSource)return S;if(a._scratchBuffer&&x.bufferSource&&(x.bufferSource.onended=null,x.bufferSource.disconnect(0),R))try{x.bufferSource.buffer=a._scratchBuffer}catch{}return x.bufferSource=null,S},_clearSound:function(x){var S=/MSIE |Trident\//.test(a._navigator&&a._navigator.userAgent);S||(x.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var f=function(x){this._parent=x,this.init()};f.prototype={init:function(){var x=this,S=x._parent;return x._muted=S._muted,x._loop=S._loop,x._volume=S._volume,x._rate=S._rate,x._seek=0,x._paused=!0,x._ended=!0,x._sprite="__default",x._id=++a._counter,S._sounds.push(x),x.create(),x},create:function(){var x=this,S=x._parent,R=a._muted||x._muted||x._parent._muted?0:x._volume;return S._webAudio?(x._node=typeof a.ctx.createGain>"u"?a.ctx.createGainNode():a.ctx.createGain(),x._node.gain.setValueAtTime(R,a.ctx.currentTime),x._node.paused=!0,x._node.connect(a.masterGain)):a.noAudio||(x._node=a._obtainHtml5Audio(),x._errorFn=x._errorListener.bind(x),x._node.addEventListener("error",x._errorFn,!1),x._loadFn=x._loadListener.bind(x),x._node.addEventListener(a._canPlayEvent,x._loadFn,!1),x._endFn=x._endListener.bind(x),x._node.addEventListener("ended",x._endFn,!1),x._node.src=S._src,x._node.preload=S._preload===!0?"auto":S._preload,x._node.volume=R*a.volume(),x._node.load()),x},reset:function(){var x=this,S=x._parent;return x._muted=S._muted,x._loop=S._loop,x._volume=S._volume,x._rate=S._rate,x._seek=0,x._rateSeek=0,x._paused=!0,x._ended=!0,x._sprite="__default",x._id=++a._counter,x},_errorListener:function(){var x=this;x._parent._emit("loaderror",x._id,x._node.error?x._node.error.code:0),x._node.removeEventListener("error",x._errorFn,!1)},_loadListener:function(){var x=this,S=x._parent;S._duration=Math.ceil(x._node.duration*10)/10,Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,S._duration*1e3]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue()),x._node.removeEventListener(a._canPlayEvent,x._loadFn,!1)},_endListener:function(){var x=this,S=x._parent;S._duration===1/0&&(S._duration=Math.ceil(x._node.duration*10)/10,S._sprite.__default[1]===1/0&&(S._sprite.__default[1]=S._duration*1e3),S._ended(x)),x._node.removeEventListener("ended",x._endFn,!1)}};var g={},y=function(x){var S=x._src;if(g[S]){x._duration=g[S].duration,b(x);return}if(/^data:[^;]+;base64,/.test(S)){for(var R=atob(S.split(",")[1]),k=new Uint8Array(R.length),I=0;I<R.length;++I)k[I]=R.charCodeAt(I);A(k.buffer,x)}else{var z=new XMLHttpRequest;z.open(x._xhr.method,S,!0),z.withCredentials=x._xhr.withCredentials,z.responseType="arraybuffer",x._xhr.headers&&Object.keys(x._xhr.headers).forEach(function(L){z.setRequestHeader(L,x._xhr.headers[L])}),z.onload=function(){var L=(z.status+"")[0];if(L!=="0"&&L!=="2"&&L!=="3"){x._emit("loaderror",null,"Failed loading audio file with status: "+z.status+".");return}A(z.response,x)},z.onerror=function(){x._webAudio&&(x._html5=!0,x._webAudio=!1,x._sounds=[],delete g[S],x.load())},E(z)}},E=function(x){try{x.send()}catch{x.onerror()}},A=function(x,S){var R=function(){S._emit("loaderror",null,"Decoding audio data failed.")},k=function(I){I&&S._sounds.length>0?(g[S._src]=I,b(S,I)):R()};typeof Promise<"u"&&a.ctx.decodeAudioData.length===1?a.ctx.decodeAudioData(x).then(k).catch(R):a.ctx.decodeAudioData(x,k,R)},b=function(x,S){S&&!x._duration&&(x._duration=S.duration),Object.keys(x._sprite).length===0&&(x._sprite={__default:[0,x._duration*1e3]}),x._state!=="loaded"&&(x._state="loaded",x._emit("load"),x._loadQueue())},T=function(){if(a.usingWebAudio){try{typeof AudioContext<"u"?a.ctx=new AudioContext:typeof webkitAudioContext<"u"?a.ctx=new webkitAudioContext:a.usingWebAudio=!1}catch{a.usingWebAudio=!1}a.ctx||(a.usingWebAudio=!1);var x=/iP(hone|od|ad)/.test(a._navigator&&a._navigator.platform),S=a._navigator&&a._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),R=S?parseInt(S[1],10):null;if(x&&R&&R<9){var k=/safari/.test(a._navigator&&a._navigator.userAgent.toLowerCase());a._navigator&&!k&&(a.usingWebAudio=!1)}a.usingWebAudio&&(a.masterGain=typeof a.ctx.createGain>"u"?a.ctx.createGainNode():a.ctx.createGain(),a.masterGain.gain.setValueAtTime(a._muted?0:a._volume,a.ctx.currentTime),a.masterGain.connect(a.ctx.destination)),a._setup()}};e.Howler=a,e.Howl=s,typeof Qi<"u"?(Qi.HowlerGlobal=r,Qi.Howler=a,Qi.Howl=s,Qi.Sound=f):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=a,window.Howl=s,window.Sound=f)})();/*!
|
|
69
|
+
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
|
70
|
+
*
|
|
71
|
+
* howler.js v2.2.4
|
|
72
|
+
* howlerjs.com
|
|
73
|
+
*
|
|
74
|
+
* (c) 2013-2020, James Simpson of GoldFire Studios
|
|
75
|
+
* goldfirestudios.com
|
|
76
|
+
*
|
|
77
|
+
* MIT License
|
|
78
|
+
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(a){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var f=s._howls.length-1;f>=0;f--)s._howls[f].stereo(a);return s},HowlerGlobal.prototype.pos=function(a,s,f){var g=this;if(!g.ctx||!g.ctx.listener)return g;if(s=typeof s!="number"?g._pos[1]:s,f=typeof f!="number"?g._pos[2]:f,typeof a=="number")g._pos=[a,s,f],typeof g.ctx.listener.positionX<"u"?(g.ctx.listener.positionX.setTargetAtTime(g._pos[0],Howler.ctx.currentTime,.1),g.ctx.listener.positionY.setTargetAtTime(g._pos[1],Howler.ctx.currentTime,.1),g.ctx.listener.positionZ.setTargetAtTime(g._pos[2],Howler.ctx.currentTime,.1)):g.ctx.listener.setPosition(g._pos[0],g._pos[1],g._pos[2]);else return g._pos;return g},HowlerGlobal.prototype.orientation=function(a,s,f,g,y,E){var A=this;if(!A.ctx||!A.ctx.listener)return A;var b=A._orientation;if(s=typeof s!="number"?b[1]:s,f=typeof f!="number"?b[2]:f,g=typeof g!="number"?b[3]:g,y=typeof y!="number"?b[4]:y,E=typeof E!="number"?b[5]:E,typeof a=="number")A._orientation=[a,s,f,g,y,E],typeof A.ctx.listener.forwardX<"u"?(A.ctx.listener.forwardX.setTargetAtTime(a,Howler.ctx.currentTime,.1),A.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),A.ctx.listener.forwardZ.setTargetAtTime(f,Howler.ctx.currentTime,.1),A.ctx.listener.upX.setTargetAtTime(g,Howler.ctx.currentTime,.1),A.ctx.listener.upY.setTargetAtTime(y,Howler.ctx.currentTime,.1),A.ctx.listener.upZ.setTargetAtTime(E,Howler.ctx.currentTime,.1)):A.ctx.listener.setOrientation(a,s,f,g,y,E);else return b;return A},Howl.prototype.init=(function(a){return function(s){var f=this;return f._orientation=s.orientation||[1,0,0],f._stereo=s.stereo||null,f._pos=s.pos||null,f._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},f._onstereo=s.onstereo?[{fn:s.onstereo}]:[],f._onpos=s.onpos?[{fn:s.onpos}]:[],f._onorientation=s.onorientation?[{fn:s.onorientation}]:[],a.call(this,s)}})(Howl.prototype.init),Howl.prototype.stereo=function(a,s){var f=this;if(!f._webAudio)return f;if(f._state!=="loaded")return f._queue.push({event:"stereo",action:function(){f.stereo(a,s)}}),f;var g=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof a=="number")f._stereo=a,f._pos=[a,0,0];else return f._stereo;for(var y=f._getSoundIds(s),E=0;E<y.length;E++){var A=f._soundById(y[E]);if(A)if(typeof a=="number")A._stereo=a,A._pos=[a,0,0],A._node&&(A._pannerAttr.panningModel="equalpower",(!A._panner||!A._panner.pan)&&r(A,g),g==="spatial"?typeof A._panner.positionX<"u"?(A._panner.positionX.setValueAtTime(a,Howler.ctx.currentTime),A._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),A._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):A._panner.setPosition(a,0,0):A._panner.pan.setValueAtTime(a,Howler.ctx.currentTime)),f._emit("stereo",A._id);else return A._stereo}return f},Howl.prototype.pos=function(a,s,f,g){var y=this;if(!y._webAudio)return y;if(y._state!=="loaded")return y._queue.push({event:"pos",action:function(){y.pos(a,s,f,g)}}),y;if(s=typeof s!="number"?0:s,f=typeof f!="number"?-.5:f,typeof g>"u")if(typeof a=="number")y._pos=[a,s,f];else return y._pos;for(var E=y._getSoundIds(g),A=0;A<E.length;A++){var b=y._soundById(E[A]);if(b)if(typeof a=="number")b._pos=[a,s,f],b._node&&((!b._panner||b._panner.pan)&&r(b,"spatial"),typeof b._panner.positionX<"u"?(b._panner.positionX.setValueAtTime(a,Howler.ctx.currentTime),b._panner.positionY.setValueAtTime(s,Howler.ctx.currentTime),b._panner.positionZ.setValueAtTime(f,Howler.ctx.currentTime)):b._panner.setPosition(a,s,f)),y._emit("pos",b._id);else return b._pos}return y},Howl.prototype.orientation=function(a,s,f,g){var y=this;if(!y._webAudio)return y;if(y._state!=="loaded")return y._queue.push({event:"orientation",action:function(){y.orientation(a,s,f,g)}}),y;if(s=typeof s!="number"?y._orientation[1]:s,f=typeof f!="number"?y._orientation[2]:f,typeof g>"u")if(typeof a=="number")y._orientation=[a,s,f];else return y._orientation;for(var E=y._getSoundIds(g),A=0;A<E.length;A++){var b=y._soundById(E[A]);if(b)if(typeof a=="number")b._orientation=[a,s,f],b._node&&(b._panner||(b._pos||(b._pos=y._pos||[0,0,-.5]),r(b,"spatial")),typeof b._panner.orientationX<"u"?(b._panner.orientationX.setValueAtTime(a,Howler.ctx.currentTime),b._panner.orientationY.setValueAtTime(s,Howler.ctx.currentTime),b._panner.orientationZ.setValueAtTime(f,Howler.ctx.currentTime)):b._panner.setOrientation(a,s,f)),y._emit("orientation",b._id);else return b._orientation}return y},Howl.prototype.pannerAttr=function(){var a=this,s=arguments,f,g,y;if(!a._webAudio)return a;if(s.length===0)return a._pannerAttr;if(s.length===1)if(typeof s[0]=="object")f=s[0],typeof g>"u"&&(f.pannerAttr||(f.pannerAttr={coneInnerAngle:f.coneInnerAngle,coneOuterAngle:f.coneOuterAngle,coneOuterGain:f.coneOuterGain,distanceModel:f.distanceModel,maxDistance:f.maxDistance,refDistance:f.refDistance,rolloffFactor:f.rolloffFactor,panningModel:f.panningModel}),a._pannerAttr={coneInnerAngle:typeof f.pannerAttr.coneInnerAngle<"u"?f.pannerAttr.coneInnerAngle:a._coneInnerAngle,coneOuterAngle:typeof f.pannerAttr.coneOuterAngle<"u"?f.pannerAttr.coneOuterAngle:a._coneOuterAngle,coneOuterGain:typeof f.pannerAttr.coneOuterGain<"u"?f.pannerAttr.coneOuterGain:a._coneOuterGain,distanceModel:typeof f.pannerAttr.distanceModel<"u"?f.pannerAttr.distanceModel:a._distanceModel,maxDistance:typeof f.pannerAttr.maxDistance<"u"?f.pannerAttr.maxDistance:a._maxDistance,refDistance:typeof f.pannerAttr.refDistance<"u"?f.pannerAttr.refDistance:a._refDistance,rolloffFactor:typeof f.pannerAttr.rolloffFactor<"u"?f.pannerAttr.rolloffFactor:a._rolloffFactor,panningModel:typeof f.pannerAttr.panningModel<"u"?f.pannerAttr.panningModel:a._panningModel});else return y=a._soundById(parseInt(s[0],10)),y?y._pannerAttr:a._pannerAttr;else s.length===2&&(f=s[0],g=parseInt(s[1],10));for(var E=a._getSoundIds(g),A=0;A<E.length;A++)if(y=a._soundById(E[A]),y){var b=y._pannerAttr;b={coneInnerAngle:typeof f.coneInnerAngle<"u"?f.coneInnerAngle:b.coneInnerAngle,coneOuterAngle:typeof f.coneOuterAngle<"u"?f.coneOuterAngle:b.coneOuterAngle,coneOuterGain:typeof f.coneOuterGain<"u"?f.coneOuterGain:b.coneOuterGain,distanceModel:typeof f.distanceModel<"u"?f.distanceModel:b.distanceModel,maxDistance:typeof f.maxDistance<"u"?f.maxDistance:b.maxDistance,refDistance:typeof f.refDistance<"u"?f.refDistance:b.refDistance,rolloffFactor:typeof f.rolloffFactor<"u"?f.rolloffFactor:b.rolloffFactor,panningModel:typeof f.panningModel<"u"?f.panningModel:b.panningModel};var T=y._panner;T||(y._pos||(y._pos=a._pos||[0,0,-.5]),r(y,"spatial"),T=y._panner),T.coneInnerAngle=b.coneInnerAngle,T.coneOuterAngle=b.coneOuterAngle,T.coneOuterGain=b.coneOuterGain,T.distanceModel=b.distanceModel,T.maxDistance=b.maxDistance,T.refDistance=b.refDistance,T.rolloffFactor=b.rolloffFactor,T.panningModel=b.panningModel}return a},Sound.prototype.init=(function(a){return function(){var s=this,f=s._parent;s._orientation=f._orientation,s._stereo=f._stereo,s._pos=f._pos,s._pannerAttr=f._pannerAttr,a.call(this),s._stereo?f.stereo(s._stereo):s._pos&&f.pos(s._pos[0],s._pos[1],s._pos[2],s._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(a){return function(){var s=this,f=s._parent;return s._orientation=f._orientation,s._stereo=f._stereo,s._pos=f._pos,s._pannerAttr=f._pannerAttr,s._stereo?f.stereo(s._stereo):s._pos?f.pos(s._pos[0],s._pos[1],s._pos[2],s._id):s._panner&&(s._panner.disconnect(0),s._panner=void 0,f._refreshBuffer(s)),a.call(this)}})(Sound.prototype.reset);var r=function(a,s){s=s||"spatial",s==="spatial"?(a._panner=Howler.ctx.createPanner(),a._panner.coneInnerAngle=a._pannerAttr.coneInnerAngle,a._panner.coneOuterAngle=a._pannerAttr.coneOuterAngle,a._panner.coneOuterGain=a._pannerAttr.coneOuterGain,a._panner.distanceModel=a._pannerAttr.distanceModel,a._panner.maxDistance=a._pannerAttr.maxDistance,a._panner.refDistance=a._pannerAttr.refDistance,a._panner.rolloffFactor=a._pannerAttr.rolloffFactor,a._panner.panningModel=a._pannerAttr.panningModel,typeof a._panner.positionX<"u"?(a._panner.positionX.setValueAtTime(a._pos[0],Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(a._pos[1],Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(a._pos[2],Howler.ctx.currentTime)):a._panner.setPosition(a._pos[0],a._pos[1],a._pos[2]),typeof a._panner.orientationX<"u"?(a._panner.orientationX.setValueAtTime(a._orientation[0],Howler.ctx.currentTime),a._panner.orientationY.setValueAtTime(a._orientation[1],Howler.ctx.currentTime),a._panner.orientationZ.setValueAtTime(a._orientation[2],Howler.ctx.currentTime)):a._panner.setOrientation(a._orientation[0],a._orientation[1],a._orientation[2])):(a._panner=Howler.ctx.createStereoPanner(),a._panner.pan.setValueAtTime(a._stereo,Howler.ctx.currentTime)),a._panner.connect(a._node),a._paused||a._parent.pause(a._id,!0).play(a._id,!0)}})()})(wh)),wh}CE();const ey="air-jam-volume-settings",SE=()=>{if(typeof window>"u")return{};try{const e=localStorage.getItem(ey);if(e){const r=JSON.parse(e);return{masterVolume:r.masterVolume??1,musicVolume:r.musicVolume??.8,sfxVolume:r.sfxVolume??1}}}catch{}return{}},bh=e=>{if(!(typeof window>"u"))try{localStorage.setItem(ey,JSON.stringify({masterVolume:e.masterVolume,musicVolume:e.musicVolume,sfxVolume:e.sfxVolume}))}catch{}},_h=SE(),TE=z0((e,r)=>({masterVolume:_h.masterVolume??1,musicVolume:_h.musicVolume??.8,sfxVolume:_h.sfxVolume??1,setMasterVolume:a=>{const s=Math.max(0,Math.min(1,a));e({masterVolume:s}),bh({...r(),masterVolume:s})},setMusicVolume:a=>{const s=Math.max(0,Math.min(1,a));e({musicVolume:s}),bh({...r(),musicVolume:s})},setSfxVolume:a=>{const s=Math.max(0,Math.min(1,a));e({sfxVolume:s}),bh({...r(),sfxVolume:s})},getEffectiveVolume:a=>{const{masterVolume:s,musicVolume:f,sfxVolume:g}=r();return s*(a==="music"?f:g)}}));B.createContext(null);/**
|
|
79
|
+
* @license lucide-react v0.554.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const RE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,s)=>s?s.toUpperCase():a.toLowerCase()),Pp=e=>{const r=NE(e);return r.charAt(0).toUpperCase()+r.slice(1)},ty=(...e)=>e.filter((r,a,s)=>!!r&&r.trim()!==""&&s.indexOf(r)===a).join(" ").trim(),OE=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};/**
|
|
84
|
+
* @license lucide-react v0.554.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/var IE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
89
|
+
* @license lucide-react v0.554.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const ME=B.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:f="",children:g,iconNode:y,...E},A)=>B.createElement("svg",{ref:A,...IE,width:r,height:r,stroke:e,strokeWidth:s?Number(a)*24/Number(r):a,className:ty("lucide",f),...!g&&!OE(E)&&{"aria-hidden":"true"},...E},[...y.map(([b,T])=>B.createElement(b,T)),...Array.isArray(g)?g:[g]]));/**
|
|
94
|
+
* @license lucide-react v0.554.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const Xn=(e,r)=>{const a=B.forwardRef(({className:s,...f},g)=>B.createElement(ME,{ref:g,iconNode:r,className:ty(`lucide-${RE(Pp(e))}`,`lucide-${e}`,s),...f}));return a.displayName=Pp(e),a};/**
|
|
99
|
+
* @license lucide-react v0.554.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const DE=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],BE=Xn("bug",DE);/**
|
|
104
|
+
* @license lucide-react v0.554.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const LE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],kE=Xn("check",LE);/**
|
|
109
|
+
* @license lucide-react v0.554.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const zE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],PE=Xn("copy",zE);/**
|
|
114
|
+
* @license lucide-react v0.554.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const UE=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],FE=Xn("external-link",UE);/**
|
|
119
|
+
* @license lucide-react v0.554.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const jE=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],VE=Xn("headphones",jE);/**
|
|
124
|
+
* @license lucide-react v0.554.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const HE=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],GE=Xn("maximize",HE);/**
|
|
129
|
+
* @license lucide-react v0.554.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const ZE=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],XE=Xn("minimize",ZE);/**
|
|
134
|
+
* @license lucide-react v0.554.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const YE=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],qE=Xn("monitor-smartphone",YE);/**
|
|
139
|
+
* @license lucide-react v0.554.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const WE=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],KE=Xn("music",WE);/**
|
|
144
|
+
* @license lucide-react v0.554.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const QE=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ny=Xn("pause",QE);/**
|
|
149
|
+
* @license lucide-react v0.554.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const JE=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ku=Xn("play",JE);/**
|
|
154
|
+
* @license lucide-react v0.554.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const $E=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],ry=Xn("qr-code",$E);/**
|
|
159
|
+
* @license lucide-react v0.554.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const eA=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],tA=Xn("refresh-cw",eA);/**
|
|
164
|
+
* @license lucide-react v0.554.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const nA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rA=Xn("settings",nA);/**
|
|
169
|
+
* @license lucide-react v0.554.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const iA=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],aA=Xn("volume-2",iA);/**
|
|
174
|
+
* @license lucide-react v0.554.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const oA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],sA=Xn("x",oA);function tn(e,r,{checkForDefaultPrevented:a=!0}={}){return function(f){if(e==null||e(f),a===!1||!f.defaultPrevented)return r==null?void 0:r(f)}}function Up(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function H0(...e){return r=>{let a=!1;const s=e.map(f=>{const g=Up(f,r);return!a&&typeof g=="function"&&(a=!0),g});if(a)return()=>{for(let f=0;f<s.length;f++){const g=s[f];typeof g=="function"?g():Up(e[f],null)}}}}function Zn(...e){return B.useCallback(H0(...e),e)}function lA(e,r){const a=B.createContext(r),s=g=>{const{children:y,...E}=g,A=B.useMemo(()=>E,Object.values(E));return F.jsx(a.Provider,{value:A,children:y})};s.displayName=e+"Provider";function f(g){const y=B.useContext(a);if(y)return y;if(r!==void 0)return r;throw new Error(`\`${g}\` must be used within \`${e}\``)}return[s,f]}function Kl(e,r=[]){let a=[];function s(g,y){const E=B.createContext(y),A=a.length;a=[...a,y];const b=x=>{var L;const{scope:S,children:R,...k}=x,I=((L=S==null?void 0:S[e])==null?void 0:L[A])||E,z=B.useMemo(()=>k,Object.values(k));return F.jsx(I.Provider,{value:z,children:R})};b.displayName=g+"Provider";function T(x,S){var I;const R=((I=S==null?void 0:S[e])==null?void 0:I[A])||E,k=B.useContext(R);if(k)return k;if(y!==void 0)return y;throw new Error(`\`${x}\` must be used within \`${g}\``)}return[b,T]}const f=()=>{const g=a.map(y=>B.createContext(y));return function(E){const A=(E==null?void 0:E[e])||g;return B.useMemo(()=>({[`__scope${e}`]:{...E,[e]:A}}),[E,A])}};return f.scopeName=e,[s,cA(f,...r)]}function cA(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(g){const y=s.reduce((E,{useScope:A,scopeName:b})=>{const x=A(g)[`__scope${b}`];return{...E,...x}},{});return B.useMemo(()=>({[`__scope${r.scopeName}`]:y}),[y])}};return a.scopeName=r.scopeName,a}var Cs=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},uA=I0[" useId ".trim().toString()]||(()=>{}),fA=0;function Fl(e){const[r,a]=B.useState(uA());return Cs(()=>{a(s=>s??String(fA++))},[e]),e||(r?`radix-${r}`:"")}var dA=I0[" useInsertionEffect ".trim().toString()]||Cs;function rf({prop:e,defaultProp:r,onChange:a=()=>{},caller:s}){const[f,g,y]=hA({defaultProp:r,onChange:a}),E=e!==void 0,A=E?e:f;{const T=B.useRef(e!==void 0);B.useEffect(()=>{const x=T.current;x!==E&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${E?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),T.current=E},[E,s])}const b=B.useCallback(T=>{var x;if(E){const S=gA(T)?T(e):T;S!==e&&((x=y.current)==null||x.call(y,S))}else g(T)},[E,e,g,y]);return[A,b]}function hA({defaultProp:e,onChange:r}){const[a,s]=B.useState(e),f=B.useRef(a),g=B.useRef(r);return dA(()=>{g.current=r},[r]),B.useEffect(()=>{var y;f.current!==a&&((y=g.current)==null||y.call(g,a),f.current=a)},[a,f]),[a,s,g]}function gA(e){return typeof e=="function"}function ju(e){const r=mA(e),a=B.forwardRef((s,f)=>{const{children:g,...y}=s,E=B.Children.toArray(g),A=E.find(xA);if(A){const b=A.props.children,T=E.map(x=>x===A?B.Children.count(b)>1?B.Children.only(null):B.isValidElement(b)?b.props.children:null:x);return F.jsx(r,{...y,ref:f,children:B.isValidElement(b)?B.cloneElement(b,void 0,T):null})}return F.jsx(r,{...y,ref:f,children:g})});return a.displayName=`${e}.Slot`,a}function mA(e){const r=B.forwardRef((a,s)=>{const{children:f,...g}=a;if(B.isValidElement(f)){const y=vA(f),E=yA(g,f.props);return f.type!==B.Fragment&&(E.ref=s?H0(s,y):y),B.cloneElement(f,E)}return B.Children.count(f)>1?B.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var pA=Symbol("radix.slottable");function xA(e){return B.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pA}function yA(e,r){const a={...r};for(const s in r){const f=e[s],g=r[s];/^on[A-Z]/.test(s)?f&&g?a[s]=(...E)=>{const A=g(...E);return f(...E),A}:f&&(a[s]=f):s==="style"?a[s]={...f,...g}:s==="className"&&(a[s]=[f,g].filter(Boolean).join(" "))}return{...e,...a}}function vA(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var wA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cn=wA.reduce((e,r)=>{const a=ju(`Primitive.${r}`),s=B.forwardRef((f,g)=>{const{asChild:y,...E}=f,A=y?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(A,{...E,ref:g})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function bA(e,r){e&&zx.flushSync(()=>e.dispatchEvent(r))}function Ss(e){const r=B.useRef(e);return B.useEffect(()=>{r.current=e}),B.useMemo(()=>(...a)=>{var s;return(s=r.current)==null?void 0:s.call(r,...a)},[])}function _A(e,r=globalThis==null?void 0:globalThis.document){const a=Ss(e);B.useEffect(()=>{const s=f=>{f.key==="Escape"&&a(f)};return r.addEventListener("keydown",s,{capture:!0}),()=>r.removeEventListener("keydown",s,{capture:!0})},[a,r])}var EA="DismissableLayer",y0="dismissableLayer.update",AA="dismissableLayer.pointerDownOutside",CA="dismissableLayer.focusOutside",Fp,iy=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ay=B.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:y,onDismiss:E,...A}=e,b=B.useContext(iy),[T,x]=B.useState(null),S=(T==null?void 0:T.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=B.useState({}),k=Zn(r,X=>x(X)),I=Array.from(b.layers),[z]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),L=I.indexOf(z),Z=T?I.indexOf(T):-1,H=b.layersWithOutsidePointerEventsDisabled.size>0,j=Z>=L,ae=RA(X=>{const de=X.target,Q=[...b.branches].some(Oe=>Oe.contains(de));!j||Q||(f==null||f(X),y==null||y(X),X.defaultPrevented||E==null||E())},S),ee=NA(X=>{const de=X.target;[...b.branches].some(Oe=>Oe.contains(de))||(g==null||g(X),y==null||y(X),X.defaultPrevented||E==null||E())},S);return _A(X=>{Z===b.layers.size-1&&(s==null||s(X),!X.defaultPrevented&&E&&(X.preventDefault(),E()))},S),B.useEffect(()=>{if(T)return a&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Fp=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(T)),b.layers.add(T),jp(),()=>{a&&b.layersWithOutsidePointerEventsDisabled.size===1&&(S.body.style.pointerEvents=Fp)}},[T,S,a,b]),B.useEffect(()=>()=>{T&&(b.layers.delete(T),b.layersWithOutsidePointerEventsDisabled.delete(T),jp())},[T,b]),B.useEffect(()=>{const X=()=>R({});return document.addEventListener(y0,X),()=>document.removeEventListener(y0,X)},[]),F.jsx(Cn.div,{...A,ref:k,style:{pointerEvents:H?j?"auto":"none":void 0,...e.style},onFocusCapture:tn(e.onFocusCapture,ee.onFocusCapture),onBlurCapture:tn(e.onBlurCapture,ee.onBlurCapture),onPointerDownCapture:tn(e.onPointerDownCapture,ae.onPointerDownCapture)})});ay.displayName=EA;var SA="DismissableLayerBranch",TA=B.forwardRef((e,r)=>{const a=B.useContext(iy),s=B.useRef(null),f=Zn(r,s);return B.useEffect(()=>{const g=s.current;if(g)return a.branches.add(g),()=>{a.branches.delete(g)}},[a.branches]),F.jsx(Cn.div,{...e,ref:f})});TA.displayName=SA;function RA(e,r=globalThis==null?void 0:globalThis.document){const a=Ss(e),s=B.useRef(!1),f=B.useRef(()=>{});return B.useEffect(()=>{const g=E=>{if(E.target&&!s.current){let A=function(){oy(AA,a,b,{discrete:!0})};const b={originalEvent:E};E.pointerType==="touch"?(r.removeEventListener("click",f.current),f.current=A,r.addEventListener("click",f.current,{once:!0})):A()}else r.removeEventListener("click",f.current);s.current=!1},y=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(y),r.removeEventListener("pointerdown",g),r.removeEventListener("click",f.current)}},[r,a]),{onPointerDownCapture:()=>s.current=!0}}function NA(e,r=globalThis==null?void 0:globalThis.document){const a=Ss(e),s=B.useRef(!1);return B.useEffect(()=>{const f=g=>{g.target&&!s.current&&oy(CA,a,{originalEvent:g},{discrete:!1})};return r.addEventListener("focusin",f),()=>r.removeEventListener("focusin",f)},[r,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function jp(){const e=new CustomEvent(y0);document.dispatchEvent(e)}function oy(e,r,a,{discrete:s}){const f=a.originalEvent.target,g=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});r&&f.addEventListener(e,r,{once:!0}),s?bA(f,g):f.dispatchEvent(g)}var Eh="focusScope.autoFocusOnMount",Ah="focusScope.autoFocusOnUnmount",Vp={bubbles:!1,cancelable:!0},OA="FocusScope",sy=B.forwardRef((e,r)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,...y}=e,[E,A]=B.useState(null),b=Ss(f),T=Ss(g),x=B.useRef(null),S=Zn(r,I=>A(I)),R=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(s){let I=function(H){if(R.paused||!E)return;const j=H.target;E.contains(j)?x.current=j:Za(x.current,{select:!0})},z=function(H){if(R.paused||!E)return;const j=H.relatedTarget;j!==null&&(E.contains(j)||Za(x.current,{select:!0}))},L=function(H){if(document.activeElement===document.body)for(const ae of H)ae.removedNodes.length>0&&Za(E)};document.addEventListener("focusin",I),document.addEventListener("focusout",z);const Z=new MutationObserver(L);return E&&Z.observe(E,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",z),Z.disconnect()}}},[s,E,R.paused]),B.useEffect(()=>{if(E){Gp.add(R);const I=document.activeElement;if(!E.contains(I)){const L=new CustomEvent(Eh,Vp);E.addEventListener(Eh,b),E.dispatchEvent(L),L.defaultPrevented||(IA(kA(ly(E)),{select:!0}),document.activeElement===I&&Za(E))}return()=>{E.removeEventListener(Eh,b),setTimeout(()=>{const L=new CustomEvent(Ah,Vp);E.addEventListener(Ah,T),E.dispatchEvent(L),L.defaultPrevented||Za(I??document.body,{select:!0}),E.removeEventListener(Ah,T),Gp.remove(R)},0)}}},[E,b,T,R]);const k=B.useCallback(I=>{if(!a&&!s||R.paused)return;const z=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,L=document.activeElement;if(z&&L){const Z=I.currentTarget,[H,j]=MA(Z);H&&j?!I.shiftKey&&L===j?(I.preventDefault(),a&&Za(H,{select:!0})):I.shiftKey&&L===H&&(I.preventDefault(),a&&Za(j,{select:!0})):L===Z&&I.preventDefault()}},[a,s,R.paused]);return F.jsx(Cn.div,{tabIndex:-1,...y,ref:S,onKeyDown:k})});sy.displayName=OA;function IA(e,{select:r=!1}={}){const a=document.activeElement;for(const s of e)if(Za(s,{select:r}),document.activeElement!==a)return}function MA(e){const r=ly(e),a=Hp(r,e),s=Hp(r.reverse(),e);return[a,s]}function ly(e){const r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const f=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||f?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function Hp(e,r){for(const a of e)if(!DA(a,{upTo:r}))return a}function DA(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function BA(e){return e instanceof HTMLInputElement&&"select"in e}function Za(e,{select:r=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&BA(e)&&r&&e.select()}}var Gp=LA();function LA(){let e=[];return{add(r){const a=e[0];r!==a&&(a==null||a.pause()),e=Zp(e,r),e.unshift(r)},remove(r){var a;e=Zp(e,r),(a=e[0])==null||a.resume()}}}function Zp(e,r){const a=[...e],s=a.indexOf(r);return s!==-1&&a.splice(s,1),a}function kA(e){return e.filter(r=>r.tagName!=="A")}var zA="Portal",cy=B.forwardRef((e,r)=>{var E;const{container:a,...s}=e,[f,g]=B.useState(!1);Cs(()=>g(!0),[]);const y=a||f&&((E=globalThis==null?void 0:globalThis.document)==null?void 0:E.body);return y?v3.createPortal(F.jsx(Cn.div,{...s,ref:r}),y):null});cy.displayName=zA;function PA(e,r){return B.useReducer((a,s)=>r[a][s]??a,e)}var Ql=e=>{const{present:r,children:a}=e,s=UA(r),f=typeof a=="function"?a({present:s.isPresent}):B.Children.only(a),g=Zn(s.ref,FA(f));return typeof a=="function"||s.isPresent?B.cloneElement(f,{ref:g}):null};Ql.displayName="Presence";function UA(e){const[r,a]=B.useState(),s=B.useRef(null),f=B.useRef(e),g=B.useRef("none"),y=e?"mounted":"unmounted",[E,A]=PA(y,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B.useEffect(()=>{const b=wu(s.current);g.current=E==="mounted"?b:"none"},[E]),Cs(()=>{const b=s.current,T=f.current;if(T!==e){const S=g.current,R=wu(b);e?A("MOUNT"):R==="none"||(b==null?void 0:b.display)==="none"?A("UNMOUNT"):A(T&&S!==R?"ANIMATION_OUT":"UNMOUNT"),f.current=e}},[e,A]),Cs(()=>{if(r){let b;const T=r.ownerDocument.defaultView??window,x=R=>{const I=wu(s.current).includes(CSS.escape(R.animationName));if(R.target===r&&I&&(A("ANIMATION_END"),!f.current)){const z=r.style.animationFillMode;r.style.animationFillMode="forwards",b=T.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=z)})}},S=R=>{R.target===r&&(g.current=wu(s.current))};return r.addEventListener("animationstart",S),r.addEventListener("animationcancel",x),r.addEventListener("animationend",x),()=>{T.clearTimeout(b),r.removeEventListener("animationstart",S),r.removeEventListener("animationcancel",x),r.removeEventListener("animationend",x)}}else A("ANIMATION_END")},[r,A]),{isPresent:["mounted","unmountSuspended"].includes(E),ref:B.useCallback(b=>{s.current=b?getComputedStyle(b):null,a(b)},[])}}function wu(e){return(e==null?void 0:e.animationName)||"none"}function FA(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Ch=0;function jA(){B.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xp()),document.body.insertAdjacentElement("beforeend",e[1]??Xp()),Ch++,()=>{Ch===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Ch--}},[])}function Xp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _i=function(){return _i=Object.assign||function(r){for(var a,s=1,f=arguments.length;s<f;s++){a=arguments[s];for(var g in a)Object.prototype.hasOwnProperty.call(a,g)&&(r[g]=a[g])}return r},_i.apply(this,arguments)};function uy(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,s=Object.getOwnPropertySymbols(e);f<s.length;f++)r.indexOf(s[f])<0&&Object.prototype.propertyIsEnumerable.call(e,s[f])&&(a[s[f]]=e[s[f]]);return a}function VA(e,r,a){if(a||arguments.length===2)for(var s=0,f=r.length,g;s<f;s++)(g||!(s in r))&&(g||(g=Array.prototype.slice.call(r,0,s)),g[s]=r[s]);return e.concat(g||Array.prototype.slice.call(r))}var zu="right-scroll-bar-position",Pu="width-before-scroll-bar",HA="with-scroll-bars-hidden",GA="--removed-body-scroll-bar-size";function Sh(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function ZA(e,r){var a=B.useState(function(){return{value:e,callback:r,facade:{get current(){return a.value},set current(s){var f=a.value;f!==s&&(a.value=s,a.callback(s,f))}}}})[0];return a.callback=r,a.facade}var XA=typeof window<"u"?B.useLayoutEffect:B.useEffect,Yp=new WeakMap;function YA(e,r){var a=ZA(null,function(s){return e.forEach(function(f){return Sh(f,s)})});return XA(function(){var s=Yp.get(a);if(s){var f=new Set(s),g=new Set(e),y=a.current;f.forEach(function(E){g.has(E)||Sh(E,null)}),g.forEach(function(E){f.has(E)||Sh(E,y)})}Yp.set(a,e)},[e]),a}function qA(e){return e}function WA(e,r){r===void 0&&(r=qA);var a=[],s=!1,f={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(g){var y=r(g,s);return a.push(y),function(){a=a.filter(function(E){return E!==y})}},assignSyncMedium:function(g){for(s=!0;a.length;){var y=a;a=[],y.forEach(g)}a={push:function(E){return g(E)},filter:function(){return a}}},assignMedium:function(g){s=!0;var y=[];if(a.length){var E=a;a=[],E.forEach(g),y=a}var A=function(){var T=y;y=[],T.forEach(g)},b=function(){return Promise.resolve().then(A)};b(),a={push:function(T){y.push(T),b()},filter:function(T){return y=y.filter(T),a}}}};return f}function KA(e){e===void 0&&(e={});var r=WA(null);return r.options=_i({async:!0,ssr:!1},e),r}var fy=function(e){var r=e.sideCar,a=uy(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=r.read();if(!s)throw new Error("Sidecar medium not found");return B.createElement(s,_i({},a))};fy.isSideCarExport=!0;function QA(e,r){return e.useMedium(r),fy}var dy=KA(),Th=function(){},af=B.forwardRef(function(e,r){var a=B.useRef(null),s=B.useState({onScrollCapture:Th,onWheelCapture:Th,onTouchMoveCapture:Th}),f=s[0],g=s[1],y=e.forwardProps,E=e.children,A=e.className,b=e.removeScrollBar,T=e.enabled,x=e.shards,S=e.sideCar,R=e.noRelative,k=e.noIsolation,I=e.inert,z=e.allowPinchZoom,L=e.as,Z=L===void 0?"div":L,H=e.gapMode,j=uy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),ae=S,ee=YA([a,r]),X=_i(_i({},j),f);return B.createElement(B.Fragment,null,T&&B.createElement(ae,{sideCar:dy,removeScrollBar:b,shards:x,noRelative:R,noIsolation:k,inert:I,setCallbacks:g,allowPinchZoom:!!z,lockRef:a,gapMode:H}),y?B.cloneElement(B.Children.only(E),_i(_i({},X),{ref:ee})):B.createElement(Z,_i({},X,{className:A,ref:ee}),E))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:Pu,zeroRight:zu};var JA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $A(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=JA();return r&&e.setAttribute("nonce",r),e}function eC(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function tC(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var nC=function(){var e=0,r=null;return{add:function(a){e==0&&(r=$A())&&(eC(r,a),tC(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},rC=function(){var e=nC();return function(r,a){B.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&a])}},hy=function(){var e=rC(),r=function(a){var s=a.styles,f=a.dynamic;return e(s,f),null};return r},iC={left:0,top:0,right:0,gap:0},Rh=function(e){return parseInt(e||"",10)||0},aC=function(e){var r=window.getComputedStyle(document.body),a=r[e==="padding"?"paddingLeft":"marginLeft"],s=r[e==="padding"?"paddingTop":"marginTop"],f=r[e==="padding"?"paddingRight":"marginRight"];return[Rh(a),Rh(s),Rh(f)]},oC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iC;var r=aC(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,s-a+r[2]-r[0])}},sC=hy(),bs="data-scroll-locked",lC=function(e,r,a,s){var f=e.left,g=e.top,y=e.right,E=e.gap;return a===void 0&&(a="margin"),`
|
|
179
|
+
.`.concat(HA,` {
|
|
180
|
+
overflow: hidden `).concat(s,`;
|
|
181
|
+
padding-right: `).concat(E,"px ").concat(s,`;
|
|
182
|
+
}
|
|
183
|
+
body[`).concat(bs,`] {
|
|
184
|
+
overflow: hidden `).concat(s,`;
|
|
185
|
+
overscroll-behavior: contain;
|
|
186
|
+
`).concat([r&&"position: relative ".concat(s,";"),a==="margin"&&`
|
|
187
|
+
padding-left: `.concat(f,`px;
|
|
188
|
+
padding-top: `).concat(g,`px;
|
|
189
|
+
padding-right: `).concat(y,`px;
|
|
190
|
+
margin-left:0;
|
|
191
|
+
margin-top:0;
|
|
192
|
+
margin-right: `).concat(E,"px ").concat(s,`;
|
|
193
|
+
`),a==="padding"&&"padding-right: ".concat(E,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.`).concat(zu,` {
|
|
197
|
+
right: `).concat(E,"px ").concat(s,`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.`).concat(Pu,` {
|
|
201
|
+
margin-right: `).concat(E,"px ").concat(s,`;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.`).concat(zu," .").concat(zu,` {
|
|
205
|
+
right: 0 `).concat(s,`;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.`).concat(Pu," .").concat(Pu,` {
|
|
209
|
+
margin-right: 0 `).concat(s,`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
body[`).concat(bs,`] {
|
|
213
|
+
`).concat(GA,": ").concat(E,`px;
|
|
214
|
+
}
|
|
215
|
+
`)},qp=function(){var e=parseInt(document.body.getAttribute(bs)||"0",10);return isFinite(e)?e:0},cC=function(){B.useEffect(function(){return document.body.setAttribute(bs,(qp()+1).toString()),function(){var e=qp()-1;e<=0?document.body.removeAttribute(bs):document.body.setAttribute(bs,e.toString())}},[])},uC=function(e){var r=e.noRelative,a=e.noImportant,s=e.gapMode,f=s===void 0?"margin":s;cC();var g=B.useMemo(function(){return oC(f)},[f]);return B.createElement(sC,{styles:lC(g,!r,f,a?"":"!important")})},v0=!1;if(typeof window<"u")try{var bu=Object.defineProperty({},"passive",{get:function(){return v0=!0,!0}});window.addEventListener("test",bu,bu),window.removeEventListener("test",bu,bu)}catch{v0=!1}var hs=v0?{passive:!1}:!1,fC=function(e){return e.tagName==="TEXTAREA"},gy=function(e,r){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!fC(e)&&a[r]==="visible")},dC=function(e){return gy(e,"overflowY")},hC=function(e){return gy(e,"overflowX")},Wp=function(e,r){var a=r.ownerDocument,s=r;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var f=my(e,s);if(f){var g=py(e,s),y=g[1],E=g[2];if(y>E)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},gC=function(e){var r=e.scrollTop,a=e.scrollHeight,s=e.clientHeight;return[r,a,s]},mC=function(e){var r=e.scrollLeft,a=e.scrollWidth,s=e.clientWidth;return[r,a,s]},my=function(e,r){return e==="v"?dC(r):hC(r)},py=function(e,r){return e==="v"?gC(r):mC(r)},pC=function(e,r){return e==="h"&&r==="rtl"?-1:1},xC=function(e,r,a,s,f){var g=pC(e,window.getComputedStyle(r).direction),y=g*s,E=a.target,A=r.contains(E),b=!1,T=y>0,x=0,S=0;do{if(!E)break;var R=py(e,E),k=R[0],I=R[1],z=R[2],L=I-z-g*k;(k||L)&&my(e,E)&&(x+=L,S+=k);var Z=E.parentNode;E=Z&&Z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Z.host:Z}while(!A&&E!==document.body||A&&(r.contains(E)||r===E));return(T&&Math.abs(x)<1||!T&&Math.abs(S)<1)&&(b=!0),b},_u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kp=function(e){return[e.deltaX,e.deltaY]},Qp=function(e){return e&&"current"in e?e.current:e},yC=function(e,r){return e[0]===r[0]&&e[1]===r[1]},vC=function(e){return`
|
|
216
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
217
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
218
|
+
`)},wC=0,gs=[];function bC(e){var r=B.useRef([]),a=B.useRef([0,0]),s=B.useRef(),f=B.useState(wC++)[0],g=B.useState(hy)[0],y=B.useRef(e);B.useEffect(function(){y.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(f));var I=VA([e.lockRef.current],(e.shards||[]).map(Qp),!0).filter(Boolean);return I.forEach(function(z){return z.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),I.forEach(function(z){return z.classList.remove("allow-interactivity-".concat(f))})}}},[e.inert,e.lockRef.current,e.shards]);var E=B.useCallback(function(I,z){if("touches"in I&&I.touches.length===2||I.type==="wheel"&&I.ctrlKey)return!y.current.allowPinchZoom;var L=_u(I),Z=a.current,H="deltaX"in I?I.deltaX:Z[0]-L[0],j="deltaY"in I?I.deltaY:Z[1]-L[1],ae,ee=I.target,X=Math.abs(H)>Math.abs(j)?"h":"v";if("touches"in I&&X==="h"&&ee.type==="range")return!1;var de=Wp(X,ee);if(!de)return!0;if(de?ae=X:(ae=X==="v"?"h":"v",de=Wp(X,ee)),!de)return!1;if(!s.current&&"changedTouches"in I&&(H||j)&&(s.current=ae),!ae)return!0;var Q=s.current||ae;return xC(Q,z,I,Q==="h"?H:j)},[]),A=B.useCallback(function(I){var z=I;if(!(!gs.length||gs[gs.length-1]!==g)){var L="deltaY"in z?Kp(z):_u(z),Z=r.current.filter(function(ae){return ae.name===z.type&&(ae.target===z.target||z.target===ae.shadowParent)&&yC(ae.delta,L)})[0];if(Z&&Z.should){z.cancelable&&z.preventDefault();return}if(!Z){var H=(y.current.shards||[]).map(Qp).filter(Boolean).filter(function(ae){return ae.contains(z.target)}),j=H.length>0?E(z,H[0]):!y.current.noIsolation;j&&z.cancelable&&z.preventDefault()}}},[]),b=B.useCallback(function(I,z,L,Z){var H={name:I,delta:z,target:L,should:Z,shadowParent:_C(L)};r.current.push(H),setTimeout(function(){r.current=r.current.filter(function(j){return j!==H})},1)},[]),T=B.useCallback(function(I){a.current=_u(I),s.current=void 0},[]),x=B.useCallback(function(I){b(I.type,Kp(I),I.target,E(I,e.lockRef.current))},[]),S=B.useCallback(function(I){b(I.type,_u(I),I.target,E(I,e.lockRef.current))},[]);B.useEffect(function(){return gs.push(g),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:S}),document.addEventListener("wheel",A,hs),document.addEventListener("touchmove",A,hs),document.addEventListener("touchstart",T,hs),function(){gs=gs.filter(function(I){return I!==g}),document.removeEventListener("wheel",A,hs),document.removeEventListener("touchmove",A,hs),document.removeEventListener("touchstart",T,hs)}},[]);var R=e.removeScrollBar,k=e.inert;return B.createElement(B.Fragment,null,k?B.createElement(g,{styles:vC(f)}):null,R?B.createElement(uC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _C(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const EC=QA(dy,bC);var xy=B.forwardRef(function(e,r){return B.createElement(af,_i({},e,{ref:r,sideCar:EC}))});xy.classNames=af.classNames;var AC=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},ms=new WeakMap,Eu=new WeakMap,Au={},Nh=0,yy=function(e){return e&&(e.host||yy(e.parentNode))},CC=function(e,r){return r.map(function(a){if(e.contains(a))return a;var s=yy(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},SC=function(e,r,a,s){var f=CC(r,Array.isArray(e)?e:[e]);Au[a]||(Au[a]=new WeakMap);var g=Au[a],y=[],E=new Set,A=new Set(f),b=function(x){!x||E.has(x)||(E.add(x),b(x.parentNode))};f.forEach(b);var T=function(x){!x||A.has(x)||Array.prototype.forEach.call(x.children,function(S){if(E.has(S))T(S);else try{var R=S.getAttribute(s),k=R!==null&&R!=="false",I=(ms.get(S)||0)+1,z=(g.get(S)||0)+1;ms.set(S,I),g.set(S,z),y.push(S),I===1&&k&&Eu.set(S,!0),z===1&&S.setAttribute(a,"true"),k||S.setAttribute(s,"true")}catch(L){console.error("aria-hidden: cannot operate on ",S,L)}})};return T(r),E.clear(),Nh++,function(){y.forEach(function(x){var S=ms.get(x)-1,R=g.get(x)-1;ms.set(x,S),g.set(x,R),S||(Eu.has(x)||x.removeAttribute(s),Eu.delete(x)),R||x.removeAttribute(a)}),Nh--,Nh||(ms=new WeakMap,ms=new WeakMap,Eu=new WeakMap,Au={})}},TC=function(e,r,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),f=AC(e);return f?(s.push.apply(s,Array.from(f.querySelectorAll("[aria-live], script"))),SC(s,f,a,"aria-hidden")):function(){return null}},of="Dialog",[vy]=Kl(of),[RC,li]=vy(of),wy=e=>{const{__scopeDialog:r,children:a,open:s,defaultOpen:f,onOpenChange:g,modal:y=!0}=e,E=B.useRef(null),A=B.useRef(null),[b,T]=rf({prop:s,defaultProp:f??!1,onChange:g,caller:of});return F.jsx(RC,{scope:r,triggerRef:E,contentRef:A,contentId:Fl(),titleId:Fl(),descriptionId:Fl(),open:b,onOpenChange:T,onOpenToggle:B.useCallback(()=>T(x=>!x),[T]),modal:y,children:a})};wy.displayName=of;var by="DialogTrigger",NC=B.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=li(by,a),g=Zn(r,f.triggerRef);return F.jsx(Cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.contentId,"data-state":X0(f.open),...s,ref:g,onClick:tn(e.onClick,f.onOpenToggle)})});NC.displayName=by;var G0="DialogPortal",[OC,_y]=vy(G0,{forceMount:void 0}),Ey=e=>{const{__scopeDialog:r,forceMount:a,children:s,container:f}=e,g=li(G0,r);return F.jsx(OC,{scope:r,forceMount:a,children:B.Children.map(s,y=>F.jsx(Ql,{present:a||g.open,children:F.jsx(cy,{asChild:!0,container:f,children:y})}))})};Ey.displayName=G0;var Vu="DialogOverlay",Ay=B.forwardRef((e,r)=>{const a=_y(Vu,e.__scopeDialog),{forceMount:s=a.forceMount,...f}=e,g=li(Vu,e.__scopeDialog);return g.modal?F.jsx(Ql,{present:s||g.open,children:F.jsx(MC,{...f,ref:r})}):null});Ay.displayName=Vu;var IC=ju("DialogOverlay.RemoveScroll"),MC=B.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=li(Vu,a);return F.jsx(xy,{as:IC,allowPinchZoom:!0,shards:[f.contentRef],children:F.jsx(Cn.div,{"data-state":X0(f.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),_o="DialogContent",Cy=B.forwardRef((e,r)=>{const a=_y(_o,e.__scopeDialog),{forceMount:s=a.forceMount,...f}=e,g=li(_o,e.__scopeDialog);return F.jsx(Ql,{present:s||g.open,children:g.modal?F.jsx(DC,{...f,ref:r}):F.jsx(BC,{...f,ref:r})})});Cy.displayName=_o;var DC=B.forwardRef((e,r)=>{const a=li(_o,e.__scopeDialog),s=B.useRef(null),f=Zn(r,a.contentRef,s);return B.useEffect(()=>{const g=s.current;if(g)return TC(g)},[]),F.jsx(Sy,{...e,ref:f,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tn(e.onCloseAutoFocus,g=>{var y;g.preventDefault(),(y=a.triggerRef.current)==null||y.focus()}),onPointerDownOutside:tn(e.onPointerDownOutside,g=>{const y=g.detail.originalEvent,E=y.button===0&&y.ctrlKey===!0;(y.button===2||E)&&g.preventDefault()}),onFocusOutside:tn(e.onFocusOutside,g=>g.preventDefault())})}),BC=B.forwardRef((e,r)=>{const a=li(_o,e.__scopeDialog),s=B.useRef(!1),f=B.useRef(!1);return F.jsx(Sy,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:g=>{var y,E;(y=e.onCloseAutoFocus)==null||y.call(e,g),g.defaultPrevented||(s.current||(E=a.triggerRef.current)==null||E.focus(),g.preventDefault()),s.current=!1,f.current=!1},onInteractOutside:g=>{var A,b;(A=e.onInteractOutside)==null||A.call(e,g),g.defaultPrevented||(s.current=!0,g.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const y=g.target;((b=a.triggerRef.current)==null?void 0:b.contains(y))&&g.preventDefault(),g.detail.originalEvent.type==="focusin"&&f.current&&g.preventDefault()}})}),Sy=B.forwardRef((e,r)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:f,onCloseAutoFocus:g,...y}=e,E=li(_o,a),A=B.useRef(null),b=Zn(r,A);return jA(),F.jsxs(F.Fragment,{children:[F.jsx(sy,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:f,onUnmountAutoFocus:g,children:F.jsx(ay,{role:"dialog",id:E.contentId,"aria-describedby":E.descriptionId,"aria-labelledby":E.titleId,"data-state":X0(E.open),...y,ref:b,onDismiss:()=>E.onOpenChange(!1)})}),F.jsxs(F.Fragment,{children:[F.jsx(LC,{titleId:E.titleId}),F.jsx(zC,{contentRef:A,descriptionId:E.descriptionId})]})]})}),Z0="DialogTitle",Ty=B.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=li(Z0,a);return F.jsx(Cn.h2,{id:f.titleId,...s,ref:r})});Ty.displayName=Z0;var Ry="DialogDescription",Ny=B.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=li(Ry,a);return F.jsx(Cn.p,{id:f.descriptionId,...s,ref:r})});Ny.displayName=Ry;var Oy="DialogClose",Iy=B.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=li(Oy,a);return F.jsx(Cn.button,{type:"button",...s,ref:r,onClick:tn(e.onClick,()=>f.onOpenChange(!1))})});Iy.displayName=Oy;function X0(e){return e?"open":"closed"}var My="DialogTitleWarning",[M5,Dy]=lA(My,{contentName:_o,titleName:Z0,docsSlug:"dialog"}),LC=({titleId:e})=>{const r=Dy(My),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
219
|
+
|
|
220
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
221
|
+
|
|
222
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return B.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},kC="DialogDescriptionWarning",zC=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dy(kC).contentName}}.`;return B.useEffect(()=>{var g;const f=(g=e.current)==null?void 0:g.getAttribute("aria-describedby");r&&f&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},PC=wy,UC=Ey,By=Ay,Ly=Cy,ky=Ty,zy=Ny,FC=Iy;function Py(e){var r,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var f=e.length;for(r=0;r<f;r++)e[r]&&(a=Py(e[r]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function Uy(){for(var e,r,a=0,s="",f=arguments.length;a<f;a++)(e=arguments[a])&&(r=Py(e))&&(s&&(s+=" "),s+=r);return s}const Y0="-",jC=e=>{const r=HC(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:y=>{const E=y.split(Y0);return E[0]===""&&E.length!==1&&E.shift(),Fy(E,r)||VC(y)},getConflictingClassGroupIds:(y,E)=>{const A=a[y]||[];return E&&s[y]?[...A,...s[y]]:A}}},Fy=(e,r)=>{var y;if(e.length===0)return r.classGroupId;const a=e[0],s=r.nextPart.get(a),f=s?Fy(e.slice(1),s):void 0;if(f)return f;if(r.validators.length===0)return;const g=e.join(Y0);return(y=r.validators.find(({validator:E})=>E(g)))==null?void 0:y.classGroupId},Jp=/^\[(.+)\]$/,VC=e=>{if(Jp.test(e)){const r=Jp.exec(e)[1],a=r==null?void 0:r.substring(0,r.indexOf(":"));if(a)return"arbitrary.."+a}},HC=e=>{const{theme:r,prefix:a}=e,s={nextPart:new Map,validators:[]};return ZC(Object.entries(e.classGroups),a).forEach(([g,y])=>{w0(y,s,g,r)}),s},w0=(e,r,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const g=f===""?r:$p(r,f);g.classGroupId=a;return}if(typeof f=="function"){if(GC(f)){w0(f(s),r,a,s);return}r.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([g,y])=>{w0(y,$p(r,g),a,s)})})},$p=(e,r)=>{let a=e;return r.split(Y0).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},GC=e=>e.isThemeGetter,ZC=(e,r)=>r?e.map(([a,s])=>{const f=s.map(g=>typeof g=="string"?r+g:typeof g=="object"?Object.fromEntries(Object.entries(g).map(([y,E])=>[r+y,E])):g);return[a,f]}):e,XC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,a=new Map,s=new Map;const f=(g,y)=>{a.set(g,y),r++,r>e&&(r=0,s=a,a=new Map)};return{get(g){let y=a.get(g);if(y!==void 0)return y;if((y=s.get(g))!==void 0)return f(g,y),y},set(g,y){a.has(g)?a.set(g,y):f(g,y)}}},jy="!",YC=e=>{const{separator:r,experimentalParseClassName:a}=e,s=r.length===1,f=r[0],g=r.length,y=E=>{const A=[];let b=0,T=0,x;for(let z=0;z<E.length;z++){let L=E[z];if(b===0){if(L===f&&(s||E.slice(z,z+g)===r)){A.push(E.slice(T,z)),T=z+g;continue}if(L==="/"){x=z;continue}}L==="["?b++:L==="]"&&b--}const S=A.length===0?E:E.substring(T),R=S.startsWith(jy),k=R?S.substring(1):S,I=x&&x>T?x-T:void 0;return{modifiers:A,hasImportantModifier:R,baseClassName:k,maybePostfixModifierPosition:I}};return a?E=>a({className:E,parseClassName:y}):y},qC=e=>{if(e.length<=1)return e;const r=[];let a=[];return e.forEach(s=>{s[0]==="["?(r.push(...a.sort(),s),a=[]):a.push(s)}),r.push(...a.sort()),r},WC=e=>({cache:XC(e.cacheSize),parseClassName:YC(e),...jC(e)}),KC=/\s+/,QC=(e,r)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=r,g=[],y=e.trim().split(KC);let E="";for(let A=y.length-1;A>=0;A-=1){const b=y[A],{modifiers:T,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:R}=a(b);let k=!!R,I=s(k?S.substring(0,R):S);if(!I){if(!k){E=b+(E.length>0?" "+E:E);continue}if(I=s(S),!I){E=b+(E.length>0?" "+E:E);continue}k=!1}const z=qC(T).join(":"),L=x?z+jy:z,Z=L+I;if(g.includes(Z))continue;g.push(Z);const H=f(I,k);for(let j=0;j<H.length;++j){const ae=H[j];g.push(L+ae)}E=b+(E.length>0?" "+E:E)}return E};function JC(){let e=0,r,a,s="";for(;e<arguments.length;)(r=arguments[e++])&&(a=Vy(r))&&(s&&(s+=" "),s+=a);return s}const Vy=e=>{if(typeof e=="string")return e;let r,a="";for(let s=0;s<e.length;s++)e[s]&&(r=Vy(e[s]))&&(a&&(a+=" "),a+=r);return a};function $C(e,...r){let a,s,f,g=y;function y(A){const b=r.reduce((T,x)=>x(T),e());return a=WC(b),s=a.cache.get,f=a.cache.set,g=E,E(A)}function E(A){const b=s(A);if(b)return b;const T=QC(A,a);return f(A,T),T}return function(){return g(JC.apply(null,arguments))}}const Yt=e=>{const r=a=>a[e]||[];return r.isThemeGetter=!0,r},Hy=/^\[(?:([a-z-]+):)?(.+)\]$/i,eS=/^\d+\/\d+$/,tS=new Set(["px","full","screen"]),nS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,iS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,aS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wi=e=>_s(e)||tS.has(e)||eS.test(e),Fa=e=>Is(e,"length",gS),_s=e=>!!e&&!Number.isNaN(Number(e)),Oh=e=>Is(e,"number",_s),Il=e=>!!e&&Number.isInteger(Number(e)),sS=e=>e.endsWith("%")&&_s(e.slice(0,-1)),rt=e=>Hy.test(e),ja=e=>nS.test(e),lS=new Set(["length","size","percentage"]),cS=e=>Is(e,lS,Gy),uS=e=>Is(e,"position",Gy),fS=new Set(["image","url"]),dS=e=>Is(e,fS,pS),hS=e=>Is(e,"",mS),Ml=()=>!0,Is=(e,r,a)=>{const s=Hy.exec(e);return s?s[1]?typeof r=="string"?s[1]===r:r.has(s[1]):a(s[2]):!1},gS=e=>rS.test(e)&&!iS.test(e),Gy=()=>!1,mS=e=>aS.test(e),pS=e=>oS.test(e),xS=()=>{const e=Yt("colors"),r=Yt("spacing"),a=Yt("blur"),s=Yt("brightness"),f=Yt("borderColor"),g=Yt("borderRadius"),y=Yt("borderSpacing"),E=Yt("borderWidth"),A=Yt("contrast"),b=Yt("grayscale"),T=Yt("hueRotate"),x=Yt("invert"),S=Yt("gap"),R=Yt("gradientColorStops"),k=Yt("gradientColorStopPositions"),I=Yt("inset"),z=Yt("margin"),L=Yt("opacity"),Z=Yt("padding"),H=Yt("saturate"),j=Yt("scale"),ae=Yt("sepia"),ee=Yt("skew"),X=Yt("space"),de=Yt("translate"),Q=()=>["auto","contain","none"],Oe=()=>["auto","hidden","clip","visible","scroll"],ue=()=>["auto",rt,r],$=()=>[rt,r],pe=()=>["",Wi,Fa],Ce=()=>["auto",_s,rt],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ne=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>["start","end","center","between","around","evenly","stretch"],He=()=>["","0",rt],Ye=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[_s,rt];return{cacheSize:500,separator:":",theme:{colors:[Ml],spacing:[Wi,Fa],blur:["none","",ja,rt],brightness:W(),borderColor:[e],borderRadius:["none","","full",ja,rt],borderSpacing:$(),borderWidth:pe(),contrast:W(),grayscale:He(),hueRotate:W(),invert:He(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[sS,Fa],inset:ue(),margin:ue(),opacity:W(),padding:$(),saturate:W(),scale:W(),sepia:He(),skew:W(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",rt]}],container:["container"],columns:[{columns:[ja]}],"break-after":[{"break-after":Ye()}],"break-before":[{"break-before":Ye()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),rt]}],overflow:[{overflow:Oe()}],"overflow-x":[{"overflow-x":Oe()}],"overflow-y":[{"overflow-y":Oe()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[I]}],"inset-x":[{"inset-x":[I]}],"inset-y":[{"inset-y":[I]}],start:[{start:[I]}],end:[{end:[I]}],top:[{top:[I]}],right:[{right:[I]}],bottom:[{bottom:[I]}],left:[{left:[I]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Il,rt]}],basis:[{basis:ue()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",rt]}],grow:[{grow:He()}],shrink:[{shrink:He()}],order:[{order:["first","last","none",Il,rt]}],"grid-cols":[{"grid-cols":[Ml]}],"col-start-end":[{col:["auto",{span:["full",Il,rt]},rt]}],"col-start":[{"col-start":Ce()}],"col-end":[{"col-end":Ce()}],"grid-rows":[{"grid-rows":[Ml]}],"row-start-end":[{row:["auto",{span:[Il,rt]},rt]}],"row-start":[{"row-start":Ce()}],"row-end":[{"row-end":Ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",rt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",rt]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...Me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[Z]}],px:[{px:[Z]}],py:[{py:[Z]}],ps:[{ps:[Z]}],pe:[{pe:[Z]}],pt:[{pt:[Z]}],pr:[{pr:[Z]}],pb:[{pb:[Z]}],pl:[{pl:[Z]}],m:[{m:[z]}],mx:[{mx:[z]}],my:[{my:[z]}],ms:[{ms:[z]}],me:[{me:[z]}],mt:[{mt:[z]}],mr:[{mr:[z]}],mb:[{mb:[z]}],ml:[{ml:[z]}],"space-x":[{"space-x":[X]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[X]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",rt,r]}],"min-w":[{"min-w":[rt,r,"min","max","fit"]}],"max-w":[{"max-w":[rt,r,"none","full","min","max","fit","prose",{screen:[ja]},ja]}],h:[{h:[rt,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[rt,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[rt,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[rt,r,"auto","min","max","fit"]}],"font-size":[{text:["base",ja,Fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oh]}],"font-family":[{font:[Ml]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",rt]}],"line-clamp":[{"line-clamp":["none",_s,Oh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wi,rt]}],"list-image":[{"list-image":["none",rt]}],"list-style-type":[{list:["none","disc","decimal",rt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[L]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wi,Fa]}],"underline-offset":[{"underline-offset":["auto",Wi,rt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",rt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[L]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),uS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dS]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[g]}],"rounded-s":[{"rounded-s":[g]}],"rounded-e":[{"rounded-e":[g]}],"rounded-t":[{"rounded-t":[g]}],"rounded-r":[{"rounded-r":[g]}],"rounded-b":[{"rounded-b":[g]}],"rounded-l":[{"rounded-l":[g]}],"rounded-ss":[{"rounded-ss":[g]}],"rounded-se":[{"rounded-se":[g]}],"rounded-ee":[{"rounded-ee":[g]}],"rounded-es":[{"rounded-es":[g]}],"rounded-tl":[{"rounded-tl":[g]}],"rounded-tr":[{"rounded-tr":[g]}],"rounded-br":[{"rounded-br":[g]}],"rounded-bl":[{"rounded-bl":[g]}],"border-w":[{border:[E]}],"border-w-x":[{"border-x":[E]}],"border-w-y":[{"border-y":[E]}],"border-w-s":[{"border-s":[E]}],"border-w-e":[{"border-e":[E]}],"border-w-t":[{"border-t":[E]}],"border-w-r":[{"border-r":[E]}],"border-w-b":[{"border-b":[E]}],"border-w-l":[{"border-l":[E]}],"border-opacity":[{"border-opacity":[L]}],"border-style":[{border:[...ne(),"hidden"]}],"divide-x":[{"divide-x":[E]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[E]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[L]}],"divide-style":[{divide:ne()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...ne()]}],"outline-offset":[{"outline-offset":[Wi,rt]}],"outline-w":[{outline:[Wi,Fa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[L]}],"ring-offset-w":[{"ring-offset":[Wi,Fa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ja,hS]}],"shadow-color":[{shadow:[Ml]}],opacity:[{opacity:[L]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[A]}],"drop-shadow":[{"drop-shadow":["","none",ja,rt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[T]}],invert:[{invert:[x]}],saturate:[{saturate:[H]}],sepia:[{sepia:[ae]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[A]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[T]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[L]}],"backdrop-saturate":[{"backdrop-saturate":[H]}],"backdrop-sepia":[{"backdrop-sepia":[ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[y]}],"border-spacing-x":[{"border-spacing-x":[y]}],"border-spacing-y":[{"border-spacing-y":[y]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",rt]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",rt]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",rt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Il,rt]}],"translate-x":[{"translate-x":[de]}],"translate-y":[{"translate-y":[de]}],"skew-x":[{"skew-x":[ee]}],"skew-y":[{"skew-y":[ee]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",rt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",rt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",rt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wi,Fa,Oh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},yS=$C(xS),Wt=(...e)=>yS(Uy(e)),vS=PC,wS=UC,Zy=B.forwardRef(({className:e,...r},a)=>F.jsx(By,{ref:a,className:Wt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-99999 bg-black/80",e),...r}));Zy.displayName=By.displayName;const Xy=B.forwardRef(({className:e,children:r,...a},s)=>F.jsx(wS,{children:F.jsxs("div",{className:"dark",children:[F.jsx(Zy,{}),F.jsxs(Ly,{ref:s,className:Wt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-99999 w-full translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-white p-6 shadow-lg duration-200",e),...a,children:[r,F.jsxs(FC,{className:"text-foreground ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[F.jsx(sA,{className:"h-4 w-4"}),F.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));Xy.displayName=Ly.displayName;const Yy=({className:e,...r})=>F.jsx("div",{className:Wt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Yy.displayName="DialogHeader";const qy=B.forwardRef(({className:e,...r},a)=>F.jsx(ky,{ref:a,className:Wt("text-lg leading-none font-semibold tracking-tight",e),...r}));qy.displayName=ky.displayName;const bS=B.forwardRef(({className:e,...r},a)=>F.jsx(zy,{ref:a,className:Wt("text-muted-foreground text-sm",e),...r}));bS.displayName=zy.displayName;const _S=({isOpen:e,onClose:r,getState:a,title:s="Debug State",updateInterval:f=100})=>{const[g,y]=B.useState(()=>a());B.useEffect(()=>{if(!e)return;const A=setInterval(()=>{y(a())},f),b=setTimeout(()=>{y(a())},0);return()=>{clearInterval(A),clearTimeout(b)}},[e,a,f]);const E=JSON.stringify(g,null,2);return F.jsx(vS,{open:e,onOpenChange:r,children:F.jsxs(Xy,{className:"flex max-h-[90vh] max-w-4xl flex-col",children:[F.jsx(Yy,{children:F.jsx(qy,{children:s})}),F.jsx("div",{className:"flex-1 overflow-auto pt-4",children:F.jsx("pre",{className:"bg-muted text-muted-foreground overflow-auto rounded-lg border p-4 font-mono text-xs",children:E})})]})})};var ES=Symbol.for("react.lazy"),Hu=I0[" use ".trim().toString()];function AS(e){return typeof e=="object"&&e!==null&&"then"in e}function Wy(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ES&&"_payload"in e&&AS(e._payload)}function CS(e){const r=SS(e),a=B.forwardRef((s,f)=>{let{children:g,...y}=s;Wy(g)&&typeof Hu=="function"&&(g=Hu(g._payload));const E=B.Children.toArray(g),A=E.find(RS);if(A){const b=A.props.children,T=E.map(x=>x===A?B.Children.count(b)>1?B.Children.only(null):B.isValidElement(b)?b.props.children:null:x);return F.jsx(r,{...y,ref:f,children:B.isValidElement(b)?B.cloneElement(b,void 0,T):null})}return F.jsx(r,{...y,ref:f,children:g})});return a.displayName=`${e}.Slot`,a}var Ky=CS("Slot");function SS(e){const r=B.forwardRef((a,s)=>{let{children:f,...g}=a;if(Wy(f)&&typeof Hu=="function"&&(f=Hu(f._payload)),B.isValidElement(f)){const y=OS(f),E=NS(g,f.props);return f.type!==B.Fragment&&(E.ref=s?H0(s,y):y),B.cloneElement(f,E)}return B.Children.count(f)>1?B.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var TS=Symbol("radix.slottable");function RS(e){return B.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TS}function NS(e,r){const a={...r};for(const s in r){const f=e[s],g=r[s];/^on[A-Z]/.test(s)?f&&g?a[s]=(...E)=>{const A=g(...E);return f(...E),A}:f&&(a[s]=f):s==="style"?a[s]={...f,...g}:s==="className"&&(a[s]=[f,g].filter(Boolean).join(" "))}return{...e,...a}}function OS(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}const e2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,t2=Uy,q0=(e,r)=>a=>{var s;if((r==null?void 0:r.variants)==null)return t2(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:g}=r,y=Object.keys(f).map(b=>{const T=a==null?void 0:a[b],x=g==null?void 0:g[b];if(T===null)return null;const S=e2(T)||e2(x);return f[b][S]}),E=a&&Object.entries(a).reduce((b,T)=>{let[x,S]=T;return S===void 0||(b[x]=S),b},{}),A=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((b,T)=>{let{class:x,className:S,...R}=T;return Object.entries(R).every(k=>{let[I,z]=k;return Array.isArray(z)?z.includes({...g,...E}[I]):{...g,...E}[I]===z})?[...b,x,S]:b},[]);return t2(e,y,A,a==null?void 0:a.class,a==null?void 0:a.className)},IS=q0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Yr({className:e,variant:r,size:a,asChild:s=!1,...f}){const g=s?Ky:"button";return F.jsx(g,{"data-slot":"button",className:Wt(IS({variant:r,size:a,className:e})),...f})}const Qy=({state:e,title:r="Debug State",updateInterval:a=100,className:s})=>{const[f,g]=B.useState(!1),[y,E]=B.useState(e);return B.useEffect(()=>{if(!f)return;const A=setInterval(()=>{E(e)},a);return E(e),()=>clearInterval(A)},[f,e,a]),F.jsxs(F.Fragment,{children:[F.jsx(Yr,{type:"button",variant:"ghost",size:"icon",onClick:()=>g(!0),"aria-label":"Debug state",title:r,className:`text-white hover:bg-white/20 hover:text-white ${s||""}`,children:F.jsx(BE,{className:"h-4 w-4"})}),F.jsx(_S,{isOpen:f,onClose:()=>g(!1),getState:()=>y,title:r,updateInterval:a})]})};var ps={},Ih,n2;function MS(){return n2||(n2=1,Ih=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ih}var Mh={},Va={},r2;function Ao(){if(r2)return Va;r2=1;let e;const 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];return Va.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},Va.getSymbolTotalCodewords=function(s){return r[s]},Va.getBCHDigit=function(a){let s=0;for(;a!==0;)s++,a>>>=1;return s},Va.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');e=s},Va.isKanjiModeEnabled=function(){return typeof e<"u"},Va.toSJIS=function(s){return e(s)},Va}var Dh={},i2;function W0(){return i2||(i2=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function r(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.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: "+a)}}e.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},e.from=function(s,f){if(e.isValid(s))return s;try{return r(s)}catch{return f}}})(Dh)),Dh}var Bh,a2;function DS(){if(a2)return Bh;a2=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(r){const a=Math.floor(r/8);return(this.buffer[a]>>>7-r%8&1)===1},put:function(r,a){for(let s=0;s<a;s++)this.putBit((r>>>a-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),r&&(this.buffer[a]|=128>>>this.length%8),this.length++}},Bh=e,Bh}var Lh,o2;function BS(){if(o2)return Lh;o2=1;function e(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return e.prototype.set=function(r,a,s,f){const g=r*this.size+a;this.data[g]=s,f&&(this.reservedBit[g]=!0)},e.prototype.get=function(r,a){return this.data[r*this.size+a]},e.prototype.xor=function(r,a,s){this.data[r*this.size+a]^=s},e.prototype.isReserved=function(r,a){return this.reservedBit[r*this.size+a]},Lh=e,Lh}var kh={},s2;function LS(){return s2||(s2=1,(function(e){const r=Ao().getSymbolSize;e.getRowColCoords=function(s){if(s===1)return[];const f=Math.floor(s/7)+2,g=r(s),y=g===145?26:Math.ceil((g-13)/(2*f-2))*2,E=[g-7];for(let A=1;A<f-1;A++)E[A]=E[A-1]-y;return E.push(6),E.reverse()},e.getPositions=function(s){const f=[],g=e.getRowColCoords(s),y=g.length;for(let E=0;E<y;E++)for(let A=0;A<y;A++)E===0&&A===0||E===0&&A===y-1||E===y-1&&A===0||f.push([g[E],g[A]]);return f}})(kh)),kh}var zh={},l2;function kS(){if(l2)return zh;l2=1;const e=Ao().getSymbolSize,r=7;return zh.getPositions=function(s){const f=e(s);return[[0,0],[f-r,0],[0,f-r]]},zh}var Ph={},c2;function zS(){return c2||(c2=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(f){return f!=null&&f!==""&&!isNaN(f)&&f>=0&&f<=7},e.from=function(f){return e.isValid(f)?parseInt(f,10):void 0},e.getPenaltyN1=function(f){const g=f.size;let y=0,E=0,A=0,b=null,T=null;for(let x=0;x<g;x++){E=A=0,b=T=null;for(let S=0;S<g;S++){let R=f.get(x,S);R===b?E++:(E>=5&&(y+=r.N1+(E-5)),b=R,E=1),R=f.get(S,x),R===T?A++:(A>=5&&(y+=r.N1+(A-5)),T=R,A=1)}E>=5&&(y+=r.N1+(E-5)),A>=5&&(y+=r.N1+(A-5))}return y},e.getPenaltyN2=function(f){const g=f.size;let y=0;for(let E=0;E<g-1;E++)for(let A=0;A<g-1;A++){const b=f.get(E,A)+f.get(E,A+1)+f.get(E+1,A)+f.get(E+1,A+1);(b===4||b===0)&&y++}return y*r.N2},e.getPenaltyN3=function(f){const g=f.size;let y=0,E=0,A=0;for(let b=0;b<g;b++){E=A=0;for(let T=0;T<g;T++)E=E<<1&2047|f.get(b,T),T>=10&&(E===1488||E===93)&&y++,A=A<<1&2047|f.get(T,b),T>=10&&(A===1488||A===93)&&y++}return y*r.N3},e.getPenaltyN4=function(f){let g=0;const y=f.data.length;for(let A=0;A<y;A++)g+=f.data[A];return Math.abs(Math.ceil(g*100/y/5)-10)*r.N4};function a(s,f,g){switch(s){case e.Patterns.PATTERN000:return(f+g)%2===0;case e.Patterns.PATTERN001:return f%2===0;case e.Patterns.PATTERN010:return g%3===0;case e.Patterns.PATTERN011:return(f+g)%3===0;case e.Patterns.PATTERN100:return(Math.floor(f/2)+Math.floor(g/3))%2===0;case e.Patterns.PATTERN101:return f*g%2+f*g%3===0;case e.Patterns.PATTERN110:return(f*g%2+f*g%3)%2===0;case e.Patterns.PATTERN111:return(f*g%3+(f+g)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}e.applyMask=function(f,g){const y=g.size;for(let E=0;E<y;E++)for(let A=0;A<y;A++)g.isReserved(A,E)||g.xor(A,E,a(f,A,E))},e.getBestMask=function(f,g){const y=Object.keys(e.Patterns).length;let E=0,A=1/0;for(let b=0;b<y;b++){g(b),e.applyMask(b,f);const T=e.getPenaltyN1(f)+e.getPenaltyN2(f)+e.getPenaltyN3(f)+e.getPenaltyN4(f);e.applyMask(b,f),T<A&&(A=T,E=b)}return E}})(Ph)),Ph}var Cu={},u2;function Jy(){if(u2)return Cu;u2=1;const e=W0(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Cu.getBlocksCount=function(f,g){switch(g){case e.L:return r[(f-1)*4+0];case e.M:return r[(f-1)*4+1];case e.Q:return r[(f-1)*4+2];case e.H:return r[(f-1)*4+3];default:return}},Cu.getTotalCodewordsCount=function(f,g){switch(g){case e.L:return a[(f-1)*4+0];case e.M:return a[(f-1)*4+1];case e.Q:return a[(f-1)*4+2];case e.H:return a[(f-1)*4+3];default:return}},Cu}var Uh={},Dl={},f2;function PS(){if(f2)return Dl;f2=1;const e=new Uint8Array(512),r=new Uint8Array(256);return(function(){let s=1;for(let f=0;f<255;f++)e[f]=s,r[s]=f,s<<=1,s&256&&(s^=285);for(let f=255;f<512;f++)e[f]=e[f-255]})(),Dl.log=function(s){if(s<1)throw new Error("log("+s+")");return r[s]},Dl.exp=function(s){return e[s]},Dl.mul=function(s,f){return s===0||f===0?0:e[r[s]+r[f]]},Dl}var d2;function US(){return d2||(d2=1,(function(e){const r=PS();e.mul=function(s,f){const g=new Uint8Array(s.length+f.length-1);for(let y=0;y<s.length;y++)for(let E=0;E<f.length;E++)g[y+E]^=r.mul(s[y],f[E]);return g},e.mod=function(s,f){let g=new Uint8Array(s);for(;g.length-f.length>=0;){const y=g[0];for(let A=0;A<f.length;A++)g[A]^=r.mul(f[A],y);let E=0;for(;E<g.length&&g[E]===0;)E++;g=g.slice(E)}return g},e.generateECPolynomial=function(s){let f=new Uint8Array([1]);for(let g=0;g<s;g++)f=e.mul(f,new Uint8Array([1,r.exp(g)]));return f}})(Uh)),Uh}var Fh,h2;function FS(){if(h2)return Fh;h2=1;const e=US();function r(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(s){this.degree=s,this.genPoly=e.generateECPolynomial(this.degree)},r.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const f=new Uint8Array(s.length+this.degree);f.set(s);const g=e.mod(f,this.genPoly),y=this.degree-g.length;if(y>0){const E=new Uint8Array(this.degree);return E.set(g,y),E}return g},Fh=r,Fh}var jh={},Vh={},Hh={},g2;function $y(){return g2||(g2=1,Hh.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),Hh}var bi={},m2;function ev(){if(m2)return bi;m2=1;const e="[0-9]+",r="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const s="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
|
|
223
|
+
]))+`;bi.KANJI=new RegExp(a,"g"),bi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),bi.BYTE=new RegExp(s,"g"),bi.NUMERIC=new RegExp(e,"g"),bi.ALPHANUMERIC=new RegExp(r,"g");const f=new RegExp("^"+a+"$"),g=new RegExp("^"+e+"$"),y=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return bi.testKanji=function(A){return f.test(A)},bi.testNumeric=function(A){return g.test(A)},bi.testAlphanumeric=function(A){return y.test(A)},bi}var p2;function Co(){return p2||(p2=1,(function(e){const r=$y(),a=ev();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(g,y){if(!g.ccBits)throw new Error("Invalid mode: "+g);if(!r.isValid(y))throw new Error("Invalid version: "+y);return y>=1&&y<10?g.ccBits[0]:y<27?g.ccBits[1]:g.ccBits[2]},e.getBestModeForData=function(g){return a.testNumeric(g)?e.NUMERIC:a.testAlphanumeric(g)?e.ALPHANUMERIC:a.testKanji(g)?e.KANJI:e.BYTE},e.toString=function(g){if(g&&g.id)return g.id;throw new Error("Invalid mode")},e.isValid=function(g){return g&&g.bit&&g.ccBits};function s(f){if(typeof f!="string")throw new Error("Param is not a string");switch(f.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: "+f)}}e.from=function(g,y){if(e.isValid(g))return g;try{return s(g)}catch{return y}}})(Vh)),Vh}var x2;function jS(){return x2||(x2=1,(function(e){const r=Ao(),a=Jy(),s=W0(),f=Co(),g=$y(),y=7973,E=r.getBCHDigit(y);function A(S,R,k){for(let I=1;I<=40;I++)if(R<=e.getCapacity(I,k,S))return I}function b(S,R){return f.getCharCountIndicator(S,R)+4}function T(S,R){let k=0;return S.forEach(function(I){const z=b(I.mode,R);k+=z+I.getBitsLength()}),k}function x(S,R){for(let k=1;k<=40;k++)if(T(S,k)<=e.getCapacity(k,R,f.MIXED))return k}e.from=function(R,k){return g.isValid(R)?parseInt(R,10):k},e.getCapacity=function(R,k,I){if(!g.isValid(R))throw new Error("Invalid QR Code version");typeof I>"u"&&(I=f.BYTE);const z=r.getSymbolTotalCodewords(R),L=a.getTotalCodewordsCount(R,k),Z=(z-L)*8;if(I===f.MIXED)return Z;const H=Z-b(I,R);switch(I){case f.NUMERIC:return Math.floor(H/10*3);case f.ALPHANUMERIC:return Math.floor(H/11*2);case f.KANJI:return Math.floor(H/13);case f.BYTE:default:return Math.floor(H/8)}},e.getBestVersionForData=function(R,k){let I;const z=s.from(k,s.M);if(Array.isArray(R)){if(R.length>1)return x(R,z);if(R.length===0)return 1;I=R[0]}else I=R;return A(I.mode,I.getLength(),z)},e.getEncodedBits=function(R){if(!g.isValid(R)||R<7)throw new Error("Invalid QR Code version");let k=R<<12;for(;r.getBCHDigit(k)-E>=0;)k^=y<<r.getBCHDigit(k)-E;return R<<12|k}})(jh)),jh}var Gh={},y2;function VS(){if(y2)return Gh;y2=1;const e=Ao(),r=1335,a=21522,s=e.getBCHDigit(r);return Gh.getEncodedBits=function(g,y){const E=g.bit<<3|y;let A=E<<10;for(;e.getBCHDigit(A)-s>=0;)A^=r<<e.getBCHDigit(A)-s;return(E<<10|A)^a},Gh}var Zh={},Xh,v2;function HS(){if(v2)return Xh;v2=1;const e=Co();function r(a){this.mode=e.NUMERIC,this.data=a.toString()}return r.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let f,g,y;for(f=0;f+3<=this.data.length;f+=3)g=this.data.substr(f,3),y=parseInt(g,10),s.put(y,10);const E=this.data.length-f;E>0&&(g=this.data.substr(f),y=parseInt(g,10),s.put(y,E*3+1))},Xh=r,Xh}var Yh,w2;function GS(){if(w2)return Yh;w2=1;const e=Co(),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(s){this.mode=e.ALPHANUMERIC,this.data=s}return a.getBitsLength=function(f){return 11*Math.floor(f/2)+6*(f%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(f){let g;for(g=0;g+2<=this.data.length;g+=2){let y=r.indexOf(this.data[g])*45;y+=r.indexOf(this.data[g+1]),f.put(y,11)}this.data.length%2&&f.put(r.indexOf(this.data[g]),6)},Yh=a,Yh}var qh,b2;function ZS(){if(b2)return qh;b2=1;const e=Co();function r(a){this.mode=e.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return r.getBitsLength=function(s){return s*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(a){for(let s=0,f=this.data.length;s<f;s++)a.put(this.data[s],8)},qh=r,qh}var Wh,_2;function XS(){if(_2)return Wh;_2=1;const e=Co(),r=Ao();function a(s){this.mode=e.KANJI,this.data=s}return a.getBitsLength=function(f){return f*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(s){let f;for(f=0;f<this.data.length;f++){let g=r.toSJIS(this.data[f]);if(g>=33088&&g<=40956)g-=33088;else if(g>=57408&&g<=60351)g-=49472;else throw new Error("Invalid SJIS character: "+this.data[f]+`
|
|
224
|
+
Make sure your charset is UTF-8`);g=(g>>>8&255)*192+(g&255),s.put(g,13)}},Wh=a,Wh}var Kh={exports:{}},E2;function YS(){return E2||(E2=1,(function(e){var r={single_source_shortest_paths:function(a,s,f){var g={},y={};y[s]=0;var E=r.PriorityQueue.make();E.push(s,0);for(var A,b,T,x,S,R,k,I,z;!E.empty();){A=E.pop(),b=A.value,x=A.cost,S=a[b]||{};for(T in S)S.hasOwnProperty(T)&&(R=S[T],k=x+R,I=y[T],z=typeof y[T]>"u",(z||I>k)&&(y[T]=k,E.push(T,k),g[T]=b))}if(typeof f<"u"&&typeof y[f]>"u"){var L=["Could not find a path from ",s," to ",f,"."].join("");throw new Error(L)}return g},extract_shortest_path_from_predecessor_list:function(a,s){for(var f=[],g=s;g;)f.push(g),a[g],g=a[g];return f.reverse(),f},find_path:function(a,s,f){var g=r.single_source_shortest_paths(a,s,f);return r.extract_shortest_path_from_predecessor_list(g,f)},PriorityQueue:{make:function(a){var s=r.PriorityQueue,f={},g;a=a||{};for(g in s)s.hasOwnProperty(g)&&(f[g]=s[g]);return f.queue=[],f.sorter=a.sorter||s.default_sorter,f},default_sorter:function(a,s){return a.cost-s.cost},push:function(a,s){var f={value:a,cost:s};this.queue.push(f),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=r})(Kh)),Kh.exports}var A2;function qS(){return A2||(A2=1,(function(e){const r=Co(),a=HS(),s=GS(),f=ZS(),g=XS(),y=ev(),E=Ao(),A=YS();function b(L){return unescape(encodeURIComponent(L)).length}function T(L,Z,H){const j=[];let ae;for(;(ae=L.exec(H))!==null;)j.push({data:ae[0],index:ae.index,mode:Z,length:ae[0].length});return j}function x(L){const Z=T(y.NUMERIC,r.NUMERIC,L),H=T(y.ALPHANUMERIC,r.ALPHANUMERIC,L);let j,ae;return E.isKanjiModeEnabled()?(j=T(y.BYTE,r.BYTE,L),ae=T(y.KANJI,r.KANJI,L)):(j=T(y.BYTE_KANJI,r.BYTE,L),ae=[]),Z.concat(H,j,ae).sort(function(X,de){return X.index-de.index}).map(function(X){return{data:X.data,mode:X.mode,length:X.length}})}function S(L,Z){switch(Z){case r.NUMERIC:return a.getBitsLength(L);case r.ALPHANUMERIC:return s.getBitsLength(L);case r.KANJI:return g.getBitsLength(L);case r.BYTE:return f.getBitsLength(L)}}function R(L){return L.reduce(function(Z,H){const j=Z.length-1>=0?Z[Z.length-1]:null;return j&&j.mode===H.mode?(Z[Z.length-1].data+=H.data,Z):(Z.push(H),Z)},[])}function k(L){const Z=[];for(let H=0;H<L.length;H++){const j=L[H];switch(j.mode){case r.NUMERIC:Z.push([j,{data:j.data,mode:r.ALPHANUMERIC,length:j.length},{data:j.data,mode:r.BYTE,length:j.length}]);break;case r.ALPHANUMERIC:Z.push([j,{data:j.data,mode:r.BYTE,length:j.length}]);break;case r.KANJI:Z.push([j,{data:j.data,mode:r.BYTE,length:b(j.data)}]);break;case r.BYTE:Z.push([{data:j.data,mode:r.BYTE,length:b(j.data)}])}}return Z}function I(L,Z){const H={},j={start:{}};let ae=["start"];for(let ee=0;ee<L.length;ee++){const X=L[ee],de=[];for(let Q=0;Q<X.length;Q++){const Oe=X[Q],ue=""+ee+Q;de.push(ue),H[ue]={node:Oe,lastCount:0},j[ue]={};for(let $=0;$<ae.length;$++){const pe=ae[$];H[pe]&&H[pe].node.mode===Oe.mode?(j[pe][ue]=S(H[pe].lastCount+Oe.length,Oe.mode)-S(H[pe].lastCount,Oe.mode),H[pe].lastCount+=Oe.length):(H[pe]&&(H[pe].lastCount=Oe.length),j[pe][ue]=S(Oe.length,Oe.mode)+4+r.getCharCountIndicator(Oe.mode,Z))}}ae=de}for(let ee=0;ee<ae.length;ee++)j[ae[ee]].end=0;return{map:j,table:H}}function z(L,Z){let H;const j=r.getBestModeForData(L);if(H=r.from(Z,j),H!==r.BYTE&&H.bit<j.bit)throw new Error('"'+L+'" cannot be encoded with mode '+r.toString(H)+`.
|
|
225
|
+
Suggested mode is: `+r.toString(j));switch(H===r.KANJI&&!E.isKanjiModeEnabled()&&(H=r.BYTE),H){case r.NUMERIC:return new a(L);case r.ALPHANUMERIC:return new s(L);case r.KANJI:return new g(L);case r.BYTE:return new f(L)}}e.fromArray=function(Z){return Z.reduce(function(H,j){return typeof j=="string"?H.push(z(j,null)):j.data&&H.push(z(j.data,j.mode)),H},[])},e.fromString=function(Z,H){const j=x(Z,E.isKanjiModeEnabled()),ae=k(j),ee=I(ae,H),X=A.find_path(ee.map,"start","end"),de=[];for(let Q=1;Q<X.length-1;Q++)de.push(ee.table[X[Q]].node);return e.fromArray(R(de))},e.rawSplit=function(Z){return e.fromArray(x(Z,E.isKanjiModeEnabled()))}})(Zh)),Zh}var C2;function WS(){if(C2)return Mh;C2=1;const e=Ao(),r=W0(),a=DS(),s=BS(),f=LS(),g=kS(),y=zS(),E=Jy(),A=FS(),b=jS(),T=VS(),x=Co(),S=qS();function R(ee,X){const de=ee.size,Q=g.getPositions(X);for(let Oe=0;Oe<Q.length;Oe++){const ue=Q[Oe][0],$=Q[Oe][1];for(let pe=-1;pe<=7;pe++)if(!(ue+pe<=-1||de<=ue+pe))for(let Ce=-1;Ce<=7;Ce++)$+Ce<=-1||de<=$+Ce||(pe>=0&&pe<=6&&(Ce===0||Ce===6)||Ce>=0&&Ce<=6&&(pe===0||pe===6)||pe>=2&&pe<=4&&Ce>=2&&Ce<=4?ee.set(ue+pe,$+Ce,!0,!0):ee.set(ue+pe,$+Ce,!1,!0))}}function k(ee){const X=ee.size;for(let de=8;de<X-8;de++){const Q=de%2===0;ee.set(de,6,Q,!0),ee.set(6,de,Q,!0)}}function I(ee,X){const de=f.getPositions(X);for(let Q=0;Q<de.length;Q++){const Oe=de[Q][0],ue=de[Q][1];for(let $=-2;$<=2;$++)for(let pe=-2;pe<=2;pe++)$===-2||$===2||pe===-2||pe===2||$===0&&pe===0?ee.set(Oe+$,ue+pe,!0,!0):ee.set(Oe+$,ue+pe,!1,!0)}}function z(ee,X){const de=ee.size,Q=b.getEncodedBits(X);let Oe,ue,$;for(let pe=0;pe<18;pe++)Oe=Math.floor(pe/3),ue=pe%3+de-8-3,$=(Q>>pe&1)===1,ee.set(Oe,ue,$,!0),ee.set(ue,Oe,$,!0)}function L(ee,X,de){const Q=ee.size,Oe=T.getEncodedBits(X,de);let ue,$;for(ue=0;ue<15;ue++)$=(Oe>>ue&1)===1,ue<6?ee.set(ue,8,$,!0):ue<8?ee.set(ue+1,8,$,!0):ee.set(Q-15+ue,8,$,!0),ue<8?ee.set(8,Q-ue-1,$,!0):ue<9?ee.set(8,15-ue-1+1,$,!0):ee.set(8,15-ue-1,$,!0);ee.set(Q-8,8,1,!0)}function Z(ee,X){const de=ee.size;let Q=-1,Oe=de-1,ue=7,$=0;for(let pe=de-1;pe>0;pe-=2)for(pe===6&&pe--;;){for(let Ce=0;Ce<2;Ce++)if(!ee.isReserved(Oe,pe-Ce)){let re=!1;$<X.length&&(re=(X[$]>>>ue&1)===1),ee.set(Oe,pe-Ce,re),ue--,ue===-1&&($++,ue=7)}if(Oe+=Q,Oe<0||de<=Oe){Oe-=Q,Q=-Q;break}}}function H(ee,X,de){const Q=new a;de.forEach(function(Ce){Q.put(Ce.mode.bit,4),Q.put(Ce.getLength(),x.getCharCountIndicator(Ce.mode,ee)),Ce.write(Q)});const Oe=e.getSymbolTotalCodewords(ee),ue=E.getTotalCodewordsCount(ee,X),$=(Oe-ue)*8;for(Q.getLengthInBits()+4<=$&&Q.put(0,4);Q.getLengthInBits()%8!==0;)Q.putBit(0);const pe=($-Q.getLengthInBits())/8;for(let Ce=0;Ce<pe;Ce++)Q.put(Ce%2?17:236,8);return j(Q,ee,X)}function j(ee,X,de){const Q=e.getSymbolTotalCodewords(X),Oe=E.getTotalCodewordsCount(X,de),ue=Q-Oe,$=E.getBlocksCount(X,de),pe=Q%$,Ce=$-pe,re=Math.floor(Q/$),ne=Math.floor(ue/$),xe=ne+1,Me=re-ne,He=new A(Me);let Ye=0;const W=new Array($),se=new Array($);let Se=0;const Ie=new Uint8Array(ee.buffer);for(let pt=0;pt<$;pt++){const Yn=pt<Ce?ne:xe;W[pt]=Ie.slice(Ye,Ye+Yn),se[pt]=He.encode(W[pt]),Ye+=Yn,Se=Math.max(Se,Yn)}const Ue=new Uint8Array(Q);let Te=0,Ke,Qe;for(Ke=0;Ke<Se;Ke++)for(Qe=0;Qe<$;Qe++)Ke<W[Qe].length&&(Ue[Te++]=W[Qe][Ke]);for(Ke=0;Ke<Me;Ke++)for(Qe=0;Qe<$;Qe++)Ue[Te++]=se[Qe][Ke];return Ue}function ae(ee,X,de,Q){let Oe;if(Array.isArray(ee))Oe=S.fromArray(ee);else if(typeof ee=="string"){let re=X;if(!re){const ne=S.rawSplit(ee);re=b.getBestVersionForData(ne,de)}Oe=S.fromString(ee,re||40)}else throw new Error("Invalid data");const ue=b.getBestVersionForData(Oe,de);if(!ue)throw new Error("The amount of data is too big to be stored in a QR Code");if(!X)X=ue;else if(X<ue)throw new Error(`
|
|
226
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
227
|
+
Minimum version required to store current data is: `+ue+`.
|
|
228
|
+
`);const $=H(X,de,Oe),pe=e.getSymbolSize(X),Ce=new s(pe);return R(Ce,X),k(Ce),I(Ce,X),L(Ce,de,0),X>=7&&z(Ce,X),Z(Ce,$),isNaN(Q)&&(Q=y.getBestMask(Ce,L.bind(null,Ce,de))),y.applyMask(Q,Ce),L(Ce,de,Q),{modules:Ce,version:X,errorCorrectionLevel:de,maskPattern:Q,segments:Oe}}return Mh.create=function(X,de){if(typeof X>"u"||X==="")throw new Error("No input text");let Q=r.M,Oe,ue;return typeof de<"u"&&(Q=r.from(de.errorCorrectionLevel,r.M),Oe=b.from(de.version),ue=y.from(de.maskPattern),de.toSJISFunc&&e.setToSJISFunction(de.toSJISFunc)),ae(X,Oe,Q,ue)},Mh}var Qh={},Jh={},S2;function tv(){return S2||(S2=1,(function(e){function r(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let s=a.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+a);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(g){return[g,g]}))),s.length===6&&s.push("F","F");const f=parseInt(s.join(""),16);return{r:f>>24&255,g:f>>16&255,b:f>>8&255,a:f&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const f=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,g=s.width&&s.width>=21?s.width:void 0,y=s.scale||4;return{width:g,scale:g?4:y,margin:f,color:{dark:r(s.color.dark||"#000000ff"),light:r(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,f){return f.width&&f.width>=s+f.margin*2?f.width/(s+f.margin*2):f.scale},e.getImageWidth=function(s,f){const g=e.getScale(s,f);return Math.floor((s+f.margin*2)*g)},e.qrToImageData=function(s,f,g){const y=f.modules.size,E=f.modules.data,A=e.getScale(y,g),b=Math.floor((y+g.margin*2)*A),T=g.margin*A,x=[g.color.light,g.color.dark];for(let S=0;S<b;S++)for(let R=0;R<b;R++){let k=(S*b+R)*4,I=g.color.light;if(S>=T&&R>=T&&S<b-T&&R<b-T){const z=Math.floor((S-T)/A),L=Math.floor((R-T)/A);I=x[E[z*y+L]?1:0]}s[k++]=I.r,s[k++]=I.g,s[k++]=I.b,s[k]=I.a}}})(Jh)),Jh}var T2;function KS(){return T2||(T2=1,(function(e){const r=tv();function a(f,g,y){f.clearRect(0,0,g.width,g.height),g.style||(g.style={}),g.height=y,g.width=y,g.style.height=y+"px",g.style.width=y+"px"}function s(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(g,y,E){let A=E,b=y;typeof A>"u"&&(!y||!y.getContext)&&(A=y,y=void 0),y||(b=s()),A=r.getOptions(A);const T=r.getImageWidth(g.modules.size,A),x=b.getContext("2d"),S=x.createImageData(T,T);return r.qrToImageData(S.data,g,A),a(x,b,T),x.putImageData(S,0,0),b},e.renderToDataURL=function(g,y,E){let A=E;typeof A>"u"&&(!y||!y.getContext)&&(A=y,y=void 0),A||(A={});const b=e.render(g,y,A),T=A.type||"image/png",x=A.rendererOpts||{};return b.toDataURL(T,x.quality)}})(Qh)),Qh}var $h={},R2;function QS(){if(R2)return $h;R2=1;const e=tv();function r(f,g){const y=f.a/255,E=g+'="'+f.hex+'"';return y<1?E+" "+g+'-opacity="'+y.toFixed(2).slice(1)+'"':E}function a(f,g,y){let E=f+g;return typeof y<"u"&&(E+=" "+y),E}function s(f,g,y){let E="",A=0,b=!1,T=0;for(let x=0;x<f.length;x++){const S=Math.floor(x%g),R=Math.floor(x/g);!S&&!b&&(b=!0),f[x]?(T++,x>0&&S>0&&f[x-1]||(E+=b?a("M",S+y,.5+R+y):a("m",A,0),A=0,b=!1),S+1<g&&f[x+1]||(E+=a("h",T),T=0)):A++}return E}return $h.render=function(g,y,E){const A=e.getOptions(y),b=g.modules.size,T=g.modules.data,x=b+A.margin*2,S=A.color.light.a?"<path "+r(A.color.light,"fill")+' d="M0 0h'+x+"v"+x+'H0z"/>':"",R="<path "+r(A.color.dark,"stroke")+' d="'+s(T,b,A.margin)+'"/>',k='viewBox="0 0 '+x+" "+x+'"',z='<svg xmlns="http://www.w3.org/2000/svg" '+(A.width?'width="'+A.width+'" height="'+A.width+'" ':"")+k+' shape-rendering="crispEdges">'+S+R+`</svg>
|
|
229
|
+
`;return typeof E=="function"&&E(null,z),z},$h}var N2;function JS(){if(N2)return ps;N2=1;const e=MS(),r=WS(),a=KS(),s=QS();function f(g,y,E,A,b){const T=[].slice.call(arguments,1),x=T.length,S=typeof T[x-1]=="function";if(!S&&!e())throw new Error("Callback required as last argument");if(S){if(x<2)throw new Error("Too few arguments provided");x===2?(b=E,E=y,y=A=void 0):x===3&&(y.getContext&&typeof b>"u"?(b=A,A=void 0):(b=A,A=E,E=y,y=void 0))}else{if(x<1)throw new Error("Too few arguments provided");return x===1?(E=y,y=A=void 0):x===2&&!y.getContext&&(A=E,E=y,y=void 0),new Promise(function(R,k){try{const I=r.create(E,A);R(g(I,y,A))}catch(I){k(I)}})}try{const R=r.create(E,A);b(null,g(R,y,A))}catch(R){b(R)}}return ps.create=r.create,ps.toCanvas=f.bind(null,a.render),ps.toDataURL=f.bind(null,a.renderToDataURL),ps.toString=f.bind(null,function(g,y,E){return s.render(g,E)}),ps}var $S=JS();const e4=Qu($S),t4=e=>`https://api.dicebear.com/9.x/adventurer-neutral/svg?seed=${encodeURIComponent(e)}`,Bl=(e,r)=>{const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!a)return`rgba(0, 0, 0, ${r})`;const s=parseInt(a[1],16),f=parseInt(a[2],16),g=parseInt(a[3],16);return`rgba(${s}, ${f}, ${g}, ${r})`},jl=({player:e,size:r="md",className:a=""})=>{const s={sm:"h-8 w-8 border-2",md:"h-12 w-12 border-4",lg:"h-16 w-16 border-4"},f={sm:e.color?`inset 0 0 4px rgba(0, 0, 0, 0.2), 0 0 8px ${Bl(e.color,.4)}`:"inset 0 0 4px rgba(0, 0, 0, 0.2)",md:e.color?`inset 0 0 10px rgba(0, 0, 0, 0.4), 0 0 20px ${Bl(e.color,.6)}, 0 0 10px ${Bl(e.color,.8)}`:"inset 0 0 10px rgba(0, 0, 0, 0.4), 0 0 20px hsl(var(--border) / 0.5)",lg:e.color?`inset 0 0 12px rgba(0, 0, 0, 0.4), 0 0 24px ${Bl(e.color,.6)}, 0 0 12px ${Bl(e.color,.8)}`:"inset 0 0 12px rgba(0, 0, 0, 0.4), 0 0 24px hsl(var(--border) / 0.5)"};return F.jsx("img",{src:t4(e.id),alt:e.label,className:`bg-secondary/30 shrink-0 rounded-full shadow-lg ${s[r]} ${a}`,style:{borderColor:e.color||"hsl(var(--border))",boxShadow:f[r]}})},n4=q0("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function r4({className:e,variant:r,...a}){return F.jsx("div",{"data-slot":"alert",role:"alert",className:Wt(n4({variant:r}),e),...a})}function i4({className:e,...r}){return F.jsx("div",{"data-slot":"alert-description",className:Wt("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...r})}const a4=q0("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function e0({className:e,variant:r,asChild:a=!1,...s}){const f=a?Ky:"span";return F.jsx(f,{"data-slot":"badge",className:Wt(a4({variant:r}),e),...s})}function o4({className:e,...r}){return F.jsx("div",{"data-slot":"card",className:Wt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function O2({className:e,...r}){return F.jsx("div",{"data-slot":"card-title",className:Wt("leading-none font-semibold",e),...r})}function I2({className:e,...r}){return F.jsx("div",{"data-slot":"card-description",className:Wt("text-muted-foreground text-sm",e),...r})}function s4({className:e,...r}){return F.jsx("div",{"data-slot":"card-content",className:Wt("px-6",e),...r})}function nv(e){const r=e+"CollectionProvider",[a,s]=Kl(r),[f,g]=a(r,{collectionRef:{current:null},itemMap:new Map}),y=I=>{const{scope:z,children:L}=I,Z=Nr.useRef(null),H=Nr.useRef(new Map).current;return F.jsx(f,{scope:z,itemMap:H,collectionRef:Z,children:L})};y.displayName=r;const E=e+"CollectionSlot",A=ju(E),b=Nr.forwardRef((I,z)=>{const{scope:L,children:Z}=I,H=g(E,L),j=Zn(z,H.collectionRef);return F.jsx(A,{ref:j,children:Z})});b.displayName=E;const T=e+"CollectionItemSlot",x="data-radix-collection-item",S=ju(T),R=Nr.forwardRef((I,z)=>{const{scope:L,children:Z,...H}=I,j=Nr.useRef(null),ae=Zn(z,j),ee=g(T,L);return Nr.useEffect(()=>(ee.itemMap.set(j,{ref:j,...H}),()=>void ee.itemMap.delete(j))),F.jsx(S,{[x]:"",ref:ae,children:Z})});R.displayName=T;function k(I){const z=g(e+"CollectionConsumer",I);return Nr.useCallback(()=>{const Z=z.collectionRef.current;if(!Z)return[];const H=Array.from(Z.querySelectorAll(`[${x}]`));return Array.from(z.itemMap.values()).sort((ee,X)=>H.indexOf(ee.ref.current)-H.indexOf(X.ref.current))},[z.collectionRef,z.itemMap])}return[{Provider:y,Slot:b,ItemSlot:R},k,s]}var l4=B.createContext(void 0);function K0(e){const r=B.useContext(l4);return e||r||"ltr"}var t0="rovingFocusGroup.onEntryFocus",c4={bubbles:!1,cancelable:!0},Jl="RovingFocusGroup",[b0,rv,u4]=nv(Jl),[f4,iv]=Kl(Jl,[u4]),[d4,h4]=f4(Jl),av=B.forwardRef((e,r)=>F.jsx(b0.Provider,{scope:e.__scopeRovingFocusGroup,children:F.jsx(b0.Slot,{scope:e.__scopeRovingFocusGroup,children:F.jsx(g4,{...e,ref:r})})}));av.displayName=Jl;var g4=B.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:f=!1,dir:g,currentTabStopId:y,defaultCurrentTabStopId:E,onCurrentTabStopIdChange:A,onEntryFocus:b,preventScrollOnEntryFocus:T=!1,...x}=e,S=B.useRef(null),R=Zn(r,S),k=K0(g),[I,z]=rf({prop:y,defaultProp:E??null,onChange:A,caller:Jl}),[L,Z]=B.useState(!1),H=Ss(b),j=rv(a),ae=B.useRef(!1),[ee,X]=B.useState(0);return B.useEffect(()=>{const de=S.current;if(de)return de.addEventListener(t0,H),()=>de.removeEventListener(t0,H)},[H]),F.jsx(d4,{scope:a,orientation:s,dir:k,loop:f,currentTabStopId:I,onItemFocus:B.useCallback(de=>z(de),[z]),onItemShiftTab:B.useCallback(()=>Z(!0),[]),onFocusableItemAdd:B.useCallback(()=>X(de=>de+1),[]),onFocusableItemRemove:B.useCallback(()=>X(de=>de-1),[]),children:F.jsx(Cn.div,{tabIndex:L||ee===0?-1:0,"data-orientation":s,...x,ref:R,style:{outline:"none",...e.style},onMouseDown:tn(e.onMouseDown,()=>{ae.current=!0}),onFocus:tn(e.onFocus,de=>{const Q=!ae.current;if(de.target===de.currentTarget&&Q&&!L){const Oe=new CustomEvent(t0,c4);if(de.currentTarget.dispatchEvent(Oe),!Oe.defaultPrevented){const ue=j().filter(ne=>ne.focusable),$=ue.find(ne=>ne.active),pe=ue.find(ne=>ne.id===I),re=[$,pe,...ue].filter(Boolean).map(ne=>ne.ref.current);lv(re,T)}}ae.current=!1}),onBlur:tn(e.onBlur,()=>Z(!1))})})}),ov="RovingFocusGroupItem",sv=B.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:f=!1,tabStopId:g,children:y,...E}=e,A=Fl(),b=g||A,T=h4(ov,a),x=T.currentTabStopId===b,S=rv(a),{onFocusableItemAdd:R,onFocusableItemRemove:k,currentTabStopId:I}=T;return B.useEffect(()=>{if(s)return R(),()=>k()},[s,R,k]),F.jsx(b0.ItemSlot,{scope:a,id:b,focusable:s,active:f,children:F.jsx(Cn.span,{tabIndex:x?0:-1,"data-orientation":T.orientation,...E,ref:r,onMouseDown:tn(e.onMouseDown,z=>{s?T.onItemFocus(b):z.preventDefault()}),onFocus:tn(e.onFocus,()=>T.onItemFocus(b)),onKeyDown:tn(e.onKeyDown,z=>{if(z.key==="Tab"&&z.shiftKey){T.onItemShiftTab();return}if(z.target!==z.currentTarget)return;const L=x4(z,T.orientation,T.dir);if(L!==void 0){if(z.metaKey||z.ctrlKey||z.altKey||z.shiftKey)return;z.preventDefault();let H=S().filter(j=>j.focusable).map(j=>j.ref.current);if(L==="last")H.reverse();else if(L==="prev"||L==="next"){L==="prev"&&H.reverse();const j=H.indexOf(z.currentTarget);H=T.loop?y4(H,j+1):H.slice(j+1)}setTimeout(()=>lv(H))}}),children:typeof y=="function"?y({isCurrentTabStop:x,hasTabStop:I!=null}):y})})});sv.displayName=ov;var m4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function p4(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x4(e,r,a){const s=p4(e.key,a);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return m4[s]}function lv(e,r=!1){const a=document.activeElement;for(const s of e)if(s===a||(s.focus({preventScroll:r}),document.activeElement!==a))return}function y4(e,r){return e.map((a,s)=>e[(r+s)%e.length])}var v4=av,w4=sv,sf="Tabs",[b4]=Kl(sf,[iv]),cv=iv(),[_4,Q0]=b4(sf),uv=B.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,onValueChange:f,defaultValue:g,orientation:y="horizontal",dir:E,activationMode:A="automatic",...b}=e,T=K0(E),[x,S]=rf({prop:s,onChange:f,defaultProp:g??"",caller:sf});return F.jsx(_4,{scope:a,baseId:Fl(),value:x,onValueChange:S,orientation:y,dir:T,activationMode:A,children:F.jsx(Cn.div,{dir:T,"data-orientation":y,...b,ref:r})})});uv.displayName=sf;var fv="TabsList",dv=B.forwardRef((e,r)=>{const{__scopeTabs:a,loop:s=!0,...f}=e,g=Q0(fv,a),y=cv(a);return F.jsx(v4,{asChild:!0,...y,orientation:g.orientation,dir:g.dir,loop:s,children:F.jsx(Cn.div,{role:"tablist","aria-orientation":g.orientation,...f,ref:r})})});dv.displayName=fv;var hv="TabsTrigger",gv=B.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,disabled:f=!1,...g}=e,y=Q0(hv,a),E=cv(a),A=xv(y.baseId,s),b=yv(y.baseId,s),T=s===y.value;return F.jsx(w4,{asChild:!0,...E,focusable:!f,active:T,children:F.jsx(Cn.button,{type:"button",role:"tab","aria-selected":T,"aria-controls":b,"data-state":T?"active":"inactive","data-disabled":f?"":void 0,disabled:f,id:A,...g,ref:r,onMouseDown:tn(e.onMouseDown,x=>{!f&&x.button===0&&x.ctrlKey===!1?y.onValueChange(s):x.preventDefault()}),onKeyDown:tn(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&y.onValueChange(s)}),onFocus:tn(e.onFocus,()=>{const x=y.activationMode!=="manual";!T&&!f&&x&&y.onValueChange(s)})})})});gv.displayName=hv;var mv="TabsContent",pv=B.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,forceMount:f,children:g,...y}=e,E=Q0(mv,a),A=xv(E.baseId,s),b=yv(E.baseId,s),T=s===E.value,x=B.useRef(T);return B.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),F.jsx(Ql,{present:f||T,children:({present:S})=>F.jsx(Cn.div,{"data-state":T?"active":"inactive","data-orientation":E.orientation,role:"tabpanel","aria-labelledby":A,hidden:!S,id:b,tabIndex:0,...y,ref:r,style:{...e.style,animationDuration:x.current?"0s":void 0},children:S&&g})})});pv.displayName=mv;function xv(e,r){return`${e}-trigger-${r}`}function yv(e,r){return`${e}-content-${r}`}var E4=uv,A4=dv,C4=gv,S4=pv;function T4({className:e,...r}){return F.jsx(E4,{"data-slot":"tabs",className:Wt("flex flex-col gap-2",e),...r})}function R4({className:e,...r}){return F.jsx(A4,{"data-slot":"tabs-list",className:Wt("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...r})}function n0({className:e,...r}){return F.jsx(C4,{"data-slot":"tabs-trigger",className:Wt("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function r0({className:e,...r}){return F.jsx(S4,{"data-slot":"tabs-content",className:Wt("flex-1 outline-none",e),...r})}function vv(e,[r,a]){return Math.min(a,Math.max(r,e))}function N4(e){const r=B.useRef({value:e,previous:e});return B.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function O4(e){const[r,a]=B.useState(void 0);return Cs(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const g=f[0];let y,E;if("borderBoxSize"in g){const A=g.borderBoxSize,b=Array.isArray(A)?A[0]:A;y=b.inlineSize,E=b.blockSize}else y=e.offsetWidth,E=e.offsetHeight;a({width:y,height:E})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),r}var wv=["PageUp","PageDown"],bv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_v={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ms="Slider",[_0,I4,M4]=nv(Ms),[Ev]=Kl(Ms,[M4]),[D4,lf]=Ev(Ms),Av=B.forwardRef((e,r)=>{const{name:a,min:s=0,max:f=100,step:g=1,orientation:y="horizontal",disabled:E=!1,minStepsBetweenThumbs:A=0,defaultValue:b=[s],value:T,onValueChange:x=()=>{},onValueCommit:S=()=>{},inverted:R=!1,form:k,...I}=e,z=B.useRef(new Set),L=B.useRef(0),H=y==="horizontal"?B4:L4,[j=[],ae]=rf({prop:T,defaultProp:b,onChange:ue=>{var pe;(pe=[...z.current][L.current])==null||pe.focus(),x(ue)}}),ee=B.useRef(j);function X(ue){const $=F4(j,ue);Oe(ue,$)}function de(ue){Oe(ue,L.current)}function Q(){const ue=ee.current[L.current];j[L.current]!==ue&&S(j)}function Oe(ue,$,{commit:pe}={commit:!1}){const Ce=G4(g),re=Z4(Math.round((ue-s)/g)*g+s,Ce),ne=vv(re,[s,f]);ae((xe=[])=>{const Me=P4(xe,ne,$);if(H4(Me,A*g)){L.current=Me.indexOf(ne);const He=String(Me)!==String(xe);return He&&pe&&S(Me),He?Me:xe}else return xe})}return F.jsx(D4,{scope:e.__scopeSlider,name:a,disabled:E,min:s,max:f,valueIndexToChangeRef:L,thumbs:z.current,values:j,orientation:y,form:k,children:F.jsx(_0.Provider,{scope:e.__scopeSlider,children:F.jsx(_0.Slot,{scope:e.__scopeSlider,children:F.jsx(H,{"aria-disabled":E,"data-disabled":E?"":void 0,...I,ref:r,onPointerDown:tn(I.onPointerDown,()=>{E||(ee.current=j)}),min:s,max:f,inverted:R,onSlideStart:E?void 0:X,onSlideMove:E?void 0:de,onSlideEnd:E?void 0:Q,onHomeKeyDown:()=>!E&&Oe(s,0,{commit:!0}),onEndKeyDown:()=>!E&&Oe(f,j.length-1,{commit:!0}),onStepKeyDown:({event:ue,direction:$})=>{if(!E){const re=wv.includes(ue.key)||ue.shiftKey&&bv.includes(ue.key)?10:1,ne=L.current,xe=j[ne],Me=g*re*$;Oe(xe+Me,ne,{commit:!0})}}})})})})});Av.displayName=Ms;var[Cv,Sv]=Ev(Ms,{startEdge:"left",endEdge:"right",size:"width",direction:1}),B4=B.forwardRef((e,r)=>{const{min:a,max:s,dir:f,inverted:g,onSlideStart:y,onSlideMove:E,onSlideEnd:A,onStepKeyDown:b,...T}=e,[x,S]=B.useState(null),R=Zn(r,H=>S(H)),k=B.useRef(void 0),I=K0(f),z=I==="ltr",L=z&&!g||!z&&g;function Z(H){const j=k.current||x.getBoundingClientRect(),ae=[0,j.width],X=J0(ae,L?[a,s]:[s,a]);return k.current=j,X(H-j.left)}return F.jsx(Cv,{scope:e.__scopeSlider,startEdge:L?"left":"right",endEdge:L?"right":"left",direction:L?1:-1,size:"width",children:F.jsx(Tv,{dir:I,"data-orientation":"horizontal",...T,ref:R,style:{...T.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:H=>{const j=Z(H.clientX);y==null||y(j)},onSlideMove:H=>{const j=Z(H.clientX);E==null||E(j)},onSlideEnd:()=>{k.current=void 0,A==null||A()},onStepKeyDown:H=>{const ae=_v[L?"from-left":"from-right"].includes(H.key);b==null||b({event:H,direction:ae?-1:1})}})})}),L4=B.forwardRef((e,r)=>{const{min:a,max:s,inverted:f,onSlideStart:g,onSlideMove:y,onSlideEnd:E,onStepKeyDown:A,...b}=e,T=B.useRef(null),x=Zn(r,T),S=B.useRef(void 0),R=!f;function k(I){const z=S.current||T.current.getBoundingClientRect(),L=[0,z.height],H=J0(L,R?[s,a]:[a,s]);return S.current=z,H(I-z.top)}return F.jsx(Cv,{scope:e.__scopeSlider,startEdge:R?"bottom":"top",endEdge:R?"top":"bottom",size:"height",direction:R?1:-1,children:F.jsx(Tv,{"data-orientation":"vertical",...b,ref:x,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:I=>{const z=k(I.clientY);g==null||g(z)},onSlideMove:I=>{const z=k(I.clientY);y==null||y(z)},onSlideEnd:()=>{S.current=void 0,E==null||E()},onStepKeyDown:I=>{const L=_v[R?"from-bottom":"from-top"].includes(I.key);A==null||A({event:I,direction:L?-1:1})}})})}),Tv=B.forwardRef((e,r)=>{const{__scopeSlider:a,onSlideStart:s,onSlideMove:f,onSlideEnd:g,onHomeKeyDown:y,onEndKeyDown:E,onStepKeyDown:A,...b}=e,T=lf(Ms,a);return F.jsx(Cn.span,{...b,ref:r,onKeyDown:tn(e.onKeyDown,x=>{x.key==="Home"?(y(x),x.preventDefault()):x.key==="End"?(E(x),x.preventDefault()):wv.concat(bv).includes(x.key)&&(A(x),x.preventDefault())}),onPointerDown:tn(e.onPointerDown,x=>{const S=x.target;S.setPointerCapture(x.pointerId),x.preventDefault(),T.thumbs.has(S)?S.focus():s(x)}),onPointerMove:tn(e.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&f(x)}),onPointerUp:tn(e.onPointerUp,x=>{const S=x.target;S.hasPointerCapture(x.pointerId)&&(S.releasePointerCapture(x.pointerId),g(x))})})}),Rv="SliderTrack",Nv=B.forwardRef((e,r)=>{const{__scopeSlider:a,...s}=e,f=lf(Rv,a);return F.jsx(Cn.span,{"data-disabled":f.disabled?"":void 0,"data-orientation":f.orientation,...s,ref:r})});Nv.displayName=Rv;var E0="SliderRange",Ov=B.forwardRef((e,r)=>{const{__scopeSlider:a,...s}=e,f=lf(E0,a),g=Sv(E0,a),y=B.useRef(null),E=Zn(r,y),A=f.values.length,b=f.values.map(S=>Dv(S,f.min,f.max)),T=A>1?Math.min(...b):0,x=100-Math.max(...b);return F.jsx(Cn.span,{"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,...s,ref:E,style:{...e.style,[g.startEdge]:T+"%",[g.endEdge]:x+"%"}})});Ov.displayName=E0;var A0="SliderThumb",Iv=B.forwardRef((e,r)=>{const a=I4(e.__scopeSlider),[s,f]=B.useState(null),g=Zn(r,E=>f(E)),y=B.useMemo(()=>s?a().findIndex(E=>E.ref.current===s):-1,[a,s]);return F.jsx(k4,{...e,ref:g,index:y})}),k4=B.forwardRef((e,r)=>{const{__scopeSlider:a,index:s,name:f,...g}=e,y=lf(A0,a),E=Sv(A0,a),[A,b]=B.useState(null),T=Zn(r,Z=>b(Z)),x=A?y.form||!!A.closest("form"):!0,S=O4(A),R=y.values[s],k=R===void 0?0:Dv(R,y.min,y.max),I=U4(s,y.values.length),z=S==null?void 0:S[E.size],L=z?j4(z,k,E.direction):0;return B.useEffect(()=>{if(A)return y.thumbs.add(A),()=>{y.thumbs.delete(A)}},[A,y.thumbs]),F.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[E.startEdge]:`calc(${k}% + ${L}px)`},children:[F.jsx(_0.ItemSlot,{scope:e.__scopeSlider,children:F.jsx(Cn.span,{role:"slider","aria-label":e["aria-label"]||I,"aria-valuemin":y.min,"aria-valuenow":R,"aria-valuemax":y.max,"aria-orientation":y.orientation,"data-orientation":y.orientation,"data-disabled":y.disabled?"":void 0,tabIndex:y.disabled?void 0:0,...g,ref:T,style:R===void 0?{display:"none"}:e.style,onFocus:tn(e.onFocus,()=>{y.valueIndexToChangeRef.current=s})})}),x&&F.jsx(Mv,{name:f??(y.name?y.name+(y.values.length>1?"[]":""):void 0),form:y.form,value:R},s)]})});Iv.displayName=A0;var z4="RadioBubbleInput",Mv=B.forwardRef(({__scopeSlider:e,value:r,...a},s)=>{const f=B.useRef(null),g=Zn(f,s),y=N4(r);return B.useEffect(()=>{const E=f.current;if(!E)return;const A=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(A,"value").set;if(y!==r&&T){const x=new Event("input",{bubbles:!0});T.call(E,r),E.dispatchEvent(x)}},[y,r]),F.jsx(Cn.input,{style:{display:"none"},...a,ref:g,defaultValue:r})});Mv.displayName=z4;function P4(e=[],r,a){const s=[...e];return s[a]=r,s.sort((f,g)=>f-g)}function Dv(e,r,a){const g=100/(a-r)*(e-r);return vv(g,[0,100])}function U4(e,r){return r>2?`Value ${e+1} of ${r}`:r===2?["Minimum","Maximum"][e]:void 0}function F4(e,r){if(e.length===1)return 0;const a=e.map(f=>Math.abs(f-r)),s=Math.min(...a);return a.indexOf(s)}function j4(e,r,a){const s=e/2,g=J0([0,50],[0,s]);return(s-g(r)*a)*a}function V4(e){return e.slice(0,-1).map((r,a)=>e[a+1]-r)}function H4(e,r){if(r>0){const a=V4(e);return Math.min(...a)>=r}return!0}function J0(e,r){return a=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const s=(r[1]-r[0])/(e[1]-e[0]);return r[0]+s*(a-e[0])}}function G4(e){return(String(e).split(".")[1]||"").length}function Z4(e,r){const a=Math.pow(10,r);return Math.round(e*a)/a}var X4=Av,Y4=Nv,q4=Ov,W4=Iv;function i0({className:e,defaultValue:r,value:a,min:s=0,max:f=100,...g}){const y=B.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[s,f],[a,r,s,f]);return F.jsxs(X4,{"data-slot":"slider",defaultValue:r,value:a,min:s,max:f,className:Wt("relative flex w-full cursor-pointer touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...g,children:[F.jsx(Y4,{"data-slot":"slider-track",className:Wt("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:F.jsx(q4,{"data-slot":"slider-range",className:Wt("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:y.length},(E,A)=>F.jsx(W4,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 cursor-pointer rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},A))]})}function Bv({className:e,compact:r}){const{masterVolume:a,musicVolume:s,sfxVolume:f,setMasterVolume:g,setMusicVolume:y,setSfxVolume:E}=TE();return F.jsxs("div",{className:Wt("flex flex-col gap-3",r&&"gap-1",e),children:[F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(aA,{className:"text-muted-foreground h-4 w-4"}),F.jsx("span",{className:"text-sm font-medium",children:"Volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("label",{className:"text-muted-foreground text-xs",children:"Master"}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(a*100),"%"]})]}),F.jsx(i0,{value:[a*100],onValueChange:A=>g(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"Master volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsxs("div",{className:"flex items-center gap-1.5",children:[F.jsx(KE,{className:"text-muted-foreground h-3 w-3"}),F.jsx("label",{className:"text-muted-foreground text-xs",children:"Music"})]}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(s*100),"%"]})]}),F.jsx(i0,{value:[s*100],onValueChange:A=>y(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"Music volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsxs("div",{className:"flex items-center gap-1.5",children:[F.jsx(VE,{className:"text-muted-foreground h-3 w-3"}),F.jsx("label",{className:"text-muted-foreground text-xs",children:"SFX"})]}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(f*100),"%"]})]}),F.jsx(i0,{value:[f*100],onValueChange:A=>E(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"SFX volume"})]})]})}const M2={idle:"Idle",connecting:"Waiting for server…",connected:"Ready for controllers",disconnected:"Disconnected",reconnecting:"Reconnecting…"},K4=({roomId:e,joinUrl:r,connectionStatus:a,players:s,lastError:f,gameState:g,onTogglePlayPause:y,isChildMode:E=!1})=>{const[A,b]=B.useState(null),[T,x]=B.useState(null),[S,R]=B.useState(!1),[k,I]=B.useState(null);B.useEffect(()=>{if(E)return;let j=!0;return e4.toDataURL(r,{margin:1,color:{dark:"#0f172a",light:"#ffffff"},width:320}).then(ae=>{j&&(b(ae),x(null))}).catch(ae=>{j&&x(ae.message)}),()=>{j=!1}},[r,E]);const z=async()=>{if(r)try{await navigator.clipboard.writeText(r),R(!0),setTimeout(()=>R(!1),2e3)}catch{const j=document.createElement("textarea");j.value=r,j.style.position="fixed",j.style.opacity="0",document.body.appendChild(j),j.select();try{document.execCommand("copy"),R(!0),setTimeout(()=>R(!1),2e3)}catch{}document.body.removeChild(j)}},L=()=>{r&&window.open(r,"_blank","noopener,noreferrer")},Z=async j=>{try{await navigator.clipboard.writeText(j),console.log(`Copied player ID: ${j}`),I(j),setTimeout(()=>I(null),1e3)}catch{const ae=document.createElement("textarea");ae.value=j,ae.style.position="fixed",ae.style.opacity="0",document.body.appendChild(ae),ae.select();try{document.execCommand("copy"),console.log(`Copied player ID: ${j}`),I(j),setTimeout(()=>I(null),1e3)}catch{}document.body.removeChild(ae)}},H=B.useMemo(()=>{switch(a){case"connected":return"default";case"connecting":case"reconnecting":return"secondary";default:return"destructive"}},[a]);return E?null:F.jsxs("div",{className:"dark",children:[!E&&F.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-99999",children:F.jsx("div",{className:"mx-auto w-full",children:F.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[F.jsx("div",{className:"flex items-center gap-3",children:F.jsxs("div",{children:[F.jsx("p",{className:"text-muted-foreground text-xs tracking-[0.18em] uppercase",children:"Room"}),F.jsx("p",{className:"text-foreground text-lg font-semibold",children:e})]})}),F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[s.length>0&&F.jsxs("div",{className:"flex items-center -space-x-2",children:[s.slice(0,4).map(j=>F.jsx(jl,{player:j,size:"sm"},j.id)),s.length>4&&F.jsxs("div",{className:"border-background bg-muted flex h-8 w-8 items-center justify-center rounded-full border-2 text-xs font-medium",children:["+",s.length-4]})]}),y&&F.jsx(Yr,{type:"button",variant:"ghost",size:"icon",onClick:y,"aria-label":g==="playing"?"Pause":"Play",className:"h-8 w-8",children:g==="playing"?F.jsx(ny,{className:"h-4 w-4"}):F.jsx(ku,{className:"h-4 w-4"})})]})]})})}),g==="paused"&&F.jsx("div",{className:"pointer-events-none fixed inset-0 z-99998 flex items-center justify-center p-4",children:F.jsx("div",{className:"pointer-events-auto w-full max-w-2xl",children:F.jsx(o4,{className:"bg-card/20 flex max-h-[85vh] flex-col overflow-hidden border py-0 shadow-lg backdrop-blur-sm",children:F.jsxs(T4,{defaultValue:E?"settings":"room-code",className:"flex h-full w-full flex-col gap-0",children:[F.jsxs(R4,{className:"border-border grid w-full shrink-0 grid-cols-2 rounded-none border-b bg-transparent p-0",children:[!E&&F.jsxs(n0,{value:"room-code",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(ry,{className:"h-4 w-4"}),"Room Code"]}),E&&F.jsxs(n0,{value:"info",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(qE,{className:"h-4 w-4"}),"Platform"]}),F.jsxs(n0,{value:"settings",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(rA,{className:"h-4 w-4"}),"Settings"]})]}),!E&&F.jsx(r0,{value:"room-code",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx("div",{className:"p-6",children:F.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-[auto_1fr]",children:[F.jsxs("div",{className:"flex flex-col items-start gap-4",children:[F.jsxs("div",{className:"space-y-2",children:[F.jsx(O2,{className:"text-3xl font-bold tracking-wider",children:e}),F.jsx(e0,{variant:H,className:"w-fit",children:M2[a]})]}),F.jsx("div",{className:"border-border bg-card w-48 shrink-0 overflow-hidden rounded-lg border-2 shadow-md",children:A?F.jsx("img",{src:A,alt:`Join room ${e}`,className:"w-full rounded bg-white"}):F.jsx("div",{className:"text-muted-foreground flex h-48 items-center justify-center text-sm",children:T?`QR failed: ${T}`:"Generating QR code…"})})]}),F.jsxs("div",{className:"flex flex-col gap-6",children:[F.jsxs("div",{className:"space-y-3",children:[F.jsx(I2,{className:"text-xs tracking-[0.18em] uppercase",children:"Join URL"}),F.jsxs("div",{className:"flex gap-2",children:[F.jsx("input",{type:"text",readOnly:!0,value:r,className:"bg-background border-input text-foreground focus:ring-ring flex h-10 w-full rounded-md border px-3 py-2 font-mono text-xs focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"}),F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:z,className:"h-10 shrink-0","aria-label":"Copy join URL",children:S?F.jsx(kE,{className:"h-4 w-4"}):F.jsx(PE,{className:"h-4 w-4"})}),F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:L,className:"h-10 shrink-0","aria-label":"Open join URL in new tab",children:F.jsx(FE,{className:"h-4 w-4"})})]})]}),F.jsx("div",{className:"space-y-3",children:s.length===0?F.jsx("p",{className:"text-sm text-white",children:"Waiting for controllers to join…"}):F.jsxs(F.Fragment,{children:[F.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Connected Players (",s.length,")"]}),F.jsx("ul",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.map(j=>F.jsx("li",{className:"flex min-w-0 flex-col items-start gap-2",children:F.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[F.jsx(jl,{player:j,size:"md"}),F.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden",children:[F.jsx("span",{className:"text-card-foreground truncate text-sm font-medium",children:j.label}),F.jsx("div",{onClick:()=>Z(j.id),className:"text-muted-foreground m-0 inline min-w-0 cursor-pointer truncate border-0 font-mono text-xs transition-colors hover:text-white",title:"Click to copy player ID",children:k===j.id?"Copied!":j.id.slice(0,8)})]})]})},j.id))})]})}),f&&F.jsx(r4,{variant:"destructive",className:"w-full",children:F.jsx(i4,{children:f})}),y&&F.jsx("div",{className:"mt-auto flex justify-end",children:F.jsxs(Yr,{type:"button",onClick:y,size:"lg",children:[F.jsx(ku,{className:"mr-2 h-5 w-5"}),"Start Game"]})})]})]})})}),E&&F.jsx(r0,{value:"info",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx("div",{className:"p-6",children:F.jsxs("div",{className:"space-y-6",children:[F.jsxs("div",{className:"space-y-2",children:[F.jsx(O2,{className:"text-2xl font-bold tracking-wider",children:"Connected to Platform"}),F.jsx(I2,{children:"This game is running inside the Air Jam Platform."})]}),F.jsxs("div",{className:"space-y-3",children:[F.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Connected Players (",s.length,")"]}),F.jsx("ul",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.map(j=>F.jsx("li",{className:"flex min-w-0 flex-col items-start gap-2",children:F.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[F.jsx(jl,{player:j,size:"md"}),F.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden",children:F.jsx("span",{className:"text-card-foreground truncate text-sm font-medium",children:j.label})})]})},j.id))})]}),y&&F.jsx("div",{className:"pt-2",children:F.jsxs(Yr,{type:"button",onClick:y,size:"lg",children:[F.jsx(ku,{className:"mr-2 h-5 w-5"}),"Resume Game"]})})]})})}),F.jsx(r0,{value:"settings",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx(s4,{className:"pt-6 pb-6",children:F.jsxs("div",{className:"space-y-6",children:[F.jsx("div",{className:"space-y-4",children:F.jsx(Bv,{})}),F.jsxs("div",{className:"space-y-4 border-t pt-4",children:[F.jsx("h3",{className:"text-sm font-semibold",children:"Connection"}),F.jsxs("div",{className:"space-y-2",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Status"}),F.jsx(e0,{variant:H,children:M2[a]})]}),F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Room ID"}),F.jsx("span",{className:"font-mono text-sm",children:e})]}),F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Players"}),F.jsx("span",{className:"text-sm font-medium",children:s.length})]})]})]}),F.jsxs("div",{className:"space-y-4 border-t pt-4",children:[F.jsx("h3",{className:"text-sm font-semibold",children:"Display"}),F.jsx("div",{className:"space-y-2",children:F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Game State"}),F.jsx(e0,{variant:"outline",className:"capitalize",children:g})]})})]})]})})})]})})})})]})},Q4=()=>{const[e,r]=B.useState(!1);B.useEffect(()=>{const g=()=>{const y=document;r(!!(document.fullscreenElement||y.webkitFullscreenElement||y.mozFullScreenElement||y.msFullscreenElement))};return document.addEventListener("fullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("msfullscreenchange",g),()=>{document.removeEventListener("fullscreenchange",g),document.removeEventListener("webkitfullscreenchange",g),document.removeEventListener("mozfullscreenchange",g),document.removeEventListener("msfullscreenchange",g)}},[]);const a=B.useCallback(async()=>{try{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.mozFullScreenElement||g.msFullscreenElement)&&(document.exitFullscreen?await document.exitFullscreen():g.webkitExitFullscreen?await g.webkitExitFullscreen():g.mozCancelFullScreen?await g.mozCancelFullScreen():g.msExitFullscreen&&await g.msExitFullscreen())}catch(g){console.error("Error exiting fullscreen:",g)}},[]),s=B.useCallback(async g=>{try{const y=g||document.documentElement;y.requestFullscreen?await y.requestFullscreen():y.webkitRequestFullscreen?await y.webkitRequestFullscreen():y.mozRequestFullScreen?await y.mozRequestFullScreen():y.msRequestFullscreen&&await y.msRequestFullscreen()}catch(y){console.error("Error entering fullscreen:",y)}},[]),f=B.useCallback(async g=>{e?await a():await s(g)},[e,a,s]);return{isFullscreen:e,enterFullscreen:s,exitFullscreen:a,toggleFullscreen:f}},$0=()=>{if(typeof window>"u")return"standalone";try{return window.self!==window.top?"platform":"standalone"}catch{return"platform"}};var Be;(function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Be||(Be={}));var D2=new Map([[Be.QR_CODE,"QR_CODE"],[Be.AZTEC,"AZTEC"],[Be.CODABAR,"CODABAR"],[Be.CODE_39,"CODE_39"],[Be.CODE_93,"CODE_93"],[Be.CODE_128,"CODE_128"],[Be.DATA_MATRIX,"DATA_MATRIX"],[Be.MAXICODE,"MAXICODE"],[Be.ITF,"ITF"],[Be.EAN_13,"EAN_13"],[Be.EAN_8,"EAN_8"],[Be.PDF_417,"PDF_417"],[Be.RSS_14,"RSS_14"],[Be.RSS_EXPANDED,"RSS_EXPANDED"],[Be.UPC_A,"UPC_A"],[Be.UPC_E,"UPC_E"],[Be.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),B2;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(B2||(B2={}));function J4(e){return Object.values(Be).includes(e)}var Gu;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(Gu||(Gu={}));var $4=(function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[Gu.SCAN_TYPE_CAMERA,Gu.SCAN_TYPE_FILE],e})(),Lv=(function(){function e(r,a){this.format=r,this.formatName=a}return e.prototype.toString=function(){return this.formatName},e.create=function(r){if(!D2.has(r))throw"".concat(r," not in html5QrcodeSupportedFormatsTextMap");return new e(r,D2.get(r))},e})(),L2=(function(){function e(){}return e.createFromText=function(r){var a={text:r};return{decodedText:r,result:a}},e.createFromQrcodeResult=function(r){return{decodedText:r.text,result:r}},e})(),C0;(function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(C0||(C0={}));var e8=(function(){function e(){}return e.createFrom=function(r){return{errorMessage:r,type:C0.UNKWOWN_ERROR}},e})(),t8=(function(){function e(r){this.verbose=r}return e.prototype.log=function(r){this.verbose&&console.log(r)},e.prototype.warn=function(r){this.verbose&&console.warn(r)},e.prototype.logError=function(r,a){(this.verbose||a===!0)&&console.error(r)},e.prototype.logErrors=function(r){if(r.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(r)},e})();function Ki(e){return typeof e>"u"||e===null}var ys=(function(){function e(){}return e.codeParseError=function(r){return"QR code parse error, error = ".concat(r)},e.errorGettingUserMedia=function(r){return"Error getting userMedia, error = ".concat(r)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e})(),kv=(function(){function e(){}return e.isMediaStreamConstraintsValid=function(r,a){if(typeof r!="object"){var s=typeof r;return a.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(s,"."),!0),!1}for(var f=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],g=new Set(f),y=Object.keys(r),E=0,A=y;E<A.length;E++){var b=A[E];if(g.has(b))return a.logError("".concat(b," is not supported videoConstaints."),!0),!1}return!0},e})(),zl={exports:{}},n8=zl.exports,k2;function r8(){return k2||(k2=1,(function(e,r){(function(a,s){s(r)})(n8,(function(a){function s(M){return M==null}var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,n){M.__proto__=n}||function(M,n){for(var o in n)n.hasOwnProperty(o)&&(M[o]=n[o])};function g(M,n){f(M,n);function o(){this.constructor=M}M.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}function y(M,n){var o=Object.setPrototypeOf;o?o(M,n):M.__proto__=n}function E(M,n){n===void 0&&(n=M.constructor);var o=Error.captureStackTrace;o&&o(M,n)}var A=(function(M){g(n,M);function n(o){var l=this.constructor,u=M.call(this,o)||this;return Object.defineProperty(u,"name",{value:l.name,enumerable:!1}),y(u,l.prototype),E(u),u}return n})(Error);class b extends A{constructor(n=void 0){super(n),this.message=n}getKind(){return this.constructor.kind}}b.kind="Exception";class T extends b{}T.kind="ArgumentException";class x extends b{}x.kind="IllegalArgumentException";class S{constructor(n){if(this.binarizer=n,n===null)throw new x("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(n,o){return this.binarizer.getBlackRow(n,o)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(n,o,l,u){const d=this.binarizer.getLuminanceSource().crop(n,o,l,u);return new S(this.binarizer.createBinarizer(d))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new S(this.binarizer.createBinarizer(n))}rotateCounterClockwise45(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new S(this.binarizer.createBinarizer(n))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class R extends b{static getChecksumInstance(){return new R}}R.kind="ChecksumException";class k{constructor(n){this.source=n}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class I{static arraycopy(n,o,l,u,d){for(;d--;)l[u++]=n[o++]}static currentTimeMillis(){return Date.now()}}class z extends b{}z.kind="IndexOutOfBoundsException";class L extends z{constructor(n=void 0,o=void 0){super(o),this.index=n,this.message=o}}L.kind="ArrayIndexOutOfBoundsException";class Z{static fill(n,o){for(let l=0,u=n.length;l<u;l++)n[l]=o}static fillWithin(n,o,l,u){Z.rangeCheck(n.length,o,l);for(let d=o;d<l;d++)n[d]=u}static rangeCheck(n,o,l){if(o>l)throw new x("fromIndex("+o+") > toIndex("+l+")");if(o<0)throw new L(o);if(l>n)throw new L(l)}static asList(...n){return n}static create(n,o,l){return Array.from({length:n}).map(d=>Array.from({length:o}).fill(l))}static createInt32Array(n,o,l){return Array.from({length:n}).map(d=>Int32Array.from({length:o}).fill(l))}static equals(n,o){if(!n||!o||!n.length||!o.length||n.length!==o.length)return!1;for(let l=0,u=n.length;l<u;l++)if(n[l]!==o[l])return!1;return!0}static hashCode(n){if(n===null)return 0;let o=1;for(const l of n)o=31*o+l;return o}static fillUint8Array(n,o){for(let l=0;l!==n.length;l++)n[l]=o}static copyOf(n,o){return n.slice(0,o)}static copyOfUint8Array(n,o){if(n.length<=o){const l=new Uint8Array(o);return l.set(n),l}return n.slice(0,o)}static copyOfRange(n,o,l){const u=l-o,d=new Int32Array(u);return I.arraycopy(n,o,d,0,u),d}static binarySearch(n,o,l){l===void 0&&(l=Z.numberComparator);let u=0,d=n.length-1;for(;u<=d;){const m=d+u>>1,p=l(o,n[m]);if(p>0)u=m+1;else if(p<0)d=m-1;else return m}return-u-1}static numberComparator(n,o){return n-o}}class H{static numberOfTrailingZeros(n){let o;if(n===0)return 32;let l=31;return o=n<<16,o!==0&&(l-=16,n=o),o=n<<8,o!==0&&(l-=8,n=o),o=n<<4,o!==0&&(l-=4,n=o),o=n<<2,o!==0&&(l-=2,n=o),l-(n<<1>>>31)}static numberOfLeadingZeros(n){if(n===0)return 32;let o=1;return n>>>16||(o+=16,n<<=16),n>>>24||(o+=8,n<<=8),n>>>28||(o+=4,n<<=4),n>>>30||(o+=2,n<<=2),o-=n>>>31,o}static toHexString(n){return n.toString(16)}static toBinaryString(n){return String(parseInt(String(n),2))}static bitCount(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),n=n+(n>>>4)&252645135,n=n+(n>>>8),n=n+(n>>>16),n&63}static truncDivision(n,o){return Math.trunc(n/o)}static parseInt(n,o=void 0){return parseInt(n,o)}}H.MIN_VALUE_32_BITS=-2147483648,H.MAX_VALUE=Number.MAX_SAFE_INTEGER;class j{constructor(n,o){n===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=n,o==null?this.bits=j.makeArray(n):this.bits=o)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(n){if(n>this.bits.length*32){const o=j.makeArray(n);I.arraycopy(this.bits,0,o,0,this.bits.length),this.bits=o}}get(n){return(this.bits[Math.floor(n/32)]&1<<(n&31))!==0}set(n){this.bits[Math.floor(n/32)]|=1<<(n&31)}flip(n){this.bits[Math.floor(n/32)]^=1<<(n&31)}getNextSet(n){const o=this.size;if(n>=o)return o;const l=this.bits;let u=Math.floor(n/32),d=l[u];d&=~((1<<(n&31))-1);const m=l.length;for(;d===0;){if(++u===m)return o;d=l[u]}const p=u*32+H.numberOfTrailingZeros(d);return p>o?o:p}getNextUnset(n){const o=this.size;if(n>=o)return o;const l=this.bits;let u=Math.floor(n/32),d=~l[u];d&=~((1<<(n&31))-1);const m=l.length;for(;d===0;){if(++u===m)return o;d=~l[u]}const p=u*32+H.numberOfTrailingZeros(d);return p>o?o:p}setBulk(n,o){this.bits[Math.floor(n/32)]=o}setRange(n,o){if(o<n||n<0||o>this.size)throw new x;if(o===n)return;o--;const l=Math.floor(n/32),u=Math.floor(o/32),d=this.bits;for(let m=l;m<=u;m++){const p=m>l?0:n&31,C=(2<<(m<u?31:o&31))-(1<<p);d[m]|=C}}clear(){const n=this.bits.length,o=this.bits;for(let l=0;l<n;l++)o[l]=0}isRange(n,o,l){if(o<n||n<0||o>this.size)throw new x;if(o===n)return!0;o--;const u=Math.floor(n/32),d=Math.floor(o/32),m=this.bits;for(let p=u;p<=d;p++){const w=p>u?0:n&31,N=(2<<(p<d?31:o&31))-(1<<w)&4294967295;if((m[p]&N)!==(l?N:0))return!1}return!0}appendBit(n){this.ensureCapacity(this.size+1),n&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(n,o){if(o<0||o>32)throw new x("Num bits must be between 0 and 32");this.ensureCapacity(this.size+o);for(let l=o;l>0;l--)this.appendBit((n>>l-1&1)===1)}appendBitArray(n){const o=n.size;this.ensureCapacity(this.size+o);for(let l=0;l<o;l++)this.appendBit(n.get(l))}xor(n){if(this.size!==n.size)throw new x("Sizes don't match");const o=this.bits;for(let l=0,u=o.length;l<u;l++)o[l]^=n.bits[l]}toBytes(n,o,l,u){for(let d=0;d<u;d++){let m=0;for(let p=0;p<8;p++)this.get(n)&&(m|=1<<7-p),n++;o[l+d]=m}}getBitArray(){return this.bits}reverse(){const n=new Int32Array(this.bits.length),o=Math.floor((this.size-1)/32),l=o+1,u=this.bits;for(let d=0;d<l;d++){let m=u[d];m=m>>1&1431655765|(m&1431655765)<<1,m=m>>2&858993459|(m&858993459)<<2,m=m>>4&252645135|(m&252645135)<<4,m=m>>8&16711935|(m&16711935)<<8,m=m>>16&65535|(m&65535)<<16,n[o-d]=m}if(this.size!==l*32){const d=l*32-this.size;let m=n[0]>>>d;for(let p=1;p<l;p++){const w=n[p];m|=w<<32-d,n[p-1]=m,m=w>>>d}n[l-1]=m}this.bits=n}static makeArray(n){return new Int32Array(Math.floor((n+31)/32))}equals(n){if(!(n instanceof j))return!1;const o=n;return this.size===o.size&&Z.equals(this.bits,o.bits)}hashCode(){return 31*this.size+Z.hashCode(this.bits)}toString(){let n="";for(let o=0,l=this.size;o<l;o++)(o&7)===0&&(n+=" "),n+=this.get(o)?"X":".";return n}clone(){return new j(this.size,this.bits.slice())}}var ae;(function(M){M[M.OTHER=0]="OTHER",M[M.PURE_BARCODE=1]="PURE_BARCODE",M[M.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",M[M.TRY_HARDER=3]="TRY_HARDER",M[M.CHARACTER_SET=4]="CHARACTER_SET",M[M.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",M[M.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",M[M.ASSUME_GS1=7]="ASSUME_GS1",M[M.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",M[M.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",M[M.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(ae||(ae={}));var ee=ae;class X extends b{static getFormatInstance(){return new X}}X.kind="FormatException";var de;(function(M){M[M.Cp437=0]="Cp437",M[M.ISO8859_1=1]="ISO8859_1",M[M.ISO8859_2=2]="ISO8859_2",M[M.ISO8859_3=3]="ISO8859_3",M[M.ISO8859_4=4]="ISO8859_4",M[M.ISO8859_5=5]="ISO8859_5",M[M.ISO8859_6=6]="ISO8859_6",M[M.ISO8859_7=7]="ISO8859_7",M[M.ISO8859_8=8]="ISO8859_8",M[M.ISO8859_9=9]="ISO8859_9",M[M.ISO8859_10=10]="ISO8859_10",M[M.ISO8859_11=11]="ISO8859_11",M[M.ISO8859_13=12]="ISO8859_13",M[M.ISO8859_14=13]="ISO8859_14",M[M.ISO8859_15=14]="ISO8859_15",M[M.ISO8859_16=15]="ISO8859_16",M[M.SJIS=16]="SJIS",M[M.Cp1250=17]="Cp1250",M[M.Cp1251=18]="Cp1251",M[M.Cp1252=19]="Cp1252",M[M.Cp1256=20]="Cp1256",M[M.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",M[M.UTF8=22]="UTF8",M[M.ASCII=23]="ASCII",M[M.Big5=24]="Big5",M[M.GB18030=25]="GB18030",M[M.EUC_KR=26]="EUC_KR"})(de||(de={}));class Q{constructor(n,o,l,...u){this.valueIdentifier=n,this.name=l,typeof o=="number"?this.values=Int32Array.from([o]):this.values=o,this.otherEncodingNames=u,Q.VALUE_IDENTIFIER_TO_ECI.set(n,this),Q.NAME_TO_ECI.set(l,this);const d=this.values;for(let m=0,p=d.length;m!==p;m++){const w=d[m];Q.VALUES_TO_ECI.set(w,this)}for(const m of u)Q.NAME_TO_ECI.set(m,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(n){if(n<0||n>=900)throw new X("incorect value");const o=Q.VALUES_TO_ECI.get(n);if(o===void 0)throw new X("incorect value");return o}static getCharacterSetECIByName(n){const o=Q.NAME_TO_ECI.get(n);if(o===void 0)throw new X("incorect value");return o}equals(n){if(!(n instanceof Q))return!1;const o=n;return this.getName()===o.getName()}}Q.VALUE_IDENTIFIER_TO_ECI=new Map,Q.VALUES_TO_ECI=new Map,Q.NAME_TO_ECI=new Map,Q.Cp437=new Q(de.Cp437,Int32Array.from([0,2]),"Cp437"),Q.ISO8859_1=new Q(de.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),Q.ISO8859_2=new Q(de.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),Q.ISO8859_3=new Q(de.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),Q.ISO8859_4=new Q(de.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),Q.ISO8859_5=new Q(de.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),Q.ISO8859_6=new Q(de.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),Q.ISO8859_7=new Q(de.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),Q.ISO8859_8=new Q(de.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),Q.ISO8859_9=new Q(de.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),Q.ISO8859_10=new Q(de.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),Q.ISO8859_11=new Q(de.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),Q.ISO8859_13=new Q(de.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),Q.ISO8859_14=new Q(de.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),Q.ISO8859_15=new Q(de.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),Q.ISO8859_16=new Q(de.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),Q.SJIS=new Q(de.SJIS,20,"SJIS","Shift_JIS"),Q.Cp1250=new Q(de.Cp1250,21,"Cp1250","windows-1250"),Q.Cp1251=new Q(de.Cp1251,22,"Cp1251","windows-1251"),Q.Cp1252=new Q(de.Cp1252,23,"Cp1252","windows-1252"),Q.Cp1256=new Q(de.Cp1256,24,"Cp1256","windows-1256"),Q.UnicodeBigUnmarked=new Q(de.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),Q.UTF8=new Q(de.UTF8,26,"UTF8","UTF-8"),Q.ASCII=new Q(de.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),Q.Big5=new Q(de.Big5,28,"Big5"),Q.GB18030=new Q(de.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),Q.EUC_KR=new Q(de.EUC_KR,30,"EUC_KR","EUC-KR");class Oe extends b{}Oe.kind="UnsupportedOperationException";class ue{static decode(n,o){const l=this.encodingName(o);return this.customDecoder?this.customDecoder(n,l):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(l)?this.decodeFallback(n,l):new TextDecoder(l).decode(n)}static shouldDecodeOnFallback(n){return!ue.isBrowser()&&n==="ISO-8859-1"}static encode(n,o){const l=this.encodingName(o);return this.customEncoder?this.customEncoder(n,l):typeof TextEncoder>"u"?this.encodeFallback(n):new TextEncoder().encode(n)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(n){return typeof n=="string"?n:n.getName()}static encodingCharacterSet(n){return n instanceof Q?n:Q.getCharacterSetECIByName(n)}static decodeFallback(n,o){const l=this.encodingCharacterSet(o);if(ue.isDecodeFallbackSupported(l)){let u="";for(let d=0,m=n.length;d<m;d++){let p=n[d].toString(16);p.length<2&&(p="0"+p),u+="%"+p}return decodeURIComponent(u)}if(l.equals(Q.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(n.buffer));throw new Oe(`Encoding ${this.encodingName(o)} not supported by fallback.`)}static isDecodeFallbackSupported(n){return n.equals(Q.UTF8)||n.equals(Q.ISO8859_1)||n.equals(Q.ASCII)}static encodeFallback(n){const l=btoa(unescape(encodeURIComponent(n))).split(""),u=[];for(let d=0;d<l.length;d++)u.push(l[d].charCodeAt(0));return new Uint8Array(u)}}class ${static castAsNonUtf8Char(n,o=null){const l=o?o.getName():this.ISO88591;return ue.decode(new Uint8Array([n]),l)}static guessEncoding(n,o){if(o!=null&&o.get(ee.CHARACTER_SET)!==void 0)return o.get(ee.CHARACTER_SET).toString();const l=n.length;let u=!0,d=!0,m=!0,p=0,w=0,C=0,N=0,D=0,P=0,G=0,q=0,K=0,ie=0,he=0;const Re=n.length>3&&n[0]===239&&n[1]===187&&n[2]===191;for(let Ae=0;Ae<l&&(u||d||m);Ae++){const Ee=n[Ae]&255;m&&(p>0?(Ee&128)===0?m=!1:p--:(Ee&128)!==0&&((Ee&64)===0?m=!1:(p++,(Ee&32)===0?w++:(p++,(Ee&16)===0?C++:(p++,(Ee&8)===0?N++:m=!1))))),u&&(Ee>127&&Ee<160?u=!1:Ee>159&&(Ee<192||Ee===215||Ee===247)&&he++),d&&(D>0?Ee<64||Ee===127||Ee>252?d=!1:D--:Ee===128||Ee===160||Ee>239?d=!1:Ee>160&&Ee<224?(P++,q=0,G++,G>K&&(K=G)):Ee>127?(D++,G=0,q++,q>ie&&(ie=q)):(G=0,q=0))}return m&&p>0&&(m=!1),d&&D>0&&(d=!1),m&&(Re||w+C+N>0)?$.UTF8:d&&($.ASSUME_SHIFT_JIS||K>=3||ie>=3)?$.SHIFT_JIS:u&&d?K===2&&P===2||he*10>=l?$.SHIFT_JIS:$.ISO88591:u?$.ISO88591:d?$.SHIFT_JIS:m?$.UTF8:$.PLATFORM_DEFAULT_ENCODING}static format(n,...o){let l=-1;function u(m,p,w,C,N,D){if(m==="%%")return"%";if(o[++l]===void 0)return;m=C?parseInt(C.substr(1)):void 0;let P=N?parseInt(N.substr(1)):void 0,G;switch(D){case"s":G=o[l];break;case"c":G=o[l][0];break;case"f":G=parseFloat(o[l]).toFixed(m);break;case"p":G=parseFloat(o[l]).toPrecision(m);break;case"e":G=parseFloat(o[l]).toExponential(m);break;case"x":G=parseInt(o[l]).toString(P||16);break;case"d":G=parseFloat(parseInt(o[l],P||10).toPrecision(m)).toFixed(0);break}G=typeof G=="object"?JSON.stringify(G):(+G).toString(P);let q=parseInt(w),K=w&&w[0]+""=="0"?"0":" ";for(;G.length<q;)G=p!==void 0?G+K:K+G;return G}let d=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(d,u)}static getBytes(n,o){return ue.encode(n,o)}static getCharCode(n,o=0){return n.charCodeAt(o)}static getCharAt(n){return String.fromCharCode(n)}}$.SHIFT_JIS=Q.SJIS.getName(),$.GB2312="GB2312",$.ISO88591=Q.ISO8859_1.getName(),$.EUC_JP="EUC_JP",$.UTF8=Q.UTF8.getName(),$.PLATFORM_DEFAULT_ENCODING=$.UTF8,$.ASSUME_SHIFT_JIS=!1;class pe{constructor(n=""){this.value=n}enableDecoding(n){return this.encoding=n,this}append(n){return typeof n=="string"?this.value+=n.toString():this.encoding?this.value+=$.castAsNonUtf8Char(n,this.encoding):this.value+=String.fromCharCode(n),this}appendChars(n,o,l){for(let u=o;o<o+l;u++)this.append(n[u]);return this}length(){return this.value.length}charAt(n){return this.value.charAt(n)}deleteCharAt(n){this.value=this.value.substr(0,n)+this.value.substring(n+1)}setCharAt(n,o){this.value=this.value.substr(0,n)+o+this.value.substr(n+1)}substring(n,o){return this.value.substring(n,o)}setLengthToZero(){this.value=""}toString(){return this.value}insert(n,o){this.value=this.value.substr(0,n)+o+this.value.substr(n+o.length)}}class Ce{constructor(n,o,l,u){if(this.width=n,this.height=o,this.rowSize=l,this.bits=u,o==null&&(o=n),this.height=o,n<1||o<1)throw new x("Both dimensions must be greater than 0");l==null&&(l=Math.floor((n+31)/32)),this.rowSize=l,u==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(n){const o=n.length,l=n[0].length,u=new Ce(l,o);for(let d=0;d<o;d++){const m=n[d];for(let p=0;p<l;p++)m[p]&&u.set(p,d)}return u}static parseFromString(n,o,l){if(n===null)throw new x("stringRepresentation cannot be null");const u=new Array(n.length);let d=0,m=0,p=-1,w=0,C=0;for(;C<n.length;)if(n.charAt(C)===`
|
|
230
|
+
`||n.charAt(C)==="\r"){if(d>m){if(p===-1)p=d-m;else if(d-m!==p)throw new x("row lengths do not match");m=d,w++}C++}else if(n.substring(C,C+o.length)===o)C+=o.length,u[d]=!0,d++;else if(n.substring(C,C+l.length)===l)C+=l.length,u[d]=!1,d++;else throw new x("illegal character encountered: "+n.substring(C));if(d>m){if(p===-1)p=d-m;else if(d-m!==p)throw new x("row lengths do not match");w++}const N=new Ce(p,w);for(let D=0;D<d;D++)u[D]&&N.set(Math.floor(D%p),Math.floor(D/p));return N}get(n,o){const l=o*this.rowSize+Math.floor(n/32);return(this.bits[l]>>>(n&31)&1)!==0}set(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]|=1<<(n&31)&4294967295}unset(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]&=~(1<<(n&31)&4294967295)}flip(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]^=1<<(n&31)&4294967295}xor(n){if(this.width!==n.getWidth()||this.height!==n.getHeight()||this.rowSize!==n.getRowSize())throw new x("input matrix dimensions do not match");const o=new j(Math.floor(this.width/32)+1),l=this.rowSize,u=this.bits;for(let d=0,m=this.height;d<m;d++){const p=d*l,w=n.getRow(d,o).getBitArray();for(let C=0;C<l;C++)u[p+C]^=w[C]}}clear(){const n=this.bits,o=n.length;for(let l=0;l<o;l++)n[l]=0}setRegion(n,o,l,u){if(o<0||n<0)throw new x("Left and top must be nonnegative");if(u<1||l<1)throw new x("Height and width must be at least 1");const d=n+l,m=o+u;if(m>this.height||d>this.width)throw new x("The region must fit inside the matrix");const p=this.rowSize,w=this.bits;for(let C=o;C<m;C++){const N=C*p;for(let D=n;D<d;D++)w[N+Math.floor(D/32)]|=1<<(D&31)&4294967295}}getRow(n,o){o==null||o.getSize()<this.width?o=new j(this.width):o.clear();const l=this.rowSize,u=this.bits,d=n*l;for(let m=0;m<l;m++)o.setBulk(m*32,u[d+m]);return o}setRow(n,o){I.arraycopy(o.getBitArray(),0,this.bits,n*this.rowSize,this.rowSize)}rotate180(){const n=this.getWidth(),o=this.getHeight();let l=new j(n),u=new j(n);for(let d=0,m=Math.floor((o+1)/2);d<m;d++)l=this.getRow(d,l),u=this.getRow(o-1-d,u),l.reverse(),u.reverse(),this.setRow(d,u),this.setRow(o-1-d,l)}getEnclosingRectangle(){const n=this.width,o=this.height,l=this.rowSize,u=this.bits;let d=n,m=o,p=-1,w=-1;for(let C=0;C<o;C++)for(let N=0;N<l;N++){const D=u[C*l+N];if(D!==0){if(C<m&&(m=C),C>w&&(w=C),N*32<d){let P=0;for(;(D<<31-P&4294967295)===0;)P++;N*32+P<d&&(d=N*32+P)}if(N*32+31>p){let P=31;for(;!(D>>>P);)P--;N*32+P>p&&(p=N*32+P)}}}return p<d||w<m?null:Int32Array.from([d,m,p-d+1,w-m+1])}getTopLeftOnBit(){const n=this.rowSize,o=this.bits;let l=0;for(;l<o.length&&o[l]===0;)l++;if(l===o.length)return null;const u=l/n;let d=l%n*32;const m=o[l];let p=0;for(;(m<<31-p&4294967295)===0;)p++;return d+=p,Int32Array.from([d,u])}getBottomRightOnBit(){const n=this.rowSize,o=this.bits;let l=o.length-1;for(;l>=0&&o[l]===0;)l--;if(l<0)return null;const u=Math.floor(l/n);let d=Math.floor(l%n)*32;const m=o[l];let p=31;for(;!(m>>>p);)p--;return d+=p,Int32Array.from([d,u])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(n){if(!(n instanceof Ce))return!1;const o=n;return this.width===o.width&&this.height===o.height&&this.rowSize===o.rowSize&&Z.equals(this.bits,o.bits)}hashCode(){let n=this.width;return n=31*n+this.width,n=31*n+this.height,n=31*n+this.rowSize,n=31*n+Z.hashCode(this.bits),n}toString(n="X ",o=" ",l=`
|
|
231
|
+
`){return this.buildToString(n,o,l)}buildToString(n,o,l){let u=new pe;for(let d=0,m=this.height;d<m;d++){for(let p=0,w=this.width;p<w;p++)u.append(this.get(p,d)?n:o);u.append(l)}return u.toString()}clone(){return new Ce(this.width,this.height,this.rowSize,this.bits.slice())}}class re extends b{static getNotFoundInstance(){return new re}}re.kind="NotFoundException";class ne extends k{constructor(n){super(n),this.luminances=ne.EMPTY,this.buckets=new Int32Array(ne.LUMINANCE_BUCKETS)}getBlackRow(n,o){const l=this.getLuminanceSource(),u=l.getWidth();o==null||o.getSize()<u?o=new j(u):o.clear(),this.initArrays(u);const d=l.getRow(n,this.luminances),m=this.buckets;for(let w=0;w<u;w++)m[(d[w]&255)>>ne.LUMINANCE_SHIFT]++;const p=ne.estimateBlackPoint(m);if(u<3)for(let w=0;w<u;w++)(d[w]&255)<p&&o.set(w);else{let w=d[0]&255,C=d[1]&255;for(let N=1;N<u-1;N++){const D=d[N+1]&255;(C*4-w-D)/2<p&&o.set(N),w=C,C=D}}return o}getBlackMatrix(){const n=this.getLuminanceSource(),o=n.getWidth(),l=n.getHeight(),u=new Ce(o,l);this.initArrays(o);const d=this.buckets;for(let w=1;w<5;w++){const C=Math.floor(l*w/5),N=n.getRow(C,this.luminances),D=Math.floor(o*4/5);for(let P=Math.floor(o/5);P<D;P++){const G=N[P]&255;d[G>>ne.LUMINANCE_SHIFT]++}}const m=ne.estimateBlackPoint(d),p=n.getMatrix();for(let w=0;w<l;w++){const C=w*o;for(let N=0;N<o;N++)(p[C+N]&255)<m&&u.set(N,w)}return u}createBinarizer(n){return new ne(n)}initArrays(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));const o=this.buckets;for(let l=0;l<ne.LUMINANCE_BUCKETS;l++)o[l]=0}static estimateBlackPoint(n){const o=n.length;let l=0,u=0,d=0;for(let N=0;N<o;N++)n[N]>d&&(u=N,d=n[N]),n[N]>l&&(l=n[N]);let m=0,p=0;for(let N=0;N<o;N++){const D=N-u,P=n[N]*D*D;P>p&&(m=N,p=P)}if(u>m){const N=u;u=m,m=N}if(m-u<=o/16)throw new re;let w=m-1,C=-1;for(let N=m-1;N>u;N--){const D=N-u,P=D*D*(m-N)*(l-n[N]);P>C&&(w=N,C=P)}return w<<ne.LUMINANCE_SHIFT}}ne.LUMINANCE_BITS=5,ne.LUMINANCE_SHIFT=8-ne.LUMINANCE_BITS,ne.LUMINANCE_BUCKETS=1<<ne.LUMINANCE_BITS,ne.EMPTY=Uint8ClampedArray.from([0]);class xe extends ne{constructor(n){super(n),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const n=this.getLuminanceSource(),o=n.getWidth(),l=n.getHeight();if(o>=xe.MINIMUM_DIMENSION&&l>=xe.MINIMUM_DIMENSION){const u=n.getMatrix();let d=o>>xe.BLOCK_SIZE_POWER;(o&xe.BLOCK_SIZE_MASK)!==0&&d++;let m=l>>xe.BLOCK_SIZE_POWER;(l&xe.BLOCK_SIZE_MASK)!==0&&m++;const p=xe.calculateBlackPoints(u,d,m,o,l),w=new Ce(o,l);xe.calculateThresholdForBlock(u,d,m,o,l,p,w),this.matrix=w}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(n){return new xe(n)}static calculateThresholdForBlock(n,o,l,u,d,m,p){const w=d-xe.BLOCK_SIZE,C=u-xe.BLOCK_SIZE;for(let N=0;N<l;N++){let D=N<<xe.BLOCK_SIZE_POWER;D>w&&(D=w);const P=xe.cap(N,2,l-3);for(let G=0;G<o;G++){let q=G<<xe.BLOCK_SIZE_POWER;q>C&&(q=C);const K=xe.cap(G,2,o-3);let ie=0;for(let Re=-2;Re<=2;Re++){const Ae=m[P+Re];ie+=Ae[K-2]+Ae[K-1]+Ae[K]+Ae[K+1]+Ae[K+2]}const he=ie/25;xe.thresholdBlock(n,q,D,he,u,p)}}}static cap(n,o,l){return n<o?o:n>l?l:n}static thresholdBlock(n,o,l,u,d,m){for(let p=0,w=l*d+o;p<xe.BLOCK_SIZE;p++,w+=d)for(let C=0;C<xe.BLOCK_SIZE;C++)(n[w+C]&255)<=u&&m.set(o+C,l+p)}static calculateBlackPoints(n,o,l,u,d){const m=d-xe.BLOCK_SIZE,p=u-xe.BLOCK_SIZE,w=new Array(l);for(let C=0;C<l;C++){w[C]=new Int32Array(o);let N=C<<xe.BLOCK_SIZE_POWER;N>m&&(N=m);for(let D=0;D<o;D++){let P=D<<xe.BLOCK_SIZE_POWER;P>p&&(P=p);let G=0,q=255,K=0;for(let he=0,Re=N*u+P;he<xe.BLOCK_SIZE;he++,Re+=u){for(let Ae=0;Ae<xe.BLOCK_SIZE;Ae++){const Ee=n[Re+Ae]&255;G+=Ee,Ee<q&&(q=Ee),Ee>K&&(K=Ee)}if(K-q>xe.MIN_DYNAMIC_RANGE)for(he++,Re+=u;he<xe.BLOCK_SIZE;he++,Re+=u)for(let Ae=0;Ae<xe.BLOCK_SIZE;Ae++)G+=n[Re+Ae]&255}let ie=G>>xe.BLOCK_SIZE_POWER*2;if(K-q<=xe.MIN_DYNAMIC_RANGE&&(ie=q/2,C>0&&D>0)){const he=(w[C-1][D]+2*w[C][D-1]+w[C-1][D-1])/4;q<he&&(ie=he)}w[C][D]=ie}}return w}}xe.BLOCK_SIZE_POWER=3,xe.BLOCK_SIZE=1<<xe.BLOCK_SIZE_POWER,xe.BLOCK_SIZE_MASK=xe.BLOCK_SIZE-1,xe.MINIMUM_DIMENSION=xe.BLOCK_SIZE*5,xe.MIN_DYNAMIC_RANGE=24;class Me{constructor(n,o){this.width=n,this.height=o}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(n,o,l,u){throw new Oe("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new Oe("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new Oe("This luminance source does not support rotation by 45 degrees.")}toString(){const n=new Uint8ClampedArray(this.width);let o=new pe;for(let l=0;l<this.height;l++){const u=this.getRow(l,n);for(let d=0;d<this.width;d++){const m=u[d]&255;let p;m<64?p="#":m<128?p="+":m<192?p=".":p=" ",o.append(p)}o.append(`
|
|
232
|
+
`)}return o.toString()}}class He extends Me{constructor(n){super(n.getWidth(),n.getHeight()),this.delegate=n}getRow(n,o){const l=this.delegate.getRow(n,o),u=this.getWidth();for(let d=0;d<u;d++)l[d]=255-(l[d]&255);return l}getMatrix(){const n=this.delegate.getMatrix(),o=this.getWidth()*this.getHeight(),l=new Uint8ClampedArray(o);for(let u=0;u<o;u++)l[u]=255-(n[u]&255);return l}isCropSupported(){return this.delegate.isCropSupported()}crop(n,o,l,u){return new He(this.delegate.crop(n,o,l,u))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new He(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new He(this.delegate.rotateCounterClockwise45())}}class Ye extends Me{constructor(n){super(n.width,n.height),this.canvas=n,this.tempCanvasElement=null,this.buffer=Ye.makeBufferFromCanvasImageData(n)}static makeBufferFromCanvasImageData(n){const o=n.getContext("2d").getImageData(0,0,n.width,n.height);return Ye.toGrayscaleBuffer(o.data,n.width,n.height)}static toGrayscaleBuffer(n,o,l){const u=new Uint8ClampedArray(o*l);for(let d=0,m=0,p=n.length;d<p;d+=4,m++){let w;if(n[d+3]===0)w=255;else{const N=n[d],D=n[d+1],P=n[d+2];w=306*N+601*D+117*P+512>>10}u[m]=w}return u}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth(),u=n*l;return o===null?o=this.buffer.slice(u,u+l):(o.length<l&&(o=new Uint8ClampedArray(l)),o.set(this.buffer.slice(u,u+l))),o}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(n,o,l,u){return super.crop(n,o,l,u),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement}rotate(n){const o=this.getTempCanvasElement(),l=o.getContext("2d"),u=n*Ye.DEGREE_TO_RADIANS,d=this.canvas.width,m=this.canvas.height,p=Math.ceil(Math.abs(Math.cos(u))*d+Math.abs(Math.sin(u))*m),w=Math.ceil(Math.abs(Math.sin(u))*d+Math.abs(Math.cos(u))*m);return o.width=p,o.height=w,l.translate(p/2,w/2),l.rotate(u),l.drawImage(this.canvas,d/-2,m/-2),this.buffer=Ye.makeBufferFromCanvasImageData(o),this}invert(){return new He(this)}}Ye.DEGREE_TO_RADIANS=Math.PI/180;class W{constructor(n,o,l){this.deviceId=n,this.label=o,this.kind="videoinput",this.groupId=l||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var se=(globalThis||Qi||self||window||void 0)&&(globalThis||Qi||self||window||void 0).__awaiter||function(M,n,o,l){function u(d){return d instanceof o?d:new o(function(m){m(d)})}return new(o||(o=Promise))(function(d,m){function p(N){try{C(l.next(N))}catch(D){m(D)}}function w(N){try{C(l.throw(N))}catch(D){m(D)}}function C(N){N.done?d(N.value):u(N.value).then(p,w)}C((l=l.apply(M,n||[])).next())})};class Se{constructor(n,o=500,l){this.reader=n,this.timeBetweenScansMillis=o,this._hints=l,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(n){this._timeBetweenDecodingAttempts=n<0?0:n}set hints(n){this._hints=n||null}get hints(){return this._hints}listVideoInputDevices(){return se(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const n=yield navigator.mediaDevices.enumerateDevices(),o=[];for(const l of n){const u=l.kind==="video"?"videoinput":l.kind;if(u!=="videoinput")continue;const d=l.deviceId||l.id,m=l.label||`Video device ${o.length+1}`,p=l.groupId,w={deviceId:d,label:m,kind:u,groupId:p};o.push(w)}return o})}getVideoInputDevices(){return se(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(o=>new W(o.deviceId,o.label))})}findDeviceById(n){return se(this,void 0,void 0,function*(){const o=yield this.listVideoInputDevices();return o?o.find(l=>l.deviceId===n):null})}decodeFromInputVideoDevice(n,o){return se(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(n,o)})}decodeOnceFromVideoDevice(n,o){return se(this,void 0,void 0,function*(){this.reset();let l;n?l={deviceId:{exact:n}}:l={facingMode:"environment"};const u={video:l};return yield this.decodeOnceFromConstraints(u,o)})}decodeOnceFromConstraints(n,o){return se(this,void 0,void 0,function*(){const l=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeOnceFromStream(l,o)})}decodeOnceFromStream(n,o){return se(this,void 0,void 0,function*(){this.reset();const l=yield this.attachStreamToVideo(n,o);return yield this.decodeOnce(l)})}decodeFromInputVideoDeviceContinuously(n,o,l){return se(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(n,o,l)})}decodeFromVideoDevice(n,o,l){return se(this,void 0,void 0,function*(){let u;n?u={deviceId:{exact:n}}:u={facingMode:"environment"};const d={video:u};return yield this.decodeFromConstraints(d,o,l)})}decodeFromConstraints(n,o,l){return se(this,void 0,void 0,function*(){const u=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeFromStream(u,o,l)})}decodeFromStream(n,o,l){return se(this,void 0,void 0,function*(){this.reset();const u=yield this.attachStreamToVideo(n,o);return yield this.decodeContinuously(u,l)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(n,o){return se(this,void 0,void 0,function*(){const l=this.prepareVideoElement(o);return this.addVideoSource(l,n),this.videoElement=l,this.stream=n,yield this.playVideoOnLoadAsync(l),l})}playVideoOnLoadAsync(n){return new Promise((o,l)=>this.playVideoOnLoad(n,()=>o()))}playVideoOnLoad(n,o){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(n),n.addEventListener("ended",this.videoEndedListener),n.addEventListener("canplay",this.videoCanPlayListener),n.addEventListener("playing",o),this.tryPlayVideo(n)}isVideoPlaying(n){return n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2}tryPlayVideo(n){return se(this,void 0,void 0,function*(){if(this.isVideoPlaying(n)){console.warn("Trying to play video that is already playing.");return}try{yield n.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(n,o){const l=document.getElementById(n);if(!l)throw new T(`element with id '${n}' not found`);if(l.nodeName.toLowerCase()!==o.toLowerCase())throw new T(`element with id '${n}' must be an ${o} element`);return l}decodeFromImage(n,o){if(!n&&!o)throw new T("either imageElement with a src set or an url must be provided");return o&&!n?this.decodeFromImageUrl(o):this.decodeFromImageElement(n)}decodeFromVideo(n,o){if(!n&&!o)throw new T("Either an element with a src set or an URL must be provided");return o&&!n?this.decodeFromVideoUrl(o):this.decodeFromVideoElement(n)}decodeFromVideoContinuously(n,o,l){if(n===void 0&&o===void 0)throw new T("Either an element with a src set or an URL must be provided");return o&&!n?this.decodeFromVideoUrlContinuously(o,l):this.decodeFromVideoElementContinuously(n,l)}decodeFromImageElement(n){if(!n)throw new T("An image element must be provided.");this.reset();const o=this.prepareImageElement(n);this.imageElement=o;let l;return this.isImageLoaded(o)?l=this.decodeOnce(o,!1,!0):l=this._decodeOnLoadImage(o),l}decodeFromVideoElement(n){const o=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideo(o)}decodeFromVideoElementContinuously(n,o){const l=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideoContinuously(l,o)}_decodeFromVideoElementSetup(n){if(!n)throw new T("A video element must be provided.");this.reset();const o=this.prepareVideoElement(n);return this.videoElement=o,o}decodeFromImageUrl(n){if(!n)throw new T("An URL must be provided.");this.reset();const o=this.prepareImageElement();this.imageElement=o;const l=this._decodeOnLoadImage(o);return o.src=n,l}decodeFromVideoUrl(n){if(!n)throw new T("An URL must be provided.");this.reset();const o=this.prepareVideoElement(),l=this.decodeFromVideoElement(o);return o.src=n,l}decodeFromVideoUrlContinuously(n,o){if(!n)throw new T("An URL must be provided.");this.reset();const l=this.prepareVideoElement(),u=this.decodeFromVideoElementContinuously(l,o);return l.src=n,u}_decodeOnLoadImage(n){return new Promise((o,l)=>{this.imageLoadedListener=()=>this.decodeOnce(n,!1,!0).then(o,l),n.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(n){return se(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(n),yield this.decodeOnce(n)})}_decodeOnLoadVideoContinuously(n,o){return se(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(n),this.decodeContinuously(n,o)})}isImageLoaded(n){return!(!n.complete||n.naturalWidth===0)}prepareImageElement(n){let o;return typeof n>"u"&&(o=document.createElement("img"),o.width=200,o.height=200),typeof n=="string"&&(o=this.getMediaElement(n,"img")),n instanceof HTMLImageElement&&(o=n),o}prepareVideoElement(n){let o;return!n&&typeof document<"u"&&(o=document.createElement("video"),o.width=200,o.height=200),typeof n=="string"&&(o=this.getMediaElement(n,"video")),n instanceof HTMLVideoElement&&(o=n),o.setAttribute("autoplay","true"),o.setAttribute("muted","true"),o.setAttribute("playsinline","true"),o}decodeOnce(n,o=!0,l=!0){this._stopAsyncDecode=!1;const u=(d,m)=>{if(this._stopAsyncDecode){m(new re("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const p=this.decode(n);d(p)}catch(p){const w=o&&p instanceof re,N=(p instanceof R||p instanceof X)&&l;if(w||N)return setTimeout(u,this._timeBetweenDecodingAttempts,d,m);m(p)}};return new Promise((d,m)=>u(d,m))}decodeContinuously(n,o){this._stopContinuousDecode=!1;const l=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const u=this.decode(n);o(u,null),setTimeout(l,this.timeBetweenScansMillis)}catch(u){o(null,u);const d=u instanceof R||u instanceof X,m=u instanceof re;(d||m)&&setTimeout(l,this._timeBetweenDecodingAttempts)}};l()}decode(n){const o=this.createBinaryBitmap(n);return this.decodeBitmap(o)}_isHTMLVideoElement(n){return n.videoWidth!==0}drawFrameOnCanvas(n,o,l){o||(o={sx:0,sy:0,sWidth:n.videoWidth,sHeight:n.videoHeight,dx:0,dy:0,dWidth:n.videoWidth,dHeight:n.videoHeight}),l||(l=this.captureCanvasContext),l.drawImage(n,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}drawImageOnCanvas(n,o,l=this.captureCanvasContext){o||(o={sx:0,sy:0,sWidth:n.naturalWidth,sHeight:n.naturalHeight,dx:0,dy:0,dWidth:n.naturalWidth,dHeight:n.naturalHeight}),l||(l=this.captureCanvasContext),l.drawImage(n,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}createBinaryBitmap(n){this.getCaptureCanvasContext(n),this._isHTMLVideoElement(n)?this.drawFrameOnCanvas(n):this.drawImageOnCanvas(n);const o=this.getCaptureCanvas(n),l=new Ye(o),u=new xe(l);return new S(u)}getCaptureCanvasContext(n){if(!this.captureCanvasContext){const l=this.getCaptureCanvas(n).getContext("2d");this.captureCanvasContext=l}return this.captureCanvasContext}getCaptureCanvas(n){if(!this.captureCanvas){const o=this.createCaptureCanvas(n);this.captureCanvas=o}return this.captureCanvas}decodeBitmap(n){return this.reader.decode(n,this._hints)}createCaptureCanvas(n){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const o=document.createElement("canvas");let l,u;return typeof n<"u"&&(n instanceof HTMLVideoElement?(l=n.videoWidth,u=n.videoHeight):n instanceof HTMLImageElement&&(l=n.naturalWidth||n.width,u=n.naturalHeight||n.height)),o.style.width=l+"px",o.style.height=u+"px",o.width=l,o.height=u,o}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(n=>n.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(n,o){try{n.srcObject=o}catch{n.src=URL.createObjectURL(o)}}cleanVideoSource(n){try{n.srcObject=null}catch{n.src=""}this.videoElement.removeAttribute("src")}}class Ie{constructor(n,o,l=o==null?0:8*o.length,u,d,m=I.currentTimeMillis()){this.text=n,this.rawBytes=o,this.numBits=l,this.resultPoints=u,this.format=d,this.timestamp=m,this.text=n,this.rawBytes=o,l==null?this.numBits=o==null?0:8*o.length:this.numBits=l,this.resultPoints=u,this.format=d,this.resultMetadata=null,m==null?this.timestamp=I.currentTimeMillis():this.timestamp=m}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(n,o){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(n,o)}putAllMetadata(n){n!==null&&(this.resultMetadata===null?this.resultMetadata=n:this.resultMetadata=new Map(n))}addResultPoints(n){const o=this.resultPoints;if(o===null)this.resultPoints=n;else if(n!==null&&n.length>0){const l=new Array(o.length+n.length);I.arraycopy(o,0,l,0,o.length),I.arraycopy(n,0,l,o.length,n.length),this.resultPoints=l}}getTimestamp(){return this.timestamp}toString(){return this.text}}var Ue;(function(M){M[M.AZTEC=0]="AZTEC",M[M.CODABAR=1]="CODABAR",M[M.CODE_39=2]="CODE_39",M[M.CODE_93=3]="CODE_93",M[M.CODE_128=4]="CODE_128",M[M.DATA_MATRIX=5]="DATA_MATRIX",M[M.EAN_8=6]="EAN_8",M[M.EAN_13=7]="EAN_13",M[M.ITF=8]="ITF",M[M.MAXICODE=9]="MAXICODE",M[M.PDF_417=10]="PDF_417",M[M.QR_CODE=11]="QR_CODE",M[M.RSS_14=12]="RSS_14",M[M.RSS_EXPANDED=13]="RSS_EXPANDED",M[M.UPC_A=14]="UPC_A",M[M.UPC_E=15]="UPC_E",M[M.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Ue||(Ue={}));var Te=Ue,Ke;(function(M){M[M.OTHER=0]="OTHER",M[M.ORIENTATION=1]="ORIENTATION",M[M.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",M[M.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",M[M.ISSUE_NUMBER=4]="ISSUE_NUMBER",M[M.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",M[M.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",M[M.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",M[M.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",M[M.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",M[M.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ke||(Ke={}));var Qe=Ke;class pt{constructor(n,o,l,u,d=-1,m=-1){this.rawBytes=n,this.text=o,this.byteSegments=l,this.ecLevel=u,this.structuredAppendSequenceNumber=d,this.structuredAppendParity=m,this.numBits=n==null?0:8*n.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(n){this.numBits=n}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(n){this.errorsCorrected=n}getErasures(){return this.erasures}setErasures(n){this.erasures=n}getOther(){return this.other}setOther(n){this.other=n}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Yn{exp(n){return this.expTable[n]}log(n){if(n===0)throw new x;return this.logTable[n]}static addOrSubtract(n,o){return n^o}}class Sn{constructor(n,o){if(o.length===0)throw new x;this.field=n;const l=o.length;if(l>1&&o[0]===0){let u=1;for(;u<l&&o[u]===0;)u++;u===l?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(l-u),I.arraycopy(o,u,this.coefficients,0,this.coefficients.length))}else this.coefficients=o}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);const o=this.coefficients;let l;if(n===1){l=0;for(let m=0,p=o.length;m!==p;m++){const w=o[m];l=Yn.addOrSubtract(l,w)}return l}l=o[0];const u=o.length,d=this.field;for(let m=1;m<u;m++)l=Yn.addOrSubtract(d.multiply(n,l),o[m]);return l}addOrSubtract(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(this.isZero())return n;if(n.isZero())return this;let o=this.coefficients,l=n.coefficients;if(o.length>l.length){const m=o;o=l,l=m}let u=new Int32Array(l.length);const d=l.length-o.length;I.arraycopy(l,0,u,0,d);for(let m=d;m<l.length;m++)u[m]=Yn.addOrSubtract(o[m-d],l[m]);return new Sn(this.field,u)}multiply(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(this.isZero()||n.isZero())return this.field.getZero();const o=this.coefficients,l=o.length,u=n.coefficients,d=u.length,m=new Int32Array(l+d-1),p=this.field;for(let w=0;w<l;w++){const C=o[w];for(let N=0;N<d;N++)m[w+N]=Yn.addOrSubtract(m[w+N],p.multiply(C,u[N]))}return new Sn(p,m)}multiplyScalar(n){if(n===0)return this.field.getZero();if(n===1)return this;const o=this.coefficients.length,l=this.field,u=new Int32Array(o),d=this.coefficients;for(let m=0;m<o;m++)u[m]=l.multiply(d[m],n);return new Sn(l,u)}multiplyByMonomial(n,o){if(n<0)throw new x;if(o===0)return this.field.getZero();const l=this.coefficients,u=l.length,d=new Int32Array(u+n),m=this.field;for(let p=0;p<u;p++)d[p]=m.multiply(l[p],o);return new Sn(m,d)}divide(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(n.isZero())throw new x("Divide by 0");const o=this.field;let l=o.getZero(),u=this;const d=n.getCoefficient(n.getDegree()),m=o.inverse(d);for(;u.getDegree()>=n.getDegree()&&!u.isZero();){const p=u.getDegree()-n.getDegree(),w=o.multiply(u.getCoefficient(u.getDegree()),m),C=n.multiplyByMonomial(p,w),N=o.buildMonomial(p,w);l=l.addOrSubtract(N),u=u.addOrSubtract(C)}return[l,u]}toString(){let n="";for(let o=this.getDegree();o>=0;o--){let l=this.getCoefficient(o);if(l!==0){if(l<0?(n+=" - ",l=-l):n.length>0&&(n+=" + "),o===0||l!==1){const u=this.field.log(l);u===0?n+="1":u===1?n+="a":(n+="a^",n+=u)}o!==0&&(o===1?n+="x":(n+="x^",n+=o))}}return n}}class na extends b{}na.kind="ArithmeticException";class xt extends Yn{constructor(n,o,l){super(),this.primitive=n,this.size=o,this.generatorBase=l;const u=new Int32Array(o);let d=1;for(let p=0;p<o;p++)u[p]=d,d*=2,d>=o&&(d^=n,d&=o-1);this.expTable=u;const m=new Int32Array(o);for(let p=0;p<o-1;p++)m[u[p]]=p;this.logTable=m,this.zero=new Sn(this,Int32Array.from([0])),this.one=new Sn(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,o){if(n<0)throw new x;if(o===0)return this.zero;const l=new Int32Array(n+1);return l[0]=o,new Sn(this,l)}inverse(n){if(n===0)throw new na;return this.expTable[this.size-this.logTable[n]-1]}multiply(n,o){return n===0||o===0?0:this.expTable[(this.logTable[n]+this.logTable[o])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+H.toHexString(this.primitive)+","+this.size+")"}equals(n){return n===this}}xt.AZTEC_DATA_12=new xt(4201,4096,1),xt.AZTEC_DATA_10=new xt(1033,1024,1),xt.AZTEC_DATA_6=new xt(67,64,1),xt.AZTEC_PARAM=new xt(19,16,1),xt.QR_CODE_FIELD_256=new xt(285,256,0),xt.DATA_MATRIX_FIELD_256=new xt(301,256,1),xt.AZTEC_DATA_8=xt.DATA_MATRIX_FIELD_256,xt.MAXICODE_FIELD_64=xt.AZTEC_DATA_6;class nr extends b{}nr.kind="ReedSolomonException";class rr extends b{}rr.kind="IllegalStateException";class Ci{constructor(n){this.field=n}decode(n,o){const l=this.field,u=new Sn(l,n),d=new Int32Array(o);let m=!0;for(let G=0;G<o;G++){const q=u.evaluateAt(l.exp(G+l.getGeneratorBase()));d[d.length-1-G]=q,q!==0&&(m=!1)}if(m)return;const p=new Sn(l,d),w=this.runEuclideanAlgorithm(l.buildMonomial(o,1),p,o),C=w[0],N=w[1],D=this.findErrorLocations(C),P=this.findErrorMagnitudes(N,D);for(let G=0;G<D.length;G++){const q=n.length-1-l.log(D[G]);if(q<0)throw new nr("Bad error location");n[q]=xt.addOrSubtract(n[q],P[G])}}runEuclideanAlgorithm(n,o,l){if(n.getDegree()<o.getDegree()){const G=n;n=o,o=G}const u=this.field;let d=n,m=o,p=u.getZero(),w=u.getOne();for(;m.getDegree()>=(l/2|0);){let G=d,q=p;if(d=m,p=w,d.isZero())throw new nr("r_{i-1} was zero");m=G;let K=u.getZero();const ie=d.getCoefficient(d.getDegree()),he=u.inverse(ie);for(;m.getDegree()>=d.getDegree()&&!m.isZero();){const Re=m.getDegree()-d.getDegree(),Ae=u.multiply(m.getCoefficient(m.getDegree()),he);K=K.addOrSubtract(u.buildMonomial(Re,Ae)),m=m.addOrSubtract(d.multiplyByMonomial(Re,Ae))}if(w=K.multiply(p).addOrSubtract(q),m.getDegree()>=d.getDegree())throw new rr("Division algorithm failed to reduce polynomial?")}const C=w.getCoefficient(0);if(C===0)throw new nr("sigmaTilde(0) was zero");const N=u.inverse(C),D=w.multiplyScalar(N),P=m.multiplyScalar(N);return[D,P]}findErrorLocations(n){const o=n.getDegree();if(o===1)return Int32Array.from([n.getCoefficient(1)]);const l=new Int32Array(o);let u=0;const d=this.field;for(let m=1;m<d.getSize()&&u<o;m++)n.evaluateAt(m)===0&&(l[u]=d.inverse(m),u++);if(u!==o)throw new nr("Error locator degree does not match number of roots");return l}findErrorMagnitudes(n,o){const l=o.length,u=new Int32Array(l),d=this.field;for(let m=0;m<l;m++){const p=d.inverse(o[m]);let w=1;for(let C=0;C<l;C++)if(m!==C){const N=d.multiply(o[C],p),D=(N&1)===0?N|1:N&-2;w=d.multiply(w,D)}u[m]=d.multiply(n.evaluateAt(p),d.inverse(w)),d.getGeneratorBase()!==0&&(u[m]=d.multiply(u[m],p))}return u}}var Tn;(function(M){M[M.UPPER=0]="UPPER",M[M.LOWER=1]="LOWER",M[M.MIXED=2]="MIXED",M[M.DIGIT=3]="DIGIT",M[M.PUNCT=4]="PUNCT",M[M.BINARY=5]="BINARY"})(Tn||(Tn={}));class Nt{decode(n){this.ddata=n;let o=n.getBits(),l=this.extractBits(o),u=this.correctBits(l),d=Nt.convertBoolArrayToByteArray(u),m=Nt.getEncodedData(u),p=new pt(d,m,null,null);return p.setNumBits(u.length),p}static highLevelDecode(n){return this.getEncodedData(n)}static getEncodedData(n){let o=n.length,l=Tn.UPPER,u=Tn.UPPER,d="",m=0;for(;m<o;)if(u===Tn.BINARY){if(o-m<5)break;let p=Nt.readCode(n,m,5);if(m+=5,p===0){if(o-m<11)break;p=Nt.readCode(n,m,11)+31,m+=11}for(let w=0;w<p;w++){if(o-m<8){m=o;break}const C=Nt.readCode(n,m,8);d+=$.castAsNonUtf8Char(C),m+=8}u=l}else{let p=u===Tn.DIGIT?4:5;if(o-m<p)break;let w=Nt.readCode(n,m,p);m+=p;let C=Nt.getCharacter(u,w);C.startsWith("CTRL_")?(l=u,u=Nt.getTable(C.charAt(5)),C.charAt(6)==="L"&&(l=u)):(d+=C,u=l)}return d}static getTable(n){switch(n){case"L":return Tn.LOWER;case"P":return Tn.PUNCT;case"M":return Tn.MIXED;case"D":return Tn.DIGIT;case"B":return Tn.BINARY;case"U":default:return Tn.UPPER}}static getCharacter(n,o){switch(n){case Tn.UPPER:return Nt.UPPER_TABLE[o];case Tn.LOWER:return Nt.LOWER_TABLE[o];case Tn.MIXED:return Nt.MIXED_TABLE[o];case Tn.PUNCT:return Nt.PUNCT_TABLE[o];case Tn.DIGIT:return Nt.DIGIT_TABLE[o];default:throw new rr("Bad table")}}correctBits(n){let o,l;this.ddata.getNbLayers()<=2?(l=6,o=xt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(l=8,o=xt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(l=10,o=xt.AZTEC_DATA_10):(l=12,o=xt.AZTEC_DATA_12);let u=this.ddata.getNbDatablocks(),d=n.length/l;if(d<u)throw new X;let m=n.length%l,p=new Int32Array(d);for(let P=0;P<d;P++,m+=l)p[P]=Nt.readCode(n,m,l);try{new Ci(o).decode(p,d-u)}catch(P){throw new X(P)}let w=(1<<l)-1,C=0;for(let P=0;P<u;P++){let G=p[P];if(G===0||G===w)throw new X;(G===1||G===w-1)&&C++}let N=new Array(u*l-C),D=0;for(let P=0;P<u;P++){let G=p[P];if(G===1||G===w-1)N.fill(G>1,D,D+l-1),D+=l-1;else for(let q=l-1;q>=0;--q)N[D++]=(G&1<<q)!==0}return N}extractBits(n){let o=this.ddata.isCompact(),l=this.ddata.getNbLayers(),u=(o?11:14)+l*4,d=new Int32Array(u),m=new Array(this.totalBitsInLayer(l,o));if(o)for(let p=0;p<d.length;p++)d[p]=p;else{let p=u+1+2*H.truncDivision(H.truncDivision(u,2)-1,15),w=u/2,C=H.truncDivision(p,2);for(let N=0;N<w;N++){let D=N+H.truncDivision(N,15);d[w-N-1]=C-D-1,d[w+N]=C+D+1}}for(let p=0,w=0;p<l;p++){let C=(l-p)*4+(o?9:12),N=p*2,D=u-1-N;for(let P=0;P<C;P++){let G=P*2;for(let q=0;q<2;q++)m[w+G+q]=n.get(d[N+q],d[N+P]),m[w+2*C+G+q]=n.get(d[N+P],d[D-q]),m[w+4*C+G+q]=n.get(d[D-q],d[D-P]),m[w+6*C+G+q]=n.get(d[D-P],d[N+q])}w+=C*8}return m}static readCode(n,o,l){let u=0;for(let d=o;d<o+l;d++)u<<=1,n[d]&&(u|=1);return u}static readByte(n,o){let l=n.length-o;return l>=8?Nt.readCode(n,o,8):Nt.readCode(n,o,l)<<8-l}static convertBoolArrayToByteArray(n){let o=new Uint8Array((n.length+7)/8);for(let l=0;l<o.length;l++)o[l]=Nt.readByte(n,8*l);return o}totalBitsInLayer(n,o){return((o?88:112)+16*n)*n}}Nt.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],Nt.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],Nt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
|
|
233
|
+
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Nt.PUNCT_TABLE=["","\r",`\r
|
|
234
|
+
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Nt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class ot{constructor(){}static round(n){return n===NaN?0:n<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:n>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:n+(n<0?-.5:.5)|0}static distance(n,o,l,u){const d=n-l,m=o-u;return Math.sqrt(d*d+m*m)}static sum(n){let o=0;for(let l=0,u=n.length;l!==u;l++){const d=n[l];o+=d}return o}}class ra{static floatToIntBits(n){return n}}ra.MAX_VALUE=Number.MAX_SAFE_INTEGER;class Le{constructor(n,o){this.x=n,this.y=o}getX(){return this.x}getY(){return this.y}equals(n){if(n instanceof Le){const o=n;return this.x===o.x&&this.y===o.y}return!1}hashCode(){return 31*ra.floatToIntBits(this.x)+ra.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(n){const o=this.distance(n[0],n[1]),l=this.distance(n[1],n[2]),u=this.distance(n[0],n[2]);let d,m,p;if(l>=o&&l>=u?(m=n[0],d=n[1],p=n[2]):u>=l&&u>=o?(m=n[1],d=n[0],p=n[2]):(m=n[2],d=n[0],p=n[1]),this.crossProductZ(d,m,p)<0){const w=d;d=p,p=w}n[0]=d,n[1]=m,n[2]=p}static distance(n,o){return ot.distance(n.x,n.y,o.x,o.y)}static crossProductZ(n,o,l){const u=o.x,d=o.y;return(l.x-u)*(n.y-d)-(l.y-d)*(n.x-u)}}class Ro{constructor(n,o){this.bits=n,this.points=o}getBits(){return this.bits}getPoints(){return this.points}}class $l extends Ro{constructor(n,o,l,u,d){super(n,o),this.compact=l,this.nbDatablocks=u,this.nbLayers=d}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class en{constructor(n,o,l,u){this.image=n,this.height=n.getHeight(),this.width=n.getWidth(),o==null&&(o=en.INIT_SIZE),l==null&&(l=n.getWidth()/2|0),u==null&&(u=n.getHeight()/2|0);const d=o/2|0;if(this.leftInit=l-d,this.rightInit=l+d,this.upInit=u-d,this.downInit=u+d,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new re}detect(){let n=this.leftInit,o=this.rightInit,l=this.upInit,u=this.downInit,d=!1,m=!0,p=!1,w=!1,C=!1,N=!1,D=!1;const P=this.width,G=this.height;for(;m;){m=!1;let q=!0;for(;(q||!w)&&o<P;)q=this.containsBlackPoint(l,u,o,!1),q?(o++,m=!0,w=!0):w||o++;if(o>=P){d=!0;break}let K=!0;for(;(K||!C)&&u<G;)K=this.containsBlackPoint(n,o,u,!0),K?(u++,m=!0,C=!0):C||u++;if(u>=G){d=!0;break}let ie=!0;for(;(ie||!N)&&n>=0;)ie=this.containsBlackPoint(l,u,n,!1),ie?(n--,m=!0,N=!0):N||n--;if(n<0){d=!0;break}let he=!0;for(;(he||!D)&&l>=0;)he=this.containsBlackPoint(n,o,l,!0),he?(l--,m=!0,D=!0):D||l--;if(l<0){d=!0;break}m&&(p=!0)}if(!d&&p){const q=o-n;let K=null;for(let Ae=1;K===null&&Ae<q;Ae++)K=this.getBlackPointOnSegment(n,u-Ae,n+Ae,u);if(K==null)throw new re;let ie=null;for(let Ae=1;ie===null&&Ae<q;Ae++)ie=this.getBlackPointOnSegment(n,l+Ae,n+Ae,l);if(ie==null)throw new re;let he=null;for(let Ae=1;he===null&&Ae<q;Ae++)he=this.getBlackPointOnSegment(o,l+Ae,o-Ae,l);if(he==null)throw new re;let Re=null;for(let Ae=1;Re===null&&Ae<q;Ae++)Re=this.getBlackPointOnSegment(o,u-Ae,o-Ae,u);if(Re==null)throw new re;return this.centerEdges(Re,K,he,ie)}else throw new re}getBlackPointOnSegment(n,o,l,u){const d=ot.round(ot.distance(n,o,l,u)),m=(l-n)/d,p=(u-o)/d,w=this.image;for(let C=0;C<d;C++){const N=ot.round(n+C*m),D=ot.round(o+C*p);if(w.get(N,D))return new Le(N,D)}return null}centerEdges(n,o,l,u){const d=n.getX(),m=n.getY(),p=o.getX(),w=o.getY(),C=l.getX(),N=l.getY(),D=u.getX(),P=u.getY(),G=en.CORR;return d<this.width/2?[new Le(D-G,P+G),new Le(p+G,w+G),new Le(C-G,N-G),new Le(d+G,m-G)]:[new Le(D+G,P+G),new Le(p+G,w-G),new Le(C-G,N+G),new Le(d-G,m-G)]}containsBlackPoint(n,o,l,u){const d=this.image;if(u){for(let m=n;m<=o;m++)if(d.get(m,l))return!0}else for(let m=n;m<=o;m++)if(d.get(l,m))return!0;return!1}}en.INIT_SIZE=10,en.CORR=1;class Bs{static checkAndNudgePoints(n,o){const l=n.getWidth(),u=n.getHeight();let d=!0;for(let m=0;m<o.length&&d;m+=2){const p=Math.floor(o[m]),w=Math.floor(o[m+1]);if(p<-1||p>l||w<-1||w>u)throw new re;d=!1,p===-1?(o[m]=0,d=!0):p===l&&(o[m]=l-1,d=!0),w===-1?(o[m+1]=0,d=!0):w===u&&(o[m+1]=u-1,d=!0)}d=!0;for(let m=o.length-2;m>=0&&d;m-=2){const p=Math.floor(o[m]),w=Math.floor(o[m+1]);if(p<-1||p>l||w<-1||w>u)throw new re;d=!1,p===-1?(o[m]=0,d=!0):p===l&&(o[m]=l-1,d=!0),w===-1?(o[m+1]=0,d=!0):w===u&&(o[m+1]=u-1,d=!0)}}}class ir{constructor(n,o,l,u,d,m,p,w,C){this.a11=n,this.a21=o,this.a31=l,this.a12=u,this.a22=d,this.a32=m,this.a13=p,this.a23=w,this.a33=C}static quadrilateralToQuadrilateral(n,o,l,u,d,m,p,w,C,N,D,P,G,q,K,ie){const he=ir.quadrilateralToSquare(n,o,l,u,d,m,p,w);return ir.squareToQuadrilateral(C,N,D,P,G,q,K,ie).times(he)}transformPoints(n){const o=n.length,l=this.a11,u=this.a12,d=this.a13,m=this.a21,p=this.a22,w=this.a23,C=this.a31,N=this.a32,D=this.a33;for(let P=0;P<o;P+=2){const G=n[P],q=n[P+1],K=d*G+w*q+D;n[P]=(l*G+m*q+C)/K,n[P+1]=(u*G+p*q+N)/K}}transformPointsWithValues(n,o){const l=this.a11,u=this.a12,d=this.a13,m=this.a21,p=this.a22,w=this.a23,C=this.a31,N=this.a32,D=this.a33,P=n.length;for(let G=0;G<P;G++){const q=n[G],K=o[G],ie=d*q+w*K+D;n[G]=(l*q+m*K+C)/ie,o[G]=(u*q+p*K+N)/ie}}static squareToQuadrilateral(n,o,l,u,d,m,p,w){const C=n-l+d-p,N=o-u+m-w;if(C===0&&N===0)return new ir(l-n,d-l,n,u-o,m-u,o,0,0,1);{const D=l-d,P=p-d,G=u-m,q=w-m,K=D*q-P*G,ie=(C*q-P*N)/K,he=(D*N-C*G)/K;return new ir(l-n+ie*l,p-n+he*p,n,u-o+ie*u,w-o+he*w,o,ie,he,1)}}static quadrilateralToSquare(n,o,l,u,d,m,p,w){return ir.squareToQuadrilateral(n,o,l,u,d,m,p,w).buildAdjoint()}buildAdjoint(){return new ir(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(n){return new ir(this.a11*n.a11+this.a21*n.a12+this.a31*n.a13,this.a11*n.a21+this.a21*n.a22+this.a31*n.a23,this.a11*n.a31+this.a21*n.a32+this.a31*n.a33,this.a12*n.a11+this.a22*n.a12+this.a32*n.a13,this.a12*n.a21+this.a22*n.a22+this.a32*n.a23,this.a12*n.a31+this.a22*n.a32+this.a32*n.a33,this.a13*n.a11+this.a23*n.a12+this.a33*n.a13,this.a13*n.a21+this.a23*n.a22+this.a33*n.a23,this.a13*n.a31+this.a23*n.a32+this.a33*n.a33)}}class Ls extends Bs{sampleGrid(n,o,l,u,d,m,p,w,C,N,D,P,G,q,K,ie,he,Re,Ae){const Ee=ir.quadrilateralToQuadrilateral(u,d,m,p,w,C,N,D,P,G,q,K,ie,he,Re,Ae);return this.sampleGridWithTransform(n,o,l,Ee)}sampleGridWithTransform(n,o,l,u){if(o<=0||l<=0)throw new re;const d=new Ce(o,l),m=new Float32Array(2*o);for(let p=0;p<l;p++){const w=m.length,C=p+.5;for(let N=0;N<w;N+=2)m[N]=N/2+.5,m[N+1]=C;u.transformPoints(m),Bs.checkAndNudgePoints(n,m);try{for(let N=0;N<w;N+=2)n.get(Math.floor(m[N]),Math.floor(m[N+1]))&&d.set(N/2,p)}catch{throw new re}}return d}}class mr{static setGridSampler(n){mr.gridSampler=n}static getInstance(){return mr.gridSampler}}mr.gridSampler=new Ls;class zn{constructor(n,o){this.x=n,this.y=o}toResultPoint(){return new Le(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class ks{constructor(n){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=n}detect(){return this.detectMirror(!1)}detectMirror(n){let o=this.getMatrixCenter(),l=this.getBullsEyeCorners(o);if(n){let m=l[0];l[0]=l[2],l[2]=m}this.extractParameters(l);let u=this.sampleGrid(this.image,l[this.shift%4],l[(this.shift+1)%4],l[(this.shift+2)%4],l[(this.shift+3)%4]),d=this.getMatrixCornerPoints(l);return new $l(u,d,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(n){if(!this.isValidPoint(n[0])||!this.isValidPoint(n[1])||!this.isValidPoint(n[2])||!this.isValidPoint(n[3]))throw new re;let o=2*this.nbCenterLayers,l=new Int32Array([this.sampleLine(n[0],n[1],o),this.sampleLine(n[1],n[2],o),this.sampleLine(n[2],n[3],o),this.sampleLine(n[3],n[0],o)]);this.shift=this.getRotation(l,o);let u=0;for(let m=0;m<4;m++){let p=l[(this.shift+m)%4];this.compact?(u<<=7,u+=p>>1&127):(u<<=10,u+=(p>>2&992)+(p>>1&31))}let d=this.getCorrectedParameterData(u,this.compact);this.compact?(this.nbLayers=(d>>6)+1,this.nbDataBlocks=(d&63)+1):(this.nbLayers=(d>>11)+1,this.nbDataBlocks=(d&2047)+1)}getRotation(n,o){let l=0;n.forEach((u,d,m)=>{let p=(u>>o-2<<1)+(u&1);l=(l<<3)+p}),l=((l&1)<<11)+(l>>1);for(let u=0;u<4;u++)if(H.bitCount(l^this.EXPECTED_CORNER_BITS[u])<=2)return u;throw new re}getCorrectedParameterData(n,o){let l,u;o?(l=7,u=2):(l=10,u=4);let d=l-u,m=new Int32Array(l);for(let w=l-1;w>=0;--w)m[w]=n&15,n>>=4;try{new Ci(xt.AZTEC_PARAM).decode(m,d)}catch{throw new re}let p=0;for(let w=0;w<u;w++)p=(p<<4)+m[w];return p}getBullsEyeCorners(n){let o=n,l=n,u=n,d=n,m=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let D=this.getFirstDifferent(o,m,1,-1),P=this.getFirstDifferent(l,m,1,1),G=this.getFirstDifferent(u,m,-1,1),q=this.getFirstDifferent(d,m,-1,-1);if(this.nbCenterLayers>2){let K=this.distancePoint(q,D)*this.nbCenterLayers/(this.distancePoint(d,o)*(this.nbCenterLayers+2));if(K<.75||K>1.25||!this.isWhiteOrBlackRectangle(D,P,G,q))break}o=D,l=P,u=G,d=q,m=!m}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new re;this.compact=this.nbCenterLayers===5;let p=new Le(o.getX()+.5,o.getY()-.5),w=new Le(l.getX()+.5,l.getY()+.5),C=new Le(u.getX()-.5,u.getY()+.5),N=new Le(d.getX()-.5,d.getY()-.5);return this.expandSquare([p,w,C,N],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let n,o,l,u;try{let p=new en(this.image).detect();n=p[0],o=p[1],l=p[2],u=p[3]}catch{let w=this.image.getWidth()/2,C=this.image.getHeight()/2;n=this.getFirstDifferent(new zn(w+7,C-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new zn(w+7,C+7),!1,1,1).toResultPoint(),l=this.getFirstDifferent(new zn(w-7,C+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new zn(w-7,C-7),!1,-1,-1).toResultPoint()}let d=ot.round((n.getX()+u.getX()+o.getX()+l.getX())/4),m=ot.round((n.getY()+u.getY()+o.getY()+l.getY())/4);try{let p=new en(this.image,15,d,m).detect();n=p[0],o=p[1],l=p[2],u=p[3]}catch{n=this.getFirstDifferent(new zn(d+7,m-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new zn(d+7,m+7),!1,1,1).toResultPoint(),l=this.getFirstDifferent(new zn(d-7,m+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new zn(d-7,m-7),!1,-1,-1).toResultPoint()}return d=ot.round((n.getX()+u.getX()+o.getX()+l.getX())/4),m=ot.round((n.getY()+u.getY()+o.getY()+l.getY())/4),new zn(d,m)}getMatrixCornerPoints(n){return this.expandSquare(n,2*this.nbCenterLayers,this.getDimension())}sampleGrid(n,o,l,u,d){let m=mr.getInstance(),p=this.getDimension(),w=p/2-this.nbCenterLayers,C=p/2+this.nbCenterLayers;return m.sampleGrid(n,p,p,w,w,C,w,C,C,w,C,o.getX(),o.getY(),l.getX(),l.getY(),u.getX(),u.getY(),d.getX(),d.getY())}sampleLine(n,o,l){let u=0,d=this.distanceResultPoint(n,o),m=d/l,p=n.getX(),w=n.getY(),C=m*(o.getX()-n.getX())/d,N=m*(o.getY()-n.getY())/d;for(let D=0;D<l;D++)this.image.get(ot.round(p+D*C),ot.round(w+D*N))&&(u|=1<<l-D-1);return u}isWhiteOrBlackRectangle(n,o,l,u){let d=3;n=new zn(n.getX()-d,n.getY()+d),o=new zn(o.getX()-d,o.getY()-d),l=new zn(l.getX()+d,l.getY()-d),u=new zn(u.getX()+d,u.getY()+d);let m=this.getColor(u,n);if(m===0)return!1;let p=this.getColor(n,o);return p!==m||(p=this.getColor(o,l),p!==m)?!1:(p=this.getColor(l,u),p===m)}getColor(n,o){let l=this.distancePoint(n,o),u=(o.getX()-n.getX())/l,d=(o.getY()-n.getY())/l,m=0,p=n.getX(),w=n.getY(),C=this.image.get(n.getX(),n.getY()),N=Math.ceil(l);for(let P=0;P<N;P++)p+=u,w+=d,this.image.get(ot.round(p),ot.round(w))!==C&&m++;let D=m/l;return D>.1&&D<.9?0:D<=.1===C?1:-1}getFirstDifferent(n,o,l,u){let d=n.getX()+l,m=n.getY()+u;for(;this.isValid(d,m)&&this.image.get(d,m)===o;)d+=l,m+=u;for(d-=l,m-=u;this.isValid(d,m)&&this.image.get(d,m)===o;)d+=l;for(d-=l;this.isValid(d,m)&&this.image.get(d,m)===o;)m+=u;return m-=u,new zn(d,m)}expandSquare(n,o,l){let u=l/(2*o),d=n[0].getX()-n[2].getX(),m=n[0].getY()-n[2].getY(),p=(n[0].getX()+n[2].getX())/2,w=(n[0].getY()+n[2].getY())/2,C=new Le(p+u*d,w+u*m),N=new Le(p-u*d,w-u*m);d=n[1].getX()-n[3].getX(),m=n[1].getY()-n[3].getY(),p=(n[1].getX()+n[3].getX())/2,w=(n[1].getY()+n[3].getY())/2;let D=new Le(p+u*d,w+u*m),P=new Le(p-u*d,w-u*m);return[C,D,N,P]}isValid(n,o){return n>=0&&n<this.image.getWidth()&&o>0&&o<this.image.getHeight()}isValidPoint(n){let o=ot.round(n.getX()),l=ot.round(n.getY());return this.isValid(o,l)}distancePoint(n,o){return ot.distance(n.getX(),n.getY(),o.getX(),o.getY())}distanceResultPoint(n,o){return ot.distance(n.getX(),n.getY(),o.getX(),o.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(H.truncDivision(this.nbLayers-4,8)+1)+15}}class No{decode(n,o=null){let l=null,u=new ks(n.getBlackMatrix()),d=null,m=null;try{let N=u.detectMirror(!1);d=N.getPoints(),this.reportFoundResultPoints(o,d),m=new Nt().decode(N)}catch(N){l=N}if(m==null)try{let N=u.detectMirror(!0);d=N.getPoints(),this.reportFoundResultPoints(o,d),m=new Nt().decode(N)}catch(N){throw l??N}let p=new Ie(m.getText(),m.getRawBytes(),m.getNumBits(),d,Te.AZTEC,I.currentTimeMillis()),w=m.getByteSegments();w!=null&&p.putMetadata(Qe.BYTE_SEGMENTS,w);let C=m.getECLevel();return C!=null&&p.putMetadata(Qe.ERROR_CORRECTION_LEVEL,C),p}reportFoundResultPoints(n,o){if(n!=null){let l=n.get(ee.NEED_RESULT_POINT_CALLBACK);l!=null&&o.forEach((u,d,m)=>{l.foundPossibleResultPoint(u)})}}reset(){}}class hf extends Se{constructor(n=500){super(new No,n)}}class jt{decode(n,o){try{return this.doDecode(n,o)}catch{if(o&&o.get(ee.TRY_HARDER)===!0&&n.isRotateSupported()){const d=n.rotateCounterClockwise(),m=this.doDecode(d,o),p=m.getResultMetadata();let w=270;p!==null&&p.get(Qe.ORIENTATION)===!0&&(w=w+p.get(Qe.ORIENTATION)%360),m.putMetadata(Qe.ORIENTATION,w);const C=m.getResultPoints();if(C!==null){const N=d.getHeight();for(let D=0;D<C.length;D++)C[D]=new Le(N-C[D].getY()-1,C[D].getX())}return m}else throw new re}}reset(){}doDecode(n,o){const l=n.getWidth(),u=n.getHeight();let d=new j(l);const m=o&&o.get(ee.TRY_HARDER)===!0,p=Math.max(1,u>>(m?8:5));let w;m?w=u:w=15;const C=Math.trunc(u/2);for(let N=0;N<w;N++){const D=Math.trunc((N+1)/2),P=(N&1)===0,G=C+p*(P?D:-D);if(G<0||G>=u)break;try{d=n.getBlackRow(G,d)}catch{continue}for(let q=0;q<2;q++){if(q===1&&(d.reverse(),o&&o.get(ee.NEED_RESULT_POINT_CALLBACK)===!0)){const K=new Map;o.forEach((ie,he)=>K.set(he,ie)),K.delete(ee.NEED_RESULT_POINT_CALLBACK),o=K}try{const K=this.decodeRow(G,d,o);if(q===1){K.putMetadata(Qe.ORIENTATION,180);const ie=K.getResultPoints();ie!==null&&(ie[0]=new Le(l-ie[0].getX()-1,ie[0].getY()),ie[1]=new Le(l-ie[1].getX()-1,ie[1].getY()))}return K}catch{}}}throw new re}static recordPattern(n,o,l){const u=l.length;for(let C=0;C<u;C++)l[C]=0;const d=n.getSize();if(o>=d)throw new re;let m=!n.get(o),p=0,w=o;for(;w<d;){if(n.get(w)!==m)l[p]++;else{if(++p===u)break;l[p]=1,m=!m}w++}if(!(p===u||p===u-1&&w===d))throw new re}static recordPatternInReverse(n,o,l){let u=l.length,d=n.get(o);for(;o>0&&u>=0;)n.get(--o)!==d&&(u--,d=!d);if(u>=0)throw new re;jt.recordPattern(n,o+1,l)}static patternMatchVariance(n,o,l){const u=n.length;let d=0,m=0;for(let C=0;C<u;C++)d+=n[C],m+=o[C];if(d<m)return Number.POSITIVE_INFINITY;const p=d/m;l*=p;let w=0;for(let C=0;C<u;C++){const N=n[C],D=o[C]*p,P=N>D?N-D:D-N;if(P>l)return Number.POSITIVE_INFINITY;w+=P}return w/d}}class Ne extends jt{static findStartPattern(n){const o=n.getSize(),l=n.getNextSet(0);let u=0,d=Int32Array.from([0,0,0,0,0,0]),m=l,p=!1;const w=6;for(let C=l;C<o;C++)if(n.get(C)!==p)d[u]++;else{if(u===w-1){let N=Ne.MAX_AVG_VARIANCE,D=-1;for(let P=Ne.CODE_START_A;P<=Ne.CODE_START_C;P++){const G=jt.patternMatchVariance(d,Ne.CODE_PATTERNS[P],Ne.MAX_INDIVIDUAL_VARIANCE);G<N&&(N=G,D=P)}if(D>=0&&n.isRange(Math.max(0,m-(C-m)/2),m,!1))return Int32Array.from([m,C,D]);m+=d[0]+d[1],d=d.slice(2,d.length-1),d[u-1]=0,d[u]=0,u--}else u++;d[u]=1,p=!p}throw new re}static decodeCode(n,o,l){jt.recordPattern(n,l,o);let u=Ne.MAX_AVG_VARIANCE,d=-1;for(let m=0;m<Ne.CODE_PATTERNS.length;m++){const p=Ne.CODE_PATTERNS[m],w=this.patternMatchVariance(o,p,Ne.MAX_INDIVIDUAL_VARIANCE);w<u&&(u=w,d=m)}if(d>=0)return d;throw new re}decodeRow(n,o,l){const u=l&&l.get(ee.ASSUME_GS1)===!0,d=Ne.findStartPattern(o),m=d[2];let p=0;const w=new Uint8Array(20);w[p++]=m;let C;switch(m){case Ne.CODE_START_A:C=Ne.CODE_CODE_A;break;case Ne.CODE_START_B:C=Ne.CODE_CODE_B;break;case Ne.CODE_START_C:C=Ne.CODE_CODE_C;break;default:throw new X}let N=!1,D=!1,P="",G=d[0],q=d[1];const K=Int32Array.from([0,0,0,0,0,0]);let ie=0,he=0,Re=m,Ae=0,Ee=!0,it=!1,We=!1;for(;!N;){const Mi=D;switch(D=!1,ie=he,he=Ne.decodeCode(o,K,q),w[p++]=he,he!==Ne.CODE_STOP&&(Ee=!0),he!==Ne.CODE_STOP&&(Ae++,Re+=Ae*he),G=q,q+=K.reduce((gc,qs)=>gc+qs,0),he){case Ne.CODE_START_A:case Ne.CODE_START_B:case Ne.CODE_START_C:throw new X}switch(C){case Ne.CODE_CODE_A:if(he<64)We===it?P+=String.fromCharCode(32+he):P+=String.fromCharCode(32+he+128),We=!1;else if(he<96)We===it?P+=String.fromCharCode(he-64):P+=String.fromCharCode(he+64),We=!1;else switch(he!==Ne.CODE_STOP&&(Ee=!1),he){case Ne.CODE_FNC_1:u&&(P.length===0?P+="]C1":P+="");break;case Ne.CODE_FNC_2:case Ne.CODE_FNC_3:break;case Ne.CODE_FNC_4_A:!it&&We?(it=!0,We=!1):it&&We?(it=!1,We=!1):We=!0;break;case Ne.CODE_SHIFT:D=!0,C=Ne.CODE_CODE_B;break;case Ne.CODE_CODE_B:C=Ne.CODE_CODE_B;break;case Ne.CODE_CODE_C:C=Ne.CODE_CODE_C;break;case Ne.CODE_STOP:N=!0;break}break;case Ne.CODE_CODE_B:if(he<96)We===it?P+=String.fromCharCode(32+he):P+=String.fromCharCode(32+he+128),We=!1;else switch(he!==Ne.CODE_STOP&&(Ee=!1),he){case Ne.CODE_FNC_1:u&&(P.length===0?P+="]C1":P+="");break;case Ne.CODE_FNC_2:case Ne.CODE_FNC_3:break;case Ne.CODE_FNC_4_B:!it&&We?(it=!0,We=!1):it&&We?(it=!1,We=!1):We=!0;break;case Ne.CODE_SHIFT:D=!0,C=Ne.CODE_CODE_A;break;case Ne.CODE_CODE_A:C=Ne.CODE_CODE_A;break;case Ne.CODE_CODE_C:C=Ne.CODE_CODE_C;break;case Ne.CODE_STOP:N=!0;break}break;case Ne.CODE_CODE_C:if(he<100)he<10&&(P+="0"),P+=he;else switch(he!==Ne.CODE_STOP&&(Ee=!1),he){case Ne.CODE_FNC_1:u&&(P.length===0?P+="]C1":P+="");break;case Ne.CODE_CODE_A:C=Ne.CODE_CODE_A;break;case Ne.CODE_CODE_B:C=Ne.CODE_CODE_B;break;case Ne.CODE_STOP:N=!0;break}break}Mi&&(C=C===Ne.CODE_CODE_A?Ne.CODE_CODE_B:Ne.CODE_CODE_A)}const sn=q-G;if(q=o.getNextUnset(q),!o.isRange(q,Math.min(o.getSize(),q+(q-G)/2),!1))throw new re;if(Re-=Ae*ie,Re%103!==ie)throw new R;const lr=P.length;if(lr===0)throw new re;lr>0&&Ee&&(C===Ne.CODE_CODE_C?P=P.substring(0,lr-2):P=P.substring(0,lr-1));const Un=(d[1]+d[0])/2,Rt=G+sn/2,In=w.length,$n=new Uint8Array(In);for(let Mi=0;Mi<In;Mi++)$n[Mi]=w[Mi];const xa=[new Le(Un,n),new Le(Rt,n)];return new Ie(P,$n,0,xa,Te.CODE_128,new Date().getTime())}}Ne.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],Ne.MAX_AVG_VARIANCE=.25,Ne.MAX_INDIVIDUAL_VARIANCE=.7,Ne.CODE_SHIFT=98,Ne.CODE_CODE_C=99,Ne.CODE_CODE_B=100,Ne.CODE_CODE_A=101,Ne.CODE_FNC_1=102,Ne.CODE_FNC_2=97,Ne.CODE_FNC_3=96,Ne.CODE_FNC_4_A=101,Ne.CODE_FNC_4_B=100,Ne.CODE_START_A=103,Ne.CODE_START_B=104,Ne.CODE_START_C=105,Ne.CODE_STOP=106;class Dt extends jt{constructor(n=!1,o=!1){super(),this.usingCheckDigit=n,this.extendedMode=o,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(n,o,l){let u=this.counters;u.fill(0),this.decodeRowResult="";let d=Dt.findAsteriskPattern(o,u),m=o.getNextSet(d[1]),p=o.getSize(),w,C;do{Dt.recordPattern(o,m,u);let K=Dt.toNarrowWidePattern(u);if(K<0)throw new re;w=Dt.patternToChar(K),this.decodeRowResult+=w,C=m;for(let ie of u)m+=ie;m=o.getNextSet(m)}while(w!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let N=0;for(let K of u)N+=K;let D=m-C-N;if(m!==p&&D*2<N)throw new re;if(this.usingCheckDigit){let K=this.decodeRowResult.length-1,ie=0;for(let he=0;he<K;he++)ie+=Dt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(he));if(this.decodeRowResult.charAt(K)!==Dt.ALPHABET_STRING.charAt(ie%43))throw new R;this.decodeRowResult=this.decodeRowResult.substring(0,K)}if(this.decodeRowResult.length===0)throw new re;let P;this.extendedMode?P=Dt.decodeExtended(this.decodeRowResult):P=this.decodeRowResult;let G=(d[1]+d[0])/2,q=C+N/2;return new Ie(P,null,0,[new Le(G,n),new Le(q,n)],Te.CODE_39,new Date().getTime())}static findAsteriskPattern(n,o){let l=n.getSize(),u=n.getNextSet(0),d=0,m=u,p=!1,w=o.length;for(let C=u;C<l;C++)if(n.get(C)!==p)o[d]++;else{if(d===w-1){if(this.toNarrowWidePattern(o)===Dt.ASTERISK_ENCODING&&n.isRange(Math.max(0,m-Math.floor((C-m)/2)),m,!1))return[m,C];m+=o[0]+o[1],o.copyWithin(0,2,2+d-1),o[d-1]=0,o[d]=0,d--}else d++;o[d]=1,p=!p}throw new re}static toNarrowWidePattern(n){let o=n.length,l=0,u;do{let d=2147483647;for(let w of n)w<d&&w>l&&(d=w);l=d,u=0;let m=0,p=0;for(let w=0;w<o;w++){let C=n[w];C>l&&(p|=1<<o-1-w,u++,m+=C)}if(u===3){for(let w=0;w<o&&u>0;w++){let C=n[w];if(C>l&&(u--,C*2>=m))return-1}return p}}while(u>3);return-1}static patternToChar(n){for(let o=0;o<Dt.CHARACTER_ENCODINGS.length;o++)if(Dt.CHARACTER_ENCODINGS[o]===n)return Dt.ALPHABET_STRING.charAt(o);if(n===Dt.ASTERISK_ENCODING)return"*";throw new re}static decodeExtended(n){let o=n.length,l="";for(let u=0;u<o;u++){let d=n.charAt(u);if(d==="+"||d==="$"||d==="%"||d==="/"){let m=n.charAt(u+1),p="\0";switch(d){case"+":if(m>="A"&&m<="Z")p=String.fromCharCode(m.charCodeAt(0)+32);else throw new X;break;case"$":if(m>="A"&&m<="Z")p=String.fromCharCode(m.charCodeAt(0)-64);else throw new X;break;case"%":if(m>="A"&&m<="E")p=String.fromCharCode(m.charCodeAt(0)-38);else if(m>="F"&&m<="J")p=String.fromCharCode(m.charCodeAt(0)-11);else if(m>="K"&&m<="O")p=String.fromCharCode(m.charCodeAt(0)+16);else if(m>="P"&&m<="T")p=String.fromCharCode(m.charCodeAt(0)+43);else if(m==="U")p="\0";else if(m==="V")p="@";else if(m==="W")p="`";else if(m==="X"||m==="Y"||m==="Z")p="";else throw new X;break;case"/":if(m>="A"&&m<="O")p=String.fromCharCode(m.charCodeAt(0)-32);else if(m==="Z")p=":";else throw new X;break}l+=p,u++}else l+=d}return l}}Dt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Dt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],Dt.ASTERISK_ENCODING=148;class et extends jt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(n,o,l){let u=this.decodeStart(o),d=this.decodeEnd(o),m=new pe;et.decodeMiddle(o,u[1],d[0],m);let p=m.toString(),w=null;l!=null&&(w=l.get(ee.ALLOWED_LENGTHS)),w==null&&(w=et.DEFAULT_ALLOWED_LENGTHS);let C=p.length,N=!1,D=0;for(let q of w){if(C===q){N=!0;break}q>D&&(D=q)}if(!N&&C>D&&(N=!0),!N)throw new X;const P=[new Le(u[1],n),new Le(d[0],n)];return new Ie(p,null,0,P,Te.ITF,new Date().getTime())}static decodeMiddle(n,o,l,u){let d=new Int32Array(10),m=new Int32Array(5),p=new Int32Array(5);for(d.fill(0),m.fill(0),p.fill(0);o<l;){jt.recordPattern(n,o,d);for(let C=0;C<5;C++){let N=2*C;m[C]=d[N],p[C]=d[N+1]}let w=et.decodeDigit(m);u.append(w.toString()),w=this.decodeDigit(p),u.append(w.toString()),d.forEach(function(C){o+=C})}}decodeStart(n){let o=et.skipWhiteSpace(n),l=et.findGuardPattern(n,o,et.START_PATTERN);return this.narrowLineWidth=(l[1]-l[0])/4,this.validateQuietZone(n,l[0]),l}validateQuietZone(n,o){let l=this.narrowLineWidth*10;l=l<o?l:o;for(let u=o-1;l>0&&u>=0&&!n.get(u);u--)l--;if(l!==0)throw new re}static skipWhiteSpace(n){const o=n.getSize(),l=n.getNextSet(0);if(l===o)throw new re;return l}decodeEnd(n){n.reverse();try{let o=et.skipWhiteSpace(n),l;try{l=et.findGuardPattern(n,o,et.END_PATTERN_REVERSED[0])}catch(d){d instanceof re&&(l=et.findGuardPattern(n,o,et.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,l[0]);let u=l[0];return l[0]=n.getSize()-l[1],l[1]=n.getSize()-u,l}finally{n.reverse()}}static findGuardPattern(n,o,l){let u=l.length,d=new Int32Array(u),m=n.getSize(),p=!1,w=0,C=o;d.fill(0);for(let N=o;N<m;N++)if(n.get(N)!==p)d[w]++;else{if(w===u-1){if(jt.patternMatchVariance(d,l,et.MAX_INDIVIDUAL_VARIANCE)<et.MAX_AVG_VARIANCE)return[C,N];C+=d[0]+d[1],I.arraycopy(d,2,d,0,w-1),d[w-1]=0,d[w]=0,w--}else w++;d[w]=1,p=!p}throw new re}static decodeDigit(n){let o=et.MAX_AVG_VARIANCE,l=-1,u=et.PATTERNS.length;for(let d=0;d<u;d++){let m=et.PATTERNS[d],p=jt.patternMatchVariance(n,m,et.MAX_INDIVIDUAL_VARIANCE);p<o?(o=p,l=d):p===o&&(l=-1)}if(l>=0)return l%10;throw new re}}et.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],et.MAX_AVG_VARIANCE=.38,et.MAX_INDIVIDUAL_VARIANCE=.5,et.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],et.START_PATTERN=Int32Array.from([1,1,1,1]),et.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class Kt extends jt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(n){let o=!1,l,u=0,d=Int32Array.from([0,0,0]);for(;!o;){d=Int32Array.from([0,0,0]),l=Kt.findGuardPattern(n,u,!1,this.START_END_PATTERN,d);let m=l[0];u=l[1];let p=m-(u-m);p>=0&&(o=n.isRange(p,m,!1))}return l}static checkChecksum(n){return Kt.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let o=n.length;if(o===0)return!1;let l=parseInt(n.charAt(o-1),10);return Kt.getStandardUPCEANChecksum(n.substring(0,o-1))===l}static getStandardUPCEANChecksum(n){let o=n.length,l=0;for(let u=o-1;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}l*=3;for(let u=o-2;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}return(1e3-l)%10}static decodeEnd(n,o){return Kt.findGuardPattern(n,o,!1,Kt.START_END_PATTERN,new Int32Array(Kt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(n,o,l,u){return this.findGuardPattern(n,o,l,u,new Int32Array(u.length))}static findGuardPattern(n,o,l,u,d){let m=n.getSize();o=l?n.getNextUnset(o):n.getNextSet(o);let p=0,w=o,C=u.length,N=l;for(let D=o;D<m;D++)if(n.get(D)!==N)d[p]++;else{if(p===C-1){if(jt.patternMatchVariance(d,u,Kt.MAX_INDIVIDUAL_VARIANCE)<Kt.MAX_AVG_VARIANCE)return Int32Array.from([w,D]);w+=d[0]+d[1];let P=d.slice(2,d.length-1);for(let G=0;G<p-1;G++)d[G]=P[G];d[p-1]=0,d[p]=0,p--}else p++;d[p]=1,N=!N}throw new re}static decodeDigit(n,o,l,u){this.recordPattern(n,l,o);let d=this.MAX_AVG_VARIANCE,m=-1,p=u.length;for(let w=0;w<p;w++){let C=u[w],N=jt.patternMatchVariance(o,C,Kt.MAX_INDIVIDUAL_VARIANCE);N<d&&(d=N,m=w)}if(m>=0)return m;throw new re}}Kt.MAX_AVG_VARIANCE=.48,Kt.MAX_INDIVIDUAL_VARIANCE=.7,Kt.START_END_PATTERN=Int32Array.from([1,1,1]),Kt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),Kt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Kt.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class Ka{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(n,o,l){let u=this.decodeRowStringBuffer,d=this.decodeMiddle(o,l,u),m=u.toString(),p=Ka.parseExtensionString(m),w=[new Le((l[0]+l[1])/2,n),new Le(d,n)],C=new Ie(m,null,0,w,Te.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&C.putAllMetadata(p),C}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let C=0;C<5&&m<d;C++){let N=Kt.decodeDigit(n,u,m,Kt.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<4-C),C!==4&&(m=n.getNextSet(m),m=n.getNextUnset(m))}if(l.length!==5)throw new re;let w=this.determineCheckDigit(p);if(Ka.extensionChecksum(l.toString())!==w)throw new re;return m}static extensionChecksum(n){let o=n.length,l=0;for(let u=o-2;u>=0;u-=2)l+=n.charAt(u).charCodeAt(0)-48;l*=3;for(let u=o-1;u>=0;u-=2)l+=n.charAt(u).charCodeAt(0)-48;return l*=3,l%10}determineCheckDigit(n){for(let o=0;o<10;o++)if(n===this.CHECK_DIGIT_ENCODINGS[o])return o;throw new re}static parseExtensionString(n){if(n.length!==5)return null;let o=Ka.parseExtension5String(n);return o==null?null:new Map([[Qe.SUGGESTED_PRICE,o]])}static parseExtension5String(n){let o;switch(n.charAt(0)){case"0":o="£";break;case"5":o="$";break;case"9":switch(n){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}o="";break;default:o="";break}let l=parseInt(n.substring(1)),u=(l/100).toString(),d=l%100,m=d<10?"0"+d:d.toString();return o+u+"."+m}}class zs{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(n,o,l){let u=this.decodeRowStringBuffer,d=this.decodeMiddle(o,l,u),m=u.toString(),p=zs.parseExtensionString(m),w=[new Le((l[0]+l[1])/2,n),new Le(d,n)],C=new Ie(m,null,0,w,Te.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&C.putAllMetadata(p),C}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let w=0;w<2&&m<d;w++){let C=Kt.decodeDigit(n,u,m,Kt.L_AND_G_PATTERNS);l+=String.fromCharCode(48+C%10);for(let N of u)m+=N;C>=10&&(p|=1<<1-w),w!==1&&(m=n.getNextSet(m),m=n.getNextUnset(m))}if(l.length!==2)throw new re;if(parseInt(l.toString())%4!==p)throw new re;return m}static parseExtensionString(n){return n.length!==2?null:new Map([[Qe.ISSUE_NUMBER,parseInt(n)]])}}class Qa{static decodeRow(n,o,l){let u=Kt.findGuardPattern(o,l,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Ka().decodeRow(n,o,u)}catch{return new zs().decodeRow(n,o,u)}}}Qa.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class ut extends Kt{constructor(){super(),this.decodeRowStringBuffer="",ut.L_AND_G_PATTERNS=ut.L_PATTERNS.map(n=>Int32Array.from(n));for(let n=10;n<20;n++){let o=ut.L_PATTERNS[n-10],l=new Int32Array(o.length);for(let u=0;u<o.length;u++)l[u]=o[o.length-u-1];ut.L_AND_G_PATTERNS[n]=l}}decodeRow(n,o,l){let u=ut.findStartGuardPattern(o),d=l==null?null:l.get(ee.NEED_RESULT_POINT_CALLBACK);if(d!=null){const Ee=new Le((u[0]+u[1])/2,n);d.foundPossibleResultPoint(Ee)}let m=this.decodeMiddle(o,u,this.decodeRowStringBuffer),p=m.rowOffset,w=m.resultString;if(d!=null){const Ee=new Le(p,n);d.foundPossibleResultPoint(Ee)}let C=this.decodeEnd(o,p);if(d!=null){const Ee=new Le((C[0]+C[1])/2,n);d.foundPossibleResultPoint(Ee)}let N=C[1],D=N+(N-C[0]);if(D>=o.getSize()||!o.isRange(N,D,!1))throw new re;let P=w.toString();if(P.length<8)throw new X;if(!ut.checkChecksum(P))throw new R;let G=(u[1]+u[0])/2,q=(C[1]+C[0])/2,K=this.getBarcodeFormat(),ie=[new Le(G,n),new Le(q,n)],he=new Ie(P,null,0,ie,K,new Date().getTime()),Re=0;try{let Ee=Qa.decodeRow(n,o,C[1]);he.putMetadata(Qe.UPC_EAN_EXTENSION,Ee.getText()),he.putAllMetadata(Ee.getResultMetadata()),he.addResultPoints(Ee.getResultPoints()),Re=Ee.getText().length}catch{}let Ae=l==null?null:l.get(ee.ALLOWED_EAN_EXTENSIONS);if(Ae!=null){let Ee=!1;for(let it in Ae)if(Re.toString()===it){Ee=!0;break}if(!Ee)throw new re}return he}decodeEnd(n,o){return ut.findGuardPattern(n,o,!1,ut.START_END_PATTERN,new Int32Array(ut.START_END_PATTERN.length).fill(0))}static checkChecksum(n){return ut.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let o=n.length;if(o===0)return!1;let l=parseInt(n.charAt(o-1),10);return ut.getStandardUPCEANChecksum(n.substring(0,o-1))===l}static getStandardUPCEANChecksum(n){let o=n.length,l=0;for(let u=o-1;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}l*=3;for(let u=o-2;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}return(1e3-l)%10}}class Ir extends ut{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let C=0;C<6&&m<d;C++){let N=ut.decodeDigit(n,u,m,ut.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<5-C)}l=Ir.determineFirstDigit(l,p),m=ut.findGuardPattern(n,m,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0))[1];for(let C=0;C<6&&m<d;C++){let N=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+N);for(let D of u)m+=D}return{rowOffset:m,resultString:l}}getBarcodeFormat(){return Te.EAN_13}static determineFirstDigit(n,o){for(let l=0;l<10;l++)if(o===this.FIRST_DIGIT_ENCODINGS[l])return n=String.fromCharCode(48+l)+n,n;throw new re}}Ir.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class ci extends ut{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,o,l){const u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1];for(let w=0;w<4&&m<d;w++){let C=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+C);for(let N of u)m+=N}m=ut.findGuardPattern(n,m,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0))[1];for(let w=0;w<4&&m<d;w++){let C=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+C);for(let N of u)m+=N}return{rowOffset:m,resultString:l}}getBarcodeFormat(){return Te.EAN_8}}class Ja extends ut{constructor(){super(...arguments),this.ean13Reader=new Ir}getBarcodeFormat(){return Te.UPC_A}decode(n,o){return this.maybeReturnResult(this.ean13Reader.decode(n))}decodeRow(n,o,l){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,o,l))}decodeMiddle(n,o,l){return this.ean13Reader.decodeMiddle(n,o,l)}maybeReturnResult(n){let o=n.getText();if(o.charAt(0)==="0"){let l=new Ie(o.substring(1),null,null,n.getResultPoints(),Te.UPC_A);return n.getResultMetadata()!=null&&l.putAllMetadata(n.getResultMetadata()),l}else throw new re}reset(){this.ean13Reader.reset()}}class Pn extends ut{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(n,o,l){const u=this.decodeMiddleCounters.map(C=>C);u[0]=0,u[1]=0,u[2]=0,u[3]=0;const d=n.getSize();let m=o[1],p=0;for(let C=0;C<6&&m<d;C++){const N=Pn.decodeDigit(n,u,m,Pn.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<5-C)}let w=Pn.determineNumSysAndCheckDigit(l,p);return{rowOffset:m,resultString:w}}decodeEnd(n,o){return Pn.findGuardPatternWithoutCounters(n,o,!0,Pn.MIDDLE_END_PATTERN)}checkChecksum(n){return ut.checkChecksum(Pn.convertUPCEtoUPCA(n))}static determineNumSysAndCheckDigit(n,o){for(let l=0;l<=1;l++)for(let u=0;u<10;u++)if(o===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[l][u]){let d=String.fromCharCode(48+l),m=String.fromCharCode(48+u);return d+n+m}throw re.getNotFoundInstance()}getBarcodeFormat(){return Te.UPC_E}static convertUPCEtoUPCA(n){const o=n.slice(1,7).split("").map(d=>d.charCodeAt(0)),l=new pe;l.append(n.charAt(0));let u=o[5];switch(u){case 0:case 1:case 2:l.appendChars(o,0,2),l.append(u),l.append("0000"),l.appendChars(o,2,3);break;case 3:l.appendChars(o,0,3),l.append("00000"),l.appendChars(o,3,2);break;case 4:l.appendChars(o,0,4),l.append("00000"),l.append(o[4]);break;default:l.appendChars(o,0,5),l.append("0000"),l.append(u);break}return n.length>=8&&l.append(n.charAt(7)),l.toString()}}Pn.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Pn.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class Ps extends jt{constructor(n){super();let o=n==null?null:n.get(ee.POSSIBLE_FORMATS),l=[];s(o)?(l.push(new Ir),l.push(new Ja),l.push(new ci),l.push(new Pn)):(o.indexOf(Te.EAN_13)>-1&&l.push(new Ir),o.indexOf(Te.UPC_A)>-1&&l.push(new Ja),o.indexOf(Te.EAN_8)>-1&&l.push(new ci),o.indexOf(Te.UPC_E)>-1&&l.push(new Pn)),this.readers=l}decodeRow(n,o,l){for(let u of this.readers)try{const d=u.decodeRow(n,o,l),m=d.getBarcodeFormat()===Te.EAN_13&&d.getText().charAt(0)==="0",p=l==null?null:l.get(ee.POSSIBLE_FORMATS),w=p==null||p.includes(Te.UPC_A);if(m&&w){const C=d.getRawBytes(),N=new Ie(d.getText().substring(1),C,C?C.length:null,d.getResultPoints(),Te.UPC_A);return N.putAllMetadata(d.getResultMetadata()),N}return d}catch{}throw new re}reset(){for(let n of this.readers)n.reset()}}class Rn extends jt{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(n,o){for(let l=0;l<o.length;l++)if(jt.patternMatchVariance(n,o[l],Rn.MAX_INDIVIDUAL_VARIANCE)<Rn.MAX_AVG_VARIANCE)return l;throw new re}static count(n){return ot.sum(new Int32Array(n))}static increment(n,o){let l=0,u=o[0];for(let d=1;d<n.length;d++)o[d]>u&&(u=o[d],l=d);n[l]++}static decrement(n,o){let l=0,u=o[0];for(let d=1;d<n.length;d++)o[d]<u&&(u=o[d],l=d);n[l]--}static isFinderPattern(n){let o=n[0]+n[1],l=o+n[2]+n[3],u=o/l;if(u>=Rn.MIN_FINDER_PATTERN_RATIO&&u<=Rn.MAX_FINDER_PATTERN_RATIO){let d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;for(let p of n)p>m&&(m=p),p<d&&(d=p);return m<10*d}return!1}}Rn.MAX_AVG_VARIANCE=.2,Rn.MAX_INDIVIDUAL_VARIANCE=.45,Rn.MIN_FINDER_PATTERN_RATIO=9.5/12,Rn.MAX_FINDER_PATTERN_RATIO=12.5/14;class ui{constructor(n,o){this.value=n,this.checksumPortion=o}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(n){if(!(n instanceof ui))return!1;const o=n;return this.value===o.value&&this.checksumPortion===o.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class fi{constructor(n,o,l,u,d){this.value=n,this.startEnd=o,this.value=n,this.startEnd=o,this.resultPoints=new Array,this.resultPoints.push(new Le(l,d)),this.resultPoints.push(new Le(u,d))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(n){if(!(n instanceof fi))return!1;const o=n;return this.value===o.value}hashCode(){return this.value}}class Mr{constructor(){}static getRSSvalue(n,o,l){let u=0;for(let w of n)u+=w;let d=0,m=0,p=n.length;for(let w=0;w<p-1;w++){let C;for(C=1,m|=1<<w;C<n[w];C++,m&=~(1<<w)){let N=Mr.combins(u-C-1,p-w-2);if(l&&m===0&&u-C-(p-w-1)>=p-w-1&&(N-=Mr.combins(u-C-(p-w),p-w-2)),p-w-1>1){let D=0;for(let P=u-C-(p-w-2);P>o;P--)D+=Mr.combins(u-C-P-1,p-w-3);N-=D*(p-1-w)}else u-C>o&&N--;d+=N}u-=C}return d}static combins(n,o){let l,u;n-o>o?(u=o,l=n-o):(u=n-o,l=o);let d=1,m=1;for(let p=n;p>l;p--)d*=p,m<=u&&(d/=m,m++);for(;m<=u;)d/=m,m++;return d}}class ec{static buildBitArray(n){let o=n.length*2-1;n[n.length-1].getRightChar()==null&&(o-=1);let l=12*o,u=new j(l),d=0,p=n[0].getRightChar().getValue();for(let w=11;w>=0;--w)(p&1<<w)!=0&&u.set(d),d++;for(let w=1;w<n.length;++w){let C=n[w],N=C.getLeftChar().getValue();for(let D=11;D>=0;--D)(N&1<<D)!=0&&u.set(d),d++;if(C.getRightChar()!=null){let D=C.getRightChar().getValue();for(let P=11;P>=0;--P)(D&1<<P)!=0&&u.set(d),d++}}return u}}class di{constructor(n,o){o?this.decodedInformation=null:(this.finished=n,this.decodedInformation=o)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Oo{constructor(n){this.newPosition=n}getNewPosition(){return this.newPosition}}class Ln extends Oo{constructor(n,o){super(n),this.value=o}getValue(){return this.value}isFNC1(){return this.value===Ln.FNC1}}Ln.FNC1="$";class Kr extends Oo{constructor(n,o,l){super(n),l?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=o}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class qn extends Oo{constructor(n,o,l){if(super(n),o<0||o>10||l<0||l>10)throw new X;this.firstDigit=o,this.secondDigit=l}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===qn.FNC1}isSecondDigitFNC1(){return this.secondDigit===qn.FNC1}isAnyFNC1(){return this.firstDigit===qn.FNC1||this.secondDigit===qn.FNC1}}qn.FNC1=10;class De{constructor(){}static parseFieldsInGeneralPurpose(n){if(!n)return null;if(n.length<2)throw new re;let o=n.substring(0,2);for(let d of De.TWO_DIGIT_DATA_LENGTH)if(d[0]===o)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(2,d[2],n):De.processFixedAI(2,d[1],n);if(n.length<3)throw new re;let l=n.substring(0,3);for(let d of De.THREE_DIGIT_DATA_LENGTH)if(d[0]===l)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(3,d[2],n):De.processFixedAI(3,d[1],n);for(let d of De.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(d[0]===l)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(4,d[2],n):De.processFixedAI(4,d[1],n);if(n.length<4)throw new re;let u=n.substring(0,4);for(let d of De.FOUR_DIGIT_DATA_LENGTH)if(d[0]===u)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(4,d[2],n):De.processFixedAI(4,d[1],n);throw new re}static processFixedAI(n,o,l){if(l.length<n)throw new re;let u=l.substring(0,n);if(l.length<n+o)throw new re;let d=l.substring(n,n+o),m=l.substring(n+o),p="("+u+")"+d,w=De.parseFieldsInGeneralPurpose(m);return w==null?p:p+w}static processVariableAI(n,o,l){let u=l.substring(0,n),d;l.length<n+o?d=l.length:d=n+o;let m=l.substring(n,d),p=l.substring(d),w="("+u+")"+m,C=De.parseFieldsInGeneralPurpose(p);return C==null?w:w+C}}De.VARIABLE_LENGTH=[],De.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",De.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",De.VARIABLE_LENGTH,20],["22",De.VARIABLE_LENGTH,29],["30",De.VARIABLE_LENGTH,8],["37",De.VARIABLE_LENGTH,8],["90",De.VARIABLE_LENGTH,30],["91",De.VARIABLE_LENGTH,30],["92",De.VARIABLE_LENGTH,30],["93",De.VARIABLE_LENGTH,30],["94",De.VARIABLE_LENGTH,30],["95",De.VARIABLE_LENGTH,30],["96",De.VARIABLE_LENGTH,30],["97",De.VARIABLE_LENGTH,3],["98",De.VARIABLE_LENGTH,30],["99",De.VARIABLE_LENGTH,30]],De.THREE_DIGIT_DATA_LENGTH=[["240",De.VARIABLE_LENGTH,30],["241",De.VARIABLE_LENGTH,30],["242",De.VARIABLE_LENGTH,6],["250",De.VARIABLE_LENGTH,30],["251",De.VARIABLE_LENGTH,30],["253",De.VARIABLE_LENGTH,17],["254",De.VARIABLE_LENGTH,20],["400",De.VARIABLE_LENGTH,30],["401",De.VARIABLE_LENGTH,30],["402",17],["403",De.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",De.VARIABLE_LENGTH,20],["421",De.VARIABLE_LENGTH,15],["422",3],["423",De.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],De.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",De.VARIABLE_LENGTH,15],["391",De.VARIABLE_LENGTH,18],["392",De.VARIABLE_LENGTH,15],["393",De.VARIABLE_LENGTH,18],["703",De.VARIABLE_LENGTH,30]],De.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",De.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",De.VARIABLE_LENGTH,20],["8003",De.VARIABLE_LENGTH,30],["8004",De.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",De.VARIABLE_LENGTH,30],["8008",De.VARIABLE_LENGTH,12],["8018",18],["8020",De.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",De.VARIABLE_LENGTH,70],["8200",De.VARIABLE_LENGTH,70]];class Wn{constructor(n){this.buffer=new pe,this.information=n}decodeAllCodes(n,o){let l=o,u=null;do{let d=this.decodeGeneralPurposeField(l,u),m=De.parseFieldsInGeneralPurpose(d.getNewString());if(m!=null&&n.append(m),d.isRemaining()?u=""+d.getRemainingValue():u=null,l===d.getNewPosition())break;l=d.getNewPosition()}while(!0);return n.toString()}isStillNumeric(n){if(n+7>this.information.getSize())return n+4<=this.information.getSize();for(let o=n;o<n+3;++o)if(this.information.get(o))return!0;return this.information.get(n+3)}decodeNumeric(n){if(n+7>this.information.getSize()){let d=this.extractNumericValueFromBitArray(n,4);return d===0?new qn(this.information.getSize(),qn.FNC1,qn.FNC1):new qn(this.information.getSize(),d-1,qn.FNC1)}let o=this.extractNumericValueFromBitArray(n,7),l=(o-8)/11,u=(o-8)%11;return new qn(n+7,l,u)}extractNumericValueFromBitArray(n,o){return Wn.extractNumericValueFromBitArray(this.information,n,o)}static extractNumericValueFromBitArray(n,o,l){let u=0;for(let d=0;d<l;++d)n.get(o+d)&&(u|=1<<l-d-1);return u}decodeGeneralPurposeField(n,o){this.buffer.setLengthToZero(),o!=null&&this.buffer.append(o),this.current.setPosition(n);let l=this.parseBlocks();return l!=null&&l.isRemaining()?new Kr(this.current.getPosition(),this.buffer.toString(),l.getRemainingValue()):new Kr(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let n,o;do{let l=this.current.getPosition();if(this.current.isAlpha()?(o=this.parseAlphaBlock(),n=o.isFinished()):this.current.isIsoIec646()?(o=this.parseIsoIec646Block(),n=o.isFinished()):(o=this.parseNumericBlock(),n=o.isFinished()),!(l!==this.current.getPosition())&&!n)break}while(!n);return o.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let n=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFirstDigitFNC1()){let o;return n.isSecondDigitFNC1()?o=new Kr(this.current.getPosition(),this.buffer.toString()):o=new Kr(this.current.getPosition(),this.buffer.toString(),n.getSecondDigit()),new di(!0,o)}if(this.buffer.append(n.getFirstDigit()),n.isSecondDigitFNC1()){let o=new Kr(this.current.getPosition(),this.buffer.toString());return new di(!0,o)}this.buffer.append(n.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new di(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let n=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let o=new Kr(this.current.getPosition(),this.buffer.toString());return new di(!0,o)}this.buffer.append(n.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new di(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let n=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let o=new Kr(this.current.getPosition(),this.buffer.toString());return new di(!0,o)}this.buffer.append(n.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new di(!1)}isStillIsoIec646(n){if(n+5>this.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(n,5);if(o>=5&&o<16)return!0;if(n+7>this.information.getSize())return!1;let l=this.extractNumericValueFromBitArray(n,7);if(l>=64&&l<116)return!0;if(n+8>this.information.getSize())return!1;let u=this.extractNumericValueFromBitArray(n,8);return u>=232&&u<253}decodeIsoIec646(n){let o=this.extractNumericValueFromBitArray(n,5);if(o===15)return new Ln(n+5,Ln.FNC1);if(o>=5&&o<15)return new Ln(n+5,"0"+(o-5));let l=this.extractNumericValueFromBitArray(n,7);if(l>=64&&l<90)return new Ln(n+7,""+(l+1));if(l>=90&&l<116)return new Ln(n+7,""+(l+7));let u=this.extractNumericValueFromBitArray(n,8),d;switch(u){case 232:d="!";break;case 233:d='"';break;case 234:d="%";break;case 235:d="&";break;case 236:d="'";break;case 237:d="(";break;case 238:d=")";break;case 239:d="*";break;case 240:d="+";break;case 241:d=",";break;case 242:d="-";break;case 243:d=".";break;case 244:d="/";break;case 245:d=":";break;case 246:d=";";break;case 247:d="<";break;case 248:d="=";break;case 249:d=">";break;case 250:d="?";break;case 251:d="_";break;case 252:d=" ";break;default:throw new X}return new Ln(n+8,d)}isStillAlpha(n){if(n+5>this.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(n,5);if(o>=5&&o<16)return!0;if(n+6>this.information.getSize())return!1;let l=this.extractNumericValueFromBitArray(n,6);return l>=16&&l<63}decodeAlphanumeric(n){let o=this.extractNumericValueFromBitArray(n,5);if(o===15)return new Ln(n+5,Ln.FNC1);if(o>=5&&o<15)return new Ln(n+5,"0"+(o-5));let l=this.extractNumericValueFromBitArray(n,6);if(l>=32&&l<58)return new Ln(n+6,""+(l+33));let u;switch(l){case 58:u="*";break;case 59:u=",";break;case 60:u="-";break;case 61:u=".";break;case 62:u="/";break;default:throw new rr("Decoding invalid alphanumeric value: "+l)}return new Ln(n+6,u)}isAlphaTo646ToAlphaLatch(n){if(n+1>this.information.getSize())return!1;for(let o=0;o<5&&o+n<this.information.getSize();++o)if(o===2){if(!this.information.get(n+2))return!1}else if(this.information.get(n+o))return!1;return!0}isAlphaOr646ToNumericLatch(n){if(n+3>this.information.getSize())return!1;for(let o=n;o<n+3;++o)if(this.information.get(o))return!1;return!0}isNumericToAlphaNumericLatch(n){if(n+1>this.information.getSize())return!1;for(let o=0;o<4&&o+n<this.information.getSize();++o)if(this.information.get(n+o))return!1;return!0}}class dn{constructor(n){this.information=n,this.generalDecoder=new Wn(n)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Ot extends dn{constructor(n){super(n)}encodeCompressedGtin(n,o){n.append("(01)");let l=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,o,l)}encodeCompressedGtinWithoutAI(n,o,l){for(let u=0;u<4;++u){let d=this.getGeneralDecoder().extractNumericValueFromBitArray(o+10*u,10);d/100===0&&n.append("0"),d/10===0&&n.append("0"),n.append(d)}Ot.appendCheckDigit(n,l)}static appendCheckDigit(n,o){let l=0;for(let u=0;u<13;u++){let d=n.charAt(u+o).charCodeAt(0)-48;l+=(u&1)===0?3*d:d}l=10-l%10,l===10&&(l=0),n.append(l)}}Ot.GTIN_SIZE=40;class pr extends Ot{constructor(n){super(n)}parseInformation(){let n=new pe;n.append("(01)");let o=n.length(),l=this.getGeneralDecoder().extractNumericValueFromBitArray(pr.HEADER_SIZE,4);return n.append(l),this.encodeCompressedGtinWithoutAI(n,pr.HEADER_SIZE+4,o),this.getGeneralDecoder().decodeAllCodes(n,pr.HEADER_SIZE+44)}}pr.HEADER_SIZE=4;class ia extends dn{constructor(n){super(n)}parseInformation(){let n=new pe;return this.getGeneralDecoder().decodeAllCodes(n,ia.HEADER_SIZE)}}ia.HEADER_SIZE=5;class Io extends Ot{constructor(n){super(n)}encodeCompressedWeight(n,o,l){let u=this.getGeneralDecoder().extractNumericValueFromBitArray(o,l);this.addWeightCode(n,u);let d=this.checkWeight(u),m=1e5;for(let p=0;p<5;++p)d/m===0&&n.append("0"),m/=10;n.append(d)}}class Dr extends Io{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()!=Dr.HEADER_SIZE+Io.GTIN_SIZE+Dr.WEIGHT_SIZE)throw new re;let n=new pe;return this.encodeCompressedGtin(n,Dr.HEADER_SIZE),this.encodeCompressedWeight(n,Dr.HEADER_SIZE+Io.GTIN_SIZE,Dr.WEIGHT_SIZE),n.toString()}}Dr.HEADER_SIZE=5,Dr.WEIGHT_SIZE=15;class tc extends Dr{constructor(n){super(n)}addWeightCode(n,o){n.append("(3103)")}checkWeight(n){return n}}class $a extends Dr{constructor(n){super(n)}addWeightCode(n,o){o<1e4?n.append("(3202)"):n.append("(3203)")}checkWeight(n){return n<1e4?n:n-1e4}}class ar extends Ot{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<ar.HEADER_SIZE+Ot.GTIN_SIZE)throw new re;let n=new pe;this.encodeCompressedGtin(n,ar.HEADER_SIZE);let o=this.getGeneralDecoder().extractNumericValueFromBitArray(ar.HEADER_SIZE+Ot.GTIN_SIZE,ar.LAST_DIGIT_SIZE);n.append("(392"),n.append(o),n.append(")");let l=this.getGeneralDecoder().decodeGeneralPurposeField(ar.HEADER_SIZE+Ot.GTIN_SIZE+ar.LAST_DIGIT_SIZE,null);return n.append(l.getNewString()),n.toString()}}ar.HEADER_SIZE=8,ar.LAST_DIGIT_SIZE=2;class an extends Ot{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<an.HEADER_SIZE+Ot.GTIN_SIZE)throw new re;let n=new pe;this.encodeCompressedGtin(n,an.HEADER_SIZE);let o=this.getGeneralDecoder().extractNumericValueFromBitArray(an.HEADER_SIZE+Ot.GTIN_SIZE,an.LAST_DIGIT_SIZE);n.append("(393"),n.append(o),n.append(")");let l=this.getGeneralDecoder().extractNumericValueFromBitArray(an.HEADER_SIZE+Ot.GTIN_SIZE+an.LAST_DIGIT_SIZE,an.FIRST_THREE_DIGITS_SIZE);l/100==0&&n.append("0"),l/10==0&&n.append("0"),n.append(l);let u=this.getGeneralDecoder().decodeGeneralPurposeField(an.HEADER_SIZE+Ot.GTIN_SIZE+an.LAST_DIGIT_SIZE+an.FIRST_THREE_DIGITS_SIZE,null);return n.append(u.getNewString()),n.toString()}}an.HEADER_SIZE=8,an.LAST_DIGIT_SIZE=2,an.FIRST_THREE_DIGITS_SIZE=10;class Et extends Io{constructor(n,o,l){super(n),this.dateCode=l,this.firstAIdigits=o}parseInformation(){if(this.getInformation().getSize()!=Et.HEADER_SIZE+Et.GTIN_SIZE+Et.WEIGHT_SIZE+Et.DATE_SIZE)throw new re;let n=new pe;return this.encodeCompressedGtin(n,Et.HEADER_SIZE),this.encodeCompressedWeight(n,Et.HEADER_SIZE+Et.GTIN_SIZE,Et.WEIGHT_SIZE),this.encodeCompressedDate(n,Et.HEADER_SIZE+Et.GTIN_SIZE+Et.WEIGHT_SIZE),n.toString()}encodeCompressedDate(n,o){let l=this.getGeneralDecoder().extractNumericValueFromBitArray(o,Et.DATE_SIZE);if(l==38400)return;n.append("("),n.append(this.dateCode),n.append(")");let u=l%32;l/=32;let d=l%12+1;l/=12;let m=l;m/10==0&&n.append("0"),n.append(m),d/10==0&&n.append("0"),n.append(d),u/10==0&&n.append("0"),n.append(u)}addWeightCode(n,o){n.append("("),n.append(this.firstAIdigits),n.append(o/1e5),n.append(")")}checkWeight(n){return n%1e5}}Et.HEADER_SIZE=8,Et.WEIGHT_SIZE=20,Et.DATE_SIZE=16;function aa(M){try{if(M.get(1))return new pr(M);if(!M.get(2))return new ia(M);switch(Wn.extractNumericValueFromBitArray(M,1,4)){case 4:return new tc(M);case 5:return new $a(M)}switch(Wn.extractNumericValueFromBitArray(M,1,5)){case 12:return new ar(M);case 13:return new an(M)}switch(Wn.extractNumericValueFromBitArray(M,1,7)){case 56:return new Et(M,"310","11");case 57:return new Et(M,"320","11");case 58:return new Et(M,"310","13");case 59:return new Et(M,"320","13");case 60:return new Et(M,"310","15");case 61:return new Et(M,"320","15");case 62:return new Et(M,"310","17");case 63:return new Et(M,"320","17")}}catch(n){throw console.log(n),new rr("unknown decoder: "+M)}}class Kn{constructor(n,o,l,u){this.leftchar=n,this.rightchar=o,this.finderpattern=l,this.maybeLast=u}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(n,o){return n instanceof Kn?Kn.equalsOrNull(n.leftchar,o.leftchar)&&Kn.equalsOrNull(n.rightchar,o.rightchar)&&Kn.equalsOrNull(n.finderpattern,o.finderpattern):!1}static equalsOrNull(n,o){return n===null?o===null:Kn.equals(n,o)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class on{constructor(n,o,l){this.pairs=n,this.rowNumber=o,this.wasReversed=l}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(n){return this.checkEqualitity(this,n)}toString(){return"{ "+this.pairs+" }"}equals(n,o){return n instanceof on?this.checkEqualitity(n,o)&&n.wasReversed===o.wasReversed:!1}checkEqualitity(n,o){if(!n||!o)return;let l;return n.forEach((u,d)=>{o.forEach(m=>{u.getLeftChar().getValue()===m.getLeftChar().getValue()&&u.getRightChar().getValue()===m.getRightChar().getValue()&&u.getFinderPatter().getValue()===m.getFinderPatter().getValue()&&(l=!0)})}),l}}class _e extends Rn{constructor(n){super(...arguments),this.pairs=new Array(_e.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=n===!0}decodeRow(n,o,l){this.pairs.length=0,this.startFromEven=!1;try{return _e.constructResult(this.decodeRow2pairs(n,o))}catch(u){this.verbose&&console.log(u)}return this.pairs.length=0,this.startFromEven=!0,_e.constructResult(this.decodeRow2pairs(n,o))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(n,o){let l=!1;for(;!l;)try{this.pairs.push(this.retrieveNextPair(o,this.pairs,n))}catch(d){if(d instanceof re){if(!this.pairs.length)throw new re;l=!0}}if(this.checkChecksum())return this.pairs;let u;if(this.rows.length?u=!0:u=!1,this.storeRow(n,!1),u){let d=this.checkRowsBoolean(!1);if(d!=null||(d=this.checkRowsBoolean(!0),d!=null))return d}throw new re}checkRowsBoolean(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());let o=null;try{o=this.checkRows(new Array,0)}catch(l){this.verbose&&console.log(l)}return n&&(this.rows=this.rows.reverse()),o}checkRows(n,o){for(let l=o;l<this.rows.length;l++){let u=this.rows[l];this.pairs.length=0;for(let m of n)this.pairs.push(m.getPairs());if(this.pairs.push(u.getPairs()),!_e.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let d=new Array(n);d.push(u);try{return this.checkRows(d,l+1)}catch(m){this.verbose&&console.log(m)}}throw new re}static isValidSequence(n){for(let o of _e.FINDER_PATTERN_SEQUENCES){if(n.length>o.length)continue;let l=!0;for(let u=0;u<n.length;u++)if(n[u].getFinderPattern().getValue()!=o[u]){l=!1;break}if(l)return!0}return!1}storeRow(n,o){let l=0,u=!1,d=!1;for(;l<this.rows.length;){let m=this.rows[l];if(m.getRowNumber()>n){d=m.isEquivalent(this.pairs);break}u=m.isEquivalent(this.pairs),l++}d||u||_e.isPartialRow(this.pairs,this.rows)||(this.rows.push(l,new on(this.pairs,n,o)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(n,o){for(let l of o)if(l.getPairs().length!==n.length){for(let u of l.getPairs())for(let d of n)if(Kn.equals(u,d))break}}static isPartialRow(n,o){for(let l of o){let u=!0;for(let d of n){let m=!1;for(let p of l.getPairs())if(d.equals(p)){m=!0;break}if(!m){u=!1;break}}if(u)return!0}return!1}getRows(){return this.rows}static constructResult(n){let o=ec.buildBitArray(n),u=aa(o).parseInformation(),d=n[0].getFinderPattern().getResultPoints(),m=n[n.length-1].getFinderPattern().getResultPoints(),p=[d[0],d[1],m[0],m[1]];return new Ie(u,null,null,p,Te.RSS_EXPANDED,null)}checkChecksum(){let n=this.pairs.get(0),o=n.getLeftChar(),l=n.getRightChar();if(l==null)return!1;let u=l.getChecksumPortion(),d=2;for(let p=1;p<this.pairs.size();++p){let w=this.pairs.get(p);u+=w.getLeftChar().getChecksumPortion(),d++;let C=w.getRightChar();C!=null&&(u+=C.getChecksumPortion(),d++)}return u%=211,211*(d-4)+u==o.getValue()}static getNextSecondBar(n,o){let l;return n.get(o)?(l=n.getNextUnset(o),l=n.getNextSet(l)):(l=n.getNextSet(o),l=n.getNextUnset(l)),l}retrieveNextPair(n,o,l){let u=o.length%2==0;this.startFromEven&&(u=!u);let d,m=!0,p=-1;do this.findNextPair(n,o,p),d=this.parseFoundFinderPattern(n,l,u),d==null?p=_e.getNextSecondBar(n,this.startEnd[0]):m=!1;while(m);let w=this.decodeDataCharacter(n,d,u,!0);if(!this.isEmptyPair(o)&&o[o.length-1].mustBeLast())throw new re;let C;try{C=this.decodeDataCharacter(n,d,u,!1)}catch(N){C=null,this.verbose&&console.log(N)}return new Kn(w,C,d,!0)}isEmptyPair(n){return n.length===0}findNextPair(n,o,l){let u=this.getDecodeFinderCounters();u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m;l>=0?m=l:this.isEmptyPair(o)?m=0:m=o[o.length-1].getFinderPattern().getStartEnd()[1];let p=o.length%2!=0;this.startFromEven&&(p=!p);let w=!1;for(;m<d&&(w=!n.get(m),!!w);)m++;let C=0,N=m;for(let D=m;D<d;D++)if(n.get(D)!=w)u[C]++;else{if(C==3){if(p&&_e.reverseCounters(u),_e.isFinderPattern(u)){this.startEnd[0]=N,this.startEnd[1]=D;return}p&&_e.reverseCounters(u),N+=u[0]+u[1],u[0]=u[2],u[1]=u[3],u[2]=0,u[3]=0,C--}else C++;u[C]=1,w=!w}throw new re}static reverseCounters(n){let o=n.length;for(let l=0;l<o/2;++l){let u=n[l];n[l]=n[o-l-1],n[o-l-1]=u}}parseFoundFinderPattern(n,o,l){let u,d,m;if(l){let C=this.startEnd[0]-1;for(;C>=0&&!n.get(C);)C--;C++,u=this.startEnd[0]-C,d=C,m=this.startEnd[1]}else d=this.startEnd[0],m=n.getNextUnset(this.startEnd[1]+1),u=m-this.startEnd[1];let p=this.getDecodeFinderCounters();I.arraycopy(p,0,p,1,p.length-1),p[0]=u;let w;try{w=this.parseFinderValue(p,_e.FINDER_PATTERNS)}catch{return null}return new fi(w,[d,m],d,m,o)}decodeDataCharacter(n,o,l,u){let d=this.getDataCharacterCounters();for(let Rt=0;Rt<d.length;Rt++)d[Rt]=0;if(u)_e.recordPatternInReverse(n,o.getStartEnd()[0],d);else{_e.recordPattern(n,o.getStartEnd()[1],d);for(let Rt=0,In=d.length-1;Rt<In;Rt++,In--){let $n=d[Rt];d[Rt]=d[In],d[In]=$n}}let m=17,p=ot.sum(new Int32Array(d))/m,w=(o.getStartEnd()[1]-o.getStartEnd()[0])/15;if(Math.abs(p-w)/w>.3)throw new re;let C=this.getOddCounts(),N=this.getEvenCounts(),D=this.getOddRoundingErrors(),P=this.getEvenRoundingErrors();for(let Rt=0;Rt<d.length;Rt++){let In=1*d[Rt]/p,$n=In+.5;if($n<1){if(In<.3)throw new re;$n=1}else if($n>8){if(In>8.7)throw new re;$n=8}let xa=Rt/2;(Rt&1)==0?(C[xa]=$n,D[xa]=In-$n):(N[xa]=$n,P[xa]=In-$n)}this.adjustOddEvenCounts(m);let G=4*o.getValue()+(l?0:2)+(u?0:1)-1,q=0,K=0;for(let Rt=C.length-1;Rt>=0;Rt--){if(_e.isNotA1left(o,l,u)){let In=_e.WEIGHTS[G][2*Rt];K+=C[Rt]*In}q+=C[Rt]}let ie=0;for(let Rt=N.length-1;Rt>=0;Rt--)if(_e.isNotA1left(o,l,u)){let In=_e.WEIGHTS[G][2*Rt+1];ie+=N[Rt]*In}let he=K+ie;if((q&1)!=0||q>13||q<4)throw new re;let Re=(13-q)/2,Ae=_e.SYMBOL_WIDEST[Re],Ee=9-Ae,it=Mr.getRSSvalue(C,Ae,!0),We=Mr.getRSSvalue(N,Ee,!1),sn=_e.EVEN_TOTAL_SUBSET[Re],lr=_e.GSUM[Re],Un=it*sn+We+lr;return new ui(Un,he)}static isNotA1left(n,o,l){return!(n.getValue()==0&&o&&l)}adjustOddEvenCounts(n){let o=ot.sum(new Int32Array(this.getOddCounts())),l=ot.sum(new Int32Array(this.getEvenCounts())),u=!1,d=!1;o>13?d=!0:o<4&&(u=!0);let m=!1,p=!1;l>13?p=!0:l<4&&(m=!0);let w=o+l-n,C=(o&1)==1,N=(l&1)==0;if(w==1)if(C){if(N)throw new re;d=!0}else{if(!N)throw new re;p=!0}else if(w==-1)if(C){if(N)throw new re;u=!0}else{if(!N)throw new re;m=!0}else if(w==0){if(C){if(!N)throw new re;o<l?(u=!0,p=!0):(d=!0,m=!0)}else if(N)throw new re}else throw new re;if(u){if(d)throw new re;_e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(d&&_e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),m){if(p)throw new re;_e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}p&&_e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}_e.SYMBOL_WIDEST=[7,5,4,3,1],_e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],_e.GSUM=[0,348,1388,2948,3988],_e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],_e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],_e.FINDER_PAT_A=0,_e.FINDER_PAT_B=1,_e.FINDER_PAT_C=2,_e.FINDER_PAT_D=3,_e.FINDER_PAT_E=4,_e.FINDER_PAT_F=5,_e.FINDER_PATTERN_SEQUENCES=[[_e.FINDER_PAT_A,_e.FINDER_PAT_A],[_e.FINDER_PAT_A,_e.FINDER_PAT_B,_e.FINDER_PAT_B],[_e.FINDER_PAT_A,_e.FINDER_PAT_C,_e.FINDER_PAT_B,_e.FINDER_PAT_D],[_e.FINDER_PAT_A,_e.FINDER_PAT_E,_e.FINDER_PAT_B,_e.FINDER_PAT_D,_e.FINDER_PAT_C],[_e.FINDER_PAT_A,_e.FINDER_PAT_E,_e.FINDER_PAT_B,_e.FINDER_PAT_D,_e.FINDER_PAT_D,_e.FINDER_PAT_F],[_e.FINDER_PAT_A,_e.FINDER_PAT_E,_e.FINDER_PAT_B,_e.FINDER_PAT_D,_e.FINDER_PAT_E,_e.FINDER_PAT_F,_e.FINDER_PAT_F],[_e.FINDER_PAT_A,_e.FINDER_PAT_A,_e.FINDER_PAT_B,_e.FINDER_PAT_B,_e.FINDER_PAT_C,_e.FINDER_PAT_C,_e.FINDER_PAT_D,_e.FINDER_PAT_D],[_e.FINDER_PAT_A,_e.FINDER_PAT_A,_e.FINDER_PAT_B,_e.FINDER_PAT_B,_e.FINDER_PAT_C,_e.FINDER_PAT_C,_e.FINDER_PAT_D,_e.FINDER_PAT_E,_e.FINDER_PAT_E],[_e.FINDER_PAT_A,_e.FINDER_PAT_A,_e.FINDER_PAT_B,_e.FINDER_PAT_B,_e.FINDER_PAT_C,_e.FINDER_PAT_C,_e.FINDER_PAT_D,_e.FINDER_PAT_E,_e.FINDER_PAT_F,_e.FINDER_PAT_F],[_e.FINDER_PAT_A,_e.FINDER_PAT_A,_e.FINDER_PAT_B,_e.FINDER_PAT_B,_e.FINDER_PAT_C,_e.FINDER_PAT_D,_e.FINDER_PAT_D,_e.FINDER_PAT_E,_e.FINDER_PAT_E,_e.FINDER_PAT_F,_e.FINDER_PAT_F]],_e.MAX_PAIRS=11;class nc extends ui{constructor(n,o,l){super(n,o),this.count=0,this.finderPattern=l}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class St extends Rn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(n,o,l){const u=this.decodePair(o,!1,n,l);St.addOrTally(this.possibleLeftPairs,u),o.reverse();let d=this.decodePair(o,!0,n,l);St.addOrTally(this.possibleRightPairs,d),o.reverse();for(let m of this.possibleLeftPairs)if(m.getCount()>1){for(let p of this.possibleRightPairs)if(p.getCount()>1&&St.checkChecksum(m,p))return St.constructResult(m,p)}throw new re}static addOrTally(n,o){if(o==null)return;let l=!1;for(let u of n)if(u.getValue()===o.getValue()){u.incrementCount(),l=!0;break}l||n.push(o)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(n,o){let l=4537077*n.getValue()+o.getValue(),u=new String(l).toString(),d=new pe;for(let C=13-u.length;C>0;C--)d.append("0");d.append(u);let m=0;for(let C=0;C<13;C++){let N=d.charAt(C).charCodeAt(0)-48;m+=(C&1)===0?3*N:N}m=10-m%10,m===10&&(m=0),d.append(m.toString());let p=n.getFinderPattern().getResultPoints(),w=o.getFinderPattern().getResultPoints();return new Ie(d.toString(),null,0,[p[0],p[1],w[0],w[1]],Te.RSS_14,new Date().getTime())}static checkChecksum(n,o){let l=(n.getChecksumPortion()+16*o.getChecksumPortion())%79,u=9*n.getFinderPattern().getValue()+o.getFinderPattern().getValue();return u>72&&u--,u>8&&u--,l===u}decodePair(n,o,l,u){try{let d=this.findFinderPattern(n,o),m=this.parseFoundFinderPattern(n,l,o,d),p=u==null?null:u.get(ee.NEED_RESULT_POINT_CALLBACK);if(p!=null){let N=(d[0]+d[1])/2;o&&(N=n.getSize()-1-N),p.foundPossibleResultPoint(new Le(N,l))}let w=this.decodeDataCharacter(n,m,!0),C=this.decodeDataCharacter(n,m,!1);return new nc(1597*w.getValue()+C.getValue(),w.getChecksumPortion()+4*C.getChecksumPortion(),m)}catch{return null}}decodeDataCharacter(n,o,l){let u=this.getDataCharacterCounters();for(let ie=0;ie<u.length;ie++)u[ie]=0;if(l)jt.recordPatternInReverse(n,o.getStartEnd()[0],u);else{jt.recordPattern(n,o.getStartEnd()[1]+1,u);for(let ie=0,he=u.length-1;ie<he;ie++,he--){let Re=u[ie];u[ie]=u[he],u[he]=Re}}let d=l?16:15,m=ot.sum(new Int32Array(u))/d,p=this.getOddCounts(),w=this.getEvenCounts(),C=this.getOddRoundingErrors(),N=this.getEvenRoundingErrors();for(let ie=0;ie<u.length;ie++){let he=u[ie]/m,Re=Math.floor(he+.5);Re<1?Re=1:Re>8&&(Re=8);let Ae=Math.floor(ie/2);(ie&1)===0?(p[Ae]=Re,C[Ae]=he-Re):(w[Ae]=Re,N[Ae]=he-Re)}this.adjustOddEvenCounts(l,d);let D=0,P=0;for(let ie=p.length-1;ie>=0;ie--)P*=9,P+=p[ie],D+=p[ie];let G=0,q=0;for(let ie=w.length-1;ie>=0;ie--)G*=9,G+=w[ie],q+=w[ie];let K=P+3*G;if(l){if((D&1)!==0||D>12||D<4)throw new re;let ie=(12-D)/2,he=St.OUTSIDE_ODD_WIDEST[ie],Re=9-he,Ae=Mr.getRSSvalue(p,he,!1),Ee=Mr.getRSSvalue(w,Re,!0),it=St.OUTSIDE_EVEN_TOTAL_SUBSET[ie],We=St.OUTSIDE_GSUM[ie];return new ui(Ae*it+Ee+We,K)}else{if((q&1)!==0||q>10||q<4)throw new re;let ie=(10-q)/2,he=St.INSIDE_ODD_WIDEST[ie],Re=9-he,Ae=Mr.getRSSvalue(p,he,!0),Ee=Mr.getRSSvalue(w,Re,!1),it=St.INSIDE_ODD_TOTAL_SUBSET[ie],We=St.INSIDE_GSUM[ie];return new ui(Ee*it+Ae+We,K)}}findFinderPattern(n,o){let l=this.getDecodeFinderCounters();l[0]=0,l[1]=0,l[2]=0,l[3]=0;let u=n.getSize(),d=!1,m=0;for(;m<u&&(d=!n.get(m),o!==d);)m++;let p=0,w=m;for(let C=m;C<u;C++)if(n.get(C)!==d)l[p]++;else{if(p===3){if(Rn.isFinderPattern(l))return[w,C];w+=l[0]+l[1],l[0]=l[2],l[1]=l[3],l[2]=0,l[3]=0,p--}else p++;l[p]=1,d=!d}throw new re}parseFoundFinderPattern(n,o,l,u){let d=n.get(u[0]),m=u[0]-1;for(;m>=0&&d!==n.get(m);)m--;m++;const p=u[0]-m,w=this.getDecodeFinderCounters(),C=new Int32Array(w.length);I.arraycopy(w,0,C,1,w.length-1),C[0]=p;const N=this.parseFinderValue(C,St.FINDER_PATTERNS);let D=m,P=u[1];return l&&(D=n.getSize()-1-D,P=n.getSize()-1-P),new fi(N,[m,u[1]],D,P,o)}adjustOddEvenCounts(n,o){let l=ot.sum(new Int32Array(this.getOddCounts())),u=ot.sum(new Int32Array(this.getEvenCounts())),d=!1,m=!1,p=!1,w=!1;n?(l>12?m=!0:l<4&&(d=!0),u>12?w=!0:u<4&&(p=!0)):(l>11?m=!0:l<5&&(d=!0),u>10?w=!0:u<4&&(p=!0));let C=l+u-o,N=(l&1)===(n?1:0),D=(u&1)===1;if(C===1)if(N){if(D)throw new re;m=!0}else{if(!D)throw new re;w=!0}else if(C===-1)if(N){if(D)throw new re;d=!0}else{if(!D)throw new re;p=!0}else if(C===0){if(N){if(!D)throw new re;l<u?(d=!0,w=!0):(m=!0,p=!0)}else if(D)throw new re}else throw new re;if(d){if(m)throw new re;Rn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(m&&Rn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),p){if(w)throw new re;Rn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}w&&Rn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}St.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],St.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],St.OUTSIDE_GSUM=[0,161,961,2015,2715],St.INSIDE_GSUM=[0,336,1036,1516],St.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],St.INSIDE_ODD_WIDEST=[2,4,6,8],St.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class xr extends jt{constructor(n,o){super(),this.readers=[],this.verbose=o===!0;const l=n?n.get(ee.POSSIBLE_FORMATS):null,u=n&&n.get(ee.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;l?((l.includes(Te.EAN_13)||l.includes(Te.UPC_A)||l.includes(Te.EAN_8)||l.includes(Te.UPC_E))&&this.readers.push(new Ps(n)),l.includes(Te.CODE_39)&&this.readers.push(new Dt(u)),l.includes(Te.CODE_128)&&this.readers.push(new Ne),l.includes(Te.ITF)&&this.readers.push(new et),l.includes(Te.RSS_14)&&this.readers.push(new St),l.includes(Te.RSS_EXPANDED)&&this.readers.push(new _e(this.verbose))):(this.readers.push(new Ps(n)),this.readers.push(new Dt),this.readers.push(new Ps(n)),this.readers.push(new Ne),this.readers.push(new et),this.readers.push(new St),this.readers.push(new _e(this.verbose)))}decodeRow(n,o,l){for(let u=0;u<this.readers.length;u++)try{return this.readers[u].decodeRow(n,o,l)}catch{}throw new re}reset(){this.readers.forEach(n=>n.reset())}}class gf extends Se{constructor(n=500,o){super(new xr(o),n,o)}}class vt{constructor(n,o,l){this.ecCodewords=n,this.ecBlocks=[o],l&&this.ecBlocks.push(l)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class yt{constructor(n,o){this.count=n,this.dataCodewords=o}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class st{constructor(n,o,l,u,d,m){this.versionNumber=n,this.symbolSizeRows=o,this.symbolSizeColumns=l,this.dataRegionSizeRows=u,this.dataRegionSizeColumns=d,this.ecBlocks=m;let p=0;const w=m.getECCodewords(),C=m.getECBlocks();for(let N of C)p+=N.getCount()*(N.getDataCodewords()+w);this.totalCodewords=p}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(n,o){if((n&1)!==0||(o&1)!==0)throw new X;for(let l of st.VERSIONS)if(l.symbolSizeRows===n&&l.symbolSizeColumns===o)return l;throw new X}toString(){return""+this.versionNumber}static buildVersions(){return[new st(1,10,10,8,8,new vt(5,new yt(1,3))),new st(2,12,12,10,10,new vt(7,new yt(1,5))),new st(3,14,14,12,12,new vt(10,new yt(1,8))),new st(4,16,16,14,14,new vt(12,new yt(1,12))),new st(5,18,18,16,16,new vt(14,new yt(1,18))),new st(6,20,20,18,18,new vt(18,new yt(1,22))),new st(7,22,22,20,20,new vt(20,new yt(1,30))),new st(8,24,24,22,22,new vt(24,new yt(1,36))),new st(9,26,26,24,24,new vt(28,new yt(1,44))),new st(10,32,32,14,14,new vt(36,new yt(1,62))),new st(11,36,36,16,16,new vt(42,new yt(1,86))),new st(12,40,40,18,18,new vt(48,new yt(1,114))),new st(13,44,44,20,20,new vt(56,new yt(1,144))),new st(14,48,48,22,22,new vt(68,new yt(1,174))),new st(15,52,52,24,24,new vt(42,new yt(2,102))),new st(16,64,64,14,14,new vt(56,new yt(2,140))),new st(17,72,72,16,16,new vt(36,new yt(4,92))),new st(18,80,80,18,18,new vt(48,new yt(4,114))),new st(19,88,88,20,20,new vt(56,new yt(4,144))),new st(20,96,96,22,22,new vt(68,new yt(4,174))),new st(21,104,104,24,24,new vt(56,new yt(6,136))),new st(22,120,120,18,18,new vt(68,new yt(6,175))),new st(23,132,132,20,20,new vt(62,new yt(8,163))),new st(24,144,144,22,22,new vt(62,new yt(8,156),new yt(2,155))),new st(25,8,18,6,16,new vt(7,new yt(1,5))),new st(26,8,32,6,14,new vt(11,new yt(1,10))),new st(27,12,26,10,24,new vt(14,new yt(1,16))),new st(28,12,36,10,16,new vt(18,new yt(1,22))),new st(29,16,36,14,16,new vt(24,new yt(1,32))),new st(30,16,48,14,22,new vt(28,new yt(1,49)))]}}st.VERSIONS=st.buildVersions();class oa{constructor(n){const o=n.getHeight();if(o<8||o>144||(o&1)!==0)throw new X;this.version=oa.readVersion(n),this.mappingBitMatrix=this.extractDataRegion(n),this.readMappingMatrix=new Ce(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(n){const o=n.getHeight(),l=n.getWidth();return st.getVersionForDimensions(o,l)}readCodewords(){const n=new Int8Array(this.version.getTotalCodewords());let o=0,l=4,u=0;const d=this.mappingBitMatrix.getHeight(),m=this.mappingBitMatrix.getWidth();let p=!1,w=!1,C=!1,N=!1;do if(l===d&&u===0&&!p)n[o++]=this.readCorner1(d,m)&255,l-=2,u+=2,p=!0;else if(l===d-2&&u===0&&(m&3)!==0&&!w)n[o++]=this.readCorner2(d,m)&255,l-=2,u+=2,w=!0;else if(l===d+4&&u===2&&(m&7)===0&&!C)n[o++]=this.readCorner3(d,m)&255,l-=2,u+=2,C=!0;else if(l===d-2&&u===0&&(m&7)===4&&!N)n[o++]=this.readCorner4(d,m)&255,l-=2,u+=2,N=!0;else{do l<d&&u>=0&&!this.readMappingMatrix.get(u,l)&&(n[o++]=this.readUtah(l,u,d,m)&255),l-=2,u+=2;while(l>=0&&u<m);l+=1,u+=3;do l>=0&&u<m&&!this.readMappingMatrix.get(u,l)&&(n[o++]=this.readUtah(l,u,d,m)&255),l+=2,u-=2;while(l<d&&u>=0);l+=3,u+=1}while(l<d||u<m);if(o!==this.version.getTotalCodewords())throw new X;return n}readModule(n,o,l,u){return n<0&&(n+=l,o+=4-(l+4&7)),o<0&&(o+=u,n+=4-(u+4&7)),this.readMappingMatrix.set(o,n),this.mappingBitMatrix.get(o,n)}readUtah(n,o,l,u){let d=0;return this.readModule(n-2,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n-2,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o,l,u)&&(d|=1),d<<=1,this.readModule(n,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n,o,l,u)&&(d|=1),d}readCorner1(n,o){let l=0;return this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,1,n,o)&&(l|=1),l<<=1,this.readModule(n-1,2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(2,o-1,n,o)&&(l|=1),l<<=1,this.readModule(3,o-1,n,o)&&(l|=1),l}readCorner2(n,o){let l=0;return this.readModule(n-3,0,n,o)&&(l|=1),l<<=1,this.readModule(n-2,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(0,o-4,n,o)&&(l|=1),l<<=1,this.readModule(0,o-3,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l}readCorner3(n,o){let l=0;return this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(0,o-3,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-3,n,o)&&(l|=1),l<<=1,this.readModule(1,o-2,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l}readCorner4(n,o){let l=0;return this.readModule(n-3,0,n,o)&&(l|=1),l<<=1,this.readModule(n-2,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(2,o-1,n,o)&&(l|=1),l<<=1,this.readModule(3,o-1,n,o)&&(l|=1),l}extractDataRegion(n){const o=this.version.getSymbolSizeRows(),l=this.version.getSymbolSizeColumns();if(n.getHeight()!==o)throw new x("Dimension of bitMatrix must match the version size");const u=this.version.getDataRegionSizeRows(),d=this.version.getDataRegionSizeColumns(),m=o/u|0,p=l/d|0,w=m*u,C=p*d,N=new Ce(C,w);for(let D=0;D<m;++D){const P=D*u;for(let G=0;G<p;++G){const q=G*d;for(let K=0;K<u;++K){const ie=D*(u+2)+1+K,he=P+K;for(let Re=0;Re<d;++Re){const Ae=G*(d+2)+1+Re;if(n.get(Ae,ie)){const Ee=q+Re;N.set(Ee,he)}}}}}return N}}class sa{constructor(n,o){this.numDataCodewords=n,this.codewords=o}static getDataBlocks(n,o){const l=o.getECBlocks();let u=0;const d=l.getECBlocks();for(let K of d)u+=K.getCount();const m=new Array(u);let p=0;for(let K of d)for(let ie=0;ie<K.getCount();ie++){const he=K.getDataCodewords(),Re=l.getECCodewords()+he;m[p++]=new sa(he,new Uint8Array(Re))}const C=m[0].codewords.length-l.getECCodewords(),N=C-1;let D=0;for(let K=0;K<N;K++)for(let ie=0;ie<p;ie++)m[ie].codewords[K]=n[D++];const P=o.getVersionNumber()===24,G=P?8:p;for(let K=0;K<G;K++)m[K].codewords[C-1]=n[D++];const q=m[0].codewords.length;for(let K=C;K<q;K++)for(let ie=0;ie<p;ie++){const he=P?(ie+8)%p:ie,Re=P&&he>7?K-1:K;m[he].codewords[Re]=n[D++]}if(D!==n.length)throw new x;return m}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class yr{constructor(n){this.bytes=n,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(n){if(n<1||n>32||n>this.available())throw new x(""+n);let o=0,l=this.bitOffset,u=this.byteOffset;const d=this.bytes;if(l>0){const m=8-l,p=n<m?n:m,w=m-p,C=255>>8-p<<w;o=(d[u]&C)>>w,n-=p,l+=p,l===8&&(l=0,u++)}if(n>0){for(;n>=8;)o=o<<8|d[u]&255,u++,n-=8;if(n>0){const m=8-n,p=255>>m<<m;o=o<<n|(d[u]&p)>>m,l+=n}}return this.bitOffset=l,this.byteOffset=u,o}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var wt;(function(M){M[M.PAD_ENCODE=0]="PAD_ENCODE",M[M.ASCII_ENCODE=1]="ASCII_ENCODE",M[M.C40_ENCODE=2]="C40_ENCODE",M[M.TEXT_ENCODE=3]="TEXT_ENCODE",M[M.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",M[M.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",M[M.BASE256_ENCODE=6]="BASE256_ENCODE"})(wt||(wt={}));class Qr{static decode(n){const o=new yr(n),l=new pe,u=new pe,d=new Array;let m=wt.ASCII_ENCODE;do if(m===wt.ASCII_ENCODE)m=this.decodeAsciiSegment(o,l,u);else{switch(m){case wt.C40_ENCODE:this.decodeC40Segment(o,l);break;case wt.TEXT_ENCODE:this.decodeTextSegment(o,l);break;case wt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(o,l);break;case wt.EDIFACT_ENCODE:this.decodeEdifactSegment(o,l);break;case wt.BASE256_ENCODE:this.decodeBase256Segment(o,l,d);break;default:throw new X}m=wt.ASCII_ENCODE}while(m!==wt.PAD_ENCODE&&o.available()>0);return u.length()>0&&l.append(u.toString()),new pt(n,l.toString(),d.length===0?null:d,null)}static decodeAsciiSegment(n,o,l){let u=!1;do{let d=n.readBits(8);if(d===0)throw new X;if(d<=128)return u&&(d+=128),o.append(String.fromCharCode(d-1)),wt.ASCII_ENCODE;if(d===129)return wt.PAD_ENCODE;if(d<=229){const m=d-130;m<10&&o.append("0"),o.append(""+m)}else switch(d){case 230:return wt.C40_ENCODE;case 231:return wt.BASE256_ENCODE;case 232:o.append("");break;case 233:case 234:break;case 235:u=!0;break;case 236:o.append("[)>05"),l.insert(0,"");break;case 237:o.append("[)>06"),l.insert(0,"");break;case 238:return wt.ANSIX12_ENCODE;case 239:return wt.TEXT_ENCODE;case 240:return wt.EDIFACT_ENCODE;case 241:break;default:if(d!==254||n.available()!==0)throw new X;break}}while(n.available()>0);return wt.ASCII_ENCODE}static decodeC40Segment(n,o){let l=!1;const u=[];let d=0;do{if(n.available()===8)return;const m=n.readBits(8);if(m===254)return;this.parseTwoBytes(m,n.readBits(8),u);for(let p=0;p<3;p++){const w=u[p];switch(d){case 0:if(w<3)d=w+1;else if(w<this.C40_BASIC_SET_CHARS.length){const C=this.C40_BASIC_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else throw new X;break;case 1:l?(o.append(String.fromCharCode(w+128)),l=!1):o.append(String.fromCharCode(w)),d=0;break;case 2:if(w<this.C40_SHIFT2_SET_CHARS.length){const C=this.C40_SHIFT2_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else switch(w){case 27:o.append("");break;case 30:l=!0;break;default:throw new X}d=0;break;case 3:l?(o.append(String.fromCharCode(w+224)),l=!1):o.append(String.fromCharCode(w+96)),d=0;break;default:throw new X}}}while(n.available()>0)}static decodeTextSegment(n,o){let l=!1,u=[],d=0;do{if(n.available()===8)return;const m=n.readBits(8);if(m===254)return;this.parseTwoBytes(m,n.readBits(8),u);for(let p=0;p<3;p++){const w=u[p];switch(d){case 0:if(w<3)d=w+1;else if(w<this.TEXT_BASIC_SET_CHARS.length){const C=this.TEXT_BASIC_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else throw new X;break;case 1:l?(o.append(String.fromCharCode(w+128)),l=!1):o.append(String.fromCharCode(w)),d=0;break;case 2:if(w<this.TEXT_SHIFT2_SET_CHARS.length){const C=this.TEXT_SHIFT2_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else switch(w){case 27:o.append("");break;case 30:l=!0;break;default:throw new X}d=0;break;case 3:if(w<this.TEXT_SHIFT3_SET_CHARS.length){const C=this.TEXT_SHIFT3_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C),d=0}else throw new X;break;default:throw new X}}}while(n.available()>0)}static decodeAnsiX12Segment(n,o){const l=[];do{if(n.available()===8)return;const u=n.readBits(8);if(u===254)return;this.parseTwoBytes(u,n.readBits(8),l);for(let d=0;d<3;d++){const m=l[d];switch(m){case 0:o.append("\r");break;case 1:o.append("*");break;case 2:o.append(">");break;case 3:o.append(" ");break;default:if(m<14)o.append(String.fromCharCode(m+44));else if(m<40)o.append(String.fromCharCode(m+51));else throw new X;break}}}while(n.available()>0)}static parseTwoBytes(n,o,l){let u=(n<<8)+o-1,d=Math.floor(u/1600);l[0]=d,u-=d*1600,d=Math.floor(u/40),l[1]=d,l[2]=u-d*40}static decodeEdifactSegment(n,o){do{if(n.available()<=16)return;for(let l=0;l<4;l++){let u=n.readBits(6);if(u===31){const d=8-n.getBitOffset();d!==8&&n.readBits(d);return}(u&32)===0&&(u|=64),o.append(String.fromCharCode(u))}}while(n.available()>0)}static decodeBase256Segment(n,o,l){let u=1+n.getByteOffset();const d=this.unrandomize255State(n.readBits(8),u++);let m;if(d===0?m=n.available()/8|0:d<250?m=d:m=250*(d-249)+this.unrandomize255State(n.readBits(8),u++),m<0)throw new X;const p=new Uint8Array(m);for(let w=0;w<m;w++){if(n.available()<8)throw new X;p[w]=this.unrandomize255State(n.readBits(8),u++)}l.push(p);try{o.append(ue.decode(p,$.ISO88591))}catch(w){throw new rr("Platform does not support required encoding: "+w.message)}}static unrandomize255State(n,o){const l=149*o%255+1,u=n-l;return u>=0?u:u+256}}Qr.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Qr.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],Qr.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Qr.TEXT_SHIFT2_SET_CHARS=Qr.C40_SHIFT2_SET_CHARS,Qr.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""];class mf{constructor(){this.rsDecoder=new Ci(xt.DATA_MATRIX_FIELD_256)}decode(n){const o=new oa(n),l=o.getVersion(),u=o.readCodewords(),d=sa.getDataBlocks(u,l);let m=0;for(let C of d)m+=C.getNumDataCodewords();const p=new Uint8Array(m),w=d.length;for(let C=0;C<w;C++){const N=d[C],D=N.getCodewords(),P=N.getNumDataCodewords();this.correctErrors(D,P);for(let G=0;G<P;G++)p[G*w+C]=D[G]}return Qr.decode(p)}correctErrors(n,o){const l=new Int32Array(n);try{this.rsDecoder.decode(l,n.length-o)}catch{throw new R}for(let u=0;u<o;u++)n[u]=l[u]}}class Ht{constructor(n){this.image=n,this.rectangleDetector=new en(this.image)}detect(){const n=this.rectangleDetector.detect();let o=this.detectSolid1(n);if(o=this.detectSolid2(o),o[3]=this.correctTopRight(o),!o[3])throw new re;o=this.shiftToModuleCenter(o);const l=o[0],u=o[1],d=o[2],m=o[3];let p=this.transitionsBetween(l,m)+1,w=this.transitionsBetween(d,m)+1;(p&1)===1&&(p+=1),(w&1)===1&&(w+=1),4*p<7*w&&4*w<7*p&&(p=w=Math.max(p,w));let C=Ht.sampleGrid(this.image,l,u,d,m,p,w);return new Ro(C,[l,u,d,m])}static shiftPoint(n,o,l){let u=(o.getX()-n.getX())/(l+1),d=(o.getY()-n.getY())/(l+1);return new Le(n.getX()+u,n.getY()+d)}static moveAway(n,o,l){let u=n.getX(),d=n.getY();return u<o?u-=1:u+=1,d<l?d-=1:d+=1,new Le(u,d)}detectSolid1(n){let o=n[0],l=n[1],u=n[3],d=n[2],m=this.transitionsBetween(o,l),p=this.transitionsBetween(l,u),w=this.transitionsBetween(u,d),C=this.transitionsBetween(d,o),N=m,D=[d,o,l,u];return N>p&&(N=p,D[0]=o,D[1]=l,D[2]=u,D[3]=d),N>w&&(N=w,D[0]=l,D[1]=u,D[2]=d,D[3]=o),N>C&&(D[0]=u,D[1]=d,D[2]=o,D[3]=l),D}detectSolid2(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d),p=Ht.shiftPoint(l,u,(m+1)*4),w=Ht.shiftPoint(u,l,(m+1)*4),C=this.transitionsBetween(p,o),N=this.transitionsBetween(w,d);return C<N?(n[0]=o,n[1]=l,n[2]=u,n[3]=d):(n[0]=l,n[1]=u,n[2]=d,n[3]=o),n}correctTopRight(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d),p=this.transitionsBetween(l,d),w=Ht.shiftPoint(o,l,(p+1)*4),C=Ht.shiftPoint(u,l,(m+1)*4);m=this.transitionsBetween(w,d),p=this.transitionsBetween(C,d);let N=new Le(d.getX()+(u.getX()-l.getX())/(m+1),d.getY()+(u.getY()-l.getY())/(m+1)),D=new Le(d.getX()+(o.getX()-l.getX())/(p+1),d.getY()+(o.getY()-l.getY())/(p+1));if(!this.isValid(N))return this.isValid(D)?D:null;if(!this.isValid(D))return N;let P=this.transitionsBetween(w,N)+this.transitionsBetween(C,N),G=this.transitionsBetween(w,D)+this.transitionsBetween(C,D);return P>G?N:D}shiftToModuleCenter(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d)+1,p=this.transitionsBetween(u,d)+1,w=Ht.shiftPoint(o,l,p*4),C=Ht.shiftPoint(u,l,m*4);m=this.transitionsBetween(w,d)+1,p=this.transitionsBetween(C,d)+1,(m&1)===1&&(m+=1),(p&1)===1&&(p+=1);let N=(o.getX()+l.getX()+u.getX()+d.getX())/4,D=(o.getY()+l.getY()+u.getY()+d.getY())/4;o=Ht.moveAway(o,N,D),l=Ht.moveAway(l,N,D),u=Ht.moveAway(u,N,D),d=Ht.moveAway(d,N,D);let P,G;return w=Ht.shiftPoint(o,l,p*4),w=Ht.shiftPoint(w,d,m*4),P=Ht.shiftPoint(l,o,p*4),P=Ht.shiftPoint(P,u,m*4),C=Ht.shiftPoint(u,d,p*4),C=Ht.shiftPoint(C,l,m*4),G=Ht.shiftPoint(d,u,p*4),G=Ht.shiftPoint(G,o,m*4),[w,P,C,G]}isValid(n){return n.getX()>=0&&n.getX()<this.image.getWidth()&&n.getY()>0&&n.getY()<this.image.getHeight()}static sampleGrid(n,o,l,u,d,m,p){return mr.getInstance().sampleGrid(n,m,p,.5,.5,m-.5,.5,m-.5,p-.5,.5,p-.5,o.getX(),o.getY(),d.getX(),d.getY(),u.getX(),u.getY(),l.getX(),l.getY())}transitionsBetween(n,o){let l=Math.trunc(n.getX()),u=Math.trunc(n.getY()),d=Math.trunc(o.getX()),m=Math.trunc(o.getY()),p=Math.abs(m-u)>Math.abs(d-l);if(p){let K=l;l=u,u=K,K=d,d=m,m=K}let w=Math.abs(d-l),C=Math.abs(m-u),N=-w/2,D=u<m?1:-1,P=l<d?1:-1,G=0,q=this.image.get(p?u:l,p?l:u);for(let K=l,ie=u;K!==d;K+=P){let he=this.image.get(p?ie:K,p?K:ie);if(he!==q&&(G++,q=he),N+=C,N>0){if(ie===m)break;ie+=D,N-=w}}return G}}class Jr{constructor(){this.decoder=new mf}decode(n,o=null){let l,u;if(o!=null&&o.has(ee.PURE_BARCODE)){const C=Jr.extractPureBits(n.getBlackMatrix());l=this.decoder.decode(C),u=Jr.NO_POINTS}else{const C=new Ht(n.getBlackMatrix()).detect();l=this.decoder.decode(C.getBits()),u=C.getPoints()}const d=l.getRawBytes(),m=new Ie(l.getText(),d,8*d.length,u,Te.DATA_MATRIX,I.currentTimeMillis()),p=l.getByteSegments();p!=null&&m.putMetadata(Qe.BYTE_SEGMENTS,p);const w=l.getECLevel();return w!=null&&m.putMetadata(Qe.ERROR_CORRECTION_LEVEL,w),m}reset(){}static extractPureBits(n){const o=n.getTopLeftOnBit(),l=n.getBottomRightOnBit();if(o==null||l==null)throw new re;const u=this.moduleSize(o,n);let d=o[1];const m=l[1];let p=o[0];const C=(l[0]-p+1)/u,N=(m-d+1)/u;if(C<=0||N<=0)throw new re;const D=u/2;d+=D,p+=D;const P=new Ce(C,N);for(let G=0;G<N;G++){const q=d+G*u;for(let K=0;K<C;K++)n.get(p+K*u,q)&&P.set(K,G)}return P}static moduleSize(n,o){const l=o.getWidth();let u=n[0];const d=n[1];for(;u<l&&o.get(u,d);)u++;if(u===l)throw new re;const m=u-n[0];if(m===0)throw new re;return m}}Jr.NO_POINTS=[];class Mo extends Se{constructor(n=500){super(new Jr,n)}}var la;(function(M){M[M.L=0]="L",M[M.M=1]="M",M[M.Q=2]="Q",M[M.H=3]="H"})(la||(la={}));class at{constructor(n,o,l){this.value=n,this.stringValue=o,this.bits=l,at.FOR_BITS.set(l,this),at.FOR_VALUE.set(n,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(n){switch(n){case"L":return at.L;case"M":return at.M;case"Q":return at.Q;case"H":return at.H;default:throw new T(n+"not available")}}toString(){return this.stringValue}equals(n){if(!(n instanceof at))return!1;const o=n;return this.value===o.value}static forBits(n){if(n<0||n>=at.FOR_BITS.size)throw new x;return at.FOR_BITS.get(n)}}at.FOR_BITS=new Map,at.FOR_VALUE=new Map,at.L=new at(la.L,"L",1),at.M=new at(la.M,"M",0),at.Q=new at(la.Q,"Q",3),at.H=new at(la.H,"H",2);class yn{constructor(n){this.errorCorrectionLevel=at.forBits(n>>3&3),this.dataMask=n&7}static numBitsDiffering(n,o){return H.bitCount(n^o)}static decodeFormatInformation(n,o){const l=yn.doDecodeFormatInformation(n,o);return l!==null?l:yn.doDecodeFormatInformation(n^yn.FORMAT_INFO_MASK_QR,o^yn.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(n,o){let l=Number.MAX_SAFE_INTEGER,u=0;for(const d of yn.FORMAT_INFO_DECODE_LOOKUP){const m=d[0];if(m===n||m===o)return new yn(d[1]);let p=yn.numBitsDiffering(n,m);p<l&&(u=d[1],l=p),n!==o&&(p=yn.numBitsDiffering(o,m),p<l&&(u=d[1],l=p))}return l<=3?new yn(u):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(n){if(!(n instanceof yn))return!1;const o=n;return this.errorCorrectionLevel===o.errorCorrectionLevel&&this.dataMask===o.dataMask}}yn.FORMAT_INFO_MASK_QR=21522,yn.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class oe{constructor(n,...o){this.ecCodewordsPerBlock=n,this.ecBlocks=o}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let n=0;const o=this.ecBlocks;for(const l of o)n+=l.getCount();return n}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class V{constructor(n,o){this.count=n,this.dataCodewords=o}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ze{constructor(n,o,...l){this.versionNumber=n,this.alignmentPatternCenters=o,this.ecBlocks=l;let u=0;const d=l[0].getECCodewordsPerBlock(),m=l[0].getECBlocks();for(const p of m)u+=p.getCount()*(p.getDataCodewords()+d);this.totalCodewords=u}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(n){return this.ecBlocks[n.getValue()]}static getProvisionalVersionForDimension(n){if(n%4!==1)throw new X;try{return this.getVersionForNumber((n-17)/4)}catch{throw new X}}static getVersionForNumber(n){if(n<1||n>40)throw new x;return ze.VERSIONS[n-1]}static decodeVersionInformation(n){let o=Number.MAX_SAFE_INTEGER,l=0;for(let u=0;u<ze.VERSION_DECODE_INFO.length;u++){const d=ze.VERSION_DECODE_INFO[u];if(d===n)return ze.getVersionForNumber(u+7);const m=yn.numBitsDiffering(n,d);m<o&&(l=u+7,o=m)}return o<=3?ze.getVersionForNumber(l):null}buildFunctionPattern(){const n=this.getDimensionForVersion(),o=new Ce(n);o.setRegion(0,0,9,9),o.setRegion(n-8,0,8,9),o.setRegion(0,n-8,9,8);const l=this.alignmentPatternCenters.length;for(let u=0;u<l;u++){const d=this.alignmentPatternCenters[u]-2;for(let m=0;m<l;m++)u===0&&(m===0||m===l-1)||u===l-1&&m===0||o.setRegion(this.alignmentPatternCenters[m]-2,d,5,5)}return o.setRegion(6,9,1,n-17),o.setRegion(9,6,n-17,1),this.versionNumber>6&&(o.setRegion(n-11,0,3,6),o.setRegion(0,n-11,6,3)),o}toString(){return""+this.versionNumber}}ze.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),ze.VERSIONS=[new ze(1,new Int32Array(0),new oe(7,new V(1,19)),new oe(10,new V(1,16)),new oe(13,new V(1,13)),new oe(17,new V(1,9))),new ze(2,Int32Array.from([6,18]),new oe(10,new V(1,34)),new oe(16,new V(1,28)),new oe(22,new V(1,22)),new oe(28,new V(1,16))),new ze(3,Int32Array.from([6,22]),new oe(15,new V(1,55)),new oe(26,new V(1,44)),new oe(18,new V(2,17)),new oe(22,new V(2,13))),new ze(4,Int32Array.from([6,26]),new oe(20,new V(1,80)),new oe(18,new V(2,32)),new oe(26,new V(2,24)),new oe(16,new V(4,9))),new ze(5,Int32Array.from([6,30]),new oe(26,new V(1,108)),new oe(24,new V(2,43)),new oe(18,new V(2,15),new V(2,16)),new oe(22,new V(2,11),new V(2,12))),new ze(6,Int32Array.from([6,34]),new oe(18,new V(2,68)),new oe(16,new V(4,27)),new oe(24,new V(4,19)),new oe(28,new V(4,15))),new ze(7,Int32Array.from([6,22,38]),new oe(20,new V(2,78)),new oe(18,new V(4,31)),new oe(18,new V(2,14),new V(4,15)),new oe(26,new V(4,13),new V(1,14))),new ze(8,Int32Array.from([6,24,42]),new oe(24,new V(2,97)),new oe(22,new V(2,38),new V(2,39)),new oe(22,new V(4,18),new V(2,19)),new oe(26,new V(4,14),new V(2,15))),new ze(9,Int32Array.from([6,26,46]),new oe(30,new V(2,116)),new oe(22,new V(3,36),new V(2,37)),new oe(20,new V(4,16),new V(4,17)),new oe(24,new V(4,12),new V(4,13))),new ze(10,Int32Array.from([6,28,50]),new oe(18,new V(2,68),new V(2,69)),new oe(26,new V(4,43),new V(1,44)),new oe(24,new V(6,19),new V(2,20)),new oe(28,new V(6,15),new V(2,16))),new ze(11,Int32Array.from([6,30,54]),new oe(20,new V(4,81)),new oe(30,new V(1,50),new V(4,51)),new oe(28,new V(4,22),new V(4,23)),new oe(24,new V(3,12),new V(8,13))),new ze(12,Int32Array.from([6,32,58]),new oe(24,new V(2,92),new V(2,93)),new oe(22,new V(6,36),new V(2,37)),new oe(26,new V(4,20),new V(6,21)),new oe(28,new V(7,14),new V(4,15))),new ze(13,Int32Array.from([6,34,62]),new oe(26,new V(4,107)),new oe(22,new V(8,37),new V(1,38)),new oe(24,new V(8,20),new V(4,21)),new oe(22,new V(12,11),new V(4,12))),new ze(14,Int32Array.from([6,26,46,66]),new oe(30,new V(3,115),new V(1,116)),new oe(24,new V(4,40),new V(5,41)),new oe(20,new V(11,16),new V(5,17)),new oe(24,new V(11,12),new V(5,13))),new ze(15,Int32Array.from([6,26,48,70]),new oe(22,new V(5,87),new V(1,88)),new oe(24,new V(5,41),new V(5,42)),new oe(30,new V(5,24),new V(7,25)),new oe(24,new V(11,12),new V(7,13))),new ze(16,Int32Array.from([6,26,50,74]),new oe(24,new V(5,98),new V(1,99)),new oe(28,new V(7,45),new V(3,46)),new oe(24,new V(15,19),new V(2,20)),new oe(30,new V(3,15),new V(13,16))),new ze(17,Int32Array.from([6,30,54,78]),new oe(28,new V(1,107),new V(5,108)),new oe(28,new V(10,46),new V(1,47)),new oe(28,new V(1,22),new V(15,23)),new oe(28,new V(2,14),new V(17,15))),new ze(18,Int32Array.from([6,30,56,82]),new oe(30,new V(5,120),new V(1,121)),new oe(26,new V(9,43),new V(4,44)),new oe(28,new V(17,22),new V(1,23)),new oe(28,new V(2,14),new V(19,15))),new ze(19,Int32Array.from([6,30,58,86]),new oe(28,new V(3,113),new V(4,114)),new oe(26,new V(3,44),new V(11,45)),new oe(26,new V(17,21),new V(4,22)),new oe(26,new V(9,13),new V(16,14))),new ze(20,Int32Array.from([6,34,62,90]),new oe(28,new V(3,107),new V(5,108)),new oe(26,new V(3,41),new V(13,42)),new oe(30,new V(15,24),new V(5,25)),new oe(28,new V(15,15),new V(10,16))),new ze(21,Int32Array.from([6,28,50,72,94]),new oe(28,new V(4,116),new V(4,117)),new oe(26,new V(17,42)),new oe(28,new V(17,22),new V(6,23)),new oe(30,new V(19,16),new V(6,17))),new ze(22,Int32Array.from([6,26,50,74,98]),new oe(28,new V(2,111),new V(7,112)),new oe(28,new V(17,46)),new oe(30,new V(7,24),new V(16,25)),new oe(24,new V(34,13))),new ze(23,Int32Array.from([6,30,54,78,102]),new oe(30,new V(4,121),new V(5,122)),new oe(28,new V(4,47),new V(14,48)),new oe(30,new V(11,24),new V(14,25)),new oe(30,new V(16,15),new V(14,16))),new ze(24,Int32Array.from([6,28,54,80,106]),new oe(30,new V(6,117),new V(4,118)),new oe(28,new V(6,45),new V(14,46)),new oe(30,new V(11,24),new V(16,25)),new oe(30,new V(30,16),new V(2,17))),new ze(25,Int32Array.from([6,32,58,84,110]),new oe(26,new V(8,106),new V(4,107)),new oe(28,new V(8,47),new V(13,48)),new oe(30,new V(7,24),new V(22,25)),new oe(30,new V(22,15),new V(13,16))),new ze(26,Int32Array.from([6,30,58,86,114]),new oe(28,new V(10,114),new V(2,115)),new oe(28,new V(19,46),new V(4,47)),new oe(28,new V(28,22),new V(6,23)),new oe(30,new V(33,16),new V(4,17))),new ze(27,Int32Array.from([6,34,62,90,118]),new oe(30,new V(8,122),new V(4,123)),new oe(28,new V(22,45),new V(3,46)),new oe(30,new V(8,23),new V(26,24)),new oe(30,new V(12,15),new V(28,16))),new ze(28,Int32Array.from([6,26,50,74,98,122]),new oe(30,new V(3,117),new V(10,118)),new oe(28,new V(3,45),new V(23,46)),new oe(30,new V(4,24),new V(31,25)),new oe(30,new V(11,15),new V(31,16))),new ze(29,Int32Array.from([6,30,54,78,102,126]),new oe(30,new V(7,116),new V(7,117)),new oe(28,new V(21,45),new V(7,46)),new oe(30,new V(1,23),new V(37,24)),new oe(30,new V(19,15),new V(26,16))),new ze(30,Int32Array.from([6,26,52,78,104,130]),new oe(30,new V(5,115),new V(10,116)),new oe(28,new V(19,47),new V(10,48)),new oe(30,new V(15,24),new V(25,25)),new oe(30,new V(23,15),new V(25,16))),new ze(31,Int32Array.from([6,30,56,82,108,134]),new oe(30,new V(13,115),new V(3,116)),new oe(28,new V(2,46),new V(29,47)),new oe(30,new V(42,24),new V(1,25)),new oe(30,new V(23,15),new V(28,16))),new ze(32,Int32Array.from([6,34,60,86,112,138]),new oe(30,new V(17,115)),new oe(28,new V(10,46),new V(23,47)),new oe(30,new V(10,24),new V(35,25)),new oe(30,new V(19,15),new V(35,16))),new ze(33,Int32Array.from([6,30,58,86,114,142]),new oe(30,new V(17,115),new V(1,116)),new oe(28,new V(14,46),new V(21,47)),new oe(30,new V(29,24),new V(19,25)),new oe(30,new V(11,15),new V(46,16))),new ze(34,Int32Array.from([6,34,62,90,118,146]),new oe(30,new V(13,115),new V(6,116)),new oe(28,new V(14,46),new V(23,47)),new oe(30,new V(44,24),new V(7,25)),new oe(30,new V(59,16),new V(1,17))),new ze(35,Int32Array.from([6,30,54,78,102,126,150]),new oe(30,new V(12,121),new V(7,122)),new oe(28,new V(12,47),new V(26,48)),new oe(30,new V(39,24),new V(14,25)),new oe(30,new V(22,15),new V(41,16))),new ze(36,Int32Array.from([6,24,50,76,102,128,154]),new oe(30,new V(6,121),new V(14,122)),new oe(28,new V(6,47),new V(34,48)),new oe(30,new V(46,24),new V(10,25)),new oe(30,new V(2,15),new V(64,16))),new ze(37,Int32Array.from([6,28,54,80,106,132,158]),new oe(30,new V(17,122),new V(4,123)),new oe(28,new V(29,46),new V(14,47)),new oe(30,new V(49,24),new V(10,25)),new oe(30,new V(24,15),new V(46,16))),new ze(38,Int32Array.from([6,32,58,84,110,136,162]),new oe(30,new V(4,122),new V(18,123)),new oe(28,new V(13,46),new V(32,47)),new oe(30,new V(48,24),new V(14,25)),new oe(30,new V(42,15),new V(32,16))),new ze(39,Int32Array.from([6,26,54,82,110,138,166]),new oe(30,new V(20,117),new V(4,118)),new oe(28,new V(40,47),new V(7,48)),new oe(30,new V(43,24),new V(22,25)),new oe(30,new V(10,15),new V(67,16))),new ze(40,Int32Array.from([6,30,58,86,114,142,170]),new oe(30,new V(19,118),new V(6,119)),new oe(28,new V(18,47),new V(31,48)),new oe(30,new V(34,24),new V(34,25)),new oe(30,new V(20,15),new V(61,16)))];var hn;(function(M){M[M.DATA_MASK_000=0]="DATA_MASK_000",M[M.DATA_MASK_001=1]="DATA_MASK_001",M[M.DATA_MASK_010=2]="DATA_MASK_010",M[M.DATA_MASK_011=3]="DATA_MASK_011",M[M.DATA_MASK_100=4]="DATA_MASK_100",M[M.DATA_MASK_101=5]="DATA_MASK_101",M[M.DATA_MASK_110=6]="DATA_MASK_110",M[M.DATA_MASK_111=7]="DATA_MASK_111"})(hn||(hn={}));class Qn{constructor(n,o){this.value=n,this.isMasked=o}unmaskBitMatrix(n,o){for(let l=0;l<o;l++)for(let u=0;u<o;u++)this.isMasked(l,u)&&n.flip(u,l)}}Qn.values=new Map([[hn.DATA_MASK_000,new Qn(hn.DATA_MASK_000,(M,n)=>(M+n&1)===0)],[hn.DATA_MASK_001,new Qn(hn.DATA_MASK_001,(M,n)=>(M&1)===0)],[hn.DATA_MASK_010,new Qn(hn.DATA_MASK_010,(M,n)=>n%3===0)],[hn.DATA_MASK_011,new Qn(hn.DATA_MASK_011,(M,n)=>(M+n)%3===0)],[hn.DATA_MASK_100,new Qn(hn.DATA_MASK_100,(M,n)=>(Math.floor(M/2)+Math.floor(n/3)&1)===0)],[hn.DATA_MASK_101,new Qn(hn.DATA_MASK_101,(M,n)=>M*n%6===0)],[hn.DATA_MASK_110,new Qn(hn.DATA_MASK_110,(M,n)=>M*n%6<3)],[hn.DATA_MASK_111,new Qn(hn.DATA_MASK_111,(M,n)=>(M+n+M*n%3&1)===0)]]);class ca{constructor(n){const o=n.getHeight();if(o<21||(o&3)!==1)throw new X;this.bitMatrix=n}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let n=0;for(let d=0;d<6;d++)n=this.copyBit(d,8,n);n=this.copyBit(7,8,n),n=this.copyBit(8,8,n),n=this.copyBit(8,7,n);for(let d=5;d>=0;d--)n=this.copyBit(8,d,n);const o=this.bitMatrix.getHeight();let l=0;const u=o-7;for(let d=o-1;d>=u;d--)l=this.copyBit(8,d,l);for(let d=o-8;d<o;d++)l=this.copyBit(d,8,l);if(this.parsedFormatInfo=yn.decodeFormatInformation(n,l),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new X}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const n=this.bitMatrix.getHeight(),o=Math.floor((n-17)/4);if(o<=6)return ze.getVersionForNumber(o);let l=0;const u=n-11;for(let m=5;m>=0;m--)for(let p=n-9;p>=u;p--)l=this.copyBit(p,m,l);let d=ze.decodeVersionInformation(l);if(d!==null&&d.getDimensionForVersion()===n)return this.parsedVersion=d,d;l=0;for(let m=5;m>=0;m--)for(let p=n-9;p>=u;p--)l=this.copyBit(m,p,l);if(d=ze.decodeVersionInformation(l),d!==null&&d.getDimensionForVersion()===n)return this.parsedVersion=d,d;throw new X}copyBit(n,o,l){return(this.isMirror?this.bitMatrix.get(o,n):this.bitMatrix.get(n,o))?l<<1|1:l<<1}readCodewords(){const n=this.readFormatInformation(),o=this.readVersion(),l=Qn.values.get(n.getDataMask()),u=this.bitMatrix.getHeight();l.unmaskBitMatrix(this.bitMatrix,u);const d=o.buildFunctionPattern();let m=!0;const p=new Uint8Array(o.getTotalCodewords());let w=0,C=0,N=0;for(let D=u-1;D>0;D-=2){D===6&&D--;for(let P=0;P<u;P++){const G=m?u-1-P:P;for(let q=0;q<2;q++)d.get(D-q,G)||(N++,C<<=1,this.bitMatrix.get(D-q,G)&&(C|=1),N===8&&(p[w++]=C,N=0,C=0))}m=!m}if(w!==o.getTotalCodewords())throw new X;return p}remask(){if(this.parsedFormatInfo===null)return;const n=Qn.values[this.parsedFormatInfo.getDataMask()],o=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,o)}setMirror(n){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=n}mirror(){const n=this.bitMatrix;for(let o=0,l=n.getWidth();o<l;o++)for(let u=o+1,d=n.getHeight();u<d;u++)n.get(o,u)!==n.get(u,o)&&(n.flip(u,o),n.flip(o,u))}}class Us{constructor(n,o){this.numDataCodewords=n,this.codewords=o}static getDataBlocks(n,o,l){if(n.length!==o.getTotalCodewords())throw new x;const u=o.getECBlocksForLevel(l);let d=0;const m=u.getECBlocks();for(const q of m)d+=q.getCount();const p=new Array(d);let w=0;for(const q of m)for(let K=0;K<q.getCount();K++){const ie=q.getDataCodewords(),he=u.getECCodewordsPerBlock()+ie;p[w++]=new Us(ie,new Uint8Array(he))}const C=p[0].codewords.length;let N=p.length-1;for(;N>=0&&p[N].codewords.length!==C;)N--;N++;const D=C-u.getECCodewordsPerBlock();let P=0;for(let q=0;q<D;q++)for(let K=0;K<w;K++)p[K].codewords[q]=n[P++];for(let q=N;q<w;q++)p[q].codewords[D]=n[P++];const G=p[0].codewords.length;for(let q=D;q<G;q++)for(let K=0;K<w;K++){const ie=K<N?q:q+1;p[K].codewords[ie]=n[P++]}return p}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Jn;(function(M){M[M.TERMINATOR=0]="TERMINATOR",M[M.NUMERIC=1]="NUMERIC",M[M.ALPHANUMERIC=2]="ALPHANUMERIC",M[M.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",M[M.BYTE=4]="BYTE",M[M.ECI=5]="ECI",M[M.KANJI=6]="KANJI",M[M.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",M[M.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",M[M.HANZI=9]="HANZI"})(Jn||(Jn={}));class Fe{constructor(n,o,l,u){this.value=n,this.stringValue=o,this.characterCountBitsForVersions=l,this.bits=u,Fe.FOR_BITS.set(u,this),Fe.FOR_VALUE.set(n,this)}static forBits(n){const o=Fe.FOR_BITS.get(n);if(o===void 0)throw new x;return o}getCharacterCountBits(n){const o=n.getVersionNumber();let l;return o<=9?l=0:o<=26?l=1:l=2,this.characterCountBitsForVersions[l]}getValue(){return this.value}getBits(){return this.bits}equals(n){if(!(n instanceof Fe))return!1;const o=n;return this.value===o.value}toString(){return this.stringValue}}Fe.FOR_BITS=new Map,Fe.FOR_VALUE=new Map,Fe.TERMINATOR=new Fe(Jn.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Fe.NUMERIC=new Fe(Jn.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Fe.ALPHANUMERIC=new Fe(Jn.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Fe.STRUCTURED_APPEND=new Fe(Jn.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Fe.BYTE=new Fe(Jn.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Fe.ECI=new Fe(Jn.ECI,"ECI",Int32Array.from([0,0,0]),7),Fe.KANJI=new Fe(Jn.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Fe.FNC1_FIRST_POSITION=new Fe(Jn.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Fe.FNC1_SECOND_POSITION=new Fe(Jn.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Fe.HANZI=new Fe(Jn.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class zt{static decode(n,o,l,u){const d=new yr(n);let m=new pe;const p=new Array;let w=-1,C=-1;try{let N=null,D=!1,P;do{if(d.available()<4)P=Fe.TERMINATOR;else{const G=d.readBits(4);P=Fe.forBits(G)}switch(P){case Fe.TERMINATOR:break;case Fe.FNC1_FIRST_POSITION:case Fe.FNC1_SECOND_POSITION:D=!0;break;case Fe.STRUCTURED_APPEND:if(d.available()<16)throw new X;w=d.readBits(8),C=d.readBits(8);break;case Fe.ECI:const G=zt.parseECIValue(d);if(N=Q.getCharacterSetECIByValue(G),N===null)throw new X;break;case Fe.HANZI:const q=d.readBits(4),K=d.readBits(P.getCharacterCountBits(o));q===zt.GB2312_SUBSET&&zt.decodeHanziSegment(d,m,K);break;default:const ie=d.readBits(P.getCharacterCountBits(o));switch(P){case Fe.NUMERIC:zt.decodeNumericSegment(d,m,ie);break;case Fe.ALPHANUMERIC:zt.decodeAlphanumericSegment(d,m,ie,D);break;case Fe.BYTE:zt.decodeByteSegment(d,m,ie,N,p,u);break;case Fe.KANJI:zt.decodeKanjiSegment(d,m,ie);break;default:throw new X}break}}while(P!==Fe.TERMINATOR)}catch{throw new X}return new pt(n,m.toString(),p.length===0?null:p,l===null?null:l.toString(),w,C)}static decodeHanziSegment(n,o,l){if(l*13>n.available())throw new X;const u=new Uint8Array(2*l);let d=0;for(;l>0;){const m=n.readBits(13);let p=m/96<<8&4294967295|m%96;p<959?p+=41377:p+=42657,u[d]=p>>8&255,u[d+1]=p&255,d+=2,l--}try{o.append(ue.decode(u,$.GB2312))}catch(m){throw new X(m)}}static decodeKanjiSegment(n,o,l){if(l*13>n.available())throw new X;const u=new Uint8Array(2*l);let d=0;for(;l>0;){const m=n.readBits(13);let p=m/192<<8&4294967295|m%192;p<7936?p+=33088:p+=49472,u[d]=p>>8,u[d+1]=p,d+=2,l--}try{o.append(ue.decode(u,$.SHIFT_JIS))}catch(m){throw new X(m)}}static decodeByteSegment(n,o,l,u,d,m){if(8*l>n.available())throw new X;const p=new Uint8Array(l);for(let C=0;C<l;C++)p[C]=n.readBits(8);let w;u===null?w=$.guessEncoding(p,m):w=u.getName();try{o.append(ue.decode(p,w))}catch(C){throw new X(C)}d.push(p)}static toAlphaNumericChar(n){if(n>=zt.ALPHANUMERIC_CHARS.length)throw new X;return zt.ALPHANUMERIC_CHARS[n]}static decodeAlphanumericSegment(n,o,l,u){const d=o.length();for(;l>1;){if(n.available()<11)throw new X;const m=n.readBits(11);o.append(zt.toAlphaNumericChar(Math.floor(m/45))),o.append(zt.toAlphaNumericChar(m%45)),l-=2}if(l===1){if(n.available()<6)throw new X;o.append(zt.toAlphaNumericChar(n.readBits(6)))}if(u)for(let m=d;m<o.length();m++)o.charAt(m)==="%"&&(m<o.length()-1&&o.charAt(m+1)==="%"?o.deleteCharAt(m+1):o.setCharAt(m,""))}static decodeNumericSegment(n,o,l){for(;l>=3;){if(n.available()<10)throw new X;const u=n.readBits(10);if(u>=1e3)throw new X;o.append(zt.toAlphaNumericChar(Math.floor(u/100))),o.append(zt.toAlphaNumericChar(Math.floor(u/10)%10)),o.append(zt.toAlphaNumericChar(u%10)),l-=3}if(l===2){if(n.available()<7)throw new X;const u=n.readBits(7);if(u>=100)throw new X;o.append(zt.toAlphaNumericChar(Math.floor(u/10))),o.append(zt.toAlphaNumericChar(u%10))}else if(l===1){if(n.available()<4)throw new X;const u=n.readBits(4);if(u>=10)throw new X;o.append(zt.toAlphaNumericChar(u))}}static parseECIValue(n){const o=n.readBits(8);if((o&128)===0)return o&127;if((o&192)===128){const l=n.readBits(8);return(o&63)<<8&4294967295|l}if((o&224)===192){const l=n.readBits(16);return(o&31)<<16&4294967295|l}throw new X}}zt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",zt.GB2312_SUBSET=1;class rc{constructor(n){this.mirrored=n}isMirrored(){return this.mirrored}applyMirroredCorrection(n){if(!this.mirrored||n===null||n.length<3)return;const o=n[0];n[0]=n[2],n[2]=o}}class pf{constructor(){this.rsDecoder=new Ci(xt.QR_CODE_FIELD_256)}decodeBooleanArray(n,o){return this.decodeBitMatrix(Ce.parseFromBooleanArray(n),o)}decodeBitMatrix(n,o){const l=new ca(n);let u=null;try{return this.decodeBitMatrixParser(l,o)}catch(d){u=d}try{l.remask(),l.setMirror(!0),l.readVersion(),l.readFormatInformation(),l.mirror();const d=this.decodeBitMatrixParser(l,o);return d.setOther(new rc(!0)),d}catch(d){throw u!==null?u:d}}decodeBitMatrixParser(n,o){const l=n.readVersion(),u=n.readFormatInformation().getErrorCorrectionLevel(),d=n.readCodewords(),m=Us.getDataBlocks(d,l,u);let p=0;for(const N of m)p+=N.getNumDataCodewords();const w=new Uint8Array(p);let C=0;for(const N of m){const D=N.getCodewords(),P=N.getNumDataCodewords();this.correctErrors(D,P);for(let G=0;G<P;G++)w[C++]=D[G]}return zt.decode(w,l,u,o)}correctErrors(n,o){const l=new Int32Array(n);try{this.rsDecoder.decode(l,n.length-o)}catch{throw new R}for(let u=0;u<o;u++)n[u]=l[u]}}class ua extends Le{constructor(n,o,l){super(n,o),this.estimatedModuleSize=l}aboutEquals(n,o,l){if(Math.abs(o-this.getY())<=n&&Math.abs(l-this.getX())<=n){const u=Math.abs(n-this.estimatedModuleSize);return u<=1||u<=this.estimatedModuleSize}return!1}combineEstimate(n,o,l){const u=(this.getX()+o)/2,d=(this.getY()+n)/2,m=(this.estimatedModuleSize+l)/2;return new ua(u,d,m)}}class or{constructor(n,o,l,u,d,m,p){this.image=n,this.startX=o,this.startY=l,this.width=u,this.height=d,this.moduleSize=m,this.resultPointCallback=p,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const n=this.startX,o=this.height,l=this.width,u=n+l,d=this.startY+o/2,m=new Int32Array(3),p=this.image;for(let w=0;w<o;w++){const C=d+((w&1)===0?Math.floor((w+1)/2):-Math.floor((w+1)/2));m[0]=0,m[1]=0,m[2]=0;let N=n;for(;N<u&&!p.get(N,C);)N++;let D=0;for(;N<u;){if(p.get(N,C))if(D===1)m[1]++;else if(D===2){if(this.foundPatternCross(m)){const P=this.handlePossibleCenter(m,C,N);if(P!==null)return P}m[0]=m[2],m[1]=1,m[2]=0,D=1}else m[++D]++;else D===1&&D++,m[D]++;N++}if(this.foundPatternCross(m)){const P=this.handlePossibleCenter(m,C,u);if(P!==null)return P}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new re}static centerFromEnd(n,o){return o-n[2]-n[1]/2}foundPatternCross(n){const o=this.moduleSize,l=o/2;for(let u=0;u<3;u++)if(Math.abs(o-n[u])>=l)return!1;return!0}crossCheckVertical(n,o,l,u){const d=this.image,m=d.getHeight(),p=this.crossCheckStateCount;p[0]=0,p[1]=0,p[2]=0;let w=n;for(;w>=0&&d.get(o,w)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&!d.get(o,w)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(o,w)&&p[1]<=l;)p[1]++,w++;if(w===m||p[1]>l)return NaN;for(;w<m&&!d.get(o,w)&&p[2]<=l;)p[2]++,w++;if(p[2]>l)return NaN;const C=p[0]+p[1]+p[2];return 5*Math.abs(C-u)>=2*u?NaN:this.foundPatternCross(p)?or.centerFromEnd(p,w):NaN}handlePossibleCenter(n,o,l){const u=n[0]+n[1]+n[2],d=or.centerFromEnd(n,l),m=this.crossCheckVertical(o,d,2*n[1],u);if(!isNaN(m)){const p=(n[0]+n[1]+n[2])/3;for(const C of this.possibleCenters)if(C.aboutEquals(p,m,d))return C.combineEstimate(m,d,p);const w=new ua(d,m,p);this.possibleCenters.push(w),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(w)}return null}}class eo extends Le{constructor(n,o,l,u){super(n,o),this.estimatedModuleSize=l,this.count=u,u===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(n,o,l){if(Math.abs(o-this.getY())<=n&&Math.abs(l-this.getX())<=n){const u=Math.abs(n-this.estimatedModuleSize);return u<=1||u<=this.estimatedModuleSize}return!1}combineEstimate(n,o,l){const u=this.count+1,d=(this.count*this.getX()+o)/u,m=(this.count*this.getY()+n)/u,p=(this.count*this.estimatedModuleSize+l)/u;return new eo(d,m,p,u)}}class Fs{constructor(n){this.bottomLeft=n[0],this.topLeft=n[1],this.topRight=n[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Gt{constructor(n,o){this.image=n,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=o}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(n){const o=n!=null&&n.get(ee.TRY_HARDER)!==void 0,l=n!=null&&n.get(ee.PURE_BARCODE)!==void 0,u=this.image,d=u.getHeight(),m=u.getWidth();let p=Math.floor(3*d/(4*Gt.MAX_MODULES));(p<Gt.MIN_SKIP||o)&&(p=Gt.MIN_SKIP);let w=!1;const C=new Int32Array(5);for(let D=p-1;D<d&&!w;D+=p){C[0]=0,C[1]=0,C[2]=0,C[3]=0,C[4]=0;let P=0;for(let G=0;G<m;G++)if(u.get(G,D))(P&1)===1&&P++,C[P]++;else if((P&1)===0)if(P===4)if(Gt.foundPatternCross(C)){if(this.handlePossibleCenter(C,D,G,l)===!0)if(p=2,this.hasSkipped===!0)w=this.haveMultiplyConfirmedCenters();else{const K=this.findRowSkip();K>C[2]&&(D+=K-C[2]-p,G=m-1)}else{C[0]=C[2],C[1]=C[3],C[2]=C[4],C[3]=1,C[4]=0,P=3;continue}P=0,C[0]=0,C[1]=0,C[2]=0,C[3]=0,C[4]=0}else C[0]=C[2],C[1]=C[3],C[2]=C[4],C[3]=1,C[4]=0,P=3;else C[++P]++;else C[P]++;Gt.foundPatternCross(C)&&this.handlePossibleCenter(C,D,m,l)===!0&&(p=C[0],this.hasSkipped&&(w=this.haveMultiplyConfirmedCenters()))}const N=this.selectBestPatterns();return Le.orderBestPatterns(N),new Fs(N)}static centerFromEnd(n,o){return o-n[4]-n[3]-n[2]/2}static foundPatternCross(n){let o=0;for(let d=0;d<5;d++){const m=n[d];if(m===0)return!1;o+=m}if(o<7)return!1;const l=o/7,u=l/2;return Math.abs(l-n[0])<u&&Math.abs(l-n[1])<u&&Math.abs(3*l-n[2])<3*u&&Math.abs(l-n[3])<u&&Math.abs(l-n[4])<u}getCrossCheckStateCount(){const n=this.crossCheckStateCount;return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n}crossCheckDiagonal(n,o,l,u){const d=this.getCrossCheckStateCount();let m=0;const p=this.image;for(;n>=m&&o>=m&&p.get(o-m,n-m);)d[2]++,m++;if(n<m||o<m)return!1;for(;n>=m&&o>=m&&!p.get(o-m,n-m)&&d[1]<=l;)d[1]++,m++;if(n<m||o<m||d[1]>l)return!1;for(;n>=m&&o>=m&&p.get(o-m,n-m)&&d[0]<=l;)d[0]++,m++;if(d[0]>l)return!1;const w=p.getHeight(),C=p.getWidth();for(m=1;n+m<w&&o+m<C&&p.get(o+m,n+m);)d[2]++,m++;if(n+m>=w||o+m>=C)return!1;for(;n+m<w&&o+m<C&&!p.get(o+m,n+m)&&d[3]<l;)d[3]++,m++;if(n+m>=w||o+m>=C||d[3]>=l)return!1;for(;n+m<w&&o+m<C&&p.get(o+m,n+m)&&d[4]<l;)d[4]++,m++;if(d[4]>=l)return!1;const N=d[0]+d[1]+d[2]+d[3]+d[4];return Math.abs(N-u)<2*u&&Gt.foundPatternCross(d)}crossCheckVertical(n,o,l,u){const d=this.image,m=d.getHeight(),p=this.getCrossCheckStateCount();let w=n;for(;w>=0&&d.get(o,w);)p[2]++,w--;if(w<0)return NaN;for(;w>=0&&!d.get(o,w)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&d.get(o,w)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(o,w);)p[2]++,w++;if(w===m)return NaN;for(;w<m&&!d.get(o,w)&&p[3]<l;)p[3]++,w++;if(w===m||p[3]>=l)return NaN;for(;w<m&&d.get(o,w)&&p[4]<l;)p[4]++,w++;if(p[4]>=l)return NaN;const C=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(C-u)>=2*u?NaN:Gt.foundPatternCross(p)?Gt.centerFromEnd(p,w):NaN}crossCheckHorizontal(n,o,l,u){const d=this.image,m=d.getWidth(),p=this.getCrossCheckStateCount();let w=n;for(;w>=0&&d.get(w,o);)p[2]++,w--;if(w<0)return NaN;for(;w>=0&&!d.get(w,o)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&d.get(w,o)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(w,o);)p[2]++,w++;if(w===m)return NaN;for(;w<m&&!d.get(w,o)&&p[3]<l;)p[3]++,w++;if(w===m||p[3]>=l)return NaN;for(;w<m&&d.get(w,o)&&p[4]<l;)p[4]++,w++;if(p[4]>=l)return NaN;const C=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(C-u)>=u?NaN:Gt.foundPatternCross(p)?Gt.centerFromEnd(p,w):NaN}handlePossibleCenter(n,o,l,u){const d=n[0]+n[1]+n[2]+n[3]+n[4];let m=Gt.centerFromEnd(n,l),p=this.crossCheckVertical(o,Math.floor(m),n[2],d);if(!isNaN(p)&&(m=this.crossCheckHorizontal(Math.floor(m),Math.floor(p),n[2],d),!isNaN(m)&&(!u||this.crossCheckDiagonal(Math.floor(p),Math.floor(m),n[2],d)))){const w=d/7;let C=!1;const N=this.possibleCenters;for(let D=0,P=N.length;D<P;D++){const G=N[D];if(G.aboutEquals(w,p,m)){N[D]=G.combineEstimate(p,m,w),C=!0;break}}if(!C){const D=new eo(m,p,w);N.push(D),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(D)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let o=null;for(const l of this.possibleCenters)if(l.getCount()>=Gt.CENTER_QUORUM)if(o==null)o=l;else return this.hasSkipped=!0,Math.floor((Math.abs(o.getX()-l.getX())-Math.abs(o.getY()-l.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let n=0,o=0;const l=this.possibleCenters.length;for(const m of this.possibleCenters)m.getCount()>=Gt.CENTER_QUORUM&&(n++,o+=m.getEstimatedModuleSize());if(n<3)return!1;const u=o/l;let d=0;for(const m of this.possibleCenters)d+=Math.abs(m.getEstimatedModuleSize()-u);return d<=.05*o}selectBestPatterns(){const n=this.possibleCenters.length;if(n<3)throw new re;const o=this.possibleCenters;let l;if(n>3){let u=0,d=0;for(const w of this.possibleCenters){const C=w.getEstimatedModuleSize();u+=C,d+=C*C}l=u/n;let m=Math.sqrt(d/n-l*l);o.sort((w,C)=>{const N=Math.abs(C.getEstimatedModuleSize()-l),D=Math.abs(w.getEstimatedModuleSize()-l);return N<D?-1:N>D?1:0});const p=Math.max(.2*l,m);for(let w=0;w<o.length&&o.length>3;w++){const C=o[w];Math.abs(C.getEstimatedModuleSize()-l)>p&&(o.splice(w,1),w--)}}if(o.length>3){let u=0;for(const d of o)u+=d.getEstimatedModuleSize();l=u/o.length,o.sort((d,m)=>{if(m.getCount()===d.getCount()){const p=Math.abs(m.getEstimatedModuleSize()-l),w=Math.abs(d.getEstimatedModuleSize()-l);return p<w?1:p>w?-1:0}else return m.getCount()-d.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]}}Gt.CENTER_QUORUM=2,Gt.MIN_SKIP=3,Gt.MAX_MODULES=57;class Br{constructor(n){this.image=n}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(n){this.resultPointCallback=n==null?null:n.get(ee.NEED_RESULT_POINT_CALLBACK);const l=new Gt(this.image,this.resultPointCallback).find(n);return this.processFinderPatternInfo(l)}processFinderPatternInfo(n){const o=n.getTopLeft(),l=n.getTopRight(),u=n.getBottomLeft(),d=this.calculateModuleSize(o,l,u);if(d<1)throw new re("No pattern found in proccess finder.");const m=Br.computeDimension(o,l,u,d),p=ze.getProvisionalVersionForDimension(m),w=p.getDimensionForVersion()-7;let C=null;if(p.getAlignmentPatternCenters().length>0){const G=l.getX()-o.getX()+u.getX(),q=l.getY()-o.getY()+u.getY(),K=1-3/w,ie=Math.floor(o.getX()+K*(G-o.getX())),he=Math.floor(o.getY()+K*(q-o.getY()));for(let Re=4;Re<=16;Re<<=1)try{C=this.findAlignmentInRegion(d,ie,he,Re);break}catch(Ae){if(!(Ae instanceof re))throw Ae}}const N=Br.createTransform(o,l,u,C,m),D=Br.sampleGrid(this.image,N,m);let P;return C===null?P=[u,o,l]:P=[u,o,l,C],new Ro(D,P)}static createTransform(n,o,l,u,d){const m=d-3.5;let p,w,C,N;return u!==null?(p=u.getX(),w=u.getY(),C=m-3,N=C):(p=o.getX()-n.getX()+l.getX(),w=o.getY()-n.getY()+l.getY(),C=m,N=m),ir.quadrilateralToQuadrilateral(3.5,3.5,m,3.5,C,N,3.5,m,n.getX(),n.getY(),o.getX(),o.getY(),p,w,l.getX(),l.getY())}static sampleGrid(n,o,l){return mr.getInstance().sampleGridWithTransform(n,l,l,o)}static computeDimension(n,o,l,u){const d=ot.round(Le.distance(n,o)/u),m=ot.round(Le.distance(n,l)/u);let p=Math.floor((d+m)/2)+7;switch(p&3){case 0:p++;break;case 2:p--;break;case 3:throw new re("Dimensions could be not found.")}return p}calculateModuleSize(n,o,l){return(this.calculateModuleSizeOneWay(n,o)+this.calculateModuleSizeOneWay(n,l))/2}calculateModuleSizeOneWay(n,o){const l=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(o.getX()),Math.floor(o.getY())),u=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(o.getX()),Math.floor(o.getY()),Math.floor(n.getX()),Math.floor(n.getY()));return isNaN(l)?u/7:isNaN(u)?l/7:(l+u)/14}sizeOfBlackWhiteBlackRunBothWays(n,o,l,u){let d=this.sizeOfBlackWhiteBlackRun(n,o,l,u),m=1,p=n-(l-n);p<0?(m=n/(n-p),p=0):p>=this.image.getWidth()&&(m=(this.image.getWidth()-1-n)/(p-n),p=this.image.getWidth()-1);let w=Math.floor(o-(u-o)*m);return m=1,w<0?(m=o/(o-w),w=0):w>=this.image.getHeight()&&(m=(this.image.getHeight()-1-o)/(w-o),w=this.image.getHeight()-1),p=Math.floor(n+(p-n)*m),d+=this.sizeOfBlackWhiteBlackRun(n,o,p,w),d-1}sizeOfBlackWhiteBlackRun(n,o,l,u){const d=Math.abs(u-o)>Math.abs(l-n);if(d){let G=n;n=o,o=G,G=l,l=u,u=G}const m=Math.abs(l-n),p=Math.abs(u-o);let w=-m/2;const C=n<l?1:-1,N=o<u?1:-1;let D=0;const P=l+C;for(let G=n,q=o;G!==P;G+=C){const K=d?q:G,ie=d?G:q;if(D===1===this.image.get(K,ie)){if(D===2)return ot.distance(G,q,n,o);D++}if(w+=p,w>0){if(q===u)break;q+=N,w-=m}}return D===2?ot.distance(l+C,u,n,o):NaN}findAlignmentInRegion(n,o,l,u){const d=Math.floor(u*n),m=Math.max(0,o-d),p=Math.min(this.image.getWidth()-1,o+d);if(p-m<n*3)throw new re("Alignment top exceeds estimated module size.");const w=Math.max(0,l-d),C=Math.min(this.image.getHeight()-1,l+d);if(C-w<n*3)throw new re("Alignment bottom exceeds estimated module size.");return new or(this.image,m,w,p-m,C-w,n,this.resultPointCallback).find()}}class $r{constructor(){this.decoder=new pf}getDecoder(){return this.decoder}decode(n,o){let l,u;if(o!=null&&o.get(ee.PURE_BARCODE)!==void 0){const w=$r.extractPureBits(n.getBlackMatrix());l=this.decoder.decodeBitMatrix(w,o),u=$r.NO_POINTS}else{const w=new Br(n.getBlackMatrix()).detect(o);l=this.decoder.decodeBitMatrix(w.getBits(),o),u=w.getPoints()}l.getOther()instanceof rc&&l.getOther().applyMirroredCorrection(u);const d=new Ie(l.getText(),l.getRawBytes(),void 0,u,Te.QR_CODE,void 0),m=l.getByteSegments();m!==null&&d.putMetadata(Qe.BYTE_SEGMENTS,m);const p=l.getECLevel();return p!==null&&d.putMetadata(Qe.ERROR_CORRECTION_LEVEL,p),l.hasStructuredAppend()&&(d.putMetadata(Qe.STRUCTURED_APPEND_SEQUENCE,l.getStructuredAppendSequenceNumber()),d.putMetadata(Qe.STRUCTURED_APPEND_PARITY,l.getStructuredAppendParity())),d}reset(){}static extractPureBits(n){const o=n.getTopLeftOnBit(),l=n.getBottomRightOnBit();if(o===null||l===null)throw new re;const u=this.moduleSize(o,n);let d=o[1],m=l[1],p=o[0],w=l[0];if(p>=w||d>=m)throw new re;if(m-d!==w-p&&(w=p+(m-d),w>=n.getWidth()))throw new re;const C=Math.round((w-p+1)/u),N=Math.round((m-d+1)/u);if(C<=0||N<=0)throw new re;if(N!==C)throw new re;const D=Math.floor(u/2);d+=D,p+=D;const P=p+Math.floor((C-1)*u)-w;if(P>0){if(P>D)throw new re;p-=P}const G=d+Math.floor((N-1)*u)-m;if(G>0){if(G>D)throw new re;d-=G}const q=new Ce(C,N);for(let K=0;K<N;K++){const ie=d+Math.floor(K*u);for(let he=0;he<C;he++)n.get(p+Math.floor(he*u),ie)&&q.set(he,K)}return q}static moduleSize(n,o){const l=o.getHeight(),u=o.getWidth();let d=n[0],m=n[1],p=!0,w=0;for(;d<u&&m<l;){if(p!==o.get(d,m)){if(++w===5)break;p=!p}d++,m++}if(d===u||m===l)throw new re;return(d-n[0])/7}}$r.NO_POINTS=new Array;class Ge{PDF417Common(){}static getBitCountSum(n){return ot.sum(n)}static toIntArray(n){if(n==null||!n.length)return Ge.EMPTY_INT_ARRAY;const o=new Int32Array(n.length);let l=0;for(const u of n)o[l++]=u;return o}static getCodeword(n){const o=Z.binarySearch(Ge.SYMBOL_TABLE,n&262143);return o<0?-1:(Ge.CODEWORD_TABLE[o]-1)%Ge.NUMBER_OF_CODEWORDS}}Ge.NUMBER_OF_CODEWORDS=929,Ge.MAX_CODEWORDS_IN_BARCODE=Ge.NUMBER_OF_CODEWORDS-1,Ge.MIN_ROWS_IN_BARCODE=3,Ge.MAX_ROWS_IN_BARCODE=90,Ge.MODULES_IN_CODEWORD=17,Ge.MODULES_IN_STOP_PATTERN=18,Ge.BARS_IN_MODULE=8,Ge.EMPTY_INT_ARRAY=new Int32Array([]),Ge.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),Ge.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class ic{constructor(n,o){this.bits=n,this.points=o}getBits(){return this.bits}getPoints(){return this.points}}class qe{static detectMultiple(n,o,l){let u=n.getBlackMatrix(),d=qe.detect(l,u);return d.length||(u=u.clone(),u.rotate180(),d=qe.detect(l,u)),new ic(u,d)}static detect(n,o){const l=new Array;let u=0,d=0,m=!1;for(;u<o.getHeight();){const p=qe.findVertices(o,u,d);if(p[0]==null&&p[3]==null){if(!m)break;m=!1,d=0;for(const w of l)w[1]!=null&&(u=Math.trunc(Math.max(u,w[1].getY()))),w[3]!=null&&(u=Math.max(u,Math.trunc(w[3].getY())));u+=qe.ROW_STEP;continue}if(m=!0,l.push(p),!n)break;p[2]!=null?(d=Math.trunc(p[2].getX()),u=Math.trunc(p[2].getY())):(d=Math.trunc(p[4].getX()),u=Math.trunc(p[4].getY()))}return l}static findVertices(n,o,l){const u=n.getHeight(),d=n.getWidth(),m=new Array(8);return qe.copyToResult(m,qe.findRowsWithPattern(n,u,d,o,l,qe.START_PATTERN),qe.INDEXES_START_PATTERN),m[4]!=null&&(l=Math.trunc(m[4].getX()),o=Math.trunc(m[4].getY())),qe.copyToResult(m,qe.findRowsWithPattern(n,u,d,o,l,qe.STOP_PATTERN),qe.INDEXES_STOP_PATTERN),m}static copyToResult(n,o,l){for(let u=0;u<l.length;u++)n[l[u]]=o[u]}static findRowsWithPattern(n,o,l,u,d,m){const p=new Array(4);let w=!1;const C=new Int32Array(m.length);for(;u<o;u+=qe.ROW_STEP){let D=qe.findGuardPattern(n,d,u,l,!1,m,C);if(D!=null){for(;u>0;){const P=qe.findGuardPattern(n,d,--u,l,!1,m,C);if(P!=null)D=P;else{u++;break}}p[0]=new Le(D[0],u),p[1]=new Le(D[1],u),w=!0;break}}let N=u+1;if(w){let D=0,P=Int32Array.from([Math.trunc(p[0].getX()),Math.trunc(p[1].getX())]);for(;N<o;N++){const G=qe.findGuardPattern(n,P[0],N,l,!1,m,C);if(G!=null&&Math.abs(P[0]-G[0])<qe.MAX_PATTERN_DRIFT&&Math.abs(P[1]-G[1])<qe.MAX_PATTERN_DRIFT)P=G,D=0;else{if(D>qe.SKIPPED_ROW_COUNT_MAX)break;D++}}N-=D+1,p[2]=new Le(P[0],N),p[3]=new Le(P[1],N)}return N-u<qe.BARCODE_MIN_HEIGHT&&Z.fill(p,null),p}static findGuardPattern(n,o,l,u,d,m,p){Z.fillWithin(p,0,p.length,0);let w=o,C=0;for(;n.get(w,l)&&w>0&&C++<qe.MAX_PIXEL_DRIFT;)w--;let N=w,D=0,P=m.length;for(let G=d;N<u;N++)if(n.get(N,l)!==G)p[D]++;else{if(D===P-1){if(qe.patternMatchVariance(p,m,qe.MAX_INDIVIDUAL_VARIANCE)<qe.MAX_AVG_VARIANCE)return new Int32Array([w,N]);w+=p[0]+p[1],I.arraycopy(p,2,p,0,D-1),p[D-1]=0,p[D]=0,D--}else D++;p[D]=1,G=!G}return D===P-1&&qe.patternMatchVariance(p,m,qe.MAX_INDIVIDUAL_VARIANCE)<qe.MAX_AVG_VARIANCE?new Int32Array([w,N-1]):null}static patternMatchVariance(n,o,l){let u=n.length,d=0,m=0;for(let C=0;C<u;C++)d+=n[C],m+=o[C];if(d<m)return 1/0;let p=d/m;l*=p;let w=0;for(let C=0;C<u;C++){let N=n[C],D=o[C]*p,P=N>D?N-D:D-N;if(P>l)return 1/0;w+=P}return w/d}}qe.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),qe.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),qe.MAX_AVG_VARIANCE=.42,qe.MAX_INDIVIDUAL_VARIANCE=.8,qe.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),qe.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),qe.MAX_PIXEL_DRIFT=3,qe.MAX_PATTERN_DRIFT=5,qe.SKIPPED_ROW_COUNT_MAX=25,qe.ROW_STEP=5,qe.BARCODE_MIN_HEIGHT=10;class Pt{constructor(n,o){if(o.length===0)throw new x;this.field=n;let l=o.length;if(l>1&&o[0]===0){let u=1;for(;u<l&&o[u]===0;)u++;u===l?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(l-u),I.arraycopy(o,u,this.coefficients,0,this.coefficients.length))}else this.coefficients=o}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);if(n===1){let u=0;for(let d of this.coefficients)u=this.field.add(u,d);return u}let o=this.coefficients[0],l=this.coefficients.length;for(let u=1;u<l;u++)o=this.field.add(this.field.multiply(n,o),this.coefficients[u]);return o}add(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");if(this.isZero())return n;if(n.isZero())return this;let o=this.coefficients,l=n.coefficients;if(o.length>l.length){let m=o;o=l,l=m}let u=new Int32Array(l.length),d=l.length-o.length;I.arraycopy(l,0,u,0,d);for(let m=d;m<l.length;m++)u[m]=this.field.add(o[m-d],l[m]);return new Pt(this.field,u)}subtract(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");return n.isZero()?this:this.add(n.negative())}multiply(n){return n instanceof Pt?this.multiplyOther(n):this.multiplyScalar(n)}multiplyOther(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");if(this.isZero()||n.isZero())return new Pt(this.field,new Int32Array([0]));let o=this.coefficients,l=o.length,u=n.coefficients,d=u.length,m=new Int32Array(l+d-1);for(let p=0;p<l;p++){let w=o[p];for(let C=0;C<d;C++)m[p+C]=this.field.add(m[p+C],this.field.multiply(w,u[C]))}return new Pt(this.field,m)}negative(){let n=this.coefficients.length,o=new Int32Array(n);for(let l=0;l<n;l++)o[l]=this.field.subtract(0,this.coefficients[l]);return new Pt(this.field,o)}multiplyScalar(n){if(n===0)return new Pt(this.field,new Int32Array([0]));if(n===1)return this;let o=this.coefficients.length,l=new Int32Array(o);for(let u=0;u<o;u++)l[u]=this.field.multiply(this.coefficients[u],n);return new Pt(this.field,l)}multiplyByMonomial(n,o){if(n<0)throw new x;if(o===0)return new Pt(this.field,new Int32Array([0]));let l=this.coefficients.length,u=new Int32Array(l+n);for(let d=0;d<l;d++)u[d]=this.field.multiply(this.coefficients[d],o);return new Pt(this.field,u)}toString(){let n=new pe;for(let o=this.getDegree();o>=0;o--){let l=this.getCoefficient(o);l!==0&&(l<0?(n.append(" - "),l=-l):n.length()>0&&n.append(" + "),(o===0||l!==1)&&n.append(l),o!==0&&(o===1?n.append("x"):(n.append("x^"),n.append(o))))}return n.toString()}}class js{add(n,o){return(n+o)%this.modulus}subtract(n,o){return(this.modulus+n-o)%this.modulus}exp(n){return this.expTable[n]}log(n){if(n===0)throw new x;return this.logTable[n]}inverse(n){if(n===0)throw new na;return this.expTable[this.modulus-this.logTable[n]-1]}multiply(n,o){return n===0||o===0?0:this.expTable[(this.logTable[n]+this.logTable[o])%(this.modulus-1)]}getSize(){return this.modulus}equals(n){return n===this}}class Si extends js{constructor(n,o){super(),this.modulus=n,this.expTable=new Int32Array(n),this.logTable=new Int32Array(n);let l=1;for(let u=0;u<n;u++)this.expTable[u]=l,l=l*o%n;for(let u=0;u<n-1;u++)this.logTable[this.expTable[u]]=u;this.zero=new Pt(this,new Int32Array([0])),this.one=new Pt(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,o){if(n<0)throw new x;if(o===0)return this.zero;let l=new Int32Array(n+1);return l[0]=o,new Pt(this,l)}}Si.PDF417_GF=new Si(Ge.NUMBER_OF_CODEWORDS,3);class ei{constructor(){this.field=Si.PDF417_GF}decode(n,o,l){let u=new Pt(this.field,n),d=new Int32Array(o),m=!1;for(let q=o;q>0;q--){let K=u.evaluateAt(this.field.exp(q));d[o-q]=K,K!==0&&(m=!0)}if(!m)return 0;let p=this.field.getOne();if(l!=null)for(const q of l){let K=this.field.exp(n.length-1-q),ie=new Pt(this.field,new Int32Array([this.field.subtract(0,K),1]));p=p.multiply(ie)}let w=new Pt(this.field,d),C=this.runEuclideanAlgorithm(this.field.buildMonomial(o,1),w,o),N=C[0],D=C[1],P=this.findErrorLocations(N),G=this.findErrorMagnitudes(D,N,P);for(let q=0;q<P.length;q++){let K=n.length-1-this.field.log(P[q]);if(K<0)throw R.getChecksumInstance();n[K]=this.field.subtract(n[K],G[q])}return P.length}runEuclideanAlgorithm(n,o,l){if(n.getDegree()<o.getDegree()){let P=n;n=o,o=P}let u=n,d=o,m=this.field.getZero(),p=this.field.getOne();for(;d.getDegree()>=Math.round(l/2);){let P=u,G=m;if(u=d,m=p,u.isZero())throw R.getChecksumInstance();d=P;let q=this.field.getZero(),K=u.getCoefficient(u.getDegree()),ie=this.field.inverse(K);for(;d.getDegree()>=u.getDegree()&&!d.isZero();){let he=d.getDegree()-u.getDegree(),Re=this.field.multiply(d.getCoefficient(d.getDegree()),ie);q=q.add(this.field.buildMonomial(he,Re)),d=d.subtract(u.multiplyByMonomial(he,Re))}p=q.multiply(m).subtract(G).negative()}let w=p.getCoefficient(0);if(w===0)throw R.getChecksumInstance();let C=this.field.inverse(w),N=p.multiply(C),D=d.multiply(C);return[N,D]}findErrorLocations(n){let o=n.getDegree(),l=new Int32Array(o),u=0;for(let d=1;d<this.field.getSize()&&u<o;d++)n.evaluateAt(d)===0&&(l[u]=this.field.inverse(d),u++);if(u!==o)throw R.getChecksumInstance();return l}findErrorMagnitudes(n,o,l){let u=o.getDegree(),d=new Int32Array(u);for(let C=1;C<=u;C++)d[u-C]=this.field.multiply(C,o.getCoefficient(C));let m=new Pt(this.field,d),p=l.length,w=new Int32Array(p);for(let C=0;C<p;C++){let N=this.field.inverse(l[C]),D=this.field.subtract(0,n.evaluateAt(N)),P=this.field.inverse(m.evaluateAt(N));w[C]=this.field.multiply(D,P)}return w}}class ti{constructor(n,o,l,u,d){n instanceof ti?this.constructor_2(n):this.constructor_1(n,o,l,u,d)}constructor_1(n,o,l,u,d){const m=o==null||l==null,p=u==null||d==null;if(m&&p)throw new re;m?(o=new Le(0,u.getY()),l=new Le(0,d.getY())):p&&(u=new Le(n.getWidth()-1,o.getY()),d=new Le(n.getWidth()-1,l.getY())),this.image=n,this.topLeft=o,this.bottomLeft=l,this.topRight=u,this.bottomRight=d,this.minX=Math.trunc(Math.min(o.getX(),l.getX())),this.maxX=Math.trunc(Math.max(u.getX(),d.getX())),this.minY=Math.trunc(Math.min(o.getY(),u.getY())),this.maxY=Math.trunc(Math.max(l.getY(),d.getY()))}constructor_2(n){this.image=n.image,this.topLeft=n.getTopLeft(),this.bottomLeft=n.getBottomLeft(),this.topRight=n.getTopRight(),this.bottomRight=n.getBottomRight(),this.minX=n.getMinX(),this.maxX=n.getMaxX(),this.minY=n.getMinY(),this.maxY=n.getMaxY()}static merge(n,o){return n==null?o:o==null?n:new ti(n.image,n.topLeft,n.bottomLeft,o.topRight,o.bottomRight)}addMissingRows(n,o,l){let u=this.topLeft,d=this.bottomLeft,m=this.topRight,p=this.bottomRight;if(n>0){let w=l?this.topLeft:this.topRight,C=Math.trunc(w.getY()-n);C<0&&(C=0);let N=new Le(w.getX(),C);l?u=N:m=N}if(o>0){let w=l?this.bottomLeft:this.bottomRight,C=Math.trunc(w.getY()+o);C>=this.image.getHeight()&&(C=this.image.getHeight()-1);let N=new Le(w.getX(),C);l?d=N:p=N}return new ti(this.image,u,d,m,p)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Do{constructor(n,o,l,u){this.columnCount=n,this.errorCorrectionLevel=u,this.rowCountUpperPart=o,this.rowCountLowerPart=l,this.rowCount=o+l}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class fa{constructor(){this.buffer=""}static form(n,o){let l=-1;function u(m,p,w,C,N,D){if(m==="%%")return"%";if(o[++l]===void 0)return;m=C?parseInt(C.substr(1)):void 0;let P=N?parseInt(N.substr(1)):void 0,G;switch(D){case"s":G=o[l];break;case"c":G=o[l][0];break;case"f":G=parseFloat(o[l]).toFixed(m);break;case"p":G=parseFloat(o[l]).toPrecision(m);break;case"e":G=parseFloat(o[l]).toExponential(m);break;case"x":G=parseInt(o[l]).toString(P||16);break;case"d":G=parseFloat(parseInt(o[l],P||10).toPrecision(m)).toFixed(0);break}G=typeof G=="object"?JSON.stringify(G):(+G).toString(P);let q=parseInt(w),K=w&&w[0]+""=="0"?"0":" ";for(;G.length<q;)G=p!==void 0?G+K:K+G;return G}let d=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(d,u)}format(n,...o){this.buffer+=fa.form(n,o)}toString(){return this.buffer}}class hi{constructor(n){this.boundingBox=new ti(n),this.codewords=new Array(n.getMaxY()-n.getMinY()+1)}getCodewordNearby(n){let o=this.getCodeword(n);if(o!=null)return o;for(let l=1;l<hi.MAX_NEARBY_DISTANCE;l++){let u=this.imageRowToCodewordIndex(n)-l;if(u>=0&&(o=this.codewords[u],o!=null)||(u=this.imageRowToCodewordIndex(n)+l,u<this.codewords.length&&(o=this.codewords[u],o!=null)))return o}return null}imageRowToCodewordIndex(n){return n-this.boundingBox.getMinY()}setCodeword(n,o){this.codewords[this.imageRowToCodewordIndex(n)]=o}getCodeword(n){return this.codewords[this.imageRowToCodewordIndex(n)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const n=new fa;let o=0;for(const l of this.codewords){if(l==null){n.format("%3d: | %n",o++);continue}n.format("%3d: %3d|%3d%n",o++,l.getRowNumber(),l.getValue())}return n.toString()}}hi.MAX_NEARBY_DISTANCE=5;class gi{constructor(){this.values=new Map}setValue(n){n=Math.trunc(n);let o=this.values.get(n);o==null&&(o=0),o++,this.values.set(n,o)}getValue(){let n=-1,o=new Array;for(const[l,u]of this.values.entries()){const d={getKey:()=>l,getValue:()=>u};d.getValue()>n?(n=d.getValue(),o=[],o.push(d.getKey())):d.getValue()===n&&o.push(d.getKey())}return Ge.toIntArray(o)}getConfidence(n){return this.values.get(n)}}class Vs extends hi{constructor(n,o){super(n),this._isLeft=o}setRowNumbers(){for(let n of this.getCodewords())n!=null&&n.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(n){let o=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(o,n);let l=this.getBoundingBox(),u=this._isLeft?l.getTopLeft():l.getTopRight(),d=this._isLeft?l.getBottomLeft():l.getBottomRight(),m=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.imageRowToCodewordIndex(Math.trunc(d.getY())),w=-1,C=1,N=0;for(let D=m;D<p;D++){if(o[D]==null)continue;let P=o[D],G=P.getRowNumber()-w;if(G===0)N++;else if(G===1)C=Math.max(C,N),N=1,w=P.getRowNumber();else if(G<0||P.getRowNumber()>=n.getRowCount()||G>D)o[D]=null;else{let q;C>2?q=(C-2)*G:q=G;let K=q>=D;for(let ie=1;ie<=q&&!K;ie++)K=o[D-ie]!=null;K?o[D]=null:(w=P.getRowNumber(),N=1)}}}getRowHeights(){let n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);let o=new Int32Array(n.getRowCount());for(let l of this.getCodewords())if(l!=null){let u=l.getRowNumber();if(u>=o.length)continue;o[u]++}return o}adjustIncompleteIndicatorColumnRowNumbers(n){let o=this.getBoundingBox(),l=this._isLeft?o.getTopLeft():o.getTopRight(),u=this._isLeft?o.getBottomLeft():o.getBottomRight(),d=this.imageRowToCodewordIndex(Math.trunc(l.getY())),m=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.getCodewords(),w=-1;for(let C=d;C<m;C++){if(p[C]==null)continue;let N=p[C];N.setRowNumberAsRowIndicatorColumn();let D=N.getRowNumber()-w;D===0||(D===1?w=N.getRowNumber():N.getRowNumber()>=n.getRowCount()?p[C]=null:w=N.getRowNumber())}}getBarcodeMetadata(){let n=this.getCodewords(),o=new gi,l=new gi,u=new gi,d=new gi;for(let p of n){if(p==null)continue;p.setRowNumberAsRowIndicatorColumn();let w=p.getValue()%30,C=p.getRowNumber();switch(this._isLeft||(C+=2),C%3){case 0:l.setValue(w*3+1);break;case 1:d.setValue(w/3),u.setValue(w%3);break;case 2:o.setValue(w+1);break}}if(o.getValue().length===0||l.getValue().length===0||u.getValue().length===0||d.getValue().length===0||o.getValue()[0]<1||l.getValue()[0]+u.getValue()[0]<Ge.MIN_ROWS_IN_BARCODE||l.getValue()[0]+u.getValue()[0]>Ge.MAX_ROWS_IN_BARCODE)return null;let m=new Do(o.getValue()[0],l.getValue()[0],u.getValue()[0],d.getValue()[0]);return this.removeIncorrectCodewords(n,m),m}removeIncorrectCodewords(n,o){for(let l=0;l<n.length;l++){let u=n[l];if(n[l]==null)continue;let d=u.getValue()%30,m=u.getRowNumber();if(m>o.getRowCount()){n[l]=null;continue}switch(this._isLeft||(m+=2),m%3){case 0:d*3+1!==o.getRowCountUpperPart()&&(n[l]=null);break;case 1:(Math.trunc(d/3)!==o.getErrorCorrectionLevel()||d%3!==o.getRowCountLowerPart())&&(n[l]=null);break;case 2:d+1!==o.getColumnCount()&&(n[l]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
|
|
235
|
+
`+super.toString()}}class vn{constructor(n,o){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=n,this.barcodeColumnCount=n.getColumnCount(),this.boundingBox=o,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let n=Ge.MAX_CODEWORDS_IN_BARCODE,o;do o=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n<o);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(n){n!=null&&n.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let n=this.adjustRowNumbersByRow();if(n===0)return 0;for(let o=1;o<this.barcodeColumnCount+1;o++){let l=this.detectionResultColumns[o].getCodewords();for(let u=0;u<l.length;u++)l[u]!=null&&(l[u].hasValidRowNumber()||this.adjustRowNumbers(o,u,l))}return n}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let n=this.detectionResultColumns[0].getCodewords(),o=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let l=0;l<n.length;l++)if(n[l]!=null&&o[l]!=null&&n[l].getRowNumber()===o[l].getRowNumber())for(let u=1;u<=this.barcodeColumnCount;u++){let d=this.detectionResultColumns[u].getCodewords()[l];d!=null&&(d.setRowNumber(n[l].getRowNumber()),d.hasValidRowNumber()||(this.detectionResultColumns[u].getCodewords()[l]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let n=0,o=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let l=0;l<o.length;l++){if(o[l]==null)continue;let u=o[l].getRowNumber(),d=0;for(let m=this.barcodeColumnCount+1;m>0&&d<this.ADJUST_ROW_NUMBER_SKIP;m--){let p=this.detectionResultColumns[m].getCodewords()[l];p!=null&&(d=vn.adjustRowNumberIfValid(u,d,p),p.hasValidRowNumber()||n++)}}return n}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let n=0,o=this.detectionResultColumns[0].getCodewords();for(let l=0;l<o.length;l++){if(o[l]==null)continue;let u=o[l].getRowNumber(),d=0;for(let m=1;m<this.barcodeColumnCount+1&&d<this.ADJUST_ROW_NUMBER_SKIP;m++){let p=this.detectionResultColumns[m].getCodewords()[l];p!=null&&(d=vn.adjustRowNumberIfValid(u,d,p),p.hasValidRowNumber()||n++)}}return n}static adjustRowNumberIfValid(n,o,l){return l==null||l.hasValidRowNumber()||(l.isValidRowNumber(n)?(l.setRowNumber(n),o=0):++o),o}adjustRowNumbers(n,o,l){if(!this.detectionResultColumns[n-1])return;let u=l[o],d=this.detectionResultColumns[n-1].getCodewords(),m=d;this.detectionResultColumns[n+1]!=null&&(m=this.detectionResultColumns[n+1].getCodewords());let p=new Array(14);p[2]=d[o],p[3]=m[o],o>0&&(p[0]=l[o-1],p[4]=d[o-1],p[5]=m[o-1]),o>1&&(p[8]=l[o-2],p[10]=d[o-2],p[11]=m[o-2]),o<l.length-1&&(p[1]=l[o+1],p[6]=d[o+1],p[7]=m[o+1]),o<l.length-2&&(p[9]=l[o+2],p[12]=d[o+2],p[13]=m[o+2]);for(let w of p)if(vn.adjustRowNumber(u,w))return}static adjustRowNumber(n,o){return o==null?!1:o.hasValidRowNumber()&&o.getBucket()===n.getBucket()?(n.setRowNumber(o.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(n){this.boundingBox=n}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(n,o){this.detectionResultColumns[n]=o}getDetectionResultColumn(n){return this.detectionResultColumns[n]}toString(){let n=this.detectionResultColumns[0];n==null&&(n=this.detectionResultColumns[this.barcodeColumnCount+1]);let o=new fa;for(let l=0;l<n.getCodewords().length;l++){o.format("CW %3d:",l);for(let u=0;u<this.barcodeColumnCount+2;u++){if(this.detectionResultColumns[u]==null){o.format(" | ");continue}let d=this.detectionResultColumns[u].getCodewords()[l];if(d==null){o.format(" | ");continue}o.format(" %3d|%3d",d.getRowNumber(),d.getValue())}o.format("%n")}return o.toString()}}class vr{constructor(n,o,l,u){this.rowNumber=vr.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(n),this.endX=Math.trunc(o),this.bucket=Math.trunc(l),this.value=Math.trunc(u)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(n){return n!==vr.BARCODE_ROW_UNKNOWN&&this.bucket===n%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(n){this.rowNumber=n}toString(){return this.rowNumber+"|"+this.value}}vr.BARCODE_ROW_UNKNOWN=-1;class Nn{static initialize(){for(let n=0;n<Ge.SYMBOL_TABLE.length;n++){let o=Ge.SYMBOL_TABLE[n],l=o&1;for(let u=0;u<Ge.BARS_IN_MODULE;u++){let d=0;for(;(o&1)===l;)d+=1,o>>=1;l=o&1,Nn.RATIOS_TABLE[n]||(Nn.RATIOS_TABLE[n]=new Array(Ge.BARS_IN_MODULE)),Nn.RATIOS_TABLE[n][Ge.BARS_IN_MODULE-u-1]=Math.fround(d/Ge.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(n){let o=Nn.getDecodedCodewordValue(Nn.sampleBitCounts(n));return o!==-1?o:Nn.getClosestDecodedValue(n)}static sampleBitCounts(n){let o=ot.sum(n),l=new Int32Array(Ge.BARS_IN_MODULE),u=0,d=0;for(let m=0;m<Ge.MODULES_IN_CODEWORD;m++){let p=o/(2*Ge.MODULES_IN_CODEWORD)+m*o/Ge.MODULES_IN_CODEWORD;d+n[u]<=p&&(d+=n[u],u++),l[u]++}return l}static getDecodedCodewordValue(n){let o=Nn.getBitValue(n);return Ge.getCodeword(o)===-1?-1:o}static getBitValue(n){let o=0;for(let l=0;l<n.length;l++)for(let u=0;u<n[l];u++)o=o<<1|(l%2===0?1:0);return Math.trunc(o)}static getClosestDecodedValue(n){let o=ot.sum(n),l=new Array(Ge.BARS_IN_MODULE);if(o>1)for(let m=0;m<l.length;m++)l[m]=Math.fround(n[m]/o);let u=ra.MAX_VALUE,d=-1;this.bSymbolTableReady||Nn.initialize();for(let m=0;m<Nn.RATIOS_TABLE.length;m++){let p=0,w=Nn.RATIOS_TABLE[m];for(let C=0;C<Ge.BARS_IN_MODULE;C++){let N=Math.fround(w[C]-l[C]);if(p+=Math.fround(N*N),p>=u)break}p<u&&(u=p,d=Ge.SYMBOL_TABLE[m])}return d}}Nn.bSymbolTableReady=!1,Nn.RATIOS_TABLE=new Array(Ge.SYMBOL_TABLE.length).map(M=>new Array(Ge.BARS_IN_MODULE));class da{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(n){this.segmentIndex=n}getFileId(){return this.fileId}setFileId(n){this.fileId=n}getOptionalData(){return this.optionalData}setOptionalData(n){this.optionalData=n}isLastSegment(){return this.lastSegment}setLastSegment(n){this.lastSegment=n}getSegmentCount(){return this.segmentCount}setSegmentCount(n){this.segmentCount=n}getSender(){return this.sender||null}setSender(n){this.sender=n}getAddressee(){return this.addressee||null}setAddressee(n){this.addressee=n}getFileName(){return this.fileName}setFileName(n){this.fileName=n}getFileSize(){return this.fileSize}setFileSize(n){this.fileSize=n}getChecksum(){return this.checksum}setChecksum(n){this.checksum=n}getTimestamp(){return this.timestamp}setTimestamp(n){this.timestamp=n}}class ac{static parseLong(n,o=void 0){return parseInt(n,o)}}class Bo extends b{}Bo.kind="NullPointerException";class Hs{writeBytes(n){this.writeBytesOffset(n,0,n.length)}writeBytesOffset(n,o,l){if(n==null)throw new Bo;if(o<0||o>n.length||l<0||o+l>n.length||o+l<0)throw new z;if(l===0)return;for(let u=0;u<l;u++)this.write(n[o+u])}flush(){}close(){}}class to extends b{}class Lo extends Hs{constructor(n=32){if(super(),this.count=0,n<0)throw new x("Negative initial size: "+n);this.buf=new Uint8Array(n)}ensureCapacity(n){n-this.buf.length>0&&this.grow(n)}grow(n){let l=this.buf.length<<1;if(l-n<0&&(l=n),l<0){if(n<0)throw new to;l=H.MAX_VALUE}this.buf=Z.copyOfUint8Array(this.buf,l)}write(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1}writeBytesOffset(n,o,l){if(o<0||o>n.length||l<0||o+l-n.length>0)throw new z;this.ensureCapacity(this.count+l),I.arraycopy(n,o,this.buf,this.count,l),this.count+=l}writeTo(n){n.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return Z.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(n){return new String(this.buf).toString()}toString_number(n){return new String(this.buf).toString()}close(){}}var At;(function(M){M[M.ALPHA=0]="ALPHA",M[M.LOWER=1]="LOWER",M[M.MIXED=2]="MIXED",M[M.PUNCT=3]="PUNCT",M[M.ALPHA_SHIFT=4]="ALPHA_SHIFT",M[M.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(At||(At={}));function oc(){if(typeof window<"u")return window.BigInt||null;if(typeof Qi<"u")return Qi.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ko;function mi(M){if(typeof ko>"u"&&(ko=oc()),ko===null)throw new Error("BigInt is not supported!");return ko(M)}function Gs(){let M=[];M[0]=mi(1);let n=mi(900);M[1]=n;for(let o=2;o<16;o++)M[o]=M[o-1]*n;return M}class ge{static decode(n,o){let l=new pe(""),u=Q.ISO8859_1;l.enableDecoding(u);let d=1,m=n[d++],p=new da;for(;d<n[0];){switch(m){case ge.TEXT_COMPACTION_MODE_LATCH:d=ge.textCompaction(n,d,l);break;case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:d=ge.byteCompaction(m,n,u,d,l);break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(n[d++]);break;case ge.NUMERIC_COMPACTION_MODE_LATCH:d=ge.numericCompaction(n,d,l);break;case ge.ECI_CHARSET:Q.getCharacterSetECIByValue(n[d++]);break;case ge.ECI_GENERAL_PURPOSE:d+=2;break;case ge.ECI_USER_DEFINED:d++;break;case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:d=ge.decodeMacroBlock(n,d,p);break;case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:throw new X;default:d--,d=ge.textCompaction(n,d,l);break}if(d<n.length)m=n[d++];else throw X.getFormatInstance()}if(l.length()===0)throw X.getFormatInstance();let w=new pt(null,l.toString(),null,o);return w.setOther(p),w}static decodeMacroBlock(n,o,l){if(o+ge.NUMBER_OF_SEQUENCE_CODEWORDS>n[0])throw X.getFormatInstance();let u=new Int32Array(ge.NUMBER_OF_SEQUENCE_CODEWORDS);for(let p=0;p<ge.NUMBER_OF_SEQUENCE_CODEWORDS;p++,o++)u[p]=n[o];l.setSegmentIndex(H.parseInt(ge.decodeBase900toBase10(u,ge.NUMBER_OF_SEQUENCE_CODEWORDS)));let d=new pe;o=ge.textCompaction(n,o,d),l.setFileId(d.toString());let m=-1;for(n[o]===ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(m=o+1);o<n[0];)switch(n[o]){case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(o++,n[o]){case ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let p=new pe;o=ge.textCompaction(n,o+1,p),l.setFileName(p.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let w=new pe;o=ge.textCompaction(n,o+1,w),l.setSender(w.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let C=new pe;o=ge.textCompaction(n,o+1,C),l.setAddressee(C.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let N=new pe;o=ge.numericCompaction(n,o+1,N),l.setSegmentCount(H.parseInt(N.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let D=new pe;o=ge.numericCompaction(n,o+1,D),l.setTimestamp(ac.parseLong(D.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let P=new pe;o=ge.numericCompaction(n,o+1,P),l.setChecksum(H.parseInt(P.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let G=new pe;o=ge.numericCompaction(n,o+1,G),l.setFileSize(ac.parseLong(G.toString()));break;default:throw X.getFormatInstance()}break;case ge.MACRO_PDF417_TERMINATOR:o++,l.setLastSegment(!0);break;default:throw X.getFormatInstance()}if(m!==-1){let p=o-m;l.isLastSegment()&&p--,l.setOptionalData(Z.copyOfRange(n,m,m+p))}return o}static textCompaction(n,o,l){let u=new Int32Array((n[0]-o)*2),d=new Int32Array((n[0]-o)*2),m=0,p=!1;for(;o<n[0]&&!p;){let w=n[o++];if(w<ge.TEXT_COMPACTION_MODE_LATCH)u[m]=w/30,u[m+1]=w%30,m+=2;else switch(w){case ge.TEXT_COMPACTION_MODE_LATCH:u[m++]=ge.TEXT_COMPACTION_MODE_LATCH;break;case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:o--,p=!0;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u[m]=ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,w=n[o++],d[m]=w,m++;break}}return ge.decodeTextCompaction(u,d,m,l),o}static decodeTextCompaction(n,o,l,u){let d=At.ALPHA,m=At.ALPHA,p=0;for(;p<l;){let w=n[p],C="";switch(d){case At.ALPHA:if(w<26)C=String.fromCharCode(65+w);else switch(w){case 26:C=" ";break;case ge.LL:d=At.LOWER;break;case ge.ML:d=At.MIXED;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.LOWER:if(w<26)C=String.fromCharCode(97+w);else switch(w){case 26:C=" ";break;case ge.AS:m=d,d=At.ALPHA_SHIFT;break;case ge.ML:d=At.MIXED;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.MIXED:if(w<ge.PL)C=ge.MIXED_CHARS[w];else switch(w){case ge.PL:d=At.PUNCT;break;case 26:C=" ";break;case ge.LL:d=At.LOWER;break;case ge.AL:d=At.ALPHA;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.PUNCT:if(w<ge.PAL)C=ge.PUNCT_CHARS[w];else switch(w){case ge.PAL:d=At.ALPHA;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.ALPHA_SHIFT:if(d=m,w<26)C=String.fromCharCode(65+w);else switch(w){case 26:C=" ";break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.PUNCT_SHIFT:if(d=m,w<ge.PAL)C=ge.PUNCT_CHARS[w];else switch(w){case ge.PAL:d=At.ALPHA;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break}C!==""&&u.append(C),p++}}static byteCompaction(n,o,l,u,d){let m=new Lo,p=0,w=0,C=!1;switch(n){case ge.BYTE_COMPACTION_MODE_LATCH:let N=new Int32Array(6),D=o[u++];for(;u<o[0]&&!C;)switch(N[p++]=D,w=900*w+D,D=o[u++],D){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:u--,C=!0;break;default:if(p%5===0&&p>0){for(let P=0;P<6;++P)m.write(Number(mi(w)>>mi(8*(5-P))));w=0,p=0}break}u===o[0]&&D<ge.TEXT_COMPACTION_MODE_LATCH&&(N[p++]=D);for(let P=0;P<p;P++)m.write(N[P]);break;case ge.BYTE_COMPACTION_MODE_LATCH_6:for(;u<o[0]&&!C;){let P=o[u++];if(P<ge.TEXT_COMPACTION_MODE_LATCH)p++,w=900*w+P;else switch(P){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:u--,C=!0;break}if(p%5===0&&p>0){for(let G=0;G<6;++G)m.write(Number(mi(w)>>mi(8*(5-G))));w=0,p=0}}break}return d.append(ue.decode(m.toByteArray(),l)),u}static numericCompaction(n,o,l){let u=0,d=!1,m=new Int32Array(ge.MAX_NUMERIC_CODEWORDS);for(;o<n[0]&&!d;){let p=n[o++];if(o===n[0]&&(d=!0),p<ge.TEXT_COMPACTION_MODE_LATCH)m[u]=p,u++;else switch(p){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:o--,d=!0;break}(u%ge.MAX_NUMERIC_CODEWORDS===0||p===ge.NUMERIC_COMPACTION_MODE_LATCH||d)&&u>0&&(l.append(ge.decodeBase900toBase10(m,u)),u=0)}return o}static decodeBase900toBase10(n,o){let l=mi(0);for(let d=0;d<o;d++)l+=ge.EXP900[o-d-1]*mi(n[d]);let u=l.toString();if(u.charAt(0)!=="1")throw new X;return u.substring(1)}}ge.TEXT_COMPACTION_MODE_LATCH=900,ge.BYTE_COMPACTION_MODE_LATCH=901,ge.NUMERIC_COMPACTION_MODE_LATCH=902,ge.BYTE_COMPACTION_MODE_LATCH_6=924,ge.ECI_USER_DEFINED=925,ge.ECI_GENERAL_PURPOSE=926,ge.ECI_CHARSET=927,ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,ge.MACRO_PDF417_TERMINATOR=922,ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,ge.MAX_NUMERIC_CODEWORDS=15,ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,ge.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,ge.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,ge.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,ge.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,ge.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,ge.PL=25,ge.LL=27,ge.AS=27,ge.ML=28,ge.AL=28,ge.PS=29,ge.PAL=29,ge.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
|
|
236
|
+
-.$/"|*()?{}'`,ge.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",ge.EXP900=oc()?Gs():[],ge.NUMBER_OF_SEQUENCE_CODEWORDS=2;class tt{constructor(){}static decode(n,o,l,u,d,m,p){let w=new ti(n,o,l,u,d),C=null,N=null,D;for(let q=!0;;q=!1){if(o!=null&&(C=tt.getRowIndicatorColumn(n,w,o,!0,m,p)),u!=null&&(N=tt.getRowIndicatorColumn(n,w,u,!1,m,p)),D=tt.merge(C,N),D==null)throw re.getNotFoundInstance();let K=D.getBoundingBox();if(q&&K!=null&&(K.getMinY()<w.getMinY()||K.getMaxY()>w.getMaxY()))w=K;else break}D.setBoundingBox(w);let P=D.getBarcodeColumnCount()+1;D.setDetectionResultColumn(0,C),D.setDetectionResultColumn(P,N);let G=C!=null;for(let q=1;q<=P;q++){let K=G?q:P-q;if(D.getDetectionResultColumn(K)!==void 0)continue;let ie;K===0||K===P?ie=new Vs(w,K===0):ie=new hi(w),D.setDetectionResultColumn(K,ie);let he=-1,Re=he;for(let Ae=w.getMinY();Ae<=w.getMaxY();Ae++){if(he=tt.getStartColumn(D,K,Ae,G),he<0||he>w.getMaxX()){if(Re===-1)continue;he=Re}let Ee=tt.detectCodeword(n,w.getMinX(),w.getMaxX(),G,he,Ae,m,p);Ee!=null&&(ie.setCodeword(Ae,Ee),Re=he,m=Math.min(m,Ee.getWidth()),p=Math.max(p,Ee.getWidth()))}}return tt.createDecoderResult(D)}static merge(n,o){if(n==null&&o==null)return null;let l=tt.getBarcodeMetadata(n,o);if(l==null)return null;let u=ti.merge(tt.adjustBoundingBox(n),tt.adjustBoundingBox(o));return new vn(l,u)}static adjustBoundingBox(n){if(n==null)return null;let o=n.getRowHeights();if(o==null)return null;let l=tt.getMax(o),u=0;for(let p of o)if(u+=l-p,p>0)break;let d=n.getCodewords();for(let p=0;u>0&&d[p]==null;p++)u--;let m=0;for(let p=o.length-1;p>=0&&(m+=l-o[p],!(o[p]>0));p--);for(let p=d.length-1;m>0&&d[p]==null;p--)m--;return n.getBoundingBox().addMissingRows(u,m,n.isLeft())}static getMax(n){let o=-1;for(let l of n)o=Math.max(o,l);return o}static getBarcodeMetadata(n,o){let l;if(n==null||(l=n.getBarcodeMetadata())==null)return o==null?null:o.getBarcodeMetadata();let u;return o==null||(u=o.getBarcodeMetadata())==null?l:l.getColumnCount()!==u.getColumnCount()&&l.getErrorCorrectionLevel()!==u.getErrorCorrectionLevel()&&l.getRowCount()!==u.getRowCount()?null:l}static getRowIndicatorColumn(n,o,l,u,d,m){let p=new Vs(o,u);for(let w=0;w<2;w++){let C=w===0?1:-1,N=Math.trunc(Math.trunc(l.getX()));for(let D=Math.trunc(Math.trunc(l.getY()));D<=o.getMaxY()&&D>=o.getMinY();D+=C){let P=tt.detectCodeword(n,0,n.getWidth(),u,N,D,d,m);P!=null&&(p.setCodeword(D,P),u?N=P.getStartX():N=P.getEndX())}}return p}static adjustCodewordCount(n,o){let l=o[0][1],u=l.getValue(),d=n.getBarcodeColumnCount()*n.getBarcodeRowCount()-tt.getNumberOfECCodeWords(n.getBarcodeECLevel());if(u.length===0){if(d<1||d>Ge.MAX_CODEWORDS_IN_BARCODE)throw re.getNotFoundInstance();l.setValue(d)}else u[0]!==d&&l.setValue(d)}static createDecoderResult(n){let o=tt.createBarcodeMatrix(n);tt.adjustCodewordCount(n,o);let l=new Array,u=new Int32Array(n.getBarcodeRowCount()*n.getBarcodeColumnCount()),d=[],m=new Array;for(let w=0;w<n.getBarcodeRowCount();w++)for(let C=0;C<n.getBarcodeColumnCount();C++){let N=o[w][C+1].getValue(),D=w*n.getBarcodeColumnCount()+C;N.length===0?l.push(D):N.length===1?u[D]=N[0]:(m.push(D),d.push(N))}let p=new Array(d.length);for(let w=0;w<p.length;w++)p[w]=d[w];return tt.createDecoderResultFromAmbiguousValues(n.getBarcodeECLevel(),u,Ge.toIntArray(l),Ge.toIntArray(m),p)}static createDecoderResultFromAmbiguousValues(n,o,l,u,d){let m=new Int32Array(u.length),p=100;for(;p-- >0;){for(let w=0;w<m.length;w++)o[u[w]]=d[w][m[w]];try{return tt.decodeCodewords(o,n,l)}catch(w){if(!(w instanceof R))throw w}if(m.length===0)throw R.getChecksumInstance();for(let w=0;w<m.length;w++)if(m[w]<d[w].length-1){m[w]++;break}else if(m[w]=0,w===m.length-1)throw R.getChecksumInstance()}throw R.getChecksumInstance()}static createBarcodeMatrix(n){let o=Array.from({length:n.getBarcodeRowCount()},()=>new Array(n.getBarcodeColumnCount()+2));for(let u=0;u<o.length;u++)for(let d=0;d<o[u].length;d++)o[u][d]=new gi;let l=0;for(let u of n.getDetectionResultColumns()){if(u!=null){for(let d of u.getCodewords())if(d!=null){let m=d.getRowNumber();if(m>=0){if(m>=o.length)continue;o[m][l].setValue(d.getValue())}}}l++}return o}static isValidBarcodeColumn(n,o){return o>=0&&o<=n.getBarcodeColumnCount()+1}static getStartColumn(n,o,l,u){let d=u?1:-1,m=null;if(tt.isValidBarcodeColumn(n,o-d)&&(m=n.getDetectionResultColumn(o-d).getCodeword(l)),m!=null)return u?m.getEndX():m.getStartX();if(m=n.getDetectionResultColumn(o).getCodewordNearby(l),m!=null)return u?m.getStartX():m.getEndX();if(tt.isValidBarcodeColumn(n,o-d)&&(m=n.getDetectionResultColumn(o-d).getCodewordNearby(l)),m!=null)return u?m.getEndX():m.getStartX();let p=0;for(;tt.isValidBarcodeColumn(n,o-d);){o-=d;for(let w of n.getDetectionResultColumn(o).getCodewords())if(w!=null)return(u?w.getEndX():w.getStartX())+d*p*(w.getEndX()-w.getStartX());p++}return u?n.getBoundingBox().getMinX():n.getBoundingBox().getMaxX()}static detectCodeword(n,o,l,u,d,m,p,w){d=tt.adjustCodewordStartColumn(n,o,l,u,d,m);let C=tt.getModuleBitCount(n,o,l,u,d,m);if(C==null)return null;let N,D=ot.sum(C);if(u)N=d+D;else{for(let q=0;q<C.length/2;q++){let K=C[q];C[q]=C[C.length-1-q],C[C.length-1-q]=K}N=d,d=N-D}if(!tt.checkCodewordSkew(D,p,w))return null;let P=Nn.getDecodedValue(C),G=Ge.getCodeword(P);return G===-1?null:new vr(d,N,tt.getCodewordBucketNumber(P),G)}static getModuleBitCount(n,o,l,u,d,m){let p=d,w=new Int32Array(8),C=0,N=u?1:-1,D=u;for(;(u?p<l:p>=o)&&C<w.length;)n.get(p,m)===D?(w[C]++,p+=N):(C++,D=!D);return C===w.length||p===(u?l:o)&&C===w.length-1?w:null}static getNumberOfECCodeWords(n){return 2<<n}static adjustCodewordStartColumn(n,o,l,u,d,m){let p=d,w=u?-1:1;for(let C=0;C<2;C++){for(;(u?p>=o:p<l)&&u===n.get(p,m);){if(Math.abs(d-p)>tt.CODEWORD_SKEW_SIZE)return d;p+=w}w=-w,u=!u}return p}static checkCodewordSkew(n,o,l){return o-tt.CODEWORD_SKEW_SIZE<=n&&n<=l+tt.CODEWORD_SKEW_SIZE}static decodeCodewords(n,o,l){if(n.length===0)throw X.getFormatInstance();let u=1<<o+1,d=tt.correctErrors(n,l,u);tt.verifyCodewordCount(n,u);let m=ge.decode(n,""+o);return m.setErrorsCorrected(d),m.setErasures(l.length),m}static correctErrors(n,o,l){if(o!=null&&o.length>l/2+tt.MAX_ERRORS||l<0||l>tt.MAX_EC_CODEWORDS)throw R.getChecksumInstance();return tt.errorCorrection.decode(n,l,o)}static verifyCodewordCount(n,o){if(n.length<4)throw X.getFormatInstance();let l=n[0];if(l>n.length)throw X.getFormatInstance();if(l===0)if(o<n.length)n[0]=n.length-o;else throw X.getFormatInstance()}static getBitCountForCodeword(n){let o=new Int32Array(8),l=0,u=o.length-1;for(;!((n&1)!==l&&(l=n&1,u--,u<0));)o[u]++,n>>=1;return o}static getCodewordBucketNumber(n){return n instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(n):this.getCodewordBucketNumber_number(n)}static getCodewordBucketNumber_number(n){return tt.getCodewordBucketNumber(tt.getBitCountForCodeword(n))}static getCodewordBucketNumber_Int32Array(n){return(n[0]-n[2]+n[4]-n[6]+9)%9}static toString(n){let o=new fa;for(let l=0;l<n.length;l++){o.format("Row %2d: ",l);for(let u=0;u<n[l].length;u++){let d=n[l][u];d.getValue().length===0?o.format(" ",null):o.format("%4d(%2d)",d.getValue()[0],d.getConfidence(d.getValue()[0]))}o.format("%n")}return o.toString()}}tt.CODEWORD_SKEW_SIZE=2,tt.MAX_ERRORS=3,tt.MAX_EC_CODEWORDS=512,tt.errorCorrection=new ei;class On{decode(n,o=null){let l=On.decode(n,o,!1);if(l==null||l.length===0||l[0]==null)throw re.getNotFoundInstance();return l[0]}decodeMultiple(n,o=null){try{return On.decode(n,o,!0)}catch(l){throw l instanceof X||l instanceof R?re.getNotFoundInstance():l}}static decode(n,o,l){const u=new Array,d=qe.detectMultiple(n,o,l);for(const m of d.getPoints()){const p=tt.decode(d.getBits(),m[4],m[5],m[6],m[7],On.getMinCodewordWidth(m),On.getMaxCodewordWidth(m)),w=new Ie(p.getText(),p.getRawBytes(),void 0,m,Te.PDF_417);w.putMetadata(Qe.ERROR_CORRECTION_LEVEL,p.getECLevel());const C=p.getOther();C!=null&&w.putMetadata(Qe.PDF417_EXTRA_METADATA,C),u.push(w)}return u.map(m=>m)}static getMaxWidth(n,o){return n==null||o==null?0:Math.trunc(Math.abs(n.getX()-o.getX()))}static getMinWidth(n,o){return n==null||o==null?H.MAX_VALUE:Math.trunc(Math.abs(n.getX()-o.getX()))}static getMaxCodewordWidth(n){return Math.floor(Math.max(Math.max(On.getMaxWidth(n[0],n[4]),On.getMaxWidth(n[6],n[2])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN),Math.max(On.getMaxWidth(n[1],n[5]),On.getMaxWidth(n[7],n[3])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(n){return Math.floor(Math.min(Math.min(On.getMinWidth(n[0],n[4]),On.getMinWidth(n[6],n[2])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN),Math.min(On.getMinWidth(n[1],n[5]),On.getMinWidth(n[7],n[3])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN)))}reset(){}}class zo extends b{}zo.kind="ReaderException";class sc{constructor(n,o){this.verbose=n===!0,o&&this.setHints(o)}decode(n,o){return o&&this.setHints(o),this.decodeInternal(n)}decodeWithState(n){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(n)}setHints(n){this.hints=n;const o=!s(n)&&n.get(ee.TRY_HARDER)===!0,l=s(n)?null:n.get(ee.POSSIBLE_FORMATS),u=new Array;if(!s(l)){const d=l.some(m=>m===Te.UPC_A||m===Te.UPC_E||m===Te.EAN_13||m===Te.EAN_8||m===Te.CODABAR||m===Te.CODE_39||m===Te.CODE_93||m===Te.CODE_128||m===Te.ITF||m===Te.RSS_14||m===Te.RSS_EXPANDED);d&&!o&&u.push(new xr(n,this.verbose)),l.includes(Te.QR_CODE)&&u.push(new $r),l.includes(Te.DATA_MATRIX)&&u.push(new Jr),l.includes(Te.AZTEC)&&u.push(new No),l.includes(Te.PDF_417)&&u.push(new On),d&&o&&u.push(new xr(n,this.verbose))}u.length===0&&(o||u.push(new xr(n,this.verbose)),u.push(new $r),u.push(new Jr),u.push(new No),u.push(new On),o&&u.push(new xr(n,this.verbose))),this.readers=u}reset(){if(this.readers!==null)for(const n of this.readers)n.reset()}decodeInternal(n){if(this.readers===null)throw new zo("No readers where selected, nothing can be read.");for(const o of this.readers)try{return o.decode(n,this.hints)}catch(l){if(l instanceof zo)continue}throw new re("No MultiFormat Readers were able to detect the code.")}}class lc extends Se{constructor(n=null,o=500){const l=new sc;l.setHints(n),super(l,o)}decodeBitmap(n){return this.reader.decodeWithState(n)}}class xf extends Se{constructor(n=500){super(new On,n)}}class yf extends Se{constructor(n=500){super(new $r,n)}}var Zs;(function(M){M[M.ERROR_CORRECTION=0]="ERROR_CORRECTION",M[M.CHARACTER_SET=1]="CHARACTER_SET",M[M.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",M[M.MIN_SIZE=3]="MIN_SIZE",M[M.MAX_SIZE=4]="MAX_SIZE",M[M.MARGIN=5]="MARGIN",M[M.PDF417_COMPACT=6]="PDF417_COMPACT",M[M.PDF417_COMPACTION=7]="PDF417_COMPACTION",M[M.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",M[M.AZTEC_LAYERS=9]="AZTEC_LAYERS",M[M.QR_VERSION=10]="QR_VERSION"})(Zs||(Zs={}));var gn=Zs;class no{constructor(n){this.field=n,this.cachedGenerators=[],this.cachedGenerators.push(new Sn(n,Int32Array.from([1])))}buildGenerator(n){const o=this.cachedGenerators;if(n>=o.length){let l=o[o.length-1];const u=this.field;for(let d=o.length;d<=n;d++){const m=l.multiply(new Sn(u,Int32Array.from([1,u.exp(d-1+u.getGeneratorBase())])));o.push(m),l=m}}return o[n]}encode(n,o){if(o===0)throw new x("No error correction bytes");const l=n.length-o;if(l<=0)throw new x("No data bytes provided");const u=this.buildGenerator(o),d=new Int32Array(l);I.arraycopy(n,0,d,0,l);let m=new Sn(this.field,d);m=m.multiplyByMonomial(o,1);const w=m.divide(u)[1].getCoefficients(),C=o-w.length;for(let N=0;N<C;N++)n[l+N]=0;I.arraycopy(w,0,n,l+C,w.length)}}class Qt{constructor(){}static applyMaskPenaltyRule1(n){return Qt.applyMaskPenaltyRule1Internal(n,!0)+Qt.applyMaskPenaltyRule1Internal(n,!1)}static applyMaskPenaltyRule2(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let m=0;m<d-1;m++){const p=l[m];for(let w=0;w<u-1;w++){const C=p[w];C===p[w+1]&&C===l[m+1][w]&&C===l[m+1][w+1]&&o++}}return Qt.N2*o}static applyMaskPenaltyRule3(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let m=0;m<d;m++)for(let p=0;p<u;p++){const w=l[m];p+6<u&&w[p]===1&&w[p+1]===0&&w[p+2]===1&&w[p+3]===1&&w[p+4]===1&&w[p+5]===0&&w[p+6]===1&&(Qt.isWhiteHorizontal(w,p-4,p)||Qt.isWhiteHorizontal(w,p+7,p+11))&&o++,m+6<d&&l[m][p]===1&&l[m+1][p]===0&&l[m+2][p]===1&&l[m+3][p]===1&&l[m+4][p]===1&&l[m+5][p]===0&&l[m+6][p]===1&&(Qt.isWhiteVertical(l,p,m-4,m)||Qt.isWhiteVertical(l,p,m+7,m+11))&&o++}return o*Qt.N3}static isWhiteHorizontal(n,o,l){o=Math.max(o,0),l=Math.min(l,n.length);for(let u=o;u<l;u++)if(n[u]===1)return!1;return!0}static isWhiteVertical(n,o,l,u){l=Math.max(l,0),u=Math.min(u,n.length);for(let d=l;d<u;d++)if(n[d][o]===1)return!1;return!0}static applyMaskPenaltyRule4(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let w=0;w<d;w++){const C=l[w];for(let N=0;N<u;N++)C[N]===1&&o++}const m=n.getHeight()*n.getWidth();return Math.floor(Math.abs(o*2-m)*10/m)*Qt.N4}static getDataMaskBit(n,o,l){let u,d;switch(n){case 0:u=l+o&1;break;case 1:u=l&1;break;case 2:u=o%3;break;case 3:u=(l+o)%3;break;case 4:u=Math.floor(l/2)+Math.floor(o/3)&1;break;case 5:d=l*o,u=(d&1)+d%3;break;case 6:d=l*o,u=(d&1)+d%3&1;break;case 7:d=l*o,u=d%3+(l+o&1)&1;break;default:throw new x("Invalid mask pattern: "+n)}return u===0}static applyMaskPenaltyRule1Internal(n,o){let l=0;const u=o?n.getHeight():n.getWidth(),d=o?n.getWidth():n.getHeight(),m=n.getArray();for(let p=0;p<u;p++){let w=0,C=-1;for(let N=0;N<d;N++){const D=o?m[p][N]:m[N][p];D===C?w++:(w>=5&&(l+=Qt.N1+(w-5)),w=1,C=D)}w>=5&&(l+=Qt.N1+(w-5))}return l}}Qt.N1=3,Qt.N2=3,Qt.N3=40,Qt.N4=10;class Po{constructor(n,o){this.width=n,this.height=o;const l=new Array(o);for(let u=0;u!==o;u++)l[u]=new Uint8Array(n);this.bytes=l}getHeight(){return this.height}getWidth(){return this.width}get(n,o){return this.bytes[o][n]}getArray(){return this.bytes}setNumber(n,o,l){this.bytes[o][n]=l}setBoolean(n,o,l){this.bytes[o][n]=l?1:0}clear(n){for(const o of this.bytes)Z.fill(o,n)}equals(n){if(!(n instanceof Po))return!1;const o=n;if(this.width!==o.width||this.height!==o.height)return!1;for(let l=0,u=this.height;l<u;++l){const d=this.bytes[l],m=o.bytes[l];for(let p=0,w=this.width;p<w;++p)if(d[p]!==m[p])return!1}return!0}toString(){const n=new pe;for(let o=0,l=this.height;o<l;++o){const u=this.bytes[o];for(let d=0,m=this.width;d<m;++d)switch(u[d]){case 0:n.append(" 0");break;case 1:n.append(" 1");break;default:n.append(" ");break}n.append(`
|
|
237
|
+
`)}return n.toString()}}class Ti{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const n=new pe;return n.append(`<<
|
|
238
|
+
`),n.append(" mode: "),n.append(this.mode?this.mode.toString():"null"),n.append(`
|
|
239
|
+
ecLevel: `),n.append(this.ecLevel?this.ecLevel.toString():"null"),n.append(`
|
|
240
|
+
version: `),n.append(this.version?this.version.toString():"null"),n.append(`
|
|
241
|
+
maskPattern: `),n.append(this.maskPattern.toString()),this.matrix?(n.append(`
|
|
242
|
+
matrix:
|
|
243
|
+
`),n.append(this.matrix.toString())):n.append(`
|
|
244
|
+
matrix: null
|
|
245
|
+
`),n.append(`>>
|
|
246
|
+
`),n.toString()}setMode(n){this.mode=n}setECLevel(n){this.ecLevel=n}setVersion(n){this.version=n}setMaskPattern(n){this.maskPattern=n}setMatrix(n){this.matrix=n}static isValidMaskPattern(n){return n>=0&&n<Ti.NUM_MASK_PATTERNS}}Ti.NUM_MASK_PATTERNS=8;class Tt extends b{}Tt.kind="WriterException";class Ze{constructor(){}static clearMatrix(n){n.clear(255)}static buildMatrix(n,o,l,u,d){Ze.clearMatrix(d),Ze.embedBasicPatterns(l,d),Ze.embedTypeInfo(o,u,d),Ze.maybeEmbedVersionInfo(l,d),Ze.embedDataBits(n,u,d)}static embedBasicPatterns(n,o){Ze.embedPositionDetectionPatternsAndSeparators(o),Ze.embedDarkDotAtLeftBottomCorner(o),Ze.maybeEmbedPositionAdjustmentPatterns(n,o),Ze.embedTimingPatterns(o)}static embedTypeInfo(n,o,l){const u=new j;Ze.makeTypeInfoBits(n,o,u);for(let d=0,m=u.getSize();d<m;++d){const p=u.get(u.getSize()-1-d),w=Ze.TYPE_INFO_COORDINATES[d],C=w[0],N=w[1];if(l.setBoolean(C,N,p),d<8){const D=l.getWidth()-d-1;l.setBoolean(D,8,p)}else{const P=l.getHeight()-7+(d-8);l.setBoolean(8,P,p)}}}static maybeEmbedVersionInfo(n,o){if(n.getVersionNumber()<7)return;const l=new j;Ze.makeVersionInfoBits(n,l);let u=17;for(let d=0;d<6;++d)for(let m=0;m<3;++m){const p=l.get(u);u--,o.setBoolean(d,o.getHeight()-11+m,p),o.setBoolean(o.getHeight()-11+m,d,p)}}static embedDataBits(n,o,l){let u=0,d=-1,m=l.getWidth()-1,p=l.getHeight()-1;for(;m>0;){for(m===6&&(m-=1);p>=0&&p<l.getHeight();){for(let w=0;w<2;++w){const C=m-w;if(!Ze.isEmpty(l.get(C,p)))continue;let N;u<n.getSize()?(N=n.get(u),++u):N=!1,o!==255&&Qt.getDataMaskBit(o,C,p)&&(N=!N),l.setBoolean(C,p,N)}p+=d}d=-d,p+=d,m-=2}if(u!==n.getSize())throw new Tt("Not all bits consumed: "+u+"/"+n.getSize())}static findMSBSet(n){return 32-H.numberOfLeadingZeros(n)}static calculateBCHCode(n,o){if(o===0)throw new x("0 polynomial");const l=Ze.findMSBSet(o);for(n<<=l-1;Ze.findMSBSet(n)>=l;)n^=o<<Ze.findMSBSet(n)-l;return n}static makeTypeInfoBits(n,o,l){if(!Ti.isValidMaskPattern(o))throw new Tt("Invalid mask pattern");const u=n.getBits()<<3|o;l.appendBits(u,5);const d=Ze.calculateBCHCode(u,Ze.TYPE_INFO_POLY);l.appendBits(d,10);const m=new j;if(m.appendBits(Ze.TYPE_INFO_MASK_PATTERN,15),l.xor(m),l.getSize()!==15)throw new Tt("should not happen but we got: "+l.getSize())}static makeVersionInfoBits(n,o){o.appendBits(n.getVersionNumber(),6);const l=Ze.calculateBCHCode(n.getVersionNumber(),Ze.VERSION_INFO_POLY);if(o.appendBits(l,12),o.getSize()!==18)throw new Tt("should not happen but we got: "+o.getSize())}static isEmpty(n){return n===255}static embedTimingPatterns(n){for(let o=8;o<n.getWidth()-8;++o){const l=(o+1)%2;Ze.isEmpty(n.get(o,6))&&n.setNumber(o,6,l),Ze.isEmpty(n.get(6,o))&&n.setNumber(6,o,l)}}static embedDarkDotAtLeftBottomCorner(n){if(n.get(8,n.getHeight()-8)===0)throw new Tt;n.setNumber(8,n.getHeight()-8,1)}static embedHorizontalSeparationPattern(n,o,l){for(let u=0;u<8;++u){if(!Ze.isEmpty(l.get(n+u,o)))throw new Tt;l.setNumber(n+u,o,0)}}static embedVerticalSeparationPattern(n,o,l){for(let u=0;u<7;++u){if(!Ze.isEmpty(l.get(n,o+u)))throw new Tt;l.setNumber(n,o+u,0)}}static embedPositionAdjustmentPattern(n,o,l){for(let u=0;u<5;++u){const d=Ze.POSITION_ADJUSTMENT_PATTERN[u];for(let m=0;m<5;++m)l.setNumber(n+m,o+u,d[m])}}static embedPositionDetectionPattern(n,o,l){for(let u=0;u<7;++u){const d=Ze.POSITION_DETECTION_PATTERN[u];for(let m=0;m<7;++m)l.setNumber(n+m,o+u,d[m])}}static embedPositionDetectionPatternsAndSeparators(n){const o=Ze.POSITION_DETECTION_PATTERN[0].length;Ze.embedPositionDetectionPattern(0,0,n),Ze.embedPositionDetectionPattern(n.getWidth()-o,0,n),Ze.embedPositionDetectionPattern(0,n.getWidth()-o,n);const l=8;Ze.embedHorizontalSeparationPattern(0,l-1,n),Ze.embedHorizontalSeparationPattern(n.getWidth()-l,l-1,n),Ze.embedHorizontalSeparationPattern(0,n.getWidth()-l,n);const u=7;Ze.embedVerticalSeparationPattern(u,0,n),Ze.embedVerticalSeparationPattern(n.getHeight()-u-1,0,n),Ze.embedVerticalSeparationPattern(u,n.getHeight()-u,n)}static maybeEmbedPositionAdjustmentPatterns(n,o){if(n.getVersionNumber()<2)return;const l=n.getVersionNumber()-1,u=Ze.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[l];for(let d=0,m=u.length;d!==m;d++){const p=u[d];if(p>=0)for(let w=0;w!==m;w++){const C=u[w];C>=0&&Ze.isEmpty(o.get(C,p))&&Ze.embedPositionAdjustmentPattern(C-2,p-2,o)}}}}Ze.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Ze.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Ze.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Ze.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Ze.VERSION_INFO_POLY=7973,Ze.TYPE_INFO_POLY=1335,Ze.TYPE_INFO_MASK_PATTERN=21522;class vf{constructor(n,o){this.dataBytes=n,this.errorCorrectionBytes=o}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Ut{constructor(){}static calculateMaskPenalty(n){return Qt.applyMaskPenaltyRule1(n)+Qt.applyMaskPenaltyRule2(n)+Qt.applyMaskPenaltyRule3(n)+Qt.applyMaskPenaltyRule4(n)}static encode(n,o,l=null){let u=Ut.DEFAULT_BYTE_MODE_ENCODING;const d=l!==null&&l.get(gn.CHARACTER_SET)!==void 0;d&&(u=l.get(gn.CHARACTER_SET).toString());const m=this.chooseMode(n,u),p=new j;if(m===Fe.BYTE&&(d||Ut.DEFAULT_BYTE_MODE_ENCODING!==u)){const Ae=Q.getCharacterSetECIByName(u);Ae!==void 0&&this.appendECI(Ae,p)}this.appendModeInfo(m,p);const w=new j;this.appendBytes(n,m,w,u);let C;if(l!==null&&l.get(gn.QR_VERSION)!==void 0){const Ae=Number.parseInt(l.get(gn.QR_VERSION).toString(),10);C=ze.getVersionForNumber(Ae);const Ee=this.calculateBitsNeeded(m,p,w,C);if(!this.willFit(Ee,C,o))throw new Tt("Data too big for requested version")}else C=this.recommendVersion(o,m,p,w);const N=new j;N.appendBitArray(p);const D=m===Fe.BYTE?w.getSizeInBytes():n.length;this.appendLengthInfo(D,C,m,N),N.appendBitArray(w);const P=C.getECBlocksForLevel(o),G=C.getTotalCodewords()-P.getTotalECCodewords();this.terminateBits(G,N);const q=this.interleaveWithECBytes(N,C.getTotalCodewords(),G,P.getNumBlocks()),K=new Ti;K.setECLevel(o),K.setMode(m),K.setVersion(C);const ie=C.getDimensionForVersion(),he=new Po(ie,ie),Re=this.chooseMaskPattern(q,o,C,he);return K.setMaskPattern(Re),Ze.buildMatrix(q,o,C,Re,he),K.setMatrix(he),K}static recommendVersion(n,o,l,u){const d=this.calculateBitsNeeded(o,l,u,ze.getVersionForNumber(1)),m=this.chooseVersion(d,n),p=this.calculateBitsNeeded(o,l,u,m);return this.chooseVersion(p,n)}static calculateBitsNeeded(n,o,l,u){return o.getSize()+n.getCharacterCountBits(u)+l.getSize()}static getAlphanumericCode(n){return n<Ut.ALPHANUMERIC_TABLE.length?Ut.ALPHANUMERIC_TABLE[n]:-1}static chooseMode(n,o=null){if(Q.SJIS.getName()===o&&this.isOnlyDoubleByteKanji(n))return Fe.KANJI;let l=!1,u=!1;for(let d=0,m=n.length;d<m;++d){const p=n.charAt(d);if(Ut.isDigit(p))l=!0;else if(this.getAlphanumericCode(p.charCodeAt(0))!==-1)u=!0;else return Fe.BYTE}return u?Fe.ALPHANUMERIC:l?Fe.NUMERIC:Fe.BYTE}static isOnlyDoubleByteKanji(n){let o;try{o=ue.encode(n,Q.SJIS)}catch{return!1}const l=o.length;if(l%2!==0)return!1;for(let u=0;u<l;u+=2){const d=o[u]&255;if((d<129||d>159)&&(d<224||d>235))return!1}return!0}static chooseMaskPattern(n,o,l,u){let d=Number.MAX_SAFE_INTEGER,m=-1;for(let p=0;p<Ti.NUM_MASK_PATTERNS;p++){Ze.buildMatrix(n,o,l,p,u);let w=this.calculateMaskPenalty(u);w<d&&(d=w,m=p)}return m}static chooseVersion(n,o){for(let l=1;l<=40;l++){const u=ze.getVersionForNumber(l);if(Ut.willFit(n,u,o))return u}throw new Tt("Data too big")}static willFit(n,o,l){const u=o.getTotalCodewords(),m=o.getECBlocksForLevel(l).getTotalECCodewords(),p=u-m,w=(n+7)/8;return p>=w}static terminateBits(n,o){const l=n*8;if(o.getSize()>l)throw new Tt("data bits cannot fit in the QR Code"+o.getSize()+" > "+l);for(let m=0;m<4&&o.getSize()<l;++m)o.appendBit(!1);const u=o.getSize()&7;if(u>0)for(let m=u;m<8;m++)o.appendBit(!1);const d=n-o.getSizeInBytes();for(let m=0;m<d;++m)o.appendBits((m&1)===0?236:17,8);if(o.getSize()!==l)throw new Tt("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(n,o,l,u,d,m){if(u>=l)throw new Tt("Block ID too large");const p=n%l,w=l-p,C=Math.floor(n/l),N=C+1,D=Math.floor(o/l),P=D+1,G=C-D,q=N-P;if(G!==q)throw new Tt("EC bytes mismatch");if(l!==w+p)throw new Tt("RS blocks mismatch");if(n!==(D+G)*w+(P+q)*p)throw new Tt("Total bytes mismatch");u<w?(d[0]=D,m[0]=G):(d[0]=P,m[0]=q)}static interleaveWithECBytes(n,o,l,u){if(n.getSizeInBytes()!==l)throw new Tt("Number of bits and data bytes does not match");let d=0,m=0,p=0;const w=new Array;for(let N=0;N<u;++N){const D=new Int32Array(1),P=new Int32Array(1);Ut.getNumDataBytesAndNumECBytesForBlockID(o,l,u,N,D,P);const G=D[0],q=new Uint8Array(G);n.toBytes(8*d,q,0,G);const K=Ut.generateECBytes(q,P[0]);w.push(new vf(q,K)),m=Math.max(m,G),p=Math.max(p,K.length),d+=D[0]}if(l!==d)throw new Tt("Data bytes does not match offset");const C=new j;for(let N=0;N<m;++N)for(const D of w){const P=D.getDataBytes();N<P.length&&C.appendBits(P[N],8)}for(let N=0;N<p;++N)for(const D of w){const P=D.getErrorCorrectionBytes();N<P.length&&C.appendBits(P[N],8)}if(o!==C.getSizeInBytes())throw new Tt("Interleaving error: "+o+" and "+C.getSizeInBytes()+" differ.");return C}static generateECBytes(n,o){const l=n.length,u=new Int32Array(l+o);for(let m=0;m<l;m++)u[m]=n[m]&255;new no(xt.QR_CODE_FIELD_256).encode(u,o);const d=new Uint8Array(o);for(let m=0;m<o;m++)d[m]=u[l+m];return d}static appendModeInfo(n,o){o.appendBits(n.getBits(),4)}static appendLengthInfo(n,o,l,u){const d=l.getCharacterCountBits(o);if(n>=1<<d)throw new Tt(n+" is bigger than "+((1<<d)-1));u.appendBits(n,d)}static appendBytes(n,o,l,u){switch(o){case Fe.NUMERIC:Ut.appendNumericBytes(n,l);break;case Fe.ALPHANUMERIC:Ut.appendAlphanumericBytes(n,l);break;case Fe.BYTE:Ut.append8BitBytes(n,l,u);break;case Fe.KANJI:Ut.appendKanjiBytes(n,l);break;default:throw new Tt("Invalid mode: "+o)}}static getDigit(n){return n.charCodeAt(0)-48}static isDigit(n){const o=Ut.getDigit(n);return o>=0&&o<=9}static appendNumericBytes(n,o){const l=n.length;let u=0;for(;u<l;){const d=Ut.getDigit(n.charAt(u));if(u+2<l){const m=Ut.getDigit(n.charAt(u+1)),p=Ut.getDigit(n.charAt(u+2));o.appendBits(d*100+m*10+p,10),u+=3}else if(u+1<l){const m=Ut.getDigit(n.charAt(u+1));o.appendBits(d*10+m,7),u+=2}else o.appendBits(d,4),u++}}static appendAlphanumericBytes(n,o){const l=n.length;let u=0;for(;u<l;){const d=Ut.getAlphanumericCode(n.charCodeAt(u));if(d===-1)throw new Tt;if(u+1<l){const m=Ut.getAlphanumericCode(n.charCodeAt(u+1));if(m===-1)throw new Tt;o.appendBits(d*45+m,11),u+=2}else o.appendBits(d,6),u++}}static append8BitBytes(n,o,l){let u;try{u=ue.encode(n,l)}catch(d){throw new Tt(d)}for(let d=0,m=u.length;d!==m;d++){const p=u[d];o.appendBits(p,8)}}static appendKanjiBytes(n,o){let l;try{l=ue.encode(n,Q.SJIS)}catch(d){throw new Tt(d)}const u=l.length;for(let d=0;d<u;d+=2){const m=l[d]&255,p=l[d+1]&255,w=m<<8&4294967295|p;let C=-1;if(w>=33088&&w<=40956?C=w-33088:w>=57408&&w<=60351&&(C=w-49472),C===-1)throw new Tt("Invalid byte sequence");const N=(C>>8)*192+(C&255);o.appendBits(N,13)}}static appendECI(n,o){o.appendBits(Fe.ECI.getBits(),4),o.appendBits(n.getValue(),8)}}Ut.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Ut.DEFAULT_BYTE_MODE_ENCODING=Q.UTF8.getName();class Ri{write(n,o,l,u=null){if(n.length===0)throw new x("Found empty contents");if(o<0||l<0)throw new x("Requested dimensions are too small: "+o+"x"+l);let d=at.L,m=Ri.QUIET_ZONE_SIZE;u!==null&&(u.get(gn.ERROR_CORRECTION)!==void 0&&(d=at.fromString(u.get(gn.ERROR_CORRECTION).toString())),u.get(gn.MARGIN)!==void 0&&(m=Number.parseInt(u.get(gn.MARGIN).toString(),10)));const p=Ut.encode(n,d,u);return this.renderResult(p,o,l,m)}writeToDom(n,o,l,u,d=null){typeof n=="string"&&(n=document.querySelector(n));const m=this.write(o,l,u,d);n&&n.appendChild(m)}renderResult(n,o,l,u){const d=n.getMatrix();if(d===null)throw new rr;const m=d.getWidth(),p=d.getHeight(),w=m+u*2,C=p+u*2,N=Math.max(o,w),D=Math.max(l,C),P=Math.min(Math.floor(N/w),Math.floor(D/C)),G=Math.floor((N-m*P)/2),q=Math.floor((D-p*P)/2),K=this.createSVGElement(N,D);for(let ie=0,he=q;ie<p;ie++,he+=P)for(let Re=0,Ae=G;Re<m;Re++,Ae+=P)if(d.get(Re,ie)===1){const Ee=this.createSvgRectElement(Ae,he,P,P);K.appendChild(Ee)}return K}createSVGElement(n,o){const l=document.createElementNS(Ri.SVG_NS,"svg");return l.setAttributeNS(null,"height",n.toString()),l.setAttributeNS(null,"width",o.toString()),l}createSvgRectElement(n,o,l,u){const d=document.createElementNS(Ri.SVG_NS,"rect");return d.setAttributeNS(null,"x",n.toString()),d.setAttributeNS(null,"y",o.toString()),d.setAttributeNS(null,"height",l.toString()),d.setAttributeNS(null,"width",u.toString()),d.setAttributeNS(null,"fill","#000000"),d}}Ri.QUIET_ZONE_SIZE=4,Ri.SVG_NS="http://www.w3.org/2000/svg";class ha{encode(n,o,l,u,d){if(n.length===0)throw new x("Found empty contents");if(o!==Te.QR_CODE)throw new x("Can only encode QR_CODE, but got "+o);if(l<0||u<0)throw new x(`Requested dimensions are too small: ${l}x${u}`);let m=at.L,p=ha.QUIET_ZONE_SIZE;d!==null&&(d.get(gn.ERROR_CORRECTION)!==void 0&&(m=at.fromString(d.get(gn.ERROR_CORRECTION).toString())),d.get(gn.MARGIN)!==void 0&&(p=Number.parseInt(d.get(gn.MARGIN).toString(),10)));const w=Ut.encode(n,m,d);return ha.renderResult(w,l,u,p)}static renderResult(n,o,l,u){const d=n.getMatrix();if(d===null)throw new rr;const m=d.getWidth(),p=d.getHeight(),w=m+u*2,C=p+u*2,N=Math.max(o,w),D=Math.max(l,C),P=Math.min(Math.floor(N/w),Math.floor(D/C)),G=Math.floor((N-m*P)/2),q=Math.floor((D-p*P)/2),K=new Ce(N,D);for(let ie=0,he=q;ie<p;ie++,he+=P)for(let Re=0,Ae=G;Re<m;Re++,Ae+=P)d.get(Re,ie)===1&&K.setRegion(Ae,he,P,P);return K}}ha.QUIET_ZONE_SIZE=4;class wf{encode(n,o,l,u,d){let m;switch(o){case Te.QR_CODE:m=new ha;break;default:throw new x("No encoder available for format "+o)}return m.encode(n,o,l,u,d)}}class Lr extends Me{constructor(n,o,l,u,d,m,p,w){if(super(m,p),this.yuvData=n,this.dataWidth=o,this.dataHeight=l,this.left=u,this.top=d,u+m>o||d+p>l)throw new x("Crop rectangle does not fit within image data.");w&&this.reverseHorizontal(m,p)}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth();(o==null||o.length<l)&&(o=new Uint8ClampedArray(l));const u=(n+this.top)*this.dataWidth+this.left;return I.arraycopy(this.yuvData,u,o,0,l),o}getMatrix(){const n=this.getWidth(),o=this.getHeight();if(n===this.dataWidth&&o===this.dataHeight)return this.yuvData;const l=n*o,u=new Uint8ClampedArray(l);let d=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return I.arraycopy(this.yuvData,d,u,0,l),u;for(let m=0;m<o;m++){const p=m*n;I.arraycopy(this.yuvData,d,u,p,n),d+=this.dataWidth}return u}isCropSupported(){return!0}crop(n,o,l,u){return new Lr(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+o,l,u,!1)}renderThumbnail(){const n=this.getWidth()/Lr.THUMBNAIL_SCALE_FACTOR,o=this.getHeight()/Lr.THUMBNAIL_SCALE_FACTOR,l=new Int32Array(n*o),u=this.yuvData;let d=this.top*this.dataWidth+this.left;for(let m=0;m<o;m++){const p=m*n;for(let w=0;w<n;w++){const C=u[d+w*Lr.THUMBNAIL_SCALE_FACTOR]&255;l[p+w]=4278190080|C*65793}d+=this.dataWidth*Lr.THUMBNAIL_SCALE_FACTOR}return l}getThumbnailWidth(){return this.getWidth()/Lr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Lr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(n,o){const l=this.yuvData;for(let u=0,d=this.top*this.dataWidth+this.left;u<o;u++,d+=this.dataWidth){const m=d+n/2;for(let p=d,w=d+n-1;p<m;p++,w--){const C=l[p];l[p]=l[w],l[w]=C}}}invert(){return new He(this)}}Lr.THUMBNAIL_SCALE_FACTOR=2;class Xs extends Me{constructor(n,o,l,u,d,m,p){if(super(o,l),this.dataWidth=u,this.dataHeight=d,this.left=m,this.top=p,n.BYTES_PER_ELEMENT===4){const w=o*l,C=new Uint8ClampedArray(w);for(let N=0;N<w;N++){const D=n[N],P=D>>16&255,G=D>>7&510,q=D&255;C[N]=(P+G+q)/4&255}this.luminances=C}else this.luminances=n;if(u===void 0&&(this.dataWidth=o),d===void 0&&(this.dataHeight=l),m===void 0&&(this.left=0),p===void 0&&(this.top=0),this.left+o>this.dataWidth||this.top+l>this.dataHeight)throw new x("Crop rectangle does not fit within image data.")}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth();(o==null||o.length<l)&&(o=new Uint8ClampedArray(l));const u=(n+this.top)*this.dataWidth+this.left;return I.arraycopy(this.luminances,u,o,0,l),o}getMatrix(){const n=this.getWidth(),o=this.getHeight();if(n===this.dataWidth&&o===this.dataHeight)return this.luminances;const l=n*o,u=new Uint8ClampedArray(l);let d=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return I.arraycopy(this.luminances,d,u,0,l),u;for(let m=0;m<o;m++){const p=m*n;I.arraycopy(this.luminances,d,u,p,n),d+=this.dataWidth}return u}isCropSupported(){return!0}crop(n,o,l,u){return new Xs(this.luminances,l,u,this.dataWidth,this.dataHeight,this.left+n,this.top+o)}invert(){return new He(this)}}class cc extends Q{static forName(n){return this.getCharacterSetECIByName(n)}}class ro{}ro.ISO_8859_1=Q.ISO8859_1;class ga{isCompact(){return this.compact}setCompact(n){this.compact=n}getSize(){return this.size}setSize(n){this.size=n}getLayers(){return this.layers}setLayers(n){this.layers=n}getCodeWords(){return this.codeWords}setCodeWords(n){this.codeWords=n}getMatrix(){return this.matrix}setMatrix(n){this.matrix=n}}class uc{static singletonList(n){return[n]}static min(n,o){return n.sort(o)[0]}}class fc{constructor(n){this.previous=n}getPrevious(){return this.previous}}class Ni extends fc{constructor(n,o,l){super(n),this.value=o,this.bitCount=l}appendTo(n,o){n.appendBits(this.value,this.bitCount)}add(n,o){return new Ni(this,n,o)}addBinaryShift(n,o){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Ni(this,n,o)}toString(){let n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+H.toBinaryString(n|1<<this.bitCount).substring(1)+">"}}class Uo extends Ni{constructor(n,o,l){super(n,0,0),this.binaryShiftStart=o,this.binaryShiftByteCount=l}appendTo(n,o){for(let l=0;l<this.binaryShiftByteCount;l++)(l===0||l===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):l===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(o[this.binaryShiftStart+l],8)}addBinaryShift(n,o){return new Uo(this,n,o)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function dc(M,n,o){return new Uo(M,n,o)}function ma(M,n,o){return new Ni(M,n,o)}const pa=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],pi=0,Fo=1,sr=2,Ys=3,wr=4,io=new Ni(null,0,0),Oi=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function bf(M){for(let n of M)Z.fill(n,-1);return M[pi][wr]=0,M[Fo][wr]=0,M[Fo][pi]=28,M[Ys][wr]=0,M[sr][wr]=0,M[sr][pi]=15,M}const ao=bf(Z.createInt32Array(6,6));class br{constructor(n,o,l,u){this.token=n,this.mode=o,this.binaryShiftByteCount=l,this.bitCount=u}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(n,o){let l=this.bitCount,u=this.token;if(n!==this.mode){let m=Oi[this.mode][n];u=ma(u,m&65535,m>>16),l+=m>>16}let d=n===sr?4:5;return u=ma(u,o,d),new br(u,n,0,l+d)}shiftAndAppend(n,o){let l=this.token,u=this.mode===sr?4:5;return l=ma(l,ao[this.mode][n],u),l=ma(l,o,5),new br(l,this.mode,0,this.bitCount+u+5)}addBinaryShiftChar(n){let o=this.token,l=this.mode,u=this.bitCount;if(this.mode===wr||this.mode===sr){let p=Oi[l][pi];o=ma(o,p&65535,p>>16),u+=p>>16,l=pi}let d=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,m=new br(o,l,this.binaryShiftByteCount+1,u+d);return m.binaryShiftByteCount===2078&&(m=m.endBinaryShift(n+1)),m}endBinaryShift(n){if(this.binaryShiftByteCount===0)return this;let o=this.token;return o=dc(o,n-this.binaryShiftByteCount,this.binaryShiftByteCount),new br(o,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(n){let o=this.bitCount+(Oi[this.mode][n.mode]>>16);return this.binaryShiftByteCount<n.binaryShiftByteCount?o+=br.calculateBinaryShiftCost(n)-br.calculateBinaryShiftCost(this):this.binaryShiftByteCount>n.binaryShiftByteCount&&n.binaryShiftByteCount>0&&(o+=10),o<=n.bitCount}toBitArray(n){let o=[];for(let u=this.endBinaryShift(n.length).token;u!==null;u=u.getPrevious())o.unshift(u);let l=new j;for(const u of o)u.appendTo(l,n);return l}toString(){return $.format("%s bits=%d bytes=%d",pa[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(n){return n.binaryShiftByteCount>62?21:n.binaryShiftByteCount>31?20:n.binaryShiftByteCount>0?10:0}}br.INITIAL_STATE=new br(io,pi,0,0);function hc(M){const n=$.getCharCode(" "),o=$.getCharCode("."),l=$.getCharCode(",");M[pi][n]=1;const u=$.getCharCode("Z"),d=$.getCharCode("A");for(let P=d;P<=u;P++)M[pi][P]=P-d+2;M[Fo][n]=1;const m=$.getCharCode("z"),p=$.getCharCode("a");for(let P=p;P<=m;P++)M[Fo][P]=P-p+2;M[sr][n]=1;const w=$.getCharCode("9"),C=$.getCharCode("0");for(let P=C;P<=w;P++)M[sr][P]=P-C+2;M[sr][l]=12,M[sr][o]=13;const N=["\0"," ","","","","","","","\x07","\b"," ",`
|
|
247
|
+
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let P=0;P<N.length;P++)M[Ys][$.getCharCode(N[P])]=P;const D=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let P=0;P<D.length;P++)$.getCharCode(D[P])>0&&(M[wr][$.getCharCode(D[P])]=P);return M}const oo=hc(Z.createInt32Array(5,256));class Ii{constructor(n){this.text=n}encode(){const n=$.getCharCode(" "),o=$.getCharCode(`
|
|
248
|
+
`);let l=uc.singletonList(br.INITIAL_STATE);for(let d=0;d<this.text.length;d++){let m,p=d+1<this.text.length?this.text[d+1]:0;switch(this.text[d]){case $.getCharCode("\r"):m=p===o?2:0;break;case $.getCharCode("."):m=p===n?3:0;break;case $.getCharCode(","):m=p===n?4:0;break;case $.getCharCode(":"):m=p===n?5:0;break;default:m=0}m>0?(l=Ii.updateStateListForPair(l,d,m),d++):l=this.updateStateListForChar(l,d)}return uc.min(l,(d,m)=>d.getBitCount()-m.getBitCount()).toBitArray(this.text)}updateStateListForChar(n,o){const l=[];for(let u of n)this.updateStateForChar(u,o,l);return Ii.simplifyStates(l)}updateStateForChar(n,o,l){let u=this.text[o]&255,d=oo[n.getMode()][u]>0,m=null;for(let p=0;p<=wr;p++){let w=oo[p][u];if(w>0){if(m==null&&(m=n.endBinaryShift(o)),!d||p===n.getMode()||p===sr){const C=m.latchAndAppend(p,w);l.push(C)}if(!d&&ao[n.getMode()][p]>=0){const C=m.shiftAndAppend(p,w);l.push(C)}}}if(n.getBinaryShiftByteCount()>0||oo[n.getMode()][u]===0){let p=n.addBinaryShiftChar(o);l.push(p)}}static updateStateListForPair(n,o,l){const u=[];for(let d of n)this.updateStateForPair(d,o,l,u);return this.simplifyStates(u)}static updateStateForPair(n,o,l,u){let d=n.endBinaryShift(o);if(u.push(d.latchAndAppend(wr,l)),n.getMode()!==wr&&u.push(d.shiftAndAppend(wr,l)),l===3||l===4){let m=d.latchAndAppend(sr,16-l).latchAndAppend(sr,1);u.push(m)}if(n.getBinaryShiftByteCount()>0){let m=n.addBinaryShiftChar(o).addBinaryShiftChar(o+1);u.push(m)}}static simplifyStates(n){let o=[];for(const l of n){let u=!0;for(const d of o){if(d.isBetterThanOrEqualTo(l)){u=!1;break}l.isBetterThanOrEqualTo(d)&&(o=o.filter(m=>m!==d))}u&&o.push(l)}return o}}class ft{constructor(){}static encodeBytes(n){return ft.encode(n,ft.DEFAULT_EC_PERCENT,ft.DEFAULT_AZTEC_LAYERS)}static encode(n,o,l){let u=new Ii(n).encode(),d=H.truncDivision(u.getSize()*o,100)+11,m=u.getSize()+d,p,w,C,N,D;if(l!==ft.DEFAULT_AZTEC_LAYERS){if(p=l<0,w=Math.abs(l),w>(p?ft.MAX_NB_BITS_COMPACT:ft.MAX_NB_BITS))throw new x($.format("Illegal value %s for layers",l));C=ft.totalBitsInLayer(w,p),N=ft.WORD_SIZE[w];let Ee=C-C%N;if(D=ft.stuffBits(u,N),D.getSize()+d>Ee)throw new x("Data to large for user specified layer");if(p&&D.getSize()>N*64)throw new x("Data to large for user specified layer")}else{N=0,D=null;for(let Ee=0;;Ee++){if(Ee>ft.MAX_NB_BITS)throw new x("Data too large for an Aztec code");if(p=Ee<=3,w=p?Ee+1:Ee,C=ft.totalBitsInLayer(w,p),m>C)continue;(D==null||N!==ft.WORD_SIZE[w])&&(N=ft.WORD_SIZE[w],D=ft.stuffBits(u,N));let it=C-C%N;if(!(p&&D.getSize()>N*64)&&D.getSize()+d<=it)break}}let P=ft.generateCheckWords(D,C,N),G=D.getSize()/N,q=ft.generateModeMessage(p,w,G),K=(p?11:14)+w*4,ie=new Int32Array(K),he;if(p){he=K;for(let Ee=0;Ee<ie.length;Ee++)ie[Ee]=Ee}else{he=K+1+2*H.truncDivision(H.truncDivision(K,2)-1,15);let Ee=H.truncDivision(K,2),it=H.truncDivision(he,2);for(let We=0;We<Ee;We++){let sn=We+H.truncDivision(We,15);ie[Ee-We-1]=it-sn-1,ie[Ee+We]=it+sn+1}}let Re=new Ce(he);for(let Ee=0,it=0;Ee<w;Ee++){let We=(w-Ee)*4+(p?9:12);for(let sn=0;sn<We;sn++){let lr=sn*2;for(let Un=0;Un<2;Un++)P.get(it+lr+Un)&&Re.set(ie[Ee*2+Un],ie[Ee*2+sn]),P.get(it+We*2+lr+Un)&&Re.set(ie[Ee*2+sn],ie[K-1-Ee*2-Un]),P.get(it+We*4+lr+Un)&&Re.set(ie[K-1-Ee*2-Un],ie[K-1-Ee*2-sn]),P.get(it+We*6+lr+Un)&&Re.set(ie[K-1-Ee*2-sn],ie[Ee*2+Un])}it+=We*8}if(ft.drawModeMessage(Re,p,he,q),p)ft.drawBullsEye(Re,H.truncDivision(he,2),5);else{ft.drawBullsEye(Re,H.truncDivision(he,2),7);for(let Ee=0,it=0;Ee<H.truncDivision(K,2)-1;Ee+=15,it+=16)for(let We=H.truncDivision(he,2)&1;We<he;We+=2)Re.set(H.truncDivision(he,2)-it,We),Re.set(H.truncDivision(he,2)+it,We),Re.set(We,H.truncDivision(he,2)-it),Re.set(We,H.truncDivision(he,2)+it)}let Ae=new ga;return Ae.setCompact(p),Ae.setSize(he),Ae.setLayers(w),Ae.setCodeWords(G),Ae.setMatrix(Re),Ae}static drawBullsEye(n,o,l){for(let u=0;u<l;u+=2)for(let d=o-u;d<=o+u;d++)n.set(d,o-u),n.set(d,o+u),n.set(o-u,d),n.set(o+u,d);n.set(o-l,o-l),n.set(o-l+1,o-l),n.set(o-l,o-l+1),n.set(o+l,o-l),n.set(o+l,o-l+1),n.set(o+l,o+l-1)}static generateModeMessage(n,o,l){let u=new j;return n?(u.appendBits(o-1,2),u.appendBits(l-1,6),u=ft.generateCheckWords(u,28,4)):(u.appendBits(o-1,5),u.appendBits(l-1,11),u=ft.generateCheckWords(u,40,4)),u}static drawModeMessage(n,o,l,u){let d=H.truncDivision(l,2);if(o)for(let m=0;m<7;m++){let p=d-3+m;u.get(m)&&n.set(p,d-5),u.get(m+7)&&n.set(d+5,p),u.get(20-m)&&n.set(p,d+5),u.get(27-m)&&n.set(d-5,p)}else for(let m=0;m<10;m++){let p=d-5+m+H.truncDivision(m,5);u.get(m)&&n.set(p,d-7),u.get(m+10)&&n.set(d+7,p),u.get(29-m)&&n.set(p,d+7),u.get(39-m)&&n.set(d-7,p)}}static generateCheckWords(n,o,l){let u=n.getSize()/l,d=new no(ft.getGF(l)),m=H.truncDivision(o,l),p=ft.bitsToWords(n,l,m);d.encode(p,m-u);let w=o%l,C=new j;C.appendBits(0,w);for(const N of Array.from(p))C.appendBits(N,l);return C}static bitsToWords(n,o,l){let u=new Int32Array(l),d,m;for(d=0,m=n.getSize()/o;d<m;d++){let p=0;for(let w=0;w<o;w++)p|=n.get(d*o+w)?1<<o-w-1:0;u[d]=p}return u}static getGF(n){switch(n){case 4:return xt.AZTEC_PARAM;case 6:return xt.AZTEC_DATA_6;case 8:return xt.AZTEC_DATA_8;case 10:return xt.AZTEC_DATA_10;case 12:return xt.AZTEC_DATA_12;default:throw new x("Unsupported word size "+n)}}static stuffBits(n,o){let l=new j,u=n.getSize(),d=(1<<o)-2;for(let m=0;m<u;m+=o){let p=0;for(let w=0;w<o;w++)(m+w>=u||n.get(m+w))&&(p|=1<<o-1-w);(p&d)===d?(l.appendBits(p&d,o),m--):(p&d)===0?(l.appendBits(p|1,o),m--):l.appendBits(p,o)}return l}static totalBitsInLayer(n,o){return((o?88:112)+16*n)*n}}ft.DEFAULT_EC_PERCENT=33,ft.DEFAULT_AZTEC_LAYERS=0,ft.MAX_NB_BITS=32,ft.MAX_NB_BITS_COMPACT=4,ft.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class so{encode(n,o,l,u){return this.encodeWithHints(n,o,l,u,null)}encodeWithHints(n,o,l,u,d){let m=ro.ISO_8859_1,p=ft.DEFAULT_EC_PERCENT,w=ft.DEFAULT_AZTEC_LAYERS;return d!=null&&(d.has(gn.CHARACTER_SET)&&(m=cc.forName(d.get(gn.CHARACTER_SET).toString())),d.has(gn.ERROR_CORRECTION)&&(p=H.parseInt(d.get(gn.ERROR_CORRECTION).toString())),d.has(gn.AZTEC_LAYERS)&&(w=H.parseInt(d.get(gn.AZTEC_LAYERS).toString()))),so.encodeLayers(n,o,l,u,m,p,w)}static encodeLayers(n,o,l,u,d,m,p){if(o!==Te.AZTEC)throw new x("Can only encode AZTEC, but got "+o);let w=ft.encode($.getBytes(n,d),m,p);return so.renderResult(w,l,u)}static renderResult(n,o,l){let u=n.getMatrix();if(u==null)throw new rr;let d=u.getWidth(),m=u.getHeight(),p=Math.max(o,d),w=Math.max(l,m),C=Math.min(p/d,w/m),N=(p-d*C)/2,D=(w-m*C)/2,P=new Ce(p,w);for(let G=0,q=D;G<m;G++,q+=C)for(let K=0,ie=N;K<d;K++,ie+=C)u.get(K,G)&&P.setRegion(ie,q,C,C);return P}}a.AbstractExpandedDecoder=dn,a.ArgumentException=T,a.ArithmeticException=na,a.AztecCode=ga,a.AztecCodeReader=No,a.AztecCodeWriter=so,a.AztecDecoder=Nt,a.AztecDetector=ks,a.AztecDetectorResult=$l,a.AztecEncoder=ft,a.AztecHighLevelEncoder=Ii,a.AztecPoint=zn,a.BarcodeFormat=Te,a.Binarizer=k,a.BinaryBitmap=S,a.BitArray=j,a.BitMatrix=Ce,a.BitSource=yr,a.BrowserAztecCodeReader=hf,a.BrowserBarcodeReader=gf,a.BrowserCodeReader=Se,a.BrowserDatamatrixCodeReader=Mo,a.BrowserMultiFormatReader=lc,a.BrowserPDF417Reader=xf,a.BrowserQRCodeReader=yf,a.BrowserQRCodeSvgWriter=Ri,a.CharacterSetECI=Q,a.ChecksumException=R,a.Code128Reader=Ne,a.Code39Reader=Dt,a.DataMatrixDecodedBitStreamParser=Qr,a.DataMatrixReader=Jr,a.DecodeHintType=ee,a.DecoderResult=pt,a.DefaultGridSampler=Ls,a.DetectorResult=Ro,a.EAN13Reader=Ir,a.EncodeHintType=gn,a.Exception=b,a.FormatException=X,a.GenericGF=xt,a.GenericGFPoly=Sn,a.GlobalHistogramBinarizer=ne,a.GridSampler=Bs,a.GridSamplerInstance=mr,a.HTMLCanvasElementLuminanceSource=Ye,a.HybridBinarizer=xe,a.ITFReader=et,a.IllegalArgumentException=x,a.IllegalStateException=rr,a.InvertedLuminanceSource=He,a.LuminanceSource=Me,a.MathUtils=ot,a.MultiFormatOneDReader=xr,a.MultiFormatReader=sc,a.MultiFormatWriter=wf,a.NotFoundException=re,a.OneDReader=jt,a.PDF417DecodedBitStreamParser=ge,a.PDF417DecoderErrorCorrection=ei,a.PDF417Reader=On,a.PDF417ResultMetadata=da,a.PerspectiveTransform=ir,a.PlanarYUVLuminanceSource=Lr,a.QRCodeByteMatrix=Po,a.QRCodeDataMask=Qn,a.QRCodeDecodedBitStreamParser=zt,a.QRCodeDecoderErrorCorrectionLevel=at,a.QRCodeDecoderFormatInformation=yn,a.QRCodeEncoder=Ut,a.QRCodeEncoderQRCode=Ti,a.QRCodeMaskUtil=Qt,a.QRCodeMatrixUtil=Ze,a.QRCodeMode=Fe,a.QRCodeReader=$r,a.QRCodeVersion=ze,a.QRCodeWriter=ha,a.RGBLuminanceSource=Xs,a.RSS14Reader=St,a.RSSExpandedReader=_e,a.ReaderException=zo,a.ReedSolomonDecoder=Ci,a.ReedSolomonEncoder=no,a.ReedSolomonException=nr,a.Result=Ie,a.ResultMetadataType=Qe,a.ResultPoint=Le,a.StringUtils=$,a.UnsupportedOperationException=Oe,a.VideoInputDevice=W,a.WhiteRectangleDetector=en,a.WriterException=Tt,a.ZXingArrays=Z,a.ZXingCharset=cc,a.ZXingInteger=H,a.ZXingStandardCharsets=ro,a.ZXingStringBuilder=pe,a.ZXingStringEncoding=ue,a.ZXingSystem=I,a.createAbstractExpandedDecoder=aa,Object.defineProperty(a,"__esModule",{value:!0})}))})(zl,zl.exports)),zl.exports}var qt=r8();const i8=Qu(qt),a8=gx({__proto__:null,default:i8},[qt]);var z2=(function(){function e(r,a,s){if(this.formatMap=new Map([[Be.QR_CODE,qt.BarcodeFormat.QR_CODE],[Be.AZTEC,qt.BarcodeFormat.AZTEC],[Be.CODABAR,qt.BarcodeFormat.CODABAR],[Be.CODE_39,qt.BarcodeFormat.CODE_39],[Be.CODE_93,qt.BarcodeFormat.CODE_93],[Be.CODE_128,qt.BarcodeFormat.CODE_128],[Be.DATA_MATRIX,qt.BarcodeFormat.DATA_MATRIX],[Be.MAXICODE,qt.BarcodeFormat.MAXICODE],[Be.ITF,qt.BarcodeFormat.ITF],[Be.EAN_13,qt.BarcodeFormat.EAN_13],[Be.EAN_8,qt.BarcodeFormat.EAN_8],[Be.PDF_417,qt.BarcodeFormat.PDF_417],[Be.RSS_14,qt.BarcodeFormat.RSS_14],[Be.RSS_EXPANDED,qt.BarcodeFormat.RSS_EXPANDED],[Be.UPC_A,qt.BarcodeFormat.UPC_A],[Be.UPC_E,qt.BarcodeFormat.UPC_E],[Be.UPC_EAN_EXTENSION,qt.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!a8)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=a,this.logger=s;var f=this.createZXingFormats(r),g=new Map;g.set(qt.DecodeHintType.POSSIBLE_FORMATS,f),g.set(qt.DecodeHintType.TRY_HARDER,!1),this.hints=g}return e.prototype.decodeAsync=function(r){var a=this;return new Promise(function(s,f){try{s(a.decode(r))}catch(g){f(g)}})},e.prototype.decode=function(r){var a=new qt.MultiFormatReader(this.verbose,this.hints),s=new qt.HTMLCanvasElementLuminanceSource(r),f=new qt.BinaryBitmap(new qt.HybridBinarizer(s)),g=a.decode(f);return{text:g.text,format:Lv.create(this.toHtml5QrcodeSupportedFormats(g.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var r=new Map;return this.formatMap.forEach(function(a,s,f){r.set(a,s)}),r},e.prototype.toHtml5QrcodeSupportedFormats=function(r){if(!this.reverseFormatMap.has(r))throw"reverseFormatMap doesn't have ".concat(r);return this.reverseFormatMap.get(r)},e.prototype.createZXingFormats=function(r){for(var a=[],s=0,f=r;s<f.length;s++){var g=f[s];this.formatMap.has(g)?a.push(this.formatMap.get(g)):this.logger.logError("".concat(g," is not supported by")+"ZXingHtml5QrcodeShim")}return a},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e})(),o8=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},s8=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},P2=(function(){function e(r,a,s){if(this.formatMap=new Map([[Be.QR_CODE,"qr_code"],[Be.AZTEC,"aztec"],[Be.CODABAR,"codabar"],[Be.CODE_39,"code_39"],[Be.CODE_93,"code_93"],[Be.CODE_128,"code_128"],[Be.DATA_MATRIX,"data_matrix"],[Be.ITF,"itf"],[Be.EAN_13,"ean_13"],[Be.EAN_8,"ean_8"],[Be.PDF_417,"pdf417"],[Be.UPC_A,"upc_a"],[Be.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=a,this.logger=s;var f=this.createBarcodeDetectorFormats(r);if(this.detector=new BarcodeDetector(f),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var r=new BarcodeDetector({formats:["qr_code"]});return typeof r<"u"},e.prototype.decodeAsync=function(r){return o8(this,void 0,void 0,function(){var a,s;return s8(this,function(f){switch(f.label){case 0:return[4,this.detector.detect(r)];case 1:if(a=f.sent(),!a||a.length===0)throw"No barcode or QR code detected.";return s=this.selectLargestBarcode(a),[2,{text:s.rawValue,format:Lv.create(this.toHtml5QrcodeSupportedFormats(s.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(r){for(var a=null,s=0,f=0,g=r;f<g.length;f++){var y=g[f],E=y.boundingBox.width*y.boundingBox.height;E>s&&(s=E,a=y)}if(!a)throw"No largest barcode found";return a},e.prototype.createBarcodeDetectorFormats=function(r){for(var a=[],s=0,f=r;s<f.length;s++){var g=f[s];this.formatMap.has(g)?a.push(this.formatMap.get(g)):this.logger.warn("".concat(g," is not supported by")+"BarcodeDetectorDelegate")}return{formats:a}},e.prototype.toHtml5QrcodeSupportedFormats=function(r){if(!this.reverseFormatMap.has(r))throw"reverseFormatMap doesn't have ".concat(r);return this.reverseFormatMap.get(r)},e.prototype.createReverseFormatMap=function(){var r=new Map;return this.formatMap.forEach(function(a,s,f){r.set(a,s)}),r},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e})(),U2=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},F2=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},l8=(function(){function e(r,a,s,f){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=s,a&&P2.isSupported()?(this.primaryDecoder=new P2(r,s,f),this.secondaryDecoder=new z2(r,s,f)):this.primaryDecoder=new z2(r,s,f)}return e.prototype.decodeAsync=function(r){return U2(this,void 0,void 0,function(){var a;return F2(this,function(s){switch(s.label){case 0:a=performance.now(),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(r)];case 2:return[2,s.sent()];case 3:return this.possiblyLogPerformance(a),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(r){return U2(this,void 0,void 0,function(){var a,s;return F2(this,function(f){switch(f.label){case 0:a=performance.now(),f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(r)];case 2:return[2,f.sent()];case 3:if(s=f.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(r)];throw s;case 4:return this.possiblyLogPerformance(a),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(r){if(this.verbose){var a=performance.now()-r;this.executionResults.push(a),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var r=0,a=0,s=this.executionResults;a<s.length;a++){var f=s[a];r+=f}var g=r/this.executionResults.length;console.log("".concat(g," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e})(),e1=(function(){var e=function(r,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(s[g]=f[g])},e(r,a)};return function(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(r,a);function s(){this.constructor=r}r.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),Zu=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},Xu=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},zv=(function(){function e(r,a){this.name=r,this.track=a}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(r){var a={};a[this.name]=r;var s={advanced:[a]};return this.track.applyConstraints(s)},e.prototype.value=function(){var r=this.track.getSettings();if(this.name in r){var a=r[this.name];return a}return null},e})(),c8=(function(e){e1(r,e);function r(a,s){return e.call(this,a,s)||this}return r.prototype.min=function(){return this.getCapabilities().min},r.prototype.max=function(){return this.getCapabilities().max},r.prototype.step=function(){return this.getCapabilities().step},r.prototype.apply=function(a){var s={};s[this.name]=a;var f={advanced:[s]};return this.track.applyConstraints(f)},r.prototype.getCapabilities=function(){this.failIfNotSupported();var a=this.track.getCapabilities(),s=a[this.name];return{min:s.min,max:s.max,step:s.step}},r.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},r})(zv),u8=(function(e){e1(r,e);function r(a){return e.call(this,"zoom",a)||this}return r})(c8),f8=(function(e){e1(r,e);function r(a){return e.call(this,"torch",a)||this}return r})(zv),d8=(function(){function e(r){this.track=r}return e.prototype.zoomFeature=function(){return new u8(this.track)},e.prototype.torchFeature=function(){return new f8(this.track)},e})(),h8=(function(){function e(r,a,s){this.isClosed=!1,this.parentElement=r,this.mediaStream=a,this.callbacks=s,this.surface=this.createVideoElement(this.parentElement.clientWidth),r.append(this.surface)}return e.prototype.createVideoElement=function(r){var a=document.createElement("video");return a.style.width="".concat(r,"px"),a.style.display="block",a.muted=!0,a.setAttribute("muted","true"),a.playsInline=!0,a},e.prototype.setupSurface=function(){var r=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var a=function(){var s=r.surface.clientWidth,f=r.surface.clientHeight;r.callbacks.onRenderSurfaceReady(s,f),r.surface.removeEventListener("playing",a)};this.surface.addEventListener("playing",a),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(r,a,s,f){return Zu(this,void 0,void 0,function(){var g,y;return Xu(this,function(E){switch(E.label){case 0:return g=new e(r,a,f),s.aspectRatio?(y={aspectRatio:s.aspectRatio},[4,g.getFirstTrackOrFail().applyConstraints(y)]):[3,2];case 1:E.sent(),E.label=2;case 2:return g.setupSurface(),[2,g]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(r){this.failIfClosed();var a=this,s=function(){setTimeout(r,200),a.surface.removeEventListener("playing",s)};this.surface.addEventListener("playing",s),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(r){return Zu(this,void 0,void 0,function(){return Xu(this,function(a){if("aspectRatio"in r)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(r)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var r=this;return new Promise(function(a,s){var f=r.mediaStream.getVideoTracks(),g=f.length,y=0;r.mediaStream.getVideoTracks().forEach(function(E){r.mediaStream.removeTrack(E),E.stop(),++y,y>=g&&(r.isClosed=!0,r.parentElement.removeChild(r.surface),a())})})},e.prototype.getCapabilities=function(){return new d8(this.getFirstTrackOrFail())},e})(),g8=(function(){function e(r){this.mediaStream=r}return e.prototype.render=function(r,a,s){return Zu(this,void 0,void 0,function(){return Xu(this,function(f){return[2,h8.create(r,this.mediaStream,a,s)]})})},e.create=function(r){return Zu(this,void 0,void 0,function(){var a,s;return Xu(this,function(f){switch(f.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return a={audio:!1,video:r},[4,navigator.mediaDevices.getUserMedia(a)];case 1:return s=f.sent(),[2,new e(s)]}})})},e})(),j2=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},V2=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},m8=(function(){function e(){}return e.failIfNotSupported=function(){return j2(this,void 0,void 0,function(){return V2(this,function(r){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(r){return j2(this,void 0,void 0,function(){return V2(this,function(a){return[2,g8.create(r)]})})},e})(),p8=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},x8=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},y8=(function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var r=MediaStreamTrack;return MediaStreamTrack&&r.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var r=ys.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(r=ys.insecureContextCameraQueryError()),Promise.reject(r)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var r=location.host.split(":")[0];return r==="127.0.0.1"||r==="localhost"},e.getCamerasFromMediaDevices=function(){return p8(this,void 0,void 0,function(){var r,a,s,f,g,y,E;return x8(this,function(A){switch(A.label){case 0:return r=function(b){for(var T=b.getVideoTracks(),x=0,S=T;x<S.length;x++){var R=S[x];R.enabled=!1,R.stop(),b.removeTrack(R)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return a=A.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(s=A.sent(),f=[],g=0,y=s;g<y.length;g++)E=y[g],E.kind==="videoinput"&&f.push({id:E.deviceId,label:E.label});return r(a),[2,f]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(r,a){var s=function(g){for(var y=[],E=0,A=g;E<A.length;E++){var b=A[E];b.kind==="video"&&y.push({id:b.id,label:b.label})}r(y)},f=MediaStreamTrack;f.getSources(s)})},e})(),un;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(un||(un={}));var v8=(function(){function e(){this.state=un.NOT_STARTED,this.onGoingTransactionNewState=un.UNKNOWN}return e.prototype.directTransition=function(r){this.failIfTransitionOngoing(),this.validateTransition(r),this.state=r},e.prototype.startTransition=function(r){return this.failIfTransitionOngoing(),this.validateTransition(r),this.onGoingTransactionNewState=r,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===un.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var r=this.onGoingTransactionNewState;this.onGoingTransactionNewState=un.UNKNOWN,this.directTransition(r)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===un.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=un.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==un.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(r){switch(this.state){case un.UNKNOWN:throw"Transition from unknown is not allowed";case un.NOT_STARTED:this.failIfNewStateIs(r,[un.PAUSED]);break;case un.SCANNING:break;case un.PAUSED:break}},e.prototype.failIfNewStateIs=function(r,a){for(var s=0,f=a;s<f.length;s++){var g=f[s];if(r===g)throw"Cannot transition from ".concat(this.state," to ").concat(r)}},e})(),w8=(function(){function e(r){this.stateManager=r}return e.prototype.startTransition=function(r){return this.stateManager.startTransition(r)},e.prototype.directTransition=function(r){this.stateManager.directTransition(r)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===un.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==un.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===un.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===un.PAUSED},e})(),b8=(function(){function e(){}return e.create=function(){return new w8(new v8)},e})(),_8=(function(){var e=function(r,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(s[g]=f[g])},e(r,a)};return function(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(r,a);function s(){this.constructor=r}r.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),Rr=(function(e){_8(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.DEFAULT_WIDTH=300,r.DEFAULT_WIDTH_OFFSET=2,r.FILE_SCAN_MIN_HEIGHT=300,r.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,r.MIN_QR_BOX_SIZE=50,r.SHADED_LEFT=1,r.SHADED_RIGHT=2,r.SHADED_TOP=3,r.SHADED_BOTTOM=4,r.SHADED_REGION_ELEMENT_ID="qr-shaded-region",r.VERBOSE=!1,r.BORDER_SHADER_DEFAULT_COLOR="#ffffff",r.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",r})($4),E8=(function(){function e(r,a){this.logger=a,this.fps=Rr.SCAN_DEFAULT_FPS,r?(r.fps&&(this.fps=r.fps),this.disableFlip=r.disableFlip===!0,this.qrbox=r.qrbox,this.aspectRatio=r.aspectRatio,this.videoConstraints=r.videoConstraints):this.disableFlip=Rr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?kv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!Ki(this.qrbox)},e.create=function(r,a){return new e(r,a)},e})(),H2=(function(){function e(r,a){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(r))throw"HTML Element with id=".concat(r," not found");this.elementId=r,this.verbose=!1;var s;typeof a=="boolean"?this.verbose=a===!0:a&&(s=a,this.verbose=s.verbose===!0,s.experimentalFeatures),this.logger=new t8(this.verbose),this.qrcode=new l8(this.getSupportedFormats(a),this.getUseBarCodeDetectorIfSupported(s),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=b8.create()}return e.prototype.start=function(r,a,s,f){var g=this;if(!r)throw"cameraIdOrConfig is required";if(!s||typeof s!="function")throw"qrCodeSuccessCallback is required and should be a function.";var y;f?y=f:y=this.verbose?this.logger.log:function(){};var E=E8.create(a,this.logger);this.clearElement();var A=!1;E.videoConstraints&&(E.isMediaStreamConstraintsValid()?A=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var b=A,T=document.getElementById(this.elementId);T.clientWidth?T.clientWidth:Rr.DEFAULT_WIDTH,T.style.position="relative",this.shouldScan=!0,this.element=T;var x=this,S=this.stateManagerProxy.startTransition(un.SCANNING);return new Promise(function(R,k){var I=b?E.videoConstraints:x.createVideoConstraints(r);if(!I){S.cancel(),k("videoConstraints should be defined");return}var z={};(!b||E.aspectRatio)&&(z.aspectRatio=E.aspectRatio);var L={onRenderSurfaceReady:function(Z,H){x.setupUi(Z,H,E),x.isScanning=!0,x.foreverScan(E,s,y)}};m8.failIfNotSupported().then(function(Z){Z.create(I).then(function(H){return H.render(g.element,z,L).then(function(j){x.renderedCamera=j,S.execute(),R(null)}).catch(function(j){S.cancel(),k(j)})}).catch(function(H){S.cancel(),k(ys.errorGettingUserMedia(H))})}).catch(function(Z){S.cancel(),k(ys.cameraStreamingNotSupported())})})},e.prototype.pause=function(r){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(un.PAUSED),this.showPausedState(),(Ki(r)||r!==!0)&&(r=!1),r&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var r=this,a=function(){r.stateManagerProxy.directTransition(un.SCANNING),r.hidePausedState()};if(!this.renderedCamera.isPaused()){a();return}this.renderedCamera.resume(function(){a()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var r=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var a=this.stateManagerProxy.startTransition(un.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var s=function(){if(r.element){var g=document.getElementById(Rr.SHADED_REGION_ELEMENT_ID);g&&r.element.removeChild(g)}},f=this;return this.renderedCamera.close().then(function(){return f.renderedCamera=null,f.element&&(f.element.removeChild(f.canvasElement),f.canvasElement=null),s(),f.qrRegion&&(f.qrRegion=null),f.context&&(f.context=null),a.execute(),f.hidePausedState(),f.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(r,a){return this.scanFileV2(r,a).then(function(s){return s.decodedText})},e.prototype.scanFileV2=function(r,a){var s=this;if(!r||!(r instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Ki(a)&&(a=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(f,g){s.possiblyCloseLastScanImageFile(),s.clearElement(),s.lastScanImageFile=URL.createObjectURL(r);var y=new Image;y.onload=function(){var E=y.width,A=y.height,b=document.getElementById(s.elementId),T=b.clientWidth?b.clientWidth:Rr.DEFAULT_WIDTH,x=Math.max(b.clientHeight?b.clientHeight:A,Rr.FILE_SCAN_MIN_HEIGHT),S=s.computeCanvasDrawConfig(E,A,T,x);if(a){var R=s.createCanvasElement(T,x,"qr-canvas-visible");R.style.display="inline-block",b.appendChild(R);var k=R.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=T,k.canvas.height=x,k.drawImage(y,0,0,E,A,S.x,S.y,S.width,S.height)}var I=Rr.FILE_SCAN_HIDDEN_CANVAS_PADDING,z=Math.max(y.width,S.width),L=Math.max(y.height,S.height),Z=z+2*I,H=L+2*I,j=s.createCanvasElement(Z,H);b.appendChild(j);var ae=j.getContext("2d");if(!ae)throw"Unable to get 2d context from canvas";ae.canvas.width=Z,ae.canvas.height=H,ae.drawImage(y,0,0,E,A,I,I,z,L);try{s.qrcode.decodeRobustlyAsync(j).then(function(ee){f(L2.createFromQrcodeResult(ee))}).catch(g)}catch(ee){g("QR code parse error, error = ".concat(ee))}},y.onerror=g,y.onabort=g,y.onstalled=g,y.onsuspend=g,y.src=URL.createObjectURL(r)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return y8.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(r){if(r){if(!kv.isMediaStreamConstraintsValid(r,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(r)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(r){var a=[Be.QR_CODE,Be.AZTEC,Be.CODABAR,Be.CODE_39,Be.CODE_93,Be.CODE_128,Be.DATA_MATRIX,Be.MAXICODE,Be.ITF,Be.EAN_13,Be.EAN_8,Be.PDF_417,Be.RSS_14,Be.RSS_EXPANDED,Be.UPC_A,Be.UPC_E,Be.UPC_EAN_EXTENSION];if(!r||typeof r=="boolean"||!r.formatsToSupport)return a;if(!Array.isArray(r.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(r.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var s=[],f=0,g=r.formatsToSupport;f<g.length;f++){var y=g[f];J4(y)?s.push(y):this.logger.warn("Invalid format: ".concat(y," passed in config, ignoring."))}if(s.length===0)throw"None of formatsToSupport match supported values.";return s},e.prototype.getUseBarCodeDetectorIfSupported=function(r){if(Ki(r))return!0;if(!Ki(r.useBarCodeDetectorIfSupported))return r.useBarCodeDetectorIfSupported!==!1;if(Ki(r.experimentalFeatures))return!0;var a=r.experimentalFeatures;return Ki(a.useBarCodeDetectorIfSupported)?!0:a.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(r,a,s){var f=this,g=s.qrbox;this.validateQrboxConfig(g);var y=this.toQrdimensions(r,a,g),E=function(b){if(b<Rr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Rr.MIN_QR_BOX_SIZE,"px.")},A=function(b){return b>r&&(f.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),b=r),b};E(y.width),E(y.height),y.width=A(y.width)},e.prototype.validateQrboxConfig=function(r){if(typeof r!="number"&&typeof r!="function"&&(r.width===void 0||r.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(r,a,s){if(typeof s=="number")return{width:s,height:s};if(typeof s=="function")try{return s(r,a)}catch(f){throw new Error("qrbox config was passed as a function but it failed with unknown error"+f)}return s},e.prototype.setupUi=function(r,a,s){s.isShadedBoxEnabled()&&this.validateQrboxSize(r,a,s);var f=Ki(s.qrbox)?{width:r,height:a}:s.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(r,a,f);g.height>a&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var y=s.isShadedBoxEnabled()&&g.height<=a,E={x:0,y:0,width:r,height:a},A=y?this.getShadedRegionBounds(r,a,g):E,b=this.createCanvasElement(A.width,A.height),T={willReadFrequently:!0},x=b.getContext("2d",T);x.canvas.width=A.width,x.canvas.height=A.height,this.element.append(b),y&&this.possiblyInsertShadingElement(this.element,r,a,g),this.createScannerPausedUiElement(this.element),this.qrRegion=A,this.context=x,this.canvasElement=b},e.prototype.createScannerPausedUiElement=function(r){var a=document.createElement("div");a.innerText=ys.scannerPaused(),a.style.display="none",a.style.position="absolute",a.style.top="0px",a.style.zIndex="1",a.style.background="rgba(9, 9, 9, 0.46)",a.style.color="#FFECEC",a.style.textAlign="center",a.style.width="100%",r.appendChild(a),this.scannerPausedUiElement=a},e.prototype.scanContext=function(r,a){var s=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(f){return r(f.text,L2.createFromQrcodeResult(f)),s.possiblyUpdateShaders(!0),!0}).catch(function(f){s.possiblyUpdateShaders(!1);var g=ys.codeParseError(f);return a(g,e8.createFrom(g)),!1})},e.prototype.foreverScan=function(r,a,s){var f=this;if(this.shouldScan&&this.renderedCamera){var g=this.renderedCamera.getSurface(),y=g.videoWidth/g.clientWidth,E=g.videoHeight/g.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var A=this.qrRegion.width*y,b=this.qrRegion.height*E,T=this.qrRegion.x*y,x=this.qrRegion.y*E;this.context.drawImage(g,T,x,A,b,0,0,this.qrRegion.width,this.qrRegion.height);var S=function(){f.foreverScanTimeout=setTimeout(function(){f.foreverScan(r,a,s)},f.getTimeoutFps(r.fps))};this.scanContext(a,s).then(function(R){!R&&r.disableFlip!==!0?(f.context.translate(f.context.canvas.width,0),f.context.scale(-1,1),f.scanContext(a,s).finally(function(){S()})):S()}).catch(function(R){f.logger.logError("Error happend while scanning context",R),S()})}},e.prototype.createVideoConstraints=function(r){if(typeof r=="string")return{deviceId:{exact:r}};if(typeof r=="object"){var a="facingMode",s="deviceId",f={user:!0,environment:!0},g="exact",y=function(k){if(k in f)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},E=Object.keys(r);if(E.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(E.length," keys");var A=Object.keys(r)[0];if(A!==a&&A!==s)throw"Only '".concat(a,"' and '").concat(s,"' ")+" are supported for 'cameraIdOrConfig'";if(A===a){var b=r.facingMode;if(typeof b=="string"){if(y(b))return{facingMode:b}}else if(typeof b=="object")if(g in b){if(y(b["".concat(g)]))return{facingMode:{exact:b["".concat(g)]}}}else throw"'facingMode' should be string or object with"+" ".concat(g," as key.");else{var T=typeof b;throw"Invalid type of 'facingMode' = ".concat(T)}}else{var x=r.deviceId;if(typeof x=="string")return{deviceId:x};if(typeof x=="object"){if(g in x)return{deviceId:{exact:x["".concat(g)]}};throw"'deviceId' should be string or object with"+" ".concat(g," as key.")}else{var S=typeof x;throw"Invalid type of 'deviceId' = ".concat(S)}}}var R=typeof r;throw"Invalid type of 'cameraIdOrConfig' = ".concat(R)},e.prototype.computeCanvasDrawConfig=function(r,a,s,f){if(r<=s&&a<=f){var g=(s-r)/2,y=(f-a)/2;return{x:g,y,width:r,height:a}}else{var E=r,A=a;return r>s&&(a=s/r*a,r=s),a>f&&(r=f/a*r,a=f),this.logger.log("Image downsampled from "+"".concat(E,"X").concat(A)+" to ".concat(r,"X").concat(a,".")),this.computeCanvasDrawConfig(r,a,s,f)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var r=document.getElementById(this.elementId);r&&(r.innerHTML="")},e.prototype.possiblyUpdateShaders=function(r){this.qrMatch!==r&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(a){a.style.backgroundColor=r?Rr.BORDER_SHADER_MATCH_COLOR:Rr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=r)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(r,a,s){var f=r,g=a,y=document.createElement("canvas");return y.style.width="".concat(f,"px"),y.style.height="".concat(g,"px"),y.style.display="none",y.id=Ki(s)?"qr-canvas":s,y},e.prototype.getShadedRegionBounds=function(r,a,s){if(s.width>r||s.height>a)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(r-s.width)/2,y:(a-s.height)/2,width:s.width,height:s.height}},e.prototype.possiblyInsertShadingElement=function(r,a,s,f){if(!(a-f.width<1||s-f.height<1)){var g=document.createElement("div");g.style.position="absolute";var y=(a-f.width)/2,E=(s-f.height)/2;if(g.style.borderLeft="".concat(y,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderRight="".concat(y,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderTop="".concat(E,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderBottom="".concat(E,"px solid rgba(0, 0, 0, 0.48)"),g.style.boxSizing="border-box",g.style.top="0px",g.style.bottom="0px",g.style.left="0px",g.style.right="0px",g.id="".concat(Rr.SHADED_REGION_ELEMENT_ID),a-f.width<11||s-f.height<11)this.hasBorderShaders=!1;else{var A=5,b=40;this.insertShaderBorders(g,b,A,-A,null,0,!0),this.insertShaderBorders(g,b,A,-A,null,0,!1),this.insertShaderBorders(g,b,A,null,-A,0,!0),this.insertShaderBorders(g,b,A,null,-A,0,!1),this.insertShaderBorders(g,A,b+A,-A,null,-A,!0),this.insertShaderBorders(g,A,b+A,null,-A,-A,!0),this.insertShaderBorders(g,A,b+A,-A,null,-A,!1),this.insertShaderBorders(g,A,b+A,null,-A,-A,!1),this.hasBorderShaders=!0}r.append(g)}},e.prototype.insertShaderBorders=function(r,a,s,f,g,y,E){var A=document.createElement("div");A.style.position="absolute",A.style.backgroundColor=Rr.BORDER_SHADER_DEFAULT_COLOR,A.style.width="".concat(a,"px"),A.style.height="".concat(s,"px"),f!==null&&(A.style.top="".concat(f,"px")),g!==null&&(A.style.bottom="".concat(g,"px")),E?A.style.left="".concat(y,"px"):A.style.right="".concat(y,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(A),r.appendChild(A)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(r){return 1e3/r},e})(),G2;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(G2||(G2={}));function be(e,r,a){function s(E,A){if(E._zod||Object.defineProperty(E,"_zod",{value:{def:A,constr:y,traits:new Set},enumerable:!1}),E._zod.traits.has(e))return;E._zod.traits.add(e),r(E,A);const b=y.prototype,T=Object.keys(b);for(let x=0;x<T.length;x++){const S=T[x];S in E||(E[S]=b[S].bind(E))}}const f=(a==null?void 0:a.Parent)??Object;class g extends f{}Object.defineProperty(g,"name",{value:e});function y(E){var A;const b=a!=null&&a.Parent?new g:this;s(b,E),(A=b._zod).deferred??(A.deferred=[]);for(const T of b._zod.deferred)T();return b}return Object.defineProperty(y,"init",{value:s}),Object.defineProperty(y,Symbol.hasInstance,{value:E=>{var A,b;return a!=null&&a.Parent&&E instanceof a.Parent?!0:(b=(A=E==null?void 0:E._zod)==null?void 0:A.traits)==null?void 0:b.has(e)}}),Object.defineProperty(y,"name",{value:e}),y}class Es extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pv extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Uv={};function Ya(e){return Uv}function Fv(e){const r=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,f])=>r.indexOf(+s)===-1).map(([s,f])=>f)}function S0(e,r){return typeof r=="bigint"?r.toString():r}function t1(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function n1(e){return e==null}function r1(e){const r=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(r,a)}function A8(e,r){const a=(e.toString().split(".")[1]||"").length,s=r.toString();let f=(s.split(".")[1]||"").length;if(f===0&&/\d?e-\d?/.test(s)){const A=s.match(/\d?e-(\d?)/);A!=null&&A[1]&&(f=Number.parseInt(A[1]))}const g=a>f?a:f,y=Number.parseInt(e.toFixed(g).replace(".","")),E=Number.parseInt(r.toFixed(g).replace(".",""));return y%E/10**g}const Z2=Symbol("evaluating");function Vt(e,r,a){let s;Object.defineProperty(e,r,{get(){if(s!==Z2)return s===void 0&&(s=Z2,s=a()),s},set(f){Object.defineProperty(e,r,{value:f})},configurable:!0})}function So(e,r,a){Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function To(...e){const r={};for(const a of e){const s=Object.getOwnPropertyDescriptors(a);Object.assign(r,s)}return Object.defineProperties({},r)}function X2(e){return JSON.stringify(e)}function C8(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const S8=t1(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function Ts(e){if(Yu(e)===!1)return!1;const r=e.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(Yu(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function Vv(e){return Ts(e)?{...e}:Array.isArray(e)?[...e]:e}const T8=new Set(["string","number","symbol"]);function cf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(e,r,a){const s=new e._zod.constr(r??e._zod.def);return(!r||a!=null&&a.parent)&&(s._zod.parent=e),s}function Ve(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if((r==null?void 0:r.message)!==void 0){if((r==null?void 0:r.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function R8(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const N8={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function O8(e,r){const a=e._zod.def,s=To(e._zod.def,{get shape(){const f={};for(const g in r){if(!(g in a.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&(f[g]=a.shape[g])}return So(this,"shape",f),f},checks:[]});return Wa(e,s)}function I8(e,r){const a=e._zod.def,s=To(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const g in r){if(!(g in a.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&delete f[g]}return So(this,"shape",f),f},checks:[]});return Wa(e,s)}function M8(e,r){if(!Ts(r))throw new Error("Invalid input to extend: expected a plain object");const a=e._zod.def.checks;if(a&&a.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const f=To(e._zod.def,{get shape(){const g={...e._zod.def.shape,...r};return So(this,"shape",g),g},checks:[]});return Wa(e,f)}function D8(e,r){if(!Ts(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a={...e._zod.def,get shape(){const s={...e._zod.def.shape,...r};return So(this,"shape",s),s},checks:e._zod.def.checks};return Wa(e,a)}function B8(e,r){const a=To(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r._zod.def.shape};return So(this,"shape",s),s},get catchall(){return r._zod.def.catchall},checks:[]});return Wa(e,a)}function L8(e,r,a){const s=To(r._zod.def,{get shape(){const f=r._zod.def.shape,g={...f};if(a)for(const y in a){if(!(y in f))throw new Error(`Unrecognized key: "${y}"`);a[y]&&(g[y]=e?new e({type:"optional",innerType:f[y]}):f[y])}else for(const y in f)g[y]=e?new e({type:"optional",innerType:f[y]}):f[y];return So(this,"shape",g),g},checks:[]});return Wa(r,s)}function k8(e,r,a){const s=To(r._zod.def,{get shape(){const f=r._zod.def.shape,g={...f};if(a)for(const y in a){if(!(y in g))throw new Error(`Unrecognized key: "${y}"`);a[y]&&(g[y]=new e({type:"nonoptional",innerType:f[y]}))}else for(const y in f)g[y]=new e({type:"nonoptional",innerType:f[y]});return So(this,"shape",g),g},checks:[]});return Wa(r,s)}function vs(e,r=0){var a;if(e.aborted===!0)return!0;for(let s=r;s<e.issues.length;s++)if(((a=e.issues[s])==null?void 0:a.continue)!==!0)return!0;return!1}function ws(e,r){return r.map(a=>{var s;return(s=a).path??(s.path=[]),a.path.unshift(e),a})}function Su(e){return typeof e=="string"?e:e==null?void 0:e.message}function qa(e,r,a){var f,g,y,E,A,b;const s={...e,path:e.path??[]};if(!e.message){const T=Su((y=(g=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:g.error)==null?void 0:y.call(g,e))??Su((E=r==null?void 0:r.error)==null?void 0:E.call(r,e))??Su((A=a.customError)==null?void 0:A.call(a,e))??Su((b=a.localeError)==null?void 0:b.call(a,e))??"Invalid input";s.message=T}return delete s.inst,delete s.continue,r!=null&&r.reportInput||delete s.input,s}function i1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gl(...e){const[r,a,s]=e;return typeof r=="string"?{message:r,code:"custom",input:a,inst:s}:{...r}}const Hv=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,S0,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gv=be("$ZodError",Hv),Zv=be("$ZodError",Hv,{Parent:Error});function z8(e,r=a=>a.message){const a={},s=[];for(const f of e.issues)f.path.length>0?(a[f.path[0]]=a[f.path[0]]||[],a[f.path[0]].push(r(f))):s.push(r(f));return{formErrors:s,fieldErrors:a}}function P8(e,r=a=>a.message){const a={_errors:[]},s=f=>{for(const g of f.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(y=>s({issues:y}));else if(g.code==="invalid_key")s({issues:g.issues});else if(g.code==="invalid_element")s({issues:g.issues});else if(g.path.length===0)a._errors.push(r(g));else{let y=a,E=0;for(;E<g.path.length;){const A=g.path[E];E===g.path.length-1?(y[A]=y[A]||{_errors:[]},y[A]._errors.push(r(g))):y[A]=y[A]||{_errors:[]},y=y[A],E++}}};return s(e),a}const a1=e=>(r,a,s,f)=>{const g=s?Object.assign(s,{async:!1}):{async:!1},y=r._zod.run({value:a,issues:[]},g);if(y instanceof Promise)throw new Es;if(y.issues.length){const E=new((f==null?void 0:f.Err)??e)(y.issues.map(A=>qa(A,g,Ya())));throw jv(E,f==null?void 0:f.callee),E}return y.value},o1=e=>async(r,a,s,f)=>{const g=s?Object.assign(s,{async:!0}):{async:!0};let y=r._zod.run({value:a,issues:[]},g);if(y instanceof Promise&&(y=await y),y.issues.length){const E=new((f==null?void 0:f.Err)??e)(y.issues.map(A=>qa(A,g,Ya())));throw jv(E,f==null?void 0:f.callee),E}return y.value},uf=e=>(r,a,s)=>{const f=s?{...s,async:!1}:{async:!1},g=r._zod.run({value:a,issues:[]},f);if(g instanceof Promise)throw new Es;return g.issues.length?{success:!1,error:new(e??Gv)(g.issues.map(y=>qa(y,f,Ya())))}:{success:!0,data:g.value}},U8=uf(Zv),ff=e=>async(r,a,s)=>{const f=s?Object.assign(s,{async:!0}):{async:!0};let g=r._zod.run({value:a,issues:[]},f);return g instanceof Promise&&(g=await g),g.issues.length?{success:!1,error:new e(g.issues.map(y=>qa(y,f,Ya())))}:{success:!0,data:g.value}},F8=ff(Zv),j8=e=>(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return a1(e)(r,a,f)},V8=e=>(r,a,s)=>a1(e)(r,a,s),H8=e=>async(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return o1(e)(r,a,f)},G8=e=>async(r,a,s)=>o1(e)(r,a,s),Z8=e=>(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return uf(e)(r,a,f)},X8=e=>(r,a,s)=>uf(e)(r,a,s),Y8=e=>async(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ff(e)(r,a,f)},q8=e=>async(r,a,s)=>ff(e)(r,a,s),W8=/^[cC][^\s-]{8,}$/,K8=/^[0-9a-z]+$/,Q8=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,J8=/^[0-9a-vA-V]{20}$/,$8=/^[A-Za-z0-9]{27}$/,eT=/^[a-zA-Z0-9_-]{21}$/,tT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Y2=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function aT(){return new RegExp(iT,"u")}const oT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,lT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,uT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xv=/^[A-Za-z0-9_-]*$/,fT=/^\+(?:[0-9]){6,14}[0-9]$/,Yv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",dT=new RegExp(`^${Yv}$`);function qv(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hT(e){return new RegExp(`^${qv(e)}$`)}function gT(e){const r=qv({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${r}(?:${a.join("|")})`;return new RegExp(`^${Yv}T(?:${s})$`)}const mT=e=>{const r=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},pT=/^-?\d+$/,xT=/^-?\d+(?:\.\d+)?/,yT=/^(?:true|false)$/i,vT=/^[^A-Z]*$/,wT=/^[^a-z]*$/,gr=be("$ZodCheck",(e,r)=>{var a;e._zod??(e._zod={}),e._zod.def=r,(a=e._zod).onattach??(a.onattach=[])}),Wv={number:"number",bigint:"bigint",object:"date"},Kv=be("$ZodCheckLessThan",(e,r)=>{gr.init(e,r);const a=Wv[typeof r.value];e._zod.onattach.push(s=>{const f=s._zod.bag,g=(r.inclusive?f.maximum:f.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<g&&(r.inclusive?f.maximum=r.value:f.exclusiveMaximum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value<=r.value:s.value<r.value)||s.issues.push({origin:a,code:"too_big",maximum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Qv=be("$ZodCheckGreaterThan",(e,r)=>{gr.init(e,r);const a=Wv[typeof r.value];e._zod.onattach.push(s=>{const f=s._zod.bag,g=(r.inclusive?f.minimum:f.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>g&&(r.inclusive?f.minimum=r.value:f.exclusiveMinimum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value>=r.value:s.value>r.value)||s.issues.push({origin:a,code:"too_small",minimum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),bT=be("$ZodCheckMultipleOf",(e,r)=>{gr.init(e,r),e._zod.onattach.push(a=>{var s;(s=a._zod.bag).multipleOf??(s.multipleOf=r.value)}),e._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):A8(a.value,r.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:r.value,input:a.value,inst:e,continue:!r.abort})}}),_T=be("$ZodCheckNumberFormat",(e,r)=>{var y;gr.init(e,r),r.format=r.format||"float64";const a=(y=r.format)==null?void 0:y.includes("int"),s=a?"int":"number",[f,g]=N8[r.format];e._zod.onattach.push(E=>{const A=E._zod.bag;A.format=r.format,A.minimum=f,A.maximum=g,a&&(A.pattern=pT)}),e._zod.check=E=>{const A=E.value;if(a){if(!Number.isInteger(A)){E.issues.push({expected:s,format:r.format,code:"invalid_type",continue:!1,input:A,inst:e});return}if(!Number.isSafeInteger(A)){A>0?E.issues.push({input:A,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort}):E.issues.push({input:A,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort});return}}A<f&&E.issues.push({origin:"number",input:A,code:"too_small",minimum:f,inclusive:!0,inst:e,continue:!r.abort}),A>g&&E.issues.push({origin:"number",input:A,code:"too_big",maximum:g,inst:e})}}),ET=be("$ZodCheckMaxLength",(e,r)=>{var a;gr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!n1(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<f&&(s._zod.bag.maximum=r.maximum)}),e._zod.check=s=>{const f=s.value;if(f.length<=r.maximum)return;const y=i1(f);s.issues.push({origin:y,code:"too_big",maximum:r.maximum,inclusive:!0,input:f,inst:e,continue:!r.abort})}}),AT=be("$ZodCheckMinLength",(e,r)=>{var a;gr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!n1(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>f&&(s._zod.bag.minimum=r.minimum)}),e._zod.check=s=>{const f=s.value;if(f.length>=r.minimum)return;const y=i1(f);s.issues.push({origin:y,code:"too_small",minimum:r.minimum,inclusive:!0,input:f,inst:e,continue:!r.abort})}}),CT=be("$ZodCheckLengthEquals",(e,r)=>{var a;gr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!n1(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag;f.minimum=r.length,f.maximum=r.length,f.length=r.length}),e._zod.check=s=>{const f=s.value,g=f.length;if(g===r.length)return;const y=i1(f),E=g>r.length;s.issues.push({origin:y,...E?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!r.abort})}}),df=be("$ZodCheckStringFormat",(e,r)=>{var a,s;gr.init(e,r),e._zod.onattach.push(f=>{const g=f._zod.bag;g.format=r.format,r.pattern&&(g.patterns??(g.patterns=new Set),g.patterns.add(r.pattern))}),r.pattern?(a=e._zod).check??(a.check=f=>{r.pattern.lastIndex=0,!r.pattern.test(f.value)&&f.issues.push({origin:"string",code:"invalid_format",format:r.format,input:f.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(s=e._zod).check??(s.check=()=>{})}),ST=be("$ZodCheckRegex",(e,r)=>{df.init(e,r),e._zod.check=a=>{r.pattern.lastIndex=0,!r.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),TT=be("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=vT),df.init(e,r)}),RT=be("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=wT),df.init(e,r)}),NT=be("$ZodCheckIncludes",(e,r)=>{gr.init(e,r);const a=cf(r.includes),s=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=s,e._zod.onattach.push(f=>{const g=f._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(s)}),e._zod.check=f=>{f.value.includes(r.includes,r.position)||f.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:f.value,inst:e,continue:!r.abort})}}),OT=be("$ZodCheckStartsWith",(e,r)=>{gr.init(e,r);const a=new RegExp(`^${cf(r.prefix)}.*`);r.pattern??(r.pattern=a),e._zod.onattach.push(s=>{const f=s._zod.bag;f.patterns??(f.patterns=new Set),f.patterns.add(a)}),e._zod.check=s=>{s.value.startsWith(r.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:s.value,inst:e,continue:!r.abort})}}),IT=be("$ZodCheckEndsWith",(e,r)=>{gr.init(e,r);const a=new RegExp(`.*${cf(r.suffix)}$`);r.pattern??(r.pattern=a),e._zod.onattach.push(s=>{const f=s._zod.bag;f.patterns??(f.patterns=new Set),f.patterns.add(a)}),e._zod.check=s=>{s.value.endsWith(r.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:s.value,inst:e,continue:!r.abort})}}),MT=be("$ZodCheckOverwrite",(e,r)=>{gr.init(e,r),e._zod.check=a=>{a.value=r.tx(a.value)}});class DT{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const s=r.split(`
|
|
249
|
+
`).filter(y=>y),f=Math.min(...s.map(y=>y.length-y.trimStart().length)),g=s.map(y=>y.slice(f)).map(y=>" ".repeat(this.indent*2)+y);for(const y of g)this.content.push(y)}compile(){const r=Function,a=this==null?void 0:this.args,f=[...((this==null?void 0:this.content)??[""]).map(g=>` ${g}`)];return new r(...a,f.join(`
|
|
250
|
+
`))}}const BT={major:4,minor:2,patch:1},fn=be("$ZodType",(e,r)=>{var f;var a;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=BT;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const g of s)for(const y of g._zod.onattach)y(e);if(s.length===0)(a=e._zod).deferred??(a.deferred=[]),(f=e._zod.deferred)==null||f.push(()=>{e._zod.run=e._zod.parse});else{const g=(E,A,b)=>{let T=vs(E),x;for(const S of A){if(S._zod.def.when){if(!S._zod.def.when(E))continue}else if(T)continue;const R=E.issues.length,k=S._zod.check(E);if(k instanceof Promise&&(b==null?void 0:b.async)===!1)throw new Es;if(x||k instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await k,E.issues.length!==R&&(T||(T=vs(E,R)))});else{if(E.issues.length===R)continue;T||(T=vs(E,R))}}return x?x.then(()=>E):E},y=(E,A,b)=>{if(vs(E))return E.aborted=!0,E;const T=g(A,s,b);if(T instanceof Promise){if(b.async===!1)throw new Es;return T.then(x=>e._zod.parse(x,b))}return e._zod.parse(T,b)};e._zod.run=(E,A)=>{if(A.skipChecks)return e._zod.parse(E,A);if(A.direction==="backward"){const T=e._zod.parse({value:E.value,issues:[]},{...A,skipChecks:!0});return T instanceof Promise?T.then(x=>y(x,E,A)):y(T,E,A)}const b=e._zod.parse(E,A);if(b instanceof Promise){if(A.async===!1)throw new Es;return b.then(T=>g(T,s,A))}return g(b,s,A)}}e["~standard"]={validate:g=>{var y;try{const E=U8(e,g);return E.success?{value:E.data}:{issues:(y=E.error)==null?void 0:y.issues}}catch{return F8(e,g).then(A=>{var b;return A.success?{value:A.data}:{issues:(b=A.error)==null?void 0:b.issues}})}},vendor:"zod",version:1}}),s1=be("$ZodString",(e,r)=>{var a;fn.init(e,r),e._zod.pattern=[...((a=e==null?void 0:e._zod.bag)==null?void 0:a.patterns)??[]].pop()??mT(e._zod.bag),e._zod.parse=(s,f)=>{if(r.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),$t=be("$ZodStringFormat",(e,r)=>{df.init(e,r),s1.init(e,r)}),LT=be("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=nT),$t.init(e,r)}),kT=be("$ZodUUID",(e,r)=>{if(r.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(s===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=Y2(s))}else r.pattern??(r.pattern=Y2());$t.init(e,r)}),zT=be("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=rT),$t.init(e,r)}),PT=be("$ZodURL",(e,r)=>{$t.init(e,r),e._zod.check=a=>{try{const s=a.value.trim(),f=new URL(s);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(f.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(f.protocol.endsWith(":")?f.protocol.slice(0,-1):f.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:e,continue:!r.abort})),r.normalize?a.value=f.href:a.value=s;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!r.abort})}}}),UT=be("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=aT()),$t.init(e,r)}),FT=be("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=eT),$t.init(e,r)}),jT=be("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=W8),$t.init(e,r)}),VT=be("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=K8),$t.init(e,r)}),HT=be("$ZodULID",(e,r)=>{r.pattern??(r.pattern=Q8),$t.init(e,r)}),GT=be("$ZodXID",(e,r)=>{r.pattern??(r.pattern=J8),$t.init(e,r)}),ZT=be("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=$8),$t.init(e,r)}),XT=be("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=gT(r)),$t.init(e,r)}),YT=be("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=dT),$t.init(e,r)}),qT=be("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=hT(r)),$t.init(e,r)}),WT=be("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=tT),$t.init(e,r)}),KT=be("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=oT),$t.init(e,r),e._zod.bag.format="ipv4"}),QT=be("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=sT),$t.init(e,r),e._zod.bag.format="ipv6",e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!r.abort})}}}),JT=be("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=lT),$t.init(e,r)}),$T=be("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=cT),$t.init(e,r),e._zod.check=a=>{const s=a.value.split("/");try{if(s.length!==2)throw new Error;const[f,g]=s;if(!g)throw new Error;const y=Number(g);if(`${y}`!==g)throw new Error;if(y<0||y>128)throw new Error;new URL(`http://[${f}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!r.abort})}}});function Jv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const e6=be("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=uT),$t.init(e,r),e._zod.bag.contentEncoding="base64",e._zod.check=a=>{Jv(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!r.abort})}});function t6(e){if(!Xv.test(e))return!1;const r=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Jv(a)}const n6=be("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=Xv),$t.init(e,r),e._zod.bag.contentEncoding="base64url",e._zod.check=a=>{t6(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!r.abort})}}),r6=be("$ZodE164",(e,r)=>{r.pattern??(r.pattern=fT),$t.init(e,r)});function i6(e,r=null){try{const a=e.split(".");if(a.length!==3)return!1;const[s]=a;if(!s)return!1;const f=JSON.parse(atob(s));return!("typ"in f&&(f==null?void 0:f.typ)!=="JWT"||!f.alg||r&&(!("alg"in f)||f.alg!==r))}catch{return!1}}const a6=be("$ZodJWT",(e,r)=>{$t.init(e,r),e._zod.check=a=>{i6(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!r.abort})}}),$v=be("$ZodNumber",(e,r)=>{fn.init(e,r),e._zod.pattern=e._zod.bag.pattern??xT,e._zod.parse=(a,s)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const f=a.value;if(typeof f=="number"&&!Number.isNaN(f)&&Number.isFinite(f))return a;const g=typeof f=="number"?Number.isNaN(f)?"NaN":Number.isFinite(f)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:f,inst:e,...g?{received:g}:{}}),a}}),o6=be("$ZodNumberFormat",(e,r)=>{_T.init(e,r),$v.init(e,r)}),s6=be("$ZodBoolean",(e,r)=>{fn.init(e,r),e._zod.pattern=yT,e._zod.parse=(a,s)=>{if(r.coerce)try{a.value=!!a.value}catch{}const f=a.value;return typeof f=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:f,inst:e}),a}}),l6=be("$ZodUnknown",(e,r)=>{fn.init(e,r),e._zod.parse=a=>a}),c6=be("$ZodNever",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:e}),a)});function q2(e,r,a){e.issues.length&&r.issues.push(...ws(a,e.issues)),r.value[a]=e.value}const u6=be("$ZodArray",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value;if(!Array.isArray(f))return a.issues.push({expected:"array",code:"invalid_type",input:f,inst:e}),a;a.value=Array(f.length);const g=[];for(let y=0;y<f.length;y++){const E=f[y],A=r.element._zod.run({value:E,issues:[]},s);A instanceof Promise?g.push(A.then(b=>q2(b,a,y))):q2(A,a,y)}return g.length?Promise.all(g).then(()=>a):a}});function qu(e,r,a,s){e.issues.length&&r.issues.push(...ws(a,e.issues)),e.value===void 0?a in s&&(r.value[a]=void 0):r.value[a]=e.value}function ew(e){var s,f,g,y;const r=Object.keys(e.shape);for(const E of r)if(!((y=(g=(f=(s=e.shape)==null?void 0:s[E])==null?void 0:f._zod)==null?void 0:g.traits)!=null&&y.has("$ZodType")))throw new Error(`Invalid element at key "${E}": expected a Zod schema`);const a=R8(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function tw(e,r,a,s,f,g){const y=[],E=f.keySet,A=f.catchall._zod,b=A.def.type;for(const T in r){if(E.has(T))continue;if(b==="never"){y.push(T);continue}const x=A.run({value:r[T],issues:[]},s);x instanceof Promise?e.push(x.then(S=>qu(S,a,T,r))):qu(x,a,T,r)}return y.length&&a.issues.push({code:"unrecognized_keys",keys:y,input:r,inst:g}),e.length?Promise.all(e).then(()=>a):a}const f6=be("$ZodObject",(e,r)=>{fn.init(e,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const E=r.shape;Object.defineProperty(r,"shape",{get:()=>{const A={...E};return Object.defineProperty(r,"shape",{value:A}),A}})}const s=t1(()=>ew(r));Vt(e._zod,"propValues",()=>{const E=r.shape,A={};for(const b in E){const T=E[b]._zod;if(T.values){A[b]??(A[b]=new Set);for(const x of T.values)A[b].add(x)}}return A});const f=Yu,g=r.catchall;let y;e._zod.parse=(E,A)=>{y??(y=s.value);const b=E.value;if(!f(b))return E.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),E;E.value={};const T=[],x=y.shape;for(const S of y.keys){const k=x[S]._zod.run({value:b[S],issues:[]},A);k instanceof Promise?T.push(k.then(I=>qu(I,E,S,b))):qu(k,E,S,b)}return g?tw(T,b,E,A,s.value,e):T.length?Promise.all(T).then(()=>E):E}}),d6=be("$ZodObjectJIT",(e,r)=>{f6.init(e,r);const a=e._zod.parse,s=t1(()=>ew(r)),f=S=>{const R=new DT(["shape","payload","ctx"]),k=s.value,I=H=>{const j=X2(H);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};R.write("const input = payload.value;");const z=Object.create(null);let L=0;for(const H of k.keys)z[H]=`key_${L++}`;R.write("const newResult = {};");for(const H of k.keys){const j=z[H],ae=X2(H);R.write(`const ${j} = ${I(H)};`),R.write(`
|
|
251
|
+
if (${j}.issues.length) {
|
|
252
|
+
payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
|
|
253
|
+
...iss,
|
|
254
|
+
path: iss.path ? [${ae}, ...iss.path] : [${ae}]
|
|
255
|
+
})));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
if (${j}.value === undefined) {
|
|
260
|
+
if (${ae} in input) {
|
|
261
|
+
newResult[${ae}] = undefined;
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
newResult[${ae}] = ${j}.value;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
`)}R.write("payload.value = newResult;"),R.write("return payload;");const Z=R.compile();return(H,j)=>Z(S,H,j)};let g;const y=Yu,E=!Uv.jitless,b=E&&S8.value,T=r.catchall;let x;e._zod.parse=(S,R)=>{x??(x=s.value);const k=S.value;return y(k)?E&&b&&(R==null?void 0:R.async)===!1&&R.jitless!==!0?(g||(g=f(r.shape)),S=g(S,R),T?tw([],k,S,R,x,e):S):a(S,R):(S.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),S)}});function W2(e,r,a,s){for(const g of e)if(g.issues.length===0)return r.value=g.value,r;const f=e.filter(g=>!vs(g));return f.length===1?(r.value=f[0].value,f[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:e.map(g=>g.issues.map(y=>qa(y,s,Ya())))}),r)}const h6=be("$ZodUnion",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.options.some(f=>f._zod.optin==="optional")?"optional":void 0),Vt(e._zod,"optout",()=>r.options.some(f=>f._zod.optout==="optional")?"optional":void 0),Vt(e._zod,"values",()=>{if(r.options.every(f=>f._zod.values))return new Set(r.options.flatMap(f=>Array.from(f._zod.values)))}),Vt(e._zod,"pattern",()=>{if(r.options.every(f=>f._zod.pattern)){const f=r.options.map(g=>g._zod.pattern);return new RegExp(`^(${f.map(g=>r1(g.source)).join("|")})$`)}});const a=r.options.length===1,s=r.options[0]._zod.run;e._zod.parse=(f,g)=>{if(a)return s(f,g);let y=!1;const E=[];for(const A of r.options){const b=A._zod.run({value:f.value,issues:[]},g);if(b instanceof Promise)E.push(b),y=!0;else{if(b.issues.length===0)return b;E.push(b)}}return y?Promise.all(E).then(A=>W2(A,f,e,g)):W2(E,f,e,g)}}),g6=be("$ZodIntersection",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value,g=r.left._zod.run({value:f,issues:[]},s),y=r.right._zod.run({value:f,issues:[]},s);return g instanceof Promise||y instanceof Promise?Promise.all([g,y]).then(([A,b])=>K2(a,A,b)):K2(a,g,y)}});function T0(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Ts(e)&&Ts(r)){const a=Object.keys(r),s=Object.keys(e).filter(g=>a.indexOf(g)!==-1),f={...e,...r};for(const g of s){const y=T0(e[g],r[g]);if(!y.valid)return{valid:!1,mergeErrorPath:[g,...y.mergeErrorPath]};f[g]=y.data}return{valid:!0,data:f}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let s=0;s<e.length;s++){const f=e[s],g=r[s],y=T0(f,g);if(!y.valid)return{valid:!1,mergeErrorPath:[s,...y.mergeErrorPath]};a.push(y.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function K2(e,r,a){if(r.issues.length&&e.issues.push(...r.issues),a.issues.length&&e.issues.push(...a.issues),vs(e))return e;const s=T0(r.value,a.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const m6=be("$ZodRecord",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value;if(!Ts(f))return a.issues.push({expected:"record",code:"invalid_type",input:f,inst:e}),a;const g=[],y=r.keyType._zod.values;if(y){a.value={};const E=new Set;for(const b of y)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){E.add(typeof b=="number"?b.toString():b);const T=r.valueType._zod.run({value:f[b],issues:[]},s);T instanceof Promise?g.push(T.then(x=>{x.issues.length&&a.issues.push(...ws(b,x.issues)),a.value[b]=x.value})):(T.issues.length&&a.issues.push(...ws(b,T.issues)),a.value[b]=T.value)}let A;for(const b in f)E.has(b)||(A=A??[],A.push(b));A&&A.length>0&&a.issues.push({code:"unrecognized_keys",input:f,inst:e,keys:A})}else{a.value={};for(const E of Reflect.ownKeys(f)){if(E==="__proto__")continue;const A=r.keyType._zod.run({value:E,issues:[]},s);if(A instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(A.issues.length){r.mode==="loose"?a.value[E]=f[E]:a.issues.push({code:"invalid_key",origin:"record",issues:A.issues.map(T=>qa(T,s,Ya())),input:E,path:[E],inst:e});continue}const b=r.valueType._zod.run({value:f[E],issues:[]},s);b instanceof Promise?g.push(b.then(T=>{T.issues.length&&a.issues.push(...ws(E,T.issues)),a.value[A.value]=T.value})):(b.issues.length&&a.issues.push(...ws(E,b.issues)),a.value[A.value]=b.value)}}return g.length?Promise.all(g).then(()=>a):a}}),p6=be("$ZodEnum",(e,r)=>{fn.init(e,r);const a=Fv(r.entries),s=new Set(a);e._zod.values=s,e._zod.pattern=new RegExp(`^(${a.filter(f=>T8.has(typeof f)).map(f=>typeof f=="string"?cf(f):f.toString()).join("|")})$`),e._zod.parse=(f,g)=>{const y=f.value;return s.has(y)||f.issues.push({code:"invalid_value",values:a,input:y,inst:e}),f}}),x6=be("$ZodTransform",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{if(s.direction==="backward")throw new Pv(e.constructor.name);const f=r.transform(a.value,a);if(s.async)return(f instanceof Promise?f:Promise.resolve(f)).then(y=>(a.value=y,a));if(f instanceof Promise)throw new Es;return a.value=f,a}});function Q2(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const y6=be("$ZodOptional",(e,r)=>{fn.init(e,r),e._zod.optin="optional",e._zod.optout="optional",Vt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Vt(e._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${r1(a.source)})?$`):void 0}),e._zod.parse=(a,s)=>{if(r.innerType._zod.optin==="optional"){const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>Q2(g,a.value)):Q2(f,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,s)}}),v6=be("$ZodNullable",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.innerType._zod.optin),Vt(e._zod,"optout",()=>r.innerType._zod.optout),Vt(e._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${r1(a.source)}|null)$`):void 0}),Vt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(a,s)=>a.value===null?a:r.innerType._zod.run(a,s)}),w6=be("$ZodDefault",(e,r)=>{fn.init(e,r),e._zod.optin="optional",Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);if(a.value===void 0)return a.value=r.defaultValue,a;const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>J2(g,r)):J2(f,r)}});function J2(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const b6=be("$ZodPrefault",(e,r)=>{fn.init(e,r),e._zod.optin="optional",Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>(s.direction==="backward"||a.value===void 0&&(a.value=r.defaultValue),r.innerType._zod.run(a,s))}),_6=be("$ZodNonOptional",(e,r)=>{fn.init(e,r),Vt(e._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(s=>s!==void 0)):void 0}),e._zod.parse=(a,s)=>{const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>$2(g,e)):$2(f,e)}});function $2(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const E6=be("$ZodCatch",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.innerType._zod.optin),Vt(e._zod,"optout",()=>r.innerType._zod.optout),Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(y=>qa(y,s,Ya()))},input:a.value}),a.issues=[]),a)):(a.value=f.value,f.issues.length&&(a.value=r.catchValue({...a,error:{issues:f.issues.map(g=>qa(g,s,Ya()))},input:a.value}),a.issues=[]),a)}}),A6=be("$ZodPipe",(e,r)=>{fn.init(e,r),Vt(e._zod,"values",()=>r.in._zod.values),Vt(e._zod,"optin",()=>r.in._zod.optin),Vt(e._zod,"optout",()=>r.out._zod.optout),Vt(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(a,s)=>{if(s.direction==="backward"){const g=r.out._zod.run(a,s);return g instanceof Promise?g.then(y=>Tu(y,r.in,s)):Tu(g,r.in,s)}const f=r.in._zod.run(a,s);return f instanceof Promise?f.then(g=>Tu(g,r.out,s)):Tu(f,r.out,s)}});function Tu(e,r,a){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},a)}const C6=be("$ZodReadonly",(e,r)=>{fn.init(e,r),Vt(e._zod,"propValues",()=>r.innerType._zod.propValues),Vt(e._zod,"values",()=>r.innerType._zod.values),Vt(e._zod,"optin",()=>{var a,s;return(s=(a=r.innerType)==null?void 0:a._zod)==null?void 0:s.optin}),Vt(e._zod,"optout",()=>{var a,s;return(s=(a=r.innerType)==null?void 0:a._zod)==null?void 0:s.optout}),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(ex):ex(f)}});function ex(e){return e.value=Object.freeze(e.value),e}const S6=be("$ZodCustom",(e,r)=>{gr.init(e,r),fn.init(e,r),e._zod.parse=(a,s)=>a,e._zod.check=a=>{const s=a.value,f=r.fn(s);if(f instanceof Promise)return f.then(g=>tx(g,a,s,e));tx(f,a,s,e)}});function tx(e,r,a,s){if(!e){const f={code:"custom",input:a,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(f.params=s._zod.def.params),r.issues.push(Gl(f))}}var nx;class T6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const s=a[0];if(this._map.set(r,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,r)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const s={...this.get(a)??{}};delete s.id;const f={...s,...this._map.get(r)};return Object.keys(f).length?f:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function R6(){return new T6}(nx=globalThis).__zod_globalRegistry??(nx.__zod_globalRegistry=R6());const Pl=globalThis.__zod_globalRegistry;function N6(e,r){return new e({type:"string",...Ve(r)})}function O6(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(r)})}function rx(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(r)})}function I6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(r)})}function M6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(r)})}function D6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(r)})}function B6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(r)})}function L6(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(r)})}function k6(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(r)})}function z6(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(r)})}function P6(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(r)})}function U6(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(r)})}function F6(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(r)})}function j6(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(r)})}function V6(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(r)})}function H6(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(r)})}function G6(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(r)})}function Z6(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(r)})}function X6(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(r)})}function Y6(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(r)})}function q6(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(r)})}function W6(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(r)})}function K6(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(r)})}function Q6(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(r)})}function J6(e,r){return new e({type:"string",format:"date",check:"string_format",...Ve(r)})}function $6(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(r)})}function eR(e,r){return new e({type:"string",format:"duration",check:"string_format",...Ve(r)})}function tR(e,r){return new e({type:"number",checks:[],...Ve(r)})}function nR(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(r)})}function rR(e,r){return new e({type:"boolean",...Ve(r)})}function iR(e){return new e({type:"unknown"})}function aR(e,r){return new e({type:"never",...Ve(r)})}function ix(e,r){return new Kv({check:"less_than",...Ve(r),value:e,inclusive:!1})}function a0(e,r){return new Kv({check:"less_than",...Ve(r),value:e,inclusive:!0})}function ax(e,r){return new Qv({check:"greater_than",...Ve(r),value:e,inclusive:!1})}function o0(e,r){return new Qv({check:"greater_than",...Ve(r),value:e,inclusive:!0})}function ox(e,r){return new bT({check:"multiple_of",...Ve(r),value:e})}function nw(e,r){return new ET({check:"max_length",...Ve(r),maximum:e})}function Wu(e,r){return new AT({check:"min_length",...Ve(r),minimum:e})}function rw(e,r){return new CT({check:"length_equals",...Ve(r),length:e})}function oR(e,r){return new ST({check:"string_format",format:"regex",...Ve(r),pattern:e})}function sR(e){return new TT({check:"string_format",format:"lowercase",...Ve(e)})}function lR(e){return new RT({check:"string_format",format:"uppercase",...Ve(e)})}function cR(e,r){return new NT({check:"string_format",format:"includes",...Ve(r),includes:e})}function uR(e,r){return new OT({check:"string_format",format:"starts_with",...Ve(r),prefix:e})}function fR(e,r){return new IT({check:"string_format",format:"ends_with",...Ve(r),suffix:e})}function Ds(e){return new MT({check:"overwrite",tx:e})}function dR(e){return Ds(r=>r.normalize(e))}function hR(){return Ds(e=>e.trim())}function gR(){return Ds(e=>e.toLowerCase())}function mR(){return Ds(e=>e.toUpperCase())}function pR(){return Ds(e=>C8(e))}function xR(e,r,a){return new e({type:"array",element:r,...Ve(a)})}function yR(e,r,a){return new e({type:"custom",check:"custom",fn:r,...Ve(a)})}function vR(e){const r=wR(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(Gl(s,a.value,r._zod.def));else{const f=s;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=a.value),f.inst??(f.inst=r),f.continue??(f.continue=!r._zod.def.abort),a.issues.push(Gl(f))}},e(a.value,a)));return r}function wR(e,r){const a=new gr({check:"custom",...Ve(r)});return a._zod.check=e,a}function iw(e){let r=(e==null?void 0:e.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Pl,target:r,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Bn(e,r,a={path:[],schemaPath:[]}){var T,x;var s;const f=e._zod.def,g=r.seen.get(e);if(g)return g.count++,a.schemaPath.includes(e)&&(g.cycle=a.path),g.schema;const y={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(e,y);const E=(x=(T=e._zod).toJSONSchema)==null?void 0:x.call(T);if(E)y.schema=E;else{const S={...a,schemaPath:[...a.schemaPath,e],path:a.path},R=e._zod.parent;if(R)y.ref=R,Bn(R,r,S),r.seen.get(R).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,y.schema,S);else{const k=y.schema,I=r.processors[f.type];if(!I)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${f.type}`);I(e,r,k,S)}}const A=r.metadataRegistry.get(e);return A&&Object.assign(y.schema,A),r.io==="input"&&tr(e)&&(delete y.schema.examples,delete y.schema.default),r.io==="input"&&y.schema._prefault&&((s=y.schema).default??(s.default=y.schema._prefault)),delete y.schema._prefault,r.seen.get(e).schema}function aw(e,r){var g,y,E;const a=e.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=A=>{var R;const b=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const k=(R=e.external.registry.get(A[0]))==null?void 0:R.id,I=e.external.uri??(L=>L);if(k)return{ref:I(k)};const z=A[1].defId??A[1].schema.id??`schema${e.counter++}`;return A[1].defId=z,{defId:z,ref:`${I("__shared")}#/${b}/${z}`}}if(A[1]===a)return{ref:"#"};const x=`#/${b}/`,S=A[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:x+S}},f=A=>{if(A[1].schema.$ref)return;const b=A[1],{ref:T,defId:x}=s(A);b.def={...b.schema},x&&(b.defId=x);const S=b.schema;for(const R in S)delete S[R];S.$ref=T};if(e.cycles==="throw")for(const A of e.seen.entries()){const b=A[1];if(b.cycle)throw new Error(`Cycle detected: #/${(g=b.cycle)==null?void 0:g.join("/")}/<root>
|
|
268
|
+
|
|
269
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const A of e.seen.entries()){const b=A[1];if(r===A[0]){f(A);continue}if(e.external){const x=(y=e.external.registry.get(A[0]))==null?void 0:y.id;if(r!==A[0]&&x){f(A);continue}}if((E=e.metadataRegistry.get(A[0]))==null?void 0:E.id){f(A);continue}if(b.cycle){f(A);continue}if(b.count>1&&e.reused==="ref"){f(A);continue}}}function ow(e,r){var y,E,A;const a=e.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=b=>{const T=e.seen.get(b),x=T.def??T.schema,S={...x};if(T.ref===null)return;const R=T.ref;if(T.ref=null,R){s(R);const k=e.seen.get(R).schema;k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(k)):(Object.assign(x,k),Object.assign(x,S))}T.isParent||e.override({zodSchema:b,jsonSchema:x,path:T.path??[]})};for(const b of[...e.seen.entries()].reverse())s(b[0]);const f={};if(e.target==="draft-2020-12"?f.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?f.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?f.$schema="http://json-schema.org/draft-04/schema#":e.target,(y=e.external)!=null&&y.uri){const b=(E=e.external.registry.get(r))==null?void 0:E.id;if(!b)throw new Error("Schema is missing an `id` property");f.$id=e.external.uri(b)}Object.assign(f,a.def??a.schema);const g=((A=e.external)==null?void 0:A.defs)??{};for(const b of e.seen.entries()){const T=b[1];T.def&&T.defId&&(g[T.defId]=T.def)}e.external||Object.keys(g).length>0&&(e.target==="draft-2020-12"?f.$defs=g:f.definitions=g);try{const b=JSON.parse(JSON.stringify(f));return Object.defineProperty(b,"~standard",{value:{...r["~standard"],jsonSchema:{input:Ku(r,"input"),output:Ku(r,"output")}},enumerable:!1,writable:!1}),b}catch{throw new Error("Error converting schema to JSON.")}}function tr(e,r){const a=r??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return tr(s.element,a);if(s.type==="set")return tr(s.valueType,a);if(s.type==="lazy")return tr(s.getter(),a);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return tr(s.innerType,a);if(s.type==="intersection")return tr(s.left,a)||tr(s.right,a);if(s.type==="record"||s.type==="map")return tr(s.keyType,a)||tr(s.valueType,a);if(s.type==="pipe")return tr(s.in,a)||tr(s.out,a);if(s.type==="object"){for(const f in s.shape)if(tr(s.shape[f],a))return!0;return!1}if(s.type==="union"){for(const f of s.options)if(tr(f,a))return!0;return!1}if(s.type==="tuple"){for(const f of s.items)if(tr(f,a))return!0;return!!(s.rest&&tr(s.rest,a))}return!1}const bR=(e,r={})=>a=>{const s=iw({...a,processors:r});return Bn(e,s),aw(s,e),ow(s,e)},Ku=(e,r)=>a=>{const{libraryOptions:s,target:f}=a??{},g=iw({...s??{},target:f,io:r,processors:{}});return Bn(e,g),aw(g,e),ow(g,e)},_R={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ER=(e,r,a,s)=>{const f=a;f.type="string";const{minimum:g,maximum:y,format:E,patterns:A,contentEncoding:b}=e._zod.bag;if(typeof g=="number"&&(f.minLength=g),typeof y=="number"&&(f.maxLength=y),E&&(f.format=_R[E]??E,f.format===""&&delete f.format),b&&(f.contentEncoding=b),A&&A.size>0){const T=[...A];T.length===1?f.pattern=T[0].source:T.length>1&&(f.allOf=[...T.map(x=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},AR=(e,r,a,s)=>{const f=a,{minimum:g,maximum:y,format:E,multipleOf:A,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof E=="string"&&E.includes("int")?f.type="integer":f.type="number",typeof T=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(f.minimum=T,f.exclusiveMinimum=!0):f.exclusiveMinimum=T),typeof g=="number"&&(f.minimum=g,typeof T=="number"&&r.target!=="draft-04"&&(T>=g?delete f.minimum:delete f.exclusiveMinimum)),typeof b=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(f.maximum=b,f.exclusiveMaximum=!0):f.exclusiveMaximum=b),typeof y=="number"&&(f.maximum=y,typeof b=="number"&&r.target!=="draft-04"&&(b<=y?delete f.maximum:delete f.exclusiveMaximum)),typeof A=="number"&&(f.multipleOf=A)},CR=(e,r,a,s)=>{a.type="boolean"},SR=(e,r,a,s)=>{a.not={}},TR=(e,r,a,s)=>{},RR=(e,r,a,s)=>{const f=e._zod.def,g=Fv(f.entries);g.every(y=>typeof y=="number")&&(a.type="number"),g.every(y=>typeof y=="string")&&(a.type="string"),a.enum=g},NR=(e,r,a,s)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},OR=(e,r,a,s)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},IR=(e,r,a,s)=>{const f=a,g=e._zod.def,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(f.minItems=y),typeof E=="number"&&(f.maxItems=E),f.type="array",f.items=Bn(g.element,r,{...s,path:[...s.path,"items"]})},MR=(e,r,a,s)=>{var b;const f=a,g=e._zod.def;f.type="object",f.properties={};const y=g.shape;for(const T in y)f.properties[T]=Bn(y[T],r,{...s,path:[...s.path,"properties",T]});const E=new Set(Object.keys(y)),A=new Set([...E].filter(T=>{const x=g.shape[T]._zod;return r.io==="input"?x.optin===void 0:x.optout===void 0}));A.size>0&&(f.required=Array.from(A)),((b=g.catchall)==null?void 0:b._zod.def.type)==="never"?f.additionalProperties=!1:g.catchall?g.catchall&&(f.additionalProperties=Bn(g.catchall,r,{...s,path:[...s.path,"additionalProperties"]})):r.io==="output"&&(f.additionalProperties=!1)},DR=(e,r,a,s)=>{const f=e._zod.def,g=f.inclusive===!1,y=f.options.map((E,A)=>Bn(E,r,{...s,path:[...s.path,g?"oneOf":"anyOf",A]}));g?a.oneOf=y:a.anyOf=y},BR=(e,r,a,s)=>{const f=e._zod.def,g=Bn(f.left,r,{...s,path:[...s.path,"allOf",0]}),y=Bn(f.right,r,{...s,path:[...s.path,"allOf",1]}),E=b=>"allOf"in b&&Object.keys(b).length===1,A=[...E(g)?g.allOf:[g],...E(y)?y.allOf:[y]];a.allOf=A},LR=(e,r,a,s)=>{const f=a,g=e._zod.def;f.type="object",(r.target==="draft-07"||r.target==="draft-2020-12")&&(f.propertyNames=Bn(g.keyType,r,{...s,path:[...s.path,"propertyNames"]})),f.additionalProperties=Bn(g.valueType,r,{...s,path:[...s.path,"additionalProperties"]})},kR=(e,r,a,s)=>{const f=e._zod.def,g=Bn(f.innerType,r,s),y=r.seen.get(e);r.target==="openapi-3.0"?(y.ref=f.innerType,a.nullable=!0):a.anyOf=[g,{type:"null"}]},zR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType},PR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,a.default=JSON.parse(JSON.stringify(f.defaultValue))},UR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(f.defaultValue)))},FR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType;let y;try{y=f.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=y},jR=(e,r,a,s)=>{const f=e._zod.def,g=r.io==="input"?f.in._zod.def.type==="transform"?f.out:f.in:f.out;Bn(g,r,s);const y=r.seen.get(e);y.ref=g},VR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,a.readOnly=!0},HR=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType},GR=be("ZodISODateTime",(e,r)=>{XT.init(e,r),rn.init(e,r)});function ZR(e){return Q6(GR,e)}const XR=be("ZodISODate",(e,r)=>{YT.init(e,r),rn.init(e,r)});function YR(e){return J6(XR,e)}const qR=be("ZodISOTime",(e,r)=>{qT.init(e,r),rn.init(e,r)});function WR(e){return $6(qR,e)}const KR=be("ZodISODuration",(e,r)=>{WT.init(e,r),rn.init(e,r)});function QR(e){return eR(KR,e)}const JR=(e,r)=>{Gv.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>P8(e,a)},flatten:{value:a=>z8(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,S0,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,S0,2)}},isEmpty:{get(){return e.issues.length===0}}})},Wr=be("ZodError",JR,{Parent:Error}),$R=a1(Wr),eN=o1(Wr),tN=uf(Wr),nN=ff(Wr),rN=j8(Wr),iN=V8(Wr),aN=H8(Wr),oN=G8(Wr),sN=Z8(Wr),lN=X8(Wr),cN=Y8(Wr),uN=q8(Wr),xn=be("ZodType",(e,r)=>(fn.init(e,r),Object.assign(e["~standard"],{jsonSchema:{input:Ku(e,"input"),output:Ku(e,"output")}}),e.toJSONSchema=bR(e,{}),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...a)=>e.clone(To(r,{checks:[...r.checks??[],...a.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]})),e.clone=(a,s)=>Wa(e,a,s),e.brand=()=>e,e.register=((a,s)=>(a.add(e,s),e)),e.parse=(a,s)=>$R(e,a,s,{callee:e.parse}),e.safeParse=(a,s)=>tN(e,a,s),e.parseAsync=async(a,s)=>eN(e,a,s,{callee:e.parseAsync}),e.safeParseAsync=async(a,s)=>nN(e,a,s),e.spa=e.safeParseAsync,e.encode=(a,s)=>rN(e,a,s),e.decode=(a,s)=>iN(e,a,s),e.encodeAsync=async(a,s)=>aN(e,a,s),e.decodeAsync=async(a,s)=>oN(e,a,s),e.safeEncode=(a,s)=>sN(e,a,s),e.safeDecode=(a,s)=>lN(e,a,s),e.safeEncodeAsync=async(a,s)=>cN(e,a,s),e.safeDecodeAsync=async(a,s)=>uN(e,a,s),e.refine=(a,s)=>e.check(i5(a,s)),e.superRefine=a=>e.check(a5(a)),e.overwrite=a=>e.check(Ds(a)),e.optional=()=>cx(e),e.nullable=()=>ux(e),e.nullish=()=>cx(ux(e)),e.nonoptional=a=>QN(e,a),e.array=()=>kN(e),e.or=a=>UN([e,a]),e.and=a=>jN(e,a),e.transform=a=>fx(e,ZN(a)),e.default=a=>qN(e,a),e.prefault=a=>KN(e,a),e.catch=a=>$N(e,a),e.pipe=a=>fx(e,a),e.readonly=()=>n5(e),e.describe=a=>{const s=e.clone();return Pl.add(s,{description:a}),s},Object.defineProperty(e,"description",{get(){var a;return(a=Pl.get(e))==null?void 0:a.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return Pl.get(e);const s=e.clone();return Pl.add(s,a[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),sw=be("_ZodString",(e,r)=>{s1.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>ER(e,s,f);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...s)=>e.check(oR(...s)),e.includes=(...s)=>e.check(cR(...s)),e.startsWith=(...s)=>e.check(uR(...s)),e.endsWith=(...s)=>e.check(fR(...s)),e.min=(...s)=>e.check(Wu(...s)),e.max=(...s)=>e.check(nw(...s)),e.length=(...s)=>e.check(rw(...s)),e.nonempty=(...s)=>e.check(Wu(1,...s)),e.lowercase=s=>e.check(sR(s)),e.uppercase=s=>e.check(lR(s)),e.trim=()=>e.check(hR()),e.normalize=(...s)=>e.check(dR(...s)),e.toLowerCase=()=>e.check(gR()),e.toUpperCase=()=>e.check(mR()),e.slugify=()=>e.check(pR())}),fN=be("ZodString",(e,r)=>{s1.init(e,r),sw.init(e,r),e.email=a=>e.check(O6(dN,a)),e.url=a=>e.check(L6(hN,a)),e.jwt=a=>e.check(K6(RN,a)),e.emoji=a=>e.check(k6(gN,a)),e.guid=a=>e.check(rx(sx,a)),e.uuid=a=>e.check(I6(Ru,a)),e.uuidv4=a=>e.check(M6(Ru,a)),e.uuidv6=a=>e.check(D6(Ru,a)),e.uuidv7=a=>e.check(B6(Ru,a)),e.nanoid=a=>e.check(z6(mN,a)),e.guid=a=>e.check(rx(sx,a)),e.cuid=a=>e.check(P6(pN,a)),e.cuid2=a=>e.check(U6(xN,a)),e.ulid=a=>e.check(F6(yN,a)),e.base64=a=>e.check(Y6(CN,a)),e.base64url=a=>e.check(q6(SN,a)),e.xid=a=>e.check(j6(vN,a)),e.ksuid=a=>e.check(V6(wN,a)),e.ipv4=a=>e.check(H6(bN,a)),e.ipv6=a=>e.check(G6(_N,a)),e.cidrv4=a=>e.check(Z6(EN,a)),e.cidrv6=a=>e.check(X6(AN,a)),e.e164=a=>e.check(W6(TN,a)),e.datetime=a=>e.check(ZR(a)),e.date=a=>e.check(YR(a)),e.time=a=>e.check(WR(a)),e.duration=a=>e.check(QR(a))});function Or(e){return N6(fN,e)}const rn=be("ZodStringFormat",(e,r)=>{$t.init(e,r),sw.init(e,r)}),dN=be("ZodEmail",(e,r)=>{zT.init(e,r),rn.init(e,r)}),sx=be("ZodGUID",(e,r)=>{LT.init(e,r),rn.init(e,r)}),Ru=be("ZodUUID",(e,r)=>{kT.init(e,r),rn.init(e,r)}),hN=be("ZodURL",(e,r)=>{PT.init(e,r),rn.init(e,r)}),gN=be("ZodEmoji",(e,r)=>{UT.init(e,r),rn.init(e,r)}),mN=be("ZodNanoID",(e,r)=>{FT.init(e,r),rn.init(e,r)}),pN=be("ZodCUID",(e,r)=>{jT.init(e,r),rn.init(e,r)}),xN=be("ZodCUID2",(e,r)=>{VT.init(e,r),rn.init(e,r)}),yN=be("ZodULID",(e,r)=>{HT.init(e,r),rn.init(e,r)}),vN=be("ZodXID",(e,r)=>{GT.init(e,r),rn.init(e,r)}),wN=be("ZodKSUID",(e,r)=>{ZT.init(e,r),rn.init(e,r)}),bN=be("ZodIPv4",(e,r)=>{KT.init(e,r),rn.init(e,r)}),_N=be("ZodIPv6",(e,r)=>{QT.init(e,r),rn.init(e,r)}),EN=be("ZodCIDRv4",(e,r)=>{JT.init(e,r),rn.init(e,r)}),AN=be("ZodCIDRv6",(e,r)=>{$T.init(e,r),rn.init(e,r)}),CN=be("ZodBase64",(e,r)=>{e6.init(e,r),rn.init(e,r)}),SN=be("ZodBase64URL",(e,r)=>{n6.init(e,r),rn.init(e,r)}),TN=be("ZodE164",(e,r)=>{r6.init(e,r),rn.init(e,r)}),RN=be("ZodJWT",(e,r)=>{a6.init(e,r),rn.init(e,r)}),lw=be("ZodNumber",(e,r)=>{$v.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>AR(e,s,f),e.gt=(s,f)=>e.check(ax(s,f)),e.gte=(s,f)=>e.check(o0(s,f)),e.min=(s,f)=>e.check(o0(s,f)),e.lt=(s,f)=>e.check(ix(s,f)),e.lte=(s,f)=>e.check(a0(s,f)),e.max=(s,f)=>e.check(a0(s,f)),e.int=s=>e.check(lx(s)),e.safe=s=>e.check(lx(s)),e.positive=s=>e.check(ax(0,s)),e.nonnegative=s=>e.check(o0(0,s)),e.negative=s=>e.check(ix(0,s)),e.nonpositive=s=>e.check(a0(0,s)),e.multipleOf=(s,f)=>e.check(ox(s,f)),e.step=(s,f)=>e.check(ox(s,f)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function cw(e){return tR(lw,e)}const NN=be("ZodNumberFormat",(e,r)=>{o6.init(e,r),lw.init(e,r)});function lx(e){return nR(NN,e)}const ON=be("ZodBoolean",(e,r)=>{s6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>CR(e,a,s)});function IN(e){return rR(ON,e)}const MN=be("ZodUnknown",(e,r)=>{l6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>TR()});function R0(){return iR(MN)}const DN=be("ZodNever",(e,r)=>{c6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>SR(e,a,s)});function BN(e){return aR(DN,e)}const LN=be("ZodArray",(e,r)=>{u6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>IR(e,a,s,f),e.element=r.element,e.min=(a,s)=>e.check(Wu(a,s)),e.nonempty=a=>e.check(Wu(1,a)),e.max=(a,s)=>e.check(nw(a,s)),e.length=(a,s)=>e.check(rw(a,s)),e.unwrap=()=>e.element});function kN(e,r){return xR(LN,e,r)}const zN=be("ZodObject",(e,r)=>{d6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>MR(e,a,s,f),Vt(e,"shape",()=>r.shape),e.keyof=()=>Zl(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:R0()}),e.loose=()=>e.clone({...e._zod.def,catchall:R0()}),e.strict=()=>e.clone({...e._zod.def,catchall:BN()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>M8(e,a),e.safeExtend=a=>D8(e,a),e.merge=a=>B8(e,a),e.pick=a=>O8(e,a),e.omit=a=>I8(e,a),e.partial=(...a)=>L8(uw,e,a[0]),e.required=(...a)=>k8(fw,e,a[0])});function si(e,r){const a={type:"object",shape:e??{},...Ve(r)};return new zN(a)}const PN=be("ZodUnion",(e,r)=>{h6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>DR(e,a,s,f),e.options=r.options});function UN(e,r){return new PN({type:"union",options:e,...Ve(r)})}const FN=be("ZodIntersection",(e,r)=>{g6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>BR(e,a,s,f)});function jN(e,r){return new FN({type:"intersection",left:e,right:r})}const VN=be("ZodRecord",(e,r)=>{m6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>LR(e,a,s,f),e.keyType=r.keyType,e.valueType=r.valueType});function HN(e,r,a){return new VN({type:"record",keyType:e,valueType:r,...Ve(a)})}const N0=be("ZodEnum",(e,r)=>{p6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>RR(e,s,f),e.enum=r.entries,e.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));e.extract=(s,f)=>{const g={};for(const y of s)if(a.has(y))g[y]=r.entries[y];else throw new Error(`Key ${y} not found in enum`);return new N0({...r,checks:[],...Ve(f),entries:g})},e.exclude=(s,f)=>{const g={...r.entries};for(const y of s)if(a.has(y))delete g[y];else throw new Error(`Key ${y} not found in enum`);return new N0({...r,checks:[],...Ve(f),entries:g})}});function Zl(e,r){const a=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new N0({type:"enum",entries:a,...Ve(r)})}const GN=be("ZodTransform",(e,r)=>{x6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>OR(e,a),e._zod.parse=(a,s)=>{if(s.direction==="backward")throw new Pv(e.constructor.name);a.addIssue=g=>{if(typeof g=="string")a.issues.push(Gl(g,a.value,r));else{const y=g;y.fatal&&(y.continue=!1),y.code??(y.code="custom"),y.input??(y.input=a.value),y.inst??(y.inst=e),a.issues.push(Gl(y))}};const f=r.transform(a.value,a);return f instanceof Promise?f.then(g=>(a.value=g,a)):(a.value=f,a)}});function ZN(e){return new GN({type:"transform",transform:e})}const uw=be("ZodOptional",(e,r)=>{y6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>HR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function cx(e){return new uw({type:"optional",innerType:e})}const XN=be("ZodNullable",(e,r)=>{v6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>kR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function ux(e){return new XN({type:"nullable",innerType:e})}const YN=be("ZodDefault",(e,r)=>{w6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>PR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qN(e,r){return new YN({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Vv(r)}})}const WN=be("ZodPrefault",(e,r)=>{b6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>UR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function KN(e,r){return new WN({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():Vv(r)}})}const fw=be("ZodNonOptional",(e,r)=>{_6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>zR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function QN(e,r){return new fw({type:"nonoptional",innerType:e,...Ve(r)})}const JN=be("ZodCatch",(e,r)=>{E6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>FR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $N(e,r){return new JN({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const e5=be("ZodPipe",(e,r)=>{A6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>jR(e,a,s,f),e.in=r.in,e.out=r.out});function fx(e,r){return new e5({type:"pipe",in:e,out:r})}const t5=be("ZodReadonly",(e,r)=>{C6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>VR(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function n5(e){return new t5({type:"readonly",innerType:e})}const r5=be("ZodCustom",(e,r)=>{S6.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>NR(e,a)});function i5(e,r={}){return yR(r5,e,r)}function a5(e){return vR(e)}const Dn=Or().trim().min(4).max(8).regex(/^[A-Z0-9]+$/,{message:"room code must contain only A-Z or 0-9"}),o5=si({roomId:Dn,controllerId:Or().min(3),input:HN(Or(),R0())}),s5=si({roomId:Dn,state:si({orientation:Zl(["portrait","landscape"]).optional(),message:Or().optional(),gameState:Zl(["paused","playing"]).optional()})}),l5=si({roomId:Dn,maxPlayers:cw().int().min(1).max(16).default(8),apiKey:Or().optional(),mode:Zl(["master","child"]).default("child"),controllerUrl:Or().url().optional()}),c5=si({roomId:Dn,controllerId:Or().min(3),nickname:Or().trim().min(1).max(24).optional()});si({roomId:Dn,controllerId:Or().min(3)});const dw=si({roomId:Dn,command:Zl(["exit","ready","toggle_pause"])});si({roomId:Dn,apiKey:Or().optional()});si({roomId:Dn,gameId:Or(),gameUrl:Or().url()});si({roomId:Dn,joinToken:Or()});const u5=e=>!!(e.startsWith("192.168.64.")||e.startsWith("192.168.65.")||e.startsWith("172.17.")||e.startsWith("172.18.")||e.startsWith("172.19.")||e.startsWith("169.254.")),f5=e=>{if(e.startsWith("192.168.")){const r=e.split("."),a=parseInt(r[2]||"0",10);return a<64?100-a:10}return e.startsWith("10.")?50:/^172\.(1[6-9]|2[0-9]|3[01])\./.test(e)?30:0},d5=()=>new Promise(e=>{if(typeof window>"u"||typeof RTCPeerConnection>"u"){e(null);return}const r=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),a=[];let s=!1;const f=E=>{r.close(),e(E)},g=setTimeout(()=>{s?y():setTimeout(()=>{y()},500)},3e3),y=()=>{if(a.length===0){f(null);return}a.sort((A,b)=>b.score-A.score);const E=a[0];clearTimeout(g),f(E.ip)};r.onicecandidate=E=>{if(E.candidate){const b=E.candidate.candidate.match(/([0-9]{1,3}(\.[0-9]{1,3}){3})/);if(b){const T=b[1];if(T==="127.0.0.1")return;if((T.startsWith("192.168.")||T.startsWith("10.")||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(T))&&!u5(T)){const S=f5(T);a.push({ip:T,score:S})}}}else s=!0,setTimeout(()=>{y()},200)},r.createDataChannel(""),r.createOffer().then(E=>r.setLocalDescription(E)).catch(()=>{clearTimeout(g),f(null)})});class h5{constructor(){qi(this,"cachedLocalIp",null);qi(this,"ipDetectionPromise",null)}async getLocalIp(){return this.cachedLocalIp!==null?this.cachedLocalIp:this.ipDetectionPromise!==null?this.ipDetectionPromise:(this.ipDetectionPromise=d5().then(r=>(this.cachedLocalIp=r,this.ipDetectionPromise=null,r)),this.ipDetectionPromise)}clearCache(){this.cachedLocalIp=null,this.ipDetectionPromise=null}async normalizeForMobile(r){if(typeof window>"u")return r;try{const a=new URL(r);if(a.hostname==="localhost"||a.hostname==="127.0.0.1"){const s=await this.getLocalIp();return s?(a.hostname=s,a.toString()):(a.hostname=window.location.hostname,a.toString())}return r}catch{return r}}async buildControllerUrl(r,a){const s=(a==null?void 0:a.path)||Px;if(a!=null&&a.host){const y=new URL(s,this.normalizeOrigin(a.host));return y.searchParams.set("room",r),y.toString()}let f;if(typeof window>"u")f=`http://localhost:${Ul}`;else{const y=new URL(window.location.href);if(!this.isLocalhost(y.hostname))f=y.origin;else{const E=await this.getLocalIp();if(E){const A=y.port;f=A?`http://${E}:${A}`:`http://${E}`}else f=y.origin}}const g=new URL(s,f);return g.searchParams.set("room",r),g.toString()}resolveServerUrl(r){if(r)return this.normalizeOrigin(r);if(typeof window<"u"){const a=new URL(window.location.href);return a.port=String(Ul),a.origin}return`http://localhost:${Ul}`}isLocalhost(r){return r==="localhost"||r==="127.0.0.1"||r==="[::1]"}normalizeOrigin(r){return r.includes("://")?r:`http://${r}`}}const hw=new h5,g5=e=>{try{const s=new URL(e).searchParams.get("room");if(s){const f=Dn.safeParse(s.toUpperCase());if(f.success)return f.data}}catch{}const r=Dn.safeParse(e.trim().toUpperCase());return r.success?r.data:null},m5=({isOpen:e,onClose:r,onScan:a,currentRoomId:s})=>{const[f,g]=B.useState(""),[y,E]=B.useState(!1),[A,b]=B.useState(""),[T,x]=B.useState(!1),S=B.useRef(null),R=B.useRef(null),k=B.useRef(!1);B.useEffect(()=>{if(e&&!k.current){const j=s||"";setTimeout(()=>{var ae,ee;E(!1),g(j),(ae=R.current)==null||ae.focus(),(ee=R.current)==null||ee.select()},0)}k.current=e},[e,s]),B.useEffect(()=>{(async()=>{const ae=f.trim().toUpperCase(),ee=Dn.safeParse(ae);if(ee.success)try{const X=await hw.buildControllerUrl(ee.data);b(X)}catch{b("")}else b("")})()},[f]),B.useEffect(()=>{if(!e&&(setTimeout(()=>{E(!1)},0),S.current)){const j=S.current;j.stop().catch(()=>{}).finally(()=>{try{j.clear()}catch{}}),S.current=null}},[e]),B.useEffect(()=>{if(!e)return;const j="qr-reader";let ae=null,ee=!1,X=!0;const de=async()=>{var Oe;try{const ue=document.getElementById(j);if(!ue)return;const $=ue.getBoundingClientRect();if($.width===0||$.height===0)return;ae=new H2(j),S.current=ae;let pe=null;try{const re=await H2.getCameras();if(re&&re.length>0){const ne=re.find(Me=>Me.label.toLowerCase().includes("back")||Me.label.toLowerCase().includes("rear"));pe=((Oe=re.find(Me=>{const He=Me.label.toLowerCase();return He.includes("environment")||He.includes("facing back")})||ne||re[0])==null?void 0:Oe.id)||null}}catch{}const Ce=pe?{deviceId:{exact:pe}}:{facingMode:"environment"};await ae.start(Ce,{fps:10,qrbox:(re,ne)=>{const xe=Math.min(re,ne),Me=Math.min(250,xe*.8);return{width:Me,height:Me}},aspectRatio:1},re=>{if(!X)return;const ne=g5(re);ne&&(g(ne),ee=!1,ae==null||ae.stop().catch(()=>{}).finally(()=>{X&&E(!1)}))},()=>{}),ee=!0,X&&E(!0)}catch{if(X&&E(!1),ae)try{ae.clear()}catch{}S.current=null}},Q=setTimeout(()=>{de()},200);return()=>{if(X=!1,clearTimeout(Q),ae&&ee)ae.stop().catch(()=>{}).finally(()=>{try{ae==null||ae.clear()}catch{}});else if(ae)try{ae.clear()}catch{}S.current=null}},[e]);const I=()=>{const j=f.trim().toUpperCase(),ae=Dn.safeParse(j);ae.success&&(a(ae.data),r())},z=j=>{j.target.select()},L=j=>{g(j.target.value.toUpperCase()),x(!1)},Z=async()=>{if(A)try{await navigator.clipboard.writeText(A),x(!0),setTimeout(()=>x(!1),2e3)}catch{const j=document.createElement("textarea");j.value=A,j.style.position="fixed",j.style.opacity="0",document.body.appendChild(j),j.select();try{document.execCommand("copy"),x(!0),setTimeout(()=>x(!1),2e3)}catch{}document.body.removeChild(j)}};if(!e)return null;const H=f.trim().length>0;return F.jsxs("div",{className:"bg-background fixed inset-0 z-50 flex flex-col items-center justify-center",children:[F.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center",children:[y&&F.jsx("div",{className:"relative flex aspect-square w-full items-center justify-center overflow-hidden p-6",children:F.jsx("div",{id:"qr-reader",className:"h-full w-full overflow-hidden rounded-lg bg-black"})}),F.jsx("div",{className:"w-full max-w-md px-6",children:F.jsx("input",{ref:R,type:"text",value:f,onChange:L,onFocus:z,onKeyDown:j=>{j.key==="Enter"&&H&&I()},placeholder:"Enter room code",className:"border-border bg-background focus:ring-primary focus:border-primary w-full rounded-lg border-2 px-6 py-4 text-center font-mono text-2xl focus:ring-2 focus:outline-none",autoComplete:"off",autoCapitalize:"characters"})}),A&&F.jsx("div",{className:"mt-4 w-full max-w-md px-6 pb-2",children:F.jsx("button",{type:"button",onClick:Z,className:"text-muted-foreground hover:text-foreground bg-muted/50 hover:bg-muted w-full rounded-lg px-4 py-3 text-center font-mono text-xs break-all transition-colors",children:T?"✓ Copied!":A})})]}),F.jsxs("div",{className:"flex w-full max-w-md gap-4 px-6 pb-6",children:[F.jsx(Yr,{type:"button",variant:"outline",onClick:r,className:"flex-1 py-6",children:"Cancel"}),F.jsx(Yr,{type:"button",onClick:I,disabled:!H,className:"flex-1 py-6",children:"Connect"})]})]})},dx=e=>{switch(e){case"connected":return"Connected to host";case"connecting":return"Connecting…";case"reconnecting":return"Trying to reconnect…";case"disconnected":return"Disconnected";case"idle":default:return"Idle"}},p5=e=>e==="any"||typeof window>"u"||!window.matchMedia?!0:window.matchMedia(`(orientation: ${e})`).matches,x5=({roomId:e,connectionStatus:r,requiredOrientation:a="landscape",children:s,gameState:f="paused",onTogglePlayPause:g,onReconnect:y,onRefresh:E,customActions:A})=>{const b=B.useMemo(()=>$0()==="platform",[]),[T,x]=B.useState(()=>p5(a)),[S,R]=B.useState(!1),{isFullscreen:k,toggleFullscreen:I}=Q4(),{store:z}=Wl(),{controllerId:L,players:Z}=As(z,ef(ee=>({controllerId:ee.controllerId,players:ee.players}))),H=B.useMemo(()=>{if(!L)return null;const ee=Z.find(X=>X.id===L);return!ee&&r==="connected"&&Z.length>0,ee||null},[L,Z,r]);B.useEffect(()=>{if(a==="any")return;const ee=window.matchMedia(`(orientation: ${a})`),X=()=>x(ee.matches);return X(),ee.addEventListener("change",X),()=>ee.removeEventListener("change",X)},[a]);const j=a==="any"?!0:T,ae=B.useMemo(()=>{switch(r){case"connected":return"bg-green-500";case"connecting":case"reconnecting":return"bg-yellow-500";case"disconnected":default:return"bg-red-500"}},[r]);return b?F.jsx("div",{className:"dark",children:F.jsx("div",{className:"text-foreground relative flex h-dvh w-dvw touch-none flex-col overflow-hidden bg-transparent select-none",children:F.jsxs("main",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-2 select-none sm:p-4",children:[!j&&F.jsxs("div",{className:"bg-background/95 absolute inset-0 z-50 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[F.jsx("p",{className:"text-card-foreground text-xl font-semibold",children:"Rotate your device"}),F.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["This game is best experienced in ",a," ","orientation."]})]}),F.jsx("div",{className:Wt("h-full w-full select-none",!j&&"pointer-events-none opacity-30"),children:s})]})})}):F.jsx("div",{className:"dark",children:F.jsxs("div",{className:"bg-background text-foreground relative flex h-dvh w-dvw touch-none flex-col overflow-hidden select-none",children:[F.jsxs("header",{className:"pointer-events-none sticky top-0 z-50 flex items-center justify-between border-b px-6 py-2",children:[F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[typeof window<"u"&&(H||L)&&F.jsxs("div",{className:"relative",title:dx(r),children:[H?F.jsx(jl,{player:H,size:"sm"}):L?F.jsx(jl,{player:{id:L,label:"Player"},size:"sm"}):null,F.jsx("span",{className:"absolute right-0 bottom-0 h-3 w-3 rounded-full bg-black","aria-hidden":"true"}),F.jsx("span",{className:Wt("absolute right-0.5 bottom-0.5 h-2 w-2 rounded-full",ae,r==="connected"&&"animate-pulse"),"aria-label":dx(r)})]}),F.jsxs("div",{children:[F.jsx("p",{className:"text-muted-foreground text-xs tracking-[0.24em] uppercase",children:"Room"}),F.jsx("p",{className:"text-foreground text-lg font-semibold",children:typeof window<"u"?e??"N/A":"N/A"})]})]}),F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[A,E&&e&&F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:E,disabled:r==="connecting"||r==="reconnecting","aria-label":"Reconnect",title:"Reconnect to room",children:F.jsx(tA,{className:Wt("h-5 w-5",(r==="connecting"||r==="reconnecting")&&"animate-spin")})}),y&&F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:()=>R(!0),"aria-label":"Scan QR code to reconnect",title:"Scan QR code to reconnect",children:F.jsx(ry,{className:"h-5 w-5"})}),g&&F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:g,"aria-label":f==="playing"?"Pause":"Play",title:f==="playing"?"Pause":"Play",children:f==="playing"?F.jsx(ny,{className:"h-5 w-5"}):F.jsx(ku,{className:"h-5 w-5"})}),F.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:()=>I(),"aria-label":k?"Exit fullscreen":"Enter fullscreen",title:k?"Exit fullscreen":"Enter fullscreen",children:k?F.jsx(XE,{className:"h-5 w-5"}):F.jsx(GE,{className:"h-5 w-5"})})]})]}),F.jsx("div",{className:"pointer-events-none fixed right-4 bottom-4 z-50",children:F.jsx("div",{className:"pointer-events-auto",children:F.jsx(Bv,{compact:!0})})}),F.jsx("main",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-2 select-none sm:p-4",children:F.jsxs("div",{className:"bg-card/95 absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[!j&&F.jsxs("div",{className:"bg-background/95 absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[F.jsx("p",{className:"text-card-foreground text-xl font-semibold",children:"Rotate your device"}),F.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["This game is best experienced in ",a," ","orientation."]})]}),F.jsx("div",{className:Wt("h-full w-full select-none",!j&&"pointer-events-none opacity-30"),children:s})]})}),y&&F.jsx(m5,{isOpen:S,onClose:()=>R(!1),onScan:ee=>{y(ee),R(!1)},currentRoomId:e})]})})},Vl="ABCDEFGHJKLMNPQRSTUVWXYZ23456789",y5=()=>{const e=new Uint32Array(4);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(let a=0;a<e.length;a+=1)e[a]=Math.floor(Math.random()*Vl.length);const r=Array.from(e,a=>Vl[a%Vl.length]).join("");return Dn.parse(r)},v5=()=>{const e=Math.floor(Date.now()%1e5).toString().padStart(5,"0");return`C${Vl[Math.floor(Math.random()*Vl.length)]}${e}`},w5=()=>{if(typeof window>"u")return null;const r=new URLSearchParams(window.location.search).get("room");return r?r.toUpperCase():null},b5=(e={})=>{const{store:r,getSocket:a,disconnectSocket:s}=Wl(),f=B.useRef(e.nickname??""),g=B.useMemo(()=>{if(typeof window>"u")return null;const j=new URLSearchParams(window.location.search),ae=j.get("aj_room"),ee=j.get("aj_controller_id");return ae&&ee?{room:ae,controllerId:ee}:null},[]),y=B.useMemo(()=>{const j=(g==null?void 0:g.room)??e.roomId??w5();if(!j)return null;try{return Dn.parse(j.toUpperCase())}catch{return null}},[e.roomId,g]),E=B.useMemo(()=>{if(g!=null&&g.controllerId)return g.controllerId;if(e.controllerId)return e.controllerId;if(typeof window<"u"){const ae=new URLSearchParams(window.location.search).get("controllerId");if(ae)return ae}return v5()},[e.controllerId,g]),A=B.useRef(e.onState);B.useEffect(()=>{A.current=e.onState},[e.onState]);const b=As(r,ef(j=>({connectionStatus:j.connectionStatus,lastError:j.lastError,controllerId:j.controllerId,players:j.players,gameState:j.gameState,stateMessage:j.stateMessage}))),[T,x]=B.useState(0),S=B.useCallback(()=>{y&&(s("controller"),x(j=>j+1))},[y,s]),R=B.useMemo(()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).get("airjam_mode")==="child",[]),k=B.useMemo(()=>e.forceConnect||g?!0:typeof window<"u"?new URLSearchParams(window.location.search).get("airjam_force_connect")==="true":!1,[e.forceConnect,g]),I=B.useMemo(()=>!R||k,[R,k]),z=B.useMemo(()=>I&&y?a("controller"):null,[I,y,a]);B.useEffect(()=>{if(!z)return;const j=ae=>{if(ae.type!=="HAPTIC"||typeof navigator>"u"||!navigator.vibrate)return;const ee=ae.payload;switch(ee.pattern){case"light":navigator.vibrate(10);break;case"medium":navigator.vibrate(30);break;case"heavy":navigator.vibrate([50,20,50]);break;case"success":navigator.vibrate([10,30,10]);break;case"failure":navigator.vibrate([50,50,50,50]);break;case"custom":(Array.isArray(ee.sequence)||typeof ee.sequence=="number")&&navigator.vibrate(ee.sequence);break}};return z.on("server:signal",j),()=>{z.off("server:signal",j)}},[z]),B.useEffect(()=>{const j=r.getState();if(j.setMode($0()),j.setRole("controller"),j.setRoomId(y),j.setStatus(y?"connecting":"idle"),j.setError(void 0),!I){j.setStatus("connected");const ue=$=>{var Ce;if($.source!==window.parent)return;const pe=$.data;if((pe==null?void 0:pe.type)==="AIRJAM_STATE"){const re=pe.payload;re.gameState&&j.setGameState(re.gameState),re.message!==void 0&&j.setStateMessage(re.message),(Ce=A.current)==null||Ce.call(A,re)}};return window.addEventListener("message",ue),window.parent.postMessage({type:"AIRJAM_READY"},"*"),()=>{window.removeEventListener("message",ue),j.setStatus("disconnected")}}if(!y||!z||!E){j.setStatus("idle");return}j.setControllerId(E);const ae=()=>{if(r.getState().setStatus("connected"),g)return;const ue=c5.parse({roomId:y,controllerId:E,nickname:f.current||void 0});z.emit("controller:join",ue,$=>{const pe=r.getState();if(!$.ok){pe.setError($.message??"Unable to join room"),pe.setStatus("disconnected");return}$.controllerId&&pe.setControllerId($.controllerId),pe.setStatus("connected")})},ee=()=>{r.getState().setStatus("disconnected")},X=ue=>{const $=r.getState(),pe=$.roomId;if(!(pe&&ue.roomId.toUpperCase()!==pe.toUpperCase())){if(!pe&&ue.roomId&&$.setRoomId(ue.roomId),!ue.player){$.setError("Welcome message received but no player profile included.");return}$.upsertPlayer(ue.player)}},de=ue=>{var pe;if(ue.roomId!==y)return;const $=r.getState();ue.state.gameState&&$.setGameState(ue.state.gameState),ue.state.message!==void 0&&$.setStateMessage(ue.state.message),(pe=A.current)==null||pe.call(A,ue.state)},Q=ue=>{const $=r.getState();$.setError(ue.reason),$.setStatus("disconnected"),$.resetGameState(),setTimeout(()=>{s("controller"),x(pe=>pe+1)},1e3)},Oe=ue=>{r.getState().setError(ue.message)};return z.on("connect",ae),z.on("disconnect",ee),z.on("server:welcome",X),z.on("server:state",de),z.on("server:hostLeft",Q),z.on("server:error",Oe),z.connect(),()=>{z.off("connect",ae),z.off("disconnect",ee),z.off("server:welcome",X),z.off("server:state",de),z.off("server:hostLeft",Q),z.off("server:error",Oe)}},[y,T,I,z,E,g,r,s]);const L=B.useCallback(j=>{f.current=j},[]),Z=B.useCallback(j=>{const ae=r.getState();if(!I)return typeof window<"u"&&window.parent.postMessage({type:"AIRJAM_INPUT",payload:j},"*"),!0;if(!y||!ae.controllerId||!z)return ae.setError("Not connected to a room"),!1;if(!z.connected)return!1;if(typeof j!="object"||j===null||Array.isArray(j))return ae.setError("Input must be an object"),!1;const ee=o5.safeParse({roomId:y,controllerId:ae.controllerId,input:j});return ee.success?(z.emit("controller:input",ee.data),!0):(ae.setError(ee.error.message),!1)},[y,I,z,r]),H=B.useCallback(j=>{const ae=r.getState();if(!I||!y||!ae.controllerId||!z||!z.connected)return;const ee=dw.safeParse({roomId:y,command:j});ee.success&&z.emit("controller:system",ee.data)},[y,I,z,r]);return{roomId:y,controllerId:b.controllerId,connectionStatus:b.connectionStatus,lastError:b.lastError,gameState:b.gameState,stateMessage:b.stateMessage,sendInput:Z,sendSystemCommand:H,setNickname:L,reconnect:S,players:b.players,socket:z}},_5=(e={})=>{const{config:r,store:a,getSocket:s,disconnectSocket:f,inputManager:g}=Wl(),y=B.useMemo(()=>{if(typeof window>"u")return null;const ue=new URLSearchParams(window.location.search),$=ue.get("aj_room"),pe=ue.get("aj_token");return $&&pe?{room:$,token:pe}:null},[]),E=!!y,A=!0,[b]=B.useState(()=>y5()),T=B.useMemo(()=>{if(y)return Dn.parse(y.room.toUpperCase());if(typeof window<"u"){const $=new URLSearchParams(window.location.search).get("room");if($){const pe=Dn.safeParse($.toUpperCase());if(pe.success)return pe.data}}return e.roomId?Dn.parse(e.roomId.toUpperCase()):b},[e.roomId,b,y]);B.useEffect(()=>{g&&g.setRoomId(T)},[g,T]);const[x,S]=B.useState(""),R=B.useRef(e.onPlayerJoin),k=B.useRef(e.onPlayerLeave),I=B.useRef(e.onChildClose);B.useEffect(()=>{R.current=e.onPlayerJoin,k.current=e.onPlayerLeave,I.current=e.onChildClose},[e.onPlayerJoin,e.onPlayerLeave,e.onChildClose]);const z=As(a,ef(ue=>({connectionStatus:ue.connectionStatus,lastError:ue.lastError,players:ue.players,gameState:ue.gameState,mode:ue.mode}))),L=B.useMemo(()=>s("host"),[A,s]),[Z,H]=B.useState(0),j=B.useCallback(()=>{const ue=Date.now();if(ue-Z<A3||(H(ue),!L||!L.connected))return;const $=dw.safeParse({roomId:T,command:"toggle_pause"});$.success&&L.emit("host:system",$.data)},[L,T,Z]),ae=B.useCallback(ue=>{if(!L||!L.connected)return!1;const $=s5.safeParse({roomId:T,state:ue});return $.success?(L.emit("host:state",$.data),!0):!1},[L,T]),ee=B.useCallback((ue,$,pe)=>{if(!L||!L.connected)return;const Ce={targetId:pe,type:ue,payload:$};L.emit("host:signal",Ce)},[L]),X=B.useCallback(()=>{f("host"),L&&L.connect()},[L,f]);B.useEffect(()=>{(async()=>{const ue=await hw.buildControllerUrl(T,{path:r.controllerPath,host:r.publicHost});S(ue)})()},[T,r.controllerPath,r.publicHost]);const de=As(a,ue=>ue.setRegisteredRoomId);B.useEffect(()=>{const ue=a.getState();if(ue.setMode($0()),ue.setRole("host"),ue.setRoomId(T),ue.setStatus("connecting"),ue.setError(void 0),!L){ue.setStatus("idle");return}const $=async()=>{const se=a.getState();if(!(a.getState().registeredRoomId===T&&L.connected))if(y){const Ie=Dn.parse(y.room.toUpperCase()),Ue={roomId:Ie,joinToken:y.token};L.emit("host:joinAsChild",Ue,Te=>{if(!Te.ok){se.setError(Te.message??"Failed to join as child"),se.setStatus("disconnected"),de(null);return}se.setStatus("connected"),se.setRoomId(Ie),de(Ie)})}else{const Ie=l5.parse({roomId:T,maxPlayers:e.maxPlayers??r.maxPlayers,apiKey:e.apiKey??r.apiKey});L.emit("host:register",Ie,Ue=>{if(!Ue.ok){se.setError(Ue.message??"Failed to register host"),se.setStatus("disconnected"),de(null);return}se.setStatus("connected"),Ue.roomId?(se.setRoomId(Ue.roomId),de(Ue.roomId)):de(T)})}},pe=()=>{a.getState().setStatus("connected"),$()},Ce=()=>{a.getState().setStatus("disconnected")},re=se=>{se.player&&(a.getState().upsertPlayer(se.player),setTimeout(()=>{var Se;(Se=R.current)==null||Se.call(R,se.player)},0))},ne=se=>{var Se;a.getState().removePlayer(se.controllerId),(Se=k.current)==null||Se.call(k,se.controllerId)},xe=se=>{g&&g.handleInput(se)},Me=()=>{var se;(se=I.current)==null||se.call(I)},He=se=>{if(se.roomId!==T)return;const Se=a.getState();se.state.gameState&&Se.setGameState(se.state.gameState),se.state.message!==void 0&&Se.setStateMessage(se.state.message)},Ye=se=>{a.getState().setError(se.message)};L.on("connect",pe),L.on("disconnect",Ce),L.on("server:controllerJoined",re),L.on("server:controllerLeft",ne),L.on("server:input",xe),L.on("server:error",Ye),L.on("server:closeChild",Me),L.on("server:state",He),L.connect();const W=a.getState().registeredRoomId;return L.connected&&W!==T&&$(),W&&W!==T&&de(null),()=>{L.off("connect",pe),L.off("disconnect",Ce),L.off("server:controllerJoined",re),L.off("server:controllerLeft",ne),L.off("server:input",xe),L.off("server:error",Ye),L.off("server:closeChild",Me),L.off("server:state",He)}},[r.maxPlayers,r.apiKey,e.maxPlayers,e.apiKey,T,y,A,L,a,g,de]);const Q=L??s("host"),Oe=B.useCallback(ue=>{if(g)return g.getInput(ue)},[g]);return{roomId:T,joinUrl:x,connectionStatus:z.connectionStatus,players:z.players,lastError:z.lastError,mode:z.mode,gameState:z.gameState,toggleGameState:j,sendState:ae,sendSignal:ee,reconnect:X,socket:Q,isChildMode:E,getInput:Oe}};function E5(e){const r=z0((s,f,g)=>{const y=e(s,f,g);return{...y,actions:{...y.actions,_syncState:E=>{s(E)}}}});return(s=f=>f)=>{const f=r(s),{getSocket:g}=Wl(),y=kp(b=>b.role),E=kp(b=>b.roomId),A=g(y==="host"?"host":"controller");if(B.useEffect(()=>{if(!(!A||!E||!y)){if(y==="host"){const b=r.subscribe(x=>{const{actions:S,...R}=x;A.emit("host:state_sync",{roomId:E,data:R})}),T=x=>{const{actionName:S,args:R,controllerId:k}=x,I=r.getState().actions[S];I&&I(...R,k)};return A.on("airjam:action_rpc",T),()=>{b(),A.off("airjam:action_rpc",T)}}if(y==="controller"){const b=T=>{const{data:x}=T,R=r.getState().actions;R._syncState?R._syncState(x):r.setState(x)};return A.on("airjam:state_sync",b),()=>A.off("airjam:state_sync",b)}}},[A,y,E]),y==="controller"&&A&&E){let b=null;if(typeof f=="object"&&f!==null&&"actions"in f)b=f.actions;else if(typeof f=="object"&&f!==null){const T=r.getState();if(T.actions){const x=Object.keys(f),S=Object.keys(T.actions);x.length>0&&x.every(R=>typeof f[R]=="function"&&S.includes(R))&&(b=f)}}if(b){const T={};return Object.keys(b).forEach(x=>{T[x]=(...S)=>{A.emit("controller:action_rpc",{roomId:E,actionName:x,args:S})}}),typeof f=="object"&&f!==null&&"actions"in f?{...f,actions:T}:T}}return f}}const Ji=E5(e=>({phase:"lobby",scores:{team1:0,team2:0},teamAssignments:{},actions:{joinTeam:(r,a)=>{a&&e(s=>({teamAssignments:{...s.teamAssignments,[a]:r}}))},setPhase:r=>e({phase:r}),resetGame:()=>e({scores:{team1:0,team2:0},phase:"lobby",teamAssignments:{}}),scorePoint:r=>e(a=>({scores:{...a.scores,[r]:a.scores[r]+1}}))}})),A5="#f97316",C5="#38bdf8";function S5(){const e=b5(),r=B.useRef(0),a=Ji(y=>y.phase),s=Ji(y=>y.teamAssignments),f=Ji(y=>y.actions),g=e.controllerId?s[e.controllerId]:null;return B.useEffect(()=>{if(e.connectionStatus!=="connected"||e.gameState!=="playing")return;let y;const E=()=>{e.sendInput({direction:r.current,action:!1}),console.log("directionRef.current",r.current),y=requestAnimationFrame(E)};return E(),()=>cancelAnimationFrame(y)},[e.connectionStatus,e.gameState,e]),F.jsxs("div",{className:"dark",children:[F.jsx("div",{className:"fixed top-20 right-4 z-50",children:F.jsx(Qy,{state:Ji(y=>y),title:"Pong Game State"})}),F.jsx(x5,{connectionStatus:e.connectionStatus,roomId:e.roomId,requiredOrientation:"portrait",gameState:e.gameState,onTogglePlayPause:()=>e.sendSystemCommand("toggle_pause"),onReconnect:()=>e.reconnect(),onRefresh:()=>window.location.reload(),children:a==="lobby"?F.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-2",children:[F.jsx("button",{type:"button",className:`flex-1 touch-none rounded-xl text-4xl font-bold text-white shadow-lg transition-all hover:opacity-90 active:scale-95 ${g==="team1"?"ring-4 ring-white ring-offset-2 ring-offset-zinc-900":"opacity-70"}`,style:{backgroundColor:g==="team1"?A5:"#3f3f46"},onTouchStart:()=>f.joinTeam("team1"),onMouseDown:()=>f.joinTeam("team1"),children:"SOLARIS"}),F.jsx("button",{type:"button",className:`flex-1 touch-none rounded-xl text-4xl font-bold text-white shadow-lg transition-all hover:opacity-90 active:scale-95 ${g==="team2"?"ring-4 ring-white ring-offset-2 ring-offset-zinc-900":"opacity-70"}`,style:{backgroundColor:g==="team2"?C5:"#3f3f46"},onTouchStart:()=>f.joinTeam("team2"),onMouseDown:()=>f.joinTeam("team2"),children:"NEBULON"})]}):F.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-2",children:[F.jsx("button",{type:"button",className:"flex-1 touch-none rounded-xl bg-zinc-800 text-4xl font-bold text-white shadow-lg transition-all hover:bg-zinc-700 active:scale-95 active:bg-zinc-700",onTouchStart:()=>r.current=-1,onTouchEnd:()=>r.current=0,onMouseDown:()=>r.current=-1,onMouseUp:()=>r.current=0,children:"▲ UP"}),F.jsx("button",{type:"button",className:"flex-1 touch-none rounded-xl bg-zinc-800 text-4xl font-bold text-white shadow-lg transition-all hover:bg-zinc-700 active:scale-95 active:bg-zinc-700",onTouchStart:()=>r.current=1,onTouchEnd:()=>r.current=0,onMouseDown:()=>r.current=1,onMouseUp:()=>r.current=0,children:"▼ DOWN"})]})})]})}const Gr=1e3,Zr=600,Ha=100,Ll=15,xs=30,Ga=15,hx=6,Nu=3,s0="#f97316",l0="#38bdf8";function T5(){const e=_5(),r=B.useRef(null),[a,s]=B.useState(null),f=Ji(T=>T.phase),g=Ji(T=>T.scores),y=Ji(T=>T.teamAssignments),E=Ji(T=>T.actions),A=B.useRef({paddle1Y:Zr/2-Ha/2,paddle2Y:Zr/2-Ha/2,ballX:Gr/2,ballY:Zr/2,ballVX:Nu,ballVY:Nu,lastTouchedTeam:null}),b=B.useCallback(()=>{const T=A.current;T.ballX=Gr/2,T.ballY=Zr/2,T.ballVX=Nu*(Math.random()>.5?1:-1),T.ballVY=Nu*(Math.random()>.5?1:-1),T.lastTouchedTeam=null},[]);return B.useEffect(()=>{if(a===null||e.gameState!=="playing")return;if(a===0){b(),setTimeout(()=>{s(null)},0);return}const T=setTimeout(()=>{s(a-1)},1e3);return()=>clearTimeout(T)},[a,e.gameState,b]),B.useEffect(()=>{const T=r.current;if(!T)return;const x=T.getContext("2d");if(!x)return;const S=window.devicePixelRatio||1;T.width=Gr*S,T.height=Zr*S,T.style.width=`${Gr}px`,T.style.height=`${Zr}px`,x.scale(S,S);let R;const k=()=>{const I=A.current,z=e.players;e.gameState==="playing"&&f==="playing"&&(z.forEach(Z=>{const H=e.getInput(Z.id),j=y[Z.id];H&&j&&(j==="team1"&&(I.paddle1Y+=H.direction*hx,I.paddle1Y=Math.max(0,Math.min(Zr-Ha,I.paddle1Y))),j==="team2"&&(I.paddle2Y+=H.direction*hx,I.paddle2Y=Math.max(0,Math.min(Zr-Ha,I.paddle2Y))))}),a===null&&(I.ballX+=I.ballVX,I.ballY+=I.ballVY),(I.ballY<=0||I.ballY>=Zr-Ga)&&(I.ballVY*=-1),I.ballX<=xs+Ll&&I.ballX>=xs&&I.ballY+Ga>=I.paddle1Y&&I.ballY<=I.paddle1Y+Ha&&(I.ballVX=Math.abs(I.ballVX),I.lastTouchedTeam="team1"),I.ballX>=Gr-xs-Ll-Ga&&I.ballX<=Gr-xs&&I.ballY+Ga>=I.paddle2Y&&I.ballY<=I.paddle2Y+Ha&&(I.ballVX=-Math.abs(I.ballVX),I.lastTouchedTeam="team2"),a===null&&(I.ballX<=0&&(E.scorePoint("team2"),s(3)),I.ballX>=Gr-Ga&&(E.scorePoint("team1"),s(3)))),x.fillStyle="#000",x.fillRect(0,0,Gr,Zr),x.fillStyle=s0,x.fillRect(xs,I.paddle1Y,Ll,Ha),x.fillStyle=l0,x.fillRect(Gr-xs-Ll,I.paddle2Y,Ll,Ha),x.fillStyle=I.lastTouchedTeam==="team1"?s0:I.lastTouchedTeam==="team2"?l0:"#fff",x.beginPath(),x.arc(I.ballX+Ga/2,I.ballY+Ga/2,Ga/2,0,Math.PI*2),x.fill(),x.setLineDash([5,15]),x.beginPath(),x.moveTo(Gr/2,0),x.lineTo(Gr/2,Zr),x.strokeStyle="#333",x.stroke(),a!==null&&(x.fillStyle="#fff",x.font="bold 120px Arial",x.textAlign="center",x.textBaseline="middle",x.fillText(a.toString(),Gr/2,Zr/2)),R=requestAnimationFrame(k)};return k(),()=>cancelAnimationFrame(R)},[e,b,a,f,y,E]),F.jsxs(F.Fragment,{children:[F.jsx(K4,{roomId:e.roomId,joinUrl:e.joinUrl,connectionStatus:e.connectionStatus,players:e.players,lastError:e.lastError,gameState:e.gameState,onTogglePlayPause:e.toggleGameState,isChildMode:e.isChildMode}),F.jsx("div",{className:"fixed top-20 right-4 z-50",children:F.jsx(Qy,{state:Ji(T=>T),title:"Pong Game State"})}),F.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center bg-zinc-900 p-4",children:[F.jsxs("div",{className:"mb-4 flex items-center gap-2 text-2xl font-bold",children:[F.jsx("span",{style:{color:s0},children:g.team1}),F.jsx("span",{className:"text-white",children:"-"}),F.jsx("span",{style:{color:l0},children:g.team2})]}),f==="lobby"&&F.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center bg-black/80",children:[F.jsx("h2",{className:"mb-4 text-4xl font-bold text-white",children:"Waiting for players..."}),F.jsx("button",{onClick:()=>E.setPhase("playing"),className:"rounded-lg bg-blue-500 px-8 py-4 text-2xl font-bold text-white hover:bg-blue-600",children:"START GAME"})]}),F.jsx("canvas",{ref:r,className:"rounded-lg border-2 border-white"})]})]})}const R5=si({direction:cw().min(-1).max(1),action:IN()});function N5(){return F.jsx(AE,{controllerPath:"/joypad",input:{schema:R5,latch:{booleanFields:["action"]}},children:F.jsxs(U_,{children:[F.jsx(u0,{path:"/",element:F.jsx(T5,{})}),F.jsx(u0,{path:"/joypad",element:F.jsx(S5,{})})]})})}jb.createRoot(document.getElementById("root")).render(F.jsx(B.StrictMode,{children:F.jsx(c3,{children:F.jsx(N5,{})})}));
|